Skip to content

fix(bin): retire stale records for reassigned pool slots - #5559

Closed
Arobotmaster wants to merge 4 commits into
kunchenguid:mainfrom
Arobotmaster:fm/fm-stale-slot-cleanup
Closed

Arobotmaster wants to merge 4 commits into
kunchenguid:mainfrom
Arobotmaster:fm/fm-stale-slot-cleanup

Conversation

@Arobotmaster

Copy link
Copy Markdown

Intent

清理已放弃的 Mirasim 工作,保住 First Mate 原版历史和非 Mirasim 的 Pi Fast 成果。已明确同意丢弃只属于 Mirasim 的未合并本地改动与演示文件;两条 Mirasim PR 已关闭。当前三项旧任务的副本记录冲突,导致安全清理被拒绝;修复这条安全清理路径,使旧任务可在确证归属后退出而不碰别的任务成果。

What Changed

  • Allow teardown to retire a stale task record when one same-home record and its slot-owner claim prove reassignment, provided the stale endpoint is confirmed dead.
  • Preserve the current owner's processes, worktree, metadata, and slot claim; ambiguous, cross-home, active, or unknown cases still refuse teardown.
  • Document the reconciliation rules and add endpoint-safety coverage for successful retirement and fail-closed cases.

Risk Assessment

⚠️ Medium: The destructive stale-record exception is narrowly source-guarded, but the user-requested live endpoint evidence remains unverified in this review.

Testing

The targeted teardown suite passed its applicable checks, with tmux-only checks skipped because tmux was unavailable. Five stale-slot scenarios passed in isolated Herdr 0.9.1 labs using real endpoints, real Pi registration, and throwaway pool slots. The two previously missing refusal paths preserved both endpoints, metadata, claims, dirty owner work, and Git state. Guarded teardown removed each lab and verified the default-session tripwire. This is a CLI change, so transcript artifacts provide the product-level evidence.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Refuse stale-record cleanup when its endpoint is still active, without changing either task ✅ pass live Artifact “Live active, confirmed-dead, and cross-home collision scenarios” records the nonzero refusal and preservation of both records, the owner claim, dirty file, owner pane, and live stale Pi pane…
Retire a confirmed-dead stale Mirasim record without touching the current Pi Fast owner ✅ pass live Artifact “Live active, confirmed-dead, and cross-home collision scenarios” shows only stale metadata removed while the owner metadata, claim, dirty work, and exact owner pane remained.
Treat the same task ID in another registered Firstmate home as a collision ✅ pass live Artifact “Live active, confirmed-dead, and cross-home collision scenarios” shows teardown refused and preserved both same-ID records, the child claim, dirty file, and endpoint.
Refuse cleanup when stale endpoint liveness is unknown ✅ pass live Artifact “Live unknown-liveness and current-owner refusal evidence” shows a real registered Pi endpoint classified unknown when the process table was unavailable, the exact refusal, and byte-identical…
Block the current slot owner until the stale duplicate is reconciled, then allow owner cleanup ✅ pass live Artifact “Live block, reconcile, and subsequent owner cleanup evidence” shows the owner first refused with all owner state intact, stale-only retirement succeeded, and the owner then returned its slot…
Evidence: Live active, confirmed-dead, and cross-home collision scenarios

Source: Live active, confirmed-dead, and cross-home collision scenarios

LAB fm-lab-stale-slot-clean-31845-469
SCENARIO active stale endpoint refuses without mutation
command: fm-teardown.sh stale-active --force
exit: 1
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  2 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-turnend-guard.ts -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: task stale-active's recorded worktree /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot.gBbspW/active/pool/1/project is also task current-owner's recorded worktree, and task stale-active's recorded endpoint is active or its liveness is unknown; only a confirmed-dead worker can be retired as a stale record. Nothing was changed - not even with --force.
Stop or reconcile task stale-active's worker first, then re-run teardown.
observable: both records, the owner claim, owner dirty file, owner pane, and live stale Pi pane remain
SCENARIO confirmed-dead stale record retires without touching current owner
command: fm-teardown.sh stale-mirasim --force
exit: 0
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  2 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-turnend-guard.ts -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
warning: task stale-mirasim's recorded worktree /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot.gBbspW/dead/pool/1/project was reassigned to task pi-fast-owner (home /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T//fm-live-stale-slot.gBbspW/dead/home), which claimed that pool slot after this record was written; that slot is no longer stale-mirasim's, so its processes, copy, and claim are left untouched and only stale-mirasim's own cleanup runs.
teardown stale-mirasim complete (window fm-lab-stale-slot-clean-31845-469:w2:p2; pool slot /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T//fm-live-stale-slot.gBbspW/dead/worktree left to task pi-fast-owner (home /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T//fm-live-stale-slot.gBbspW/dead/home), which it was reassigned to)
Backlog: stale-mirasim just finished (this home keeps no markdown backlog at /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot.gBbspW/dead/home/data/backlog.md). Update /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot.gBbspW/dead/home/data/backlog.md - move stale-mirasim to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
observable: stale metadata removed; owner metadata, claim, dirty file, and exact owner pane remain
SCENARIO same task id in another registered home remains a collision
command: fm-teardown.sh same-id --force
exit: 1
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-turnend-guard.ts -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: task same-id's recorded worktree /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot.gBbspW/cross-home/pool/1/project is also task same-id's recorded worktree.
Returning that pool slot would kill same-id's processes and reset its copy, so nothing was changed - not even with --force.
Reconcile whichever record is wrong (bin/fm-crew-state.sh same-id; bin/fm-crew-state.sh same-id), then re-run teardown.
observable: root and child same-id records, child claim, dirty file, and pane all remain
RESULT all live stale-slot scenarios passed; lab teardown follows via trap
Evidence: Live unknown-liveness and current-owner refusal evidence

Source: Live unknown-liveness and current-owner refusal evidence

SCENARIO unknown liveness: PASS
  live session: fm-lab-stale-slot-live-53297-26197 (herdr herdr 0.9.1)
  real stale endpoint: fm-lab-stale-slot-live-53297-26197:w1:p1; registered status=idle; suspended pid=54788
  product liveness verdict with unavailable process table: unknown
  teardown exit: 1
  refusal: ●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ●  WATCHER DOWN - SUPERVISION IS OFF ●  2 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s). ●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair. ●  This is a supervision warning only; the guarded operation WILL still run. ●  repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-turnend-guard.ts -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded. ●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ REFUSED: task stale-mirasim's recorded worktree /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-stale-slot-live.L0TbOg/pool/1/project is also task pi-fast-owner's recorded worktree, and task stale-mirasim's recorded endpoint is active or its liveness is unknown; only a confirmed-dead worker can be retired as a stale record. Nothing was changed - not even with --force. Stop or reconcile task stale-mirasim's worker first, then re-run teardown. 
  no harm: both panes and Pi pid present; task records, owner claim, sentinel, and git status byte-identical
SCENARIO current owner blocked: PASS
  real owner endpoint: fm-lab-stale-slot-live-53297-26197:w1:p2
  teardown exit: 1
  refusal: WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode. REFUSED: task pi-fast-owner's recorded worktree /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-stale-slot-live.L0TbOg/pool/1/project is also task stale-mirasim's recorded worktree. Returning that pool slot would kill stale-mirasim's processes and reset its copy, so nothing was changed - not even with --force. Reconcile whichever record is wrong (bin/fm-crew-state.sh pi-fast-owner; bin/fm-crew-state.sh stale-mirasim), then re-run teardown. 
  no harm: both panes and Pi pid present; task records, owner claim, sentinel, and git status byte-identical
LAB teardown: PASS; guarded helper verified the default-session tripwire unchanged
Evidence: Live block, reconcile, and subsequent owner cleanup evidence

Source: Live block, reconcile, and subsequent owner cleanup evidence

