Repository navigation
fix(exec): block background tasks under the orchestrator; WIP-commit stranded exec work (#1032) - #1034
Merged
admarble merged 2 commits intoSep 10, 2026
Conversation
…stranded exec work (#1032) Every stranded-exec transcript found (ad-motion #226/#233, sequant #933/#990, the vid-gen bench) ended with the agent starting the test suite as a Monitor or a backgrounded Bash command and then "waiting for the notification". Under sequant run the phase ends when the turn ends, no notification is ever delivered, and the #879 guard fails the phase with the work uncommitted. - pre-tool.sh: with SEQUANT_ORCHESTRATOR set, HOOK_BLOCK a Monitor tool call and a Bash call with run_in_background: true, pointing at the foreground form (`timeout 600 npm test ...`). Interactive sessions untouched. - /exec §3: foreground-only rule for the suite, after a WIP commit. - phase-executor: when the exec tree is `uncommitted`, commit the dirty paths as `wip(#N): exec ended with uncommitted work (auto-committed by sequant)` before failing the phase; the error names the commit. Git errors fall back to the pre-#1032 message and leave the work in place. - Tests: hook integration (AC-1/AC-2), skill gate (AC-3), real-git WIP commit (AC-4/AC-5). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR
…AC-3 test to the #1032 contract The pre-tool hook (and commitlint setups downstream) reject `wip` as a commit type, so the auto-commit and the /exec skill example now use `chore(#N): wip checkpoint — …`. The #879 AC-3 integration case asserted the guard mutates nothing; it now asserts the dirty file is byte-identical AND checkpointed on the branch, which is the new contract. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR
admarble
added a commit
that referenced
this pull request
Sep 10, 2026
…doff constraints Adds what running wave 1 on 2026-09-10 decided and found: D15 (#982 AC-3 verify command amended), D16 (#990 AC-6 `update --dry-run` clause moved to #1030), D17 (background-task stranding → #1032 / PR #1034); the execution table on issue-graph.md; HANDOFF.md's ledger rewritten for the next runner (three PRs awaiting the owner, owner actions, MCP 30-minute wall guidance). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR
admarble
added a commit
that referenced
this pull request
Sep 10, 2026
…xecution ledger (#1031) * docs(graph): add node 09 (#1030 dry-run/apply drift) and decision D14 to the wave-2 plan Claude-Session: https://claude.ai/code/session_01Y4tK7EXMEUze1VkjkKAMU4 Entire-Checkpoint: b5dab9dfebb7 * docs(graph): wave-1 execution record — D15–D17, post-wave ledger, handoff constraints Adds what running wave 1 on 2026-09-10 decided and found: D15 (#982 AC-3 verify command amended), D16 (#990 AC-6 `update --dry-run` clause moved to #1030), D17 (background-task stranding → #1032 / PR #1034); the execution table on issue-graph.md; HANDOFF.md's ledger rewritten for the next runner (three PRs awaiting the owner, owner actions, MCP 30-minute wall guidance). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
admarble
pushed a commit
that referenced
this pull request
Sep 10, 2026
…anded on main AC-4's gate caught exactly the drift it exists for: merging main brought the seventeenth distinct HOOK_BLOCKED refusal (#1032, PR #1034) and the computed count no longer matched the typed slot. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR Entire-Checkpoint: 5070c7c3df27
admarble
added a commit
that referenced
this pull request
Sep 10, 2026
…TY.md (#1035) * test(#980): gate test for SECURITY.md and THREAT-MODEL.md (WIP) Entire-Checkpoint: a7d871dfe538 * docs(security): public threat model, SECURITY.md, and CI-gated claims (#980) Entire-Checkpoint: b88d4b15dee0 * test(#980): report a missing enforcer path cleanly instead of throwing ENOENT Entire-Checkpoint: 3a13e689f28f * test(#980): mark the security-docs gate @tautology-skip with mutation evidence The file asserts on the text of SECURITY.md, THREAT-MODEL.md and README.md; there is no production function to call, by design. Without the pragma the advisory detector reads the whole file as 100% tautological and scripts/qa/tautology-detector-cli.test.ts (which runs the CLI against the branch's own changed test files) exits 1, failing npm test. Entire-Checkpoint: 204e10f911e3 * docs(#980): the merge gate is a human control, not a deterministic one; the injection eval is evidence, not containment Second-pass QA (AC_MET_BUT_NOT_A_PLUS) notes: the ASI01 row listed the human merge gate inside the deterministic bound, contradicting the Residual risks section; the manually dispatched eval was classed deterministic alongside runtime hook refusals. Both cells corrected; the citation gate still passes (35/35). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR Entire-Checkpoint: a606392f4b70 * docs(#980): guard count is 17 after the #1032 background-task guard landed on main AC-4's gate caught exactly the drift it exists for: merging main brought the seventeenth distinct HOOK_BLOCKED refusal (#1032, PR #1034) and the computed count no longer matched the typed slot. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR Entire-Checkpoint: 5070c7c3df27 --------- Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: t <[email protected]>
admarble
deleted the
feature/1032-fix-exec-phase-agent-that-backgrounds-the-tes
branch
September 10, 2026 22:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1032.
Why
Every stranded-exec transcript in the retained logs — ad-motion #226 (08-24) and #233 (09-10), sequant #933 ×2 (09-07) and #990 (09-10), the vid-gen bench #5/#6 (08-30) — ends the same way: the agent starts the full test suite as a
Monitoror a backgrounded Bash command, then "waits for the notification". Undersequant runthe end of the turn is the end of the phase (claude-code.tsreturns on the firstresult), no task notification was delivered in any of those transcripts, and the #879 guard fails the phase with the work uncommitted. An agent that polls instead idles until the MCP 30-minute kill (#980 today).What
pre-tool.shblocks aMonitortool call and aBashcall withrun_in_background: truewheneverSEQUANT_ORCHESTRATORis set, with a message that shows the foreground form. Interactive sessions are untouched. Synced to.claude/hooks/and the pluginhooks/copy./exec§3 Checks-first: run the suite once, foreground, withtimeout, after a WIP commit; never wait on a background task. Synced to all three skill copies.mapAgentSuccessToPhaseResultfinds anuncommittedexec tree it commits exactly the dirty paths aschore(#N): wip checkpoint — exec ended with uncommitted work (auto-committed by sequant)(a conventional type — the pre-tool hook rejectswip) (--no-verify: a checkpoint, not a reviewed commit), then still fails the phase, naming the commit. Git errors fall back to the pre-fix(exec): phase agent that backgrounds the test suite and waits for a notification strands uncommitted work — block Monitor/run_in_background under the orchestrator, WIP-commit on the no-commit guard #1032 message and leave the work in place.Known gap, not addressed:
Agent(run_in_background=true)for parallel implementers is still allowed — the/execskill prescribes it and no stranded transcript involved it.AC verification
npx vitest run src/lib/__tests__/pre-tool-background-guard.integration.test.ts -t "AC-1"… -t "AC-2"npx vitest run src/lib/__tests__/exec-skill-foreground-rule.test.ts→ 6 passed;npm run lint:skill-sync→ 44 synced, 0 divergednpx vitest run src/lib/workflow/phase-executor.wip-commit.test.ts -t "AC-4"… -t "AC-5"grep -c "run_in_background" CHANGELOG.md→1npm run build && npm testAlso updated:
phase-executor.integration.test.ts#879 AC-3 case (see AC-7 row).Mutation verification
Mutation-verified: AC-1 — deleted the orchestrator guard block from
.claude/hooks/pre-tool.sh;pre-tool-background-guard.integration.test.ts > AC-1 > blocks a Monitor tool calland> blocks a Bash call with run_in_background: truefailed (2); restored.Mutation-verified: AC-3 — deleted the "Foreground only (#1032)" paragraph from
.claude/skills/exec/SKILL.md; bothexec-skill-foreground-rule.test.tscases for that copy failed; restored.Mutation-verified: AC-4 — dropped the
git commitcall inautoCommitUncommittedWork;phase-executor.wip-commit.test.ts > AC-4 > commits the dirty paths, still fails, and names the commitfailed; restored.🤖 Generated with Claude Code