Repository navigation
fix: preserve remote job quarantine during repeated shutdown - #53
Merged
levelupself merged 4 commits intoAug 14, 2026
Merged
Conversation
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
Make the remote-job worker quarantine publication survive a second TERM during worker replacement. Preserve the diagnosed race as a deterministic behavioral regression in tests/fm-remote-job.test.sh that fails before the fix and passes after it on the same machine: the second TERM must land after mktemp creates worker.lock/.quarantine.* and before rename to worker.lock/quarantine, without changing test timing, adding retries, or inserting sleeps. Fix only bin/fm-remote-job-lib.sh, bin/fm-remote-job-worker.sh, and the existing remote-job behavior test; do not touch task 212 spawn-recovery implementation because it is disconfirmed as causal, and do not conflate watcher-extension work. Choose direction A so quarantine publication survives any repeat shutdown signal instead of merely removing the supervisors redundant TERM source, and safely recover a pre-existing regular bounded orphaned .quarantine.* from an already damaged lock by promoting it to fail-closed canonical quarantine before ownership cleanup. Verify tests/fm-remote-job.test.sh serially and under concurrent load, run repository lint, and provide full-suite evidence. Pipeline-authored risk rationales, fix summaries, and PR bodies must use role-neutral prose with no second person and no captain, user, firstmate, or crewmate role nouns; this constraint does not apply to product code, prompts, or user-facing copy.
What Changed
.quarantine.*files to canonical fail-closed quarantine before stale lock cleanup.TERMduring quarantine publication and interrupted-publication recovery.Risk Assessment
✅ Low: The change is narrowly scoped and preserves fail-closed worker ownership across repeated shutdown signals and interrupted quarantine publication without exposing a substantiated unsafe sibling path.
Testing
The targeted remote-job test passed serially and under three-way concurrent load; a same-machine pre-fix counterfactual reproduced the quarantine-loss failure, while the fixed runs demonstrated canonical quarantine publication, replacement refusal, orphan recovery, and eventual safe cleanup. An initial pre-fix attempt encountered a transient startup failure, and an immediate isolated retry reached and reproduced the intended regression. Repository lint and full-suite validation were not run because this assigned test phase explicitly forbids lint and broad-suite execution.
Evidence: Serial end-to-end behavior transcript
Evidence: Pre-fix deterministic regression transcript
Evidence: Concurrent run 1 transcript
Evidence: Concurrent run 2 transcript
Evidence: Concurrent run 3 transcript
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.
git diff db7a847e0e3428b8bd34b046199be5ba380f678f..158fa396e10cd0da139a8d889841e171114a0751 -- bin/fm-remote-job-lib.sh bin/fm-remote-job-worker.sh tests/fm-remote-job.test.shbash tests/fm-remote-job.test.sh 2>&1 | tee /tmp/no-mistakes-evidence/01KZZNY93ZPT64T2FMQKG1QCYD/fm-remote-job-serial.logThree simultaneous invocations ofbash tests/fm-remote-job.test.sh, recorded asfm-remote-job-concurrent-{1,2,3}.logApplied the implementation diff in reverse while retaining the new behavioral test, then rantimeout 90 bash tests/fm-remote-job.test.sh; it failed at the quarantine assertion as expectedgit status --short && git diff --exit-code -- bin/fm-remote-job-lib.sh bin/fm-remote-job-worker.sh tests/fm-remote-job.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.