fix(spawn): refresh remoteless pooled worktrees from the primary default branch - #3052
fix(spawn): refresh remoteless pooled worktrees from the primary default branch#3052daoudaziz96 wants to merge 2 commits into
Conversation
…ult branch A crewmate or scout spawn for a project with no origin remote (a registered local-only project) failed at the pooled-worktree base refresh: the unconditional git fetch origin refused the spawn. Treehouse pools worktrees of the primary checkout, so for a remoteless repo the primary's own default-branch tip is the freshest possible base. Detect the missing origin and reset the clean pool to that tip with the same expected-vs-actual verification the origin path uses; refuse loudly when the default branch cannot be resolved. Remote-backed behavior, the dirty-worktree refusal, and fetch-failure refusals are unchanged.
…sh in architecture doc
Confidence Score: 4/5The valid non-main/master local-only project case should be fixed before merging because fresh ship and scout dispatches remain unusable for those repositories. The new remoteless path relies on a helper that recognizes only main or master without origin metadata, and the added trunk test demonstrates that an otherwise valid registered local-only project is refused. Files Needing Attention: bin/fm-spawn.sh, tests/fm-spawn-pool-base-freshen.test.sh, docs/architecture.md Reviews (1): Last reviewed commit: "no-mistakes(document): document remotele..." | Re-trigger Greptile |
| default=$(default_branch "$primary") || { | ||
| echo "error: could not determine the default branch of remoteless primary checkout '$primary' for pooled worktree '$worktree'; refusing to launch from a guessed base" >&2 | ||
| return 1 | ||
| } |
There was a problem hiding this comment.
Nonstandard default branches are refused
When a local-only project's default branch is not named main or master, default_branch "$primary" fails and aborts every fresh ship or scout spawn, even though the primary checkout has a valid default-branch commit. The new trunk fixture confirms this refusal, contradicting the documented behavior of refreshing from the primary checkout's default branch.
Summary
freshen_spawn_worktree_baseinbin/fm-spawn.shunconditionally fetchesorigin, so any crewmate/scout spawn for a remotelesslocal-onlyproject fails with "'origin' does not appear to be a git repository ... refusing to launch from a potentially stale base". Local-only projects are a registered delivery posture, so dispatch should work for them.This change detects a missing
originremote (git remote get-url origin): whenoriginexists, behavior is byte-for-byte unchanged; when it does not, the pooled worktree is refreshed from the primary checkout's default branch tip instead, with the same clean-tree refusal and expected-vs-actual head verification as the remote path. No refusal is weakened.Validation
🤖 Generated with Claude Code
https://claude.ai/code/session_01N8oThKtr11vBbxdX5KcnVm