Skip to content

fix(bin): accept converged synchronized runs for validation completion - #133

Merged
dnth merged 2 commits into
mainfrom
fm/fm-validation-green-monitor-binding
Sep 11, 2026
Merged

dnth merged 2 commits into
mainfrom
fm/fm-validation-green-monitor-binding

Conversation

@dnth

@dnth dnth commented Sep 11, 2026

Copy link
Copy Markdown
Owner

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

  • Centralized active No-Mistakes branch ownership checks and accepted fully evidenced synchronized runs after branch convergence while PR monitoring remains active.
  • Updated receipt binding/completion documentation to describe the synchronized-state requirements and preserved fail-closed behavior for incomplete or mismatched evidence.
  • Added regression coverage for synchronized monitoring completion and negative sync-evidence cases.

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.

ok - fm-receipt-check help renders an executable generation-bound bind command
ok - fm-receipt-check reports required, evidenced, and missing ids deterministically
ok - fm-receipt-check distinguishes complete evidence from invalid JSONL
ok - structured success and negative outcomes control criterion evidence
ok - pinned brief and metadata delivery modes must match exactly
ok - pinned metadata owner rejects hard-linked validation records
ok - invalid ship briefs fail and scout/report behavior stays unchanged
ok - early snapshot failures release cleanup without a FIFO reader
ok - snapshot readiness publication failures terminate without waiting
ok - fm-receipt-check pins task evidence and rejects hard-linked ledgers
ok - receipt append and check consume one criterion grammar
ok - exact bound runs complete from the shared current CI-log readiness predicate
ok - finding-to-criterion invalidations remain inspectable in task metadata
ok - run binding resolves abbreviated heads and rejects non-planned commits
ok - binding and completion work against the real agent-supplied intent-log shape while wrong runs fail closed
ok - completion accepts only active pipeline-owned descendant heads
ok - terminal passed runs seal their own pipeline advance and refuse foreign drift
ok - pipeline rebase restamps bind and seal their validated content
ok - restamped chains enforce provenance and ownership
ok - active pipeline-owned descendant binds without replan
ok - terminal pipeline-owned descendant binds and completes
ok - restamp chain followed by pipeline doc commit binds and completes
ok - active descendant binds using axi sync fallback when axi status omits branch_sync
ok - unowned active descendant binding is rejected
ok - converged synchronized run binds and completes while monitoring its PR
ok - converged synchronized binding requires the full run-owned sync evidence
ok - descendant bind rejects the wrong branch
ok - low-risk mechanical changes can skip a full No-Mistakes run
ok - low risk requires safe changelog prose and file-bound mechanical evidence
ok - implementation completion refreshes per head and remains idempotent
ok - plan publication holds the pinned ledger boundary against concurrent receipts
ok - diff summary errors fail closed before risk classification
ok - successful terminal runs bind while failed runs remain rejected
ok - No-Mistakes status and CI-log observations are bounded
ok - authoritative documentation remains high
ok - terminal delivery paths record one completion timestamp at their boundary
ok - completion signals release the validation lock for retry
ok - replanning invalidates prior run and completion bindings
ok - dirty worktrees cannot be planned or completed
ok - git status errors fail implementation, planning, and completion cleanliness gates
ok - shared cleanliness inspects ignored submodules
ok - direct and local plans never invoke No-Mistakes
ok - local completion requires fast-forward readiness
ok - local readiness and landing share one fail-closed default resolver
ok - security and uncertain changes retain full No-Mistakes validation
ok - direct-PR and local-only retain evidence gates without invoking No-Mistakes

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.sh
  • Verified 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.

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.
@dnth
dnth merged commit 1dff0cc into main Sep 11, 2026
15 checks passed
@dnth
dnth deleted the fm/fm-validation-green-monitor-binding branch September 11, 2026 02:25
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.

1 participant