Reference Search docs

Errors & codes

Prefer stable codes over string matching. Map adapter errors at package boundaries. Do not leak SQL, filesystem paths, or secret material into app-facing errors.

Shape conventions

Errors that cross a boundary should carry:

FieldRole
codeStable SCREAMING_SNAKE or dotted machine code
messageHuman-safe summary (no secrets)
retryableExplicit when known (do not infer from message)
cause chainInternal only; strip before external MCP/CLI if sensitive

Parse-don’t-validate constructors throw typed parse errors (CoreParseError, EffectValidationError, …) rather than returning “maybe invalid” DTOs.

EventStore / storage

CodeMeaningTypical retry
OPTIMISTIC_SEQUENCE_CONFLICTStale expectedSeqYes — reload stream
STALE_FENCEFence below owner_epochNo as OCC retry
MISSING_FENCEUnfenced write to fenced streamNo — acquire lease
CHECKPOINT_REGRESSIONNon-monotonic checkpointNo
UNSUPPORTED_SCHEMA_VERSIONDB newer than codeNo — upgrade binary
MIGRATION_FAILUREMigrate failedNo until fixed
STREAM_INTEGRITYNoncontiguous / head mismatchNo
UNSUPPORTED_CODECUnknown payload codecNo
PERSISTENCE_UNAVAILABLEe.g. OPFS required but missingNo / change mode
SQLITE_BUSYBusy timeoutMaybe — backoff
SNAPSHOT_AHEADSnapshot seq > headNo
STORAGE_WORKER_TERMINATEDWorker crashRestart worker

Aggregates

CodeMeaningRetry?
AGGREGATE_CONFLICTOCC / concurrent writersYes — reload & retry
AGGREGATE_INVARIANTBusiness rule rejectNo
Stale fence surfaced at aggregateLost leaseNo blind retry

Resilience failure classes

ClassRetry via ResilienceProfile?
transientYes (within profile)
policy.DecidedNever
terminalNever
cancellationNever
deadlinePolicy-dependent; not infinite retry

Contracts / Gatekeeper

Compatibility and gate denials surface as structured reasons (MachineReadableReason with gate: contracts | policy | obligations | cost | effects | resilience), not only thrown exceptions. CLI/MCP should print reason codes agents can act on.

Identity / config

Prefer ref-safe messages (“resolution rank failed at provider-federation”) over embedding token fragments. Static-escape expiry is a hard fail, not a silent fallback to plaintext.

EventStore · Effects · ActorHost · Contracts