adk_plugin_pipeline (erlang_adk v0.7.0)

View Source

Compiled, ordered execution pipeline for Runner-global plugins.

Pipelines are immutable values and therefore cheap to keep in a Runner. Each callback executes in its own monitored lightweight process with a deadline and maximum heap. A callback can never block or exhaust the invocation process indefinitely.

Summary

Functions

Compile plugin descriptors in strict list order.

Return JSON-safe configuration metadata without module configuration.

Run one lifecycle hook through every configured plugin.

Types

outcome/0

-type outcome() ::
          {continue, term(), [trace_entry()]} |
          {amend, term(), [trace_entry()]} |
          {return, term(), [trace_entry()]} |
          {halt, term(), [trace_entry()]} |
          {error, term(), [trace_entry()]}.

pipeline/0

-opaque pipeline()

trace_entry/0

-type trace_entry() :: map().

Functions

compile(Plugins)

-spec compile([map()]) -> {ok, pipeline()} | {error, term()}.

Compile plugin descriptors in strict list order.

A descriptor has a binary id, an already-existing module atom, and may set mode (observe or intervene), failure_policy (open or closed), timeout_ms, max_heap_words, and config. No string or binary is ever converted to a module atom.

compile(Plugins, Defaults)

-spec compile([map()], map()) -> {ok, pipeline()} | {error, term()}.

describe(_)

-spec describe(pipeline()) -> map().

Return JSON-safe configuration metadata without module configuration.

run(Pipeline, Hook, Context0, Value)

-spec run(pipeline(), adk_plugin:hook(), map(), term()) -> outcome().

Run one lifecycle hook through every configured plugin.

The trace contains only bounded structural status, never callback values or exception text. Fail-open failures are recorded and execution continues; fail-closed failures stop with a typed, secret-free error.