Stable logical identity of a Spectre Agent.
An Agent reference is process-, node-, Definition-, and Stack-independent.
The compiled module, declared Definition version, and Stack digest are kept
only as resolver hints for the 0.2 boundary; they never participate in the
stable key. legacy_key/1 exposes the former key explicitly so a
Checkpoint Store can perform a controlled migration instead of silently
creating or merging Instances.
Summary
Functions
Restores a stable AgentRef without creating atoms from persisted data.
Builds a stable reference from a portable logical id.
Returns the stable opaque key used by Instance routing and storage.
Returns the pre-0.2.3 key when the resolver hints needed to reproduce it are present.
Builds a stable logical reference from an Agent module or returns an existing reference.
Returns the current stable AgentRef schema version.
Returns the portable stable identity without making source hints authoritative.
Types
@type t() :: %Spectre.AgentRef{ definition: module() | nil, id: String.t(), schema_version: pos_integer(), stack_digest: String.t() | nil, version: pos_integer() | nil }
Functions
Restores a stable AgentRef without creating atoms from persisted data.
Builds a stable reference from a portable logical id.
This is the durable boundary form. :definition, :version, and
:stack_digest may be supplied as trusted resolver hints but are not
required to route the identity.
Returns the stable opaque key used by Instance routing and storage.
Returns the pre-0.2.3 key when the resolver hints needed to reproduce it are present.
The legacy key is never selected automatically as the current identity. It exists only for explicit Checkpoint Store migration.
Builds a stable logical reference from an Agent module or returns an existing reference.
The optional :id distinguishes intentionally separate logical Agents
that use the same compiled source. Definition and Stack fields are resolver
hints only and can change without changing key/1.
@spec schema_version() :: pos_integer()
Returns the current stable AgentRef schema version.
Returns the portable stable identity without making source hints authoritative.