feat: add supplemental fleet sweep reconciliation - #2729
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aba95c5e88
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 4. Follow the pending-reply and remote-reply owners for their bounded recovery and failure handling rather than inventing a retry loop or timeout. | ||
| 5. Prove each requested update reached the parent append-only status and pending-reply path and appeared in a wake drain under the existing process-event and pending-reply owners. | ||
| 6. Use targeted status reads only as delivery evidence and never as current-state truth. | ||
| 7. If a secondmate aggregate report is unavailable, invalid, partial, or timed out, use `bin/fm-on.sh <secondmate-id> fm-fleet-snapshot.sh --secondmate-home-summary`, then validate the bounded structured result. |
There was a problem hiding this comment.
Route local secondmates through their local homes
Captain, when a registered secondmate is local and its aggregate report is unavailable or partial, this fallback always invokes fm-on.sh; that command’s documented contract says “Routes come only from remote records” (bin/fm-on.sh:7-8), while the snapshot owner explicitly uses an environment-scoped local-home execution for local secondmates (bin/fm-fleet-snapshot.sh:1190-1209). The sweep therefore falsely classifies every affected local lane as unavailable instead of reconciling it, so branch on registered placement and reuse the validated local-home path.
AGENTS.md reference: AGENTS.md:L49-L52
Useful? React with 👍 / 👎.
kunchenguid
left a comment
There was a problem hiding this comment.
Speaking as Kun's firstmate:
VISION verdict: align as opt-in composition. /fleet-sweep is user-invocable, exact-invocation only, and it composes wake-drain, fleet-snapshot, send, crew-state, and existing recovery/dispatch owners rather than inventing a new task shape.
Class: opt-in. Not default-on. Ordinary status still goes through Bearings. The skill's standing-authority bounds (no invented work, no merge without captain authority, no destructive action) match VISION.
Note, not a merge blocker here: the fallback bin/fm-on.sh <id> fm-fleet-snapshot.sh --secondmate-home-summary is remote-only by contract, so a local secondmate whose aggregate report fails will be labeled unavailable. The primary path still uses fm-send.sh.
No security issue. Approving first-time fork workflow runs. Not merge-eligible until CI including no-mistakes is green.
Intent
Create a short, explicit, self-contained user-invocable operator skill named fleet-sweep under .agents/skills/fleet-sweep for the shared Firstmate repository. It must run only when the captain explicitly invokes /fleet-sweep and supplement without replacing, duplicating, scheduling, or creating another owner for watcher, wake-drain, Bearings, AFK, secondmate supervision, pending-reply, remote-reply, or capacity behavior. Begin from the durable wake drain and structured fleet snapshot, treat status appends as wake events rather than current-state truth, reconcile every registered secondmate and every recorded child against live current state, and prove each requested update reached the parent append-only status and pending-reply path and was drained using the existing process-event and pending-reply owners; targeted status reads are delivery evidence only. The captain explicitly selected a registry-aware aggregate-failure fallback and every registered secondmate remains in scope: resolve registered placement, use bin/fm-on.sh fm-fleet-snapshot.sh --secondmate-home-summary for registered remote homes, and use the existing validated local-home execution path owned by bin/fm-fleet-snapshot.sh to run fm-fleet-snapshot.sh --secondmate-home-summary inside registered local homes. This route-by-registry ruling supersedes any earlier wording that could be read as requiring remote-only fm-on uniformly. Never classify a local home clear merely because fm-on is inapplicable, and report a lane unavailable if its correct bounded targeted route also fails. Reconcile stale terminal and validation run-step evidence against newer live ownership so an older cancelled or failed run cannot override a newer actively working run, classify that worker as progressing, and do not interrupt, relaunch, or call it failed solely from the stale run. Check remote transport, pending replies, open decisions, merge or migration-ready work, blocked or inactive workers, and whether parent updates are arriving and draining. Load and follow orca-linear before a current-cycle Linear sweep across every home, classify every item as progressing, genuinely blocked by a named unresolved dependency, or concretely capacity constrained, repair or route fictitious blockers, and correct stale Linear status only when live evidence proves it stale. Respect latest captain-shared routing and parking rules, require concrete slot or host-resource evidence for capacity, and move already-authorized ready work through existing controls without creating a scheduler. Within standing authority the sweep may nudge or safely recover existing workers, clear fictitious blockers, dispatch already-authorized ready work, and correct stale Linear status, but it must not invent work, contradict current priorities, change scope or priority, merge without captain authority, perform destructive or irreversible actions, or broaden external effects. Keep normal supervision active while replies are pending and finish only after replies are durably ingested and drained or named transport failures are surfaced. Report explicit categories for captain actions, autonomous repairs dispatches and Linear corrections, progressing work, blockers with owners, capacity constraints with evidence, unavailable lanes, and unreconciled items so omissions cannot hide. Keep the workflow in one concise SKILL.md unless a deterministic helper is demonstrably necessary, compose existing Firstmate commands, add only the minimum AGENTS.md trigger pointer, follow existing user-invocable conventions, one-owner placement, one sentence per Markdown line, plain dashes, and no incident-specific REC policy. Preserve PR #2729 and every commit, update it through the no-mistakes path, never merge, and never claim absent CI is green; if the fork still requires maintainer workflow approval after all local pipeline stages pass, leave that as a paused external wait.
What Changed
/fleet-sweepskill for bounded fleet-wide reconciliation across worker state, registered secondmates, pending replies, Linear work, blockers, capacity, and unavailable lanes.Risk Assessment
✅ Low: The change is a well-bounded operator skill that satisfies the required registry-aware fleet and Linear fallback behavior while preserving existing supervision, transport, and scheduling owners.
Testing
The baseline and final wake drains were empty, the structured live snapshot showed a valid registry with zero secondmates, targeted executable tests passed for correlated pending replies, remote reply ingestion/draining, stale-state reconciliation, and registry-aware unavailable fallbacks, while the live Linear read correctly failed as unlinked; evidence was captured, but a real multi-home cycle could not run because this isolated home has no registered fleet.
Evidence: Fleet-sweep validation report
Source: Fleet-sweep validation report
Evidence: Structured live fleet baseline
Source: Structured live fleet baseline
Evidence: Pending-reply and remote-reply tests
Source: Pending-reply and remote-reply tests
Evidence: Registry-aware routing tests
Source: Registry-aware routing tests
Evidence: Linear lane result
Source: Linear lane result
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
.agents/skills/fleet-sweep/SKILL.md:33- The intent requires a “current-cycle Linear sweep across every home,” but the aggregate-report fallback only runsfm-fleet-snapshot.sh --secondmate-home-summary, whose output contains fleet/backlog state but no Linear inventory. If a secondmate report is unavailable while this snapshot succeeds, that home's Linear items remain unchecked without the lane necessarily being classified unavailable. Require a placement-correct bounded Linear fallback, or explicitly classify that home's Linear lane as unavailable and unreconciled.🔧 Fix: Add placement-aware Linear fallback reconciliation
✅ Re-checked - no issues remain.
.agents/skills/fleet-sweep/SKILL.md:1- The live harness proves/fleet-sweepis discoverable and enforces its operational boundary, but a complete multi-home sweep was not executed because it would mutate real fleet, pending-reply, and Linear state. Full end-to-end proof requires an authorized staging fleet or permission to exercise live operational state.git diff --find-renames 1cb900c28faf23fe23c9bb54e63f7c3b436ea096..ebda14583e10eeec6bedd17008f9af1d6145465btests/fm-documentation-audiences.test.shbin/fm-doc-audience-check.shclaude -p '/fleet-sweep' --permission-mode plan --allowedTools Read Glob Grep --no-session-persistence --output-format json --max-budget-usd 0.25(inconclusive setup probe: budget exhausted)claude -p '/fleet-sweep' --permission-mode plan --allowedTools Read Glob Grep --no-session-persistence --output-format json --max-budget-usd 0.65git status --short && git rev-parse HEAD && git diff --check 1cb900c28faf23fe23c9bb54e63f7c3b436ea096..ebda14583e10eeec6bedd17008f9af1d6145465b🔧 Fix: Confirm fleet-sweep paths; no reproducible failure
1 warning still open:
.agents/skills/fleet-sweep/SKILL.md:1- The authorized live sweep found zero registered secondmates and no recorded workers or pending replies in this isolated gate home, while the worktree was not linked to Linear. Executable fixture tests prove the correlated pending-reply, remote ingest/drain, registry-aware routing, stale-state reconciliation, and unavailable-lane behavior, but a genuine live multi-home cycle remains unreconciled until a registered staging or live secondmate home is available.bin/fm-wake-drain.shbefore and after the sweepbin/fm-fleet-snapshot.sh --jsonorca skills get orca-linearorca status --jsonorca linear issue --current --full --jsontests/fm-send-secondmate-marker.test.shtests/fm-remote-reply.test.shtests/fm-fleet-snapshot-view.test.shtests/fm-bearings-snapshot.test.shManual category-by-category fleet-sweep report generated from the live snapshot, final drain, and Linear resultgit status --shortconfirmed testing left the worktree unchanged✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.