feat: add external host-root mode with isolated workers - #1
Closed
YrFnS wants to merge 39 commits into
Closed
Conversation
…e remains blocked
Owner
Author
|
Closing this duplicate fork-local PR. The branch is already the head of upstream PR kunchenguid#1238. |
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.
Intent
Update FirstMate PR kunchenguid#1238 so Second Brain remains the instruction and lifecycle root only for the primary supervisor, while ordinary ship and scout workers launch from their isolated target worktree. Workers must load target-repository instructions natively, avoid the full Second Brain startup context, retain FirstMate task briefs, completion signaling, durable host/target identity, recovery, teardown safety, and all supported harness/backend behavior. Preserve secondmate isolation. Rebase the existing PR onto current upstream main, resolve conflicts without dropping newer upstream semantic busy-state, Herdr, dispatch, teardown, or documentation behavior, validate focused and full suites, update the existing PR, and do not merge it.
What Changed
Risk Assessment
Testing
HEAD and diff checks, a real Herdr/Treehouse worker lifecycle, the focused acceptance suite, and the full non-analysis behavior suite were exercised; the full run’s only failure was a Pi TUI observation race, its durable export proved the product had succeeded, and the minimal test correction passed the complete Pi Calm suite, while expected opt-in/live-backend skips remained. An initial broad attempt ran one passing embedded ShellCheck check before selection was corrected; no dedicated lint or static-analysis suites ran. No screenshot was applicable because this is a CLI/runtime isolation change, so reviewer-visible evidence is provided as a real lifecycle transcript and rendered HTML export.
Evidence: Real Herdr host-root lifecycle transcript
A real Herdr worker launched in an isolated Treehouse target, loaded target instructions, retained distinct FM_HOST_ROOT/FM_TARGET_WORKTREE identity, completed through status-log reconciliation, and tore down without dirtying the host or primary target./tmp/no-mistakes-evidence/01KYY0FT6X7BB6X6PZFN82RYAC/fm-calm-pi-extension.SFdisk/calm-export.html)Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 3 issues found → auto-fixed ✅
bin/fm-watch.sh:283- The host-tmux supervision reference is now the task ID, but the stale path passes it tostale_is_terminal(), whose fallback strips a leadingfm-. A supported ID such asfm-footherefore readsfoo.status, delaying terminal wakes until the heartbeat catch-all. Pass the recorded task ID or actual endpoint to the status check.bin/fm-spawn.sh:1831-sq_turnendis shell quoting embedded inside a TOML-cvalue. Apostrophes produce an invalid TOML escape, while quotes or backslashes can corrupt the value, causing Codex to reject the launch and lose required completion signaling. Serialize the notify command as TOML/JSON before shell-quoting the complete override.docs/verification/supervision.md:66- Intent requires ordinary workers to “avoid the full Second Brain startup context,” but this verification record says Codex and OpenCode “loaded the hostAGENTS.md” and emitted a host session-start event. Confirm whether this is stale evidence that must be marked superseded, or whether forbidden host context still enters workers.🔧 Fix: Captain: fix host-root review regressions
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
git rev-parse HEADandgit diff --stat e595611291247368b982eb729097c54f2b45aa78..b174555be5698848cfef54ac401a0a24ca71d02e/bin/bash -x tests/fm-backend-herdr-host-root-e2e.test.shbin/fm-test-run.sh tests/fm-host-root-mode.test.sh tests/fm-host-setup.test.sh tests/fm-backend-herdr.test.sh tests/fm-backend.test.sh tests/fm-backend-tmux-smoke.test.sh tests/fm-backend-cmux.test.sh tests/fm-backend-orca.test.sh tests/fm-backend-zellij.test.sh tests/fm-brief.test.sh tests/fm-session-start.test.sh tests/fm-spawn-dispatch-profile.test.sh tests/fm-daemon.test.sh tests/fm-watch-triage.test.sh tests/fm-gate-refuse.test.sh tests/fm-decision-hold-lifecycle.test.sh tests/fm-pr-check-security.test.sh tests/fm-review-diff.test.sh tests/fm-secondmate-harness.test.sh tests/fm-secondmate-lifecycle-e2e.test.sh tests/fm-secondmate-liveness.test.sh tests/fm-secondmate-safety.test.sh tests/fm-teardown-endpoint-safety.test.sh tests/fm-teardown.test.sh --json /tmp/no-mistakes-evidence/01KYY0FT6X7BB6X6PZFN82RYAC/focused-tests.jsonFull behavior selection fromfull-tests-no-analysis-selected.txtthroughbin/fm-test-run.sh, excluding the three dedicated static-analysis suites and masking embedded ShellCheck checksTwo isolated pre-fix reruns oftests/fm-calm-pi-extension.test.shplus preserved pane/export inspection/bin/bash tests/fm-calm-pi-extension.test.shafter the test-only race correctionFinalgit status --shortandherdr lab listcleanup checks✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.