Skip to content

Preserve distinct same-second replan work evidence - #8742

Merged
huangruiteng merged 7 commits into
mainfrom
codex/retain-same-second-replan-evidence-20261114
Nov 16, 2026
Merged

huangruiteng merged 7 commits into
mainfrom
codex/retain-same-second-replan-evidence-20261114

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Two ordinary work records from different settled Todo Turns can have identical summaries and timestamps. The replan projection keeps both work records addressable, credits an exact replay once, and waits for work that belongs to the planned Todo before marking an earlier result as followed through.

The projection checks the actual planned Todo against the existing settlement decoder, including when a typed observation names the Todo only through its work item. A scoped v1 Todo decision keeps its Todo binding and the same history reference as its v0 representation. The history index supplies the Goal and append position for older records where available. Legacy typed observations with an indexed position can still follow through, and accounting records cannot consume work evidence.

Author Declaration

Criterion Disposition Evidence
Distinct settled Turns and replay Implemented The same-second index produces two separate work references and credits an exact replay once.
Planned Todo attribution Implemented File and SQLite preserve earlier pending evidence when a typed-only Todo claim carries a different replan obligation. A matching Todo settlement still follows through.
Scoped Todo decisions Implemented A valid v1 Todo decision is selected and shares its derivation with v0. A conflicting binding ID cannot qualify.
Older history Implemented The index supplies a missing outer Goal or a known append position for typed legacy work without a settlement field. Scoped history retains established references, including rejected work and accounting records.

Scope And Continuation

The TypeScript projection owns eligibility and references. The Python codec carries source ordering and identity facts from the existing index. The quota guard, previous-review citation route and history CLI use the same projection. UI impact is none.

Validation

  • Tested revision 7b8e0393904f2f4c4dae1fa616d300c3d2d4c45c against base f38fae05bb9a1c2cc54a2641359224cc253d32ac.
  • Author validation run state finished.
  • Input classes synthetic and public_fixture.
Check kind Result Evidence
real_entrypoint / regression_parity passed The exact independent File/SQLite fixture had four expected failures and six passes at 15d0b1518fa4c95007556e752c7d4c5a8740e449. All ten passed on this revision. The tracked extended matrix covers the true absence of a settlement field, a legacy accounting record, a valid typed-only Todo, and unrelated obligation progress. History reads preserve the original index bytes.
real_backend passed 223 Python tests cover quota and history CLI, append order, successor reentry, evidence transport and settlement.
unit / static passed 131 TypeScript tests, the control-plane typecheck, and Ruff on the changed Python files.
integration passed Standard premerge passed 17 selected checks and the direct checks against the verified base.
static failed on base and head The digest-owner suite reports the same inherited matcher at native_child_result_inbox.ts:109 on both revisions. #8836 carries the matcher repair.
integration pending Independent review and hosted checks for this revision. Installed-host and live model adoption remain unverified.
uv run --extra test python -m pytest -q tests/control_plane/test_replan_context_order.py \
  -k 'nested_only_turn or settlement_identity_controls or projected_work_uses'

Fixture SHA-256 e2b2a4e575fee7aaa120f9d7810fd48aaba51204ad2fdc1d295c6464c33d608e.

Boundary Checklist

  • Public-safe fixtures and evidence summaries.
  • Bilingual protocol description.
  • DCO sign-off on author and integration commits.

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 · reasoning_effort=max

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

评审提交 83e24aacb0ca97a634112f092f761f3a965d1060;对照目标基线 0dfaf72549687b3d4b26f6cfdbaa3d134fa78c3d。

[P2] 同一轮的冲突 effect ID 会多计一份工作成果。 在隔离的追加索引中,让同一 Goal、Agent、Todo、Turn 的同一份普通成果出现两次。第二条只把 effect_id 换成另一 Goal/Agent 的值。 候选仍接受两条记录作为独立来源,ordinary_work.recorded_count 和 work_result_use.unresolved_count 都从 1 变成 2。未匹配的 effect ID 还生成了可读的新证据引用。 触发分支

动机 / Motivation

