Repository navigation
feat(bin): support named base branches for pooled spawns - #2622
lakshyads05 wants to merge 13 commits into
Conversation
|
@kunchenguid This PR has been raised via the no-mistake pipeline. Still I see the check failing above |
2f81418 to
d798af1
Compare
|
@kunchenguid please approve the workflows |
|
Speaking as Kun's firstmate: Named bases are opt-in ( |
4a6a6bc to
ca1e09f
Compare
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (17): Last reviewed commit: "fix(bin): bound relaunch after brief sen..." | Re-trigger Greptile |
6ab9ebb to
156f20a
Compare
88615af to
456a15a
Compare
|
@kunchenguid please review |
5de5349 to
a18f51f
Compare
Ordinary pooled freshen still tracks origin's default branch. When the captain already cut a target branch, --base-branch resets the worktree to that tip and records the PR target; --branch-name stops firstmate from rewriting generated fm/<id> text by hand.
A local-only --branch-name brief finishes on that custom branch. Merge-local now reads the recorded Crew branch line and keeps fm/<id> only when that line is absent.
The generated contract is appended after free-form task text, so the first matching line can be an earlier mention instead of the real name.
Local-only ships based on --base-branch were still delivered to the repository default, which either refused the ready branch or landed the named base on main.
An earlier Base branch line in replaceable task text was treated as authoritative, so spawn could disagree with the generated brief and local landing target.
Last-match parsing fixed task-text decoys, but a later progress note could then override the generated Definition of done contract.
A task-authored heading could hide the generated contract section. Read the last Definition of done before any relaunch progress note.
Stop whole-file fallback from reading relaunch progress notes when a contract line was never generated. When a Definition of done section exists, only that region is authoritative; otherwise scan the brief prefix before the fm-control relaunch marker. Add regression tests for local-only --branch-name landing and conjured progress-note contracts.
The scaffold checks out the named base before `git checkout -b`, so equal crew and base branch names always fail the worker's first setup action.
Refuse --base-branch when it equals the resolved crew branch, including the default fm/<task-id>. Ignore a forged relaunch marker that still sits before generated Setup, so task text cannot hide the Definition of done.
Spawn reads only Definition of done, so a scout --base-branch recorded in Setup was invisible and matching spawns were refused.
A lone worktree line in a progress note no longer moves the contract scan past the real fm-control relaunch marker.
A progress note that copies Setup plus the worktree line could move the generated-contract bound. End ship and scout briefs with a scaffold line and treat only a later relaunch marker as structural.
a727289 to
58d0079
Compare
|
@kunchenguid please review |
|
@kunchenguid please review and approve |
|
Superseded by #4071, which rebases the named-base and crew-branch work onto current upstream. Closing this PR in favor of that replacement. |
Intent
Give firstmate an additive --base-branch on fm-spawn.sh for existing pooled treehouse worktrees: freshen/reset to that named branch tip (origin/ if present, else the local branch; refuse if missing; no silent fallback to the remote default; refuse an unverifiable ref-specific fetch instead of treating it as remote absence). Record base_branch= in task meta only when the flag is set. --relaunch, --secondmate, and backend=orca refuse the flag. Do not change fm-teardown.sh, fm-control.sh, or validate_spawn_worktree. Do not add wtnew worktree provisioning, teardown, or process-reap behavior; that earlier design was cancelled and must not return.
For the eventual PR, do not change no-mistakes itself and do not use --skip pr. A no-mistakes ship must run the pipeline completely normally: push, PR against the repo default branch, CI monitored to green. After that first green, retarget the PR with raw
gh pr edit <number> --base <branch>(installed gh-axi pr edit has no --base; keep gh-axi for every other GitHub operation), then wait and confirm CI is green again against the real target; do not trust the pre-retarget green. A direct-PR ship opens with gh-axi pr create --base . Document this exact sequence in fm-spawn.sh's header. Scaffold the matching worker-facing steps from fm-brief.sh --base-branch. When the flag is omitted, freshen, generated meta, and generated briefs stay identical to today.Also accepted on the same change: optional --branch-name on fm-brief.sh so ship and scout scaffolds use that name everywhere the scaffold currently hardcodes fm/. Validate with git check-ref-format --branch. When omitted, generated briefs stay identical to today. Note other scripts that still reconstruct fm/. Shell-quote generated executable branch snippets.
This run's delivery job is to push the already-validated head through the gate to the recorded fork (https://github.com/lakshyads/firstmate.git) and let the PR step write a genuine no-mistakes ## Pipeline section (the marker "Updates from git push no-mistakes"). Update existing PR #2622 if that works, or open a fresh cross-repo PR from the fork; either is fine. Do not hand-stamp the signature. Do not merge.
Tests must exercise real executables and public behavior; never assert implementation source text.
What Changed
--base-branchfreshening for pooled ship and scout worktrees, with metadata recording and refusal paths for unsupported or unverifiable cases.--branch-namescaffolding.Risk Assessment
✅ Low: The requested behavior is implemented within the affected spawn and brief paths, with omitted-flag compatibility and relevant failure paths covered by reviewed executable tests.
Testing
Exercised real spawn and brief executables with isolated Git remotes and pooled worktrees: named-origin and local base selection, stale refresh, missing/unverifiable ref refusals, dirty-worktree preservation, incompatible mode refusals, metadata/brief contracts, quoted custom branches, and omitted-flag compatibility. The generated brief artifact shows the user-facing retarget-after-green sequence and custom branch command; all focused tests passed.
Evidence: Pooled-worktree base-branch E2E transcript
Source: Pooled-worktree base-branch E2E transcript
Evidence: Generated worker brief with base and branch contracts
Source: Generated worker brief with base and branch contracts
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-spawn.sh:1699- The new brief/spawn base agreement is enforced only for ship tasks. A scout brief scaffolded with--base-branch developcan be spawned with--scout --base-branch release; spawn resets the worktree toreleasewhile the worker-facing Setup still statesdevelop. Emit the same machine-readable base contract for scouts and validate it before freshening, so the stated and actual analysis base cannot diverge.🔧 Fix: Enforce named-base contracts for scout spawns
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
git diff --check 1cb900c28faf23fe23c9bb54e63f7c3b436ea096 d798af1b00fe9e138f07bf0f0012809ef263de5dFM_TEST_EVIDENCE=1 bash tests/fm-spawn-pool-base-freshen.test.shbash tests/fm-brief.test.shFM_HOME=<evidence home> bin/fm-brief.sh e2e-base-branch-demo firstmate --mode no-mistakes --base-branch release/2026-q3 --branch-name feature/worker-base-branch✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.