fix(bin): recognize an afk-daemon-owned watcher in the turn-end guard - #2853
Open
pramendra wants to merge 3 commits into
Open
fix(bin): recognize an afk-daemon-owned watcher in the turn-end guard#2853pramendra wants to merge 3 commits into
pramendra wants to merge 3 commits into
Conversation
added 2 commits
August 23, 2026 18:23
…d guard bin/fm-supervise-daemon.sh tears its watcher down and relaunches it after every actionable wake and after a bounded crash-loop backoff, so state/.watch.lock is routinely and briefly dead or genuinely unheld between watcher generations while away mode is active, even though the daemon and its beacon stay healthy throughout. fm-turnend-guard.sh's strict fm_watcher_healthy check has no way to tell that benign hand-off apart from an abandoned watcher, so it hard-blocked the turn on healthy supervision. Add fm_afk_daemon_owns_supervision (bin/fm-wake-lib.sh), the daemon-managed analogue of the existing Pi extension exception: a live identity-matched away-mode daemon lock plus a fresh beacon now satisfies the guard in every harness mode. A genuinely dead daemon or a stale beacon still blocks.
…cher regression tests
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "chore: untrack accidentally committed .s..." | Re-trigger Greptile |
The pipeline's own review/document step re-created this tool-local directory and committed it. Same recurring nuisance already fixed independently on other branches tonight; apply the identical fix here so this PR does not ship an ephemeral run-scoped Serena project file.
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
Follow-up on the merged turn-end guard afk-daemon fix: untrack the .serena/ tool-local project config that the prior pipeline run's own review/document step accidentally re-created and committed (a recurring nuisance also being fixed independently on other branches tonight), and ignore .serena/ going forward so the PR does not ship an ephemeral run-scoped file.
What Changed
fm_afk_daemon_aliveandfm_afk_daemon_owns_supervisiontobin/fm-wake-lib.sh, treating a live, identity-matched away-mode sub-supervisor daemon lock (state/.supervise-daemon.lock) with a beacon fresh within grace as an alternate liveness proof, mirroring the existing Pi-extension hand-off tolerance.bin/fm-turnend-guard.sh: when the strict watcher lock/beacon check fails, the guard now also accepts daemon-owned supervision (in both--claudeand default mode) instead of false-alarming during the daemon's routine watcher teardown/relaunch gap.tests/fm-turnend-guard.test.shfor the daemon-owned allow case in both modes, plus negative controls for a dead daemon lock and a stale beacon, and documented the new exception indocs/turnend-guard.md..serena/tool-local project config (re-created by the pipeline's own review/document step) and added.serena/to.gitignoreso it isn't shipped again.Risk Assessment
✅ Low: The reviewed commit is a clean, narrowly-scoped chore: it untracks the two accidentally-committed .serena/ files and adds .serena/ to .gitignore, exactly matching the stated intent, with no functional code touched.
Testing
Ran the targeted turn-end guard suite (71/71 passing, covering the afk-daemon false-positive fix) and manually exercised git's real .gitignore consumer to confirm the .serena/ untrack-and-ignore follow-up works end-to-end (untracked, and a recreated .serena file is correctly ignored, not resurfaced as untracked). No issues found; worktree left clean.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-turnend-guard.test.sh— 71/71 ok, includes afk-daemon watcher regression cases (e.g. "a live afk daemon with a fresh beacon satisfies the guard", "a dead afk daemon lock does not satisfy the guard")git ls-files .serena— confirms no .serena/ paths are tracked after the untrack commitgit status --porcelainbefore/after recreating .serena/project.yml — confirms git silently ignores it (real-consumer test of the new .gitignore rule)git check-ignore -v .serena/project.yml— confirms the match comes from.gitignore:7:.serena/, the exact line added by the target commitgit status --porcelainpost-test — confirms no leftover artifacts from manual verification✅ **Document** - passed
✅ No issues found.
⏭️ **Lint** - skipped
Step was skipped.
✅ **Push** - passed
✅ No issues found.