根据已有工作成果决定是否继续同一条路线的 Agent 和维护者。 下一次 replan 要看完已声明工作的本轮成果,并决定如何接续。同秒的两轮会出现相同摘要。 目标基线在同一索引输入下只计一份 ordinary_work 和一份待跟进成果。 复盘可能把同一次工作当成两份证据,重复追踪或把尚未验证的新工作当成已经发生。 两轮真实不同的结算身份在同一秒、同一内容下,候选会返回两份成果;完全重放不增加计数。新引用与旧引用都能从 history CLI 读回。 负例用合成记录写入隔离索引,走实际 projection、history CLI 和现有写回资格判断。File/SQLite 另跑原生 CLI 的复盘到写回链。未发现正常 writer 会生成冲突 effect ID;未查询托管 CI 或使用线上 Goal。

改动思路 / Approach

现有 append index 持有源记录与顺序。TypeScript replan owner 负责投影,settlement owner 定义可校验的身份。 复用 settlement owner 核对 effect_id 与 Goal、Agent、Todo、Turn 完整一致,再用规范身份区分同秒的独立成果。冲突行保留历史可读性,但不能与原轮合计为两份已声明成果。 从现有追加记录生成引用与完整计数。正确时,两轮都进入待复盘,重放不新增。

具体改动 / Changes

关键代码讲解

补丁用 workEvidenceRef 把普通成果和现有 Turn 绑定关联;typed progress 和纯记账沿用旧引用。真正不同的两轮现在能同时出现在 followthrough。todoWorkIdentity 校验了四个外层字段,但 effect_id 只要非空就进入新哈希。现有 settlement owner 已有规范值可对照。 读取证据身份 规范结算身份

按 docs/reference/protocols/goal-vision-replan-contract-v0.md 的当前基线约束,独立同秒结果 已验证;历史引用与真实接续 已验证;冲突记录不能增量 未满足。基线验收依据

对主干的风险 / Risks

把隔离索引里第二条的 effect ID 改成另一个来源,相同的两次读取在基线得到 1 份,在候选得到 2 份。两条新引用均可读取,说明问题出在工作证据资格。修复时在同一个 owner 同时检查两种计数。

语义与 CI 对齐

TypeScript replan 31 项、定向 Python 54 项通过。基线与候选分别跑完 File/SQLite 的原生复盘与后继写回。标准 premerge 13 项选中检查通过。独立追加索引反例仍失败。 负例用合成记录写入隔离索引,走实际 projection、history CLI 和现有写回资格判断。File/SQLite 另跑原生 CLI 的复盘到写回链。未发现正常 writer 会生成冲突 effect ID;未查询托管 CI 或使用线上 Goal。

我的整体评价 / Verdict

请求修改。复用 settlement owner 核对 effect_id 与 Goal、Agent、Todo、Turn 完整一致,再用规范身份区分同秒的独立成果。冲突行保留历史可读性,但不能与原轮合计为两份已声明成果。 在同一真实索引和 history CLI 上对照独立同秒 Turn、完全重放和同 Turn 冲突 effect ID。检验两种计数、旧引用回读和索引字节不变。

English verdict: REQUEST_CHANGES at 83e24aa. The patch preserves distinct valid turns, but a contradictory effect ID makes the same turn count twice. Reuse canonical settlement identity before assigning a distinct work reference.

…tain-same-second-replan-evidence-20261114

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 / reasoning effort max

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

[P2] 验证用于接续的复盘结算身份。 一次合法工作后接着记录已接受的复盘和一条后续工作。只替换复盘行的 effect_id 为另一个 Goal 的值,候选仍选择该复盘,并将前一份结果记为已接续。 两个版本的同索引对照都显示已接续 1 份。原结算身份与修改过的 decision 在 history 中均可追溯。让 decisionBindingMatches 的 v0 分支同时验证规范 effect。无效决定可以在历史中查询,在接续投影中不得认领前一份成果。 v0 决定资格 · 接续依据

[P2] 保留只在结算身份内保存 Turn 的历史证据。 同一份合法工作的完整规范结算身份保留 Turn。去掉记录外层的重复 turn_instance_id 后,基线仍得到 1 份普通成果和 1 份待跟进结果,候选两项均为 0。两端的历史 CLI 都能读回原引用。 既有逻辑 Turn 提取能从该行取得原 Turn。显式写入另一个外层 Turn 时,候选排除了该行。兼容只有内层 Turn 的历史记录。外层值存在时校验两者一致,再核规范 effect。 资格检查

