Skip to main content

Module decision

Module decision 

Source
Expand description

Decision-model gate ([[gate]] decision, SPEC §8): TypeSafe’s Jev (POST {base_url}/v1/systemone) as a cheap external verifier — ~$0.042/M input tokens versus a frontier LLM-judge call. It asks one noul (probability-of-yes) question — “does the candidate response fully and correctly satisfy the request?” — and passes iff P(yes) >= threshold.

Reuses crate::prior’s HTTP/parsing posture (same provider, same endpoint family, same defensive-JSON stance) but plugs into the crate::gate::Gate trait exactly like crate::judge::JudgeGate — this is a verifier that can block serving, not a pre-generation cost hint.

Fail-safe, not fail-smart: a timeout, transport error, non-2xx response, or a reply this module cannot parse all ABSTAIN — never a fabricated Pass. Abstains are recorded through the same crate::gate::GateHealthRegistry error-budget path every other gate uses, plus a dedicated firstpass_decision_gate_errors_total counter.

Prompt-injection hygiene: the request and candidate response are carried only inside the state payload as DATA ({"request": ..., "response": ...}); instructions is a fixed (or operator-configured) string that never has request/candidate text interpolated into it, so a candidate that tries to talk the verifier into a pass cannot reach the instruction Jev actually follows.

Unmeasured: this gate’s precision/recall against real failures has not been benchmarked. Treat it as an unvalidated cheap pre-filter, not a drop-in replacement for judge.

Structs§

DecisionGate
A gate backed by TypeSafe’s Jev decision model.