LAB fm-lab-stale-slot-missi-38247-29705
SCENARIO unknown endpoint liveness refuses without mutation
🌳 Setting up worktree...
🌳 Leased worktree at /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/unknown/treehouse-root/.treehouse/project-302bfc/1/project. Run 'treehouse return /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/unknown/treehouse-root/.treehouse/project-302bfc/1/project' to release it.
precondition: exact real endpoint normal-liveness=alive unreadable-process-info-liveness=unknown
command: FM_TEST_HERDR_PROCESS_INFO_UNREADABLE=1 fm-teardown.sh stale-unknown --force
exit: 1
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  2 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-turnend-guard.ts -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: task stale-unknown's recorded worktree /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/unknown/treehouse-root/.treehouse/project-302bfc/1/project is also task current-owner's recorded worktree, and task stale-unknown's recorded endpoint is active or its liveness is unknown; only a confirmed-dead worker can be retired as a stale record. Nothing was changed - not even with --force.
Stop or reconcile task stale-unknown's worker first, then re-run teardown.
observable: refusal preserved both records, owner claim, dirty file, owner pane, and exact live stale endpoint
SCENARIO current owner blocks until stale duplicate is reconciled
🌳 Setting up worktree...
🌳 Leased worktree at /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/treehouse-root/.treehouse/project-508b87/1/project. Run 'treehouse return /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/treehouse-root/.treehouse/project-508b87/1/project' to release it.
command: fm-teardown.sh pi-fast-owner --force (before reconciliation)
exit: 1
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  2 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair a missing or failed watcher cycle with the Pi tool fm_watch_arm_pi, or restart Pi with -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-turnend-guard.ts -e ~/.no-mistakes/worktrees/1d0ac733deef/01M3AA72HRK6AC7HY8QAE4S3SQ/.pi/extensions/fm-primary-pi-watch.ts if the extensions are not loaded.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: task pi-fast-owner's recorded worktree /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/treehouse-root/.treehouse/project-508b87/1/project is also task stale-mirasim's recorded worktree.
Returning that pool slot would kill stale-mirasim's processes and reset its copy, so nothing was changed - not even with --force.
Reconcile whichever record is wrong (bin/fm-crew-state.sh pi-fast-owner; bin/fm-crew-state.sh stale-mirasim), then re-run teardown.
observable: blocked owner retained both records, claim, dirty file, and exact live owner endpoint
command: fm-teardown.sh stale-mirasim --force (reconcile stale record)
exit: 0
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
warning: task stale-mirasim's recorded worktree /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/treehouse-root/.treehouse/project-508b87/1/project was reassigned to task pi-fast-owner (home /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T//fm-live-stale-slot-missing.Ij3def/reconcile/home), which claimed that pool slot after this record was written; that slot is no longer stale-mirasim's, so its processes, copy, and claim are left untouched and only stale-mirasim's own cleanup runs.
teardown stale-mirasim complete (window fm-lab-stale-slot-missi-38247-29705:w2:p2; pool slot /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/treehouse-root/.treehouse/project-508b87/1/project left to task pi-fast-owner (home /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T//fm-live-stale-slot-missing.Ij3def/reconcile/home), which it was reassigned to)
Backlog: stale-mirasim just finished (this home keeps no markdown backlog at /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/home/data/backlog.md). Update /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/home/data/backlog.md - move stale-mirasim to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
observable: stale retirement removed only stale metadata; owner record, claim, dirty file, and exact endpoint remain
command: fm-teardown.sh pi-fast-owner --force (after reconciliation)
exit: 0
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
teardown: reaping leaked worktree process(es) for pi-fast-owner: 43614 43655
teardown: force-killing leaked worktree process(es) for pi-fast-owner: 43614
🌳 Worktree returned to pool.
teardown pi-fast-owner complete (window fm-lab-stale-slot-missi-38247-29705:w2:p1, worktree /var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/treehouse-root/.treehouse/project-508b87/1/project)
Backlog: pi-fast-owner just finished (this home keeps no markdown backlog at /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/home/data/backlog.md). Update /private/var/folders/1d/x0xnwzls1ll7fn7pp48vq52w0000gn/T/fm-live-stale-slot-missing.Ij3def/reconcile/home/data/backlog.md - move pi-fast-owner to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
observable: reconciled owner cleanup removed its metadata, exact endpoint, and spent slot claim
RESULT both previously missing live scenarios passed; lab teardown follows via trap
LAB teardown: PASS; fm-lab-stale-slot-missi-38247-29705 is absent and the default session remains running as default
Evidence: Targeted teardown regression output

Source: Targeted teardown regression output

ok - fm-teardown: missing, empty, malformed, ambiguous, and task-mismatched endpoints refuse before every mutation or runtime call
ok - fm-teardown: a concurrent lifecycle action refuses before mutation
ok - fm-teardown: non-pool cleanup ignores unrelated task publication locks
ok - fm-teardown: destructive cleanup serializes with metadata writers
ok - cleanup identity: valid tmux, Herdr, Zellij, Orca, and cmux records validate while every empty backend target refuses
ok - cleanup identity: an Orca record's real composite worktree id validates while a separatorless or newline-carrying id refuses
ok - tmux backend: direct empty target returns nonzero without invoking tmux
ok - process cleanup: creation-time PID identity removes only the exact child and preserves the control child
skip - tmux not installed
skip - tmux not installed
skip - tmux not installed
skip - tmux not installed
skip - tmux not installed
ok - fm-teardown: an Orca close its missing CLI never attempted refuses even under --force, keeping the record naming the terminal
skip - tmux not installed
ok - Treehouse locking resolves a bare local origin against its source project, matching the provisioned clone
ok - fm-teardown: a pool slot named by a second task record is never returned, killed, or reset
ok - fm-teardown: cross-home slot records remain distinct even when task ids match
ok - fm-teardown: a task that solely holds its slot still returns it
ok - fm-teardown: a pool slot claimed by another task is left alone while the task's own cleanup finishes
ok - fm-teardown: a task's own slot claim, and an unclaimed slot, both still tear down
ok - fm-teardown: stale record in a slot collision retires without touching owner and owner returns slot after
ok - fm-teardown: current slot owner refuses teardown until stale collision record is reconciled
ok - fm-teardown: unproved claims, owners, and endpoint liveness refuse without mutation
ok - fm-teardown: an exact recorded endpoint still tears down after changing cwd outside its worktree
ok - Treehouse project locking anchors at the local root for main-home, local-secondmate, and remote-seeded layouts
ok - fm-teardown: a remote-seeded secondmate home returns its own uncontested pool slot
ok - fm-teardown: slot ownership across a remote-seeded home and its local child still refuses
ok - Treehouse project locking still serializes two homes across the remote-seeded boundary
Evidence: Real Herdr agent lifecycle regression output

Source: Real Herdr agent lifecycle regression output

ok - agent get distinguishes leftover-shell (dead/no-agent) from live idle Pi
ok - pane get agent_status lag cannot keep an exited occupant classified alive
- Outcome: 🔧 1 issue found → no changes applied ✅ across 3 runs (23m4s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 warning

✅ No issues found.

  • ⚠️ recorded fix decision 01M3AAR7PMMKYQSEQSP9KDQCK5/test-1 (test round 1): unverified: The tree adds fixture coverage for stale-owner blocking and unknown liveness at tests/fm-teardown-endpoint-safety.test.sh:1129 and :1193, but this review did not run tests, and the source does not provide captured evidence from an isolated real endpoint as required by the decision.
🔧 **Test** - 1 issue found → no changes applied ✅
  • ⚠️ live validation verdict: inconclusive (3 of 5 scenarios were driven live against the product); untested: Refuse cleanup when stale endpoint liveness is unknown, Block the current slot owner until the stale duplicate record is reconciled
  • Live validation: ⚠️ inconclusive - 3 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Retire a confirmed-dead stale Mirasim record while preserving the Pi Fast task that now owns the slot ✅ pass live Live stale-slot cleanup transcript: stale-mirasim metadata disappeared while the owner's metadata, slot claim, dirty file, and exact Herdr pane remained.
Refuse stale-record cleanup while its recorded endpoint is a live Pi agent ✅ pass live Live stale-slot cleanup transcript: fm-teardown.sh stale-active --force refused and both records, the claim, dirty work, and both Herdr panes remained.
Refuse cleanup when stale endpoint liveness is unknown ⏸️ untested no The prior payload cited only a shell regression test and explicitly marked this scenario live=false; it did not establish the result against a real running endpoint with unknown liveness. A live produ…
Treat an equal task ID in another registered Firstmate home as a real collision ✅ pass live Live stale-slot cleanup transcript: cross-home same-id teardown refused while both metadata files, the child-home claim, dirty file, and Herdr pane remained.
Block the current slot owner until the stale duplicate record is reconciled ⏸️ untested no The prior payload cited only the targeted teardown regression transcript and explicitly marked this scenario live=false; it did not establish the reconciliation sequence against the real running produ…
  • bash tests/fm-teardown-endpoint-safety.test.sh
  • bash tests/fm-backend-herdr-agent-exit-shell-e2e.test.sh
  • ROOT="$PWD" EVIDENCE=~/.no-mistakes/evidence/01M3AA72HRK6AC7HY8QAE4S3SQ bash ~/.no-mistakes/evidence/01M3AA72HRK6AC7HY8QAE4S3SQ/live-stale-slot-cleanup.sh
  • bin/fm-herdr-lab.sh run fm-lab-audit session list --json to confirm the test labs were removed
  • git status --short && git diff --check to confirm testing left the worktree clean

🔧 No changes applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Force cleanup of a duplicate stale record whose real Herdr endpoint liveness is unknown; teardown refuses and leaves both tasks and the slot untouched ✅ pass live Live Herdr refusal and no-harm transcript: the real registered Pi endpoint classified unknown, teardown exited 1 with the explicit liveness refusal, and both panes, the Pi process, metadata, claim,…
Force cleanup as the current slot owner while the stale duplicate remains; teardown names the collision and refuses without mutation ✅ pass live Live Herdr refusal and no-harm transcript: the real owner endpoint teardown exited 1, named stale-mirasim, stated that nothing changed even with --force, and preserved both endpoints, metadata, cl…
  • tests/fm-teardown-endpoint-safety.test.sh
  • ~/.no-mistakes/evidence/01M3AA72HRK6AC7HY8QAE4S3SQ/live-herdr-stale-slot-validation.sh 2>&1 | tee ~/.no-mistakes/evidence/01M3AA72HRK6AC7HY8QAE4S3SQ/live-herdr-stale-slot-validation.log
  • Post-lab checks confirmed the suspended Pi process and temporary slot fixture were removed, and git status --short remained clean.

✅ No issues found.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Refuse stale-record cleanup when its endpoint is still active, without changing either task ✅ pass live Artifact “Live active, confirmed-dead, and cross-home collision scenarios” records the nonzero refusal and preservation of both records, the owner claim, dirty file, owner pane, and live stale Pi pane…
Retire a confirmed-dead stale Mirasim record without touching the current Pi Fast owner ✅ pass live Artifact “Live active, confirmed-dead, and cross-home collision scenarios” shows only stale metadata removed while the owner metadata, claim, dirty work, and exact owner pane remained.
Treat the same task ID in another registered Firstmate home as a collision ✅ pass live Artifact “Live active, confirmed-dead, and cross-home collision scenarios” shows teardown refused and preserved both same-ID records, the child claim, dirty file, and endpoint.
Refuse cleanup when stale endpoint liveness is unknown ✅ pass live Artifact “Live unknown-liveness and current-owner refusal evidence” shows a real registered Pi endpoint classified unknown when the process table was unavailable, the exact refusal, and byte-identical…
Block the current slot owner until the stale duplicate is reconciled, then allow owner cleanup ✅ pass live Artifact “Live block, reconcile, and subsequent owner cleanup evidence” shows the owner first refused with all owner state intact, stale-only retirement succeeded, and the owner then returned its slot…
  • tests/fm-teardown-endpoint-safety.test.sh
  • tests/fm-backend-herdr-agent-exit-shell-e2e.test.sh
  • ROOT="$PWD" EVIDENCE="~/.no-mistakes/evidence/01M3AA72HRK6AC7HY8QAE4S3SQ" bash .../live-stale-slot-cleanup.sh
  • ROOT="$PWD" EVIDENCE="~/.no-mistakes/evidence/01M3AA72HRK6AC7HY8QAE4S3SQ" bash .../live-stale-slot-missing-scenarios.sh
  • bash .../live-herdr-stale-slot-validation.sh
  • Confirmed the named lab session was deleted and the default Herdr session remained running and unchanged.
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

@zachlandes zachlandes mentioned this pull request Oct 12, 2026
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