import type { SkippedDiffFile } from './skipped-retrieval.js'; import type { ReviewComment, Severity } from './types.js'; /** * The Verify stage hands each severe finding to a separate, adversarial agent * whose job is to refute it. The agent returns one of three decisions, which * the Synthesize stage applies deterministically: * * - `keep`: the finding is proven at its stated severity — survives unchanged. * - `downgrade`: a real concern, but the stated severity overstates the * demonstrable impact — severity steps down one tier (and the Conventional * Comment header is relabelled to match). * - `drop`: not a real defect — removed from the review. * * Unknown / unparseable verifier output defaults to `keep` so a flaky verifier * never silently deletes a finding (precision is the goal, but not at the cost * of dropping findings we failed to actually evaluate). */ export type VerifyDecision = 'keep' | 'downgrade' | 'drop'; export interface Verdict { decision: VerifyDecision; reason: string; } export interface AuditEntry { file: string; line: number; action: 'dropped' | 'downgraded'; fromSeverity: Severity; toSeverity?: Severity; reason: string; } export interface SynthesisResult { comments: ReviewComment[]; audit: AuditEntry[]; } /** One MCP tool result captured during Find and replayed to the verifiers. */ export interface McpResultEntry { /** Bridged tool name, e.g. `mcp__tracker__get_issue`. */ tool: string; /** Short, already-redacted rendering of the call arguments. */ argsSummary: string; /** Text the tool returned. */ text: string; } /** * Render the MCP tool results the Find stage collected as an * `` block: the verifier sees the same external * evidence the finder did without calling any tool itself. The block is capped * at {@link MAX_EXTERNAL_CONTEXT_CHARS}; when it does not fit, the most recent * results win (they are the ones the finding is most likely to cite) and a * notice records how many older ones were dropped. */ export declare function renderExternalContextResults(entries: McpResultEntry[]): string; export interface VerifyContext { /** Pre-rendered `` block from `renderIntentBlock`, if the MR has one. */ intentBlock?: string; /** MCP tool results captured during Find, replayed as read-only evidence. */ externalContext?: McpResultEntry[]; } export declare function buildVerifySystemPrompt(diff: string, commitLog?: string, staged?: SkippedDiffFile[], context?: VerifyContext): string; export declare function buildVerifyUserPrompt(comment: ReviewComment): string; export declare function parseVerdict(text: string): Verdict; export declare function stepDownSeverity(severity: Severity): Severity; /** * Rewrite the leading Conventional Comment header of a comment body so its * label/decoration matches a new severity. Leaves the body untouched when the * first line is not a recognizable header (the severity field still changes — * the header is cosmetic). */ export declare function relabelBodyHeader(body: string, severity: Severity): string; /** * Apply per-finding verdicts to the Find stage's comments. Comments without a * verdict (e.g. INFO findings that were never verified) pass through unchanged. * Returns the surviving comments plus an audit trail of every drop/downgrade. */ export declare function applyVerdicts(comments: ReviewComment[], verdicts: Map): SynthesisResult; /** * Rebuild the review summary from the comments that survived Verify, preserving * the Find stage's prose overview and its own Notes (the context it applied, * e.g. an ADR/commit that suppressed a finding), and regenerating the risk line * and issues block from the surviving set. * * Verify's own drop/downgrade decisions are deliberately NOT surfaced here: a * finding the verifier refuted is a non-issue the developer never saw, so * echoing "Verify removed a WARN at x:y — not a real defect" only re-injects the * noise the verifier just removed. The drop/downgrade counts stay in the run log * for operators; see `result.audit` at the call site. * * Deterministic by design: the production Synthesize stage may instead write the * summary with an LLM, but the skateboard keeps it pure and testable so the * variable under test (Verify's decisions) is isolated from model variance. */ export declare function rebuildSummary(originalSummary: string | null, kept: ReviewComment[]): string; /** * Build the canonical `{ summary, comments }` JSON the Synthesize stage writes * to the review file. Shapes match what `parseReviewMarkdownWithWarnings` * consumes, so the parser, payload builder, and posting path are untouched. */ export declare function synthesizeReviewJson(originalSummary: string | null, result: SynthesisResult): string; //# sourceMappingURL=verify.d.ts.map