# Check what changed before every agent turn

Prepare and compare bounded State evidence around an AgentCore turn. Local Turn Frames do not intercept model calls or authorize external actions.

Status: Merged · local only. Prelaunch; not a live service guarantee.
The Linux x64 native toolkit qualifies reference-only local Turn Frames. Exact Context capture, manifest assembly, and a controlled request-boundary adapter also exist in source. Automatic runtime interception and managed AgentCore wiring remain planned. Model submission, completion, and business acceptance are not observed unless an injected boundary explicitly reports them.

Reviewed: 2026-10-14.
Backend source: e16b81b4a637acec91f3aed8a71cf5b0f42f0c19.
Native toolkit: merged in PR #176, reviewed at e16b81b4a637acec91f3aed8a71cf5b0f42f0c19.
HTML: /docs/turn-lifecycle

## In short

Before your application starts another AgentCore turn, compare the State evidence that changed and prepare the next selection. Local Turn Frames make that preparation inspectable. The runtime performs model and tool calls; the application owns checks before consequential actions.

**Available today:** The native toolkit has a local reference-only candidate. No live AgentCore turn interception, model submission or managed Turn Receipt is established.

> Prepare the next State selection; let the AgentCore runtime execute the turn.

## Prepare State; keep execution explicit

- **Compare local Turn Frames** — Inspect the exact evidence prepared for adjacent reasoning turns.
- **Check applicability** — Required inputs and versions must still apply, and permissions must still be valid.
- **Execute in AgentCore** — Live interception and managed Turn Receipts are planned integrations that still require qualification.

## Resolve → detect → reconcile → assemble → reason → revalidate

1. **Resolve** — Start from exact retained evidence, View definitions, source versions, freshness and authority inputs.

2. **Detect** — Identify which exact identities or fences changed. Provenance change is not automatically semantic change.

3. **Reconcile** — Incremental view maintenance: propagate through declared dependencies and recompute only supported affected State, fencing stale work with version conditions.

4. **Assemble** — Assemble required reference evidence and bounded optional context into a separate model-facing representation.

5. **Reason** — Your agent hosted on AgentCore invokes the model. The runtime and application own execution; Kam retains the admitted State evidence.

6. **Revalidate** — The future action boundary checks the relevant ReadSet before consequential external effects.

## What the native toolkit actually proves

The native toolkit, merged in PR #176, can build a local record of one turn’s preparation, called a Turn Frame (format kam.local-turn-frame.v1). Each frame links to the previous one and pins the exact State, inputs and evaluation time it used, so two turns can be compared line by line.

To avoid overstating what happened, every prepared frame says so explicitly: modelRequestReady false, modelSubmission not_observed, turnReceipt not_committed, liveAuthorization not_checked and persisted false. The candidate is diagnostic infrastructure, not live runtime interception.

## Why did this turn rebuild?

The local profiler compares definition, membership, exact provenance, reported content hash, source fences, temporal inputs and selection disposition independently. Unsupported semantic sameness, provider cache hits and inferred decision causes remain not_observed.

The long-term developer-tools direction is change diagnostics for agent State: explain the source change, affected Views, reused evidence, rebuilt representation and logical versus physical retry work.
