You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AA explorer: dataset version switcher — browse older AA import batches, not just latest #3302
Drew's order (2026-10-31): the /aa explorer should let him switch between AA dataset versions (import batches) to compare — e.g. the current v5 data vs earlier vintages — instead of only ever showing the newest.
Current state (verified 2026-10-31):
The collector's AA payload (pm-stack/aggregator/scripts/collect-fleet-feed.ts) is hardwired to ainventory.v_latest_workbook_batch — every query filters import_batch = (select import_batch from ainventory.v_latest_workbook_batch). The payload carries the batch id (aa.ts raw.batch) but only ONE batch is ever emitted.
ainventory.ingest_batches holds the batch register (id, source_kind, source_ref, ran_at, inserted_counts). Caveat: many rows are Model data pipeline: workbook-free append-only event log + agent interpretation #1248 Phase-1 backfill carriers re-importing the same 2026-10-21 workbook (identical 62 measurement events under different ran_at dates) — a raw batch list would show near-duplicates.
Build:
Batch index: the collector emits the list of available batches with human labels (ran_at date + short source_ref + inserted counts), collapsing carrier duplicates that carry identical content (same source_ref + identical inserted_counts + identical payload where cheaply checkable) into one selectable entry.
Per-batch payloads: /api/aa.json serves the selected batch (?batch=<id>); default remains the latest batch (today's behavior). Keep collector cost sane — a batch's payload only needs rebuilding when that batch is newest or newly imported; historical payloads can be built once and cached as files beside the feed.
UI selector on /aa: a dataset-version control (visible on both tabs) listing the labeled batches, newest first, with the ACTIVE batch labeled on the page and reflected in downloads (a download taken while viewing batch X contains batch X's data). Switching swaps the entire explorer dataset — charts, tables, recommendations, both perspectives.
Selector present on /aa; choosing an older batch visibly changes the data (verify with a batch whose counts differ) and the page labels which batch is active.
Default load = latest batch, byte-identical behavior to today.
Downloads follow the selected batch.
Verified live on the laptop aggregator after deploy from the primary clone.
agent-note:v1
event: picked-up
task: 4924 (repo-health-code-pilot, OpenChamber scheduled lane)
state: claimed
verified: #3302 is OPEN; no hard-stop labels; no open PR matching #3302 and no existing queue/4924 or #3302 branch found in the primary clone. Existing scope is the AA batch selector/cached per-batch payload implementation.
next: refresh and fast-forward ~/git/code main, create or resume /home/user/git/fleet/task-4924 on queue/4924-3302-aa-dataset-version-switcher, then inspect the current code and investigate issue-specific assumptions.
agent-note:v1
event: blocked
task: 4924 (repo-health-code-pilot, OpenChamber scheduled lane)
state: blocked — packet_defect
verified: the packet says the collector filters on ainventory.v_latest_workbook_batch and names ainventory.ingest_batches, but current code at pm-stack/aggregator/scripts/collect-fleet-feed.ts:289-483 uses ainventory.v_latest_import_batch and has no references to either packet name. The collector currently builds/caches only the latest batch (aa-last-good.json); the authoritative historical batch source/view and metadata columns are not specified in this checkout. I did not guess the database schema.
checks: baseline cd pm-stack/aggregator && bun test test/aa.test.ts — 24 pass, 0 fail; no feature changes.
resume: correct the packet with a verified historical source/view and exact fields plus caching semantics, then revalidate issue and PR state and resume on the clean branch/worktree.
The cancellation's absence claim was wrong. Both ainventory.v_latest_workbook_batch and ainventory.ingest_batches exist in the live DB. Current code uses v_latest_import_batch, whose live view definition is identical to v_latest_workbook_batch.
Correct source of selectable batches:ainventory.sources WHERE kind='drive-workbook', keyed by import_batch, with name, imported_at, and drive_modified_at. There are 19 workbook source entries observed; recent entries do not have matching ingest_batches rows, so that table cannot be the sole index. Live data has different batch contents/counts (e.g. sheet rows 4,493 vs 4,100; benchmark rows 62 vs 87).
Important query trap:v_rankings and v_threshold_metrics each choose v_latest_workbook_batch internally. Filtering only the outer AA_SQL is insufficient; their calculations must be parameterized/recreated for the selected batch while preserving current latest math.
No PR or code work exists. The feature remains live; the packet now captures the verified schema, per-batch cache, dedupe rule, selector/API/download behavior, and explicit treatment of globally current prices.
Task 4924 was requeued under the same dedupe key with corrected scope. Task 6870 completes as triaged with follow_up_task_ids=[4924].
agent-note:v1
event: picked-up
task: 12631 (repo-health-code-pilot, OpenChamber scheduled lane aea12c82)
state: claimed → implementation complete, PR #7564 at af4b7d1
verified: #3302 OPEN, no hard-stop labels. PR #7564 OPEN, head af4b7d1 (merge of origin/main), MERGEABLE.
what changed: four Codex P2 findings on #7564 triaged.
fixed 82b77ad — the historical-build budget is consumed before each fetch, so a failing batch counts and an outage cannot become unbounded 60 s queries.
fixed 82b77ad — last-good AA payload is rewritten after the batch index exists, so a later transient failure still offers every cached version.
fixed 6f5a3e2 — a cached historical payload invalidated by an opencode config change is served stale (with reason) instead of passing as ordinary success; new test pins it.
deferred → aggregator(aa-explorer): cached historical AA batches freeze the v_current_prices overlay — version switching silently switches token rates #8211 (filed and enqueued): cached batches freeze the batch-independent v_current_prices overlay, so version switching switches token rates while the page calls it current.
tests: cd pm-stack/aggregator && PM_AGG_PORT=14870 PM_AGG_FRESHNESS_PORT=14871 bun test test/aa.test.ts test/aa-batches.test.ts — 59 pass, 0 fail (after merging current origin/main).
ci: basic-tier failures on this PR are pre-existing main breakage, proven on clean main: scripts-test bitwarden tests fail identically on main (8 tests, 2 failures 5 errors), and .github/scripts/check-fleet-search-parity.test.sh exits 1 with the same diff on main; the pm-stack 5 failing tests are also in main-tier run 42621208851.
next: watch checks, merge on green modulo the proven pre-existing failures, or park with this note if the shift ends first.
agent-note:v1
event: parked
task: 12631 (repo-health-code-pilot, OpenChamber scheduled lane aea12c82)
state: parked 20 min — CI pending on PR #7564
artifact: PR #7564, head af4b7d1 (merge of origin/main into queue/12631-3302-aa-batch-versioning), MERGEABLE; worktree ~/git/fleet/12631-3302-aa-batch-versioning
verified: #3302 OPEN; three Codex findings fixed and pushed (82b77ad, 6f5a3e2); finding 4 deferred to #8211 (filed + enqueued); targeted tests 59 pass 0 fail
ci: all basic-tier checks and the pm-stack full job were still queued at park time (runner backlog, not failures of this diff). Known pre-existing main failures unaffected by this PR: scripts-test bitwarden tests, fleet-search parity guard, and 5 pm-stack tests — all reproduce on clean main.
resume: read PR/check state fresh; merge when the diff's own checks are green, treating only the proven pre-existing failures as ignorable; close #3302 with the merge SHA.
Plan: verify PR feat(aggregator): browse historical AA dataset batches #7564 fresh (diff vs intent, Codex findings, conflicts), run the aggregator AA tests on the laptop, and merge + complete when verified — or park as a CI wait if verification cannot complete.
Done — fixed_merged (lane code-y, task 12631, resume of the prior attempt's PR).
PR #7564 MERGED 2026-11-10T21:09:40Z, merge commit 02d20c012d1a70bc1f241ca4160a499a1580e02f. The AA explorer dataset version switcher ships as built by the prior attempt; this pass finished the Codex gate (§5) — all four P2 findings from the 2026-11-08 review are fixed and dispositioned on their threads:
Failed historical fetches now count toward the per-tick build budget (82b77ad37e).
The reader serves config-invalidated cached versions as stale with a reason, never as ordinary success (6f5a3e29be).
The batch index is persisted into the last-good section, so degraded mode keeps the selector (82b77ad37e).
NEW this pass (62b9b691cd): cached sections are validity-keyed on the current-price overlay — each cache entry records pricesFingerprint (sha256 of its v_current_prices rows) and the collector hashes the live overlay once per tick (AA_PRICES_SQL); a price-only change now rebuilds historical caches at the bounded rate instead of serving frozen prices/catalog as current, matching the render copy's promise. Pre-existing entries without a fingerprint are treated as stale once.
Verification: bun test test/aa-batches.test.ts 18/18 (incl. two new oracle tests for the overlay fingerprint); full aggregator suite head-vs-base comparison — identical failing sets (18 pre-existing, load-flaky; base fails 21+3), no new failures from this change. GitHub checks remained pending throughout (fleet-wide CI stall); merged on local verification per fleet practice.
Activity
dezren39 commentedon Nov 1, 2026
agent-note:v1
event: picked-up
task: 4924 (repo-health-code-pilot, OpenChamber scheduled lane)
state: claimed
verified: #3302 is OPEN; no hard-stop labels; no open PR matching #3302 and no existing queue/4924 or #3302 branch found in the primary clone. Existing scope is the AA batch selector/cached per-batch payload implementation.
next: refresh and fast-forward ~/git/code main, create or resume /home/user/git/fleet/task-4924 on queue/4924-3302-aa-dataset-version-switcher, then inspect the current code and investigate issue-specific assumptions.
dezren39 commentedon Nov 1, 2026
agent-note:v1
event: blocked
task: 4924 (repo-health-code-pilot, OpenChamber scheduled lane)
state: blocked — packet_defect
verified: the packet says the collector filters on
ainventory.v_latest_workbook_batchand namesainventory.ingest_batches, but current code atpm-stack/aggregator/scripts/collect-fleet-feed.ts:289-483usesainventory.v_latest_import_batchand has no references to either packet name. The collector currently builds/caches only the latest batch (aa-last-good.json); the authoritative historical batch source/view and metadata columns are not specified in this checkout. I did not guess the database schema.checks: baseline
cd pm-stack/aggregator && bun test test/aa.test.ts— 24 pass, 0 fail; no feature changes.resume: correct the packet with a verified historical source/view and exact fields plus caching semantics, then revalidate issue and PR state and resume on the clean branch/worktree.
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
ainventoryschema; correct the packet without guessing.v_latest_import_batch; live schema hassources,ingest_batches, and historical workbook batches. The ranking/threshold views are latest-only and must be parameterized for historical batches.dezren39 commentedon Nov 3, 2026
🤖 Agent note · done — triage verdict: CONFIRMED; task 4924 requeued with corrected live-schema packet
4fc40be7b; no matching open PR; live primaryainventoryschema queried read-only.Findings
ainventory.v_latest_workbook_batchandainventory.ingest_batchesexist in the live DB. Current code usesv_latest_import_batch, whose live view definition is identical tov_latest_workbook_batch.ainventory.sources WHERE kind='drive-workbook', keyed byimport_batch, withname,imported_at, anddrive_modified_at. There are 19 workbook source entries observed; recent entries do not have matchingingest_batchesrows, so that table cannot be the sole index. Live data has different batch contents/counts (e.g. sheet rows 4,493 vs 4,100; benchmark rows 62 vs 87).v_rankingsandv_threshold_metricseach choosev_latest_workbook_batchinternally. Filtering only the outerAA_SQLis insufficient; their calculations must be parameterized/recreated for the selected batch while preserving current latest math.Task 4924 was requeued under the same dedupe key with corrected scope. Task 6870 completes as
triagedwith follow_up_task_ids=[4924].271 remaining items
dezren39 commentedon Nov 10, 2026
agent-note:v1
event: picked-up
task: 12631 (repo-health-code-pilot, OpenChamber scheduled lane aea12c82)
state: claimed → implementation complete, PR #7564 at af4b7d1
verified: #3302 OPEN, no hard-stop labels. PR #7564 OPEN, head af4b7d1 (merge of origin/main), MERGEABLE.
what changed: four Codex P2 findings on #7564 triaged.
tests: cd pm-stack/aggregator && PM_AGG_PORT=14870 PM_AGG_FRESHNESS_PORT=14871 bun test test/aa.test.ts test/aa-batches.test.ts — 59 pass, 0 fail (after merging current origin/main).
ci: basic-tier failures on this PR are pre-existing main breakage, proven on clean main: scripts-test bitwarden tests fail identically on main (8 tests, 2 failures 5 errors), and .github/scripts/check-fleet-search-parity.test.sh exits 1 with the same diff on main; the pm-stack 5 failing tests are also in main-tier run 42621208851.
next: watch checks, merge on green modulo the proven pre-existing failures, or park with this note if the shift ends first.
dezren39 commentedon Nov 10, 2026
agent-note:v1
event: parked
task: 12631 (repo-health-code-pilot, OpenChamber scheduled lane aea12c82)
state: parked 20 min — CI pending on PR #7564
artifact: PR #7564, head af4b7d1 (merge of origin/main into queue/12631-3302-aa-batch-versioning), MERGEABLE; worktree ~/git/fleet/12631-3302-aa-batch-versioning
verified: #3302 OPEN; three Codex findings fixed and pushed (82b77ad, 6f5a3e2); finding 4 deferred to #8211 (filed + enqueued); targeted tests 59 pass 0 fail
ci: all basic-tier checks and the pm-stack full job were still queued at park time (runner backlog, not failures of this diff). Known pre-existing main failures unaffected by this PR: scripts-test bitwarden tests, fleet-search parity guard, and 5 pm-stack tests — all reproduce on clean main.
resume: read PR/check state fresh; merge when the diff's own checks are green, treating only the proven pre-existing failures as ignorable; close #3302 with the merge SHA.
dezren39 commentedon Nov 10, 2026
🤖 Agent note · picked up (resume)
direct(fix(queue): single-session by default — launch-on-handoff, lane works, inline triage (reverses #8097 Rule 3) #8187) — this lane resumes task 12631 itself.queue/12631-3302-aa-batch-versioning, updated 2026-11-10T20:17:47Z) is OPEN with checks pending in the fleet-wide CI stall.fix(aggregator): validity-key AA batch caches on the current-price ov…
dezren39 commentedon Nov 10, 2026
Done — fixed_merged (lane code-y, task 12631, resume of the prior attempt's PR).
PR #7564 MERGED 2026-11-10T21:09:40Z, merge commit
02d20c012d1a70bc1f241ca4160a499a1580e02f. The AA explorer dataset version switcher ships as built by the prior attempt; this pass finished the Codex gate (§5) — all four P2 findings from the 2026-11-08 review are fixed and dispositioned on their threads:82b77ad37e).6f5a3e29be).82b77ad37e).62b9b691cd): cached sections are validity-keyed on the current-price overlay — each cache entry recordspricesFingerprint(sha256 of itsv_current_pricesrows) and the collector hashes the live overlay once per tick (AA_PRICES_SQL); a price-only change now rebuilds historical caches at the bounded rate instead of serving frozen prices/catalog as current, matching the render copy's promise. Pre-existing entries without a fingerprint are treated as stale once.Verification:
bun test test/aa-batches.test.ts18/18 (incl. two new oracle tests for the overlay fingerprint); full aggregator suite head-vs-base comparison — identical failing sets (18 pre-existing, load-flaky; base fails 21+3), no new failures from this change. GitHub checks remained pending throughout (fleet-wide CI stall); merged on local verification per fleet practice.