Skip to content

feat(cli): add AXI supervision and guarded branch sync#4

Closed
simfor99 wants to merge 24 commits into
mainfrom
feat/axi-native-agent-supervision
Closed

feat(cli): add AXI supervision and guarded branch sync#4
simfor99 wants to merge 24 commits into
mainfrom
feat/axi-native-agent-supervision

Conversation

@simfor99

Copy link
Copy Markdown
Owner

Intent

Make No-Mistakes natively supervise an already armed AXI run after a Codex or Claude Code Stop event. Preserve the upstream branch-sync behavior, require explicit opt-in local hooks, never alter users hook configuration automatically, continue only technical events, and keep ask-user and terminal states safely bounded. Submit the reusable implementation and tests as a focused upstream PR; exclude local planning notes and internal evidence artifacts.

What Changed

  • Add opt-in axi supervise hooks for armed Codex and Claude Code sessions; technical Stop events can continue work while ask-user and terminal states remain bounded.
  • Add guarded sync/axi sync and TUI controls that inspect branch state, fast-forward safely, and recover custody of terminal pipeline-owned work.
  • Strengthen delivery and CI handling with persisted push provenance, deferred pipeline-owned review findings, and GitHub required-check reconciliation.

Risk Assessment

⚠️ Medium: Die zustandsbehaftete Claude-Hook-Supervision ist komplex, aber der aktuelle Diff behebt die zuvor gefundenen Cursor- und Record-Grenzfälle ohne weiteren belegbaren Fehler.

Testing

Der bereitgestellte Race-Baseline-Lauf sowie gezielte Unit- und reale E2E-Flüsse für Codex und Claude bestanden: explizites Arming, unveränderte Hook-Konfiguration, technische Fortsetzung, stille Ask-user- und unvollständige Ereignisse, terminaler Abschluss und der separate Branch-Sync-Nutzerpfad. Keine visuelle Evidenz erforderlich, da dies eine CLI-/Hook-Funktion ohne gerenderte Oberfläche ist.

Evidence: Native AXI supervision E2E transcript

Codex and Claude E2E CLI transcripts: arm requires a hook; only technical gates emit nm_event=technical_gate; duplicate events are quiet; terminal events complete supervision; ask-user events remain quiet.

=== RUN   TestAxiNativeAgentSupervisionJourney
=== RUN   TestAxiNativeAgentSupervisionJourney/codex/technical-and-terminal
    axi_journey_test.go:182: native supervision CLI transcript (codex):
        arm:
        supervision: armed
        run_id: "01KXP14R4G5VQN30TQWSE2605P"
        cwd: /tmp/TestAxiNativeAgentSupervisionJourneycodextechnical-and-termina1310645011/003/worktree
        hook_required: true
        single_session_per_worktree_required: true
        help[1]: "Install the documented Stop hook before ending this turn; for Claude Code, arm with --claude-transcript so only assistant entries written after arming are eligible."
        non-stop hook: ""
        technical hook:
        {"decision":"block","reason":"nm_event=technical_gate"}
        duplicate hook: ""
        terminal hook:
        {"decision":"block","reason":"nm_event=terminal"}
        final status:
        supervision: completed
        run_id: "01KXP14R4G5VQN30TQWSE2605P"
        session_bound: true
        stale_heartbeats: 0
        updated_at: 1784224572
=== RUN   TestAxiNativeAgentSupervisionJourney/codex/ask-user-stops
    axi_journey_test.go:210: ask-user supervision CLI transcript (codex):
        hook: ""
        status:
        supervision: awaiting_user
        run_id: "01KXP14SR55TJ98NVJ38Z479ZG"
        session_bound: true
        stale_heartbeats: 0
        updated_at: 1784224573
