Skip to main content
Typed refusals | Entity RuntimeUnderstand kernel, definition, and storage refusal kinds and decide whether to repair, gather evidence, reload, or escalate.Entity Runtimehow-toentity-runtimehow-toadopterdeveloperreference

Typed refusals

A refusal means the runtime understood the request and declined to produce or store the proposed change. Refusals are ordinary control flow for an agent integration, not partial failures.

Kernel refusals

KindMeaningTypical response
entity_not_registeredno validated definition for (entity, version)load the intended definition set
entity_mismatchinstance and definition identities differrefuse the caller-supplied instance
unknown_stateinstance claims a state absent from its definitionrepair the trusted store or migration
revision_exhaustedanother successful revision cannot be representedstop; do not wrap or reset history
operation_not_founddefinition declares no such operationinspect allowed operations and replan
invalid_transitionoperation is unavailable from the current statereload context and choose a legal operation
validationfields or arguments violate their schemarepair every returned path
precondition_failedobserved facts contradict an operation rulechoose another operation or escalate
precondition_unobservablerule needs facts that were not observedgather every path in unresolved
invariant_violationthe resulting entity would be invaliddo not bypass; fix modeling or input
invariant_unobservableresulting validity depends on missing factsgather or model the evidence explicitly
templatea runtime template path cannot resolverepair definition/input; never substitute null

Definition parsing and registration failures use kind: definition and include defect plus a defects array when multiple independent defects were accumulated. Fix the definition before exposing it to an agent.

Store refusals

Rust callers match StoreError variants. CLI File Store operations serialize { "refused": true, "by": "store", "detail": "..." }; the human detail preserves the provider's reason, but the CLI does not expose the Rust variant as a JSON kind.

Store outcomeMeaningResponse
RevisionConflictstored revision differs from the expectationreload and re-run the decision
RecordConflictrecord ID already names different bytesinvestigate idempotency misuse; choose no replacement ID silently
Unreachableprovider could not be contactedretry or follow declared offline policy; never treat as absent
Backendprovider itself failedsurface an operational error; do not spin on policy retries

False versus unobservable

These outcomes intentionally differ:

{
"kind": "precondition_failed",
"rule": "large_refunds_need_a_human",
"reason": "refunds above 5000 cents require a human actor"
}

The facts were present and policy said no.

{
"kind": "precondition_unobservable",
"rule": "reviewed",
"unresolved": ["$fields.review_score"]
}

Policy could not answer because evidence was absent. An agent should not handle those situations the same way.

The no-change guarantee

Kernel entry points take the instance by shared reference and return a new instance only on success. Stores check expectations before committing. Therefore:

  • no refused rule leaves assigned fields behind;
  • no refused invariant emits events;
  • no revision conflict overwrites the winning state; and
  • no failed atomic batch commits a prefix.

Match variants or JSON kind fields. Human messages may improve without preserving exact wording.