fix(bin): remove duplicated statements from the composed launch brief - #9
Merged
Merged
Conversation
Apply audit findings A1, A2, A4 and C1: the worker identity sentence, the inbox read-and-acknowledge mechanics, and the killed-call daemon note were each stated more than once in one composed brief. Each now has one surviving statement, and the fm-brief.sh role-scope comment matches what the scaffolds emit.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
What
An audit of the text a worker receives at launch found statements repeated within one composed brief.
This PR removes the repeats that are safe to remove, and records the two that look like repeats but are not.
It is removal only: no surviving text is reworded, and no instruction changes meaning.
The launch text is composed by
bin/fm-spawn.shas: role section (fm_brief_worker_role,bin/fm-dod-lib.sh), then the stored brief (bin/fm-brief.sh), then the intent overlay for no-mistakes ships, with a relaunch note appended to the stored brief bybin/fm-control.sh.Removed, and where each deleted copy's content now lives
bin/fm-brief.sh)fm_brief_worker_role, first line of every ship/scout launch and relaunchbin/fm-dod-lib.sh)# Firstmate instruction inboxsection (bin/fm-brief.sh): glob, numeric order, exactmv, why the move is the acknowledgement, empty-inbox exceptionbin/fm-control.sh): "list .../*.msg, act on each message in numeric order, then mv each handled file into .../handled/"bin/fm-dod-lib.sh)bin/fm-brief.shheader said scaffolds carry no role scope while every scaffold opened with a role sentence. After A1 that is true for ship and scout, so the code was changed to match the comment there. A secondmate charter never receivesfm_brief_worker_role, so its role sentence is its only one and stays; the comment now says so.Examined and NOT removed
A3, the
--intentrules (Definition of done versus the intent overlay).This is not a duplicate.
The audit concluded the two statements only ever appear together.
bin/fm-promote.sh:208rendersfm_dod_blockon its own into the instructions sent to a promoted scout, with no overlay, so for that worker the Definition of done copy is the only--intentrule it receives.The overlay also cannot stand alone:
bin/fm-dod-lib.shfm_brief_intent_overlayends by deferring to "The Definition of done's rule that--intentmust be self-sufficient".Deleting the Definition of done copy would remove a rule, not a repetition.
A5, local-only "never push, never open a PR" (Rule 1 versus the Definition of done).
The findings themselves record that deleting Rule 1 (
fm_ship_rule_one) loses the rule as a Rule.The Definition of done sentence "Do NOT push, do NOT open a PR, do NOT merge" is pinned by
tests/fm-task-delivery.test.sh:393as the promoted local-only worker's no-remote contract.Neither copy can go without losing a documented contract.
A6 and everything in Part D of the findings were left exactly as they are: they are deliberate (a principle plus a concrete prohibition, and precedence clauses that name what they override).
The ship/scout Rule 4 asymmetry is untouched.
Composition paths the audit did not see
The audit reconstructed the composed brief from
fm-spawn.sh,fm-brief.shand one rendered example.Two further paths exist, both in
bin/fm-promote.sh:ship-instructions.md(lines 215-229): the promotion message sent to a live scout. It isfm_ship_rule_one+ the ask-user block +fm_dod_block, with no role section, no Rule 7 and no intent overlay; Rule 7 and the inbox section reach that worker only by carrying over from its original scout brief.brief.md(lines 235-241): the original scout brief withpromote_delivery_contractappended. A relaunch composes role section + scout brief + ship contract (+ overlay for no-mistakes), so scout Rule 1 and the ship Rule 1 both appear, deliberately, under an explicit supersession clause.A4 was re-checked against both: the scout scaffold's Rule 7 carries the identical text, so a promoted worker still has it.
Evidence
Composed briefs for all five variants (ship no-mistakes, direct-PR, local-only, scout, secondmate charter) were generated before and after.
The complete diff of composed output is:
bin/fm-lint.shis clean.tests/fm-brief.test.sh,tests/fm-task-delivery.test.sh,tests/fm-control-relaunch.test.shandtests/fm-spawn-dispatch-profile.test.shpass unchanged.