Skip to content

fix(packaging): preserve full CLI fallback in split installs - #9876

Open
cocolord wants to merge 5 commits into
loopx-project:mainfrom
cocolord:codex/full-split-cli-compat-20261202-UbBRqY
Open

cocolord wants to merge 5 commits into
loopx-project:mainfrom
cocolord:codex/full-split-cli-compat-20261202-UbBRqY

Conversation

@cocolord

@cocolord cocolord commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Problem

The split metapackage installs the Core CLI entrypoint and companions. Legacy routes can still need the complete parser. Without its module, 260 retained help paths were rejected, including commands such as preset list, project-skill, and goal-channel.

Change

Add a transitional loopx-cli-compat distribution containing the existing parser and canary modules. The dependency-only metapackage pins it to the release train. Core checks the compatibility artifact and the exact same-version dependencies before dispatching the fallback.

Determine Core installation mode from the active package location. Capability discovery, cold status, and Doctor use the installed ownership checks when the compatibility parser is present. Include the compatibility artifact in the runtime fingerprint and exercise a real fallback command in split release qualification. Keep the version query on its lightweight path.

Validation

  • The integrated candidate restored all 260 previously rejected paths and all 467 retained help paths on macOS. A real preset query returned five presets through both console routes with identical output.
  • The same nine-distribution release train passed Deep Doctor on macOS and Debian arm64. All 18 artifacts passed checksum and metadata verification. Rebuilding all nine wheels from the normalized source archives on Debian produced identical payload members.
  • On both platforms an intentionally incomplete installation refused the fallback, kept missing Benchmark disabled, and reported the missing release dependencies. Cold status and write refusal without Node passed. The Debian stable-to-candidate roundtrip preserved the same SQLite task and one settlement.
  • The author diff passed 58 focused Python tests, with three skips. The integrated kernel typing checks and bilingual RFC check passed.

The split candidate was verified in combination with the Core install ownership and related prerequisite repairs. The standalone premerge run hit the existing 120-second install-local smoke limit and its cleanup deadline.

The integrated standard premerge passed all 19 selected checks. Its install-local smoke finished in 116.067 seconds under the existing limit.

Package Smoke follow-up

Package Smoke now builds the matching compatibility wheel in its offline wheelhouse and verifies the installed parser with a preset query. The previous step failed to resolve its exact compatibility pin. Replaying the corrected workflow step from the same M3 wheelhouse passed pip check, Deep Doctor with all seven companions, and a preset query returning five entries.

The previous hosted Core execution job reported the update-parser and ordinary Turn regressions tracked in #9862. The composed checkout with #9646 and #9862 passed all 97 tests from the same Core execution suite on macOS with a separately installed rc wheel. The composed result and the hosted checks for the current PR head apply to different revisions.

Review follow-up

At aa46838dbd on abbd0fad2f, 80 focused tests and quick premerge pass. The new tests cover active installation ownership, exact companion pins, missing and mismatched packages, the shared discovery and dispatch guard, and version without the effect runtime. The local composition with #9646 passes 34 focused tests.

An offline wheel comparison on macOS arm64 used the same eight non-Core artifacts and swapped only the Core wheel. The version without #9646 selects the dependency-only metapackage and fails Deep Doctor. With #9646 in the local composition aa683bc2e9, Core is selected, Deep Doctor passes, all seven companions are ready, and a runtime fingerprint is present. Both complete assemblies run preset list. Bare Core and the incomplete assembly refuse the fallback. The current Workspace wheel owns the relocated manager-context module.

This PR requires #9646 to land before merge. Requalification on the landed composition remains open.

Debian arm64 qualification

The local composition aa683bc2e9 rebuilt all nine wheels and the earlier Core control byte for byte. Debian 12 arm64 installed those artifacts after preparing its offline dependency cache. All five install cases matched the macOS results for ownership, Deep Doctor, companion readiness, package fingerprint, and CLI fallback.

In nine-package installs, the Core from #9646 restores Deep Doctor and all seven companions. Bare Core keeps help and empty status readable without Node. Effectful commands report node_unavailable before creating a registry. Seven installed Workspace tests also pass on Linux, including File and SQLite result readback after install and removal.

The merge dependency on #9646 remains in effect.

