Skip to content

fix: guard Stop hook invocation and secondmate intake and relaunch - #245

Merged
dnth merged 4 commits into
mainfrom
fm/fm-upstream-easy-ports
Oct 14, 2026
Merged

dnth merged 4 commits into
mainfrom
fm/fm-upstream-easy-ports

Conversation

@dnth

@dnth dnth commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Intent

Port four small upstream fixes from kunchenguid/firstmate (our upstream) into this fork (dnth/firstmate), adapting each to the fork's current code. The captain asked for "the easy merge" set:

  1. fix(skills): reconcile inherited secondmate plans with shipped state kunchenguid/firstmate#1853: docs-only second-mate intake guard (record intake for an existing or inherited domain in the secondmate-provisioning skill).
  2. fix: prevent manual Claude Stop hook calls from arming supervision kunchenguid/firstmate#6032: guard the Claude Stop hook's arguments (bin/fm-claude-stop-autoarm.sh); self-contained.
  3. fix(bin): stop secondmate relaunch failing when watcher scratch files vanish kunchenguid/firstmate#4900: remove the 3-line find(1) relaunch guard in bin/fm-control.sh that wrongly blocks secondmate relaunches when watcher scratch files vanish mid-scan.
  4. fix(bin): render the remote charter's steering-inbox path host-local kunchenguid/firstmate#5049: the remote second-mate charter's steering inbox must not use the parent's host-local path; it must resolve under the second mate's own (remote) home.

Requirements: for each pick, read the upstream PR diff and discussion, confirm the problem still exists in this fork, then adapt the change by hand to the fork's current structure. Do not cherry-pick blindly and do not pull any other upstream change. If a pick is already fixed in the fork, or adapting it would conflict with a fork-only feature, skip it and record why. Keep each pick in its own commit that names the upstream PR. Credit upstream in the PR body with the four links and state which were ported, adapted, or skipped. Add or adjust tests only where the fork has an existing test for the touched behavior or the upstream PR added one. Shared tracked material follows firstmate-coding-guidelines (one sentence per line in Markdown, plain dash, shellcheck-clean, no agent co-author, tests exercise behavior, never source-string assertions).

Acceptance criteria: AC1 kunchenguid#1853 guard text present in the fork's equivalent doc or a recorded reason it is covered/does not apply. AC2 kunchenguid#6032 Stop hook argument guard ported with a test or reproduction that malformed/missing arguments no longer break the hook. AC3 kunchenguid#4900 wrong relaunch guard removed with a test or reproduction showing the blocked relaunch now proceeds. AC4 kunchenguid#5049 charter inbox path resolves under the second mate's own home, with a test or reproduction. AC5 touched existing test suites pass, and the PR body links all four upstream PRs and states which were ported, adapted or skipped.

Decisions made (deliberate, not mistakes):

  • All four picks were confirmed live in the fork and none were skipped.
  • fix(skills): reconcile inherited secondmate plans with shipped state kunchenguid/firstmate#1853 ported verbatim into .agents/skills/secondmate-provisioning/SKILL.md (new section, Covers entry, one-line reinforcement in Backlog handoff). No test, by design: there is no executable consumer of skill prose and a source-string test is forbidden.
  • fix: prevent manual Claude Stop hook calls from arming supervision kunchenguid/firstmate#6032 adapted: the fork has no supervision host, so the usage text says it "arms the watcher" and the regression test asserts fm-watch-arm.sh never runs (no host fixture). -h/--help prints usage and exits 0; any other argument exits 2; both before anything is sourced, read, or armed. docs/watcher-continuity.md gets one line forbidding manual arming from a tool turn.
  • fix(bin): stop secondmate relaunch failing when watcher scratch files vanish kunchenguid/firstmate#4900 adapted: the fork has no tests/fm-control-relaunch.test.sh, so regression tests T19 (fake find fails on state/ yet the restart succeeds and the journal records children=2) and T20 (mode-000 state/ still refuses, agent untouched, skipped as root) were added to the existing tests/fm-secondmate-restart.test.sh, which drives the real fm-control.sh relaunch. They deliberately use mate ids smf1/smu1 because fm-spawn hard-codes /tmp/fm- temp roots.
  • fix(bin): render the remote charter's steering-inbox path host-local kunchenguid/firstmate#5049 adapted: in this fork only OMP remote steers are recorded in state/parent-route/.inbox (non-OMP remote steers are still typed into the pane), so upstream's PARENT_ROUTE_INBOX delivery-count refactors were not carried over; only the fixture plus three charter-render assertions were added to tests/fm-remote-secondmate-lifecycle-e2e.test.sh, and the docs/remote-secondmates.md line says "routed OMP transport". Rewrites use plain assignments to avoid the macOS bash 3.2 quoted-substitution quote leak.
  • Known local environment issue: this host's /tmp holds stale group-writable /tmp/fm- dirs (e.g. /tmp/fm-sm1, /tmp/fm-remote-omp) that make fm-spawn refuse task temp roots, and the remote lifecycle e2e step "remote reply source did not capture the merged-PR reply" fails on this host on the pre-port base too; neither is caused by these changes.

