Skip to content

feat(rounds): priority-ranked triage walk over the fleet snapshot - #17

Merged
7hoenix merged 9 commits into
mainfrom
fm/triage-loop-skill-7p
Jul 31, 2026
Merged

7hoenix merged 9 commits into
mainfrom
fm/triage-loop-skill-7p

Conversation

@7hoenix

@7hoenix 7hoenix commented Jul 31, 2026

Copy link
Copy Markdown
Owner

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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

  • Adds /rounds, a captain-invocable skill (.agents/skills/rounds/SKILL.md) backed by bin/fm-rounds-queue.sh, a new deterministic projection over fm-fleet-snapshot.sh --json (schema fm-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.
  • Extends the fleet snapshot to carry each backlog row's priority (0-4, unset reads as medium and is flagged, not backfilled), every blocked-by token instead of only the last, and structured hold/hold-kind/hold-until gates; fixes strip_trailing_metadata so hold tokens no longer leak into parsed row titles, and extracts the TOON encoder into shared bin/fm-toon-lib.sh now used by both the bearings and rounds projections.
  • Documents the priority and hold backlog tokens plus the tasks-axi hold/unhold verbs in AGENTS.md, the projection and its ordering rule in docs/architecture.md, the new scripts in docs/scripts.md, and the FM_ROUNDS_SNAPSHOT/FM_ROUNDS_TODAY test-only overrides in docs/configuration.md; adds tests/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 in tests/lib.sh.

Risk Assessment

⚠️ Medium: The branch adds a read-only projection plus a captain-facing skill with strong test coverage and no mutation path, and the two prior fix rounds resolved the substantive classification bugs; what remains is one presentation rule that will produce misleading captain-facing text in an uncommon but real configuration, plus a narrow silent-omission gap - both safe to address as follow-ups.

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)
# /rounds end-to-end walk over a synthetic 19-item fleet
# Real bin/fm-fleet-snapshot.sh -> real bin/fm-rounds-queue.sh (only tmux + no-mistakes stubbed)
# Fleet: 8 in-flight rows, 5 queued rows, 2 done rows, 10 live lanes (1 a persistent supervisor)

############ RUN A: default walk - what /rounds reads to open the round
schema: fm-rounds.v1
home: /var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.vEo0to
generated: "2026-07-31T14:21:53Z"
today: 2026-07-30
count_walk: 8
shown: 8
count_captain: 6
count_contradiction: 0
count_bookkeeping: 2
count_dispatchable: 2
count_quiet: 4
count_held: 1
count_landed: 1
count_secondmate: 1
count_conflicts: 1
walk[8]{pos,id,bucket,severity,why,drift,priority_word,priority_set,workspace_ambiguous,repo,kind,state,source,decisions,blocked_by_open,pr,report,since,title,detail}:
  1,auth-shape-k3,captain,"-",decision-waiting,null,urgent,true,false,storefront,ship,parked,status-log,1,null,null,null,2026-07-24,Rework session auth,keep sessions server-side or move to signed cookies
  2,pricing-page-v3,captain,"-",gate-arrived,null,high,true,false,storefront,ship,null,null,0,null,null,null,2026-07-10,New pricing page,not before the pricing review
  3,retry-queue-b8,captain,"-",failed,null,high,true,false,payments,ship,failed,status-log,0,null,null,null,2026-07-22,Retry queue for webhooks,the integration suite will not run without vendor credentials
  4,export-csv-p1,captain,"-",pr-ready,null,high,true,false,storefront,ship,done,status-log,0,null,"https://github.com/acme/storefront/pull/402",null,2026-07-26,CSV export for orders,"PR https://github.com/acme/storefront/pull/402 checks green"
  5,invoice-pdf-c1,captain,"-",ready-to-stand-down,null,medium,false,false,payments,ship,done,status-log,0,null,"https://github.com/acme/payments/pull/311",null,null,Invoice PDF rendering,PR merged
  6,audit-deps-w4,captain,"-",report-ready,null,medium,false,false,payments,scout,done,status-log,0,null,null,/var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.vEo0to/data/audit-deps-w4/report.md,2026-07-28,Audit dependency drift,report ready
  7,untracked-fix-j0,unreliable,bookkeeping,no-backlog-row,no-backlog-row,medium,false,false,storefront,ship,working,pane,0,null,null,null,null,null,harness busy
  8,ghost-row-z9,unreliable,bookkeeping,no-lane,no-lane,medium,true,false,storefront,ship,null,null,0,null,null,null,2026-07-18,Migrate legacy settings,null
