Repository navigation
fix(bin): accept converged synchronized runs for validation completion - #133
Merged
Merged
Conversation
A correctly attributed no-mistakes run that passed its required checks stays active only to monitor its open PR. In that state `axi status --run` still reports status running with no outcome and no branch_sync block, while `axi sync --check` reports the branch converged: state synchronized, safety already_synchronized, relation equal, and the pipeline block naming the same run, its submitted head, and its pushed-back current head. Both completion paths required pipeline_owned, so the bound run could never bind or seal its own advance (observed on fm-omp-orchestrate-opt-in run 01M25YRZ7NP7HVZ33K1XC94AYN, PR #131: submitted 5d52705, pushed c096921, checks green, still monitoring). Add fm_nm_run_branch_ownership to bin/fm-nm-run-lib.sh as the one owner of active-run branch evidence, used by both --bind-run and --complete. It keeps pipeline_owned acceptance unchanged and additionally accepts a synchronized state only on the full sync readout: same run id, submitted_head resolving to the validated head, current_head and the reported local head resolving to the run's observed head, relation equal, and safety already_synchronized. Checks-green readiness stays a separate requirement, so a merely synchronized-but-not-passed run still refuses. Upstream kunchenguid/firstmate has no fix to port: fm-receipt-check.sh is fork-local and upstream's diverged fm-nm-run-lib.sh has no synchronized handling. Adjacent upstream repairs (kunchenguid#2881, kunchenguid#3681, kunchenguid#3704, kunchenguid#3846) cover other read paths; open upstream PR kunchenguid#2799 confirms the checks-green merge-wait state but targets the supervision classifier, not completion. Extend tests/fm-receipt-check.test.sh with the converged bind+complete path and negative controls for foreign run ids, mismatched submitted heads, incomplete convergence fields, stale local heads, and synchronized-with-pending-CI completion.
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 the bounded Firstmate completion-record mismatch for a correctly attributed No-Mistakes run whose required checks have passed but which remains active only to monitor an open PR. Upstream kunchenguid/firstmate was inspected first: bin/fm-receipt-check.sh is fork-local and upstream's diverged bin/fm-nm-run-lib.sh has no handling for the synchronized/already_synchronized state; adjacent upstream fixes cover other read paths and open upstream PR 2799 targets the supervision classifier, so this is a narrow local adaptation, not a port. The shared predicate fm_nm_run_branch_ownership in bin/fm-nm-run-lib.sh now owns active-run branch evidence for both --bind-run and --complete in bin/fm-receipt-check.sh: pipeline_owned stays accepted, and the converged synchronized state is accepted only on the complete axi sync --check evidence - same run id, submitted_head resolving to the validated head, current_head and reported local head resolving to the run's observed head, relation equal, safety already_synchronized. Checks-green readiness stays a separate requirement so a merely synchronized-but-not-passed run still refuses; failures, missing/stale/malformed/ambiguous evidence, wrong task/run/branch/generation identity, foreign commits, and unresolvable or diverged heads all stay rejected; exact-head, faithful-restamp, and pipeline-descendant contracts are unchanged. The motivating case is task fm-omp-orchestrate-opt-in, PR #131, run 01M25YRZ7NP7HVZ33K1XC94AYN, plan generation 7ffba69cdf8d349d3af4e925742b2c97, submitted head 5d52705, published head c096921; the exact combination was reproduced failing-before/passing-after in isolated temp task state on the real commit chain with captured real CLI outputs, and is now a regression test backed by real temporary commits with negative controls. No parallel verifier, monitoring system, or generic compatibility framework was added; the original task's run, PR, metadata, worktree, and source were only read, never modified.
Firstmate-Validation-Generation: b9d90ffae324b15049aa610261fc7ff3
What Changed
synchronizedruns after branch convergence while PR monitoring remains active.Risk Assessment
✅ Low: The change is narrowly scoped, preserves existing ownership and head-accounting rules, and adds synchronized-state acceptance only with the required run, head, relation, and safety checks.
Testing
Ran the targeted fm-receipt-check behavior suite end-to-end; the new synchronized monitoring-run bind/complete scenario and rejection controls passed, with reviewer-visible output captured in the evidence log.
Evidence: fm-receipt-check targeted test log
Targeted receipt-check behavior tests passed, including converged synchronized monitoring-run bind/complete and negative controls for foreign run IDs, mismatched heads, incomplete equality/safety evidence, and stale local heads.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.
bash tests/fm-receipt-check.test.shVerified the synchronized monitoring-run regression and its negative evidence controls in the captured test output.Verified the worktree remained clean after testing.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.