branch: report role-limited MAIN-only outcomes as captain verdict - #30
Merged
Merged
Conversation
The supervision branch cannot merge a PR, land local-only work, or spawn a new task (fm_lease_forbid_branch in fm-pr-merge.sh, fm-merge-local.sh, fm-spawn.sh). When such an outcome was reported routine, no follow-up turn opened on MAIN, and nobody else can act on it either - the branch is forbidden and routine never wakes MAIN. Add this class to the branch prompt's captain-verdict list, with the reason inline, and update docs/pi-supervision-branch.md's claim that the verdict criteria mirror only the captain-etiquette escalation list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The supervision branch reports every handled fleet event as
routineorcaptain(fm_branch_report). Onlycaptainopens a follow-up turn on MAIN (.pi/extensions/fm-branch-supervision.ts:340-349);routinemerges a note with no turn.The branch is deterministically forbidden from three MAIN-only actions (
bin/fm-lease-lib.sh'sfm_lease_forbid_branch):bin/fm-pr-merge.sh:45- PR mergebin/fm-merge-local.sh:25- local-only landingbin/fm-spawn.sh:993- new-task spawnWhen the branch handles an event whose finishing action is one of these and reports it
routine, nobody acts on it: the branch can't (role limit) and MAIN never wakes (no turn opens). Measured evidence (2026-08-26): PR kunchenguid#107's merge-ready outcome was reportedroutinethree times (fm_branch_outcomesseq 26/27/28) and sat unhandled for 8 minutes until the captain noticed; the same gap left a crew model-policy update (seq 228) unhandled until the captain re-raised it.Fix
Added exactly one bullet to the existing
captainlist inbin/fm-branch-prompt.sh's "Verdict: routine or captain" section: an outcome only MAIN can finish because the branch's role limits forbid it (PR ready to merge, local-only landing ready to approve, a new task that needs spawning), with the reason inline (reporting it routine leaves it done by nobody). No new delivery tier, no change to.pi/extensions/fm-branch-supervision.ts's routine/captain delivery mechanics, no change to what "routine" means for everything else.Updated
docs/pi-supervision-branch.md's line 49, which previously claimed the verdict criteria mirror only the captain-etiquette escalation list - that's no longer exactly true, since this addition has no counterpart in captain etiquette (it exists purely because of the branch's own role limits).Evidence
bin/fm-test-run.sh --changed --base main, full logs in/tmp/changed-test-run.login the task worktree):Full changed-selection run:
FM_TEST_SUMMARY total=28 failed=0 skipped_gate=1.The new criterion is pinned by test:
tests/fm-branch-supervision.test.sh'stest_branch_prompt_is_byte_stable_and_above_cache_flooralready asserted prompt substrings (role preamble, recovery playbook), so I added one more substring assertion there covering the new bullet's key phrases ("only MAIN can finish", "PR ready to merge", "routine never wakes MAIN") rather than inventing a new test file.docs/pi-supervision-branch.mdline 49 read and corrected: it previously said the verdict criteria "mirror the captain-etiquette escalation list," which was no longer literally true once this branch-role-limit-only criterion was added (captain etiquette has no counterpart for it, since only the branch has role limits). Reworded to say the criteria mirror that list "plus one addition that list has no reason to carry," with the reason stated inline.Not done (scope discipline)
Did not touch
.pi/extensions/fm-branch-supervision.ts's routine/captain delivery mechanics and did not add a third delivery tier - the brief explicitly ruled that out as a much larger change (extension + docs + tests) when the defect is fully addressed by tightening the verdict criterion in the branch prompt.Reading this codebase
Used
bin/fm-project.shfirst per the brief, but this worktree has nodata/projects.mdregistry entry forfirstmatepointing at itself (no registry at .../data/projects.md, andfm-project.sh listreports the same), so the door never engaged for this task. Fell back to plaingrep -nandreadthroughout, which worked fine for this task's shape: two known symbols (fm_lease_forbid_branch,fm_branch_report) with brief-supplied line numbers, and one prose contract file (bin/fm-branch-prompt.sh) that is comments-as-text rather than code structure - not a natural fit for a symbol-graph query anyway. Never got to try theP explore/node/query/callers/callees/impactverbs since nothing here needed a structural "who calls this" answer; everything was "find this exact string/section" (P grep/P read's territory) and plaingrep -rnanswered it in one shot. One concrete improvement: if the door auto-detected "this checkout IS the project" when no registry entry matches and the cwd itself is a git repo whose remote matches a known project name, it would have saved the one dead-end call and the registry lookup before falling back.