Repository navigation
refactor(chat): group internal helpers under chat namespace - #7878
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
1) 问题定义(为什么改、要解决什么)
- 推进顶层模块收拢重构(M1),在不破坏
loopx.chat既有公开模块导入的前提下,通过__path__将chat_event_cache、chat_monitor_actions、chat_todo_actions、chat_todo_detail四个内部辅助模块移入loopx/chat/命名空间并收紧顶层模块预算。
2) 改动摘要(按模块分组)
- 命名空间收敛 (
loopx/chat.py,loopx/chat/**,loopx/chat_server.py):在loopx/chat.py声明__path__ = [str(Path(__file__).with_suffix(""))],将 4 个内部 mixin/cache 模块移入loopx/chat/并更新内部导入。 - 预算棘轮与布局测试 (
tests/architecture/top_level_module_budget.json,tests/test_chat_internal_module_layout.py):下调max_top_level_modules并新增test_chat_internal_module_layout.py校验公开符号与内部子模块归属。
3) 逐点审阅结论(架构、语义、正确性、测试、风险)
- 架构与向后兼容性:利用单文件模块声明
__path__的标准 Python 导入机制,保持import loopx.chat完全兼容,同时消除了顶层内部模块平铺膨胀。
4) 建议修改项(分 P0/P1/P2,带文件路径和行号)
- 无阻塞项。
5) 最终结论(Verdict)
Approved — ready to merge once CI completes (exact head df7fe0641cdf5bf3d06aa28299dd594af3867e1d verified).
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
维护 Chat 路由、配置和产品入口的开发者,以及继续使用现有 Chat CLI/HTTP 的用户。 保留公开 loopx.chat 模块,通过显式 path 指向 chat 子目录;内部模块与全部当前 caller 一起迁移。 4 个模块去除 import 路径差异后的完整 AST 相同;同一完整 HTTP/CLI smoke 在 base/head 均通过,独立 wheel 的模块清单、隔离 import origin 和已安装 CLI 启动/三条公开路径检查也通过。 只资格化这一个 M1 slice;没有交付 split distributions、minimal runtime、性能改善或整个 M1 完成,也没有新增 frontend 工作流。
改动思路 / Approach
保留公开 loopx.chat 模块,通过显式 path 指向 chat 子目录;内部模块与全部当前 caller 一起迁移。 RFC 已把 Chat 内部归属到这个 namespace;没有另建 API facade 或状态 owner。 当前 4 个 internal Chat helper/API 整体搬入 loopx/chat/;更新调用者和结构预算,HTTP、配置、权限、持久化及前端行为保持。 留在顶层不能实现已接受的 M1 结构边界;把所有 helper 一次迁走会增大回滚范围;给每个已整体迁出的内部模块留 shim 会永久保留旧依赖。已有公开 loopx.chat 不可删除,内部迁移和 caller 更新适合同一可逆 slice。 正向路径从 installed loopx chat → ChatRequestHandler → existing moved mixins/owners 进入既有 owner,source base/head 相同完整 smoke exit0;wheel 包含所有新文件且 import origin 来自隔离 site-packages;已安装 CLI 三个公开 endpoint 返回200;异常路径保留 原 Chat handler、runtime controller 和 typed permission owner,同一完整 smoke 的预览写保护、失败与 stop/session assertions 在 base/head 均通过;layout/wheel oracle 防止只在 source 可 import。本次完整审查当前 head,没有继承先前模板审查的通过结论。
具体改动 / Changes
10 paths +54/-18;模块内容整体搬迁,import/caller、预算与 layout tests 同步。 Chat 组装与 transport 归 Chat;配置、Todo、权限与持久化仍属于原 control-plane/capability owner。 没有新 schema、状态、权限、分类或 provider 默认值;结构 namespace 和 import 路径是本次变更。
关键代码讲解
-
loopx.chat public module:保留当前公开 chat 入口并给内部子模块提供 search path。 原模块导出保留,增加指向 chat/ 的 path。 输入为Python import / CLI chat entry,关键条件是公开 owner 仍为同一 loopx.chat.py;不建立第二个 Chat runtime。缺失内部模块会在 import/startup 显式失败 -
ChatEventCache:拥有现有事件缓存和游标/保留语义。 仅改位置与 import;完整模块 AST 与基线归一后相同。 输入为既有 handler/registry/runtime request,关键条件是沿用原 scope、preview/apply 或 error 分支。原错误、恢复和拒绝路径保留 -
ChatMonitorActionMixin:处理现有监测 Todo 动作。 仅改位置与 import;完整模块 AST 与基线归一后相同。 输入为既有 handler/registry/runtime request,关键条件是沿用原 scope、preview/apply 或 error 分支。原错误、恢复和拒绝路径保留 -
ChatTodoActionMixin:处理既有 Todo 操作及回读。 仅改位置与 import;完整模块 AST 与基线归一后相同。 输入为既有 handler/registry/runtime request,关键条件是沿用原 scope、preview/apply 或 error 分支。原错误、恢复和拒绝路径保留 -
TodoDetailRequestMixin:处理现有 Todo 详情请求。 仅改位置与 import;完整模块 AST 与基线归一后相同。 输入为既有 handler/registry/runtime request,关键条件是沿用原 scope、preview/apply 或 error 分支。原错误、恢复和拒绝路径保留
规格为 docs/architecture/rfcs/monorepo-distribution-split-v0.md,spec_revision 867615e2c3aa2a32516a71d46f11a20d6fcb3289;§1 decision3、I3 和 §11 M1 明确区分 public import 兼容与 internal caller 同批迁移;§9 rows1–2 要求结构与原行为验证,文件数不证明运行时或长期收益。
- M1 ownership:implemented。本组内部 Chat 模块和 caller 整体归位,顶层预算反映净减少。 对应
loopx/chat/* and top_level_module_budget.json;layout/budget/import-ratchet tests。 - I3 compatibility:implemented。既有 public loopx.chat 保留;内部旧路径没有剩余实际消费者。 对应
installed loopx chat → ChatRequestHandler → existing moved mixins/owners;repository caller search + isolated installed imports。 - §9 structure and behavior:implemented。实际 CLI/HTTP 和失效/preview-locked 拒绝保留,wheel 安装包含新模块。 对应
loopx-chat-server-smoke.py and installed wheel;same source smoke base/head + clean venv installed CLI。
对主干的风险 / Risks
最强风险是 source checkout 可用但 wheel 丢失 namespace 文件,或某个 lazy/动态旧 import 直到实际 HTTP 请求才触发。 为区分修复与无效测试,我对不可变 base/head 执行相同输入:base 相同完整 Chat smoke exit0,既有状态和拒绝断言通过;head 同一 smoke exit0;45 selected tests 与隔离 wheel 的生产入口检查通过。仅通过 Python compile 或布局测试不能排除 packaging/HTTP 问题;我另外构建 wheel、在去除 PYTHONPATH 的新 venv 使用 -I 验证 origin,并从 installed CLI 发真实请求。 未配置/preview-locked 与 session failure 均在相同完整 smoke 中;当前配置、Todo、event cursor/retention 或 SSH 相关 suites 保留实际拒绝与恢复。没有新增 scope/filter 或 domain-specific gate。
- PASSED:
selected layout/budget/import and domain suites— PASS:45 tests - PASSED:
same complete source Chat smoke on base/head— PASS:两边全部语义断言通过 - PASSED:
uv build wheel; isolated venv; python -I import; installed loopx chat— PASS:所有新文件在 wheel,origins 为 site-packages;readiness/endpoints/page200 - PASSED:
git diff --check; whole-repo old import search; complete module AST— PASS:仅 import 路径变化,无剩余 active old caller
语义与 CI 对齐
本次只改变内部模块归属,不新增 typed vocabulary 或 prose classifier;HTTP/CLI/state 继续复用既有 owner。 没有新增 opt-in 或静默默认变化;原 preview/权限拒绝、未配置与失败路径通过真实 source smoke 和当前 suites,模块搬迁没有启动额外服务或注入指令。 独立证据覆盖当前 changed invariant;远端 CI 的其他状态与合并 readiness 另行保留,没有把检查颜色当作正确性证明。 独立资格覆盖当前单一 loopx wheel 和合成 Chat 生产后端;mock host 仅代替模型响应,不证明真实模型质量、split-package/installed App 或完整 M1。不存在 PostgreSQL authority store 改动。
我的整体评价 / Verdict
APPROVE:当前完整 diff 在所声明边界内达到 goal_achieved;long_horizon 为 preserved,既有 Todo、配置、session 与拒绝/恢复经过原 owner;这是可验证的维护边界收口,不是模型效果或完整成本收益实验。 user_experience 为 preserved,原 CLI、/chat/、readiness、endpoints 和交互/失败回读保持;安装 wheel 后不会只因 source checkout 掩盖缺失模块。 源码及已安装 /chat/ 页面加载通过;未改 frontend、样式或视口组成,visual_review not_applicable。 保留公开 loopx.chat 模块,通过显式 path 指向 chat 子目录;内部模块与全部当前 caller 一起迁移。 RFC 已把 Chat 内部归属到这个 namespace;没有另建 API facade 或状态 owner。 当前 4 个 internal Chat helper/API 整体搬入 loopx/chat/;更新调用者和结构预算,HTTP、配置、权限、持久化及前端行为保持。 已在原 owner 收口并删除旧内部路径;其他仍活跃的顶层 helper 应随各自 caller 分组迁出,不能把本批小幅移动当作整体 runtime 瘦身。 不把本次 review 当作合并授权。
English verdict: APPROVE — df7fe0641cdf5bf3d06aa28299dd594af3867e1d; the complete current internal-module move preserves public Chat behavior and passes real source and isolated installed-wheel checks. 45 selected tests and identical base/head HTTP smoke pass; installed readiness/endpoints/page return 200.
|
Hi @cocolord, the DCO If the log confirms a missing |
1 similar comment
|
Hi @cocolord, the DCO If the log confirms a missing |
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
维护 Chat 路由、配置和产品入口的开发者,以及继续使用现有 Chat CLI/HTTP 的用户。 当前独立审查整个17模块/71路径整合;17个模块及14个生产caller归一后AST保持,安装wheel后新模块全可导入,公共CLI与HTTP保持。 953项相关测试通过,1项旧基线同节点失败;真实source smoke和隔离wheel17模块/3个HTTP200通过。但2个非merge提交缺Signed-off-by,当前交付检查不通过。 不交付完整M1或split distributions/性能收益,不把机械移动、绿色功能测试或GitHub Verified代替DCO与merge authority。
改动思路 / Approach
17个迁移模块与14个生产caller经import/alias归一的完整AST一致;只增加已接受的公共chat子模块搜索路径。边界仍属同域、可逆M1收口,无需拆回最初4个模块。 当前完整71-path diff,17个内部Chat模块及其消费者;不是旧正文中的4模块slice。 留在顶层不能实现已接受的 M1 结构边界;把所有 helper 一次迁走会增大回滚范围;给每个已整体迁出的内部模块留 shim 会永久保留旧依赖。已有公开 loopx.chat 不可删除,内部迁移和 caller 更新适合同一可逆 slice。 正向路径从 source/installed loopx chat → ChatRequestHandler → relocated existing owners 进入既有 owner,source smoke全断言、17个wheel imports与readiness/endpoints/page均200;异常路径保留 原 Chat handler、runtime controller 和 typed permission owner,同一完整 smoke 的预览写保护、失败与 stop/session assertions 在 base/head 均通过;layout/wheel oracle 防止只在 source 可 import。本次完整审查当前 head,没有继承先前模板审查的通过结论。
具体改动 / Changes
71 paths +234/-170;17个模块移动、caller import/alias、128预算和现有fixtures/tests更新;无新生产规则。 Chat 组装与 transport 归 Chat;配置、Todo、权限与持久化仍属于原 control-plane/capability owner。 没有新 schema、状态、权限、分类或 provider 默认值;结构 namespace 和 import 路径是本次变更。
关键代码讲解
-
AutomationCadenceRequestMixin:复用既有自动化 cadence 配置 owner。 仅改位置与 import;完整模块 AST 与基线归一后相同。 输入为既有 handler/registry/runtime request,关键条件是沿用原 scope、preview/apply 或 error 分支。原错误、恢复和拒绝路径保留 -
GoalConfigurationRequestMixin / MachineConfigurationRequestMixin:沿用 Goal 与机器配置的现有 preview/apply/readback。 两个完整模块只调整 import;machine_configuration_api.py:117 也逐 AST 对照。 输入为既有 Goal/机器配置请求,关键条件是原 scope、preview revision、authority 与拒绝分支保持。原配置错误与恢复 owner -
open_chat_session:打开既有 Chat session,不新增 admission。 仅改位置与 import;完整模块 AST 与基线归一后相同。 输入为既有 handler/registry/runtime request,关键条件是沿用原 scope、preview/apply 或 error 分支。原错误、恢复和拒绝路径保留 -
SshSourceRequestMixin:处理既有 SSH source 配置与拒绝。 仅改位置与 import;完整模块 AST 与基线归一后相同。 输入为既有 handler/registry/runtime request,关键条件是沿用原 scope、preview/apply 或 error 分支。原错误、恢复和拒绝路径保留 -
UsageStatisticsRequestMixin / workspace_goal_directory:保留用量统计与 workspace/Goal 只读投影。 两个完整模块仅更改 import 归属;workspace_directory.py:16 同样逐 AST 对照。 输入为既有 status/usage/workspace 请求,关键条件是原来源、可见范围及错误分支不变。原不可用/拒绝 owner 保留
规格为 docs/architecture/rfcs/monorepo-distribution-split-v0.md,spec_revision 867615e2c3aa2a32516a71d46f11a20d6fcb3289;§1 decision3、I3 和 §11 M1 明确区分 public import 兼容与 internal caller 同批迁移;§9 rows1–2 要求结构与原行为验证,文件数不证明运行时或长期收益。
- M1 ownership:implemented。本组内部 Chat 模块和 caller 整体归位,顶层预算反映净减少。 对应
loopx/chat/* and top_level_module_budget.json;layout/budget/import-ratchet tests。 - I3 compatibility:implemented。既有 public loopx.chat 保留;内部旧路径没有剩余实际消费者。 对应
installed loopx chat → ChatRequestHandler → existing moved mixins/owners;repository caller search + isolated installed imports。 - §9 structure and behavior:implemented。实际 CLI/HTTP 和失效/preview-locked 拒绝保留,wheel 安装包含新模块。 对应
loopx-chat-server-smoke.py and installed wheel;same source smoke base/head + clean venv installed CLI。
[P2] 补齐整合历史的 DCO sign-off
当前非merge提交 77ebc81b4970fb342fdbbe26efce4ce312ae77f5 与 53435870bf75887f09213ff3593727470d8d86ac 的原始commit message经 git interpret-trailers --parse 都返回空集。它们是本head带入main的提交,不是CI checkout或网络失败。仓库要求每个PR commit有Signed-off-by;GitHub Verified签名和源分支里别的已签提交不能补足这两条的DCO。请由能够作出该声明的提交者修复/保留有效trailers,再推新head复审。这里不代作者签署。
对主干的风险 / Risks
最强风险是 source checkout 可用但 wheel 丢失 namespace 文件,或某个 lazy/动态旧 import 直到实际 HTTP 请求才触发。 为区分修复与无效测试,我对不可变 base/head 执行相同输入:base 同一固定基线867615e2的完整Chat smoke通过;原public入口/拒绝/恢复语义有效;head 17模块/14caller归一AST一致,current完整source smoke通过,隔离wheel17模块和public三路径200;953 pass,1个基线同错。只测source会遗漏packaging;独立wheel在无PYTHONPATH的新venv以-I确认origins来自site-packages。17模块和14生产caller AST逐一对照而非只看rename统计。 既有preview/scope/failed-session/stop、configuration与SSH相关suite保留;17迁移module及caller没有任何域决策差异。公共chat search path以实际installed CLI验证。
- PASSED:
AST17+14; 954 focused current cases; isolated17-module wheel and3 HTTP200— 953 passed,1个基线同错;imports/HTTP/AST全部通过 - PASSED:
same full Chat source smoke on fixed base/current head— PASS:相同完整语义断言通过 - FAILED:
git log --no-merges + git interpret-trailers --parse on current base..head— 77ebc81、53435870bf75887f09213ff3593727470d8d86ac 均无trailer。 - FAILED:
same pytest node at immutable base and current head— 相同regex文案错误;相关因果源路径未触及,移动不改变原错误。
当前953 pass、1 fail:tests/test_chat_manager_context.py::test_trusted_manager_profile_rejects_endpoint_that_cannot_enforce_it 在未触及base867615e2同节点复现相同文案错误,单独记录为既存失败。没有将它报成refactor回归。DCO缺失则是本head的当前必需检查失败。
语义与 CI 对齐
本次只改变内部模块归属,不新增 typed vocabulary 或 prose classifier;HTTP/CLI/state 继续复用既有 owner。 没有新增 opt-in 或静默默认变化;原 preview/权限拒绝、未配置与失败路径通过真实 source smoke 和当前 suites,模块搬迁没有启动额外服务或注入指令。 独立证据覆盖当前 changed invariant;远端 CI 的其他状态与合并 readiness 另行保留,没有把检查颜色当作正确性证明。 原source/wheel和全部当前改动test文件已验证;无真实模型/installed App/性能收益资格。唯一功能测试失败在未触及基线同节点复现,不要求本PR修复它;DCO是本head当前缺陷,不能称环境故障。 PR正文仍为4模块/145→141;建议同步17模块/145→128。
我的整体评价 / Verdict
REQUEST_CHANGES:当前完整 diff 在所声明边界内达到 goal_achieved;long_horizon 为 preserved,本次结构与执行结果保持;未证明长期效果改善。提交缺DCO是当前作者交付义务,不能由测试通过替代。 user_experience 为 preserved,真实source/installed Chat公共入口保持;功能等价不代表当前提交已满足DCO。 未改frontend或渲染presentation;actual /chat/加载通过,visual_review not_applicable。 17个迁移模块与14个生产caller经import/alias归一的完整AST一致;只增加已接受的公共chat子模块搜索路径。边界仍属同域、可逆M1收口,无需拆回最初4个模块。 当前完整71-path diff,17个内部Chat模块及其消费者;不是旧正文中的4模块slice。 已在原 owner 收口并删除旧内部路径;其他仍活跃的顶层 helper 应随各自 caller 分组迁出,不能把本批小幅移动当作整体 runtime 瘦身。 功能M1 slice已有独立资格,但当前结论为REQUEST_CHANGES:先补齐两条DCO,再推送新head。PR描述还停留在4模块/145→141,请同步17模块/145→128的实际范围;未要求拆回旧slice。没有合并操作。
English verdict: REQUEST_CHANGES — 0fb7f27d068ccc5baf0f7e18b69f05bd5e60c9ef; the move preserves public Chat behavior, but two current non-merge commits lack required DCO sign-off. Restore valid trailers before delivery. 953 passed + 1 independently reproduced baseline failure; full real Chat smoke; 17-module isolated wheel/import/CLI HTTP
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> 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> 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>
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> 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> 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> Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
Update the chat transport composition test to import the colocated endpoint catalog, and align the machine-configuration template expectation with the evidence-conditioned stride default shipped in PR 7928 (verified identical failure on origin/main ac74f90). Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
0fb7f27 to
0bdf1a2
Compare
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
调用 Chat CLI、HTTP 服务和管理配置的用户,以及维护这些入口的开发者,会在加载内部 Chat 模块时经过这次移动的代码。 原来 17 个内部模块散落在顶层,维护者查找 Chat 实现需要跨多个同级模块;现在把它们放入 chat 命名空间,并同步全部生产调用者,原有公开入口继续工作。 已验证的结果是内部模块归组后,源码中的完整 Chat HTTP smoke 和独立安装包的 CLI、HTTP 入口仍可使用。 本 PR 只交付内部目录整理,不拆分发行包,不承诺性能提升,也不宣称已完成整个发行结构迁移。 更大范围的发行包拆分与长期维护收益仍需后续独立证明;本次的三个既有测试失败和广泛测试超时也没有被修复。
改动思路 / Approach
公开的 loopx.chat 仍是入口;17 个内部实现移到同一目录,再由已有 Chat 服务、运行时和配置调用者直接导入。移动内部实现并让现有调用者一次采用,保留公开 chat 入口,避免双份兼容分支;这与已接受的结构整理边界相称。 当前交付边界是 17 个内部模块归组、全部调用者更新和源码/安装包入口验证;不包含发行拆包。 请求校验、锁定写入、会话停止与重试仍由原实现负责;没有新建策略层或持久状态。源码归组本身不能证明可安装,所以本次还构建真实 wheel,在隔离环境运行 CLI 和三个 HTTP 入口。
具体改动 / Changes
规范依据:docs/architecture/rfcs/monorepo-distribution-split-v0.md,固定版本 ac74f90c4778381b6fcedd5d76059522591c3f42。I3:保留公开导入兼容,内部移动后所有生产调用者更新,已实现。M1:本 PR 实现结构归组这个有用切片;发行包真正拆分仍在范围外,不将目录移动等同于整个 M1 的全部后续工作。
关键代码讲解
loopx/chat.py:22的__path__为内部子模块提供查找路径,公开模块仍在,未添加旧内部模块的重复 shim。GoalConfigurationRequestMixin:420保留原配置验证与写入分支,仅改变所属模块。open_chat_session:32仍承担既有会话打开逻辑;ChatRuntimeController:238已采用新导入,不把迁移留在未使用的新目录。
当前完整 diff 是 72 个路径、+237/-173,包含 17 个重命名。按明确的旧新模块映射、相对导入解析及新增 __path__ 归一后,17 个移动模块和其余 14 个生产文件的完整 AST 一致;没有归一条件、诊断文本或业务语句。8 条提交均有有效 DCO sign-off,上轮的两条未签署提交阻塞已在当前 head 修复。两处测试默认值调整对应 base 已存在的 evidence_conditioned_v1 和 Antigravity 支持,不是生产默认改变。
对主干的风险 / Risks
最大风险是导入在源码树成功、打包后缺文件。PASS:相同完整 Chat HTTP smoke 在 base/head 均通过;真实 wheel 包含 17 个新模块、没有旧内部模块,公开 CLI 与 /api/chat/readiness、/api/chat/endpoints、/chat/ 均成功。故意删除隔离安装中的 todo_detail 后,实际 CLI 立即报 ModuleNotFoundError;恢复原字节后通过,这个检查能感知缺包回归。协议 Host 是合成实现,没有真实付费模型调用。
PASS:最终 premerge 的 6 项直接检查与 18 项选中检查;Ruff、语义词表检查通过。FAIL:独立补测 head65通过/3失败,base61通过/5失败。共有失败分别是 SQLite Todo 长文本投影两例,以及 Lark fixture 缺少 background_services;对应因果实现未变或 AST 等价,两条额外 base 失败正是已纠正的陈旧测试预期。既有维护性建议仍报 94 条语句/61 个决策点超预算,未调低检查要求。UNVERIFIED:广泛测试在 base/head 都于600秒停止,不算完整架构测试通过。严格 CQR 仍为失败,最终 premerge 因 quality_invalid_receipt 未通过合并门。
我的整体评价 / Verdict
没有发现当前 PR 引入的阻塞问题,APPROVE。长期工作路径判定 preserved:原会话、锁、错误和重试语义保留;用户体验判定 preserved:已有 CLI/HTTP 工作流可用,没有增加配置或确认轮次。移动内部实现并让现有调用者一次采用,保留公开 chat 入口,避免双份兼容分支;这与已接受的结构整理边界相称。 当前交付边界是 17 个内部模块归组、全部调用者更新和源码/安装包入口验证;不包含发行拆包。 复用既有词汇和决策 owner,不创建共享状态合同。检查过的 chat.py、服务和调用者没有渲染内容改动,因此视觉评审不适用;真实模型、Windows 和完整拆包未验证,不据此宣称长期收益。上轮 CHANGES_REQUESTED 的讨论保留,不执行 dismissal。CQR、既有集成失败及未完成的广泛测试作为独立合并限制保留,本次评审不授予合并权限。
English verdict: APPROVE at 0bdf1a205c4de985d75fcb9daba0fadb5713fab0. Source and installed Chat paths preserve the moved behavior; strict quality-receipt and broader-validation holds remain.
Summary
Advances the accepted small-kernel M1 boundary as one reviewable stack: move internal-only Chat helpers into
loopx/chat/so the top-level module surface reflects real public owners, without changing behavior and without compatibility shims for internal modules.loopx.chatas the existing public owner and adds a submodule search path;loopx/*.pyintoloopx/chat/;tests/architecture/top_level_module_budget.jsonfrom 145 to 128 (the exact net reduction);tests/test_chat_internal_module_layout.pyto guard the namespace and the removal of the old top-level imports.Stack commits (each DCO signed-off):
Rebase And Hygiene
origin/mainac74f90c4; four GitHub merge commits were dropped by a plain rebase and the seven refactor commits replayed withgit commit -s.loopx/chat/coordination.py: kept main'snative_manager_context(...)behavior and only adjusted the relative import depth for the new location.git diff origin/main...HEAD: 72 files, +237/-173.scripts/check_rfc_bilingual.py --base origin/main --head HEAD: passed (no RFC pair touched).loopx canary premerge --from-git-diff --git-diff-base origin/main: passed, 18 selected checks, 0 failures. One advisory inherited failure (control-plane-maintainability-ratchet-smoke.py) is the known baseline smoke that did not mention any changed file.Validation
tests/test_chat_transport_composition.py+tests/test_chat_machine_configuration_api.py: 27 passed.tests/test_chat_internal_module_layout.py+tests/architecture: 1657 passed, 1 failed (pre-existing, see below).origin/mainand are aligned in the final commit (endpoint_catalogimport path; evidence-conditioned stride default from fix(stride): apply work-shape guidance and enable inherited default #7928). The remaining two reproduce identically on pristineorigin/mainac74f90c4and are not caused by this stack:tests/test_chat_lark_api_contract.py::test_chat_server_closes_lark_goal_topic_runtime(ChatHTTPServerfixture lacksbackground_services);tests/architecture/test_semantic_vocabulary_drift.py::test_inventory_report_discloses_budget_slack(conflicting_definitionsbudget slack of 2 on main).Boundary
This is a behavior-preserving Python layout refactor for the accepted M1 milestone. It does not depend on or modify the older capability/extension registry PR #2212, and it does not claim merge authority. The top-level module count is a structural budget, not a runtime performance claim.
Remaining M1 scope: top-level
loopx/chat_*.pymodules that are established public import contracts (for exampleloopx.chat_server) still need their own move with I3 shims and a documented deprecation window (D3). They are intentionally excluded from this internal-only slice so that public compatibility and review can be qualified separately.CI (run 41631310097)
changes,kernel-static-checks,kernel-contracts,chat-bundle,typescript-core,stage2clanes,chat-bundle-browser,dashboard-browser (2)/(3),presentation, and the node compatibility jobs.windows-powershellfails intests/control_plane/test_sqlite_authority_cli.pywithprivate capture validation is unsupported on this platform. The same failure reproduces on unrelated branches:codex/antigravity-thinking-summary-and-turn-recovery-20261103(run 41630688646) andcodex/s5-s11-visual-hierarchy-20261103(run 41624843236). Fix proposed in fix(quota): omit private capture budget on unqualified hosts #7993.dashboard-browser (1)fails becausegoal-workspace-m2exceeded its frozen 1s lens-switch budget (1583.7ms), while shards (2) and (3) passed the same commit. This stack does not touch Dashboard code; treated as a timing flake and rerun after the rebase.checksandmerge-gatefailures are downstream of the two jobs above. Test shards were still queued in the runner backlog when this section was written.This PR will be rebased onto current
mainafter the prerequisite repairs merge, then re-run before merge readiness.