Skip to content

pm-stack(aggregator): dnsSectionFromRegisterJson accepts impossible renewal dates (2027-02-30, 2026-13-01) — the #2199 fix covered only the Markdown register path #4858

Closed

Description

@dezren39

Title: pm-stack(aggregator): dnsSectionFromRegisterJson accepts impossible renewal dates (2027-02-30, 2026-13-01) — the #2199 fix covered only the Markdown register path

Problem

parseDnsRegister (the Markdown path) refuses impossible calendar renewal dates since the #2199 fix (PR #4835): pm-stack/aggregator/src/dns.ts:56 requires isIsoDate(renewal) in addition to the YYYY-MM-DD shape, because an impossible date "string-sorts into the register, counts toward the annual total, and poisons nextRenewal / renewingSoon".

The JSON path — dnsSectionFromRegisterJson, whose register.json is authoritative for the fields it carries (dns.ts:95-103) — never got the same check:

  • pm-stack/aggregator/src/dns.ts:135: if (typeof renewal !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(renewal)) return null; — shape only, no isIsoDate.
  • The shared section gate isDnsSection (dns.ts:183) likewise only requires renewal to be a string, so a section carrying an impossible renewal certifies as valid for the render paths.

That contradicts the function's own contract (dns.ts:100-103): "Returns null on ANY malformation … so the caller falls back to the Markdown parse instead of serving a half-invented register."

Verified this run (laptop probe, origin/main 8e76c6f)

Probe script /tmp/probe-dns.ts on the laptop, importing dnsSectionFromRegisterJson, isDnsSection, and summarizeDns from current main, with a register.json containing next_renewal values 2027-02-30 ($20), 2026-13-01 ($30), 2024-02-29 ($5, valid leap date), and 2027-01-15 ($10):

SECTION_NULL: false
DOMAINS: leap.example,month13.example,real.example,feb30.example
TOTAL: 65
IS_DNS_SECTION: true
NEXT_RENEWAL: month13.example 2026-13-01

So the impossible rows are accepted, their $50 counts toward totalAnnualListUsd, the section passes isDnsSection, and summarizeDns (dns.ts:232, string comparison e.renewal >= today) reports the nonexistent 2026-13-01 as the next renewal — exactly the harm #2199 documented for the Markdown path.

Why it matters

The JSON register is the authoritative source (#902 slice 2); a single bad next_renewal from the register job silently poisons the /dns totals, nextRenewal, and renewingSoon instead of falling back to the Markdown parse as the contract promises. The Markdown path was fixed for this exact failure mode in #4835; the authoritative path was left open.

Acceptance criteria

  • dnsSectionFromRegisterJson returns null when any row's next_renewal is shape-valid but not a real calendar date (e.g. 2027-02-30, 2026-13-01, 2026-00-10, 2026-04-31), falling back to the Markdown parse.
  • Real dates still parse, including leap dates (2024-02-29).
  • isDnsSection refuses an entry whose renewal is not a real calendar date.
  • New tests in pm-stack/aggregator/test/slice3.test.ts mirror the fix(aggregator): reject impossible DNS register renewal dates (#2199) #4835 Markdown cases for the JSON path (impossible dates refused, leap date kept); existing slice3 DNS tests stay green.

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/normalOrdinary priority (the default)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7403 (small_fix, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 4, 2026
  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. added a commit that references this issue on Nov 4, 2026
  7. 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

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/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