Skip to content

fix(spawn): refresh remoteless pooled worktrees from the primary default branch - #3052

Open
daoudaziz96 wants to merge 2 commits into
kunchenguid:mainfrom
daoudaziz96:fm/fm-spawn-local-only
Open

fix(spawn): refresh remoteless pooled worktrees from the primary default branch#3052
daoudaziz96 wants to merge 2 commits into
kunchenguid:mainfrom
daoudaziz96:fm/fm-spawn-local-only

Conversation

@daoudaziz96

Copy link
Copy Markdown

Summary

freshen_spawn_worktree_base in bin/fm-spawn.sh unconditionally fetches origin, so any crewmate/scout spawn for a remoteless local-only project 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 origin remote (git remote get-url origin): when origin exists, 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

  • 9/9 focused freshen tests green plus lint (ShellCheck via pinned linter evidence); validated through the no-mistakes pipeline (run 01M0V9CSV1B0R8PREH57BR06HM: review, test, document, lint all green on this head).
  • 4 broad-suite failures verified pre-existing on base 038d0f7 (environment-only: linters PATH, muse probe, composer glyph).
  • Remote-backed spawn behavior unchanged; remoteless spawn verified against a scratch fixture.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N8oThKtr11vBbxdX5KcnVm

Mohamed Aziz Daoud added 2 commits August 25, 2026 02:26
…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.
@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The 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

Comment thread bin/fm-spawn.sh
Comment on lines +1778 to +1781
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
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant