Skip to content

fix: bind no-mistakes run by plan metadata, not intent-log body - #90

Merged
dnth merged 1 commit into
mainfrom
fm/fix-receipt-run-bind-vs-axi-intent-log
Sep 1, 2026
Merged

fix: bind no-mistakes run by plan metadata, not intent-log body#90
dnth merged 1 commit into
mainfrom
fm/fix-receipt-run-bind-vs-axi-intent-log

Conversation

@dnth

@dnth dnth commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Outcome

fm-receipt-check.sh --bind-run/--complete refused every no-mistakes run because the binder proved a run belonged to the current plan by grepping the run's intent log for an inline Firstmate-Validation-Generation: <gen> record. Real AXI never echoes the agent-supplied --intent body back through axi logs --step intent - it reports only "using intent supplied by the agent" - so no run could bind and terminal --complete refused even for CI-green, correctly-validated runs (observed this session on fork PR #88's receipt completion and the port-3369-check-unregister task).

The fix binds from what AXI reports authoritatively instead: the run id and head from axi status --run, the created-after-plan boundary, and the generation recorded in the task's own plan metadata (validation_generation). The exact run/generation/head identity checks are unchanged, so a wrong head, a mismatched generation, or a superseded plan (which mints a new generation and clears validation_run_*) still fails closed.

Files changed

  • bin/fm-receipt-check.sh - bind-run no longer reads axi logs --step intent; the generation is anchored to plan metadata cross-checked against the run-authoritative id/head. Added a rationale comment at the check.
  • bin/fm-nm-run-lib.sh - removed the now-unused fm_nm_intent_has_generation helper (its only caller was the bind path).
  • tests/fm-receipt-check.test.sh - new regression test reproduces the real agent-supplied intent-log shape and asserts bind+complete succeed while a mismatched generation and a wrong head still fail closed; the intent-echo-specific assertions were retargeted to the retained id/head/generation checks.

Verification

  • bash tests/fm-receipt-check.test.sh - all pass, including the new agent-supplied intent-log regression.
  • bash tests/fm-omp-harness.test.sh - 12/12 pass; no OMP adapter/spawn/arm files were modified (harness-agnostic change).
  • bash bin/fm-lint.sh - exit 0 (ShellCheck 0.11.0 pinned).

Risks / follow-ups

  • The generation is Firstmate's own plan-side nonce; since AXI exposes no per-run generation, it is anchored to plan metadata rather than proven from the run body. Anti-superseded protection is retained through the created-after-plan boundary at bind and the generation/head re-checks at completion (a replan clears the bound run). The Firstmate-Validation-Generation: line in the brief's --intent is now provenance only, no longer machine-verified; fm-brief.sh is left unchanged.

https://claude.ai/code/session_016U99CBNwSkGnuHNoqLJZQj

The run-binding path in fm-receipt-check.sh proved a no-mistakes run
belonged to the current plan by grepping the run's intent log for an
inline `Firstmate-Validation-Generation: <gen>` record. Real AXI never
echoes the agent-supplied --intent body back through
`axi logs --step intent`; it reports only "using intent supplied by the
agent". So bind-run always refused, and terminal --complete refused even
for CI-green, correctly-validated runs.

Bind from what AXI reports authoritatively instead: the run id and head
from `axi status --run`, the created-after-plan boundary, and the
generation recorded in this task's plan metadata (validation_generation).
The exact run/generation/head identity checks are unchanged, so a wrong
head, a mismatched generation, or a superseded plan (which mints a new
generation and clears validation_run_*) still fails closed. The intent
log is no longer consulted, and the now-unused
fm_nm_intent_has_generation helper is removed from the one-owner lib.

Colocated regression tests reproduce the real agent-supplied intent-log
shape and assert bind+complete succeed while wrong runs are rejected.

Claude-Session: https://claude.ai/code/session_016U99CBNwSkGnuHNoqLJZQj
@dnth
dnth merged commit 69a006c into main Sep 1, 2026
14 of 15 checks passed
@dnth
dnth deleted the fm/fix-receipt-run-bind-vs-axi-intent-log branch September 1, 2026 23:55
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