repo-mailbox/scripts
Kjell Tore Guttormsen 21e2873e21 fix(coord-send): reply mode claimed "marked handled" without checking
coord-send.sh ran coord-done under `>/dev/null 2>&1` and then printed the
handled claim unconditionally. Measured with a stub coord-done exiting 1:
the original stayed in the inbox, no archive/ was created, and coord-send
still exited 0 saying "marked handled" - a false success in the message
transport itself, which is why every reply had to be verified by hand.

The predicate is deliberately wider than the exit code: coord-done exits 0
when it archives nothing (an unknown name is idempotently fine by its own
contract), so an exit-code-only fix still certifies a message that never
moved. The check is exit 0 AND the original no longer being at
$COORD/$FROM/inbox/$REPLYTO - recomputed rather than reusing $REPLY_ORIG,
which resolves to the inbox OR the archive, so replying to an already
archived original moves nothing and must not warn.

Failure is exit 1, a new status: the reply WAS delivered and re-sending it
would duplicate it, so 2 stays the nothing-was-written status.

Selftest section 34 (14 checks, red first) pins all four cases: coord-done
fails outright, coord-done exits 0 without moving, the real happy path, and
an archive-path reply. coord-selftest 206 -> 220.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ett8uHMDLir6trFaMzrYRu
2026-08-16 15:42:13 +02:00
..
board-selftest.sh fix(board): a missing coord-count.sh sibling warns instead of lying 2026-08-14 23:53:31 +02:00
board.sh fix(board): a missing coord-count.sh sibling warns instead of lying 2026-08-14 23:53:31 +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-send): reply mode claimed "marked handled" without checking 2026-08-16 15:42:13 +02:00
coord-send.sh fix(coord-send): reply mode claimed "marked handled" without checking 2026-08-16 15:42:13 +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(state-line-guard): Edit path used String.replace, not a function 2026-08-15 20:37:18 +02:00