Skip to content

fix(bin): treat a watcher beacon stamped ahead of the clock as fresh - #8720

Merged
kunchenguid merged 2 commits into
kunchenguid:mainfrom
mikeastwoody:fm/fm-8426-watcher-negative-age
Nov 26, 2026
Merged

kunchenguid merged 2 commits into
kunchenguid:mainfrom
mikeastwoody:fm/fm-8426-watcher-negative-age

Conversation

@mikeastwoody

@mikeastwoody mikeastwoody commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Speaking as mikeastwoody's firstmate: approved contribution to #8426, chosen from a shortlist of ready-for-pr issues.

Substance of the approved issue: bin/fm-guard.sh prints the full "WATCHER DOWN - SUPERVISION IS OFF" banner while the watcher is healthy whenever the liveness beacon's mtime is one or two seconds ahead of the guard's clock read; the banner itself shows "last beat: -2s ago". fm_path_age in bin/fm-wake-lib.sh returns now - mtime, so such a beacon gives a negative age, and fm_watcher_supervision_verdict runs that age through a ''|*[!0-9]*) digit test that treats -1 or -2 as not a number and leaves the beacon not fresh. A beacon stamped slightly ahead of the clock is fresh, as the strict check fm_watcher_healthy already treats it: clamp a negative age to zero before the digit test, and add a guard fixture test with the beacon mtime at now + 2 that must not print the banner. Contract class (maintainer triage): restore.

What Changed

  • fm_watcher_supervision_verdict in bin/fm-wake-lib.sh now sets a negative beacon age to zero before its digit check. A .last-watcher-beat whose mtime is slightly ahead of the guard's clock now counts as fresh, which matches fm_watcher_healthy. Before this change, such a beacon failed the check as "not a number" and fm-guard.sh printed the "WATCHER DOWN" banner with a negative "last beat" age.
  • Added test_autoarm_future_beacon_is_fresh_not_a_banner to tests/fm-guard-stale-banner.test.sh. It sets the beacon mtime to now + 2s and asserts that the auto-arm guard prints nothing.
  • Updated the coverage list in docs/turnend-guard.md to include the future-stamped beacon case.

Risk Assessment

✅ Low: The change is a two-line clamp that only affects a negative age, which only a beacon stamped ahead of the clock can produce. It matches how fm_watcher_healthy already treats that case. The new test runs fm-guard.sh and asserts the issue's stated behaviour, and it would have failed before the fix.

Testing

I ran the real fm-guard.sh against disposable lab homes made with fm-lab-home.sh, at the target commit and at the base commit. With the beacon 1–2 s ahead of the clock, the base guard printed the full WATCHER DOWN banner ("last beat: -1s ago"). The fixed guard printed nothing. As adversarial checks, a beacon at 0 s stayed silent, and a 600 s-old beacon and a missing beacon still raised the banner with the right reason. I ran the new fixture test on its own in throwaway copies: it passes with the fix and fails with the base library, reproducing the reported "-2s ago" banner. The full test file fails at the unrelated Windows-tagged extension case on this macOS host, at both base and target. There is no UI change, so the CLI transcripts are the evidence. Result: go.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Operator runs fm-guard while the watcher beacon is stamped 2s ahead of the clock (autoarm model, lab home): no WATCHER DOWN banner ✅ pass live fm-guard-future-beacon-transcript.txt: [TARGET e3e8c6a] beacon_offset=2s -> exit=0, empty output
Regression reproduction: same 2s/1s future beacon on base 6891844 prints the false banner with a negative 'last beat' ✅ pass live fm-guard-future-beacon-transcript.txt: [BASE 6891844] beacon_offset=2s and 1s -> full banner 'last beat: -1s ago'; new-test-red-green.log shows 'last beat: -2s ago' with the fix reverted
Beacon stamped 1s ahead and exactly now: guard stays silent ✅ pass live fm-guard-future-beacon-transcript.txt: [TARGET] offsets 1s and 0s -> empty output
Adversarial: a genuinely stale beacon (600s old, grace 300) still prints the WATCHER DOWN banner after the clamp ✅ pass live fm-guard-future-beacon-transcript.txt: [TARGET] offset=-600s -> banner 'last beat: 600s ago, grace 300s'
Adversarial: a missing beacon still prints the WATCHER DOWN banner (last beat: never) ✅ pass live fm-guard-future-beacon-transcript.txt: [TARGET] beacon none -> banner 'last beat: never'
New fixture test test_autoarm_future_beacon_is_fresh_not_a_banner fails before the fix and passes after it ✅ pass live new-test-red-green.log: target -> ok (exit 0); base fm-wake-lib.sh -> not ok with the WATCHER DOWN banner (exit 1)
Evidence: fm-guard CLI transcript: future/zero/stale/missing beacon, target vs base

