Skip to content

fix: surface green no-mistakes PRs awaiting merge - #5327

Merged
kunchenguid merged 4 commits into
mainfrom
fm/fm-green-nm-pr-unreported-r1
Sep 22, 2026
Merged

kunchenguid merged 4 commits into
mainfrom
fm/fm-green-nm-pr-unreported-r1

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

A green no-mistakes ship PR can sit fully green with nobody told, so the captain is never asked to merge it. On task fm-afk-landed-teardown-gap-r1 (firstmate repo, no-mistakes v1.79.0, run 01M351FDMW4618QZPN0N9NYHYV, PR #5317), all pipeline steps completed through pr and every GitHub check went green, yet the PR sat green about fifty minutes with no report to the captain. Two independent failures combined:

  1. The worker never appended its green-PR done line. The no-mistakes ci step stays status=running while it monitors the merge and re-arms its own timeout each time the base branch advances, so it never transitions to a terminal state or the next gate even after every check is green. The worker's background wait for the run to reach "the next gate or outcome" therefore never fires, so the worker never learns checks went green and never reports, despite its instructions to report when CI first goes green.

  2. The supervisor-side fallback also could not see it. bin/fm-crew-state.sh returned "state: unknown - source: run-step - complete same-branch run inventory unreadable" for both of that day's no-mistakes ships on every read, so heartbeat review never observed checks-green and the idle worker was never flagged as waiting for a merge.

The required outcome: a green no-mistakes PR always reaches the captain for merge, without depending on the worker remembering to append a report line. Both the worker-side green detection and the supervisor-side crew-state read must be able to observe a checks-green PR that is still in ci merge-monitoring.

What Changed

  • Instruct no-mistakes workers to reattach drive calls and report their checks-passed result instead of waiting for status polling to expose a green PR.
  • Resolve capped run inventories using the overview’s repository identity and detect checks-green merge monitoring from full CI logs, preserving readiness across base-branch timeout re-arms and including the PR URL.
  • Add regression coverage and documentation for linked worktrees, truncated log tails, and green PRs awaiting merge.

Risk Assessment

✅ Low: The change is well-bounded, addresses both worker and supervisor observability paths, and includes behavior-focused regression coverage for linked worktrees, re-arm lines, and log-tail eviction.

Testing

The generated worker brief established the live scaffolding scenario. The targeted scripts and isolated reproductions produced supporting non-live observations for supervisor and CI-state behavior, but the historical production run was unavailable from this repository context, so those scenarios could not be validated against the live product.

  • Live validation: ⚠️ inconclusive - 1 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Scaffolding a no-mistakes ship tells the worker to reattach the drive call until it returns checks-passed, rather than waiting on status polling ✅ pass live Generated no-mistakes worker brief
Supervisor reads a linked-worktree green PR from a capped run inventory and reports it ready for review with its PR URL ⏸️ untested no The prior payload recorded only an isolated reproduction and a test script, not a live product run. An accessible live no-mistakes run containing a linked-worktree green PR and capped run inventory is…
A green marker remains observable after more timeout re-arm lines than the default no-mistakes log tail ⏸️ untested no The prior payload recorded only a simulated transcript with 60 re-arm lines, not a live product run. An accessible live no-mistakes run whose full log contains a green marker followed by more re-arm l…
Pending checks or a new issue after an earlier green marker remain working instead of being falsely reported ready ⏸️ untested no The prior payload recorded only adversarial isolated states, not live product behavior. Accessible live no-mistakes runs exhibiting pending checks and a post-green relapse are required to establish th…
Evidence: Green PR supervisor transcript

Source: Green PR supervisor transcript

Scenario: supervisor reads a linked-worktree no-mistakes run whose green marker predates 60 timeout re-arm lines

User-visible fm-crew-state output:
state: done · source: run-step · checks green: PR ready for review (still monitoring for merge/close): https://github.com/o/r/pull/5317 · run: 01GREEN

Dependency calls made by fm-crew-state:
axi status
axi
axi status --run 01GREEN
axi logs --step ci --run 01GREEN --full
Evidence: Generated no-mistakes worker brief

Source: Generated no-mistakes worker brief

You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
## Captain's intent
{TASK}

## Firstmate spec
{FIRSTMATE_SPEC}

# Herdr lifecycle declaration - NOT ENABLED
**HARD SAFETY GATE:** this scaffold cannot inspect the task text filled in above.
If the task will start, stop, delete, restart, profile, or otherwise drive Herdr lifecycle behavior, stop and regenerate the brief with `--herdr-lab` before dispatch.
Do not add Herdr lifecycle commands to this unguarded brief by hand.

# Setup
You are in a disposable git worktree of firstmate, at a detached HEAD on a clean default branch.

**Verify isolation before anything else.** Run `pwd -P` and `git rev-parse --show-toplevel`; both must resolve to the disposable task worktree you were launched in, such as a treehouse pool path or an Orca-managed worktree, not the primary checkout firstmate operates from.
The path check is authoritative: `git rev-parse --git-dir` and `git rev-parse --git-common-dir` can help inspect the repo, but they do not prove you are outside the primary checkout.
If the top-level path is the primary checkout or not the worktree you were launched in, STOP - do not branch or commit here - append `blocked [at=<epoch>]: launched in primary checkout, not an isolated worktree` to the status file and stop.

1. First action: create your branch: `git checkout -b fm/green-pr-demo`
2. Run `no-mistakes doctor`; if it reports the repo is not initialized here, run `no-mistakes init`.

# Rules
1. Never push to the default branch. Never merge a PR.
2. Stay inside this worktree; modify nothing outside it.
3. Use gh-axi for GitHub operations and chrome-devtools-axi for browser operations.
4. Report status by appending one line:
   `echo "{state} [at=<epoch>]: {one short line}" >> '~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/.test-tmp-green-pr/home/state/green-pr-demo.status'`
   States: working, needs-decision, blocked, paused, done, failed.
   Substitute `<epoch>` with the current Unix time in seconds - run `date +%s` and write the number it printed; a stamp that is not plain digits records no time at all.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on (setup done, bug reproduced, fix implemented, validation passed) and the
   needs-decision/blocked/paused/done/failed states. No step-by-step FYI progress lines;
   firstmate reads your pane for that.
   Whenever you mention a PR anywhere - a status line, your terminal, a summary - write its full
   https:// URL exactly as the forge printed it, never a bare number such as "PR 108"; firstmate
   copies that URL from your line rather than assembling one.
   A mid-task `working:` line (including setup complete) is nonterminal: do not end the
   turn after it; continue the same stage until a defined `done:` gate under Definition of done.
   Use `paused: {why}` - distinct from `blocked:` - ONLY when you are deliberately idling on a
   known external wait you expect to clear on its own (an upstream release, a rate-limit reset, a scheduled window, or your own validation round):
   firstmate then leaves your idle pane alone and rechecks it on a long
   cadence instead of treating it as a possible wedge. Use `blocked:` when you are stuck and need help.
5. If you hit the same obstacle twice, append `blocked [at=<epoch>]: {why}` and stop; firstmate will help.
6. If a decision belongs above the implementation worker (product choices, destructive actions),
   append `needs-decision [at=<epoch>]: {summary of options}` and stop. Firstmate will reply with the decision.
   For a no-mistakes ask-user gate specifically, escalate all ask-user findings as one event plus one snapshot file, using that same shape even when the gate holds only a single ask-user finding: write only the ask-user findings, verbatim and unparaphrased (id, severity, file, line, description, authority), to `~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/.test-tmp-green-pr/home/data/green-pr-demo/nm-<run>-findings.txt`, then report the gate with
   `needs-decision [at=<epoch>] [key=nm-<run>-<step>]: ask-user findings=<id1>,<id2>,... file=~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/.test-tmp-green-pr/home/data/green-pr-demo/nm-<run>-findings.txt`
   naming every ask-user finding id from that gate. The status line only points at the file; it never restates or summarizes a finding's content.
   A decision or blocker you opened stays open until a `resolved` line carrying its exact key lands; a later `done:` or `working:` line never closes it, even when the answer is what started that work.
   Firstmate's reply normally writes that closing line at answer time; when a blocker or wait clears WITHOUT a firstmate reply, append `resolved [at=<epoch>]: {how it cleared}` yourself (same `[key=<slug>]` if you opened it with one) as you resume.
7. Never stop, restart, or update the shared `no-mistakes` daemon - it is one instance serving
   every lane/home, so restarting it kills other lanes' in-flight pipeline runs; only firstmate
   manages the daemon.
   Before you append `blocked:` about the pipeline, run `no-mistakes daemon status` and
   `no-mistakes axi status`. If the daemon socket refuses connections or is missing, append
   `blocked [at=<epoch>]: {the daemon error}` and stop even when the local run record still says running or
   fixing, because that record can be stale after the daemon exits. A run record failed with a
   daemon error is also a real block.
   Only after ruling out socket refusal, if the run is still running or fixing, reattach and keep
   going. A drive-call error, timeout, slow read, or generic unreachability is NOT a daemon error:
   the daemon accepts `respond` immediately and runs the round in the background, so a killed or
   timed-out call was only waiting for a read while the run kept working.

# Firstmate instruction inbox
Firstmate steers you through durable message files in '~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/.test-tmp-green-pr/home/state/green-pr-demo.inbox'.
When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list '~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/.test-tmp-green-pr/home/state/green-pr-demo.inbox'/*.msg, read and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/.test-tmp-green-pr/home/state/green-pr-demo.inbox'/NNN.msg '~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/.test-tmp-green-pr/home/state/green-pr-demo.inbox'/handled/`.
The move IS the acknowledgement: without it firstmate rings again and eventually treats you as stuck. An empty or absent inbox needs no action.

# Project memory
If `AGENTS.md` or `CLAUDE.md` already exists, or if this task produced durable project-intrinsic knowledge, run `~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/bin/fm-ensure-agents-md.sh .` in the worktree.
Record only project knowledge useful to almost every future session.
For anything the codebase already shows, prefer a pointer to the authoritative file, command, or doc over copying the detail.
If you touch a project `AGENTS.md`, follow `~/.no-mistakes/worktrees/52b07e9083e7/01M35A07ND0CMZXWX71B2AH6FH/bin/fm-ensure-agents-md.sh`'s self-governance contract in the same pass.
Keep it proportionate: skip `AGENTS.md` edits for trivial tasks that produced no durable project knowledge.

# Definition of done
Delivery contract: mode=no-mistakes
The task is complete only when committed on your branch.
When you believe it is complete, append `done [at=<epoch>]: {summary}` to the status file and stop.
Firstmate will then instruct you to run /no-mistakes to validate and ship a PR.

You drive no-mistakes by responding to its gates, not by implementing fixes.
Follow the guidance no-mistakes itself provides for the mechanics: it loads when you invoke /no-mistakes, and `no-mistakes axi run --help` plus the `help` lines in each `axi` response are authoritative and version-matched to the installed binary.
When starting no-mistakes, pass `--intent` as only this brief's `## Captain's intent` subsection body, not its heading, plus any later words the captain actually said.
Preserve the actual words without adding speaker labels or direct address; the subsection heading supplies provenance outside the pipeline input.
For a legacy brief with no such subsection, include only words on lines marked `[captain] `, excluding that metadata prefix; never copy its mixed `# Task` wholesale.
If it has no provenance-marked captain words, stop and ask firstmate instead of starting no-mistakes.
Do not include `## Firstmate spec`, later Firstmate build constraints, or your own decisions and tradeoffs.
The `--intent` string you pass must be self-sufficient: that string plus the codebase must let a reader reconstruct roughly the same specification, without depending on a separate report, a PR, or context that lives only in this conversation.
When the captain's intent refers to a report, decision, or PR ("do items 1, 2, 3, and 7 of the report"), write the substance of the referenced items into `--intent` in the captain's terms, not only the pointer; that substance is the captain's ask by reference, while Firstmate's build instructions and your own decisions still stay out.
This replaces the no-mistakes skill's advice to enrich `--intent` with decisions and tradeoffs; that advice does not apply to Firstmate-dispatched work.
Do not hand-edit, commit, or fix findings yourself while a run is active - the pipeline applies every fix.

One drive call blocks until the next gate or outcome, which routinely outlives what your harness lets a single command run: Claude Code kills a command at ten minutes maximum, while one fix round is capped around thirty minutes and up to three rounds chain.
So background the drive call instead of sitting in one blocking hold your harness will kill, and read its return when it finishes.
Where a harness's own command limit is not established, assume it bounds commands and use that same backgrounded shape.
Only a drive call's return reports the green PR: `no-mistakes axi status` shows progress but never reports `checks-passed` while the ci step is still monitoring the PR for merge, so never wait on a status poll for the next gate or outcome.
Whenever a drive call returns without a gate or an outcome - its own wait elapsed, or it was killed or timed out - reattach at once by re-running `no-mistakes axi run` without flags, backgrounded the same way; once checks are green it returns `checks-passed` immediately, and if it refuses because no run is active, read the finished outcome from `no-mistakes axi status`.
A killed or timed-out call is never evidence the daemon died: the daemon accepts your response immediately and runs the round in the background, so the call was only ever waiting for a read while the run kept working.
Reattach and keep going rather than reporting the pipeline blocked; rule 7 owns the checks that decide when a pipeline block is real.

Two firstmate-specific rules layer on top of that guidance:
- ask-user findings are never yours to answer: escalate to firstmate using rule 6's ask-user format and stop.
  Firstmate applies `ask-user-authority` and obtains any required captain decision.
  When the decision comes back, feed it to the gate with `no-mistakes axi respond` and let the pipeline apply it - do not route the question to "the user" or implement the fix yourself.
- NEVER pass `--yes` (or `-y`) to `no-mistakes axi run` or `no-mistakes axi respond`. It is banned fleet-wide.
  It auto-resolves every gate including ask-user findings with no escalation, and answering your own ask-user finding is a hard rule violation.

After /no-mistakes reports CI green (the CI-ready return point - do not wait for it to keep monitoring in the background until merge), read the PR back from the forge and confirm it is not a draft (`gh pr view <url> --json isDraft` must print false); if it is a draft, mark it ready with `gh-axi pr ready`.
A draft cannot be merged, so a done report on one leaves the merge unasked.
Then append `done [at=<epoch>]: PR {url} checks green` and stop. You are finished.
If you deliberately keep the PR a draft, append `paused [at=<epoch>]: {why the draft is held}` instead of done.
Evidence: Adversarial CI-state boundary transcript

Source: Adversarial CI-state boundary transcript

Adversarial CI-state boundaries through the user-facing fm-crew-state command

Checks have not registered yet:
state: working · source: run-step · validating (running) · run: 01BOUNDARY

Earlier green marker followed by a new issue:
state: working · source: run-step · validating (running) · run: 01BOUNDARY
Evidence: Targeted brief tests

Source: Targeted brief tests

COMMAND: tests/fm-brief.test.sh

ok - fm-brief: scaffolds leave the worker role scope to the launch boundary and keep the secondmate contract
ok - fm-brief.sh: bash -n succeeds
/private/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/fm-brief.srh8Jj/heredoc-in-substitution.sh:2
ok - fm-brief.sh: no heredoc is nested inside a command substitution (Bash 3.2 parse-safe)
ok - fm-brief.sh: --help renders the complete header
ok - fm-brief.sh: no-mistakes/direct-PR/local-only briefs generate cleanly
ok - fm-brief.sh: ship --mode is required and closed-set validated
ok - fm-brief.sh: the explicit ship mode wins over the registered posture
ok - fm-brief.sh: --yolo and scout/secondmate --mode are refused, never silently dropped
ok - fm-brief.sh: faster paths use configured authority without stacked review
ok - fm-brief.sh: no-mistakes DOD keeps its apostrophe prose and bans --yes outright
ok - fm-brief.sh: no-mistakes DOD detects a green PR from the drive call, not a status poll
ok - fm-brief.sh: PR-based done requires a non-draft PR; a deliberate draft declares a wait
ok - fm-brief.sh: no-mistakes ask-user findings use one event plus a verbatim snapshot
ok - fm-brief.sh: ship project-memory wording carries the AGENTS.md authoring bar
ok - fm-brief.sh: --herdr-lab emits the complete hard safety contract
ok - fm-brief.sh: --herdr-lab uses its quoted Firstmate-owned helper path
ok - fm-brief.sh: ship and scout scaffolds make omitted Herdr intent fail-visible
ok - fm-brief.sh: the documented {TASK} and {FIRSTMATE_SPEC} fills cannot corrupt the Herdr safety gate
ok - fm-brief.sh: Herdr lab contract covers scouts and rejects secondmate misuse
ok - fm-brief.sh: --no-projects scaffolds a project-less charter and guards misuse
ok - fm-brief.sh: marked requests avoid generic acknowledgements and preserve material reporting
ok - fm-brief.sh: relative directory inputs ignore CDPATH, render stable absolute charter paths, or fail loudly
ok - fm-brief.sh: custom pause verb renders in every scaffold
ok - fm-brief.sh: ship and scout scaffolds teach validation-round pauses
ok - fm-brief.sh: investigation and visual-review completions load the shared decision policy
ok - fm-brief: scout and secondmate code paths still scaffold well-formed briefs
ok - fm-brief.sh: scout Lavish hosting follows the bootstrap lavish-axi floor
ok - fm-brief.sh: the home brief include lands last on ship and scout, verbatim, and fails closed
Evidence: Targeted crew-state tests

Source: Targeted crew-state tests


COMMAND: tests/fm-crew-state.test.sh

ok - captured AXI replacement status replays through crew-state
ok - captured AXI parked status replays through crew-state
ok - captured AXI failed status replays through crew-state
ok - captured capped inventory replays selection, ambiguity, and unavailable lookup
ok - captured status formats reject a synthetic authority transition
ok - captured completed status yields to synthetic subsequent development
ok - active run-step is authoritative
ok - stale needs-decision over active run is superseded
ok - stale blocked over active run is superseded
ok - daemon/timeout blocked claim over a live fixing run reads as run alive
ok - socket refusal or missing socket over a stale fixing run reports blocked
ok - socket refusal over a terminal attributed run reports blocked
ok - socket-down evidence outranks a live run only while it is the log's latest event
ok - broken-pipe blocker over a live run keeps the plain superseded reading
ok - genuine daemon-down blocked line still reports blocked
ok - a busy secondmate keeps its open blocker until that exact key closes
ok - the most recently opened decision supplies the reported state and detail
ok - ship and scout terminal declarations supersede stale decisions
ok - latest status retains legacy completion events and shared captain matching
ok - latest status subprocess work stays bounded and still reads past a long prose tail
ok - genuine parked run is not flagged superseded
ok - the parked human-decision component is derived from the findings table's action column
ok - scalar gate parked run is not flagged superseded
ok - gate block parked run is not flagged superseded
ok - ci-ready status log beats monitoring run
ok - ci-monitoring run with checks already green surfaces done
ok - top-level ci status uses ci log green marker
ok - terminal no-checks ci-monitor marker surfaces done
ok - base-advance re-arm after green stays checks green
ok - a green marker before the ci log tail still surfaces done
ok - pending no-checks ci-monitor marker stays working
ok - ci-monitoring run with checks not yet green stays working
ok - a fresh issue after an earlier green reading is not masked
ok - stale checks-green status log does not mask CI relapse
ok - ci fixing is not overridden by an earlier green marker
ok - top-level fixing is not overridden by a stale ci running row
ok - top-level fixing is not overridden by a stale done log
ok - terminal passed run is authoritative
ok - terminal passed-with-override run reads done like a clean pass
ok - terminal passed run uses matching retirement receipt without forge
ok - terminal passed no-forge mode preserves local receipt evidence
ok - terminal passed run with open PR does not claim merged
ok - terminal passed run PR overrides stale task metadata
ok - terminal passed run without readable PR identity reports unknown
ok - terminal passed run reads open GitLab MR state
ok - terminal passed run reads merged GitLab MR state
ok - terminal passed run handles failed GitLab read
ok - terminal failed run is authoritative
ok - orphaned ci monitor after green reads as held-for-merge done
ok - status-only failed orphaned ci monitor after green reads done
ok - genuinely failing CI keeps the failed verdict
ok - a second failed step disqualifies the orphaned-monitor reclassification
ok - cross-branch run is attributed via the real runs list
ok - socket refusal over a coarse active run reports blocked
ok - failed ledger record reads unknown only when the daemon is provably down
ok - cross-branch attribution picks the branch's most recent row
ok - a newer failure is not hidden by a live sibling
ok - runs-list selection keeps the newer failure over an older live row
ok - an older unfetched live sibling does not hide a newer failure
ok - two terminal rows keep the existing newest-first precedence
ok - an unclassifiable status row keeps the ledger's newest-first precedence
ok - a terminal run with no live sibling is unchanged
ok - coarse run does not probe another branch's ci log
ok - another branch's run is ignored, falls back
ok - no run + a busy semantic record reads working, attributed to its source
ok - a launch parked on a recognized interactive prompt never reads working, closing the absorb path a stale watcher poll depends on
ok - a converted adapter never reads working from rendered footer text
ok - grok still reads working through its isolated rendered-tail fallback
ok - herdr's native busy verdict reads working with no record present
ok - a herdr CLI that fails to answer reads unknown/unreachable, never gone
ok - an alive endpoint whose scrollback read failed stays working
ok - a husk pane (agent gone) still reads gone for reclaim
ok - a mid-tool-call crew stays working because its record outranks herdr's generation state
ok - an idle record with idle agent_status stays not-busy (no regression for a human-blocked agent)
ok - no run + idle pane uses the status-log verb
ok - no run + idle pane parses keyed status syntax
ok - no run + idle pane on a paused: status reports state: paused with its reason
ok - no run + idle pane honors the configured paused verb
ok - a trailing resolved: event does not corrupt state render (idle stays idle)
ok - dead window ignores stale status log
ok - a tmux that fails to answer reads unknown/unreachable, never gone
ok - closed pane still reports a terminal run-step
ok - closed pane still reports an active run-step
ok - no timeout command uses perl bound
ok - scout skips the run lookup
ok - torn-down worktree is handled gracefully
ok - fm-crew-state remote: alive endpoint falls through to the routed status log
ok - fm-crew-state remote: an idle alive endpoint reads alive, never gone or dead
ok - fm-crew-state remote: an unreachable host reads unknown-remote, never gone or dead
ok - fm-crew-state remote: the remote host's own dead verdict is reported truthfully
ok - missing meta is handled gracefully
ok - crew_is_provably_working absorbs a validating crew found only via the runs-list fallback
ok - crew_is_provably_working still surfaces a genuinely stopped crew (safety property preserved)
ok - usage error exits 2
ok - historical same-branch rewritten head is not attributed as current
ok - active run with valid descendant fix head remains current
ok - local work advanced past run head invalidates attribution
ok - pipeline-owned active run binds without head equality and beats the failed row
ok - a genuinely failed run with no later run is not hidden
ok - coarse scan anchors the unresolvable active row instead of falling to an older one
ok - coarse scan with a mismatched anchor stays unknown and lets the pane answer
ok - coarse terminal row at a foreign head is not attributed
ok - an executing run binds regardless of branch_sync state
ok - a parked run keeps the strict head rule without pipeline_owned
ok - run_parked_scalar_gate_running keeps the strict head rule despite its live status word
ok - run_parked_in_gate_block keeps the strict head rule despite its live status word
ok - the exemption never applies to a terminal run
ok - missing run head falls back instead of matching by branch
ok - active fix round with an unfetched pipeline head reads working
ok - unanchored unverifiable active row is attributed because it is live
ok - unresolvable terminal row never reads as current
ok - runs-list continuation attribution works when axi answers another branch
ok - herdr stale registration over a shell-only pane reads agent gone, not alive
ok - herdr stale working record never reports a shell-only pane busy
ok - capped overview retains both competing same-branch run ids
ok - same-branch identity survives both runs falling outside the overview
ok - a capped overview with zero same-branch rows reports absent, not unreadable
ok - no run for this branch beside a live run elsewhere reads absent, not unreadable
ok - the capped inventory reader is bounded by the crew read budget
ok - a repo spelling the inventory does not record reads unreadable
ok - a linked worktree green PR in merge monitoring reads held for merge
ok - complete inventory preserves the replacement gate without writes
ok - missing complete-inventory failure reports unknown
ok - corrupt complete-inventory failure reports unknown
ok - schema complete-inventory failure reports unknown
ok - repo complete-inventory failure reports unknown
ok - count complete-inventory failure reports unknown
ok - norepo complete-inventory failure reports unknown
ok - R6 complete selection ignores unrelated branch semantics
ok - R6 requested branches use exact identity without a whitelist
ok - R6 capped inventory ignores unrelated semantics and names both ids
ok - R6 complete identity lookup precedes partial-row semantic rejection
ok - R6 capped inventory preserves quoted requested-branch identity
ok - R6 structural completeness and requested-run validation remain enforced
ok - R5 complete inventory without Python keeps the replacement gate
ok - R5 complete ambiguity without Python names both ids
ok - R5 capped lookup without Python preserves available ids
ok - R5 capped lookup without SQLite support preserves available ids
ok - R1 both directions of inventory liveness disagreement read unknown
ok - R2 uninitialized busy workers retain pane reporting
ok - R2 uninitialized idle workers retain status reporting
ok - R3 historical inventory yields to the current busy pane
ok - R3 historical inventory yields to current worker status
ok - superseded cancelled run preserves the replacement review gate
ok - a live rebased run beats an older failed run at the local head
ok - pending run with a rebased head reads working
ok - running run with a rebased head reads working
ok - legacy live rebased run is authoritative over an older failed row
ok - legacy surface binds a fixing run at a rebased head
ok - legacy surface binds a ci run at a rebased head
ok - an unproven record at a diverged head does not answer for the crew
ok - an unproven record with a dead daemon never overrides a busy pane
ok - an ordinary blocked tip over a coarse live row keeps the superseded reading
ok - a socket-refused blocker survives the dead-daemon verdict
ok - an ordinary blocked tip survives the dead-daemon verdict
ok - a parked gate survives a dead daemon with its findings intact
ok - an unproven record at a diverged head does not answer on the selected route
ok - a live record at a diverged head binds while the daemon answers
ok - the anchored continuation binds while the daemon answers
ok - a head-tied coarse record keeps its working reading and its original note
ok - a coarse failed record with a dead daemon reads unknown
ok - the selected-run anchored continuation reports the dead daemon, not an identity failure
ok - the selected-run anchored continuation binds while the daemon answers
ok - the selected route keeps an anchored parked run's gate with a dead daemon
ok - an open decision survives the dead-daemon verdict on the selected route
ok - a coarse pending ledger word reads unknown
ok - an unanswered probe never turns a failed coarse record into a gate
ok - the selected-route dead-daemon verdict names the run once
ok - a head-tied row reads working when axi names the self run
ok - a head-tied row reads working when axi names the other run
ok - a head-tied coarse row is exempt even when the record head diverged
ok - an unrecognised ledger word keeps the ordinary supersede note
ok - an unanswered daemon probe leaves a live rebased run bound
ok - a head-tied coarse live row is exempt from the dead-daemon verdict
ok - a coarse live row over an open decision keeps the original supersede note
ok - a coarse live row at a rebased head is not attributed
ok - a terminal run at a diverged head keeps the strict head rule
ok - competing live runs report unknown with both run ids
ok - newer failed run remains failed beside an older live run
ok - missing run selection reports unknown with candidate ids
ok - wrong-id run selection reports unknown with candidate ids
ok - wrong-branch run selection reports unknown with candidate ids
ok - wrong-head run selection reports unknown with candidate ids
ok - missing-status run selection reports unknown with candidate ids
ok - malformed-table run selection reports unknown with candidate ids
ok - inventory-error run selection reports unknown with candidate ids
ok - selected-error run selection reports unknown with candidate ids
ok - legacy conflicting run records report unknown
all fm-crew-state tests passed
- Outcome: ⚠️ 1 warning across 1 run (4m7s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed (2) ✅
  • 🚨 bin/fm-crew-state.sh:801 - The required guarantee that a green monitoring PR is always observable remains breakable because axi logs is still called without --full, so it returns only a tail. Concrete sequence: checks become green once, then enough base-advance/re-arm lines accumulate to evict that sole green marker; because re-arm lines are now intentionally ignored, marker is empty, nm_ci_checks_state returns unknown, and the active path at bin/fm-crew-state.sh:1068 continues reporting working. The same truncated helper also affects terminal held-green reclassification at bin/fm-crew-state.sh:692. This contradicts the required outcome that the supervisor read “must be able to observe a checks-green PR that is still in ci merge-monitoring.” Scan the complete CI log (the CLI exposes --full) or otherwise preserve the latest recognized checks state. Because this is an explicit intent-conformance gap, the remedy needs user approval.

🔧 Fix applied.
2 issues (1 error, 1 info) still open:

  • 🚨 bin/fm-crew-state.sh:801 - The required guarantee that a green monitoring PR is always observable remains breakable because axi logs is still called without --full, so it returns only a tail. Concrete sequence: checks become green once, then enough base-advance/re-arm lines accumulate to evict that sole green marker; because re-arm lines are now intentionally ignored, marker is empty, nm_ci_checks_state returns unknown, and the active path at bin/fm-crew-state.sh:1068 continues reporting working. The same truncated helper also affects terminal held-green reclassification at bin/fm-crew-state.sh:692. This contradicts the required outcome that the supervisor read “must be able to observe a checks-green PR that is still in ci merge-monitoring.” Scan the complete CI log (the CLI exposes --full) or otherwise preserve the latest recognized checks state. Because this is an explicit intent-conformance gap, the remedy needs user approval.
  • ℹ️ bin/fm-crew-state.sh:103 - Round 1 correctly switched checks-state detection to the full CI log, but documentation still describes a tail-only scan. Update this reference and the sibling descriptions at docs/architecture.md:118 and tests/fm-crew-state.test.sh:1269 so the documented invariant matches the durable fix.

🔧 Fix applied.
✅ Re-checked - no issues remain.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (1 of 4 scenarios were driven live against the product); untested: Supervisor reads a linked-worktree green PR from a capped run inventory and reports it ready for review with its PR URL, A green marker remains observable after more timeout re-arm lines than the default no-mistakes log tail, Pending checks or a new issue after an earlier green marker remain working instead of being falsely reported ready
  • Live validation: ⚠️ inconclusive - 1 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Scaffolding a no-mistakes ship tells the worker to reattach the drive call until it returns checks-passed, rather than waiting on status polling ✅ pass live Generated no-mistakes worker brief
Supervisor reads a linked-worktree green PR from a capped run inventory and reports it ready for review with its PR URL ⏸️ untested no The prior payload recorded only an isolated reproduction and a test script, not a live product run. An accessible live no-mistakes run containing a linked-worktree green PR and capped run inventory is…
A green marker remains observable after more timeout re-arm lines than the default no-mistakes log tail ⏸️ untested no The prior payload recorded only a simulated transcript with 60 re-arm lines, not a live product run. An accessible live no-mistakes run whose full log contains a green marker followed by more re-arm l…
Pending checks or a new issue after an earlier green marker remain working instead of being falsely reported ready ⏸️ untested no The prior payload recorded only adversarial isolated states, not live product behavior. Accessible live no-mistakes runs exhibiting pending checks and a post-green relapse are required to establish th…
  • tests/fm-brief.test.sh
  • tests/fm-crew-state.test.sh
  • Generated a real no-mistakes ship brief with FM_HOME=&lt;isolated-home&gt; bin/fm-brief.sh green-pr-demo firstmate --mode no-mistakes
  • Ran bin/fm-crew-state.sh green-pr against an isolated linked-worktree, capped-inventory reproduction with a green marker followed by 60 timeout re-arm lines
  • Ran bin/fm-crew-state.sh ci-boundary for checks-not-registered and green-then-new-issue adversarial states
  • Attempted no-mistakes axi status/logs --run 01M351FDMW4618QZPN0N9NYHYV; the historical run was unavailable in this worktree's repo-scoped no-mistakes context
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

A green PR could sit unreported because neither the worker nor the
supervisor could observe checks-green while the ci step kept monitoring
for the merge.

Supervisor read: fm_nm_select_run's capped-overview inventory reader looked
the repository up by the task worktree path, but no-mistakes registers a
repository once by its main clone path and resolves every linked worktree
to it, so on every task copy of a busy repo the lookup matched no row and
each read reported "complete same-branch run inventory unreadable". Key the
lookup on the overview's own top-level `repo:` line, which every axi
release emits as the resolved working_path.

Even with a readable run, the ci-log classifier treated "base branch
advanced ..., re-arming CI monitor timeout" as not-ready. The monitor logs
a checks state only when it changes and a base advance does not clear
readiness, so a green PR read as still validating for as long as main kept
advancing. Stop treating that line as a marker, matching no-mistakes' own
ci-log parser, and name the run's PR URL in the held-for-merge reading so
the existing inactive-outcome path can act on it without a worker report.

Worker contract: `axi status` never reports checks-passed while the ci
step monitors for merge, so the definition of done no longer makes a
status poll the wait for the next gate or outcome; the drive call's own
return is the green signal, reattached with `no-mistakes axi run` after a
bounded return.
@kunchenguid
kunchenguid merged commit d92cea0 into main Sep 22, 2026
35 of 37 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-green-nm-pr-unreported-r1 branch September 22, 2026 21:19
BohnBawerick added a commit to BohnBawerick/firstmate that referenced this pull request Sep 23, 2026