Skip to content

Keep same-batch outcome reviews current after result linking - #8335

Merged
huangruiteng merged 2 commits into
mainfrom
codex/batched-review-basis-20261108
Nov 8, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/batched-review-basis-20261108

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

A refresh-state that submits a complete outcome self-review together with an Explore result can immediately invalidate that review when result delivery appends the Todo link. The caller then repeats an unchanged refinement just to restore basis_current.

For work linked to the reviewed outcome, bind the new complete review to the exact normalized additive link submitted in that batch, using the original CAS snapshot and the shared Todo append rule. The review stays stale until the Todo owner commits that link. A valid result for separate same-Agent work preserves the reviewed outcome's ordinary basis and work links. The TypeScript owner validates the complete intent and ownership before determining relevance, so malformed or foreign intent remains rejected even when unrelated. Concurrent changes to reviewed work or extra evidence on it still invalidate the review; interrupted delivery, exact replay and original ordinary/legacy review semantics remain intact. Raw conclusions, retained requirements/sources, configured checks and independently_verified=false are preserved.

Refinement still precedes primary writeback and Explore delivery. Moving the review last would change its original CAS and due-review context, while a compound transaction would need to absorb the existing Todo lease and file-backed writeback/graph owners. This bounded change carries only the exact existing append intent and adds no setting or execution authority. The companion refactor shares additive normalization with unchanged diagnostics and validation order.

Validation at 3b7534ab038be611c7cdd4de671a5d4a0642b37d (base 21013c0c113445b71a30f6ce06ab61455b56f1f2):

  • 139 focused Python tests passed across batched review, due-review composition, Explore delivery and outcome/native recovery. File/SQLite cases include same-work and separate-outcome batching, explicit-file and inline path-delta attachments, interrupted graph-to-Todo linking, concurrent extra evidence, CAS refusal, legacy replay and once-only settlement.
  • 47 focused TypeScript tests passed; control-plane typecheck and changed Python Ruff checks passed.
  • Same-work regression sensitivity: four baseline cases fail as expected, while four separate/legacy controls pass. Separate-outcome compatibility: both File/SQLite cases pass on the baseline, fail on the original PR head and pass after the correction. Five shared-append base/head cases preserve exact output and rejection diagnostics.
  • Standard premerge passed: 19 selected checks, zero failures, plus direct diff/compile/bilingual checks and the changed-public-file boundary scan. Semantic vocabulary advisory found no supported new carriers; the internal request extension is described above.

The expected cost improvement is removal of the mechanical stale/readback/unchanged-refine path. Actual request, billing, elapsed-time and outcome improvements require separate runtime evidence. Installed adoption and independent review of the updated head remain unqualified here; merge is left to the maintainer.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | effort=max

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

REQUEST_CHANGES,精确 head 509cc126fac5acf912e05d0a2d0934cf5f61ddd6,base 21013c0c113445b71a30f6ce06ab61455b56f1f2。确认一个 P2:合法的“复核成果 A、为当前 Todo B 写回结果”批次被新增的成员资格条件拒绝。其余本次验证通过,不能抵消这处兼容性回归。

动机 / Motivation

在一次 refresh-state 中同时提交成果自查和当前 Todo 的 Explore 结果的 Agent。

同一 Agent 复核只关联 Todo A 的成果,同时为 Todo B 写入 Explore 结果;旧版成功且 A 的依据保持 current,新版在主写回前拒绝。

同一成果的同批关联能消除机械补写;独立成果的合法组合仍须沿用普通复核语义。

原问题也真实存在:新自查先保存工作摘要,随后本批结果关联改变该摘要,成功写回又要求机械地重复同一自查。此次正例已经修复;但可用修复必须保留独立成果的合法组合,避免把省下的一次补写变成另一路径的拆分操作。本次不改变独立检查、Goal 完成、权限、预算或运行时模型采纳。

改动思路 / Approach

refresh-state 只运输明确的新 review 与已规范化结果的一个追加意图。TypeScript acceptance owner 在原始 CAS 快照上计算前瞻摘要;主写回和 Explore/Todo owner 仍按原顺序提交效果。摘要不等于效果,关联尚未提交或出现额外工作/证据时仍应过期。已有自查不被重新绑定,independently_verified 仍为 false。

在既有 TypeScript owner 内计算精确前瞻摘要,保留原 CAS、顺序及 Todo 提交权限,比重排效果或引入第二个 Python 决策 owner 更符合现有边界;本 head 的成员资格拒绝仍须修复。 仅修复显式同批新 review 与一个结果关联的依据;保留合法的无关成果组合、旧回执、所有独立检查和权限边界。

