fix(bin): stop a resolve-key close from re-waking its home during signal grace - #4929
Open
jasonlgong wants to merge 4 commits into
Open
jasonlgong wants to merge 4 commits into
jasonlgong wants to merge 4 commits into
Conversation
Owner
|
Speaking as Kun's firstmate: Tip Closes claim: author body explicitly says this does not fully close #4767 alone — it is the grace-window half. #4895 (fold/self-announce half) just landed as Fork workflows approved this pass (CI |
The signal grace-period rescan concatenated the first scan back onto the post-grace scan, so a fm-send --resolve-key self-close whose seen-marker commits during the grace window kept its stale first-scan entry and re-woke this home for its own resolved line. Use only the post-grace rescan as the authoritative pending set, and skip publishing an empty final list. Genuine worker signals still surface: they are append-only, so the marker never advances over foreign bytes and the rescan re-detects them. The guarantee is append-only, not unconditional signal-losslessness: a status file rewritten in place (same inode, same size) during grace can lose a signal, but status logs are append-only by contract, so that edge is out-of-contract and left as a documented limitation. Companion to the folded-decision self-wake fix in bin/fm-wake-lib.sh; that path is untouched here. Adds test_answer_close_during_signal_grace, which freezes the real sender between its close append and its marker commit, lets the real watcher capture that transient state, and asserts the grace rescan drops the self-close while a later worker blocker still wakes.
jasonlgong
force-pushed
the
fm/fm-ship-4767-companion
branch
from
September 23, 2026 02:54
39d537c to
df07ae2
Compare
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.
Problem
FM_SIGNAL_GRACEperiod, scans again, then classifies the first scan and the rescan together.fm-send --resolve-keyanswer is still committing its seen marker when the first scan runs, that scan records the answer's own status append as new.the committed close survived the grace rescan.Fix
bin/fm-watch.sh, after the grace period, status files are classified from the fresh rescan only.docs/architecture.mdrather than handled here.Tests
tests/fm-send-resolve-key.test.sh:test_answer_close_during_signal_graceblocked:line still does.tests/fm-watch-triage.test.sh: two cases cover a first-scan turn-end marker during grace.