conflicts[1]{workspace,lanes}:
  /var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.vEo0to/projects/wt-shared,billing-copy-r7 sidebar-nav-m2
dispatchable[2]{id,repo,kind,priority_word,title}:
  rate-limit-q2,payments,ship,high,Rate limit the public API
  tidy-logs-h6,storefront,ship,low,Tidy up log formatting
quiet: []
omitted[3]{surface,reveal}:
  quiet lanes (4),"--all"
  held under an active hold (1),tasks-axi list --state held
  landed and stood down (1),the Done section of data/backlog.md

############ RUN B: --limit 3 - walk bounded, truncation disclosed, counts stay pre-limit
schema: fm-rounds.v1
home: /var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.ACZ45r
generated: "2026-07-31T14:22:01Z"
today: 2026-07-30
count_walk: 8
shown: 3
count_captain: 6
count_contradiction: 0
count_bookkeeping: 2
count_dispatchable: 2
count_quiet: 4
count_held: 1
count_landed: 1
count_secondmate: 1
count_conflicts: 1
walk[3]{pos,id,bucket,severity,why,drift,priority_word,priority_set,workspace_ambiguous,repo,kind,state,source,decisions,blocked_by_open,pr,report,since,title,detail}:
  1,auth-shape-k3,captain,"-",decision-waiting,null,urgent,true,false,storefront,ship,parked,status-log,1,null,null,null,2026-07-24,Rework session auth,keep sessions server-side or move to signed cookies
  2,pricing-page-v3,captain,"-",gate-arrived,null,high,true,false,storefront,ship,null,null,0,null,null,null,2026-07-10,New pricing page,not before the pricing review
  3,retry-queue-b8,captain,"-",failed,null,high,true,false,payments,ship,failed,status-log,0,null,null,null,2026-07-22,Retry queue for webhooks,the integration suite will not run without vendor credentials
conflicts[1]{workspace,lanes}:
  /var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.ACZ45r/projects/wt-shared,billing-copy-r7 sidebar-nav-m2
dispatchable[2]{id,repo,kind,priority_word,title}:
  rate-limit-q2,payments,ship,high,Rate limit the public API
  tidy-logs-h6,storefront,ship,low,Tidy up log formatting
quiet: []
omitted[4]{surface,reveal}:
  quiet lanes (4),"--all"
  walk showing 3 of 8,raise or drop --limit
  held under an active hold (1),tasks-axi list --state held
  landed and stood down (1),the Done section of data/backlog.md

############ RUN C: --all - the bucket that is skipped because nothing is needed
schema: fm-rounds.v1
home: /var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.oXGs0q
generated: "2026-07-31T14:22:04Z"
today: 2026-07-30
count_walk: 8
shown: 8
count_captain: 6
count_contradiction: 0
count_bookkeeping: 2
count_dispatchable: 2
count_quiet: 4
count_held: 1
count_landed: 1
count_secondmate: 1
count_conflicts: 1
walk[8]{pos,id,bucket,severity,why,drift,priority_word,priority_set,workspace_ambiguous,repo,kind,state,source,decisions,blocked_by_open,pr,report,since,title,detail}:
  1,auth-shape-k3,captain,"-",decision-waiting,null,urgent,true,false,storefront,ship,parked,status-log,1,null,null,null,2026-07-24,Rework session auth,keep sessions server-side or move to signed cookies
  2,pricing-page-v3,captain,"-",gate-arrived,null,high,true,false,storefront,ship,null,null,0,null,null,null,2026-07-10,New pricing page,not before the pricing review
  3,retry-queue-b8,captain,"-",failed,null,high,true,false,payments,ship,failed,status-log,0,null,null,null,2026-07-22,Retry queue for webhooks,the integration suite will not run without vendor credentials
  4,export-csv-p1,captain,"-",pr-ready,null,high,true,false,storefront,ship,done,status-log,0,null,"https://github.com/acme/storefront/pull/402",null,2026-07-26,CSV export for orders,"PR https://github.com/acme/storefront/pull/402 checks green"
  5,invoice-pdf-c1,captain,"-",ready-to-stand-down,null,medium,false,false,payments,ship,done,status-log,0,null,"https://github.com/acme/payments/pull/311",null,null,Invoice PDF rendering,PR merged
  6,audit-deps-w4,captain,"-",report-ready,null,medium,false,false,payments,scout,done,status-log,0,null,null,/var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.oXGs0q/data/audit-deps-w4/report.md,2026-07-28,Audit dependency drift,report ready
  7,untracked-fix-j0,unreliable,bookkeeping,no-backlog-row,no-backlog-row,medium,false,false,storefront,ship,working,pane,0,null,null,null,null,null,harness busy
  8,ghost-row-z9,unreliable,bookkeeping,no-lane,no-lane,medium,true,false,storefront,ship,null,null,0,null,null,null,2026-07-18,Migrate legacy settings,null
