Repository navigation
test(periodic-report): preserve Turn milestones through retry recovery - #5951
Conversation
…anges Signed-off-by: hyk <4408344+hhyykk@users.noreply.github.com>
Signed-off-by: hyk <4408344+hhyykk@users.noreply.github.com>
852344f to
d6b36cc
Compare
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
…caller-regression-20261008 Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
Duang777
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; self_reported; Codex; OpenAI
动机
受影响的是维护 Turn 周期报告恢复语义的评审者和后续修改者。当可选派发失败、响应丢失或功能关闭后重放同一 Turn 时,测试应证明 Host、主写回和 quota 都只发生一次,关闭模式不创建 sidecar 也不执行可选读取。该 PR 只新增回归覆盖,验证既有 File、SQLite 与 DSH/通用 Host 路径在四种模式下保持幂等。它不修改产品字节,也不声称覆盖 PostgreSQL、真实模型或安装态运行。
这项覆盖补上的是跨边界恢复行为,而不是单个 helper 的实现细节:如果意图在响应丢失后不能从已提交 Turn 重建,周期报告会丢失;如果 replay 再次调用 Host、写回或扣额度,则会重复副作用和成本。
改动思路
新增测试通过真实 CLI handler 建立 File/SQLite fixture,先关闭一个已验收阶段,再让 generic CLI 或 DSH Host 返回 replan_required。测试在 post-writeback hook 前后注入派发失败和响应丢失,并用原 resume_turn_key 重放,随后读取 run index、refresh JSON、sidecar 和 pending intent,比较原始 provider revision 与后来新增 Todo 的 revision。
参数矩阵为 3 组 provider/host 组合乘 4 种模式:File + generic CLI、SQLite + generic CLI、File + DSH;standard、dispatch failure、response loss、feature off。权威状态仍由现有 Turn writeback、provider 和 quota ledger 负责,测试只观察其公开 CLI/持久化结果,没有引入新的决策 owner 或兼容分支。
具体改动
唯一变更是新增 tests/capabilities/test_periodic_report_turn_replan.py,共 307 行。没有生产、协议、文档或生成文件变化,也没有新 vocabulary。
关键内容讲解
_fixture复用项目既有_write_live_fixture和 SQLite 隔离初始化,只为 Goal 打开 periodic report 配置;File 与 SQLite 均不重复初始化。test_turn_milestone_intent_is_replay_stable通过参数化覆盖 12 个 case。首次 Turn 必须写入 active successor vision、一次 quota spend 和一次 Host 调用。inject_optional_failure分别模拟 sidecar 提交前失败与提交后响应丢失;恢复时 replay 必须返回同一 intent,不重复 primary writeback、Host 或 quota。- feature-off 分支对
read_heartbeat_settlement计数,要求既无 sidecar、无 pending intent,也无可选读取,证明关闭态没有额外观察副作用。
这里没有独立书面规格;验收基于现有 Turn replay、periodic-report post-writeback hook 与 quota 幂等契约,以及该文件对公开结果的字面断言。
对主干的风险
未发现 P0-P2 缺陷。测试文件较长,但 12 个 case 共享一个状态机流程,断言同时覆盖原 provider revision、later Todo 隔离、sidecar 数量、intent idempotency key、Host 计数和 quota ledger;拆成重复 fixture 会增加维护成本。现有覆盖扫描没有发现另一份同时跨 File/SQLite、generic CLI/DSH、派发失败/响应丢失/OFF 的同形测试,因此这不是同作者批量 smoke 或已有用例的简单复制。
exact head 1f71a252d21526f0e8d37f4b6573a5efb96e1e0e 的 12 个新增 case 全部通过。远端聚合红灯分别命中未修改的 personal-workspace display-name assertion 和 Windows 计时边界;不可变 base 与 head 的相同命令呈现相同签名,而本 PR 唯一新增文件的 changed invariant 有独立通过证据。因此这些失败不改变代码评审结论,但继续阻止把本次批准当作 merge readiness。
我的整体评价
APPROVE。 这是 test-only、可独立回滚且具有长期回归价值的覆盖:它保护已发货的 Turn writeback、恢复和 feature-off 隔离,并能在未来 optional hook 或 provider 改动导致重复副作用时直接失败。长程工作与用户路径都没有产品字节变化;剩余风险是正常 managed runtime 因本地 IPC 权限未在本轮资格中执行,以及 PostgreSQL、真实模型和安装态未覆盖。批准仅绑定当前 head,不清除 CI/维护者合并门禁。
English verdict: APPROVE - exact head 1f71a252d21526f0e8d37f4b6573a5efb96e1e0e adds 12 passing File/SQLite and generic CLI/DSH replay cases without changing product code; unrelated base-equal CI failures remain a separate merge-readiness hold.
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
动机
维护周期报告的开发者需要确认:一次 Turn 重规划已提交后,失败重试仍能找到原来的报告里程碑。
此前已有运行时修复,但缺少把原生 Turn、已接受的后继、可选报告失败和后来状态变化串起来的持续回归;现在一个参数化集成测试覆盖这些组合。
本次独立执行观察到:重放保留同一个 intent,Host 执行、主写回和扣额各一次,后来的开放 Todo 与未被接受的 Vision 不替换原来源。
本 PR 只增加持续测试,不改变运行时、报告生成或外部发送,也不宣称真实模型、安装态、完整 PostgreSQL Turn 或 Lark 已通过。
改动思路
这是一项覆盖已交付运行时的集成回归。现有 turn run-once 负责执行、验证和主结算,periodic-report 仍是提交后的可选观察者;测试不复制这两个 owner 的规则。正常 managed Node transport、真实 File/SQLite authority 和实际 Host 子进程都参与运行,Host 返回的业务决定采用合成数据。
| 分支 | 必须保留的结果 |
|---|---|
| 正常及重复重放 | 同一已接受后继生成同一 intent,主效果和 Host 各一次 |
| 可选调用失败/响应丢失 | 后来 Todo、未接受的 Vision 不替代原来源,原 Turn 恢复 intent |
| reporting 关闭 | 不读可选 settlement/source,不产生 sidecar 或 pending intent |
只测试纯阶段判断会漏掉提交、原来源与恢复之间的接缝;这里复用已有 live fixture、一次初始化和同一个参数化模块,边界合理。
具体改动
实际 6e8688d8d90f1c5a99fadf81def8e4ca2e79c925...1f71a252d21526f0e8d37f4b6573a5efb96e1e0e 只有一个新增测试文件,307 行;没有产品或文档字节变化。描述中的早期 runtime 依赖 #5935/#5939 已在主干,完整相关正文及实际合并祖先已核对。
关键内容讲解
_fixture先选择真实 provider,再启用合成 weekly profile;沿已有_write_live_fixture初始化,不重复建立 provider。test_turn_milestone_intent_is_replay_stable以 3 组 host/provider × 4 个模式覆盖 12 例。初次执行读取真正落盘的 accepted ACK、Vision 与来源 revision;随后加入开放 Todo 和未接受的 Vision,再恢复原 Turn,核对原 revision、同一 frontier identity、唯一主写回、唯一扣额和唯一 Host 调用。- 文件末尾还核对空写 scope、未授予生成/外发权限、真实 trigger evaluation 及 pending-intent 的幂等键。生成一个 intent 没有被混称为完成报告或发出消息。
规范依据为 periodic-report-v0,固定 revision 6e8688d8d90f1c5a99fadf81def8e4ca2e79c925。逐项映射:Post-writeback hook boundary 的原提交/原来源/重放由上述矩阵覆盖;Disabled reporting 的零可选读取/sidecar 由 OFF 三例覆盖;Recorded trigger intent 的权限边界由末尾断言覆盖。文档保留的完整 PG Turn、前端/Lark 与模型资格不因本测试而关闭。
对主干的风险
独立执行 uv run --extra test python -m pytest -q tests/capabilities/test_periodic_report_turn_replan.py:12 passed,0 skipped,未替换 stdio 或 managed runtime。正常主流程通过之后,我在私有探针中仅移除可选 drain,保留原断言,原生 public CLI 用例在第 186 行准确失败;这证明它能捕获“主流程成功但未处理报告观察者”的实质回归。该预期失败属于探针,未修改提案源码。
standard premerge 的 5 项直接检查、3 项 catalog 检查全部通过,没有 failure、warning 或 manual hold。没有查询、轮询或等待远端 CI。合成 Host 和注入失败只能证明这里的控制与恢复合同,不能证明模型遵守、正式安装、全平台或外部服务行为。
重复覆盖也已核对:现有 test_periodic_report_turn_writeback.py 保护 closed-current-Vision/terminal 路线,Turn driver 测试保护一般 material replan;本文件保护 accepted ACTIVE successor 与可选报告恢复的组合。对同作者 periodic 标题 PR 的有界检索共 3 项,另两项是已合入实现,不构成重复测试堆叠。保留共享 fixture 和现有语义断言即可,无需另造 smoke 或框架。
我的整体评价
APPROVE,精确 head 1f71a252d21526f0e8d37f4b6573a5efb96e1e0e。这是完整而可撤销的持续覆盖增量;long_horizon 与 user_experience 均判定为 preserved:产品行为未变,测试保护继续执行与恢复,也不增加用户准备或确认轮次。没有新增状态词汇、规则 owner 或兼容分支,现有初始化复用已完成,未发现需要本 PR 再简化的机制。已检验的范围是源码路径,长期收益和安装态采用保持各自资格;评审通过不授予合并权限。
English verdict: APPROVE — 1f71a252d21526f0e8d37f4b6573a5efb96e1e0e. The test-only addition protects accepted-successor report recovery, exact replay and disabled-path isolation through real native handlers and subprocesses. All12 cases and required local premerge checks pass; a private missing-drain mutation is detected. Live-model, installed, full PostgreSQL Turn and Lark qualification remain separate.
Author revision
1f71a252d21526f0e8d37f4b6573a5efb96e1e0eincludes target main6e8688d8d90f1c5a99fadf81def8e4ca2e79c925. The final upstream delta changes documentation and tests only; product bytes and the focused test sources behind the validation below are unchanged.Turn replan commits must retain their original periodic-report intent through optional-dispatch failure, response loss and replay. Replays must not invoke the host again, repeat primary writeback or spend quota; capability OFF must create no sidecar or optional read.
This test-only update integrates current main and reuses the shared live fixture's provider initialization. File and SQLite are each initialized exactly once. The existing 12 generic-CLI/dsh and recovery/OFF cases remain intact. The earlier runtime dependencies are now on main.
Validation at base
f72b67113ff42ccf385519222a530a11ce22659c:Author test changes are complete. CI and normal-runtime qualification remain separate; no merge approval is claimed.