Skip to content

Error Ownership

Reference table mapping each layer of the Nimi stack to its error contract, rule prefix, and authoritative source.

Per-Layer Ownership

LayerOwner contractRule prefixWhat it owns
Platform protocol.nimi/spec/platform/kernel/protocol-contract.mdP-PROTO-*Cross-world protocol error codes, action hints, audit event taxonomy
Runtime.nimi/spec/runtime/kernel/error-model.mdK-ERR-*Reason codes, error classification, retry vs contract-failure distinction
Runtime streaming.nimi/spec/runtime/kernel/streaming-contract.mdK-STREAM-*Terminal frames, stream-level failure semantics
SDK.nimi/spec/sdk/kernel/error-projection.mdS-ERROR-*App-facing error projection, typed error shapes
Desktop.nimi/spec/desktop/kernel/error-boundary-contract.mdD-*UI error boundary, retry policy, user-facing error rendering

Translation Tables

The Platform-to-Runtime mapping is the canonical translation point between protocol-level errors and runtime reason codes: .nimi/spec/platform/kernel/tables/error-code-mapping.yaml.

Per-layer enumerations live in their own tables:

TableLayer
platform/kernel/tables/protocol-error-codes.yamlPlatform
runtime/kernel/tables/reason-codes.yamlRuntime
runtime/kernel/tables/error-mapping-matrix.yamlRuntime cross-layer
sdk/kernel/tables/sdk-error-codes.yamlSDK
desktop/kernel/tables/retry-status-codes.yamlDesktop

Distinguishing Transport Recovery From Contract Failure

Failure classRecoverable byAuthority
Transport error (network, timeout, transient 5xx)Retry, auth refreshTransport / SDK transport contract
Auth refresh requiredAuth refresh, token rotationRuntime auth + SDK transport
Contract failure (typed shape, MIME, schema, missing field)Not recoverable by retry; fails closedOwner contract
Streaming terminal failureCannot rescue mid-stream; emit terminal failure frameRuntime streaming

Retry and auth refresh are transport mechanisms only. They must never silently rescue a decode, content-type, schema, or contract failure.

Cross-Layer Error Walk

A single failure typically crosses multiple layers. A worked example: a streaming generation request whose upstream provider fails mid-response lands as:

LayerAction
ProviderReturns transient error frame
Runtime provider-healthClassifies under K-ERR-* family
Runtime streamingDecides recover-vs-terminate; if terminate, emits typed terminal failure frame
Runtime workflowWorkflow state moves to FAILED
Runtime auditRecords failure with trace lineage
SDK error projectionProjects typed app-facing error per S-ERROR-*
Desktop UISurfaces under D-* error boundary
UserSees governed failure, never a fabricated success

Source Basis

Nimi AI open world platform documentation.