Repository navigation
fix(bin): supersede stale scout delivery text in brief.md on promotion - #4491
Merged
kunchenguid merged 3 commits intoSep 15, 2026
Merged
Conversation
pablontiv
force-pushed
the
fm/fix-4486-promote-stale-brief
branch
from
September 15, 2026 04:19
984b349 to
383f265
Compare
pablontiv
force-pushed
the
fm/fix-4486-promote-stale-brief
branch
from
September 15, 2026 04:30
aae2735 to
c2bfc3d
Compare
Owner
|
Speaking as Kun's firstmate: triage complete — this is a restore that supersedes stale scout delivery text in |
Owner
|
Speaking as Kun's firstmate: this is merged. Thank you @pablontiv — really appreciate you taking the time on this. |
Intent
Captains's intent: dispatch now. Fix GitHub issue #4486 in this fork and open a PR through the normal contribution flow, with exact issue linkage (the PR must close #4486). This is a distinct, reproducible promote/relaunch safety gap: promoted ship work must not retain stale scout "Never push" instructions.
Issue #4486 substance:
bin/fm-promote.shwritesship-instructions.mdand flips the task'skindtoship, but never rewritesdata/<id>/brief.md(bin/fm-promote.sh:137,SCOUT_BRIEF="$DATA/$ID/brief.md"). A promoted scout, on its next relaunch, still receives the original scout-mode launch brief containing stale scout delivery text such as "This is a SCOUT task ... Never push." PR #4481 (issue #4279) recently fixed a related but distinct problem - a crewmate's ROLE IDENTITY being superseded by a conflicting project AGENTS.md - but that fix does not neutralize DELIVERY-MODE instructions, so the stale "Never push" text from a leftover scout brief survives untouched even after that fix.What Changed
bin/fm-promote.shnow rewritesdata/<id>/brief.mdin addition toship-instructions.md: it stages the original scout brief, appends the same superseding delivery contract (ship identity, "Never push"-superseding notice, mode-specific ship safety rule, ask-user block, and Definition of done) plus the shared Firstmate spec steps, and atomically swaps it into place, with cleanup/rollback of the staged original on any failure.RULE1inbin/fm-brief.sh) into a sharedfm_ship_rule_one()helper inbin/fm-dod-lib.sh, so both an ordinary ship brief and a promotion's brief/instructions render the identical rule text per delivery mode (no-mistakes,direct-PR,local-only).docs/architecture.mdanddocs/scripts.mdto describefm-dod-lib.sh/fm-promote.shas also owning the promoted task'sbrief.mdcontract, and addedtests/fm-control-relaunch.test.sh::test_promoted_scout_relaunch_receives_the_current_delivery_contractcovering all three delivery modes to verify a relaunch after promotion no longer surfaces the stale scout "Never push" text.Closes #4486
Risk Assessment
✅ Low: The change is well-scoped: it factors the ship push/merge rule into a shared fm_ship_rule_one (eliminating prior duplication), and extends fm-promote.sh to atomically rewrite data//brief.md with a superseding delivery contract under the existing per-task lock, with correct rollback-on-failure via the promote_cleanup trap; the new end-to-end test executes fm-promote.sh and fm-spawn.sh --relaunch for real and asserts on the generated launch-brief.md content, reproducing the exact issue #4486 scenario and matching the required intent.
Testing
Ran the actual repo test suite's live regression test for this fix end-to-end against the real bin/fm-promote.sh and bin/fm-spawn.sh scripts (real scout promotion + real relaunch, stubbed only at the session/agent-provider boundary): it passes at the target commit for all three delivery modes and, when isolated and run against the pre-fix base commit, reproduces the exact reported bug (stale scout brief survives relaunch). No code or test changes were needed; worktree left clean.
./bin/fm-test-run.sh tests/fm-control-relaunch.test.shat c2bfc3d — for all 3 modes it…test_promote_requires_and_records_the_delivery_contractandtest_promote_refuses_a_symlinked_task_record(unchanged pre-existing tests) passed at c2bfc3d,…Evidence: Full fm-control-relaunch.test.sh run at target commit c2bfc3d (all pass, incl. new regression test)
Evidence: Same test run against base commit da5e658 (pre-fix) in an isolated temp clone: fails exactly on the reported gap
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
./bin/fm-test-run.sh tests/fm-control-relaunch.test.shat c2bfc3d — for all 3 modes it…test_promote_requires_and_records_the_delivery_contractandtest_promote_refuses_a_symlinked_task_record(unchanged pre-existing tests) passed at c2bfc3d,…./bin/fm-test-run.sh tests/fm-control-relaunch.test.shat target commit c2bfc3d58f10424efb29e364914060c4ab98409e (56 tests, all pass)Same test file run against base commit da5e658562128ce94d2ea374fb018004b859bfdf in an isolatedgit cloneof the bare repo at /tmp (deleted afterward) — reproduces the reported failure pre-fixgit status --shortin the worktree before and after testing to confirm no residue was left✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.