Skip to content

Reason code catalog

A reason code is a stable identifier for why something happened, published so that both the producer and the reader use the same value. The catalog is a capability rather than a document, so a caller can ask which codes exist and whether a given code belongs to a class.

The catalog is queryable

Operation Answers
Model release route reason codes Which codes exist for model release routing
Project release route reason codes Which codes exist for project release routing
Is a model release route mismatch Does this code mean a model route mismatch
Is a project release route mismatch Does this code mean a project route mismatch
Model serve blocked event kind Which event kind means a serve admission block
Is a model serve blocked event kind Does this event kind mean that

The membership tests exist so that a consumer branches on a published predicate rather than on a string comparison it maintains itself. A code added to a class is then recognised by every consumer without each one being edited.

Release route mismatches

A release route mismatch means the thing being routed to is not the thing that was expected. Three codes cover models:

MODEL_RELEASE_ROUTE_GENERATION_MISMATCH
MODEL_RELEASE_ROUTE_HASH_MISMATCH
MODEL_RELEASE_TARGET_VERSION_MISMATCH

Two cover projects:

PROJECT_RELEASE_ROUTE_GENERATION_MISMATCH
PROJECT_RELEASE_ROUTE_HASH_MISMATCH

The three kinds of mismatch are worth telling apart. A generation mismatch means the route is stale relative to the current desired state. A hash mismatch means the content is not what was pinned. A target version mismatch means the route points at a different version than the one asked for.

Serve admission blocks have an event kind

model.serve.admission.blocked

A blocked serve admission is an event kind rather than only a status, so it appears in the event feed where a run's other decisions appear and can be joined to them by the correlation tuple.

Why codes are published rather than logged

flowchart LR
  subgraph PR["PRODUCERS"]
    direction TB
    P1["Kernel"]
    P2["xratud"]
    P3["Control plane"]
  end
  CAT[("Reason code catalog<br/>one definition per code")]
  subgraph CO["CONSUMERS"]
    direction TB
    C1["xratud"]
    C2["Control plane"]
    C3["CLI and your tooling"]
  end
  CAT --> PR
  CAT --> CO

Both sides read the catalog in the middle, and neither reads the other's message text.

Message text is for people and changes freely. A reason code is behaviour: a consumer decides what to do from it, so it has one definition and both sides read the same one.

The same pattern appears at the plane boundaries, where the control-lane vocabulary is published once and both the node and the kernel branch on it. See Cross-plane contracts.

Where codes surface

Reason codes appear on governance events, on blocked runs and deployments, and in the failure listings the reliability surface exposes. A code seen in one place means the same thing in another, which is the point of publishing it.