Skip to content

test: repair native recovery and staged settlement readers - #7855

Merged
huangruiteng merged 2 commits into
mainfrom
codex/native-refresh-test-readers-20261102-2202
Nov 2, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/native-refresh-test-readers-20261102-2202

Conversation

@cocolord

@cocolord cocolord commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • Outcome basis: reproduced test-consumer defects; base: main (c334bbaf196505778149ae4edeefaa013d343259).
  • Original refresh/recovery target files: base 8 failed / 17 passed / 5 fixture errors; repaired 30 passed.
  • The guided-start failure was independently reproduced on the same clean base. The expanded validation includes the repaired case and the full staged-read suite; remaining staged-suite failures are disclosed below.

Author Declaration

  • Written by: model_agent — TraeCode, OpenAI GPT-6 family.
  • Specification: reproduced defects and the requirements in this PR.
Criterion Disposition Owner / verification
Read current full recovery for native full/delta output implemented Shared read_cli_policy_payload uses existing production readers; real CLI and navigation-reference coverage
Preserve command failure and inline/off payloads implemented Exit code is retained; a failed command cannot be replaced by a successful capture
Retain physical-file, full-digest and private-file checks implemented Existing production readers; digest replacement and capture/reference symlink rejection
Preserve recovery, suppression, configuration, single-debit and replay behavior implemented Original recovery/notification assertions run through the corrected fixture
Consume staged guided-start settlement without readmission or spending implemented Execute the returned reader; verify original Turn/obligation, validation/writeback/spend order, both command bindings, visible-goal source and zero debit

Scope 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

  • Final tested revision: 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.
  • Run state: finished. Input classes: synthetic and public fixtures.
Check kind Result Evidence / limitation
regression_parity passed Original three files: base 8 failed / 17 passed / 5 errors; head 30 passed
unit / real_entrypoint / real_backend passed Final guided-start test: 2 passed, File and SQLite; original identity/commands, unchanged registry/state/index/capture bytes and zero debit
unit / integration failed Expanded run: 132 passed / 10 failed. All original 119 cases passed; additional staged-read suite: 13 passed / 10 failed at existing navigation-reader assumptions
regression_parity failed The same 10 additional staged-suite failures reproduced on clean main at decision, interaction_contract or path lookups; those other consumers remain outside this repair
regression_parity passed Guided-start base failure now exercises the returned staged writer and preserves the original identity/command/no-debit requirements
unit passed Nine reader cases cover current recovery, unchanged captures, inline/failure handling, digest and symlink rejection
static / integration passed Standard premerge: five direct checks and all three selected quota/work-lane/scheduler canaries
static passed Ruff, diff hygiene, staged/committed RFC bilingual checks and public-boundary scan
manual passed Disposable validation runtimes retired; no private artifacts or environment lockfile staged

The 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-language browser 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

  • Bug fix
  • Refactoring (test helper only)
  • Test update

LoopX Area

  • Control plane (validation)
  • Host or runtime integration (validation)

Shared-authority RFC fixture impact: not applicable; no RFC progress or provider promotion claimed.

Boundary Checklist

  • Public-safe diff and description; no private state, credentials, raw traces, internal links or local machine paths.
  • No duplicate benchmark work or benchmark execution.
  • Scoped to the test-consumer defects.
  • No paired RFC changes; bilingual diff check passed.
  • UI impact is none.
  • Commits include DCO sign-off.

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>
@cocolord cocolord changed the title test: repair native refresh and recovery policy readers test: repair native recovery and staged settlement readers Nov 1, 2026

@loopx-agent loopx-agent 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; 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.

@huangruiteng
huangruiteng merged commit 07c7f33 into main Nov 2, 2026
29 of 35 checks passed
@huangruiteng
huangruiteng deleted the codex/native-refresh-test-readers-20261102-2202 branch November 2, 2026 03:29
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.

3 participants