/** Gate kinds in the intent-to-acceptance lifecycle. */ export type GateType = "refinement" | "review" | "acceptance"; /** Reviewer identity. */ export type Reviewer = { kind: ReviewerKind; id: string; }; /** Actor kinds that may resolve a gate. */ export type ReviewerKind = "human" | "ai" | "council" | "engine" | "asset_owner"; /** Quorum rule for multi-reviewer gates. */ export type QuorumRule = "all" | "any" | number; /** Policy controlling who may resolve a gate and how. */ export type GatePolicy = { reviewers: ReviewerKind[]; quorum: QuorumRule; excludeActors?: string[]; timeout?: number; revisionLimit?: number; autoAdvance?: boolean; }; /** Pre-defined policy templates for common cases. */ export declare const GATE_POLICIES: { automatic: () => GatePolicy; humanRequired: () => GatePolicy; aiRequired: () => GatePolicy; humanAndAi: () => GatePolicy; council: () => GatePolicy; }; /** Decision types for the Refinement Gate. */ export type RefinementDecisionType = "refined_intent" | "clarification_requested"; /** Decision types for the Review Gate. */ export type ReviewDecisionType = "approve" | "approve_with_conditions" | "revision_required" | "reject" | "supersede_expedition" | "split_expedition" | "merge_expedition" | "escalate_to_mission" | "escalate_to_program"; /** Decision types for the Acceptance Gate. */ export type AcceptanceDecisionType = "accepted" | "rejected"; /** Union of all gate decision types. */ export type GateDecisionType = RefinementDecisionType | ReviewDecisionType | AcceptanceDecisionType; /** Validity of a recorded decision. */ export type DecisionValidity = "valid" | "invalid" | "obsolete"; /** Current status of a gate instance. */ export type GateStatus = "pending" | "awaiting_review" | "approved" | "revision_requested" | "rejected" | "accepted" | "closed"; /** Expedition lifecycle status under review-gate governance. */ export type ReviewGateExpeditionStatus = "proposed" | "executing" | "implementation_complete" | "awaiting_review" | "revision_requested" | "approved" | "awaiting_acceptance" | "accepted" | "closed" | "rejected"; /** Refined Intent — canonical pre-Mission contract. */ export type RefinedIntent = { id: string; missionId: string; objective: string; scope: string; nonGoals: string[]; successCriteria: string[]; visualReferences: string[]; behavioralReferences: string[]; constraints: string[]; protectedAssets: string[]; acceptanceExamples: string[]; knownUnknowns: string[]; risks: string[]; approvedBy?: Reviewer; approvedAt?: number; version: number; }; /** Inputs consumed by a Review Gate. */ export type ReviewGateInputs = { refinedIntentId: string; implementationReference: string; divergenceReportId?: string; }; /** Outputs produced by a Review Gate. */ export type ReviewGateOutputs = { reviewPackageId: string; reviewDecisionId: string; }; /** Review Gate Package artifact. */ export type ReviewGatePackage = { id: string; gateId: string; expeditionId: string; refinedIntentId: string; implementationReference: string; knownDivergence: string[]; acceptedDivergence: string[]; rejectedDivergence: string[]; }; /** Replayable decision event produced by any gate. */ export type ReviewDecision = { id: string; gateId: string; gateType: GateType; expeditionId: string; decision: GateDecisionType; reason: string; affectedAssets: string[]; requiredChanges?: string[]; evidence: string[]; reviewer: Reviewer; validity: DecisionValidity; timestamp: number; }; /** Revision request artifact. */ export type RevisionRequest = { id: string; gateId: string; expeditionId: string; reason: string; evidence: string[]; reviewer: Reviewer; timestamp: number; }; /** A condition attached to an approve_with_conditions decision. */ export type ReviewCondition = { id: string; description: string; fulfilled: boolean; fulfilledBy?: string; fulfilledAt?: number; }; /** Acceptance Gate Package artifact. */ export type AcceptanceGatePackage = { id: string; gateId: string; expeditionId: string; reviewDecisionId: string; certificationEvidence: string[]; stakeholderApprovals: string[]; rolloutReadiness: string[]; }; /** Acceptance Record artifact. */ export type AcceptanceRecord = { id: string; gateId: string; expeditionId: string; decision: AcceptanceDecisionType; reviewer: Reviewer; timestamp: number; }; /** A gate instance — stateless checkpoint identified by ID. */ export type Gate = { id: string; gateType: GateType; expeditionId: string; policy: GatePolicy; status: GateStatus; inputs: string[]; outputs: string[]; reviewer?: Reviewer; decisionId?: string; parentGateId?: string; blocking: boolean; createdAt: number; resolvedAt?: number; conditions?: ReviewCondition[]; }; /** Expedition augmented with review-gate state. */ export type ReviewGateExpedition = { expeditionId: string; status: ReviewGateExpeditionStatus; gates: Gate[]; refinedIntentId?: string; reviewPackageId?: string; reviewDecisionId?: string; /** Persisted proposal-evaluation result that produced the review decision. */ evaluation?: import("./proposal-evaluation/types.js").EvaluationResult; acceptancePackageId?: string; acceptanceRecordId?: string; currentGateId?: string; }; /** Error thrown when a state transition is invalid. */ export declare class ReviewGateError extends Error { constructor(message: string); } import type { ConstructionContext } from "./intent-model.js"; /** Generate an id from a prefix, timestamp, and random suffix. */ export declare function makeId(prefix: string, timestamp?: number): string; /** Create a fresh expedition under review-gate governance. */ export declare function createReviewGateExpedition(expeditionId: string): ReviewGateExpedition; /** Create a gate instance. */ export declare function createGate(gateType: GateType, expeditionId: string, policy: GatePolicy, inputs?: string[], parentGateId?: string, ctx?: ConstructionContext): Gate; /** Begin executing an expedition. */ export declare function beginExecution(expedition: ReviewGateExpedition): ReviewGateExpedition; /** Mark implementation complete and open the Review Gate. */ export declare function completeImplementation(expedition: ReviewGateExpedition, implementationReference: string, policy?: GatePolicy, timestamp?: number): { expedition: ReviewGateExpedition; gate: Gate; reviewPackage: ReviewGatePackage; }; /** Resolve a Review Gate with a decision. */ export declare function resolveReviewGate(expedition: ReviewGateExpedition, decisionType: ReviewDecisionType, reviewer: Reviewer, reason: string, evidence?: string[], affectedAssets?: string[], requiredChanges?: string[], timestamp?: number): { expedition: ReviewGateExpedition; gate: Gate; decision: ReviewDecision; }; /** Begin a revision after a Review Gate requested changes. */ export declare function beginRevision(expedition: ReviewGateExpedition, gate: Gate, reviewer: Reviewer, reason: string, evidence?: string[], timestamp?: number): { expedition: ReviewGateExpedition; revisionRequest: RevisionRequest; }; /** Open the Acceptance Gate after a successful Review Gate. */ export declare function openAcceptanceGate(expedition: ReviewGateExpedition, reviewDecision: ReviewDecision, policy?: GatePolicy, timestamp?: number): { expedition: ReviewGateExpedition; gate: Gate; acceptancePackage: AcceptanceGatePackage; }; /** Resolve the Acceptance Gate. */ export declare function resolveAcceptanceGate(expedition: ReviewGateExpedition, decisionType: AcceptanceDecisionType, reviewer: Reviewer, reason: string, evidence?: string[], timestamp?: number): { expedition: ReviewGateExpedition; gate: Gate; record: AcceptanceRecord; decision: ReviewDecision; }; /** Check if all conditions on a gate are fulfilled. */ export declare function allConditionsFulfilled(gate: Gate): boolean; /** Close an accepted expedition. */ export declare function closeExpedition(expedition: ReviewGateExpedition): ReviewGateExpedition; /** Fulfill a condition on a gate. */ export declare function fulfillCondition(gate: Gate, conditionId: string, fulfilledBy: string, timestamp?: number): Gate; /** Create and approve a Refined Intent, opening a Refinement Gate. */ export declare function approveRefinedIntent(expedition: ReviewGateExpedition, refinedIntent: Omit, reviewer: Reviewer, policy?: GatePolicy, timestamp?: number): { expedition: ReviewGateExpedition; gate: Gate; refinedIntent: RefinedIntent; }; /** Mark a recorded decision as invalid or obsolete. */ export declare function invalidateDecision(expedition: ReviewGateExpedition, gateId: string, validity: Exclude, reason: string): ReviewGateExpedition; /** Check whether an upstream expedition blocks downstream work. */ export declare function blocksDownstream(expedition: ReviewGateExpedition): boolean;