Skip to content

fix: stop repeated stale-pane wakes from resetting the rearm resurface bound - #304

Merged
sKeLe100 merged 6 commits into
mainfrom
fm/watch-stale-resurface-loop
Nov 22, 2026
Merged

sKeLe100 merged 6 commits into
mainfrom
fm/watch-stale-resurface-loop

Conversation

@sKeLe100

@sKeLe100 sKeLe100 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Intent

Watcher fix: in this home, stale-pane wakes re-fire about every 10 seconds (wakes 301-306 on 2026-11-20). The rearm bound only trips on an unchanged queue, and each new stale wake changes the queue, so the bound never trips. Fix it so a repeated stale wake for the same pane or task is suppressed or counted toward the bound, and add a test. Keep it minimal and upstream-shaped.

What Changed

  • fm_rearm_resurface_decide in bin/fm-wake-lib.sh no longer fingerprints the raw queue bytes. It now checksums a normalized view in which a repeated stale wake for an already-queued key collapses to that key's first row. A pane that stays stale re-announces with a fresh epoch/sequence and idle-age payload. That used to change the fingerprint on every poll and keep the bound from tripping. A new stale key, any other wake, an acknowledgement, or a session restart still starts a fresh streak. An unreadable queue falls back to absent.
  • docs/watcher-continuity.md ("Resurface bound") and the function's header comment now describe the normalized fingerprint and the stale-wake collapse.
  • Added a regression case to tests/fm-watch-recovery-loop.test.sh. tests/fm-test-compute.test.sh gets a one-line change that isolates it from FM_PC02_HOSTNAME.

Risk Assessment

✅ Low: The change is a small, fail-open normalization of the resurface fingerprint that collapses repeated stale rows per key, backed by a behavioral regression test and an updated owning doc.

Testing

Baseline changed-tests passed. I ran the recovery-loop test against the real watcher scripts in a disposable state dir. It passes with the fix and fails against the base lib, so it reproduces the reported bug. Worktree is clean.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Repeated stale wake for same pane (fresh epoch/idle payload) increments resurface streak and escalates at the bound ✅ pass live tests/fm-watch-recovery-loop.test.sh test_repeated_stale_wake_counts_toward_bound: ok
Same test against pre-fix lib fails (streak reset to 1) ✅ pass live not ok - a repeated stale wake for the same pane reset the streak to 1
Unrelated new wake still resets streak and resumes ordinary delivery ✅ pass live same test, final stage ok

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

🔧 **Rebase** - 2 issues found → auto-fixed ✅
  • ⚠️ bin/fm-test-run.sh - merge conflict rebasing onto origin/main
  • ⚠️ docs/fm-test-portable-shards.md - merge conflict rebasing onto origin/main

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Repeated stale wake for same pane (fresh epoch/idle payload) increments resurface streak and escalates at the bound ✅ pass live tests/fm-watch-recovery-loop.test.sh test_repeated_stale_wake_counts_toward_bound: ok
Same test against pre-fix lib fails (streak reset to 1) ✅ pass live not ok - a repeated stale wake for the same pane reset the streak to 1
Unrelated new wake still resets streak and resumes ordinary delivery ✅ pass live same test, final stage ok
  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated --exclude-quarantined --pc02-if-idle
  • bash tests/fm-watch-recovery-loop.test.sh on the fix (all 5 pass)
  • same test with pre-fix bin/fm-wake-lib.sh (new test fails: streak reset to 1), then restored
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@sKeLe100
sKeLe100 force-pushed the fm/watch-stale-resurface-loop branch from 6c47e16 to 60b8118 Compare November 22, 2026 15:41
@sKeLe100 sKeLe100 changed the title fix(bin): suppress repeated stale wakes from resetting the rearm-resurface bound fix: stop repeated stale-pane wakes from resetting the rearm resurface bound Nov 22, 2026
@sKeLe100
sKeLe100 merged commit 0de7ff0 into main Nov 22, 2026
26 checks passed
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