/** * KHAELOR * File: src/phases/types.ts * Description: Phase-gate vocabulary — gate modes, gate config, defaults (v2 design §1). * * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai */ import type { DesignArtifact, Phase } from "../session/index.js"; export type { DesignArtifact, Phase }; /** * Gate rigor modes: * - "strict": three phases, human approval of every design artifact. * - "auto": the agent self-approves when the design touches ≤ maxFiles files (default). * - "off": v1 behavior — no gate. */ export type GateMode = "strict" | "auto" | "off"; export interface GateAutoApprove { /** Auto-approve designs touching at most this many files. */ maxFiles: number; } export interface GateConfig { mode: GateMode; autoApprove: GateAutoApprove; } export const DEFAULT_GATE_CONFIG: Readonly = Object.freeze({ mode: "auto" as GateMode, autoApprove: Object.freeze({ maxFiles: 3 }), }); /** Result of submitting a design artifact through the gate. */ export interface DesignDecision { status: "approved" | "rejected" | "pending"; artifactId: string; reason?: string; } /** Injected TUI panel callback for strict-mode design approval. */ export interface PhaseApprovalAsker { askDesign(artifactId: string, artifact: DesignArtifact): Promise<{ approved: boolean; reason?: string }>; } /** Structured error prefix the model learns to react to (prompt engineering by architecture). */ export const PHASE_GATE_BLOCKED = "PHASE_GATE_BLOCKED";