export type RiskClass = "read-only" | "ordinary-reversible" | "human-required" | "protected"; export type ApprovalState = "Approved" | "ReviewPending" | "NeedsHuman"; export declare const APPROVAL_ACTION_KINDS: readonly ["read", "write", "adopt", "rebind", "recover", "rollback", "migration", "weakening", "permission-change", "protected"]; export type ApprovalActionKind = typeof APPROVAL_ACTION_KINDS[number]; export interface SemanticApprovalBinding { planHash: string; contextDigest: string; inputDigest: string; policyDigest: string; observedHash: string; actionDigest: string; } export interface SemanticApprovalPacket { schemaVersion: "semantic-approval/1.0"; kind: "semantic-approval"; planHash: string; inputHash: string; binding: SemanticApprovalBinding; producerIdentity: string; actions: Array<{ id: string; kind: ApprovalActionKind; summary: string; before: string; after: string; reversible: boolean; protected?: boolean; recovery: string; }>; risk: RiskClass; packetHash: string; } export interface ReviewerVerdict { schemaVersion: "reviewer-verdict/1.0"; packetHash: string; planHash: string; inputHash: string; reviewerIdentity: string; verdict: "approve" | "reject" | "needs-human"; reasonCodes: string[]; } export interface ReviewerAdapter { identity: string; review(packet: SemanticApprovalPacket, attempt: 1 | 2): ReviewerVerdict; } export interface ApprovalResult { state: ApprovalState; code?: "DG02_REVIEWER_CONFIGURATION_REQUIRED" | "REVIEWER_SELF_REVIEW" | "REVIEWER_INVALID" | "REVIEWER_REJECTED" | "REVIEWER_ATTEMPT_LIMIT" | "HUMAN_APPROVAL_REQUIRED"; packet: SemanticApprovalPacket; verdict?: ReviewerVerdict; } export declare function validSemanticApprovalPacket(packet: SemanticApprovalPacket): boolean; export declare function classifyRisk(actions: SemanticApprovalPacket["actions"]): RiskClass; export declare function createSemanticApprovalPacket(input: Omit & { binding: Omit; }): SemanticApprovalPacket; export declare function reviewSemanticApproval(args: { packet: SemanticApprovalPacket; adapter?: ReviewerAdapter; attempt?: 1 | 2 | 3; }): ApprovalResult; /** The mutation caller derives attempts from append-only history; callers cannot reset it. */ export declare function reviewSemanticApprovalWithHistory(args: { commonDir: string; packet: SemanticApprovalPacket; adapter?: ReviewerAdapter; }): ApprovalResult; //# sourceMappingURL=service.d.ts.map