import Anthropic from '@anthropic-ai/sdk'; import { type SpawnFn } from './host-cli-client.js'; /** * Phase 24.2 — per-task verifier. Sibling to the Phase 15 `Verifier` for * `--deep` AC review; this one runs at `cadence build task --status=DONE` * against a single task's files+diff and returns a 3-way verdict. */ export type PerTaskVerdict = 'pass' | 'concerns' | 'refuse'; export interface PerTaskInput { /** Task id from the DRAFT, e.g. "T1". */ taskId: string; /** Files declared on the task in the DRAFT. */ files: string[]; /** `git diff HEAD -- ` output, or empty when nothing changed. */ diff: string; } export interface PerTaskResult { verdict: PerTaskVerdict; /** Short, human-readable reason (≤ 200 chars). */ reason: string; /** Provider name (e.g. "mock", "anthropic"). */ provider: string; /** Optional model name when the provider is an LLM. */ model?: string; } export interface PerTaskVerifier { readonly name: string; verify(input: PerTaskInput): Promise; } /** * Deterministic mock provider. Rule: * files empty → 'refuse' ("no files touched") * diff empty → 'concerns' ("no diff since last task") * otherwise → 'pass' * * Mirrors the Phase 15 MockVerifier philosophy — a deterministic floor that * lets CI exercise the wiring without an API key. Real per-task verifiers * read the diff and apply behavioral judgment. */ export declare class MockPerTaskVerifier implements PerTaskVerifier { readonly name = "mock"; verify(input: PerTaskInput): Promise; } export interface AnthropicPerTaskVerifierOptions { apiKey?: string; model?: string; maxTokens?: number; /** Inject a client for tests; production callers should omit this. */ client?: Anthropic; } export declare class AnthropicPerTaskVerifier implements PerTaskVerifier { readonly name = "anthropic"; private readonly client; private readonly model; private readonly maxTokens; constructor(opts?: AnthropicPerTaskVerifierOptions); verify(input: PerTaskInput): Promise; } export interface LocalPerTaskVerifierOptions { baseURL: string; model: string; transport?: typeof fetch; } export declare class LocalPerTaskVerifier implements PerTaskVerifier { private readonly o; readonly name = "local"; constructor(o: LocalPerTaskVerifierOptions); verify(input: PerTaskInput): Promise; } export interface HostCliPerTaskVerifierOptions { /** 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 165 T7 — spawns the user's already-installed, already-authenticated * host CLI (`claude`/`codex`) in headless mode via `hostCliJSON` (T2's * transport) instead of calling an HTTP endpoint, the first real * `hostCli` builder for any verifier family (AC-1). Structurally mirrors * `LocalPerTaskVerifier` — same `SYSTEM_PROMPT`/`formatUserMessage`/ * `PerTaskResponseSchema`, only the transport differs. */ export declare class HostCliPerTaskVerifier implements PerTaskVerifier { private readonly o; readonly name = "host-cli"; constructor(o: HostCliPerTaskVerifierOptions); verify(input: PerTaskInput): Promise; } //# sourceMappingURL=per-task.d.ts.map