feat(orchestration): phase-aware Baton composition (v1.2.0)#10
Conversation
|
Flagging a separate finding that surfaced while I was working in this area — it's orthogonal to the dispatch brake (this PR answers whether delegation is worth it; the finding below is a bug in how the long-running-process handoff behaves), so it doesn't conflict with the direction here. But it touches the same policy file, and it means the current detach-and-yield rule is actively harmful, so I wanted it in front of you before v1.1.6. The findingThe rule in A foreground Bash command that exceeds its
I chased three wrong mechanisms before this held up (killed-at-turn-boundary, SIGPIPE-on-stdout, stranded-but-uncollected) — each reproduced cleanly and then failed a control. The decisive variable turned out to be foreground-vs-background spawn, nothing in the command itself. The correction
This supersedes my own #7, which the evidence now shows was patching a self-inflicted wound. If useful
Happy to fold the prose fix into this PR instead if you'd rather keep v1.1.6 as one changeset — your call on sequencing. Raw traces/fixtures available if you want to reproduce the SIGTERM. |
Co-authored-by: dromsak <spoof_cud.0j@icloud.com>
|
Integrated the minimal long-process correction in ff9f118: executor roles no longer detach, the main orchestrator owns tracked background commands, and a regression test locks the boundary. The v1.1.6 changelog credits @dromsak and the commit carries a Co-authored-by trailer. PR #11's plugin/hook replatform remains separate. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff9f118b71
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16b9650774
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b7e4d684e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40b9b7fd4f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32e89b85ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
What changed
Prepare pilotfish v1.2.0 as a phase-aware orchestration release instead of a one-size-fits-all dispatch brake.
plan-verifier(READY/REVISE) and require explicit approval before writesverifierread-and-run after implementation (CONFIRMED/REFUTED); separate it from the pre-approval rolemodel; frontmatter remains the sole model sourcesecurity-reviewerbefore approval; write-capablesecurity-executoraccepts only approved implementation contractstoolsallowlists; older or unidentifiable builds stop before writesThe release also preserves the original dispatch experiment and re-scopes its early Baton probes as incomplete discovery-only observations rather than a compatibility failure.
Why
The earlier brake conflated two different questions. Discovery needs a stable research contract but may happen before the implementation outcome is known; writing agents need a stable execution contract and required approval. Treating both phases alike either suppresses useful evidence gathering or dispatches executors before the main session can own a coherent Plan.
A dual-mode verifier prompt was insufficient because Plan readiness happens before approval but the outcome verifier needs Bash after implementation. The final design separates capability:
plan-verifierhas only Read/Glob/Grep, while outcomeverifierretains Bash but no write tools. Security analysis and implementation use the same reviewer/executor split.Separately, four direct harness trials from @dromsak showed that
nohup/setsidescape task tracking, while a timeout-promoted command under a foreground-spawned agent is terminated shortly after the agent returns. The minimal prose fix fromfix-subagent-detachis included without adopting PR #11's plugin/hook replatform.This was initially prepared under a v1.1.6 working stamp, then reclassified as v1.2.0 before release because it changes orchestration behavior and adds roles and capability boundaries rather than delivering a patch-only fix.
Live Gate
The corrected fresh-session Gate used native first-party Claude routing with the installed Baton skill and the PR candidate policy.
plan-verifierused only Glob/Read and returnedREADYmech-executorwrote onlyREPORT.md;npm testpassed; fresh Opus outcomeverifierreturnedCONFIRMEDAll three named-role calls omitted invocation-level
model. Baton chose direct main-session Discovery, then delegated the stable approved writing contract tomech-executor; this validates phase-dependent topology rather than mandatory fan-out.The exact runtime policy and eight-role
--agentsJSON are committed underbenchmarks/baton-compatibility/final-gate-snapshot/. That evidence retains the v1.1.6 candidate stamp used during the run. The v1.2.0 release policy differs only in the inert version comment;results.jsonrecords both raw hashes and tests lock the normalized policies together.The first isolation attempt is disclosed but rejected: excluding the user setting source hid the installed Baton skill, so no approval turn was run. An earlier complete dual-mode-verifier Gate is also preserved but superseded after review found its no-write boundary was prompt-only. Raw transcript hashes, snapshots, and exact prompts remain under
benchmarks/baton-compatibility/.The final fixture did not trigger long work or invoke
security-reviewer. Long-process evidence remains the contributor's four dedicated direct trials plus regression coverage across every Bash-capable role; the security reviewer boundary is its positive tool allowlist plus policy tests. No extra edge-case Claude run is claimed as coverage.Other controls
mech-executor; 12/12 pass; in the execution-only segment, reported cost field down 36.01% with wall time up 7.92%; neither comparison included the required outcome verifier, so this proves route reachability rather than full-lifecycle savingsThese are single-run observations. Client-reported cost is not a provider invoice and no population-performance claim is made.
Checks
This PR is ready for review. It does not create the v1.2.0 tag or release.