/** * `claim.ts` — a **recompute-verified claim** façade. * * One uniform call — `verifyClaim(claim) → ClaimVerdict` — over the package's * existing recompute engines, so any surface (a comment-box widget, a CI * check, an MCP tool) can render a single ✓/✗ plus a human-readable recompute * trace next to a claim, without knowing which engine adjudicated it. * * ## The honest boundary * * This verifies **only** claims that reduce to a *deterministic recomputation * over committed evidence* — never arbitrary prose. A claim is adjudicable iff * its value is the output of a pure function the caller can re-run from the * cited inputs: * * - `clearing` — re-run an auction's clearing from its SIGNED bid set and * check the receipt's price/winner (WASM kernel; the exact * `verify` / `recomputeClearing` path). * - `in_bounds` — re-run an agent run's capability verdict from its tool * trace + declared boundary (pure-node attestation engine). * - `signature` — authenticity only: Ed25519 + BLAKE3 root hash, no * value recompute. * * Anything NOT reducible to a recompute (e.g. "10k users downloaded this") * returns `verified: false` with an explicit `unsupported`/`reason` — it is * never silently passed. `eval_score` and `dataset_aggregate` are the planned * next kinds (see docs/RECOMPUTE-VERIFIED-CLAIMS.md); until wired they report * unsupported rather than faking a check. * * ## Proof-carrying numbers * * When a claim carries an `asserted` value (the number a human wrote in prose, * e.g. "cleared at 400000 µ$"), it is cross-checked against the recomputed * value. A receipt that is authentic but whose prose number was altered fails * (`verified: false`, `asserted.matched: false`) — the receipt can't lie, and * neither can the sentence quoting it. */ /** The closed set of recomputable claim kinds. */ export type ClaimKind = "clearing" | "in_bounds" | "signature" | "policy"; /** Evidence a claim is recomputed against. Shape depends on `kind`. */ export interface ClaimEvidence { /** * For `clearing` / `signature`: the auction receipt as a JSON **string** * (the hub's wire form). For `in_bounds`: the attestation receipt **object** * (as produced by `signReceipt` / returned from a tool-proxy run). */ receipt: string | Record; /** Pinned issuer JWKS JSON string. Required for `signature`; for `clearing` * it upgrades the check from recompute-only to recompute + signature. */ jwks?: string; /** `in_bounds`: pin the expected cryptographic principal / public key. */ expectPrincipal?: string; expectPublicKey?: string; /** `policy`: current time (unix seconds) for the cert freshness check. * Defaults to now. */ nowUnix?: number; /** `policy`: 64-hex context the cert must be bound to (request/edge hash). * Omit only to intentionally skip the binding check (fail-open). */ expectedContextHex?: string; } /** An author-asserted value to cross-check against the recompute. */ export interface ClaimAssertion { /** `clearing`: integer micro-USD price. `in_bounds`: boolean. */ value: number | boolean | string; } export interface Claim { /** Human-readable statement rendered next to the ✓/✗. */ statement: string; kind: ClaimKind; evidence: ClaimEvidence; /** Optional prose value to cross-check (proof-carrying numbers). */ asserted?: ClaimAssertion; } export interface ClaimTraceStep { check: string; ok: boolean; detail?: string; } export interface ClaimVerdict { /** The single boolean to gate the ✓/✗ on. */ verified: boolean; kind: ClaimKind; statement: string; /** What the recompute produced (kind-specific), or null on a hard error. */ recomputed: { label: string; value: unknown; } | null; /** The author's asserted value + whether it matched the recompute. */ asserted: { value: unknown; matched: boolean; } | null; /** Ordered, human-readable trace of the checks that ran. */ trace: ClaimTraceStep[]; /** First failing reason, or null when verified. */ reason: string | null; } /** * Adjudicate a claim by recomputation. Never throws — a malformed receipt, * an unknown kind, or an engine error surface as `verified: false` with a * `reason`, so the widget can always render a definite ✓/✗. */ export declare function verifyClaim(claim: Claim): Promise;