动机 / Motivation

用已有工作成果决定下一步的 Agent 和维护者。 一个待复盘 Todo 同一秒完成两轮,公开字段相同时,目标基线只保留一份。 候选对两条不同合法 Turn 保留两份独立结果,完全重放、外来 effect 和缺 effect 的普通行没有加计数。旧引用和两个新引用均通过 history CLI 读回,索引字节相同。

上次审阅的提交 83e24aa 在同一输入下记录了 4 份。候选修复了先前指出的普通证据冲突。接续反例使用隔离追加索引。正常 writer 如何产生损坏行与已安装宿主行为未实测。

改动思路 / Approach

本 PR 的边界是现有 replan 投影的工作身份、旧引用和结果接续。 在已有 TypeScript 读模型内复用结算身份,补齐同一个身份检查的各个消费者。 追加索引保留来源顺序,现有 settlement owner 定义规范 effect,history CLI 继续解析旧引用。按 docs/reference/protocols/goal-vision-replan-contract-v0.md 在 4b5bf09 的 原接续契约 评审。

具体改动 / Changes

  • distinct-recorded-observations 已验证。workEvidenceRef 为合法普通回写绑定完整身份,两个同秒结果与旧引用都可按原 Agent 回读。typed progress 和记账沿用历史引用。工作证据引用
  • decision-source-binding 仍未满足。workResultUse 保留历史别名,后续普通结果进入待跟进前先校验身份;acceptedDecisionSource 使用的 v0 判定仍允许冲突 effect,以致下一条合法工作可以消耗前一份结果。来源判定与接续
  • historical-recorded-work 出现兼容回归。普通证据与审阅引用的过滤需要区分外层副本缺失与值冲突。新增双语协议说明和三个测试文件覆盖了完整合法身份、同秒重放、旧引用与冲突普通回写。协议说明

对主干的风险 / Risks

接续反例在同一隔离追加索引和实际 history CLI 上比较。定向 Python 82 项基线通过、83 项候选通过,包含 File 与 SQLite 的 quota 和后继恢复。选定 TypeScript 用例基线 67 项、候选 68 项,双方 typecheck 通过。较宽 TypeScript 验证涉及的 digest owner 失败已独立归因,双方在 native_child_result_inbox.ts 第 109 行同一模式报错。

我的整体评价 / Verdict

请求修改。让 decisionBindingMatches 的 v0 分支同时验证规范 effect。无效决定可以在历史中查询,在接续投影中不得认领前一份成果。 兼容只有内层 Turn 的历史记录。外层值存在时校验两者一致,再核规范 effect。 在同一索引上核对当前普通行修复、旧引用与两个新增反例。

English verdict: REQUEST_CHANGES at 5ca5a07. Same-second work is preserved, but a mismatched v0 decision still consumes prior evidence and a legacy nested-only Turn loses valid recorded work.

…plan-decision-settlement-proof-20261116

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 · reasoning_effort=max

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

评审提交 83e5f19a630cc217909b91a93811ce04d6fcdc73,目标基线 f3bdad2387397e078fbc887e7cb7ed80adaf7510。

[P2] 带外来 effect 的身份缺少 schema 时仍能认领成果。 在一次已接受的复盘指向后续 Todo 后,追加一条带外来 effect_id 的后续工作。保留 v0 schema 时,File 和 SQLite 都保留旧成果待跟进。只删除 schema_version 或换成未知值,两端都把旧成果记成已接续,并多计一条工作。识别显式携带的结算身份对象。缺失或不支持的 schema 应使该记录退出工作资格判断,历史查询仍能读回它。 结算身份检查

[P2] 缺少外层 Goal ID 的合法历史成果被排除。 从同一 Goal 的历史索引读入一条规范 v0 回写,只省略外层 goal_id。Codec 已从索引所属 Goal 补齐可读行,新增检查仍与源记录的空值比较。两种后端在主干都得到一份工作和一份已接续成果,候选两项归零。身份比较使用 codec 从所属索引确定的 Goal ID。继续验证已有外层 Goal 与规范身份的一致性。 源字段比较 · 历史 scope

动机 / Motivation

