Expand description
Identity and version newtypes (spec §7).
Every identifier that crosses a boundary is a dedicated type so that a
CaseId can never be passed where an InteractionId is expected and so that
public signatures never carry raw strings or integers for identities.
Two families exist:
- UUID-backed identifiers (
ConversationId,TurnId,InteractionId,CommandId,EventId,ReceiptId,BatchId,OutboxId) are generated server-side withUuid::now_v7so they sort by creation time. - String-backed identifiers (
CaseId,WorkflowKey,WorkflowVersion,TargetToken,OptionId,OperationKey,ReadToolKey,AccountId,UserId,SchemaVersion,AttachmentId,OriginToken,QuestionId,BlockId,ReadRequestId,ProviderKey,ModelKey,AttemptId) are opaque labels owned by the application or the server.
Neither family implements Default: an identifier is either derived from
its inputs, generated on purpose, or nil in a fixture.
All of them serialize transparently (a UUID string or a plain string) and
derive schemars::JsonSchema so they can appear in model-facing schemas.
Structs§
- Account
Id - Tenant identifier. Every lookup in the library is scoped by it.
- Attachment
Id - Identifier of an attachment supplied with a turn.
- Attempt
Id - Identifier of one attempt at an external effect, scoped to the outbox or the dispatcher, used to reconcile an unknown outcome (I15).
- BatchId
- Identifies one command batch (a group of envelopes committed under one
AtomicityScope). - BlockId
- Stable identifier of a response block within an assistant turn.
- CaseId
- Application-owned identifier of a workflow case (a trip, a traveler record…). Opaque to the library; never shown to the model.
- Case
Revision - Monotonic revision of a mutable case (spec §7, I13).
- Command
Id - Identifies one typed command envelope. Distinct from the idempotency key: two envelopes may share an idempotency key when a turn is replayed.
- Conversation
Id - Identifies one conversation (a chat thread) within an account.
- EventId
- Identifies one committed domain event in the claim ledger.
- Interaction
Id - Identifies one persisted interaction (card, confirmation, selection…).
- Model
Key - Stable key of a configured model, e.g.
"gpt-5.4". The configured identifier, not a marketing name. - Operation
Key - Key of a semantic operation offered to the interpreter, e.g.
"trip.set_travel_date". Only keys listed in the catalog of this turn may be used. - Option
Id - Identifier of a stored option on an interaction. The client echoes it back; the server derives its meaning from the stored option.
- Origin
Token - Server-issued token that a UI surface attaches to a turn to name the exact record it was opened from (spec §12.4).
- Outbox
Id - Identifies one outbox row for an external side effect.
- Provider
Key - Stable key of a configured model provider, e.g.
"openai". Never a credential and never a URL. - Question
Id - Stable identifier of a question within a turn (spec §19.1).
- Read
Request Id - Identifier the model assigns to a read request so results can be matched back to it.
- Read
Tool Key - Key of a read-only tool offered to the bounded read loop.
- Receipt
Id - Identifies one operational receipt derived from committed events.
- Redaction
Authority - Names the authority under which an event payload was erased, e.g. an
erasure ticket, a retention policy key or an operator identifier
(
EventRedaction). - Schema
Version - Version label of a model-facing schema (e.g. the interpreter output).
- Target
Token - Opaque token shown to the model instead of a raw case identifier. The
server owns the token →
CaseRefmapping. - TurnId
- Identifies one user turn. Every command, replay record and response block produced while handling the turn carries it.
- UserId
- Identifier of the authenticated user acting within an account.
- Workflow
Key - Stable key of a workflow definition, e.g.
"trip". - Workflow
Version - Version label of a workflow definition. Must change whenever projection semantics change (spec §8.4).