Source: fm-guard CLI transcript: future/zero/stale/missing beacon, target vs base

=== [TARGET e3e8c6ae] model=autoarm beacon_offset=2s grace=300 ===
exit=0
(guard output: empty - no banner)
=== [BASE 68918448] model=autoarm beacon_offset=2s grace=300 ===
exit=0
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: -1s ago, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
=== [TARGET e3e8c6ae] model=autoarm beacon_offset=1s grace=300 ===
exit=0
(guard output: empty - no banner)
=== [BASE 68918448] model=autoarm beacon_offset=1s grace=300 ===
exit=0
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: -1s ago, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
=== [TARGET e3e8c6ae] model=autoarm beacon_offset=0s grace=300 ===
exit=0
(guard output: empty - no banner)
=== [TARGET e3e8c6ae] model=autoarm beacon_offset=-600s grace=300 ===
exit=0
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: 600s ago, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
=== [TARGET e3e8c6ae] model=autoarm beacon_offset=nones grace=300 ===
exit=0
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Evidence: New fixture test: passes with the fix, fails with the base fm-wake-lib.sh

Source: New fixture test: passes with the fix, fails with the base fm-wake-lib.sh

\### target e3e8c6ae (fix + new test)
ok - fm-guard stale banner: auto-arm fresh beacon without a live watcher is healthy
ok - fm-guard stale banner: a beacon slightly ahead of the clock is fresh
ok - fm-guard stale banner: auto-arm stale beacon alarms with the true reason
ok - fm-guard stale banner: auto-arm stale episode stays one episode across calls
exit=0

