fix: prevent stale supervision wake loops - #108
Merged
Merged
Conversation
Port upstream kunchenguid#3672 stale acknowledgement protections to the OMP branch and carry the missing parked-worker cadence into the bash watcher. Add regression coverage for stale acknowledgements, OMP task scoping, and parked-worker wake bounds.
…gression entry points
dnth
force-pushed
the
fm/port-3672-stale-supervision-wake-loops
branch
from
September 5, 2026 11:52
ce6135c to
6f2a0e7
Compare
dnth
force-pushed
the
fm/port-3672-stale-supervision-wake-loops
branch
from
September 5, 2026 12:01
6f2a0e7 to
4bd7c32
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.
Intent
Port upstream firstmate PR kunchenguid#3672 (fix: prevent stale supervision wake loops, merged as f4d7875 on upstream/main) into dnth/firstmate. Diff upstream against this fork current code and port only genuinely missing parts, reconciling fork-native supervision work including watcher-continuity PR #99 and kunchenguid#3532 if present; do not blindly re-apply upstream. Adapt any Pi-extension-specific changes to this fork's bash + OMP supervision structure (.omp/extensions and bin/fm-supervise-daemon.sh), omitting non-applicable Pi pieces. Prevent repeated stale supervision wake re-firing for parked declared waits or unchanged status and prevent stale acknowledgement loops. Add a colocated behavioral regression test in tests/ that fails without the fix and passes with it, through executable/public interfaces rather than source-byte assertions. Preserve existing supervision tests and wake handling/declared-pause behavior, keep every touched bin script shellcheck-clean, and include a short reconciliation of upstream changes, already-present fork behavior, newly ported behavior, and deliberate adaptations/omissions in docs or the PR description. Deliver a no-mistakes PR against main without merging it; hold for captain merge approval. Firstmate-Validation-Generation: 85e43d6d42e5ead5be9063eaff21d9e5
What Changed
Risk Assessment
✅ Low: The port is internally consistent with the stated intent: stale live-wait panes are declaration-throttled, acknowledgements remain actor-scoped and generation-aware, and the added regression tests exercise executable behavior without source-byte assertions.
Testing
Ran the focused watcher triage, durable wake queue, and OMP supervision behavioral suites. They exercised stale wake suppression/resurfacing, declared-wait and AFK handling, enqueue-before-suppressor ordering, acknowledgement replay safety, and branch/main ownership boundaries; all completed successfully. No UI surface is involved, so screenshot evidence was not applicable.
Evidence: Focused watcher behavior evidence
Evidence: Wake queue safety evidence
Evidence: OMP supervision evidence
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
docs/architecture.md:30- The new architecture text documents an opt-inconfig/turnend-churn-absorbmode andFM_TURNEND_CHURN_ABSORB_SECSbounded behavior, but neither the flag nor the environment variable is implemented anywhere in the changed source (or repository). Users enabling the documented option will see no effect; either remove this unsupported reconciliation text or authorize porting the missing implementation.🔧 Fix: Removed unsupported churn docs and recorded future port
1 info still open:
docs/configuration.md:707-FM_STALE_ESCALATE_SECSis documented twice indocs/configuration.md; remove the duplicate entry to avoid ambiguous configuration guidance.✅ No issues found.
🔧 **Test** - 1 issue found → auto-fixed ✅
docs/configuration.md:707- docs/configuration.md defines FM_STALE_ESCALATE_SECS twice (lines 703 and 707), creating contradictory duplicate configuration documentation.bash tests/fm-omp-branch-supervision.test.shbash tests/fm-wake-queue.test.shbash tests/fm-watch-triage.test.sh(targeted watcher triage cases exercised)bash tests/fm-watch-recovery-loop.test.sh🔧 Fix: Removed duplicate stale escalation configuration documentation
✅ Re-checked - no issues remain.
bash tests/fm-watch-triage.test.shbash tests/fm-wake-queue.test.shbash tests/fm-omp-branch-supervision.test.shCheckedgit status --short --untracked-files=alland confirmed no transient test artifacts were left in the worktree.✅ No issues found.
bash tests/fm-watch-triage.test.shbash tests/fm-wake-queue.test.shbash tests/fm-omp-branch-supervision.test.shgit status --short(confirmed no transient worktree artifacts)✅ **Document** - passed
✅ No issues found.
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.