Review follow-up

Tested this PR together with the Core ownership change from #9646 at 92d4376. An isolated Python 3.12 install of all nine locally built wheels passed dependency checks. Deep Doctor reported a Core runtime identity and all seven companions ready. The console script, module entrypoint, and legacy module each listed presets. Removing Workspace made the preset command exit 2. This validates the combined build. The Core ownership prerequisite still needs to land in main before this PR can be updated and its new head requalified.

Archived split candidate qualification

The nine-wheel composition 3fa8c026a8 includes this commit, #9646 and the Windows Doctor launcher fix from #9999. Fresh bare Core and complete Meta installs of the same hash-verified wheel artifact both ran the Generic CLI journey with SQLite hard leases and a loopback Qwen3 model. Each used the first, unchanged and revised Todo context. After interruption following durable model output, each rejected the stale context and resumed the original Turn without a fresh model call. Independent validation succeeded, the restored Turn settled once and replay added no effects. Hosted qualification

The published PR still needs its current-head review on the target after #9646 lands.

Core prerequisite qualification

The current CLI head was composed locally with #9646 at 6823e56230 and main@dc0505ea3a. The composition preserves both the Core metadata checks and the CLI companion dependencies in the shared install owner. All 25 targeted compatibility and Doctor tests passed.

The branch remains on its published head while #9646 is open. A fresh nine-wheel installation and Deep Doctor run remain part of the exact-head verification after the prerequisite lands.

Split install dependency readback

Recombined with #9646 after its main sync. The combined checkout passed 29 focused CLI and installation tests. The 89 selected installed-wheel cases require external wheel environment configuration and were skipped in that run. The published branch is waiting for #9646 to reach main.

Installed validation with the current ownership prerequisite

Reconciled and tested #9876 with the current #9646 ownership revision (18145cb). All nine wheels were built from the combined checkout and installed into a fresh local environment. Deep Doctor passed and reported a package fingerprint with all seven companions ready. Both the console launcher and Python module returned the same preset list. Removing Benchmark Toolkit made the fallback reject dispatch with exit code 2. The combined source also passed 26 focused tests and the bilingual RFC check. #9646 is still open, so the published #9876 head is awaiting the ownership prerequisite.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@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 · Gemini · Google · self_reported

动机 / Motivation

受影响的调用方与维护者:通过拆包 metapackage loopx 安装完整发行版、并执行未迁入 Core selected-command 集合的既有 CLI 命令(如 preset list、canary、project-skill、goal-channel)以及安装自检(doctor --installation-only --deep)的普通用户与发布维护者。

