Skip to content

fix(bin): make bootstrap output and nudges deterministic - #646

Merged
kunchenguid merged 6 commits into
mainfrom
fm/fm-bootstrap-nudge-s7
Jul 16, 2026
Merged

kunchenguid merged 6 commits into
mainfrom
fm/fm-bootstrap-nudge-s7

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Validate the committed Firstmate bootstrap benign-output and deterministic secondmate-nudge change. The change should make routine session-start confirmations silent by default or explicit BOOTSTRAP_INFO no-action facts so bootstrap-diagnostics no longer loads for benign TASKS_AXI availability, already-live or successful secondmate liveness, harness override, or active dispatch confirmations. It should preserve loud actionable diagnostics, keep AGENTS.md section 13 and the bootstrap-diagnostics skill trigger consistent without duplicating policy, and move secondmate instruction re-read nudges into the deterministic locked session-start sweep immediately after a live secondmate home fast-forwards across a changed loaded instruction surface. Startup nudges must use the existing marked fail-closed fm-send path with stable fm- resolution, report exactly what was sent, preserve idempotent retry markers for failed sends, surface send failures, avoid nudging unchanged homes, and never infer a target outside the registered home. The implementation includes focused regression coverage for benign and actionable output classification, no needless skill trigger, changed and unchanged homes, successful marked sends, failed or ambiguous sends, idempotent retry, and stock macOS Bash 3.2. Let no-mistakes v1.39.0 own guarded custody recovery and branch synchronization onto current main; do not use --yes.

What Changed

  • Made routine bootstrap confirmations silent by default, with optional benign BOOTSTRAP_INFO facts for verbose mode, while preserving actionable diagnostics for missing tools, invalid dispatch config, sync skips, liveness failures, and failed nudges.
  • Moved secondmate instruction re-read nudges into the locked bootstrap sweep so changed live homes are sent marked fm-send.sh fm-<id> messages immediately, with safe state override handling and idempotent retry markers for failures.
  • Updated bootstrap, secondmate provisioning, configuration, and trigger docs to match the new diagnostic contract, and expanded shell regression coverage for benign output, verbose facts, nudge sends, retry safety, and Bash 3.2 compatibility.

Risk Assessment

✅ Low: The change is well-bounded to bootstrap output classification and deterministic secondmate nudging, and the previously identified state override, docs, and retry-marker target-validation risks are now addressed in source with focused coverage added.

Testing

The configured all-tests baseline was already green; I reran the focused bootstrap, secondmate sync/nudge, and liveness suites, then captured a manual CLI transcript showing the end-user bootstrap output and nudge/retry behavior under macOS Bash 3.2, with all checks passing.

Evidence: Manual CLI evidence transcript
Manual end-to-end bootstrap evidence
workspace: /Users/kunchen/.no-mistakes/worktrees/016d88035d58/01KXNXKNE8DVCKW733AAKHPRX9
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin25)
note: FM_GATE_REFUSE_BYPASS=1 is set only for this hermetic fake-fleet fixture because the validator itself runs in a no-mistakes gate worktree.

## 1. Benign startup is silent by default
$ bin/fm-bootstrap.sh
<no output>
$ FM_BOOTSTRAP_VERBOSE_FACTS=1 bin/fm-bootstrap.sh
BOOTSTRAP_INFO: crew harness override active: codex
BOOTSTRAP_INFO: crew dispatch active config/crew-dispatch.json
BOOTSTRAP_INFO: crew dispatch rule: normal work -> codex
BOOTSTRAP_INFO: crew dispatch default: claude/default/low
BOOTSTRAP_INFO: tasks-axi available

## 2. Changed live secondmate receives one marked fm-send nudge
$ bin/fm-bootstrap.sh
BOOTSTRAP_INFO: nudged fm-sm-instr with 'firstmate was updated to the latest - please re-read your AGENTS.md to pick up the new instructions.'
sent tmux commands containing marker/message:
send-keys -t firstmate:fm-sm-instr -l [fm-from-firstmate]⁣firstmate was updated to the latest - please re-read your AGENTS.md to pick up the new instructions.
send-keys -t firstmate:fm-sm-instr Enter
retry marker: absent after successful send

