Skip to main content

evaluate_gate_compiled_traced

Function evaluate_gate_compiled_traced 

Source
pub fn evaluate_gate_compiled_traced<F>(
    specs: &[Spec],
    bindings: &IndexMap<String, Value>,
    bc: &Program,
    new_tracer: F,
) -> GateVerdict
where F: Fn() -> Box<dyn Tracer>,
Expand description

Like evaluate_gate_compiled but additionally threads a caller-supplied tracer into every Vm the spec body spins up for SpecExpr::Call (#199).

new_tracer is called once per host-helper invocation and must produce a fresh Box<dyn Tracer> for each new Vm. Multiple tracers can share state — typically by closing over a [lex_trace::Handle] and cloning it inside the closure — so the resulting trace tree captures the spec body’s call graph (e.g. under_budget → projected_load + budget_total) alongside the rest of the agent’s run.

Existing callers of evaluate_gate / evaluate_gate_compiled stay unchanged; this is purely additive.