Skip to content

fix: preserve watcher check wakes#62

Closed
tommy230 wants to merge 3 commits into
kunchenguid:mainfrom
tommy230:fix/watcher-check-wake-lossless
Closed

fix: preserve watcher check wakes#62
tommy230 wants to merge 3 commits into
kunchenguid:mainfrom
tommy230:fix/watcher-check-wake-lossless

Conversation

@tommy230

@tommy230 tommy230 commented Jun 24, 2026

Copy link
Copy Markdown

What

Reworked replacement for #52, rebased onto current main.

This makes watcher PR/check wakes lossless by moving repeated-output suppression into fm-watch.sh: check output is written to the durable wake queue before the watcher advances its .seen-check-* marker.

Why

state/*.check.sh was the remaining wake source whose suppression could happen inside an opaque check script. A legacy edge-triggered check could advance its own .babysit-*.seen marker before its stdout became a delivered watcher wake; if that stdout was lost by a timeout, crash, or concurrent watcher run, the terminal transition could be swallowed permanently.

That violates the durable wake invariant used by status and stale-pane signals: enqueue first, suppress second.

Changes

  • Adds watcher-owned dedupe for stateless check output via .seen-check-*.
  • Enqueues check wakes before advancing the dedupe marker.
  • Keeps a catch-all for legacy .babysit-*.seen sidecars that already self-suppressed a terminal MERGED or CLOSED state.
  • Marks matching legacy sidecars as already escalated when a normal check wake is delivered, avoiding duplicate catch-all wakes.
  • Cleans check-related watcher state during teardown.
  • Updates the PR-check contract docs and adds focused regression coverage.

Validation

  • tests/fm-wake-queue.test.sh - passed
  • tests/fm-teardown.test.sh - passed
  • for test_script in tests/*.test.sh; do "$test_script"; done - passed
  • bash -n bin/*.sh tests/*.sh - passed
  • shellcheck -x bin/*.sh tests/*.sh - passed
  • no-mistakes run 01KVWAJEV4K1D91FS6J8Q400ZX - checks-passed

The no-mistakes review found and fixed one issue in this branch before final validation: the legacy catch-all could duplicate a check wake after a normal check output had already delivered. The final branch includes that fix.

GitHub currently reports no status checks configured for this fork PR, so the validation evidence is the local/no-mistakes run above.

@tommy230 tommy230 closed this Jun 24, 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