Repository navigation
fix(replan): preserve mixed reviews after work-link updates - #8009
huangruiteng wants to merge 1 commit into
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
d2564a5 to
d20b92f
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max.
动机 / Motivation
调用原生 quota/refresh 的 Agent 在一次评审尚未结算时,可能为验收项补上具体工作。此前 Vision 与 Goal Acceptance 两种缺口并存时,补工作链接会改变 frontier,原 Turn 随后被当成身份冲突,已经开始的评审无法合法收尾。本次同一个原 Turn 能读到新增验收要求,完成有证据的评审回写,并在重复结算时只扣一次;后来创建的等待任务仍保持等待。本 PR 不授予后续任务执行权,也不证明已安装宿主采用或长程净收益。
安装后的真实宿主采用与长程效果仍需各自现有资格;本次只证明源码版本的原轮恢复和边界。
没有发现阻塞性问题。这个判断来自同一合成场景在 immutable base 与当前 head 的对照,不沿用作者的通过声明。
改动思路 / Approach
保留原 TS 语义 owner,只扩展已有 scalar receipt 对 Vision 来源的识别;恢复的是原评审身份,而不是缓存旧 Goal 内容或新增一套权限判断。当前 PR 的边界是三个文件内的原轮恢复修复及直接回归;新 frontier、独立验收 hold、能力和生命周期义务仍由各自现有 owner 处理。
做法比保存完整旧 packet 更合适:receipt 只保存可追溯的种类与无损 stop clause,恢复时仍从 canonical acceptance 构造当前 context。Vision 与 outcome 并存时选用原有 Vision policy,因此一般的 new_surface 或 unchanged reason 不能替代有证据的复盘。source 有 window、capability、periodic、external 或 acceptance-hold 限制时仍走原 owner,不能借此降格。
具体改动 / Changes
验收依据为 docs/reference/protocols/goal-vision-replan-contract-v0.md,spec_revision=d4aaaaefbd37a83a30f10681de839b45d631eeb9。判断的是修改前已经接受的合同:
ownership-boundary:复用 TS 决策、Python receipt IO 和现有 decoder,没有第二个 state/permission owner。replan-ack-freshness:补 work link 及追加 requirement 后,原 Goal/Agent/Turn/obligation 不变;新验收可读,原 writeback 后只扣一次,后续工作不在本轮执行。acceptance:恢复不是 discharge;缺 evidence 的原生回写仍拒绝,只有现有 typed semantic outcome 能结算。
关键代码讲解
projectReplanSemantics的receipt_review_source使用同一个 local set 检查完整 trigger 集;混合顺序不会影响 Vision 的优先语义。preserveReceiptBoundObligation恢复原 id、Agent、kind 与 stop,不携带旧replan_context或 action packet;随后仍交给当前 context owner。requiredSemanticOutcomes保持 Vision 的既有证据门,已有 capability、acceptance 与 lifecycle 限制没有改写。
独立执行结果:
| 同一条件 | base | 当前 head |
|---|---|---|
| File/SQLite × Stride off/on 的四个 mixed source 场景 | 4 个 identity-conflict 失败 | 4 个通过 |
| 四个 pure-outcome 场景与 stop/privacy 控制 | 5 个通过 | 5 个通过 |
| 真实 base 产生缺 source 的旧 receipt,再交给 head | — | 4 个均拒绝,0 writeback / 0 spend |
| 完整 TS 语义模块 | — | 33 PASS |
原生 CLI 是 OS subprocess,File/SQLite 为真实隔离 store。对照仅在收集时给两个 production 版本相同 test oracle,没有修改生产代码。最初缺源负例的父进程补丁未进入 CLI 子进程,随后还有一处 harness parser 参数错误;这些运行保留为无效测试,最终改用真实 base writer,不把前两次错误算成产品回归或通过。
对主干的风险 / Risks
最大的反向风险是把原 Vision 复盘降成普通进展,或让旧 source/context 替当前验收背书。当前 source whitelist、Vision-dominant qualifier、无损 stop serializer 及原 binding 检查共同约束这条路径;正反 CLI 覆盖新增 requirement、wrong-scope 变体、空回写、重复 spend 与等待 successor 保持。
语义与 CI 对齐
这里复用现有 trigger vocabulary;SCALAR_REVIEW_KINDS 是本模块的分类集合,不是新公开枚举、配置或 schema。标准 diff-scoped premerge exit 0,direct checks、8 catalog 与 8 risk checks 通过;gate 另报 1 项 inherited maintainability advisory,其完整历史根因本次未独立归因,不能改记为新修复。没有查询、轮询或等待远端 CI,也没有执行 merge、安装或真实模型。
我的整体评价 / Verdict
这是 justified_increment:原始混合 review 的卡死已在当前精确头得到独立对照,保留现有 owner 和原轮一次结算,比缓存完整旧合同更容易维护。long_horizon=improved 仅指所测恢复链路,user_experience=improved 指无需重建 Turn 或重新输入已知意图;不据此推断长期效果。安装后的真实宿主采用与长程效果仍需各自现有资格;本次只证明源码版本的原轮恢复和边界。
变更仅在 replan 语义 reducer、CLI 回归和 TS 测试,没有渲染页面或产品配置变更。已安装宿主与 Lark 的实际采用未验证;本次没有新增可截图的 UI。
English verdict: APPROVE d20b92f; mixed review recovery is verified against the base with current acceptance, fail-closed legacy receipts and exactly-once settlement preserved.
A mixed Vision/Goal Acceptance review can lose its admitted Turn identity after a caller links concrete work to the outcome. The current frontier then changes before the original review is settled, and recovery rejects the unchanged original Turn.
Retain the existing scalar review source for pure Vision, pure outcome and mixed Vision/outcome reviews, preserving the Vision policy when both are present. Recovery still uses current cumulative acceptance and still owes the original evidence-based review. Periodic, external-progress and lifecycle reviews keep their existing owners and gates; old receipts without a source remain fail-closed.
Validation on
d20b92fcebdff335b5389c3de5d2eb93a84ad7b5, rebased onto current main:The previous CI lint failure came from the Lark lambda already repaired in #8008; that main change is now included in the base. Current-head CI and independent review remain separate gates. This is a control-plane correctness fix; no benchmark-effectiveness claim or main-merge authorization is implied.