Repository navigation
feat(bin): put persistent second mates to sleep and wake them on purpose - #32
Conversation
bin/fm-secondmate-sleep.sh sleeps a registered local mate (persist its open work under the restart gate, exit its agent, stop its watcher, retire its process-event listeners, then write the parent-home state/<id>.asleep marker), wakes it through the guarded liveness relaunch, and reports status. Liveness recovery, the watcher's wake-loop check, startup convergence, config push, /updatefirstmate's restart pass, fm-send, and bearings all read the marker through bin/fm-secondmate-sleep-lib.sh and leave an asleep mate alone.
…clear teardown markers
…ause in sleep A decision-bound process-event source kept through sleep stays registered with its binding, but its runner stops once the sleeping home stops renewing the owner lease, so a board answer given meanwhile is queued by Lavish and captured only after wake. Wake now runs the mate home's own fm-procevent.sh reconcile once the agent is confirmed live, so that listener relaunches at once, and the script header, the persist request, and the secondmate-provisioning section say so instead of promising capture during sleep.
…ping it A mate whose agent was stopped at admission needs no persist answer, but a liveness relaunch could bring it back before its stop step, which then marked a running agent asleep. The stop step now probes again under the per-mate liveness lock and refuses at the agent step, unstopped, when the agent is back up. One probe helper now serves admission, the stop step, and wake. The wake test gives the woken home's real process-event machinery a real sleep: the case's shortened sleep stub raced the listener's launch on a loaded host.
Reviewer's GuideThis PR implements an explicit local-secondmate sleep lifecycle: it atomically records intent only after safely stopping the agent, watcher, and eligible listeners, prevents all automatic recovery and steering paths from reviving or contacting sleeping mates, and provides a guarded wake path that relaunches the mate and reconciles retained listeners, with shared restart persistence logic, documentation, and broad regression coverage. Sequence diagram for explicitly sleeping and waking a local secondmatesequenceDiagram
participant Operator
participant Parent as ParentHome
participant Mate as SecondmateHome
participant Agent
participant Listener as ProcessEventListeners
Operator->>Parent: fm-secondmate-sleep.sh sleep id --by who --reason text
Parent->>Parent: Check registered and idle
Parent->>Agent: fm_secondmate_persist_ask()
Agent-->>Parent: Correlated persistence answer
Parent->>Agent: fm-control.sh id exit
Parent->>Mate: fm-watch-arm.sh --stop
Parent->>Listener: Retire unbound sources
Parent->>Parent: fm_secondmate_asleep_write()
Note over Parent,Mate: Home data and durable work remain untouched
Operator->>Parent: fm-secondmate-sleep.sh wake id
Parent->>Parent: fm_secondmate_asleep_clear()
Parent->>Mate: fm-spawn.sh id --secondmate
Mate-->>Parent: Agent confirmed live
Parent->>Listener: procevent.sh reconcile
Listener-->>Mate: Retained listeners relaunch
State diagram for the secondmate sleep lifecyclestateDiagram-v2
[*] --> Awake
Awake --> Admission: sleep
Admission --> Refused: not registered, remote, or in-flight work
Admission --> Persisting: agent alive
Admission --> Stopping: agent already stopped
Persisting --> Refused: no correlated persistence answer
Persisting --> Stopping: answer received
Stopping --> Refused: agent changed, watcher/listener/marker step failed
Stopping --> Asleep: marker written
Asleep --> Asleep: automatic recovery and steering skipped
Asleep --> Waking: wake
Waking --> Awake: agent live and listeners reconciled
Waking --> Awake: marker absent noop
Waking --> RecoveryOwned: relaunch failed
RecoveryOwned --> Awake: liveness recovery
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 8 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="bin/fm-send.sh" line_range="463" />
<code_context>
T=$RESOLVED_TARGET
shift
+if [ -n "$TARGET_META" ] && [ "$(fm_meta_get "$TARGET_META" kind)" = secondmate ]; then
+ ASLEEP_ID=$(fm_send_id_from_meta "$TARGET_META")
+ if fm_secondmate_asleep "$STATE" "$ASLEEP_ID"; then
</code_context>
<issue_to_address>
**Sends reach a stopped mate**
When a send passes the marker check after sleep stops the agent but before it writes the marker, `fm-send` proceeds without coordinating with sleep, so it sends or records work for a stopped mate. The caller sees success for work the agent never receives, and the new marker prevents recovery from consuming it.
Serialize sends with the sleep transaction or otherwise ensure work accepted during sleep is durably queued for the mate.
Also at `bin/fm-secondmate-sleep.sh:339-359`.
</issue_to_address>
### Comment 2
<location path="bin/fm-secondmate-sleep.sh" line_range="339" />
<code_context>
+ esac
+ fi
+ if [ "${NEEDS_EXIT[i]}" = 1 ] && ! out=$(FM_HOME="$FM_HOME" FM_STATE_OVERRIDE="$STATE" \
+ "$SCRIPT_DIR/fm-control.sh" "$id" exit < /dev/null 2>&1); then
+ fm_secondmate_liveness_unlock "$id"
+ refuse "$i" agent "$(first_line "$out")"
</code_context>
<issue_to_address>
**Replacement agent stops without persistence**
When the agent that answered the persist request exits and a replacement becomes live before `stop_and_mark` acquires the liveness lock, `stop_and_mark` skips the under-lock agent probe when `NEEDS_EXIT[i]` is set and exits the replacement without asking it to persist. Its open conversational work can be lost.
Re-probe the agent under the liveness lock and request persistence from any replacement before exiting it.
</issue_to_address>
### Comment 3
<location path="bin/fm-secondmate-sleep.sh" line_range="284-286" />
<code_context>
+ return 1
+ ;;
+ esac
+ if ! out=$(run_in_mate_home "$home" fm-procevent.sh retire "$id" "${guard[@]+"${guard[@]}"}"); then
+ printf '%s: %s\n' "$id" "$(first_line "$out")"
+ return 1
+ fi
+ done
</code_context>
<issue_to_address>
**Failed sleep leaves listeners missing**
When a later listener retirement or another sleep step fails after the agent, watcher, or an earlier listener has already stopped, `retire_unbound_listeners` and `stop_and_mark` return without restoring earlier state. The sleep marker is absent, so the mate can resume with listeners permanently removed or with its agent or watcher stopped.
Make sleep failure transactional by restoring the agent, watcher, and any listeners already stopped or retired before returning.
Also at `bin/fm-secondmate-sleep.sh:344-357`.
</issue_to_address>
### Comment 4
<location path="bin/fm-secondmate-restart.sh" line_range="261-266" />
<code_context>
errors=0
while IFS='|' read -r id home _window meta; do
[ -n "$id" ] || continue
+ if fm_secondmate_asleep "$STATE" "$id"; then
+ printf 'secondmate %s: skipped - %s; its inherited material converges when it wakes\n' \
+ "$id" "$(fm_secondmate_asleep_line)"
+ continue
+ fi
if [ -z "$home" ]; then
printf 'secondmate %s: skipped - no home= in %s and no registry home\n' "$id" "$meta"
</code_context>
<issue_to_address>
**Restart runs behind sleep marker**
When a restart passes its asleep check and sleep completes before the restart launches the agent, `fm-secondmate-restart.sh` launches without rechecking the marker or coordinating through the liveness lock, leaving a running agent while the mate is reported as asleep and beyond liveness supervision.
Coordinate restart launch with sleep through the liveness lock and recheck the asleep marker before relaunching.
Also at `bin/fm-secondmate-sleep.sh:339-354`.
</issue_to_address>
### Comment 5
<location path="bin/fm-secondmate-sleep.sh" line_range="262-284" />
<code_context>
+ [ -e "$path" ] || [ -L "$path" ] || continue
+ id=${path##*/}
+ id=${id%.source}
+ if out=$(run_in_mate_home "$home" fm-captain-hold.sh binding "$id"); then
+ continue
+ elif [ -n "$out" ]; then
+ printf '%s: %s\n' "$id" "$(first_line "$out")"
+ return 1
+ fi
+ guard=()
+ if ! fm_procevent_source_lock_acquire "$id"; then
+ printf '%s: cannot lock the source\n' "$id"
+ return 1
+ fi
+ fm_procevent_extension_registration_load_locked "$home/state" "$id"
+ owner_state=$?
+ fm_procevent_source_lock_release "$id"
+ case "$owner_state" in
+ 0) guard=(--if-owner "$FM_PROCEVENT_EXTENSION_REGISTRATION_TOKEN") ;;
+ 1) ;;
+ *)
+ printf '%s: cannot safely read its registration owner\n' "$id"
+ return 1
+ ;;
+ esac
+ if ! out=$(run_in_mate_home "$home" fm-procevent.sh retire "$id" "${guard[@]+"${guard[@]}"}"); then
+ printf '%s: %s\n' "$id" "$(first_line "$out")"
+ return 1
</code_context>
<issue_to_address>
**Held call loses its listener**
When a captain-call binding is published after the binding lookup but before source retirement, `retire_unbound_listeners` retires the source despite the new binding, leaving the held call bound to a missing listener. Its answer is not captured after wake.
Make the binding check and source retirement atomic so a source with a newly published captain-call binding is not retired.
</issue_to_address>
### Comment 6
<location path="bin/fm-teardown.sh" line_range="3769" />
<code_context>
fm_backlog_atomic_transition remove "$STATE/$ID.meta" "task record" "$STATE" || return 1
rm -f -- "$STATE/$ID.turn-ended" "$STATE/$ID.progress" \
"$STATE/.secondmate-relaunch-$ID" "$STATE/.secondmate-relaunch-bound-$ID"
+ fm_secondmate_asleep_clear "$STATE" "$ID" || true
printf 'teardown %s complete (remote %s:%s)\n' "$ID" "$remote_host" "$remote_home"
return 0
</code_context>
<issue_to_address>
**Stale marker blocks a reprovisioned mate**
When sleep-marker removal fails, including when the marker path is a directory, `fm_secondmate_asleep_clear` cannot remove a directory with `rm -f`, and both teardown paths ignore its failure. Teardown can report completion while the marker remains, so a mate reprovisioned under that ID is treated as asleep and a directory marker cannot be cleared by wake.
Make marker clearing handle a directory marker and make teardown stop and report failure when marker removal fails.
Also at `bin/fm-teardown.sh:1010`, `bin/fm-secondmate-sleep-lib.sh:71`.
</issue_to_address>
### Comment 7
<location path="bin/fm-bearings-snapshot.sh" line_range="530-531" />
<code_context>
- reason:(.current.reason // "-")} ]) as $secondmates_all
+ reason:(.current.reason // "-")}
+ | if $asleep[.id] != null then
+ .state = "asleep" | .doing = ($asleep[.id].line | trunc(120)) | .reason = $asleep[.id].reason
+ else . end ]) as $secondmates_all
| ([ .tasks[]
| select(.kind != "secondmate")
</code_context>
<issue_to_address>
**Asleep homes lack a warning row**
When a consumer uses the snapshot's `gates` array for Charted Next, the asleep decoration changes only the secondmate projection; the snapshot's `gates` array is assembled from catch-up and queued work, with no asleep-home row. A consumer following the Bearings skill's instruction to show asleep homes in Charted Next therefore has no warning row to render from `gates`.
Project asleep secondmates into the warning-gate data consumed for Charted Next, or update the consumer contract to render the asleep secondmate projection directly.
</issue_to_address>
### Comment 8
<location path="tests/fm-wake-queue.test.sh" line_range="646-647" />
<code_context>
+ FM_CHECK_INTERVAL=999999 FM_HEARTBEAT=999999 \
+ secondmate_stall_watch_leg "$dir" "second" cleared
+ [ ! -s "$state/.wake-queue" ] \
+ || fail "an asleep mate's queue fed the secondmate wake-loop escalation: $(cat "$state/.wake-queue")"
+ ! grep -F 'secondmate wake-loop stalled' "$dir/watch-first.out" "$dir/watch-second.out" >/dev/null \
+ || fail "an asleep mate was reported as a stalled wake loop"
+ [ ! -s "$dir/sent" ] || fail "an asleep mate's pane was rung: $(cat "$dir/sent")"
</code_context>
<issue_to_address>
**Queue preservation assertion checks parent state**
`test_asleep_secondmate_queue_does_not_feed_stall_escalation` puts the queued row in `$sub/state/.wake-queue` at line 632 but checks `$state/.wake-queue` here. If the sleep handling deletes the mate’s queue, this assertion still passes because it checks a different, absent file; the test does not catch that queued work was lost.
Assert that `"$sub/state/.wake-queue"` still contains the queued row after both stall-watch legs.
</issue_to_address>| T=$RESOLVED_TARGET | ||
| shift | ||
|
|
||
| if [ -n "$TARGET_META" ] && [ "$(fm_meta_get "$TARGET_META" kind)" = secondmate ]; then |
There was a problem hiding this comment.
🟡 Medium · Sends reach a stopped mate
When a send passes the marker check after sleep stops the agent but before it writes the marker, fm-send proceeds without coordinating with sleep, so it sends or records work for a stopped mate. The caller sees success for work the agent never receives, and the new marker prevents recovery from consuming it.
Serialize sends with the sleep transaction or otherwise ensure work accepted during sleep is durably queued for the mate.
Also at bin/fm-secondmate-sleep.sh:339-359.
Prompt for AI agents
In `bin/fm-send.sh` at line 463:
**Sends reach a stopped mate**
When a send passes the marker check after sleep stops the agent but before it writes the marker, `fm-send` proceeds without coordinating with sleep, so it sends or records work for a stopped mate. The caller sees success for work the agent never receives, and the new marker prevents recovery from consuming it.
Serialize sends with the sleep transaction or otherwise ensure work accepted during sleep is durably queued for the mate.
Also at `bin/fm-secondmate-sleep.sh:339-359`.| esac | ||
| fi | ||
| if [ "${NEEDS_EXIT[i]}" = 1 ] && ! out=$(FM_HOME="$FM_HOME" FM_STATE_OVERRIDE="$STATE" \ | ||
| "$SCRIPT_DIR/fm-control.sh" "$id" exit < /dev/null 2>&1); then |
There was a problem hiding this comment.
🟡 Medium · Replacement agent stops without persistence
When the agent that answered the persist request exits and a replacement becomes live before stop_and_mark acquires the liveness lock, stop_and_mark skips the under-lock agent probe when NEEDS_EXIT[i] is set and exits the replacement without asking it to persist. Its open conversational work can be lost.
Re-probe the agent under the liveness lock and request persistence from any replacement before exiting it.
Prompt for AI agents
In `bin/fm-secondmate-sleep.sh` at line 339:
**Replacement agent stops without persistence**
When the agent that answered the persist request exits and a replacement becomes live before `stop_and_mark` acquires the liveness lock, `stop_and_mark` skips the under-lock agent probe when `NEEDS_EXIT[i]` is set and exits the replacement without asking it to persist. Its open conversational work can be lost.
Re-probe the agent under the liveness lock and request persistence from any replacement before exiting it.| if ! out=$(run_in_mate_home "$home" fm-procevent.sh retire "$id" "${guard[@]+"${guard[@]}"}"); then | ||
| printf '%s: %s\n' "$id" "$(first_line "$out")" | ||
| return 1 |
There was a problem hiding this comment.
🟡 Medium · Failed sleep leaves listeners missing
When a later listener retirement or another sleep step fails after the agent, watcher, or an earlier listener has already stopped, retire_unbound_listeners and stop_and_mark return without restoring earlier state. The sleep marker is absent, so the mate can resume with listeners permanently removed or with its agent or watcher stopped.
Make sleep failure transactional by restoring the agent, watcher, and any listeners already stopped or retired before returning.
Also at bin/fm-secondmate-sleep.sh:344-357.
Prompt for AI agents
In `bin/fm-secondmate-sleep.sh` at lines 284-286:
**Failed sleep leaves listeners missing**
When a later listener retirement or another sleep step fails after the agent, watcher, or an earlier listener has already stopped, `retire_unbound_listeners` and `stop_and_mark` return without restoring earlier state. The sleep marker is absent, so the mate can resume with listeners permanently removed or with its agent or watcher stopped.
Make sleep failure transactional by restoring the agent, watcher, and any listeners already stopped or retired before returning.
Also at `bin/fm-secondmate-sleep.sh:344-357`.| if out=$(run_in_mate_home "$home" fm-captain-hold.sh binding "$id"); then | ||
| continue | ||
| elif [ -n "$out" ]; then | ||
| printf '%s: %s\n' "$id" "$(first_line "$out")" | ||
| return 1 | ||
| fi | ||
| guard=() | ||
| if ! fm_procevent_source_lock_acquire "$id"; then | ||
| printf '%s: cannot lock the source\n' "$id" | ||
| return 1 | ||
| fi | ||
| fm_procevent_extension_registration_load_locked "$home/state" "$id" | ||
| owner_state=$? | ||
| fm_procevent_source_lock_release "$id" | ||
| case "$owner_state" in | ||
| 0) guard=(--if-owner "$FM_PROCEVENT_EXTENSION_REGISTRATION_TOKEN") ;; | ||
| 1) ;; | ||
| *) | ||
| printf '%s: cannot safely read its registration owner\n' "$id" | ||
| return 1 | ||
| ;; | ||
| esac | ||
| if ! out=$(run_in_mate_home "$home" fm-procevent.sh retire "$id" "${guard[@]+"${guard[@]}"}"); then |
There was a problem hiding this comment.
🟡 Medium · Held call loses its listener
When a captain-call binding is published after the binding lookup but before source retirement, retire_unbound_listeners retires the source despite the new binding, leaving the held call bound to a missing listener. Its answer is not captured after wake.
Make the binding check and source retirement atomic so a source with a newly published captain-call binding is not retired.
Prompt for AI agents
In `bin/fm-secondmate-sleep.sh` at lines 262-284:
**Held call loses its listener**
When a captain-call binding is published after the binding lookup but before source retirement, `retire_unbound_listeners` retires the source despite the new binding, leaving the held call bound to a missing listener. Its answer is not captured after wake.
Make the binding check and source retirement atomic so a source with a newly published captain-call binding is not retired.- Sleep re-probes the agent under the per-mate liveness lock every time and stops only the incarnation that was asked to persist (its spawn_gen); a replaced or returned agent is refused unstopped. - The second-mate restart runs its relaunch under the same lock and rechecks the sleep marker there, so it never leaves a running agent behind a marker. - Clearing the sleep marker removes a file, symlink, or directory at exactly its path and fails unless nothing is left; both teardown paths stop and report a marker they could not remove. - The bearings snapshot header and skill state that the asleep notice is the secondmates[] row with state asleep, never a gates[] row. - The sleep header says a refused sleep rolls nothing back, and that unbound board listeners already retired stay retired until re-armed by hand. - Tests: wake-queue asserts the mate's own queued row survives; new sleep T9, restart T4c, and teardown directory and stuck-marker cases. - CI: the stock-bash job expects 61 Bearings tests, and the gotmp teardown fixture stages fm-secondmate-sleep-lib.sh.
|
Review round on the Sourcery findings, applied in Fixed
Not changed, with evidence
CI (run 37537978889)
|
Why
Today a persistent second mate can only be retired (
bin/fm-teardown.shremoves its home) or have its agent exited, which the liveness sweep undoes on the next tick or session start.Every idle home still runs its own agent and supervision watcher, and those cycles multiply across homes on a shared host.
This adds a durable, deliberate sleep: the mate's agent, watcher, and process-event listeners stop, its home (data, backlog, held captain calls, clones, worktrees) is left untouched, and nothing brings it back until an explicit wake.
Design
bin/fm-secondmate-sleep.shruns from the parent home withFM_HOMEexplicit; its header and--helpown the marker format and every step.sleep <id>... --by <who> --reason <text>, per registered local mate, each step idempotent, and a sleep that cannot complete writes no marker and names the refusing step:registered: a local route indata/secondmates.mdwhose home carries its own seed marker; a remote route is refused for now. Anfm-<id>spelling names<id>only whenfm-<id>is not itself registered and<id>is.idle: no in-flight work (state/*.meta) in the mate's own home, checked at admission and again under the per-mate liveness lock just before the stop.agent: a running agent is asked to write down the open work it holds only in conversation, with the same request, gate, and bound asbin/fm-secondmate-restart.sh(now shared throughbin/fm-secondmate-restart-lib.sh), and is stopped withbin/fm-control.sh <id> exitonly after its correlated answer lands. An agent that was stopped at admission is probed again under the lock, and one that came back up meanwhile is refused unstopped.watcher: the home's ownbin/fm-watch-arm.sh --stop.listeners: every process-event source with no held captain call bound to it is retired through the home's own owner-matchedbin/fm-procevent.sh retire. A decision-bound source stays registered with its binding but does not run while the mate sleeps; a board answer given meanwhile is queued by Lavish and captured once the mate wakes and that listener relaunches.marker:state/<id>.asleepin the parent home, withsince=,by=, andreason=lines.wake <id>...removes the marker, relaunches through the guarded liveness relaunch path (bin/fm-spawn.sh <id> --secondmate, which converges tracked files and inherited material), confirms the agent live, then runs the home's ownbin/fm-procevent.sh reconcileonce so kept listeners relaunch immediately. A wake with no marker is a no-op.status [<id>...]prints each registered mate as asleep (since when, by whom, why) or awake.Callers that now consult the marker
All read it through
fm_secondmate_asleepin the newbin/fm-secondmate-sleep-lib.sh; none parses the file.bin/fm-secondmate-liveness-lib.sh: the probe returnsasleepbefore probing, so neither the session-start sweep nor the watcher tick relaunches an asleep mate.bin/fm-bootstrap.sh: the liveness sweep prints oneBOOTSTRAP_INFOline per asleep mate; startup convergence skips the instruction nudge, its retry, and the config-reread send for it (its home still fast-forwards).bin/fm-watch.sh: the second-mate wake-loop stall check observes an asleep mate's queue as empty, so it neither rings the stopped pane nor raises a stall alarm.bin/fm-update.sh: lists an asleep mate as asleep and keeps it out ofrestart-secondmatesandnudge-secondmates.bin/fm-secondmate-restart.sh: reports a hand-named asleep mate asasleep:and never asks, nudges, or restarts it; the summary gains an asleep count.bin/fm-config-push.sh: skips an asleep home whole, leaving any pending reread generation for the wake launch.bin/fm-send.sh: refuses any send to an asleep mate and names the wake command.bin/fm-bearings-snapshot.sh: reportsstate: asleepwith its reason and leaves its stopped endpoint out ofunhealthy_endpoints; the bearings skill renders that row in Charted Next as an action-free warning.bin/fm-teardown.sh: retirement removes the marker on both the local and remote paths, so a later mate under the same id does not start asleep; nothing else about retirement changed.Docs: the secondmate-provisioning skill gains a Sleep and wake section, the
AGENTS.mdsection 13 trigger line gains "sleeping or waking",docs/configuration.mdnamesstate/<id>.asleep, task-intake gains the routing sentence for an asleep mate's scope, the updatefirstmate skill reads the new asleep lines, anddocs/scripts.mdlists the two new scripts.Reviewed and left alone
bin/fm-spawn.sh: the single launch owner; every automatic relaunch path is gated upstream, so a refusal there would only block deliberate recovery.bin/fm-control.sh: an explicit control-plane verb on a named id is a deliberate operator action.bin/fm-bootstrap.shand the remote branch ofbin/fm-config-push.sh: sleep refuses remote routes, so no remote mate can be asleep.bin/fm-fleet-snapshot.sh: the canonical snapshot stays a complete projection; bearings decorates it.bin/fm-pending-reply-lib.sh: a request left unanswered at sleep time still escalates as a missed report, which surfaces the open loop rather than hiding it.Review rounds applied
The no-mistakes pipeline reviewed this branch twice before the captain chose to ship it straight to the fork; both runs ended when a review fix round hit the pipeline's 30-minute agent limit, and the remaining fixes were applied by hand.
da9023eb): the idle check repeats under the liveness lock; teardown removes the marker; decision-bound listeners and their captain-hold bindings survive sleep; thefm-id alias resolves only when the exact id is not registered. A finding asking to dropstatusand the recorded who and why was rejected, since both are in the approved specification.8917afdb): a kept listener's runner stops once the sleeping home stops renewing the process-event owner lease, so the docs and persist request now say a board answer is captured after wake, not during sleep, and wake reconciles the home's listeners immediately.34bcd202): the agent state is probed again under the liveness lock before the stop, so a mate relaunched between admission and the stop is refused instead of being marked asleep while running. The same commit makes the wake test give the woken home's real listener machinery a realsleep; the case's shortened sleep stub raced the listener launch on a loaded host and made that test flaky.Checks run
Run locally on head
34bcd202, each inside a contained low-priority scope on a host at load 13 to 20:bash tests/fm-secondmate-sleep.test.sh: 8 of 8 pass (T1-T8). T8 was confirmed failing against the script without the re-probe, and the extended wake test T4 was confirmed failing before the reconcile at wake.bash tests/fm-secondmate-liveness.test.sh: 20 of 20 pass.bash tests/fm-update.test.sh: 17 of 17 pass.bash tests/fm-secondmate-restart.test.sh: 20 of 20 pass.bash tests/fm-send-secondmate-marker.test.sh: 9 of 9 pass.bin/fm-lint.sh: clean (ShellCheck 0.11.0, actionlint 1.7.12).bin/fm-doc-audience-check.sh:ok surfaces=114 local_links=540.The new cases in
tests/fm-secondmate-harness.test.sh,tests/fm-bearings-snapshot.test.sh, andtests/fm-wake-queue.test.shwere run individually, red before green, while the first commit was written, but those whole files were not re-run on this head;tests/fm-teardown.test.sh's new case came from the pipeline's round-1 fix and was not run locally.bin/fm-test-run.sh --check-coveragepassed after the new suite was registered in thesecondmatefamily. CI runs the full suite.Follow-ups
bin/fm-on.sh.bin/fm-secondmate-sleep.shis 559 lines, about 97 of them the header that owns the marker and every step; it stays one domain but could split wake into its own file if it grows.Summary by Sourcery
Introduce deliberate, durable sleeping for local persistent secondmates while ensuring explicit wake is the only path that restores their runtime services.
New Features:
Bug Fixes:
Enhancements:
CI:
Documentation:
Tests: