Expand description
Load, verify and apply decision certificates: decision-certificate.v1
(spec/decision-certificate.v1.md), decision-certificate.v1.1 (spec/decision-certificate.v1.1.md)
and decision-certificate.v1.2 (spec/decision-certificate.v1.2.md).
Verification canonicalises the JSON value exactly as received (RFC 8785, JCS), never a
re-serialised struct, so number formatting can’t drift from the issuer’s. The typed
Certificate is read from the same value afterwards, rejecting unknown fields.
A v1.2 certificate also stores the confidence histogram of its threshold split, so a consumer can
monitor without labels: Histogram::of bins a window of use-time confidences and
shift_score compares it with the stored one. The score is descriptive, a prompt to measure
again; it never shows that the bound holds or has failed.
probabilities applies a certificate’s calibration map to a case’s raw scores, for the map
kinds v1.2 defines (temperature and dr, MAP_KINDS).
Structs§
- Audit
- Band
- Calibration
Map - Certificate
- Every field is required;
Optionfields must be present (as null): a missing field is an error. - Histogram
- A test’s threshold-split cases per bin of
confidence_bins, and the cases the rule abstains on whatever the threshold (unscored, or above thecannot_tellcut). v1.2. - Issuer
- Rule
- Segment
- Shift
Score - Pearson’s chi-square test of homogeneity between the stored histogram and a window’s.
- Split
- Verified
- A certificate whose signature verified against a trusted key.
- Window
Enums§
Constants§
- ABSTAIN_
ALL abstain_belowthat abstains on every case (asdk calibratewrites it).- MAP_
KINDS - The kinds of calibration map v1.2 defines. A certificate may name another kind; it still verifies, and a consumer that does not apply that kind refuses it (spec v1.2 §4).
- MAX_
BINS - Most bins a
confidence_binsmay define. - SPEC
- The
specof a certificate produced by the v1 procedure. - SPECS
- Every
specthis verifier accepts. v1 and v1.1 have the same fields; v1.2 adds some. - SPEC_
V1_ 1 - The
specof a certificate produced by the v1.1 procedure (the per-test grid start). - SPEC_
V1_ 2 - The
specof a v1.2 certificate: v1.1’s procedure, plus the stored confidence histogram.
Functions§
- bin_of
- The bin of
confidence:iwithbins[i] <= confidence < bins[i + 1]; the last bin also holds - canonical
- The JCS bytes of a JSON value.
- certificate_
id - chi2_sf
- P(X >= x) for X ~ chi-square with
dfdegrees of freedom: the regularised upper incomplete gamma Q(df/2, x/2), by its series below a + 1 and its continued fraction above. 1 for df 0. - confidence
- A case’s confidence under
map: the largest of itsprobabilities. None when those are. - key_id
ed25519:+ the first 16 hex chars of SHA-256 of the raw public key.- probabilities
- The probabilities
mapgives a case’s raw scores, one per option in score order (spec v1.2 §1): - shift_
score - Compare a window’s histogram with the certificate’s (spec §4). The columns are the bins and the unscored count; columns empty in both are dropped. With an empty side or one column left there is nothing to compare: statistic 0, df 0, p-value 1. None when the bin counts differ.
- timestamp
- Parse the spec’s timestamp form,
YYYY-MM-DDTHH:MM:SSZ, and nothing else. - verify
- Verify
vagainstkeys(key id → base64url raw public key) and read it.