import Anthropic from '@anthropic-ai/sdk'; import type { Draft } from '@manehorizons/cadence-types'; import { type SpawnFn } from './host-cli-client.js'; /** * Phase 25.1 — plan-review verifier. Reviews the parsed DRAFT (objective + * ACs + tasks) at `cadence draft approve` when `'plan-review'` is in the * effective gate set (strict×complex). `pass=false` refuses approve unless * `--allow-plan-review-failure`. Approve-time, not settle-time: there is no * diff and no SUMMARY yet — the input is the plan itself. */ export type PlanReviewSeverity = 'high' | 'medium' | 'low'; export interface PlanReviewFinding { severity: PlanReviewSeverity; message: string; /** Optional concrete edit the author could apply to resolve the finding. */ suggestedEdit?: string; } export interface PlanReviewInput { /** The parsed DRAFT being approved. */ draft: Draft; } export interface PlanReviewResult { pass: boolean; findings: PlanReviewFinding[]; provider: string; model?: string; } export interface PlanReviewVerifier { readonly name: string; verify(input: PlanReviewInput): Promise; } /** * Deterministic mock — passes iff the plan has ≥1 acceptance criterion and * every AC has non-empty trimmed given/when/then. Each defect is one HIGH * finding. Intentionally narrow: holistic plan judgment lives in the * Anthropic provider; the mock is the offline floor. */ export declare class MockPlanReviewVerifier implements PlanReviewVerifier { readonly name = "mock"; verify(input: PlanReviewInput): Promise; } export interface AnthropicPlanReviewVerifierOptions { apiKey?: string; model?: string; maxTokens?: number; /** Inject a client for tests; production callers should omit this. */ client?: Anthropic; } export declare class AnthropicPlanReviewVerifier implements PlanReviewVerifier { readonly name = "anthropic"; private readonly client; private readonly model; private readonly maxTokens; constructor(opts?: AnthropicPlanReviewVerifierOptions); verify(input: PlanReviewInput): Promise; } export interface LocalPlanReviewVerifierOptions { baseURL: string; model: string; transport?: typeof fetch; } export declare class LocalPlanReviewVerifier implements PlanReviewVerifier { private readonly o; readonly name = "local"; constructor(o: LocalPlanReviewVerifierOptions); verify(input: PlanReviewInput): Promise; } export interface HostCliPlanReviewVerifierOptions { /** Host CLI binary name or path, e.g. `"claude"` or `"codex"`. */ bin: string; model?: string; /** Inject a spawn implementation for tests; production callers should omit this. */ spawnImpl?: SpawnFn; } /** * Phase 191 — spawns the user's already-installed, already-authenticated * host CLI (`claude`/`codex`) in headless mode via `hostCliJSON` instead of * calling an HTTP endpoint. Structurally mirrors `LocalPlanReviewVerifier` — * same `SYSTEM_PROMPT`/`formatUserMessage`/`PlanReviewResponseSchema`, only * the transport differs. */ export declare class HostCliPlanReviewVerifier implements PlanReviewVerifier { private readonly o; readonly name = "host-cli"; constructor(o: HostCliPlanReviewVerifierOptions); verify(input: PlanReviewInput): Promise; } //# sourceMappingURL=plan-review.d.ts.map