把关联移到主写回之前会改变效果准入;把 review 移到最后会消费原 CAS 并改变 due-Stride/context 和部分回执的顺序。把图日志、主写回及 Todo lease 合成事务则超出此修复。当前精确意图方案本身有依据,所需修复是既有 TS owner 内的一处分支范围,毋须另加 Python 策略或配置。

具体改动 / Changes

规范依据是变更前的 skills/loopx-project/references/outcome-refinement.md,spec_revision 21013c0c113445b71a30f6ce06ab61455b56f1f2;同时检查其引用的 Goal acceptance 合同。按原文小节映射:Reuse context and batch changes 未满足,原有复核只需成果 ID 和变更字段,并不要求当前 Todo 必须属于该成果;Continue and recover 已实现原操作/原 revision 的恢复与顺序保留;Default supporting outcomes and evidence review 的权限、根 Goal、预算与停止边界保留。PR 新增文字不能反过来证明缩窄旧调用范围合理。

关键代码讲解

  • handle_refresh_state_command 在同时出现 review 与结果时无条件附加当前 Todo 的意图,File 与 path-delta 两种结果入口共用这一路径;它没有也不应成为第二个成员关系决策 owner。
  • refineGoalOutcome 先验证完整 review,再将一个规范化追加映射到原始 Todo 快照,由原 reviewBasis 计算摘要。它复制 map、不写 Todo;但第 195–196 行把“该效果是否属于此成果”错写成所有批次的强制准入条件。
  • refineGoalAcceptanceOutcome 保持原 CAS 与包含新意图的操作哈希。旧版本回执只在精确旧封套匹配时只读恢复,不把旧摘要升级到后来 head;这段兼容性对应真实持久化重试,不能仅因调用者共同升级而删除。
  • appendTodoExploreReferences 同时服务实际 Todo planner 与前瞻摘要,收回重复规范化逻辑。独立 11 组 base/head planPublicTodoUpdate 比较覆盖省略、null、空数组、去重、错误类型、非法旧引用、替换/追加冲突及多重非法条件,完整输出、异常类型、诊断和优先级逐字节一致。

变更为 11 文件、+401/−18;其中生产代码六文件 +52/−18,测试 +324,参考与技能文本 +25。没有新生产模块、持久化 review schema 或 CLI 开关;扩展的是既有 goal.acceptance.refine 的瞬时请求意图,并复用既有追加词汇。扫描与标准 premerge 的语义检查通过。现有 CLI/native/HTTP 复核和 inspect/status 消费者均已检查,不存在新增 Python 决策 owner。

对主干的风险 / Risks

[P2] 保留无关成果与当前结果的合法批量组合。 同一 active Goal 中,Agent 拥有 Todo A、B,成果 A 仅关联 Todo A。以 Todo B 获得当前准入后,给一次 refresh-state 同时传入成果 A 的完整自查与 Todo B 的合法 Explore 附件。旧版成功,A 的工作依据未变,仍为 current;本 head 在主写回前返回 goal_acceptance_invalid_request,详情为 reviewed work must be the caller's linked Todo,appended=false。我用同一 fixture 和真实 CLI,分别在 File/SQLite 的不可变 base/head 上复现:

输入 base 当前 head
复核当前已关联工作,并追加本批关联 写回成功但依据过期,原缺口 两后端均成功且 current
复核独立成果 A,为当前 Todo B 追加结果 两后端均成功,A 保持 current 两后端均在主写回前拒绝

由 TypeScript owner 先验证追加意图与 Goal/Agent 所有权,再仅对已关联到被复核成果的 Todo 计算前瞻依据;无关 Todo 保留普通复核语义。 应新增两后端真实 CLI 控制:A 的关联保持仅有 Todo A,B 的结果关联正常提交,A 的完整 review 为 current;同时保留非法/外属意图、初始 CAS、旧 review 和并发额外证据的拒绝/过期断言。把复核拆成单独调用只能绕过回归,不能证明原批量合同兼容。

独立验证:PASS 129 项 Python(同批、due-review、成果复核、native 恢复和 Explore 投递),PASS 150 项 TypeScript;24 项显式 PostgreSQL 环境测试跳过,未据此声明正向 PostgreSQL 工作流通过。PASS control-plane typecheck、双语 RFC、diff hygiene,以及精确 head 的标准 premerge:19 个选择项和 6 个 direct checks,零失败。另行的范围探针有上述两项真实回归;基线同任务正例的两项预期红也保留,未重标成通过。中断后恢复、丢失回复、额外并发关联、普通/旧回执和一次结算由实际 File/SQLite 路径覆盖。所有模型/评分/安装收益仍未验证;按当前策略未查询 CI。

语义与 CI 对齐

