Skip to content

test(chat): protect public status compatibility before M1 relocation - #8001

Merged
huangruiteng merged 1 commit into
mainfrom
codex/m1-chat-public-status-20261103
Nov 3, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/m1-chat-public-status-20261103

Conversation

@cocolord

@cocolord cocolord commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Delivery brief

Goal/source: advance the accepted M1 Chat ownership milestone in the small-kernel RFC, preserving I3 public imports.

Current gap: ChatStatusRequestMixin and goal_read_runtime_root have active HTTP and Todo-detail consumers and historical module monkeypatch points. An export-only wrapper can preserve import names while silently breaking those patch points.

Delivered delta: an independently reviewable characterization prerequisite, plus the matching English/Chinese RFC checkpoint. No production owner, HTTP behavior, source-registry admission, module budget or default changes.

Changes and decisive evidence

  • Three fresh-process import orders protect historical imports, historical pickle lookups and reload with already-imported function references.
  • A registry patch through the historical module must reach the already-imported Todo consumer, preserve source routing and only tolerate a missing registry.
  • A real loopback HTTP request proves the legacy collector, registry and host-observation patch points affect outbound readback.
  • A disposable copied-export facade mutation is rejected by the source-bound Todo-consumer patch oracle. This catches the compatibility regression a plain import assertion would miss.
  • The existing real source-routing and denial tests remain unchanged. This complements their behavior coverage rather than replacing their independent authority oracles.

Validation

Tested exact head: d81a9e6f5e75ad378f3b9dca8748b5a54b6a3599; PR base: main (baseline 2eca84b44).

  • Focused source suite: 205 passed, including real File/SQLite source routing, source loss/recovery, delivery-review HTTP, redaction and the unchanged exact-path/exact-function source-session denial oracle.
  • Separately built complete wheel, installed outside the checkout: 10 compatibility cases passed, with checkout PYTHONPATH removed and interpreter/package provenance checked. The first wheel build correctly refused the missing frontend bundle; the unchanged frontend was then built normally and wheel validation rerun successfully.
  • Standard premerge: 5 direct checks + 14 selected checks passed, zero failures or inherited advisories. This is validation, not merge authority.
  • Changed-file Ruff, whitespace checks and staged/exact-head bilingual RFC checks passed.
  • Public/private scan: no errors; only the expected absent-runtime warning from an isolated empty registry.
  • Diff-scoped vocabulary advisory found no changed production vocabulary. Its untracked-source probe only supports loopx/, so the new test module was reviewed directly rather than claiming tool coverage.
  • Whole-tree CI-equivalent lint is not green: unchanged tests/test_lark_private_conversations.py has F811 at line 817 and E731 at line 928 on the baseline. This PR does not fix or waive that separate hold.

Remaining boundary and rollback

The full move is not delivered. Its next complete slice must relocate the status owner, retain an identity-compatible public bridge, update active callers and retarget both existing source-session denial oracle entries together without relaxing them. That oracle remains untouched here. I3 still requires at least one minor release; implementation does not decide D3 expiry. No module-count, performance, split-installation or R1 managed-Turn benefit is claimed.

Bounded refactoring: deferred at the complete status-owner/denial-oracle boundary; splitting globals or leaving a second decision owner just to fit a partial move would make verification and rollback worse. This prerequisite is reversible by reverting the test/checkpoint commit, with no runtime or persisted-state rollback.

Author work in this test-only proposal is complete. CI, independent review and merge readiness remain separate gates. No merge is requested or performed automatically. No visual surface changes; generated frontend assets, dependency directories, logs and lock artifacts are excluded.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

@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

维护 Chat status 公共入口及 Todo detail 的迁移开发者。若只复制导出函数,import 仍成功,但调用方对历史模块的 registry patch 不再影响已经导入的 Todo 函数;新增用例会在这一错误迁移处失败。十项兼容用例在当前实现和原 base 上通过,而复制导出的 facade 反例触发三项失败。本次不搬迁生产 owner,不改变 HTTP、权限、默认配置或模块预算,也不认证 wheel 安装、性能或完整 M1。status owner 迁移、公开 bridge 的弃用窗口及迁移后的 wheel 集成仍由 M1 后续完整切片验证。 这是一项有实际消费者和可失败反例的 characterization 前置工作,不能用通过测试的数量冒充迁移已完成。

改动思路 / Approach

继续由现有 loopx.chat_status_api 拥有函数 globals,ChatRequestHandler 和 loopx.chat.todo_detail 消费同一公开入口。新测试先在三个新进程中选择不同 import 顺序,再检查历史 pickle 查找和 reload 后旧引用;随后经原 Todo consumer 和真实 loopback HTTP handler 验证 patch 是否到达。HTTP 中的 collector 与宿主观察是合成替身,因此该用例证明的是兼容接线;现有 source-routing、异常和权限测试仍承担真实 backend 的独立职责。

做更少的 import-only 断言会漏过“名称存在而 globals 已分家”的错误;直接搬迁又会混合 owner、公开 bridge 和 source-session denial oracle。本 PR 把有失效能力的前置测试与双语 checkpoint 一起交付,边界可独立回滚。相邻重构延后到一次完整 status-owner 迁移,无需在本次测试 PR 增加中间 owner 或兼容框架。

具体改动 / Changes

head d81a9e6f5e75ad378f3b9dca8748b5a54b6a3599,实际 merge base 2eca84b445e2a0daaccb99084c35f0096f8bb30d;完整差异为三个文件 +191/-0:148 行测试和 43 行双语 checkpoint,没有生产代码、生成物或默认变更。先读取改动前的规范 docs/architecture/rfcs/monorepo-distribution-split-v0.md,spec_revision 2eca84b445e2a0daaccb99084c35f0096f8bb30d,再检查完整 diff;未以新 checkpoint 为自己的验收规范。

关键内容讲解

  • I3 — implemented,限定现有入口的刻画: test_historical_status_imports_survive_import_order_reload_and_pickle 覆盖三个 fresh-process import 顺序、旧 pickle 名称和 reload 后的旧函数引用;新 oracle 在原 base 上十项均通过。尚未迁移,不能声称已验证迁移后的 DeprecationWarning 或经历一个 minor release。
  • M1 — deferred: ChatStatusRequestMixin 与 goal_read_runtime_root 仍在原 owner;本次不降低 top-level budget。下一步由 M1 维护者一起搬迁 owner、更新 active callers,并同步调整 denial oracle 中的精确 loader 路径与函数例外。
  • D3 — deferred: 至少一个 minor release 的 I3 约束保留,精确 shim 退役期限仍由 release owner 决定,checkpoint 未替它作决定。
  • test_historical_registry_patch_reaches_already_imported_todo_consumer 保留 source-bound 返回 None、controller root 与未绑定 fallback 三个分支,且独立断言 registry patch 确实被调用。复制导出 facade 后三项都失败,证明它能捕捉仅 re-export 的迁移错误。
  • test_historical_discovery_patch_only_tolerates_missing_registry 仅容忍 FileNotFoundError;PermissionError 与 ValueError 必须继续抛出。最后一个 HTTP 用例经实际 /status.json?goal_id=alpha 验证 collector、registry 双读与宿主观察 patch 的外部响应。

对主干的风险 / Risks

未发现 blocking finding。最大风险是把 tests 的稳定替身误当作真实 source authority 或安装资格:这里没有这样继承,tests/architecture/test_source_session_registry_denial.py 的精确路径/函数限制完全未动,原 source-routing 与失败恢复用例一起运行。新增断言关注可观察的 import 身份、patch 可达性和拒绝语义,不要求将来保留第二决策 owner。两个 RFC 语言版本的边界、next slice 与未交付范围语义一致。

独立本地验证:PASS 八个完整相关测试模块 280 项,包括真实 HTTP、source-runtime、拒绝 oracle、redaction 和宿主观察;PASS 原 base 上执行同一新增 oracle 十项;预期 FAIL 一次性 copied-export facade mutation 三项失败。PASS 标准 premerge 的 5 direct +14 selected,零失败、零 advisory;第一次运行因缺少 npm dev dependency 在语义扫描处失败,按仓库要求安装依赖后完整重跑通过,没有改 gate。

FAIL,基线已有且与本 PR 无关: 按 workflow 原命令 ruff check tests loopx/canary loopx/control_plane loopx/domain_packs loopx/presentation,base/head 的完整 stdout 字节相同:未改动 test_lark_private_conversations.py 的 F811:817 与 E731:928;新增测试不在失败路径。另一次更宽 ruff check . 两边也同为 124 错且完整 stdout 相同,不能称全树 lint 通过。没有查询、轮询或等待远端 CI,未知状态保持未知。wheel、跨平台和迁移后 bridge 本轮未重验;本次不修改这些生产边界。

我的整体评价 / Verdict

APPROVE 这个有用且可逆的兼容性前置切片,problem_context=justified_increment。long_horizon 与 user_experience 均为 preserved:生产源码完全未变,真实原调用及失败/拒绝覆盖通过,避免后续迁移静默损坏已导入 consumer;没有增加用户交互轮次或激活新工作。已检查 Chat status、Todo detail、HTTP 与 checkpoint 文档,本 PR 没有渲染呈现变更,visual_review 不适用;unverified_scope 为 wheel、实际 owner 迁移及其弃用期。

与相邻已有测试相比,新增价值是 import order/pickle/reload 及 copied-export 失效 oracle,现有 CORS、source routing、host observation 没有这组跨模块身份覆盖;检索当前作者近期 15 项 PR,也未见重复同形测试批次。无需另造新框架或继续拆成更小 PR。旧 lint 不影响本次已覆盖的 changed invariant,批准结论与当前合并 readiness 分开;没有执行 merge 或撤销旧评审。

English verdict: APPROVE at d81a9e6f5e75ad378f3b9dca8748b5a54b6a3599. The complete test/checkpoint slice protects live legacy patch points: 280 related tests, ten baseline characterization cases and all standard premerge checks pass; a copied-export mutation fails as intended. The two CI-scope lint failures are byte-identical at base and head. M1 relocation and installed-wheel qualification remain deferred.

@huangruiteng
huangruiteng merged commit 6a9c77b into main Nov 3, 2026
20 of 25 checks passed
@huangruiteng
huangruiteng deleted the codex/m1-chat-public-status-20261103 branch November 3, 2026 17:44
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