/** * Abstract interface for the `--deep` independent verifier. Implementations * read AC text + relevant code + tests and return a per-AC pass/fail verdict * with reasoning. Selection is config-driven (see `selectVerifier`). */ import { type SpawnFn } from './host-cli-client.js'; export interface VerifyAc { /** Stable AC id, e.g. "AC-1". */ id: string; /** Human-readable Given clause from the DRAFT. */ given: string; /** Human-readable When clause. */ when: string; /** Human-readable Then clause — the actual outcome to verify. */ then: string; } export interface VerifyTestRef { /** Path relative to repoRoot, forward-slashed. */ file: string; /** 1-based line where the AC token appeared. */ line: number; /** Trimmed snippet of the matching test line. */ snippet: string; /** Assertion mode only: true when the ref is inside a qualifying span. */ qualifying?: boolean; /** Assertion mode only: true when the ref falls inside a skip/todo/failing span. */ skipped?: boolean; } export interface VerifyInput { /** ACs to verify. */ acs: VerifyAc[]; /** Map of AC id → linked test refs (from `scanTestCoverage`). */ tests: Record; /** Optional unified diff of code changes for the phase. May be empty. */ diff: string; /** Optional list of touched source files (for context). May be empty. */ files: string[]; } export interface AcVerdict { pass: boolean; /** Short, human-readable reason (≤ 200 chars). */ reason: string; } /** * Phase 73: token usage from a real LLM provider, when it reports one. Cost in * dollars is intentionally NOT derived here — no price table to rot (v1.15 * scope guard). The `mock` provider never sets this. */ export interface VerifyUsage { inputTokens: number; outputTokens: number; } export interface VerifyResult { /** Per-AC verdicts keyed by AC id. */ verdicts: Record; /** Provider name (e.g. "mock", "anthropic"). Stamped into SUMMARY. */ provider: string; /** Optional model name when the provider is an LLM. */ model?: string; /** Phase 73: token usage when the provider reports it. Omitted otherwise. */ usage?: VerifyUsage; } /** * Verifiers must be safe to call without I/O setup beyond what the * constructor accepts. Implementations should *not* throw on per-AC verdict * failures — failed verdicts go in `result.verdicts[id].pass = false`. * Throwing is reserved for transport errors (network, malformed response). */ export interface Verifier { readonly name: string; verify(input: VerifyInput, opts?: { signal?: AbortSignal; traceId?: string; }): Promise; } export interface LocalVerifierOptions { baseURL: string; model: string; transport?: typeof fetch; /** Phase 72: extra HTTP headers (e.g. an Authorization bearer). Never logged. */ headers?: Record; } export declare class LocalVerifier implements Verifier { private readonly o; readonly name = "local"; constructor(o: LocalVerifierOptions); verify(input: VerifyInput, opts?: { signal?: AbortSignal; traceId?: string; }): Promise; } export interface HostCliVerifierOptions { /** 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 `LocalVerifier` — same * empty-ACs early return, `{signal, traceId}` opts threading, * `SYSTEM_PROMPT`/`formatUserMessage`/`VerifierResponseSchema` (imported from * `anthropic-verifier.ts`, same as `LocalVerifier`). `hostCliJSON` does not * report token usage, so `usage` is correctly never set here — unlike * `LocalVerifier`, this is not a gap, just an honest omission matching what * the transport actually reports. */ export declare class HostCliVerifier implements Verifier { private readonly o; readonly name = "host-cli"; constructor(o: HostCliVerifierOptions); verify(input: VerifyInput, opts?: { signal?: AbortSignal; traceId?: string; }): Promise; } //# sourceMappingURL=verifier.d.ts.map