Skip to content

feat(bin): sync upstream firstmate updates and restore fork docs#19

Merged
mielyemitchell merged 26 commits into
mainfrom
fm/upstream-sync3-c8
Jul 18, 2026
Merged

feat(bin): sync upstream firstmate updates and restore fork docs#19
mielyemitchell merged 26 commits into
mainfrom
fm/upstream-sync3-c8

Conversation

@mielyemitchell

@mielyemitchell mielyemitchell commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Intent

Fix PR #19 review nits before merge. This is a docs-only follow-up on the round-3 upstream sync branch: restore the fork dispatch-ack guidance in AGENTS.md at the three missing touchpoints identified by sync3-review-d7 report N1 (.pending-acks state-file description, fm-send --expect-ack steer-usage guidance, and ack-missed wake-handling guidance), adapting the wording to the condensed AGENTS.md structure without touching code. Also correct the PR #19 body via gh-axi so fm-send --expect-ack is described as fork-only, not an upstream feature. Validate the updated branch through no-mistakes and get PR checks green.

What Changed

  • Merged upstream/main, bringing in durable captain decision holds (bin/fm-decision-hold.sh, docs/decision-hold-lifecycle.md), hardened PR-check handling (bin/fm-pr-lib.sh, bin/fm-pr-check-migrate.sh, bin/fm-pr-check.sh), secondmate shared-captain-preference inheritance, Pi max reasoning profiles, and numerous reliability fixes across bootstrap, watch, afk, and bearings scripts in bin/ and .agents/skills/.
  • Restored fork-specific documentation that the upstream merge had dropped: AGENTS.md's .pending-acks state-file description, fm-send --expect-ack steer-usage guidance, and ack-missed wake-handling guidance, plus corresponding docs/scripts.md rows and README.md/docs/architecture.md bullets and links.
  • Added extensive new test coverage for the merged behavior, including tests/fm-pr-check-security.test.sh, tests/fm-decision-hold-lifecycle.test.sh, tests/fm-afk-return.test.sh, tests/fm-shared-captain-inheritance.test.sh, tests/fm-captain-translation-contract.test.sh, and tests/fm-instruction-owners.test.sh.

Risk Assessment

✅ Low: The two fork-authored commits (bd12109, 51b13ba) are pure documentation restorations with zero functional/code changes (one comment-only edit in fm-usage-tripwire.sh); every restored docs/scripts.md row was cross-checked 1:1 against actual files in bin/ and bin/backends/ (no missing, no stale entries), and the restored AGENTS.md dispatch-ack guidance (.pending-acks, --expect-ack, ack-missed) matches the real implementation in fm-ack-lib.sh, fm-send.sh, fm-watch.sh, and their tests. The bulk of the diff stat is an upstream sync merge (9f99ce5) carrying already-published upstream commits, not new fork logic authored in this review round.

Testing

