Repository navigation
fix(bin): allow pooled spawns without a git origin - #3885
Merged
Merged
Conversation
…igured An origin-less local-only project has nothing remote to be stale against, so fm-spawn's freshen_spawn_worktree_base refused to launch crews for it. Detect a missing origin remote and skip the fetch freshness gate entirely; an existing-but-unreachable origin keeps refusing as before.
Confidence Score: 5/5The PR appears safe to merge, with no actionable defects beyond the explicitly accepted and tested variable-less included-section limitation. The changed flow checks cleanliness before origin detection, skips fetch and reset only when no origin configuration can be detected, and retains refusal behavior for dirty worktrees and detectable unusable or unreachable origins. Reviews (1): Last reviewed commit: "no-mistakes(document): Document originle..." | Re-trigger Greptile |
Intent
Fix fm-spawn.sh refusing crews for local-only projects with no git origin. When no origin is configured there is nothing remote to be stale against, so the freshness gate must skip; an existing-but-unreachable origin must keep refusing.
What Changed
Risk Assessment
✅ Low: The change is bounded, preserves refusal for usable-but-unreachable origin configurations, and explicitly documents the accepted narrow limitation for variable-less included sections.
Testing
Exercised the real fm-spawn pooled-worktree flow, demonstrating that an originless project launches without fetching while configured, unusable, and unreachable origins refuse; dirty-worktree protections and related refresh behavior also passed. The initial run exceeded its timeout, and the complete rerun succeeded with reviewer-visible CLI evidence captured.
Evidence: End-to-end fm-spawn freshness behavior transcript
Source: End-to-end fm-spawn freshness behavior transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (7) ✅
bin/fm-spawn.sh:2379- The early return bypasses the existing cleanliness check. With no origin and an untracked or modified file in the pooled worktree, spawning now succeeds and hands unrelated/uncommitted work to the new crew. Preserve the clean-worktree refusal before returning from the originless path.bin/fm-spawn.sh:2375- The criterion requires that “an existing-but-unreachable origin must keep refusing,” but this hunk treats everyremote get-url originfailure as absence. A configuredremote.originwith fetch configuration but no usable URL is an existing, unreachable origin;get-urlfails and spawn incorrectly succeeds. Distinguish exact remote absence from an unusable configured remote and retain the fetch refusal for the latter.🔧 Fix: Preserve pool safety for absent and unusable origins
1 error still open:
bin/fm-spawn.sh:2387- This still contradicts the required distinction that only complete origin absence may skip. For a clean repository whose config contains an empty[remote "origin"]section,git config --get-regexp '^remote\.origin\.'finds no variables and returns nonzero, so this branch launches instead of treating the existing unusable origin as a refusal. The added test does not cover this shape because it addsremote.origin.fetch. Detect the section itself, including an empty section, before skipping.🔧 Fix: Refuse empty origin configurations during pooled spawn
1 error still open:
bin/fm-spawn.sh:2381- The required “existing-but-unreachable origin must keep refusing” behavior remains bypassable. If the repository config includes another config file containing an empty[remote "origin"]section,git config --get-regexpfinds no origin keys and this loop scans onlyconfigandconfig.worktree, not the included file. The helper therefore reports no origin and spawn succeeds. Extend section detection across the effective include chain and cover this concrete included-empty-section case.🔧 Fix: Detect empty origin sections across config includes
1 error still open:
bin/fm-spawn.sh:2395- The required “existing-but-unreachable origin must keep refusing” invariant still fails for Git's supported glob includes. With.git/configcontainingpath = config.d/*.confand a matched file containing only[remote "origin"], the resolved-variable check finds no key, while this walker tests the literal wildcard path with-fand skips it. Spawn then treats the repository as originless and succeeds. Make raw include traversal honor Git include-path expansion semantics rather than treating each path as a literal filename.🔧 Fix: Honor globbed includes when detecting origin configuration
1 error still open:
bin/fm-spawn.sh:2403- The intent requires that “when no origin is configured ... the freshness gate must skip,” but this hunk collects everyincludeIf.*.pathfrom raw config without evaluating its condition. An origin-less worktree with an inactive conditional include whose target contains an empty[remote "origin"]section is therefore treated as having an origin and refuses on fetch. Replace the hand-walk with detection limited to Git's effective config chain; this pipeline-authored machinery should not be further shape-patched without user approval.🔧 Fix: Document conservative conditional include handling
1 error still open:
bin/fm-spawn.sh:2403- The addedcompgenpath contradicts “When no origin is configured ... the freshness gate must skip.” Git treatsinclude.pathas a literal pathname; it does not expand file globs. Withinclude.path=config.d/*.confand a matching file containing an empty origin section, Git does not read that file, but this helper expands it, reports an origin, and causes fetch to refuse an actually originless project. This pipeline-added matching path exceeds the intent; remove the shell-glob expansion and the regression test that asserts its incorrect refusal.🔧 Fix: Use Git-resolved config files for origin detection
1 error still open:
bin/fm-spawn.sh:2383- This contradicts the requirement that an existing-but-unreachable origin must refuse.git config --list --show-originemits variables, not every file read, so an active included file containing only[remote "origin"]emits no row and is never scanned. The helper returns origin-absent and spawn succeeds. The test masks this case by adding an unrelatedfm-test.markervariable. Because this detector is pipeline-authored machinery from prior fix rounds, ask the user to authorize replacing it with a mechanism that actually discovers zero-variable included files rather than adding another shape patch.🔧 Fix: Document included empty-origin detection boundary
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Inspected the target diff forbin/fm-spawn.shandtests/fm-spawn-pool-base-freshen.test.sh.FM_TEST_EVIDENCE=1 bash tests/fm-spawn-pool-base-freshen.test.sh(initial 180-second run timed out after substantial progress).FM_TEST_EVIDENCE=1 bash tests/fm-spawn-pool-base-freshen.test.sh(rerun with sufficient timeout completed successfully).Verified the worktree remained clean withgit status --short.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.