Repository navigation
refactor(chat): move internal APIs under chat namespace - #7883
loopx-agent merged 3 commits into
Conversation
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.
1) 问题定义(为什么改、要解决什么)
- 推进顶层模块收拢重构,将
chat_usage_statistics_api.py与chat_workspace_directory.py下沉至loopx/chat/内部命名空间,并同步收紧顶层模块预算(max_top_level_modules: 141 -> 139)。
2) 改动摘要(按模块分组)
- 模块迁移与引用更新 (
loopx/chat/usage_statistics_api.py,loopx/chat/workspace_directory.py,loopx/chat_server.py,loopx/chat_status_api.py,loopx/presentation/**):将两个内部辅助模块移入loopx/chat/并更新所有导入方。 - 架构预算收紧与测试 (
tests/architecture/top_level_module_budget.json,tests/test_chat_internal_module_layout.py):将max_top_level_modules从141下调至139,并在模块布局测试中新增断言。
3) 逐点审阅结论(架构、语义、正确性、测试、风险)
- 架构与兼容性:纯内部命名空间收拢,无公开 CLI/API 契约变更,预算棘轮同步收紧。
4) 建议修改项(分 P0/P1/P2,带文件路径和行号)
- 无阻塞项。
5) 最终结论(Verdict)
Approved — ready to merge once CI completes (exact head 1ab4d610c2b3468f353584a4f68d0ac9c19aa0be verified).
|
Hi @cocolord, the DCO If the log confirms a missing |
|
Hi @cocolord, the DCO If the log confirms a missing |
d088698
into
codex/small-kernel-m1-chat-20261102
|
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max Post-merge audit — 当前PR已合入父分支;以下是完整当前head审计与仍可在父PR修复的贡献检查问题,不是对已合并PR重新批准。 动机 / Motivation维护 Chat 路由、配置和产品入口的开发者,以及继续使用现有 Chat CLI/HTTP 的用户。 使用 #7878 已建立的 loopx.chat 子模块边界,完整审查当前七个迁移模块和所有 caller,不只按旧正文中的两个模块审查。 7 个模块去除 import 路径差异后的完整 AST 相同;同一完整 HTTP/CLI smoke 在 base/head 均通过,独立 wheel 的模块清单、隔离 import origin 和已安装 CLI 启动/三条公开路径检查也通过。 只资格化这一个 M1 slice;没有交付 split distributions、minimal runtime、性能改善或整个 M1 完成,也没有新增 frontend 工作流。 改动思路 / Approach使用 #7878 已建立的 loopx.chat 子模块边界,完整审查当前七个迁移模块和所有 caller,不只按旧正文中的两个模块审查。 RFC 已把 Chat 内部归属到这个 namespace;没有另建 API facade 或状态 owner。 当前 7 个 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,没有继承先前模板审查的通过结论。 具体改动 / Changes29 paths +95/-67;模块内容整体搬迁,import/caller、预算与 layout tests 同步。 Chat 组装与 transport 归 Chat;配置、Todo、权限与持久化仍属于原 control-plane/capability owner。 没有新 schema、状态、权限、分类或 provider 默认值;结构 namespace 和 import 路径是本次变更。 关键代码讲解
规格为
[P2] 已合入父分支的两条提交仍缺 DCO sign-off当前真实stacked diff为七个模块,不是旧批准覆盖的两个模块。新增非merge提交 本子PR已merge进父分支,修复行动集中在仍open的#7878当前head复审:由能作出DCO声明的提交者恢复有效trailers,再提交新head,不在此重复发起形式request-changes,也不代别人签署。这个审计保留完整七模块的功能通过证据,同时纠正旧两模块批准不能覆盖当前范围的问题。 对主干的风险 / Risks最强风险是 source checkout 可用但 wheel 丢失 namespace 文件,或某个 lazy/动态旧 import 直到实际 HTTP 请求才触发。 为区分修复与无效测试,我对不可变 base/head 执行相同输入:base 相同完整 Chat smoke exit0,既有状态和拒绝断言通过;head 同一 smoke exit0;56 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。
DCO检查:FAILED,两个非merge提交缺Signed-off-by;与上述功能测试分开,不能把它视为已通过的交付检查。 语义与 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 改动。 当前 head 实际迁移七个模块、预算 141→134;PR 正文仍写“两模块、141→139”,应更新为当前完整范围,避免后续审查继续只读旧描述。这是非阻塞的说明同步建议。 我的整体评价 / VerdictREQUEST_CHANGES:当前完整 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。 使用 #7878 已建立的 loopx.chat 子模块边界,完整审查当前七个迁移模块和所有 caller,不只按旧正文中的两个模块审查。 RFC 已把 Chat 内部归属到这个 namespace;没有另建 API facade 或状态 owner。 当前 7 个 internal Chat helper/API 整体搬入 loopx/chat/;更新调用者和结构预算,HTTP、配置、权限、持久化及前端行为保持。 已在原 owner 收口并删除旧内部路径;其他仍活跃的顶层 helper 应随各自 caller 分组迁出,不能把本批小幅移动当作整体 runtime 瘦身。 当前功能slice验证通过,但DCO交付义务未满足,修复集中到父PR#7878;本次只发布合并后审计comment,没有执行merge或形式批准。 English verdict: REQUEST_CHANGES — |
Summary
loopx.chatGoal and boundary
This is the next independently reviewable M1 slice of the accepted small-kernel composition RFC. It reduces top-level kernel surface and gives Chat-owned assembly code an explicit package boundary without changing HTTP behavior.
Review this PR against its stacked base branch. It depends on #7878 at
df7fe0641cdf5bf3d06aa28299dd594af3867e1d.Validation
origin/codex/small-kernel-m1-chat-20261102: passed, including 5/5 selected canaries and no manual holdsloopx chatreadiness, API endpoints, and UI checks: passedGenerated frontend assets used for package validation are not part of this diff. This runtime boundary still requires normal maintainer review and merge authority; this PR is not self-merge eligible.