Repository navigation
Description
Finding (unaddressed PR review comment)
Codex P2 on merged PR #8681 — comment #8681 (comment) by chatgpt-codex-connector[bot], 2026-11-11T13:22:05Z, at pm-stack/aggregator/src/aa-batch-sql.ts:609:
Preserve the selected batch for configs and coding-agent results — When a historical dataset is fetched or its cache is rebuilt, these predicates select the latest canonical ingest rather than the requested batch.
collectAaSectionstill callsfetchAaPayload(row.importBatch)for historical entries, so the resulting payload combines historical rankings and timings with latest configs and CAI observations, then caches that mixture under the historical UUID. This contradicts the dataset selector's explicit promise that older versions show that import's coding-agent rows and snapshot figures. Preserve a mapping to the selected import or reconstruct these sections from its retained snapshot data; latest-batch parity alone does not preserve historical behavior. The same issue applies to thecaipredicate below.
No-response evidence
- PR aggregator: read AA configs/CAI from canonical measurement_events (retire benchmark_results) — #4401 tranche 2 #8681 merged 2026-11-11T13:21:56Z, at the reviewed head — the comment was posted at merge time and the flagged behaviour merged unchanged.
- Fresh re-read (2026-11-11, this run): the PR's only inline comment is this Codex original, with no replies; no conversation comment addresses it.
- GraphQL
reviewThreadscheck: the thread is unresolved. - Searched open and closed issues for "8681" and "aa-batch historical batch configs cai" — no existing issue covers this finding (aggregator(aa-explorer): cached historical AA batches freeze the v_current_prices overlay — version switching silently switches token rates #8211 covered a different overlay defect and is closed).
Still live on current main (verified 2026-11-11, two gh api reads)
pm-stack/aggregator/src/aa-batch-sql.ts on main, aaPayloadSql(batch): the configs and cai sections still ignore the batch expression and scope to the latest workbook-import ingest batch (where br.ingest_batch_id = (select ingest_batch_id from ainventory.measurement_events where source_kind = 'workbook-import' order by ingested_at desc limit 1)), while sources/rankings/thresholds/testRunRows scope to ${b}. A header comment (tranche 2 of #4401) documents that canonical events carry no sheet import_batch identity — but the user-visible consequence Codex flagged stands: a historical payload mixes latest configs/CAI with that batch's rankings and is cached under the historical UUID.
Acceptance criteria
- Historical AA payloads no longer present latest-batch configs/CAI as the selected batch's data (preserve a mapping to the selected import, reconstruct from retained snapshot data, or clearly scope/label those sections as latest-only so the cache under the historical UUID is not a silent mixture), or the finding is resolved by a documented decision on this issue.
Activity
developing-today commentedon Nov 12, 2026
CODE-2646
dezren39 commentedon Nov 12, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 12, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 12, 2026
🤖 Agent note · triaged
fix(aggregator): validity-key AA batch caches with the payload SQL re…
fix(aggregator): scope AA configs/cai as-of the selected batch (#8817) (
dezren39 commentedon Nov 12, 2026
🤖 Agent note · done
dezren39 commentedon Nov 12, 2026
🤖 Agent note · done (already_done — duplicate follow-on)