Skip to content

fix(watcher): make declaration-based pause cadence opt-in - #4811

Open
tiago-peixoto wants to merge 56 commits into
kunchenguid:mainfrom
tiago-peixoto:fm/firstmate-issue2713-watcher-paused-suppression
Open

tiago-peixoto wants to merge 56 commits into
kunchenguid:mainfrom
tiago-peixoto:fm/firstmate-issue2713-watcher-paused-suppression

Conversation

@tiago-peixoto

@tiago-peixoto tiago-peixoto commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2713

Intent

In the maintainer's triage, restore and opt-in PRs merge automatically after a green full suite, while new-default PRs (ones that change what an unconfigured home does) wait for the maintainer's own decision.
#4811 (branch fm/firstmate-issue2713-watcher-paused-suppression on the fork tiago-peixoto/firstmate, for issue #2713) was triaged new-default: "it replaces the liveness gate docs/architecture.md specifies on main".
The approved adjustment: keep main's liveness gate as the default, and apply the new pause-cadence rule only when one new off-by-default config file exists. A home without the new file must behave exactly as current upstream main, including homes that use any existing setting; this moves the PR to opt-in.
The maintainer rejected an earlier conversion (PR 8263) that reused existing settings, because homes already using them would get the new behavior without turning on anything new; so the gate is one new file used for nothing else.
Update method for this PR: merge current upstream main into the PR branch, never rebase, never force-push.

What Changed

  • bin/fm-watch.sh now applies the declaration-based pause cadence only when the new empty flag file config/pause-cadence exists. Without the file, pause_state_class keeps both liveness gates for an ordinary crew, and the stale and changing-pane paths call handle_paused_stale as on main.
  • With the flag present, an ordinary idle crew with a standing paused: or captain-held declaration gets one plain stale: wake on its first stable sight, whether or not its agent has exited, and later sights use FM_PAUSE_RESURFACE_SECS. Secondmates, lanes parked on review, and overdue pauses keep their existing handling. A pane that never settles gets its recheck after a whole cadence, or after two consecutive changing polls once its until time has passed.
  • docs/configuration.md gains a "Pause cadence (config/pause-cadence)" section and docs/architecture.md links to it. tests/fm-watch-triage-pause.test.sh adds cases for the default path (liveness gates and first-sight output unchanged, with and without existing settings) and for the opt-in path (first sight, re-surface cadence, exited agents, replacement declarations, never-settling panes).

Risk Assessment

✅ Low: Every behavior change in bin/fm-watch.sh sits behind -e "$CONFIG/pause-cadence", so a home without the file takes main's exact branches (both liveness gates in pause_state_class, handle_paused_stale in the stable and changed-hash arms); the only code on the default path is one extra read of the count file that feeds a variable used only under the flag.

Testing

I ran the one touched test file through the repository runner (57 cases pass, exit 0), then drove the real watcher against real tmux panes in disposable lab homes at both the target commit and upstream main. Default and existing-settings homes matched main exactly: a dead-agent pause stayed quiet and a non-dead one woke once with stale:. With config/pause-cadence the dead-agent home got one stale: wake, then stayed quiet through a pane change, and a secondmate stayed absorbed. The main drive was cut by its time limit after the default rows finished, so main's last opt-in-named rows are missing; they are not needed for the comparison. No UI surface exists, so evidence is CLI transcripts.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Unconfigured home, ordinary crew with paused: status whose agent exited (idle shell pane): watcher stays quiet, same as upstream main ✅ pass live live-head.txt and live-main.txt rows [default-dead]: run 2 and run 3 QUIET on both; live-main-vs-head.diff shows no difference in these rows
Unconfigured home, ordinary crew with paused: status whose agent is not confirmed dead (foreground sleep pane): one stale: lab:fm-live wake on first sight, then quiet, same as upstream main ✅ pass live live-head.txt and live-main.txt rows [default-notdead]: run 2 stale: lab:fm-live, run 3 QUIET on both
Home that uses existing settings (pause-ceiling, four wedge-defer and churn flags, watch.env) but no pause-cadence: behaves exactly as upstream main for dead and non-dead agents ✅ pass live live-head.txt and live-main.txt rows [existing-dead] and [existing-notdead] are identical; live-main-vs-head.diff has no lines for them
Home with config/pause-cadence, dead-agent paused: crew: one plain stale: wake on first stable sight, then quiet on later sights and after the pane text changes ✅ pass live live-head.txt rows [optin-dead]: run 2 stale: lab:fm-dead, run 3 QUIET, run 4 after pane changed QUIET; this run-2 row is the only changed line in live-main-vs-head.diff
Adversarial: remove config/pause-cadence from an opted-in home and the default handling returns (dead-agent pause stays quiet) ✅ pass live live-head.txt row [optin-dead] run 5 flag removed -> QUIET
Adversarial: home with config/pause-cadence and a secondmate with paused: status stays absorbed, no plain stale wake ✅ pass live live-head.txt rows [optin-secondmate]: run 2 and run 3 QUIET; test file case with pause-cadence, a secondmate and a lane parked on review stay absorbed on first sight ok
The touched test file tests/fm-watch-triage-pause.test.sh passes on the merged result, including main's restored default cases and the separate opt-in cases ✅ pass live triage-pause-head.log: 1..57, 57 ok lines, exit=0, gate_skip=false
Evidence: Live watcher transcript at target commit 75a4bc5

Source: Live watcher transcript at target commit 75a4bc59

=== target commit 75a4bc59 (watcher: {run-worktree}/bin/fm-watch.sh) ===
- home 'default-dead': window=lab:fm-dead kind=ship config=[none] status='paused: waiting for an external result'
  [default-dead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.rJtc4C/default-dead/state/t1.status 
  [default-dead] run 2 -> QUIET (15 polls, no wake)
  [default-dead] run 3 -> QUIET (15 polls, no wake)
- home 'default-notdead': window=lab:fm-live kind=ship config=[none] status='paused: waiting for an external result'
  [default-notdead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.rJtc4C/default-notdead/state/t1.status 
  [default-notdead] run 2 -> rc=0 wake: stale: lab:fm-live 
  [default-notdead] run 3 -> QUIET (15 polls, no wake)
- home 'existing-dead': window=lab:fm-dead kind=ship config=[pause-ceiling wedge-defer-worker-wait wedge-defer-parked-gate wedge-defer-validating turnend-churn-absorb watch.env] status='paused: waiting for an external result'
  [existing-dead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.rJtc4C/existing-dead/state/t1.status 
  [existing-dead] run 2 -> QUIET (15 polls, no wake)
  [existing-dead] run 3 -> QUIET (15 polls, no wake)
- home 'existing-notdead': window=lab:fm-live kind=ship config=[pause-ceiling wedge-defer-worker-wait wedge-defer-parked-gate wedge-defer-validating turnend-churn-absorb watch.env] status='paused: waiting for an external result'
  [existing-notdead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.rJtc4C/existing-notdead/state/t1.status 
  [existing-notdead] run 2 -> rc=0 wake: stale: lab:fm-live 
  [existing-notdead] run 3 -> QUIET (15 polls, no wake)
- home 'optin-dead': window=lab:fm-dead kind=ship config=[pause-cadence] status='paused: waiting for an external result'
  [optin-dead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.rJtc4C/optin-dead/state/t1.status 
  [optin-dead] run 2 -> rc=0 wake: stale: lab:fm-dead 
  [optin-dead] run 3 -> QUIET (15 polls, no wake)
  [optin-dead] run 4 after pane changed -> QUIET (15 polls, no wake)
- home 'optin-dead': config/pause-cadence removed
  [optin-dead] run 5 flag removed -> QUIET (15 polls, no wake)
- home 'optin-notdead': window=lab:fm-live kind=ship config=[pause-cadence] status='paused: waiting for an external result'
  [optin-notdead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.rJtc4C/optin-notdead/state/t1.status 
  [optin-notdead] run 2 -> rc=0 wake: stale: lab:fm-live 
  [optin-notdead] run 3 -> QUIET (15 polls, no wake)
- home 'optin-secondmate': window=lab:fm-dead kind=secondmate config=[pause-cadence] status='paused: waiting for an external result'
  [optin-secondmate] run 1 -> rc=0 wake: signal: /tmp/fm-lab.rJtc4C/optin-secondmate/state/t1.status 
  [optin-secondmate] run 2 -> QUIET (15 polls, no wake)
  [optin-secondmate] run 3 -> QUIET (15 polls, no wake)
Evidence: Live watcher transcript at upstream main 427056c (stopped by time limit after the default rows)

Source: Live watcher transcript at upstream main 427056c4 (stopped by time limit after the default rows)

=== upstream main 427056c4 (watcher: /tmp/fm-pc-drive/main/bin/fm-watch.sh) ===
- home 'default-dead': window=lab:fm-dead kind=ship config=[none] status='paused: waiting for an external result'
  [default-dead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.Sacy5y/default-dead/state/t1.status 
  [default-dead] run 2 -> QUIET (15 polls, no wake)
  [default-dead] run 3 -> QUIET (15 polls, no wake)
- home 'default-notdead': window=lab:fm-live kind=ship config=[none] status='paused: waiting for an external result'
  [default-notdead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.Sacy5y/default-notdead/state/t1.status 
  [default-notdead] run 2 -> rc=0 wake: stale: lab:fm-live 
  [default-notdead] run 3 -> QUIET (15 polls, no wake)
- home 'existing-dead': window=lab:fm-dead kind=ship config=[pause-ceiling wedge-defer-worker-wait wedge-defer-parked-gate wedge-defer-validating turnend-churn-absorb watch.env] status='paused: waiting for an external result'
  [existing-dead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.Sacy5y/existing-dead/state/t1.status 
  [existing-dead] run 2 -> QUIET (15 polls, no wake)
  [existing-dead] run 3 -> QUIET (15 polls, no wake)
- home 'existing-notdead': window=lab:fm-live kind=ship config=[pause-ceiling wedge-defer-worker-wait wedge-defer-parked-gate wedge-defer-validating turnend-churn-absorb watch.env] status='paused: waiting for an external result'
  [existing-notdead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.Sacy5y/existing-notdead/state/t1.status 
  [existing-notdead] run 2 -> rc=0 wake: stale: lab:fm-live 
  [existing-notdead] run 3 -> QUIET (15 polls, no wake)
- home 'optin-dead': window=lab:fm-dead kind=ship config=[pause-cadence] status='paused: waiting for an external result'
  [optin-dead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.Sacy5y/optin-dead/state/t1.status 
  [optin-dead] run 2 -> QUIET (15 polls, no wake)
  [optin-dead] run 3 -> QUIET (15 polls, no wake)
  [optin-dead] run 4 after pane changed -> QUIET (15 polls, no wake)
- home 'optin-dead': config/pause-cadence removed
  [optin-dead] run 5 flag removed -> QUIET (15 polls, no wake)
- home 'optin-notdead': window=lab:fm-live kind=ship config=[pause-cadence] status='paused: waiting for an external result'
  [optin-notdead] run 1 -> rc=0 wake: signal: /tmp/fm-lab.Sacy5y/optin-notdead/state/t1.status 
  [optin-notdead] run 2 -> rc=0 wake: stale: lab:fm-live 

NOTE: the main drive was stopped by its 900s limit after optin-notdead run 2 (machine under load). Every default and existing-settings row completed.
Evidence: Diff of main transcript against target transcript

Source: Diff of main transcript against target transcript

19c19 < [optin-dead] run 2 -> QUIET (15 polls, no wake) --- > [optin-dead] run 2 -> rc=0 wake: stale: lab:fm-dead 26a27,31 (rows main's drive did not reach before its time limit; all are pause-cadence homes)

19c19
<   [optin-dead] run 2 -> QUIET (15 polls, no wake)
---
>   [optin-dead] run 2 -> rc=0 wake: stale: lab:fm-dead 
26a27,31
>   [optin-notdead] run 3 -> QUIET (15 polls, no wake)
> - home 'optin-secondmate': window=lab:fm-dead kind=secondmate config=[pause-cadence] status='paused: waiting for an external result'
>   [optin-secondmate] run 1 -> rc=0 wake: signal: LAB/optin-secondmate/state/t1.status 
>   [optin-secondmate] run 2 -> QUIET (15 polls, no wake)
>   [optin-secondmate] run 3 -> QUIET (15 polls, no wake)
Evidence: Touched test file run log

Source: Touched test file run log

FM_TEST_BEGIN 2026-11-22T04:02:30Z tests/fm-watch-triage-pause.test.sh family=watcher-wake-lock expected_gate_skip=none
1..57
ok - without pause-cadence, new and existing homes retain both liveness gates and main's first-sight output
ok - all four required captain-hold tests fail when tasks-axi is unavailable
ok - a not-provably-working non-terminal stale is surfaced immediately (never left to wait out the timer)
ok - a declared pause is absorbed on first sight, then re-surfaced as a recheck past the threshold, never wedge-escalated
ok - a declared pause surfaces once, then re-surfaces on the cadence, never wedge-escalated
ok - declared waits surface unreported gates and terminal runs once, while working runs and answered gates keep the pause cadence on idle and busy paths
ok - without config/paused-wait-supersession superseding states keep the declared-wait cadence and spend no extra crew-state read
ok - with the away-mode flag present an armed busy paused worker at a human gate behaves exactly as with the flag absent: no superseded wake and no crew-state read
ok - exited declared-pause and captain-held panes use bounded pause cadence while a live decision gate still surfaces once
ok - exited declared-pause and captain-held panes use bounded pause cadence while a live decision gate still surfaces once
ok - own-work waits keep one first alert, then bounded rechecks without wedges; undeclared idle still alarms
ok - absorbed paused and captain-held replacements each start their own re-surface cadence
ok - paused and captain-held replacements each get their own first sight
ok - with pause-cadence, a secondmate and a lane parked on review stay absorbed on first sight
ok - a parked live worker surfaces once, absorbs pane churn for the whole re-surface window, then re-surfaces when it elapses
ok - a declared wait on a pane whose hash changes every poll is rechecked once per cadence
ok - an elapsed until time on a pane whose hash changes every poll is rechecked before the cadence, then once per declaration
ok - a live paused worker stays absorbed until its declared time, then rechecks
ok - work under an open captain call surfaces once, absorbs pane churn, then re-surfaces when the window elapses
ok - a stale window with no open captain call keeps alarming on every new hash
ok - a wake that never reached the durable queue arms no re-surface throttle
ok - a released-then-re-held task is a distinct captain call whose first sight still alarms
ok - a declared paused secondmate re-surfaces on the bounded normal-mode cadence
ok - a captain-held secondmate re-surfaces on the bounded normal-mode cadence
ok - a non-paused secondmate retains normal stale suppression
ok - a resumed secondmate clears pause and stale tracking before stale exemption
ok - unchanged stale hashes reclassify when a crew enters or leaves pause
ok - a declared pause is periodically rechecked against authoritative active-run state
ok - a paused status overridden by authoritative working preserves its wedge timer, is rechecked rather than wedge-escalated while the declaration stands, and escalates once it is lifted
ok - a captain-held item is never rechecked while the away-posture record exists, and the recheck returns once the record is archived
ok - a live captain-held pane is absorbed on first sight while the away-posture record exists
ok - a delivery the captain already holds is never rechecked while the away-posture record exists
ok - the daemon-owned one-shot never hands off a captain-held pane while the away-posture record exists
ok - quiet mode's record silences no captain-held recheck, on the watcher's cadence or through a quiet daemon's one-shot
ok - a declared wait naming a near-future until time stays quiet until that time
ok - a wrong-year declared time cannot silence the watcher beyond the recheck cadence
ok - a declared wait whose until time has passed is rechecked at once, then held to the cadence
ok - with config/pause-ceiling, a dated pause past its ceiling opens one keyed decision that a worker event closes
date: invalid date '@'
ok - without config/pause-ceiling an old pause keeps the plain recheck and opens no decision
ok - overdue publication reconciles resumes before or after the blocker append without a stale alert
ok - busy overdue decisions suppress wedge alerts until a worker event, then restore ordinary tracking
date: invalid date '@'
ok - a fresh overdue marker survives reconciliation and closes when the worker resumes
ok - an open overdue decision suppresses terminal stale wakes caused only by pane display churn
date: invalid date '@'
ok - a reused task id with fresh working status does not inherit overdue pause state
date: invalid date '@'
ok - malformed dated pauses remain on bounded recheck
ok - the undated bound uses the pause timestamp and rejects zero
date: invalid date '@'
ok - undated pauses stay quiet through the bound and close their overdue decision on resume
ok - with paused-recheck-silent on, an unchanged paused declaration is rechecked without a wake
ok - with paused-recheck-silent absent, the unchanged paused recheck still wakes
ok - with paused-recheck-silent on, an open decision still wakes
ok - with paused-recheck-silent on, a changed declaration still wakes
ok - with paused-recheck-silent on, an unchanged paused recheck for a live ship agent is silent
ok - with paused-recheck-silent on, a ticking pane on an unchanged paused declaration is silent
ok - with paused-recheck-silent on, a paused recheck for an exited agent still wakes
ok - with paused-recheck-silent on, a due declared time still wakes
ok - without until, a worker paused on its own ended background job is not rechecked inside the cadence
ok - until set to a background job's timeout rechecks the worker paused on it once the job must have ended
FM_TEST_COMPLETE
FM_TEST_END 2026-11-22T04:21:49Z tests/fm-watch-triage-pause.test.sh exit=0 duration_ms=1159145 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=1159256
FM_TEST_SUMMARY_FAMILY family=watcher-wake-lock count=1 duration_ms=1159145 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-watch-triage-pause.test.sh duration_ms=1159145
exit=0

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed (2) ✅
  • ⚠️ tests/fm-watch-triage-pause.test.sh:141 - Three tests that exist on main were rewritten to assert the opt-in behavior and now run only with config/pause-cadence present, so main's default assertions for them no longer run anywhere. Sites: test_nonterminal_stale_paused_absorbed_then_resurfaced (line 141, lost: a dead-agent pause is absorbed quietly on first sight, then rechecks past the cadence with the 'awaiting external' wording), test_exited_declared_pause_is_bounded_but_live_gate_surfaces (line 283, lost: zero bare stopped-crew wakes for a dead agent, and the captain-held dead-agent recheck on the cadence), test_absorbed_replacement_wait_does_not_inherit_the_old_throttle (line 425, lost: the replacement declaration wakes with its own recheck reason). The new test_pause_cadence_default_keeps_liveness_gate covers only the first poll cycle and one changed pane, not the default recheck after the cadence or the default replacement wording. The intent requires that a home without the file behaves exactly as upstream main, and the source diff does keep every changed branch behind the flag, but a later edit that breaks the default dead-agent cadence would now pass this file. Remedy: restore these three tests to main's bodies (no FM_CONFIG_OVERRIDE) and move the opt-in expectations into separately named tests. Related stale comments in the same file: lines 486-488 and 517-520 now describe the opt-in rule ('keeps the pause cadence whether or not the agent is still alive') above parked_watch_round and test_live_declared_wait_churn_honors_the_resurface_throttle, which run with the default liveness gate. Restore main's wording there.
  • ℹ️ bin/fm-watch.sh:4833 - Simplification: the opt-in changed-hash arm reads the declaration and the clock again although both are already in hand. Line 4833 calls status_declared_wait_line a second time instead of using "$last" from line 4827, and line 4834 calls date +%s instead of using "$now" from line 4828. Line 4831 also recomputes age_of on the status file that line 4829 already computed. Reuse the three values. Behavior does not change.

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ℹ️ bin/fm-watch.sh:4833 - Simplification: the opt-in changed-hash arm reads the declaration and the clock again although both are already in hand. Line 4833 calls status_declared_wait_line a second time instead of using "$last" from line 4827, and line 4834 calls date +%s instead of using "$now" from line 4828. Line 4831 also recomputes age_of on the status file that line 4829 already computed. Reuse the three values. Behavior does not change.
  • ⚠️ bin/fm-watch.sh:4732 - With config/pause-cadence present, the stable first-sight arm sends every non-overdue paused class to surface_nonterminal_stale without checking the crew kind or the review-park marker, so two waits that main absorbs through handle_paused_stale now get a plain stale: &lt;window&gt; wake. This is inside the opt-in branch only; a home without the file is unaffected. Site 1, secondmate (line 4732-4744): a mate with a fresh paused: line reaches this arm (the gate at line 4579 admits declared mates), pause_state_class returns paused without a liveness read, and the opt-in branch surfaces it at once. On main the same mate is absorbed by handle_paused_stale until the status is FM_PAUSE_RESURFACE_SECS old, then wakes with the awaiting external wording. docs/configuration.md line 1182 says a secondmate retains its existing first-sight handling, and the changed-hash arm at line 4824 already exempts kind = secondmate; this arm does not. Site 2, lane parked on review (same lines): bin/fm-park.sh line 648 appends paused [at=...]: parked on review and stops the agent. handle_paused_stale line 2541 absorbs that lane because fm-park.sh's tick owns every wake for it, but surface_nonterminal_stale has no review-park check, so the opt-in home gets one plain stale wake per parked lane on first stable sight, and again on a new hash after the cadence. Remedy: in the opt-in condition at line 4732, also call handle_paused_stale when $kind is secondmate or $STATE/$task.review-park exists, so only an ordinary un-parked crew takes the plain first sight. No opt-in test covers a secondmate or a parked lane; the existing secondmate tests run without the flag.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Unconfigured home, ordinary crew with paused: status whose agent exited (idle shell pane): watcher stays quiet, same as upstream main ✅ pass live live-head.txt and live-main.txt rows [default-dead]: run 2 and run 3 QUIET on both; live-main-vs-head.diff shows no difference in these rows
Unconfigured home, ordinary crew with paused: status whose agent is not confirmed dead (foreground sleep pane): one stale: lab:fm-live wake on first sight, then quiet, same as upstream main ✅ pass live live-head.txt and live-main.txt rows [default-notdead]: run 2 stale: lab:fm-live, run 3 QUIET on both
Home that uses existing settings (pause-ceiling, four wedge-defer and churn flags, watch.env) but no pause-cadence: behaves exactly as upstream main for dead and non-dead agents ✅ pass live live-head.txt and live-main.txt rows [existing-dead] and [existing-notdead] are identical; live-main-vs-head.diff has no lines for them
Home with config/pause-cadence, dead-agent paused: crew: one plain stale: wake on first stable sight, then quiet on later sights and after the pane text changes ✅ pass live live-head.txt rows [optin-dead]: run 2 stale: lab:fm-dead, run 3 QUIET, run 4 after pane changed QUIET; this run-2 row is the only changed line in live-main-vs-head.diff
Adversarial: remove config/pause-cadence from an opted-in home and the default handling returns (dead-agent pause stays quiet) ✅ pass live live-head.txt row [optin-dead] run 5 flag removed -> QUIET
Adversarial: home with config/pause-cadence and a secondmate with paused: status stays absorbed, no plain stale wake ✅ pass live live-head.txt rows [optin-secondmate]: run 2 and run 3 QUIET; test file case with pause-cadence, a secondmate and a lane parked on review stay absorbed on first sight ok
The touched test file tests/fm-watch-triage-pause.test.sh passes on the merged result, including main's restored default cases and the separate opt-in cases ✅ pass live triage-pause-head.log: 1..57, 57 ok lines, exit=0, gate_skip=false
  • nice -n 10 bash bin/fm-test-run.sh tests/fm-watch-triage-pause.test.sh - exit 0, 57 of 57 cases ok, no gate skip, 1159 s
  • Live drive at target commit 75a4bc59: real bin/fm-watch.sh, real bin/fm-crew-state.sh, real bin/fm-wake-drain.sh against real tmux panes on a private tmux -L fm-lab socket, in disposable lab homes made by bin/fm-lab-home.sh create; 8 homes (default, existing settings, opt-in, opt-in secondmate; dead shell pane and non-dead sleep pane), 3 to 5 watcher runs each
  • Same live drive against upstream main 427056c4's bin/ (extracted with git archive 427056c4 bin into a temp directory), then diff of the two transcripts
  • Adversarial: changed the pane text on the opted-in dead-agent home, then removed config/pause-cadence from that home, and ran the watcher again each time
  • Teardown: lab homes removed, lab tmux server killed, scratch drive directory removed, git status --short empty
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@tiago-peixoto tiago-peixoto changed the title fix(bin): keep a declared pause on the bounded recheck for every agent-liveness verdict fix(bin): keep a declared pause on the bounded cadence whatever the agent's liveness Sep 18, 2026
@tiago-peixoto
tiago-peixoto marked this pull request as ready for review September 18, 2026 16:59
Oskari-Heikkinen added a commit to Oskari-Heikkinen/firstmate that referenced this pull request Sep 24, 2026
…hat fire into one wake (#9)

* fix(watch): keep a declared pause across alive and unknown liveness

Port of upstream kunchenguid/firstmate PR 4811 by Tiago Peixoto
(kunchenguid#4811), the fix for
upstream issues 5415 and 2713.

pause_state_class treated any non-dead agent verdict as proof the wait was
false, so a parked live worker (and an unreadable one) surfaced as stale
while only an exited pane took the bounded recheck. Drop those gates and
the now-unreachable declared-wait arms, and pin the grok/node/empty/zsh
matrix.

The bin/ and tests/ changes apply unchanged; the docs/architecture.md and
docs/configuration.md hunks were re-applied by hand onto the current text.

* feat(watch): coalesce due declared-wait rechecks into one cache-aware wake

Each declared-wait recheck used to wake the supervisor on its own the
moment it fell due, and a supervisor idle for over an hour rewrote its
whole prompt cache for each of those turns.

Due rechecks now queue and are delivered together as one wake: at once
while the supervisor took a turn within FM_RECHECK_WARM_SECS (its cache
is still warm), otherwise alongside the next wake raised for any other
reason. A held recheck still wakes on its own once its wait has gone
FM_STANDING_WAITS_CEILING_SECS unseen, so every wait keeps a finite
bound. Captain-held rechecks, a paused wait whose declared until time
has passed, and away mode are delivered when due. A queued recheck whose
wait ended is dropped rather than delivered.

* feat(watch): absorb declared-wait rechecks whose lane did not change

Almost every declared-wait recheck asked the supervisor to confirm a
wait in which nothing had changed. A due paused: recheck is now compared
with the lane's fingerprint from when the wait was first seen or last
shown: status log, current-state verdict, agent liveness, task-copy HEAD
and dirty bit, unread steers, and any recorded PR's state, head, and red
checks, with the pane left out. An unchanged lane is absorbed until it
has gone FM_STANDING_WAITS_CEILING_SECS unseen, when every standing wait
is shown together in one wake. A changed lane is rechecked and the
recheck names what changed, and an unreadable fingerprint counts as a
change.

The away-mode daemon applies the same fingerprint and ceiling, sharing
the watcher's baseline. Captain-held rechecks and passed until times are
unchanged.

* no-mistakes(review): Gate cold captain-held and repeat-until rechecks, keep queue lock

* no-mistakes(document): Document daemon fingerprint absorption of unchanged paused rechecks

* no-mistakes(lint): Export daemon test overrides individually to satisfy ShellCheck

* fix(control): quote the interrupt proof value so ShellCheck reads it as a string

Full ShellCheck analysis reads the unquoted assignment proof=agent-alive
as arithmetic (SC2100). The value and behavior are unchanged.

* no-mistakes(review): Leave away-mode declared-wait rechecks to the daemon

* docs(architecture): bound declared-wait silence trade to at most one recheck
pause_state_class treated any non-dead agent verdict as proof the wait was
false, so a parked live worker (and an unreadable one) surfaced as stale
while only an exited pane took the bounded recheck. Drop those gates and
the now-unreachable declared-wait arms, and pin the grok/node/empty/zsh
matrix.
@tiago-peixoto
tiago-peixoto force-pushed the fm/firstmate-issue2713-watcher-paused-suppression branch from 82161ac to 57d8b3b Compare September 24, 2026 17:06
tiago-peixoto added a commit to tiago-peixoto/firstmate that referenced this pull request Sep 25, 2026
…g's last event

`state/<id>.status` is an append-only event log, and every declared-wait
gate read it last-event-wins. A worker that appended `paused: <external
wait>` kept its wedge-alarm suppression only until the next line landed,
from anyone: its own armed background reporter, a pipeline step notice, a
firstmate note. That line became the newest event, current state flipped
away from the declaration, the possible-wedge ladder restarted from zero,
and nothing reported that the suppression had been voided.

`status_standing_wait_line` in `bin/fm-classify-lib.sh` folds the log the
way keyed decisions are already folded: a `paused:` or `captain-held:` line
declares the wait, and only a line the worker writes to say its situation
changed - `done`, `needs-decision`, `blocked`, `failed`, `resolved`, or a
replacing declaration - retracts it. `working:`, `note:` and free-text
prose leave it standing. A `resolved` line retracts a pause only when it
carries the pause's own phase key, where a keyless line is its own phase
distinct from a stated `[key=default]`, matching upstream's
`status_declared_wait_line`; a captain hold is retracted by any `resolved`
line because the hold waits on firstmate's answer. Every declared-wait
gate reads that fold: `fm-crew-state.sh`, `fm-watch.sh`,
`fm-supervise-daemon.sh`, and `fm-push-transition-lib.sh`'s Herdr fast
path. The re-surface throttle is scoped to the declaration line rather
than the status-log signature. The daemon's captain-relevance and terminal
reads, and the watcher's wedge wait evidence, keep upstream's
`status_declared_wait_line` read.

Fork patch F6. Tracks kunchenguid#2713 (open); upstream PR
kunchenguid#4811 proposes a narrower cadence fix for the same
issue. Rebuilt on upstream a8572f6, whose 5587 introduced
`status_declared_wait_line` at these gates; each conflicting gate keeps
the standing fold on top of upstream's surrounding change.
@tiago-peixoto tiago-peixoto changed the title fix(bin): keep a declared pause on the bounded cadence whatever the agent's liveness fix(bin): keep declared paused/captain-held waits on the bounded recheck whatever the agent's liveness Sep 26, 2026
@tiago-peixoto tiago-peixoto changed the title fix(bin): keep declared paused/captain-held waits on the bounded recheck whatever the agent's liveness fix(bin): hold declared waits to the bounded recheck cadence whatever the agent's liveness Sep 28, 2026
@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Reviews (15) · Last reviewed commit: "Merge upstream main while preserving opt..." · Reviewed by Greptile

Comment thread bin/fm-watch.sh Resolved
Comment thread bin/fm-watch.sh Resolved
Comment thread bin/fm-watch.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @tiago-peixoto for keeping this current with main.

What changed since my 10-21 stamp: three merge-from-main commits (8f718900, 5a2de442, 8eec5615, up to main af1c6817) and a refreshed PR body. I compared the PR's own diff against main with the one I reviewed at 9b1a3e73. It's the same bin/fm-watch.sh / bin/fm-classify-lib.sh / tests / docs change. The only differences are two docs/configuration.md lines that pick up main's new config/wedge-defer-validating wording. GitHub reports it mergeable. Every check is green on 8eec5615 except Behavior portable parallel 2, and that's the same tests/fm-test-run.test.sh "packing exactly at the budget" failure main has right now. This PR doesn't touch that test. Your new live run covers 5 of 12 scenarios and the attestation check passes.

Where it stands: this is still a captain-decision hold, and it isn't waiting on you. It's new-default, because it replaces the liveness gate that docs/architecture.md specifies on main. So Kun makes the merge-or-leave call. Nothing more is needed from you.

VISION.md: One captain aligns · Authority aligns · Scripts aligns · Restart aligns · Delegation aligns (regression tests plus live runs) · Vendor aligns · Scope aligns.

@tiago-peixoto tiago-peixoto changed the title fix(bin): keep a declared pause on the bounded recheck cadence for every agent liveness fix(bin): keep the bounded pause recheck for standing declarations regardless of agent liveness Oct 27, 2026
@tiago-peixoto tiago-peixoto changed the title fix(bin): keep the bounded pause recheck for standing declarations regardless of agent liveness fix(bin): keep the pause cadence for a standing declaration whatever the agent's liveness Oct 28, 2026
Comment thread bin/fm-watch.sh Resolved
…n/fm-watch.sh. Invariant: a paused: declaration whose until time has elapsed gets its recheck once per declaration, not a cadence later, whatever the pane hash does. Sites checked: the stable-hash first sight (surface_nonterminal_stale already handles an elapsed until with a plain wake and the :due throttle), the stable-hash cadence arm and both secondmate arms (call handle_paused_stale unconditionally, which already fires an elapsed until at once via min_age=0), the busy-pane arm (untouched by earlier decision), and the ordinary-crew changed-hash arm (the one site with the status-age gate that blocked it). Change in the changed-hash arm: the age gate now also admits a declaration whose until time has passed, so handle_paused_stale fires the due recheck once per declaration; every other declaration keeps the cadence gate. Deviation from the literal instruction, reported rather than hidden: the elapsed until is admitted only once a second consecutive poll shows the hash still changing (read from the existing .count-<key> file before the branch resets it to 0; no new state). An unconditional pass-through made the existing test_paused_bg_job_until_timeout_rechecks_after_the_job_ends fail: for a pane that changes once and then settles, it pre-empted the plain first-sight wake with recheck wording, which the ci round 1 decision ("do not change first-sight behaviour") forbids. With the two-poll rule a settling pane keeps its plain first sight and a ticking pane is rechecked one poll later instead of up to FM_PAUSE_RESURFACE_SECS later. Test added in tests/fm-watch-triage-pause.test.sh: test_elapsed_until_on_a_never_settling_pane_is_rechecked_before_the_cadence (ordinary crew, paused: ... until 30s ago, status 500s old inside a 999s cadence, fake tmux whose capture changes every call): exactly one wake with the "declared clearing time has passed" wording, throttle recorded as :due, then a second round absorbs. It failed against the unfixed watcher ("held to the cadence instead of rechecked at once") and passes after the fix. docs/architecture.md gained one sentence describing the rule next to the never-settling-pane sentence. Verification: bash -n on both files passed. The single full run of tests/fm-watch-triage-pause.test.sh completed: 31 of 31 tests passed, none failed, exit code 0, including the new test and the sibling tests (bg-job until timeout, never-settling cadence, churn honors throttle, live paused until, until that passed, replacement wait throttle). ci-1 (transient npm 404) left untouched per instruction. No commit made; merge-only history preserved, no rebase or force-push
@tiago-peixoto tiago-peixoto changed the title fix(bin): keep the pause cadence for a standing declaration whatever the agent's liveness fix(bin): keep a declared pause on the bounded recheck cadence whatever the agent's liveness Oct 29, 2026
@tiago-peixoto tiago-peixoto changed the title fix(bin): keep a declared pause on the bounded recheck cadence whatever the agent's liveness fix(bin): keep a declared pause on the bounded recheck cadence regardless of agent liveness Nov 1, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @tiago-peixoto for keeping this current and for fixing the "Ended waits stay quiet" finding.

What changed since my 10-23 stamp (8eec5615): merges of main up to today, the fix in 7e8e6456 (an elapsed until on a never-settling pane is rechecked after the second consecutive changing poll, once per declaration, while a pane that changes once and settles keeps its plain first sight), and a comment touch-up in 0f9db275. Greptile is 5/5 on 0f9db275, every review thread is resolved, the quick checks pass, live validation is a go at 10 of 12, and it merges cleanly with main 41a47c09.

Waiting on you for one thing: the no-mistakes attestation for 0f9db275 shows the rebase step as skipped. Our merge gate now needs every step run on the current head, with no exceptions, including a rebase skip on a branch that already contains main. When you have a moment, could you re-raise this branch through no-mistakes so the attestation shows every step completed? The branch already contains main, so the rebase step should just pass. No force-push or history rewrite is needed from our side. Sorry for the extra round. This rule tightened after your last update.

After that, it goes back to Kun for the merge-or-leave call. Contract-class: new-default (unchanged), because it replaces the liveness gate that docs/architecture.md specifies on main. VISION.md: all seven rules still align.

@tiago-peixoto tiago-peixoto changed the title fix(bin): keep a declared pause on the bounded recheck cadence regardless of agent liveness fix(bin): keep the watcher's bounded pause cadence for standing declarations regardless of agent liveness Nov 3, 2026
@tiago-peixoto tiago-peixoto changed the title fix(bin): keep the watcher's bounded pause cadence for standing declarations regardless of agent liveness fix(bin): keep the watcher's pause cadence for standing declarations whatever the agent's liveness Nov 10, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @tiago-peixoto, and sorry again for the extra round. On 075129c1 the no-mistakes attestation binds the head with every step completed, rebase included, and nothing skipped. That clears my 11-01 ask. The branch now contains main 913bb7a7. I re-read the PR's own diff against main, and it's the same pause_state_class / churn-arm change I reviewed before, with this merge keeping main's opted-in overdue-pause decisions intact. The quick checks, the no-mistakes check and Greptile pass, every review thread is resolved, and live validation is go (10 of 10).

Status: waiting on us, not on you. The next step is the labelled full suite. We're holding new full-suite runs until main is green again, because main is currently red on an unrelated upstream Pi test break (#8325). After that it goes back to Kun for the merge-or-leave call, because the contract class is new-default (it replaces the liveness gate docs/architecture.md specifies on main). VISION: all rules align.

One optional tidy-up for whenever you next touch the body: Fixes #2713 is wrapped in backticks, so GitHub isn't linking the issue. Dropping the backticks fixes that. It doesn't hold anything up.

tiago-peixoto added a commit to tiago-peixoto/firstmate that referenced this pull request Nov 18, 2026
…t-PR branch PRs (#120)

* fix(bin): treat a declared wait as a standing declaration, not the log's last event

`state/<id>.status` is an append-only event log, and every declared-wait
gate read it last-event-wins. A worker that appended `paused: <external
wait>` kept its wedge-alarm suppression only until the next line landed,
from anyone: its own armed background reporter, a pipeline step notice, a
firstmate note. That line became the newest event, current state flipped
away from the declaration, the possible-wedge ladder restarted from zero,
and nothing reported that the suppression had been voided.

`status_standing_wait_line` in `bin/fm-classify-lib.sh` folds the log the
way keyed decisions are already folded: a `paused:` or `captain-held:` line
declares the wait, and only a line the worker writes to say its situation
changed - `done`, `needs-decision`, `blocked`, `failed`, `resolved`, or a
replacing declaration - retracts it. `working:`, `note:` and free-text
prose leave it standing. A `resolved` line retracts a pause only when it
carries the pause's own phase key, where a keyless line is its own phase
distinct from a stated `[key=default]`, matching upstream's
`status_declared_wait_line`; a captain hold is retracted by any `resolved`
line because the hold waits on firstmate's answer. Every declared-wait
gate reads that fold: `fm-crew-state.sh`, `fm-watch.sh`,
`fm-supervise-daemon.sh`, and `fm-push-transition-lib.sh`'s Herdr fast
path. The re-surface throttle is scoped to the declaration line rather
than the status-log signature. The daemon's captain-relevance and terminal
reads, and the watcher's wedge wait evidence, keep upstream's
`status_declared_wait_line` read.

Fork patch F6. Tracks kunchenguid#2713 (open); upstream PR
kunchenguid#4811 proposes a narrower cadence fix for the same
issue. Rebuilt on upstream a8572f6, whose 5587 introduced
`status_declared_wait_line` at these gates; each conflicting gate keeps
the standing fold on top of upstream's surrounding change.

Upstream issue: kunchenguid#2713 (open)
Upstream PR: kunchenguid#4811 (open)
(cherry picked from commit 4bfc53c)

* feat(spawn): lease Treehouse copies for the task lifetime

A process-bound `treehouse get` hold lapses when no process remains in
the copy, so a later `get` could be handed a live task's recorded
worktree while that task was merely idle between turns. Its next
relaunch, teardown, or worktree read then pointed at someone else's work.

Fresh ship and scout Treehouse spawns now acquire the copy with
`treehouse get --lease --lease-holder <task-id>` from the spawning
project instead of opening a process-bound subshell in the pane. A
leased worktree is never handed out by a later `get` and never removed by
prune, even with no process running inside it, until `treehouse return` -
and teardown returns it only after the landed-work test passes.

After acquiring, spawn refuses a copy that another live task in this home
or any locally registered home already records, including pre-lease tasks
whose hold has lapsed; a relaunch of the same task reuses the copy its own
record names. The pane is then seated with a top-level `cd` into the
leased path and polled until two consecutive reads agree on it. The
pool-slot ownership claim is kept alongside the lease, because that
marker is what teardown reads to leave a reassigned slot untouched.
Upstream spawn fixtures are taught the lease so tests added after this
patch keep passing.

The occupancy walk reuses upstream's fm_local_firstmate_state_dirs, the
same local-home set teardown reads, and a spawn that aborts before any
lease was armed skips the lease return.

Fork patch. Tracks kunchenguid#2754, kunchenguid#1924 and kunchenguid#947 (all
open); the upstream PR that carried this design, kunchenguid#2760, was closed by
its own author on 2026-09-21, not declined by the maintainer.

Upstream issue: kunchenguid#2754 (open); also kunchenguid#1924 and kunchenguid#947 (open)
Upstream PR: kunchenguid#2760 (closed unmerged by its author; the open issues above still track the defect)
(cherry picked from commit eacfbf4)

* fix(bin): lease a secondmate's worktree from its own clone (#64)

* fix(bin): lease a secondmate's worktree from its own clone

Treehouse names a pool by directory name and origin URL, not by clone
path, so a secondmate home's clone of a project shares the pool of the
main home's clone of the same origin. A spawn from the secondmate home
was handed a copy linked to the main home's clone, and Claude trust
pre-registration refused it ("is not a worktree of project"), so no
claude worker could start there.

Acquisition now holds such a copy leased while it retries, so Treehouse
cannot hand it out again and creates a copy from the spawning clone,
then returns the held copies. The trust refusal is unchanged for fresh
spawns. A relaunch of a task already recorded in another clone's copy
of the same origin registers trust against that clone, so existing work
can move to claude; an unrelated repository's copy is still refused.

Refs kunchenguid#4348

* test(pi): stop a killed fork from deleting the dead-lock fixture

The free-or-dead-lock case made its dead pid with `sleep 30 &` followed
at once by `kill`. A TERM that reaches the forked child before it drops
the suite's TERM trap runs fm_test_cleanup there, and the child shares
the suite's cleanup registry, so it deleted the fixture root while the
test kept running. CI saw the second extension load fail with
ERR_MODULE_NOT_FOUND. A child that exits on its own yields a dead pid
without sending any signal.

Upstream issue: kunchenguid#4348 (open)
Fork PR: #64
(cherry picked from commit 8cef12e)

* fix(bin): refresh the watcher beacon between slow poll phases (#65)

* fix(bin): refresh the watcher beacon between slow poll phases

A round of checks can outlast the liveness grace while the watcher is
still moving, so a live watcher is reported dead.
kunchenguid#5408

* fix(bin): treat a beacon generation change as the next poll

Mid-cycle liveness touches moved the beacon mtime during a slow round, so a cycle wait reaped the watcher before wedge classification.

Upstream issue: kunchenguid#5408 (open)
Fork PR: #65
Includes the wedge-suite fixture correction from fork PR #100 (fork commit 44a9daa), which reads a completed watcher poll from the beacon's generation rather than its modification time, because this carry refreshes that time between slow phases.
(cherry picked from commit c01eae6)

* fix(bin): carry the machine-capacity rule in every ship and scout brief (#76)

* fix(bin): carry the machine-capacity rule in every ship and scout brief

Ship and scout briefs said nothing about the heavy-run slots that every
Firstmate home on a machine shares, so each home hand-wrote its own copy
of the rule. One copy named a slot by a bare suffix, which two lanes
resolved to two different paths: each held a genuine lock and both ran
heavy suites at once.

fm-brief.sh now emits one "# Machine capacity" section in ship and scout
briefs. It spells each of this home's slot paths in full, in claim order,
states the 1-minute load bar, and sends every claim through the new
bin/fm-heavy-slot.sh. The helper claims a slot by one atomic mkdir of its
full path, records the task and a pid that lives for the whole heavy
command, and releases only the task's own slot. The slot list and load
bar come from config/heavy-suite-slots and config/heavy-suite-load.

* fix(bin): leave a project's own slot-claiming suite script unwrapped

A project on this server runs its full suite through its own script,
which claims a heavy slot by itself. Wrapped in fm-heavy-slot.sh as the
brief directed, that script would wait on the slot its own wrapper
already holds. The capacity rule now tells the worker to run such a
script as the project says instead.

Upstream issue: kunchenguid#4453 (open; a full-check limit for parallel workers on one machine)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #76
(cherry picked from commit d6d65e4)

Current successor: kunchenguid#8006 (open).

* fix(bin): serve heavy-slot waiters in arrival order and show live holders (#77)

Heavy-slot admission was bare mkdir contention, so a home whose tasks
released and retook a slot faster than another home polled could keep
it indefinitely. A waiter could not tell that starvation from honest
queuing behind working holders either: the owner pid was its only
liveness evidence, and a suite's short-lived processes leave any one pid
dead while the suite still works.

fm-heavy-slot.sh now refreshes the owner file's time while the command
runs, so its age shows a working holder even between a suite's
processes. Waiters keep a refreshed ticket in a queue beside the slots,
and a free slot goes to the longest live waiter that may use it. The new
status subcommand reads each slot as working, between commands, idle, or
stale, and the brief escalates only a holder not shown to be working.

Upstream issue: kunchenguid#4453 (open)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #77
(cherry picked from commit 27b3cc2)

Current successor: kunchenguid#8006 (open).

* fix(bin): let firstmate clear an abandoned heavy slot only on positive evidence (#78)

* test(heavy-slot): end fake suites when a failed test removes their directory

Two fake suites in tests/fm-heavy-slot.test.sh wait for a "go" file that
only the passing path creates. When a test failed first, the test root was
removed but the suite kept polling for a file that could no longer appear,
so it ran until someone killed it and held any pipe on the test's output
open. Each loop now also ends once its case directory is gone.

* fix(bin): let firstmate clear an abandoned heavy slot only on positive evidence

Nothing could tell an abandoned heavy slot from one whose suite still ran.
The owner pid is the launcher's, and a wrapper killed outright leaves its
suite running under other pids, so a sweep keyed on a dead pid would clear
a live slot and start a second suite beside it. Slots on this machine also
came in older shapes, plain files and bare-pid owner lines, that status
lumped together as unreadable.

fm-heavy-slot.sh run now exports FM_HEAVY_SLOT_HELD=<slot>:<task> into the
heavy command, so every process the suite starts carries the claim's mark.
The new clear subcommand is for firstmate only and removes one slot only
when the record is past its bound, no recorded pid is alive, no live
process carries the mark, and no no-mistakes pipeline step runs. It checks
the record's age last, so a slot claimed again during the scans is left
alone. Status now names plain-file claims and legacy owner lines, and the
brief tells workers that only firstmate clears a slot.

* fix(bin): refuse to clear a heavy slot the helper did not mark

clear derived a claim's mark from its owner line, so a claim written by
hand in that shape, or one with no pid at all, looked as if no process
carried its mark and cleared on age alone. All three slots live on this
machine today are hand-made claims, and one records no pid, so a suite
running under it would have been invisible to every check.

Every claim fm-heavy-slot.sh makes now holds a mark file, and run exports
that file's line as the mark. clear trusts only that file; any other claim
is refused unless firstmate passes --owner-ended after confirming the
owning task has ended, and the recorded-pid, pipeline-step, and age checks
still apply.

Upstream issue: kunchenguid#4453 (open)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #78
(cherry picked from commit 9430517)

Current successor: kunchenguid#8006 (open).

On macOS, clear refuses occupied slots even with --owner-ended because ps can hide a live process environment. The protected-process regression fails before this guard and passes afterward. Ordinary claim, run, and owner release are unchanged.

* fix(bin): relaunch a gone herdr worker into its own presentation space (#79)

When fm-control relaunch re-created a worker whose Herdr pane was gone,
fm-spawn always used the flat per-home container. A second mate runs
fm-control from its own pane, so the replacement tab landed inside the
second mate's own workspace instead of a presentation space of its own.

The rebind now follows the fresh-spawn placement rules in the recorded
session: the projected create moves into spawn_herdr_projection_create,
shared by both paths. A journal whose token workspace is positively gone
is retired first; a space that is still present or unreadable is left
untouched and the replacement falls back flat with a warning. A projected
replacement also gets the projection's abort cleanup.

tests/fm-control-relaunch.test.sh reproduces the defect against a
stateful stand-in Herdr. tests/fm-control-herdr-relaunch-space-e2e.test.sh
checks the same placement against real Herdr where a default session
exists, and skips elsewhere.

Upstream PR: kunchenguid#6700 (closed unmerged by its author; re-create a rebound herdr endpoint in its own presentation space)
Upstream issue: kunchenguid#5356 (open)
Fork PR: #79
Includes the Herdr fixture correction from fork PR #100 (fork commit 42f55e0): the inert opencode stand-in answers upstream's --version probe.
(cherry picked from commit 38b19bf)

* fix(bin): tell the no-mistakes validation handoff from the finished report (#86)

A no-mistakes worker was told to append done at commit time and again when
its pull request was green, so one status line could not say which event it
reported, and the handoff sentence did not name who starts the validation run.

The handoff line now opens with the fixed words 'ready for validation, not
pushed', and the instructions say that firstmate sends the /no-mistakes
instruction and the worker starts the run only then. A secondmate home no
longer publishes that handoff to its parent as finished work.

A bare done: {summary} from a worker launched on older instructions stays an
ungated handoff, as before.

Refs kunchenguid#7251

Upstream issue: kunchenguid#7251 (open)
Fork PR: #86
(cherry picked from commit 1e01205)

* fix: match Pi Codex quota accounts by recorded sign-in source (#92)

Upstream issue: kunchenguid#7483 (open)
Fork PR: #92
(cherry picked from commit 5b55c4a)

* fix(bin): read a green PR waiting on a merge as held, not finished (#75)

* fix(bin): read a green PR waiting on a merge as held, not finished

A secondmate home summary counted every in-flight child that
fm-crew-state.sh reads as done as terminal_in_flight. A no-mistakes ship
whose run passed reads done while its PR is still open and waiting on a
maintainer, so Bearings reported those homes as having unreconciled
books and the parent queued a reconcile request for each of them.

A done child whose run-step reading shows its PR still open is now a
child-state hold. Merged, closed, unknown, and status-log done readings
still count as terminal_in_flight, so a finished task that was never
cleaned up still reads as a mismatch.

* ci: expect the added Bearings regression test in the stock Bash count

The stock macOS Bash job pins the number of Bearings tests it must see.
The parked-PR regression test makes that 61.

Upstream PR: kunchenguid#7493 (open; same job), also kunchenguid#6565 (open)
Upstream issue: kunchenguid#3941 (open; related)
Fork PR: #75
(cherry picked from commit 5876427)

* fix(bin): require a handoff or disposition receipt to acknowledge a review with findings (#109)

Upstream issue: kunchenguid#8046

* fix(bin): keep a correlated reply distinct from the child's completion (#110)

Upstream issue: kunchenguid#8047

* fix(status): validate status event writes (#111)

Upstream issue: kunchenguid#8048

* fix(bin): refresh the watcher beacon between pane-scan windows (#113)

One pane scan reads every recorded window in turn. A pane seen stable for
the first time costs a current-state read, which can spend its whole
no-mistakes bound, so many windows together outlast the beacon grace while
the watcher is still working. The arm then refuses a live watcher with
"lock held by live pid ... but heartbeat is stale".

Refresh the beacon at the start of each window, as the check loop already
does between checks. One window whose reads hang past the grace still reads
stale.

Upstream issue: kunchenguid#8095

* feat(bin): deliver verified document snapshots with secondmate --doc reports (#114)

Capture document bytes before publishing a report and bind the report to their digest.
Verify remote bytes before making the snapshot available to the parent.
Preserve upstream interrupt cleanup for remote download temporary files.

Upstream PR: kunchenguid#8243
Fork PR: #114

* fix(bin): reuse unchanged pending-reply decisions within a tick (#115)

Reuse one decision fold while task status identity, contents, kind, and classification settings remain unchanged within a tick. Invalidate the cached verdict on changed evidence and keep calls outside a tick uncached.

Upstream PR: kunchenguid#8241

Fork PR: #115

* fix(bin): preserve Claude worker local settings during spawn and relaunch (#119)

* fix: preserve Claude worker settings during spawn and relaunch

* no-mistakes(test): Seed Claude worker settings from the primary clone

* no-mistakes(document): Document that local Claude settings seed workers

* fix(contributions): wake on an unanswered inline comment from an app bot

A GitHub App reviewer such as CodeRabbit posts inline findings as a Bot
account with no repository association, so the observer dropped them unless a
home listed the bot. Admit such an inline comment while its thread has no later
reply from the contribution author, and key it without the edit time so the
bot rewriting its own comment does not wake again.

* fix(pr-health): record a direct-PR ship's branch PR when no ready line names it

A direct-PR worker that reports readiness in other words, or only through a
paused merge wait, leaves no done line that a PR registration path reads, so the
task never records pr= and never arms a merge poll. The monitor already finds
the open PR on each live task copy's branch; record it through fm-pr-check.sh
for a direct-PR ship that has none. Other modes open their PR before the work
is ready, so they keep relying on their ready report.

Document both this and the app-bot inline comment admission in the
configuration reference, the script index and the ship-landing skill.

* fix(pr-health): never re-arm a merge poll on a PR whose merge was reported

After a merge the watcher retires the poll but keeps pr=, and the contribution
record can stay non-final for a pass, so branch registration skipped a PR the
merge poll already reported, as fm-pr-check.sh scan does. Also correct the
registration-scan section, which said pr= could only come from a manual run.

* ci: trigger checks after Actions were re-enabled on the fork

* no-mistakes(document): docs: state full direct-PR registration rule
@tiago-peixoto tiago-peixoto changed the title fix(bin): keep the watcher's pause cadence for standing declarations whatever the agent's liveness fix(watcher): make declaration-based pause cadence opt-in Nov 22, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @tiago-peixoto for the conversion.

What I checked on head 75a4bc59 (contains main 427056c4): I read the full diff against main. Every behavior change in bin/fm-watch.sh sits behind [ -e "$CONFIG/pause-cadence" ]. That covers both liveness gates in pause_state_class, the stable-hash paused) arm and the changing-hash paused) arm. Without the file, each branch short-circuits into main's exact path. The only new code on the default path is the churning read of the count file, and only the flagged branch uses it. config/ is gitignored, and no existing setting turns the flag on. The docs in docs/configuration.md and docs/architecture.md describe only the flagged behavior, and fm-classify-lib.sh changes a comment only. The no-mistakes attestation binds this head with every step completed and nothing skipped (live 7 of 7, including the unconfigured and existing-settings homes compared against main). Repo invariants, Test coverage guard and the no-mistakes check pass, and every review thread is resolved. The red Full suite row is only the unlabelled maintainer gate, so it doesn't count against you.

Contract class (my read): opt-in (it was new-default). An unconfigured home, or one using existing settings, keeps main's liveness gate, first-sight output and changing-pane handling.

Status: held until main is green. Main is still not green, so new full-suite runs are on hold. The full suite comes next. Because this PR was previously routed to Kun as new-default, I'm checking with Kun's side whether the reclassification changes that routing before anything lands.

One small ask: the body now says Fixes #2713. #2713 reports that the default watcher suppresses live declared waits. With this PR opt-in, that default stays as it is, so merging would close #2713 while it's still true for unconfigured homes. Please change it to Refs #2713, unless Kun decides the opt-in fully answers it.

VISION per-rule verdict:

  • One captain, one interface: aligns. Opted-in homes get one first-sight wake and then the bounded cadence instead of repeat stale noise.
  • Authority is explicit and never inferred: aligns. It's off unless the captain creates the file.
  • Scripts own the mechanics, agents own the judgment: aligns. The flag check and cadence are deterministic.
  • A restart is a non-event: aligns. Markers and the declaration-keyed throttle are on disk.
  • Delegation with a spine: aligns. Overdue pauses, review-parked lanes and secondmates keep their existing handling.
  • The fleet outlives any vendor: aligns. It uses the backend-neutral liveness and pane reads.
  • Scope: aligns.

tiago-peixoto added a commit to tiago-peixoto/firstmate that referenced this pull request Nov 25, 2026
…t-PR branch PRs (#120)

* fix(bin): treat a declared wait as a standing declaration, not the log's last event

`state/<id>.status` is an append-only event log, and every declared-wait
gate read it last-event-wins. A worker that appended `paused: <external
wait>` kept its wedge-alarm suppression only until the next line landed,
from anyone: its own armed background reporter, a pipeline step notice, a
firstmate note. That line became the newest event, current state flipped
away from the declaration, the possible-wedge ladder restarted from zero,
and nothing reported that the suppression had been voided.

`status_standing_wait_line` in `bin/fm-classify-lib.sh` folds the log the
way keyed decisions are already folded: a `paused:` or `captain-held:` line
declares the wait, and only a line the worker writes to say its situation
changed - `done`, `needs-decision`, `blocked`, `failed`, `resolved`, or a
replacing declaration - retracts it. `working:`, `note:` and free-text
prose leave it standing. A `resolved` line retracts a pause only when it
carries the pause's own phase key, where a keyless line is its own phase
distinct from a stated `[key=default]`, matching upstream's
`status_declared_wait_line`; a captain hold is retracted by any `resolved`
line because the hold waits on firstmate's answer. Every declared-wait
gate reads that fold: `fm-crew-state.sh`, `fm-watch.sh`,
`fm-supervise-daemon.sh`, and `fm-push-transition-lib.sh`'s Herdr fast
path. The re-surface throttle is scoped to the declaration line rather
than the status-log signature. The daemon's captain-relevance and terminal
reads, and the watcher's wedge wait evidence, keep upstream's
`status_declared_wait_line` read.

Fork patch F6. Tracks kunchenguid#2713 (open); upstream PR
kunchenguid#4811 proposes a narrower cadence fix for the same
issue. Rebuilt on upstream a8572f6, whose 5587 introduced
`status_declared_wait_line` at these gates; each conflicting gate keeps
the standing fold on top of upstream's surrounding change.

Upstream issue: kunchenguid#2713 (open)
Upstream PR: kunchenguid#4811 (open)
(cherry picked from commit 4bfc53c)

* feat(spawn): lease Treehouse copies for the task lifetime

A process-bound `treehouse get` hold lapses when no process remains in
the copy, so a later `get` could be handed a live task's recorded
worktree while that task was merely idle between turns. Its next
relaunch, teardown, or worktree read then pointed at someone else's work.

Fresh ship and scout Treehouse spawns now acquire the copy with
`treehouse get --lease --lease-holder <task-id>` from the spawning
project instead of opening a process-bound subshell in the pane. A
leased worktree is never handed out by a later `get` and never removed by
prune, even with no process running inside it, until `treehouse return` -
and teardown returns it only after the landed-work test passes.

After acquiring, spawn refuses a copy that another live task in this home
or any locally registered home already records, including pre-lease tasks
whose hold has lapsed; a relaunch of the same task reuses the copy its own
record names. The pane is then seated with a top-level `cd` into the
leased path and polled until two consecutive reads agree on it. The
pool-slot ownership claim is kept alongside the lease, because that
marker is what teardown reads to leave a reassigned slot untouched.
Upstream spawn fixtures are taught the lease so tests added after this
patch keep passing.

The occupancy walk reuses upstream's fm_local_firstmate_state_dirs, the
same local-home set teardown reads, and a spawn that aborts before any
lease was armed skips the lease return.

Fork patch. Tracks kunchenguid#2754, kunchenguid#1924 and kunchenguid#947 (all
open); the upstream PR that carried this design, kunchenguid#2760, was closed by
its own author on 2026-09-21, not declined by the maintainer.

Upstream issue: kunchenguid#2754 (open); also kunchenguid#1924 and kunchenguid#947 (open)
Upstream PR: kunchenguid#2760 (closed unmerged by its author; the open issues above still track the defect)
(cherry picked from commit eacfbf4)

* fix(bin): lease a secondmate's worktree from its own clone (#64)

* fix(bin): lease a secondmate's worktree from its own clone

Treehouse names a pool by directory name and origin URL, not by clone
path, so a secondmate home's clone of a project shares the pool of the
main home's clone of the same origin. A spawn from the secondmate home
was handed a copy linked to the main home's clone, and Claude trust
pre-registration refused it ("is not a worktree of project"), so no
claude worker could start there.

Acquisition now holds such a copy leased while it retries, so Treehouse
cannot hand it out again and creates a copy from the spawning clone,
then returns the held copies. The trust refusal is unchanged for fresh
spawns. A relaunch of a task already recorded in another clone's copy
of the same origin registers trust against that clone, so existing work
can move to claude; an unrelated repository's copy is still refused.

Refs kunchenguid#4348

* test(pi): stop a killed fork from deleting the dead-lock fixture

The free-or-dead-lock case made its dead pid with `sleep 30 &` followed
at once by `kill`. A TERM that reaches the forked child before it drops
the suite's TERM trap runs fm_test_cleanup there, and the child shares
the suite's cleanup registry, so it deleted the fixture root while the
test kept running. CI saw the second extension load fail with
ERR_MODULE_NOT_FOUND. A child that exits on its own yields a dead pid
without sending any signal.

Upstream issue: kunchenguid#4348 (open)
Fork PR: #64
(cherry picked from commit 8cef12e)

* fix(bin): refresh the watcher beacon between slow poll phases (#65)

* fix(bin): refresh the watcher beacon between slow poll phases

A round of checks can outlast the liveness grace while the watcher is
still moving, so a live watcher is reported dead.
kunchenguid#5408

* fix(bin): treat a beacon generation change as the next poll

Mid-cycle liveness touches moved the beacon mtime during a slow round, so a cycle wait reaped the watcher before wedge classification.

Upstream issue: kunchenguid#5408 (open)
Fork PR: #65
Includes the wedge-suite fixture correction from fork PR #100 (fork commit 44a9daa), which reads a completed watcher poll from the beacon's generation rather than its modification time, because this carry refreshes that time between slow phases.
(cherry picked from commit c01eae6)

* fix(bin): carry the machine-capacity rule in every ship and scout brief (#76)

* fix(bin): carry the machine-capacity rule in every ship and scout brief

Ship and scout briefs said nothing about the heavy-run slots that every
Firstmate home on a machine shares, so each home hand-wrote its own copy
of the rule. One copy named a slot by a bare suffix, which two lanes
resolved to two different paths: each held a genuine lock and both ran
heavy suites at once.

fm-brief.sh now emits one "# Machine capacity" section in ship and scout
briefs. It spells each of this home's slot paths in full, in claim order,
states the 1-minute load bar, and sends every claim through the new
bin/fm-heavy-slot.sh. The helper claims a slot by one atomic mkdir of its
full path, records the task and a pid that lives for the whole heavy
command, and releases only the task's own slot. The slot list and load
bar come from config/heavy-suite-slots and config/heavy-suite-load.

* fix(bin): leave a project's own slot-claiming suite script unwrapped

A project on this server runs its full suite through its own script,
which claims a heavy slot by itself. Wrapped in fm-heavy-slot.sh as the
brief directed, that script would wait on the slot its own wrapper
already holds. The capacity rule now tells the worker to run such a
script as the project says instead.

Upstream issue: kunchenguid#4453 (open; a full-check limit for parallel workers on one machine)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #76
(cherry picked from commit d6d65e4)

Current successor: kunchenguid#8006 (open).

* fix(bin): serve heavy-slot waiters in arrival order and show live holders (#77)

Heavy-slot admission was bare mkdir contention, so a home whose tasks
released and retook a slot faster than another home polled could keep
it indefinitely. A waiter could not tell that starvation from honest
queuing behind working holders either: the owner pid was its only
liveness evidence, and a suite's short-lived processes leave any one pid
dead while the suite still works.

fm-heavy-slot.sh now refreshes the owner file's time while the command
runs, so its age shows a working holder even between a suite's
processes. Waiters keep a refreshed ticket in a queue beside the slots,
and a free slot goes to the longest live waiter that may use it. The new
status subcommand reads each slot as working, between commands, idle, or
stale, and the brief escalates only a holder not shown to be working.

Upstream issue: kunchenguid#4453 (open)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #77
(cherry picked from commit 27b3cc2)

Current successor: kunchenguid#8006 (open).

* fix(bin): let firstmate clear an abandoned heavy slot only on positive evidence (#78)

* test(heavy-slot): end fake suites when a failed test removes their directory

Two fake suites in tests/fm-heavy-slot.test.sh wait for a "go" file that
only the passing path creates. When a test failed first, the test root was
removed but the suite kept polling for a file that could no longer appear,
so it ran until someone killed it and held any pipe on the test's output
open. Each loop now also ends once its case directory is gone.

* fix(bin): let firstmate clear an abandoned heavy slot only on positive evidence

Nothing could tell an abandoned heavy slot from one whose suite still ran.
The owner pid is the launcher's, and a wrapper killed outright leaves its
suite running under other pids, so a sweep keyed on a dead pid would clear
a live slot and start a second suite beside it. Slots on this machine also
came in older shapes, plain files and bare-pid owner lines, that status
lumped together as unreadable.

fm-heavy-slot.sh run now exports FM_HEAVY_SLOT_HELD=<slot>:<task> into the
heavy command, so every process the suite starts carries the claim's mark.
The new clear subcommand is for firstmate only and removes one slot only
when the record is past its bound, no recorded pid is alive, no live
process carries the mark, and no no-mistakes pipeline step runs. It checks
the record's age last, so a slot claimed again during the scans is left
alone. Status now names plain-file claims and legacy owner lines, and the
brief tells workers that only firstmate clears a slot.

* fix(bin): refuse to clear a heavy slot the helper did not mark

clear derived a claim's mark from its owner line, so a claim written by
hand in that shape, or one with no pid at all, looked as if no process
carried its mark and cleared on age alone. All three slots live on this
machine today are hand-made claims, and one records no pid, so a suite
running under it would have been invisible to every check.

Every claim fm-heavy-slot.sh makes now holds a mark file, and run exports
that file's line as the mark. clear trusts only that file; any other claim
is refused unless firstmate passes --owner-ended after confirming the
owning task has ended, and the recorded-pid, pipeline-step, and age checks
still apply.

Upstream issue: kunchenguid#4453 (open)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #78
(cherry picked from commit 9430517)

Current successor: kunchenguid#8006 (open).

On macOS, clear refuses occupied slots even with --owner-ended because ps can hide a live process environment. The protected-process regression fails before this guard and passes afterward. Ordinary claim, run, and owner release are unchanged.

* fix(bin): relaunch a gone herdr worker into its own presentation space (#79)

When fm-control relaunch re-created a worker whose Herdr pane was gone,
fm-spawn always used the flat per-home container. A second mate runs
fm-control from its own pane, so the replacement tab landed inside the
second mate's own workspace instead of a presentation space of its own.

The rebind now follows the fresh-spawn placement rules in the recorded
session: the projected create moves into spawn_herdr_projection_create,
shared by both paths. A journal whose token workspace is positively gone
is retired first; a space that is still present or unreadable is left
untouched and the replacement falls back flat with a warning. A projected
replacement also gets the projection's abort cleanup.

tests/fm-control-relaunch.test.sh reproduces the defect against a
stateful stand-in Herdr. tests/fm-control-herdr-relaunch-space-e2e.test.sh
checks the same placement against real Herdr where a default session
exists, and skips elsewhere.

Upstream PR: kunchenguid#6700 (closed unmerged by its author; re-create a rebound herdr endpoint in its own presentation space)
Upstream issue: kunchenguid#5356 (open)
Fork PR: #79
Includes the Herdr fixture correction from fork PR #100 (fork commit 42f55e0): the inert opencode stand-in answers upstream's --version probe.
(cherry picked from commit 38b19bf)

* fix(bin): tell the no-mistakes validation handoff from the finished report (#86)

A no-mistakes worker was told to append done at commit time and again when
its pull request was green, so one status line could not say which event it
reported, and the handoff sentence did not name who starts the validation run.

The handoff line now opens with the fixed words 'ready for validation, not
pushed', and the instructions say that firstmate sends the /no-mistakes
instruction and the worker starts the run only then. A secondmate home no
longer publishes that handoff to its parent as finished work.

A bare done: {summary} from a worker launched on older instructions stays an
ungated handoff, as before.

Refs kunchenguid#7251

Upstream issue: kunchenguid#7251 (open)
Fork PR: #86
(cherry picked from commit 1e01205)

* fix: match Pi Codex quota accounts by recorded sign-in source (#92)

Upstream issue: kunchenguid#7483 (open)
Fork PR: #92
(cherry picked from commit 5b55c4a)

* fix(bin): read a green PR waiting on a merge as held, not finished (#75)

* fix(bin): read a green PR waiting on a merge as held, not finished

A secondmate home summary counted every in-flight child that
fm-crew-state.sh reads as done as terminal_in_flight. A no-mistakes ship
whose run passed reads done while its PR is still open and waiting on a
maintainer, so Bearings reported those homes as having unreconciled
books and the parent queued a reconcile request for each of them.

A done child whose run-step reading shows its PR still open is now a
child-state hold. Merged, closed, unknown, and status-log done readings
still count as terminal_in_flight, so a finished task that was never
cleaned up still reads as a mismatch.

* ci: expect the added Bearings regression test in the stock Bash count

The stock macOS Bash job pins the number of Bearings tests it must see.
The parked-PR regression test makes that 61.

Upstream PR: kunchenguid#7493 (open; same job), also kunchenguid#6565 (open)
Upstream issue: kunchenguid#3941 (open; related)
Fork PR: #75
(cherry picked from commit 5876427)

* fix(bin): require a handoff or disposition receipt to acknowledge a review with findings (#109)

Upstream issue: kunchenguid#8046

* fix(bin): keep a correlated reply distinct from the child's completion (#110)

Upstream issue: kunchenguid#8047

* fix(status): validate status event writes (#111)

Upstream issue: kunchenguid#8048

* fix(bin): refresh the watcher beacon between pane-scan windows (#113)

One pane scan reads every recorded window in turn. A pane seen stable for
the first time costs a current-state read, which can spend its whole
no-mistakes bound, so many windows together outlast the beacon grace while
the watcher is still working. The arm then refuses a live watcher with
"lock held by live pid ... but heartbeat is stale".

Refresh the beacon at the start of each window, as the check loop already
does between checks. One window whose reads hang past the grace still reads
stale.

Upstream issue: kunchenguid#8095

* feat(bin): deliver verified document snapshots with secondmate --doc reports (#114)

Capture document bytes before publishing a report and bind the report to their digest.
Verify remote bytes before making the snapshot available to the parent.
Preserve upstream interrupt cleanup for remote download temporary files.

Upstream PR: kunchenguid#8243
Fork PR: #114

* fix(bin): reuse unchanged pending-reply decisions within a tick (#115)

Reuse one decision fold while task status identity, contents, kind, and classification settings remain unchanged within a tick. Invalidate the cached verdict on changed evidence and keep calls outside a tick uncached.

Upstream PR: kunchenguid#8241

Fork PR: #115

* fix(bin): preserve Claude worker local settings during spawn and relaunch (#119)

* fix: preserve Claude worker settings during spawn and relaunch

* no-mistakes(test): Seed Claude worker settings from the primary clone

* no-mistakes(document): Document that local Claude settings seed workers

* fix(contributions): wake on an unanswered inline comment from an app bot

A GitHub App reviewer such as CodeRabbit posts inline findings as a Bot
account with no repository association, so the observer dropped them unless a
home listed the bot. Admit such an inline comment while its thread has no later
reply from the contribution author, and key it without the edit time so the
bot rewriting its own comment does not wake again.

* fix(pr-health): record a direct-PR ship's branch PR when no ready line names it

A direct-PR worker that reports readiness in other words, or only through a
paused merge wait, leaves no done line that a PR registration path reads, so the
task never records pr= and never arms a merge poll. The monitor already finds
the open PR on each live task copy's branch; record it through fm-pr-check.sh
for a direct-PR ship that has none. Other modes open their PR before the work
is ready, so they keep relying on their ready report.

Document both this and the app-bot inline comment admission in the
configuration reference, the script index and the ship-landing skill.

* fix(pr-health): never re-arm a merge poll on a PR whose merge was reported

After a merge the watcher retires the poll but keeps pr=, and the contribution
record can stay non-final for a pass, so branch registration skipped a PR the
merge poll already reported, as fm-pr-check.sh scan does. Also correct the
registration-scan section, which said pr= could only come from a manual run.

* ci: trigger checks after Actions were re-enabled on the fork

* no-mistakes(document): docs: state full direct-PR registration rule
Upstream issue: maps to kunchenguid#8753 (app-bot inline comments)
Upstream issue: maps to kunchenguid#8754 (direct-PR branch PR record)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants