Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ Preserve durable structured identifiers, dependencies, and completion artifact l
## 11. Crewmate briefs

`bin/fm-brief.sh` and its help own scaffold syntax, generated variants, status protocol, delivery-mode definitions of done, and exact safety mechanics.
Use its scaffold as the contract, then fill `## Captain's intent` (`{TASK}`) with the captain's own ask plus only the context needed to read it, and fill `## Firstmate spec` (`{FIRSTMATE_SPEC}`) with Firstmate's build instructions.
`bin/fm-dod-lib.sh` owns what a no-mistakes worker may pass as `--intent`.
Use its scaffold as the contract, then fill `## Captain's intent` (`{TASK}`) with the captain's own ask plus the context needed to read it, including the substance of any report, decision, or PR the ask refers to, and fill `## Firstmate spec` (`{FIRSTMATE_SPEC}`) with Firstmate's build instructions.
`bin/fm-dod-lib.sh` owns what a no-mistakes worker may pass as `--intent` and its rule that the string must be self-sufficient.
Keep additions task-specific rather than repeating lifecycle instructions, and alter generated sections only when the task genuinely differs from the standard shape.

Every ship brief must retain the worktree-isolation assertion and stop if launched in the primary checkout.
Expand Down
3 changes: 2 additions & 1 deletion bin/fm-brief.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# For ordinary tasks, the standard Setup/Rules/Definition-of-done contract is
# filled in. Ship and scout `# Task` sections have two subsections Firstmate
# fills before dispatch: `{TASK}` under `## Captain's intent` (the captain's
# own ask plus only the context needed to read it) and `{FIRSTMATE_SPEC}`
# own ask plus the context needed to read it, including the substance of any
# report, decision, or PR the ask refers to) and `{FIRSTMATE_SPEC}`
# under `## Firstmate spec` (build instructions, which are never the captain's
# intent). bin/fm-dod-lib.sh owns the no-mistakes `--intent` contract those
# subsections feed; bin/fm-spawn.sh refuses leftover placeholders. Secondmate
Expand Down
15 changes: 11 additions & 4 deletions bin/fm-dod-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
# line that bin/fm-spawn.sh checks a ship brief against.
# This file is the one owner of the no-mistakes `--intent` contract: only the
# brief's `## Captain's intent` subsection plus later captain words, never
# `## Firstmate spec` and never the worker's own tradeoffs. bin/fm-brief.sh
# scaffolds those two `# Task` subsections; bin/fm-spawn.sh and bin/fm-promote.sh
# refuse leftover `{TASK}` / `{FIRSTMATE_SPEC}` placeholders through the helpers
# below. Other mentions of `--intent` point here rather than restating the rule.
# `## Firstmate spec` and never the worker's own tradeoffs.
# The string passed must be self-sufficient - it plus the codebase reconstructs
# roughly the same specification - so a report, decision, or PR the intent
# refers to is written into it as substance, never left as a pointer.
# bin/fm-brief.sh scaffolds those two `# Task` subsections; bin/fm-spawn.sh and
# bin/fm-promote.sh refuse leftover `{TASK}` / `{FIRSTMATE_SPEC}` placeholders
# through the helpers below. Other mentions of `--intent` point here rather than
# restating the rule.
# Every heredoc here stays outside a command substitution: `VAR=$(cat <<EOF ...)`
# breaks parsing of the whole file on Bash 3.2 (tests/fm-brief.test.sh).

Expand Down Expand Up @@ -138,6 +142,7 @@ EOF
cat <<'EOF'

Firstmate-authored constraints, acceptance criteria, implementation details, decisions, and tradeoffs are specification, not captain intent.
The Definition of done's rule that `--intent` must be self-sufficient still governs the string you pass: resolve any report, decision, or PR the intent above refers to into its substance rather than passing the pointer.
EOF
}

Expand Down Expand Up @@ -197,6 +202,8 @@ Follow the guidance no-mistakes itself provides for the mechanics: it loads when
When starting no-mistakes, pass \`--intent\` as only this brief's \`## Captain's intent\` subsection plus any later words the captain actually said.
For a legacy brief with no such subsection, include only words explicitly labeled \`Captain:\`, \`Captain's words:\`, \`Captain's ask:\`, or \`Captain's intent:\`; never copy its mixed \`# Task\` wholesale. If it has no provenance-marked captain words, stop and ask firstmate instead of starting no-mistakes.
Do not include \`## Firstmate spec\`, later Firstmate build constraints, or your own decisions and tradeoffs.
The \`--intent\` string you pass must be self-sufficient: that string plus the codebase must let a reader reconstruct roughly the same specification, without depending on a separate report, a PR, or context that lives only in this conversation.
When the captain's intent refers to a report, decision, or PR ("do items 1, 2, 3, and 7 of the report"), write the substance of the referenced items into \`--intent\` in the captain's terms, not only the pointer; that substance is the captain's ask by reference, while Firstmate's build instructions and your own decisions still stay out.
This replaces the no-mistakes skill's advice to enrich \`--intent\` with decisions and tradeoffs; that advice does not apply to Firstmate-dispatched work.
Do not hand-edit, commit, or fix findings yourself while a run is active - the pipeline applies every fix.

Expand Down
7 changes: 7 additions & 0 deletions tests/fm-brief.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,13 @@ test_no_mistakes_dod_wording() {
"no-mistakes DOD must keep worker tradeoffs out of --intent"
assert_grep "This replaces the no-mistakes skill's advice to enrich \`--intent\`" "$brief" \
"no-mistakes DOD must override the external skill's enrich-with-decisions guidance"
# A bare reference cannot preserve the captain's ask, so the rendered DOD states
# the self-sufficiency rule and requires referenced material to be resolved into
# its substance.
assert_grep "The \`--intent\` string you pass must be self-sufficient" "$brief" \
"no-mistakes DOD must require a self-sufficient --intent string"
assert_grep "write the substance of the referenced items into \`--intent\`" "$brief" \
"no-mistakes DOD must tell the worker to resolve report, decision, and PR references into substance"

# The --yes ban is a fleet-wide prohibition, not a preference, and it must not
# claim an enforcement the tool does not provide: this is instruction only.
Expand Down
3 changes: 3 additions & 0 deletions tests/fm-task-delivery.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,9 @@ EOF
assert_grep "plus any later words the captain actually supplied" \
"$home/data/$id/launch-brief.md" \
"migrated launch contract excluded later captain clarifications"
assert_grep "The Definition of done's rule that \`--intent\` must be self-sufficient still governs" \
"$home/data/$id/launch-brief.md" \
"migrated launch contract's overlay dropped the self-sufficiency pointer"

id=delivery-legacy-unmarked-no-mistakes
mkdir -p "$home/data/$id"
Expand Down
Loading