=== RUN   TestAxiNativeAgentSupervisionJourney/codex/missing-cwd-is-ignored
=== RUN   TestAxiNativeAgentSupervisionJourney/claude/technical-and-terminal
    axi_journey_test.go:182: native supervision CLI transcript (claude):
        arm:
        supervision: armed
        run_id: "01KXP14W7FSNGQKJTCVK4A95MT"
        cwd: /tmp/TestAxiNativeAgentSupervisionJourneyclaudetechnical-and-termin705846911/003/worktree
        hook_required: true
        single_session_per_worktree_required: true
        help[1]: "Install the documented Stop hook before ending this turn; for Claude Code, arm with --claude-transcript so only assistant entries written after arming are eligible."
        non-stop hook: ""
        technical hook:
        {"decision":"block","reason":"nm_event=technical_gate"}
        duplicate hook: ""
        terminal hook:
        {"decision":"block","reason":"nm_event=terminal"}
        final status:
        supervision: completed
        run_id: "01KXP14W7FSNGQKJTCVK4A95MT"
        session_bound: true
        stale_heartbeats: 0
        updated_at: 1784224577
=== RUN   TestAxiNativeAgentSupervisionJourney/claude/ask-user-stops
    axi_journey_test.go:210: ask-user supervision CLI transcript (claude):
        hook: ""
        status:
        supervision: awaiting_user
        run_id: "01KXP14YW8F02EKXK37Z1C3WT3"
        session_bound: true
        stale_heartbeats: 0
        updated_at: 1784224578
=== RUN   TestAxiNativeAgentSupervisionJourney/claude/missing-cwd-is-ignored
--- PASS: TestAxiNativeAgentSupervisionJourney (10.57s)
    --- PASS: TestAxiNativeAgentSupervisionJourney/codex/technical-and-terminal (2.74s)
    --- PASS: TestAxiNativeAgentSupervisionJourney/codex/ask-user-stops (1.28s)
    --- PASS: TestAxiNativeAgentSupervisionJourney/codex/missing-cwd-is-ignored (1.26s)
    --- PASS: TestAxiNativeAgentSupervisionJourney/claude/technical-and-terminal (2.69s)
    --- PASS: TestAxiNativeAgentSupervisionJourney/claude/ask-user-stops (1.30s)
    --- PASS: TestAxiNativeAgentSupervisionJourney/claude/missing-cwd-is-ignored (1.29s)
