import type { IntegrityAnchor } from "@kontourai/surface"; import type { Candidate, CandidateSet, ClaimTarget, Extraction, RawSource, ReviewAuthorizing, ReviewOutcome } from "./types.js"; export declare const REVIEW_PROOF_SCHEMA = "survey.review-proof"; export declare const REVIEW_PROOF_SCHEMA_VERSION = 3; export declare const REVIEW_PROOF_PACKAGE_NAME = "@kontourai/survey"; export declare const REVIEW_PROOF_CONTRACT_VERSION = "3"; declare const LEGACY_REVIEW_PROOF_SCHEMA_VERSION = 1; declare const LEGACY_REVIEW_PROOF_CONTRACT_VERSION = "1"; declare const REVIEW_PROOF_SCHEMA_VERSION_V2 = 2; declare const REVIEW_PROOF_CONTRACT_VERSION_V2 = "2"; export interface ReviewProofInput { rawSource: RawSource; extraction: Extraction; candidate: Candidate; candidateSet: CandidateSet; reviewOutcome?: ReviewOutcome; claim: ClaimTarget; sourceRef?: string; observedAt?: string; metadata?: Record; } export interface CanonicalReviewProofPayloadV1 { schemaVersion: 1; proof: { schema: typeof REVIEW_PROOF_SCHEMA; schemaVersion: typeof LEGACY_REVIEW_PROOF_SCHEMA_VERSION; packageName: typeof REVIEW_PROOF_PACKAGE_NAME; packageVersion: typeof LEGACY_REVIEW_PROOF_CONTRACT_VERSION; issuer: string; producer: string; issuedAt: string; subject: { claimId: string; candidateSetId: string; candidateId?: string; subjectType: string; subjectId: string; facet: string; claimType: string; fieldOrBehavior: string; }; sourcePayload: { id: string; sourceRef: string; checksum?: string; }; }; rawSource: { id: string; kind: RawSource["kind"]; sourceRef: string; observedAt: string; fetchedAt?: string; checksum?: string; locatorScheme: RawSource["locatorScheme"]; }; extraction: { id: string; sourceId: string; target: string; value: unknown; confidence?: number; locator?: string; excerpt?: string; extractor: string; extractedAt: string; }; candidate: { id: string; extractionId: string; value: unknown; confidence?: number; sourceRank?: number; }; candidateSet: { id: string; target: string; candidateIds: string[]; selectedCandidateId?: string; status: CandidateSet["status"]; rationale?: string; }; reviewOutcome?: { id: string; candidateSetId: string; candidateId?: string; status: ReviewOutcome["status"]; actor?: string; reviewedAt?: string; rationale?: string; evidenceIds?: string[]; }; claim: { id: string; candidateSetId: string; candidateId?: string; subjectType: string; subjectId: string; facet: string; claimType: string; fieldOrBehavior: string; value?: unknown; status?: ClaimTarget["status"]; impactLevel: ClaimTarget["impactLevel"]; createdAt?: string; updatedAt?: string; evidenceType?: ClaimTarget["evidenceType"]; evidenceMethod?: ClaimTarget["evidenceMethod"]; confidenceBasis?: ClaimTarget["confidenceBasis"]; derivedFrom?: string[]; derivationEdges?: Array[number], "metadata">>; collectedBy: string; actor?: string; eventMethod?: string; }; } type CanonicalReviewAuthorizing = (Extract & { authorityRef?: never; }) | (Extract & { authorityRef?: never; }) | (Extract & { source?: never; }); export type CanonicalReviewProofPayloadV2 = Omit & { schemaVersion: 2; proof: Omit & { schemaVersion: typeof REVIEW_PROOF_SCHEMA_VERSION_V2; packageVersion: typeof REVIEW_PROOF_CONTRACT_VERSION_V2; }; reviewOutcome?: NonNullable & { authorizing?: CanonicalReviewAuthorizing; }; }; export type CanonicalReviewProofPayloadV3 = Omit & { schemaVersion: 3; proof: Omit & { schemaVersion: typeof REVIEW_PROOF_SCHEMA_VERSION; packageVersion: typeof REVIEW_PROOF_CONTRACT_VERSION; }; reviewOutcome?: NonNullable & { resolution?: ReviewOutcome["resolution"]; resolutionReason?: string; attemptEvidenceIds?: string[]; }; }; export type CanonicalReviewProofPayload = CanonicalReviewProofPayloadV1 | CanonicalReviewProofPayloadV2 | CanonicalReviewProofPayloadV3; export declare function buildCanonicalReviewProofPayload(input: ReviewProofInput): CanonicalReviewProofPayloadV3; export declare function canonicalReviewProofJson(payload: CanonicalReviewProofPayload): string; export declare function hashCanonicalReviewProofPayload(payload: CanonicalReviewProofPayload): string; /** * Verifies the integrity hash of a persisted v1, v2, or v3 canonical review proof. * Envelope compatibility and version-specific admissibility are checked before * the expected hash is compared. */ export declare function verifyCanonicalReviewProofPayload(payload: unknown, expectedHash: string): boolean; export declare function buildReviewProofAnchor(input: ReviewProofInput): IntegrityAnchor; export {};