Skip to content

Merge upstream round 3 through kunchenguid/firstmate@9e3df47b - #264

Merged
HelloWorldSungin merged 9 commits into
mainfrom
fm/fm-upstream-sync-2026-09-02-round-3
Sep 4, 2026
Merged

HelloWorldSungin merged 9 commits into
mainfrom
fm/fm-upstream-sync-2026-09-02-round-3

Conversation

@HelloWorldSungin

@HelloWorldSungin HelloWorldSungin commented Sep 4, 2026 •

Copy link
Copy Markdown
Owner

Intent

Round 3 of the recorded 7-round upstream sync plan: merge the contiguous first-parent prefix
f66be0f8..9e3df47b from kunchenguid/firstmate into this fork as one reviewable merge PR.

  • Fork base: bb268932f3983e6b31df9006989b08163237b736
  • Measured merge base: f66be0f8f7f56f78d09458d909bdd555b9dbcf76
  • Round endpoint: 9e3df47b4a5f228d8e3bf2b889e7119f95b85be5

Endpoint identity

The plan named the endpoint by its abbreviation. Both identities were resolved and they agree:

$ git rev-parse 9e3df47b^{commit}
9e3df47b4a5f228d8e3bf2b889e7119f95b85be5
$ gh-axi api repos/kunchenguid/firstmate/pulls/3299   # merge_commit_sha
9e3df47b4a5f228d8e3bf2b889e7119f95b85be5             # base.sha 0ace60ab (change 19)

9e3df47b is the commit upstream PR kunchenguid/firstmate#3299 landed on main, and its
first parent is change 19. Nothing later than it entered the round: the only commits this branch
adds over the fork base are the five upstream changes, the merge commit, and one follow-up commit
that removes the inventory row for a script this round deleted.

