import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { ToolContext, ToolResponse } from '../types.js'; import { type DropCause } from '../core/file-resolution.js'; import { HygieneSignal } from '../core/hygiene-signals.js'; import { TypecheckResult } from '../core/typecheck.js'; import { TaskDiffResult } from '../core/task-diff.js'; /** Test-only: clears this module's warn-once ledger. */ export declare function _resetReviewWarnings(): void; type HygieneResult = { signals: HygieneSignal[]; rejection?: { message: string; }; }; export type DiffMethodologyState = { kind: 'present'; } | { kind: 'present-truncated'; } | { kind: 'empty'; } | { kind: 'rejected'; message: string; }; export declare function computeDiffMethodologyState(result: TaskDiffResult): DiffMethodologyState; export type TypecheckMethodologyState = { kind: 'success-clean-full'; } | { kind: 'success-with-diagnostics'; truncated: boolean; } | { kind: 'success-partial-coverage'; } | { kind: 'success-with-diagnostics-and-partial-coverage'; truncated: boolean; } | { kind: 'unavailable-feature-disabled'; } | { kind: 'unavailable-other'; reason: string; } | { kind: 'timeout'; }; export declare function computeTypecheckMethodologyState(result: TypecheckResult): TypecheckMethodologyState; export declare function unwrapTypecheck(settled: PromiseSettledResult, /** * The compiled tree (requirement 4.2). `tsconfigPath` must name the same file * on this arm as on the ones `runProjectTypecheck` returns itself; reporting * the workflow root here would make the rejection arm describe a different * tree than the success arm. */ workspacePath: string): TypecheckResult[]; export declare function unwrapHygiene(settled: PromiseSettledResult): HygieneResult; /** * One of TWO producers of `TaskDiffResult.rejection`. * * This arm carries a thrown exception's `.message`. The other is * `computeTaskDiff`'s containment assertion (requirement 4.23), which fills the * same field with its own stated text (`containmentRejectionMessage`) rather * than inheriting the wording used here or in `R4_2B_DIFF_REJECTED` — a * mis-partitioned pathspec is not an unexpected exception (requirement 4.24). * One field, two producers, on purpose: `computeDiffMethodologyState` classifies * both as `rejected`, which is what keeps either from being read as the `empty` * diff — "the task changes were already committed" — that a discarded pathspec * would otherwise produce. * * Either message is READ by the agent only on the direct-call path, as * `data.diffRejection.message`. `TaskReviewRunner` names no diff field in its * destructure of `prepareResponse.data`, so on the dashboard-spawned path the * classification above is all that survives — the wording does not. Residual, * deferred as `d-6e59490b`. */ export declare function unwrapDiff(settled: PromiseSettledResult): TaskDiffResult; export declare const reviewTaskTool: Tool; export declare function reviewTaskHandler(args: any, context: ToolContext): Promise; /** * The file-resolution counts published with the prepare response (requirement * 4.19), so the reviewing agent learns how many logged paths actually resolved * and how many were dropped, by cause. * * They reach the dashboard-spawned reviewer only because `TaskReviewRunner` * names the field in its destructure of `prepareResponse.data`, which is typed * `any`: every field it does not name is silently discarded, with no compiler * error. */ export interface FileResolutionCounts { workspaceCount: number; workflowCount: number; drops: Record; } /** * True when the task logged files and NONE of them resolved inside the * workspace under review — the case requirement 4.20 makes actionable. * * Stated in terms of the three published counts alone, so the runner can decide * it without a fourth field: every logged entry either resolves (into * `workspaceCount` or `workflowCount`) or increments a drop, and the realpath * dedupe only ever collapses entries that resolved. `workflowCount > 0 || * totalDrops > 0` is therefore exactly "the log listed at least one file". A log * with no files at all yields zeros throughout and is not a disclosure case. */ export declare function hasNoReviewableFiles(counts: FileResolutionCounts | undefined | null): boolean; /** * The all-drop disclosure (requirement 4.20). It REPLACES — never annotates — * the two read-every-file instructions this spec owns: the first `nextSteps` * entry below and the runner's first numbered prompt instruction. Annotating * them would leave the stated harm (a passing verdict over unexamined code) * fully intact. * * RESIDUAL (requirement 4.21, deferral `d-f3cb6fd8`): two further instructions * to read every listed file survive this replacement and are deliberately NOT * changed here — the unconditional methodology header (`buildReviewMethodology`, * this file) and `R4_2A_DIFF_EMPTY`. Both are byte-pinned, by the seventeen * committed fixtures under `src/tools/__tests__/__fixtures__/methodology/` and by * a drift test comparing against a *different* spec's requirements document, so * changing them is cross-spec work this spec does not carry. `R4_2A_DIFF_EMPTY` * additionally fires NECESSARILY on this path: an empty workspace file set * yields an empty diff with no rejection (`src/core/task-diff.ts:41-43`), so its * fabricated "already committed before review" explanation is present alongside * this statement in every all-drop review. The last sentence of the text names * that contradiction rather than leaving the agent to resolve it — but the * contradiction itself is real, and this constant is not a complete closure of * the harm. */ export declare const NO_REVIEWABLE_FILES_DISCLOSURE = "NO REVIEWABLE FILES WERE RESOLVED. The implementation log listed files, but none of them resolved inside the workspace under review (see the fileResolution counts: workspaceCount is 0), so the implementation itself is not available to read. Do NOT return a \"pass\" verdict on that basis \u2014 a pass would assert that code was examined when none was read. Report the unresolved files as a critical finding instead. Any entries still shown in filesToReview are shared .spec-workflow documents, not the implementation. Other guidance in this review context still instructs you to read every listed file, and the empty-diff guidance may explain the missing diff as \"the task changes were already committed before review\"; neither holds here \u2014 the diff is empty and the list has no workspace files because resolution dropped them all."; export declare function buildReviewMethodology(taskContext: { description: string; requirements: string[]; leverage: string | null; prompt: string | null; promptStructured: any[] | null; }, hasTechSteering: boolean, hasPriorReviews: boolean, hasHygieneSignals: boolean, diffState: DiffMethodologyState, typecheckState: TypecheckMethodologyState): string; export {}; //# sourceMappingURL=review-task.d.ts.map