feat(issue-50): create --onboard waits for the onboarding job to end (A)

The handshake only said the agent saw the prompt (#23). create_session.sh
now waits, after `started`, for the onboarding job to reach a terminal
status and makes that its own result, so the orchestrator learns it from
create's exit (MULTI_AGENT_RULES §6) instead of guessing from herdr's
agent_status:

- lib_py/delegation/wrapper.py: `wait-terminal` (completed|error|cancelled,
  `timeout` after --timeout, `missing` when the record is gone; stops with
  its caller via --watch-pid) and `onboard-exit` (completed 0, error or
  cancelled 44, timeout or missing 45). bash branches on the printed answer.
- lib.sh: delegate_wait_terminal / delegate_onboard_exit, thin calls.
- create_session.sh: `onboarding completed: job <id> (<n>s)` on stdout, or
  `last_visible_status: onboarding-<status>` on the row, the reason on stderr
  and `exit 44` / `exit 45` after `trap - EXIT` - the session is kept, as for
  a missing handshake. The "no started" path (error, exit 0 before) now ends
  with 44. MAM_ONBOARD_WAIT_S (default 600, floor 1) bounds the wait.
- worktree_prepare.sh: 44/45 pass through with "session and worktree kept".
- create SKILL.md exit table (44, 45) and the knob; the #42 inventory follows.
- tests/conftest.py: --onboard is the default, so ~60 sandbox create tests
  reach the new wait. The mock herdr now acts as the agent for create's
  onboarding prompt - it runs the publish commands the prompt names through
  the real publish_event.py - and MAM_ONBOARD_WAIT_S=3 caps a test that turns
  that off (MAM_MOCK_ONBOARD_HANDSHAKE=0 -> 44, `started` -> 45). The
  delegate-job wrapper's prompt has another shape and is never answered.
- tests/test_issue50_onboard.py: the decision tables, create in the sandbox
  (0 / 44 / 45, session kept, row note, trap window), the knob's integer
  rule, worktree_prepare's pass-through.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Fable 5.1 committed 2026-10-10 15:39:21 +00:00
1 parent 40293841e7
commit c29c5b2142
9 files changed
+367 -14

No files matched your search

+11 -9
View File
@@ -60,8 +60,8 @@
},
{
"skill": "multi-agent-mux-create",
"start": 129,
"end": 147,
"start": 134,
"end": 152,
"lang": "yaml",
"sha": "2dd608d04ae0",
"class": "c",
@@ -74,8 +74,8 @@
},
{
"skill": "multi-agent-mux-create",
"start": 153,
"end": 155,
"start": 158,
"end": 160,
"lang": "bash",
"sha": "613003708f19",
"class": "c",
@@ -88,8 +88,8 @@
},
{
"skill": "multi-agent-mux-create",
"start": 193,
"end": 197,
"start": 202,
"end": 206,
"lang": "bash",
"sha": "38836d31bf38",
"class": "c",
@@ -103,8 +103,8 @@
},
{
"skill": "multi-agent-mux-create",
"start": 219,
"end": 241,
"start": 228,
"end": 250,
"lang": "bash",
"sha": "d90cfd2555fd",
"class": "b",
@@ -612,10 +612,12 @@
"4",
"42",
"43",
"44",
"45",
"other"
],
"passthrough": {
"4": "multi-agent-mux-create/scripts/create_session.sh:515"
"4": "multi-agent-mux-create/scripts/create_session.sh:532"
}
}
},