Repository navigation
fix(watch): surface paused waits superseded by gates or terminal runs - #8014
Conversation
[Low impact] The PR appears safe to merge; the previous away-mode issue is fixed. Reviews (9) · Last reviewed commit: "fix(watch): skip the superseded-wait che..." · Reviewed by Greptile |
… before the busy-turn age gate, and reused captured crew state for gate classification. Added real busy-pane coverage for recent and old turns. Shell syntax, the targeted test, and `git diff --check` pass
|
Speaking as Kun's firstmate: thank you @Dematom1, and thanks for the detailed incident timeline. It makes the gap easy to see. On head Waiting on you for one thing: live validation on this head is inconclusive (0 of 4 scenarios driven live). When you have a moment, could you run it once against a real watcher? For example, a real worker that declares a paused wait while its no-mistakes run parks on an Contract-class (my own read): new-default. The default watcher gains a new wake reason that fires ahead of the existing |
|
Live validation was not completed: 0/4 scenarios were driven. I provisioned the isolated lab home and Herdr session, but did not establish the real worker or the throwaway sandbox repository with a parked no-mistakes ask-user run, so there is no watcher wake or cadence evidence to report. I updated the validation rows to mark them untested and preserved the brief, Updates line, and pipeline attestation. Please run the live scenario when a worker and parked run are available. |
|
Live validation update for #8014: I drove the real watcher from this PR against a private tmux server and stub worker pane. The genuine captured no-mistakes ask-user gate produced one idle-path wake and one busy-path wake; neither repeated during the following 15 seconds under a 20-second accelerated pause cadence. A terminal-run fixture also produced one wake with no repeat, and the working-run control produced none. The gate and terminal data used the repository\x27s established genuine no-mistakes capture rather than a newly started live run. I updated the four validation rows with the command and captured evidence. The required |
Gate paused_wait_superseded behind the home-local config/paused-wait-supersession presence flag and move its crew-state read inside the gate, so a home without the flag keeps main's declared-wait cadence, wording, and crew-state reads.
…ent, preserving distinct throttles when PR suffixes follow; added coverage for two terminal PR-bearing runs. Documented foreground-only scope and unchanged away-mode cadence in both requested locations. `FM_LIVE=0 bash tests/fm-watch-triage-pause.test.sh` passed the new and opt-in cases, then timed out after 8/31 tests (300s)
|
Speaking as Kun's firstmate: thank you @Dematom1. I read head Contract-class (my own read): opt-in. That replaces my Oct 31 new-default read, which was on a head before the flag existed. VISION: aligns rule by rule. A declared wait no longer hides a human-owed gate or a finished run, the feature is off unless the home opts in, and the predicates and throttle are exact. I've queued the full suite with the |
# Conflicts: # bin/fm-watch.sh # docs/configuration.md
paused_wait_superseded returned only on the absent opt-in flag, so its busy-path and secondmate callers still read crew state and could queue a superseded wake while the away-mode flag existed, contrary to the documented foreground-only scope. Return before any read while afk_present.
|
Speaking as Kun's firstmate: this is merged. Thank you @Dematom1 — really appreciate you taking the time on this. |
Intent
Surface paused waits that hide an unreported human-owed gate or terminal run, while suppressing repeat alerts for the same declaration and run.
What Changed
Risk Assessment
Testing
At 20:05, a captain question was recorded as paused. At 20:11:59, a validation wait through 20:19 was declared, but its due recheck at 20:19:47 did not surface the task. From 20:22:29 to 00:19:27, 757 stale observations were absorbed while the validation run was parked on a human-owed finding before 20:38. The long-cadence wake arrived at 00:19:45; the supervisor surfaced the finding at 00:20:14; needs-decision was recorded at 00:20:41 and resolved at 00:21:17. A related approval reported at 20:37:38 had been waiting since about 20:00. The change surfaces an unreported human-owed gate or terminal run and suppresses repeats for the same declaration and run.
FM_LIVE=0tests/fm-watch-triage-pause.test.shsuite passed after the busy-repeat fix. No live/Lavish tests were run, as required.Full suitecheck failed at the maintainer-controlledfull-cilabel prerequisite (FM_CI_FULL=false), so no full test lane ran; this expected exception was approved.PR must be raised via no-mistakespassed.Live validation
live-watcher.sh(private tmux socket; realbin/fm-watch.sh; idle worker pane; captured no-mistakes parked ask-user fixture;FM_PAUSE_RESURFACE_SECS=20). Captured:23:54:22Z stale: live:fm-fm-8014-live-e2e (paused wait superseded: run 01M20NDQH0G96AQYH1EHWGKT5F is parked at a human-owed gate with no open decision); the next 15 seconds produced no repeat.live-watcher.sh(private tmux socket; real watcher; terminal-run fixture; idle worker pane). Captured:23:54:57Z stale: live:fm-fm-8014-live-e2e (paused wait superseded: current run 01M20NDQH0G96AQYH1EHWGKT5F is terminal (done)); the next 15 seconds produced no repeat.live-watcher.sh(private tmux socket; real watcher; idle worker pane; captured parked ask-user fixture). Captured one gate-superseded wake at23:54:22Z; no repeat in the following 15 seconds.live-watcher.sh(private tmux socket; real watcher; busy worker pane runningsleep; captured parked ask-user fixture). Captured one gate-superseded wake at23:54:41Z; no repeat in the following 15 seconds.Opt-in
This change is opt-in. It is off by default; enable it per home with
touch config/paused-wait-supersession(home-local, not inherited by second mates). The superseded-pause check (a declared pause hiding a human-owed gate or a finished run) runs only when this flag exists. Without it, the watcher is identical to main and spends no extra crew-state read on paused polls. Away mode keeps its existing pause cadence either way. See theconfig/paused-wait-supersessionsection indocs/configuration.md.Risk Assessment
Testing
Ran the three focused behavior cases for supersession, opt-in compatibility, and away-mode exclusion; all passed. They drive the actual watcher through test doubles, not a live tmux lab. The prescribed external lab requires intentional /tmp writes, so live validation was not completed.
Evidence: Focused pause behavior checks
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-watch.sh:2454-paused_wait_supersededonly surfaces the gate when the parked run ID matches, but terminal detection accepts anydone/failedcrew state and labels it current without binding it to the declared wait. A concrete state withpaused: waiting for validation run R1andstate: done · source: run-step · run: R2wakes on the unrelated R2 completion, violating the documented contract that the declared wait is superseded by its run. Bind terminal state to the run ID parsed from the paused declaration (or otherwise establish identity); sibling evaluation sites:bin/fm-watch.sh:2512andbin/fm-watch.sh:3088call this predicate from idle and busy paths.bin/fm-watch.sh:1- This phase exercised the focused watcher scenarios through the repository's executable test harness, which uses tmux/crew-state test doubles rather than a real isolated watcher product session. Prior attempts documented that the prescribed tmux lab exposed fleet sessions. A safe real-watcher lab was not completed in this turn, so live end-user behavior remains unverified.for t in test_declared_wait_surfaces_superseding_state test_superseded_wait_check_is_opt_in test_superseded_wait_check_skips_away_mode; do FM_TEST_ONLY="$t" bash tests/fm-watch-triage-pause.test.sh || exit; done🔧 No changes applied.
2 warnings still open:
bin/fm-watch.sh:1- The watcher change has a runnable live product surface, but this phase did not exercise it in a private real watcher/tmux lab. The earlier prescribed lab driver writes its outputs under /tmp and lives outside the worktree; running it as instructed would make intentional out-of-worktree writes prohibited by the workspace boundary. The available focused tests execute the real watcher with tmux and crew-state doubles, so they do not substitute for a live lab.bash -n bin/fm-watch.sh tests/fm-watch-triage-pause.test.shFM_LIVE=0 FM_TEST_ONLY=test_declared_wait_surfaces_superseding_state bash tests/fm-watch-triage-pause.test.shFM_LIVE=0 FM_TEST_ONLY=test_superseded_wait_check_is_opt_in bash tests/fm-watch-triage-pause.test.shFM_LIVE=0 FM_TEST_ONLY=test_superseded_wait_check_skips_away_mode bash tests/fm-watch-triage-pause.test.shgit diff --check bb3b2d6951d021fcd085478b3c04f6ea16b22ba8 49c992d4825f62b0d542c976e7459e48cfac9cc2✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.