Description
pm-stack(aggregator): isAaSection accepts impossible/non-ISO testRuns snapshotDate — summarizeAa reports a fabricated snapshot vintage on /aa
Summary
The AA section gate checks a test run's snapshotDate only as string-or-null, never as a real calendar date. A gate-passing section whose test runs carry 2026-02-30 or not-a-date produces a snapshot-vintage range built from those strings, and the /aa provenance card presents it as the batch's real Test_Runs snapshot range.
Evidence (verified this run, origin/main @ ef55926)
pm-stack/aggregator/src/aa.ts:1170-1171—isAaSection's testRuns element check is(typeof snapshotDate === "string" || snapshotDate === null). The same gate validatesgeneratedAtwithisIsoDate(aa.ts:1158 and the absent-form check), so the date rule exists in this function and this one field skips it.pm-stack/aggregator/src/aa.ts:1206-1213—summarizeAacollects the string snapshotDates, sorts them lexicographically, and reports{ min, max }assnapshotVintage.pm-stack/aggregator/src/render.ts(renderAa provenance card) — rendersTest_Runs snapshots in this batch: ${summary.snapshotVintage.min} – ${summary.snapshotVintage.max}verbatim.- Laptop bun probe (scan worktree at ef55926,
probe-aa.ts, run this run): a complete minimal valid section passes the gate (control); the same section with testRuns snapshotDates"not-a-date"and"2026-02-30"also passes (isAaSection= true) andsummarizeAa(...).snapshotVintage={"min":"2026-02-30","max":"not-a-date"}. isIsoDate(src/validate.ts:116) accepts the date-only form real snapshot dates use ("2026-09-28", see fixtures in src/sources/fixtures.ts) while rejecting both probe strings, so gating on it does not break legitimate producer output (aa.ts:112 builds the field from the import'ssnapshot_datecolumn viastr()— arbitrary upstream text).
Why it matters
The vintage range is the /aa page's provenance claim about which AA snapshot batch the figures came from. An impossible or garbage date in one upstream row silently falsifies that claim for the whole batch — the aggregator-wide rule (#2199/#3513/#5172 family) is that a date field a consumer treats as a date is gated as a real ISO calendar date at the boundary, not merely typed as a string. This is distinct from #4169 (dereference depth: gate-passing sections throwing in renderAa) and from #2415, which added the string-or-null check itself: neither covers the value validity of this field, and this section does not throw — it renders wrong data.
Acceptance criteria
-
isAaSectionrequires a testRunssnapshotDateto benullorisIsoDate(...)(date-only forms included), so a section carrying an impossible/non-ISO snapshot date reads as absent/degraded at the live-source gate (src/sources/live.ts) instead of serving a fabricated vintage. - Gate tests in the style of test/aa-gate-2415.test.ts:
2026-02-30,2026-04-31, andnot-a-datesnapshotDates fail the gate;2026-09-28andnullpass; collector-built sections (aaSectionFromRaw output) still pass unchanged. - Existing aggregator tests still pass.
Activity
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 4, 2026
agent-note:v1
event: picked_up
task: 9222 (small_fix, repo-health-code-pilot; repo-worker-code, lane code-g)
state: claimed; fresh GitHub state: issue #5289 is OPEN with no hard-stop labels (no held, user/owned, do-not-merge, do-not-auto-edit). No open PR implements the snapshotDate validity gate; PR #4565 (#4169, render-depth) touches the same isAaSection testRuns block but keeps the string-or-null snapshotDate check — distinct scope, possible textual rebase for whichever merges second.
next: create laptop worktree branch queue/9222-5289-aa-snapshotdate-gate, gate testRuns snapshotDate with isIsoDate in isAaSection, add aa gate tests, push and open PR.
dezren39 commentedon Nov 4, 2026
agent-note:v1
event: parked
task: 9222 (small_fix, repo-health-code-pilot; repo-worker-code, lane code-g)
state: parked — CI pending on PR #5291 (checks queued since 2026-11-04T05:15:59Z, still pending at the 5-minute poll limit; no Codex review findings posted yet at park time).
artifact: PR #5291 #5291 — branch queue/9222-5289-aa-snapshotdate-gate, commit 0302c6b, laptop worktree /home/user/git/fleet/task-9222. Fix verified on the laptop before opening: targeted bun tests 56 pass / 0 fail; full aggregator suite 1499 pass with only the pre-existing snapshot-retention lockfile timing flakes (isolated file passes 23/23 on clean main and on this branch).
next: on resume, read PR #5291 check state and Codex findings fresh, disposition any finding, merge when checks are green per standing criteria, then complete task 9222.
7 remaining items
dezren39 commentedon Nov 4, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 4, 2026
🤖 Agent note · parked
Merge pull request #5291 from developing-today/queue/9222-5289-aa-sna…
dezren39 commentedon Nov 4, 2026
🤖 Agent note · done
GhKindnot imported) — verified present on current main via gh api, unrelated to this PR's diff (src/aa.ts + test/aa-gate-5289.test.ts), and already tracked as issue pm-stack(aggregator): typecheck red on main — src/item-history.ts uses GhKind without importing it from model.ts #5247. Codex review completed with no findings.test(aggregator): aa-gate-5289 fixtures carry modelVariantKey (#4169)