import type { CompletionReport, Constraint, ReviewerReport } from './completion-report.js'; import type { QualityGateResult } from './wrfc-types.js'; /** * The report shape `parseEngineerCompletionReport` returns. * * Exported because it IS the return type of an exported function: without the * keyword a caller could hold the value but never name the type, and had to * recover it as `Parameters[2]`. */ export type ReviewableCompletionReport = CompletionReport & { reviewableOutput?: string | undefined; }; export declare function extractScoreFromText(text: string): number | null; /** * Determines whether a review verdict passes. * * Score >= threshold is a NECESSARY condition. Prose language ("passed", * "approved") is treated as confirmation only, it can never elevate a * sub-threshold score to a pass verdict. * * This is intentionally fail-closed: if the score is below threshold, * the result is always false regardless of what the reviewer wrote. */ export declare function extractPassedFromText(text: string, score: number, threshold: number): boolean; export declare function extractIssuesFromText(text: string): ReviewerReport['issues']; export declare function parseEngineerCompletionReport(rawOutput: string, _template?: string): ReviewableCompletionReport; /** * Discriminator for claim verification outcome: * - 'files_verified': claims present and all found on disk. * - 'git_corroborated': claims present, some missing on disk, but git diff shows changes. * - 'verified_empty': no claims made but git diff shows changes (engineer did real work without listing files). * - 'unverifiable_no_claims': no claims AND no git diff, suspicious; treated as phantom work. * - 'unverified': claims present but not found on disk and git shows no changes. */ export type ClaimVerificationKind = 'files_verified' | 'git_corroborated' | 'verified_empty' | 'unverifiable_no_claims' | 'unverified'; /** Per-file result for claim verification. */ export interface ClaimVerificationResult { /** All paths claimed as created, modified, or deleted. */ claimedPaths: string[]; /** Paths that exist on disk (for created/modified claims). */ foundPaths: string[]; /** Paths that were claimed but not found on disk. */ missingPaths: string[]; /** Whether git diff/status shows any changes since the engineer started. */ gitDiffDetected: boolean | null; /** * Tri-state discriminator. Use this instead of the bare `verified` boolean * to distinguish 'unverifiable_no_claims' (suspicious) from 'verified_empty' * (legit no-file work with a git diff). Controllers must treat 'unverifiable_no_claims' * as phantom work and inject a synthetic issue. */ kind: ClaimVerificationKind; /** * Convenience: true iff kind is NOT 'unverified' or 'unverifiable_no_claims'. * NOTE: Callers should use `kind` directly when deciding whether to set `chain.claimsVerified`. * In particular, `unverifiable_no_claims` returns `verified: false` here but the controller * intentionally leaves `chain.claimsVerified` as `undefined` (not `false`) because suspicion * cannot be confirmed. Do NOT blindly propagate `result.verified` into chain state. */ verified: boolean; /** Human-readable summary of what was and wasn't found. */ summary: string; } /** * Verifies that an engineer's self-reported work actually materialised on disk. * * Strategy: * 1. Stat every path claimed in filesCreated/filesModified. * 2. If any claimed paths are missing, check git diff/status as a fallback * (the engineer may have written to a path not literally listed). * 3. If no paths were claimed at all, fall through to git as the sole signal. * * This is intentionally lenient about the git check, a non-empty diff is * treated as corroborating evidence even when individual file stats fail. */ export declare function verifyEngineerClaims(report: CompletionReport, projectRoot: string): ClaimVerificationResult; export declare function parseReviewerCompletionReport(chainId: string, rawOutput: string, threshold: number): ReviewerReport; export declare function buildReviewTask(chainId: string, originalTask: string, report: ReviewableCompletionReport, threshold: number, constraints?: Constraint[]): string; export declare function buildGateFailureTask(chainId: string, task: string, failedGates: readonly QualityGateResult[], constraints?: readonly Constraint[]): string; //# sourceMappingURL=wrfc-reporting.d.ts.map