repo-mailbox/scripts
Kjell Tore Guttormsen db57b43f50 fix(coord-count): distinguish claimed from unmeasured, fix Linux date parse
Review finding 11 (docs/2026-08-14-confident-zero-review.md), tier 1,
prioritized by .claude 2026-08-14T21:24:16Z coord message.

Two bugs collapsed into one token. Column 4 of coord-count.sh (the WP1d
origin-age column) printed "-" for both "has .origin" (claimed, not a
dead-letter candidate) and "age could not be measured" - a consumer could
not tell "not a dead letter" from "not measured". Fixed by reserving "-"
for claimed only and introducing "?" for could-not-measure; board.sh's
sole column-4 consumer (awk '$4 != "-" && $4+0 >= 3') needed no change,
since awk's numeric coercion already treats "?" as 0 and filters it out
the same way "-" always was.

Second, the age computation itself used `date -u -j -f ...`, a BSD-only
invocation. Measured directly (Ubuntu 24.04, GNU coreutils 9.4, real
coord-count.sh, unmodified) rather than reasoned about: GNU date rejects
-j outright ("invalid option -- 'j'", exit 1), so every mailbox printed
"-" on Linux regardless of actual dead-letter status - WP1d detection was
silently inert on the one platform this public plugin cannot assume away.
Fixed with a one-time `date --version` flavor check (measured: exits 0
with a GNU banner on GNU date, exits nonzero with "illegal option" on BSD
date) branching to `date -u -d <RFC-3339-string>` on GNU, unchanged
`-j -f` on BSD. The RFC 3339 acceptance is documented (GNU Coreutils
manual, "Options for date"), not live-measured, since Colima was removed
from this machine mid-session before that specific sub-claim could be
re-verified live.

coord-selftest.sh section 31 (e) previously pinned the bug (asserted "-"
for an ungrammatical filename); updated to assert "?", plus a new
contrast check that claimed and could-not-measure are always different
tokens. Section 32 pins the GNU branch with a PATH shim for `date` that
replays only measured facts (the --version and -j behaviors above) rather
than a speculative mock.

All four selftest suites green: coord 200/200, board 178/178 (regression,
unaffected as predicted), route 69/69, guard 21/21.

Out of scope, reported not fixed: coord-sweep.sh:77 and both selftests'
fixture generators use `date -v-Nd` (BSD-only, same class) - the suite
itself cannot run on Linux yet. No CI exists in this repo to catch that
drift automatically.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F1mzsaUmjqFHArbArG7EpF
2026-08-14 23:44:01 +02:00
..
board-selftest.sh feat(coord,board): flag mailboxes no session has ever read (WP1d detection half) 2026-08-14 21:52:47 +02:00
board.sh feat(coord,board): flag mailboxes no session has ever read (WP1d detection half) 2026-08-14 21:52:47 +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 fix(coord-count): distinguish claimed from unmeasured, fix Linux date parse 2026-08-14 23:44:01 +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 fix(coord-count): distinguish claimed from unmeasured, fix Linux date parse 2026-08-14 23:44:01 +02:00
coord-send.sh fix(coord-send): stop rejecting dot-prefixed repo names 2026-08-09 21:09:23 +02:00
coord-sweep.sh fix(coord-send): stop rejecting dot-prefixed repo names 2026-08-09 21:09:23 +02:00
route-selftest.sh feat(route)!: Fable rows are a hand-written override, never a route.sh outcome 2026-08-09 22:03:05 +02:00
route.sh feat(route)!: Fable rows are a hand-written override, never a route.sh outcome 2026-08-09 22:03:05 +02:00
state-line-guard-selftest.sh fix(hooks): raise state-line-guard MAX_LINES from 60 to 120 2026-08-14 21:35:31 +02:00