fix(orders): call the order-verbs by absolute path, not bare PATH names

board.sh's --dispatch --order-id thin starter told a dispatched session
to run `coord-order-claim <id>` / `coord-order-done <id> ...` literally.
Neither is on PATH, so step one was command-not-found - easy to misread
as "the order does not exist" (Verifiseringsloven ansikt 4).

Measuring the denominator beyond the one line the order named found the
same defect in two more emitters that hand a session its own next-step
text: coord-order-inbox.sh's SessionStart injection (every pending/claimed
order, not only dispatched ones) and coord-order-claim.sh's own WHEN DONE
/ IF YOU CANNOT lines. All three now call the verb via $SELFDIR (derived
from $0's directory, correct at emission time), and board.sh's interpolation
of it is shell-clean-guarded like the other two values sharing its
double-quoted position - reachability proven with a copy of board.sh run
from a space-containing path, not asserted.

board-selftest 239->246, orders-selftest 99->104. CLAUDE.md counts and a
new F-paragraph updated to match.

ORDRE 20260817T213139Z-643032142-from-.claude

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019syEQHvw2jf1dTR4bUPKRG
This commit is contained in:
Kjell Tore Guttormsen 2026-08-18 09:16:59 +02:00
commit 393499c3ee
6 changed files with 130 additions and 11 deletions

View file

@ -22,6 +22,17 @@
set -u
export LC_ALL=C
# ORDRE 65 (.claude, 2026-08-17): `coord-order-claim`/`coord-order-done` are
# not on PATH. This block is injected verbatim at SessionStart as
# additionalContext - a session reading it may run the shown command via its
# own Bash tool, so a bare verb name is command-not-found on the very first
# try, misreadable as "the order does not exist" (Verifiseringsloven ansikt
# 4). SELFDIR is derived from where THIS script is actually running FROM
# ($0's directory), the same technique board.sh uses for its dispatch
# starter - correct at the moment this text is generated, for whichever
# install location is live then.
SELFDIR="$(cd "$(dirname "$0")" && pwd)"
COORD="${CLAUDE_COORD_DIR:-$HOME/.claude/coord}"
REPO=""
@ -86,7 +97,7 @@ subject: ${subj}"
[ -n "$ret" ] && OUT="${OUT}
returned earlier: ${ret}"
OUT="${OUT}
-> claim: coord-order-claim ${id} | leave it: say to the operator why
-> claim: bash $SELFDIR/coord-order-claim.sh ${id} | leave it: say to the operator why
"
PENDING=$((PENDING + 1))
done
@ -105,7 +116,7 @@ if [ -d "$CLAIMED" ]; then
OUT="${OUT}
--- order: ${id} (from ${from}, CLAIMED ${cage}d ago) ---
subject: ${subj}
-> in flight. If no session is working it, put it back: coord-order-done ${id} --return --reason \"<why>\"
-> in flight. If no session is working it, put it back: bash $SELFDIR/coord-order-done.sh ${id} --return --reason \"<why>\"
"
CLAIMED_N=$((CLAIMED_N + 1))
done