Expand description
The unified certificate contract (task #16).
Across the program a dozen independent analyses each emit a “certificate”:
the outer-optimum first-order self-audit ([CriterionCertificate]), the
sensitivity-coreset error budget ([CoresetCertificate]), the log-det
enclosure ([LogdetEnclosure]), the Kantorovich encode atlas
([EncodeResult]), the exact-orbit residual-gauge report, the dictionary
incoherence / global-optimality report, the structure-search collapse
events, and the topology evidence certification. Each grew its own struct,
its own verdict enum, and its own scattered payload key.
This module gives them ONE shared contract so a fit returns a single
inspectable certificate ledger — the program’s signature artifact. The
contract is the Certificate trait: every certificate states
- the CLAIM it certifies — a stable machine id plus a human sentence
(
Certificate::claim); - the EVIDENCE quantities behind the claim (
Certificate::evidence), as named scalars/flags/text; - a conservative VERDICT (
Certificate::verdict) drawn fromVerdict, in which certified-but-wrong is structurally impossible: the verdict can only STRENGTHEN as evidence accrues, the weakest state is the default, and there are explicitVerdict::Insufficient/Verdict::Unavailablestates so a missing or below-margin certificate never silently reads as “certified”.
Migration rule (task #16): the existing certificate types KEEP their math
unchanged; they merely implement Certificate. Their bespoke methods
(passes, certify_margin, decide_within_margin, is_certified, …) stay
as-is and the trait’s Certificate::verdict is defined in terms of them,
so there is exactly one source of truth for each verdict.
Structs§
- Certificate
Ledger - The fit’s certificate ledger: every certificate the fit produced, keyed by claim id, in stable order. This is the single inspectable artifact that replaces the scattered per-feature payload keys.
- Claim
- The claim a certificate makes: a stable machine id and a human sentence.
- Ledger
Entry - One certificate’s contribution to the ledger: its claim, evidence, and conservative verdict, frozen at the time the fit recorded it.
Enums§
- Evidence
Value - A single named evidence quantity behind a claim. Evidence is reported as typed values so the ledger is machine-inspectable, not just a string blob.
- Verdict
- The conservative verdict ladder shared by every certificate.
Traits§
- Certificate
- The shared contract every certificate in the program implements (task #16).
Type Aliases§
- Evidence
- The ordered set of evidence quantities behind a claim. Ordering is stable
(
BTreeMap) so payloads and snapshots are deterministic.