import { type CoverageExplainResult } from '../verify/coverage.js'; import type { CommandIO, CommandResult } from './io.js'; /** * `cadence verify coverage --explain AC-N` (phase 167, T8, AC-8) — a * read-only diagnostic that surfaces the same facts the real coverage gate * (`../gates/coverage.ts`) computes internally but never prints: which * test files matched the configured globs, which profile (if any) scanned * each one, every occurrence of the target AC token, which span (if any) * contains each occurrence, and a plain-language reason the occurrence does * or doesn't satisfy the configured coverage mode. Never mutates * `.cadence/state.json` or any other project state — it doesn't require an * active BUILD/phase and works standalone against any repo with (or * without) a `.cadence/config.json`. * * Pure core / impure shell (CLAUDE.md house pattern): `explainAcCoverage` * (`../verify/coverage.js`) is the core — it takes repoRoot + acId + * explicit globs/mode and does only read-only fs access. This module is the * thin shell: it gathers the facts (cwd, config-derived globs/mode, * argv), calls the core, and renders — human report or `--json`, both on * stdout per CLAUDE.md's stdout contract; errors/diagnostics go to stderr. * * Relocated from `cli/commands/verify.ts` into `services/verify.ts` (phase * 221 T3) so `mcp/tools.ts` can import it directly. Pure relocation — CLI * behavior, output text, flags, and exit codes are unchanged. */ export interface VerifyCoverageArgs { cwd: string; explain: string; json?: boolean | undefined; } /** Pure rendering of a `CoverageExplainResult` into the human-readable report. */ export declare function renderExplainHuman(result: CoverageExplainResult): string; /** * Thin service wrapper: gathers facts (config-derived globs/mode/scheme) and * calls the pure `explainAcCoverage` core, then renders. Nothing is ever * written: `.cadence/config.json` and the glob-matched test files are read * only. * * Phase 239 (T4, AC-6): under `verification.coverageScheme: 'phase-qualified'` * this additionally performs a best-effort read of `.cadence/state.json` to * recover the active draft id, which is the qualifier the gate itself uses. * That read is the one state access here, it is read-only, and it degrades * per the house rule for observation code — a missing, unreadable, or * loop-less state contributes no qualifier rather than throwing. Because * silently falling back to an unqualified explain would make this diagnostic * disagree with the gate it exists to explain, the degraded path prints a * loud stderr notice (CLAUDE.md: The Quiet Fallback) and says plainly that * the report is unqualified. */ export declare function runVerifyCoverage(args: VerifyCoverageArgs, io: CommandIO): Promise; /** * `cadence verify phase [phase] [num]` (phase 204, T5) — a state-independent, * phase-scoped re-derivation of whether a settled phase's recorded AC * coverage still holds, closing rec-20260709-003. Unlike `verify coverage * --explain`, this never requires an active BUILD/loop and works against a * fresh checkout that never ran the phase locally — it reads only the * phase's committed `DRAFT.md` + `SUMMARY.json` (via `replayPhaseCoverage`) * plus, optionally, the current working tree's test files and the * configured `verification.testCommand`. * * Two modes: * - single-phase: explicit `phase` + `num` args, re-derives that one phase. * - `--changed --base `: discovers every phase whose `SUMMARY.json` * changed between `base` and `HEAD` (`discoverChangedPhases`) and * re-derives all of them — the shape `cadence init --ci`'s generated * workflow calls in CI. * * Exit codes are pinned: 0 clean (no drift, test command passed or wasn't * run), 1 drift found or the test command failed, 2 usage error (neither * mode selected, `--changed` without `--base`) or an input error (git diff * failure, missing/malformed DRAFT or SUMMARY, config load failure). */ export interface VerifyPhaseArgs { cwd: string; phase?: string; num?: string; changed?: boolean; base?: string; json?: boolean; /** Commander's --no-test-run negates this to false; default (undefined) means "run it". */ testRun?: boolean; } export declare function runVerifyPhase(args: VerifyPhaseArgs, io: CommandIO): Promise; //# sourceMappingURL=verify.d.ts.map