/** * #1567 composition: effect records link the operator decisions that * authorized them through `links.operatorDecisionEventId` and * `links.operatorDecisionRecordHash`. This module checks those links against * an operator-decision audit chain. It is read-only on both sides: there is * no write coupling between the ledger and the decision store. * * @see docs/contracts/effect-ledger.v1.md "Composition" * @see docs/contracts/operator-decision-audit.v1.md */ import type { EffectLedger } from './ledger.js'; import type { EffectLinks } from './types.js'; /** The two fields of an operator-decision record the links bind to. */ export interface DecisionEventRef { event_id: string; record_hash: string; } export type DecisionLinkFailureReason = 'decision-event-missing' | 'decision-record-hash-mismatch' | 'decision-record-hash-orphan'; export interface DecisionLinkFailure { reason: DecisionLinkFailureReason; writer: string; seq: number; effectId: string; operatorDecisionEventId?: string; } export interface DecisionLinkVerification { ok: boolean; /** Ledger records that carry an operator-decision link. */ linked: number; /** Distinct operator-decision events referenced. */ events: number; failures: DecisionLinkFailure[]; } /** The operator-decision links a ledger record carries, or null. */ export declare function decisionLinkOf(links: EffectLinks | undefined): { eventId?: string; recordHash?: string; } | null; /** * Check every operator-decision link in the ledger against `decisions`. A * linked event ID must exist; a linked record hash must equal that event's * `record_hash`; a record hash without an event ID is refused. The caller * verifies the decision chain itself (`verifyDecisionChain`). */ export declare function verifyDecisionLinks(ledger: EffectLedger, decisions: readonly DecisionEventRef[]): Promise; //# sourceMappingURL=decision-links.d.ts.map