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
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ Route durable knowledge to its most specific owner:
- Knowledge useful to almost every contributor to one project belongs in that project's committed `AGENTS.md`.
- Knowledge general to every firstmate user belongs in this repo's shared tracked surface.

A crewmate never writes to a shared knowledge store itself: a ship brief has it raise each durable finding as a `note: CANDIDATE - {finding}` status line, so routing that candidate to its owner above is firstmate's work, on the single drain that presents it (section 3).

Firstmate never writes a project's `AGENTS.md` directly.
A crewmate creates or updates it lazily through the project's selected delivery path, using `bin/fm-ensure-agents-md.sh` and preferring pointers to authoritative sources over copied detail.
Keep fleet delivery posture and captain-private strategy out of project memory.
Expand Down
38 changes: 35 additions & 3 deletions bin/fm-brief.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@
# local-memory-store search before the first substantive action and a reported
# outcome; a secondmate charter omits it because its own crewmates each get
# their own generated brief carrying the same contract.
# A ship brief additionally treats a session-start "pp-brain: auth_missing" banner as a known
# false positive: the worker makes ONE real search_knowledge call before acting on it, and only
# a genuinely failing live call becomes the fixed
# "blocked: <server> unreachable (confirmed by a live call, not the startup banner)" line,
# reusing an existing classifier verb rather than inventing one.
# Ship briefs route a durable finding through a "note: CANDIDATE - {finding}" line the worker
# records and only firstmate promotes, never a direct write to PP Brain or any shared memory.
# The brief treats "note:" as nonterminal like "working:", and discloses that the supervisor's
# wedge guards do not yet do the same.
# A ship brief describes a wait on an open PR/MR as a colleague's approval, never the captain's
# merge decision (the captain cannot approve their own), and requires at least one substantive
# "working:" line before the first "done:"/"failed:" line the worker writes.
# Refuses to overwrite an existing brief.
set -eu

Expand Down Expand Up @@ -432,6 +444,7 @@ fi
# delivery mode, validated above. The generated DOD opens with the fixed
# "Delivery contract: mode=<mode>" line that bin/fm-spawn.sh checks against its own
# explicit --mode before launching.
PAUSE_NOTE=" If a declared wait concerns an open $FORGE_ABBR under review, describe it as awaiting a colleague's approval, never the captain's merge decision - the captain cannot approve their own $FORGE_NOUN."
case "$MODE" in
direct-PR)
SETUP2=""
Expand All @@ -448,6 +461,7 @@ EOF
;;
local-only)
SETUP2=""
PAUSE_NOTE=""
RULE1="1. Never push to any remote and never open a $FORGE_NOUN. Work only on your \`fm/$ID\` branch; firstmate handles the merge into local \`main\`."
IFS= read -r -d '' DOD <<EOF || true
# Definition of done
Expand Down Expand Up @@ -492,6 +506,9 @@ esac
# briefs stay byte-identical to the historical Bash 5 output.
DOD=${DOD%$'\n'}

# The Rule 4 wedge-guard disclosure below is removable once `note` joins the
# working|resolved|captain-held enumerations in fm-supervise-daemon.sh (classify_stale
# and handle_wake's _clear_wedge) and the watcher's stale_is_terminal path.
cat > "$BRIEF" <<EOF
You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

Expand All @@ -502,6 +519,9 @@ You are a crewmate: an autonomous worker agent managed by firstmate. Work on you
Before your first substantive action, search PP Brain (\`search_knowledge\` with both \`query\` and \`prompt\` populated - one alone kills two of six retrieval paths) and the local memory store for prior decisions, refuted approaches, and known traps on this subject.
Treat the \`# Task\` section above as firstmate's assembly of that context, a starting point rather than a substitute.
Report what you found and what it changed in your next status line, or state plainly that both were silent.
If the session-start banner reports \`pp-brain: auth_missing\`, or anything else suggests PP Brain is unauthenticated, treat that alone as a known false positive: make ONE real \`search_knowledge\` call before acting on it.
Only a failing live call is evidence - never stop, and never proceed without org context, on the banner alone.
If that live call genuinely fails, append \`blocked: <server> unreachable (confirmed by a live call, not the startup banner)\` to the status file and stop; firstmate will help.

$HERDR_SECTION

Expand All @@ -520,17 +540,29 @@ $RULE1
3. $FORGE_TOOLS_LINE
4. Report status by appending one line:
\`echo "{state}: {one short line}" >> $STATUS_FILE\`
States: working, needs-decision, blocked, $PAUSED_VERB, done, failed.
States: working, note, needs-decision, blocked, $PAUSED_VERB, done, failed.
Each append wakes firstmate, so report sparingly: only phase changes a supervisor
would act on (setup done, bug reproduced, fix implemented, validation passed) and the
needs-decision/blocked/paused/done/failed states. No step-by-step FYI progress lines;
firstmate reads your pane for that.
A mid-task \`working:\` line (including setup complete) is nonterminal: do not end the
A mid-task \`working:\` or \`note:\` line (including setup complete) is nonterminal: do not end the
turn after it; continue the same stage until a defined \`done:\` gate under Definition of done.
Use \`$PAUSED_VERB: {why}\` - distinct from \`blocked:\` - ONLY when you are deliberately idling on a
known external wait you expect to clear on its own (an upstream release, a rate-limit reset,
a scheduled window): firstmate then leaves your idle pane alone and rechecks it on a long
cadence instead of treating it as a possible wedge. Use \`blocked:\` when you are stuck and need help.
cadence instead of treating it as a possible wedge. Use \`blocked:\` when you are stuck and need help.$PAUSE_NOTE
When you discover a durable finding (knowledge-store drift, a ticket whose real state differs
from this brief, verified behavior of a tool, a trap the next worker would hit), append it as
\`note: CANDIDATE - {finding}\` rather than acting on it yourself: you record candidates, only
firstmate promotes them, and you must never write to PP Brain or any shared memory directly.
Every \`note:\` line reaches firstmate: the next status drain presents it whatever its wording.
But \`note:\` is not yet covered by the supervision wedge guards that protect \`working:\`,
\`resolved:\` and \`captain-held:\`, so while a note whose prose happens to match a legacy
captain-relevant free-text pattern is your last line, wedge detection for your pane can be
suppressed. That gap lives in those guards, not in note wording, and is tracked separately.
Before the FIRST \`done:\` or \`failed:\` line you write, send at least one \`working:\` status
that carries real substance (a finding, a decision, a completed stage) - never end a task on
a single \`done:\` line with nothing reported before it.
5. If you hit the same obstacle twice, append \`blocked: {why}\` and stop; firstmate will help.
6. If a decision belongs above the implementation worker (product choices, destructive actions, ask-user findings),
append \`needs-decision: {summary of options}\` and stop. Firstmate will reply with the decision.
Expand Down
Loading
Loading