Repository navigation
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues remain from this review. Reviews (7) · Last reviewed commit: "no-mistakes(document): docs: fix hint pr..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @kesslerio. I read the full diff against latest One thing is waiting on you: Greptile's open P1 (Frozen watcher looks healthy). Exporting contract-class: new-default. On VISION: One captain aligns in purpose (no false "watcher down"), but a frozen watcher must not look healthy ("never hide a failure") · Authority neutral · Scripts aligns (deterministic throttle, one grace entry point) · Restart aligns in purpose, cannot tell while the P1 is open · Delegation cannot tell (supervision liveness) · Vendor neutral · Scope aligns. |
|
Speaking as Kun's firstmate: thank you @kesslerio. The P1 is fixed on Checks on this head: no-mistakes passes, and the attestation binds I've queued the full suite. Status: waiting on CI, not on you. contract-class: new-default (unchanged from my last note). Every home's beacon becomes a mid-cycle progress signal, and the readers move from a flat 300 s to |
The turn-end guard, the pull warning, and the arm that replaces a stalled watcher all judge one liveness beacon with a flat 300-second grace, but a single poll cycle walks the pending-reply sweep, the per-window stale loop, the per-status heartbeat scan, and the per-check sweep with a subprocess per unit. On a home with a deep pending-reply backlog one cycle ran past 590s with the beacon untouched while the watcher was genuinely working (another ran 1997s and delivered an actionable check at the end), so a live cycle raised the watcher-down banner and a successor refused that same live holder as stale until the 3x stall bound - the false alarm and the blocked replacement were the same failure. Cycle sweeps now refresh the beacon between units through fm_watch_beacon_progress: a throttled, fork-free touch that acts only when a live watcher exported its beacon path, so a working cycle stays fresh while a genuinely wedged one stops advancing and ages exactly as before. Counting completed cycles moves to its own state/.watch-cycle marker, because the beacon is now a progress signal rather than a cycle tick. Every beacon reader derives its grace from the poll cadence through fm_beacon_grace (an explicit FM_GUARD_GRACE, else max(300, FM_POLL+60)), so the guard, the arm, and the watcher's own re-arm agree on what fresh means. FM_GUARD_GRACE, FM_HEARTBEAT, and FM_WATCHER_STALL_BOUND still win as explicit overrides, and the banner keeps naming the grace it judged.
turnend-guard.md owns the liveness contract, so it now states that the beacon tracks cycle progress, what that does and does not guarantee, and that state/.watch-cycle is the cycle boundary. Its grace section names the one shared derivation and every reader instead of listing readers that fall back to a bare 300 seconds. watcher-continuity.md and configuration.md stop claiming the flat default.
…ite tests/fm-watch-beacon-progress.test.sh had no portable-serial duration hint, so the coverage guard measured 45/298 unhinted (15.1%) against its 15% limit and failed. Added a provisional 45000 ms hint in the single shared table in bin/fm-test-run.sh, based on two local runner samples (18426/18470 ms) scaled for CI, and recorded its provenance in docs/fm-test-portable-shards.md. The guard now reports serial_unhinted=44 of 298 (14.8%) and exits 0. The Full suite verdict failure is not independently code-caused: the failing run was a labeled event with a non-full-ci label, so every behavior lane was skipped, repo invariants passed, and the coverage guard was the only failed needed job. The remaining Full suite gate is the maintainer full-ci label. Verified: bin/fm-test-run.sh --check-coverage passes; the beacon progress suite passes all 13 tests; the changed fm-watch-wedge-cap suite passes; and the runner's hint-coverage and packing-boundary tests pass. Local-only failures in unrelated harness tests came from this NixOS/container host (pty reparenting, missing ruby), not from the change
…ps through progress marker
05abb9e to
1ab9157
Compare
…: 1. Test coverage guard and Behavior portable parallel 2 (same root cause): tests/fm-test-run.test.sh runs bin/fm-test-run.sh --check-coverage, which found 45 of 299 portable serial scripts unhinted (>15%) because the PR added tests/fm-nm-bounded-owned.test.sh without a duration hint. Once hinted realistically, the serial packing model also exceeded its 1,200,000 ms budget because the provisional 45000 ms hint for tests/fm-watch-beacon-progress.test.sh was an overestimate. I added the completed passing Ubuntu FM_TEST_END durations from CI run 43226301857: 3712 ms for fm-nm-bounded-owned and 30149 ms for fm-watch-beacon-progress (replacing the provisional 45000 ms), and recorded provenance in docs/fm-test-portable-shards.md. bin/fm-test-run.sh --check-coverage now reports 44/299 unhinted and serial_max_ms=1198795 <= 1200000. 2. Lint 1: new source lines could not be followed under --external-sources, producing SC1091/SC2153 in tests/fm-nm-bounded-owned.test.sh and SC1091 in bin/fm-supervision-lib.sh. Added shellcheck source directives for tests/lib.sh and bin/fm-wake-lib.sh. 3. Full suite is the dependent aggregator and failed only because the lanes above failed; fixing them resolves it with no separate code change. Local verification: bin/fm-test-run.sh --check-coverage passes; explicit ShellCheck and bin/fm-lint.sh --partition 1of2 pass; changed files in partition 2 report reason=ok; tests/fm-nm-bounded-owned.test.sh and tests/fm-watch-beacon-progress.test.sh pass; the coverage tests in tests/fm-test-run.test.sh pass. A later, unrelated tests/fm-session-lock-ancestry.test.sh case fails on this host because it expects orphans to be reparented to PID 1, which this container does not do; it is not in the changed area and does not affect the CI fix
|
Speaking as Kun's firstmate: thank you @kesslerio. I re-read the change on the new head The labelled run on this head (43241299800) passed every Behavior lane and Lint 1. Lint 2 was cancelled at the 30-minute cap after all 304 files finished with rc=0. That's a CI capacity problem, not this PR, so I've re-queued the full suite. Status: waiting on CI, not on you. contract-class: new-default (unchanged). If the suite is green, this goes to the captain for a decision, with the wider no-mistakes-query scope noted on the card. |
|
Speaking as Kun's firstmate: the full suite is green on Status: with the captain for a decision. This isn't waiting on you, @kesslerio. Contract class (my own read): new-default. The beacon refresh, the process-group handling in |
|
Gentle nudge @kunchenguid — this one is fully green (24/24, full labelled suite on e85b5c26) and parked at the new-default flag for your merge-or-leave call. For the wider queue: #7607, #7613, #8019, #6753 and the rest of the open set are all mergeable or green awaiting the same decision batch — several have been at that gate since Nov 9. No rush implied; just confirming nothing on our side is holding them. |
What Changed
bin/fm-watch.shnow refreshesstate/.last-watcher-beatbetween the units of a long supervision cycle (pending-reply records, stale windows, heartbeat scan, check sweep) instead of only at cycle boundaries, so a home with a deep backlog or slow checks no longer reads as a dead supervisor; child display sweeps report through a separate.last-watcher-progressmarker that only the live watcher propagates, and.watch-cycleis now the distinct per-cycle boundary marker.fm-guard.sh,fm-watch-arm.sh, the turn-end guards and their Cursor/Antigravity wrappers, the Claude Stop auto-arm hook, the supervision host and hand-back,fm-inbox.sh,fm-afk-return.sh, and the sharedfm_watcher_healthy/fm_watcher_supervision_verdict/fm_supervision_statuspredicates) resolves freshness through the newfm_beacon_graceinbin/fm-wake-lib.sh, so an explicitFM_GUARD_GRACEwins and otherwise the poll-derived default applies consistently; armed and directly launched watchers also share oneconfig/watch.env+config/x-mode.envloader.fm_nm_boundedgives each no-mistakes query its own group so a cancelled sweep kills its query descendants while a single query's timeout still stays query-local and returns 124.turnend-guard.md,watcher-continuity.md,configuration.md, the operational home layout skill) record the cycle-progress contract, the new markers, and the shared grace derivation.Risk Assessment
Testing
Ran the branch's three real-process shell suites (beacon progress, bounded-query ownership, wedge cap), then drove the product end-to-end in a disposable marked lab home created and destroyed in the same turn: the real watch-arm, watcher, and guard. The arm still loads config/watch.env after the CONFIG assignment removal and attaches to a 700s beacon under the configured 1200s grace; the guard judges the same configured grace in both directions; a live watcher's long check sweep keeps its beacon fresh so a progressing cycle raises no false WATCHER DOWN; and a SIGSTOP-frozen watcher correctly ages out and warns. No UI surface is involved, so no screenshots were captured.
watcher: attached pid=1460132 (beacon 700s)andfm_beacon_grace in lab home = 1200guard during the working sweep -> 0 WATCHER DOWN lines, output bytes=0frozen watcher pid=1460990 beacon_age=13s, guard raised 1 WATCHER DOWN with grace 8sstatus and resolver query descendants stop on display cancellation,owned and standalone bounded queries preserve stdout and status, `expired queries close descendant ou…FM_TEST_COMPLETE, exit 0 (real bin/fm-watch.sh, bin/fm-guard.sh, bin/fm-watch-arm.sh processes in isolated homes)Evidence: Live lab-home run of watch-arm, watcher, and guard (scenarios A, A2, B, C)
Source: Live lab-home run of watch-arm, watcher, and guard (scenarios A, A2, B, C)
=== A: arm loads home watch.env and attaches to a 700s beacon under configured grace 1200 === holder live pid=1460132 beacon_age=700s fm_beacon_grace in lab home = 1200 watcher: attached pid=1460132 (beacon 700s) === A2: guard reads the configured grace (silent at 700s, warns at 100s with grace 60) === guard with home grace=1200, live holder, beacon 700s -> 0 WATCHER DOWN lines, output bytes=0 guard with home grace=60, live holder, beacon 100s -> 1 WATCHER DOWN lines WATCHER DOWN - SUPERVISION IS OFF (last beat: 100s ago, grace 60s) === B: real watcher's 16s check sweep keeps the beacon fresh under grace 8 === sample: cycle_age=9s beacon_age=1s sample: cycle_age=12s beacon_age=2s (grace 8s) guard during the working sweep -> 0 WATCHER DOWN lines, output bytes=0 === C: SIGSTOP the working watcher mid-sweep === frozen watcher pid=1460990 beacon_age=13s guard on the frozen watcher -> 1 WATCHER DOWN linesEvidence: Beacon-progress real-process suite (18 ok)
Source: Beacon-progress real-process suite (18 ok)
Evidence: Bounded-query ownership suite (3 ok)
Source: Bounded-query ownership suite (3 ok)
Evidence: Live scenario driver script used for the lab-home run
Source: Live scenario driver script used for the lab-home run
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (4) ✅
bin/fm-watch.sh:4181- The new background display sweeps record only FM_ACTIVE_CHECK_PID, leaving FM_ACTIVE_CHECK_PGID empty. If the watcher receives TERM while Herdr is reporting metadata or Rex is reading validation status, watcher_cleanup kills the helper shell but leaves its subprocesses running, then releases the watcher lock. A successor can therefore start while predecessor-owned operations remain active. Both launches need the existing managed process-group ownership and cleanup: bin/fm-watch.sh:4181 (Herdr) and :4193 (Rex), consumed by fm_active_check_stop at :3368.tests/fm-watch-beacon-progress.test.sh:544- This test stops as soon as .last-heartbeat exists, but watcher startup unconditionally creates that file at bin/fm-watch.sh:4042 before any heartbeat runs. Ignoring FM_HEARTBEAT entirely would still pass both the wait at :544 and assertion at :549. Use the documented heartbeat cadence as the oracle: wait for a scheduled heartbeat to advance the marker or produce its idle-heartbeat streak, and verify that a long configured interval does not advance it during the same observation window.🔧 Fix applied.
2 warnings still open:
bin/fm-watch.sh:4181- The new background display sweeps record only FM_ACTIVE_CHECK_PID, leaving FM_ACTIVE_CHECK_PGID empty. If the watcher receives TERM while Herdr is reporting metadata or Rex is reading validation status, watcher_cleanup kills the helper shell but leaves its subprocesses running, then releases the watcher lock. A successor can therefore start while predecessor-owned operations remain active. Both launches need the existing managed process-group ownership and cleanup: bin/fm-watch.sh:4181 (Herdr) and :4193 (Rex), consumed by fm_active_check_stop at :3368.bin/fm-watch.sh:3527- Round 1's process-group fix leaves the Rex validation-read path outside cleanup ownership. With Rex marks enabled and an expired progress cache, fm-rex-marks.sh:249 calls fm_nm_bounded, whose timeout/gtimeout branches create a separate process group (bin/fm-nm-run-lib.sh:32–33); its Perl fallback explicitly does likewise (:34). Sending TERM to the watcher during that read kills the display helper's group but leaves the query running while watcher_cleanup releases the singleton lock. The optional home-resolver call uses the same escaping boundary (:61). This remains reachable through bin/fm-watch.sh:4211 and bin/fm-rex-marks.sh:305. Propagate cancellation through the shared bounded-query boundary and wait for its owned descendants before releasing the watcher lock.🔧 Fix applied.
1 error still open:
bin/fm-nm-run-lib.sh:27- Round 2's ownership fix breaks per-query timeout isolation. With a shell resolver that starts a slow child and waits (the shape already used by the new fixture), --foreground terminates only the resolver; its child retains stdout, so the command substitution at bin/fm-nm-run-lib.sh:66 can remain blocked beyond five seconds and stall the watcher. Both timeout backends at bin/fm-nm-run-lib.sh:34 and bin/fm-nm-run-lib.sh:35 are affected. Conversely, the Perl backend at bin/fm-nm-run-lib.sh:36 sends TERM to the entire display group, including itself and the display shell: one expired query aborts all remaining tasks instead of returning a bounded failure. These paths are enabled by bin/fm-watch.sh:3525 and reached through bin/fm-rex-marks.sh:249. Preserve query-local timeout cleanup and failure returns at fm_nm_bounded while retaining watcher cancellation ownership.🔧 Fix applied.
✅ Re-checked - no issues remain.
tests/fm-nm-bounded-owned.test.sh:13- The ownership-fix rounds introduced fixtures that require GNUtimeoutdespite supporting gtimeout and Perl fallbacks. On macOS with only gtimeout or Perl,command -v timeoutreturns empty, generatingexec '' "$@"; this shim shadows the working fallback and queries never start. The same defect occurs at tests/fm-nm-bounded-owned.test.sh:93. Resolve an available timeout/gtimeout executable before creating the shim; when neither exists, skip GNU backend emulation while retaining Perl coverage.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
watcher: attached pid=... (beacon 320s)instead of a stale-he…export FM_GUARD_GRACE=60to the same config/watch.env and re-arms: on the same 320s beacon the arm no longer attaches but reports `watcher: replaced stalled pid ... (beacon 320s pas…bash tests/fm-nm-bounded-owned.test.sh(3/3 ok)bash tests/fm-watch-beacon-progress.test.sh(15/15 ok, 27s)bash tests/fm-watch-wedge-cap.test.sh(all cases ok, 4m56s)bash tests/fm-watch-arm.test.sh(41 ok / 0 not ok when I stopped it incomplete to stay inside the time budget; no TAP plan, so not counted as a pass)Live lab scenario 1: lab home withconfig/watch.envexporting FM_POLL=600, real arm-started watcher, beacon backdated to 320s, second real arm ->watcher: attached pid=... (beacon 320s)Live lab scenario 2: same home withexport FM_GUARD_GRACE=60added, same 320s beacon ->watcher: replaced stalled pid ... (beacon 320s past hard bound 180s), no attachLive lab scenario 3 control: lab home with no config/watch.env; a 320s beacon attaches only when the arm's own environment supplies FM_POLL=600, and is refused (heartbeat is stale for 320s (>300s)) without itLive lab scenario 4:config/watch.envFM_POLL=600 plusconfig/x-mode.envFM_GUARD_GRACE=60 -> arm replaced the 320s stalled holder, proving the second file is sourcedLive lab scenario 5: real arm-launched watcher with five 2s checks, grace 4s -> max beacon age 2s with 7 distinct beacon touches while the same lock pid owned one 12s cyclegrepaudit of bin/fm-watch-arm.sh after the live runs: no remainingCONFIGreference; arm runs cleanly underset -ugit status --porcelainin the worktree: empty (no test artifacts left behind); all /tmp/fm-lab.* homes removed and all watcher processes stopped✅ No issues found.
watcher: attached pid=1460132 (beacon 700s)andfm_beacon_grace in lab home = 1200guard during the working sweep -> 0 WATCHER DOWN lines, output bytes=0frozen watcher pid=1460990 beacon_age=13s, guard raised 1 WATCHER DOWN with grace 8sstatus and resolver query descendants stop on display cancellation,owned and standalone bounded queries preserve stdout and status, `expired queries close descendant ou…FM_TEST_COMPLETE, exit 0 (real bin/fm-watch.sh, bin/fm-guard.sh, bin/fm-watch-arm.sh processes in isolated homes)bash tests/fm-watch-beacon-progress.test.sh(18 real-process cases: throttle/inertness, crew+secondmate+check+terminal-wait progress refresh, home cadence and Relay precedence, stalled-holder banner and eviction, frozen watcher during a display sweep) -> FM_TEST_COMPLETE, exit 0bash tests/fm-nm-bounded-owned.test.sh(real timeout/gtimeout/Perl bounded queries: owned and standalone descendants stop on display cancellation, stdout/status preserved, expired query frees the next) -> exit 0bash tests/fm-watch-wedge-cap.test.sh(changed wedge-cap coverage) -> 23 ok, exit 0bash ~/.no-mistakes/evidence/01M77TT015RB584XQG5V31A01V/live-lab-scenarios.sh(lab minted withbin/fm-lab-home.sh create, torn down in the same run):bin/fm-watch-arm.shattaches to a live 700s beacon under homeFM_GUARD_GRACE=1200;bin/fm-guard.shsilent at 700s/1200 and warns WATCHER DOWN 'grace 60s' at 100s/60; a real watcher's 12s+ check sweep keeps beacon_age 1-2s under grace 8 with guard silent; SIGSTOP mid-sweep ages the beacon to 13s and the guard raises WATCHER DOWN🔧 **Document** - 1 issue found → no changes applied ✅
bin/fm-test-run.sh:973- The branch adds tests/fm-nm-bounded-owned.test.sh to the portable serial lane with no duration hint, sobin/fm-test-run.sh --check-coveragenow reports 45 of 299 unhinted scripts (15.05%) against its 15% limit and exits 1; the base state passed at 44/298. Fixing it needs a hint line in the single shared table (besidetests/fm-watch-beacon-progress.test.sh 45000) plus a provenance entry in docs/fm-test-portable-shards.md; local samples here were 3000-4000 ms. That is test-harness configuration, not documentation, so this phase could not apply it without changing executable behavior.🔧 No changes applied.
1 error still open:
bin/fm-test-run.sh:973- Carried over unresolved from the previous round and still reproducible:bin/fm-test-run.sh --check-coverageexits 1 with 45 of 299 unhinted portable-serial scripts (15.05% against a 15% limit) because this branch addstests/fm-nm-bounded-owned.test.shwith no measured duration hint. This document phase cannot close it: the repair is harness configuration, not documentation - atests/fm-nm-bounded-owned.test.sh <ms>row besidetests/fm-watch-beacon-progress.test.sh 45000inportable_serial_weight_hints, plus its provenance sentence indocs/fm-test-portable-shards.md. Editing the runner's hint table would change executable harness behavior (shard packing and the guard's own verdict), which this phase must not do. Two local samples here were 3-4 s (bash tests/fm-nm-bounded-owned.test.sh, exit 0 both times), so a CI-scaled hint around 8000-9000 ms fits the existing provisional-hint convention. I deliberately did not add the docs provenance line alone, because it would document a hint the table does not contain.✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.