test(brief): pin the malformed route line, the case that will actually occur

The briefing had checks for a VALID route line and for a MISSING one, but
not for one that exists and carries a value outside route.sh's closed set -
which is the case that arrives on its own as 23 hand-written route lines
drift. route.sh exits 2, the command comes back empty, and without a check
nothing stops a future edit from printing a bare "$ ": the shape of a
runnable command carrying nothing, which is worse than an absent command
because it reads as copied-and-pasteable.

Two checks, because the marker appearing and the command line NOT appearing
are different claims and only both together describe the behavior. Verified
the fixture fails for the right reason: `--path knwon` exits 2 with
"unknown value".

board-selftest 49 -> 51. No behavior change; no version bump.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017orCFDkmp88fLnqDR3chdJ
This commit is contained in:
Kjell Tore Guttormsen 2026-08-01 22:44:35 +02:00
commit 6de2408b28
2 changed files with 28 additions and 2 deletions

View file

@ -54,7 +54,7 @@ marketplace plugin. Three components, one boundary:
- **Board (`scripts/board.sh`):** cross-repo attention board. Reads STATE.md
next-step blocks + board lines, `git status`, and mailbox pending counts, and
prints one line per repo. Read-only by construction: it writes to no repo, no
STATE.md and no mailbox. Pinned by `board-selftest.sh` (49 checks).
STATE.md and no mailbox. Pinned by `board-selftest.sh` (51 checks).
**It lives here because the mailbox is one of its three inputs, and it carries
the same axis distinction the mailbox does.** A pending count means *others
@ -209,7 +209,7 @@ obligations in another repo.
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/board-selftest.sh` must exit 0 (49/49) and
`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
trigger aliases in the skill description are deliberate.

View file

@ -199,6 +199,22 @@ mkrepo "$ROOT/repo-owes"
mkdir -p "$CLAUDE_COORD_DIR/repo-owes/inbox"
echo "msg" > "$CLAUDE_COORD_DIR/repo-owes/inbox/2026-msg1-from-y.md"
# repo-typo: a route line that EXISTS but carries a value outside route.sh's
# closed set. This is the case that actually occurs as route lines are written
# by hand across repos, and it is distinct from having no route line at all:
# route.sh exits 2, the command comes back empty, and the briefing must say so
# rather than print a bare "$ " that reads as a runnable command.
mkrepo "$ROOT/repo-typo"
{
echo "# STATE - repo-typo"
printf '## %s NESTE %s START HER\n' "$HAND" "$EMDASH"
echo "<!-- board: status=planned; blocked-on=-; next-cost=Opus 5/high -->"
echo "<!-- route: path=knwon; verification=strong; reversibility=cheap; scope=local; rationale=x -->"
echo "Neste steg for repo-typo."
} > "$ROOT/repo-typo/STATE.md"
mkdir -p "$CLAUDE_COORD_DIR/repo-typo/inbox"
echo "msg" > "$CLAUDE_COORD_DIR/repo-typo/inbox/2026-msg1-from-y.md"
OUT="$("$BOARD" --roots "$ROOT" 2>/dev/null)"
# --- 1. Discovery ---------------------------------------------------------
@ -342,6 +358,16 @@ check "brief derives the exact startup command from the repo's route line" $?
printf '%s' "$BRIEF" | grep -qE '^ \$ claude --model'
check "startup command starts on its own line, not appended to NESTE prose" $?
# A route line that parses to a value route.sh rejects must degrade the same
# way a missing one does. Silence here would print a bare '$ ' - the shape of a
# runnable command, carrying nothing - which is worse than an absent command
# because it looks copied-and-pasteable.
printf '%s' "$BRIEF" | grep -A4 'repo-typo' | grep -qi 'route'
check "unparseable route line degrades to a marker, not to an empty command" $?
printf '%s' "$BRIEF" | grep -A4 'repo-typo' | grep -qE '^ \$ claude'; [ $? -ne 0 ]
check "unparseable route line never emits a command line at all" $?
# repo-a owes 3 messages and has no route line. A fabricated command would be
# worse than none: it would read as authoritative while being a guess.
printf '%s' "$BRIEF" | grep -A4 'repo-a' | grep -qi 'route'