改动前后的具体场景:改动前,拆包安装 loopx metapackage 只拉起 loopx-core 与配套发行物,不包含 loopx/cli.py 与 loopx/canary/,导致未进入精简分发表的完整 CLI 路径在拆包环境被拒绝或报缺模块错误;改动后,新增同版本过渡发行物 loopx-cli-compat 由 metapackage 钉住,Core 在确认完整发布装配齐备后派发到 loopx.cli,使 preset list 等完整命令恢复可用,但本 PR 在当前 main 基线上缺少依赖型 metapackage 的归属委派修复(PR #9646 尚未合入),导致拆包 loopx 安装下的 doctor --installation-only --deep、companion 诊断和运行时指纹在精确 head 上直接失败。

预期与实测的可观测结果:预期可观测结果是:拆包 loopx metapackage 恢复完整 CLI 回退(如 loopx --format json preset list 返回 5 个预设),同时保持裸 loopx-core 隔离、不完整装配拒绝回退、以及 Deep Doctor 与运行时指纹覆盖全部 7 个 companion。实测在精确 head 1ef497f12585 上,回退派发与不完整装配拒绝已生效,但 loopx metapackage 安装场景的 Deep Doctor 与运行时指纹均未通过,需补齐归属解析与单元测试后再合入。

本次明确不覆盖的范围(Non-goals):本 PR 不改变单仓发布列车与 Apache-2.0 许可,不将完整 parser 迁回裸 loopx-core,不更改可选 capability 的默认关闭或激活权限,也不试图把全部旧 CLI 子命令一次性迁移为 Core selected commands。

从单仓拆包架构演进来看,在所有历史 CLI 命令完全迁移到 Core selected-command 集合之前,使用过渡兼容包恢复拆包 metapackage 的 CLI 兼容性、同时守住裸 loopx-core 隔离与缺依赖拒绝边界,方向本身合理;但当前精确 head 1ef497f12585ca5b7d8531fcab085f254e494943 依赖尚未合入主干的 PR #9646,在直接合入 main 时会立刻破坏 doctor --installation-only --deep、运行时指纹及本 PR 自己新增的 package-smoke.yml 校验断言。

改动思路 / Approach

作者的核心设计是新增过渡发行物 loopx-cli-compat(承载 loopx/cli.py 与 loopx/canary/**),在 packages/loopx-core/prepare.py 中将其钉死到与 loopx-core、Workspace 及 5 个内置 capability 相同的发布版本,并由 loopx metapackage 一并引入。运行时不再用 find_spec("loopx.cli") 猜测“是否为单体安装”,而是在 loopx/python_install_owner.py 中引入 active_core_distribution(),通过当前已加载文件的真实路径是否与 distribution("loopx-core") 匹配来判定运行模式,再通过 inspect_cli_compatibility_distribution() 与 split_cli_compatibility_ready() 核验完整同版本装配后才允许 _run_full_cli()、commands 与顶层帮助放行完整 CLI 回退。同时将 version 子命令移出 _dispatch_selected() 的 effect_runtime_request_scope(),保持版本查询轻量不加载 effect runtime。

架构评估结论:引入独立过渡发行物 loopx-cli-compat 并在 loopx/python_install_owner.py 中通过活跃包路径区分 Core 与单体安装,职责边界清晰且能保持裸 loopx-core 轻量化;但将 active_core_distribution() 引入部分调用点、却将依赖型 metapackage 的 installed_loopx_distribution() 归属修复留在尚未合入的 PR #9646 中,使当前 PR 无法在 main 上独立自洽交付。

当前 PR 合理边界:当前 PR 应作为可独立合入 main 的完整拆包回退切片:要么等待 PR #9646 合入后基于新 main 变基并实测 9 包 metapackage 安装通过,要么在本 PR 内闭环修复依赖型 loopx metapackage 在 installed_loopx_distribution() / Doctor / 指纹链路上的归属解析,并补齐针对 python_install_owner.py 与 cli_runtime.py 新增分支的单元测试。

基于精确 head 1ef497f12585 本地真实构建全部 9 个拆包 wheel 并在隔离虚拟环境实测的四组对照如下(均为离线 wheelhouse 实测结果):

安装形态(精确 head 1ef497f12585) installed_loopx_distribution active_core_distribution preset list doctor --installation-only --deep companion_distributions package_fingerprint
A. 拆包 metapackage (loopx==2.4.1, 9 包) loopx loopx-core PASS(5 个预设) FAIL(representative_package_paths: scripts/loopx) FAIL(None,0 个) FAIL(None)
B. 裸 loopx-core==2.4.1(1 包) loopx-core loopx-core PASS(按预期 exit 2 拒绝) PASS(ok=True) PASS(0 个) PASS(sha256:...)
C. 不完整拆包(缺 benchmark-toolkit,7 包) loopx-core loopx-core PASS(按预期 exit 2 拒绝) PASS(按预期 ok=False 报缺依赖) PASS(含 release_dependency_unavailable) —
D. loopx-core + 全部 7 个 companion(不含 loopx meta,8 包) loopx-core loopx-core PASS(5 个预设) PASS(ok=True) PASS(7 个全 ready=True) PASS(sha256:...)

上表直接坐实了问题根因:核心回退机制与不完整装配拒绝逻辑本身工作正常(场景 B/C/D 均符合预期),唯一导致场景 A(即真正的 pip install loopx 拆包 metapackage 入口)全线失败的断点在于 installed_loopx_distribution() 在当前 main 上仍返回空壳 metapackage loopx,未委派给 loopx-core。

具体改动 / Changes

本次 PR 共修改 15 个文件(新增 187 行、删除 62 行),涵盖:

  • 运行时安装归属与回退门控:loopx/python_install_owner.py(+71/-1)、loopx/cli_runtime.py(+14/-25)、loopx/capabilities/catalog.py(+4/-3)、loopx/bootstrap_command_pack.py(+3/-2)、loopx/release_candidate.py(+4/-2)、loopx/release_manifest.py(+3/-11)。
  • 拆包构建与发行物定义:新增 packages/loopx-cli-compat/pyproject.toml 与 README.md,修改 packages/loopx-core/prepare.py(+30/-6)增加 prepare_cli_compat_source() 并将 loopx-cli-compat 加入 metapackage 依赖与 CLI 选项。
  • 发布/烟测工作流:.github/workflows/package-smoke.yml(+12/-4)在离线 wheelhouse 构建 loopx-cli-compat 并断言 Deep Doctor 覆盖 7 个 companion 且 preset list 可用;.github/workflows/split-release-candidate.yml(+2/-0)增加 preset list 校验。
  • 双语 RFC 与测试:同步更新 docs/architecture/rfcs/monorepo-distribution-split-v0.md 与 .zh-CN.md(各 +2/-0),修改 tests/test_core_distribution.py(+7/-0)与 tests/test_doctor_installation_scope.py(+3/-8)。

关键代码讲解

  1. loopx/python_install_owner.py:25-37(active_core_distribution / monolithic_cli_available):改用 distribution("loopx-core").locate_file("loopx/python_install_owner.py").resolve() == Path(__file__).resolve() 识别当前是否从 loopx-core 加载,并据此定义 monolithic_cli_available()。这使得即便拆包环境安装了 loopx-cli-compat(提供了 loopx.cli),capability 目录发现与 Doctor 仍不会误判为单体安装。但在同文件第 84-94 行,installed_loopx_distribution() 仍优先返回 lookup("loopx"),与 active_core_distribution() 形成语义割裂。
  2. loopx/python_install_owner.py:40-81(inspect_cli_compatibility_distribution / split_cli_compatibility_ready):复用 inspect_builtin_capability_distribution() 检查 loopx-cli-compat 的模块/资源归属与非 editable 约束,再核对 distribution("loopx-cli-compat").requires 精确等于 loopx-core 与 6 个运行时 companion 的同版本钉死集合,并逐一检查这些发行物均以同版本安装;缺失时返回 release_dependency_unavailable 与 unavailable_dependencies,元数据不符时返回 invalid_companion_metadata。
  3. loopx/cli_runtime.py:1188-1263(_standalone_core / _run_full_cli / main / _dispatch_selected):_standalone_core() 改为委托 active_core_distribution() is not None;_run_full_cli()、顶层 --help 与 commands 改为在 _standalone_core() and not split_cli_compatibility_ready() 时维持精简集合/拒绝回退,兼容装配就绪时才导入 loopx.cli.main。_dispatch_selected() 第 1019 行将 "version" 纳入免 effect_runtime_request_scope() 白名单,实测 loopx --format json version 不再加载 loopx.control_plane.effect_runtime(基线 6b12a4906ecc 会加载)。
  4. packages/loopx-core/prepare.py:284-314(prepare_cli_compat_source / prepare_meta_source):抽出 SPLIT_RUNTIME_DISTRIBUTIONS 与 _pin_release_dependencies();prepare_cli_compat_source() 仅打包 loopx/cli.py 与 loopx/canary/** 源码并将 requires-release.txt 钉死到全部 7 个运行时发行物,prepare_meta_source() 再额外钉死 loopx-cli-compat。

规范逐项对照(docs/architecture/rfcs/monorepo-distribution-split-v0.md @ 6b12a4906eccdc9151de117e13abff69564fdf99)

  • I1-monorepo-single-train(I1 单仓单 PR 单发布列车):implemented — loopx-cli-compat 位于 packages/loopx-cli-compat/,由 packages/loopx-core/prepare.py 在同一版本列车构建,双语 RFC 已同步更新(check_rfc_bilingual.py PASS)。
  • I2-disjoint-kernel-truth(I2 内核单一真值与包内容无重复拷贝):implemented — 9 包构建实测 loopx-cli-compat 仅含 loopx/cli.py 与 loopx/canary/**,与 loopx-core 及其他 companion 文件集完全互斥(场景 D 运行时指纹校验通过)。
  • I4-missing-optional-degrades-cleanly(I4 缺失可选发行物降级为不可用,绝不静默替代):implemented — 场景 C 实测缺失 loopx-capability-benchmark-toolkit 时,capability list 准确报告 benchmark-toolkit 为 installed=false, ready=false,同时 split_cli_compatibility_ready() 返回 False 并拒绝 preset list 回退。
  • I5-lightweight-non-effectful-paths(I5 内核安装与轻量命令不强依赖 Node/effect runtime):implemented — 实测 loopx --format json version 在 Head 上不加载 loopx.control_plane.effect_runtime(基线会加载)。
  • S5-split-metapackage-qualification(Section 5 拆包 loopx metapackage 完整安装装配与自检资格):not_met — 在精确 head 1ef497f12585 上安装 loopx==2.4.1 metapackage 后,doctor --installation-only --deep 失败(exit 1)、companion_distributions 为 None、package_fingerprint 为 None,未满足本 PR 新增的 .github/workflows/package-smoke.yml:246-263 与 split-release-candidate.yml:94-96 验收标准。最小修复:合入 PR #9646 并变基,或在本 PR 内修正依赖型 loopx metapackage 的 installed_loopx_distribution() 归属解析。

对主干的风险 / Risks

阻塞问题(Blocking Findings)

  1. [High / Blocking] 依赖未合入的 PR #9646:精确 head 在拆包 loopx metapackage 安装下导致 Deep Doctor、companion 诊断、运行时指纹及本 PR 的 package-smoke.yml 断言全部失败

    • Problem:loopx/python_install_owner.py:84-94 的 installed_loopx_distribution() 仍无条件优先返回 distribution("loopx")。在拆包 metapackage 安装中,loopx 是零代码的空壳元包,真实代码和 console script 属于 loopx-core。而 loopx/release_candidate.py:317-321(collect_companion_distribution_diagnostics)、loopx/release_manifest.py:341-347(_distribution_runtime_fingerprint)与 loopx/doctor.py:181-190(_python_distribution_owning_module)全部依赖 installed_loopx_distribution()。作者在 PR 描述中注明是在合并了未合入的 PR #9646 后做的集成验证,但当前 PR 直接指向 main(6b12a4906ecc),PR #9646 仍处于 OPEN 状态。
    • Evidence:在精确 head 1ef497f12585 本地用 packages/loopx-core/prepare.py + uv build --wheel 构建全部 9 个 wheel,在隔离 venv 安装 loopx==2.4.1 后实测:installed_loopx_distribution(distribution).name == "loopx",doctor.python_distribution_install(...) == {"available": False},release_manifest._distribution_runtime_fingerprint() is None,collect_companion_distribution_diagnostics() 返回 0 个 companion,loopx --format json doctor --installation-only --deep 返回 exit 1(ok: false,失败项 representative_package_paths: scripts/loopx,companion_distributions: null)。对照组卸载/不装 loopx metapackage、仅装其余 8 包时,doctor --installation-only --deep 立即 ok: true、返回 7 个 ready=true companion 并输出有效 package_fingerprint。
    • Impact:若当前 head 直接合入 main,.github/workflows/package-smoke.yml 的 core-companions 拆包安装任务与 .github/workflows/split-release-candidate.yml 会立即在 main 上失败;用户通过 loopx metapackage 安装后无法通过 Deep Doctor 自检,也丢失运行时指纹。
    • Fix:要么先合入 PR #9646 并将本 PR 变基至更新后的 main 重新验证,要么在本 PR 中一并让 installed_loopx_distribution()(或 doctor.py / release_candidate.py / release_manifest.py)对仅含 .dist-info 且钉死 loopx-core==<version> 的依赖型 loopx metapackage 委派到 loopx-core。
    • Rerun command:构建 9 包 offline wheelhouse 后在隔离 venv 安装 loopx==<version>,运行 loopx --format json doctor --installation-only --deep 与 loopx --format json preset list,验证 ok == True、7 个 companion_distributions 全 ready == True、service_runtime_identity.package_fingerprint 非空且 preset list 返回有效预设。
  2. [Medium / Blocking] loopx/python_install_owner.py 与 loopx/cli_runtime.py 新增的关键归属与回退门控分支缺少单元测试覆盖

    • Problem:本 PR 在 loopx/python_install_owner.py 新增 4 个公共函数(含 invalid_companion_metadata、release_dependency_unavailable 等失败路径)并修改 loopx/cli_runtime.py 的 _standalone_core、_run_full_cli、commands、--help 与 version effect-runtime 豁免逻辑,但测试改动仅包含 tests/test_core_distribution.py 的 7 行 staging 文件断言以及 tests/test_doctor_installation_scope.py 中对 monolithic_cli_available 的桩替换(lambda: False)。
    • Evidence:在 tests/ 中检索 active_core_distribution、split_cli_compatibility_ready、release_dependency_unavailable、CLI_COMPAT_DISTRIBUTION 均无任何单测覆盖;inspect_cli_compatibility_distribution 仅在 mock 列表中被引用。这也直接导致阻塞问题 #1 在 tests/test_core_distribution.py、tests/test_doctor_installation_scope.py、tests/test_cli_entrypoint.py(362 passed)全部绿灯时完全未被拦截。
    • Impact:后续修改拆包依赖清单、metapackage 归属或 CLI 门控时极易引入静默回归,本地单测无法提供有效防护。
    • Fix:在 tests/test_doctor_installation_scope.py 或 tests/test_core_distribution.py / tests/test_cli_entrypoint.py 补齐针对以下路径的单元测试:(1) 拆包 metapackage、裸 Core、单体安装下 active_core_distribution() / monolithic_cli_available() / installed_loopx_distribution() 的行为;(2) inspect_cli_compatibility_distribution() 的正常、invalid_companion_metadata、release_dependency_unavailable 分支;(3) cli_runtime 在 _standalone_core=True 且 split_cli_compatibility_ready 为 True/False 时的 _run_full_cli、commands、--help 分支与 version 不触发 effect_runtime。
    • Rerun command:uv run --extra test python -m pytest tests/test_core_distribution.py tests/test_doctor_installation_scope.py tests/test_cli_entrypoint.py -q

非阻塞建议(Non-Blocking Observations)

  • loopx/python_install_owner.py:55-61 对 distribution(CLI_COMPAT_DISTRIBUTION).requires 做严格字符串集合比对(declared != expected)。当前 packages/loopx-cli-compat/pyproject.toml 固定了 setuptools==83.0.0,实测可精确产出 name==version;但若未来构建前端或元数据规范化在 == 两侧添加空格或括号(如 scripts/release_artifacts.py:154-157 已兼容的形态),严格字符串比对可能误报 invalid_companion_metadata,后续可考虑复用标准化 specifier 解析。

隔离、权限与验证摘要

  • 默认关闭与隔离(default_off_isolation):实测裸 loopx-core(场景 B)下 find_spec("loopx.cli") is None、split_cli_compatibility_ready() is False,preset list 与 canary --help 均被 exit 2 拒绝;不完整拆包(场景 C,缺 benchmark-toolkit)下 benchmark-toolkit 保持 installed=false, ready=false 且回退被拒绝,未发生静默激活或越权回退。
  • 权限语义(authority_semantics):loopx-cli-compat 仅为过渡分发包,不新增任何 capability/provider 写入权限或执行授权,console 入口和激活边界仍由 Core 持有。
  • 类型化状态规则与语义对齐(typed_state_rule / domain_neutrality / behavior_change_disclosure / guidance_vs_obligation):沿用既有 inspect_builtin_capability_distribution() 结构化字典返回并新增机器可读原因 release_dependency_unavailable(领域中性,无特定业务硬编码);但 requires 集合采用原始字符串精确比对(已列为非阻塞提示)。行为变化(拆包 metapackage 钉住 loopx-cli-compat)已在双语 RFC 与包 README 中披露。
  • 本地验证矩阵(wait_for_ci=false,未等待远程 CI):
    • uv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --head HEAD:PASS
    • uv run --extra test loopx canary premerge --tier quick --from-git-diff --git-diff-base origin/main:PASS(4 direct checks + py_compile + 3 catalog canaries + public boundary 15 changed files)
    • uv run --extra test python -m pytest tests/test_core_distribution.py tests/test_doctor_installation_scope.py tests/test_cli_entrypoint.py -q:PASS(362 passed, 86 skipped)
    • uv run --extra test python -m pytest tests/test_ci_resource_policy.py tests/test_release_artifact_publication.py tests/test_python_install_owner_platform.py -q:PASS(237 passed, 3 skipped)
    • 精确 head 9 包真实构建与隔离虚拟环境安装对照(场景 A/B/C/D):场景 B/C/D PASS,场景 A(loopx==2.4.1 metapackage Deep Doctor / companion 诊断 / fingerprint)FAIL(复现阻塞问题 #1)。

我的整体评价 / Verdict

  • 目标与结果影响(outcome_impact):
    • long_horizon:regression — 虽然完整 CLI 回退命令(如 preset list)在拆包环境中恢复可用,但在精确 head 直接合入 main 后,拆包 metapackage 安装的 doctor --installation-only --deep 与 package_fingerprint 持续失败,直接阻断升级/发布自检与长程环境健康验证。
    • user_experience:regression — 用户按发布指引安装 loopx metapackage 后运行 loopx doctor --installation-only --deep 会误报缺失源码脚本 scripts/loopx 且看不到任何 companion 状态;需先补齐依赖型 metapackage 归属解析。视觉评审(visual_review):not_applicable(本次改动仅涉及 Python 打包分发、CLI 路由/自检与 GitHub Actions 工作流(loopx/python_install_owner.py、loopx/cli_runtime.py、packages/loopx-core/prepare.py、.github/workflows/),未修改任何 Web/App 渲染界面,因此视觉检查不适用。;未验证范围:none(纯打包、CLI 运行时与发布工作流变更,无渲染界面改动)。)。
  • 可观测语义与兼容评估(observable_semantics & code_volume):与基线 6b12a4906ecc 相比,本 PR 正确消除了 version 子命令加载 effect_runtime 的开销,并在裸 Core 与不完整装配场景中守住了回退拒绝和 capability 隔离;但拆包 metapackage 场景在当前 main 上出现 Deep Doctor 与运行时指纹回归(unintended_drift)。整体代码量(+187/-62)聚焦且不过度膨胀,但测试覆盖明显不足。
  • 语义词表结论(semantic_alignment):本次仅在 loopx/python_install_owner.py 本地诊断原因集中扩展了 release_dependency_unavailable(local_only),未修改共享 control-plane 状态机词表 loopx/semantics/vocabulary_v0.json;当前 semantic_alignment 判定为 aligned(不涉及词表注册或 RFC/CI 契约违规)。
  • 残余风险与复审门槛:本结论基于精确 head 1ef497f12585ca5b7d8531fcab085f254e494943(复核远端 head 未变化)。重新提交复审需提供:(1) 依赖型 loopx metapackage 归属修复(合入 PR #9646 后变基,或在本 PR 内闭环修复)及精确 head 9 包离线安装通过 doctor --installation-only --deep(含 7 个 ready companion 与 package_fingerprint)的实测证据;(2) 针对 python_install_owner.py 与 cli_runtime.py 新增分支的通过单元测试。

英文简短结论
English verdict: REQUEST_CHANGES at head 1ef497f. While loopx-cli-compat fallback dispatch, standalone loopx-core isolation, incomplete-install refusal, and lightweight version routing work as verified on built wheels, installing the split loopx metapackage on this exact head against main fails doctor --installation-only --deep (ok: false, missing scripts/loopx), returns zero companion_distributions (breaking .github/workflows/package-smoke.yml), and yields package_fingerprint=None because installed_loopx_distribution() still selects the empty loopx metapackage (prerequisite PR #9646 is still open); additionally, the new ownership and fallback-gating branches in loopx/python_install_owner.py and loopx/cli_runtime.py lack direct unit tests.

…alify-split-cli-review-20261202-lxq.1uSqtz2p

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…alify-split-cli-review-20261202-lxq.1uSqtz2p

Signed-off-by: lusendong.6789 <lusendong.6789@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.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

评审提交 aa46838dbdc0bc269afe70cf2fc0ce939911b054,提案比较基线 abbd0fad2f564344cf52bb1db01a59b4078b40d4,核对主干 abbd0fad2f564344cf52bb1db01a59b4078b40d4。通过分包元发行版安装 LoopX 的操作者,需要完整旧 CLI 与可供发布校验的运行身份。 主干的分包安装缺少完整解析器,preset 路由被拒绝,元包也无法证明 Core 的实际文件所有权。 覆盖 Core、兼容包、元包和发布冒烟。现有 standalone Core 仍有受支持的命令集合。

现头恢复 preset CLI 并对纯 Core、版本不匹配或缺失分包实施拒绝,完整分包的 Doctor 所有权仍待依赖进入目标分支。

改动思路 / Approach

Core 按当前安装位置识别本体,兼容 guard 检查实际资源和已声明的完整版本闭包。发布冒烟再以实际 wheel 运行旧入口和安装自检。 入口门禁与 Doctor 所有权现由不同判断返回结果。只恢复命令调用会留下安装健康与运行身份不一致。 安装元数据与 RECORD 的实际文件由 python_install_owner 解释,CLI runtime 负责路由,Package Smoke 是完整装配的调用方。

具体改动 / Changes

  • 16 文件 +352/-62。新增兼容 wheel 只装现有解析器与 canary 包,并以同版本依赖约束绑定现有 Core、Workspace 和能力包。
  • 当前精确头重建九个 wheel。两种真实 CLI 路由均返回 5 个 preset,纯 Core 和缺伴包两侧均退出 2。现头补上的版本命令与共享回退门禁测试通过。
  • 将 #9646 在隔离目录合入时同一所有权文件发生冲突。保留双方改动后,仅换入由合成树构建的 Core wheel,其余八个成品固定,Deep Doctor 与伴包指纹恢复。

验收依据 · 原生路径说明 · abbd0fa

  • split-fallback 全量分包的两个旧解析入口工作。 对应位置
  • isolated-core 纯 Core 和缺伴包仍拒绝。 对应位置
  • split-runtime-identity 完整安装从 Core 读回实际运行身份、七个伴包与指纹。 对应位置

对主干的风险 / Risks

当前头的全量装配虽能查询 preset,Deep Doctor 却失败于 representative_package_paths 缺 scripts/loopx。报告没有伴包清单或安装指纹。#9646 的当前分支与本提交在同一所有权文件冲突,无法用局部组合替代交付。 作者提供的 Debian 证据属于不同的本地组合。本轮只在隔离 macOS 安装了独立重建的精确头全量包与仅替换 Core 的合成对照。两种组合的通过范围可从各自的同一命令读回。

我的整体评价 / Verdict

请求修改。当前提案的正常发布检查无法读取运行身份。合成产物证明所需修复位置。 让 #9646 的所有权修复先进入目标分支,解决两处改动的整合,再对更新后的精确头运行九包安装、Deep Doctor、两种入口及缺伴包对照。 69 项源码测试通过,3 项按平台条件跳过,quick premerge 通过。隔离环境完整安装通过包依赖检查,Deep Doctor 仍退出 1。仅换入合成的 Core wheel 后,Deep Doctor 退出 0,七个伴包就绪且出现运行指纹。

English verdict: REQUEST_CHANGES at aa46838. The exact-head nine-wheel installation restores preset dispatch and rejects incomplete assemblies, but Deep Doctor still selects the dependency-only metapackage and cannot qualify runtime identity. Swapping only the Core wheel built with #9646 restores the checks. Integrate the ownership prerequisite and requalify the new exact head.

"$install_root/bin/loopx" --format json doctor --installation-only --deep
) | tee "$RUNNER_TEMP/split-meta-doctor.json"
"$install_root/bin/python" -I - "$version" "$RUNNER_TEMP/split-meta-doctor.json" <<'PY'
"$install_root/bin/loopx" --format json doctor --installation-only --deep | tee "$RUNNER_TEMP/split-meta-doctor.json"

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.

[P2] 当前九包安装无法通过 Deep Doctor。 当前头的全量装配虽能查询 preset,Deep Doctor 却失败于 representative_package_paths 缺 scripts/loopx。报告没有伴包清单或安装指纹。#9646 的当前分支与本提交在同一所有权文件冲突,无法用局部组合替代交付。 让 #9646 的所有权修复先进入目标分支,解决两处改动的整合,再对更新后的精确头运行九包安装、Deep Doctor、两种入口及缺伴包对照。

This branch has not been deployed

No deployments
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.

2 participants