\### target test with base 68918448 bin/fm-wake-lib.sh (fix reverted)
ok - fm-guard stale banner: auto-arm fresh beacon without a live watcher is healthy
not ok - a future-stamped beacon printed the banner (unexpected: 'WATCHER DOWN')
--- output ---
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: -2s ago, grace 999s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
exit=1
  • Outcome: ⚠️ 1 info across 1 run (1m49s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-inbox.sh:879 - This was already there before the change and sits outside the intent's scope, which names only the guard. fm-inbox.sh runs a beacon age from fm_path_age through the same ''|*[!0-9]*) test. A beacon stamped 1-2s ahead of the clock therefore gives beacon_age_seconds: null (unknown) in the inbox status JSON, when the beacon is in fact fresh. Nothing breaks: it only affects what the status shows, and no supervision decision is made from it. If this behaviour should be consistent everywhere, the place to fix it is fm_path_age itself, by clamping a negative age to 0. That would cover fm-guard, fm-inbox and the display in fm-watch-arm's report_attached together. It is not required for False "WATCHER DOWN" banner when the liveness beacon mtime is slightly ahead of the clock (negative age fails the digit test) #8426.
⚠️ **Test** - 1 info
  • ℹ️ tests/fm-guard-stale-banner.test.sh:688 - This is not caused by this change. On this macOS host, tests/fm-guard-stale-banner.test.sh stops at test_extension_handoff_with_tagged_windows_session: the 'live' case prints the banner with 'last beat: unknown'. The same failure happens at base 6891844, so it is pre-existing and depends on the host. Because the file exits at that test, the run never reaches the new test, so I validated the autoarm subset on its own.
  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Operator runs fm-guard while the watcher beacon is stamped 2s ahead of the clock (autoarm model, lab home): no WATCHER DOWN banner ✅ pass live fm-guard-future-beacon-transcript.txt: [TARGET e3e8c6a] beacon_offset=2s -> exit=0, empty output
Regression reproduction: same 2s/1s future beacon on base 6891844 prints the false banner with a negative 'last beat' ✅ pass live fm-guard-future-beacon-transcript.txt: [BASE 6891844] beacon_offset=2s and 1s -> full banner 'last beat: -1s ago'; new-test-red-green.log shows 'last beat: -2s ago' with the fix reverted
Beacon stamped 1s ahead and exactly now: guard stays silent ✅ pass live fm-guard-future-beacon-transcript.txt: [TARGET] offsets 1s and 0s -> empty output
Adversarial: a genuinely stale beacon (600s old, grace 300) still prints the WATCHER DOWN banner after the clamp ✅ pass live fm-guard-future-beacon-transcript.txt: [TARGET] offset=-600s -> banner 'last beat: 600s ago, grace 300s'
Adversarial: a missing beacon still prints the WATCHER DOWN banner (last beat: never) ✅ pass live fm-guard-future-beacon-transcript.txt: [TARGET] beacon none -> banner 'last beat: never'
New fixture test test_autoarm_future_beacon_is_fresh_not_a_banner fails before the fix and passes after it ✅ pass live new-test-red-green.log: target -> ok (exit 0); base fm-wake-lib.sh -> not ok with the WATCHER DOWN banner (exit 1)
  • bin/fm-lab-home.sh create disposable lab home + real bin/fm-guard.sh (FM_SUPERVISION_MODEL=autoarm, FM_GUARD_GRACE=300) with the beacon stamped at now+2 and now+1, at target e3e8c6ae and at base 68918448 (git archive copy)
  • Same driver at target with beacon offsets 0s, -600s (stale), and no beacon file
  • tests/fm-guard-stale-banner.test.sh (autoarm subset in a throwaway git-archive copy: fresh, future (new), stale, stale-episode) at target → all ok
  • Same autoarm subset with only bin/fm-wake-lib.sh reverted to base 68918448 → new test not ok with the reported last beat: -2s ago banner (red-before / green-after)
  • Full tests/fm-guard-stale-banner.test.sh at target and at base: both stop at the same unrelated test_extension_handoff_with_tagged_windows_session failure
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

Issues

Closes #8426

fm_watcher_supervision_verdict ran a negative beacon age through its digit
test, so a beacon one or two seconds ahead of the guard's clock read left the
watcher looking down and printed the full banner. Clamp a negative age to 0
before the test, matching fm_watcher_healthy.
@kunchenguid kunchenguid added the full-ci Maintainer go-ahead: run the full CI suite on this outside pull request label Nov 24, 2026
@kunchenguid
kunchenguid merged commit f3ddbd0 into kunchenguid:main Nov 26, 2026
44 of 45 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @mikeastwoody — really appreciate you taking the time on this.

rub-a-dub-dub added a commit to rub-a-dub-dub/firstmate that referenced this pull request Nov 27, 2026
* ci: pack every job to ~15 min from measured timings, warn at 20 min, faster lint (kunchenguid#8431)

* Port of kunchenguid#7390: per-secondmate Treehouse pool outside the home (kunchenguid#8718)

* fix(bin): spawn a secondmate's ships from a pool of its own clone

Treehouse names a pool from the repository basename and origin URL alone, so a
secondmate home's standalone clone of a project resolved to the same default
pool as the root home's clone, whose slots are worktrees of the root clone.
fm-spawn then stopped at Claude trust registration with "not a worktree of
project".

The root home keeps Treehouse's default pool unchanged. Every other local home
now passes `treehouse --root <home state>/treehouse get`, so its slots are
worktrees of its own clone; a remote home is the root of its own machine and
keeps the default. The worktree-of-project checks are untouched.

* fix(bin): require treehouse --root support at bootstrap

A local secondmate spawn now types `treehouse --root <dir> get`, and --root
arrived in treehouse 2.2.0 while --lease dates from 1.8.0, so a treehouse that
passed the lease-only gate could still lack it. Bootstrap now reports such an
install as an upgrade request.

* no-mistakes(test): Teach secondmate-pool test fake tmux to list windows

* no-mistakes(document): Raise CI Treehouse pin to 2.3.0 for --root

* test(spawn): cover a local secondmate's Herdr lease from its own pool

* fix(bin): keep secondmate Treehouse pools outside the home

Root a local secondmate's pool at
${TREEHOUSE_ROOT:-$HOME/.treehouse}/fm-secondmate/<home-id> so a slot's
ancestors never include that home's CLAUDE.md or AGENTS.md.

Co-authored-by: Kun Chen <[email protected]>

* fix(bin): refuse in-home Treehouse roots and drop secondmate pools on teardown

Review-2 corrections on the outside-home pool move: ignore a relative
TREEHOUSE_ROOT, refuse a root under the home, skip fm-secondmate pools in
the duplicate-clone check, drop the unused state-dir parameter, and remove
a secondmate's per-home pool when the home is removed.

Co-authored-by: Kun Chen <[email protected]>

---------

Co-authored-by: Hamish Gray <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Kun Chen <[email protected]>

* Raise Treehouse pin to 3.1.8 and floor to 3.0.1 (kunchenguid#8733)

* fix(bin): treat a watcher beacon stamped ahead of the clock as fresh (kunchenguid#8720)

* fix(guard): treat a beacon stamped ahead of the clock as fresh

fm_watcher_supervision_verdict ran a negative beacon age through its digit
test, so a beacon one or two seconds ahead of the guard's clock read left the
watcher looking down and printed the full banner. Clamp a negative age to 0
before the test, matching fm_watcher_healthy.

* no-mistakes(document): document future-stamped beacon guard coverage

* feat: follow captain-named PRs with direct outcome lines (kunchenguid#8598)

* feat: follow requested PRs without model turns

* no-mistakes(review): announce only new PR conditions; bound poll pass

* no-mistakes(review): validate check timeout; always read one follow

* no-mistakes(test): load private Calm mod copy in live follow test

* no-mistakes(document): index PR follow in script, layout and Calm docs

* fix: expose PR follow guidance only after opt-in

* no-mistakes(document): note opt-in follow line in session-start header

* no-mistakes(review): prove Pi follow surface by lock owner alone

* no-mistakes(review): accept only published follow surface values

* fix: tolerate missing Pi session start context

* no-mistakes(review): keep Calm replay and shown cursor in one sequence

* feat(bin): add opt-in answer words for captain-hold answers (kunchenguid#8161)

* Preserve selected captain answers

* no-mistakes(review): Guard option answers and keep one selected line

* no-mistakes(review): Say when the selected-answer line is absent

* no-mistakes(document): Document option-word guard and selected answer

* no-mistakes(ci): Fixed both Greptile findings in bin/fm-captain-hold.sh and extended tests/fm-captain-hold-lifecycle.test.sh. The timed-out prior agent had left uncommitted edits in this worktree covering both findings; I reviewed them, kept them, simplified the marker matching to one pattern set, and aligned the help text. ci-2 (spaces bypass the option guard). Invariant: an answer that is only an option selection never closes a call without its displayed words, regardless of surrounding blanks. is_option_selection now trims leading and trailing whitespace before matching, so both intake points (load_decision for direct `answer`, and the keyed `answers` row loop) reject `A ` and ` b`. The keyed label check uses a new is_blank helper, so a whitespace-only label counts as missing. The original answer and label text are still what gets stored. Help text for `answer` and `answers` now says surrounding blanks are ignored and a blank label skips the row. Tests: shapes `A ` and ` b` added to the direct-answer refusal loop and the keyed-answer skip loop, plus a keyed row `A` with label ` ` asserting the `skipped:` message and `held: yes`. ci-3 (first-line answers missed). Invariant: an `Answer as shown to the captain:` marker wins over `Answer:` wherever either appears, including on the first line. resolution_block now prefixes the decision text with one newline and matches `\nAnswer as shown to the captain: ` and `\nAnswer: ` against that prefixed text, so a first-line marker is found by the same pattern as any later line, and the displayed-answer arm is checked first. Multi-line text with no marker still writes no Selected answer line, and single-line free text is still selected whole. Tests: a decision file starting with `Answer: Off until checks pass.` and one starting with `Answer as shown to the captain: ...` followed by `Answer: A`, both asserting `Selected answer: Off until checks pass.`. Verification: shellcheck -x passes on both files. A direct harness sourcing is_blank, is_option_selection, and resolution_block confirmed every reported sequence. bin/fm-test-run.sh tests/fm-captain-hold-lifecycle.test.sh ran the whole suite: every test passed up to the final one, test_archived_answer_in_a_user_configured_archive_satisfies_the_gate, which failed with "compatible tasks-axi is required". That test redirects HOME, and on this host tasks-axi is a node script behind a mise shim that refuses to run under a redirected HOME (mise "config not trusted" error, reproduced with HOME=tmpdir tasks-axi --version). It is a host environment issue, not caused by this change. Rerunning test_answer_records_and_closes, test_option_answers_keep_their_displayed_words, and both archive tests with /home/firstmate/.local/share/mise/installs/node/22.23.1/bin ahead on PATH passed all four. Changes are confined to bin/fm-captain-hold.sh and tests/fm-captain-hold-lifecycle.test.sh; no full-ci label was requested or added

* no-mistakes(review): Ignore blank answer labels and drop skill step 8

* no-mistakes(document): Document blank-label handling in keyed answers

* no-mistakes(ci): I added the missing interview example to `.agents/skills/captain-hold-lifecycle/SKILL.md`, under step 5 of the operating sequence. The Greptile Review finding ci-1 was correct: the step described the interview in prose but showed no concrete call. Invariant: the skill must show one concrete interview that registers a call, presents a keyed question, feeds the answer, and verifies closure. Step 5 is the only place in the changed area that describes the interview, so there are no sibling sites. The example uses task id `sample-start-state` and the question `Should the feature start enabled? A: Off until checks pass. B: On now.`. It shows three commands: `bin/fm-captain-hold.sh hold` to register the call, a `printf 'sample-start-state\tA\tOff until checks pass.\n'` row piped into `bin/fm-captain-hold.sh answers --source "captain interview"`, and `tasks-axi show sample-start-state --full`. A closing sentence says the last command must print `state: done` and `Selected answer: Off until checks pass.`. I took the command shapes and expected output from the existing test `test_option_answers_keep_their_displayed_words` in `tests/fm-captain-hold-lifecycle.test.sh` and from the usage header of `bin/fm-captain-hold.sh`. The example omits `--repo` because `hold` defaults a new task's repo to `firstmate`. The change is 11 added lines in that one file. I changed no code and no tests. Not tested: I did not run the example commands or any test suite, because the driver instructions for this round say it is documentation-only and to run no tests. The commit named in the driver instructions (38e0f30) touches only `bin/fm-captain-hold.sh` and the test file, so it took no example away from the skill

* fix: make answer-word enforcement opt-in

* no-mistakes(review): List hold-answer-words in home layout inventory

* fix: publish extension packages on macOS before making them read-only (kunchenguid#8744)

installPackage made the staged package root 0555 and then renamed it into
the content-addressed store. macOS rename(2) refuses to move a directory its
owner cannot write, so every extension package install failed with EACCES.
Keep the staged root owner-writable for the rename, then set the installed
root to 0555; installed-package validation is unchanged.

tests/fm-extension-binding.test.sh restores owner write before moving an
installed package aside and restores 0555 when moving it back.

Fixes kunchenguid#8739.

* fix: report an incompatible remote tasks-axi as OUTDATED (kunchenguid#8743)

bin/fm-remote-doctor.sh reported an installed but incompatible tasks-axi as
`required tasks-axi=MISSING (incompatible)`, telling the operator to install a
tool that is already present. It now reports `OUTDATED (incompatible)` while
an absent tasks-axi stays `MISSING`; both still fail readiness and name
tasks-axi among the required-tool gaps, and the worker-probe parser accepts
an OUTDATED result instead of rejecting the probe as invalid.

The entrypoint's pinned DOCTOR_SHA256 follows the new doctor bytes.

Fixes kunchenguid#8740

* feat(bin): add opt-in reports to the PR health monitor (kunchenguid#8773)

* feat(bin): add opt-in reports to the PR health monitor

Each new report needs its own config file and stays off until that file exists.
A failing check, required or not, wakes only after a second pass still sees it.
Approved and green never starts a merge.
A merged or closed pull request names the account once and is not read again.
A change request on an older commit waits on the reviewer.

* no-mistakes(review): Baseline already-final PRs silently when final report is on

* no-mistakes(review): Gate final report on open_seen marker

* no-mistakes(review): Drop open_seen on flag-off reads

* no-mistakes(review): Clear open_seen on each flag-off poll

* fix(lock): never record an omp daemon worker as the session (kunchenguid#8731)

omp's daemon broker (omp __omp_worker_daemon_broker) runs every bash call made with name, carries the bare process name omp, and is shared by every omp in one project directory, so it outlives sessions and its parent is whichever omp started it. A named bin/fm-session-start.sh call recorded the broker in state/.lock, which then pinned the home's lock: every later session saw another live firstmate session holding it and supervision never started (omp 18.8.0-18.8.4).

The lock library now rejects omp __omp_worker_* processes as harnesses and stops its ancestry walk at one, so a worker-pinned lock reads stale and the session reclaims it, and a lock-taking script run under a worker refuses with a message naming the cause instead of recording the wrong pid. The omp protocol and harness reference say to run lock-taking scripts as ordinary bash calls.

(cherry picked from commit defe8dc)

Co-authored-by: Aviv Laufer <[email protected]>

* feat: add opt-in Pi Bash timeout cap (kunchenguid#8445)

* feat(pi): add opt-in bash timeout cap

* no-mistakes(review): Convert Pi Bash timeout caps from milliseconds to seconds

* no-mistakes(document): Clarify Pi Bash timeout configuration and scope

* no-mistakes(ci): Captain, added the missing test-duration hint and documented its provisional local measurement. The coverage guard now passes within both limits. Five focused test runs, lint, and documentation checks passed. Full suite remains blocked by the maintainer’s full-ci label requirement; that external approval condition needs no code change

* test(pi): isolate timeout test extension state

* no-mistakes(test): Reject Pi Bash timeout settings above native timer limit

* feat(pi): add opt-in bash timeout cap

* no-mistakes(review): Convert Pi Bash timeout caps from milliseconds to seconds

* no-mistakes(document): Clarify Pi Bash timeout configuration and scope

* no-mistakes(ci): Captain, added the missing test-duration hint and documented its provisional local measurement. The coverage guard now passes within both limits. Five focused test runs, lint, and documentation checks passed. Full suite remains blocked by the maintainer’s full-ci label requirement; that external approval condition needs no code change

* test(pi): isolate timeout test extension state

* no-mistakes(test): Reject Pi Bash timeout settings above native timer limit

* chore: align test runner with main timing source

* no-mistakes(review): Remove duplicate timeout timing note

---------

Co-authored-by: mehulbhagwani <[email protected]>
Co-authored-by: Pitch Perfekt Collective <[email protected]>
Co-authored-by: Kun Chen <[email protected]>

* fix: narrow Herdr presentation lock scope (kunchenguid#7430)

* fix(spawn): give presentation recovery a longer bounded lock wait

* no-mistakes(document): Updated Herdr lock-recovery documentation

* no-mistakes(document): Restored authoritative Herdr reclaim fallback rule

* no-mistakes(document): Clarified Herdr reclaim documentation ownership

* fix(spawn): release the Herdr presentation lock after the layout mutation

A clean projected create or an exact resume now holds the session-wide
Herdr presentation-order lock only for the projected layout mutation and
releases it before the remaining spawn setup and the launch handoff. A
concurrent recovery therefore no longer gives up while a sibling spawn
finishes unrelated setup. Abort cleanup still re-acquires the lock before
any projection cleanup.

This replaces the earlier longer recovery retry: a resume again makes one
bounded attempt and refuses on contention by default, and the e2e suite's
concurrent resume opts into --herdr-resume-lock-wait so the two recoveries
serialize.

* no-mistakes(review): Release presentation lock before allocation

* no-mistakes(test): Cover Herdr recovery lock scope deterministically

* no-mistakes(document): Consolidate Herdr reclaim recovery guidance

* no-mistakes(lint): Check replacement endpoint command status directly

* test(spawn): capture the lock holder pid outside a subshell

Run the projection lock holder as a backgrounded function so ShellCheck's
extended analysis no longer reports SC2031 on the parent's $! capture.

* test: make behavior fixtures portable and isolated on macOS (kunchenguid#8756)

* test: portable fixtures for macOS hosts and hermetic operator environments

Fixture-only changes so these suites pass on a macOS operator host and no
longer read or write the operator's live environment: a GNU stat shim
(fm_fake_gnu_stat) for fixtures that fake a non-Darwin uname, sed -i.bak,
canonical /tmp socket paths, a PATH_MAX-aware deep-path case,
order-independent directory reads and structurally built manifest
corruptions, FIFO gates in place of sleeps, scrubbed dispatch credentials,
a scratch FM_HOME in the spawn-batch and teardown cases, and wider bounds
in two timing-sensitive cases.

Fixes kunchenguid#8741

* no-mistakes(test): Fix watcher timing; extension install still blocked

* no-mistakes(test): Stabilize source race; extension install still blocked

* test: keep the late-launch check main-equivalent so it holds on non-exec bash

* no-mistakes(review): add missing fm-pi-bash-timeout serial timing hint row

* no-mistakes(review): revert out-of-scope fm-pr-poll quoting sweep to parent spelling

---------

Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Hamish Gray <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Kun Chen <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: Tiago <[email protected]>
Co-authored-by: YifuGu <[email protected]>
Co-authored-by: Tim Kleinschmidt <[email protected]>
Co-authored-by: Aviv Laufer <[email protected]>
Co-authored-by: Mehul Bhagwani <[email protected]>
Co-authored-by: mehulbhagwani <[email protected]>
Co-authored-by: Pitch Perfekt Collective <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Maintainer go-ahead: run the full CI suite on this outside pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False "WATCHER DOWN" banner when the liveness beacon mtime is slightly ahead of the clock (negative age fails the digit test)

2 participants