Skip to content

feat(bin): probe the gate ref before a no-mistakes run and route a stale one to a decision - #7218

Open
markhomexa wants to merge 4 commits into
kunchenguid:mainfrom
markhomexa:fm/fm-gate-ref-stale-after-daemon-crash
Open

markhomexa wants to merge 4 commits into
kunchenguid:mainfrom
markhomexa:fm/fm-gate-ref-stale-after-daemon-crash

Conversation

@markhomexa

@markhomexa markhomexa commented Oct 13, 2026 •

Copy link
Copy Markdown

Problem

After a validation daemon crash, a lane's gate ref is left stale and no supported command moves it. The gate repository now holds -v2 or -v3 rebuild refs for about twenty lanes, not the four first measured on 12 October, so this has cost far more than one bad afternoon.

Each affected lane recovered its own copy, rebased, and tried to validate again. The push to the gate was rejected as non-fast-forward because the gate's refs/heads/<branch> still held the pre-rebase head. no-mistakes axi sync --check meanwhile reported custody_returned, relation: equal, next_action.code: run_pipeline.

Cause (no-mistakes v1.72.0 source, internal/branchsync/sync.go)

What this PR does

  • bin/fm-gate-ref-probe.sh: a read-only check of the one ref the push is judged against. Verdicts: absent, in-sync, stale (exit 10), holds-work (exit 11), unanswerable (exit 2). It writes nothing to the gate or the copy.
  • The worker driving text runs it immediately before every axi run that starts a new run, and routes exit 2, 10 and 11 to a keyed needs-decision [key=gate-ref-stale] carrying the exit code and both refs by name and value, instead of retrying or forcing.
  • validation-supervision records firstmate's side of that decision.

What it does NOT do

  • It does not remove the need for worker discipline, and it does not remove the rebuild cost. A lane hitting exit 10 still loses its branch name: the only route is a re-dispatch under a fresh branch name, because the ship branch is recorded in the brief, spawn metadata and PR checks.
  • It surfaces the stale ref early and names it, instead of a lane discovering it after a failed push and reading a status that says the branch is healthy.
  • It does not move, reset or delete the gate ref, and it adds no enforcement or wrapper around axi run.
  • Route A (reset the local branch to the stale gate tip so the push is a no-op fast-forward) was never verified end to end and is not offered.

NOT covered: blocked_recover_manual_reconciliation

Two lanes last night hit a different shape and nothing here helps them: tx-task-title-edit-any-task (the lane that got exit 1 and no plan) and tx-land-3123-team-address. In both, the run finished failed with "daemon crashed during execution", the terminal head was never verified, and pipeline_owned with inspect_and_reconcile_manually blocks every run. On tx-task-title-edit-any-task the gate ref equals the local head, so the probe exits 0 and does not address the block. For tx-land-3123-team-address the head was not in the gate, so the probe was not run on it. The crash case is NOT solved by this change.

Per-lane verdicts (probe run against each lane's real head and the real gate)

Lane Local head Gate ref Verdict
tx-contacts-drag-order bae56ee7e 0b43553ec stale, exit 10, no commit unique to the gate ref, 1 gate-only merge not patch-compared
tx-note-edit-shared-thread b73c0acb0 f218411b7 stale, exit 10, no commit unique to the gate ref, 1 gate-only merge not patch-compared
tx-task-title-edit-any-task 7ba0aba42 7ba0aba42 in-sync, exit 0; blocked for a different reason (uncovered)
tx-land-3123-team-address 3f795ded5 n/a head not in the gate; same blocked shape (uncovered)

Checks: awaiting maintainer approval

Both checks finished action_required with zero jobs on this head, so nothing ran. GitHub holds workflow runs from a fork pull request until a maintainer approves them in the Actions interface. Neither failure comes from this change. A maintainer needs to approve:

Durable fix is a decision, already filed

Reporting the cause upstream, updating the installed no-mistakes (1.72.0 to a newer release, not shown to fix the equal case), and whether rebuilding under a fresh name is an acceptable permanent answer are the captain's call and are not decided here. Anyone reading this later should not conclude the daemon-crash case is handled.

markhomexa and others added 4 commits October 13, 2026 02:34
…ale one to a keyed decision

axi sync --check can read custody_returned with run_pipeline while the
gate's branch ref still holds the pre-rebase head, so the push is rejected
non-fast-forward and no supported command offers a way out.
fm-gate-ref-probe.sh reads that one ref without writing anything and names
whether it is stale (nothing unique to it) or holds work the copy lacks.
The worker driving text runs it before a run on a touched branch and
reports a keyed needs-decision instead of retrying or forcing.
…not clear

The trigger no longer depends on a worker judging whether a crash touched
the branch, a probe never precedes a flagless reattach or an offered
recovery, and the skill states that the fresh-branch route is a
re-dispatch because the ship branch is recorded in the brief, spawn
metadata and PR checks.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @markhomexa. This is a clear write-up, and I appreciate that the body is honest about what it does not solve.

I reviewed tip 36a93d6a against main 6407052f. It touches 6 files (+277/−0). bin/fm-gate-ref-probe.sh only reads: it never fetches, it reads gate objects through GIT_ALTERNATE_OBJECT_DIRECTORIES, and it writes no refs. There's no workflow, secret or network surface, and the tests use local bare repos. Since the diff is safe, I approved the held fork runs: CI 38380824469 and Require no-mistakes 38380824452, 38380966576.

One blocker, on your side: the PR body has no no-mistakes pipeline attestation, so the required no-mistakes check can't pass. When you have a moment, could you re-raise through git push no-mistakes so the body carries an attestation bound to the tip, along with its live-validation rows? Your per-lane table is useful context. A live run of the new driving text would be even better: a worker that hits exit 10 and stops on needs-decision [key=gate-ref-stale].

Contract-class: new-default. Every no-mistakes ship worker's Definition of done now runs the probe before each new axi run, and on exit 2/10/11 it stops with a new keyed decision. That's a new step on the unconfigured ship path, so it would go to Kun for merge-or-leave once it's otherwise ready. It won't auto-merge.

VISION.md, rule by rule:

Overlap, for awareness: #3957 rewrites the same no-mistakes Definition of done block in bin/fm-dod-lib.sh, and your own #4938 covers the same crash-stranded gate-ref shape. If #4938 is superseded by this one, it would help to say so there.

Main is currently red on unrelated Pi type drift. If CI here fails only on those same shards, that's not on you.

Status: waiting-author (re-raise through no-mistakes). After that it goes to Kun's merge-or-leave when green.

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.

2 participants