conflicts[1]{workspace,lanes}:
  /var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.oXGs0q/projects/wt-shared,billing-copy-r7 sidebar-nav-m2
dispatchable[2]{id,repo,kind,priority_word,title}:
  rate-limit-q2,payments,ship,high,Rate limit the public API
  tidy-logs-h6,storefront,ship,low,Tidy up log formatting
quiet[4]{id,why,action,state}:
  billing-copy-r7,progressing,none,working
  dark-mode-n4,waiting-on-another,none,null
  sidebar-nav-m2,progressing,none,working
  vendor-sync-t5,declared-wait,pause-ack,paused
omitted[2]{surface,reveal}:
  held under an active hold (1),tasks-axi list --state held
  landed and stood down (1),the Done section of data/backlog.md

############ RUN D: recomputed after the captain's answers are recorded
#   'not now, after the pricing review' -> hold re-dated to 2026-08-14
#   'merge it' + 'stand it down'        -> row merged, lane gone
#   'file the missing row'              -> the untracked lane is now tracked
schema: fm-rounds.v1
home: /var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.02oUII
generated: "2026-07-31T14:22:07Z"
today: 2026-07-30
count_walk: 5
shown: 5
count_captain: 4
count_contradiction: 0
count_bookkeeping: 1
count_dispatchable: 2
count_quiet: 5
count_held: 2
count_landed: 2
count_secondmate: 1
count_conflicts: 1
walk[5]{pos,id,bucket,severity,why,drift,priority_word,priority_set,workspace_ambiguous,repo,kind,state,source,decisions,blocked_by_open,pr,report,since,title,detail}:
  1,auth-shape-k3,captain,"-",decision-waiting,null,urgent,true,false,storefront,ship,parked,status-log,1,null,null,null,2026-07-24,Rework session auth,keep sessions server-side or move to signed cookies
  2,retry-queue-b8,captain,"-",failed,null,high,true,false,payments,ship,failed,status-log,0,null,null,null,2026-07-22,Retry queue for webhooks,the integration suite will not run without vendor credentials
  3,invoice-pdf-c1,captain,"-",ready-to-stand-down,null,medium,false,false,payments,ship,done,status-log,0,null,"https://github.com/acme/payments/pull/311",null,null,Invoice PDF rendering,PR merged
  4,audit-deps-w4,captain,"-",report-ready,null,medium,false,false,payments,scout,done,status-log,0,null,null,/var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.02oUII/data/audit-deps-w4/report.md,2026-07-28,Audit dependency drift,report ready
  5,ghost-row-z9,unreliable,bookkeeping,no-lane,no-lane,medium,true,false,storefront,ship,null,null,0,null,null,null,2026-07-18,Migrate legacy settings,null
conflicts[1]{workspace,lanes}:
  /var/folders/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T//rounds-e2e.02oUII/projects/wt-shared,billing-copy-r7 sidebar-nav-m2
dispatchable[2]{id,repo,kind,priority_word,title}:
  rate-limit-q2,payments,ship,high,Rate limit the public API
  tidy-logs-h6,storefront,ship,low,Tidy up log formatting
quiet: []
omitted[3]{surface,reveal}:
  quiet lanes (5),"--all"
  held under an active hold (2),tasks-axi list --state held
  landed and stood down (2),the Done section of data/backlog.md
Evidence: Captain-facing surface: RUN A rendered through the skill's presentation contract
# What the captain actually sees during `/rounds`

The queue is produced by `bin/fm-rounds-queue.sh` (RUN A in `rounds-e2e-walk.txt`, real
snapshot, 19 fleet members). The blocks below are that same RUN A data rendered through
the presentation contract in `.agents/skills/rounds/SKILL.md` - one item per message,
recommendation mandatory, no ids, no internals, full PR URLs. Reproduced here in full so a
reviewer can see the end-user surface; in a live session each block is one message and the
walk stops after it until the captain answers.

