/** * v0.4 — `goal.md` parser. * * Per docs/plan/v0.4-autonomous-engine.md §4.1. `goal.md` is the *volatile * intent* file (Codex `/goal` analogue) — written by humans, never modified * by AI agents. Holds the 1-line goal, metrics with provenance, pipeline, * budgets, termination conditions, optional signal trigger, and an optional * narrowing of modifiable_paths (which is otherwise inherited from * `/AGENTS.md`). * * Guardrails (immutable_paths, external_side_effects, Output policies) are * NOT parsed here — they live in AGENTS.md and are loaded by * `agents-md-loader.ts`. Per v0.4 §4.2. */ export declare const GOAL_SCHEMA_VERSION = 1; export type MetricDirection = "maximize" | "minimize"; export type SignalAutoMode = "false" | "prompt" | "true"; export interface MetricSpec { name: string; formula: string; source: string; threshold: number; direction: MetricDirection; } export interface PipelineStep { /** "/" — e.g. "experience/desk-researcher". */ agent: string; task: string; } export interface CostBudget { per_cycle_usd: number; total_usd: number; } export interface TimeBudget { /** Either hours OR cycles must be set, not both. */ hours?: number; cycles?: number; } export interface SignalTrigger { /** false: alert only · prompt: ask user yes/no · true: auto-execute */ auto: SignalAutoMode; /** Keywords that signal-scan matches against to trigger this goal. */ match_keywords: string[]; } export interface GoalSpec { schema_version: number; goal_id: string; org: string; target_repo: string | null; cycle_unit: "pipeline_pass"; /** First H1 line — the "what are we doing" one-liner (Codex /goal style). */ title: string; /** Optional 1-3 lines beneath the H1 (Acceptance / Stop rule). */ preamble: string; metrics: MetricSpec[]; pipeline: PipelineStep[]; time_budget: TimeBudget; cost_budget: CostBudget; termination_conditions: string[]; signal_trigger: SignalTrigger; /** * Optional goal-specific narrowing of modifiable_paths. Final modifiable * paths = (AGENTS.md.modifiable_paths) ∩ (goal.md.modifiable_paths_override) * computed by `guards.ts`. Empty/undefined means "use AGENTS.md defaults". */ modifiable_paths_override?: string[]; /** Absolute path of the goal.md that was parsed (forensic). */ source_path: string; } export declare class GoalParseError extends Error { readonly path?: string | undefined; constructor(message: string, path?: string | undefined); } export declare function parseGoalFile(absPath: string): GoalSpec; export declare function parseGoal(raw: string, sourcePath: string): GoalSpec;