fix(bin): allow guarded teardown of endpoint-less tmux husk records - #7
Merged
Merged
Conversation
…nt absence proof Terminal ship/scout records with no window= target could not be cleaned up even when work was fully landed, because endpoint validation ran before force and land checks. Open a guarded husk path only for exact tmux husk shape, only after protocol-level proof that no live tmux server remains for this uid (plus add-only name secondary), and never skip land/scout gates under --force for husks.
…-bounded probe runner
…configuration doc
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Live serial shard walls are commonly 8-14 minutes; the 15-minute cap left almost no margin once a new husk regression script rebalanced shard 3 over the limit. Keep the job as a hang tripwire, not the expected healthy end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Close the teardown tool gap for endpoint-less terminal task records ("husks") without weakening unlanded-work protection.
Defect: bin/fm-teardown.sh refuses endpoint-less TERMINAL task records even with --force, because the missing/ambiguous-window endpoint check runs BEFORE force's check-skipping. Result: a husk record whose work is fully landed/remote-preserved has NO guarded cleanup path at all.
Required shape: Add a guarded husk path: teardown of an endpoint-less record is allowed ONLY when the landed-work test passes. The unlanded-work protection must not weaken in any other case. fm-teardown.sh owns the complete landed-work test; preserve the positive-landing-proof requirement from commit 6c6a22f (never bypass it for husks). --force semantics for records WITH endpoints must be unchanged. MINIMAL fix: bias to subtraction and the smallest guarded opening.
v7 approach (panel-passed under captain ruling A): name-independent proof that no live tmux server remains for this uid — protocol probe of connectable uid unix sockets (tmux -S display-message #{pid}), plus add-only pgrep -x tmux secondary that may only enlarge the refuse set. Process name never authorizes absence. Husk only for exact ship/scout tmux meta shape (zero window=, exact endpoint_task_id, worktree, project, backend absent-or-tmux). Husk teardowns still require land/scout gates under --force. Refuse husk absence proof when no hard-bounded probe runner (gtimeout/timeout/perl) exists. Colocated regression tests under tests/fm-teardown-husk.test.sh.
Follow-up required for green CI: portable-serial shard 3 timed out twice at the 15-minute hang tripwire after the new husk script rebalanced that shard; raise the portable-serial hang tripwire to 20 minutes so live 8-14 minute shard walls keep margin (hang tripwire, not expected healthy end).
Hard boundaries: PR target = origin fork (jokim1/firstmate) ONLY; never upstream (kunchenguid/firstmate). Never run real teardown against live home records.
What Changed
bin/fm-teardown.shnow permits teardown of endpoint-less TERMINAL task records ("husks") that previously had no cleanup path: the missing/ambiguous-endpoint refusal is skipped only for records matching the exact ship/scout tmux meta shape (zerowindow=, exactendpoint_task_id, worktree, project, tmux-or-absent backend), and only after a name-independent proof that no live tmux server remains for the uid — a protocol probe of connectable uid unix sockets plus an add-onlypgrep -x tmuxpass that can only enlarge the refuse set. Land/scout gates still run under--force, the positive-landing-proof requirement is preserved, and the absence proof is refused when no hard-bounded probe runner (gtimeout/timeout/perl) is available.tests/fm-teardown-husk.test.shcovering the husk teardown path, including live real-tmux server refusal and renamed-binary protocol proof..github/workflows/ci.yml(the new husk script rebalanced shard 3), and noted the endpoint-less husk teardown exception indocs/configuration.md.Risk Assessment
✅ Low: The change adds a tightly-shaped, conservative husk teardown path guarded by a name-independent absence proof and the preserved positive-landing gate, with all non-husk semantics provably identical and colocated regression tests; it fully satisfies the authoritative intent.
Testing
Ran the new colocated husk regression suite (7/7, exercising real tmux servers for the live-server and renamed-binary absence proofs) plus the two sibling teardown suites (endpoint-safety 7/7, full teardown 73/73) with zero failures, confirming the guarded husk opening and that unlanded-work protection and endpoint-bearing --force semantics are unchanged. I also drove the real fm-teardown.sh end-to-end as an operator and captured a CLI transcript showing a landed husk torn down, an unlanded husk refused under --force with commits preserved, and a landed husk refused while a live tmux server answers. This is a shell CLI change with no rendered UI surface, so the operator CLI transcript is the appropriate product-level artifact rather than a screenshot.
Evidence: fm-teardown husk end-to-end CLI transcript (allow landed / refuse unlanded --force / refuse live-server)
SCENARIO 1 — landed husk: teardown husk-landed complete ... exit=0, meta REMOVED SCENARIO 2 — husk --force with unlanded commit: REFUSED: worktree ... has work not on any remote and not landed. unpushed commits: 2a0d140 unlanded ... exit=1, meta STILL PRESENT SCENARIO 3 — landed husk with live tmux server --force: REFUSED: husk husk-live: live tmux server(s) present; endpoint absence not positively proven. exit=1, meta STILL PRESENTEvidence: Evidence driver script (drives real bin/fm-teardown.sh)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-teardown-husk.test.sh— 7/7 pass, including live real-tmux server refusal and X6 renamed-binary protocol proofbash tests/fm-teardown-endpoint-safety.test.sh— 7/7 pass (endpoint validation unchanged)bash tests/fm-teardown.test.sh— 73/73 pass (no regression in dirty/land/lock-recovery gates)End-to-end: ran realbin/fm-teardown.shagainst husk fixtures via evidence driver — landed husk ALLOWED (exit 0, record removed); unlanded husk--forceREFUSED (unpushed commits preserved, meta kept); landed husk with live tmux server--forceREFUSED via absence proofReviewed CI hang-tripwire raise 15→20 min in .github/workflows/ci.yml and the husk-exception note in docs/configuration.md✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.