Skip to main content

Module predictor

Module predictor 

Source
Expand description

Per-query gate-pass predictor (ADR 0008, Phase 2).

A hand-rolled online logistic regression that estimates P(gate-pass | rung, query features) — the per-query, per-rung success probability the start-rung bandit’s coarse context buckets can’t express. It is trained incrementally from the deployment’s own receipts (each attempt is a labeled example) and, in this phase, its prediction is recorded on the receipt in shadow — it never changes routing. Whether the prediction is good enough to act on is decided later, offline, via firstpass predictor-eval (AUC / Brier).

No ML/linalg dependency — the model is a weight vector and two closed-form updates. The feature encoding is fixed-length and deterministic so predictions are reproducible and the receipt is stable.

Structs§

PassPredictor
An online logistic-regression predictor of gate-pass probability.

Constants§

FEATURE_DIM
Fixed feature-vector length. Layout (see encode): [bias, task_kind×7, prompt_bucket_norm, has_tools, tool_count_norm, has_images, session_fail_norm, rung×8] = 1 + 7 + 1 + 1 + 1 + 1 + 1 + 8 = 21.

Functions§

encode
Encode (features, rung) into the fixed-length feature vector (see FEATURE_DIM).