repo-mailbox/scripts
Kjell Tore Guttormsen 8e207c6c49 test(sweep): stop the --days 0 check from racing a one-second cutoff
Measured, not guessed: the check failed 7 runs in 20, not once. The cause is
a same-second collision, reproduced deterministically - a notice minted at
20260801205457 against a cutoff of 20260801205457 survives, the same notice
60s older is closed.

coord-sweep.sh is right and is left alone. Its cutoff is second-granular and
it closes strictly older messages, which spares rather than closes at the
boundary; at any real --days value one second is unobservable. Relaxing that
guard to <= would make a destructive script more aggressive to satisfy a test.

So the test was claiming what the code does not promise: that a notice minted
earlier in the same run is necessarily older at second granularity. Under a
second of work separates the two, so it was a coin flip. Aged by 5 seconds
through the existing age_it, which keeps it well inside the default 14-day
window and clear of the boundary. No sleep: that would have hidden the answer
rather than fixed it.

Selftest 182 -> 183, 20/20 green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GfDGWyyhnM26J4p93GSk2L
2026-08-01 23:01:32 +02:00
..
board-selftest.sh test(brief): pin the malformed route line, the case that will actually occur 2026-08-01 22:44:35 +02:00
board.sh feat(brief): render the nightly cross-repo briefing without a model 2026-08-01 22:38:46 +02:00
brief-nightly.sh feat(brief): render the nightly cross-repo briefing without a model 2026-08-01 22:38:46 +02:00
coord-count.sh feat(engine): let a message say it needs no answer, and count debt without losing sight of the rest 2026-07-31 15:46:14 +02:00
coord-done.sh feat(engine): make a bulk close state what Rule 7 says must be stated 2026-07-31 15:48:42 +02:00
coord-inbox.sh feat(engine): let a message say it needs no answer, and count debt without losing sight of the rest 2026-07-31 15:46:14 +02:00
coord-selftest.sh test(sweep): stop the --days 0 check from racing a one-second cutoff 2026-08-01 23:01:32 +02:00
coord-send.sh feat(engine): let a message say it needs no answer, and count debt without losing sight of the rest 2026-07-31 15:46:14 +02:00
coord-sweep.sh feat(sweep): close the aged FYI backlog without a human in the loop 2026-08-01 22:00:42 +02:00
route-selftest.sh feat(route): give the advisor a writer, on a need and per row 2026-07-31 21:39:59 +02:00
route.sh feat(route): give the advisor a writer, on a need and per row 2026-07-31 21:39:59 +02:00