GeezerVison is showing github.com — aggregator(actions): validateNewAction accepts impossible calendar dates — a snooze until 2026-02-30 is stored verbatim and Date.parse reads it as Mar 2, so the card stays snoozed ~2 extra days · Issue #3393 · developing-today/code
aggregator(actions): validateNewAction accepts impossible calendar dates — a snooze until 2026-02-30 is stored verbatim and Date.parse reads it as Mar 2, so the card stays snoozed ~2 extra days #3393DescriptionSummary
validateNewAction (pm-stack/aggregator/src/actions.ts) is the only validation gate for dashboard actions written through the actions API. For the two date fields it checks nothing but Number.isNaN(Date.parse(x)):
payload.until — actions.ts:229-232 (payload.until must be an ISO date/time)
payload.proposalUpdatedAt — actions.ts:292-296 (same pattern)
V8's Date.parse does not refuse impossible calendar days — it normalizes them. Verified on the laptop (node v24 / bun, same engine family as the aggregator runtime):
Date.parse("2026-02-30") = 1772409600000 = 2026-03-02T00:00:00.000Z
Date.parse("2026-02-29") = finite (2026-03-01; 2026 is not a leap year)
Date.parse("2026-04-31T00:00:00Z") = finite (2026-05-01)
Date.parse("2026-13-01") = NaN (only the month range is checked)
So the check catches a bad month and garbage, but an impossible day passes, and the string is stored verbatim (payload.until = until, actions.ts:231).
Verified repro (this run)
Laptop probe ~/git/fleet/probe-2026-11-01-laneA-actionuntil/probe.ts (bun, importing the real validateNewAction from src/actions.ts and cardState from src/card-state.ts; laptop clone ~/git/code at main e6577a96, all five involved files md5-identical to origin/main):
validate until=2026-02-28 -> OK (stored as "2026-02-28")
validate until=2026-02-29 -> OK (stored as "2026-02-29") ← 2026 has no Feb 29
validate until=2026-02-30 -> OK (stored as "2026-02-30") ← impossible day
validate until=2026-04-31 -> OK (stored as "2026-04-31") ← April has 30 days
validate until=2026-13-01 -> ERR payload.until must be an ISO date/time
validate until=not-a-date -> ERR payload.until must be an ISO date/time
cardState at 2026-03-01T12:00Z with until=2026-02-28 -> suppressed: null (control: snooze over)
cardState at 2026-03-01T12:00Z with until=2026-02-30 -> suppressed: "snoozed" (still hidden on Mar 1)
The consumer side is cardState (src/card-state.ts:75): Date.parse(snooze.payload.until) > now decides suppression, re-parsing the stored string with the same normalizing parser — so the impossible date silently becomes Mar 2 there. A snooze written "until Feb 30" (or a UI/typo producing Feb 29 in a non-leap year) keeps the card hidden ~2 days longer than the chosen horizon, the write returned success, and the stored record names a day that never exists, so no later reader can recover the intent. proposalUpdatedAt has the same shape: an impossible stamp is accepted and stored, and ordering/freshness comparisons against it compare against the normalized instant, not the written one.
Why it matters
- This is the write-path gate for user-facing dashboard actions; a wrong-but-plausible date is exactly the input a strict validator exists to catch, and the failure mode is silent (success response, wrong behavior days later).
- The codebase already has the strict primitives and the precedent:
validate.ts parseIsoDate/isIsoDate (real-calendar-date check, aggregator(snapshot-records): shape-only dates win freshestDate — a 2026-13-01 'Last checked' silently drops a pool's snapshot history, 2026-02-30 is stored as a phantom March date #2264/aggregator: Phase 1 of #2576 — validate.ts primitives, the ingest contract in the README, and the malformed-input probe matrix #2577) are used by feed.ts and snapshot-records.ts (freshestDate: "an impossible date like 2026-02-30 … must not win"). actions.ts is the remaining Date.parse-only gate on this surface.
- Sibling snapshot-gate findings (aggregator(snapshot-records): recordsFromDeepseekBalance takes the ¥ line's first date-shaped string unchecked — an impossible date (2026-02-30) shadows the section's valid Last-checked date, the record fails isSnapshotRecord and is silently dropped as 'already present' #3379, aggregator(snapshots): isSnapshotRollup re-admits the shapes isSnapshotRecord was hardened to refuse — impossible dates, negative/string limit, unparseable resetsAt, inverted pairs expand into the reading path unchecked #3365) cover the snapshot pipeline; this is the distinct actions/card-state path — the persisted action log and live card suppression, not snapshot history.
Acceptance criteria
-
validateNewAction refuses a payload.until or payload.proposalUpdatedAt whose calendar day does not exist (e.g. 2026-02-29 in 2026, 2026-02-30, 2026-04-31), with the existing "must be an ISO date/time" error; real dates (incl. 2024-02-29) still pass, as do full ISO datetimes for real days.
- The validation uses a real-calendar check consistent with
validate.ts (parseIsoDate semantics for the date part), not Date.parse alone.
- Tests: actions validation tests gain impossible-day cases for both fields (refused) plus leap-year control (accepted); existing actions/card-state tests still pass.
- No change to
cardState comparison semantics for valid stored dates; already-stored impossible strings are out of scope (note in the fix if a defensive read-side guard is added anyway).
Filed by new-issue-creator-code-a (lane A), run 2026-11-01. Evidence probe: ~/git/fleet/probe-2026-11-01-laneA-actionuntil/ on the laptop. Activitydeveloping-today commented on Nov 1, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item effort/sSmall: expected under 2 hours of work on Nov 1, 2026dezren39 commented on Nov 1, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (new-issue-creator-code-a)
- Session / ID: cron job new-issue-creator-code-a, run 2026-11-01 01:05 CST
- Found via: filed this run
- Task: Make validateNewAction refuse impossible calendar dates (2026-02-30, 2026-04-31, non-leap Feb 29) for payload.until and payload.proposalUpdatedAt, using a real-calendar check consistent with validate.ts parseIsoDate instead of Date.parse alone.
- Expectation: effort/s — done when the acceptance criteria on this issue pass, including validation tests for impossible days on both fields plus a leap-year control.
- Links: evidence in the issue body; laptop probe at ~/git/fleet/probe-2026-11-01-laneA-actionuntil/probe.ts (real validateNewAction + cardState at main e6577a9: impossible dates accepted verbatim, card still snoozed on Mar 1 with until=2026-02-30; control 2026-02-28 not snoozed).
dezren39 commented on Nov 12, 2026 🤖 Agent note · parked — CI wait on PR #4466 after rebase (task 6024, lane code-c)
- Agent: queue worker lane code-c (task 6024; assignment direct)
- Prior hard stop void: the earlier "Drew-owned" stop on this task rested on PR validateNewAction: refuse impossible calendar dates for until/proposalUpdatedAt #4466 being authored by dezren39. Per Drew's 2026-11-11 ruling, dezren39 is the fleet working identity, not a hold; PR validateNewAction: refuse impossible calendar dates for until/proposalUpdatedAt #4466 and issue aggregator(actions): validateNewAction accepts impossible calendar dates — a snooze until 2026-02-30 is stored verbatim and Date.parse reads it as Mar 2, so the card stays snoozed ~2 extra days #3393 carry no
held, user/owned, do-not-merge, or do-not-auto-edit label. The stale user/escalated / queue/blocked / status/blocked labels from that stop are removed by this note's label sync; the task proceeds as ordinary work.
- Rebase: PR validateNewAction: refuse impossible calendar dates for until/proposalUpdatedAt #4466 was CONFLICTING with current main. Rebased branch
queue/6024-3393-calendar-dates onto main (be6bf9a) in laptop worktree ~/git/fleet/queue-6024-3393: the only conflict was additive in pm-stack/aggregator/test/actions.test.ts (main's aggregator(actions): cleanText caps can split a surrogate pair — a stored action field ends in a lone surrogate #7694 surrogate-cap test vs this PR's aggregator(actions): validateNewAction accepts impossible calendar dates — a snooze until 2026-02-30 is stored verbatim and Date.parse reads it as Mar 2, so the card stays snoozed ~2 extra days #3393 date test in the same spot) — both tests kept. New head 4043d15, PR MERGEABLE.
- Verification: targeted probe exercising
validateNewAction directly — 12/12 PASS (impossible days 2026-02-29/02-30/04-31 refused for until and proposalUpdatedAt with the exact error strings; leap-day and real-day controls accepted; both aggregator(actions): cleanText caps can split a surrogate pair — a stored action field ends in a lone surrogate #7694 surrogate-cap cases pass). The full actions.test.ts harness hangs in its beforeAll subprocess spawn in this environment — verified identical on clean main be6bf9a, i.e. pre-existing and unrelated (the PR's own run on its original base passed 20/20). Codex review on the previous head completed with no findings; the rebase changed no source logic beyond the test-file merge.
- CI on head 4043d15: running/queued; the one completed failure,
basic: fleet-search pyjson/render parity (#5920), is pre-existing on clean main (recorded by lane code-c's previous shift) and untouched by this PR (aggregator only). The aggregator suite check is still queued.
- Disposition: task 6024 parked as a CI wait on PR validateNewAction: refuse impossible calendar dates for until/proposalUpdatedAt #4466 (broker ready-condition, 1h floor). Resume: when checks complete — merge PR validateNewAction: refuse impossible calendar dates for until/proposalUpdatedAt #4466 if the aggregator suite is green (the pre-existing fleet-search parity failure does not block), then complete task 6024 as
fixed_merged and close issue aggregator(actions): validateNewAction accepts impossible calendar dates — a snooze until 2026-02-30 is stored verbatim and Date.parse reads it as Mar 2, so the card stays snoozed ~2 extra days #3393 via the PR's closing keyword / verified closure.
dezren39 commented on Nov 12, 2026 🤖 Agent note · done — already complete
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|