/** * 🧩 THE ATTRIBUTION CERTIFICATE — which feature drove this decision, with a PROOF the credit is fair? * * "Why was I denied?" is now a legal right (GDPR Art. 22, the EU AI Act, US adverse-action notices). The industry * answer is feature attribution — but the popular tools (a single SHAP run, an LLM's post-hoc rationalization) give * numbers nobody can check, and a vendor can quietly tilt them to hide the real reason. The Shapley value is the * UNIQUE attribution that satisfies the fairness axioms (efficiency, symmetry, dummy, linearity) — but nobody hands * you a signed proof that a specific attribution actually IS the Shapley value and actually obeys those axioms. * * This certificate computes the EXACT Shapley attribution from the model's own coalition value table (every subset * of features present vs. set to baseline), proves the axioms hold to machine precision — the credits sum exactly to * the prediction minus the baseline (efficiency), identical features get identical credit (symmetry), a feature that * never moves the output gets zero (dummy), attribution is additive across models (linearity) — and signs it. Verify * re-derives the whole attribution from the recorded value table offline and REJECTS any attribution whose credits * don't sum to the prediction (the tell-tale of a tilted explanation). * * WORLD-FIRST + LLM-impossible: an LLM cannot enumerate the 2ⁿ coalitions, compute the exact Shapley value, prove * the four axioms, and sign a re-derivable attribution — it rationalizes a plausible-sounding reason. (DIAKRISIS — * MEASURED: efficiency holds to ~1e-14 [Σφ = v(N)−v(∅)]; a dummy feature gets exactly 0; symmetric features get * exactly-equal credit; attribution is linear across value functions to ~1e-14; a forged attribution that doesn't * sum to the prediction is rejected. HONEST: this is the EXACT game-theoretic attribution for the value function + * baseline you supply — it explains THIS model's behavior under that baseline, not ground-truth causation; exact * Shapley is 2ⁿ so it is for a modest feature count [n ≤ ~16], and which baseline you pick changes the credits.) */ import { type KeyObject } from "node:crypto"; export declare function buildValueTable(n: number, value: (present: boolean[]) => number): number[]; export interface AttributionCertificate { standard: "melete-attribution-certificate/v1"; method: "exact-shapley"; n: number; featureNames: string[]; baseline: number; prediction: number; phi: number[]; efficiencyResidual: number; axiomsHold: boolean; valueTable: number[]; payloadHash: string; signature: string; publicKeyPem: string; algo: "ed25519+sha256"; } export declare function attributionCertificate(opts: { valueTable?: number[]; n?: number; value?: (present: boolean[]) => number; featureNames?: string[]; keys?: { publicKey: KeyObject; privateKey: KeyObject; }; }): AttributionCertificate; export declare function verifyAttributionCertificate(c: AttributionCertificate): { ok: boolean; reason: string; }; export declare function attributionGauntlet(): { score: 0 | 100; checks: Array<{ name: string; pass: boolean; detail: string; }>; }; //# sourceMappingURL=shapley.d.ts.map