Conversation
keenvc
added a commit
to keenvc/firstmate
that referenced
this pull request
Sep 20, 2026
… liveness sweep
This was referenced Sep 30, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The session-start secondmate liveness sweep walked only
state/<id>.metarecords filtered tokind=secondmate. That made two classes of registered secondmate invisible to the sweep meant to guarantee they are running:data/secondmates.mdwith nostate/<id>.metarecord was never enumerated at all.window=empty) was silently skipped by the[ -n "$window" ] || return 0guard.Both are recovery-grade failures. Because the sweep reports healthy when it declines, the outage was invisible until a new secondmate happened to be requested on a project that already had two.
Fix
bin/fm-bootstrap.shsecondmate_liveness_sweepnow enumerates the union of:data/secondmates.md(the durable "which secondmates exist" authority), andkind=secondmatestate/<id>.metarecords,deduplicated so a running registered secondmate is probed exactly once. A registered id with no record, or with a record that has no endpoint, is relaunched from its registry entry and persistent home via the existing
bin/fm-spawn.sh <id> --secondmaterecovery path. A relaunch that fails is reported as an explicit named gap:A meta record whose
kindis notsecondmateis not treated as the secondmate's endpoint, so a colliding task record cannot be probed.Behavior preserved
dead/missingclassifier states; ambiguous, unreadable, unverified-harness, and unreachable-remote targets remainskipped:with their reason.kind=secondmatemeta and registers no secondmates).Tests
tests/fm-secondmate-liveness.test.shextended with six cases:kind=secondmaterecord absent from the registry is still accounted for.All existing cases in the file pass, plus
fm-bootstrap,fm-session-start,fm-secondmate-sync,fm-bootstrap-network-parallel,fm-remote-secondmate-lifecycle-e2e,fm-secondmate-lifecycle-e2e, andfm-secondmate-safety.bin/fm-doc-audience-check.shpasses.Docs
Updated the owned prose in
AGENTS.md,docs/configuration.md,.agents/skills/bootstrap-diagnostics/SKILL.md, and.agents/skills/secondmate-provisioning/SKILL.mdso the documented contract matches the enforced behavior.