Skip to main content

Check what changed before every agent turn

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

Merged · local onlyReviewed 2026-10-14 · prelaunchRead this guide as Markdown
Guide context

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

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.

On this page · 3 sections

Prepare State; keep execution explicit

  1. Compare local Turn Frames

    Inspect the exact evidence prepared for adjacent reasoning turns.

  2. Check applicability

    Required inputs and versions must still apply, and permissions must still be valid.

  3. 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.

Agent-readable documentation manifest