## 3. Failed send leaves marker, retry sends once, third run is silent
$ FM_FAKE_TMUX_FAIL_LITERAL=1 bin/fm-bootstrap.sh
NUDGE_SECONDMATES: secondmate sm-instr: send failed: ●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pending marker after failed send:
id=sm-instr
selector=fm-sm-instr
home=/private/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KXNXKNE8DVCKW733AAKHPRX9/manual-fixture/nudge-retry/sm-instr
commit=61651e573e840d113c58f340b2183e783b8355c0
instructions=AGENTS.md, bin, .agents/skills
message=firstmate was updated to the latest - please re-read your AGENTS.md to pick up the new instructions.
$ bin/fm-bootstrap.sh  # retry after endpoint recovers
BOOTSTRAP_INFO: nudged fm-sm-instr with 'firstmate was updated to the latest - please re-read your AGENTS.md to pick up the new instructions.'
retry marker after retry: cleared
$ bin/fm-bootstrap.sh  # idempotent follow-up
<no output>
Evidence: Bootstrap focused regression log
Focused bootstrap regression tests
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin25)

$ bash tests/fm-bootstrap.test.sh
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap reports treehouse lease + tasks-axi/quota-axi bootstrap contracts
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap enforces no-mistakes minimum version
ok - bootstrap requires git with an install instruction
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap: backend=orca gates the Orca CLI without requiring it on the default backend
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap: session-provider backends require their own CLI + jq + treehouse, never tmux
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap: a session-provider backend gates its own CLI, never a false tmux requirement
ok - bootstrap: Herdr manual-install guidance is never executed as a shell command
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap: the bundled cmux CLI satisfies the active backend dependency
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap: unknown resolved backends fail closed with an actionable diagnostic
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap: JSON-emitting backends require jq (their genuine dep), never tmux
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap: the treehouse lease check follows the resolved backend's worktree provider
ok - bootstrap computes a fleet-size-aware default timeout and preserves partial fleet-sync output
ok - bootstrap keeps the quick 20s default for small fleets
ok - bootstrap preserves FM_FLEET_SYNC_BOOTSTRAP_TIMEOUT as an explicit override
ok - bootstrap treats a blank timeout override as unset
ok - bootstrap computes the timeout before launching fleet sync
ok - bootstrap keeps routine tasks-axi, harness, dispatch, and already-live liveness confirmations silent
ok - bootstrap routine contract runs under system /bin/bash
ok - bootstrap diagnostics trigger excludes benign lines and keeps actionable prefixes
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap surfaces active crew-dispatch rules only as verbose BOOTSTRAP_INFO
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap validates crew-dispatch.json and reports malformed or unverified configs
Evidence: Secondmate sync/nudge focused regression log
Focused secondmate sync/nudge regression tests
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin25)

$ bash tests/fm-secondmate-sync.test.sh
ok - T1 updated: a behind home fast-forwards to the primary's local HEAD
ok - T2 current: an already-current home is a no-op and reports no instruction change
ok - T3 dirty: an uncommitted home is skipped, its edit preserved
ok - T4 diverged: a home that is not an ancestor of the primary's HEAD is skipped
ok - T5 in-flight: a home on a feature branch is skipped, its work preserved
ok - T6 no fetch: the local-HEAD sync never invokes git fetch
ok - T7 sweep nudges on a real instruction change only, but still fast-forwards
ok - T8 bootstrap sweeps live homes and sends exactly one marked nudge for the instruction change
ok - T8a bootstrap nudge send respects FM_STATE_OVERRIDE
ok - T8f bootstrap nudge retry rejects malformed marker ids
ok - T8c failed bootstrap nudge is surfaced and recorded for retry
ok - T8d bootstrap nudge retry is idempotent after success
ok - T8e bootstrap nudge retry refuses a changed home instead of guessing
ok - T8b stale herdr nudge failures leave a retry marker after respawn rotates fm-<id> metadata
ok - T9 bootstrap surfaces a skipped dirty live secondmate home
ok - T10 spawn fast-forwards a secondmate worktree to the primary's local HEAD before launch
ok - T11 spawn warns when pre-launch sync is skipped
ok - T12 gitignored marker: a freshly seeded home reads clean to fleet-sync and the ff sweep
ok - T13 gitignored marker: an existing marker-only-dirty home converges, then reads clean
ok - T14 marker tolerance does not mask a genuinely dirty home
ok - T15 the firstmate repo gitignores the secondmate seed marker
# all fm-secondmate-sync tests passed
Evidence: Secondmate liveness focused regression log
Focused secondmate liveness regression tests
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin25)

