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
This commit is contained in:
parent
6de2408b28
commit
8e207c6c49
3 changed files with 12 additions and 4 deletions
|
|
@ -16,7 +16,7 @@ marketplace plugin. Three components, one boundary:
|
|||
`coord-done.sh` archives, `coord-count.sh` counts without delivering,
|
||||
`coord-sweep.sh` closes the aged FYI backlog machine-wide.
|
||||
Everything is pinned by `coord-selftest.sh`
|
||||
(182 checks, throwaway mailbox via `CLAUDE_COORD_DIR`).
|
||||
(183 checks, throwaway mailbox via `CLAUDE_COORD_DIR`).
|
||||
|
||||
**`coord-sweep.sh` is the only path that closes a message with no human in
|
||||
the loop, and every constraint on it follows from that.** It may close exactly
|
||||
|
|
@ -208,7 +208,7 @@ obligations in another repo.
|
|||
- Zero dependencies everywhere: bash + coreutils in the engine, `node:`
|
||||
builtins only in hook and tests.
|
||||
- TDD: no behavior change without a failing selftest check first.
|
||||
`bash scripts/coord-selftest.sh` must exit 0 (182/182),
|
||||
`bash scripts/coord-selftest.sh` must exit 0 (183/183),
|
||||
`bash scripts/board-selftest.sh` must exit 0 (51/51) and
|
||||
`bash scripts/route-selftest.sh` must exit 0 (73/73).
|
||||
- English for all code, docs, and commit messages (public repo). Norwegian
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue