Spectre.Journal.Recorder (Spectre v0.3.0)

Copy Markdown View Source

Builds, filters, and delivers observational journal records.

Journaling is disabled unless an agent, runtime call, or application config supplies a store. Asynchronous warning mode is the monitoring default; synchronous error mode is available when the host requires a journal append to succeed before the turn continues.

Summary

Functions

Records a privacy-safe operational event emitted by an optional extension.

Records a committed or ambiguous persistence boundary.

Records policy, lifecycle, and execution events carried by a runtime result.

Records the final routing/arbitration decision in a router context.

Functions

record_extension(agent, event, metadata, opts)

@spec record_extension(module(), atom(), map(), keyword()) :: :ok | {:error, term()}

Records a privacy-safe operational event emitted by an optional extension.

record_persistence(result, context)

@spec record_persistence(Spectre.Result.t(), Spectre.Context.t() | map()) ::
  {:ok, Spectre.Result.t()} | {:error, term()}

Records a committed or ambiguous persistence boundary.

record_result(result, context)

@spec record_result(Spectre.Result.t(), Spectre.Context.t() | map()) ::
  {:ok, Spectre.Result.t()} | {:error, term()}

Records policy, lifecycle, and execution events carried by a runtime result.

Records exclude effect arguments, action results, provider errors, input, and replies unless explicitly enabled. The result is returned unchanged.

record_routing(context)

@spec record_routing(Spectre.Router.Context.t()) ::
  {:ok, Spectre.Router.Context.t()} | {:error, term()}

Records the final routing/arbitration decision in a router context.

The returned context is unchanged. Only an explicit synchronous on_error: :error configuration can turn an append failure into a routing error.