Repository navigation
test: repair native recovery and staged settlement readers - #7855
Conversation
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
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
维护者需要验证恢复、投递和结算规则,但部分测试仍将 native 导航或分阶段读取当作 inline 结果。 基线在准备响应后因缺少 decision 或 settlement_plan 失败;当前共享 recovery reader 与原生 staged reader 使原有业务检查继续执行。 当前提交54项相关测试通过,覆盖 File/SQLite;非零退出、摘要损坏、symlink、原身份绑定、零扣槽与源文件不变均有实证。 本 PR 只修复测试消费者,不改变生产策略、宿主、调度或权限;没有据此证明模型读取、保留、采用或长期收益。
改动思路 / Approach
共享 helper 从成功命令的当前完整 recovery 读取策略,复用现有物理文件、权限和完整摘要校验;inline/off 和非零退出的原失败响应仍保留。另一个已有 guided-start 测试执行生产输出中的 staged reader,再检查原 Turn/obligation 与结算命令。生产 replan-view 从原 capture 生成读视图,在 CLI 路由中先于实时 authority 访问返回。
最小边界是恢复已有回归检查:在已有 fixture 中抽取重复解码,并使用已有分阶段读取 owner。没有新生产协议、配置、权限、UI 或独立 smoke。队列经验仅用于审视实际 caller 和第一项有用结果;该内部前提不需新增产品入口,经验送达也不证明效果。
具体改动 / Changes
关键代码讲解
- read_cli_policy_payload 只对 returncode=0 的 full/delta 导航跟随当前 recovery,避免用旧 baseline 或可见 delta 代替当前完整策略;失败不会被成功 capture 覆盖。
- _run_generated_cli 保留实际子进程退出码,委托共享 reader;两个 refresh fixture 采用相同路径,原恢复、抑制、配置、单次扣槽和重放断言继续执行。
- guided-start 测试 在 File/SQLite 上执行原响应发出的 reader,验证原身份、validation/writeback/spend 顺序、两条命令的 obligation/Turn 绑定、visible-goal 来源、零扣槽和四个源文件字节不变。
- reader 控制 覆盖 full/delta、显式路径/reference、无效 delta/旧 baseline、inline/失败响应、摘要替换和两种 symlink。当前 reader 通过,内存中故意忽略退出码的变异会被反例抓到。
接受依据是不可变基线的 good-smokes 合同 与本 PR 五项明确要求,没有另设功能规格。current_full_recovery、failed_command_is_failure、physical_private_digest、original_assertions、staged_guided_read 均 implemented。完整五文件 +104/-21,生产源码不变。1576 个原 Assert AST 中保留1574个;两项旧 inline 形状检查明确迁到当前 channel/读取后 plan 身份及顺序检查,不能继续声称所有 AST 未变。实际54项通过和反例才是恢复覆盖的主要证据。
对主干的风险 / Risks
PASS:在当前提交 31d0a7b,Python3.12.15、pytest9.1.1、Node24.21.0 下,四个完整 reader/refresh/投影模块及 guided-start 双后端共 54 passed。当前失败覆盖变异控制通过;五条变更路径 Ruff 通过;原生 standard premerge 五项直接检查和三个选中 quota/work-lane/scheduler canary 通过。
FAIL(保留):早一提交的288-case扩展运行有22个失败;其中 guided-start 现在已修复并单独在双后端验证。对其余未变消费者的21个节点,已用相同精确选择分别运行不可变基线与当前提交:21 failed / 21 failed。逐节点完整错误匹配;先确认测试函数和 canonical fixture 的完整 AST 相等,再仅归一化 checkout 根路径与源码行号,完整失败组 SHA-256 为 ddccb8bbc4beed50562def8ea29defd0bae6e78bbac45216422f8e4376ff710c。这些旧 raw/native navigation、inline settlement 假设仍需各自 owner 修复,没有被改断言、跳过或记成通过。
上述21项是当前选择性复跑,不冒充当前提交的完整288-case结果;作者132/10等不同范围也不混为本次运行。没有查询、轮询或等待远端 CI;作者披露的历史 CI timeout 未独立归因,不能称为已排除的 flake。没有运行整仓、PostgreSQL、安装版 App、真实模型或性能测量。
我的整体评价 / Verdict
当前完整提交没有发现新阻塞,APPROVE。long_horizon=preserved:生产继续、恢复、重放和授权 owner 不变,交付是对既有行为的有效检查。user_experience=preserved:没有增加操作、配置或确认。共享 reader 与现成 staged reader 形成完整、可回退的内部验证修复;其余消费者失败和更广集成资格仍保留。
UI impact: none;完整 diff 无布局、渲染或产品文案变化,视觉证据不适用。安装、自然 Host 采用、模型保留、后续有用工作与完整成本未验证。CQR、原生 merge-readiness、review reconciliation 与实际合并权限是独立门;本评审不授予合并权。
English verdict: APPROVE at 31d0a7b — current-recovery and staged-reader assertions pass on the changed paths;21 independently matched pre-existing consumer failures remain disclosed.
Goal And Delivered Outcome
Default-native quota output uses navigation envelopes and staged reads. Refresh/recovery fixtures treated the navigation envelope as inline policy, and the guided-start todoless replan test expected an inline settlement plan. These assumptions prevented the tests from exercising the current protocol.
Reuse the existing current-capture decoder through a shared test fixture, and have the guided-start test execute its emitted staged reader. The tests now verify current recovery and the original settlement identity, command bindings and read-only behavior under the native default.
main(c334bbaf196505778149ae4edeefaa013d343259).Author Declaration
read_cli_policy_payloaduses existing production readers; real CLI and navigation-reference coverageScope And Continuation
Complete within the test-reader scope. Existing decoding is extracted into an existing fixture module; the guided-start case consumes the production reader directly. No new decoder or production decision owner is introduced. Production behavior and UI are unchanged. Test oracle reads do not establish model consumption, retention or performance improvement.
Validation
31d0a7b51dc2fb83b4de9c67664beb084b3c023a. The changed test was rerun after adding the File/SQLite matrix and read-only snapshots; the earlier expanded run covers unchanged readers and callers.decision,interaction_contractorpathlookups; those other consumers remain outside this repairThe earlier 119-case run recorded 118 passed / 1 failed. Those historical results remain valid for that revision; this repair made all 119 pass before the final File/SQLite strengthening. The final two-case matrix passed separately. The ten additional staged-suite baseline failures remain failures and limit broader qualification. Prior-head CI also reported a 30-second timeout in the unchanged
research-display-languagebrowser scenario (job). No flakiness or baseline claim is made for that CI failure. Final-head CI and independent review remain pending; this PR does not claim merge readiness.Coverage includes all direct generated-command helper consumers, the dependent goal-channel fixture consumer, and the final guided-start File/SQLite path. Current-capture negative cases passed; the wider staged-suite failures are not counted as qualified integration coverage. Full repository tests, PostgreSQL, installed hosts, real models and performance measurements were not run. No production authority/provider code changes.
Frontend / Visual Evidence
UI impact: none; test fixtures only. Visual evidence: not applicable.
Type of Change
LoopX Area
Shared-authority RFC fixture impact: not applicable; no RFC progress or provider promotion claimed.
Boundary Checklist