本 PR 不是 opt-in 改动:默认成果维护原本没有开关,Explore 附件仍须原准入。普通/分开/旧复核控制及共享追加诊断比较保持,然而已启用同一容器内的无关成果被新 gate 捕获,属于确定的调用范围漂移,不能用默认关闭说明或绿色 premerge 豁免。最小修复与复测正是上面的 TS 分支及两后端对照;没有新增协议、放宽权限或调整 CI 门槛的必要。

我的整体评价 / Verdict

当前结论为 REQUEST_CHANGES。long_horizon 与 user_experience 均存在已复现的范围回归:合法一次批次被阻断,操作者须重新组织已知输入才能继续。正例减少机械重复,架构与代码量总体适当,旧回执兼容及共享追加提取也有真实依据;这些判断不覆盖本次错误拒绝。修复应留在既有 TypeScript owner,保持完整 CAS、原始自查结论、关联权限、独立检查和恢复语义,再复核新精确 head。

未修改渲染页面、布局或交互控件;已检查现有 acceptance HTTP、status/inspect 与 Dashboard 消费边界,复用现有 basis_current 投影。 渲染变更的未验证范围为 none;安装后的模型采用、完整成本收益及正向 PostgreSQL 集成没有验收。本次是独立 source-checkout 审查,没有执行合并或修改运行中的 Goal。

English verdict: REQUEST_CHANGES at 509cc12. A valid same-Agent review of an unrelated outcome is rejected before writeback on real File and SQLite; baseline accepts it. 129 Python, 150 TypeScript and standard premerge pass, with 24 explicit PostgreSQL skips; scope compatibility still blocks this head.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

APPROVE,精确 head 3b7534ab038be611c7cdd4de671a5d4a0642b37d,base 21013c0c113445b71a30f6ce06ab61455b56f1f2。No blocking finding。上一 head 509cc126fac5acf912e05d0a2d0934cf5f61ddd6 的 P2 由相同真实 File/SQLite 反例独立验明修复;此结论包含完整 base-to-head 判断,不继承旧评审结论,也不构成合并授权。

动机 / Motivation

在一次 refresh-state 中同时提交成果自查和当前 Todo 的 Explore 结果的 Agent。

同一成果的新自查与本批结果关联完成后直接保持 current;复核只关联 Todo A 的成果并为 Todo B 写结果时,沿用原复核依据和原工作关联。

本次能在一个合法批次内保存完整自查、结果关联并读回当前依据,无需机械补写,也不把无关工作塞入被复核成果。

原缺口是自查先保存当前工作摘要,随后本批成功追加的结果关联立即使其过期,迫使再提交一次无内容变化的复核。新 head 同时保留了独立成果的合法组合。本次不改变独立检查、Goal 完成、权限、预算或运行时模型采纳。

改动思路 / Approach

精确前瞻摘要、CAS、回执与归属校验都留在既有 TypeScript owner;Python 只运输明确意图,相关性只决定摘要输入,不成为无关成果的新准入条件。 本 PR 只修复新完整 review 与本批精确追加关联的组合,保留普通/无关成果、旧回执、独立检查和 Todo 提交权限。

同批显式输入只声明一个即将追加的结果关联。原 CAS 快照上的 typed owner 计算对应前瞻摘要,既不写 Todo,也不把摘要当成效果。若它属于被复核成果,只有实际 Todo owner 提交该精确关联后依据才 current;若属于同 Agent 的其他工作,该成果保持普通复核语义。两种情况都先验证完整意图、规范化节点和 Goal/Agent 归属,不能因“无关”忽略非法输入。

重排效果不是等价简化:先追加会改变主写回准入;最后复核会消费原 CAS 并影响 due-Stride/context 及部分回执恢复。原图日志、主写回和 Todo lease 又不属于一个事务。保留既有 owner 内的精确投影,比增加 Python 策略、补写命令或第二个状态 owner 更合适。

具体改动 / Changes

规范仍以变更前的 skills/loopx-project/references/outcome-refinement.md 为准,spec_revision 21013c0c113445b71a30f6ce06ab61455b56f1f2,另核对其 Goal acceptance 参考合同。Reuse context and batch changes:已实现现有成果只提交 ID/变更字段、原要求和关联保留,相关/无关组合均可一次完成;Continue and recover:原操作、原 revision、先 refinement 后普通写回及部分效果恢复均保留;Default supporting outcomes and evidence review:来源不是权限,根 Goal、预算、停止和独立检查边界保留。本 PR 新文字只解释经执行验证的窄例外。

关键代码讲解

  • handle_refresh_state_command 从现有显式/path-delta 规范化结果运输当前 Todo 与一个追加节点,Python 不重新判断成果成员关系,也不改变原效果顺序。
  • refineGoalOutcome 验证新完整 review,再验证整个待追加意图。第 195–202 行先检查归属、数量和共享节点 codec,最后仅用 outcome.todo_ids.includes(todoId) 选择摘要输入;无关工作不再被拒绝,也不会加入成果关联。旧摘要、其他关联工作及未知工作字段的保守摘要规则保留。
  • refineGoalAcceptanceOutcome 保留原 CAS 和精确请求哈希。旧版本操作只在精确旧封套匹配时只读恢复,不把历史摘要重新绑定到后来的 head。这对应真实持久化回执,而非维护第二套复核业务规则。
  • appendTodoExploreReferences 同时服务实际 Todo planner 和前瞻投影;我在本 head 重跑 11 组 base/head 公共 planner 对照,省略/null/空数组、去重、错误类型、非法旧引用、替换与追加冲突及重叠错误的完整 JSON、异常类型、诊断与优先级仍逐字节一致。

完整 PR 为 11 文件、+462/−18:六个生产文件 +55/−18,测试 +374,参考/技能文本 +33。自旧评审以来只改一个生产分支,并增加反例与范围说明。没有新 CLI 开关或持久化 review schema;扩展的是既有 goal.acceptance.refine 的瞬时请求意图,复用原追加词汇。主干仍为上述 base,组合树等于本 head,未出现新组合漂移。

对主干的风险 / Risks

最强反向风险是“放过无关成果”时也放过非法意图,或重试时悄悄把摘要升级到新证据。我独立建立真实 File/SQLite authority 探针,每个后端检查错误 Goal、Agent、owner 冒充、外属/缺失 Todo、非法/多节点、越权字段和缺少新 review,均拒绝且完整 provider、head 和 receipts 不变。合法无关结果不改变 A 的 basis/关联;后来修改 A 的真实工作会使 review 失效,原操作重放仍不能将其刷新。失效并发关联、初始 CAS、丢失回复、旧回执与中断投递继续通过实际 CLI/typed owner 路径验证。

原始独立四例使用完全相同的脚本:base 上同任务两例为预期的过期红、独立成果两例通过;旧 509 的独立成果两例错误拒绝;本 head 四例全部通过,包含分别读回 A 的原关联与 B 的实际结果。旧失败记录保留,未因新绿结果重标。

本 head 独立 PASS 26 项 Python(四个原始范围反例,加 22 个变更/恢复和 due-review 组合例),PASS 153 项 TypeScript(含上述两后端独立 authority 探针),24 项显式 PostgreSQL 环境测试跳过。PASS typecheck、Ruff、完整变更的标准 premerge:19 选择项和 6 direct checks,零失败,包含双语 RFC、compile、语义检查及公共边界扫描。

旧 509 的独立 129 Python 是历史旁证,本次没有冒称重跑。已逐字节核对其未改的 Python transport、acceptance receipt owner、Todo append/digest owner 及普通/native/delivery 测试;改变的 optional-intent 分支和调用反例在新 head 重新执行。所有旧覆盖都带源 revision 和上述失效检查。未查询 CI,也未声明正向 PostgreSQL、安装后模型采用或完整成本收益。

语义与 CI 对齐

默认成果维护没有 opt-in 开关,不能用“功能关闭”规避共享路径检查。当前相关性只选择被复核工作的摘要,不额外收编当前或后来创建的无关成果;非法意图仍由同一 TS owner 先拒绝。既有 schema、Actor、检查与回执没有被当成独立验收或 Goal 完成;新增可读说明保留原权限、来源、CAS、due-Stride、继续/停止及恢复条件。

我的整体评价 / Verdict

本次 bounded repair 达到当前可交付目标。long_horizon 的结构改进是减少一次无内容变化的机械复核,同时保留后续真实变化和恢复边界;user_experience 保持已知合法输入一次批量完成,无需人为扩大关联或拆分操作。这不是模型能力、原生分数或总费用已改善的证据。

未修改渲染页面、布局或交互控件;已检查现有 acceptance HTTP、status/inspect 与 Dashboard 消费边界,复用现有 basis_current 投影。 渲染变更未验证范围为 none;安装后的模型采用、真实成本与正向 PostgreSQL 集成仍无验收。代码量和旧回执兼容有明确调用依据,共享追加提取适当,未发现需要另建 owner 或扩大重构的理由。后续安装/模型和组合收益仍由原交付流程验证;此评审不关闭父目标、不批准 merge。

English verdict: APPROVE at 3b7534a. The original File/SQLite scope counterexample now passes without weakening intent, ownership, CAS, replay or concurrent freshness. 26 current Python and 153 TypeScript tests plus standard premerge pass; 24 explicit PostgreSQL cases are skipped. Earlier 129 Python results remain attributed to head509.

@huangruiteng
huangruiteng merged commit e2fb838 into main Nov 8, 2026
31 of 43 checks passed
@huangruiteng
huangruiteng deleted the codex/batched-review-basis-20261108 branch November 8, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants