feat(rule13): 执行前分歧重评估闸——main 撞声明范围→needs_attention 重评估
通用规则13的(B)半边:sync main 之前先跑 reevalScopeGate, 以 git diff HEAD...origin/main 取 main 自分支点以来改动的文件, 与任务 scopeFiles 求交集;非空即 emit needs-reeval → daemon markReeval 直接转 needs_attention(不重试/不计失败/run收尾cancelled)。 - checks.ts: + reevalScopeGate / ReevalGateFn / ReevalGateResult - pipeline.ts: createWorktree 后、syncMain 前插入重评估闸 + reevalGate 依赖注入 - protocol.ts: + needs-reeval OutboxRecord/Payload 事件 - ingest.ts: + case 'needs-reeval' → store.markReeval - store.ts: + markReeval(executing→needs_attention,不进重试链) - status.ts: executing 合法转移 + needs_attention - 测试 +5:reevalScopeGate(命中/未命中/空/无前移/git错) · pipeline(命中emit/未命中续跑) · store.markReeval;全套 242 绿 - docs: optimization-plan.html 规则13 标 ✅ 已实现 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -684,9 +684,9 @@
|
||||
<li class="rule-item">
|
||||
<div class="rule-num">13</div>
|
||||
<div class="rule-body">
|
||||
<span class="tag tag-new">新增</span>
|
||||
<strong>执行前同步 main + 分歧重评估</strong>:任务正式执行前,先把 defaultBranch 最新代码 merge 进 worktree;若改动过大 / 耦合过深 / 存在逻辑冲突,则触发方案重评估(回 planner 重写 spec / 重拆,或转 needs_attention)而非盲目继续。
|
||||
<div class="rule-impl">与③协同:执行前同步冲突=早发现;执行后合并冲突=③兜底</div>
|
||||
<span class="tag tag-approved">✅ 已实现</span>
|
||||
<strong>执行前同步 main + 分歧重评估</strong>:任务正式执行前,先把 defaultBranch 最新代码 merge 进 worktree;若改动过大 / 耦合过深 / 存在逻辑冲突,则触发方案重评估(转 needs_attention 待人工)而非盲目继续。
|
||||
<div class="rule-impl">实现:sync main 前先跑 <code>reevalScopeGate</code>——以 <code>git diff HEAD...origin/main</code> 取 main 自分支点以来改动的文件,与任务声明范围 <code>scopeFiles</code> 求交集;非空即 emit <code>needs-reeval</code> → daemon <code>markReeval</code> 直接转 <code>needs_attention</code>(不重试、不计失败次数、run 收尾 cancelled)。与③协同:执行前同步冲突=早发现;执行后合并冲突=③兜底</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user