Skip to main content

Module threshold

Module threshold 

Source
Expand description

Data-driven Truth Gate threshold.

The hook can record every engine probability as a prediction trace (HIKMAH_HOOK_RECORD); a person or CI later records whether that completion claim was false (hikmah outcome --observed true means it was a false completion). MemoryStore::gate_threshold pairs the two and picks the threshold t (the engine blocks when p >= t) with the highest recall of false completions whose empirical false-block rate (blocked true completions / all true completions) stays within a budget. Ties in recall go to the higher threshold. Only observed probabilities are candidates, because the rates change only there.

This covers the engine path alone. The deterministic rules still block on their own, so the gate’s overall false-block rate can be higher by the rules’ own false blocks.

Structs§

GateThresholdReport
ThresholdPoint
The engine-path rates at one threshold.

Functions§

choose_threshold
Highest-recall threshold among the observed probabilities whose false-block rate is at most max_false_block; ties in recall go to fewer false blocks, then to the higher threshold. A threshold that catches no false completion only adds false blocks (turning the engine off does better), so it never qualifies. None when none qualifies.
rates_at
Rates at threshold t for (p, was_false_completion) points.
wilson_interval
Wilson score interval for k successes in n trials at normal quantile z.