What Changed

  • Ported upstream #1853: require reconciliation of inherited secondmate plans against shipped state before seeding or backlog handoff.
  • Adapted upstream #6032 and #4900: handle Stop-hook help and reject unknown arguments before arming; replace the relaunch directory scan with permission checks so disappearing watcher scratch files do not block restarts.
  • Adapted upstream #5049: render remote charter steering-inbox paths under the secondmate’s own home for routed OMP transport. Added regression coverage for all three runtime fixes; none of the four picks were skipped.

Risk Assessment

✅ Low: The four ports are narrowly scoped, match the authorized adaptations, and introduce no substantiated correctness, security, or scope issues.

Testing

All three target suites and runtime scenarios passed using real product commands with isolated session/SSH fixtures. Base probes reproduced the fixed failures; an exploratory base lifecycle run encountered an unrelated reconciliation failure. CLI transcripts and generated charter evidence were retained; no rendered UI was changed.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Provision an inherited domain using the new record-intake instructions ⏸️ untested no This port changes skill prose only and has no executable consumer or live-validatable surface. The instructions were reviewed; their presence cannot demonstrate agent compliance.
Request hook help and receive usage without reading stdin or initializing a home ✅ pass live Stop-hook argument handling
Supply unknown or empty arguments and receive exit 2 without arming ✅ pass live Stop-hook argument handling; Stop-hook suite
Invoke the real hook with a normal Stop payload and retain its arming and rewake behavior ✅ pass live Stop-hook suite
Restart a secondmate despite a failing scratch-file directory scan and account for both children ✅ pass live Relaunch output and checkpoint journal
Attempt restart with unreadable state and preserve the running agent ✅ pass live Relaunch output and checkpoint journal
Seed a remote secondmate and receive inbox, message-listing, and acknowledgement paths under its own home ✅ pass live Generated remote charter; Remote lifecycle suite
Evidence: Stop-hook argument handling
[
  {
    "arguments": [
      "--help"
    ],
    "exit": 0,
    "stdout": "Usage: fm-claude-stop-autoarm.sh\n\nClaude Stop hook registered in .claude/settings.json; not for manual use.\nIt reads the Stop payload on stdin and, in a primary home that needs\nsupervision, arms the watcher for this session.\nExit 0 is silent; exit 2 carries a rewake banner on stderr.\n",
    "stderr": "",
    "stdin_remained_open": true
  },
  {
    "arguments": [
      "-h"
    ],
    "exit": 0,
    "stdout": "Usage: fm-claude-stop-autoarm.sh\n\nClaude Stop hook registered in .claude/settings.json; not for manual use.\nIt reads the Stop payload on stdin and, in a primary home that needs\nsupervision, arms the watcher for this session.\nExit 0 is silent; exit 2 carries a rewake banner on stderr.\n",
    "stderr": "",
    "stdin_remained_open": true
  },
  {
    "arguments": [
      "--bogus"
    ],
    "exit": 2,
    "stdout": "",
    "stderr": "error: unknown argument: --bogus\nUsage: fm-claude-stop-autoarm.sh\n\nClaude Stop hook registered in .claude/settings.json; not for manual use.\nIt reads the Stop payload on stdin and, in a primary home that needs\nsupervision, arms the watcher for this session.\nExit 0 is silent; exit 2 carries a rewake banner on stderr.\n",
    "stdin_remained_open": true
  },
  {
    "arguments": [
      ""
    ],
    "exit": 2,
    "stdout": "",
    "stderr": "error: unknown argument: \nUsage: fm-claude-stop-autoarm.sh\n\nClaude Stop hook registered in .claude/settings.json; not for manual use.\nIt reads the Stop payload on stdin and, in a primary home that needs\nsupervision, arms the watcher for this session.\nExit 0 is silent; exit 2 carries a rewake banner on stderr.\n",
    "stdin_remained_open": true
  },
  {
    "arguments": [
      "--bogus",
      "--help"
    ],
    "exit": 2,
    "stdout": "",
    "stderr": "error: unknown argument: --bogus\nUsage: fm-claude-stop-autoarm.sh\n\nClaude Stop hook registered in .claude/settings.json; not for manual use.\nIt reads the Stop payload on stdin and, in a primary home that needs\nsupervision, arms the watcher for this session.\nExit 0 is silent; exit 2 carries a rewake banner on stderr.\n",
    "stdin_remained_open": true
  },
  {
    "arguments": [
      "--help",
      "--bogus"
    ],
    "exit": 0,
    "stdout": "Usage: fm-claude-stop-autoarm.sh\n\nClaude Stop hook registered in .claude/settings.json; not for manual use.\nIt reads the Stop payload on stdin and, in a primary home that needs\nsupervision, arms the watcher for this session.\nExit 0 is silent; exit 2 carries a rewake banner on stderr.\n",
    "stderr": "",
    "stdin_remained_open": true
  }
]
Evidence: Relaunch output and checkpoint journal
restarted: smf1 (claude)
summary: 1 of 1 restarted, 0 nudged, 0 unreached
v1
task=smf1
phase=complete
ts=2026-10-14T04:38:44Z
backend=tmux
endpoint=fmses:fm-smf1
worktree=/tmp/fm-secondmate-restart.qgVa1u/findrace-15407/smf1-home
kind=secondmate
from_harness=claude
from_model=default
from_effort=default
to_harness=claude
to_model=default
to_effort=default
worktree_head=46842119175a42d65c390f99882ae3c967aaa565
worktree_dirty=yes
children=2
note=none
exit_result=stopped
relaunch_tx=684265.20261014T043843Z.4187
ok - T19 a vanished watcher scratch file does not block a mate's restart
unreached: smu1: the restart outcome is unknown: secondmate smu1's home has no readable state directory, so its child work cannot be accounted for; refusing to relaunch
summary: 0 of 1 restarted, 0 nudged, 1 unreached
agent before=claude after=claude
ok - T20 a mate home whose state cannot be listed still refuses the restart
Evidence: Generated remote charter
You are a persistent second mate managed by the main firstmate. Work on your own; do not wait for a human.

