Repository navigation
aggregator: read AA configs/CAI from canonical measurement_events (retire benchmark_results) — #4401 tranche 2 - #8681
Conversation
…tire benchmark_results (code#4401 tranche 2)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4ed342027
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 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) |
There was a problem hiding this comment.
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. collectAaSection still calls fetchAaPayload(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 in render.ts 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 the cai predicate below.
Useful? React with 👍 / 👎.
Closes the last open acceptance item of #4401 (tranche 2, task 14717).
What changes
pm-stack/aggregator/src/aa-batch-sql.ts: the AA payload'sconfigsandcaisections no longer read the frozenainventory.benchmark_resultstable. They read the canonicalainventory.measurement_eventsstore, scoped to the latestworkbook-importingest batch (the events' equivalent of the latest sheet import batch), withspeedTpsprojected fromoutput_tps. The two sections ignore the sheet batch expression — canonical events carry no sheetimport_batchidentity — documented in the code comment.benchmark_version is null(the version-less AA scrape set, 35 rows); cai keeps rows whoserawcarriesbenchmark_version(the workbook-import CAI shape the query projects, 27 rows).aa.ts,model.ts, andscripts/collect-fleet-feed.tsupdated frombenchmark_resultstomeasurement_events.Verification (live, before the drop)
EXCEPTcomparison, old table (latest sheet batch) vs new query scope: configs 35/35, cai 27/27, zero differences in either direction.benchmark_results; no Supabase views, functions, or matviews reference it; named consumers (quota gatherer, coding-plan-watch, pool-intelligence) have no references.bun test test/aa-batches.test.ts test/aa-explorer-computations.test.ts test/aa-gate-*.test.ts— 46 pass, 0 fail. (test/aa.test.tsfails pre-existing in this environment on clean main too: live-server port / missing-package environment issues, unrelated.)Database step (executed with this PR, recorded on #4401)
ainventory.benchmark_results(1,141 rows, frozen at the 2026-10-26 import) dropped after the parity verification above; its content is fully represented inmeasurement_eventsfor every row the aggregator ever read.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.