3 Commits
Author SHA1 Message Date
zeekayandHanzo Dev b3ed9327df calibrate: pool tied scores, and bind a map to a shape before it can be read
Two defects in the same value.

TIES. A decision score is 1 - prod(1-weight) over a fixed set of rule
weights, rounded to four places, so the score alphabet is a handful of
atoms and the modal atom is exactly zero. pava ran over individual
samples, and a run of unproductive-then-productive at one score is
already non-decreasing — so nothing merged, every sample stayed its own
block, and the dedup that followed kept the MAX of two blocks sharing a
centroid. Every plateau holding a positive was reported as certainty, at
the top of the range where declines happen. Ties are now pooled into one
block per distinct score before the algorithm starts, which is what makes
the answer isotonic regression; a rounding collision between two
centroids pools rather than picks.

THE SHAPE GATE. P(score, shape) let the caller supply the value being
compared, and every internal call site supplied m.Shape — so the
training-serving skew control was trivially satisfied everywhere except
the one place a live shape was threaded in. Reading is now impossible
without Under(shape), which returns a Reader: the gate is at the bind,
where the current shape is a fact the server observed, and every
consumer downstream holds a value for which the question is already
answered and has no shape to pass. Reliability draws no chart for a
reader that cannot answer.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-01 18:08:46 -07:00
zeekayandHanzo Dev 5a75cfcfe0 cost: a price that cannot be multiplied is refused, and a curve is a chart
Two arithmetic facts the money path was relying on and neither was true.

A stated price is multiplied by a COUNT and summed in int64. At the volumes
this plane measures, a price above about ninety-two thousand units wraps —
and a wrapped cost does not surface as an error. It surfaces as the minimum
of the sweep, which is returned as the threshold to adopt. policy refuses
such a price at the door, where the caller-supplied number arrives, and
evaluate refuses it again in the arithmetic rather than trusting it was
called correctly: a policy sealed before the bound existed reads back
through the same path. The cost then goes ABSENT with a refusal, and the
rank statistics, which never touch a price, are unaffected.

Curve returned one point per distinct score with no bound — fifty thousand
points on a full history, a megabyte no browser plots. The sweep still runs
over every distinct score and the metrics behind it are unchanged; what is
RETURNED is an evenly spaced subsequence keeping both ends, so the shape,
the extremes and the monotonicity survive. Truncating would have cut the
curve off at one end and described a model that stops. It is the argument
Listed already makes about Moved, applied to the other rendering.

Both are mutation-proven: reintroduce the wrap or drop the sampling and the
test that names it goes red.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-01 18:08:46 -07:00
zeekayandHanzo Dev 851643291e scoring: a score means a probability, and a decision says why
Four packages, each one concept, all base-free and linkable from the
decision path:

reason     the closed vocabulary an adverse decision is defended with,
           DERIVED from anomaly.Inventory rather than declared beside it,
           so it cannot describe a model that is not there. Ranked by the
           model's own counterfactual share, never a surrogate.
calibrate  isotonic (pool-adjacent-violators, exact) and Platt, turning a
           density into a probability. Every map records the model shape it
           was fitted under and REFUSES to answer under another, which is
           the training-serving skew control: a calibration cannot outlive
           the coordinates it describes.
policy     the ladder from probability to action, as an immutable value
           with a digest over what it DECIDES. Action names stay opaque
           here so the vocabulary lives at the wire, in one place.
evaluate   the imbalanced-data metrics — ROC-AUC by midranks, average
           precision by the step definition, prevalence always beside
           both, and a cost in exact int64 nano-units with the
           cost-minimising threshold. Plus the deterministic replay of a
           candidate over recorded history, and a two-arm learning curve
           over a FIXED later window so two steps are comparable.

Accuracy is not computed. On a one-in-a-thousand stream it is not a weak
metric, it is a misleading one.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-01 18:08:46 -07:00