import type { CanonicalState, DerivedState, ReviewGateExpeditionState } from "../types/index.js"; import type { GatePolicy, Reviewer, ReviewDecisionType, AcceptanceDecisionType, RefinedIntent } from "./review-gates.js"; import type { EvaluationResult } from "./proposal-evaluation/types.js"; export type ReviewGateEngineEvent = { type: string; payload: Record; }; export type ReviewGateEngineResult = { state: ReviewGateExpeditionState; events: ReviewGateEngineEvent[]; }; /** Ensure a review-gate expedition record exists. */ export declare function ensureReviewGateExpedition(derivedState: DerivedState, expeditionId: string): ReviewGateExpeditionState; /** Approve a Refined Intent and bind it to the expedition. */ export declare function engineApproveRefinedIntent(current: ReviewGateExpeditionState | undefined, expeditionId: string, refinedIntentInput: Omit, reviewer: Reviewer, policy: GatePolicy): ReviewGateEngineResult; /** Mark implementation complete and open a Review Gate. * * Supports both the first review (expedition is `proposed`) and re-review * after a revision cycle (expedition is `executing`). */ export declare function engineOpenReviewGate(current: ReviewGateExpeditionState | undefined, expeditionId: string, implementationReference: string, policy: GatePolicy): ReviewGateEngineResult; /** Resolve a Review Gate with a decision. */ export declare function engineResolveReviewGate(current: ReviewGateExpeditionState, decisionType: ReviewDecisionType, reviewer: Reviewer, reason: string, evidence?: string[], affectedAssets?: string[], requiredChanges?: string[], evaluation?: EvaluationResult): ReviewGateEngineResult; /** Begin a revision after a Review Gate requested changes. */ export declare function engineRequestRevision(current: ReviewGateExpeditionState, gateId: string, reviewer: Reviewer, reason: string, evidence?: string[]): ReviewGateEngineResult; /** Open the Acceptance Gate after a successful Review Gate. */ export declare function engineOpenAcceptanceGate(current: ReviewGateExpeditionState, policy: GatePolicy): ReviewGateEngineResult; /** Resolve the Acceptance Gate. */ export declare function engineResolveAcceptanceGate(current: ReviewGateExpeditionState, decisionType: AcceptanceDecisionType, reviewer: Reviewer, reason: string, evidence?: string[], evaluation?: EvaluationResult): ReviewGateEngineResult; /** Close an accepted expedition. */ export declare function engineCloseExpedition(current: ReviewGateExpeditionState): ReviewGateEngineResult; /** Fulfill a condition on a review gate. */ export declare function engineFulfillCondition(current: ReviewGateExpeditionState, gateId: string, conditionId: string, fulfilledBy: string): ReviewGateEngineResult; /** Check whether an upstream expedition blocks downstream work. */ export declare function isBlockedByUpstreamGate(state: CanonicalState, derivedState: DerivedState, expeditionId: string): boolean;