Skip to main content

Module trace

Module trace 

Source
Expand description

The audit trace (SPEC §9.1) — the tamper-evident record of one routing decision.

A trace captures why a request went where it did and what it cost: the features it was routed on, every attempt and its gate verdicts, the final served outcome, and the savings versus always calling the top rung. Each record links to the previous via Trace::prev_hash (see crate::hashchain), so the log is append-only and any tampering is detectable.

The serde field names in this module are the wire/audit contract. External auditors parse them and re-derive the hash chain; renaming one is a breaking change that requires a schema/version bump, never a silent edit.

Structs§

Attempt
One attempt at a rung: the model call plus the gates run against its output.
DeferredVerdict
A verdict that arrived after the response was served (deferred gate or downstream feedback).
FinalOutcome
The final outcome and economics of a decision.
PolicyRef
Reference to the policy that produced a decision.
RequestInfo
The routed request, described without its raw content.
Trace
A single routing decision, start to finish.

Enums§

ServedFrom
Where the served response came from.