$ bash tests/fm-secondmate-liveness.test.sh
ok - fm_backend_tmux_agent_alive: alive/dead/unknown classification
ok - fm_backend_herdr_agent_alive: dead/no-agent->dead, live->alive, unknown->unknown
ok - fm_backend_agent_alive: routes tmux/herdr correctly, unknown for an unverified backend
ok - sweep: a confirmed-dead secondmate endpoint is killed and respawned
ok - sweep: an already-live secondmate is left untouched (no kill, no respawn)
ok - sweep: a transient/unknown probe reading is reported but never acted on
ok - sweep: an unverified harness makes a dead-looking probe inconclusive
ok - sweep: idempotent by construction - a live secondmate is never re-touched on a later run
ok - sweep: skipped entirely under FM_BOOTSTRAP_DETECT_ONLY=1, exactly like the other mutating sweeps
ok - sweep: a silent no-op with no kind=secondmate meta present (a secondmate home's own natural scoping)
# all fm-secondmate-liveness tests passed

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed (3) ✅
  • 🚨 bin/fm-bootstrap.sh:249 - secondmate_sync builds its sweep and retry markers from the effective $STATE, but the new fm-send.sh calls do not pass FM_STATE_OVERRIDE=&#34;$STATE&#34;. In any supported specialized/test setup with an alternate state dir, fm-send.sh falls back to $FM_HOME/state, so fm-&lt;id&gt; can fail to resolve or resolve stale metadata instead of the secondmate home this sweep just validated and fast-forwarded. Pass FM_STATE_OVERRIDE=&#34;$STATE&#34; on both the immediate send here and the retry send at line 301.

🔧 Fix: Honor state override for bootstrap nudges
1 warning still open:

  • ⚠️ docs/configuration.md:35 - The configuration docs still describe the removed benign confirmations as TASKS_AXI: available behavior here and CREW_DISPATCH: active at line 216. The implementation now keeps these silent by default and only emits verbose BOOTSTRAP_INFO facts, so these old labels can send operators or agents looking for diagnostics that no longer exist. Update the references to the new silent/default and verbose BOOTSTRAP_INFO behavior.

🔧 Fix: Update benign bootstrap documentation labels
1 warning still open:

  • ⚠️ bin/fm-bootstrap.sh:267 - The required criterion says startup nudges must "never infer a target outside the registered home," but retry markers read id= from state and use it directly in meta=&#34;$STATE/$id.meta&#34; and later fm-send.sh &#34;$selector&#34; without applying the safe-id check used when writing markers. A malformed or stale marker with id=../../... can make the retry path read metadata outside the effective state directory and route fm-&lt;id&gt; through that external metadata instead of a registered secondmate in this home. Validate the loaded marker id before constructing paths or selectors, and reject markers whose filename does not match the safe id.

🔧 Fix: Validate bootstrap nudge retry markers
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • Pre-run baseline already succeeded: command -v tmux &gt;/dev/null || { echo &#34;tmux is required for e2e tests&#34; &gt;&amp;2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo &#34;== $t ==&#34;; bash &#34;$t&#34; || rc=1; done; exit &#34;$rc&#34;
  • bash tests/fm-bootstrap.test.sh
  • bash tests/fm-secondmate-sync.test.sh
  • bash tests/fm-secondmate-liveness.test.sh
  • Evidence rerun to logs: bash tests/fm-bootstrap.test.sh, bash tests/fm-secondmate-sync.test.sh, and bash tests/fm-secondmate-liveness.test.sh under /bin/bash 3.2.57
  • Manual fake-fleet CLI check recorded in bootstrap-e2e-cli-transcript.log: benign bootstrap produced no output, verbose mode produced only BOOTSTRAP_INFO, changed live secondmate produced one marked fm-send nudge, failed send left a pending marker, retry cleared it, and the next run returned to silence
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid
kunchenguid merged commit 1346ff7 into main Jul 16, 2026
5 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-bootstrap-nudge-s7 branch July 16, 2026 18:12
claw000606 pushed a commit to boyangwang/firstmate that referenced this pull request Jul 19, 2026
…#646)

* fix: make bootstrap nudges deterministic

* no-mistakes(review): Honor state override for bootstrap nudges

* no-mistakes(review): Update benign bootstrap documentation labels

* no-mistakes(review): Validate bootstrap nudge retry markers

* no-mistakes(document): Align bootstrap nudge documentation

* no-mistakes: apply CI fixes
kirubeltadesse added a commit to kirubeltadesse/firstmate that referenced this pull request Jul 20, 2026
* fix: restore fleet snapshots on stock macOS Bash (kunchenguid#578)

* fix: restore stock macOS snapshot parsing

* no-mistakes(document): Clarify Linux gate and macOS CI coverage

* fix(afk): make Pi escalation and return catch-up reliable (kunchenguid#587)

* fix: close away-mode blocker supervision gap

* no-mistakes(review): Gate teardown retries and verify U+2063 dedupe

* no-mistakes(test): Fail closed on incomplete Pi composer separators

* no-mistakes(document): Document Pi composer recognition and return gating

* feat: support Pi max reasoning profiles (kunchenguid#537)

* support Pi max thinking profiles

* no-mistakes(review): Captain, allow Pi max dispatch profiles

* chore: no-mistakes(document): Clarify yolo response ownership (kunchenguid#595)

* Clarify validation response ownership

* no-mistakes(document): Clarify yolo response ownership

* feat: establish instruction ownership foundation (kunchenguid#619)

* Add instruction owners foundation

* no-mistakes(document): Refresh project-management owner pointers

* fix: compress Firstmate contract and enforce delivery rigor ownership (kunchenguid#626)

* docs: compress firstmate operating contract

* docs: make delivery rigor single-owner

PR B already removed personal and stacked review requirements, but it did not explicitly assign rigor to the selected delivery path or forbid risk-based manual clean gates. That gap still permitted the Hi Bit inversion.

* no-mistakes(review): Honor configured merge authority across faster delivery paths

* no-mistakes(document): Align docs with compressed operating contract

* feat: add durable captain decision holds (kunchenguid#593)

* Add durable captain decision holds

* no-mistakes(review): Validate decision hold retries and origin paths

* no-mistakes(review): Enforce durable decision lifecycle boundaries

* no-mistakes(review): Harden decision display and partial retry recovery

* no-mistakes(test): Update scout teardown fixtures for decision inventory

* no-mistakes(document): Align decision lifecycle and scout teardown documentation

* no-mistakes: apply CI fixes

* no-mistakes(review): Reconcile terminal decision holds

* no-mistakes(document): Align captain decision-hold documentation

* fix(bin): harden PR check artifacts (kunchenguid#556)

* fix: harden PR check artifacts

* fix: close PR check migration gaps

* fix: close PR check retry gaps

* fix: clarify migration outcomes and ESM boundary

* fix: keep failed migrations authoritative

* test: use inert PR validation fixtures

* no-mistakes(review): Reserve noncanonical PR quarantine namespace

* no-mistakes(review): Prevalidate final PR-check teardown artifacts

* no-mistakes(review): Preserve X metadata and validate teardown IDs

* no-mistakes(review): Initialize migration state before watcher exclusion

* no-mistakes(review): Isolate failed poll migrations from bootstrap recovery

* no-mistakes(review): Allow safe polling during incomplete private repairs

* no-mistakes(review): Authenticate watcher checks at execution time

* no-mistakes(review): Preserve custom checks with hash-bound registration

* no-mistakes(review): Clean custom check snapshots on watcher signals

* no-mistakes(review): Stop watcher checks promptly on signals

* no-mistakes(review): Terminate watcher check groups before cleanup

* no-mistakes(document): Correct stale X-mode watcher documentation

* fix: drain returned watcher check groups

* no-mistakes(review): Harden quarantine links and recover validated replacement polls

* no-mistakes(review): Preserve X mode across shim version transitions

* no-mistakes(review): Refresh legacy X shims before marker short-circuits

* no-mistakes(document): Correct persisted PR-check artifact documentation

* no-mistakes(document): Correct stale PR-check documentation

* fix: bind PR poll repair provenance

* no-mistakes(review): Enforce single-link ownership for custom check artifacts

* no-mistakes(review): Preserve private checks, X polling, and lifecycle IDs

* no-mistakes(review): Separate task creation and legacy teardown validation

* no-mistakes(review): Restore safe legacy operations and teardown validation

* no-mistakes(review): Disambiguate migration obligations and preserve legacy retries

* no-mistakes(review): Preserve fail-closed diagnostics and legacy quarantine evidence

* no-mistakes(review): Reconcile legacy migration retries and teardown collisions

* no-mistakes(review): Force legacy namespace reconciliation before marker short-circuits

* no-mistakes(document): Document private poll artifact safety contracts

* no-mistakes(lint): Suppress intentional literal-dollar lint finding

* fix: migrate historical X poll identity

* fix: harden PR check artifacts

* no-mistakes(review): Preserve fail-closed diagnostics and legacy quarantine evidence

* no-mistakes(review): Reconcile legacy migration retries and teardown collisions

* fix: migrate historical X poll identity

* no-mistakes(review): Harden X-mode artifact publication against symlink corruption

* no-mistakes(review): Guard X artifact publication

* no-mistakes(review): Enforce private X artifact reads

* no-mistakes(test): Fix backend compatibility fixture dependencies

* no-mistakes(document): Refresh PR-check documentation

* no-mistakes(lint): Remove unused x-mode test locals

* no-mistakes: apply CI fixes

* fix(bin): compact session-start backlog digest (kunchenguid#636)

* fix: compact session-start backlog digest

* no-mistakes(test): Fix legacy backend fixture helper

* no-mistakes(test): Fix watcher exit wait helper

* no-mistakes(document): Document compact backlog digest

* fix: dedupe stale watcher guard banners (kunchenguid#637)

* fix: dedupe stale watcher guard banner

* no-mistakes(review): Keep read-only guard state nonmutating

* no-mistakes(document): Clarify stale watcher docs

* fix(bin): balance bearings landed baseline (kunchenguid#640)

* fix: balance bearings landed defaults

* no-mistakes(document): Document balanced landed baseline

* no-mistakes: apply CI fixes

* fix: clarify captain-facing translation contract (kunchenguid#644)

* docs: clarify captain-facing translation contract

* no-mistakes(review): Restore runtime fallback mandate

* no-mistakes(document): Align Bearings translation wording

* fix(bin): make bootstrap output and nudges deterministic (kunchenguid#646)

* fix: make bootstrap nudges deterministic

* no-mistakes(review): Honor state override for bootstrap nudges

* no-mistakes(review): Update benign bootstrap documentation labels

* no-mistakes(review): Validate bootstrap nudge retry markers

* no-mistakes(document): Align bootstrap nudge documentation

* no-mistakes: apply CI fixes

* docs(secondmate-provisioning): clarify concise registry ownership (kunchenguid#649)

* Clarify concise secondmate registry contract

* no-mistakes(review): Expand secondmate registry boilerplate coverage

* no-mistakes(document): Point route docs to owner

* fix(bin): strip quoted blocked_by values during decision hold resolve (kunchenguid#654)

* fix(bin): strip quotes on blocked_by in decision-hold resolve

tasks-axi quotes multi-entry blocked_by as "a,b,c", so the comma-boundary
membership test only matched middle elements. Strip surrounding quotes
before matching so first and last hold ids resolve correctly.

* no-mistakes(document): Refresh decision-hold regression evidence

* feat(secondmate): inherit shared captain preferences (kunchenguid#656)

* feat(secondmate): inherit shared captain preferences

* no-mistakes(review): Honor shared captain data overrides

* no-mistakes(review): Honor bootstrap data override registry

* no-mistakes(document): Refresh shared inheritance docs

* no-mistakes(document): Clarify inherited local-material docs

* feat: gate local agent secret injection (kunchenguid#658)

* feat(spawn): gate local agent secret injection

* fix(spawn): align final Keychain slot

* no-mistakes: apply CI fixes

* test: isolate Herdr autodetect smoke sessions (kunchenguid#662)

* test: isolate herdr autodetect smoke session

* no-mistakes(review): Restored autodetect smoke gate bypass

* no-mistakes(test): Harden Herdr lab provisioning

* no-mistakes(document): Refresh Herdr lab docs

* docs: adopt under way for active work (kunchenguid#666)

* Revert "feat: gate local agent secret injection (kunchenguid#658)" (kunchenguid#668)

This reverts commit c27135c.

* fix(pi): distinguish stale locks when arming watcher (kunchenguid#681)

* fix(pi): distinguish stale locks when arming watcher

* no-mistakes(test): Stabilize watcher extension async waits

* no-mistakes(document): Document Pi lock recovery

* fix: accept secondmate house vocabulary (kunchenguid#685)

* fix: accept secondmate as house vocabulary

* no-mistakes(test): Update captain vocabulary contract test

* no-mistakes(document): Align secondmate documentation vocabulary

* fix(bin): parse handoff homes after registry parentheticals (kunchenguid#686)

* fix: parse secondmate home after pre-field parentheses

Registry summaries often include parentheticals before the structured
(home: ...) field. Match that field with a greedy prefix so handoff
no longer reports "has no home" for those entries.

* no-mistakes(document): Refresh handoff test comments

* feat: add native session-start nudges (kunchenguid#687)

* feat: add native session-start nudges

* no-mistakes(document): Document nudge script inventory

* docs: call built-in defaults the firstmate repo, not template (kunchenguid#688)

Relabel absent-captain and related domain defaults wording so it names
the firstmate repo rather than treating "template" as this domain's
identity label. Keep the design-tenet "shared template" statements and
unrelated launch/PR-poll template uses unchanged.

* fix(bin): repair fm-brief.sh parse error and harden set -u array expansion (kunchenguid#205)

* fix(bin): use set -u-safe empty-array expansion in pr-merge and spawn

Expanding "${arr[@]}" on an empty array under set -u fails on bash < 4.4
(notably macOS bash 3.2). Quote the portable "${arr[@]+"${arr[@]}"}" idiom
in fm-pr-merge and fm-spawn batch dispatch so empty arrays expand to nothing.

Co-authored-by: Cursor <[email protected]>

* test(brief): harden fm-brief regression coverage for parse and scaffolds

Tighten bash -n checking, pin literal backtick rendering in the no-mistakes
DOD wording assertion, and keep a scout/secondmate scaffold smoke test so the

Co-authored-by: Cursor <[email protected]>
kunchenguid#166 apostrophe regression cannot return unnoticed.

---------

Co-authored-by: Cursor <[email protected]>

* fix(bin): keep watcher supervision continuous across child cycles (kunchenguid#693)

* fix: make watcher supervision continuous

* no-mistakes(review): Bound watcher retries and log attached signals

* no-mistakes(review): Add bounded successor-recovery wake fallbacks

* no-mistakes(review): Prevent overlapping successor-arm retries

* no-mistakes(review): Resume supervision after late arm closes

* no-mistakes(review): Bind OpenCode recovery to attempted arm

* no-mistakes(test): Synchronize peer beacon regression fixture

* no-mistakes(test): Synchronize Pi and OpenCode late-close lifecycle fixtures

* no-mistakes(document): Captain: document watcher successor protocol behavior

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* no-mistakes: apply CI fixes

* fix: fetch current PR head for review diffs (kunchenguid#722)

* fix: always fetch PR head for review diffs

Prefer a freshly fetched refs/pull/<n>/head over a reachable recorded
pr_head= so reviewers never hold a merge over a "missing" fix that already
landed on the remote PR. Recorded SHA is offline fallback only; local branch
is last resort with a warning. Store the tip under refs/fm-review/ so a later
base-branch fetch cannot clobber the compare tip via FETCH_HEAD.

* no-mistakes(test): Isolate session-start nudge tests from gate state

* no-mistakes(document): Correct review-diff documentation

* docs: resolve five contract contradictions across AGENTS.md, README, and skills (kunchenguid#736)

* docs: resolve five contract contradictions

* no-mistakes(test): align owner-pointer assertions with reworded docs; skip absent shellcheck

* docs(harness): correct Grok exit guidance (kunchenguid#742)

* docs(harness): reverify grok exit command

* no-mistakes(test): Correct Grok exit resume attribution

* fix(watcher): bound stale wakes for parked crew (kunchenguid#743)

* fix(watcher): bound stale wakes for exited paused crew

* no-mistakes(review): Gate pause suppression on confirmed agent death

* no-mistakes(test): Fixed stale pause cadence

* no-mistakes(document): Document dead-agent hold cadence

* fix(supervision): distinguish ordinary wakes from recovery (kunchenguid#744)

* fix(supervision): distinguish ordinary wakes from repair

* no-mistakes(review): Make passive guard follow-ups recovery-only

* no-mistakes(document): Clarify recovery-only turn-end guard documentation

* fix(x-mode): dedupe pending mention wakes (kunchenguid#745)

* fix(x-mode): dedupe pending mention wakes

* no-mistakes(review): fix x-poll claim error deduplication

* no-mistakes(review): separate claim diagnostics from relay recovery

* no-mistakes(document): Document X-mode once-only mention wakes

* refactor: slim AGENTS.md to ~200 lines, reference files for details

* docs: use canonical expanded reference files from main repo

---------

Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Korallis <[email protected]>
Co-authored-by: Johans Ballestar <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Israel Wilson <[email protected]>
Marl0nL added a commit to Marl0nL/firstmate that referenced this pull request Jul 24, 2026
…kunchenguid#646, kunchenguid#662, kunchenguid#686, kunchenguid#722, kunchenguid#744) (#23)

* fix: dedupe stale watcher guard banners (kunchenguid#637)

* fix: dedupe stale watcher guard banner

* no-mistakes(review): Keep read-only guard state nonmutating

* no-mistakes(document): Clarify stale watcher docs

(cherry picked from commit 2406354)

* fix(bin): make bootstrap output and nudges deterministic (kunchenguid#646)

* fix: make bootstrap nudges deterministic

* no-mistakes(review): Honor state override for bootstrap nudges

* no-mistakes(review): Update benign bootstrap documentation labels

* no-mistakes(review): Validate bootstrap nudge retry markers

* no-mistakes(document): Align bootstrap nudge documentation

* no-mistakes: apply CI fixes

(cherry picked from commit 1346ff7)

* test: isolate Herdr autodetect smoke sessions (kunchenguid#662)

* test: isolate herdr autodetect smoke session

* no-mistakes(review): Restored autodetect smoke gate bypass

* no-mistakes(test): Harden Herdr lab provisioning

* no-mistakes(document): Refresh Herdr lab docs

(cherry picked from commit 85643ee)

* fix(bin): parse handoff homes after registry parentheticals (kunchenguid#686)

* fix: parse secondmate home after pre-field parentheses

Registry summaries often include parentheticals before the structured
(home: ...) field. Match that field with a greedy prefix so handoff
no longer reports "has no home" for those entries.

* no-mistakes(document): Refresh handoff test comments

(cherry picked from commit d939c49)

* fix(bin): repair fm-brief.sh parse error and harden set -u array expansion (kunchenguid#205)

* fix(bin): use set -u-safe empty-array expansion in pr-merge and spawn

Expanding "${arr[@]}" on an empty array under set -u fails on bash < 4.4
(notably macOS bash 3.2). Quote the portable "${arr[@]+"${arr[@]}"}" idiom
in fm-pr-merge and fm-spawn batch dispatch so empty arrays expand to nothing.


* test(brief): harden fm-brief regression coverage for parse and scaffolds

Tighten bash -n checking, pin literal backtick rendering in the no-mistakes
DOD wording assertion, and keep a scout/secondmate scaffold smoke test so the


---------

(cherry picked from commit bc1a21b)

* fix: fetch current PR head for review diffs (kunchenguid#722)

* fix: always fetch PR head for review diffs

Prefer a freshly fetched refs/pull/<n>/head over a reachable recorded
pr_head= so reviewers never hold a merge over a "missing" fix that already
landed on the remote PR. Recorded SHA is offline fallback only; local branch
is last resort with a warning. Store the tip under refs/fm-review/ so a later
base-branch fetch cannot clobber the compare tip via FETCH_HEAD.

* no-mistakes(test): Isolate session-start nudge tests from gate state

* no-mistakes(document): Correct review-diff documentation

(cherry picked from commit b2bf95f)

* fix(supervision): distinguish ordinary wakes from recovery (kunchenguid#744)

* fix(supervision): distinguish ordinary wakes from repair

* no-mistakes(review): Make passive guard follow-ups recovery-only

* no-mistakes(document): Clarify recovery-only turn-end guard documentation

(cherry picked from commit 68c6110)

---------

Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Johans Ballestar <[email protected]>