Skip to content

pm-stack(aggregator): isAaSection accepts impossible/non-ISO testRuns snapshotDate — summarizeAa reports a fabricated snapshot vintage on /aa #5289

Closed

Description

@dezren39

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 validates generatedAt with isIsoDate (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 — summarizeAa collects the string snapshotDates, sorts them lexicographically, and reports { min, max } as snapshotVintage.
  • pm-stack/aggregator/src/render.ts (renderAa provenance card) — renders Test_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) and summarizeAa(...).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's snapshot_date column via str() — 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

  • isAaSection requires a testRuns snapshotDate to be null or isIsoDate(...) (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, and not-a-date snapshotDates fail the gate; 2026-09-28 and null pass; collector-built sections (aaSectionFromRaw output) still pass unchanged.
  • Existing aggregator tests still pass.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/lowNice to have; do when convenient
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    on Nov 4, 2026
  2. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a, run 2026-11-04T05:02Z
    • Found via: filed this run
    • Task: isAaSection accepts impossible/non-ISO testRuns snapshotDate (aa.ts:1170-1171 typeof-only vs isIsoDate on generatedAt in the same gate); verified by laptop bun probe at origin/main ef55926 — gate=true, summarizeAa vintage {"min":"2026-02-30","max":"not-a-date"}; control valid.
    • Expectation: effort/s — gate snapshotDate on isIsoDate (null stays valid) + aa-gate tests; done when a section with an impossible snapshotDate reads as degraded and collector-built sections still pass.
    • Links: evidence body filed from hidden_files/issue-aa-testrun-snapshotdate-not-iso.md (goal workspace)
  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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.

  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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.

  6. 7 remaining items

  7. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  9. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 4, 2026
  10. added a commit that references this issue on Nov 4, 2026
  11. removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
  12. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/aggregatorPackage/app: aggregator (pm-stack in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions