SPB Git

spb/khaelor Public

KHAELOR — a terminal-native autonomous engineering agent powered by Anthropic.

TypeScript 82.9% HTML 14.9% CSS 1.1% JavaScript 0.7%
1.5 KB · 51 lines typescript
Raw Blame History
1/**2 * KHAELOR3 * File: src/phases/types.ts4 * Description: Phase-gate vocabulary — gate modes, gate config, defaults (v2 design §1).5 *6 * Author: Simon-Pierre Boucher7 * Contact: contact@spboucher.ai8 */910import type { DesignArtifact, Phase } from "../session/index.js";1112export type { DesignArtifact, Phase };1314/**15 * Gate rigor modes:16 * - "strict": three phases, human approval of every design artifact.17 * - "auto":   the agent self-approves when the design touches ≤ maxFiles files (default).18 * - "off":    v1 behavior — no gate.19 */20export type GateMode = "strict" | "auto" | "off";2122export interface GateAutoApprove {23  /** Auto-approve designs touching at most this many files. */24  maxFiles: number;25}2627export interface GateConfig {28  mode: GateMode;29  autoApprove: GateAutoApprove;30}3132export const DEFAULT_GATE_CONFIG: Readonly<GateConfig> = Object.freeze({33  mode: "auto" as GateMode,34  autoApprove: Object.freeze({ maxFiles: 3 }),35});3637/** Result of submitting a design artifact through the gate. */38export interface DesignDecision {39  status: "approved" | "rejected" | "pending";40  artifactId: string;41  reason?: string;42}4344/** Injected TUI panel callback for strict-mode design approval. */45export interface PhaseApprovalAsker {46  askDesign(artifactId: string, artifact: DesignArtifact): Promise<{ approved: boolean; reason?: string }>;47}4849/** Structured error prefix the model learns to react to (prompt engineering by architecture). */50export const PHASE_GATE_BLOCKED = "PHASE_GATE_BLOCKED";51