依赖历史成果决定下一步的 Agent 和维护者会看到这处变化。同一个待复盘 Todo 在一秒内完成两轮,结果摘要相同时,主干只能展示一份。下一轮复盘会漏掉一次实际尝试。候选在 File 和 SQLite 上都保留了两个合法 Turn,并将完全重放计为一次。另有两个身份边界会改变既有成果的归属。本次评审覆盖源码 CLI 读取隔离追加索引,验证证据归属和历史回读。已安装宿主与实际模型采用仍未实测。

改动思路 / Approach

现有结算 owner 生成规范 effect,TypeScript 投影利用它区分 Turn,已有历史读取负责兼容旧引用。这三项可以在当前调用链内完成。当前 PR 只需在相同读取链中保留独立证据,并区分可查询历史与可归因的成果。 仅按显示字段生成引用会继续丢掉同秒记录。仅按 effect 生成引用又会失去同轮不同内容的校验和旧引用读回。现有追加顺序仍决定哪份计划先出现、哪份成果后来产生。

具体改动 / Changes

关键代码讲解

  • workEvidenceRef 在普通回写的显示内容上纳入结算身份与 Goal instance。同秒且内容相同的两轮可各自读回。typed progress 与计费记录使用已有的历史引用。 证据引用

  • recordedDecisionSource 识别可读历史,acceptedDecisionSource 再检查工作资格。候选已能保留只有内层 Turn 的合法记录,并阻止先前发现的外来 v0 decision 认证旧成果。 决定资格

  • workResultUse 逐条处理接受的计划和后续成果,reviewEvidence 用同一资格检查核对引用。三个测试文件分别覆盖引用、追加顺序和 TypeScript 投影的兼容路径。双语协议补充了身份核对规则。 读取接续 · 引用校验 · 历史用例

规范 docs/reference/protocols/goal-vision-replan-contract-v0.md @ 4b5bf09cdf97b93e2d96eb1144df2a83212f4ade。 接续规范

  • append-order-observations 已实现。合法同秒结果在 File 和 SQLite 都得到两个独立引用,原样重放不增加计数。
  • historical-reference-readback 已实现。原引用、两个新引用和先前外来 v0 decision 的历史引用均可查询,接续时仍校验资格。
  • declared-work-attribution 未满足。缺少 schema 的冲突来源可关闭待跟进项,缺少冗余 Goal ID 的规范来源失去资格。
  • stride-off-readonly 已实现。关掉 stride 策略仍可读取通用接续和 scoped history,隔离索引的字节一致。

对主干的风险 / Risks

在两种后端运行同一 CLI 夹具。规范的后续工作在两端都能接续一次。对照测试还读回了旧成果引用。当前两处偏差分别让复盘提前结案或重复追问已完成的工作。合成索引只用于重现来源形状。

追加记录 主干已接续 候选已接续
规范后续工作 1 1
外来 effect,v0 schema 1 0
同一外来 effect,缺失或未知 schema 1 1
规范 effect,省略外层 Goal ID 1 0

语义与 CI 对齐

定向 Python 基线 82 项、候选 87 项通过。TypeScript 基线 66 项、候选 67 项通过。候选标准 premerge 的 17 项选中检查和 5 项直接检查通过。候选 TypeScript control-plane typecheck 与定向 Ruff 通过。 SHA-256 owner 检查在基线和候选各有同一项既有失败,定位到结果文件与 Lark 的三个匹配式,由 #8836 跟进。托管 CI 未查询。上述两组反例分别违反已声明工作归因与旧记录 scope 的现有契约。在现有 replan context 顺序集成测试加入两例,File/SQLite 用 quota should-run 检查计数与旧成果是否待跟进,再用 history 对照同一引用。

我的整体评价 / Verdict

请求修改。独立结果的引用方式适合复用现有 owner,已有索引与历史查询足以承载兼容。长程复盘目前仍会误关闭或漏掉有效成果。CLI 的历史查询通过,接续状态需要按两种来源分别修正。界面视觉检查不适用,因为本次只改 CLI 和 replan 证据投影。

English verdict: REQUEST_CHANGES at 83e5f19. File and SQLite accept a foreign effect with an unknown or missing schema and drop valid scoped history when the outer Goal ID is absent.

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 · reasoning_effort=max

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

评审 15d0b1518fa4c95007556e752c7d4c5a8740e449,目标主干 f3bdad2387397e078fbc887e7cb7ed80adaf7510,复验前一提交 83e5f19a630cc217909b91a93811ce04d6fcdc73。

动机 / Motivation

根据历史成果判断已计划 Todo 是否做过,以及还有哪些新证据需要复盘的维护者和 Agent。 同一秒内两轮合法回写使用同一个摘要时,旧版只保留一份证据。若另一条重规划记录碰巧写入已计划 Todo 的进展 ID,旧版也可能提前结束待跟进的成果。 File 和 SQLite 均能读回两个同秒、不同 Turn 的成果,同一记录重放仍只计一次。当前修复拒绝缺失或未知身份 schema 及显式冲突 Todo,保留缺外层 Goal 或 Turn 的合法历史。仅在 typed progress 里声明 Todo 时,仍有一条错误归因。 验证使用源码 CLI、本地 File 与 SQLite、隔离追加历史和合成身份。实装宿主及模型如何采用这些证据待验证。

已有待跟进结果可被另一条重规划回执错误关闭。另有一项 v1 Todo 兼容缺口,结算解析器接受该形状,决定投影仍跳回旧决定。

改动思路 / Approach

复用原结算身份解析器、已有 history 和 TypeScript 投影,按追加顺序区分记录。Todo 归因需要使用同一个目标解析来决定应校验谁的结算,保持证据读回独立可用。 该切片包含普通进展、已记录决定、待跟进结果和历史读回。身份核验只决定证据能否归给某个 Todo,原结算、执行授权和调度沿现有 owner。 在开始 Todo 归因时解析实际将使用的 Todo,复用现有结算 owner 核对其绑定。v1 合法 Todo 按解析出的 binding_kind 进入决定分支。保留无法归因的历史读回。

具体改动 / Changes

6 个文件新增 407 行、删除 75 行。生产主要改 TypeScript 归因和 Python 来源传输,新增验证集中在真实 CLI 读取与重放。原规范为 docs/reference/protocols/goal-vision-replan-contract-v0.md @ f3bdad2387397e078fbc887e7cb7ed80adaf7510。 接续规范 前一头评审

  • distinct-work。不同 Turn 的同秒成果分别保留,精确重放只计一次。 已复验通过。
  • scoped-legacy-history。历史缺外层 Goal/Turn 仍按原作用域和同一身份读回。 已复验通过。
  • attribution-from-every-todo-branch。Todo 归因需要与实际已接受的后续 Todo 和结算绑定相符。 当前仍有缺口。
  • legacy-reference-and-off。原 history 引用继续读回,不从共用投影启用 Stride。 已复验通过。
  • v1-todo-decision。同一规范 Todo 绑定在决定和后续成果采用相同有效边界。 当前仍有缺口。

关键代码讲解

  • replan_evidence_rows。携带历史所属 Goal、精确来源和可校验的身份字段。 代码
  • hasConflictingTodoSettlement。使用现有结算解码器校验声明的 Todo 身份,当前提前退出漏掉 typed progress 的有效 Todo。 代码
  • workEvidenceRef。用现有结算身份区分同秒摘要,保留旧引用路径。 代码
  • recordedDecisionBindingMatches。处理所存决定的身份形状,v1 分支当前只接收自主重规划。 代码
  • workResultUse。按追加顺序关联待跟进成果、引用它的决定和 Todo 后续工作。 代码

对主干的风险 / Risks

[P2] 用实际归因的 Todo 核对声明的结算身份。 一次已接受复盘引用待跟进结果并安排 Todo B,后续记录无外层 todo_id。其有效 autonomous_replan 结算绑定另一义务,而 progress_observation.work_item_id 为 B。 File 和 SQLite 上均把旧成果标为已接续,把这条重规划记录当作 Todo B 的材料回写。只增加显式的外层 B 后,当前头两端均正确拒绝。同三版本的匹配夹具证明此前错误还剩这一条入口。 在已有 Todo 结果归因处先取 observationTodo 实际使用的 Todo,再对该 Todo 验证已声明的结算绑定。保留真实非 Todo 观测和无结算身份的历史兼容。 代码

[P3] 将 v1 Todo 决定与 v1 自主重规划区别处理。 匹配的 Todo 决定通过规范 v1 binding_kind=todo、binding_id=原Todo 编码,其他 Goal/Agent/Turn/effect 与 v0 对照相同。 结算身份读者接受 v1 Todo。实际 quota 换成同义 v1 时,两后端忽略该决定,并选出更早的决定。v0 同输入成功,当前普通 v1 Todo 回写也已通过。 对源决定按共享解析器的绑定分类。Todo 保留 Todo 字段,autonomous_replan 使用义务字段。维持已有历史引用可回读。 代码

同一组 20 例在上一候选通过 6 例,当前 20 例全通过。额外的同输入反例在当前两种后端还有四处失败。74 项 Python、114 项 TypeScript、6 项直接和 17 项标准预检通过。两端有同一个既有摘要归属失败,由 #8836 跟进。Goal 合并质量回执仍缺。 摘要归属跟进

我的整体评价 / Verdict

同秒去重、旧历史载入和此前发现的显式身份反例通过。只在 typed progress 里声明 Todo 的分支仍误认另一条重规划回执,需修复后才能通过。 让所有 Todo 归因分支对同一个有效 Todo 检查已声明结算。在 File/SQLite 覆盖仅 typed progress 声明、显式 Todo、无身份历史及合法 v0/v1 Todo 决定。

English verdict: REQUEST_CHANGES at 15d0b1518fa4c95007556e752c7d4c5a8740e449. Same-second work is independently readable on both stores. A typed-only Todo claim still borrows an autonomous replan receipt and consumes the prior result. A valid v1 Todo decision still falls back to the earlier decision.

Verify the actual Todo targeted by an observation through the existing settlement decoder, and project scoped v1 decisions with their Todo identity. Carry known append positions for historical typed observations without identity fields, while excluding accounting rows from attributed work and retaining original history references.

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 · reasoning_effort=max

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

评审 head 7b8e039,对照目标 main f38fae0 并复验前一提交 15d0b15。 前一头评审

动机 / Motivation

通过普通 quota guard 和历史证据评估此前决定、准备下一轮工作的 Agent。 此前两个同秒成果可能合成一个引用。另一个重规划义务的回执可在只声明 typed progress Todo 时被误认成后续工作,有效的 v1 Todo 决定也会回退到旧决定。 当前 File 和 SQLite 分别读回两个原成果,再重放仍只计原一次。仅有 typed progress 的后续工作须通过它所归属 Todo 的结算核验。 同一已验证 Todo 的 v0、v1 决定保留相同历史引用,正确的原 Todo 回写能够消耗所引用的旧结果。 同一历史中的另一个 autonomous_replan 回执即使在 work_item_id 写入计划 Todo,也不会把前一份成果标为已接续。该义务自身的真实观察仍可见。 索引补齐旧记录的 Goal 和追加位置,兼容缺外层 Turn 或原结算身份的历史。过时或冲突身份仍可按原历史引用读回。 实际安装的 Host 与真实模型是否使用这份反馈仍待验证。

改动思路 / Approach

沿用既有 TypeScript projection 与结算身份解码器,Python codec 提供原 Goal 和索引顺序。 本次交付历史证据区分、Todo 归因及精确引用回读,涉及 quota、history 与 Stride 引用校验。 让普通读回保留历史引用,在决定与后续工作关联时验证实际归属的 Todo。单靠外层 todo_id 会漏掉 typed progress 的真实归属,单靠摘要无法区分原有两个 Turn。

具体改动 / Changes

GitHub 公布的 6 个文件逐项匹配当前 main 的差异,+540/-87。生产改动集中在两处。原索引给出可核对的历史顺序,TypeScript 用精确结算身份区分同秒的普通工作,并在后续引用与已计划 Todo 之间核验归属。 接续规范 · Todo 归因 · 成果引用 · v1 决定 · 旧索引顺序

  • distinct-work。同秒同摘要的两个合法 Turn 各有可读的引用,原记录重复出现时只计一次。
  • scoped-legacy-history。缺少外层 Goal 或 Turn 的已存历史沿原索引和原作用域读回。
  • attribution-from-every-todo-branch。只在 typed progress 指明 Todo 时仍验证实际结算主体。
  • legacy-reference-and-off。旧引用可重放,Stride off 继续读已有历史证据。
  • v1-todo-decision。规范 v1 Todo 保留 v0 的决定来源及有效归属。

语义与 CI 对齐

只把原工作可验证的归属用于接续判断。原证据、实际采用和收益各自有证据门槛,回写的记录只支持第一项。普通 guard 的权限、调度、预算和关闭时原行为按现有 owner。

对主干的风险 / Risks

  • 同一独立探针在 main 为 4 过、6 项预期失败,前一候选为 6 过、4 项预期失败,当前 10 项通过。 两后端都拒绝把另一条重规划回执当作该 Todo 的后续工作,且选回原有效 scoped v1 Todo 决定。 实际 CLI 反例
  • 以相同追加记录在两后端对照,主干各只返回一个待跟进成果,候选各返回两个,两个引用均经 history CLI 读回。重复项只计一次。读回前后原索引逐字相同。目标 head 的 115 项 Python、33 项 TypeScript、定向 Ruff、控制面类型检查及 diff 检查通过。 引用读回用例
  • Stride off 保留原普通 guard、历史回读和只读 followthrough,未启用 Stride 或 Explore、未写原索引、未增加扣额。 测试使用隔离本地权威后端和合成工作记录。GitHub CI 未查询。

我的整体评价 / Verdict

批准当前提交的代码结论。实际差异的生产改动在 CLI 的历史读回及重规划投影。App/Lark 的渲染文件与目标 main 相同。 实际安装的 Host 与真实模型是否使用这份反馈仍待验证。 真实 CLI 已覆盖同秒结果去重、旧引用读回、正确结算归属及未声明结算历史的兼容处理。

英文简短结论

English verdict: APPROVE at 7b8e039. File and SQLite keep distinct same-second work readable, reject a mismatched typed-only Todo attribution, and preserve the original decision reference for v1 Todo bindings.

@huangruiteng huangruiteng left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · Codex · OpenAI · self_reported

动机 / Motivation

同一秒、同摘要但属于不同 settled Turn 的工作必须继续保持可区分;只有实际归属到计划 Todo、且结算身份一致的后续记录,才能把先前成果标记为已接续。旧实现会合并独立成果,也可能让冲突 effect 或错误 Todo 认领前一份结果。

改动思路 / Approach

改动沿用既有 replan-context projection 和 settlement decoder。Python 历史 codec 提供原 Goal、索引顺序和缺失外层字段的兼容读取,TypeScript 负责规范化结算身份、Todo 归因、同秒结果去重和 v0/v1 决定引用。

具体改动 / Changes

当前 head 7b8e0393904f2f4c4dae1fa616d300c3d2d4c45c 保留同一秒不同 Turn 的多个历史引用;完全重放只计一次;冲突 effect ID、错误 Goal/Agent/Todo、缺失或不支持的 schema 不会认领成果;typed progress 先解析实际归属的 Todo,再核验声明的结算身份;缺失外层 Goal/Turn 时由所属历史索引补齐,已有外层字段时继续做一致性检查;v1 Todo 决定和 autonomous replan 决定按各自绑定字段解析,并保持原历史引用。7 个历史 review thread 均已按当前代码和测试逐项核对并 resolve,讨论内容仍然保留,没有通过放宽预算、吞错误或重试掩盖问题。

对主干的风险 / Risks

无阻断发现。真实路径验证包括 32 个 File/SQLite replan-context Python 用例和 33 个 TypeScript replan-context 用例,覆盖同秒独立成果、重放去重、错误身份拒绝、旧索引读取、typed Todo 归因和 v1 决定。CI 中 digest-owner 失败是 #8836 的既有 matcher,另外的 real-server 与浏览器失败不在本 PR 改动文件内;安装态和真实模型采用仍未在本 PR 证明。

我的整体评价 / Verdict

APPROVE。该改动修复了成果合并、错误接续和无依据 Todo 认领三类语义问题,同时保留历史可读性、普通 guard 权限和关闭 Stride 时的原行为。

English verdict: APPROVE at 7b8e039. Distinct same-second work remains addressable, conflicting settlement identities and Todo attributions cannot claim prior results, and focused File/SQLite plus TypeScript verification passed.

@huangruiteng
huangruiteng merged commit e72b99b into main Nov 16, 2026
40 of 52 checks passed
@huangruiteng
huangruiteng deleted the codex/retain-same-second-replan-evidence-20261114 branch November 16, 2026 04:49
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