axi: internal mirror ref diverges and blocks all runs after a legitimate branch-head rewrite (amend/rebase/force-with-lease); reconciliation is circular

Author: mikaellinares87-codeCreated Sep 7, 2026Updated Sep 21, 2026
Labelsbugready-for-pr

Summary

When a task branch's HEAD is legitimately rewritten (git commit --amend, rebase, or push --force-with-lease) after a run has been recorded — e.g. to strip a forbidden commit trailer required by a review finding — the daemon's internal mirror (~/.no-mistakes/repos/<hash>.git) stays at the old head, and the pipeline then rejects every subsequent run on that branch as non-fast-forward. axi status / axi sync report blocked_* with next_action: inspect_and_reconcile_manually, which is circular: there is no reconciliation command to actually run. The only escapes are manual (a direct-PR bypass, or a forced git fetch into the mirror).

Three observed instances

Case 1 — amend (2026-09-03). Fixing a commit-agent-coauthor review finding rewrote the commit to drop the co-author trailer ⇒ the new head is not a descendant of the pipeline's recorded head ⇒ the gate rejects it: worktree HEAD <x> is not a descendant of the pipeline's recorded head <y>, corrupting the internal ref and blocking all later runs on that branch. axi status: safety=blocked_recover_preserved_head_missing, next_action=inspect_and_reconcile_manually (circular). Only abort was offered — a no-op on a terminal-failed run; there is no clean/reset/forget. Evidence: run 01M1KAPCEMPT27QTEFPZ45A754 (failed); mirror .../repos/d55e1663632d.git; recorded head 2d07a35, divergent local head 8c3de40. Workaround: direct-PR bypass.

Case 2 — rebase + force-with-lease (2026-09-07). After rebasing and push --force-with-lease over a cancelled run, the mirror stayed at the old head; a new run gave BROKEN PIPE then non-fast-forward. axi status: safety=blocked_diverged, next_action=inspect_and_reconcile_manually; axi sync --check: blocked_remote_rewritten; no reconciliation command. Workaround: forced git fetch of the live branch into the mirror.

Case 3 — amend to strip a session trailer (2026-09-07). A worker amended an already-reviewed commit to remove a forbidden Claude-Session trailer (the repo's own no-agent-signatures check forbids it). The amend made the local branch diverge non-fast-forward from the pipeline's recorded head. axi sync --recover returned recovered: true, changed: false (custody was fine — the divergence is content/history, not custody), so it did not help. Recovery required rebuilding a clean linear history and starting a fresh run on a new branch name.

Common pattern

Any rewrite of the branch head (amend / rebase / force-with-lease) over a terminated or cancelled run leaves the internal mirror divergent. axi status / sync then report blocked_* with a circular next_action: inspect_and_reconcile_manually and no tool behind it. All known workarounds are manual. The amend case is especially common because a legitimate review fix (removing a forbidden trailer) requires rewriting history.

Request

Either:

  • (a) adopt the new head when the live branch is legitimately rewritten (the common, safe case), or
  • (b) provide a non-circular reconciliation command (e.g. axi sync --adopt-remote / axi sync --reset-mirror) instead of next_action=inspect_and_reconcile_manually with no tool behind it.

Reported by a heavy multi-home / multi-machine user; happy to provide more logs.