feat: add explicit worktree provisioning overrides - #202
Open
ruby-dlee wants to merge 11 commits into
Open
Conversation
ruby-dlee
force-pushed
the
fm/fm-provisioning-cont-r7
branch
from
August 14, 2026 23:23
3de004b to
26f6417
Compare
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
Recover and ship the abandoned Firstmate worktree-provisioning change from exact preserved commit ef049ac onto a fresh current-main lineage without reviving predecessor workspace, stale branch, or obsolete PR 96. Preserve every reviewed security correction: project path_prepend must affect only the crewmate session after Firstmate's complete launch line resolves; it must never repoint harnesses, wrappers, interpreters, shells, or turn-end hook commands; component-level path_prepend overrides manifest-level order; unexpected explicit-provisioner outcomes fail closed under block policy while documented declaration-driven capability gaps remain explicit and launchable. Reconcile with current main's declaration-driven provisioner rather than replacing or weakening it, recover the known fixture isolation and obsolete continuation-assertion corrections from predecessor evidence, make no unsupported attribution claim about the other 27 historic failures, validate with focused/full tests and a real isolated Treehouse ready/block/capability-gap exercise, preserve ef049ac remotely on a new non-force ref, keep PR 96 closed and unmerged, then push one new branch and open one replacement PR. Do not merge.
What Changed
Risk Assessment
✅ Low: The final correction accurately documents the implemented early and shared pre-endpoint refusal boundaries, and the full branch review found no remaining material source-verifiable risks or intent contradictions.
Testing
The successful baseline full test step was supplemented with focused real-watcher pause/cleanup validation and end-to-end provisioning exercises covering ready, block-policy refusal, capability-gap launch, PATH isolation, component override, runtime pins, raw-launch refusal, and durable lane reporting; CLI evidence was captured, no watcher-owned orphan remained, and the worktree stayed clean.
Evidence: Provisioning end-to-end CLI transcript
Evidence: Watcher pause/cleanup CLI transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (4) ✅
bin/fm-spawn.sh:4357- The required invariant says projectpath_prepend"must affect only the crewmate session after Firstmate's complete launch line resolves," but this branch deliberately launches raw commands unpinned when their first word is a shell builtin, alias, function, construct, or otherwise not PATH-resolvable. A manifest can therefore finishready, publish a pin, and still start a crewmate whose session never receives it. Either refuse this explicitly opted-in pinned spawn, or introduce the pin at the earliest boundary after the shell has resolved the complete raw launch while preserving shell semantics.🔧 Fix: Fail closed on unpinnable raw launches
2 issues (1 error, 1 warning) still open:
bin/fm-spawn.sh:2722- A slash-containing raw first word is treated as safely pinnable without checking that it names an executable. With--harness '/missing/crewtool --go'and a manifest that publishespath_prepend, the pre-lease gate passes, provisioning runs, the tmux/zellij endpoint and metadata are created, and only the in-pane launcher later exits 127. Validate slash-containing words as executable before declaring the line deliverable so unresolved raw launches fail before endpoint creation as required.docs/configuration.md:506- The configuration contract still says every launch runs under a pin and that unpinnable commands are never refused, directly contradicting the new fail-closed behavior. Update this paragraph to state that builtin, alias, function, construct, and unresolved raw first words are refused when an applicable manifest may publishpath_prepend, while remaining unchanged without a pin.🔧 Fix: Validate raw executable paths before spawning
2 errors still open:
bin/fm-spawn.sh:3418- The fail-closed gate only checks explicit manifests, but declaration-driven provisioning can also publishPROVISION_PATH_PREFIX. An unresolved raw launch with no explicit manifest can therefore acquire/provision a worktree; on tmux/zellij/cmux,spawn_pin_launch_linerejects it only after endpoint creation and metadata installation. Apply the raw-launch deliverability gate to any declaration-driven component that may publish a runtime pin, or move the definitive check to the shared post-provision/pre-endpoint boundary.bin/fm-spawn.sh:2736- Relative executable paths are validated againstPROJ_ABS, but the launcher later executes them from the leased worktree. If the primary checkout and leased live-default worktree differ,./crewtoolcan pass preflight because it exists only in the primary and then fail 127 after endpoint creation, or be falsely refused when it exists only in the lease. Validate relative raw paths against the acquiredWTat the common post-acquisition/pre-endpoint boundary; absolute paths can remain preflight-checked.🔧 Fix: Gate published pins before endpoint creation
1 warning still open:
docs/configuration.md:507- The documentation says every unpinnable raw path is refused before leasing, but relative paths and declaration-driven pins are intentionally validated only after worktree acquisition and provisioning (while still before endpoint creation). State the actual boundary: early refusal when knowable from an explicit manifest, otherwise definitive post-provision/pre-endpoint refusal.🔧 Fix: Clarify runtime pin refusal boundaries
✅ Re-checked - no issues remain.
🔧 **Test** - 1 issue found → auto-fixed (6) ✅
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; tests/run.sh || rc=1; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"🔧 Fix: Confirm failures stem from cross-run resource contention
1 error still open:
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; tests/run.sh || rc=1; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"🔧 Fix: Confirm isolated Herdr teardown and suite seal pass
1 error still open:
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; tests/run.sh || rc=1; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"🔧 Fix: Exec Herdr event reader to prevent orphaning
1 error still open:
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; tests/run.sh || rc=1; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"🔧 Fix: Keep legacy migration fresh-report fixture current
1 error still open:
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; tests/run.sh || rc=1; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"🔧 Fix: Retry busy AFK launcher namespace guards
1 error still open:
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; tests/run.sh || rc=1; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"🔧 Fix: Reap watcher poll sleep during shutdown
✅ Re-checked - no issues remain.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; tests/run.sh || rc=1; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"Baseline already completed successfully:command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; tests/run.sh || rc=1; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"tests/fm-watch-pause-absorb.test.shunder the repository isolation runner, including post-run owned-process sealingtests/fm-provision.test.sh tests/fm-spawn-provision.test.shManual post-test inspection:git status --shortandps -axo pid=,ppid=,pgid=,command= | grep '[s]leep 1' || true✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.