---

**Opening line** (one sentence, then item 1 and stop):

> Six things want you, captain, plus two record mismatches worth a minute. Everything else
> is moving on its own.

---

`` `
[1 of 8] storefront - Rework session auth                          urgent
State:    The work is parked on a design question and has been since 24 July.
Needs:    Which way session auth goes.
Options:  A) keep sessions server-side   B) move to signed cookies
I'd say:  A - server-side keeps revocation instant, and nothing else here depends on the
          cookie change landing first.
Then:     I pass your answer back and the work resumes on its own.
`` `

`` `
[2 of 8] storefront - New pricing page                             high
State:    You set this aside until the pricing review, and that date has now passed.
Needs:    Whether to start it now.
I'd say:  Start it - the review it was waiting on is behind us and nothing else is
          contending for that area.
Then:     I lift the deferral and put someone on it.
`` `

`` `
[3 of 8] payments - Retry queue for webhooks                       high
State:    Stopped and could not recover: the integration suite will not run without vendor
          credentials.
Needs:    Either the credentials, or a decision to stub that suite out.
I'd say:  Stub the vendor calls for now - the credentials are a separate ask and this has
          been sitting since 22 July.
Then:     I send that back as the way forward and the work picks up again.
`` `

`` `
[4 of 8] storefront - CSV export for orders                        high
State:    Finished and green: https://github.com/acme/storefront/pull/402
Needs:    Your merge.
I'd say:  Merge it - checks are green and it is self-contained.
Then:     I merge it, then come back before standing anything down.
`` `

`` `
[5 of 8] payments - Invoice PDF rendering       medium (no priority set)
State:    Already merged - https://github.com/acme/payments/pull/311 - but the work is
          still standing.
Needs:    Your word to close it out.
I'd say:  Close it out. I will look in first; a merge is not by itself permission to shut
          the door on whatever is still open there.
Then:     I check it is idle, then stand it down. I can also set a priority for next time.
`` `

`` `
[6 of 8] payments - Audit dependency drift      medium (no priority set)
State:    The investigation is done and the findings are written up.
Needs:    You to read them, and whether any of it becomes work.
I'd say:  Let me walk you through the findings now - it is short.
Then:     I relay them and we decide what, if anything, gets picked up.
`` `

`` `
[7 of 8] storefront - untracked work in progress     ⚠ state unclear
What I can see:  Something is actively running against storefront that nothing in the
                 records accounts for.
What I don't:    What it is meant to deliver, or who asked for it.
I'd say:         Let me look at it and file it properly so it stops being invisible.
`` `

`` `
[8 of 8] storefront - Migrate legacy settings        ⚠ state unclear
What I can see:  The records say this is under way since 18 July; nothing is running.
What I don't:    Whether it was ever started or quietly stopped.
I'd say:         Records-only drift, nothing at risk. I will clear the row unless you want
                 it actually started.
`` `

---

**Closing the walk** - the two batched surfaces, after the last item:

> Two pieces of ready work have nothing blocking them: rate limiting the public API
> (high) and tidying up log formatting (low). I'd start the rate limiting now and leave
> the log tidy-up for a quieter day - say the word and I'll set them going.
>
> One thing to flag: two pieces of work are pointed at the same workspace, so a state
> reading on either can be attributed to the wrong one. I can check which is which.

Skipped without asking, because nothing was needed: four items moving on their own or
waiting on other work, one you deferred to September, one already landed and closed out,
and the persistent supervisor. That is 19 fleet members reduced to 8 questions.
Evidence: Reproducible fixture harness used to produce the transcript
#!/usr/bin/env bash
# End-to-end evidence harness for /rounds.
#
# Builds a realistic synthetic firstmate home (backlog rows + state/*.meta +
# status logs + worktrees), then runs the REAL bin/fm-fleet-snapshot.sh and the
# REAL bin/fm-rounds-queue.sh over it - the exact path the /rounds skill takes.
# Nothing is stubbed except tmux (the runtime backend) and no-mistakes, so the
# fixture can express live / dead / busy / idle lanes deterministically.
set -eu

ROOT=$1                      # firstmate repo (this worktree)
HOME_DIR=$(mktemp -d "${TMPDIR:-/tmp}/rounds-e2e.XXXXXX")
export FM_HOME="$HOME_DIR"
mkdir -p "$HOME_DIR/state" "$HOME_DIR/data" "$HOME_DIR/projects" "$HOME_DIR/config"

