Repository navigation
fix(bin): refuse spawn into a project with an unborn HEAD - #6987
Conversation
|
Speaking as Kun's firstmate: thanks @Azd325 — a fast, honest refusal instead of a misleading 60s isolation timeout is a real improvement. This is waiting on you (author), not the captain. I approved the fork CI runs (38032666724, 38032666729) after reading the diff (no workflow or secret surface). VISION verdict (head c7de95e0 vs main fb75c1f): One captain — aligns (outcome named, no new noise). Authority — the bin guard aligns; the new skill sentence cannot tell (see 3). Scripts/judgment — aligns (exact check in script). Restart — aligns (read-only, before any record). Delegation with a spine — aligns (strengthens a refusal path). Vendor — aligns (plain git). Scope — aligns. Three things before this can land:
|
What Changed
bin/fm-spawn.shnow refuses a fresh spawn when the project is a git repository whoseHEADhas no commit. It exits 1 with an error that suggestsgit commit --allow-empty. Relaunches and secondmate spawns are not affected..agents/skills/project-management/SKILL.mdnow tells the captain that a newly created local project needs a first commit before spawn can dispatch work into it.tests/fm-spawn-worktree-settle.test.shadds a test for the refusal. The existing spawn fixtures (fm-self-repo-role,fm-spawn-batch,fm-task-delivery) now make a first commit so they pass the new guard.Risk Assessment
✅ Low: The change adds a narrow early guard (only for a fresh ship or scout spawn into a git repository whose HEAD does not resolve), adds one doc line, and gives the fixtures a first commit. The round-1 fix (git_commit in the consent-foreign fixture) is correct and minimal, and the new regression test uses an independent oracle and fails without the guard.
Testing
I ran the real bin/fm-spawn.sh against a git-init'd project with no commit through the existing settle test harness. Spawn refused at once, named the unborn HEAD and the remedy, published no task metadata, and made no commit. The three suites whose fixtures needed a first commit pass. With the guard disabled, the regression test fails with 'expected exit 1, got 0'. I restored the file afterwards. I did not drive a Herdr or tmux lab. The harness-level test ran the real script, so I judged that enough.
git rev-list --all.Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
tests/fm-self-repo-role.test.sh:610- A spawn test still uses a project fixture with no commit, and the new guard breaks it. In the consent casespawn-consent-b4,$TMP_ROOT/consent-foreignis made with a baregit init -q. The test then runs the realbin/fm-spawn.shagainst it and checksassert_not_contains "$out" "spawn refused"(line 615). The new unborn-HEAD guard (bin/fm-spawn.sh:3506) runs before the self-repo role gate (bin/fm-spawn.sh:~3742). It exits witherror: spawn refused: project ... has no commit yet. So the assertion fails and the suite goes red. The guard also masks what the case means to prove: that the role gate lets a foreign project pass. The user intent says: "tests whose fixture projects are created with a bare git init must give each fixture project a first commit instead of weakening the guard." Fix: after line 610, addgit_commit "$proj" init. The file already definesgit_commitat line 60. The other spawn fixtures with no commit (tests/fm-spawn-batch.test.sh:87,95 and tests/fm-task-delivery.test.sh:37) are already fixed. The role-check fixture at line 177 runsfm-role.shand not spawn, so it needs no change.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
git rev-list --all.bash tests/fm-spawn-worktree-settle.test.shbash tests/fm-self-repo-role.test.shbash tests/fm-spawn-batch.test.shbash tests/fm-task-delivery.test.shMutation check: guard condition replaced withif false &&, settle test rerun, file restored✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.