Skip to content

feat(bin): require PP Brain and memory grounding in ship and scout briefs - #8

Merged
alandomio merged 1 commit into
mainfrom
fm/fm-brief-brain-grounding
Sep 1, 2026
Merged

alandomio merged 1 commit into
mainfrom
fm/fm-brief-brain-grounding

Conversation

@alandomio

@alandomio alandomio commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Adds a # Grounding section to the crewmate ship-brief and scout-brief templates that bin/fm-brief.sh generates, requiring the worker to search PP Brain and firstmate's local memory store for prior decisions, refuted approaches, and known traps before its first substantive action.

Why it matters: worker use of PP Brain today is incidental - it only happens when a dispatched task invokes a skill (implement-ticket, investigate-incident, ...) that already requires it. Two recent failures were caused by acting without prior knowledge that was in fact recorded: a ticket was implemented when a merge request for it already existed, and an investigation was dispatched into an alert that already had two reports and an open decision. Nothing in the scaffold guaranteed the search would happen on any other kind of task.

This change touches only bin/fm-brief.sh and its test; it does not change the secondmate charter template or any other generated section.

Change
File Change
bin/fm-brief.sh +14 lines: a three-line # Grounding section in the shared ship-brief heredoc (all three --mode values) and the scout-brief heredoc, plus a one-line header-comment note documenting the placement decision
tests/fm-brief.test.sh +44 lines: test_grounding_section_requires_search_and_reporting

The Grounding section requires three things: search PP Brain's search_knowledge with both query and prompt populated (passing only one silently drops two of six retrieval paths) and the local memory store; treat the brief's # Task section as a starting point rather than a substitute; and report what was found and what it changed in the next status line, or state plainly that both were silent. The third requirement is deliberate - a section that only says "search Brain" produces a search with no accountability for what it found.

Validation
  • bin/fm-lint.sh (pinned ShellCheck 0.11.0 + actionlint 1.7.12): clean.
  • bash tests/fm-brief.test.sh: 22/22, including the new test, which exercises the generated brief text through the script's own CLI output rather than asserting on implementation source bytes.
  • Manually generated a ship brief and a scout brief and inspected the rendered # Grounding section: three single-sentence lines, no stray formatting, no unreplaced heredoc markers.
Placement rationale

The Grounding section was added to ship briefs (all three delivery modes) and scout briefs, but deliberately not to the secondmate charter template.

Ship briefs got it because the duplicate-merge-request failure that motivated this change was itself a mechanical ship task, not an investigation - limiting the requirement to scouts would have missed the exact failure mode it exists to prevent.

The secondmate charter was excluded because a secondmate never performs a task's first substantive action itself: it delegates project work to its own crewmates through the normal firstmate lifecycle, and each of those crewmates receives its own generated ship or scout brief, which already carries this same Grounding section. Adding the section to the charter too would be a second, structurally unused copy of the same contract that nothing ever reads.

Out of scope
  • Enforcing that the search actually happened, or that its result was meaningfully used - the contract relies on the worker following the brief and firstmate reading the reported outcome, same as every other brief requirement.
  • Any change to which skills call PP Brain today; this only closes the gap for tasks that don't already invoke one.

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.

  • test
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

🤖 Generated with Claude Code

fm-brief.sh generated every crewmate and scout brief with no instruction
to consult PP Brain or the local memory store, so grounding in prior
organisational knowledge only happened incidentally, when a worker
invoked a skill that already required it.

Add a short Grounding section to ship and scout briefs requiring a
search of both stores before the first substantive action, treating
the Task section as a starting point rather than a substitute, and
reporting what was found and what it changed (or that both were
silent). Also encode the documented retrieval-path gotcha: a Brain
search must populate both query and prompt.
@alandomio
alandomio merged commit 7583d6d into main Sep 1, 2026
14 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.

1 participant