You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(bin): unwedge the auto-arm claim mutex, add a guard last-resort arm, and scope teardown's landed-work check - #4208
Replay this home's 13 unpushed local commits onto current upstream, as a PR to
origin rather than an in-place rewrite of the home's own main.
Background. This home's main carried 13 commits that were never pushed and was
97 commits behind origin/main. Until that is reconciled no upstream fix reaches
this machine and finished work lands inconsistently depending on when its copy
was made. A merge was rejected because it leaves the histories permanently
tangled; leaving it alone keeps costing re-derived fixes.
Required shape. The replay happens in an isolated worktree and lands as a PR.
The home's main is NOT rewritten in place: firstmate is running from that
checkout and supervising a live fleet, so rebasing bin/ underneath it would
break the thing doing the work. Once this merges upstream the home
fast-forwards through the ordinary update path.
Required judgement per commit. 97 commits of drift means overlap is expected,
and six of the 13 are pipeline review-round commits whose subject matter may
have moved. Each commit is checked against current origin/main before being
carried. A commit whose intent is already satisfied upstream is dropped with a
note naming the upstream commit that satisfies it. No commit is force-applied
to preserve a count: carrying a stale fix on top of a better upstream one is
worse than dropping it. Where a commit's intent still stands but the code
around it has moved, the intent is re-expressed against today's code rather
than replaying a diff that no longer fits.
Required deliverable. A per-commit ledger in the PR body is the real
deliverable: for each of the 13, carried / dropped / re-expressed, and why.
That ledger is how the captain and firstmate know nothing was lost silently.
It must account for all 13 originals by name; state explicitly where a replay
was retitled, so a reader is not left wondering why a subject changed; state
plainly where a replayed commit was wrong against today's code, what caught it,
and that a corrective commit exists, so a reader never has to diff two commits
to discover the second one; and record the finding about whether any of the 13
was already satisfied upstream, so nobody re-derives that check.
Boundaries in force. No force-push, no stash, no discarding unlanded work. If
the replay cannot be done without discarding something, stop and report rather
than improvising. Nothing under projects/ is touched. The three parked branches
are not tidied or rebased here; that is separate work after this lands. Merge
is the captain's decision on this PR; report the full PR URL at green CI and
stop there.
Accepted requirements from the first validation review, to be applied by the
pipeline's fix round in this run:
The guard's last-resort arm confirm window (FM_CLAUDE_GUARD_ARM_CONFIRM,
hand-set default 5 s) must be derived from the same OSTYPE switch bin/fm-watch-arm.sh uses for its own arm window (10 s, 30 s on Git
Bash/MSYS), not kept as a separate number. Two timeouts that must agree
need one source; a confirm window tighter than the arm layer it confirms
makes the guard report a failure the arm had not yet had time to avoid, and
that is a false-alarm generator. State that reason at the constant.
fm_pid_start_identity's ps -o lstart fallback must pin TZ as well as LC_ALL=C, because lstart renders in the caller's zone and the generic
mutex steal now keys on string equality of that record; a contender under a
different TZ must not read a live holder as a reused pid.
The live Claude Stop auto-arm end-to-end guard's pre-wedge fixture must not
fabricate the dead-holder start time from a process spawned within the same
second as the real holder, because ps lstart has one-second resolution on
macOS and the divergence assertion then fails before Claude is launched.
docs/turnend-guard.md's regression-coverage sentence must describe the
cases actually pinned by the tests (a spent budget stopping the blocking but
never the arming, and a restorable cycle being restored rather than alarmed
over), not the pre-fix spent-budget stand-down.
===
Per-commit ledger
None of the 13 was already satisfied upstream. Each was checked against
current origin/main before being carried, and every one of them still earns
its place: 97 commits of drift produced zero semantic overlap. No commit was
dropped. Recorded here so nobody re-derives that check.
Two entries need reading in full: number 3 was retitled, and number 7 was wrong
against today's code and carries a correction.
#
Replayed
Landed as
Outcome
Basis
1
079255d1 docs(agents): visual surface as the default for captain decisions
2272b29e
Carried, context re-resolved
Upstream section 9 still reads "Use plain chat for a yes-or-no decision and lavish-axi only when several options...". The neighbouring PR-URL sentence had been rewritten upstream, so the hunk conflicted; upstream's sentence kept, only the presentation rule replaced.
2
71ef98bc review: urgency is a no-delay rule, not a chat-only carve-out
34741cb0
Carried, context re-resolved
Same line, same conflict shape. Final wording is this commit's.
3
881b3cde document: note bearings Lavish board offer in README
3a3de369
Re-expressed, and retitled
Retitled to docs(readme): document the bearings Lavish board offer and mode because the content changed, not just its context. The original one-line note said /bearings file "then offers a Lavish board on that report". Upstream has since made the board its own explicit invocation option, and file mode now offers that mode rather than building a board itself, so replaying the original line verbatim would document a mechanism that no longer exists. The README named neither the mode nor the offer, leaving the board undiscoverable from the public surface, so the skill table row and the invocation examples now carry both.
4
81c21716 feat(brief): PR screenshots as committed blob images
69cf5560
Carried, minus its demo screenshot
Upstream bin/fm-brief.sh has no PR media section and .github/pr-media/ does not exist upstream. The test conflict was additive only; both sides kept. The original also committed a 1 MB demo screenshot, .github/pr-media/fm-brief-screenshot-embedding-b1/brief-media-rule.png, carried for illustration only; that file is NOT on this branch. See "The demo screenshot was dropped" below for what happened and why it stays dropped.
5
dc834ad5 review: disclose that PR media blob URLs die at merge
725b05bd
Carried, clean
Applies unchanged.
6
283a6898 test: record the private-repo blob render verification in the header
48e1b707
Carried, clean
Applies unchanged.
7
54f27e50 fix(bin): unwedge the Stop auto-arm's claim mutex, give the guard a last-resort arm
2c5537e0plus4e1bf9aa
Carried, but wrong against today's code; corrected
The underlying defect is still live upstream: upstream has neither the holder-liveness helper nor the guard's confirm window, and all three generic lock liveness reads are still bare, so the pid-reuse wedge persists there. The closest upstream neighbour, #4119, suppresses false long-turn alarms and is complementary rather than overlapping. The replayed commit is nevertheless incorrect against today's code, and a second commit fixes it. See the section below; do not read this row alone.Corrected a second time in the CI fix commit 039cc763: the lock claim record now writes pid-identity and pid-start beside pid, but bin/fm-extension.mjs's lifecycle lock release still unlinked only pid before rmdir, so every bind, retire, and process-event release threw ENOTEMPTY and masked its real outcome on Linux CI; the release now removes both optional claim files, with a regression case in tests/fm-extension-binding.test.sh that failed before and passes after. The same commit fixed a test bug in tests/fm-watcher-lock.test.sh (BASHPID expanded inside a command substitution, so bash 5 compared the holder against a throwaway subshell while macOS bash 3.2 passed by accident).
8
9a976fcf fix(brief): harden the scaffold against premature done and phantom waits
1cebdafa
Carried
The defect is still live upstream and self-contradictory: the same no-mistakes block tells a worker "The task is complete only when committed on your branch... append done: {summary}" and, further down, to append done: PR {url} checks green after CI. That is the gate five lanes read as satisfied at an unpushed commit. Rule 7 had been expanded upstream; upstream's rule 7 is kept in full and this commit's rule 8 appended after it.
9
d317816a fix(tests): assert unbounded unread-status lines without a grep pattern
95c7f873
Carried
Confirmed still broken upstream: the suite on unmodified origin/main fails on this macOS host with "the oversized unread status line was truncated or omitted".
10
28946390 test: let the process-event fixture finish before retiring
2fbf2893
Carried
Upstream's fixture is unchanged; it still breaks out on the first queue byte and retires a runner that is mid-exit. The agent co-author trailer was dropped to satisfy this repo's rule against agent co-authors.
11
6dd0be56 fix(bin): scope teardown's landed-work check to the paths at risk
28e1ed0b
Carried, after the closest call in this set
Upstream still compares whole trees. Upstream PR #3870 tried path coverage, a reviewer broke it, and it was reverted with regression tests. That rejection was of path-set membership ("same path, different content, work discarded"); this commit compares content at those paths, so it refuses that sequence. Proof rather than argument: all three of upstream's regression tests pass on this branch, including squash-merged same-path different content still refuses. The header comment was merged so upstream's still-true facts survive and only the rejected-alternatives claim is replaced. Corrected in the CI fix commit 039cc763: the replayed at_risk_commit_paths returned "cannot establish" on an empty at-risk set - after the fetch put every HEAD commit on a remote - contradicting its own contract, so teardown refused landed work in fm-captain-hold-lifecycle on CI (48/49); an empty set now returns conclusive-empty while a genuine inability to list still fails closed (49/49).
12
bf3a6f29 review: report only verified merged-PR evidence in teardown refusals
b8159eac
Carried
Test conflict was additive; upstream's retained-state helper and this commit's stubs both kept.
13
65881b2a review: fail closed when the teardown path intersection cannot run
d5e642a9
Carried, clean
Applies unchanged.
The replayed auto-arm fix was wrong against today's code (4e1bf9aa)
Entry 7 must not be read on its own. Replaying 54f27e50 onto current origin/main introduced a real defect, so this branch carries a fourteenth
commit that fixes it.
The replayed commit decided whether a lock holder was still alive by comparing
the holder's full process identity, which folds in the command line. That is
correct for a role predicate, where a process that exec'd away from the role it
registered for should retire. It is wrong for a generic mutex, where the only
question is whether the process that took the lock is still running. A holder
that exec's into another program - take the lock, then become the long-lived
thing - keeps its pid and its start time and replaces only its command, so the
identity comparison read a live holder as dead and let a contender steal its
lock mid-hold.
Upstream's own bounded-wait case in tests/fm-wake-queue.test.sh caught it: the
drain stopped reporting the holder and took the lock instead. That failure is
what prompted the correction.
Holder liveness now keys on process start time, which answers the pid-reuse
question without asking the unrelated one. A pid that started at a different
time is a different process wearing a recycled number, which is the wedge the
replayed commit exists to break; an exec keeps the start time and stays the
holder. fm_lock_claim records both facts because they answer different
questions, and an unrecorded or unreadable start time keeps the conservative
bare-liveness read unchanged.
Regression coverage drives the two signals apart deliberately and asserts the
divergence, so the case cannot go quietly vacuous: the test asserts the full
identity CHANGED across the exec while the recorded start time survived, then
requires the contender to refuse. Probed for sensitivity against the pre-fix
comparison, it reports the lock stolen; against the fix, it passes.
Verification
484 tests pass and none fail, across fm-wake-queue 41, fm-watcher-lock 35, fm-claude-stop-autoarm 43, fm-turnend-guard 90, fm-guard-stale-banner 32, fm-watch-triage 111, fm-teardown 95, fm-brief 26, fm-task-delivery 11. bin/fm-lint.sh and bin/fm-doc-audience-check.sh are clean. The branch forks
from the current origin/main tip and the home's own main is untouched.
Commit hashes in the ledger are the ones on the branch as submitted to
validation; the validation pipeline's own rebase step rewrites them whenever
upstream has moved, so the commit subjects, not the hashes, are the stable key
for matching a ledger row to a branch commit. The commits after 4e1bf9aa
are the validation pipeline's own review, documentation, and CI fixes on top of
the replay, not replayed originals: they bound the guard's last-resort arm blocks
per generation, fix lock handoff records, keep the last-resort watcher arm free
of the budget limit, document the new guard and teardown tunables, derive the
guard confirm window from the arm layer's OSTYPE switch, pin TZ on the lock
start-time read, and - in the final one, 039cc763 - apply the CI fix round
described under rows 7 and 11.
The demo screenshot was dropped (69cf5560, then 5090d5ea)
The replayed brief commit 69cf5560 carried a 1 MB demo screenshot, .github/pr-media/fm-brief-screenshot-embedding-b1/brief-media-rule.png,
committed in the original as an illustration of the PR-media convention. The
first validation run's own review-fix commit, 5090d5ea ("bound last-resort
arm blocks and fix lock handoff records"), deleted that file without mentioning
it in its message, and an earlier version of this ledger went on claiming the
screenshot had been carried. That is why the ledger and the branch tip
disagreed: an automated fix made a silent content change, not a deliberate
replay decision. It is recorded here as the reason for the mismatch, not as a
fault.
The file stays dropped. Nothing references it: the tracked tree at the branch
tip was searched for the file's path and basename (git grep over every
tracked file, plus the home's private records), and the only pr-media
mentions are the convention text in bin/fm-brief.sh and its tests, which
refer to the .github/pr-media/<task-id>/ pattern and not to this image. A
1 MB binary that nothing links to earns no place in the default branch, so the
ledger is corrected to say so rather than the file restored.
What Changed
bin/fm-wake-lib.sh now records a lock holder's process start time (pid-start, via new fm_pid_start_identity with TZ=UTC LC_ALL=C pinned on the ps -o lstart fallback) and fm_lock_holder_alive keys liveness on it, so a reused pid no longer wedges the Stop auto-arm's claim mutex while an exec'd holder keeps its lock; bin/fm-turnend-guard.sh gains a --claude last-resort arm that spawns and verifies the watcher itself when the auto-arm claims nothing, with the confirm window (FM_CLAUDE_GUARD_ARM_CONFIRM) derived from the same OSTYPE switch as fm-watch-arm.sh (10 s, 30 s on MSYS), the arm never budget-limited, and only the follow-up block bounded per auto-arm generation.
bin/fm-teardown.sh compares landed-work content only at the paths the not-on-a-remote commits touched (at_risk_commit_paths / content_in_default), fails closed when any step of that intersection cannot run, and refusals now list the unmatched paths and the merged-PR commits it verified as missing (FM_TEARDOWN_EVIDENCE_PATH_LIMIT, FM_TEARDOWN_EVIDENCE_COMMIT_LIMIT) instead of unverified claims.
bin/fm-brief.sh adds a "Screenshots and PR media" section for PR-bearing modes (committed .github/pr-media/<task-id>/ blob URLs, local paths forbidden, blob URLs noted to die at merge) plus a wait-only-on-your-own-work rule, and bin/fm-dod-lib.sh reserves done: for a green-CI PR with a working: implementation committed stop-and-wait report; AGENTS.md defaults captain decisions to a lavish-axi surface with urgency as a no-delay rule, README documents /bearings lavish, CONTRIBUTING and the guard/teardown/configuration docs cover the new rules and tunables, and tests are added or fixed across wake-queue, watcher-lock, autoarm (unit and live e2e wedge fixture), turnend-guard, teardown, brief, and watch-triage.
Risk Assessment
✅ Low: The fix round is a small, mechanical application of four accepted requirements; each was verified against the current code and its call sites, the derived default shares one source with fm-watch-arm, the TZ pin has no record-compatibility hazard, the live fixture now diverges for real, and no new behavior or test-quality problems were introduced.
Testing
Ran the nine suites the intent names (bin/fm-test-run.sh over fm-turnend-guard, fm-watcher-lock, fm-wake-queue, fm-claude-stop-autoarm, fm-guard-stale-banner, fm-teardown, fm-brief, fm-task-delivery, fm-watch-triage), then reproduced each accepted fix-round requirement end-to-end: a live lock holder claiming under TZ=Asia/Tokyo is stolen by a contender under TZ=America/Los_Angeles with the pre-fix lib and deferred to with the fixed lib; the old e2e fixture form fabricates a dead-holder start time in the same second as the live wedge pid (3/3 runs) while the fixed form diverges; the guard's last-resort arm now confirms a 7 s-slow watcher under its default window (and a 12 s one under OSTYPE=msys) where the old hand-set 5 s gave up. Added two regression tests pinning the derived confirm window (fails on 06968371, passes on HEAD) and one pinning cross-TZ holder liveness in fm-watcher-lock (fails on 06968371, passes on HEAD); full guard (92) and watcher-lock (36) suites pass with them. Also confirmed ledger claims: the unbounded unread-status-line case fails on base with grep: out of memory and passes on the branch; all path-scoped teardown cases including squash-merged same-path different content still refuses pass; generated a no-mistakes brief and captured its PR-media section as product output. Three pre-existing host-specific failures (unchanged on base, in code this change does not touch; teardown additionally needs tasks-axi, which CI installs and this host lacks — I used a temp-prefix npm install for the run) are reported as informational. The live Claude auto-arm e2e (FM_CLAUDE_LIVE_E2E, credentialed, launches real Claude sessions) was not run; its fixture fix is evidenced by the standalone reproduction instead.
Evidence: TZ-dependent mutex steal: pre-fix lib steals from a live holder, fixed lib defers
[pre-fix 06968371] holder pid=87101 recorded pid-start: lstart=Fri Sep 11 21:24:55 2026
[pre-fix 06968371] holder start as read under America/Los_Angeles: lstart=Fri Sep 11 05:24:55 2026
[pre-fix 0696837~1] RESULT: contender STOLE the lock from live holder (now held by pid 87317, holder 87101 still alive: yes)
[fixed 0696837] holder pid=87683 recorded pid-start: lstart=Fri Sep 11 12:24:56 2026
[fixed 0696837] holder start as read under America/Los_Angeles: lstart=Fri Sep 11 12:24:56 2026
[fixed 0696837] RESULT: contender DEFERRED to live holder (lock still held by pid 87683)
[pre-fix 0696837~1] holder pid=87101 recorded pid-start: lstart=Fri Sep 11 21:24:55 2026
[pre-fix 0696837~1] holder start as read under America/Los_Angeles: lstart=Fri Sep 11 05:24:55 2026
[pre-fix 0696837~1] RESULT: contender STOLE the lock from live holder (now held by pid 87317, holder 87101 still alive: yes)
/var/folders/ds/6s0bw4852ks422cp3q2vc44h0000gn/T/no-mistakes-evidence/01M285TRRXCBHAJ66CSHTEHP8Q/tz-mutex-steal-repro.sh: line 22: 87101 Terminated: 15 TZ=Asia/Tokyo bash -c '. "$1"; STATE="$2"; fm_lock_try_acquire "$STATE/demo.lock" || exit 9; exec sleep 300' _ "$LIB" "$W/state"
[fixed 0696837] holder pid=87683 recorded pid-start: lstart=Fri Sep 11 12:24:56 2026
[fixed 0696837] holder start as read under America/Los_Angeles: lstart=Fri Sep 11 12:24:56 2026
[fixed 0696837] RESULT: contender DEFERRED to live holder (lock still held by pid 87683)
/var/folders/ds/6s0bw4852ks422cp3q2vc44h0000gn/T/no-mistakes-evidence/01M285TRRXCBHAJ66CSHTEHP8Q/tz-mutex-steal-repro.sh: line 22: 87683 Terminated: 15 TZ=Asia/Tokyo bash -c '. "$1"; STATE="$2"; fm_lock_try_acquire "$STATE/demo.lock" || exit 9; exec sleep 300' _ "$LIB" "$W/state"
Evidence: Live e2e wedge fixture: old same-second form vs fixed outer-$$ form (3 runs)
live reused pid (22610) start : lstart=Fri Sep 11 12:25:12 2026
OLD fixture 'dead holder' start : lstart=Fri Sep 11 12:25:12 2026 -> SAME SECOND: divergence assertion FAILS
NEW fixture 'dead holder' start : lstart=Fri Sep 11 12:25:10 2026 -> DIVERGES
(identical outcome on runs 2 and 3)
--- run 1
live reused pid (22610) start : lstart=Fri Sep 11 12:25:12 2026
OLD fixture 'dead holder' start : lstart=Fri Sep 11 12:25:12 2026 -> SAME SECOND: divergence assertion FAILS
/var/folders/ds/6s0bw4852ks422cp3q2vc44h0000gn/T/no-mistakes-evidence/01M285TRRXCBHAJ66CSHTEHP8Q/e2e-wedge-fixture-repro.sh: line 20: 22610 Terminated: 15 sleep 600
NEW fixture 'dead holder' start : lstart=Fri Sep 11 12:25:10 2026 -> DIVERGES
--- run 2
live reused pid (25523) start : lstart=Fri Sep 11 12:25:14 2026
OLD fixture 'dead holder' start : lstart=Fri Sep 11 12:25:14 2026 -> SAME SECOND: divergence assertion FAILS
/var/folders/ds/6s0bw4852ks422cp3q2vc44h0000gn/T/no-mistakes-evidence/01M285TRRXCBHAJ66CSHTEHP8Q/e2e-wedge-fixture-repro.sh: line 20: 25523 Terminated: 15 sleep 600
NEW fixture 'dead holder' start : lstart=Fri Sep 11 12:25:12 2026 -> DIVERGES
--- run 3
live reused pid (27519) start : lstart=Fri Sep 11 12:25:15 2026
OLD fixture 'dead holder' start : lstart=Fri Sep 11 12:25:15 2026 -> SAME SECOND: divergence assertion FAILS
/var/folders/ds/6s0bw4852ks422cp3q2vc44h0000gn/T/no-mistakes-evidence/01M285TRRXCBHAJ66CSHTEHP8Q/e2e-wedge-fixture-repro.sh: line 20: 27519 Terminated: 15 sleep 600
NEW fixture 'dead holder' start : lstart=Fri Sep 11 12:25:10 2026 -> DIVERGES
Evidence: Guard confirm-window regression: new tests pass on HEAD, fail on pre-fix guard
HEAD:
ok - fm-turnend-guard --claude: the last-resort arm's default confirm window is the arm layer's 10 s, not a tighter hand-set 5 s
ok - fm-turnend-guard --claude: the last-resort arm's default confirm window widens to 30 s on Git Bash/MSYS with fm-watch-arm's
0696837~1 (hand-set 5 s):
not ok - the derived default confirm window gave up on a watcher fm-watch-arm's own window would have confirmed
● TURN WOULD END BLIND - SUPERVISION IS OFF
== new guard confirm-window test against PRE-FIX guard (0696837~1, hand-set 5 s default):
not ok - the derived default confirm window gave up on a watcher fm-watch-arm's own window would have confirmed (missing: 'SUPERVISION RESTORED BY THE TURN-END GUARD')
--- output ---
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
● TURN WOULD END BLIND - SUPERVISION IS OFF
● 1 task(s) in flight, but no live watcher holds this home lock (last beat: 211296612s ago).
● The Stop-owned auto-arm did not claim this home either, so recovery is NOT already under way.
● watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
exit=1
Evidence: Cross-TZ holder-liveness regression test: HEAD vs pre-fix lib
== fixed lib (0696837):
ok - a live holder keeps its lock against a contender running under a different TZ
== PRE-FIX lib (0696837~1, no TZ pin):
not ok - a live holder was stolen by a contender running under a different TZ: rc=0 held=
== fixed lib (0696837):
ok - a live holder that exec'd into another program keeps its lock
ok - a live holder keeps its lock against a contender running under a different TZ
exit=0
== PRE-FIX lib (0696837~1, no TZ pin):
ok - a live holder that exec'd into another program keeps its lock
not ok - a live holder was stolen by a contender running under a different TZ: rc=0 held=
exit=1
Evidence: Ledger entry 9 confirmed: unbounded unread-status line fails on base, passes on branch
== branch:
ok - every readable unread status line is annotated in full while invalid status files preserve their raw wakes
== base:
grep: out of memory
not ok - the oversized unread status line was truncated or omitted
== branch:
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 13 --recovery-generation 83446.1789131769.rrO6L3
ok - every readable unread status line is annotated in full while invalid status files preserve their raw wakes
exit=0
== base:
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 13 --recovery-generation 95689.1789131781.e34yAk
grep: out of memory
not ok - the oversized unread status line was truncated or omitted
exit=1
Evidence: Generated no-mistakes brief: PR media section (product output of bin/fm-brief.sh)
### no-mistakes brief: '# Screenshots and PR media' section (generated by bin/fm-brief.sh)
# Screenshots and PR media
When a screenshot, GIF, or recording is part of the deliverable, commit it into your branch under `.github/pr-media/media-nm-c1/` and reference it as ``, using the owner/repo your branch is pushed to.
That URL renders inline in the PR body, private repository included; it stops resolving once the PR merges and the branch is deleted, though the image file itself lands on the default branch with the change.
Never paste a local filesystem path into a PR body - nobody else can open it.
Put those image lines in your `--intent`: the pipeline keeps the intent verbatim in the PR body and rewrites every other section on each run.
Attaching an image as pipeline run evidence never substitutes for that: the pipeline renders an evidence attachment in the PR body as `local file: /var/folders/...`, a machine-local path no reviewer can open, inside a section it rewrites every run, so it cannot be hand-fixed afterwards.
Any image that must appear in the PR body goes through the committed `.github/pr-media/media-nm-c1/` file and its blob URL carried in `--intent`.
### local-only brief: PR media section present? 0 (expected 0: no PR body in local-only)
Evidence: Serial rerun log: guard (92) and watcher-lock (36) suites green with new cases
FM_TEST_BEGIN 2026-09-11T12:37:16Z tests/fm-teardown.test.sh family=pr-forge expected_gate_skip=none
ok - local-only worktree with HEAD on a fork remote is torn down and the home summary is refreshed
ok - teardown closes its own backlog item before reporting success
ok - teardown honors config/backlog-backend=manual and still finishes cleanly
ok - local-only worktree with truly unpushed work is refused (safety preserved)
ok - local-only worktree with work merged into local main is torn down (no regression)
ok - no-mistakes worktree with HEAD on origin is torn down (no regression)
ok - no-mistakes worktree with genuinely unlanded work is refused (safety preserved)
ok - local-only worktree with unpushed work is torn down under --force (escape hatch)
ok - fm-pr-check publishes the PR-ready line on a secondmate's parent channel once
ok - a secondmate home's teardown delivers the child's final line or refuses until it can
ok - teardown completes when an exact busy-state sidecar is already absent
ok - herdr teardown removes pane-owned escalation dedupe state
ok - herdr flat teardown refuses before returning the isolated copy under lock contention and the retry completes cleanly
ok - herdr flat teardown never erases records when pane presence is unparseable
not ok - herdr-preflight-missing-adapter: teardown continued without its required preflight
FM_TEST_END 2026-09-11T12:38:30Z tests/fm-teardown.test.sh exit=1 duration_ms=74448 gate_skip=false
FM_TEST_BEGIN 2026-09-11T12:38:30Z tests/fm-wake-queue.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - an abandoned same-process lock hold is reclaimed; a parent's live hold is not
ok - without BASHPID a subshell cannot release or reclaim its parent lock and owns its own hold
ok - bounded acquire hands ownership to the waiting caller after contention
ok - a handed-off bounded lock still reads as held by its live caller
ok - presentation lock waits are bounded and retriable without weakening acknowledgement atomicity
ok - malformed presentation locks report acquire failure instead of contention
not ok - a genuine later no-progress episode was hidden after earlier progress
FM_TEST_END 2026-09-11T12:38:55Z tests/fm-wake-queue.test.sh exit=1 duration_ms=24584 gate_skip=false
FM_TEST_BEGIN 2026-09-11T12:38:55Z tests/fm-turnend-guard.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - fm_supervision_unhealthy: false with no state/*.meta at all
ok - fm_supervision_unhealthy: true with in-flight task and no beacon ever
ok - fm_supervision_unhealthy: true with in-flight task and a beacon far outside the grace window
ok - fm_supervision_unhealthy: false with in-flight task and a fresh beacon
ok - fm_supervision_status: FM_SUP_QUEUE_PENDING tracks state/.wake-queue
ok - fm_supervision_needed: X-mode relay poll needs supervision
ok - fm_supervision_unhealthy: source-only home needs supervision
ok - fm_supervision_needed: a registered custom check needs supervision with no task in flight
ok - fm_supervision_needed: a registered check whose bytes drifted still needs supervision
ok - fm_supervision_needed: false for a check.sh with no registration binding
ok - fm_supervision_needed: a task PR poll without a trust binding is not a registered custom check
ok - fm_supervision_status: the relay shim is not counted as a registered custom check
ok - fm-turnend-guard: silent no-op with nothing in flight
ok - fm-turnend-guard: blocks when a fresh beacon has no live watcher lock
ok - fm-turnend-guard: non-Claude path blocks a source-only home
ok - fm-turnend-guard: blocks on a dead watcher lock even when the beacon is fresh
ok - fm-turnend-guard: silent no-op with a live watcher lock and fresh beacon
ok - fm-turnend-guard: healthy non-Claude harness paths ignore Claude episode contention
ok - fm-turnend-guard: blocks on a live watcher lock with an ancient beacon
ok - fm-turnend-guard: blocks with the exact required reason in the primary when unhealthy
ok - fm-turnend-guard: blocks from active FM_HOME state, not only repo-root state
ok - fm-turnend-guard: X-mode repair reason sources the cadence config
ok - fm-turnend-guard: X-mode-only supervision remains guarded in default mode
ok - fm-turnend-guard: registered-check-only supervision is named in the block banner
ok - fm-turnend-guard: ignores stale repo-root state when FM_HOME is set
ok - fm-turnend-guard: uses FM_STATE_OVERRIDE ahead of FM_HOME/state
ok - fm-turnend-guard: stop_hook_active=true always allows the stop (never blocks twice in one turn)
ok - fm-turnend-guard: blocks a blind turn end in a secondmate's own home (.fm-secondmate-home no longer excludes it)
ok - fm-turnend-guard: idle-by-default - silent in a secondmate home with nothing in flight
ok - fm-turnend-guard: stop_hook_active=true allows the stop in a secondmate home (never blocks twice in one turn)
ok - fm-turnend-guard: secondmate deferred-death recovery - silent while watched, forces re-arm once the watcher exits
ok - fm-turnend-guard: inert in a secondmate's own child worktree (linked git worktree) even when unhealthy
ok - fm-turnend-guard: blocks a blind turn end in a treehouse-leased LINKED secondmate home (marker force-include)
ok - fm-turnend-guard: an invalid (empty) marker cannot spoof inclusion; linked worktree stays exempt
ok - fm-turnend-guard: a non-ASCII marker cannot spoof inclusion; linked worktree stays exempt
ok - fm-turnend-guard: inert in a crewmate/scout task worktree (linked git worktree) even when unhealthy
ok - fm-turnend-guard: fails open (never blocks) when jq is missing
ok - fm-turnend-guard: silent no-op on empty stdin
ok - fm-turnend-guard: runs well under the generous timing margin (1s)
ok - fm-turnend-guard-grok: forces one explicitly marked same-session resume when the shared predicate blocks
ok - fm-turnend-guard-grok: legacy environment loop guard prevents a nested resume loop
ok - fm-turnend-guard-grok: native false delegates blocking feedback with zero resume processes
ok - fm-turnend-guard-grok: native true remains bounded and starts no resume process
ok - fm-turnend-guard-grok: both spellings are typed and camelCase has deterministic precedence
ok - fm-turnend-guard-grok: malformed, invalidly typed, and missing-prerequisite payloads start neither path
ok - fm-turnend-guard-grok: missing jq and no-supervision-needed stops stay silent and bounded
ok - tracked .claude/settings.json entries: 5 inert under grok, the documented subagent exception still armed, all live under Claude
ok - .codex/hooks.json: Stop hook uses hook process root when payload cwd is outside
ok - .codex/hooks.json: Stop hook ignores nested git root guard scripts
ok - .opencode primary plugin: guard path is anchored to worktree, not directory
ok - .pi primary extension: no-tool and multi-tool runs each inject exactly one guard follow-up
ok - .pi primary extension: delivery failure resets the logical-run latch
ok - fm-turnend-guard --claude: re-blocks a loop-guarded stop while unhealthy and unclaimed (incident regression)
ok - fm-turnend-guard --claude: X-mode-only homes re-block when auto-arm recovery is absent
ok - fm-turnend-guard --claude: a live arming epoch advances once and repeated observation is idempotent
ok - fm-turnend-guard --claude: repeated failed-to-arming races make bounded monotonic progress
ok - fm-turnend-guard --claude: terminal owner boundary excludes a concurrent start without deadlock
ok - fm-turnend-guard --claude: fresh rewake epoch prevents a duplicate continuation for the same event
ok - fm-turnend-guard --claude: an abandoned auto-arm claim no longer allows a blind stop (incident regression)
ok - fm-turnend-guard --claude: a claim whose pid was reused stops counting as recovery even while its entry reads arming
ok - fm-turnend-guard --claude: a hung owner frozen at arming with no watcher beat no longer allows a blind stop
ok - fm-turnend-guard --claude: a live open generation claim owns recovery with no lock held
ok - fm-turnend-guard --claude: a stuck generation claim no longer allows a blind stop
ok - fm-turnend-guard --claude: the terminal path clears an abandoned claim instead of stepping aside silently
ok - fm-turnend-guard --claude: fresh failed epochs preserve and advance monotonic fail-open progression
ok - fm-turnend-guard --claude: integrated fresh failures reach one bounded fail-open, stop continuation, and reset on recovery
ok - fm-turnend-guard --claude: reset contention preserves all episode state until retry
ok - fm-turnend-guard --claude: concurrent auto-arm and guard resets are idempotent and deadlock-free
ok - fm-turnend-guard --claude: stale rewake epoch does not allow a blind stop
ok - fm-turnend-guard --claude: budget exhaustion alone cannot permit a blind stop
ok - fm-turnend-guard --claude: verified fail-open is loud, bounded, attended, and non-repeating
ok - fm-turnend-guard --claude: fail-open requires both exhausted retries and consumed notice
ok - fm-turnend-guard --claude: away ownership excludes the Stop-autoarm fail-open
ok - fm-turnend-guard --claude: positive watcher recovery resets failure episode state
ok - fm-turnend-guard --claude: bounded claim wait avoids a token-consuming forced continuation
ok - fm-turnend-guard --claude: secondmate home re-blocks unclaimed and allows auto-arm-claimed stops
ok - fm-turnend-guard: a live away-mode daemon satisfies supervision with no watcher holding the lock
ok - fm-turnend-guard: away-mode daemon ownership survives a leftover dead watcher lock
ok - fm-turnend-guard: away mode with no daemon and no watcher still blocks
ok - fm-turnend-guard: away mode blocks on a dead away-mode daemon
ok - fm-turnend-guard: away mode blocks on a pid-reused away-mode daemon lock
ok - fm-turnend-guard: away-mode daemon ownership never substitutes for a fresh beacon
ok - fm-turnend-guard: a daemon lock proves nothing while away mode is off
ok - fm-turnend-guard: away-mode beacon freshness uses the poll-derived grace, not the flat default
ok - fm-turnend-guard: a dead away-mode daemon still blocks under the poll-derived grace
ok - fm-turnend-guard: the poll-derived grace is bounded, not unlimited
ok - fm-turnend-guard: with away mode off, the poll-derived grace never applies
ok - fm-turnend-guard --claude: a lapsed cycle is restored at the next turn end without manual intervention
ok - fm-turnend-guard --claude: an unverifiable last-resort arm falls back to the bounded re-block
ok - fm-turnend-guard --claude: the last-resort arm's default confirm window is the arm layer's 10 s, not a tighter hand-set 5 s
ok - fm-turnend-guard --claude: the last-resort arm's default confirm window widens to 30 s on Git Bash/MSYS with fm-watch-arm's
ok - fm-turnend-guard --claude: the last-resort arm stands down while away mode owns the watcher
ok - fm-turnend-guard --claude: a spent block budget stops the blocking and never stops the arming
ok - fm-turnend-guard --claude: a restorable cycle is restored rather than alarmed over
FM_TEST_END 2026-09-11T12:41:18Z tests/fm-turnend-guard.test.sh exit=0 duration_ms=142551 gate_skip=false
FM_TEST_BEGIN 2026-09-11T12:41:18Z tests/fm-watcher-lock.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - simultaneous watcher starts leave exactly one live process
ok - fm_pid_identity real ps fallback is locale-invariant
ok - fm_pid_identity is locale-invariant across LC_ALL/LC_TIME
ok - /proc process identity ignores simulated btime changes
ok - /proc process identity detects pid reuse
ok - MSYS /proc process identity regression skipped on non-Windows host
ok - killed watcher stale lock is reclaimed
tests/fm-watcher-lock.test.sh: line 1248: 93661 Killed: 9 FM_STATE_OVERRIDE="$state" bash -c '
. "$1"
fm_lock_remove_path() {
if [ "$1" = "$STATE/.watch.lock" ]; then
kill -KILL "${BASHPID:-$$}"
fi
return 1
}
fm_lock_try_acquire "$2"
' _ "$LIB" "$lockdir" > /dev/null 2>&1
ok - stale watcher reclaim publishes durable recovery evidence before clear
ok - live watcher lock with stale heartbeat is actionable
ok - guard banner leads when down with pending wakes (repair-after-drain) and stays silent when live and fresh
ok - concurrent fm_lock_try_acquire yields exactly one winner
ok - dead-pid stale lock is reclaimed by a single acquirer
ok - concurrent stale-lock steal yields exactly one winner
ok - live steal mutex is not reclaimed
ok - a live reused pid with mismatched recorded identity is reclaimed without being signalled
ok - a live holder whose recorded identity matches is never stolen
ok - a live holder that exec'd into another program keeps its lock
ok - a live holder keeps its lock against a contender running under a different TZ
ok - a fresh lock hold records the holder's pid-identity and start time
ok - live-held lock is not stolen
ok - empty mid-acquire lock keeps a minimum grace
ok - late original claimant cannot claim a recreated lock
ok - paused mid-acquire claimant backs off to active stealer
ok - watch restart preserves recovery without signaling a reused pid
ok - watch restart attaches to a verified healthy peer and later surfaces a successor gap
ok - watcher self-evicts when the lock pid no longer names it
ok - arm turns clean self-eviction without a successor into a typed failure
ok - arm attaches to a live fresh watcher and fails loudly when that cycle has no successor
ok - attached arm signals record a classified lifecycle entry
ok - arm starts cleanly and resurfaces recovery after a dead-pid lock
ok - arm cleans child watcher and temp output on HUP
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 21055.1789130526.8Pqoku
WARNING: queued wakes pending - drain them with bin/fm-wake-drain.sh before anything else.
ok - arm propagates an immediate watcher wake before confirmation
ok - arm attaches to a peer watcher after child stands down and surfaces a missing successor
watcher: lock held by live pid 26844 but heartbeat is stale for 842449343s (>300s); inspect or stop that watcher before re-arming.
ok - arm reports FAILED and exits non-zero when no fresh watcher can be confirmed
ok - cycle-exit ledger links a verified successor and remains size-capped
ok - SIGSTOP distinguishes live PID from stale beacon and termination records the exit class
FM_TEST_END 2026-09-11T12:43:03Z tests/fm-watcher-lock.test.sh exit=0 duration_ms=105029 gate_skip=false
FM_TEST_SUMMARY total=4 failed=2 skipped_gate=0 duration_ms=346997
FM_TEST_SUMMARY_FAMILY family=pr-forge count=1 duration_ms=74448 failed=1
FM_TEST_SUMMARY_FAMILY family=watcher-wake-lock count=3 duration_ms=272164 failed=1
FM_TEST_SLOWEST rank=1 script=tests/fm-turnend-guard.test.sh duration_ms=142551
FM_TEST_SLOWEST rank=2 script=tests/fm-watcher-lock.test.sh duration_ms=105029
FM_TEST_SLOWEST rank=3 script=tests/fm-teardown.test.sh duration_ms=74448
FM_TEST_SLOWEST rank=4 script=tests/fm-wake-queue.test.sh duration_ms=24584
exit=1
Evidence: Teardown suite minus the two host-broken herdr-preflight cases: 93 pass incl. path-scoped landed-work cases
ok - local-only worktree with HEAD on a fork remote is torn down and the home summary is refreshed
ok - teardown closes its own backlog item before reporting success
ok - teardown honors config/backlog-backend=manual and still finishes cleanly
ok - local-only worktree with truly unpushed work is refused (safety preserved)
ok - local-only worktree with work merged into local main is torn down (no regression)
ok - no-mistakes worktree with HEAD on origin is torn down (no regression)
ok - no-mistakes worktree with genuinely unlanded work is refused (safety preserved)
ok - local-only worktree with unpushed work is torn down under --force (escape hatch)
ok - fm-pr-check publishes the PR-ready line on a secondmate's parent channel once
ok - a secondmate home's teardown delivers the child's final line or refuses until it can
ok - teardown completes when an exact busy-state sidecar is already absent
ok - herdr teardown removes pane-owned escalation dedupe state
ok - herdr flat teardown refuses before returning the isolated copy under lock contention and the retry completes cleanly
ok - herdr flat teardown never erases records when pane presence is unparseable
ok - forced secondmate teardown holds every descendant lifecycle and metadata lock
ok - forced secondmate teardown retains Herdr child identity until exact pane disappearance
ok - forced teardown retains a nested secondmate home and its grandchild's Herdr identity when the grandchild close is unconfirmed
ok - herdr projection teardown retires its journal only after confirming the exact recorded pane is gone
ok - herdr projection teardown retains every record when post-close presence is unknown
ok - herdr projection teardown surfaces failed focus restoration without turning confirmed cleanup into a hard failure
ok - squash-merged + deleted-branch worktree (PR merged) is torn down (the fix)
ok - squash-merged PR accepts a local HEAD that is an ancestor of the final PR head
ok - teardown discovers a merged PR by branch name and tears down when no pr= was ever recorded
ok - squash-merged PR accepts replayed unpushed local patches contained in the PR head
ok - merged PR does not allow teardown after a later local commit
ok - squash-merged task whose local branch followed the pipeline rebase is torn down
ok - squash-merged same-path different content still refuses
ok - squash-merged rebased local still refuses a genuinely unlanded follow-up commit
ok - squash-merged stale local still refuses when the forge is unreachable
ok - fm-pr-check does not refresh PR head after HEAD moves
ok - fm-pr-check records the remote PR head when the local worktree lags
ok - worktree whose content already landed in the default branch is torn down (content fallback)
ok - content fallback refreshes origin default before comparing the paths the work touched
ok - branch far behind the default branch is torn down when every path it changed already matches there
ok - a touched path the default branch does not match still refuses, and the refusal names it
ok - a path the default branch does not have at all still refuses
ok - a deletion the default branch also made is torn down
ok - a deletion the default branch has not made still refuses
ok - content a merge commit introduced on its own is still accounted for
ok - an unrefreshable default branch refuses and reports that the check could not run
ok - a refusal names the commits a merged PR head does not contain
ok - a merged PR whose head could not be fetched is reported as uncompared, never as lacking the work
ok - a safety pass whose own PR lookup fails reports no PR from an earlier pass
ok - an intersection that cannot be computed refuses rather than declaring the work landed
ok - dirty worktree is refused even when its committed work has landed (dirty always wins)
ok - gh lookup error with content not in default refuses (fail-safe)
ok - a record predating spawn_gen refuses teardown until --legacy-record is passed
ok - a landed legacy record with a dead endpoint tears down and logs its accepted incarnation
ok - --legacy-record never relaxes the unlanded-work refusal
ok - an endpoint that cannot be confidently read as dead refuses --legacy-record teardown
ok - --legacy-record teardown rolls its stamp back when the close marker write fails
ok - a legacy stamp a failed rollback left behind still faces the endpoint gate
ok - a corrupt spawn_gen is never accepted as a legacy record
ok - provably-stale worktree index.lock (old, no live holder) is cleared and teardown succeeds
ok - live-held worktree index.lock is never removed and teardown refuses
ok - lsof errors leave worktree index.lock in place and refuse teardown
ok - stale lock cleanup rechecks and refuses dirty worktree before return
ok - normal repo index.lock is resolved from the worktree and cleared when stale
ok - index-lock mtime fault injection is PATH-based; skipped on Darwin where stat is /usr/bin/stat
ok - transient index.lock cleared after first failed return is retried successfully without force-remove
ok - persistent index.lock exhausts retries and refuses without force-removing the lock
ok - empty retry wait overrides use the default without aborting teardown
ok - fractional legacy retry wait remains supported without arithmetic
ok - a task's own parked no-mistakes run is aborted, not orphaned, before the worker is removed
ok - a parked run the pipeline advanced past the task copy is still concluded from the runs ledger, not orphaned
ok - a ledger row for a different head never authorizes a parked-run abort
ok - a malformed ledger row never authorizes a parked-run abort
ok - an impossible ledger date never authorizes a parked-run abort
ok - a terminal status with a stale gate never reaches ledger cleanup
ok - an advanced head present locally aborts through the strict rule alone - the ledger fallback stays dormant
ok - an unresolvable active row with no same-branch anchor is never concluded (conservative refusal)
ok - an ancestor-only anchor never binds an advanced parked run to this task
ok - a terminal unfetched-head row is stale history and never concludes a run
ok - a terminal newest row anchored at this worktree's head never authorizes an abort
ok - a resolvable diverged newer same-branch row makes every older row stale history; no run is concluded
ok - consecutive unresolvable rows are ambiguous and never conclude a run
ok - a ledger-proven continuation is still left alone while the run is autonomously active
ok - teardown refuses before reap or removal when a task-owned run remains parked
ok - a different run cannot confirm the targeted abort
ok - empty post-abort status is not accepted as confirmation
ok - the CLI's exact run-not-found signal confirms completion
ok - a parked run on another branch is never aborted by this task's teardown (ownership is precise)
ok - a task-owned autonomous running step is left alone rather than aborted
ok - a leaked descendant process rooted under the task's worktree is reaped by teardown, not left surviving
ok - a leaked descendant process rooted under the task's per-task tasktmp is reaped by teardown too
ok - missing lsof falls back to reaping the tmux pane process group
ok - an erroring lsof scan refuses teardown and preserves the task
ok - a reused pid with a different start time is never force-killed
ok - an exec change preserves birth identity and the process is reaped
ok - a process spawned during grace is reaped on a later pass
ok - persistent leaked processes refuse teardown after bounded retries
ok - a process exiting during identity lookup does not block teardown
ok - the run abort and the leaked-process reap both complete before the destructive worktree return
exit=0
- Evidence: Initial nine-suite targeted run log (concurrent scheduler) (local file: /var/folders/ds/6s0bw4852ks422cp3q2vc44h0000gn/T/no-mistakes-evidence/01M285TRRXCBHAJ66CSHTEHP8Q/targeted-suites.log)
- Outcome: ⚠️ 3 infos across 1 run (41m21s)
🚨 bin/fm-turnend-guard.sh:506 - Accepted requirement not yet applied: confirm=${FM_CLAUDE_GUARD_ARM_CONFIRM:-5} keeps a hand-set 5 s default. The intent requires the default to be derived from the same OSTYPE switch bin/fm-watch-arm.sh:75-78 uses (msys*|mingw*|cygwin* → 30, else 10), with the reason stated at the constant: a confirm window tighter than the arm layer it confirms makes the guard report a failure the arm had not yet had time to avoid. Fix: replace the literal with the same case "${OSTYPE:-}" switch (or a shared default), keep the env override, and update the three places that still say "default 5" (bin/fm-turnend-guard.sh:83, docs/turnend-guard.md:112, docs/configuration.md:1003, which should mirror the FM_ARM_CONFIRM_TIMEOUT line's "default 30 on Git Bash/MSYS" wording). The one test that depends on the window (tests/fm-turnend-guard.test.sh:2152) already sets FM_CLAUDE_GUARD_ARM_CONFIRM=1, so no fixture change is needed.
🚨 bin/fm-wake-lib.sh:124 - Accepted requirement not yet applied: the ps -o lstart= fallback pins only LC_ALL=C. lstart renders in the caller's zone, and fm_lock_holder_alive (bin/fm-wake-lib.sh:961) keys the generic mutex steal on string equality of this record, so a contender running under a different TZ than the claimant (e.g. a Stop hook launched from a shell with TZ exported vs a launchd-started watcher) reads a live holder as a reused pid and steals a held lock. Fix: TZ=UTC LC_ALL=C ps -p "$pid" -o lstart= on line 124 and say why beside the existing locale comment. (The pre-existing fm_pid_identity fallback at line 88 has the same exposure for the role predicates; that is outside this change's accepted scope but worth the same one-word pin if touched.)
🚨 tests/fm-claude-stop-autoarm-live-e2e.test.sh:93 - Accepted requirement not yet applied: the pre-wedge fixture fabricates the dead holder's start time with bash -c '... fm_pid_start_identity "$$"', where $$ is single-quoted and so expands to the inner bash spawned milliseconds after sleep 600 &. ps lstart has one-second resolution on macOS, so WEDGE_START equals WEDGE_LIVE_START on almost every run and the guard fails at wedge fixture start times did not diverge before Claude is launched. Fix: pass the test script's own long-lived pid as an argument (bash -c '. "$1"; fm_pid_start_identity "$2"' _ "$ROOT/bin/fm-wake-lib.sh" "$$"), exactly as the portable tests/fm-claude-stop-autoarm.test.sh wedge does via fm_test_pid_start_identity "$$"; do the same for WEDGE_IDENTITY on line 88 so both fabricated facts describe one dead holder.
🚨 docs/turnend-guard.md:197 - Accepted requirement not yet applied: the regression-coverage sentence still lists "repeated arms spending the same block budget, the spent-budget stand-down to the attended fail-open", which describes the pre-fix behavior. The tests actually pinned are test_hook_claude_mode_spent_budget_stops_blocking_but_never_stops_arming (a spent budget stops the blocking but never the arming) and test_hook_claude_mode_spent_budget_restores_the_cycle_before_alarming (a restorable cycle is restored rather than alarmed over); commit a1bca9a removed the stand-down. Fix: rewrite that parenthetical to name those two cases.
🔧 Fix: derive guard confirm window, pin TZ, fix e2e wedge fixture
1 info still open:
ℹ️ bin/fm-wake-lib.sh:125 - The TZ=UTC pin is correct and matches the accepted requirement, but nothing executes fm_pid_start_identity under two different TZ values and asserts equal output, so a later refactor of this one-word pin would regress the mixed-TZ lock steal silently. If coverage is wanted, the behavioral shape is: same pid, TZ=UTC vs TZ=Asia/Tokyo, outputs must be string-equal on the ps fallback path. Not required by the intent; noted only so the gap is known.
⚠️ **Test** - 3 infos
ℹ️ tests/fm-teardown.test.sh:2658 - Pre-existing, host-specific: tests/fm-teardown.test.sh case herdr-preflight-missing-adapter fails on this macOS host ("teardown continued without its required preflight") and aborts the suite; it fails identically on the base commit 869ae90 and bin/fm-teardown.sh's change is not involved (the remaining 93 cases, including every path-scoped landed-work case this branch adds, pass when run past it). The suite also requires tasks-axi on PATH, which CI installs via npm and this host lacks. Remote CI owns this suite.
ℹ️ tests/fm-wake-queue.test.sh:294 - Pre-existing, host-specific flake: test_secondmate_foreign_queue_stall_tracks_progress_and_alerts_once in tests/fm-wake-queue.test.sh fails when run inside the full suite on this host (passes 3/3 in isolation, fails identically on base 869ae90 in-suite). Unrelated to this change — it exercises fm-watch-checkpoint's secondmate stall detection with a faked clock, none of which the branch touches. Every other wake-queue case, including the two the ledger cites (bounded-wait handoff, unbounded unread lines), passes.
ℹ️ tests/fm-watch-triage.test.sh:2890 - Pre-existing, host-specific: test_paused_authoritative_working_preserves_wedge_timer in tests/fm-watch-triage.test.sh fails on this host in isolation and identically on base 869ae90; the branch does not modify bin/fm-watch.sh or bin/fm-watch-triage.sh. The process-event fixture cases this branch does touch (test_procevent_*) pass 6/6.
bin/fm-test-run.sh tests/fm-turnend-guard.test.sh tests/fm-watcher-lock.test.sh tests/fm-wake-queue.test.sh tests/fm-claude-stop-autoarm.test.sh tests/fm-guard-stale-banner.test.sh tests/fm-teardown.test.sh tests/fm-brief.test.sh tests/fm-task-delivery.test.sh tests/fm-watch-triage.test.sh (concurrent auto-scheduler; 6 of 9 green, see findings for the 3 host-specific failures)
bin/fm-test-run.sh --jobs 1 tests/fm-teardown.test.sh tests/fm-wake-queue.test.sh tests/fm-turnend-guard.test.sh tests/fm-watcher-lock.test.sh with tasks-axi on PATH — guard (92 cases incl. 2 new) and watcher-lock (36 cases incl. 1 new) pass
New test test_hook_claude_mode_last_resort_arm_default_confirm_matches_arm_window (7 s-slow watcher confirmed under the default window; FM_CLAUDE_GUARD_ARM_CONFIRM=5 control gives up) — passes on HEAD, fails against the 0696837~1 guard script
New test test_hook_claude_mode_last_resort_arm_default_confirm_widens_on_msys (12 s-slow watcher confirmed under OSTYPE=msys) — passes
New test test_lock_keeps_live_holder_across_caller_timezones in tests/fm-watcher-lock.test.sh — passes on HEAD, fails against the 0696837~1 lib (rc=0 held= = stolen)
Manual repro tz-mutex-steal-repro.sh: holder under TZ=Asia/Tokyo, contender under TZ=America/Los_Angeles — pre-fix lib STEALS from the live holder, fixed lib DEFERS
Manual repro e2e-wedge-fixture-repro.sh x3: old bash -c '... "$$"' form yields the same lstart second as the live wedge pid (divergence assertion fails); fixed outer-$$ form diverges every run
fm-teardown suite minus the two host-broken herdr-preflight cases: 93 pass, including squash-merged same-path different content still refuses, an intersection that cannot be computed refuses, a merged PR whose head could not be fetched is reported as uncompared
test_enrichment_preserves_all_unread_lines_and_status_file_failures run on base extraction vs branch: base fails with grep: out of memory, branch passes (confirms ledger entry 9)
fm-watch-triage process-event cases (test_procevent_*, the fixture the change touched) in isolation: 6/6 pass
FM_HOME=<tmp> bin/fm-brief.sh media-nm-c1 some-proj --mode no-mistakes and --mode local-only: PR-media section present with ?raw=true blob URL and merge-death disclosure in no-mistakes, absent in local-only
Failing cases re-run on a git archive of base commit 869ae905: wake-queue foreign-stall, watch-triage wedge-timer, teardown herdr-preflight missing-adapter all fail identically on base
Intent
Replay this home's 13 unpushed local commits onto current upstream, as a PR to
origin rather than an in-place rewrite of the home's own main.
Background. This home's main carried 13 commits that were never pushed and was
97 commits behind origin/main. Until that is reconciled no upstream fix reaches
this machine and finished work lands inconsistently depending on when its copy
was made. A merge was rejected because it leaves the histories permanently
tangled; leaving it alone keeps costing re-derived fixes.
Required shape. The replay happens in an isolated worktree and lands as a PR.
The home's main is NOT rewritten in place: firstmate is running from that
checkout and supervising a live fleet, so rebasing bin/ underneath it would
break the thing doing the work. Once this merges upstream the home
fast-forwards through the ordinary update path.
Required judgement per commit. 97 commits of drift means overlap is expected,
and six of the 13 are pipeline review-round commits whose subject matter may
have moved. Each commit is checked against current origin/main before being
carried. A commit whose intent is already satisfied upstream is dropped with a
note naming the upstream commit that satisfies it. No commit is force-applied
to preserve a count: carrying a stale fix on top of a better upstream one is
worse than dropping it. Where a commit's intent still stands but the code
around it has moved, the intent is re-expressed against today's code rather
than replaying a diff that no longer fits.
Required deliverable. A per-commit ledger in the PR body is the real
deliverable: for each of the 13, carried / dropped / re-expressed, and why.
That ledger is how the captain and firstmate know nothing was lost silently.
It must account for all 13 originals by name; state explicitly where a replay
was retitled, so a reader is not left wondering why a subject changed; state
plainly where a replayed commit was wrong against today's code, what caught it,
and that a corrective commit exists, so a reader never has to diff two commits
to discover the second one; and record the finding about whether any of the 13
was already satisfied upstream, so nobody re-derives that check.
Boundaries in force. No force-push, no stash, no discarding unlanded work. If
the replay cannot be done without discarding something, stop and report rather
than improvising. Nothing under projects/ is touched. The three parked branches
are not tidied or rebased here; that is separate work after this lands. Merge
is the captain's decision on this PR; report the full PR URL at green CI and
stop there.
Accepted requirements from the first validation review, to be applied by the
pipeline's fix round in this run:
FM_CLAUDE_GUARD_ARM_CONFIRM,hand-set default 5 s) must be derived from the same OSTYPE switch
bin/fm-watch-arm.shuses for its own arm window (10 s, 30 s on GitBash/MSYS), not kept as a separate number. Two timeouts that must agree
need one source; a confirm window tighter than the arm layer it confirms
makes the guard report a failure the arm had not yet had time to avoid, and
that is a false-alarm generator. State that reason at the constant.
fm_pid_start_identity'sps -o lstartfallback must pinTZas well asLC_ALL=C, becauselstartrenders in the caller's zone and the genericmutex steal now keys on string equality of that record; a contender under a
different TZ must not read a live holder as a reused pid.
fabricate the dead-holder start time from a process spawned within the same
second as the real holder, because
ps lstarthas one-second resolution onmacOS and the divergence assertion then fails before Claude is launched.
docs/turnend-guard.md's regression-coverage sentence must describe thecases actually pinned by the tests (a spent budget stopping the blocking but
never the arming, and a restorable cycle being restored rather than alarmed
over), not the pre-fix spent-budget stand-down.
===
Per-commit ledger
None of the 13 was already satisfied upstream. Each was checked against
current
origin/mainbefore being carried, and every one of them still earnsits place: 97 commits of drift produced zero semantic overlap. No commit was
dropped. Recorded here so nobody re-derives that check.
Two entries need reading in full: number 3 was retitled, and number 7 was wrong
against today's code and carries a correction.
079255d1docs(agents): visual surface as the default for captain decisions2272b29elavish-axionly when several options...". The neighbouring PR-URL sentence had been rewritten upstream, so the hunk conflicted; upstream's sentence kept, only the presentation rule replaced.71ef98bcreview: urgency is a no-delay rule, not a chat-only carve-out34741cb0881b3cdedocument: note bearings Lavish board offer in README3a3de369docs(readme): document the bearings Lavish board offer and modebecause the content changed, not just its context. The original one-line note said/bearings file"then offers a Lavish board on that report". Upstream has since made the board its own explicit invocation option, and file mode now offers that mode rather than building a board itself, so replaying the original line verbatim would document a mechanism that no longer exists. The README named neither the mode nor the offer, leaving the board undiscoverable from the public surface, so the skill table row and the invocation examples now carry both.81c21716feat(brief): PR screenshots as committed blob images69cf5560bin/fm-brief.shhas no PR media section and.github/pr-media/does not exist upstream. The test conflict was additive only; both sides kept. The original also committed a 1 MB demo screenshot,.github/pr-media/fm-brief-screenshot-embedding-b1/brief-media-rule.png, carried for illustration only; that file is NOT on this branch. See "The demo screenshot was dropped" below for what happened and why it stays dropped.dc834ad5review: disclose that PR media blob URLs die at merge725b05bd283a6898test: record the private-repo blob render verification in the header48e1b70754f27e50fix(bin): unwedge the Stop auto-arm's claim mutex, give the guard a last-resort arm2c5537e0plus4e1bf9aa039cc763: the lock claim record now writespid-identityandpid-startbesidepid, butbin/fm-extension.mjs's lifecycle lock release still unlinked onlypidbeforermdir, so every bind, retire, and process-event release threw ENOTEMPTY and masked its real outcome on Linux CI; the release now removes both optional claim files, with a regression case intests/fm-extension-binding.test.shthat failed before and passes after. The same commit fixed a test bug intests/fm-watcher-lock.test.sh(BASHPIDexpanded inside a command substitution, so bash 5 compared the holder against a throwaway subshell while macOS bash 3.2 passed by accident).9a976fcffix(brief): harden the scaffold against premature done and phantom waits1cebdafadone: {summary}" and, further down, to appenddone: PR {url} checks greenafter CI. That is the gate five lanes read as satisfied at an unpushed commit. Rule 7 had been expanded upstream; upstream's rule 7 is kept in full and this commit's rule 8 appended after it.d317816afix(tests): assert unbounded unread-status lines without a grep pattern95c7f873origin/mainfails on this macOS host with "the oversized unread status line was truncated or omitted".28946390test: let the process-event fixture finish before retiring2fbf28936dd0be56fix(bin): scope teardown's landed-work check to the paths at risk28e1ed0bsquash-merged same-path different content still refuses. The header comment was merged so upstream's still-true facts survive and only the rejected-alternatives claim is replaced. Corrected in the CI fix commit039cc763: the replayedat_risk_commit_pathsreturned "cannot establish" on an empty at-risk set - after the fetch put every HEAD commit on a remote - contradicting its own contract, so teardown refused landed work infm-captain-hold-lifecycleon CI (48/49); an empty set now returns conclusive-empty while a genuine inability to list still fails closed (49/49).bf3a6f29review: report only verified merged-PR evidence in teardown refusalsb8159eac65881b2areview: fail closed when the teardown path intersection cannot rund5e642a9The replayed auto-arm fix was wrong against today's code (
4e1bf9aa)Entry 7 must not be read on its own. Replaying
54f27e50onto currentorigin/mainintroduced a real defect, so this branch carries a fourteenthcommit that fixes it.
The replayed commit decided whether a lock holder was still alive by comparing
the holder's full process identity, which folds in the command line. That is
correct for a role predicate, where a process that exec'd away from the role it
registered for should retire. It is wrong for a generic mutex, where the only
question is whether the process that took the lock is still running. A holder
that exec's into another program - take the lock, then become the long-lived
thing - keeps its pid and its start time and replaces only its command, so the
identity comparison read a live holder as dead and let a contender steal its
lock mid-hold.
Upstream's own bounded-wait case in
tests/fm-wake-queue.test.shcaught it: thedrain stopped reporting the holder and took the lock instead. That failure is
what prompted the correction.
Holder liveness now keys on process start time, which answers the pid-reuse
question without asking the unrelated one. A pid that started at a different
time is a different process wearing a recycled number, which is the wedge the
replayed commit exists to break; an exec keeps the start time and stays the
holder.
fm_lock_claimrecords both facts because they answer differentquestions, and an unrecorded or unreadable start time keeps the conservative
bare-liveness read unchanged.
Regression coverage drives the two signals apart deliberately and asserts the
divergence, so the case cannot go quietly vacuous: the test asserts the full
identity CHANGED across the exec while the recorded start time survived, then
requires the contender to refuse. Probed for sensitivity against the pre-fix
comparison, it reports the lock stolen; against the fix, it passes.
Verification
484 tests pass and none fail, across
fm-wake-queue41,fm-watcher-lock35,fm-claude-stop-autoarm43,fm-turnend-guard90,fm-guard-stale-banner32,fm-watch-triage111,fm-teardown95,fm-brief26,fm-task-delivery11.bin/fm-lint.shandbin/fm-doc-audience-check.share clean. The branch forksfrom the current
origin/maintip and the home's own main is untouched.Commit hashes in the ledger are the ones on the branch as submitted to
validation; the validation pipeline's own rebase step rewrites them whenever
upstream has moved, so the commit subjects, not the hashes, are the stable key
for matching a ledger row to a branch commit. The commits after
4e1bf9aaare the validation pipeline's own review, documentation, and CI fixes on top of
the replay, not replayed originals: they bound the guard's last-resort arm blocks
per generation, fix lock handoff records, keep the last-resort watcher arm free
of the budget limit, document the new guard and teardown tunables, derive the
guard confirm window from the arm layer's OSTYPE switch, pin TZ on the lock
start-time read, and - in the final one,
039cc763- apply the CI fix rounddescribed under rows 7 and 11.
The demo screenshot was dropped (
69cf5560, then5090d5ea)The replayed brief commit
69cf5560carried a 1 MB demo screenshot,.github/pr-media/fm-brief-screenshot-embedding-b1/brief-media-rule.png,committed in the original as an illustration of the PR-media convention. The
first validation run's own review-fix commit,
5090d5ea("bound last-resortarm blocks and fix lock handoff records"), deleted that file without mentioning
it in its message, and an earlier version of this ledger went on claiming the
screenshot had been carried. That is why the ledger and the branch tip
disagreed: an automated fix made a silent content change, not a deliberate
replay decision. It is recorded here as the reason for the mismatch, not as a
fault.
The file stays dropped. Nothing references it: the tracked tree at the branch
tip was searched for the file's path and basename (
git grepover everytracked file, plus the home's private records), and the only
pr-mediamentions are the convention text in
bin/fm-brief.shand its tests, whichrefer to the
.github/pr-media/<task-id>/pattern and not to this image. A1 MB binary that nothing links to earns no place in the default branch, so the
ledger is corrected to say so rather than the file restored.
What Changed
bin/fm-wake-lib.shnow records a lock holder's process start time (pid-start, via newfm_pid_start_identitywithTZ=UTC LC_ALL=Cpinned on theps -o lstartfallback) andfm_lock_holder_alivekeys liveness on it, so a reused pid no longer wedges the Stop auto-arm's claim mutex while an exec'd holder keeps its lock;bin/fm-turnend-guard.shgains a--claudelast-resort arm that spawns and verifies the watcher itself when the auto-arm claims nothing, with the confirm window (FM_CLAUDE_GUARD_ARM_CONFIRM) derived from the same OSTYPE switch asfm-watch-arm.sh(10 s, 30 s on MSYS), the arm never budget-limited, and only the follow-up block bounded per auto-arm generation.bin/fm-teardown.shcompares landed-work content only at the paths the not-on-a-remote commits touched (at_risk_commit_paths/content_in_default), fails closed when any step of that intersection cannot run, and refusals now list the unmatched paths and the merged-PR commits it verified as missing (FM_TEARDOWN_EVIDENCE_PATH_LIMIT,FM_TEARDOWN_EVIDENCE_COMMIT_LIMIT) instead of unverified claims.bin/fm-brief.shadds a "Screenshots and PR media" section for PR-bearing modes (committed.github/pr-media/<task-id>/blob URLs, local paths forbidden, blob URLs noted to die at merge) plus a wait-only-on-your-own-work rule, andbin/fm-dod-lib.shreservesdone:for a green-CI PR with aworking: implementation committedstop-and-wait report; AGENTS.md defaults captain decisions to alavish-axisurface with urgency as a no-delay rule, README documents/bearings lavish, CONTRIBUTING and the guard/teardown/configuration docs cover the new rules and tunables, and tests are added or fixed across wake-queue, watcher-lock, autoarm (unit and live e2e wedge fixture), turnend-guard, teardown, brief, and watch-triage.Risk Assessment
✅ Low: The fix round is a small, mechanical application of four accepted requirements; each was verified against the current code and its call sites, the derived default shares one source with fm-watch-arm, the TZ pin has no record-compatibility hazard, the live fixture now diverges for real, and no new behavior or test-quality problems were introduced.
Testing
Ran the nine suites the intent names (
bin/fm-test-run.shover fm-turnend-guard, fm-watcher-lock, fm-wake-queue, fm-claude-stop-autoarm, fm-guard-stale-banner, fm-teardown, fm-brief, fm-task-delivery, fm-watch-triage), then reproduced each accepted fix-round requirement end-to-end: a live lock holder claiming under TZ=Asia/Tokyo is stolen by a contender under TZ=America/Los_Angeles with the pre-fix lib and deferred to with the fixed lib; the old e2e fixture form fabricates a dead-holder start time in the same second as the live wedge pid (3/3 runs) while the fixed form diverges; the guard's last-resort arm now confirms a 7 s-slow watcher under its default window (and a 12 s one under OSTYPE=msys) where the old hand-set 5 s gave up. Added two regression tests pinning the derived confirm window (fails on 06968371, passes on HEAD) and one pinning cross-TZ holder liveness in fm-watcher-lock (fails on 06968371, passes on HEAD); full guard (92) and watcher-lock (36) suites pass with them. Also confirmed ledger claims: the unbounded unread-status-line case fails on base withgrep: out of memoryand passes on the branch; all path-scoped teardown cases includingsquash-merged same-path different content still refusespass; generated a no-mistakes brief and captured its PR-media section as product output. Three pre-existing host-specific failures (unchanged on base, in code this change does not touch; teardown additionally needstasks-axi, which CI installs and this host lacks — I used a temp-prefix npm install for the run) are reported as informational. The live Claude auto-arm e2e (FM_CLAUDE_LIVE_E2E, credentialed, launches real Claude sessions) was not run; its fixture fix is evidenced by the standalone reproduction instead.Evidence: TZ-dependent mutex steal: pre-fix lib steals from a live holder, fixed lib defers
[pre-fix 06968371] holder pid=87101 recorded pid-start: lstart=Fri Sep 11 21:24:55 2026 [pre-fix 06968371] holder start as read under America/Los_Angeles: lstart=Fri Sep 11 05:24:55 2026 [pre-fix 0696837~1] RESULT: contender STOLE the lock from live holder (now held by pid 87317, holder 87101 still alive: yes) [fixed 0696837] holder pid=87683 recorded pid-start: lstart=Fri Sep 11 12:24:56 2026 [fixed 0696837] holder start as read under America/Los_Angeles: lstart=Fri Sep 11 12:24:56 2026 [fixed 0696837] RESULT: contender DEFERRED to live holder (lock still held by pid 87683)Evidence: Live e2e wedge fixture: old same-second form vs fixed outer-$$ form (3 runs)
live reused pid (22610) start : lstart=Fri Sep 11 12:25:12 2026 OLD fixture 'dead holder' start : lstart=Fri Sep 11 12:25:12 2026 -> SAME SECOND: divergence assertion FAILS NEW fixture 'dead holder' start : lstart=Fri Sep 11 12:25:10 2026 -> DIVERGES (identical outcome on runs 2 and 3)Evidence: Guard confirm-window regression: new tests pass on HEAD, fail on pre-fix guard
HEAD: ok - fm-turnend-guard --claude: the last-resort arm's default confirm window is the arm layer's 10 s, not a tighter hand-set 5 s ok - fm-turnend-guard --claude: the last-resort arm's default confirm window widens to 30 s on Git Bash/MSYS with fm-watch-arm's 0696837~1 (hand-set 5 s): not ok - the derived default confirm window gave up on a watcher fm-watch-arm's own window would have confirmed ● TURN WOULD END BLIND - SUPERVISION IS OFFEvidence: Cross-TZ holder-liveness regression test: HEAD vs pre-fix lib
== fixed lib (0696837): ok - a live holder keeps its lock against a contender running under a different TZ == PRE-FIX lib (0696837~1, no TZ pin): not ok - a live holder was stolen by a contender running under a different TZ: rc=0 held=Evidence: Ledger entry 9 confirmed: unbounded unread-status line fails on base, passes on branch
== branch: ok - every readable unread status line is annotated in full while invalid status files preserve their raw wakes == base: grep: out of memory not ok - the oversized unread status line was truncated or omittedEvidence: Generated no-mistakes brief: PR media section (product output of bin/fm-brief.sh)
Evidence: Serial rerun log: guard (92) and watcher-lock (36) suites green with new cases
Evidence: Teardown suite minus the two host-broken herdr-preflight cases: 93 pass incl. path-scoped landed-work cases
/var/folders/ds/6s0bw4852ks422cp3q2vc44h0000gn/T/no-mistakes-evidence/01M285TRRXCBHAJ66CSHTEHP8Q/targeted-suites.log) - Outcome:Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-turnend-guard.sh:506- Accepted requirement not yet applied:confirm=${FM_CLAUDE_GUARD_ARM_CONFIRM:-5}keeps a hand-set 5 s default. The intent requires the default to be derived from the same OSTYPE switchbin/fm-watch-arm.sh:75-78uses (msys*|mingw*|cygwin*→ 30, else 10), with the reason stated at the constant: a confirm window tighter than the arm layer it confirms makes the guard report a failure the arm had not yet had time to avoid. Fix: replace the literal with the samecase "${OSTYPE:-}"switch (or a shared default), keep the env override, and update the three places that still say "default 5" (bin/fm-turnend-guard.sh:83,docs/turnend-guard.md:112,docs/configuration.md:1003, which should mirror theFM_ARM_CONFIRM_TIMEOUTline's "default 30 on Git Bash/MSYS" wording). The one test that depends on the window (tests/fm-turnend-guard.test.sh:2152) already setsFM_CLAUDE_GUARD_ARM_CONFIRM=1, so no fixture change is needed.bin/fm-wake-lib.sh:124- Accepted requirement not yet applied: theps -o lstart=fallback pins onlyLC_ALL=C.lstartrenders in the caller's zone, andfm_lock_holder_alive(bin/fm-wake-lib.sh:961) keys the generic mutex steal on string equality of this record, so a contender running under a differentTZthan the claimant (e.g. a Stop hook launched from a shell withTZexported vs a launchd-started watcher) reads a live holder as a reused pid and steals a held lock. Fix:TZ=UTC LC_ALL=C ps -p "$pid" -o lstart=on line 124 and say why beside the existing locale comment. (The pre-existingfm_pid_identityfallback at line 88 has the same exposure for the role predicates; that is outside this change's accepted scope but worth the same one-word pin if touched.)tests/fm-claude-stop-autoarm-live-e2e.test.sh:93- Accepted requirement not yet applied: the pre-wedge fixture fabricates the dead holder's start time withbash -c '... fm_pid_start_identity "$$"', where$$is single-quoted and so expands to the inner bash spawned milliseconds aftersleep 600 &.ps lstarthas one-second resolution on macOS, soWEDGE_STARTequalsWEDGE_LIVE_STARTon almost every run and the guard fails atwedge fixture start times did not divergebefore Claude is launched. Fix: pass the test script's own long-lived pid as an argument (bash -c '. "$1"; fm_pid_start_identity "$2"' _ "$ROOT/bin/fm-wake-lib.sh" "$$"), exactly as the portabletests/fm-claude-stop-autoarm.test.shwedge does viafm_test_pid_start_identity "$$"; do the same forWEDGE_IDENTITYon line 88 so both fabricated facts describe one dead holder.docs/turnend-guard.md:197- Accepted requirement not yet applied: the regression-coverage sentence still lists "repeated arms spending the same block budget, the spent-budget stand-down to the attended fail-open", which describes the pre-fix behavior. The tests actually pinned aretest_hook_claude_mode_spent_budget_stops_blocking_but_never_stops_arming(a spent budget stops the blocking but never the arming) andtest_hook_claude_mode_spent_budget_restores_the_cycle_before_alarming(a restorable cycle is restored rather than alarmed over); commit a1bca9a removed the stand-down. Fix: rewrite that parenthetical to name those two cases.🔧 Fix: derive guard confirm window, pin TZ, fix e2e wedge fixture
1 info still open:
bin/fm-wake-lib.sh:125- The TZ=UTC pin is correct and matches the accepted requirement, but nothing executesfm_pid_start_identityunder two different TZ values and asserts equal output, so a later refactor of this one-word pin would regress the mixed-TZ lock steal silently. If coverage is wanted, the behavioral shape is: same pid,TZ=UTCvsTZ=Asia/Tokyo, outputs must be string-equal on the ps fallback path. Not required by the intent; noted only so the gap is known.tests/fm-teardown.test.sh:2658- Pre-existing, host-specific:tests/fm-teardown.test.shcaseherdr-preflight-missing-adapterfails on this macOS host ("teardown continued without its required preflight") and aborts the suite; it fails identically on the base commit 869ae90 andbin/fm-teardown.sh's change is not involved (the remaining 93 cases, including every path-scoped landed-work case this branch adds, pass when run past it). The suite also requirestasks-axion PATH, which CI installs via npm and this host lacks. Remote CI owns this suite.tests/fm-wake-queue.test.sh:294- Pre-existing, host-specific flake:test_secondmate_foreign_queue_stall_tracks_progress_and_alerts_onceintests/fm-wake-queue.test.shfails when run inside the full suite on this host (passes 3/3 in isolation, fails identically on base 869ae90 in-suite). Unrelated to this change — it exercises fm-watch-checkpoint's secondmate stall detection with a faked clock, none of which the branch touches. Every other wake-queue case, including the two the ledger cites (bounded-wait handoff, unbounded unread lines), passes.tests/fm-watch-triage.test.sh:2890- Pre-existing, host-specific:test_paused_authoritative_working_preserves_wedge_timerintests/fm-watch-triage.test.shfails on this host in isolation and identically on base 869ae90; the branch does not modifybin/fm-watch.shorbin/fm-watch-triage.sh. The process-event fixture cases this branch does touch (test_procevent_*) pass 6/6.bin/fm-test-run.sh tests/fm-turnend-guard.test.sh tests/fm-watcher-lock.test.sh tests/fm-wake-queue.test.sh tests/fm-claude-stop-autoarm.test.sh tests/fm-guard-stale-banner.test.sh tests/fm-teardown.test.sh tests/fm-brief.test.sh tests/fm-task-delivery.test.sh tests/fm-watch-triage.test.sh(concurrent auto-scheduler; 6 of 9 green, see findings for the 3 host-specific failures)bin/fm-test-run.sh --jobs 1 tests/fm-teardown.test.sh tests/fm-wake-queue.test.sh tests/fm-turnend-guard.test.sh tests/fm-watcher-lock.test.shwithtasks-axion PATH — guard (92 cases incl. 2 new) and watcher-lock (36 cases incl. 1 new) passNew testtest_hook_claude_mode_last_resort_arm_default_confirm_matches_arm_window(7 s-slow watcher confirmed under the default window;FM_CLAUDE_GUARD_ARM_CONFIRM=5control gives up) — passes on HEAD, fails against the 0696837~1 guard scriptNew testtest_hook_claude_mode_last_resort_arm_default_confirm_widens_on_msys(12 s-slow watcher confirmed underOSTYPE=msys) — passesNew testtest_lock_keeps_live_holder_across_caller_timezonesin tests/fm-watcher-lock.test.sh — passes on HEAD, fails against the 0696837~1 lib (rc=0 held== stolen)Manual reprotz-mutex-steal-repro.sh: holder under TZ=Asia/Tokyo, contender under TZ=America/Los_Angeles — pre-fix lib STEALS from the live holder, fixed lib DEFERSManual reproe2e-wedge-fixture-repro.shx3: oldbash -c '... "$$"'form yields the samelstartsecond as the live wedge pid (divergence assertion fails); fixed outer-$$form diverges every runfm-teardown suite minus the two host-broken herdr-preflight cases: 93 pass, includingsquash-merged same-path different content still refuses,an intersection that cannot be computed refuses,a merged PR whose head could not be fetched is reported as uncomparedtest_enrichment_preserves_all_unread_lines_and_status_file_failuresrun on base extraction vs branch: base fails withgrep: out of memory, branch passes (confirms ledger entry 9)fm-watch-triage process-event cases (test_procevent_*, the fixture the change touched) in isolation: 6/6 passFM_HOME=<tmp> bin/fm-brief.sh media-nm-c1 some-proj --mode no-mistakesand--mode local-only: PR-media section present with?raw=trueblob URL and merge-death disclosure in no-mistakes, absent in local-onlyLedger spot checks:git ls-files | grep pr-mediaempty (demo screenshot dropped),git diff 869ae90..HEAD -- projects/emptyFailing cases re-run on agit archiveof base commit 869ae905: wake-queue foreign-stall, watch-triage wedge-timer, teardown herdr-preflight missing-adapter all fail identically on base