# Charter
Own iOS delivery on the build Mac.

# Routing scope
iOS implementation and Xcode validation

# Project clones
- alpha

# Operating model
You are in an isolated firstmate home. The local `AGENTS.md` is your job description, and your local `data/`, `state/`, `config/`, and `projects/` dirs are yours to operate.
The projects above are local clones for work you supervise; they are not an exclusive ownership claim.
Delegate project work to your own crewmates with the normal firstmate lifecycle: brief, spawn, status, watcher, steer, teardown, and recovery.
Do not invent a second delegation system.
You do not generate your own work.
Act only on tasks the main firstmate routes to you.
Never start a survey, audit, or "find improvements" sweep on your own initiative; that is not your job and it is unwanted.

# Requests from the main firstmate
You are a firstmate in your own home, so an incoming message reaches you in your own chat.
You must distinguish who it is from, because the answer goes to a different place.
A request relayed to you by the main firstmate is tagged with a leading `[fm-from-firstmate]` marker followed by an invisible system separator; this marker is untypable, so a human never produces it.
When a message carries that marker, do the work, then respond via the STATUS/ESCALATION path below, never only in this chat: the main firstmate does not read your chat, so a chat-only reply is lost.
Marked requests also carry a privacy-safe `corr=<id>` token after the marker; include that exact token in your parent status reply (or in the status pointer to a detailed doc) so the parent can correlate the answer.
Optional helper: `bin/fm-secondmate-report.sh` can append a correlated status line for you, but a plain `echo` that includes the same `corr=<id>` is equally valid - do not depend on the helper being present.
For a terse result, a status line is the whole answer.
For a detailed answer (an investigation, a plan, an audit), write it to a doc under your home's `data/` and append a status line that points to that doc - the scout-report pattern - so the main firstmate is woken and can read it.
Before treating an investigation or visual review as complete, load `captain-hold-lifecycle` from this home's `.agents/skills/` and pass its shared completion gate.
A message with NO marker is the captain typing directly into your pane: treat it as authoritative captain intervention and stay conversational exactly as you would for any captain message; do not force it onto the status path.
A request arriving through the instruction inbox below follows the same marker and reply rules.

# Firstmate instruction inbox
Firstmate steers you through durable message files in '/tmp/fm-remote-secondmate-e2e.FndNCJ/remote-home/state/parent-route/ios.inbox'.
When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '/tmp/fm-remote-secondmate-e2e.FndNCJ/remote-home/state/parent-route/ios.inbox'/*.msg, read and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '/tmp/fm-remote-secondmate-e2e.FndNCJ/remote-home/state/parent-route/ios.inbox'/NNN.msg '/tmp/fm-remote-secondmate-e2e.FndNCJ/remote-home/state/parent-route/ios.inbox'/handled/`.
The move IS the acknowledgement: without it firstmate rings again and eventually treats you as stuck. An empty or absent inbox needs no action.

# Escalation to main firstmate
Handle routine work yourself.
Report only true captain-relevant outcomes or a declared external wait by appending one line:
   `echo "{state}: {one short line}" >> '/tmp/fm-remote-secondmate-e2e.FndNCJ/remote-home/state/parent-replies.status'`
States: working, needs-decision, blocked, paused, done, failed.
Use `paused: {why}` (distinct from `blocked:`) only when your domain is deliberately idling on a known external wait you expect to clear on its own; use `blocked:` when you are stuck and need firstmate to act.
Use this only for material phase changes, a captain decision, a real blocker, a failure, work ready for review, or work you landed.
Work you landed includes a merge you performed yourself under standing merge authority and one the captain merged on the forge: under that authority nothing is ever \"ready for review\", so a landed merge that goes unreported reaches the captain as silence.
This is also how you return the answer to a marked from-firstmate request above.
A marked request requires one correlated answer after the work; it does not require a separate receipt or start acknowledgement.
Never append `working:` merely to acknowledge receipt or announce that a marked request has started.
When a routed-work phase has a supervisor-actionable material change worth reporting under the rule above, give that reported phase a stable key.
If its first reportable event is `working [key=<work-slug>]: {material phase}`, use the same key on its later `paused`, `done`, `failed`, `needs-decision`, or `blocked` event so the earlier working phase is superseded.
When a keyed phase ends without another reportable state, append `resolved [key=<work-slug>]: {why it is no longer active}`.
`resolved` separately closes an escalated decision or blocker, and only a `resolved` line carrying that decision's exact key closes it: a later `done` or `working` event never does, even when the answer is what started that work.
The main firstmate's answer normally writes that closing line at answer time; when a blocker or wait clears WITHOUT an answer from the main firstmate, append `resolved: {how it cleared}` yourself (keyed with `[key=<slug>]` if you opened it with one) as your domain resumes.
Routine internal supervision, heartbeats, retries, and crewmate churn stay inside your own home and must not touch that status file.

# Definition of done
You are persistent by default. Do not exit just because your queue is empty.
On startup and restart, run normal firstmate bootstrap and recovery through `bin/fm-session-start.sh` for your own home, but only to RECONCILE work that is already yours: in-flight crewmates, tracked backlog items, and durable watches recorded in this home.
When you have no assigned or in-flight work after that reconciliation, go idle and wait silently for the main firstmate to route you a task.
An empty queue is a healthy resting state, not a cue to invent work: never spawn a survey, audit, or any self-directed "find work" task on your own initiative.
If this charter cannot be carried out, append `blocked: {why}` or `failed: {why}` to the main status file and stop.
Evidence: Stop-hook suite
ok - auto-arm: inert in a linked child worktree even when in-flight
ok - auto-arm: inert with no session lock
ok - auto-arm: a demonstrably dead recorded session owner is reclaimed through fm-lock.sh before arming
ok - auto-arm: inert without arm, rewake, or lock replacement when another live harness owns the home
ok - auto-arm: inert while AFK owns supervision
ok - auto-arm: stale-owner recovery leaves the AFK and supervision-need gates unchanged
ok - auto-arm: resolves the outermost pid of a nested contiguous claude ancestry (bg-spare chain)
ok - auto-arm: inert with nothing in flight and no X-mode need
ok - auto-arm: actionable close translates to exactly one exit-2 rewake with reason
ok - auto-arm: actionable close survives a healthy successor without duplicate delivery
ok - auto-arm: bounded failure verification emits one automatic-mechanism alarm
ok - auto-arm: consecutive failures keep Stop-owned retry without repeating notice
ok - auto-arm: marker-write refusal defers delivery until one successor commits the notice
ok - auto-arm: unverified clean close exhausts retries and fails closed
ok - auto-arm: post-alarm actionable outcomes cannot continue or reset failure state
ok - auto-arm: benign cycle end with a live watcher and fresh beacon stays silent across the next cycle
ok - auto-arm: budget contention preserves the episode and forces a reset retry
ok - auto-arm: owner-mutex contention preserves successor episode state
ok - auto-arm: X-mode poll need arms the cycle even with no tasks in flight
ok - auto-arm: concurrent firings admit one owner and one rewake translation
ok - auto-arm: an abandoned owner claim is reclaimed so a lapsed cycle re-arms
ok - auto-arm: a legacy owner still arming is never reclaimed while its watcher keeps beating
ok - auto-arm: a fresh legacy arming claim is never reclaimed while its startup window is still open
ok - auto-arm: a live claim the ledger does not name is never reclaimed
ok - auto-arm: a claim whose pid was reused is reclaimed even while its ledger entry still reads arming
ok - auto-arm: a reused-pid claim is reclaimed even with no ledger entry to prove it
ok - auto-arm: an identity-matched owner still arming is never reclaimed
ok - auto-arm: the guard's terminal-check claim is never reclaimed
ok - auto-arm: a stuck live legacy owner is retired via TERM and its lock reclaimed
ok - auto-arm: a SIGSTOPped legacy owner is reclaimed with TERM pending and dies on continue
ok - auto-arm: a live open generation claim defers concurrent firings with no lock held
ok - auto-arm: a hung generation owner with no watcher beat is superseded so re-arming self-heals
ok - auto-arm: an identityless arming ledger never defers the gate (reused-pid loophole closed)
ok - auto-arm: a superseded owner never re-invokes the arm and leaves its successor's claim untouched
ok - auto-arm: a superseded owner goes silent - one supersession episode, one translation, no held mutex
ok - auto-arm: need vanishing mid-cycle closes without a rewake
ok - auto-arm: mid-cycle AFK hands triage to the daemon with no rewake
ok - auto-arm: active in a marked secondmate home
ok - auto-arm: --help, -h, and an unknown argument arm nothing; the Stop path still arms
ok - fm-lock: shared session-lock lib preserves the status path
Evidence: Secondmate restart suite
ok - T1 persist is a gate, and asks for open records and task status only
ok - T2 the mate persists before anything is stopped
ok - T2b an arrived persist answer is resolved before timeout
ok - T2c a reply between the preliminary scan and timeout decision wins
ok - T3 a runtime that cannot prove a restart falls back to the re-read message
ok - T4 every named mate is accounted for, including one this home does not know
ok - T5 a refused restart leaves the mate running and reports an unknown outcome
ok - T8 a local restart re-resolves this home's pin and reports the runtime that came up
ok - T6 a remote mate restarts through the host-local control plane over the fm-on hop
ok - T7 an unreachable host is reported honestly instead of claimed as reloaded
ok - T9 the persist gate retains its explicitly allocated correlation
ok - T10 pending persist answers are polled as one fleet
ok - T11 post-stop restart failure is never misreported as a nudge
ok - T12 relaunch waits do not block fleet persistence polling
ok - T13 a dead restart worker cannot hang the parent
ok - T14 a result published during reaping is honored
ok - T15 an already-current live mate is named by the update pass and genuinely restarted
ok - T16 an already-current mate with an unprovable runtime keeps the honest nudge path
ok - OMP secondmate capability resolves to the restart path
ok - OMP relaunch preparation proves stop and clears owned markers
ok - T17 an OMP restart stops the owner, proves it gone, retires its session artifacts, then relaunches
ok - T18 a local OMP mate persists and restarts after an update changes its loaded closure
ok - T19 a vanished watcher scratch file does not block a mate's restart
ok - T20 a mate home whose state cannot be listed still refuses the restart
# all fm-secondmate-restart tests passed
Evidence: Remote lifecycle suite
ok - overlapping remote home provisioning serializes through publication and rollback
ok - remote seed rollback preserves serialized competing routes
ok - unknown readiness preserves its route and brief for reconciliation
ok - remote seeding checks, repairs, and re-checks readiness, then stops on a remaining gap
ok - remote seeding proceeds once the repair closes every gap
ok - remote seed registers the route and provisions the whole home and project clone on that host
ok - remote inheritance rejects incomplete and superseded payload generations
ok - mixed local and remote routes validate without migration
ok - remote spawn launches on the remote-local backend and records a host-qualified route
ok - markerless remote liveness distinguishes live, unreachable, and missing endpoints without route loss
ok - legacy and mismatched remote endpoints fail closed before backend access
ok - non-herdr remote endpoints are refused without changing either route
ok - remote spawn serializes inheritance through launch publication
ok - marked send and routed reply complete through the existing parent correlation owner
ok - partial remote inheritance retains reread intent through bootstrap convergence
ok - config push and bootstrap serialize remote inheritance convergence
WARNING: watcher still down (same stale episode; last beat: 48s ago, grace 300s) - full banner already printed this episode.
WARNING: queued wakes pending - drain them with bin/fm-wake-drain.sh before anything else.
ok - remote inherited config retains and retries a failed live reread nudge
ok - a remote mate's merged-PR reply settles its landing through the reconcile carrier check and retries without duplication
ok - fleet snapshot projects mixed local and remote structured state
ok - remote update imports and fast-forwards the persistent home on its configured host
ok - the remote restart verb delegates to the host-local control plane and refuses before stopping anything
ok - startup repairs remote readiness before probing without relaunching
ok - startup reports alive legacy backends without changing their routes
ok - unreachable remote state remains unknown with no local respawn or failover
ok - remote retirement refuses child work, then removes only its own endpoint while a shared-session sibling survives
ok - remote spawn refuses a retired route without republishing its metadata
ok - remote OMP delivery replaces the reproducible typed no-turn regression with one bound inbox request, programmatic turn, and handled acknowledgement
ok - a successful remote OMP generation slept and restored on delivery retires its prior runtime markers and delivers exactly once
ok - a failed remote OMP bind retires its generation artifacts, preserves the retained session, and accepts the next launch
ok - Remote failed binds repair absent and malformed pointers without deleting saved sessions
ok - a remote OMP relaunch pins the herdr backend even when the remote home configures tmux
ok - remote OMP primary, fallback, result metadata, pane launch, and existing safety refusals hold end to end
ALL TESTS PASSED

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.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Provision an inherited domain using the new record-intake instructions ⏸️ untested no This port changes skill prose only and has no executable consumer or live-validatable surface. The instructions were reviewed; their presence cannot demonstrate agent compliance.
Request hook help and receive usage without reading stdin or initializing a home ✅ pass live Stop-hook argument handling
Supply unknown or empty arguments and receive exit 2 without arming ✅ pass live Stop-hook argument handling; Stop-hook suite
Invoke the real hook with a normal Stop payload and retain its arming and rewake behavior ✅ pass live Stop-hook suite
Restart a secondmate despite a failing scratch-file directory scan and account for both children ✅ pass live Relaunch output and checkpoint journal
Attempt restart with unreadable state and preserve the running agent ✅ pass live Relaunch output and checkpoint journal
Seed a remote secondmate and receive inbox, message-listing, and acknowledgement paths under its own home ✅ pass live Generated remote charter; Remote lifecycle suite
  • bash tests/fm-claude-stop-autoarm.test.sh in bwrap with workspace-owned /tmp
  • bash tests/fm-secondmate-restart.test.sh in bwrap with workspace-owned /tmp
  • bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh in bwrap with workspace-owned /tmp; initial recursive fixture setup was stopped and corrected
  • Direct hook invocations with open stdin, nonexistent home/code paths, help flags, unknown arguments, and an empty argument
  • Focused real-command relaunch and charter drivers with product output captured
  • Focused regressions against an archived base commit reproduced the pre-fix hook, relaunch, and charter failures
  • Exploratory base remote lifecycle run stopped at an unrelated markerless-reconciliation failure
  • Removed disposable fixtures and drivers; git status --short returned clean
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

dnth added 4 commits October 14, 2026 11:05
Port of upstream kunchenguid#1853: add record intake for an
existing or inherited domain to secondmate-provisioning so a new mate
reconciles inherited plans against origin/main and the live deployment
instead of inheriting a plan backlog blind.
Port of upstream kunchenguid#6032, adapted to the fork's
watcher-arm path (the fork has no supervision host). -h/--help prints
usage and any other argument is refused, both before state is read or
the watcher armed, so a manual run from a tool turn cannot leave a
watcher owned by a short-lived process.
… vanish

Port of upstream kunchenguid#4900. The relaunch checkpoint no
longer walks state/ with find(1), which can fail when a watcher scratch
file vanishes mid-scan; it requires a readable, enterable state/ and keeps
the per-*.meta readability loop as the real guarantee. Regression tests
live in the fork's tests/fm-secondmate-restart.test.sh, which drives the
real fm-control relaunch (the fork has no fm-control-relaunch test file).
Port of upstream kunchenguid#5049. The remote charter copy now
rewrites the parent-absolute <FM_HOME>/state/<id>.inbox to the remote
home's state/parent-route/<id>.inbox, where the remote control plane
records OMP steers, alongside the existing reply-log rewrite. Each
rewrite is a plain assignment to avoid the macOS bash 3.2 quoted
substitution quote leak. The fork still types non-OMP remote steers, so
the upstream test's delivery-count refactors are not carried over; only
the charter-render assertions are.
@dnth
dnth merged commit 53c6176 into main Oct 14, 2026
32 of 33 checks passed
@dnth
dnth deleted the fm/fm-upstream-easy-ports branch October 14, 2026 05:53
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.

1 participant