import { type AgentRunner, type ModelOutputParser, type EvalDriver, type RunOut } from "./eval.js"; /** * The harness CLI did not run, as distinct from running and finding nothing. * A named class so the caller can tell the two apart without matching prose. */ export declare class DraftRunFailed extends Error { constructor(reason: string); } /** A reference the model proposes as machine-verifiable. */ export interface DraftedRef { readonly kind: "enforce" | "file" | "cmd" | "dir"; readonly ref: string; } /** A drafted ref that failed verification — the value proof. */ export interface BrokenRef { readonly kind: DraftedRef["kind"]; readonly ref: string; readonly issue: string; } export interface AdoptabilityResult { /** Distinct verifiable references the model found (the surface a spec would protect). */ readonly total: number; /** How many of those are broken in this repo right now. */ readonly broken: number; readonly brokenRefs: readonly BrokenRef[]; } /** * Deterministic verdict over drafted refs — the "disposes" half. Dedupes * (kind+ref), routes each to the real cross-ref/filesystem check, and counts the * broken. Pure: a hallucinated rule resolves to broken, never trusted as a pass. */ export declare function verifyDraftedRefs(refs: readonly DraftedRef[], basePath: string): AdoptabilityResult; /** * Tolerant parse of the model's draft output into `DraftedRef[]`. The model is * asked for a bare JSON array, but tolerate prose-wrapped / fenced output by * extracting the outermost `[...]`. Drops any entry with an unknown kind or a * non-string ref (the verifier is the guard, but a malformed shape is just noise). */ export declare function parseDraftJson(text: string): DraftedRef[]; /** Options for the real model draft (the one v8-ignored seam). */ export interface DraftOptions { readonly model?: string; readonly cwd?: string; readonly runner?: AgentRunner; readonly parse?: ModelOutputParser; /** * The driver's own reader for a failure the exit code does not carry — a * refusal, or a turn error inside a zero-exit run. Supplied by * {@link draftWith}; absent means the exit code is the only signal. */ readonly runError?: (out: RunOut) => string | null; } /** Injectable drafter — the real one calls a model; tests pass a fake. */ export type Drafter = (content: string) => Promise; /** * Build the real drafter from a harness's EVAL DRIVER, instead of the hard-wired * `spawnAgent` + `parseClaudeRun` defaults above. * * 🔴 THIS IS WHY THE PREVIEW IS NOT CLAUDE-CODE-ONLY. `defaultDraft`'s two * defaults ARE the two members of the Claude eval driver, and nothing else in * the drafter is harness-specific: the prompt is over an instruction file's * prose, and prose is prose. The VERIFIER is deterministic and harness-free * ("LLM proposes, deterministic disposes", this file's header), so "M broken * right now" is exactly as trustworthy driven by one harness as by another; * only the draft's RECALL varies by model, which it already does across models * of the same harness. * * `model` is passed through to whichever runner: the trigger tier already does * this, and a runner that does not understand the alias ignores it. */ export declare function draftWith(driver: EvalDriver, opts?: DraftOptions): Drafter; export interface AdoptabilityTierOptions { readonly instructionContent: string; readonly basePath: string; /** Injectable for tests; defaults to the real one-shot model draft. */ readonly draft?: Drafter; } /** * Run the preview: draft refs from the instruction file (model), then verify them * (deterministic). The composition root of "LLM proposes, deterministic disposes". */ export declare function runAdoptabilityTier(opts: AdoptabilityTierOptions): Promise; /** Terminal section — the adoption invitation, not a graded ring. */ export declare function formatAdoptability(r: AdoptabilityResult, instructionFile: string): string; //# sourceMappingURL=adoptability.d.ts.map