Commit 960f3e5
committed
fix(pm): post-stamped refuses a quoted stamp that names no real instant
The quoted-stamp shape rule is the protocol's stamp regex, and a regex counts
digits: `2026-13-45T99:99Z` satisfies every class in it. The direction rule then
let it through in the quiet direction -- `stampSpan` asks `Date.parse`, which
answers NaN, so the span is null, so "is this later than now" is false. Not
future, therefore not refused: the value was rendered VERBATIM and `--dry-run`
reported "1 quoted stamp(s) rendered verbatim" at exit 0. A stamp no clock could
ever have shown went onto the board as a reading.
`Date.parse` has two ways of not meaning what the digits say. An out-of-range
field gives NaN. A field inside its range but not on the calendar -- 31 April,
29 February in a non-leap year, hour 24 -- is rolled FORWARD into the next real
date and returned as an ordinary number, so `2026-04-31T00:00Z` parses, sits in
the past, and is not the date its digits spell. Measured on this runtime: that
second half was accepted and rendered today.
One rule refuses both. `stampRealInstant` re-renders the parsed instant at the
stamp's own grain and requires the bytes back; a value that round-trips to a
different date is not a reading of the instant it names. It sits in
`stampRefusals` beside the direction rule, in the same scan, so exactly one rule
still decides what a quoted stamp is -- and the three fire one at a time: shape,
then calendar, then direction.
The positional and mixed remedies hand the seat `{{WAS:<the typed stamp>}}` with
the stamp filled in, so the new closure would have made them prescribe a refusal
for an impossible stamp. Both now read one predicate, `quotedRouteClosed`, which
shuts the offer off for either reason instead of the future alone.
Header and usage prose corrected in the same edit: the accepted shape has always
taken the seconds grain as well as the minute, and both said minute only.
Self-test: 152 cases across 9 batteries -> 186 across 10; the new battery is
floored at 34 and SELF_TEST_BATTERY_FLOOR raised 9 -> 10.
Claude-Session: https://claude.ai/code/session_01HZfg2AwVX191qCizp88gQr
Co-authored-by: Claude <noreply@anthropic.com>1 parent 499f7f9 commit 960f3e5
1 file changed
Lines changed: 191 additions & 19 deletions
0 commit comments