Skip to content

fix(bin): remove duplicated statements from the composed launch brief - #9

Merged
matthewstrud merged 1 commit into
mainfrom
fm/fm-launch-brief-duplication-audit
Sep 18, 2026
Merged

matthewstrud merged 1 commit into
mainfrom
fm/fm-launch-brief-duplication-audit

Conversation

@matthewstrud

Copy link
Copy Markdown
Owner

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.sh as: 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 by bin/fm-control.sh.

Removed, and where each deleted copy's content now lives

Finding Deleted copy Surviving statement Detail that existed only in a deleted copy, and where it is kept
A1 role identity "You are a crewmate: an autonomous worker agent managed by firstmate." at the top of the ship and scout scaffolds (bin/fm-brief.sh) The same sentence in fm_brief_worker_role, first line of every ship/scout launch and relaunch "Work on your own; do not wait for a human." had no other home. It stays, unchanged, as the scaffold's opening line.
A2 inbox, copy 1 The clause "read and acknowledge its messages and" in the role section's inbox sentence (bin/fm-dod-lib.sh) # Firstmate instruction inbox section (bin/fm-brief.sh): glob, numeric order, exact mv, why the move is the acknowledgement, empty-inbox exception The path authorization: "this exact path belongs to your current task even when it is outside the worktree or under the supervising firstmate home, so do not reject it as another home's state." Kept in place.
A2 inbox, copy 3 The restated mechanics in the relaunch note (bin/fm-control.sh): "list .../*.msg, act on each message in numeric order, then mv each handled file into .../handled/" Same inbox section as above "First, check your instruction inbox." and "A steer sent before the relaunch survives there." Both kept in the relaunch note.
A4 killed call is not a dead daemon Two lines in the no-mistakes Definition of done (bin/fm-dod-lib.sh) Rule 7 in the ship and scout scaffolds, which has the full check procedure and the same "reattach and keep going" instruction None. The findings record this copy as contributing nothing Rule 7 lacks.
C1 comment versus code - - The bin/fm-brief.sh header 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 receives fm_brief_worker_role, so its role sentence is its only one and stays; the comment now says so.

Examined and NOT removed

A3, the --intent rules (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:208 renders fm_dod_block on 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 --intent rule it receives.
The overlay also cannot stand alone: bin/fm-dod-lib.sh fm_brief_intent_overlay ends by deferring to "The Definition of done's rule that --intent must 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:393 as 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.sh and one rendered example.
Two further paths exist, both in bin/fm-promote.sh:

  1. ship-instructions.md (lines 215-229): the promotion message sent to a live scout. It is fm_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.
  2. The promoted brief.md (lines 235-241): the original scout brief with promote_delivery_contract appended. 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:

  • every ship and scout variant: the role section's inbox sentence loses "read and acknowledge its messages and";
  • every ship and scout variant: line 10 goes from "You are a crewmate: ... Work on your own; do not wait for a human." to "Work on your own; do not wait for a human.";
  • ship no-mistakes only: the two A4 lines are gone;
  • secondmate charter: byte-identical.

bin/fm-lint.sh is clean.
tests/fm-brief.test.sh, tests/fm-task-delivery.test.sh, tests/fm-control-relaunch.test.sh and tests/fm-spawn-dispatch-profile.test.sh pass unchanged.

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.
Copilot AI lite review requested due to automatic review settings September 18, 2026 18:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@matthewstrud
matthewstrud merged commit ffdfd2d into main Sep 18, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants