Process watch report (orchestrator skill)
The orchestration is a script now: pnpm run pipeline:nightly. It runs the watcher,
plans from state (state/watch/* vs state/ingest/*, so a multi-day gap never misses an
intermediate change), runs every due script handler with timed, logged steps, applies the
gates and post-steps, commits by explicit pathspec, writes the upload manifest, and publishes
when the publish gate passes. This skill is the agent wrapper around it. It covers what a
script cannot do: the delegated handlers, and reading the failure packets.
What runs for which source is in the registry (scripts/pipeline/registry/), rendered as
docs/pipeline-handlers.md. This skill no longer
carries a source → skill table. If you need to know what a source does, read that page or run
pnpm run pipeline:plan. Design and history: docs/plans/watch-pipeline-scripts-v1.md.
Procedure
- Check the machine. Run
pnpm run pipeline:doctor. It reports egress (BG or not),
local Postgres, the Cloud SQL proxy, binaries and drives. A handler whose needs are unmet
is blocked, not failed. Fix what you can (pnpm run db:pg:up, `pnpm run
db:proxy:cloud`). The VPN is the operator's to flip; never change it yourself.
- Run it. Use
pnpm run pipeline:nightlyfor the whole chain (--no-publishstops
after the ingest commit, leaving the manifest for pipeline:publish). If the watcher
already ran today, use pnpm run pipeline:ingest --publish instead. A run takes hours,
longer than any foreground tool timeout, and a background shell dies with the session
that started it — so from an agent, launch it DETACHED (the setsid command below) and
wait with pnpm run pipeline:wait --newer-than <launch time> (Bash timeout 600000). It
returns within ~9 min: exit 0 = finished (prints the run's final line and report path),
**75 = still running — call it again with the --session it printed; never end the turn
on a 75**, 3 = the run was killed. Do not wait with a Monitor watch: one expires on its
own, and the 2026-11-19 routine ended its turn on that expiry with the run still going.
It stops rather than continues
when something critical happens:
- preflight (the doctor runs first): git mid-rebase/merge or off
main, low disk
(repo volume < 10 GB, Docker VM < 8 GB), or local Postgres down AFTER the run tried
pnpm run db:pg:up itself (the container has been found removed after Docker
restarts; its data is in the data-bg_pgdata volume, so recreating it loses nothing)
— nothing runs, exit 3;
- the watcher crashes or times out — nothing is ingested, exit 5. Per-source watcher
errors are NOT critical: they are listed as findings (a streak of 3+ marks the
watcher unit partial) and the ingest runs on what the watcher found;
- mid-ingest, a step failing with an environment class (
db-local-down,disk,
db-auth) aborts every later handler and holds the publish — unless the environment
answers again 10 s later (a restarted container), which is recorded as a transient
blip and the run goes on. A dropped connection in a step pinned to the LOCAL
database is db-local-down, not proxy-down;
- any handler failure holds the publish.
| exit | meaning |
| --- | --- |
| 0 | clean or degraded (only operator/agent items left) |
| 1 | a handler or post-step failed |
| 2 | the runner itself crashed (the report still exists; its runner unit has the stack) |
| 3 | another run holds the lock, or preflight refused |
| 4 | the ingest was fine, but the publish was held or failed |
| 5 | the watcher failed |
| 130 | interrupted (Ctrl-C/SIGTERM/SIGHUP) during the watcher |
Every exit path writes state/pipeline/runs/<session>/report.md — preflight refusal and
crashes included — and prints its path last. Two exceptions: a run refused by the lock
(read the holder's run instead) and a second Ctrl-C, which kills the running steps and
exits at once. A preflight refusal caused by git (mid-rebase, off main) writes its
report but does not commit it.
A run killed outright (SIGKILL, the session that launched it ending, a reboot)
cannot write its report. The next nightly names it in its findings — session, phase,
the step it died in — from the dead run's status.json. To launch a run that outlives
the terminal or agent session that starts it, detach it from that process group:
perl -MPOSIX -e 'setsid; exec @ARGV' pnpm run pipeline:nightly > /tmp/nightly.out 2>&1 &.
Watching a live run. The first line printed is the live log:
tail -f logs/pipeline/<session>/run.log (logs/pipeline/LATEST names the current
session). One timestamped line per event: each phase, each step's start (command, log
file, usual duration) and end (status, exit, duration, first error), a heartbeat every
5 min while a step runs (flagged when over 2× its usual time), and every orchestrator
decision. status.json beside it is rewritten on every event and every minute: the
phase, the step running now and for how long, counts so far, the last step. Each step's
full output is logs/pipeline/<session>/<seq>-<step>.log. On macOS a desktop
notification carries the final exit code.
- Read the report. Run
pnpm run pipeline:report(or open
state/pipeline/runs/<session>/report.md). Its sections, in order: Verdict, Failures,
Needs operator, Needs agent, What ran, Findings. --json gives run.json. Under
nightly, the first unit is watcher (its source counts and any standing streak) and
the Publish decision section says what the publish did, with a link to its own report.
- Failures: open the packet, don't re-derive. Each failed step has
state/pipeline/runs/<session>/failures/<seq>-<step-id>.md, and a unit failed by a
gate (every step ok, result refused) has <seq>-<step-id>-gate.md (the report links
each one). It holds:
- the exact command;
- the log tail;
- the failure class;
- the matching known-failure advice;
- the handler's Never rules;
- what a fix must not break.
Fix the cause, re-run just that handler with pnpm run pipeline:ingest --only <handler>,
and confirm its verdict. A class of env (egress, PG down, proxy) is a machine problem,
not a code one: say so and stop. Before calling a red test:data file a regression,
re-run it alone; the executor already does this for vitest and records the result.
- Needs agent — the delegated handlers. Each item names a skill and the steps the plan
would run. Why the handler is still delegated is a comment on its entry in
scripts/pipeline/registry/handlers/. Invoke that skill (Skill(update-…)) and pass on the unattended contract below.
The skill stamps its own marker. Then publish what it produced with /upload-watch-changes
(which runs pnpm run pipeline:publish). Do one handler at a time, in the order listed.
- Needs operator. These are listed, not done:
- manual downloads;
- pastes;
- judgement calls.
Each item has its instruction, URL, drop path and age. An item with a file done-check
resolves itself once the file lands. Otherwise, once the operator has acted, run
pnpm run pipeline:ack <handler> <step>. An ack covers only changes before it.
- Summarise for the user. Include:
- the verdict;
- what was ingested and published;
- each failure with its packet path and what you did about it;
- the Needs operator list.
Unattended mode (the nightly routine)
When the args contain unattended, nobody is at the keyboard. Every planned ingest and
the publish after it are pre-approved, so:
- Do not wait or ask. Run the procedure above straight through.
- Pass the contract on to every delegated skill. Put this in each
Skillcall's args:
`"unattended nightly run from /process-watch-report — do not ask; take the documented
default at every prompt; skip any step that needs human judgment and report it"`.
- Skip and report human-judgment steps; never guess them. A skill whose automated part
succeeded counts as partial. Stamp it only if that skill's own rules say the automated
part is complete; otherwise leave it unstamped, so the next run queues it again.
- Handle a failure by skipping it and continuing. Record it, leave that handler unstamped,
and go on to the next. A failure never halts the night.
- Never run anything destructive or outward-facing beyond the documented publish. That
includes db:sync:cloud, --clean, a deploy, or a hand-run apply_functions.ts against
Cloud SQL. Those wait for a human.
Appendix: the manual procedure
Everything below is the procedure this skill ran before the pipeline existed. Keep it for
two cases:
- running a delegated handler's skill by hand;
- recovering when the pipeline itself is broken (say so in the summary if you use it).
Where it says to consult the source → skill mapping, use pnpm run pipeline:plan or
docs/pipeline-handlers.md. The performance trace is the same: the pipeline writes the same
state/perf/*.jsonl rows itself.
Performance trace — EVERY step is timed
This orchestrator is the longest-running thing in the repo: a single run can invoke a
dozen ingest skills and then a db:refresh that is a 75-link && chain. Until 2026-08-29
none of it was measured, so "the run took four hours" was the only fact available and it
names nothing to fix.
So every step this skill takes is timed and appended to a durable trace:
state/perf/process-watch-report.jsonl ← this skill
state/perf/upload-watch-changes.jsonl ← /upload-watch-changes (the publish half)
APPEND-ONLY, and committed. One JSONL row per step, one session per orchestrator
invocation. The point is the HISTORY, not this run: a step is only diagnosable against its
own past durations, so the file is never truncated and never gitignored (a per-machine log
would be empty on the machine that later does the optimisation work — which is why the
extension is .jsonl and not .log, the latter being covered by .gitignore).
The three commands
# once, at the very top of the run — every step below carries this id.
# ⚠️ PASTE THE PRINTED ID into each later command. `$S` below is shorthand: a shell
# variable does NOT survive between tool calls, and `--session ""` files rows under a
# blank session that no rollup can group.
pnpm run -s perf:step -- session
# a shell command: measured exactly, exit code propagated (so `&&` still works)
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "myarea:alerts" --phase derive -- pnpm run myarea:alerts
# an `&&`-chain package script: ONE ROW PER LINK, plus a whole-chain total
pnpm run -s perf:chain -- db:refresh --session "$S" --phase ingest
# something this process did not run — a Skill invocation, a manual wait
date -u +%FT%TZ # before — read the stamp; it does not survive the tool call
# … Skill(update-procurement) …
pnpm run -s perf:step -- record --run process-watch-report --session "$S" \
--step "update-procurement" --phase ingest --started 2026-08-29T05:12:33Z --status ok \
--notes "3 210 new contracts"
# read the trace back (also step 10 below)
pnpm run -s perf:report --run process-watch-report --last 5
Four rules, each of which is a way the trace goes quietly WRONG rather than absent — and a
wrong duration is worse than a missing one, because it sends the optimisation work to the
wrong step:
- ⚠️ Never wrap a chain in
perf:step run.pnpm run db:refreshunderperf:stepyields
ONE number for 75 links, which answers "was it slow" and nothing about WHERE — and "where"
is the entire question when the chain is an hour long. Use perf:chain, which reads the
chain text out of package.json (so it cannot drift from what pnpm run would have done),
runs each link through sh -c in order, and aborts on the first non-zero exit exactly as
&& does. Same applies to tr:daily-refresh (8 links).
- ⚠️
--steplabels are compared ACROSS sessions, so keep them deterministic. No dates,
no counts, no row totals in the label — those go in --notes. A label that changes per run
makes every run look like a first run and the per-step history never accumulates.
- ⚠️ Record a SKIPPED step rather than omitting it.
--status skippedwith a--notes
reason. An unmeasured step and a fast step are indistinguishable in the trace, and a step
skipped four runs in five is exactly the one whose real cost gets forgotten.
- A failed step is still a step.
perf:step runrecords the non-zero exit and then
propagates it; do not swallow the row when the orchestrator halts. Aborted runs are the
most interesting rows in the file.
phase is the coarse grouping — plan | ingest | derive | verify | publish |
commit. Use it consistently; it is what lets a later analysis say "the derive block is
40% of the run" without re-classifying every step by hand.
Reading the trace
pnpm run perf:report prints two views, and the second is the worklist:
- Last N sessions — total work and that session's five slowest steps.
- Cost by step, ranked by TOTAL across all sessions. Ranked by total rather than by
median on purpose: a 4 s step that runs sixty times costs more than a 90 s step that runs
once, and the cheapest win is usually the one that repeats.
⚠️ A session's total is the sum of its steps' own durations, never end − start. The
gap between two steps is the agent thinking, or the operator answering a prompt, or a manual
download — real wall-clock, but not work this pipeline can attribute or optimise. Reporting
it as "the run took X" would credit the pipeline with time it never spent.
Procedure
Step 0 — read "Manual downloads needed" first
The daily report may open with a ## Manual downloads needed section. It sits above
## Changed because a missing input blocks its ingest entirely — there is nothing to run
even when the upstream moved.
Surface every entry to the user before invoking anything, and **do not invoke a skill whose
input is still missing**. Report it as skipped and leave that skill's marker untouched:
these skills mostly skip-and-warn on an absent input and exit 0, so running one stamps
lastSuccessfulIngest over the gap and the orchestrator stops queueing the work. The
request itself is disk-derived and keeps firing — what a wrong stamp suppresses is the
ACTION, not the report line, which is why this goes unnoticed.
A source whose skill has a shared marker needs its own. state/ingest/update-budget.json
backs ~13 sources, so it is stamped whenever any of them fires; a sub-step waiting on a manual
download must key on its own marker or the wait is masked by unrelated activity.
A source can appear in BOTH this section and ## Changed — they answer different questions
("someone must fetch something" vs "an upstream moved"). The manual entry wins: fetch
first, then re-run the orchestrator.
- Open the trace, then enumerate state. The FIRST command of the run mints the session
id every later step carries — do it before anything else, because a step recorded under a
fresh id is a step that vanishes from this run's rollup:
```bash
pnpm run -s perf:step -- session
```
⚠️⚠️ SUBSTITUTE THE LITERAL ID INTO EVERY LATER COMMAND. Each Bash tool call is a fresh
shell, so S=$(…) set in one call is EMPTY in the next and --session "" files the row under
a blank session no rollup can group. $S in the examples means "paste what this printed"
(--session 20260829T051233Z-a1b2). Mint it ONCE — a second session call starts a second
run as far as every report is concerned.
Lost it? Read it back rather than minting a new one:
tail -1 state/perf/process-watch-report.jsonl | jq -r .session.
Then inspect both state directories via Bash. Each watcher source has lastChanged; each ingested skill has lastSuccessfulIngest.
```bash
# Watcher state — one per source (_-prefixed files such as
# _health.json are runner bookkeeping, not sources: skip them)
for f in state/watch/*.json; do
case "$(basename "$f")" in _*) continue ;; esac
jq -r --arg name "$f" '"\($name) lastChanged=\(.lastChanged // "?")"' "$f"
done
# Ingest markers — one per skill (may be empty on first run)
for f in state/ingest/*.json; do
[ "$f" = "state/ingest/.gitkeep" ] && continue
jq -r --arg name "$f" '"\($name) skill=\(.skill) lastSuccessfulIngest=\(.lastSuccessfulIngest)"' "$f"
done
```
Performance note (measured 2026-07-16): the two for-loops above spawn one jq per file (~169 processes, ~1.4 s wall). A single batched pass per directory is ~35–80× faster (~0.02 s) and folds the enumerate→map→queue step (2) into one join — reach for it on a large state dir:
```bash
# Watcher state as one object: {id: lastChanged}
jq -n 'reduce inputs as $x ({}; ($x|input_filename|sub("./";"")|sub(".json$";"")) as $id | if ($id|startswith("_")) then . else . + {($id): ($x.lastChanged)} end)' state/watch/.json
# Ingest markers as one object: {skill: lastSuccessfulIngest}
jq -n 'reduce inputs as $x ({}; . + {($x|input_filename|sub("./";"")|sub(".json$";"")): ($x.lastSuccessfulIngest)})' state/ingest/.json
```
The input_filename-keyed reduce is the load-bearing trick — one jq -n … inputs reads every file in a single process instead of for f … jq "$f".
- Build the work queue. For each watcher source:
- Look up its mapped skill in the table above. If no mapping, log it as "skipped — no handler" and move on.
- Read the mapped skill's
state/ingest/<skill>.json: - Missing marker (skill never stamped) → queue the skill AND flag "first-run bootstrap"; see "Bootstrap" below before invoking.
lastChanged > lastSuccessfulIngest→ queue the skill.lastChanged <= lastSuccessfulIngest→ skip (already ingested this change).
Dedupe the queue: if cacbg_declarations and bgpost_postcodes both flag update-connections, queue it once. Preserve the watcher-source-order so the user sees a stable plan.
- Confirm the plan with the user before doing destructive work. Print which sources triggered which skills and the estimated work. Example:
> Plan for orchestrator run:
>
> - update-macro ← eurostat (changed 2026-05-09, last ingest 2026-05-07) — ~30s
> - update-financing ← smetna_palata (changed 2026-05-11, never ingested) — first run, ~10s
> - then /upload-watch-changes publishes the result (bucket + Cloud SQL) — withheld
> automatically if anything above fails; say "hold the publish" to keep it manual.
> Proceed?
Wait for user confirmation (or proceed automatically if they already said "go" / "run all" / "yes proceed", or the args contain unattended — see "Unattended mode"). If the queue is empty, print "Nothing to ingest — every changed source has already been processed since its last change" and stop.
The "yes" here covers the publish. Step 14 invokes /upload-watch-changes on the
strength of this confirmation, and that skill does not re-ask when the orchestrator hands it
a clean run — so the plan MUST name the publish, every time. A "hold the publish" / "don't
upload" answer is remembered for step 12's gate: the manifest is still written, only the
invocation is withheld.
- Invoke each skill in sequence — and time each one. Use the
Skilltool, one skill at a
time. Don't parallelise — they can conflict on data/ writes. Capture each invocation's actual
stdout (counts, file paths, status) for the final summary. Do NOT paraphrase as "done" — quote
specifics.
A Skill call is not a shell command, so it cannot be wrapped by perf:step run. Bracket it
instead — capture the clock immediately BEFORE the invocation and record immediately after:
```bash
date -u +%FT%TZ # ← run this, READ the output, then invoke the Skill
```
⚠️ Same rule as the session id: T0=$(date +%s) would be gone by the next tool call. Read the
printed stamp and paste it literally (--started 2026-08-29T05:12:33Z); --started accepts an
ISO stamp or epoch seconds. If the start time is lost entirely, use --seconds <n> with your
own estimate and say in --notes that it is estimated — an honest estimate beats a hole, and a
hole reads as "fast" for ever.
```bash
pnpm run -s perf:step -- record --run process-watch-report --session "$S" \
--step "update-procurement" --phase ingest --started "$T0" --status ok \
--notes "3 210 new contracts, 41 new tenders"
```
⚠️ --step is the SKILL NAME and nothing else — no date, no count. It is the key the
per-step history joins on across sessions; a label carrying today's numbers makes every run
look like a first run. The counts belong in --notes, which is free text.
A skill that ran and found nothing still gets a row (--status ok, notes "no new data"); a
skill that was queued and then NOT run gets --status skipped with the reason. Omitting either
makes an unmeasured step indistinguishable from a fast one.
Before the next invocation, run git diff --stat data/ to capture what physically changed on disk vs. what the skill claims. The diff is truth; skill output is narration.
A skill whose body is an &&-chain is worth expanding. update-procurement ends in
db:refresh (75 links) and tr-daily-refresh is itself 8 links. When a skill's own procedure
tells you to run one of those, run it as pnpm run -s perf:chain -- <script> --session "$S"
instead of pnpm run <script>: identical semantics, one trace row per link. That is where the
hours are, and a single row for the whole chain names nothing to fix.
- Stamp success. After each skill completes without error, run:
```bash
pnpm exec tsx scripts/stamp-ingest.ts <skill-name> --summary "<one-line recap>"
```
This writes state/ingest/<skill>.json with lastSuccessfulIngest = now. If the skill threw, do NOT stamp — the orchestrator's halt-on-error rule below applies.
The summary should reflect what was actually ingested (e.g. "2 new sessions through 2026-05-10" for rollcall, "15 years tracked, 0 net change" for financing). It lives in the marker file and shows up in git log -p state/ingest/.
Then append a row to the public data-changes log — but only when data actually changed. The /data-changes SPA page is for readers, not auditors; it should list substantive refreshes, not bootstrap stamps or fetchedAt-only churn. Use git diff --stat data/ (the truth) as the gate:
```bash
# If the skill actually wrote new/changed bytes under data/, append.
# If the diff is empty (or only metadata files moved), skip.
if [ -n "$(git diff --stat data/)" ]; then
pnpm exec tsx scripts/append-data-change.ts <skill-name> \
--summary "<same one-line recap>" \
--source "<upstream label, e.g. 'Eurostat macro (BG)'>"
fi
```
Use the same --summary text as the stamp — keeping the two in sync means git log -p state/ingest/ and the public page tell the same story. The script is also defensive: it auto-skips when the summary matches no-op patterns (bootstrap:, unchanged, no data changes, only fetchedAt diff, timestamp-only diff, no run), so a stray call won't pollute the page — but git diff --stat is the cleaner upstream gate.
PG-only ingests that self-report — skip the generic append for these. A Postgres-only skill writes nothing (or only a tiny artifact like product_slugs.json) under data/, so git diff --stat data/ is empty and this gate would silently drop it — e.g. update-prices was the single most-frequent /data/updates entry, and going Postgres-only would have taken it to zero. Those skills instead call appendDataChange from inside the ingest, based on the rows they actually loaded. Do NOT run scripts/append-data-change.ts for them — the ingest already did. Currently self-reporting: update-prices (scripts/prices/ingest.ts), update-persons (resolve_persons.ts), update-nzok (load_nzok_hospital_pg.ts) and update-fuel (fetch_fuel.ts).
⚠️ A self-reporting ingest runs TWICE per publish cycle, and it used to report twice. The :cloud twin is the same script with DATABASE_URL pointed at the Cloud SQL proxy — prices:ingest:cloud is literally pnpm run prices, db:load:agri:pg:cloud is literally pnpm run db:load:agri:pg — so the code that ingested the data locally runs again to publish it. dedupeSameDay keys on the calendar date, and the pair straddles UTC midnight often enough that ONE refresh was published as two days of activity three times: 2026-07-28, 2026-08-28 and 2026-08-31 (the last caught by hand, the first two shipped and were removed by the fix). Two things now stop it, both central so a new self-reporter inherits them:
appendDataChangerefuses any append made while pointed at the serving database — a publish is not a data change. Nothing to add per script.- prefer
dedupeKeyoverdedupeSameDay: a stable identity for the DATA the row describes (for prices, the loaded price day), deduped across the whole log with no time window. Reach fordedupeSameDayonly when the row legitimately recurs every run with no data day to key on (resolve_personsre-derives the whole person layer daily).
Three tempting alternatives that do NOT work, all measured against the committed log: a wider dedupe window (24/48 h) swallows genuine consecutive-day refreshes, and prices publishes daily; the wall-clock date is the bug itself; and summary equality misses it whenever the cloud database was further behind and loaded a different number of archives ("+2 daily archives" vs "+1") — which is exactly the shape of the 2026-07-28 pair. Gate: scripts/lib/data-changes.test.ts.
(update-agri is also PG-only and does NOT yet self-report — its /data/updates history is a known gap; add the same appendDataChange call to scripts/agri/ingest.ts when convenient, with a dedupeKey naming the financial year or corpus vintage it loaded. It needs no other change: the publish guard already covers db:load:agri:pg:cloud.)
- Final post-step: rebuild the My-Area alerts feed. After every queued skill has run (or the queue was empty), unconditionally run:
```bash
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "myarea:alerts" --phase derive -- pnpm run myarea:alerts
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "myarea:alerts:cloud" --phase publish -- pnpm run myarea:alerts:cloud
```
⚠️ BOTH lines, and the second is not optional. Since json-retirement-v2 Tier 4b the feed is stored in Postgres (myarea_alerts, migration 184) rather than written as 290 files under data/myarea/alerts/ — so a local-only run leaves prod serving the previous vintage at a 200, with git diff --stat data/ empty and nothing red anywhere. This is the same class as the C1 rollcall gap: the local half looks like a complete run. The builder composes the events in TypeScript (they carry bilingual prose) and only the storage moved; 184's header has the reasoning.
The script materialises the per-município "Последна активност" feed (the myarea_alerts table) from already-ingested data — council resolutions, procurement (now tagged announced / awarded / annex via the rollups' tag), EU-fund contracts plus snapshot-diff new/modified projects (from data/funds/projects/changes/, dated by the real detection day), capital programmes, local elections, plenary keyword hits. It's cheap (<5 s) and its output is a function of whatever's now in data/, so running it last keeps the feed in sync with whatever the orchestrator just changed. Because update-funds writes the EU changes/ artifact _inside_ its own run (before this post-step), the new/modified EU events are already on disk when this runs. Don't stamp this as a separate skill — it's a derived rebuild, not an upstream ingest.
Specifically do NOT append for:
- Bootstrap stamps (option (a) from "Bootstrap" above —
"bootstrap: marker seeded, no run"). - Skills that ran but produced no on-disk data diff (e.g. macro where every series is current).
- Watcher-fingerprint flips that were chrome-only (financing's
subsidiipage churn, etc.).
Re-seed (rarely): if you ever need to rebuild data/data-changes.json from current state/ingest/*.json markers, run pnpm exec tsx scripts/seed-data-changes.ts. The seeder applies the same no-op filter, so it's safe to re-run.
- Final post-step: refresh the data map. After the alerts feed, unconditionally run:
```bash
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "data:map" --phase derive -- pnpm run data:map
```
This rebuilds data/data_map.json — the /data map manifest — baking the latest per-source freshness from state/watch and reflecting the watched-sources registry. Like the alerts feed it's a derived rebuild (a function of what's now in data/ + the registry), not an upstream ingest, so don't stamp it as a skill. The write is churn-free: if nothing but the generatedAt stamp would change, the file is left untouched, so a quiet day produces no diff. The manifest lives under data/, so it ships to the live SPA via the same bucket:sync below — no Firebase site deploy is needed to refresh the map.
7b. Final post-step: rebuild the HOME dashboard's artifacts. After the data map and
before the artifact check below (which verifies these reached the bucket), unconditionally
run the four generators and the health check:
```bash
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "db:gen-home-hub-stats" --phase derive -- pnpm run db:gen-home-hub-stats
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "db:gen-home-flyover" --phase derive -- pnpm run db:gen-home-flyover
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "db:gen-home-price-events" --phase derive -- pnpm run db:gen-home-price-events
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "db:gen-home-feed" --phase derive -- pnpm run db:gen-home-feed
pnpm run -s perf:step -- run --run process-watch-report --session "$S" \
--step "home:health" --phase verify -- pnpm run home:health
```
Then record home in state/upload/pending.json alongside the other touched subtrees, so
/upload-watch-changes publishes it. ⚠️ Note in the manifest that the home subtree needs
pnpm run bucket:gz after its sync — / is the entry page and a bucket:sync:paths reverts
the stored gzip on both blobs. pnpm run home:publish is that pair as one command, for an
operator working by hand.
Unconditional, and ONCE per run: nine source families feed the home feed, so a per-source
mapping would run these up to nine times, each fold catching whichever siblings had not yet
finished. The full reasoning, the ordering constraints and what to do when home:health goes
red are in „The home dashboard — ONE generation step, at the END of the run" above and in