Repository navigation
Conversation
The 2026-07-05 workflow-paradigm cutover made the launchd poller (bin/fm-poll.sh, beacon state/.last-poller-beat) the live supervisor and retired the push-based watcher (bin/fm-watch.sh) to an escape hatch, but the supervision-health predicates still checked the watcher alone. With the poller up and healthy the turn-end guard fired "TURN WOULD END BLIND - SUPERVISION IS OFF" every turn, and fm-wake-drain.sh printed the same false alarm. Make the checks additive - watcher-healthy OR poller-healthy means supervised: - fm-supervision-lib.sh: fm_supervision_status now reads both beacons, adds FM_SUP_POLLER_FRESH and FM_SUP_SUPERVISED, and describes the freshest beacon in FM_SUP_BEACON_DESC; fm_supervision_unhealthy keys off FM_SUP_SUPERVISED. - fm-wake-lib.sh: new fm_poller_healthy mirrors fm_watcher_healthy against the poller's own liveness record (live pid on line 1 of state/.poll.pid, matching process identity on line 2, and a fresh state/.last-poller-beat). - fm-turnend-guard.sh: accept the turn when either supervisor is genuinely alive; the block banner and reason now name the poller as primary. - fm-guard.sh: the pull-based banner keys off supervision, not the watcher alone, so a live poller stays silent. The old watcher path is untouched and still works as the documented escape hatch, and the guard still fires when neither supervisor is live and work is in flight (a dead poller that only left a fresh beacon still blocks). Tests extend the predicate and hook coverage with poller cases, and the drain test asserts a fresh poller beacon silences the banner. docs/turnend-guard.md is updated to reality (poller primary, watcher hatch).
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.
What Changed
bin/fm-supervision-lib.shnow tracks both supervisor beacons (state/.last-poller-beatandstate/.last-watcher-beat) and reports a combinedFM_SUP_SUPERVISEDverdict: either beacon fresh within the grace window counts as supervised, sofm-guard.shandfm_supervision_unhealthyno longer false-alarm when only the launchd poller is up. The banner beacon description now names which supervisor beat and when (e.g. "poller 4s ago").bin/fm-turnend-guard.shshort-circuits on a genuinely healthy poller via a newfm_poller_healthyhelper inbin/fm-wake-lib.sh(pidfile pid alive plus fresh beacon) before falling back to the watcher lock check, so turns are no longer blocked when the poller alone is supervising. Banner and remediation text infm-guard.sh,fm-turnend-guard.sh, andfm-wake-drain.shnow points at both supervisors (verify the poller, or arm the watcher escape hatch).docs/architecture.md,docs/scripts.md,docs/configuration.md,docs/turnend-guard.md,CONTRIBUTING.md) and the guard/wake-queue/watcher-lock tests are updated to the poller-as-valid-supervision model, including new turnend-guard test coverage for the poller-healthy path. The full test suite passed in the pipeline run; the review left two informational notes (the pre-existing beacon-freshness grace tradeoff now extended to the poller, and duplicated.poll.pidparsing betweenfm-poll.shandfm_poller_healthy).Risk Assessment
✅ Low: A well-bounded, fail-closed extension of existing supervision checks whose new poller-health predicate exactly matches the poller's pidfile and beacon contract, with hermetic tests covering the fresh, stale, and dead-pid cases and no stale consumers of the renamed banner or status fields.
Testing
Completed 1 recorded test check.
Pipeline
Updates from git push no-mistakes
⏭️ **intent** - skipped
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-supervision-lib.sh:72- The pull-based fm-guard.sh path judges supervision by beacon freshness alone (fm_supervision_status), so a poller or watcher that died within the last FM_GUARD_GRACE seconds (default 300) reads as supervised and stays silent. This is the pre-existing watcher tradeoff extended to the poller, and the sharper liveness check in fm-turnend-guard.sh covers the end-of-turn case; noting it as an acknowledged design tradeoff, not a defect.bin/fm-wake-lib.sh:99- The .poll.pid parsing convention (pid via sed -n '1p', identity via sed -n '2,$p') is now duplicated between the poller's singleton guard in bin/fm-poll.sh and fm_poller_healthy in bin/fm-wake-lib.sh. Factoring a small shared read-pidfile helper would keep the two consumers from drifting if the pidfile format ever changes.✅ **Test** - passed
✅ No issues found.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"docs/turnend-guard.md:3- docs/turnend-guard.md cites 'AGENTS.md section 8' as the home of the 'no turn ends blind' discipline (lines 3 and 16), but the rewritten AGENTS.md's section 8 is now 'Restart and recovery' and no section states that discipline. Pre-existing at the base commit (paradigm rewrite), not caused by this change; re-pointing or rewording needs a decision about where that discipline lives in the new AGENTS.md.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.