Skip to content

fix: preserve live pipeline run state during crew reporting - #2159

Open
bluewandd wants to merge 3 commits into
kunchenguid:mainfrom
bluewandd:fix/live-run-reported-failed
Open

fix: preserve live pipeline run state during crew reporting#2159
bluewandd wants to merge 3 commits into
kunchenguid:mainfrom
bluewandd:fix/live-run-reported-failed

Conversation

@bluewandd

Copy link
Copy Markdown

What Changed

  • Attribute read-only crew state to same-branch pipeline runs whose nonempty commit heads are not yet locally available, while retaining strict matching for teardown aborts.
  • Prefer active matching run rows over terminal rows when resolving coarse run listings.
  • Document the separate reporting and teardown attribution policies and add regression coverage.

Risk Assessment

✅ Low: The reporting-only attribution relaxation is confined to fm-crew-state while teardown retains the strict verified-head predicate for destructive aborts.

Testing

Reviewed the target diff, ran the two focused behavior suites, and exercised the crew-state CLI end-to-end against representative no-mistakes responses; both unresolved live-run scenarios rendered state: working · source: run-step, with no working-tree artifacts left behind.

Evidence: Crew-state CLI end-to-end transcript
Scenario 1: pipeline-owned validation reports a head not yet in this worktree; its own axi status remains working.
state: working · source: run-step · validating (fixing)

Scenario 2: runs list puts a stale failed row before the current unresolved running row; active row must win.
state: working · source: run-step · validating (background run)

Pipeline

Updates from git push no-mistakes

⏭️ **intent** - skipped

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • 🚨 bin/fm-nm-run-lib.sh:78 - This shared ownership predicate now accepts any unresolvable head, but fm-teardown.sh uses it before axi abort --run and explicitly requires a verified branch+head match. A stale/invalid or GC-pruned parked run on a reused branch therefore passes attribution and is aborted during teardown. Keep the resolvable-head requirement for destructive callers; add a reporting-only compatibility predicate (or explicit mode) for fm-crew-state's pipeline-owned containment path.

🔧 Fix: Separate reporting-only run attribution from teardown safety
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • git diff --check e836a7f28bc5100f517c1d672a56483754899add 40622263504b110ac729a57ea1351fc3c6dc8117
  • bin/fm-test-run.sh tests/fm-crew-state.test.sh
  • bin/fm-test-run.sh tests/fm-teardown.test.sh
  • Manual bin/fm-crew-state.sh CLI exercise with a pipeline-owned unresolved head and with a stale failed runs-list row preceding a live running row.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@bluewandd
bluewandd force-pushed the fix/live-run-reported-failed branch 2 times, most recently from f82d9a9 to 19d6742 Compare August 13, 2026 19:41
@bluewandd

Copy link
Copy Markdown
Author

Following up on this fix. The PR has all 13 checks passing and has been open since August 11. It prevents fm-crew-state from reporting a live pipeline-owned run as failed while keeping teardown\x27s strict branch/head safety. The branch is behind current main and needs a rebase before merge. Please review when you get a chance.

fm_nm_head_matches_worktree rejected a run head it could not resolve as a
local object, even though a live no-mistakes run legitimately advances a
branch's head past what this worktree's object store has observed yet
(branch_sync.state: pipeline_owned). The rejection fell through to the
coarse runs-list fallback, which could then match an older failed row
sitting at the worktree's own sha and report a healthy running validation
as failed.

Treat an unresolvable run head as unable to disprove attribution rather
than as divergence, and make nm_runs_status_for_branch prefer an active
row over a terminal one for the same branch regardless of list order, so a
stale failed/completed row never outranks a live run.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: first look on current main 85d6c7226c93 (#2953). Never messaged the captain.

class=corrective. Reporting-only attribution: a nonempty run head missing from the local object store stays reportable so a live pipeline-owned no-mistakes run is not mapped failed; coarse listing prefers an active same-branch row over a terminal row. Teardown keeps the strict fm_nm_head_matches_worktree predicate. Not leftover of landed #2953 (actor-split; main still uses strict crew-state matching). Related to open afternoon #3001 (same false-failed live NM run, broader: classify/watch wedge too). Help this PR; do not open a competing one.

VISION.md (inspected bin/fm-nm-run-lib.sh fm_nm_head_matches_worktree_reporting, bin/fm-crew-state.sh coarse active-over-terminal, bin/fm-teardown.sh comments-only strict abort, tests):

  • One captain, one interface: aligns (false failed hid in-flight validation).
  • Authority is explicit: aligns (no new grant; reporting variant must not authorize teardown).
  • Scripts own the mechanics: aligns (resolvable vs missing head is exact).
  • A restart is a non-event: aligns (live run remains inspectable).
  • Delegation with a spine: aligns.
  • The fleet outlives any vendor: aligns (binds to no-mistakes run listing / axi status).
  • Scope: aligns.

This HEAD: 19d67428441f371ebf9677ed43a1cabc39e8982b. CONFLICTING / DIRTY, ahead 3 / behind 67.
Attestation c376f6e8d2c3f7dfe83d746ede7c4c1592aa7358 THIS HEAD.
CI green on this SHA but stale (runs 31737096580 / 31737096644 from 2026-08-13). Author follow-up 05:44Z asked for review and noted rebase need. Author body does not close an issue.

Not first-time: Behavior/Lint/CI actually ran on this PR. No workflow approval this pass. Greptile is not a merge gate.

Security: none. Read-only reporting relaxation; teardown stays fail-closed.

Overlap: bin/fm-crew-state.sh / bin/fm-nm-run-lib.sh with open #3001; bin/fm-teardown.sh with #2804 / herdr pair #2637/#2692 (this hunk is comments + a test that teardown does not abort an unresolvable head). Not a lock PR. Not spawn-freshen.

Land-eligible rec: NO. Captain-flag NOW: no.

This is waiting-on-author (rebase onto current main + HEAD-matching attestation; coordinate with #3001 rather than land both). Not a captain-decision. Not a merge I will recommend.

@bluewandd
bluewandd force-pushed the fix/live-run-reported-failed branch from 19d6742 to 912889d Compare August 25, 2026 06:26
@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge because reporting is relaxed without weakening the strict ownership check guarding teardown aborts.

The changed reporting behavior is deliberately read-only, destructive teardown continues to require a resolvable code-identity match, and no concrete unacknowledged failure remains.

Reviews (1): Last reviewed commit: "no-mistakes(document): Document reportin..." | Re-trigger Greptile

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.

3 participants