feat(brief): add crewmate identity disambiguation to ship and scout scaffolds - #1
Merged
Merged
Conversation
…caffolds Both scaffolds now carry a one-line note after the opening identity sentence: if the worktree AGENTS.md is firstmate's own, it is the supervisor job description; the crewmate's brief governs. Mirrors the secondmate charter pattern at line 234. Covered by a new test in tests/fm-brief.test.sh.
BenWilcox8
pushed a commit
that referenced
this pull request
Sep 12, 2026
…nguid#3681) * fix(bin): recognize active pipeline fix rounds with unfetched run heads A no-mistakes fix round advances the run head beyond the submitted head, and the pipeline commits in its own checkout, so the task copy never receives the new commit object. fm-crew-state's strict head rule rejected the active row, the coarse runs-list scan skipped it and matched the older failed row at the submitted head, and an active validation read as failed (observed on model-routing-benchmark-hardening: active head ac61c64 vs task copy at fb47636d). fm_nm_runs_status_for_worktree in bin/fm-nm-run-lib.sh now owns runs-ledger attribution: the branch's newest row alone decides, and a newest row whose head cannot resolve locally is recognized only as a provable pipeline-owned continuation - active (running) and anchored by the immediately older row for the same branch having ended at exactly this worktree's HEAD. The reader keeps the axi TOON as full detail for that proven same-branch run. Unanchored, ancestor-anchored, and terminal unresolvable rows stay unattributed, so branch-name coincidence and other tasks' runs never match, and fm_nm_head_matches_worktree keeps its exact prior semantics for teardown (verified by the full teardown suite). Tests: reproduction regression for the unfetched active fix head (reads working via full run-step detail), coarse-path continuation when axi answers another branch, and negative controls for the unanchored active row and the unresolvable terminal row with the historical fallback preserved. Ported onto upstream/main f4d7875, where kunchenguid#3194 independently added the branch_sync custody exemption on the full axi-status path: both mechanisms now coexist, each owning one surface (TOON custody on the full path, the runs ledger on the coarse path). The port deletes the superseded coarse scan-and-skip (nm_runs_status_for_branch) and its now caller-less helpers (fm_nm_head_resolvable, nm_coarse_head_matches_worktree), renames the exemption comment's "the one exemption" phrasing now that a second complementary exemption exists, and points the stale FM_CREW_STATE_RUNS_LIMIT comment at fm_nm_runs_status_for_worktree (judge follow-up #1). The parent coarse-guard test's fixture is the ledger-anchored continuation shape, so its expectation flips to the fixed behavior (working via run-step, never the older failed row); a new mismatched-anchor coarse negative control preserves that guard's original no-anchor protection (pane answers, never the older row). * no-mistakes(document): Clarify pipeline attribution documentation
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.
Intent
Add one sentence to the ship and scout scaffolds in bin/fm-brief.sh: if this worktree's AGENTS.md is firstmate's own, it is the supervisor job description, not yours; you are a crewmate, your brief governs. Both scaffolds carry the disambiguation sentence. Covered by a new test in tests/fm-brief.test.sh asserting the sentence appears in both ship and scout scaffolds. Acceptance: both scaffolds carry the disambiguation sentence and fm-brief tests pass.
What Changed
bin/fm-brief.shnow carry a crewmate identity disambiguation sentence.This sentence tells the crewmate agent that firstmate's own
AGENTS.mdis the supervisor job description, not the crewmate's brief.test_crewmate_identity_disambiguationintests/fm-brief.test.shchecks that both scaffolds carry this sentence.Risk Assessment
✅ Low: The change adds a single sentence to two heredocs in bin/fm-brief.sh and a corresponding behavioral test that exercises the real binary and checks its generated output file - minimal, well-scoped, and fully conformant with the stated intent.
Testing
Ran the full
fm-brief.test.shsuite (23 tests). The new test exercises both the ship and scout code paths by invoking the realfm-brief.shscript and checking the generatedbrief.mdoutput file for the disambiguation sentence. All 23 tests pass, including the new targeted test.Evidence: fm-brief test run output
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.
bash tests/fm-brief.test.sh- full suite including newtest_crewmate_identity_disambiguationwhich invokesfm-brief.shfor both ship and scout paths and asserts the generated brief files contain the disambiguation sentence✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.