fix(spawn): resolve bare project names from home - #2911
Conversation
Confidence Score: 5/5The PR appears safe to merge, with no blocking failure remaining. The previously reported relative-path, cwd-shadow, and exact-reproduction issues are addressed by the resolver ordering, home-only bare-name lookup, explicit diagnostics, and focused regressions; no blocking failure remains. Reviews (2): Last reviewed commit: "no-mistakes: apply CI fixes" | Re-trigger Greptile |
|
Speaking as Kun's firstmate: Scheduled 7:10pm PT 8/23 pass. VISION.md read in full from current main VISION (inspected
Class: corrective (completes the existing home-registry identity for slash-free project names; cwd-relative bare names were a shadow bug, not a supported contract). Not default-behavior: explicit path forms are unchanged, and the isolated-worktree refusal still stands. Security review of the FULL diff before first-fork CI approval: files are only Workflow-approval this pass (captain
MERGEABLE / UNSTABLE, ahead 3 / behind 0. HEAD Overlap: Waiting on the author for a HEAD-matching Land-eligible: NO. Captain-flag NOW: no. |
Intent
Fix the fm-spawn failure where the reconcile-github-delivery-state scout never created metadata because the bare project name was resolved relative to the caller instead of the active Firstmate home's projects directory. Preserve the end-user-aligned reproduction and distinguish the initiating trigger, masking condition, and visible symptom. Make bare project names resolve to the intended home-scoped primary project clone so treehouse or Orca can create a genuine isolated disposable worktree, while retaining or strengthening the existing fail-closed assertion that refuses a primary-checkout target and providing a clear diagnostic when the project cannot resolve. Preserve already-working absolute, relative-path, and projects/ spawns across all supported runtime backends. Turn the exact reconcile-github-delivery-state scout failure into an executable regression that proves the published worktree is a distinct linked-worktree root and that a caller cwd shadow cannot capture the bare project name. Keep the Firstmate shared tracked change minimal and surgical, follow Firstmate coding guidelines, validate through no-mistakes to a green PR, and do not merge because this Firstmate-repo PR waits for the captain's explicit merge word.
What Changed
projects/<name>strictly from the active Firstmate home's projects directory, with a clear error when the project is missing..and.., while preventing caller-directory shadows from capturing bare names.Risk Assessment
✅ Low: Captain, the shared resolver now enforces home-only bare-name lookup, preserves explicit path forms, and the regressions cover the original failure, cwd masking, missing-project refusal, and worktree isolation invariant.
Testing
No baseline test results were supplied. Targeted treehouse-facing, Orca, and backend-dispatch tests passed; after the initial manual capture correctly hit gate-agent protection, its isolated retry used the repository's test-only bypass and proved home-scoped resolution, shadow immunity, distinct linked-worktree publication, path compatibility, and clear fail-closed diagnostics. A CLI transcript was captured instead of visual evidence because this change has no UI surface.
Evidence: Exact scout CLI and persisted-state evidence
spawned reconcile-github-delivery-state harness=codex kind=scout ... verified: published worktree is a distinct linked-worktree root verified: caller cwd shadow did not capture the bare project name Overall: PASSPipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
bin/fm-spawn.sh:1493- Required criterion: "Preserve already-working absolute, relative-path, and projects/<name> spawns across all supported runtime backends." The new no-slash branch treats.and..as home-scoped names. Because$PROJECTS/.and$PROJECTS/..normally exist, these arguments now target the projects collection or Firstmate home instead of the caller-relative project, potentially spawning from the wrong repository. Handle.and..as relative paths before the bare-name branch and add focused regressions.tests/fm-tangle-guard.test.sh:242- Required criteria say to "Turn the exact reconcile-github-delivery-state scout failure into an executable regression" and preserve the reproduction's trigger, masking condition, and visible symptom. This fixture creates$caller/analyticsbefore its only invocation, so the base implementation resolves that shadow and writes metadata instead of reproducing the reported no-metadata failure. Keep the shadow-precedence case, but add a separate no-shadow invocation that reproduces the original sequence and explicitly identifies the trigger, mask, and symptom.🔧 Fix: Captain, preserve relative paths and split spawn regressions
1 error still open:
bin/fm-spawn.sh:1497- The required criterion says, "Make bare project names resolve to the intended home-scoped primary project clone" and requires that "a caller cwd shadow cannot capture the bare project name." However, the changedelif [ -d "$path" ]branch still resolves a bare name from the caller when the home clone is absent. A caller-sideanalytics/directory can therefore capture the name and bypass the required clear missing-project diagnostic. Remove this fallback for bare names while retaining the explicit.|..and*/*relative-path cases, update the help text, and add a missing-home plus cwd-shadow regression.🔧 Fix: Captain, enforce home-only bare project resolution
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-tangle-guard.test.shbash tests/fm-backend-orca.test.shbash tests/fm-backend.test.shManual temporary-home E2E:bin/fm-spawn.sh reconcile-github-delivery-state analytics --scout --harness codex --model gpt-5.6-sol --effort medium, executed from a caller directory containing a competinganalyticsrepository.Manual path matrix forprojects/analytics, an absolute project path, and../home/projects/analytics, plus missing-project and primary-checkout refusal counterfactuals.✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.