Skip to main content

Module identity

Module identity 

Source
Expand description

Flow-local, typed identities used by pairwise protocol transforms.

This module deliberately contains no wire types. A converter gives it a source dialect, a role and a logical position, and gets back an immutable target identifier. The same flow can then attach source identifiers that arrive in a later stream event without changing the identifier already emitted to a client.

Structs§

CallResultLink
IdNamespace
A caller-owned 128-bit namespace. Supplying it explicitly makes generated ids deterministic in tests and lets an adapter define invocation scope.
IdentityFlow
Flow-local identity map. It must be created for each invocation; it does not contain process-global state or random number generation.
IdentityHandle
An immutable identity allocated within one invocation/stream flow.
IdentityStateRecord
The only identity facts allowed to cross a request boundary.
IdentityStateSnapshot
IdentityStateStore
Adapter-neutral persistence helper over the protocol’s scoped CAS store.
IdentityTarget
Target semantics are persisted with an identity record. A record from a different model or target dialect cannot be restored into a new flow.
LateIdentityFacts
Fields that may be learned after the first stream event. Existing values are immutable; a contradictory late fact is rejected.
OpaqueSignature
A declared opaque signature can be restored only for its original origin, model and field. It is intentionally just a small token, never a wire DTO.
SourceIdentity
A source identity. logical_index is mandatory even when an upstream id exists: it makes same-name or missing-id repetitions explicit.
TargetIdPolicy
Target validation used before preserving an upstream id or emitting a generated id. Wire adapters can tighten this for a particular target.

Enums§

IdSyntax
A target-specific syntax restriction, used only when supported by the target contract. No vendor-wide character restriction is assumed by default.
IdentityError
Errors from flow identity allocation and scoped identity persistence.
IdentityRole
IdentityRoleName
String form of a role keeps errors independent of future role additions.
KnownIdPrefix
Prefix conventions used when generating ids, not universal input validators. Sources: samples/codex/codex-rs/protocol/src/models.rs id_prefix(); upstream_docs OpenAI Responses examples and Claude tool_use examples. Existing legal ids are not rejected just for lacking these prefixes. Exact prefixes used by known wire ids. Matching is boundary-aware: call_foo is recognized while callback is not.
OpaqueField
The exact declared upstream field that owns an opaque value. A matching origin/model does not permit moving bytes between these fields.
OutputItemKind

Type Aliases§

DialectId
Identity is bound to the protocol’s stable, serializable dialect enum.