/** * 审查循环 * * 管理任务审查和修复循环: * 1. 任务审查(规范合规 + 代码质量) * 2. 修复循环(最多5轮) * 3. 断路器(第5轮后裁定) * * 关键原则: * - 每轮修复后必须做范围限定的重新审查 * - 次要发现不进入循环,记录到账本延迟处理 * - 控制器不自己修复(保持上下文干净) */ import type { Finding, ReviewResult, FixRoundRecord } from './types.js'; export type LoopDecision = { type: 'pass'; } | { type: 'fix'; findings: Finding[]; } | { type: 'adjudicate'; findings: Finding[]; } | { type: 'blocked'; reason: string; }; export declare class ReviewLoop { private maxRounds; constructor(maxRounds?: number); /** * 分析审查结果,决定下一步行动 * * @param review - 审查结果 * @param currentRound - 当前修复轮次 * @param testsPassed - 测试是否全部通过(TDD GREEN 门控,默认 true) */ analyzeReview(review: ReviewResult, currentRound: number, testsPassed?: boolean): LoopDecision; /** * 创建修复轮次记录 */ createFixRecord(round: number, addressed: number, open: number, findingSummaries: string[], commits: string): FixRoundRecord; /** * 裁定开放发现 * * 三种裁定结果: * 1. 审查者错了/有争议 → 停放(代码保留) * 2. 真实但无下游依赖 → 停放(延迟修复) * 3. 真实且承重 → 阻塞 */ adjudicateFinding(finding: Finding, _planContext: string): { action: 'park' | 'block'; ruling: string; }; /** * 构建范围限定的重新审查 prompt * * 关键:只审查修复 diff,不重新审查整个任务 */ buildReReviewPrompt(fixDiffPath: string, openFindings: Finding[], briefPath: string, reportPath: string): string; } //# sourceMappingURL=review-loop.d.ts.map