import { type Trajectory } from "./parser.js";
export interface ValidationError {
    rule: "trajectory-presence" | "cross-reference-integrity" | "temporal-coherence" | "deferred-completeness" | "rationale-completeness";
    message: string;
    /** The rough line number in the impl body, if known. */
    line?: number;
}
export interface ValidateTrajectoryOptions {
    /**
     * When true, also enforce `### Trajectory Rationale` completeness — every
     * trajectory T-ID must appear as a `- **TN**` entry in the subsection,
     * and the subsection must not contain entries for IDs missing from the
     * trajectory table. Mirrors the JS hook's `rationale: required` frontmatter
     * check at apps/indusk-mcp/hooks/validate-impl-structure.js.
     */
    rationaleRequired?: boolean;
    /**
     * The phase number that counts as "writable today against the current stack."
     * Trajectory rows whose `Writable at` is ≤ baseline are exempt from the
     * rationale-completeness rule. Defaults to 0 (the original behavior:
     * Phase 0 rows are exempt). Plans where Phase 1 IS the enabling work
     * (refactors, schema migrations, scaffolding) set this to 1 so rows
     * authored at Phase 1 don't require justification entries.
     */
    rationaleBaseline?: number;
}
/**
 * Rule 1: Every impl document must have a `## Test Trajectory` section.
 */
export declare function validateTrajectoryPresence(body: string): ValidationError[];
/**
 * Rule 2: Every test ID referenced in a phase Verification block must exist
 * in the Trajectory table. Phases with no test-ID references must declare
 * `(no tests flip at this phase — reason: {allowed-reason})`.
 */
export declare function validateCrossReferenceIntegrity(body: string, trajectory: Trajectory): ValidationError[];
/**
 * Rule 3: For every Trajectory row, the phase number in `Writable at` must
 * be ≤ the phase number in `Passes at`. A test cannot pass before its
 * dependencies exist. Also catches NaN from malformed `Phase N` references.
 */
export declare function validateTemporalCoherence(trajectory: Trajectory): ValidationError[];
/**
 * Rule 4: Every Deferred Verification row must have non-empty `reason:`,
 * `would require:`, and `mitigation:` fields. The mitigation field is the
 * compensating control — without it, deferring a test means flying blind.
 */
export declare function validateDeferredCompleteness(trajectory: Trajectory): ValidationError[];
/**
 * Rule 5: When the impl frontmatter sets `rationale: required`, every
 * trajectory row whose `Writable at` is later than the configured baseline
 * (default Phase 0) must have an entry in the `### Trajectory Rationale`
 * subsection.
 *
 * The baseline names the phase that counts as "writable today against the
 * current stack" for this plan. Default 0 — Phase 0 rows are exempt because
 * they're writable before any plan code lands. Plans where Phase 1 IS the
 * enabling work (refactors, schema migrations, scaffolding) can declare
 * `rationale_baseline: 1` in frontmatter so Phase 1 rows are exempt too.
 *
 * If no row needs a rationale (every row is ≤ baseline), the subsection
 * itself is optional. If any row is later than baseline, the subsection
 * must exist and contain an entry for every such row. Stale entries
 * (entries for IDs not in the trajectory) are always flagged.
 *
 * Mirrors `validateRationaleCompleteness` in
 * `.claude/hooks/validate-impl-structure.js`.
 */
export declare function validateRationaleCompleteness(body: string, trajectory: Trajectory, options?: {
    baseline?: number;
}): ValidationError[];
/**
 * Run all trajectory validation rules against an impl body. The body is the
 * markdown content after the frontmatter — pass the output of `gray-matter`
 * or equivalent. Returns combined errors; empty array means the trajectory
 * is valid. Pass `{ rationaleRequired: true }` to additionally enforce
 * `### Trajectory Rationale` completeness (mirrors the JS hook's check on
 * `rationale: required` in frontmatter).
 */
export declare function validateTrajectory(body: string, options?: ValidateTrajectoryOptions): ValidationError[];
