fix(dispatch): background starter passes --repo to both order verbs

A background child runs in a worktree, and without --repo the order
verbs derive identity from the git toplevel's basename - the worktree's
name, not the repo's. Measured in the session that built the form: the
claim ran before the worktree and won; coord-order-done ran inside it and
exited 1 "no claimed order ... for dispatch-bg-form", leaving the order in
flight until --repo repo-mailbox was passed. The order's own starter
template carried the same defect.

§19b gains two checks (red against 24adf59, same predicate), the
template passes --repo <repo> to claim and done, and the skill says why.

Suites under bash 3.2: coord 257, board 495, route 73, orders 116,
guard 54 = 995. npm test 12/12.

Order 20260923T070445Z-9974217048-from-.claude (follow-up to 24adf59).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-23 09:37:38 +02:00
commit 741ada82b7
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
5 changed files with 32 additions and 12 deletions

View file

@ -15,14 +15,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
--disallowedTools AskUserQuestion,SendMessage,ListAgents --bg --name <name>
"<starter>"`. `--model` sits directly after `claude`, because the budget hook
counts a start only in that position. The three tools are disallowed per
hardening T4. The ASCII starter claims by full path, compares against NESTE,
hardening T4. The ASCII starter claims by full path with `--repo`, compares against NESTE,
pins the branch with `git checkout -B`, forbids push/tag/release, and closes
by full path. The skill also says what the PM does afterwards: watch the
by full path, also with `--repo`. Inside a worktree the verbs would otherwise
derive the worktree's name as the identity. That was measured: a close
without `--repo` exited 1 and left the order in flight. The skill also says what the PM does afterwards: watch the
order file, re-measure on the commit, and leave the merge to the operator's
push round. The skill description now triggers on the form. `board.sh` is
unchanged: the form has no pane, no plan block and no `morning` consumer, so
`--target-pane` stays `yes|no`. board-selftest §19b pins all of it (15
checks, 12 red before the skill changed).
`--target-pane` stays `yes|no`. board-selftest §19b pins all of it (17
checks, 14 red before the skill changed).
## [0.35.0] - 2026-09-18

View file

@ -467,7 +467,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` (493 checks).
STATE.md and no mailbox. Pinned by `board-selftest.sh` (495 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
@ -1524,9 +1524,12 @@ marketplace plugin. Three components, one boundary:
splicing it keeps `--model` in the one position the budget hook counts.
board-selftest §19b reads the skill's background SECTION only. It pins
model-first (with a planted-wrong-order control), the three T4 tools,
`INGEN push`, `git checkout -B`, both order verbs by full path, and a
description that triggers on the form. It also pins that `--target-pane`
still refuses `bg`. **Stated overlap, not closed:** starter steps (1), (2) and
`INGEN push`, `git checkout -B`, and both order verbs by full path AND with
`--repo`. A worktree's git toplevel basename is the worktree's name, so
derived identity looks in the wrong queue. That was measured in the building
session: its close exited 1 until `--repo` was passed. The section also pins
a description that triggers on the form, and that `--target-pane` still
refuses `bg`. **Stated overlap, not closed:** starter steps (1), (2) and
(4) repeat the protocol `board.sh`'s thin starter carries. A protocol change
must move both copies.
@ -1570,7 +1573,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 (257/257),
`bash scripts/board-selftest.sh` must exit 0 (493/493),
`bash scripts/board-selftest.sh` must exit 0 (495/495),
`bash scripts/route-selftest.sh` must exit 0 (73/73),
`bash scripts/orders-selftest.sh` must exit 0 (116/116) and
`bash scripts/state-line-guard-selftest.sh` must exit 0 (54/54).

View file

@ -14,7 +14,7 @@ Session A in repo X leaves a message for repo Y; the next session in repo Y gets
![Hooks](https://img.shields.io/badge/hooks-1-green)
![Skills](https://img.shields.io/badge/skills-4-orange)
![CLI scripts](https://img.shields.io/badge/CLI_scripts-8-blue)
![Selftest checks](https://img.shields.io/badge/selftest_checks-993-blue)
![Selftest checks](https://img.shields.io/badge/selftest_checks-995-blue)
---
@ -203,7 +203,7 @@ Note that raising the inbox's priority (Rule 7) deliberately does **not** widen
## Development
bash scripts/coord-selftest.sh # 257 checks against a throwaway mailbox
bash scripts/board-selftest.sh # 493 checks against a throwaway repo tree
bash scripts/board-selftest.sh # 495 checks against a throwaway repo tree
bash scripts/route-selftest.sh # 73 checks, incl. the route->board round trip
bash scripts/orders-selftest.sh # 116 checks, incl. the 20-way barriered claim race
bash scripts/state-line-guard-selftest.sh # 54 checks, incl. the Edit replace_all projection and the ratchet

View file

@ -1955,6 +1955,15 @@ printf '%s\n' "$dsk_bg" | grep -q 'bash [^ ]*/scripts/coord-order-claim\.sh '
check "background starter claims by FULL path to coord-order-claim.sh" $?
printf '%s\n' "$dsk_bg" | grep -q 'bash [^ ]*/scripts/coord-order-done\.sh '
check "background starter closes by FULL path to coord-order-done.sh" $?
# ...and both carry --repo. A background child runs in a WORKTREE, whose git
# toplevel basename is the worktree's name, not the repo's, so a verb that
# derives its identity looks in the wrong queue. Measured 2026-09-23 in the
# session that built this section: claim ran before the worktree and won;
# done ran inside it and exited 1 "no claimed order ... for dispatch-bg-form".
printf '%s\n' "$dsk_bg" | grep -q 'coord-order-claim\.sh --repo [^ ]* '
check "background starter claims with --repo (a worktree's name is not the repo's)" $?
printf '%s\n' "$dsk_bg" | grep -q 'coord-order-done\.sh --repo [^ ]* '
check "background starter closes with --repo (a worktree's name is not the repo's)" $?
if printf '%s\n' "$dsk_bg" | grep -qE '^[[:space:]]*coord-order-(claim|done) '; then rc=1; else rc=0; fi
check "background section has no bare coord-order-claim/-done command line" "$rc"
# The description is what makes a skill trigger; a form it does not mention is

View file

@ -233,9 +233,15 @@ full, because a child executes the starter literally and the order verbs are
not on PATH (ORDRE 65).
```text
ORDRE <id> ligger i dette repoets ordrekoe. Gjor dette i rekkefolge: (1) claim den - bash <PLUGIN_ROOT>/scripts/coord-order-claim.sh <id> - claim skriver ut hele ordreteksten. FULL STI ER MED VILJE. Claim KUN denne ordren. (2) Sammenlign mot STATE.md NESTE og uttal avviket i ditt FORSTE svar. (3) Du er en bakgrunnsoekt isolert i en NY worktree: sett grenen din til <hash> (git checkout -B <gren> <hash>) og verifiser. Commit paa den grenen, ingen fletting, INGEN push/tag/release - operatoren pusher. Du kan ikke stille spoersmaal; ved et teknisk valg, ta det anbefalte og skriv valgt X fordi Y. Lange kjoringer i forgrunnen, aldri arm venter. (4) Lukk med bash <PLUGIN_ROOT>/scripts/coord-order-done.sh <id> --commit HASH - eller --return --reason. Rapport som coord til <sender> via coord-send.
ORDRE <id> ligger i dette repoets ordrekoe. Gjor dette i rekkefolge: (1) claim den - bash <PLUGIN_ROOT>/scripts/coord-order-claim.sh --repo <repo> <id> - claim skriver ut hele ordreteksten. FULL STI ER MED VILJE. Claim KUN denne ordren. (2) Sammenlign mot STATE.md NESTE og uttal avviket i ditt FORSTE svar. (3) Du er en bakgrunnsoekt isolert i en NY worktree: sett grenen din til <hash> (git checkout -B <gren> <hash>) og verifiser. Commit paa den grenen, ingen fletting, INGEN push/tag/release - operatoren pusher. Du kan ikke stille spoersmaal; ved et teknisk valg, ta det anbefalte og skriv valgt X fordi Y. Lange kjoringer i forgrunnen, aldri arm venter. (4) Lukk med bash <PLUGIN_ROOT>/scripts/coord-order-done.sh --repo <repo> <id> --commit HASH - eller --return --reason. Rapport som coord til <sender> via coord-send.
```
- **`--repo <repo>` on both verbs, always.** A background child runs in a
worktree, and without `--repo` the verbs derive their identity from the git
toplevel's basename. That basename is the worktree's name, not the repo's.
Measured 2026-09-23: a claim made before the worktree won. The close made
inside the worktree exited 1 with `no claimed order … for <worktree-name>`,
and the order stayed in flight.
- **`Claim KUN denne ordren`** stays in even when the queue holds only this
one. Another order can land between the dispatch and the child's first turn.
- **`<hash>` is the commit the child must build on, not automatically `main`.**