$ git log --oneline bb268932..HEAD
c2232595 docs(scripts): drop the retired harness-adapter routing script row
aa77f071 Merge upstream round 3 through kunchenguid/firstmate@9e3df47b
9e3df47b refactor: retire legacy PR-check migration machinery (#3299)
0ace60ab test: centralize shared shell fixtures (#3296)
c731c36c docs(skills): split harness adapter operations reference (#3289)
4eb587d6 fix(bin): prevent routine updates from hiding actionable status (#3268)
5f310975 fix(bin): keep home-summary publication from starving supervision (#3273)

Upstream has advanced past the plan's own round-7 endpoint since the plan was written; that is
expected and changed nothing here. The round is a full merge of a contiguous prefix, created with
git merge --no-ff and one upstream parent. No cherry-pick, rebase, force-push, squash, or fork
main rewrite was used.

Applicability of every upstream change in this round

# Upstream change Classification What happened
16 5f310975 kunchenguid/firstmate#3273 conflicted with fork work, resolved The home-summary starvation fix itself took cleanly (bin/fm-home-summary-refresh.sh, bin/fm-classify-lib.sh, bin/fm-watch.sh, and 488 lines of new test). Two parts needed a decision: its new HOME_SUMMARY: bootstrap diagnostic had to be threaded into the fork's longer diagnostic list, and its second per-task read bound FM_SNAPSHOT_CREW_STATE_TIMEOUT duplicates a fork contract the ledger says must stay single.
17 4eb587d6 kunchenguid/firstmate#3268 conflicted with fork work, resolved 23 files. The signal_reason_is_actionable -> signal_files_actionable rewrite, the deletion of scan_captain_relevant_statuses, and the status-span presentation-marker contract all took cleanly, exactly as the plan predicted, because the fork's callers were unchanged base. Three sites needed a decision: the afk skill's declared-wait bullet, the rewritten mark_surfaced in bin/fm-push-transition-lib.sh, and the away daemon's escalation gating in bin/fm-supervise-daemon.sh.
18 c731c36c kunchenguid/firstmate#3289 conflicted with fork work, resolved (semantic collision C1) Both sides had split the same skill independently. Upstream's layout and routing artifact were taken whole and the fork's own split retired; see "Semantic collision C1" below.
19 0ace60ab kunchenguid/firstmate#3296 adapted, with a reason The new tests/fixtures.sh and five of the six migrated suites took cleanly, and the plan's prediction held: the fixture code moved into a NEW file, so the fork's descendant reaping in tests/lib.sh is untouched. tests/fm-spawn-dispatch-profile.test.sh needed adapting because the fork's inline tmux stub and brief writer carry behaviour the shared builders do not; see the per-file table.
20 9e3df47b kunchenguid/firstmate#3299 conflicted with fork work, resolved, plus one fixture correction Upstream deletes only bin/fm-pr-check-migrate.sh. Every fork reference to PR_CHECK_MIGRATION: and .pr-check-migration* is inherited from the merge base and had to be removed with it; the complete sweep is below. The fork's own run-attribution and endpoint-binding migrations, six lines below the deleted bootstrap call, are kept and still run. This change also carried incidental churn in tests/fm-remote-job.test.sh that did not compose with the fork's worker; see "The remote job worker stop" below.

Semantic collision C1: the harness-adapters split

The harness-adapters skill had been split independently on both sides of the same merge base:

  • Upstream (kunchenguid/firstmate#3289): SKILL.md becomes a 95-line router carrying an embedded
    harness-adapter-routing-v1 JSON object, with references/common/{control-and-recovery,dispatch,model-and-effort,primary-hooks}.md
    and references/harness/<h>.md, pinned by a new tests/fm-harness-adapter-references.test.sh.
  • Fork (HelloWorldSungin/firstmate#191, faea8a28): a 268-line shared head plus harnesses/<h>.md
    including the fork-only agy.md, routed by a 114-line bin/fm-harness-adapter-doc.sh.

Same facts, different filenames and different routing. Resolved under TRACK using the remote-doctor
precedent in docs/fork-divergence.md: take upstream's implementation whole, preserve compatible
fork-only intent, and never blend two designs.

What was taken. Upstream's SKILL.md router, its four references/common/*.md files, its eight
references/harness/*.md files, and tests/fm-harness-adapter-references.test.sh.

What was re-homed rather than dropped. Every fork-only fact was located by diffing the merge
base's monolithic SKILL.md against the fork's whole split tree, then checking each fork-added
sentence against upstream's whole tree. Of 111 fork-added lines, all but four groups were the fork's
own split-mechanism prose (which retires with the fork's split) or restatements upstream's
references/common/*.md and references/harness/*.md already carry. The four that were genuinely
fork-only moved to their new owners:

Fork-only fact New owner
The whole agy adapter contract (harnesses/agy.md) references/harness/agy.md, plus an "agy" row in the routing object and its crew-only/Herdr-only boundary in the router's Non-negotiable safety section
agy's model and effort axes (a row in the fork's fleet-wide launch-profile table) the Operating facts table in references/harness/agy.md, matching upstream's per-harness shape
bin/fm-launch-lib.sh owns launch-command construction, and bin/fm-spawn.sh the surrounding gates references/common/dispatch.md Owners and Adapter verification
The crew-only secondmate-fallback gate naming agy and muse references/common/dispatch.md Resolution
The dashboard's additive per-task agent-event wiring, and the guarded-hook probe rule references/common/primary-hooks.md Turn end

bin/fm-harness-adapter-doc.sh retired, not ported. Porting it would have left two routing
consumers over one table, which is what the fork's own one-owner rule and the remote-doctor
precedent both forbid. The property it existed for survives structurally rather than at runtime:
upstream's tests/fm-harness-adapter-references.test.sh fails the build when any routed target is
unreadable, so a missing reference cannot reach a session at all, and the router's own text keeps a
harness undispatchable until its entry and owners land. tests/fm-harness-adapter-doc.test.sh went
with it.

Consumers that followed. docs/documentation-audiences.json (nine paths repointed, agy inserted
in order), docs/scripts.md (row removed), bin/fm-test-run.sh (changed-file family map),
docs/verification/muse.md, CONTRIBUTING.md, docs/configuration.md, and the ledger's agy link.

docs/adr/0002-stow-session-end.md still names the retired script inside a dated 2026-08-26 review
record. That is a historical observation of what that review counted, not a live pointer; the count
it reports still holds of the adopted tree. It was left as written rather than back-dating an ADR,
and both bin/fm-pointer-check.sh and bin/fm-doc-audience-check.sh pass with it in place.

The remote job worker stop (change 20's incidental fixture churn)

kunchenguid/firstmate#3299 also moved the staged-record tamper setup in
tests/fm-remote-job.test.sh from "TERM the recorded serving child" to a bare whole-tree stop.
That does not compose with this fork's worker, and it is a real mechanism rather than a flake:

  • Reproduced 3 of 3 locally and once on fork CI shard 8. Reverting only those three lines to the
    fork's previous block makes the same tree pass, which isolates the cause to this hunk.
  • fm_remote_job_stop_worker_tree is byte-identical between the two trees, so the difference is the
    worker, not the helper.
  • Mechanism: this fork's worker is a restart supervisor plus a serving child in one process group,
    and worker_reap_descendants escalates TERM to KILL in a single pass with no grace between them.
    A group signal therefore reaches supervisor and child at the same instant, and the supervisor kills
    the child between publishing its shutdown quarantine and clearing it.
  • Probed end state after the stop: worker.pid present holding a dead pid, plus worker.ready,
    worker.identity, and lock/quarantine all left behind, after which fm_remote_job_ensure_worker
    refuses and the tamper step cannot run at all.

So a whole-group stop of this worker deliberately leaves ownership quarantined. That is the
fail-safe working as designed, and it is a consequence of the recorded "Remote job worker descendant
reaping" divergence rather than a new one.

Resolution. The setup is re-sequenced to TERM the recorded serving child first and let it
complete its own shutdown, which releases ownership and ends the supervisor with it. Upstream's two
assertions are kept byte-identical and contiguous - verified programmatically against
9e3df47b, not by eye - and a bounded process-group check follows them, because once the child is
gone the tree stop would otherwise pass vacuously on an already-dead pid. The comment at the
re-sequenced step names the mechanism and says explicitly not to normalise it back, so the next
reader does not find an unexplained ordering and helpfully undo it.

The added group check was proven non-vacuous rather than assumed: against a real live process group
it reports "not stopped" after spending its full bound, reports "stopped" once that group is killed,
and refuses an empty group.

Follow-up recommendation, deliberately not implemented here. worker_supervisor_shutdown reaps
with TERM and KILL in the same pass. That is right for orphans, but the serving child is not an
orphan: it has its own TERM handler that publishes a shutdown quarantine, stops active execution,
then clears it. Killing it mid-sequence converts an orderly shutdown into a permanently quarantined
one, which is what every whole-group stop hits, including the fork's own
bin/fm-remote-job-reap-orphans.sh. A grace window for the supervisor's own recorded child, ahead of
the generic descendant escalation, would keep the orphan guarantee while letting the child release
ownership. That is a change to signal-time supervision behaviour and must not ride inside a sync
round, where it would be reviewed as conflict resolution rather than as the behavioural change it is.

The PR_CHECK_MIGRATION / .pr-check-migration* sweep

Patterns grepped over the whole tree excluding .git, after resolution:

PR_CHECK_MIGRATION   pr-check-migration   pr_check_migration
pr-check-quarantine  pr_check_quarantine  fm-pr-check-migrate   "PR-check migration"

Every hit and its disposition:

Site Disposition
bin/fm-pr-check-migrate.sh (1159 lines) deleted by upstream
bin/fm-bootstrap.sh header: "PR_CHECK_MIGRATION: <private remediation>" diagnostic line removed; upstream's HOME_SUMMARY: line added in its place
bin/fm-bootstrap.sh header: "eleven MUTATING sweeps (PR-check migration, ...)" sweep dropped from the list, count corrected to ten
bin/fm-bootstrap.sh header: "never race-mutates PR-check artifacts, ..." "PR-check artifacts" dropped
bin/fm-bootstrap.sh locked-boundary call "$SCRIPT_DIR/fm-pr-check-migrate.sh" || true removed; the fork's fm-endpoint-binding-migrate.sh and fm-run-attribution-legacy-transition.sh calls immediately below are kept unchanged
bin/fm-session-start.sh header, four sites (sweep count, sweep enumeration, read-only skip list, --reemit skip list) migration dropped from every enumeration, count corrected from ten to nine
bin/fm-session-start.sh two runtime printf lines naming PR-check migration removed by upstream's own hunks, merged cleanly
bin/fm-teardown.sh header quarantine sentence, validate_pr_poll_cleanup, remove_pr_poll_artifacts upstream's rewrite taken; the fork's model-verification paragraph kept beside it
bin/fm-pr-lib.sh registration-parse comment naming the migration upstream's rewrite taken
bin/fm-watch.sh, bin/fm-pr-check.sh, bin/fm-x-lib.sh upstream's deletions merged cleanly, no fork content adjacent
AGENTS.md state layout: .pr-check-quarantine/ and .pr-check-migration.log .pr-check-migration-scan-v1 .pr-check-migration-v1 rows both removed
AGENTS.md section 13 bootstrap-diagnostics trigger list PR_CHECK_MIGRATION: removed, HOME_SUMMARY: added in the same position
.agents/skills/bootstrap-diagnostics/SKILL.md description trigger list same replacement
.agents/skills/bootstrap-diagnostics/SKILL.md six PR_CHECK_MIGRATION: handling bullets removed; upstream's HOME_SUMMARY: bullet placed where they were
docs/scripts.md fm-pr-check-migrate.sh inventory row removed
tests/fm-watcher-lock.test.sh mark_pr_check_migration_complete helper plus its five call sites removed
tests/fm-pr-check-security.test.sh, tests/fm-secondmate-safety.test.sh, tests/fm-remote-job.test.sh, tests/fm-tool-update-check.test.sh, tests/fm-wake-queue.test.sh, tests/fm-watch-arm.test.sh, tests/fm-watch-checkpoint.test.sh, tests/fm-watch-triage.test.sh, tests/fm-x-mode.test.sh upstream's deletions merged cleanly
tests/fm-run-attribution-legacy-transition.test.sh:73 comment naming "the legacy PR-check migration" as a consumer of the metadata identity parser fork-only stale comment, narrowed to the consumer that still exists

Two hits are left standing on purpose, and both are correct:

  • tests/fm-pr-check-security.test.sh:1014,1016 are upstream's own new regression asserting that a
    real bootstrap emits no PR_CHECK_MIGRATION diagnostic. Removing them would remove the proof.
  • docs/adr/0002-stow-session-end.md:117 names the retired routing script inside a dated review
    record; see the C1 section above.

Final state: grep -rI over the whole tree for all seven patterns returns only those two files.

Divergence survival, demonstrated by behaviour

Every active entry in docs/fork-divergence.md was checked. Behaviour first: for the entries this
round's upstream changes actually landed on, the named regression case is quoted from the
merge-result run. For entries whose carrying files this round never touched, the evidence is that
absence plus the suite that pins them still passing, which is what the ledger asks for.

Divergences this round's changes landed on

Each of these carries a fork behaviour that one of this round's five upstream changes landed on. The
named case is quoted from the merge-result sweep, so the evidence is the behaviour running, not the
file still being present.

Watcher live declared-wait routing and self-widening recheck cadence - collided with change 17,
which made the away daemon advance a recheck marker only when the escalation was actually buffered.
Adopted whole with pause_streak_bump moved inside that gate.

tests/fm-watch-triage.test.sh  exit=0
  ok - pause_streak_bump reconciles the wait on record before counting a recheck
  ok - pause_resurface_window doubles per unchanged recheck, caps, and clamps a misconfigured cap
  ok - a declared wait whose run yields no progress evidence is rechecked on its own cadence, never wedge-escalated
tests/fm-daemon.test.sh  exit=0
  ok - housekeeping re-surfaces a stale declared pause on the long cadence and resets its window
  ok - a captain-held transfer classifies as pause, not as a wedge candidate
  ok - an enriched wedge under a declared wait uses the pause cadence and restores wedge detection on resume

Run-progress wedge hold - change 17 rewrote the daemon's stale/wedge arm the fork's hold sits in.

tests/fm-run-progress.test.sh  exit=0
  ok - an executing step silent past the bound reads as stranded, naming the step
tests/fm-watch-triage.test.sh  exit=0
  ok - a crew parked on a demonstrably progressing validation run holds its wedge escalation
  ok - consecutive run-progress holds are capped: past the cap the pane escalates anyway naming the still-moving run
tests/fm-daemon.test.sh  exit=0
  ok - away mode still wedge-escalates a stranded run and a crew with no run at all
  ok - away mode caps consecutive run-progress holds: past the cap it escalates anyway, naming the still-moving run

Parked-decision marker reconciliation - carried into upstream's rewritten mark_surfaced, which
now commits an offset and identity instead of comparing a last line.

tests/fm-watch-triage.test.sh  exit=0
  ok - a parked keyed decision surfaces once, not once per pane repaint

Fleet snapshot per-task timeout and abandoned child work - change 16 reintroduced upstream's
second timeout name. The fork's single contract was kept and the bounded-read fixture repointed.

tests/fm-home-summary-refresh.test.sh  exit=0
  ok - producer bounds each per-task current-state read
tests/fm-fleet-snapshot-view.test.sh  exit=0
  ok - one unreadable task reports unknown with a timeout source and the rest of the snapshot survives
  ok - an abandoned live reading keeps open decisions instead of treating the death as a resume

Remote job worker descendant reaping - change 20's incidental fixture churn; see "The remote job
worker stop" above.

tests/fm-remote-job.test.sh  exit=0   (31 cases, including the staged-record tamper setup)
tests/fm-remote-job-orphan-reap.test.sh  exit=0
  ok - the reaper stops an abandoned worker's whole tree
  ok - a worker whose code root still exists is never reaped

Bounded remote job stdin capture - same file, same round.

tests/fm-remote-job.test.sh  exit=0
  ok - a finite payload survives the stdin bound byte for byte on every mechanism arm and call shape
  ok - the worker preserves bounded argv and stdin in an empty environment

Agy crew adapter - change 18 retired the layout its contract lived in. The adapter is now reached
through upstream's routing artifact, and its executable guards are unchanged.

tests/fm-harness-adapter-references.test.sh  exit=0
  ok - harness adapter routing artifact is normalized and every target is readable
tests/fm-agy-adapter.test.sh  exit=0   (30 cases)
  ok - agy is refused as a secondmate launcher (crew-only)
  ok - agy is refused on a non-herdr backend (herdr-only)
  ok - raw launch commands resolving to agy are refused (direct, env, assignment, wrapper, and variable indirection)
  ok - an ordinary agy steer rings its doorbell through the atomic prompt
  ok - unverifiable send on agy is reported distinctly in wording and exit code
tests/fm-agy-trust-lib.test.sh  exit=0
tests/fm-agy-smoke.test.sh  exit=0

The routing case is what proves the re-homing rather than the file's presence: it parses the
router's JSON object and requires every target it names, including the agy row added here, to be
readable.

Fleet dashboard and agent-event instrumentation - change 18 re-homed its per-task hook prose into
references/common/primary-hooks.md; the additive-wiring property is unchanged.

tests/fm-dashboard-events.test.sh  exit=0
  ok - the turn-end guard's exit status, output, and inputs are identical with and without instrumentation
  ok - the Claude Stop auto-arm's exit status, stderr, and epoch ledger are identical with and without instrumentation

Watcher stop-signal disposition and Watcher restart hand-over - change 20 removed the
migration helper from the suite that pins both.

tests/fm-watcher-lock.test.sh  exit=0   (37 cases)
  ok - watcher stop is kernel-delivered and its EXIT cleanup still releases the lock
  ok - a stop-signal burst during cleanup still releases the singleton lock
  ok - watch restart hands over to a fresh watcher inside its own stop budget
  ok - watch restart attaches to a verified healthy peer and later surfaces a successor gap

Default per-script bound on every test sweep - change 18 and change 19 both edited the runner.

tests/fm-test-run.test.sh  exit=0
  ok - --per-script-timeout-secs turns a hung script into a bounded failure
  ok - the per-script bound also terminates and reports a hung script under --jobs

Divergences whose carrying files this round did not touch

The round's diff was checked against every file each remaining entry names, and none of them
changed between the fork parent and this branch:

$ for f in bin/fm-pr-merge.sh bin/fm-upstream-status.sh bin/fm-run-progress.sh \
           bin/fm-quota-sidecar.sh bin/fm-send.sh bin/fm-remote-job-worker.sh \
           bin/fm-remote-job-lib.sh bin/backends/herdr.sh bin/fm-install-shellcheck.sh \
           bin/fm-nm-run-lib.sh bin/fm-spawn.sh bin/fm-launch-lib.sh \
           bin/fm-bearings-snapshot.sh .no-mistakes.yaml .github/workflows/ci.yml; do
    git diff --quiet bb268932 HEAD -- "$f" && echo "unchanged: $f"
  done
unchanged: (all fifteen)
$ git diff --name-only bb268932 HEAD -- .pi/
(empty)

Their pinning suites still pass on the merge result:

tests/fm-send-strict.test.sh  exit=0
  ok - fm-send strict: confirmed scout follow-ups reopen completion review        (scout completion gate)
tests/fm-crew-state.test.sh  exit=0
  ok - a run with no durable task branch is visible as unattributable              (no-mistakes run attribution)
  ok - a pooled worktree on another task's branch surfaces a run-attribution fault
tests/fm-quota-sidecar.test.sh  exit=0
  ok - stale records retain diagnostic numbers only as UNKNOWN last-known windows  (LLM quota sidecar)
  ok - an unmounted sidecar share degrades cleanly to UNKNOWN
tests/fm-lint.test.sh  exit=0
  ok - ShellCheck installer stops after spending its whole retry budget            (pinned download retry budget)
tests/fm-backlog-handoff.test.sh  exit=0
  ok - a pre-move crash wakes only after retry makes the item durable              (pre-move crash fixture)
tests/fm-pi-watch-extension.test.sh  exit=0
  ok - Pi away mode leaves one supervision cycle and resumes exactly one on return (Pi away-mode standby)
tests/fm-backend-herdr.test.sh  exit=0
  ok - fm_backend_herdr_send_text_submit: idle native baseline uses a rendered busy footer to confirm a queued Enter   (Herdr pre-Enter footer read)
tests/fm-no-mistakes-required-gate.test.sh  exit=0
  ok - PR opened without no-mistakes signature strictly fails compliance gate      (compliance-gate event scope)
tests/fm-agents-hard-rules.test.sh  exit=0
  ok - the third-party upstream write boundary is a hard rule with every clause    (upstream-read-only posture)
tests/fm-recall.test.sh, tests/fm-gbrain-capture.test.sh  exit=0                   (GBrain per-home memory)
  ok - capture is inert until a home has a brain
  ok - a read against a local index leaves a bounded record that hashes what was asked

Three entries record decisions and postures rather than executable behaviour, so their evidence is
documentary and was re-read rather than executed:

  • Stricter merge-proof contract. The entry deliberately records a decision the code has not
    caught up to; bin/fm-pr-merge.sh is unchanged by this round and the entry's warning against
    silently resolving the collision toward upstream is intact.
  • Upstream tracking mechanism and Repository-local validation evidence.
    bin/fm-upstream-status.sh and .no-mistakes.yaml are unchanged, and this PR is itself the
    tracking mechanism operating as the entry describes.

Baseline versus final

Three complete bin/fm-test-run.sh --all sweeps plus three full canonical bin/fm-lint.sh runs, on
one host. The two parent baselines ran in isolated temporary clones so this branch and its merge
structure stayed untouched, and all three test sweeps ran sequentially, never concurrently: the
suite drives real tmux and a real Herdr install through shared host state, so two sweeps on one
machine would have produced a baseline nobody could trust.

Tests

Run Total Failed Gate-skipped Wall
Fork parent bb268932 215 1 29 54m
Upstream parent 9e3df47b 170 7 24 47m
Merge result 217 1 30 55m

The two parents fail different tests because they are different trees: the fork carries 45 test
scripts upstream does not have, and several upstream fixtures model a host this one is not.
Failures are therefore recorded separately, and the merge result is judged against the fork parent,
which is the tree being merged into.

Fork-parent failure (1). tests/fm-calm-pi-extension.test.sh - could not render calm-mode HTML export DOM. Headless Chrome dies with a Trace/breakpoint trap rendering the export DOM on this
host. Reproduced in isolation on the untouched fork parent, so it is neither load flake nor merge
damage. It is a pre-existing host failure and it is expected to persist on the merge result.

Merge-result failure (1). tests/fm-calm-pi-extension.test.sh, the identical
Trace/breakpoint trap in headless Chrome, with the same missing export.txt and the same
could not render calm-mode HTML export DOM line as the fork parent. Same test, same assertion,
same mechanism, and it also fails on the upstream parent. It is carried in, not caused here.

Read the two numbers together: the fork parent was 215 tests with 1 failure, the merge result is 217
with the same 1 failure. The count moves by two because this round adds upstream's
tests/fm-harness-adapter-references.test.sh, tests/fm-harness-adapter-instructions-live-e2e.test.sh,
and tests/fm-test-fixtures.test.sh, and removes tests/fm-harness-adapter-doc.test.sh with the
routing script it pinned. No test that passed on the fork parent fails on the merge result.

Upstream-parent failures (7). None of these reach the merge result: five of the seven pass on
the fork parent, because the fork's own version of that file or fixture is what the merge keeps.

Upstream-parent failure Cause Fork parent
fm-calm-pi-extension /export did not complete while calm mode was on the same headless-Chrome crash also fails
fm-bootstrap the unsplit run lost its local diagnostic (missing: 'MISSING: node (install:') the fixture expects node to be absent; this host has it passes
fm-session-start MISSING diagnostic did not appear at all same missing-tool assumption passes
fm-on composed child PATH did not match the portable contract the expected PATH has no /nix/store/... entry; this host is a Nix profile passes
fm-remote-doctor --fix did not create the first needed harness wrapper host tooling the fixture assumes passes
fm-test-run comm: file 2 is not in sorted order upstream's own runner fixture under this host's collation passes (the fork's runner test differs)
fm-watcher-lock arm did not exit with HUP status (got 124) upstream installs trap 'exit 1' HUP INT TERM; the fork deliberately does not, which is the "Watcher stop-signal disposition" divergence passes

That last row is the strongest single piece of survival evidence in this PR, and it is worth
separating from everything else here because it is not our evidence.

tests/fm-watcher-lock.test.sh is upstream's own test, run against upstream's own parent
tree
, with no fork content in it. It asserts that a stopped watcher exits with HUP status, which is
true only when the trap 'exit 1' HUP INT TERM that upstream installs is in place. It fails there,
timing out at 124. That handler is precisely what this fork's "Watcher stop-signal disposition"
divergence exists to NOT install, because a trap handler is a string bash parses at signal time and
that parse can fail inside a command substitution, leaving the watcher deaf to its own stop
(HelloWorldSungin/firstmate#242).

Every other survival claim in this PR is one of our own tests passing, which a reader has to take on
trust. This one is upstream's test, on upstream's tree, failing on the exact behaviour we document a
deliberate difference from - so it makes the case without our authorship and without our fixtures.

Lint

bin/fm-lint.sh with the full canonical file set (CI=true), pinned ShellCheck 0.11.0 and
actionlint 1.7.12:

Run Result
Fork parent bb268932 clean, exit 0
Upstream parent 9e3df47b clean, exit 0
Merge result, before the fixes below 4 findings, exit 1
Merge result, final clean, exit 0

The merge result initially failed lint in four places that lint clean on both parents. This is
worth stating precisely because it is easy to misread as sloppiness in the resolution: not one of
the four lines was written or edited by this merge. ShellCheck's extended dataflow analysis is
whole-source-graph sensitive, and the merged graph differs from either parent's - for
bin/fm-bootstrap.sh the trigger was upstream deleting sixteen lines of dead shim helpers from a
lib it sources, which changed nothing about the flagged code itself.

  • bin/fm-control.sh:439 proof=agent-alive raised SC2100, reading the dash as arithmetic. Quoted.
    Zero behaviour change and the reported proof token is unchanged. Upstream made the same class of
    fix in this very round by renaming its own note-file sentinel to note_file, but this token is
    reported and asserted on, so it is quoted rather than renamed.
  • Three SC2030 infos on export FM_TIMEOUT_KILL_GRACE=5 and export FM_WRITE_BACK_BUDGET=$budget
    in bin/fm-bootstrap.sh and bin/fm-teardown.sh. Those exports are deliberately subshell-local,
    as the comments already above them say, so each carries a # shellcheck disable=SC2030 naming
    that reason.

Determinism was checked rather than assumed: the pre-fix findings reproduced identically across
repeated runs and under FM_LINT_JOBS=1, so they were a real gate failure to fix and not analysis
noise to wait out.

CI

CI is independent confirmation on a clean runner rather than this host.

On head 1eb341ce5c3f5688c6571e5f1d75ac05e7e8493a: 16 passed, 1 failed, 17 total. The single
failure is PR must be raised via no-mistakes, which is red by design for this round; see "Expected
red check" below. Every other required check passes: Lint, Test coverage guard, Repo invariants,
both portable parallel shards, all eight portable serial shards, Behavior tests (Herdr), Stock macOS
Bash snapshot compatibility, and Behavior timing aggregate.

CI is worth reading beside the local sweeps rather than instead of them, because it runs on a clean
Ubuntu runner that has neither this host's Nix profile nor its Chrome, which is what makes the local
fork-parent fm-calm-pi-extension failure legible as a host fact rather than a code one.

An earlier head, c2232595, failed Behavior portable serial 8 on the remote job worker stop
described above. That is the CI half of the 3-of-3 local reproduction, and it passes on the current
head with the Option B correction in place.

Per-file reasoning for every changed contract file

Twenty paths conflicted textually. Each row below states the decision and why. Every other changed
file merged with no decision to make; the two lists after the table account for those.

The twenty conflicted paths

File Resolution
AGENTS.md Three conflicts. The state-layout rows for .pr-check-quarantine/ and .pr-check-migration* were dropped with the machinery they describe, keeping the fork's .lease-<task> row. The section 13 bootstrap-diagnostics trigger keeps the fork's longer list minus PR_CHECK_MIGRATION: plus upstream's HOME_SUMMARY: in the same position upstream gives it. The session-start digest block keeps the fork's condensed prose: upstream's only edit there deletes one item from a seven-item enumeration the fork no longer carries, so nothing false survives and nothing was lost.
.agents/skills/afk/SKILL.md Upstream's rewritten declared-wait bullet taken whole, including its new rule that an unreported captain-relevant event in the newly classified span still escalates immediately. The fork's fourth line, which reads the recheck window rather than the fixed constant, was kept because the streak-doubling sentence directly below it is a fork divergence that depends on that wording.
.agents/skills/bootstrap-diagnostics/SKILL.md Two conflicts, both the same shape: the fork's fuller diagnostic vocabulary is kept, PR_CHECK_MIGRATION is removed with its six handling bullets, and upstream's HOME_SUMMARY: trigger and bullet are placed where the retired ones sat, which is also where upstream places it relative to the secondmate block.
.agents/skills/harness-adapters/SKILL.md Semantic collision C1. Upstream's router taken whole, then an "agy" routing row and agy's crew-only/Herdr-only boundary added. See the C1 section.
CONTRIBUTING.md One sentence, edited on both sides. Upstream's "skill tree rooted at" phrasing is taken because the fork adopts that tree; the fork's naming of bin/fm-launch-lib.sh as the launch-command owner is kept because that ownership split is real here and upstream has no equivalent.
bin/fm-bootstrap.sh Four conflicts, all in the header plus the locked mutating-sweep block. Header diagnostics and sweep enumerations lose the retired migration and gain HOME_SUMMARY:; the sweep count drops from eleven to ten. In the code, the deleted fm-pr-check-migrate.sh call goes and the fork's fm-endpoint-binding-migrate.sh and fm-run-attribution-legacy-transition.sh calls immediately below it stay. Upstream's FM_FLEET_PRUNE header line was not re-added: the fork deliberately pruned that duplicate, and bin/fm-fleet-sync.sh owns it.
bin/fm-fleet-snapshot.sh Taken from the fork side in full. Upstream's whole change to this file is a second per-task read bound, FM_SNAPSHOT_CREW_STATE_TIMEOUT, which the fork already implements as FM_SNAPSHOT_TASK_TIMEOUT with a floor, an inner no-mistakes hand-down, a parallel fan-out, and an explicit source:"timeout" record. The ledger requires this file to end a round with exactly one of those contracts, so upstream's second name was not introduced.
bin/fm-push-transition-lib.sh Upstream rewrote mark_surfaced from a last-line comparison to an offset-and-identity presentation-marker commit, and added hb_surfaced_offset and mark_surface_reported. All three taken whole. The fork's _reconcile_surfaced_open_decision call was carried into the new mark_surfaced because that marker keys on the task's endpoint rather than on the status log's position, so it is orthogonal to what upstream changed and would otherwise have been silently retired.
bin/fm-session-start.sh Four conflicts, all header enumerations of bootstrap's mutating sweeps. The retired migration is dropped from each and the count corrected from ten to nine. Both runtime printf sites naming the migration merged without a conflict.
bin/fm-supervise-daemon.sh Two conflicts. Upstream now advances a dedup or recheck marker only when escalate_add actually buffered the escalation. The stale/wedge arm carries the fork's run-progress hold, whose three escalation branches all shared one stale_marker_remove below them, so an escalated flag carries upstream's gating across all three without duplicating the removal. In the declared-wait arm, the fork's pause_streak_bump moved inside upstream's if, because a recheck that was never recorded must not widen the window it never sent.
bin/fm-teardown.sh Header only. Upstream's quarantine-free sentence taken, the fork's dispatched-model-check paragraph kept beside it. Upstream's code hunks removing the quarantine validation and cleanup merged without a conflict.
bin/fm-test-run.sh Four conflicts. Two family alternations resolved as unions, so the fork's fm-pointer-check, fm-run-progress, fm-agy-smoke, fm-gbrain-*, and fm-cmux-claude-composer-live-e2e entries and upstream's fm-harness-adapter-references and fm-harness-adapter-instructions-live-e2e entries all survive. The serial weight-hint table was merged row-wise: fork values win where both sides measured, 32 upstream rows for scripts the fork had not hinted were added, and the one row naming a script that no longer exists after a rename, fm-cursor-agy-adapter.test.sh, was dropped. The changed-file family map keeps the fork's stow arm and its .agents/skills/*/*.md reach, and adds upstream's harness-adapters arm. --check-coverage passes: total=217 parallel=24 serial=155 serial_shards=8 herdr=12 optin=26.
bin/fm-watch.sh One conflict, inside mark_all_captain_relevant_surfaced. The fork had not changed this function, so upstream's endpoint-driven rewrite was taken whole. Every other upstream hunk in this file, including the removal of the migration reference, merged cleanly beside the fork's run-progress and declared-wait code.
docs/configuration.md The harness-adapters sentence merged into upstream's "skill tree rooted at" form with the fork's router-and-references framing. Upstream's FM_SNAPSHOT_CREW_STATE_TIMEOUT row was removed for the same ledger reason as the script; its FM_HOME_SUMMARY_FAILURE_REPORT row was kept.
docs/documentation-audiences.json Nine harnesses/*.md entries replaced by upstream's twelve references/** entries, with references/harness/agy.md inserted in order. Valid JSON, 123 surfaces, and bin/fm-doc-audience-check.sh passes.
docs/scripts.md The fm-pr-check-migrate.sh row removed with the script. The fm-harness-adapter-doc.sh row was removed in the follow-up commit for the same reason. The fork's fm-endpoint-binding-migrate.sh and fm-run-attribution-legacy-transition.sh rows are kept.
docs/verification/muse.md Upstream's pointer to the skill tree root taken, replacing the fork's direct link into the retired harnesses/ path.
tests/fm-spawn-dispatch-profile.test.sh Two conflicts from upstream's fixture centralization. Both now call the shared builders, and the fork behaviour they carried was re-homed rather than kept as a second copy: the fork's brief text is passed through fm_test_spawn_brief's third argument, and the fork's Claude-config resolution recording moved into tests/fixtures.sh as a second env-gated recording on the same send-keys payload, inert whenever FM_FAKE_RESOLVED_CLAUDE_CONFIG_LOG is unset. The fork's timeout -k pass-through shim and its comment stay in the suite because they are specific to this suite's bounded calls.
tests/fm-test-run.test.sh Fixture union: the fork's .agents/skills/example/template.md case, which pins the .agents/skills/*/*.md reach, and upstream's two harness-adapters files both exist, so all three selection cases run.
tests/fm-watcher-lock.test.sh The retired mark_pr_check_migration_complete helper and its five call sites removed. The fork's beacon_stamp helper and its TERM-resistant peer fixture, including the widened readiness poll and the comment explaining why it exists, are kept; upstream did not change that fixture this round, it only sat next to a deleted line.

Deliberate changes to files that did not conflict

File Why
tests/fixtures.sh (new, from upstream) Extended with the fork's Claude-config resolution recording, so tests/fm-spawn-dispatch-profile.test.sh could adopt the shared builder instead of keeping a second stub. The addition is env-gated the same way FM_FAKE_LAUNCH_LOG and FM_FAKE_DUPLICATE_WINDOW already are, so every other suite is unaffected.
tests/fm-home-summary-refresh.test.sh (from upstream) Its bounded-read case set FM_SNAPSHOT_CREW_STATE_TIMEOUT=2, a name this fork does not have, which would have left the case named "producer bounds each per-task current-state read" no longer bounding what it names. Repointed to FM_SNAPSHOT_TASK_TIMEOUT=2, at that variable's documented floor. Upstream's assertion, message, and exit code are untouched. This is a fixture repair, not a divergence.
tests/fm-remote-job.test.sh (from upstream) Change 20's incidental fixture churn moved the staged-record tamper setup to a bare whole-tree stop, which this fork's worker answers by quarantining ownership. The setup is re-sequenced around the serving child; upstream's two assertions stay byte-identical and contiguous, and a non-vacuous process-group check follows them. Full mechanism and evidence in "The remote job worker stop" above.
tests/fm-run-attribution-legacy-transition.test.sh (fork-only) A comment named the legacy PR-check migration as a second consumer of the metadata identity parser. That consumer no longer exists; the sentence was narrowed to the consumer that does.
bin/fm-control.sh proof=agent-alive is quoted. Zero behaviour change, and the proof token is unchanged; in the merged source graph ShellCheck's dataflow reads the unquoted literal as arithmetic and raises SC2100, which fails bin/fm-lint.sh. Upstream made the same class of change in this very round by renaming its own note-file sentinel to note_file, but the reported proof token here must stay agent-alive, so it is quoted instead of renamed.
bin/fm-bootstrap.sh, bin/fm-teardown.sh Three # shellcheck disable=SC2030 directives, each naming the reason. The subshell-scoped export FM_TIMEOUT_KILL_GRACE=5 and export FM_WRITE_BACK_BUDGET=$budget are deliberately subshell-local, as the comments directly above them already say. They lint clean on both parents and only fire in the merged graph, where ShellCheck's dataflow reaches the outside fm_run_timed calls that correctly keep the default.
docs/fork-divergence.md One entry added and three changed; see "Ledger changes in this round".

Files that merged with no decision

Sixty-nine paths took upstream's change with no fork content adjacent, or took the fork's with no
upstream content adjacent. Every upstream-added line in the round was checked mechanically against
the merged tree: of 3,803 added lines across 69 files, 35 are absent, and all 35 are the deliberate
resolutions listed above. The same check in the other direction over the fork's own additions since
the merge base, restricted to files upstream also touched, finds 114 fork lines absent from 9,297,
and all 114 are the same set: the fork's retired split-mechanism prose, the corrected sweep counts
and enumerations, the retired migration references, the two daemon lines that now end in
&& escalated=1, the moved dispatch-profile fixture code, and the repointed audience paths.

Ledger changes in this round

docs/fork-divergence.md:

  • Added a retired-divergence entry, "Fork-local harness-adapters split and its routing script -
    retired 2026-09-04", recording C1 as the sixth capability collision resolved by the remote-doctor
    precedent, what was taken, what was re-homed and where, and why the runtime refusal did not need
    porting. Fork PR HelloWorldSungin/firstmate#191 had never been recorded in the ledger; it is now,
    as the retired side of this collision.

  • Changed "Agy crew adapter": its contract link moves from harnesses/agy.md to
    references/harness/agy.md and now names the routing artifact that reaches it.

  • Changed "Fleet snapshot per-task timeout and abandoned child work": records that upstream
    reintroduced FM_SNAPSHOT_CREW_STATE_TIMEOUT a second time with kunchenguid/firstmate#3273, that
    the fork's single contract was kept again, and that tests/fm-home-summary-refresh.test.sh's
    bounded-read case was repointed so it still bounds the read it names.

  • Changed "Watcher live declared-wait routing and self-widening recheck cadence": records the
    kunchenguid/firstmate#3268 collision and that pause_streak_bump moved inside upstream's
    escalation gating, so a recheck that was never recorded no longer widens the window it never sent.

  • Changed "Remote job worker descendant reaping": a note added under the existing entry, as a
    consequence of that divergence rather than a new one, recording that a whole-group stop of this
    worker deliberately leaves ownership quarantined, what that forces on any fixture that stops the
    worker, and that whether the reap should grant its own child time to finish is deliberately not
    decided here.

No active divergence was retired by this round, and none was created. The ledger's active-entry
count is unchanged.

Parked branches

docs/fork-divergence.md "Parked branches outside the fork baseline" lists five deliberately
unlanded branches: fm/fm-afk-injection-wedge, fm/fm-crew-state-blind-during-fix-round,
fm/fm-parked-decision-stale-noise, fm/fm-subagent-model-routing-guard, and
fm/fm-vault-drift-check. None entered this round; each was checked against this branch's history:

$ git merge-base --is-ancestor origin/fm/fm-afk-injection-wedge HEAD            -> not an ancestor
$ git merge-base --is-ancestor origin/fm/fm-crew-state-blind-during-fix-round HEAD -> not an ancestor
$ git merge-base --is-ancestor origin/fm/fm-parked-decision-stale-noise HEAD    -> not an ancestor
$ git merge-base --is-ancestor origin/fm/fm-subagent-model-routing-guard HEAD   -> not an ancestor
$ git merge-base --is-ancestor origin/fm/fm-vault-drift-check HEAD              -> not an ancestor

Nothing was merged from, rebased onto, resurrected from, or cherry-picked out of any of them.

Pushed head and mergeability

Exact pushed head: 1eb341ce5c3f5688c6571e5f1d75ac05e7e8493a

Local HEAD and origin/fm/fm-upstream-sync-2026-09-02-round-3 are the same commit, so what was
reviewed is what was pushed:

$ git rev-parse HEAD
1eb341ce5c3f5688c6571e5f1d75ac05e7e8493a
$ git ls-remote origin fm/fm-upstream-sync-2026-09-02-round-3
1eb341ce5c3f5688c6571e5f1d75ac05e7e8493a

Mergeability:

$ gh api repos/HelloWorldSungin/firstmate/pulls/264
  mergeable:        true
  mergeable_state:  unstable
  base:             main
  head:             1eb341ce5c3f5688c6571e5f1d75ac05e7e8493a
  commits:          9
  changed_files:    90

mergeable: true means there is no conflict with main. mergeable_state: unstable means exactly
one required check is red, which is the by-design no-mistakes signature check below - not a conflict
and not a second failure.

The merge parentage that must survive landing:

$ git log --format='%H %P' -1 aa77f071
aa77f071… bb268932f3983e6b31df9006989b08163237b736 9e3df47b4a5f228d8e3bf2b889e7119f95b85be5

Two parents: the fork base and the round endpoint. That second parent is the entire point of the
round, and it exists only if this lands as a merge commit.

Expected red check

This round ships direct-PR, not through the no-mistakes pipeline: that pipeline rebases onto
origin/main, which would replay and linearize this merge-only branch and destroy the upstream
parentage the whole sync strategy depends on. The fork's compliance workflow still requires a
no-mistakes signature, so PR must be raised via no-mistakes is red by design. Every other
required check must pass.

Landing

Do not squash. This must land with a merge commit:

bin/fm-pr-merge.sh <task-id> <full-PR-url> -- --merge

bin/fm-pr-merge.sh defaults to squash, and squashing would lose the upstream parent, keep the
merge base from advancing, and make every future round re-present these same five commits.

kunchenguid and others added 9 commits August 29, 2026 10:34
…nchenguid#3273)

* fix(bin): keep home-summary publication bounded and off the watcher beat

A home whose tasks had accumulated ordinary status history could not publish
state/home-summary.json at all, and every attempt starved the watcher's
liveness beacon while it failed silently.

The producer's per-task open-decision fold spent tens of milliseconds per
status line on a bash 3.2 global bracket-class substitution used only as a
blank-line guard. On a real home that made the whole ledger producer take
minutes, so publication burned its full FM_HOME_SUMMARY_TIMEOUT on every
attempt and never completed. Replace that guard with an equivalent case glob
in the one fold owner, which both the whole-file and cursor-backed folds use.

Bound each per-task current-state read in the snapshot with
FM_SNAPSHOT_CREW_STATE_TIMEOUT. For a remote secondmate that read crosses ssh,
whose dead-peer detection deliberately never kills a slow-but-alive remote
command, so nothing else bounded it.

Detach the watcher's two publication triggers from the poll loop. The loop
owns the beacon that fm-guard.sh reads as proof supervision is alive, and an
inline publication put up to a full publication deadline between two beacon
touches. A single in-flight publication is tracked so a slow one cannot
accumulate clones.

Report a repeatedly failing publication at session start. Publication stays
deliberately non-fatal to its caller, so the existing bounded home-local
failure record is now surfaced as a HOME_SUMMARY bootstrap line once the
ledger is absent or stale and failures have been recorded since.

* no-mistakes(review): Preserve home-summary failure attempt ordering

* no-mistakes(review): Enforce durable home-summary single-flight and ordering

* no-mistakes(review): Derive failure ordering from publication boundaries

* no-mistakes(review): Restore best-effort failure logging and publication scoping

* no-mistakes(review): Make ordering regression sensitive to one failure

* no-mistakes(document): Correct HOME_SUMMARY diagnostic guidance
…henguid#3268)

* fix(supervision): classify the appended status span, not the last line

An actionable project update could be classified as routine and absorbed, so
a worker that raised a decision, hit a blocker, failed, or finished stalled
silently with the captain never told.

Trigger, mask, symptom. A worker appends a captain-relevant event
(`needs-decision`, `blocked`, `failed`, `done`). Any later routine append -
a `working:` progress note - lands before the supervisor classifies the
batch; the watcher's 30s signal-grace linger exists precisely to coalesce a
status write with the same turn's turn-end, so this window is ordinary
rather than rare. Both supervisors then asked "is the LAST line
captain-relevant?", read the routine line, and absorbed the wake. The
`.seen-*` suppressor advanced either way, so nothing ever re-read the event.
When the crew was also provably working, the no-verb fallback absorbed it
too, which is why the event disappeared completely instead of surfacing late.

Reproduced end to end against a real watcher before any change: with the
trailing `working:` append the watcher never exits and the wake queue stays
empty; with that one line removed - the smallest counterfactual - the same
`needs-decision` surfaces and queues. The away-mode daemon's `classify_signal`
returns `self|routine signal` for a `blocked:` event under the same mask,
which is the worse case because no captain is present to notice.

The proven path was already in the tree: `status_open_decisions` fixed this
exact masking for the durable decision fold, and its header states the rule -
reading an append-only event log last-event-wins cannot represent an earlier
event that a later unrelated line moved past. The classification path was
never migrated to that read model. That is the earliest divergence, and the
fix is to migrate it rather than to special-case the symptom.

`status_span_first_actionable` in bin/fm-classify-lib.sh is the new single
owner: it reads the bytes at or after a caller-supplied position and returns
the first still-live captain-relevant event. Each supervisor supplies its own
position, because the always-on watcher and the away-mode daemon classify the
same stream independently and must not share one cursor: the watcher reads
the size already recorded in its `.seen-*` signature (no new state) and its
`.hb-surfaced-<task>` backstop marker, and the daemon its
`.subsuper-seen-status-<task>` marker. Those two markers held the escalated
line and now hold the escalated-through byte offset, which also removes a
second defect in the same code - content dedup silently swallowed a genuinely
new event whose text repeated an older one. An absent, malformed, or
past-the-end position reads the whole log, so uncertainty surfaces events
rather than losing them, and a marker an older build wrote as a status line
reads that way too. Status logs are only ever appended to, including across a
reused task id, so a recorded position keeps its meaning.

A `needs-decision`/`blocked` event in the span is retired only when the
whole-file fold proves its key closed; `status_open_decisions` stays the sole
owner of that rule, so same-key reopening and reserved-key namespaces need no
second implementation here. Every other captain-relevant event is terminal
and always actionable.

Both backstops now walk every status log instead of only those whose last
line looks captain-relevant, because the event a backstop most needs to catch
is exactly one a later append has moved past. That leaves
`scan_captain_relevant_statuses` with no callers, and it is removed rather
than left as a working copy of the defective read model.

Regression coverage exercises the classifier and both supervisors through
their own interfaces: the masked decision, the captain-reported
release/install completion followed by cleanup chatter, and the away-mode
blocker all surface; a routine append after an already-classified event stays
absorbed, so the fix does not convert ordinary progress into wakes; and the
heartbeat backstop catches a masked event the per-wake path missed. The
end-to-end watcher tests drive a real fm-watch.sh with the crew reported as
provably working, which is the configuration that made the original stall
silent.

Two further claims in the supplied RCA are deliberately not patched here.
"Repeated operational recoveries produced all-clear replies despite known
actions" is downstream of this same cause, not an independent contributor: an
all-clear reply is the documented response when the specific event needs no
action, so a classification that wrongly reported "no action" produces it, and
correcting the classification removes it. "The project was subjected to
validation requirements outside its accepted path" is delivery-mode selection,
which AGENTS.md section 7 owns; no code changed here touches it, so it is out
of scope.

Harness and backend axes were inspected rather than assumed: nothing in this
path reads a vendor-emitted signal. The status log's format and append
protocol are Firstmate's own and identical for every harness, and no runtime
backend reads or writes `.status` files (`bin/backends/*` contain no reference
to them). The surrounding triage's only backend touchpoints - pane capture and
the authoritative crew-state read - are unchanged. No live-harness guard
applies and no per-harness verification record changes.

Verified with `bin/fm-lint.sh`, `bin/fm-doc-audience-check.sh`, and
`bin/fm-test-run.sh --changed --base origin/main`.

* no-mistakes(review): Prevent status races and surface classification failures

* no-mistakes(review): Surface unreadable signals and preserve AFK endpoints

* no-mistakes(review): Route stale wakes through captured span verdicts

* no-mistakes(review): Retire supervision offsets with reused task state

* no-mistakes(review): Bind status offsets and preserve live decision origins

* no-mistakes(review): Strengthen status identity with verified birth time

* no-mistakes(review): Skip turn-end markers during status classification

* no-mistakes(review): Preserve status presentation with platform-strength identities

* no-mistakes(review): Retain failed wakes and advance routine checkpoints

* no-mistakes(review): Surface all events and retain unreadable wakes

* no-mistakes(review): Treat absent status logs as successful empty spans

* no-mistakes(review): Bound repeated classification failures with durable receipts

* revert(supervision): drop the failure-receipt and durable-retry machinery

Captain-authorized revert to the minimal fix. Review rounds added a durable
failure-receipt store and wake-retention-on-failure to bound repeated
classification failures. That machinery grew larger than the fix it protected
and kept producing its own defects: an unreadable log still looped forever
because the always-on watcher never consulted the receipt, and the receipt was
persisted before its diagnostic was durably queued, so a crash in between
swallowed the alarm outright. Those two defects go away with the code that
contained them rather than being repaired.

Removed: the failure-receipt path, fingerprint, record and clear helpers and
their retirement bookkeeping; the retention of a durable wake when
classification fails; and the error-propagation plumbing in both supervisors
that existed only to drive them.

Kept, because it is the accepted fix rather than the declined machinery: span
classification of the events appended since a supervisor last looked, in both
supervisors and both backstops; reporting every actionable event in a span and
committing a position only through what was reported; naming the live opening of
a reopened decision; treating an absent log as ordinary and an unreadable one as
worth reporting; the non-.status filter; and the platform-strength identity that
guards a position commit without failing a read.

Replacement behavior for a log that cannot be classified: report it once, do NOT
advance the classification position so the content is classified from where it
stopped once readable, and DO advance the wake signature so the report is
bounded to one per distinct file state. Reporting and reading are different acts:
telling the captain about a log is not the same as having read it, and only the
latter may move a classification position.

The residual risk is explicit and accepted: there is no guaranteed automatic
retry inside a crash-mid-read window, and the locked session-start replay of the
durable queue covers it. That rationale is recorded at mark_escalated_seen so a
future reader does not reintroduce the retry as a "missing" guarantee.

Also fixes lint failures that arrived with the review-fix commits and were never
caught because the run never reached its lint step: an unfollowable conditional
source directive, a second unquoted-expansion site left after a call was split
across lines, cleanup of the file being read inside its own read loop (restructured
to one post-loop teardown rather than three in-loop copies), stub functions in
tests that are invoked indirectly, and a test local left unused when its
assignment was replaced by a helper. bin/fm-lint.sh passes on the default branch,
so these were introduced here.

Verified with `bin/fm-lint.sh`, the end-to-end masked-decision and away-mode
reproductions, and `bin/fm-test-run.sh` over the supervision, wake-queue,
wake-drain, watch-arm and inactive-reconcile suites (6 scripts, 0 failures).

* no-mistakes(review): Correct classification failure contract documentation

* no-mistakes(review): Bound unreadable status reports without skipping classification

* no-mistakes(review): Preserve escalation markers when buffering fails

* no-mistakes(review): Detect permission recovery without advancing classification

* no-mistakes(document): Document status span classification contract

* no-mistakes(ci): Fixed CI failures by lazily loading classification helpers in fm-wake-lib, preserving minimal recovery/remote fixtures; added a public current-status marker helper and updated behavioral fixtures to use the v2 marker contract; resolved ShellCheck variable collisions in fm-control and fm-public-followup-lib. Verified fm-lint, bash syntax, fm-control, public-followup, wake-queue, send-resolve-key, captain-hold, pending-reply, remote-reply, remote-backlog-handoff, turnend-guard, and Claude autoarm tests. The Pi branch suite reached a separate local stock-render mismatch under Node 24; its CI-reported missing-classifier failure path is fixed

* no-mistakes(review): Escalate blockers while preserving declared-wait cadence

* no-mistakes(review): Clarify actionable events override wait self-handling

* no-mistakes(review): Surface rejected decisions and dangling status links

* no-mistakes(document): Document reserved-key reconciliation classification

* no-mistakes(ci): Fixed the flaky portable serial CI test by modeling the retained staging directory as genuinely owned by a live process and aging both fixtures deterministically. This removes scheduler-timing dependence while verifying the worker reaps abandoned staging and preserves live staging. Verified with fm-remote-transport-lanes.test.sh, bin/fm-lint.sh, bash syntax, and git diff --check

* no-mistakes(document): Correct away-mode classification documentation
…#3289)

* docs: split harness adapter operations reference

* no-mistakes(review): Fix harness adapter routing and ownership contracts

* no-mistakes(review): Prune duplicate harness adapter ownership prose

* no-mistakes(review): Fix default effort routing and Grok max semantics

* no-mistakes(review): Remove source-only routing test and duplicate semantics

* no-mistakes(review): Add local harness adapter instruction evaluation

* no-mistakes(review): Fix harness evaluation gating and change mapping

* no-mistakes(test): Captain, require explicit harness instruction evaluator model

* no-mistakes(document): Fix harness adapter documentation references
* test(fixtures): share fake-toolchain and spawn-world builders

Future tests can start from tests/fixtures.sh instead of copying stubs, and a
no-mistakes version-floor bump is one constant rather than a multi-file edit.

Migrated this round: fm-busy-adapter-wiring, fm-spawn-pool-base-freshen,
fm-grok-harness, fm-tangle-guard, fm-gate-refuse, fm-spawn-dispatch-profile.
Left for opportunistic migration: remaining make_spawn_fakebin copies
(trace-context, kimi, muse, backend), the make_stubs send cluster, and the
fake no-mistakes version banners in bootstrap/session-start/secondmate suites.
Did not touch tests/fm-pr-check-security.test.sh.

* no-mistakes(review): Prevent fake SSH test from blocking on stdin

* no-mistakes(document): Clarify shared fixture documentation

* no-mistakes(ci): Fixed the flaky watcher triage test by extending its startup-sensitive timer-repair wait from 3s to 10s, matching existing loaded-runner budgets. Verified with the full tests/fm-watch-triage.test.sh suite, bash syntax validation, and git diff checks

* no-mistakes(ci): Fixed portable serial shard 4 by updating the inactive-reconcile fixture to prime status through the public fm_wake_status_mark_current API, ensuring classifier helpers load correctly and preventing the idle watcher from exiting. Verified the test three consecutive times, ran fm-test-fixtures, ShellCheck, bash syntax checks, and git diff checks. The outer no-mistakes executor can now bind a fresh attestation to the new head

* no-mistakes(ci): Added behavioral coverage proving the shared spawn tmux fixture defaults an unset FM_FAKE_PANE_PATH to empty. Verified the fixture suite, ShellCheck, syntax/diff checks, and all six migrated test suites; all passed. The outer executor can now bind a fresh no-mistakes attestation to the updated head
* feat(bin): retire completed PR-check migration machinery

Every registered home already carried both completion markers, and no
installer still creates pre-migration checks. Remove the one-time migrate
script, its bootstrap/watch/teardown/docs surface, and migration-path tests
without weakening live check-trust or PR-poll authentication.

* no-mistakes(review): Restore live PR-check security coverage

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

* no-mistakes(ci): Fixed both failing CI checks. Updated inactive-reconcile setup to use the public status-marking interface, preventing false watcher exits. Made remote-job shutdown deterministic by stopping the complete worker tree before tampering. Verified both affected test suites, repeated inactive reconciliation, shell syntax, and git diff checks
Round 3 of the recorded 7-round upstream sync plan: the contiguous
first-parent prefix f66be0f..9e3df47, five upstream changes.

- 5f31097 (kunchenguid#3273) home-summary publication no longer
  starves supervision.
- 4eb587d (kunchenguid#3268) routine status updates no longer hide
  actionable events.
- c731c36 (kunchenguid#3289) harness-adapters split into a router
  plus references/.
- 0ace60a (kunchenguid#3296) shared shell fixtures centralized in
  tests/fixtures.sh.
- 9e3df47 (kunchenguid#3299) legacy PR-check migration machinery
  retired.

Twenty paths conflicted. The two load-bearing resolutions:

The harness-adapters skill had been split independently on both sides. Under
TRACK this takes upstream's references/ layout and its routing artifact, adds
references/harness/agy.md with an agy routing row, re-homes the fork's own
prose (bin/fm-launch-lib.sh ownership, the crew-only secondmate gate, the
dashboard's additive per-task event wiring) into references/common/, and
retires bin/fm-harness-adapter-doc.sh with its test. docs/fork-divergence.md
records that retirement as the sixth capability collision resolved by the
remote-doctor precedent.

Upstream deleted only bin/fm-pr-check-migrate.sh, so every inherited
PR_CHECK_MIGRATION and .pr-check-migration* reference was removed with it
across AGENTS.md, the bootstrap-diagnostics skill, bin/fm-bootstrap.sh,
bin/fm-session-start.sh, bin/fm-teardown.sh and the security and watcher-lock
suites. The fork's endpoint-binding and run-attribution migrations, which sit
directly below the deleted bootstrap call, are kept.

Deliberate divergences preserved rather than merged away: the fleet snapshot's
single FM_SNAPSHOT_TASK_TIMEOUT contract (upstream's second name was again not
introduced), the watcher's live declared-wait routing and self-widening
cadence (upstream's escalation gating adopted with pause_streak_bump moved
inside it), and the parked-decision marker reconciliation in
bin/fm-push-transition-lib.sh (carried into upstream's rewritten mark_surfaced).
The round's harness-adapters resolution deleted bin/fm-harness-adapter-doc.sh,
so its inventory row no longer names a script this repo carries.
The merge threads upstream's escalation gating across the fork's three
run-progress branches with a flag; declare it beside the other housekeeping
locals so it cannot leak into the daemon's outer scope.
kunchenguid#3299 moved the staged-record tamper setup to a bare
whole-tree stop. This fork's worker is a restart supervisor plus a serving child
in one process group, and worker_reap_descendants escalates TERM to KILL in a
single pass, so a group signal kills the child between publishing its shutdown
quarantine and clearing it. Ownership stays quarantined and the tamper step
cannot start a worker at all.

Re-sequence the setup to TERM the recorded child first and let it complete its
own shutdown, which ends the supervisor with it. Upstream's two assertions stay
byte-identical, and a bounded process-group check follows them so the tree stop
cannot pass vacuously on an already-dead pid.

docs/fork-divergence.md records this under the existing descendant-reaping
entry, as a consequence of that divergence rather than a new one.
@HelloWorldSungin
HelloWorldSungin merged commit dcc14c4 into main Sep 4, 2026
16 of 17 checks passed
@HelloWorldSungin
HelloWorldSungin deleted the fm/fm-upstream-sync-2026-09-02-round-3 branch September 4, 2026 03:20
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