FAKEBIN="$HOME_DIR/fakebin"; mkdir -p "$FAKEBIN"
cat > "$FAKEBIN/no-mistakes" <<'SH'
#!/usr/bin/env bash
exit 0
SH
# Fake tmux: window presence and pane busy-signature keyed off the target name.
cat > "$FAKEBIN/tmux" <<'SH'
#!/usr/bin/env bash
set -u
target=""; prev=""
for arg in "$@"; do [ "$prev" = "-t" ] && target=$arg; prev=$arg; done
# Lanes whose endpoint is GONE.
case "$target" in *gone-paused*) exit 1 ;; esac
case "${1:-}" in
  display-message)
    case "$*" in
      *pane_current_command*)
        case "$target" in *sidebar*|*billing*|*untracked*) printf 'claude\n' ;; *) printf 'zsh\n' ;; esac ;;
      *) printf '%%1\n' ;;
    esac ;;
  capture-pane)
    # Busy signature only for the lanes that are genuinely mid-run.
    case "$target" in
      *sidebar*|*billing*|*untracked*) printf 'editing src/api.ts\nesc to interrupt\n' ;;
      *) printf 'all quiet\n> \n' ;;
    esac ;;
esac
exit 0
SH
chmod +x "$FAKEBIN/no-mistakes" "$FAKEBIN/tmux"
export PATH="$FAKEBIN:$PATH"

mkdir -p "$HOME_DIR/projects/wt-auth" "$HOME_DIR/projects/wt-export" \
         "$HOME_DIR/projects/wt-invoice" "$HOME_DIR/projects/wt-audit" \
         "$HOME_DIR/projects/wt-shared" "$HOME_DIR/projects/wt-untracked" \
         "$HOME_DIR/projects/wt-retry" "$HOME_DIR/projects/wt-vendor" \
         "$HOME_DIR/secondmate-home"

cat > "$HOME_DIR/data/backlog.md" <<'MD'
## In flight
- [ ] auth-shape-k3 - Rework session auth (repo: storefront) (kind: ship) (priority: 0) (since 2026-07-24)
- [ ] export-csv-p1 - CSV export for orders (repo: storefront) (kind: ship) (priority: 1) (since 2026-07-26)
- [ ] retry-queue-b8 - Retry queue for webhooks (repo: payments) (kind: ship) (priority: 1) (since 2026-07-22)
- [ ] audit-deps-w4 - Audit dependency drift (repo: payments) (kind: scout) (since 2026-07-28)
- [ ] sidebar-nav-m2 - Refresh sidebar navigation (repo: storefront) (kind: ship) (priority: 2) (since 2026-07-29)
- [ ] billing-copy-r7 - Billing page copy pass (repo: payments) (kind: ship) (priority: 3) (since 2026-07-29)
- [ ] vendor-sync-t5 - Vendor catalog sync (repo: payments) (kind: ship) (priority: 2) (since 2026-07-20)
- [ ] ghost-row-z9 - Migrate legacy settings (repo: storefront) (kind: ship) (priority: 2) (since 2026-07-18)

## Queued
- [ ] rate-limit-q2 - Rate limit the public API (repo: payments) (kind: ship) (priority: 1) (since 2026-07-27)
- [ ] tidy-logs-h6 - Tidy up log formatting (repo: storefront) (kind: ship) (priority: 3) (since 2026-07-27)
- [ ] dark-mode-n4 - Dark mode for checkout (repo: storefront) (kind: ship) (priority: 2) (since 2026-07-25) blocked-by: auth-shape-k3 - waits on the auth rework
- [ ] pricing-page-v3 - New pricing page (repo: storefront) (kind: ship) (priority: 1) (since 2026-07-10) (hold: not before the pricing review) (hold-kind: captain) (hold-until: 2026-07-29)
- [ ] mobile-app-y8 - Mobile app shell (repo: storefront) (kind: ship) (priority: 0) (since 2026-07-12) (hold: revisit after the quarter, not now) (hold-kind: captain) (hold-until: 2026-09-01)

## Done
- [x] invoice-pdf-c1 - Invoice PDF rendering https://github.com/acme/payments/pull/311 (repo: payments) (kind: ship) (merged 2026-07-30)
- [x] search-fix-d5 - Fix product search ranking https://github.com/acme/storefront/pull/298 (repo: storefront) (kind: ship) (merged 2026-07-28)
MD

