import Anthropic from '@anthropic-ai/sdk'; import type { Spec } from '@manehorizons/cadence-types'; import { type SpawnFn } from './host-cli-client.js'; /** * Phase 36.1 — spec-review verifier. Reviews the parsed SPEC (objective + * ACs + constraints + open questions) at `cadence spec approve` (run through * the Phase 35.1 convergence loop). Structural clone of `plan-review.ts`; * review-only (cadence is host-agnostic — no generator). */ export type SpecReviewSeverity = 'high' | 'medium' | 'low'; export interface SpecReviewFinding { severity: SpecReviewSeverity; message: string; suggestedEdit?: string; } export interface SpecReviewInput { spec: Spec; } export interface SpecReviewResult { pass: boolean; findings: SpecReviewFinding[]; provider: string; model?: string; } export interface SpecReviewVerifier { readonly name: string; verify(input: SpecReviewInput): Promise; } /** * Deterministic mock — passes iff the spec has a non-empty objective, ≥1 AC * with non-empty G/W/T, AND ≥1 constraint. Intentionally stricter than * MockPlanReviewVerifier (a spec without constraints is under-scoped). Each * defect is one HIGH finding. */ export declare class MockSpecReviewVerifier implements SpecReviewVerifier { readonly name = "mock"; verify(input: SpecReviewInput): Promise; } export interface AnthropicSpecReviewVerifierOptions { apiKey?: string; model?: string; maxTokens?: number; client?: Anthropic; } export declare class AnthropicSpecReviewVerifier implements SpecReviewVerifier { readonly name = "anthropic"; private readonly client; private readonly model; private readonly maxTokens; constructor(opts?: AnthropicSpecReviewVerifierOptions); verify(input: SpecReviewInput): Promise; } export interface LocalSpecReviewVerifierOptions { baseURL: string; model: string; transport?: typeof fetch; } export declare class LocalSpecReviewVerifier implements SpecReviewVerifier { private readonly o; readonly name = "local"; constructor(o: LocalSpecReviewVerifierOptions); verify(input: SpecReviewInput): Promise; } export interface HostCliSpecReviewVerifierOptions { /** 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 `LocalSpecReviewVerifier` — * same `SYSTEM_PROMPT`/`formatUserMessage`/`SpecReviewResponseSchema`, only * the transport differs. */ export declare class HostCliSpecReviewVerifier implements SpecReviewVerifier { private readonly o; readonly name = "host-cli"; constructor(o: HostCliSpecReviewVerifierOptions); verify(input: SpecReviewInput): Promise; } //# sourceMappingURL=spec-review.d.ts.map