From edadf44577a1e3e69a19032fe84385efb1c2f6c4 Mon Sep 17 00:00:00 2001 From: Archer Date: Mon, 26 Oct 2026 14:43:02 +0000 Subject: [PATCH] =?UTF-8?q?docs(aggregator):=20README=20=E2=80=94=20snapsh?= =?UTF-8?q?ot=20writers=20(=C2=A74)=20alongside=20the=20backfill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pm-stack/aggregator/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pm-stack/aggregator/README.md b/pm-stack/aggregator/README.md index 28037a1c5d..7617b4fb4f 100644 --- a/pm-stack/aggregator/README.md +++ b/pm-stack/aggregator/README.md @@ -245,6 +245,18 @@ a file. `scripts/collect-fleet-feed.ts` runs on the sandbox: from the §4 store; older feeds without the sections fall back to a direct read of the two source documents. Seed the store once with `bun run scripts/backfill-usage-snapshots.ts` (idempotent). +- **Snapshot writers (hub §4)** — history accumulates three ways, all + riding the feed: the collector derives records from its own hub + sections (`src/snapshot-records.ts`) and embeds them in the feed's + `snapshots` field; stewardship-cycle (after a quota-view refresh) + and the keeper's check-usage append records to + `usage-snapshot-outbox.jsonl` beside the keeper state — via + `bun run scripts/append-usage-snapshots.ts` (add + `--from-provider-usage` for the keeper snapshot) or, for + check-usage, from Python directly — and the collector drains the + outbox into the same field. `Source.usage()` ingests feed records + into the local store; dedupe on (service, metric, timestamp, value) + makes every writer safe to re-run. - **Sandbox attention** — sessions mapped by the shared OpenCode v2 mapper (`src/sources/opencode.ts`), stamped `opencode-sandbox` with parent/agent/outcome; keeper supervision entries from