import { type PairedTaskOutcome } from './flywheel-sequential-evidence.js'; export declare const RECEIPT_SCHEMA = "ruflo.flywheel-receipt/v1"; export declare const RECEIPT_DOMAIN = "ruflo/flywheel-receipt/v1"; export declare const GENESIS_LEDGER_HEAD: string; export type VerificationKind = 'recomputed' | 'signature-verified' | 'trusted-assertion'; export type ProposerName = 'local' | 'darwin'; export interface ReceiptSignature { algorithm: 'ed25519'; domain: typeof RECEIPT_DOMAIN; publicKeyPem: string; signatureBase64: string; } export interface ResourceEvidence { p95LatencyMicros: number; costMicrosPerTask: number; tokensPerTask: number; failureRate: string; evaluationCostMicros: number; energyMicrojoules?: number; currency: string; } export interface PromotionStatistics { ruleVersion: 'ruflo.flywheel-gate/v1'; relativeLift: string; pairedBootstrapProbability: string; pairedBootstrapDeltaCILow95: string; frozenAnchorRegression: string; iterations: number; seedHex: string; significant: boolean; accepted: boolean; } export interface TermVerification { term: string; verification: VerificationKind; evidenceRef: string; attestor?: string; } export interface EvaluationEvidence { corpusRoles: { selectionTaskIds: string[]; promotionHoldoutTaskIds: string[]; guardTaskIds: string[]; }; verification: Record; canary: Record; } export interface FlywheelReceiptPayload { schemaVersion: typeof RECEIPT_SCHEMA; receiptId: string; lineageId: string; candidateId: string; evaluationRunId: string; baselineRef: string; expectedLedgerHead: string; candidatePolicy: Record; gateVersion: string; policySchemaVersion: string; safetyEnvelopeRef: string; /** Hash-pinned human relevance anchor used for this evaluation (#2840). */ anchorRef?: string; requestedProposer: 'auto' | ProposerName; effectiveProposer: ProposerName; proposerSubstitution?: string; corpusVersion: string; corpusHash: string; baselineScore: string; candidateScore: string; heldOutDeltas: string[]; /** * Task-level paired outcomes behind heldOutDeltas — same order, same length, * per-task delta reproducible from the two scores. Optional in the payload * so pre-existing receipts still verify byte-identically, but the promotion * authority (flywheel-transaction.ts) REQUIRES it by default: aggregate-only * evidence is refused rather than silently falling back to the weaker gate. */ pairedOutcomes?: Array<{ taskId: string; baselineScore: string; candidateScore: string; }>; statistics: PromotionStatistics; gates: Record; resourceEvidence: ResourceEvidence; evidence: EvaluationEvidence; termVerification: TermVerification[]; decision: 'accepted' | 'rejected'; issuedAt: string; expiresAt: string; } export interface FlywheelEvaluationReceipt { payload: FlywheelReceiptPayload; signature?: ReceiptSignature; } export interface CreateReceiptInput { lineageId?: string; evaluationRunId?: string; baselineRef: string; expectedLedgerHead?: string; candidatePolicy: Record; gateVersion?: string; policySchemaVersion?: string; safetyEnvelopeRef: string; anchorRef?: string; requestedProposer?: 'auto' | ProposerName; effectiveProposer?: ProposerName; proposerSubstitution?: string; corpusVersion: string; corpusHash: string; baselineScore: number; candidateScore: number; heldOutDeltas: number[]; /** Task-level paired outcomes behind heldOutDeltas (same order). */ pairedOutcomes?: PairedTaskOutcome[]; frozenAnchorRegression: number; gates: Record; resourceEvidence?: Partial; evidence?: EvaluationEvidence; termVerification?: TermVerification[]; now?: number; ttlMs?: number; privateKeyPem?: string; publicKeyPem?: string; bootstrapIterations?: number; } /** * RFC-8785-compatible for the JSON domain accepted above: ECMAScript primitive * serialization plus recursively sorted UTF-16 property names. */ export declare function canonicalizeJcs(value: unknown): string; export declare function sha256Ref(value: string | Buffer): string; export declare function policyCandidateId(policy: Record): string; /** UUIDv7 with a 48-bit millisecond timestamp and RFC-4122 variant bits. */ export declare function uuidV7(now?: number): string; export declare function computePromotionStatistics(input: { baselineScore: number; candidateScore: number; heldOutDeltas: number[]; frozenAnchorRegression: number; corpusHash: string; candidateId: string; baselineRef: string; evaluationRunId: string; iterations?: number; metricEpsilon?: number; }): PromotionStatistics; export declare function createFlywheelReceipt(input: CreateReceiptInput): FlywheelEvaluationReceipt; export interface ReceiptVerification { valid: boolean; signed: boolean; errors: string[]; } export declare function verifyFlywheelReceipt(receipt: FlywheelEvaluationReceipt, trustedPublicKeys?: Set): ReceiptVerification; //# sourceMappingURL=flywheel-receipt.d.ts.map