@@ -15,7 +15,10 @@ set -euo pipefail
1515# - Claude OAuth env forwarding;
1616# - dashboard configured rows before containers exist;
1717# - dashboard I* rows for interactive containers;
18- # - dashboard P row and [P] post-process action.
18+ # - dashboard P row, with P tailing its logs and lowercase p
19+ # starting the post-process run;
20+ # - post_process.setup override that runs a lighter post-process
21+ # setup instead of inheriting the top-level setup.
1922#
2023# The generated config uses normal prompts and max_idle=3. It does
2124# not include a timeboxed "keep running for N minutes" prompt. Stop
@@ -139,6 +142,25 @@ setup_log="test-results/setup-${setup_id}.log"
139142EOF
140143chmod +x " $REPO_DIR /scripts/setup.sh"
141144
145+ cat > " $REPO_DIR /scripts/post-setup.sh" << 'EOF '
146+ #!/bin/bash
147+ set -euo pipefail
148+
149+ # Lighter setup used only for the post-process pass. swarm.json sets
150+ # post_process.setup to this script, so launch.sh runs it instead of
151+ # inheriting the heavier top-level scripts/setup.sh. The unique marker
152+ # makes the override observable: it proves the post-process container
153+ # ran this lighter script and did not redo the top-level setup.
154+ mkdir -p test-results
155+ {
156+ printf 'POST_SETUP_RAN at %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
157+ printf 'driver=%s model=%s\n' \
158+ "${SWARM_DRIVER:-unknown}" \
159+ "${SWARM_MODEL:-unknown}"
160+ } >> test-results/post-process-setup.log
161+ EOF
162+ chmod +x " $REPO_DIR /scripts/post-setup.sh"
163+
142164cat > " $REPO_DIR /prompts/headless.md" << 'EOF '
143165You are running a manual claude-swarm smoke test in a disposable repo.
144166
@@ -241,6 +263,7 @@ cat > "$REPO_DIR/swarm.json" <<'EOF'
241263 ],
242264 "post_process": {
243265 "prompt": "prompts/post-process.md",
266+ "setup": "scripts/post-setup.sh",
244267 "driver": "codex-cli",
245268 "model": "gpt-5.4",
246269 "effort": "medium",
@@ -309,9 +332,10 @@ Expected result:
309332 \` unknown\` / \` not found\` .
310333- Omitted \` count\` on \` claude-manual\` and \` count: 0\` on
311334 \` codex-manual\` should not add numbered rows.
312- - The post-process row should appear as \` P\` , matching the key that
313- starts it.
314- - The footer should show \` [P] post-process\` .
335+ - The post-process row should appear as \` P\` , the same letter as the
336+ \` P\` key that tails its logs once it exists.
337+ - The footer should show \` [p] post-process\` -- lowercase \` p\`
338+ starts the run.
315339
316340Press \` q\` to exit.
317341
@@ -326,10 +350,11 @@ Expected result:
326350- Five numbered containers start: 3 Claude OAuth and 2 Codex ChatGPT.
327351- The dashboard header reports 5 agents.
328352- Press \` 1\` through \` 5\` to inspect numbered-agent logs.
329- - \` p\` should only tail post-process logs after a post-process
330- container exists. When it appears, \` P\` should be hidden because
331- post-process is already running.
332- - \` P\` should ask for confirmation before starting post-process.
353+ - \` P\` should only tail post-process logs after a post-process
354+ container exists; the logs hint becomes \` [1-9/P]\` then.
355+ - \` p\` should ask for confirmation before starting post-process.
356+ Once the container exists, the \` [p] post-process\` start hint
357+ disappears (stop with \` s\` before starting another run).
333358
334359This fixture uses \` max_idle: 3\` and normal prompts, so agents can
335360finish naturally. Once you have seen enough, press \` s\` in the
@@ -434,10 +459,10 @@ Expected result:
434459./dashboard.sh
435460\`\`\`
436461
437- Press \` P \` , confirm with \` y\` , and watch the \` P\` row. After the
438- post-process container exists, lowercase \` p \` should tail its logs and
439- \` P \` should disappear . Use \` s\` or \` ./launch.sh stop \` before
440- starting a new post-process run.
462+ Press \` p \` , confirm with \` y\` , and watch the \` P\` row. After the
463+ post-process container exists, uppercase \` P \` tails its logs and the
464+ \` [p] post-process \` start hint disappears . Use \` s\` or
465+ \` ./launch.sh stop \` before starting a new post-process run.
441466
442467Equivalent non-dashboard command:
443468
@@ -448,9 +473,28 @@ Equivalent non-dashboard command:
448473Expected result:
449474
450475- Post-process uses the Codex ChatGPT profile from \` post_process\` .
476+ - Before the prompt runs, the container executes
477+ \` scripts/post-setup.sh\` (from \` post_process.setup\` ), which appends
478+ a \` POST_SETUP_RAN\` line to \` test-results/post-process-setup.log\` .
479+ This is the lighter post-process setup; the heavier top-level
480+ \` scripts/setup.sh\` is not redone here.
451481- It writes \` test-results/post-process-summary.md\` .
482+ - The summary lists \` post-process-setup.log\` , so the override stays
483+ visible after harvest.
452484- The summary ends with \` POST_PROCESS_DONE\` .
453485
486+ The \` post_process.setup\` key has three modes. This fixture ships the
487+ override (a path); to try the others, edit \` swarm.json\` :
488+
489+ - Path (the default here): \` "setup": "scripts/post-setup.sh"\` runs
490+ that lighter script for the post-process pass only.
491+ - Skip: \` "setup": false\` or \` "setup": ""\` runs no setup, so a heavy
492+ top-level setup is not repeated. \` post-process-setup.log\` is then
493+ absent.
494+ - Inherit: remove the \` setup\` key from \` post_process\` to reuse the
495+ top-level \` scripts/setup.sh\` ; a \` test-results/setup-*.log\` for the
496+ post-process pass appears instead.
497+
454498## 8. Harvest And Inspect
455499
456500\`\`\` bash
0 commit comments