fix(bin): keep newest run attribution in crew-state - #5954
Open
mehulbhagwani wants to merge 5 commits into
Open
mehulbhagwani wants to merge 5 commits into
mehulbhagwani wants to merge 5 commits into
Conversation
|
mehulbhagwani
force-pushed
the
fm/fm-bug-crewstate-run-identity
branch
from
September 28, 2026 05:11
ca32edb to
a843ef1
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
mehulbhagwani
force-pushed
the
fm/fm-bug-crewstate-run-identity
branch
from
September 29, 2026 10:45
7b5aacd to
7d28337
Compare
mehulbhagwani
force-pushed
the
fm/fm-bug-crewstate-run-identity
branch
from
October 1, 2026 11:47
7d28337 to
cc232ce
Compare
Document and pin newer-first (recorded AXI) and historical-first overview orders. Same-minute ledger timestamps use row order as the tie-break so an older live bare status cannot hide a newer completed run.
mehulbhagwani
force-pushed
the
fm/fm-bug-crewstate-run-identity
branch
from
October 2, 2026 13:13
cc232ce to
f33f82f
Compare
Author
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
Make every open mehulbhagwani PR on kunchenguid/firstmate clean for Kun to merge.
PRs: #5954 #5953 #5952 #5951 #5919 #5709 #4932
For each: checkout that PR head branch on origin/fork, rebase onto current upstream main, fix red CI (behavior portable serial jobs), ensure no-mistakes attestation head_sha MATCHES PR head, push to the PR branch (update existing PR in place — do NOT open new PRs), confirm CI green and mergeable CLEAN.
Priority: 5954 and 5952 already green—verify still clean; then 5953, 5951 red serial jobs; 5919 conflicts; 5709 attestation mismatch; 4932 two serial fails.
Do not merge on Kun's repo (no authority). Leave PRs ready. Report final status table.
Fix all 7 fast.
This run validates and updates existing PR #5954 in place (branch fm/fm-bug-crewstate-run-identity on the mehulbhagwani fork): crew-state attributes the active no-mistakes run per task without hiding a newer completed or cancelled run behind an older still-live run, and two runs created in the same minute are not misattributed when ledger timestamps collide; it prefers the overview order with a tie-break that keeps the live run. tests/fm-crew-state.test.sh covers both overview orders, including newer-first, which recorded overviews use. The previous CI failure on this PR was the unrelated Pi Calm hidden-block geometry E2E (/reload viewport transition), which this change does not touch. The branch was rebased onto main, so the push must update the existing PR branch (force with lease) and the PR body attestation must bind to the new head. Do not open a new PR.
What Changed
bin/fm-crew-state.shandbin/fm-nm-run-lib.sh: crew-state now attributes the active no-mistakes run per task using the overview order, with a tie-break that keeps the live run. A newer completed or cancelled run is no longer hidden behind an older still-live run, and runs created in the same minute are not misattributed when ledger timestamps collide.docs/architecture.md: documents the live-run precedence rule in crew-state attribution.tests/fm-crew-state.test.sh: adds coverage for stale-status versus newest-run precedence and for both overview orders (newer-first and older-first) with same-minute runs.Risk Assessment
✅ Low: The change is a narrowly gated tie-break in crew-state run selection that falls back to the overview's choice whenever the runs ledger cannot uniquely prove ordering, and it is covered by new behavioral tests in both overview orders.
Testing
Ran tests/fm-crew-state.test.sh, which drives the real bin/fm-crew-state.sh against disposable fixture overviews. All cases passed. The suite uses fixtures, not a running Herdr or no-mistakes daemon, so no scenario was driven live and each is marked untested.
Evidence: crew-state test log
Source: crew-state test log
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bash tests/fm-crew-state.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.