The configured baseline suite (tests/*.test.sh under tmux) already passed before I started. Since the only change is prose in AGENTS.md, I additionally ran the two most relevant targeted tests: fm-instruction-owners.test.sh (validates AGENTS.md's structural claims and ownership map) and fm-ack-loop.test.sh (exercises the actual fm-send --expect-ack / ack-missed / .pending-acks behavior the new prose describes) - both fully green, confirming the newly-worded documentation accurately matches real, already-tested code behavior. I also diffed the exact commit under test and read the surrounding numbered list by eye to confirm the new item slots in without breaking the section's numbering or flow. The working tree is clean after testing (no stray artifacts). I corrected the PR #19 body wording with gh-axi pr edit so it describes fm-send --expect-ack as the fork-only dispatch-ack feature, not an upstream feature, and rechecked the final body text after CI passed. No screenshots or rendered UI apply here - this is a shell/doc-only repo with no visual surface.

Evidence: AGENTS.md docs diff + targeted test output
=== git diff bd12109..51b13ba (the docs-only commit under test) ===
diff --git a/AGENTS.md b/AGENTS.md
index 84227a7..8e08da1 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -99,6 +99,7 @@ state/               volatile runtime signals; gitignored
   x-outbox/          generated X-mode dry-run reply and dismiss previews; inspect it when FMX_DRY_RUN is set (section 14)
   x-poll.error       generated X-mode relay diagnostic dedupe marker
   .wake-queue        durable queued wakes: epoch<TAB>seq<TAB>kind<TAB>key<TAB>payload
+  .pending-acks      durable fm-send --expect-ack rows for must-not-drop steers; the watcher escalates missed acknowledgements once and teardown prunes rows per task
   .afk               durable away-mode flag; present = sub-supervisor may inject escalations (set by /afk, cleared on user return)
   .fleet-freeze      durable fleet-freeze flag; present = fm-spawn.sh, fm-send.sh, fm-watch.sh, fm-watch-arm.sh, and the supervise daemon refuse fleet movement
   .watch.lock .wake-queue.lock watcher singleton and queue serialization locks
@@ -242,6 +243,7 @@ After spawning, confirm the worker is processing the brief, handle any trust dia
 A persistent secondmate is recorded in the secondmate registry and runtime state, never as a backlog work item.
 
 Steer a worker with short single-line messages through fail-closed `fm-send`; put long instructions in a file.
+For a captain dispatch or other must-not-drop steer, use `fm-send --expect-ack <minutes>` so the watcher escalates if the target does not acknowledge with a status event.
 A secondmate's routed reply returns through status or a document pointer, not by firstmate peeking into its chat.
 Supervise all live work under section 8.
 
@@ -327,8 +329,9 @@ Handle actionable wakes as follows:
 
 1. For `signal:`, read the listed event lines first, then reconcile current state only where action depends on it.
 2. For `stale:`, inspect the recorded endpoint and load `stuck-crewmate-recovery` for a stopped, looping, confused, or unresponsive worker; a deep-inspection reason also requires current-state and validation-log inspection.
-3. For `check:`, act on the named poll result, including merges and X-mode events.
-4. For `heartbeat:`, review the whole fleet from the structured fleet view, reconcile suspicious tasks and PR state, update the backlog, and never report an unchanged fleet as progress.
+3. For `ack-missed:`, treat the steer as possibly dropped; peek or read current state, then steer or recover the target before assuming it saw the instruction.
+4. For `check:`, act on the named poll result, including merges and X-mode events.
+5. For `heartbeat:`, review the whole fleet from the structured fleet view, reconcile suspicious tasks and PR state, update the backlog, and never report an unchanged fleet as progress.
 
 When any wake reports a merged PR for a project cloned in this home, refresh that clone through the guarded fleet-sync path.
 When X-linked work reaches a milestone or terminal state, load `fmx-respond`; before terminal teardown, always post the final completion follow-up so the link clears even if earlier follow-ups were spent.

=== tests/fm-instruction-owners.test.sh ===
ok - new internal skills have one precise AGENTS.md trigger each
ok - diagnostic-reasoning owns the approved evidence procedure
ok - project-management owns registry, delivery posture, consent, initialization, and removal safety
ok - generic effort fallback applies only below captain and standing configuration
ok - firstmate-coding-guidelines owns compatibility review and deterministic enforcement
ok - secondmate registry guidance keeps concise routes and points to the charter
ok - state, startup, and ordinary recovery have focused owners and triggers
ok - compressed AGENTS.md records the approved one-owner map
ok - compressed AGENTS.md retains authority, supervision, AFK, and X safety

=== tests/fm-ack-loop.test.sh ===
ok - fm-send --expect-ack records target, deadline, baseline, and summary after a successful lane send
ok - fm-send --expect-ack rejects explicit backend pane targets
ok - pending ack clears when the target status file changes after send
ok - missed pending ack escalates once and is queued through the wake queue
ok - fm-watch surfaces expired pending acks as actionable wake reasons
ok - deadline lateness labels use seconds under two minutes and m/s after that

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • 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"
  • git diff bd12109..51b13ba (isolated the docs-only commit under test)
  • bash tests/fm-instruction-owners.test.sh
  • bash tests/fm-ack-loop.test.sh
  • manual review of AGENTS.md section 8's renumbered wake-handling list (1-5) for consistency
  • gh pr view 19 --json body,title,url to confirm current PR body wording for the fork-only note
  • git status --short to confirm no leftover test artifacts in the worktree
✅ **Document** - PR metadata note resolved

✅ The document step raised an informational note about the PR body wording; the final PR body was corrected with gh-axi pr edit so fm-send --expect-ack is described as fork-only, not upstream.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

kunchenguid and others added 26 commits July 14, 2026 02:47
…#555)

* fix: make bearings use secondmate home state

* test: anonymize bearings fixtures

* no-mistakes(review): Bound parent activity evidence scans, captain

* no-mistakes(review): Preserve structured secondmate authority and bounds, captain

* no-mistakes(review): Preserve registry completeness and child inventory, captain

* no-mistakes(review): Reconcile parent evidence by verb and key, captain

* no-mistakes(review): Treat unkeyed parent evidence as inconclusive, captain

* no-mistakes(document): Document bearings local snapshot and PR opt-in

* no-mistakes(lint): Fix fleet snapshot ShellCheck findings

* no-mistakes: apply CI fixes
* fix: restore stock macOS snapshot parsing

* no-mistakes(document): Clarify Linux gate and macOS CI coverage
…d#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
* support Pi max thinking profiles

* no-mistakes(review): Captain, allow Pi max dispatch profiles
…nguid#595)

* Clarify validation response ownership

* no-mistakes(document): Clarify yolo response ownership
* Add instruction owners foundation

* no-mistakes(document): Refresh project-management owner pointers
…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
* 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: 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: 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 banner

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

* no-mistakes(document): Clarify stale watcher docs
* fix: balance bearings landed defaults

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

* no-mistakes: apply CI fixes
* docs: clarify captain-facing translation contract

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

* no-mistakes(document): Align Bearings translation wording
…#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
…nchenguid#649)

* Clarify concise secondmate registry contract

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

* no-mistakes(document): Point route docs to owner
…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

* 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(spawn): gate local agent secret injection

* fix(spawn): align final Keychain slot

* no-mistakes: apply CI fixes
* 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
* fix(pi): distinguish stale locks when arming watcher

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

* no-mistakes(document): Document Pi lock recovery
Integrated upstream/main through 46e4201.

Guardrail integration report:

- popup-risk unknown hard-fail + idle-to-busy probe: re-applied in bin/fm-send.sh via require_verified_submit/pre_busy_state and verified by grep plus tests/fm-send-popup-settle.test.sh::test_codex_dollar_unknown_submit_verdict_fails_loudly.

- watcher fleet freeze refusal: re-applied in bin/fm-watch.sh via fm_fleet_freeze_refuse "watch"; verified by grep and tests/fm-freeze.test.sh.

- AGENTS judgment criteria: re-applied in AGENTS.md, including the yolo Routine definition; verified by grep and tests/fm-instruction-owners.test.sh.

- bounded no-mistakes bootstrap probe: survived in bin/fm-bootstrap.sh via FM_NO_MISTAKES_PROBE_TIMEOUT/no_mistakes_bounded; verified by grep and tests/fm-bootstrap.test.sh.

- Herdr protocol floor: re-applied the fork floor as FM_BACKEND_HERDR_MIN_PROTOCOL=16 in bin/backends/herdr.sh and aligned docs; verified by grep, tests/fm-backend-herdr.test.sh, and real Herdr smoke tests.

- tasks-axi cwd trap and wrapper references: re-applied bootstrap TASKS_AXI cwd-trap diagnostics plus fm-teardown/stow wrapper references; verified by grep, tests/fm-bootstrap.test.sh, tests/fm-tasks-axi.test.sh, tests/fm-teardown.test.sh, and tests/fm-stow-contract.test.sh.

Verification:

- for t in tests/*.test.sh; do bash "$t" || exit $?; done

- bin/fm-lint.sh

- shellcheck bin/*.sh bin/backends/*.sh

Expected local skips: cmux socket smoke unavailable, zellij binary unavailable, opt-in Pi/Herdr live e2e tests unset, and installed tasks-axi lacks newer compatibility/atomic multi-ID move support.
…cripts.md rows, architecture.md sections, README bullets/links
@mielyemitchell mielyemitchell changed the title docs: sync upstream firstmate changes and restore fork-specific documentation feat(bin): sync upstream firstmate updates and restore fork docs Jul 18, 2026
@mielyemitchell
mielyemitchell merged commit 1a30163 into main Jul 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants