Skip to content

fix(bin): Repair remote secondmate route boundaries - #2

Merged
davidtandoh merged 5 commits into
mainfrom
fm/ak088-remote-route-repair-gated
Sep 15, 2026
Merged

davidtandoh merged 5 commits into
mainfrom
fm/ak088-remote-route-repair-gated

Conversation

@davidtandoh

@davidtandoh davidtandoh commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

Intent

Continue AK-088 by repairing the confirmed Firstmate remote-secondmate routing defects that prevent the agent-station acceptance canary. Use the accepted AK-088 task and ADR-0007 as governing contracts. Keep Firstmate as the sole fleet supervisor and Herdr as transport. Do not create another supervisor. The governing contracts require one conversational captain to dispatch and observe the configured agent-station remote secondmate through its SSH route, with Firstmate owning dispatch, supervision, and crewmate lifecycle, Herdr owning visible remote session transport, and no parallel fleet supervisor or lifecycle owner.

What Changed

  • bin/fm-remote-home-seed.sh now rewrites the parent steering inbox path in the published remote charter to the remote home's host-local state/parent-route/<id>.inbox, alongside the existing status-path rewrite, so the remote charter never names the primary's inaccessible Mac-local paths.
  • bin/fm-procevent.sh treats any empty source output as no-result, including exit 0, leaving the source registered for retry without publishing a result, adapter sidecar, or wake.
  • bin/fm-wake-lib.sh adds a non-recursive recovery mutex acquire for the .steal lock: a stale or same-process owner is reclaimed at the fixed path, a live or unreadable owner refuses, and the previous recursive fm_lock_try_acquire call that grew .steal.steal paths and spun the EXIT path on a self-held mutex is replaced. Tests cover each behavior and the docs for remote secondmates, process-event sources, and watcher continuity are updated to match.

Risk Assessment

✅ Low: The three source changes are small and each was traced end to end: the recovery-mutex rewrite still yields a single winner under concurrent stale reclaim and now reclaims the self-held mutex on the exit path, the charter inbox rewrite matches the path fm-remote-secondmate-control.sh actually writes, and the exit-zero empty-output change only affects the remote-reply poll (every other shell adapter always prints output); both prior-round fixes are present and .agent-kit/session.lock is untracked at the target commit.

Testing

Ran the three modified test files as the baseline (lock file green, procevent green except one load-sensitive timing fixture unrelated to the guard change, remote lifecycle e2e still running with 18 passes and no failures when the report was forced), then drove each altered behavior live against the real scripts on base, intermediate, and target commits: glob-metacharacter home seeding produces a correct host-local remote charter only on the target, the self-held and stale recovery mutex cases hang or grow recursive paths on earlier commits and resolve promptly on the target, and an empty exit-zero procevent result stays armed silently on the target while nonempty results still capture. No real SSH leg could be driven because Remote Login is off on this host.

  • Live validation: ✅ go - 7 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Captain seeds a remote secondmate from a home path containing glob metacharacters; the remote charter names the remote host's inbox and reply log and none of the parent's paths ✅ pass live seed-charter-glob-home-target.txt (target) and seed-charter-glob-home-before.txt (base and 1df13d2 fail)
Remote seeding over a real SSH route to a second host ⏸️ untested no Remote Login (sshd) is disabled on this Mac and enabling it is a system-setting change outside the worktree boundary; provide an SSH alias to a reachable host with fm-remote-entrypoint.sh on PATH, or…
Watcher exit path re-acquires a lock whose recovery mutex this same process already holds after the primary holder died; it returns promptly and releases both paths ✅ pass live lock-self-held-hang-before-after.txt (1df13d2 hangs 8s, target acquires and releases)
A dead-owner recovery mutex is reclaimed repeatedly without growing a recursive .steal.steal path, including a lock name near the 255-byte limit ✅ pass live lock-self-held-hang-before-after.txt (base grows .steal suffixes until 'File name too long' and hangs; target refuses cleanly) and lock-recovery-mutex-drive.txt
Adversarial: an unreadable or live recovery-mutex owner is never replaced ✅ pass live lock-recovery-mutex-drive.txt scenarios C and D on target: refused, mutex left intact
A remote-reply source that exits zero with empty output stays armed with no captured result, sidecar, or wake ✅ pass live procevent-exit-zero-empty-drive.txt (base captured an empty result and queued a wake; target reports no-result)
Adversarial: nonempty results from exit-zero and nonzero sources are still captured and wake Firstmate ✅ pass live procevent-nonempty-still-captured.txt
A remote steer lands in the charter-declared host-local inbox and can be acknowledged by moving it to handled/ ⏸️ untested no The lifecycle e2e run that drives this assertion had not reached completion when the structured report was demanded; rerun bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh to completion
The generated .agent-kit/session.lock is not tracked at the target commit ✅ pass live git ls-tree -r 031fc51 -- .agent-kit is empty; commit 031fc51 deletes the file
Evidence: Glob-path remote seeding on target: charter names only remote host paths

Source: Glob-path remote seeding on target: charter names only remote host paths

\### target-031fc51: parent-side seed script = ~/.no-mistakes/worktrees/e54530c4a65d/01M2J14319FFN72458A227T2Y3/bin/fm-remote-home-seed.sh
    parent FM_HOME = /private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/fm[1]
$ FM_HOME="$PARENT" fm-remote-home-seed.sh ios remote-mac "$REMOTE_ROOT" "$REMOTE_HOME" alpha
provisioned: /private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home projects=1
home=remote-mac:/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home
(exit 0)
-- ssh calls: 2
-- parent charter (data/ios/brief.md) route lines:
   22:Nobody reads this chat: the captain and the main firstmate see only what is appended to '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/fm[1]/state/ios.status', and a captain-facing sentence that is not appended there has not been sent.
   42:Firstmate steers you through durable message files in '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/fm[1]/state/ios.inbox'.
   43:When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/fm[1]/state/ios.inbox'/*.msg, read and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/fm[1]/state/ios.inbox'/NNN.msg '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/fm[1]/state/ios.inbox'/handled/`.
   49:   `echo "{state}: {one short line}" >> '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/fm[1]/state/ios.status'`
-- remote charter received on the remote host (/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home/data/charter.md) route lines:
   22:Nobody reads this chat: the captain and the main firstmate see only what is appended to '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home/state/parent-replies.status', and a captain-facing sentence that is not appended there has not been sent.
   42:Firstmate steers you through durable message files in '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home/state/parent-route/ios.inbox'.
   43:When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/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 '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home/state/parent-route/ios.inbox'/NNN.msg '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home/state/parent-route/ios.inbox'/handled/`.
   49:   `echo "{state}: {one short line}" >> '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home/state/parent-replies.status'`
-- verdict:
   ok: parent inbox path absent from remote charter
   ok: parent status path absent from remote charter
   ok: remote charter names the host-local inbox /private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home/state/parent-route/ios.inbox
   ok: remote charter names the host-local reply log /private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-target-031fc51.d8W5R5/remote-home/state/parent-replies.status
Evidence: Glob-path remote seeding on base and 1df13d2: parent paths retained or quote-mangled

Source: Glob-path remote seeding on base and 1df13d2: parent paths retained or quote-mangled

\### base-d913576: parent-side seed script = /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-base-d913576/bin/fm-remote-home-seed.sh
    parent FM_HOME = /private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]
$ FM_HOME="$PARENT" fm-remote-home-seed.sh ios remote-mac "$REMOTE_ROOT" "$REMOTE_HOME" alpha
provisioned: /private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/remote-home projects=1
home=remote-mac:/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/remote-home
(exit 0)
-- ssh calls: 2
-- parent charter (data/ios/brief.md) route lines:
   22:Nobody reads this chat: the captain and the main firstmate see only what is appended to '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.status', and a captain-facing sentence that is not appended there has not been sent.
   42:Firstmate steers you through durable message files in '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.inbox'.
   43:When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.inbox'/*.msg, read and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.inbox'/NNN.msg '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.inbox'/handled/`.
   49:   `echo "{state}: {one short line}" >> '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.status'`
-- remote charter received on the remote host (/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/remote-home/data/charter.md) route lines:
   22:Nobody reads this chat: the captain and the main firstmate see only what is appended to '"/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/remote-home/state/parent-replies.status"', and a captain-facing sentence that is not appended there has not been sent.
   42:Firstmate steers you through durable message files in '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.inbox'.
   43:When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.inbox'/*.msg, read and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.inbox'/NNN.msg '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/fm[1]/state/ios.inbox'/handled/`.
   49:   `echo "{state}: {one short line}" >> '"/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-base-d913576.Rd2WkL/remote-home/state/parent-replies.status"'`
-- verdict:
   FAIL: remote charter still names the parent's inaccessible inbox
   ok: parent status path absent from remote charter
   FAIL: remote charter does not name the host-local inbox cleanly
   FAIL: remote charter does not name the host-local reply log cleanly

