Coding-Agent State Protocol

Blog

Field notes on keeping agents honest — state drift, deterministic verification, and gating the push.

22 Jul 2026 · 8 min

Loop Engineering: The Boxes in the Loop That Can't Be the Model

Loop engineering breaks an agent loop into four parts — trigger, topology, verifier, stop rule. A model can serve as three of them. The verifier and the topology check are where a model grading its own work quietly fails, and both need a floor that resolves against git. Shown on real casp output for a drifted state and an unexecutable plan.

21 Jul 2026 · 9 min

A Verification Rule Isn't Shipped Until Existing Repos Can Adopt It

A new drift rule reddens every repo that already uses the checker, for history written before the rule existed. The fix is an adoption window derived from the project's own append-only data, not a config flag — then the second-order trap, where the rule shipped a template no installed user could obtain, and the command written to deliver it safely shipped two ways to lose data.

21 Jul 2026 · 9 min

The Plan Is a Queue: Handing an AI Coding Agent One Session at a Time

Handed a whole spec, a coding agent picks a plausible starting point rather than the next one, and every session opens with the same re-briefing. An ordered queue of session prompts in the repository fixes that — and introduces a pointer that can name a slice already shipped, which is why the handoff has to refuse mechanically rather than politely.

15 Jul 2026 · 6 min

The Machine-Readable Handoff: A Drift Verdict an Agent Can Act On

The record a session leaves behind is read first by the next agent, not a person. So the check on that record should return structured output an agent can act on — expected vs actual per finding, as data — while keeping every property that makes it a deterministic floor: no model, no network, resolved against git.

13 Jul 2026 · 7 min

Self-Verifying AI Agents: The One Check the Harness Cannot Run on Itself

The self-verification loop closes every gap except one — nothing in it verifies the harness's own record of the project against git. Why a second review agent is a second opinion rather than a ground truth, shown on a fabricated session close that every code check waves through.

13 Jul 2026 · 7 min

Pre-Push Hooks for AI Coding Agents: Gate Both Boundaries of the Session

Advice-level verification does not survive autonomy. How casp gates both boundaries of an agent session — casp next refuses to start on drift, and a pre-push hook blocks the push — so a false recorded state can neither orient the next agent nor leave the machine.

11 Jul 2026 · 7 min

State Drift: Why AI Coding Agents Lose Track of Your Project — and the Deterministic Fix

Across many agents, sessions and models, the state you recorded quietly diverges from what git contains. Why it happens, why storage-and-recall tools don't close it, and how a deterministic check validates state against git and blocks the push on drift.