PASS
ok  	github.com/kunchenguid/no-mistakes/internal/e2e	10.579s
- Outcome: 🔧 1 issue found → auto-fixed (3) ✅ across 4 runs (39m40s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped
  • ⚠️ internal/cli/axi.go - merge conflict rebasing onto origin/main
🔧 **Review** - 5 issues found → auto-fixed (9) ✅
  • 🚨 internal/branchsync/sync.go:1 - Der angegebene Bereich ist kein fokussierter Supervisions-PR: Er fügt zusätzlich die neue Branch-Sync-/Custody-Implementierung hinzu. Das widerspricht dem Kriterium „focused upstream PR“; bitte bestätigen, dass diese fachfremden Änderungen tatsächlich mitgeliefert werden sollen.
  • 🚨 .no-mistakes/evidence/fm/nm-ci-autofix-git-env/focused-regression-tests.txt:1 - Der Diff fügt interne Test- und Laufzeitevidenz hinzu (insgesamt vier Dateien unter .no-mistakes/evidence/fm/). Das widerspricht unmittelbar dem Kriterium „exclude local planning notes and internal evidence artifacts“.
  • 🚨 internal/scm/github/github.go:520 - Klassische GitHub-Branch-Protection-Kontexte ohne App-ID werden grundsätzlich als unbeobachtbar behandelt. Selbst ein erfolgreiches gleichnamiges Check Run erzeugt dadurch zusätzlich einen synthetischen blockierenden Pending-Check; betroffene CI-Monitore erreichen nie checks-passed. Soll diese bewusst fail-closed gewählte, aber für Legacy-contexts dauerhaft blockierende Semantik gelten?
  • 🚨 internal/cli/axi_supervise.go:245 - Eine aus einem Unterverzeichnis gestartete Codex- oder Claude-Session wird nie gebunden: arm speichert den Git-Root, der Hook sucht aber mit dem unveränderten Provider-CWD exakt danach und endet still. Den Hook-CWD vor FindByCWD auf den Git-Root normalisieren.
  • ⚠️ internal/supervision/store.go:238 - Zwei verschiedene Claude-Stop-Turns mit derselben letzten Assistant-Nachricht (z. B. zweimal „Done.“) erhalten dieselbe Handoff-ID und der zweite wird dauerhaft als Duplikat verworfen. Die Deduplizierung sollte zusätzlich den bereits gespeicherten Event-Fingerprint berücksichtigen.

🔧 Fix: Fix supervision hook binding and event deduplication
5 errors still open:

  • 🚨 internal/branchsync/sync.go:1 - Der angegebene Bereich enthält zusätzlich die neue Branch-Sync-/Custody-Implementierung. Das widerspricht dem Kriterium „focused upstream PR“; bitte bestätigen, dass diese fachfremden Änderungen Teil dieses Supervisions-PRs sein sollen.
  • 🚨 .no-mistakes/evidence/fm/nm-ci-autofix-git-env/focused-regression-tests.txt:1 - Der Diff fügt interne Test- und Laufzeitevidenz unter .no-mistakes/evidence/fm/ hinzu. Das widerspricht unmittelbar dem Kriterium „exclude local planning notes and internal evidence artifacts“.
  • 🚨 internal/scm/github/github.go:520 - Klassische GitHub-Branch-Protection-contexts ohne App-ID gelten immer als unbeobachtbar. Ein erfolgreicher gleichnamiger Check Run erzeugt daher zusätzlich einen synthetischen Pending-Check, sodass betroffene CI-Monitore nie checks-passed erreichen. Soll diese fail-closed Semantik für Legacy-Kontexte bewusst dauerhaft blockieren?
  • 🚨 internal/cli/axi_supervise.go:423 - Die neue Deduplizierung ist nicht idempotent: Der Event-Fingerprint enthält die veränderliche Heartbeat-Deadline, die nach der ersten Übergabe gespeichert wird. Eine erneute Zustellung desselben Stop-Turns erhält dadurch einen anderen Fingerprint und erzeugt erneut eine block-Continuation. Den Fingerprint aus stabilen Provider-Ereignisdaten bilden.
  • 🚨 internal/daemon/daemon.go:565 - Die persistierte CIReady-Information wird über IPC geliefert, aber beim Aufbau des AXI-Views verworfen; der Supervisor prüft ausschließlich historische CI-Logs. Bei einem frischen Attach ohne verfügbare Logdatei endet die Supervision deshalb mit Heartbeats/Pause statt checks_passed. CIReady durch den AXI-View führen und bei der Readiness-Entscheidung berücksichtigen.

🔧 Fix: Stabilize supervision retries and CI readiness
4 errors still open:

  • 🚨 internal/branchsync/sync.go:1 - Der deklarierte Bereich enthält zusätzlich die neue Branch-Sync-/Custody-Implementierung. Das widerspricht dem Kriterium „focused upstream PR“; bitte bestätigen, dass diese fachfremden Änderungen Teil dieses Supervisions-PRs sein sollen.
  • 🚨 .no-mistakes/evidence/fm/nm-ci-autofix-git-env/focused-regression-tests.txt:1 - Der Diff enthält weiterhin interne Test- und Laufzeitevidenz unter .no-mistakes/evidence/fm/. Das widerspricht unmittelbar dem Kriterium „exclude local planning notes and internal evidence artifacts“.
  • 🚨 internal/scm/github/github.go:520 - Klassische GitHub-Branch-Protection-contexts ohne App-ID gelten immer als unbeobachtbar. Auch ein erfolgreicher gleichnamiger Check Run erzeugt dadurch einen synthetischen Pending-Check, sodass betroffene CI-Monitore nie checks-passed erreichen. Soll diese fail-closed Semantik für Legacy-Kontexte bewusst dauerhaft blockieren?
  • 🚨 internal/cli/axi_supervise.go:465 - Die stabilisierte Deduplizierung kann unterschiedliche Claude-Stop-Turns verwerfen: Claude bildet die Handoff-ID nur aus Session und letzter Assistant-Nachricht, während der neue Fingerprint bei unverändertem AXI-Status ebenfalls gleich bleibt. Zwei aufeinanderfolgende identische Antworten stoppen damit die Heartbeat-Kette, statt bis zur konfigurierten Stale-Grenze weiterzuarbeiten. Bitte die gewünschte Abwägung zwischen Zustellungs-Deduplizierung und Wiederholung identischer Claude-Turns bestätigen.

🔧 Fix: Distinguish identical Claude Stop turns
1 error still open:

  • 🚨 internal/cli/axi_supervise.go:241 - Die neue Turn-Kennung ist nicht zuverlässig: transcript_path wird laut Claude-Code-Hook-Referenz asynchron geschrieben und kann beim Stop noch hinterherhinken. Dadurch kann eine verzögert erneut zugestellte Stop-Nachricht nach einem Metadata-Update eine neue ID erhalten und erneut blockieren; umgekehrt kann ein echter Folgeturn noch die alte Metadata tragen und verworfen werden. Eine echte, atomar verfügbare Turn-Grenze verwenden oder die Deduplizierung so gestalten, dass sie nicht von asynchronen Dateimetadaten abhängt.

🔧 Fix: Use Claude transcript UUIDs for Stop deduplication
1 error still open:

  • 🚨 internal/cli/axi_supervise.go:253 - Das Kriterium „Make No-Mistakes natively supervise … after a … Claude Code Stop event“ bleibt bei einem frisch bewaffneten Lauf unerfüllt: Beim ersten Stop ist previous leer, daher akzeptiert die Funktion sofort die letzte bereits persistierte Assistant-UUID, statt auf die zum aktuellen Stop gehörende Nachricht zu warten. Claude dokumentiert ausdrücklich, dass das Transcript beim Stop hinterherhinken kann; der spätere Flush wird dann als weiterer Turn behandelt und kann eine zweite Continuation erzeugen. Die aktuelle Stop-Nachricht zur Zuordnung behalten und bis zu ihrer UUID warten.

🔧 Fix: Match Claude Stop messages to transcript UUIDs
2 errors still open:

  • 🚨 internal/cli/axi_supervise.go:255 - Das Kriterium „Make No-Mistakes natively supervise … after a … Claude Code Stop event“ bleibt bei normalem Transcript-Lag unerfüllt: Der neue Hunk gibt bei handoffID == "" sofort zurück, statt bis zur konfigurierten Deadline auf die UUID der aktuellen Nachricht zu warten. Ein Stop vor dem asynchronen Transcript-Flush wird dadurch still verworfen.
  • 🚨 internal/cli/axi_supervise.go:255 - Die explizite Vorgabe, echte nachfolgende Claude-Stopps auch bei identischem Nachrichtentext zu unterscheiden, ist beim ersten Handoff noch nicht erfüllt: Mit leerem previous akzeptiert dieser Hunk eine bereits im Transcript vorhandene frühere gleichlautende Assistant-UUID als aktuellen Stop. Nach dem Flush des echten Turns wird dessen UUID als zweite Continuation verarbeitet. Es braucht eine beim Armen persistierte Transcript-Grenze oder eine andere kausale Turn-ID.

🔧 Fix: Bound Claude transcript handoffs causally
2 errors still open:

  • 🚨 internal/cli/axi_supervise.go:579 - Das Kriterium „keep ask-user … safely bounded“ wird verletzt: Der ask_user-Rückweg überspringt PrepareHandoff, den einzigen neuen Pfad zum Speichern von event.TranscriptOffset. Nach axi respond ist die alte Ask-user-Nachricht damit weiterhin hinter der Boundary; bei identischem Folgetext und Transcript-Lag wird sie als neuer Stop zugeordnet und kann erneut blockieren. Den Offset auch beim Ask-user-Übergang fortschreiben.
  • 🚨 internal/cli/axi_supervise.go:308 - Das Kriterium „Make No-Mistakes natively supervise … after a … Claude Code Stop event“ bleibt für große Turns unerfüllt: Der neue 1-MiB-Reader erreicht eine spätere Assistant-Zeile nach großem Tool-Output nicht. Jeder Poll beginnt wieder beim unveränderten Offset, liest denselben Präfix und verwirft den Stop nach Ablauf der Frist. Den Scan innerhalb der begrenzten Wartezeit fortschreiten lassen oder den Overflow sicher behandeln.

🔧 Fix: Advance Claude transcript cursors safely
1 error still open:

  • 🚨 internal/cli/axi_supervise.go:315 - Das Kriterium „Make No-Mistakes natively supervise … after a … Claude Code Stop event“ bleibt bei Transcript-Deltas über 8 MiB unerfüllt: Dieser Hunk beendet den Scan mit leerer Handoff-ID, ohne Cursor oder Pausenstatus zu persistieren. Liegt die aktuelle Assistant-UUID hinter dem Limit, wird jeder spätere Stop vom alten Offset aus erneut über denselben Präfix gescannt und dauerhaft verworfen. Einen verifizierten Fortschritt persistieren oder den Overflow sichtbar und sicher pausieren.

🔧 Fix: Persist verified Claude transcript scan progress
2 errors still open:

  • 🚨 internal/cli/axi_supervise.go:482 - Das Kriterium „Make No-Mistakes natively supervise … after a … Claude Code Stop event“ wird durch verzögerte Duplikate verletzt: Ein verspäteter T1-Stop kann einen bereits geschriebenen, anderslautenden T2-Record scannen, auf die alte T1-ID zurückfallen und hier den Scan-Offset hinter T2 persistieren. Der echte T2-Stop beginnt dann nach seiner UUID und wird still verworfen. Den Cursor beim previous-Fallback nicht fortschreiben.
  • 🚨 internal/cli/axi_supervise.go:480 - Das Kriterium „Make No-Mistakes natively supervise … after a … Claude Code Stop event“ bleibt für Assistant-Records über dem Record-Limit unerfüllt: Der Scanner verwirft sie, behandelt ihr Zeilenende aber als geprüften Fortschritt und persistiert hier den Offset. Ist dies der aktuelle Stop-Record, wird seine UUID nie geprüft und für alle späteren Zustellungen dauerhaft übersprungen. Einen verworfenen Record sichtbar pausieren oder erst nach vollständiger Prüfung fortschreiben.

🔧 Fix: Guard Claude cursor advancement and oversized records
✅ Re-checked - no issues remain.

🔧 **Test** - 1 issue found → auto-fixed (3) ✅
  • 🚨 tests failed with exit code 1
  • go test -race ./...

🔧 Fix: Isolate branchsync hook tests from global configuration
1 error still open:

  • 🚨 internal/cli/axi_supervise.go:259 - Codex- und Claude-Stop-Payloads ohne cwd werden trotzdem dem Prozessverzeichnis zugeordnet und senden nm_event=technical_gate. Unvollständige Ereignisse müssen fail-closed ignoriert werden.
  • go test -race ./...
  • go test -race ./... (vom Auftrag als erfolgreiche Baseline angegeben)
  • go test -race ./internal/cli ./internal/supervision
  • go test -tags=e2e -count=1 -timeout 300s -run '^(TestAxiAgentJourney|TestAxiBranchSyncJourney)$' ./internal/e2e
  • go test -tags=e2e -count=1 -timeout 300s -run '^TestAxiNativeAgentSupervisionJourney/(codex|claude)/(technical-and-terminal|ask-user-stops)$' -v ./internal/e2e
  • go test -tags=e2e -count=1 -timeout 300s -run '^TestAxiNativeAgentSupervisionJourney$' -v ./internal/e2e (Negativtest ohne cwd, reproduzierbar fehlgeschlagen)

🔧 Fix: Reject Stop hooks missing cwd
1 error still open:

  • 🚨 .no-mistakes/evidence - The target diff adds four tracked internal evidence artifacts under .no-mistakes/evidence/, contrary to the explicit requirement to exclude internal evidence artifacts from the focused upstream PR. Remove these files from this PR.
  • go test -race ./...
  • go test -tags=e2e -count=1 -run '^TestAxiNativeAgentSupervisionJourney$' -v ./internal/e2e
  • go test -race ./internal/cli ./internal/supervision
  • go test -tags=e2e -count=1 -run '^TestAxiBranchSyncJourney$' -v ./internal/e2e
  • git diff --name-only 2bbbc143bd4520056e97957883a02615657b2a62 99c0f3eadc5d2ca720fa087b9ba41cafbbd58756 -- .no-mistakes/evidence

🔧 Fix: Remove internal evidence artifacts
✅ Re-checked - no issues remain.

  • go test -race ./...
  • Baseline (bereits erfolgreich): go test -race ./...
  • go test -tags=e2e -count=1 -timeout 300s -run '^TestAxiNativeAgentSupervisionJourney$' -v ./internal/e2e
  • go test -tags=e2e -count=1 -timeout 300s -run '^TestAxiBranchSyncJourney$' -v ./internal/e2e
  • go test -count=1 -run '^(TestCodexHookIgnoresNonStopEvents|TestClaudeHookIgnoresMalformedAndNonStopPayloads|TestClassifySupervisorRunFailsClosedForAskUserAndMalformedGates|TestClassifySupervisorRunRecognizesTechnicalGateAndTerminal|TestApplySupervisorOutcomeDeduplicatesRepeatedStopEvent|TestApplySupervisorOutcomeAskUserAdvancesClaudeTranscriptOffset|TestApplySupervisorOutcomeBoundsReasonsAndPausesAfterStaleBudget)$' ./internal/cli
  • go test -count=1 ./internal/supervision ./internal/branchsync
  • Manuelle Diff- und Scope-Prüfung: keine internen Evidence- oder Planungsartefakte im Ziel-Diff.
🔧 **Document** - 1 issue found → auto-fixed ✅
  • ⚠️ internal/cli/axi_supervise.go:111 - The live axi supervise --help description still says Codex-only although Claude Code is supported; changing that executable help text exceeds the documentation/doc-comment-only scope.

🔧 Fix: Name Codex and Claude in supervise help
✅ Re-checked - no issues remain.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 68 files, which is 18 over the limit of 50.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 76466c99-4fdf-44ba-9d8c-a7a943a76359

📥 Commits

Reviewing files that changed from the base of the PR and between 365cf40 and f54822f.

📒 Files selected for processing (68)
  • .release-please-manifest.json
  • AGENTS.md
  • CHANGELOG.md
  • docs/src/content/docs/concepts/gate-model.md
  • docs/src/content/docs/guides/agents.md
  • docs/src/content/docs/guides/tui.md
  • docs/src/content/docs/reference/cli.md
  • docs/src/content/docs/reference/environment.md
  • docs/src/content/docs/reference/global-config.md
  • docs/src/content/docs/reference/pipeline-steps.md
  • internal/branchsync/recover_test.go
  • internal/branchsync/sync.go
  • internal/branchsync/sync_test.go
  • internal/cli/axi.go
  • internal/cli/axi_drive.go
  • internal/cli/axi_guidance.go
  • internal/cli/axi_guidance_test.go
  • internal/cli/axi_query.go
  • internal/cli/axi_render.go
  • internal/cli/axi_supervise.go
  • internal/cli/axi_supervise_test.go
  • internal/cli/root.go
  • internal/cli/status.go
  • internal/cli/sync.go
  • internal/cli/sync_test.go
  • internal/daemon/daemon.go
  • internal/db/db_test.go
  • internal/db/run.go
  • internal/db/run_test.go
  • internal/db/schema.go
  • internal/e2e/axi_journey_test.go
  • internal/e2e/journey_test.go
  • internal/e2e/review_pipeline_delivery_test.go
  • internal/git/env.go
  • internal/git/env_test.go
  • internal/git/git.go
  • internal/ipc/protocol.go
  • internal/pipeline/findings.go
  • internal/pipeline/steps/ci.go
  • internal/pipeline/steps/ci_commit_test.go
  • internal/pipeline/steps/ci_fix.go
  • internal/pipeline/steps/ci_test.go
  • internal/pipeline/steps/common.go
  • internal/pipeline/steps/common_exec.go
  • internal/pipeline/steps/common_test.go
  • internal/pipeline/steps/intent_prompt.go
  • internal/pipeline/steps/pipeline_delivery.go
  • internal/pipeline/steps/pipeline_delivery_test.go
  • internal/pipeline/steps/push.go
  • internal/pipeline/steps/push_test.go
  • internal/pipeline/steps/review.go
  • internal/pipeline/steps/review_pipeline_delivery_test.go
  • internal/pipeline/steps/steps_test.go
  • internal/skill/skill.go
  • internal/supervision/store.go
  • internal/supervision/store_test.go
  • internal/tui/app.go
  • internal/tui/branch_sync.go
  • internal/tui/branch_sync_test.go
  • internal/tui/ci.go
  • internal/tui/commands.go
  • internal/tui/keys.go
  • internal/tui/messages.go
  • internal/tui/pipeline.go
  • internal/tui/view.go
  • internal/types/findings.go
  • internal/types/findings_test.go
  • skills/no-mistakes/SKILL.md

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Review on demand using usage pricing
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/axi-native-agent-supervision

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

kunchenguid and others added 24 commits July 16, 2026 20:07
* fix(pipeline): ignore deferred delivery findings at pre-push review

Review runs before push/PR/CI, so an authoritative intent like "Open PR A
unmerged" must not park the run when the PR or remote branch this same
pipeline will create is still absent. Add a phase ownership clause, narrow
intent conformance to source-verifiable criteria, and strip findings that
only claim later pipeline-owned delivery is missing. External or
pre-existing lifecycle requirements stay enforceable; push/PR/CI remain
strict after their stages run.

* no-mistakes(review): Harden deferred delivery finding classification

* no-mistakes(review): Require explicit delivery ownership classification

* no-mistakes(review): Recompute review metadata after delivery filtering

* no-mistakes(review): Preserve source risk through delivery filtering

* no-mistakes(document): Document review delivery ownership boundary

* no-mistakes: apply CI fixes
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…id#496)

* feat(sync): guard local branch reconciliation

* no-mistakes(review): Clear stale CI readiness states

* no-mistakes(document): Align AXI sync guidance
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…#499)

* fix(pipeline): harden step git environment

* no-mistakes(document): Clarify step git environment
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…unchenguid#502)

* feat(branchsync): guarded custody recovery for terminal unpublished runs

A run that goes terminal (cancelled, failed, or completed without a push
stage) after moving the pipeline head used to leave the branch
pipeline_owned forever: sync --check reported blocked_pipeline_owned with
no safe exit, while the fix commits existed only in the local gate branch
(v1.38.1 dogfood catch, run 01KXN8YJ6DWF8XPP582DWQC3HV).

Terminal-run classification now reports safety
blocked_pipeline_owned_recoverable with the run's status and a structured
recover_custody next action; active runs keep the plain wait block. The
new guarded recovery (sync --recover on the human CLI and AXI, u in the
TUI) verifies the preserved head at the gate branch, anchors it under
refs/no-mistakes/recover/<run> in the invoking repository, fast-forwards
only a clean behind worktree, and stamps runs.custody_returned_at so a
fresh run can start. Dirty and diverged worktrees refuse with the
explicit choices; --recover --keep-local returns custody at the current
head without touching the worktree and moves the gate branch to it with
an atomic compare-and-swap, staging objects via gate-side fetch so the
receive hook never fires. The full relation matrix and fail-safe rules
live in the Recover doc comment in internal/branchsync/sync.go.

Recovered never-pushed runs classify as custody_returned (exit 0,
run_pipeline next action); recovered pushed runs fall through to their
ordinary binding classification such as local_ahead. Guidance is synced
across the skill body, agents guide, and live axi strings, pinned by the
canonical-phrase drift test.

Regressions: internal/branchsync/recover_test.go (terminal x relation x
cleanliness matrix, gate divergence fail-closed, CAS race),
internal/cli/sync_test.go, internal/tui/branch_sync_test.go, db custody
column migration tests, and e2e TestAxiCustodyRecoveryJourney which
reproduces the stranded state with the real binary and recovers it end
to end.

* no-mistakes(review): Harden branch recovery fast-forward preconditions

* no-mistakes(review): Anchor reachable recovery commits locally

* no-mistakes(review): Clarify custody recovery anchor guidance

* no-mistakes(document): Clarify custody recovery docs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@simfor99
simfor99 force-pushed the feat/axi-native-agent-supervision branch from aa8413f to f54822f Compare July 16, 2026 18:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a guarded local branch synchronization feature (branchsync) to handle terminal pipeline runs and ensure safe custody recovery. It adds new CLI commands (axi sync, axi watch, axi supervise) and updates the TUI to provide branch synchronization status and recovery actions. Additionally, it improves CI monitoring by persisting readiness state and separating native check runs from legacy commit statuses. My feedback highlights that several calls to store.UpdateForSession in internal/cli/axi_supervise.go ignore potential errors, which could lead to silent failures and state inconsistencies; these should be logged to ensure observability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

I am having trouble creating individual review comments. Click here to see my feedback.

internal/cli/axi_supervise.go (483-486)

medium

The error returned by store.UpdateForSession is being ignored. While it's important for the hook not to fail loudly to the calling agent, completely ignoring the error can lead to silent failures and an inconsistent state in the supervision store. This could make debugging issues with supervision difficult.

Consider logging the error to a dedicated log file for no-mistakes or to stderr. This would preserve the hook's contract with the agent while making potential file system or state corruption issues observable.

internal/cli/axi_supervise.go (489-493)

medium

The error returned by store.UpdateForSession is being ignored. While it's important for the hook not to fail loudly to the calling agent, completely ignoring the error can lead to silent failures and an inconsistent state in the supervision store. This could make debugging issues with supervision difficult.

Consider logging the error to a dedicated log file for no-mistakes or to stderr. This would preserve the hook's contract with the agent while making potential file system or state corruption issues observable.

internal/cli/axi_supervise.go (497-501)

medium

The error returned by store.UpdateForSession is being ignored. While it's important for the hook not to fail loudly to the calling agent, completely ignoring the error can lead to silent failures and an inconsistent state in the supervision store. This could make debugging issues with supervision difficult.

Consider logging the error to a dedicated log file for no-mistakes or to stderr. This would preserve the hook's contract with the agent while making potential file system or state corruption issues observable.

internal/cli/axi_supervise.go (508-512)

medium

The error returned by store.UpdateForSession is being ignored. While it's important for the hook not to fail loudly to the calling agent, completely ignoring the error can lead to silent failures and an inconsistent state in the supervision store. This could make debugging issues with supervision difficult.

Consider logging the error to a dedicated log file for no-mistakes or to stderr. This would preserve the hook's contract with the agent while making potential file system or state corruption issues observable.

internal/cli/axi_supervise.go (514-518)

medium

The error returned by store.UpdateForSession is being ignored. While it's important for the hook not to fail loudly to the calling agent, completely ignoring the error can lead to silent failures and an inconsistent state in the supervision store. This could make debugging issues with supervision difficult.

Consider logging the error to a dedicated log file for no-mistakes or to stderr. This would preserve the hook's contract with the agent while making potential file system or state corruption issues observable.

internal/cli/axi_supervise.go (525-529)

medium

The error returned by store.UpdateForSession is being ignored. While it's important for the hook not to fail loudly to the calling agent, completely ignoring the error can lead to silent failures and an inconsistent state in the supervision store. This could make debugging issues with supervision difficult.

Consider logging the error to a dedicated log file for no-mistakes or to stderr. This would preserve the hook's contract with the agent while making potential file system or state corruption issues observable.

internal/cli/axi_supervise.go (668-672)

medium

The error returned by store.UpdateForSession is being ignored. While it's important for the hook not to fail loudly to the calling agent, completely ignoring the error can lead to silent failures and an inconsistent state in the supervision store. This could make debugging issues with supervision difficult.

Consider logging the error to a dedicated log file for no-mistakes or to stderr. This would preserve the hook's contract with the agent while making potential file system or state corruption issues observable.

@simfor99

Copy link
Copy Markdown
Owner Author

Superseded by upstream PR kunchenguid#506, which contains the clean, rebased change set.

@simfor99 simfor99 closed this Jul 16, 2026
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