meta() { f=$1; shift; : > "$f"; for kv in "$@"; do printf '%s\n' "$kv" >> "$f"; done; }

# 1. open decision waiting on the captain (urgent)
meta "$HOME_DIR/state/auth-shape-k3.meta" "window=firstmate:fm-auth-shape-k3" \
  "worktree=$HOME_DIR/projects/wt-auth" "project=storefront" "harness=claude" "kind=ship" "mode=no-mistakes" "yolo=off"
printf 'working: starting\nneeds-decision [auth-shape]: keep sessions server-side or move to signed cookies\n' \
  > "$HOME_DIR/state/auth-shape-k3.status"

# 2. green PR awaiting the captain's merge (high)
meta "$HOME_DIR/state/export-csv-p1.meta" "window=firstmate:fm-export-csv-p1" \
  "worktree=$HOME_DIR/projects/wt-export" "project=storefront" "harness=claude" "kind=ship" "mode=no-mistakes" "yolo=off" \
  "pr=https://github.com/acme/storefront/pull/402"
printf 'done: PR https://github.com/acme/storefront/pull/402 checks green\n' > "$HOME_DIR/state/export-csv-p1.status"

# 3. crew that could not recover (high)
meta "$HOME_DIR/state/retry-queue-b8.meta" "window=firstmate:fm-retry-queue-b8" \
  "worktree=$HOME_DIR/projects/wt-retry" "project=payments" "harness=claude" "kind=ship" "mode=no-mistakes" "yolo=off"
printf 'failed: the integration suite will not run without vendor credentials\n' > "$HOME_DIR/state/retry-queue-b8.status"

# 4. scout with its report on disk (no priority recorded)
meta "$HOME_DIR/state/audit-deps-w4.meta" "window=firstmate:fm-audit-deps-w4" \
  "worktree=$HOME_DIR/projects/wt-audit" "project=payments" "harness=claude" "kind=scout" "mode=scout" "yolo=off"
printf 'done: report ready\n' > "$HOME_DIR/state/audit-deps-w4.status"
mkdir -p "$HOME_DIR/data/audit-deps-w4"; printf '# Dependency drift\n' > "$HOME_DIR/data/audit-deps-w4/report.md"

# 5+6. two live lanes genuinely mid-run, sharing one workspace path
meta "$HOME_DIR/state/sidebar-nav-m2.meta" "window=firstmate:fm-sidebar-nav-m2" \
  "worktree=$HOME_DIR/projects/wt-shared" "project=storefront" "harness=claude" "kind=ship" "mode=no-mistakes" "yolo=off"
printf 'working: implementing\n' > "$HOME_DIR/state/sidebar-nav-m2.status"
meta "$HOME_DIR/state/billing-copy-r7.meta" "window=firstmate:fm-billing-copy-r7" \
  "worktree=$HOME_DIR/projects/wt-shared" "project=payments" "harness=claude" "kind=ship" "mode=no-mistakes" "yolo=off"
printf 'working: implementing\n' > "$HOME_DIR/state/billing-copy-r7.status"

# 7. declared external wait, endpoint still there -> quiet
meta "$HOME_DIR/state/vendor-sync-t5.meta" "window=firstmate:fm-vendor-sync-t5" \
  "worktree=$HOME_DIR/projects/wt-vendor" "project=payments" "harness=claude" "kind=ship" "mode=no-mistakes" "yolo=off"
printf 'paused: waiting on the vendor sandbox to come back\n' > "$HOME_DIR/state/vendor-sync-t5.status"

# 8. running lane with no backlog row -> bookkeeping drift
meta "$HOME_DIR/state/untracked-fix-j0.meta" "window=firstmate:fm-untracked-fix-j0" \
  "worktree=$HOME_DIR/projects/wt-untracked" "project=storefront" "harness=claude" "kind=ship" "mode=no-mistakes" "yolo=off"
printf 'working: implementing\n' > "$HOME_DIR/state/untracked-fix-j0.status"

# 9. merged row whose lane is still standing -> ready to stand down
meta "$HOME_DIR/state/invoice-pdf-c1.meta" "window=firstmate:fm-invoice-pdf-c1" \
  "worktree=$HOME_DIR/projects/wt-invoice" "project=payments" "harness=claude" "kind=ship" "mode=no-mistakes" "yolo=off" \
  "pr=https://github.com/acme/payments/pull/311"
printf 'done: PR merged\n' > "$HOME_DIR/state/invoice-pdf-c1.status"

# 10. persistent supervisor - never a work item
meta "$HOME_DIR/state/payments-second-a1.meta" "window=firstmate:fm-payments-second-a1" \
  "worktree=$HOME_DIR/secondmate-home" "project=$HOME_DIR/secondmate-home" "harness=claude" \
  "kind=secondmate" "mode=secondmate" "home=$HOME_DIR/secondmate-home" "projects=payments"
printf 'working: watching delegated scope\n' > "$HOME_DIR/state/payments-second-a1.status"

# ghost-row-z9 is recorded in flight with nothing running -> bookkeeping drift (no meta on purpose)

export FM_ROUNDS_TODAY=2026-07-30

if [ "${FM_DEMO_ANSWERS:-0}" = 1 ]; then
  # Replay what the captain's answers would record, exactly as the /rounds
  # recording table prescribes, then recompute. The walk keeps no cursor: the
  # answers live in the backlog and the fleet, and the next run reflects them.
  #   "not now, after the pricing review" -> a fresh dated hold
  sed -i.bak 's|(hold: not before the pricing review) (hold-kind: captain) (hold-until: 2026-07-29)|(hold: after the pricing review) (hold-kind: captain) (hold-until: 2026-08-14)|' "$HOME_DIR/data/backlog.md"
  #   "merge it" + "stand it down" -> merged row, lane torn down
  sed -i.bak '/export-csv-p1/d' "$HOME_DIR/data/backlog.md"
  printf '%s\n' '- [x] export-csv-p1 - CSV export for orders https://github.com/acme/storefront/pull/402 (repo: storefront) (kind: ship) (merged 2026-07-30)' >> "$HOME_DIR/data/backlog.md"
  rm -f "$HOME_DIR/state/export-csv-p1.meta" "$HOME_DIR/state/export-csv-p1.status"
  #   "file the missing row" -> the untracked lane gets tracked
  sed -i.bak 's|^## Queued$|- [ ] untracked-fix-j0 - Fix stale cart totals (repo: storefront) (kind: ship) (priority: 2) (since 2026-07-29)\n\n## Queued|' "$HOME_DIR/data/backlog.md"
  rm -f "$HOME_DIR/data/backlog.md.bak"
fi

"$ROOT/bin/fm-rounds-queue.sh" "${@:2}"
Evidence: Default walk over the synthetic fleet (excerpt)
count_walk: 8
shown: 8
count_captain: 6
count_bookkeeping: 2
count_dispatchable: 2
count_quiet: 4
count_held: 1
count_landed: 1
count_secondmate: 1
count_conflicts: 1
walk[8]{pos,id,bucket,severity,why,...}:
1,auth-shape-k3,captain,"-",decision-waiting,null,urgent,...
2,pricing-page-v3,captain,"-",gate-arrived,null,high,...
3,retry-queue-b8,captain,"-",failed,null,high,...
4,export-csv-p1,captain,"-",pr-ready,null,high,...
5,invoice-pdf-c1,captain,"-",ready-to-stand-down,null,medium,...
6,audit-deps-w4,captain,"-",report-ready,null,medium,...
7,untracked-fix-j0,unreliable,bookkeeping,no-backlog-row,...
8,ghost-row-z9,unreliable,bookkeeping,no-lane,...
dispatchable[2]: rate-limit-q2 (high), tidy-logs-h6 (low)
omitted[3]: quiet lanes (4) | held under an active hold (1) | landed and stood down (1)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 issues (1 warning, 1 info)
  • ⚠️ bin/fm-rounds-queue.sh:320 - gate-arrived is evaluated in the $ask chain 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 its blocked-by dependencies are still open. Verified against a synthetic snapshot: a row with hold-until: 2026-07-01 and blocked_by_all: [&#34;blocker-a&#34;] (blocker-a still queued) came back as bucket: captain, why: gate-arrived with no blocker signal, while blocker-a itself was still listed as dispatchable. The SKILL's recording table then says to tasks-axi unhold &lt;id&gt; and "take the action they asked for", which routes straight into dispatching work on an unmet dependency - the same hazard the blocked_by_all fix closed for the dispatchable batch, reached through the other door. Consider gating gate-arrived on blocker_open($b) | not, or emitting a blocked_by field on walk entries so the presenter can caveat it.
  • ⚠️ bin/fm-rounds-queue.sh:284 - $bad is 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 with hints.open_decisions of length 1 and no backlog row classifies as bucket: unreliable, why: no-backlog-row, severity: bookkeeping, with count_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 $ask win 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 &lt; 0 or &gt; 4, so a hand-edited non-integer such as (priority: 2.5) passes. Verified: it yields priority_set: true, priority_word: &#34;medium&#34;, and sort_priority: 2.5 - the word says medium, the sort sits between medium and low, and priority_set: true suppresses 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-runs bin/fm-rounds-queue.sh after every captain answer and after every mid-walk wake. Each run shells out to a full fm-fleet-snapshot.sh --json, which invokes fm-crew-state.sh per task, and that in turn can call no-mistakes axi status with 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 made no-lane (bookkeeping) yield to the captain chain, and the only captain reason reachable when $t == null is gate-arrived - so a backlog row in state in_flight carrying an arrived hold gate now classifies bucket: captain, why: gate-arrived, drift: no-lane where it previously classified bucket: unreliable, why: no-lane. Verified by running the projection against a synthetic snapshot: a row {state: in_flight, hold: &#34;captain said wait&#34;, hold_until: 2026-07-01} with no matching task came back as count_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 to tasks-axi unhold &lt;id&gt; 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 secondary drift line. The $t == null guard on gate-arrived was written to mean "nothing is working this yet", which no-lane directly contradicts, so this pairing should keep the drift as the presented reason: gate the branch on $book != &#34;no-lane&#34; (or on $b.state != &#34;in_flight&#34;), leaving every other bookkeeping-yields-to-captain case exactly as this round built it.
  • ℹ️ .agents/skills/rounds/SKILL.md:74 - blocked_by_open is 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 is quiet is suppressed entirely without --all, and only a blocker that happens to land in walk[] or dispatchable[] has a title the 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 - The blocked_by_open presentation rule is unconditional, but the field can never be set on the case it was added to guard. blocked_by_open is non-null exactly when blocker_open($b) is true (bin/fm-rounds-queue.sh:264-267), while gate-arrived requires blocker_open($b) | not (line 361) and the dispatchable bucket 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 records tasks-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 is bucket: captain, why: pr-ready, blocked_by_open: &#34;A&#34;, 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 - The indeterminate detector is scoped to $st == &#34;unknown&#34; and $src == &#34;none&#34;, but bin/fm-crew-state.sh can emit unknown with source run-step: its coarse runs-list fallback sets RUN_STATE=unknown in the default arm of the case &#34;$COARSE_STATUS&#34; switch and then reaches emit &#34;$RUN_STATE&#34; run-step &#34;$RUN_DETAIL&#34;. Such a lane with a live endpoint matches no contradiction detector (dead-lane-run needs endpoint.exists == false), no bookkeeping detector, and no captain reason, so it falls through the $ask chain to the else arm of $quiet and classifies bucket: 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 the indeterminate detector exists for. Reachability is low today (it needs no-mistakes runs to report a status word outside running/completed/cancelled/failed), but the guard is cheap: drop the $src == &#34;none&#34; condition, or add an elif $t != null and $st == &#34;unknown&#34; 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 pass
  • bash tests/fm-fleet-snapshot-view.test.sh - 13 cases including the new multi-blocker and hold-token parsing, all pass
  • Manual e2e: built a synthetic FM_HOME (8 in-flight rows, 5 queued, 2 done, 10 live lanes incl. a secondmate) and ran the real bin/fm-fleet-snapshot.sh -> real bin/fm-rounds-queue.sh with only tmux/no-mistakes stubbed
  • bin/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 conflict
  • bin/fm-rounds-queue.sh --limit 3 - verified walk truncation is disclosed in omitted[] while every count_* stays the pre-limit population and shown tracks the limit
  • bin/fm-rounds-queue.sh --all - verified the quiet bucket (progressing, waiting-on-another, declared-wait) is what gets skipped
  • Manual 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 step
  • Rendered 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)
⚠️ **Document** - 1 info
  • ℹ️ 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.
⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint fixes needed; shellcheck 0.11.0 passes clean
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint changes needed; shellcheck 0.11.0 clean
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint fixes needed; shellcheck 0.11.0 passes clean
1 warning still open:

  • ⚠️ linter found issues (exit code 127)
✅ **Push** - passed

✅ No issues found.

7hoenix added 9 commits July 30, 2026 09:25
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.
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.
@7hoenix
7hoenix merged commit 568cebf into main Jul 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant