Skip to main content

Module debug

Module debug 

Source
Expand description

Debug mode: per-request policy-execution tracing and the plugin sandbox.

Policy development is otherwise blind — you can see the final response and aggregate metrics, but not the Context as it moves from node to node. This module records that walk.

  • trace — the Trace/NodeStep records and redacted snapshots.
  • diff — derives “what this plugin changed” from two snapshots.
  • store — resolved settings plus the bounded ring buffer.
  • sandbox — runs plugins or a named policy against a synthetic context.

Tracing is opt-in per request (a trigger header) and entirely off unless debug.enabled is set in system.yaml. When it is off the only cost on the request path is one Option check per node in the engine loop.

Re-exports§

pub use store::DebugState;
pub use store::TraceSummary;
pub use trace::CaptureOptions;
pub use trace::ContextSnapshot;
pub use trace::EdgeKind;
pub use trace::NodeStep;
pub use trace::PreviousBodies;
pub use trace::StepOutcome;
pub use trace::Trace;
pub use trace::TraceSource;

Modules§

diff
What a plugin changed, derived from two consecutive snapshots.
sandbox
The plugin sandbox: run plugins against a synthetic Context.
store
Debug settings and the bounded in-memory trace buffer.
trace
Trace records and context snapshots.

Structs§

TraceRecorder
Accumulates steps while the engine walks a graph.

Functions§

new_trace_id
A short, unique trace id.
now_ms
Unix milliseconds, saturating to 0 if the clock is before the epoch.