adk_trace_store (erlang_adk v0.10.0)

View Source

Supervised bounded retention for metadata-only traces and workflow lifecycle events.

Every retained event belongs to an exact principal digest and to all applicable combinations of run, trace, workflow, and invocation identity. The raw principal is never retained. Cursors are store-global and strictly increasing; each identity stream remembers capacity/retention eviction long enough to return an explicit replay gap instead of silently presenting a partial history.

Summary

Functions

Non-blocking best-effort workflow adapter. Retention is diagnostic and must never turn a completed workflow into a failure. Oversized messages and unavailable or back-pressured stores are silently dropped; the store also rejects unknown capabilities without inspecting any caller principal.

Deliver an event while binding the capability lifetime to a local workflow owner. Active owners keep the capability valid even when a workflow is quiet for longer than the configured receiver TTL.

Validate the bounded descriptor shape. Authority is not inferred from this structural check: the receiving store verifies the unguessable capability against its private registry before accepting an event.

Build the only non-process workflow lifecycle receiver accepted by the workflow runtime. The store binds the authenticated principal digest to an unguessable, retention-bounded capability. The returned descriptor has no principal field, and workflow events cannot select or replace it.

Types

lifecycle_receiver/0

-opaque lifecycle_receiver()

Functions

append_lifecycle(Principal, Event)

append_lifecycle(Server, Principal, Event)

append_observability(Principal, Event)

append_observability(Server, Principal, Event)

child_spec(Options)

-spec child_spec(map()) -> supervisor:child_spec().

code_change(OldVersion, State, Extra)

deliver_lifecycle(Receiver, Event)

-spec deliver_lifecycle(lifecycle_receiver(), map()) -> ok.

Non-blocking best-effort workflow adapter. Retention is diagnostic and must never turn a completed workflow into a failure. Oversized messages and unavailable or back-pressured stores are silently dropped; the store also rejects unknown capabilities without inspecting any caller principal.

deliver_lifecycle(Receiver, Owner, Event)

-spec deliver_lifecycle(lifecycle_receiver(), pid() | undefined, map()) -> ok.

Deliver an event while binding the capability lifetime to a local workflow owner. Active owners keep the capability valid even when a workflow is quiet for longer than the configured receiver TTL.

format_status(Status)

handle_call(Request, From, State0)

handle_cast(Message, State0)

handle_info(Message, State0)

init(Options)

is_lifecycle_receiver(Receiver)

-spec is_lifecycle_receiver(term()) -> boolean().

Validate the bounded descriptor shape. Authority is not inferred from this structural check: the receiving store verifies the unguessable capability against its private registry before accepting an event.

lifecycle_receiver(Principal)

-spec lifecycle_receiver(binary()) -> {ok, lifecycle_receiver()} | {error, term()}.

Build the only non-process workflow lifecycle receiver accepted by the workflow runtime. The store binds the authenticated principal digest to an unguessable, retention-bounded capability. The returned descriptor has no principal field, and workflow events cannot select or replace it.

lifecycle_receiver(Server, Principal)

-spec lifecycle_receiver(gen_server:server_ref(), binary()) ->
                            {ok, lifecycle_receiver()} | {error, term()}.

principal_status(Principal)

principal_status(Server, Principal)

prune()

prune(Server)

query(Principal, Selector, Options)

query(Server, Principal, Selector, Options)

start_link()

-spec start_link() -> gen_server:start_ret().

start_link(Options)

-spec start_link(map()) -> gen_server:start_ret().

status()

status(Server)

terminate(Reason, State)