Repository navigation
feat(supervision): add resting vs active state for secondmate in-flight counting - #773
Freudator86 wants to merge 12 commits into
Conversation
1fbd0e3 to
5c2e3b1
Compare
|
Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for firstmate#773 at |
5c2e3b1 to
cd8252a
Compare
3d1265a to
842851d
Compare
|
Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for firstmate#773 at |
…ht counting A persistent secondmate's own state/<id>.meta counted as in-flight for stop-hook/turnend-guard supervision exactly like a crewmate/scout, so a secondmate that is deliberately idle-but-alive still blocked turn-end whenever its supervising primary had no fresh watcher beacon. kind=secondmate meta can now carry supervision=resting to exclude it from that count while staying fully alive; supervision=active and legacy meta with no field still count as before. Liveness probing/respawn and dormant registry entries are untouched - this is purely a supervision-counting change.
… leaked CLAUDECODE env var
…ion counting in remaining docs
secondmate_liveness_sweep() in bin/fm-bootstrap.sh no longer echoes a "respawned" success line (it went silent independently of this feature, matching the sibling test_sweep_respawns_confirmed_dead_secondmate case). The resting-vs-active test still asserted the old noisy behavior; update it to expect silence on success while still verifying via the tmux call log that kill-then-respawn actually happens, unaffected by supervision=resting.
Same-SHA commit d466792 was shared by closed PR #761 and current PR #773; the 'PR must be raised via no-mistakes' check resolved the old closed PR's context for that SHA. An empty commit gives GitHub a fresh SHA to key the check off of the correct, currently open PR.
Same-SHA commit d466792 was shared by closed PR #761 and current PR #773; the 'PR must be raised via no-mistakes' check resolved the old closed PR's context for that SHA. An empty commit gives GitHub a fresh SHA to key the check off of the correct, currently open PR.
… mis-merge The rebase's automatic conflict resolution picked the wrong side of a conflicting assertion in test_spawn_releases_orca_resources_when_metadata_write_fails, expecting "mkdir"/"xists" in the output. bin/fm-spawn.sh's metadata-write failure path is an unguarded `} > "$STATE/$ID.meta"` redirection with no preceding mkdir check, so the actual (and origin/main's original, correct) failure output is "Is a directory".
…to all Pi .ts-import tests"}
Behavior portable serial failed on cd8252a for an environment-specific reason unrelated to this branch's diff (test_send_conformance_old_vs_new's BASE_REF resolution behaves differently under the fork-PR checkout); every other check passed and the test suite is clean locally against the same commit. An empty commit gives GitHub a fresh SHA to re-evaluate against, consistent with the same recovery already used earlier in this PR (e94ce1b, 8f8d65b).
842851d to
cebf348
Compare
|
Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for firstmate#773 at |
|
Closing this ourselves. The upstream gap is real and still present, but this particular change has Still valid upstream: the liveness sweep counts every task metadata file, so a resting secondmate Why this change should not be the fix:
It also bundles three unrelated test fixes - roughly 90 of its 226 added lines - and now conflicts If an upstream port is wanted, the honest form is a fresh cut from the landed design with the |
Intent
Push already-reviewed content (PR #391) through the no-mistakes gate; PR #761 was closed because it was opened by a bare gh pr create and never carried the pipeline signature
What Changed
fm_sup_resting_secondmatetobin/fm-supervision-lib.shand wired it intofm_supervision_statusso a persistent secondmate whose meta is markedsupervision=restingis excluded from in-flight work counting (used byfm-guard.shandfm-turnend-guard.sh), while any other/absent value still counts as active for backward compatibility.supervision=meta field and resting/active semantics inAGENTS.md,docs/architecture.md, anddocs/turnend-guard.md, including when firstmate should set a secondmate to resting vs. active.tests/fm-turnend-guard.test.sh, a newtests/fm-secondmate-liveness.test.shverifyingsupervision=restingdoesn't affect liveness probing or respawn, and portability/assertion fixes acrosstests/fm-backend-orca.test.sh,tests/fm-session-start.test.sh,tests/fm-pi-watch-extension.test.sh, andtests/fm-watcher-lock.test.sh.Risk Assessment
✅ Low: The change adds a narrowly-scoped, opt-in exclusion (supervision=resting) to the shared in-flight predicate in fm-supervision-lib.sh, defaults safely to "active" when the field is absent (so no existing secondmate is silently dropped from supervision), is consumed consistently by the one real caller (fm-turnend-guard.sh) that matters, and is covered by direct unit tests for the predicate, the hook, and a liveness-sweep test proving the field has zero effect on respawn behavior; the remaining diff is test-portability fixes and documentation unrelated to functional risk.
Testing
Completed 1 recorded test check.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
⏭️ **Test** - skipped
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"✅ **Document** - passed
✅ No issues found.
⏭️ **Lint** - skipped
✅ **Push** - passed
✅ No issues found.