import { type GoalSpec } from "../engine/goal-parser.js"; import { Findings, type BaseFinding, type ValidationResult } from "../util/validation.js"; /** * v1.3.7 §3.5 — static validation of a `goal.md`. Mirrors the other four * managers ({code, message, field} findings via the shared `Findings` * collector). `src/engine/**` is immutable, so this lives in `src/bot/` and * only *calls* `parseGoalFile` — the parser already throws `GoalParseError` * on structural/semantic shape issues; this wrapper turns that into a * non-throwing diagnostic and adds the extra static checks v1.3.6 §3.2 made * for skill/agent: metric provenance, pipeline agent existence, termination * presence, and a composite-vs-single Goodhart guardrail warning. * * Pure given the option callbacks (no fs unless `sourceExists` is supplied) so * it stays unit-testable like `validateCronDef`. */ export interface GoalFinding extends BaseFinding { goalId?: string; } export type GoalValidationResult = ValidationResult; export interface ValidateGoalOptions { /** Does the metric `source` resolve (file path / known URL)? Caller supplies. */ sourceExists?: (source: string) => boolean; /** Does the pipeline `/` resolve to a real workspace agent? */ agentExists?: (ref: string) => boolean; } /** Validate an already-parsed spec. Split out so tests can skip fs. */ export declare function validateGoalSpec(spec: GoalSpec, opts?: ValidateGoalOptions, f?: Findings): GoalValidationResult; /** Parse + validate a goal.md at `absPath`. Parse failure → single GOAL_PARSE error. */ export declare function validateGoalFile(absPath: string, opts?: ValidateGoalOptions): GoalValidationResult;