Repository navigation
feat(rounds): priority-ranked triage walk over the fleet snapshot - #17
Merged
Merged
Conversation
Add /rounds, a captain-invocable walk through outstanding work in captain-set priority order that skips anything needing nothing. The classification lives in bin/fm-rounds-queue.sh, a projection over fm-fleet-snapshot.sh, so the actionable/not-actionable rule is deterministic and testable rather than re-derived in skill prose. The skill owns only the conversation and the approval boundaries. Priority reuses the existing tasks-axi priority field; the backlog is its only store and unset reads as medium, so nothing needs backfilling. Also fixes a live parser bug: fm-fleet-snapshot.sh stripped no hold tokens, so every held row's title carried its full metadata tail. Extracts the TOON encoder to fm-toon-lib.sh rather than copying it.
…and test tmproot cleanup
Rule 7 authorized acknowledging a declared wait and steering a self-parked crew without ever showing the item to the captain. The ack also clears the throttle that eventually forces a forgotten external wait back to the supervisor, so a start-of-day plus mid-day pass would retire that safety net entirely. The quiet bucket's action field is now descriptive only. Acknowledging a wait keeps its one route: the captain sees the item, says to leave it running, and the ack follows - the confirmed-recheck scope AGENTS.md section 8 intends. Also pins the hold-token parsing, whose captures feed the active-hold drop and gate-arrived classification: a comma-bearing reason, the undated form, and the held-row title fix.
…ived holds on blockers
This was referenced Aug 3, 2026
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.
Intent
Build /rounds, a captain-invocable firstmate skill that automates the work-triage loop the captain and firstmate were running by hand: enumerate outstanding work, rank it by a captain-set priority, walk it in order, skip anything that needs nothing right now, and present the rest ONE AT A TIME with a recommendation.
RE-RUN after the previous run went terminal-failed when its fix-round client was killed externally. Six fix rounds ALREADY LANDED on this branch and their commits are present - do not re-surface findings those rounds resolved. Landed so far: hold suppression yields to a lane with a live problem; a merged PR classifies ready-to-stand-down rather than pr-ready, via both the run-step detail and the backlog-row landed check; the dead-lane-run detector requires a shared live workspace or a non-terminal run; counts are pre-limit with a separate shown field; blocked_by_all carries every blocker so dispatch never proposes work on an unmet dependency; the dispatchable batch is PROPOSED as one confirm line and never auto-started; out-of-range priority reads as unset; tests/lib.sh temp-dir cleanup is fixed and re-source safe; rule 7 authorizes no action on an item the captain was never shown; hold-token parsing is covered.
CAPTAIN DIRECTIVE: ship it now, handle the rest as follow-ups. NINE known items are DELIBERATELY DEFERRED to separate backlog work and must NOT be fixed here - if review raises any, they are accepted as known follow-ups rather than reopened: (1) a pr-ready item is not re-checked against GitHub, so a PR merged in the UI with no local record still reads as needing a merge; (2) real same-files/same-subsystem overlap detection and a batch cap for the dispatchable proposal; (3) a held lane whose work is ready for review is buried by an undated hold; (4) a malformed non-ISO hold-until string-compares greater than today forever and silently swallows the item; (5) rebasing bearings Captain-s Call onto this classifier; (6) the paused-but-gone detector may be unreachable and fires zero times on the live fleet, so either record its real triggering condition or remove it and correct the header claim; (7) count_landed reports the whole retained Done section rather than what landed this round.
Original decisions the captain approved, which a reviewer reading only the diff would not know:
PRIORITY REUSES AN EXISTING FIELD. tasks-axi already has --priority 0-4 and fm-fleet-snapshot.sh already parsed it; both were entirely unused. The backlog is priority-s ONLY home, deliberately not per-task meta: priority is a property of the work (queued work has priority and no meta file), meta has no update path, and the backlog already handles archival and secondmate handoff. Unset reads as medium and is flagged rather than backfilled, so the existing backlog needed no migration.
CLASSIFICATION LIVES IN A SCRIPT, NOT SKILL PROSE. bin/fm-rounds-queue.sh owns the actionable/not-actionable rule so it is deterministic and testable; a rule written as prose is re-derived differently every invocation. The skill owns only the conversation and the approval boundaries. This follows the canonical-snapshot-plus-projection pattern fm-bearings-snapshot.sh and fm-fleet-view.sh already state in their headers.
DELIBERATELY NOT AN EXTENSION OF /bearings. bearings is contractually read-mostly; /rounds takes actions on the captain-s word. Folding them would break the bearings contract. They share the gatherer, not the output.
TWO PRE-EXISTING BUGS FIXED ALONG THE WAY. The snapshot-s strip_trailing_metadata did not know about hold tokens, so every held row-s parsed title carried its entire metadata tail - verified live on 9 held items. And the TOON encoder was extracted to fm-toon-lib.sh rather than copied, per the repo-s one-owner rule.
TUNING DRIVEN BY REAL FLEET DATA. A shared-workspace detector as a per-lane reason fired on 8 of 19 items and buried the real work, so it became ONE fleet-level conflicts entry with affected lanes flagged workspace_ambiguous, requiring TWO LIVE claimants. Severity tiers keep bookkeeping drift from outranking a live decision.
APPROVAL AUTHORITY IS UNCHANGED BY DESIGN. The skill automates which question is asked and in what order; it automates no answer. Merges, ask-user findings, and teardown stay the captain-s, the pre-teardown peek is preserved because a merge is explicitly not teardown consent in this fleet, and rule 7 now forbids acting on any item the captain was not shown.
AGENTS.md gains only a few lines on an existing section 10 bullet plus the row-format tokens: the skill is discovered through its frontmatter, exactly as /bearings is. FM_ROUNDS_SNAPSHOT and FM_ROUNDS_TODAY are documented test-only overrides, mirroring FM_CLASSIFY_CREW_STATE.
What Changed
/rounds, a captain-invocable skill (.agents/skills/rounds/SKILL.md) backed bybin/fm-rounds-queue.sh, a new deterministic projection overfm-fleet-snapshot.sh --json(schemafm-rounds.v1). It walks the union of live lanes and open backlog rows, drops secondmates, landed work, and still-held items, and classifies the rest as unreliable / captain-owned / dispatchable / quiet, ordered by captain-set priority then severity so bookkeeping drift can never mask a live decision. The script owns the actionable rule; the skill owns only the conversation and approval boundaries - merges, teardown, and ask-user findings stay the captain's, and a dispatchable batch is proposed rather than auto-started.priority(0-4, unset reads as medium and is flagged, not backfilled), everyblocked-bytoken instead of only the last, and structuredhold/hold-kind/hold-untilgates; fixesstrip_trailing_metadataso hold tokens no longer leak into parsed row titles, and extracts the TOON encoder into sharedbin/fm-toon-lib.shnow used by both the bearings and rounds projections.tasks-axi hold/unholdverbs in AGENTS.md, the projection and its ordering rule indocs/architecture.md, the new scripts indocs/scripts.md, and theFM_ROUNDS_SNAPSHOT/FM_ROUNDS_TODAYtest-only overrides indocs/configuration.md; addstests/fm-rounds-queue.test.sh(30 classification/ordering/parity cases) plus snapshot-view cases for multi-blocker and hold-token parsing, and fixes temp-dir cleanup and re-source safety intests/lib.sh.Risk Assessment
Testing
The configured baseline suite had already passed; on top of it I ran the two suites owning this change (fm-rounds-queue, 30 cases; fm-fleet-snapshot-view, 13 cases) and then demonstrated the feature end-to-end by driving a realistic synthetic 19-member fleet through the real snapshot and the real rounds-queue projection - only tmux and no-mistakes stubbed - capturing the default walk, --limit truncation, the --all quiet bucket, and a post-answer recompute, plus a captain-facing render of the walk. Everything behaved as the intent describes and nothing failed.
Evidence: End-to-end /rounds walk transcript (4 runs over a real snapshot of a synthetic 19-item fleet)
Evidence: Captain-facing surface: RUN A rendered through the skill's presentation contract
Evidence: Reproducible fixture harness used to produce the transcript
Evidence: Default walk over the synthetic fleet (excerpt)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-rounds-queue.sh:320-gate-arrivedis evaluated in the$askchain before any blocker check, and the walk projection carries no blocker field at all, so a queued row whose hold-until date has arrived is presented to the captain as actionable even while itsblocked-bydependencies are still open. Verified against a synthetic snapshot: a row withhold-until: 2026-07-01andblocked_by_all: ["blocker-a"](blocker-a still queued) came back asbucket: captain, why: gate-arrivedwith no blocker signal, while blocker-a itself was still listed as dispatchable. The SKILL's recording table then says totasks-axi unhold <id>and "take the action they asked for", which routes straight into dispatching work on an unmet dependency - the same hazard theblocked_by_allfix closed for the dispatchable batch, reached through the other door. Consider gatinggate-arrivedonblocker_open($b) | not, or emitting ablocked_byfield on walk entries so the presenter can caveat it.bin/fm-rounds-queue.sh:284-$badis evaluated before$ask, but the bookkeeping-severity detectors (no-backlog-row,no-lane) are not contradictions - the header itself says they "poison no state claim". Yet they still preempt the captain-owned reason. Verified: a live lane withhints.open_decisionsof length 1 and no backlog row classifies asbucket: unreliable, why: no-backlog-row, severity: bookkeeping, withcount_captain: 0. The SKILL renders unreliable items with the "⚠ state unclear / What I can see / What I don't" block, which has no slot for the pending decision or the PR URL, so a decision actually waiting on the captain is never asked. This is the same class of masking the dead-lane-run narrowing was added to fix. Consider letting$askwin over bookkeeping-tier$bad(keeping the drift as a secondary note), and reserving preemption for the three contradiction-severity detectors.bin/fm-rounds-queue.sh:224- The out-of-range clamp only rejects< 0or> 4, so a hand-edited non-integer such as(priority: 2.5)passes. Verified: it yieldspriority_set: true,priority_word: "medium", andsort_priority: 2.5- the word says medium, the sort sits between medium and low, andpriority_set: truesuppresses the SKILL's "(no priority set)" tag and its offer to correct. That contradicts the header's stated invariant that "the word, the sort, and the offer-to-set flag can never disagree". Adding(. | floor) != .to the same clamp closes it..agents/skills/rounds/SKILL.md:90- The skill deliberately keeps no cursor and re-runsbin/fm-rounds-queue.shafter every captain answer and after every mid-walk wake. Each run shells out to a fullfm-fleet-snapshot.sh --json, which invokesfm-crew-state.shper task, and that in turn can callno-mistakes axi statuswith a per-task timeout (FM_CREW_STATE_NM_TIMEOUT, default 10s). On a ~19-lane fleet a six-item walk means six full fleet reads with up to 19 no-mistakes probes each. The stateless design is the right call for surviving interruption, but there is no cheap-recompute path today; worth noting as a follow-up (e.g. a snapshot-reuse flag for the same turn) rather than a blocker.🔧 Fix: stop bookkeeping masking captain items, gate arrived holds on blockers
2 issues (1 warning, 1 info) still open:
bin/fm-rounds-queue.sh:351- The bucket reorder madeno-lane(bookkeeping) yield to the captain chain, and the only captain reason reachable when$t == nullisgate-arrived- so a backlog row in statein_flightcarrying an arrived hold gate now classifiesbucket: captain, why: gate-arrived, drift: no-lanewhere it previously classifiedbucket: unreliable, why: no-lane. Verified by running the projection against a synthetic snapshot: a row{state: in_flight, hold: "captain said wait", hold_until: 2026-07-01}with no matching task came back ascount_captain: 1,why: gate-arrived,state: null. This is reachable in practice (captain holds a running item with--until, its lane later dies or is torn down, the gate arrives). The SKILL's recording table then routes the answer totasks-axi unhold <id>FIRST, then dispatch - starting work the records say is already in flight, while the true finding (recorded in flight with nothing running) is demoted to the secondarydriftline. The$t == nullguard ongate-arrivedwas written to mean "nothing is working this yet", whichno-lanedirectly contradicts, so this pairing should keep the drift as the presented reason: gate the branch on$book != "no-lane"(or on$b.state != "in_flight"), leaving every other bookkeeping-yields-to-captain case exactly as this round built it..agents/skills/rounds/SKILL.md:74-blocked_by_openis emitted as a space-joined list of raw task ids, and the new presentation rule tells the agent to "name what the item is still waiting on". But the presentation contract three lines up (line 55) forbids task ids in captain chat, and the queue carries no title for the blocker in default output: a blocker that isquietis suppressed entirely without--all, and only a blocker that happens to land inwalk[]ordispatchable[]has atitlethe presenter could translate to. So the presenter is left either leaking an id or saying something vague. Either emit the blockers' titles alongside their ids on the walk row, or narrow the rule to "say it is waiting on other work and offer to name it" so the two contract lines stop pulling against each other.🔧 Fix: scope bookkeeping yield to live lanes, stop blocker-id leak
2 issues (1 warning, 1 info) still open:
.agents/skills/rounds/SKILL.md:74- Theblocked_by_openpresentation rule is unconditional, but the field can never be set on the case it was added to guard.blocked_by_openis non-null exactly whenblocker_open($b)is true (bin/fm-rounds-queue.sh:264-267), whilegate-arrivedrequiresblocker_open($b) | not(line 361) and thedispatchablebucket requires the same. So on the walk the field is only ever set for contradiction/bookkeeping rows and for LANE-based captain reasons - decision-waiting, blocked, failed, pr-ready, ready-to-stand-down, review-diff, report-ready. For every one of those the mandated caveat "say that the item is still waiting on other work ... and never present it as ready to start" is a non-sequitur, and for a merge or review ask it is actively wrong. Failure: the captain recordstasks-axi block B --by A("don't land B until A merges"), B's crew finishes and its PR goes green, A is still in flight. The walk row isbucket: captain, why: pr-ready, blocked_by_open: "A", and the presenter is instructed to tell the captain the work is still waiting on other work and must not be presented as ready to start - for an item whose only ask is "merge this PR". Scope the bullet to the ask it was written for (an item being proposed for dispatch), and for a lane-based ask reword it to "the records still name open work this depends on" rather than "not ready to start". The queue field itself can stay exactly as the previous round built it.bin/fm-rounds-queue.sh:324- Theindeterminatedetector is scoped to$st == "unknown" and $src == "none", butbin/fm-crew-state.shcan emitunknownwith sourcerun-step: its coarse runs-list fallback setsRUN_STATE=unknownin the default arm of thecase "$COARSE_STATUS"switch and then reachesemit "$RUN_STATE" run-step "$RUN_DETAIL". Such a lane with a live endpoint matches no contradiction detector (dead-lane-run needsendpoint.exists == false), no bookkeeping detector, and no captain reason, so it falls through the$askchain to theelsearm of$quietand classifiesbucket: quiet, why: no-signal, action: none- hidden without--all. A lane whose state genuinely could not be determined is therefore silently omitted from the walk, which is the opposite of what theindeterminatedetector exists for. Reachability is low today (it needsno-mistakes runsto report a status word outside running/completed/cancelled/failed), but the guard is cheap: drop the$src == "none"condition, or add anelif $t != null and $st == "unknown"arm so any undeterminable state lands in the bookkeeping tier instead of the quiet bucket.✅ **Test** - passed
✅ No issues found.
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"bash tests/fm-rounds-queue.test.sh- 30 classification/ordering/parity cases, all passbash tests/fm-fleet-snapshot-view.test.sh- 13 cases including the new multi-blocker and hold-token parsing, all passManual e2e: built a synthetic FM_HOME (8 in-flight rows, 5 queued, 2 done, 10 live lanes incl. a secondmate) and ran the realbin/fm-fleet-snapshot.sh-> realbin/fm-rounds-queue.shwith only tmux/no-mistakes stubbedbin/fm-rounds-queue.sh(default) over that fleet - verified priority ordering, the six captain reasons, bookkeeping drift placement, held/landed/secondmate drops, and the one fleet-level workspace conflictbin/fm-rounds-queue.sh --limit 3- verified walk truncation is disclosed in omitted[] while every count_* stays the pre-limit population andshowntracks the limitbin/fm-rounds-queue.sh --all- verified the quiet bucket (progressing, waiting-on-another, declared-wait) is what gets skippedManual e2e recompute: replayed the captain's answers per the skill's recording table (hold re-dated, PR merged + lane torn down, missing backlog row filed) and re-ran the queue - walk dropped 8 -> 5 with held/landed/quiet counts moving in stepRendered RUN A's queue through the SKILL.md presentation contract to capture the captain-facing surface (one item per block, mandatory recommendation, no ids/internals, full PR URLs)bin/fm-rounds-queue.sh:63- bin/fm-rounds-queue.sh's header states that each contradiction detector "exists because it fired on real fleet state", but the paused-but-gone detector's reachability is unconfirmed and was deliberately deferred by the captain (known follow-up 6: either record its real triggering condition or remove the detector and correct the header claim). Resolving it needs a judgment call about the detector itself, not a doc edit, so I left the header untouched.🔧 Fix: no lint fixes needed; shellcheck 0.11.0 passes clean
1 warning still open:
🔧 Fix: no lint changes needed; shellcheck 0.11.0 clean
1 warning still open:
🔧 Fix: no lint fixes needed; shellcheck 0.11.0 passes clean
1 warning still open:
✅ **Push** - passed
✅ No issues found.