/** * certify_provenance — a reproducible, content-addressed record of what a change DOES * (change: add-change-provenance-certificate). * * Supply-chain provenance (SLSA / in-toto / Sigstore) attests who/what produced a change; it does * not say what the change does to the code. This emits the missing SEMANTIC half: the structural * delta, blast radius, the paths the change opens into a declared surface, the specs it drifts, and * the tests that reach it — composed from `change_impact_certificate` (which already folds in * blast_radius) plus `structural_diff`. * * Two properties make it provenance rather than a briefing: * - REPRODUCIBLE + CONTENT-ADDRESSED: the predicate is serialized canonically (sorted keys) and * hashed (sha256), so any consumer can recompute it and verify the digest — the certificate is * checkable, not merely signed. * - PORTABLE: it is shaped as an in-toto predicate (stable `predicateType`) for attachment to the * repo's existing SLSA/in-toto attestation, or emitted as standalone JSON. * * OpenLore emits the document and performs NO signing (that stays with the repo's cosign/Sigstore * flow). A bad base is fatal (never a fallback certification). Boundaries are disclosed, so the * claim is a sound lower bound, never "safe". Sibling: `change_impact_certificate` briefs the * author's pending diff in-session; this emits the portable, recomputable attestation. */ import { type ImpactCertificate } from './impact-certificate.js'; /** Stable predicate type for the in-toto statement. */ export declare const PROVENANCE_PREDICATE_TYPE = "https://openlore.dev/change-provenance/v1"; export interface ChangeProvenanceInput { directory: string; baseRef?: string; change?: string; allowBaseFallback?: boolean; format?: 'in-toto' | 'json'; } interface StructuralSummary { addedFunctions: number; removedFunctions: number; signatureChanges: number; deprecatedCallsAdded: number; } /** * Deterministic JSON with lexicographically sorted object keys, so the digest is stable regardless * of key insertion order. Arrays keep their order (it is already deterministic upstream). */ export declare function canonicalJson(value: unknown): string; /** * Build the provenance predicate and its content-address digest from an impact certificate and the * structural delta. Pure — same inputs produce a byte-identical predicate and digest. */ export declare function buildProvenanceDocument(cert: ImpactCertificate, structural: StructuralSummary | { unavailable: string; }): { predicate: Record; digest: string; }; /** * Emit the semantic change-provenance certificate for a commit range. Returns a conclusion-shaped * object; a failed impact certificate (e.g. an unresolvable base) is returned as an error, never a * partial certification. */ export declare function handleCertifyProvenance(input: ChangeProvenanceInput): Promise>; export {}; //# sourceMappingURL=change-provenance.d.ts.map