Skip to content

aggregator(aa+dns): section gates accept an impossible generatedAt — bare Date.parse rolls 2026-02-30 to Mar 2 and both isAaSection and isDnsSection pass it as a real collection time #3441

Closed

Description

@dezren39

Bug

Two fleet-feed section gates validate their generatedAt stamp with bare Date.parse, so a day-overflow date that never existed passes as a real collection time:

  • isAaSection (pm-stack/aggregator/src/aa.ts:1096 absent form, :1100 ok form): Number.isFinite(Date.parse(s.generatedAt)).
  • isDnsSection (pm-stack/aggregator/src/dns.ts:79): the same expression.

Date.parse("2026-02-30T00:00:00.000Z") does not fail — it rolls over to 2026-03-02. So a section stamped February 30 passes both gates and is served/rendered as data collected on March 2: the live source builds provenance from it (feedAgeText, collected ${feed.aa.generatedAt}, register parsed ${feed.dns.generatedAt} in src/sources/live.ts), and renderAa/renderDns print it via fmtDate. The stamp is the freshness signal for both pages; a fabricated March date makes stale or hand-edited data look freshly collected.

The codebase already has the strict primitive for exactly this: isIsoDate/parseIsoDate in src/validate.ts re-checks calendar components so 2026-02-30 fails instead of rolling over, and sibling gates use it (orchestrationSectionProblem checks isIsoDate(s.generatedAt); isSnapshotRecord uses it for ts/resetsAt with the comment "Date.parse rolls 2026-02-30 into March, so the strict primitive is the gate"). The AA and DNS gates were never migrated.

Evidence (verified this run, main ba2e97d)

Laptop probe ~/git/fleet/probe-2026-11-01-laneA-gendates/probe.ts (Bun 1.4.2), importing the real aa.ts/dns.ts/validate.ts from the laptop clone — aa.ts md5 2dc10e70, dns.ts md5 03aab48e, validate.ts md5 2078ddfd, identical on sandbox main ba2e97d and the probe clone; full output in probe.txt in the same directory:

  • Date.parse("2026-02-30T00:00:00.000Z") → 2026-03-02T00:00:00.000Z (rollover); isIsoDate(same) → false.
  • AA control (real stamp): isAaSection → true. With generatedAt: "2026-02-30T00:00:00.000Z" → true (ok form and absent form both).
  • DNS control (real stamp): isDnsSection → true. With the Feb-30 stamp → true.
  • (Month 13 is already refused, because Date.parse returns NaN for it — the hole is specifically day-of-month overflow: Feb 29 in a non-leap year, Feb 30/31, Apr/Jun/Sep/Nov 31.)

Why it matters

generatedAt is how every surface answers "how old is this data". A stamp that silently becomes a different, real-looking date defeats the staleness banners and provenance lines these pages rely on, and it does so invisibly — no NaN, no "unknown", just the wrong day. The feed is a file boundary shared with the collector, older feeds, and hand/backfill tooling; the section gates are the one place supposed to keep impossible stamps out.

Acceptance criteria

  • isAaSection (both ok and absent forms) and isDnsSection refuse a generatedAt that is not a real ISO calendar date — at minimum the day-overflow shapes above — using the shared isIsoDate primitive from validate.ts (or an equivalent component re-check).
  • A Feb-30-stamped AA or DNS section in the feed is treated as absent/invalid by the live source (existing provenance wording), not rendered with a March 2 collection date.
  • Regression tests beside the existing aa/dns gate tests: Feb-30, Feb-29-2026 (non-leap), and Apr-31 stamps fail both gates; the well-formed fixture sections still pass unchanged.
  • No change to the on-disk feed format or to what the collector emits for valid sections.

Distinct from: #2242 (health.ts age computation over dns/aa stamps — different file, NaN/future ages; these are the section gates themselves certifying an impossible date), #2199 (DNS register renewal dates in parseDnsRegister), #2412/#2415 (dns/aa gates' unchecked numeric/thresholds/sources fields — crash class, not the stamp), #3396/#3393 (tier-items/actions date gates).

Activity

  1. developing-today commented on Nov 1, 2026

    @developing-today
    Contributor
  2. added
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/lowNice to have; do when convenient
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    effort/sSmall: expected under 2 hours of work
    on Nov 1, 2026
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator (lane A, new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a, run 2026-11-01 03:05 CST
    • Found via: filed this run
    • Task: Triage the bare-Date.parse generatedAt gap in isAaSection/isDnsSection and route the fix (shared isIsoDate primitive).
    • Expectation: effort/s — done when the gates refuse day-overflow stamps and regression tests pin them.
    • Links: probe ~/git/fleet/probe-2026-11-01-laneA-gendates/ (laptop)
  4. added
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    work/assignedQueue worker lifecycle state
    and removed on Nov 1, 2026
  5. 9 remaining items

  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up queue task 6084

  7. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · fix implemented, tests green (queue task 6084)

    • Changed (5 files): pm-stack/aggregator/src/aa.ts (isAaSection ok + absent branches now use shared strict isIsoDate), pm-stack/aggregator/src/dns.ts (isDnsSection likewise); regressions in test/aa-gate-2415.test.ts (ok), test/aa.test.ts (absent), test/slice3.test.ts (DNS) covering 2026-02-30, 2026-02-29, 2026-04-31 generatedAt, with well-formed controls retained.
    • Red confirmed: all three new regression tests failed on pre-fix code (gates returned true).
    • Green: bun test test/aa-gate-2415.test.ts test/aa.test.ts test/slice3.test.ts test/validate.test.ts → 171 pass, 0 fail.
    • Full suite: bun test (pm-stack/aggregator) → 1072 pass, 1 fail + 1 error, both from pre-existing missing web-push package in test/alerts.test.ts (import-time, unrelated to date gates). tsc --noEmit shows only the pre-existing missing bun types diagnostic.
    • Next: commit, push branch, open PR referencing aggregator(aa+dns): section gates accept an impossible generatedAt — bare Date.parse rolls 2026-02-30 to Mar 2 and both isAaSection and isDnsSection pass it as a real collection time #3441 (no merge).
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Conductor binding · manual dispatch wave (Drew-ordered queue unblock) 2026-11-02

  10. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 2, 2026
  11. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Queue task 6084 picked up (lane 8ac61616). Revalidated: issue OPEN, no superseding work, no held/Drew-owned flags. Resuming from dispatched-session checkpoint: fix + PR #4426 exist — verifying fresh (diff reviewed, targeted tests 171 pass / 0 fail) and harvesting.

  12. added a commit that references this issue on Nov 2, 2026
  13. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Queue task 6084 done. Fix merged via PR #4426 (merge 97f7105): AA/DNS generatedAt gates now use isIsoDate, rejecting impossible calendar dates. Verified: targeted suites 171 pass / 0 fail. Closing as fixed.

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

Metadata

Metadata

Assignees

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/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/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions