fix(bin): stop fm-crew-state from false-failing healthy active validations - #2656
Closed
RajeshRajendiran wants to merge 10 commits into
Closed
fix(bin): stop fm-crew-state from false-failing healthy active validations#2656RajeshRajendiran wants to merge 10 commits into
RajeshRajendiran wants to merge 10 commits into
Conversation
…ords Fixes false-failed reporting when a crew's branch had multiple no-mistakes runs (rewrites, restarts, or ordering quirks). The cross-branch `runs` list fallback now scans all matching rows for the branch+head and prefers an active (`running`) status, rather than blindly returning the first matching terminal row. Also cross-checks a terminal `axi status` record against the runs list and overrides to working when an active row for the same branch+head exists. Adds regression tests for both fallback and full-path false-failed scenarios. Verified against the live sasi-telegram-alerts-broken run, which reports `parked` matching its current ask-user review gate.
…stale-record override detail Extend CI_READY_LOG_SUPERSEDED to cover coarse running rows alongside pending, because a coarse running row reached via the cross-branch fallback has no step detail to verify CI progress and cannot be trusted to have appended the status-log checks-green line. Also rename the stale-record override detail from 'validating (background run)' to 'validating (stale-record override)' so the override is auditable and distinguishable from ordinary coarse attributions. Update the regression test to match the new expected behavior: a coarse running run without step detail reports working instead of inheriting a stale checks-green status-log line.
…ncile coarse-running ci-ready comments
…-record override too
Author
|
Closing: captain dropped this task. The fix is validated but not merging at this time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Fix bin/fm-crew-state.sh to correctly report healthy running no-mistakes validations instead of false-failing.
Changes:
Tests updated: test_coarse_running_run_has_no_ci_log_and_suppresses_ci_ready verifies coarse running suppresses ci-ready when no step detail is available. All 46 existing tests pass.
shellcheck -x passes cleanly on changed scripts.
What Changed
nm_coarse_status_is_active()(treatingpendingandrunningas active) and apendingcase in the coarse-status handler so a freshly created, not-yet-started run reportsworkingwith detailvalidating (pending)instead of an unrecognized status.axi statusreportsfailedbut the branch's newest runs-list row for the same head is still active, the verdict flips toworkingwith detailvalidating (stale-record override), so a superseded failed record no longer false-fails a healthy crew while genuine terminal failures still surface.CI_READY_LOG_SUPERSEDEDto suppress thechecks greenci-ready shortcut both for the stale-record override and for coarsepending/runningrows (which carry no step detail), preventing a green status-log line left by an earlier run from misreportingdone; updated theFM_CREW_STATE_RUNS_LIMITdoc note and added/updated tests covering these paths.Risk Assessment
✅ Low: The change is well-bounded, carefully scoped to the failed-verdict path, preserves the newest-row and green-not-demoted invariants, and is covered by behavioral regression tests reproducing the false-fail and masking scenarios.
Testing
shellcheck -x passes on the changed script; the entire fm-crew-state test suite (60 tests, including the 7 new ones for pending/running coarse rows, stale-record override, genuine-failure safety, checks-green non-demotion, and superseded ci-ready suppression) passes; and a reproducible hermetic driver exercising the real bin/fm-crew-state.sh shows the base commit false-failing a healthy stale-record+active-run crew as
state: failedwhile the target commit correctly reportsstate: working · validating (stale-record override). New-test regression coverage was confirmed by running the new assertions against the base bin and observing the expected failures. No actionable issues found.Evidence: Stale-record override before/after (real fm-crew-state.sh verdict)
Source: Stale-record override before/after (real fm-crew-state.sh verdict)
===== BEFORE FIX (base commit 87681a4) ===== state: failed · source: run-step · run failed ===== AFTER FIX (target commit ca42337) ===== state: working · source: run-step · validating (stale-record override)Evidence: Reproducible hermetic before/after driver script
Source: Reproducible hermetic before/after driver script
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
shellcheck -x bin/fm-crew-state.shbash tests/fm-crew-state.test.sh (full suite, 60 ok / all fm-crew-state tests passed)bash /tmp/no-mistakes-evidence/01M0ED5CSW6TF5E95NG50WFZDZ/demo-stale-override.sh (hermetic before/after of stale-record override driving the real bin/fm-crew-state.sh through fake no-mistakes/tmux/herdr)Regression check: ran the new test assertions against the base-commit bin/fm-crew-state.sh with a non-fatal fail() and observed failures fora pending coarse row is a live run,pending coarse row names its own detail,coarse running without step detail -> working,coarse running keeps run-step source,coarse running must not inherit a stale ci-ready log,stale terminal axi status must not false-fail a healthy run,a pending replacement run is live✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.