\### mid-1df13d2-unquoted-pattern: parent-side seed script = /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-mid-1df13d2/bin/fm-remote-home-seed.sh
    parent FM_HOME = /private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]
$ FM_HOME="$PARENT" fm-remote-home-seed.sh ios remote-mac "$REMOTE_ROOT" "$REMOTE_HOME" alpha
provisioned: /private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/remote-home projects=1
home=remote-mac:/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/remote-home
(exit 0)
-- ssh calls: 2
-- parent charter (data/ios/brief.md) route lines:
   22:Nobody reads this chat: the captain and the main firstmate see only what is appended to '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.status', and a captain-facing sentence that is not appended there has not been sent.
   42:Firstmate steers you through durable message files in '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.inbox'.
   43:When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.inbox'/*.msg, read and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.inbox'/NNN.msg '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.inbox'/handled/`.
   49:   `echo "{state}: {one short line}" >> '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.status'`
-- remote charter received on the remote host (/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/remote-home/data/charter.md) route lines:
   22:Nobody reads this chat: the captain and the main firstmate see only what is appended to '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.status', and a captain-facing sentence that is not appended there has not been sent.
   42:Firstmate steers you through durable message files in '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.inbox'.
   43:When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.inbox'/*.msg, read and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.inbox'/NNN.msg '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.inbox'/handled/`.
   49:   `echo "{state}: {one short line}" >> '/private/var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T/nm-seed-mid-1df13d2-unquoted-pattern.8IAqOt/fm[1]/state/ios.status'`
-- verdict:
   FAIL: remote charter still names the parent's inaccessible inbox
   FAIL: remote charter still names the parent's inaccessible status path
   FAIL: remote charter does not name the host-local inbox cleanly
   FAIL: remote charter does not name the host-local reply log cleanly
Evidence: Seeding driver script used for the above

Source: Seeding driver script used for the above

#!/usr/bin/env bash
# Drive bin/fm-remote-home-seed.sh from a parent home whose path contains glob
# metacharacters ("fm[1]"), across the same fake-SSH boundary the lifecycle e2e
# test uses (the fake ssh execs the real fm-remote-entrypoint.sh locally), then
# print the steering/status lines of the charter the remote home received.
# Usage: seed-charter-drive.sh <label> <parent-side-code-root> <remote-code-root> <fake-ssh-source-test>
set -u
LABEL=$1 PROOT=$2 RROOT=$3 E2E=$4
TMP_ROOT=$(mktemp -d "${TMPDIR:-/tmp}/nm-seed-$LABEL.XXXXXX"); TMP_ROOT=$(cd "$TMP_ROOT" && pwd -P)
PARENT="$TMP_ROOT/fm[1]"; REMOTE_ROOT="$TMP_ROOT/remote-root"; REMOTE_HOME="$TMP_ROOT/remote-home"
FAKEBIN="$TMP_ROOT/fake"; CLAIMS="$TMP_ROOT/claims"
mkdir -p "$PARENT/data" "$PARENT/state" "$PARENT/config" "$PARENT/projects" "$REMOTE_ROOT" "$CLAIMS" "$FAKEBIN"
cleanup() {
  FM_HOME="$PARENT" FM_PROCEVENT_CLAIM_ROOT="$CLAIMS" "$PROOT/bin/fm-procevent.sh" sweep-home >/dev/null 2>&1 || true
  if [ -f "$TMP_ROOT/remote-jobs/worker.pid" ]; then kill "$(cat "$TMP_ROOT/remote-jobs/worker.pid")" 2>/dev/null || true; sleep 0.3; fi
  rm -rf -- "$TMP_ROOT"
}
trap cleanup EXIT
( cd "$RROOT" && tar --exclude=.git --exclude=.no-mistakes --exclude=data --exclude=state --exclude=config -cf - . ) | ( cd "$REMOTE_ROOT" && tar -xf - )
git -C "$REMOTE_ROOT" init -q -b main
git -C "$REMOTE_ROOT" -c [email protected] -c user.name=T add .
git -C "$REMOTE_ROOT" -c [email protected] -c user.name=T commit -qm "Remote fixture root"
git init -q --bare "$TMP_ROOT/alpha.git"
git -C "$PARENT/projects" init -q -b main alpha
printf 'alpha\n' > "$PARENT/projects/alpha/README.md"
git -C "$PARENT/projects/alpha" -c [email protected] -c user.name=T add README.md
git -C "$PARENT/projects/alpha" -c [email protected] -c user.name=T commit -qm "Initial alpha"
git -C "$PARENT/projects/alpha" remote add origin "file://$TMP_ROOT/alpha.git"
git -C "$PARENT/projects/alpha" push -q -u origin main
printf -- '- alpha [direct-PR] - alpha project (added 2026-08-02)\n' > "$PARENT/data/projects.md"
printf 'codex\n' > "$PARENT/config/secondmate-harness"; printf 'tmux\n' > "$PARENT/config/backend"
# The fake ssh transport, verbatim from the lifecycle e2e test.
sed -n "/^cat > \"\$FAKEBIN\/fake-ssh\" <<'SH'$/,/^SH$/p" "$E2E" | sed '1d;$d' > "$FAKEBIN/fake-ssh"; chmod +x "$FAKEBIN/fake-ssh"
echo "### $LABEL: parent-side seed script = $PROOT/bin/fm-remote-home-seed.sh"
echo "    parent FM_HOME = $PARENT"
echo "\$ FM_HOME=\"\$PARENT\" fm-remote-home-seed.sh ios remote-mac \"\$REMOTE_ROOT\" \"\$REMOTE_HOME\" alpha"
FM_SECONDMATE_CHARTER='Own iOS delivery on the build Mac.' FM_SECONDMATE_SCOPE='iOS implementation and Xcode validation' \
FM_HOME="$PARENT" FM_ROOT_OVERRIDE="$REMOTE_ROOT" FM_PROCEVENT_CLAIM_ROOT="$CLAIMS" \
FM_SSH_BIN="$FAKEBIN/fake-ssh" FM_FAKE_SSH_COUNT="$TMP_ROOT/ssh.count" \
FM_FAKE_REMOTE_ENTRYPOINT="$REMOTE_ROOT/bin/fm-remote-entrypoint.sh" \
FM_REMOTE_JOB_PLATFORM_OVERRIDE=Linux FM_REMOTE_JOB_STATE_ROOT="$TMP_ROOT/remote-jobs" \
FM_FAKE_SSH_MODE=normal FM_FAKE_REMOTE_CWD="$TMP_ROOT" FM_FAKE_DOCTOR_LOG="$TMP_ROOT/doctor.log" \
FM_FAKE_DOCTOR_REPAIRED="$TMP_ROOT/doctor.repaired" FM_FAKE_SEED_ENTERED="$TMP_ROOT/seed.entered" FM_FAKE_SEED_RELEASE="$TMP_ROOT/seed.release" \
  "$PROOT/bin/fm-remote-home-seed.sh" ios remote-mac "$REMOTE_ROOT" "$REMOTE_HOME" alpha; echo "(exit $?)"
echo "-- ssh calls: $(cat "$TMP_ROOT/ssh.count" 2>/dev/null)"
echo "-- parent charter (data/ios/brief.md) route lines:"; grep -n "ios.status\|ios.inbox" "$PARENT/data/ios/brief.md" | sed 's/^/   /'
echo "-- remote charter received on the remote host ($REMOTE_HOME/data/charter.md) route lines:"
grep -n "\.status\|\.inbox" "$REMOTE_HOME/data/charter.md" 2>/dev/null | sed 's/^/   /' || echo "   (no remote charter)"
echo "-- verdict:"
if grep -Fq "$PARENT/state/ios.inbox" "$REMOTE_HOME/data/charter.md" 2>/dev/null; then echo "   FAIL: remote charter still names the parent's inaccessible inbox"; else echo "   ok: parent inbox path absent from remote charter"; fi
if grep -Fq "$PARENT/state/ios.status" "$REMOTE_HOME/data/charter.md" 2>/dev/null; then echo "   FAIL: remote charter still names the parent's inaccessible status path"; else echo "   ok: parent status path absent from remote charter"; fi
if grep -Fq "'$REMOTE_HOME/state/parent-route/ios.inbox'" "$REMOTE_HOME/data/charter.md" 2>/dev/null; then echo "   ok: remote charter names the host-local inbox $REMOTE_HOME/state/parent-route/ios.inbox"; else echo "   FAIL: remote charter does not name the host-local inbox cleanly"; fi
if grep -Fq "'$REMOTE_HOME/state/parent-replies.status'" "$REMOTE_HOME/data/charter.md" 2>/dev/null; then echo "   ok: remote charter names the host-local reply log $REMOTE_HOME/state/parent-replies.status"; else echo "   FAIL: remote charter does not name the host-local reply log cleanly"; fi
Evidence: Self-held mutex hang (1df13d2) and recursive path growth (base) versus target

Source: Self-held mutex hang (1df13d2) and recursive path growth (base) versus target

\### base-d913576
--- A. exit-path re-acquire while this process already holds the recovery mutex (primary holder dead)
acquired by pid 28860
primary released
mutex released
returned rc=0
   paths left: 
--- E. lock name near the 255-byte component limit, dead holder: no recursive suffix growth
drive:8: no matches found: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/x*
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

... [1219 bytes truncated] ...

.]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
basename: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/base-d913576/state/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[.steal x N ...]: File name too long
TIMEOUT after 8s (hung)
   suffix paths left:  

\### mid-1df13d2-before-review-fix
--- A. exit-path re-acquire while this process already holds the recovery mutex (primary holder dead)
TIMEOUT after 8s (hung)
   paths left: .contend.lock .contend.lock.steal 
--- E. lock name near the 255-byte component limit, dead holder: no recursive suffix growth
drive:8: no matches found: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/mid-1df13d2-before-review-fix/state/x*
refused
returned rc=0
   suffix paths left: .contend.lock .contend.lock.steal  

\### target-031fc51
--- A. exit-path re-acquire while this process already holds the recovery mutex (primary holder dead)
acquired by pid 90734
primary released
mutex released
returned rc=0
   paths left: 
--- E. lock name near the 255-byte component limit, dead holder: no recursive suffix growth
drive:8: no matches found: /var/folders/wj/q35z6lgs5zx716wvy69ctcy80000gn/T//nm-lock2.rm7A3w/target-031fc51/state/x*
refused
returned rc=0
   suffix paths left:  

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-wake-lib.sh:924 - The new non-recursive recovery mutex fails closed on an empty pid file (case &#34;$pid&#34; in &#39;&#39;|*[!0-9]*) return 1). At base, the recursive fm_lock_try_acquire &#34;$steal&#34; treated an empty pid as a mid-acquire and reclaimed it once the mutex path aged past FM_LOCK_STALE_AFTER (via fm_lock_mid_acquire_is_fresh); now a .watch.lock.steal whose owner pid file is empty (only reachable through a crash that loses the just-written pid bytes while the symlink survives) is refused forever, so a stale primary lock behind it can only be recovered by manual removal. This sits inside the deliberate fail-closed design line the user reaffirmed in round 1 ("do not broaden the lock design") and is pinned by test_lock_unreadable_steal_mutex_fails_closed, so no action is requested; recorded so the accepted trade-off is explicit.
⚠️ **Test** - 1 warning
  • ⚠️ tests/fm-procevent.test.sh:2562 - tests/fm-procevent.test.sh failed once at the orphan-storm launch-floor fixture (expects 3 relaunches within 12s) while the machine load average was 13-16. That fixture's source exits nonzero with empty output, which the changed guard handles identically before and after this diff, so it reads as a load-induced flake rather than a regression; a rerun under lower contention was not completed before this report was forced. Remote CI should confirm.
  • Live validation: ✅ go - 7 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Captain seeds a remote secondmate from a home path containing glob metacharacters; the remote charter names the remote host's inbox and reply log and none of the parent's paths ✅ pass live seed-charter-glob-home-target.txt (target) and seed-charter-glob-home-before.txt (base and 1df13d2 fail)
Remote seeding over a real SSH route to a second host ⏸️ untested no Remote Login (sshd) is disabled on this Mac and enabling it is a system-setting change outside the worktree boundary; provide an SSH alias to a reachable host with fm-remote-entrypoint.sh on PATH, or…
Watcher exit path re-acquires a lock whose recovery mutex this same process already holds after the primary holder died; it returns promptly and releases both paths ✅ pass live lock-self-held-hang-before-after.txt (1df13d2 hangs 8s, target acquires and releases)
A dead-owner recovery mutex is reclaimed repeatedly without growing a recursive .steal.steal path, including a lock name near the 255-byte limit ✅ pass live lock-self-held-hang-before-after.txt (base grows .steal suffixes until 'File name too long' and hangs; target refuses cleanly) and lock-recovery-mutex-drive.txt
Adversarial: an unreadable or live recovery-mutex owner is never replaced ✅ pass live lock-recovery-mutex-drive.txt scenarios C and D on target: refused, mutex left intact
A remote-reply source that exits zero with empty output stays armed with no captured result, sidecar, or wake ✅ pass live procevent-exit-zero-empty-drive.txt (base captured an empty result and queued a wake; target reports no-result)
Adversarial: nonempty results from exit-zero and nonzero sources are still captured and wake Firstmate ✅ pass live procevent-nonempty-still-captured.txt
A remote steer lands in the charter-declared host-local inbox and can be acknowledged by moving it to handled/ ⏸️ untested no The lifecycle e2e run that drives this assertion had not reached completion when the structured report was demanded; rerun bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh to completion
The generated .agent-kit/session.lock is not tracked at the target commit ✅ pass live git ls-tree -r 031fc51 -- .agent-kit is empty; commit 031fc51 deletes the file
  • bash tests/fm-watcher-lock.test.sh (all lock tests including the four new recovery-mutex regressions pass)
  • bash tests/fm-procevent.test.sh (new exit-zero empty output stays armed test passes; one unrelated timing fixture failed under load)
  • bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh (in progress at report time: 18 passes, no failures, remote seed/charter section passed)
  • Manual drive seed-charter-drive.sh of bin/fm-remote-home-seed.sh with FM_HOME .../fm[1] over the fake-SSH boundary that execs the real fm-remote-entrypoint.sh, on base, intermediate, and target
  • Manual drive of fm_lock_acquire_wait/fm_lock_try_acquire with a self-held recovery mutex, dead-owner mutex x3, unreadable owner, live owner, and a 244-char lock name, on base, intermediate, and target with an 8s hang timeout
  • Manual drive of bin/fm-procevent.sh register/start with /bin/sh -c &#39;exit 0&#39; (empty) on base and target, and with nonempty exit-0, nonempty exit-1, and empty exit-1 sources on target
  • git ls-tree 031fc51 -- .agent-kit confirms no session lock is tracked
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

…m tests/fm-backend.test.sh: resolve_permissive_tmux_kill_ref searched `git log --first-parent HEAD -- bin/backends/tmux.sh` for a historical adapter with the permissive kill-window selector. This fork merges upstream via merge commits (d913576 -> 0e19df7), so all upstream history is on the second parent; the first-parent walk only sees the post-merge exact-selector adapter and the case fails with "unable to locate a historical bin/backends/tmux.sh with permissive kill-window selectors". Main's latest CI run (d913576) fails on the identical assertion, so the PR code did not cause it, but the check blocks this and every future PR in the fork. Fix: removed `--first-parent` from the resolver (content-addressed search now walks all ancestors; identical result on upstream's linear history) and updated the comment. Verified: pre-fix copy reproduces the failure locally; fixed tests/fm-backend.test.sh passes all cases including the teardown conformance case. shellcheck not installed locally. Separate flag, not changed: commit 9d1b207 re-added .agent-kit/session.lock to the tree despite the review round 2 decision to untrack it; it should be dropped from the index (git rm --cached) before merge
@davidtandoh
davidtandoh merged commit a530c8a into main Sep 15, 2026
14 checks passed
davidtandoh added a commit that referenced this pull request Sep 27, 2026
Bring fork main (2f9a106, the 2026-09-26 upstream sync plus fork
fixes #2-#6) into the Kiro V3 crew branch so PR #8 merges cleanly.
A merge, not a rebase, keeps the upstream PR kunchenguid#4679 merge and its
authorship intact.

Textual conflicts (1):

- bin/fm-test-run.sh, family_for_basename live-e2e list: this branch
  added fm-kiro-signals-live-e2e.test.sh on its own line; main added
  fm-herdr-agent-liveness-live-e2e.test.sh beside the version-floor
  test. Kept both entries, so both live tests stay classified in the
  live-harness-optin family.

Auto-merged files touched by both sides, checked by hand:

- bin/fm-spawn.sh: main's agy Opus --effort omission (fork fix #5)
  sits in the agy arm next to this branch's new kiro effort arm;
  effort_flag_for_harness keeps the (harness, effort, model)
  signature on both sides.
- agy.md, docs/configuration.md, docs/verification/runtime-backends.md:
  disjoint hunks.

Semantic review: the Kiro adapter adds no arm to bin/backends/herdr.sh
or fm_harness_pid_alive. Kiro reaches the fork's registration-
independent Herdr liveness (fork fix #3) through
fm_agent_process_classify_name, where kiro-cli classifies as agent.
It is worker-only, so it stays out of the primary session-lock
harness table.

Claude-Session: https://claude.ai/code/session_01B4Krq5gHjEPXbmzMaaeTHs
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