GeezerVison is showing github.com — fleet-queue(fallback): parse_ts accepts impossible dates — Feb 31 / non-leap Feb 29 / Apr 31 silently roll into the next month and shift marker lease math by days · Issue #6667 · developing-today/code
fleet-queue(fallback): parse_ts accepts impossible dates — Feb 31 / non-leap Feb 29 / Apr 31 silently roll into the next month and shift marker lease math by days #6667DescriptionProblem
parse_ts in the queue fallback mode (pkgs/fleet/crates/fleet-queue/src/fallback.rs:151-158) validates the day field only as 1..=31, regardless of month or leap year. Impossible dates are accepted and silently normalized by days_from_civil into a different real date, shifting the parsed epoch by days:
2026-02-31T00:00:00Z → parses as 2026-03-03
2026-02-29T00:00:00Z (2026 is not a leap year) → parses as 2026-03-01
2026-04-31T00:00:00Z → parses as 2026-05-01
Marker timestamps are authoritative for all lease math in fallback mode ("The marker's own embedded ts is authoritative — comment metadata is never consulted for lease math", fetch_markers doc), and parse_marker accepts any marker whose ts parses. So a claim/heartbeat marker stamped with an impossible date gets a silently shifted activity time — up to ~3 days of phantom lease — instead of being rejected as malformed the way a month-13 timestamp already is (ts_round_trip pins 2026-13-06 → None, but no impossible-day case).
Evidence
Verified on the laptop against origin/main @5492f27e02 (probe ~/git/fleet/probe-fallback-contest, real fallback.rs included verbatim, parse_ts/format_ts called directly):
parse_ts(2026-02-31T00:00:00Z) = Some(1772496000) = 2026-03-03T00:00:00Z
parse_ts(2026-02-29T00:00:00Z) = Some(1772323200) = 2026-03-01T00:00:00Z
parse_ts(2024-02-29T00:00:00Z) = Some(1709164800) = 2024-02-29T00:00:00Z (leap year: correct)
parse_ts(2026-04-31T00:00:00Z) = Some(1777593600) = 2026-05-01T00:00:00Z
parse_ts(2026-01-31T00:00:00Z) = Some(1769817600) = 2026-01-31T00:00:00Z (control: correct)
Why it matters
Fallback markers are the claim state: a misparsed ts moves last_activity, which decides Live vs Stale, supersede, and contest outcomes. Every other malformed-marker shape (bad month, bad hour, unparseable text) is rejected as "not a marker at all" precisely so near-misses never move claim state — impossible days are the one shape that slips through and actively moves it in the wrong direction.
Acceptance criteria
parse_ts returns None for day-of-month values that do not exist in the given month/year (Feb 29 on non-leap years, Feb 30/31, Apr/Jun/Sep/Nov 31), while still accepting 2024-02-29 and all valid dates.
ts_round_trip (or a sibling test) gains the impossible-date cases above.
- Round-trip property preserved:
parse_ts(format_ts(e)) == Some(e) for the existing epoch set.
Activitydeveloping-today commented on Nov 7, 2026 dezren39 commented on Nov 7, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (lane B, new-issue-creator-code-b)
- Session / ID: new-issue-creator-code-b run, 2026-11-06 19:20 CST
- Found via: filed this run
- Task: Small fix: make fallback parse_ts reject day-of-month values that do not exist in the given month/year instead of normalizing them into the next month.
- Expectation: effort/xs — done when parse_ts returns None for Feb 29 (non-leap)/Feb 30-31/Apr 31, 2024-02-29 still parses, and ts_round_trip gains the impossible-date cases.
- Links: probe ~/git/fleet/probe-fallback-contest (laptop, real fallback.rs verbatim @5492f27e02)
dezren39 commented on Nov 7, 2026
Picked up by repo-worker-code-q — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-q posts progress markers; after 30 minutes of silence any other worker may pick this up.)
🤖 Agent note · picked up
dezren39 commented on Nov 7, 2026
Picked up by repo-worker-code-l — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-l posts progress markers; after 30 minutes of silence any other worker may pick this up.)
🤖 Agent note · picked up (resume of parked work)
- Agent: queue worker (repo-worker-code), lane code-l
- Session / ID: repo-queue-worker-shift-l run, 2026-11-06 19:58 CST (fallback mode; issue fleet-queue(fallback): parse_ts accepts impossible dates — Feb 31 / non-leap Feb 29 / Apr 31 silently roll into the next month and shift marker lease math by days #6667 is the task)
- Found via: fallback scan — lane code-q parked this awaiting CI on PR fix(fleet-queue): parse_ts rejects impossible dates #6684 (claim stale, item claimable); resume condition on record: PR fix(fleet-queue): parse_ts rejects impossible dates #6684 checks green + Codex on head 234e448 dispositioned → merge (closes fleet-queue(fallback): parse_ts accepts impossible dates — Feb 31 / non-leap Feb 29 / Apr 31 silently roll into the next month and shift marker lease math by days #6667) → strip lifecycle labels → fallback release done
- Task: resume, do not restart: verify PR fix(fleet-queue): parse_ts rejects impossible dates #6684 fresh (diff + fleet-queue tests re-run on laptop), disposition the still-pending PR-tier checks under the standing merge criteria, merge if verified, complete the release
- Expectation: effort s; done = PR fix(fleet-queue): parse_ts rejects impossible dates #6684 merged, issue fleet-queue(fallback): parse_ts accepts impossible dates — Feb 31 / non-leap Feb 29 / Apr 31 silently roll into the next month and shift marker lease math by days #6667 closed, labels cleaned, fallback release done
- Links: PR fix(fleet-queue): parse_ts rejects impossible dates #6684, pkgs/fleet/crates/fleet-queue/src/fallback.rs
dezren39 commented on Nov 7, 2026
Progress from repo-worker-code-l: resumed: PR #6684 verified as a single-file change (fallback.rs +70/-1, fix 9df8a5e + property tests 234e448); Codex on head clean (no findings, none unresolved); re-running cargo test -p fleet-queue --features client on the laptop before merging under the standing criteria (scripts-test still pending in the runner backlog) dezren39 commented on Nov 7, 2026
Released by repo-worker-code-l (outcome: done). Issue #6667 FIXED and merged (resume of lane code-q's parked work): PR #6684 #6684 merged be4040c (fix 9df8a5e + property tests 234e448 by lane code-q). parse_ts now validates the day against the real month length with the Gregorian leap rule, so impossible dates (Feb 31, non-leap Feb 29, Apr 31) return None instead of rolling into the next month and shifting fallback lease math. Resume verification by this lane: Codex review on head 234e448 completed with no findings and none unresolved; cargo test -p fleet-queue --features client re-run on the laptop at the PR head: 40 passed / 0 failed (EXIT:0), matching the parked evidence. PR-tier scripts-test was still pending in the runner backlog at merge — merged under the standing merge criteria with locally re-verified tests. Issue auto-closed by the PR.
🤖 Agent note · done (resumed and completed)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|