Skip to content

Install Benchmark Toolkit alongside standalone Core - #9038

Open
cocolord wants to merge 2 commits into
mainfrom
codex/core-benchmark-package-boundary-20261119
Open

cocolord wants to merge 2 commits into
mainfrom
codex/core-benchmark-package-boundary-20261119

Conversation

@cocolord

@cocolord cocolord commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Goal and delivered outcome

A user can add Benchmark Toolkit to a standalone Core environment when a task needs evaluation or research analysis. The matching loopx-capability-benchmark-toolkit wheel supplies the existing loopx benchmark commands and assessment store. Core supplies the catalog and its referenced four-arm contract. Capability discovery reports the installed provider and leaves execution unloaded.

Rebased cleanly onto origin/main@6915df67db (including #9049 Standard capability packages, #9504 lazy explore gating, #9498, and #9058 loopx-workspace distribution split) and updated to 14b8f48355d32328a7c830ea9e95ccf5e7035d86 (18 files, git merge-tree --write-tree origin/main HEAD clean at 41ad8640e5):

  • .github/workflows/package-smoke.yml & tests/test_ci_resource_policy.py (resolving review threads PRRT_kwDOStEbEs68jtRp and PRRT_kwDOStEbEs68jtRz): Restores the three baseline pull_request.paths triggers (packages/**, apps/presentation/dashboard/**, scripts/chat_bundle.py) alongside tests/test_core_benchmark_distribution.py, removes the duplicate second Toolkit qualification step at line 138 so Benchmark Toolkit builds once into $RUNNER_TEMP/benchmark-source before Build the matching Workspace wheel, and adds CI resource-policy regression assertions covering single-path triggers and unique per-distribution prepare.py --output targets.

  • loopx/python_install_owner.py: Preserves raw wheel RECORD inspection (distribution_recorded_files, is_distribution_artifact, symlink-free physical artifact verification) and registers BENCHMARK_TOOLKIT_DISTRIBUTION = "loopx-capability-benchmark-toolkit" alongside WORKSPACE_DISTRIBUTION so builtin_capability_installed fails closed on missing indirect modules as well as startup modules.

  • loopx/release_manifest.py: Includes BENCHMARK_TOOLKIT_DISTRIBUTION in _CORE_COMPANION_DISTRIBUTIONS using the shared raw RECORD artifact owner (distribution_recorded_files / is_distribution_artifact).

  • packages/loopx-core/prepare.py, loopx/capabilities/catalog.py, loopx/cli_runtime.py, loopx/presentation/research_analysis_api.py: Stages BENCHMARK_TOOLKIT_DISTRIBUTION execution files and benchmark_* CLI commands cleanly in loopx-capability-benchmark-toolkit while retaining research_analysis_api.py and runtime_workspace.py inside loopx-workspace, wiring _research_analysis_store() with benchmark_toolkit_installed() + lazy import_module (503 research_analysis_unavailable), and guarding loopx benchmark CLI registration/help alongside _WORKSPACE_COMMANDS and _FULL_INSTALL_SELECTED_COMMANDS.

  • tests/test_core_benchmark_distribution.py, tests/test_core_distribution.py, tests/test_distribution_runtime_identity.py: Verifies real loopx-core + loopx-capability-benchmark-toolkit installation, partial startup (benchmark_study.py) and indirect-dependency (trajectory_assessment.py) removal/restoration across File/SQLite, runtime identity completeness via real RECORD, and Core catalog/command isolation; deduplicates test_matching_workspace_owns_only_its_records cleanly with #9058.

Related to #5072 and #9058. Built from prior #9034 / #9038 work (f0afdefb87, 5213b2f141, 9a5aa5ec65, 88726a8bdd, f54dd039ed).

Author declaration

Verification

Tested on macOS arm64 against HEAD 14b8f48355d32328a7c830ea9e95ccf5e7035d86 (base origin/main@6915df67db) with real built 2.4.1 wheels (loopx-core, loopx-capability-benchmark-toolkit, and loopx-workspace) in one shared $RUNNER_TEMP:

Boundary Observed result
Shared $RUNNER_TEMP real 2.4.1 Core -> Toolkit -> Workspace wheels (pytest -q) 96 passed, 0 failed, 0 skipped: tests/test_core_distribution.py + tests/test_distribution_runtime_identity.py (82 passed in 173.67s), tests/test_core_benchmark_distribution.py (7 passed in 49.95s), and after scripts/chat_bundle.py build --install + prepare.py --distribution loopx-workspace, tests/test_core_workspace_distribution.py (7 passed in 41.91s).
CI workflow trigger & step policy (pytest -q tests/test_ci_resource_policy.py) 170 passed in 4.68s (verifies packages/**, apps/presentation/dashboard/**, scripts/chat_bundle.py, and tests/test_core_benchmark_distribution.py trigger package-smoke.yml, single Toolkit qualification before Workspace, and distinct prepare.py --output paths).
Static checks & boundary scans (committed 14b8f48355) ruff check (tests/test_ci_resource_policy.py, tests/test_core_benchmark_distribution.py, tests/test_core_distribution.py, tests/test_distribution_runtime_identity.py, packages/loopx-core/prepare.py clean); mypy --follow-imports=silent (17/17 configured files clean); check_rfc_bilingual.py --base origin/main --head HEAD passed; git merge-tree --write-tree origin/main HEAD (41ad8640e5, clean); loopx check (ok=true, 0 errors, 0 warnings across 18 files).
Goal Change-Quality & canary premerge (tier=standard) Goal CQR cqr_2574af7e4301f9a7eaf4 (decision="pass", receipt_valid=true, blocking=false, scope 2574af7e4301f9a7eaf404cc533403b54d303bd2abb4bb3f54a1706beb2431b2). canary premerge: 6/6 direct + 10/10 catalog + 8/8 risk-profile + 1/1 public-boundary passed (0 failures, policy_failure_count=0, manual_hold_count=1 on benchmark_sensitive).

Package Smoke builds the matching toolkit wheel and tests the install, File/SQLite result recovery, and removal path. Full benchmark-family execution, public PyPI publication, and matched model outcomes/full costs remain separate RFC acceptance.

Boundary checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces/verifier output, internal links, or local machine paths.
  • Paired English/Chinese RFC diffs pass scripts/check_rfc_bilingual.py --base origin/main --head HEAD.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

@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
Target Exact Head: 92e4815

动机 / Motivation

本 PR 针对独立安装的 loopx-core 发行包中 benchmark-toolkit 能力状态与实际打包边界不一致的问题进行最小闭环修复:

  • 受影响调用方(Affected caller / operator):Operators and developers who install the standalone loopx-core wheel instead of the ordinary LoopX package, as well as maintainer/CI build jobs running packages/loopx-core/prepare.py and capability discovery commands (loopx capability list, loopx capability show benchmark-toolkit, and loopx benchmark).
  • 变更前后场景(Before / after scenario):Before this PR (at baseline 453d4e3), packages/loopx-core/prepare.py copied all 36 files under loopx/capabilities/benchmark_toolkit/, all 9 loopx/cli_commands/benchmark_*.py command modules, and the workspace research-analysis presentation endpoints into the standalone loopx-core wheel, while loopx capability show benchmark-toolkit reported provider_id='loopx-core' with ready=True even though loopx benchmark --help failed with exit code 2 as unavailable. After this PR, standalone Core keeps only the 3 benchmark catalog/contract files (README.md, catalog_entry.py, four_arm_contract.py) in a namespace package without init.py, excludes the execution adapters and presentation research APIs, reports provider_id='loopx' with installed=enabled=ready=False, and directs callers to the ordinary LoopX installation.
  • 可观测结果改善(Observable outcome):In an installed non-editable loopx-core wheel, loopx capability list and loopx capability show benchmark-toolkit project provider_id='loopx' with provider_state={'declared': True, 'installed': False, 'enabled': False, 'ready': False} and next_real_step pointing to the ordinary LoopX installation, while loopx benchmark --help exits cleanly with code 2 before dispatch and excluded benchmark/presentation modules cannot be imported.
  • 非目标边界(Non-goals):Does not split benchmark-toolkit into its own packages/ wheel, does not alter ordinary full-distribution capability status or runtime authority/quota/Turn execution semantics, and does not qualify installed Standard or Windows wheel builds.
  • 当前增量后仍存在的缺口(Remaining gap):Independent capability packaging under packages/, installed Standard distribution qualification, and model-visible context overhead measurements remain deferred work toward RFC decision D2.

如果不修这一缺陷,只安装 loopx-core 的用户在查询能力目录时会看到 benchmark-toolkit 显示 ready=True,但真正执行 loopx benchmark 时却被全量 CLI 缺失拒绝;同时独立 Core wheel 仍平白携带 36 个 benchmark 实现文件、9 个 benchmark_*.py CLI 适配器和工作台研究分析 HTTP 接口,违背小内核发行物应诚实暴露未安装扩展态(I4)的设计契约。

改动思路 / Approach

作者没有新建第二套扩展声明清单、构建期开关或硬编码命令名单,而是复用现有两个唯一 owner 协作完成边界收口:

  1. 打包过滤边界(packages/loopx-core/prepare.py):将 loopx/capabilities/benchmark_toolkit/ 与 loopx/cli_commands/benchmark_ 加入 EXCLUDED_PREFIXES,将 loopx/presentation/research_analysis_api.py 与 loopx/presentation/runtime_workspace.py 加入 EXCLUDED_MODULES,仅通过 BENCHMARK_CATALOG_FILES 白名单保留 README.md、catalog_entry.py 和 four_arm_contract.py(故意不包含 __init__.py,使 benchmark_toolkit 在 Core wheel 中退化为 PEP 420 namespace package,避免导入目录条目时触发执行门面副作用)。
  2. 目录能力投影边界(loopx/capabilities/catalog.py):Reuses the single existing CapabilityRegistry provider-state contract (build_capability_registry) and the existing packaging filter (prepare_core_source) via a narrow importlib.util.find_spec('loopx.cli') check rather than adding a parallel distribution manifest, runtime flag, or second capability registry.
  3. 当前 PR 边界(Current PR boundary):Keep benchmark catalog metadata and the stdlib-only four-arm contract inside standalone Core while excluding benchmark execution adapters, experiment stores, and workspace research-analysis APIs; defer separate benchmark wheel extraction to later D2 work.

普通全量安装(find_spec("loopx.cli") is not None)路径保持零改动:benchmark-toolkit 仍注册在就绪的 loopx-core provider 下;只有缺少 loopx.cli 门面的独立 Core 环境会为缺失执行面注册未安装 builtin provider loopx。

具体改动 / Changes

  • 规范基准映射(Spec basis):对照 docs/architecture/rfcs/monorepo-distribution-split-v0.md 在 PR 前不可变提交 453d4e3 中确立的基准不变量逐项核验:
    • I2 (内核真相唯一 owner 与零重复实现路径):implemented — 仅保留 catalog.py(build_capability_registry)与 prepare.py(prepare_core_source)唯一所有者,通过安装态 test_installed_core_lists_benchmark_as_unavailable 与导入边界测试验证。
    • I4 (缺失可选发行物退化为等价扩展关闭态、禁止静默替代):implemented — build_capability_registry 在无 loopx.cli 时投影 provider_id="loopx" 且 installed=enabled=ready=False,由真实安装态 wheel 的 capability list / capability show 与 benchmark --help 退出码 2 验证。
    • I6 (移动或排除文件不改变公开/私有扫描边界与许可规则):implemented — loopx check 与 canary premerge 扫描全部 6 个变更文件零违规。
    • I7 (未启用/未安装可选组件不初始化、显式请求在分发前失败关闭):implemented — 省略 benchmark_toolkit/__init__.py 与 cli_commands/benchmark_*.py,loopx benchmark --help 在分发前经 _run_full_cli 返回拒绝。
  • 对 RFC 双语修订的独立审查:PR 同时在 docs/architecture/rfcs/monorepo-distribution-split-v0.md 与 .zh-CN.md 中新增 1 段关于 D2 边界的说明(确认 Core 保留目录元数据与四臂契约、benchmark 执行留在普通发行物)。该说明忠实反映上述既定 I2/I4 边界,未修改原有基线不变量或放宽验收门禁,中英文语义一致(check_rfc_bilingual.py 通过)。

关键代码讲解

  1. packages/loopx-core/prepare.py — prepare_core_source(EXCLUDED_PREFIXES / EXCLUDED_MODULES / BENCHMARK_CATALOG_FILES)
    • 在源码暂存筛选中以 (path.as_posix() in BENCHMARK_CATALOG_FILES or not path.as_posix().startswith(EXCLUDED_PREFIXES)) 精确放行目录与纯标准库四臂契约文件,排除执行期适配器及依赖它们的 presentation/research_analysis_api.py 与 runtime_workspace.py;刻意省略 benchmark_toolkit/__init__.py 以防导入目录数据时连带执行门面初始化。
  2. loopx/capabilities/catalog.py — build_capability_registry
    • 在注册内置能力前用 has_full_cli = find_spec("loopx.cli") is not None 零副作用探测全量 CLI 门面是否存在。仅当为 False 时注册 {"id": "loopx", "origin": "builtin", "installed": False},并通过不可变字典并集为 BENCHMARK_TOOLKIT_CATALOG_ENTRY 覆盖 "provider_id": "loopx" 与明确 next_real_step,不修改模块级常量自身。
  3. loopx/capabilities/benchmark_toolkit/catalog_entry.py — BENCHMARK_TOOLKIT_CATALOG_ENTRY(结合 four_arm_contract.py)
    • 仅依赖 Python 标准库与 .four_arm_contract(BENCHMARK_FOUR_ARM_ATTESTATIONS、BENCHMARK_FOUR_ARM_RUNNER_OBLIGATIONS),保证即使 benchmark_toolkit/__init__.py 与所有执行模块被移除,目录构建仍能零外部依赖、零私有导入安全加载。
  4. tests/test_core_distribution.py — test_core_staging_excludes_workspace_and_reuses_kernel_bytes / test_installed_core_identity_help_and_unavailable_workspace / test_installed_core_lists_benchmark_as_unavailable
    • 分别从打包暂存目录文件清单、独立非可编辑 loopx_core-2.4.0 wheel 的 find_spec 负向可达性、真实子进程 CLI 目录 JSON 输出与 loopx benchmark --help 拒绝退出码 2 三层闭环覆盖行为边界。

对主干的风险 / Risks

无阻断缺陷(No blocking finding)。 本次变更是高度局部化的打包白名单与目录状态投影修复,对主干普通安装路径零行为漂移:

  • 默认隔离(Default-off / ordinary-install parity):在主干普通安装环境(存在 loopx.cli)实测 capability show benchmark-toolkit 仍返回 provider_id="loopx-core" 与 installed=enabled=ready=True,与 453d4e349cb08b4dd3258c4bbaaed4b9a3b513c8 完全一致;仅在独立 Core 环境生效,且未新增任何通用状态枚举或语义词汇(semantic_alignment 为 not_applicable)。
  • 负向与失效边界验证:在真实打包安装的 loopx_core-2.4.0(CPython 3.12 非可编辑安装)运行 tests/test_core_distribution.py 与 tests/control_plane/test_installed_core_context.py,49 passed (0 failed, 0 skipped);导入边界与能力文档/扩展注册测试 59 passed;CLI 入口相关过滤回归 24 passed;ruff、mypy、npm run typecheck:control-plane、check_rfc_bilingual.py、loopx check 及 canary premerge(merge_gate_passed: true)全部通过。
  • 残余风险(Residual risk):(1) canary premerge 中的 control-plane-maintainability-ratchet-smoke.py 报告了 2 条与本 PR 无关的既有超长决策函数项(loopx/control_plane/heartbeat/builder.py 与 work_items/interaction_contract.py),标记为 advisory_inherited_failure;(2) 本地未运行 Windows 平台 wheel 构建或远端 GitHub CI(遵循策略 wait_for_ci: false);(3) 本 PR 仍依赖 loopx.cli 模块存在与否作为全量安装判定代理,未来若 loopx meta-package 在无 loopx.cli 下拆分扩展包,需要与 RFC D2 一并演进该判定。最强补充验证是在发布流水线执行跨平台 wheel 构建与普通全量安装共存测试。

我的整体评价 / Verdict

  • 长程演进影响(long_horizon: preserved):不修改 Turn/Todo/Quota/Lease 状态机与恢复契约,已安装 Core 的长程恢复与上下文契约全部实测通过;同时让 Core 目录不再对长程 Agent 误报 benchmark-toolkit 就绪,避免后续回合在缺失能力上空转重试。
  • 用户体验与可视化审计(user_experience: improved):在独立 Core 中将 benchmark-toolkit 诚实标注为 installed=False, ready=False 并提供明确替代引导。visual_review 说明:Verified read-only CLI help, capability JSON/Markdown output, and refusal stderr across the 6 changed files; no web UI, HTML surface, or rendered browser presentation changes in this PR. 未覆盖范围:None; no rendered UI or frontend presentation changes (standalone Core distribution packaging and CLI catalog metadata only).
  • 可观测语义与代码体量:全量安装保持行为完全等价,独立 Core 行为变更有 I4 与完整安装态测试支撑(intentional_change_validated);全 PR 仅 +87/-4(6 个文件),无多余抽象与重复逻辑(code_volume: necessary、change_proportionality: proportionate),未新增共享词汇或扩展持久化状态,不扩大任何主体权限或生命周期(authority_semantics: not_applicable)。
  • 本地验收汇总(PASS):installed loopx_core-2.4.0 wheel pytest(49 passed)、architecture & capability pytest(59 passed)、CLI entrypoint pytest subset(24 passed)、ruff / mypy / tsc / check_rfc_bilingual / loopx check / canary premerge 均通过;精确审阅 head:92e48150544d399ee24d30b0759c7dcbe7a7fd1c。

English Verdict: APPROVE

loopx-agent
loopx-agent previously approved these changes Nov 18, 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.2-sol · OpenAI (runtime_reported, max)

动机 / Motivation

独立安装 Core 的用户查看能力目录,要知道当前能运行什么以及如何取得缺少的能力。
原来的 Core 目录显示 Benchmark provider 已就绪,实际调用却被引向普通发行版。现在列表与详情会如实显示未安装,并给出原来的继续路径。
独立 Core 实际少装 44 个 Benchmark 与研究工作台相关文件,帮助和其他 24 个能力详情保持一致。
此切片交付现有 Core 发行物的安装与发现边界;Benchmark 工作流仍由普通发行物提供。
完整独立能力分包、Standard 安装和模型采用仍需独立验收。

改动思路 / Approach

在现有 Core 打包阶段收敛实际内容,并用原能力注册表投影安装状态,避免把可选运行时引进目录。
本次处理 standalone Core 的 Benchmark 缺席、读入口及原有普通发行物兼容。

Core 构建从清洁源码中选择实际可安装文件,继续带上目录引用的元数据。目录检查普通 CLI 是否可发现,通过已有 provider state 给出清楚的结果和下一步。评审从独立安装走到发现、拒绝、常规任务和恢复,也核对了普通轮包原有路径。

这个提交已有一份署名 Gemini 的独立评审。本次 GPT 重新构建发行物并检验实际安装,沿用同一个 GitHub 评审账号。已有 Gemini 评审

具体改动 / Changes

依据 docs/architecture/rfcs/monorepo-distribution-split-v0.md,基线 453d4e3。I4 的缺席行为、V1 的只读发现和 V3 的 CLI 兼容在已有装配内通过。完整 R1 及 M3 的组合资格继续验收。

关键代码讲解

  • 现有构建筛选保留目录、README 与四臂契约;研究 API 和 Benchmark 执行器留在普通包。独立 Core 轮包的运行时文件从 1907 减少到 1863,普通版仍有这 44 个文件且内容逐字一致。prepare_core_source
  • 注册表通过普通 CLI 的实际存在性沿用现有 provider 字段。Core 显示 Benchmark 未安装和普通发行版指引,原普通包的 Benchmark 仍显示可用。build_capability_registry
  • 干净安装用例经真实 CLI 读取列表和详情,用空 PATH 检查其余能力,并执行既有拒绝路径。安装后的能力状态测试

中英 RFC 和 Core README 说明同一个当前范围,无需另建状态或激活 owner。

对主干的风险 / Risks

最有影响的失败是删除执行文件后连帮助和正常 Core 工作一起失效,或者误删普通包消费者。重建了两版 Core 和普通 wheel,比较 25 项目录与详情:Core 的其他 24 项及普通包输出保持。本地只读审计没有启动新进程、访问网络或写状态。两版 Core 都以相同退出状态拒绝 Benchmark,普通已装包的 Benchmark help 和就绪状态相同。

49 项 Core 工作、恢复及 staging/上下文用例通过,另有 303 项普通源码 Benchmark、目录与研究 API 测试通过。同一已验证 Chat bundle 来自未变的普通包构建输入。

语义与 CI 对齐

继续使用原 provider 状态与已受治理结算。双语、编译、差异和 quick canary 六项直接检查通过。两个原维护性建议仍在,当前头的受管变更质量收执待核。GitHub CI 按配置未采集。

我的整体评价 / Verdict

没有阻塞性发现。只装 Core 的用户可提前知道 Benchmark 是否可用,原受治理工作及恢复在当前安装路径继续通过。额外代价集中于既有 package selector;补齐独立模块安装与 Standard 后仍需重新验证组合。
实测包内容、CLI 和合成任务恢复;实际高层模型成果、完整成本与发行采用仍待验证。

English verdict: APPROVE at 92e4815. The installed Core now reports the benchmark runtime as absent and preserves ordinary distribution behavior and governed recovery.

@cocolord cocolord changed the title fix(core): keep benchmark execution out of standalone Core Install Benchmark Toolkit alongside standalone Core Nov 18, 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 | Gemini | Google | self_reported
Target Exact Head: c8aa614

动机 / Motivation

  • 受影响调用方(Affected caller / operator):安装独立 loopx-core wheel 的运维人员与开发者、在核心任务后按需加装或卸载 loopx-capability-benchmark-toolkit 的评测分析者,以及调用能力目录与研究分析接口的客户端。
  • 变更前后场景(Before / after scenario):在基线 5cfd6ae7d5 上,独立 loopx-core 打包脚本把 benchmark 执行模块与 CLI 适配器全部编入核心 wheel,loopx capability show benchmark-toolkit 误报 provider_id=loopx-core 且 ready=True,但运行 loopx benchmark --help 却因缺少 loopx.cli 退出码 2 失败,用户也无法向独立 Core 加装或移除 Benchmark 工具包。在本 PR 提交 c8aa6147dd51c5013cd524fcb73d9dab4aadd0ce 之后,Core 仅保留目录与纯标准库四臂契约文件,未加装工具包时诚实报告 installed=False, ready=False 并拒绝 loopx benchmark 与研究分析接口;加装同版本 loopx-capability-benchmark-toolkit wheel 后即可在原 registry 与 runtime 上执行评测命令、注册并重读证据包,卸载后核心任务与原有记录完整保留。
  • 可观测结果改善(Observable outcome):实测构建产物显示 loopx_core-2.4.0(1,866 个 loopx/ 文件)与 loopx_capability_benchmark_toolkit-2.4.0(42 个 loopx/ 文件,176,334 字节)的 RECORD 与 zip 文件列表 100% 互不相交(交集为空)。仅装 Core 时能力发现仅加载 catalog_entry 与 four_arm_contract 且零执行模块进入 sys.modules;加装匹配版本工具包后 capability show 报告 provider_id=loopx-capability-benchmark-toolkit 与 ready=True,能力发现仍不提前加载执行模块,版本不匹配(0.0.0)被拒绝,注册证据包经卸载/Core 任务重放/重装后仍可原样读回;普通 monorepo 路径返回结果与基线逐字段一致。
  • 非目标边界(Non-goals):本 PR 不拆分子包为独立 Git 仓库,不构建或发布 loopx-workspace 及 Standard 三个 CLI wheel,不改变内核 Goal/Todo/Lease/Quota 权威写路径与默认值,也不认证具体 benchmark 家族任务跑分或模型端到端收益。
  • 当前增量后仍存在的缺口(Remaining gap):Workspace 独立分包(由并行 PR #9058 覆盖)、其余内置能力向 packages/ 迁移(RFC M4/D2)、跨平台 Linux/Windows wheel 矩阵构建以及真实长程模型开销与效果对比仍待后续里程碑验收。

若不交付该边界,独立 loopx-core 安装包既会继续对用户与长程 Agent 误报 benchmark-toolkit 就绪,又无法按需加装同版本 Benchmark 工具包以复用同一套 Goal registry 与历史分析记录。

改动思路 / Approach

注:先前针对旧提交 92e48150544d399ee24d30b0759c7dcbe7a7fd1c 的评审已随作者合并 main、合入 #9034 的惰性导入提交 6c481cfee7 并扩展为独立可加装工具包方案 c8aa6147dd51c5013cd524fcb73d9dab4aadd0ce 而自动失效(GitHub 状态 DISMISSED,packet 标为 review_not_bound_to_current_head)。本次在全新隔离 worktree 下针对最新 exact head 重新构建双 wheel 并完成全量本地验证。

各机制分别归位至既有唯一 owner:prepare.py(打包筛选)、python_install_owner.py(版本与 RECORD 归属核验)、catalog.py(能力目录投影)、cli_runtime.py(独立 Core 路由分发与未安装拒绝)、research_analysis_api.py(HTTP 503 保护边界)及 release_manifest.py(伴随 wheel 物理指纹组合),未新增并行注册表、独立状态库或新生命周期动词。以 loopx-core 与 loopx-capability-benchmark-toolkit 的严格互不相交打包、按需惰性导出与版本/RECORD 一致性校验为当前可逆边界;把 loopx-workspace 与其余 Standard 能力拆包、以及带真实浏览器的跨包联调留待对应 PR 与后续里程碑。

  1. 包边界与文件所有权隔离:packages/loopx-core/prepare.py 将 loopx/capabilities/benchmark_toolkit/ 除 README.md、catalog_entry.py、four_arm_contract.py 外的 33 个模块(含 __init__.py)以及 loopx/cli_commands/benchmark_*.py 9 个适配器移出 Core,改由 --distribution loopx-capability-benchmark-toolkit 打入独立 wheel,使 Core 中的 benchmark_toolkit 退化为 PEP 420 namespace package;同时将 research_analysis_api.py 与 runtime_workspace.py 从 Core 排除。
  2. 惰性包入口与零执行发现:合入自 #9034 的 loopx/capabilities/benchmark_toolkit/__init__.py 用 _EXPORTS + __getattr__ + __dir__ + TYPE_CHECKING 替代原本的 31 条顶层 eager import,保证仅访问目录元数据或单项符号时不会牵连其余 30 余个重型执行/实验模块。
  3. 版本与物理 RECORD 双重校验:loopx/python_install_owner.py 新增 builtin_capability_installed,在无 loopx.cli 的独立 Core 环境中核验 distribution(name).version == distribution("loopx-core").version 且目标模块真实 origin 落在分发包的 RECORD 清单内;目录、CLI、HTTP 接口和 release_manifest.py 指纹计算全部复用同一归属事实。

具体改动 / Changes

  • 规范基准与条款映射:依据预 PR 不可变规范基线 docs/architecture/rfcs/monorepo-distribution-split-v0.md(提交 5cfd6ae7d571f2f97da40982db23f76540723c89)逐条核对:
    • I1(单一 monorepo 同仓协作):implemented — 同一源树经 packages/loopx-core/prepare.py 产出双 wheel 并接入 .github/workflows/package-smoke.yml。
    • I2(内核真相唯一 owner 与零重复路径):implemented — 仅保留 Core 内核与单一 trajectory_assessment_store,双 wheel RECORD 零重叠,由 test_core_benchmark_distribution.py 与实测 zip 对比验证。
    • I3(既有公开 import 兼容):implemented — loopx/capabilities/benchmark_toolkit/__init__.py 保留全部 199 个 __all__ 符号及顺序,由 test_benchmark_toolkit_loading.py 与全量导出对象身份核对验证。
    • I4(缺失可选包等价扩展关闭态、禁止静默替代):implemented — 无工具包或版本不匹配时 catalog.py 报 installed=False, ready=False,cli_runtime.py 退出码 2 拒绝,research_analysis_api.py 返回 HTTP 503。
    • I6(公开/私有边界与许可证不变):implemented — packages/loopx-capability-benchmark-toolkit/pyproject.toml 保持 Apache-2.0,loopx check 扫描 19 个变更文件零违规。
    • I7(未选中可选组件零初始化且缺失依赖前置失败):implemented — sys.modules 实测发现阶段仅加载 catalog_entry 与 four_arm_contract,且 loopx benchmark 在解析分发前拦截。
    • V1(按需加载)与 V3(CLI 兼容):implemented — 覆盖 capability、commands、benchmark 路由及普通 monorepo 等价性。
    • M3、M4、D2(Workspace/Standard 全量分包、其余内置能力迁移与模型开销验收):deferred — 保留给后续独立 PR 与 RFC 里程碑,本 PR 仅交付 Benchmark Toolkit 边界。
  • RFC 双语更新审查:PR 同步更新 docs/architecture/rfcs/monorepo-distribution-split-v0.md 与 .zh-CN.md(已通过 check_rfc_bilingual.py),补充按依赖闭包打包、Yardstick 方法界定、Standard 候选集合、Benchmark Toolkit wheel 边界及来自 #9034 的发现入口检查点。其中来自 #9034 的“Core 发现入口检查点 — 2026-11-19”表仍写“未从 wheel 删除 benchmark 文件”,与本 PR 正文新增段落存在历史口径衔接差,但不影响核心不变量或机器验收门禁。

关键代码讲解

  1. packages/loopx-core/prepare.py — _benchmark_execution_source / prepare_core_source / prepare_benchmark_source
    • _benchmark_execution_source 精确匹配 BENCHMARK_EXECUTION_PREFIXES 中除 BENCHMARK_CATALOG_FILES(3 个目录/契约文件)以外的所有文件;prepare_core_source 排除这些文件及 research_analysis_api.py / runtime_workspace.py,而 prepare_benchmark_source 反向仅收集这 42 个文件并生成钉死 loopx-core==<version> 的 VERSION 与 requires-core.txt。
  2. loopx/python_install_owner.py — builtin_capability_installed(及 loopx/capabilities/benchmark_toolkit/catalog_entry.py — benchmark_toolkit_installed)
    • 先判断 loopx.cli 是否存在;在独立 Core 中先核对 loopx-capability-benchmark-toolkit 与 loopx-core 版本一致,再用 find_spec 检查 benchmark_dispatch 与 trajectory_assessment_store 存在且物理路径属于该包 RECORD,既防错配版本也不触发目标模块导入。
  3. loopx/cli_runtime.py — _run_command / _dispatch_selected / _dispatch_common_command
    • 当 _standalone_core() 为真且命令为 benchmark 时,若 benchmark_toolkit_installed(builtin_cli_present=False) 为假,直接经 parser.error 以退出码 2 返回安装指引;为真时仅注册 benchmark 子解析器并经 _dispatch_selected 转发至 handle_benchmark_command,同时 loopx commands 仅在已装匹配工具包时展示 loopx benchmark。
  4. loopx/presentation/research_analysis_api.py — ResearchAnalysisRequestMixin._research_analysis_store / _research_analysis_read / _research_analysis_write
    • 移除模块顶层对 trajectory_assessment_store 的硬导入,改为请求鉴权与源校验通过后再调用 benchmark_toolkit_installed(),未安装或版本不匹配时返回 HTTP 503 research_analysis_unavailable;并将 except 块中的 store.PackUnavailable 改为运行时判别以防 store is None 时抛出 AttributeError。
  5. loopx/release_manifest.py — _owned_runtime_files / _distribution_runtime_fingerprint
    • 当主发行物为 loopx-core 时,遍历已知伴随发行物(含 loopx-capability-benchmark-toolkit),跳过未安装项,对已安装项校验非 editable、同版本、非空且路径集合与 Core 零重叠后再共同计入 package_fingerprint;安装与卸载工具包会准确切换并还原精确指纹。

对主干的风险 / Risks

无阻断发现(No blocking finding)。 以下为需要记录的非阻断风险与跨 PR 协调事项:

  1. [P2 · 跨 PR 共享修改与集成协调风险]:本 PR 与开放中的兄弟 PR #9058("Install the local Workspace alongside standalone Core")存在 11 个共享修改文件:.github/workflows/package-smoke.yml、docs/architecture/rfcs/monorepo-distribution-split-v0.md、docs/architecture/rfcs/monorepo-distribution-split-v0.zh-CN.md、loopx/cli_runtime.py、loopx/presentation/research_analysis_api.py、loopx/python_install_owner.py、loopx/release_manifest.py、packages/README.md、packages/loopx-core/README.md、packages/loopx-core/prepare.py、tests/test_distribution_runtime_identity.py;此外本 PR 已直接合并开放 PR #9034 的提交 6c481cfee7。两者先后合入主干时需协调以下具体冲突面:prepare.py 中 --distribution 选项及 EXCLUDED_MODULES vs WORKSPACE_MODULES 过滤谓词、research_analysis_api.py 中版本/RECORD 守卫 vs import_module 方案、release_manifest.py 伴随发行物列表以及 cli_runtime.py 路由分支;另外本 PR 已在 release_manifest.py 预先列出尚未合入的 loopx-workspace 与三个 Standard CLI 包名(缺失时安全 PackageNotFoundError: continue,不影响当前运行),且测试文件 test_distribution_runtime_identity.py 测试函数名为 test_matching_workspace_owns_only_its_records。
  2. [P3 · 非阻断既有行为观察]:在存在双默认 runtime root 的宿主上执行 loopx capability show benchmark-toolkit 且未传 --runtime-root 时,capability.py 触发 args.capability_operation_parser.error(...) 转入 _SelectedParseRejected 并回退 _run_full_cli,在独立 Core 下显示通用的不可用提示而非多 root 提示(基线 5cfd6ae7d5 已如此,非本 PR 引入)。
  3. 验证与边界矩阵:
    • 双 wheel 物理打包与 RECORD 互不相交:PASS(loopx_core 1,874 条 vs loopx_capability_benchmark_toolkit 49 条,重叠 0)。
    • 隔离 venv 验证:仅 Core(capability show 报 installed=False、sys.modules 零执行模块、benchmark 退出码 2);Core+Toolkit(capability show 报 ready=True、doctor --deep 通过、199 个 __all__ 符号与 43 个模块可正常导入、four-arm-contract CLI 返回合格 4 臂契约、test_core_benchmark_distribution.py 验证版本篡改拒绝与卸载/Core 重放/重装数据保留);普通 monorepo(get_capability 与基线逐字节一致,ResearchAnalysisRequestMixin 不可用返回 503 / 可用返回 store)。
    • 自动化测试(全部无跳过通过):test_benchmark_toolkit_loading.py + test_core_benchmark_distribution.py + test_core_distribution.py + test_distribution_runtime_identity.py + test_installed_core_context.py 80 passed;test_research_analysis_api.py + test_capability_extension_registry.py + test_benchmark_toolkit.py 303 passed;test_control_plane_import_boundaries.py + test_top_level_module_budget.py + test_package_kernel_import_ratchet.py + test_cli_entrypoint.py 339 passed;其余 14 个 tests/capabilities/test_benchmark_*.py 测试集 257 passed;ruff check、mypy(17 个配置严格文件)、npm run typecheck:control-plane、check_rfc_bilingual.py、semantic-vocabulary-drift-smoke.py、3 项 benchmark boundary smoke、loopx check 与 canary premerge --tier quick(6 项直接检查 + 4 项精选检查)全部 PASS(canary 仅留 benchmark_sensitive 人工评审门禁)。
  4. 残余风险(Residual risk):(1) 本次本地仅在 macOS arm64 / Python 3.13 / Node 26 下验证,Linux/Windows 构建与结合未合入 loopx-workspace(#9058)的端到端浏览器界面未在本 PR 单独构造;(2) 双包安装假设 loopx-core 与 loopx-capability-benchmark-toolkit 落在同一 site-packages 目录,跨 sys.path 分目录安装会让包含 __init__.py 的目录遮蔽 Core 的 namespace 目录;(3) 远端 GitHub Actions CI 按策略未查询(wait_for_ci: false)。

语义与 CI 对齐

  • semantic_alignment 结论为 aligned(reuse_existing):全 PR 未新增控制面状态枚举、Todo/Lease 词汇或持久化 schema,复用既有 CapabilityRegistry provider 布尔状态、CLI 退出码 2 拒绝与 HTTP 503 错误码;semantic-vocabulary-drift-smoke.py、check_rfc_bilingual.py、npm run typecheck:control-plane 与 canary premerge 全部通过。远端 GitHub CI 按 Goal 配置(wait_for_ci: false)未等待,不构成审阅阻塞。

我的整体评价 / Verdict

  • 长程演进影响(long_horizon: preserved):独立 Core 下 capability list/show 不再虚报就绪,避免长程 Agent 在缺失能力上空转重试;加装/卸载 loopx-capability-benchmark-toolkit 不修改 registry、Turn journal、Lease 或 Quota 账本,卸载后原有受治理任务与重放保持零副作用通过。
  • 用户体验与可视化审计(user_experience: improved):缺省与版本失配均在命令/API 边界给出包含 loopx-capability-benchmark-toolkit 的可操作安装指引,loopx commands 动态反映已安装命令。visual_review:仅涉及打包、CLI 路由、目录元数据和 loopx/presentation/research_analysis_api.py 的 JSON 503 错误守卫,未改动任何 HTML/CSS/前端渲染视图或可视化页面。 未覆盖范围:None(本次变更无前端渲染界面;Workspace 浏览器视图由并行 PR #9058 单独验证)。
  • 可观测语义、代码体量与隔离:普通 monorepo 输出与基线完全等价,独立 Core 缺失拒绝与加装恢复均有真实 wheel 子进程测试与 I4/V1/V3 支撑(intentional_change_validated);全 PR 19 文件 +1,218/-505(净变化中 __init__.py 为就地惰性重构 +482/-453,实际新增实现与测试紧凑,无重复 owner,code_volume: necessary、change_proportionality: proportionate),不扩大 Actor 权限或生命周期(authority_semantics: not_applicable),默认路径完全隔离(default_off_isolation: isolated)。

English verdict: APPROVE at c8aa614. Verified 100% wheel RECORD disjointness, isolated Core and Core+Toolkit venv behavior, ordinary monorepo parity, and local validation suites (979 pytest cases across the touched surfaces, ruff, mypy, tsc, RFC bilingual check, and quick premerge canary).

@mergify

mergify Bot commented Nov 19, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @cocolord.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

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 HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 19, 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.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

独立 Core 用户应能按需安装 Benchmark Toolkit,并沿原 registry 和 runtime 注册、发现和重读分析结果。基线 5cfd6ae 中独立 Core 一并携带执行文件,但 benchmark 仍走普通 CLI fallback。把发现和执行分开可以让常用 Core 任务保持独立,也应让使用者在调用前看到可信的可用状态。

在 c8aa614 上,实际构建的双 wheel 完成了 CLI 发现、注册、卸载、Core 回读及重装读回的链路。当前缺口出现在匹配版本的工具包安装不完整时。能力目录仍报告就绪,用户沿这个信号调用时却遇到 Python traceback。这个状态需要有清楚的安装恢复路径。

实际 benchmark 执行、发布资格与 #9058 的 Workspace 组合分别验收。

改动思路 / Approach

包构建、物理归属检查和 CLI/HTTP 入口的分工适合保留。当前 PR 的边界是独立 Core 中 Toolkit 的可选安装、真实就绪和失败恢复,沿用原有分析证据存储。

把执行文件继续留在 Core 会维持已安装与能执行之间的差距。只补 CLI 路由则无法提供可拆卸的可选执行包。当前以源码分流构成两个 wheel、用 existing store 和 capability catalog 作为拥有者,能实现低成本边界。建议继续用同一个 readiness owner,让其判定覆盖 CLI 实际必需的装配,并保留普通 Core 路径。独立 Workspace 包仍由 #9058 交付。

具体改动 / Changes

完整净改动为 19 个文件,+1218/-505。包准备器从同一源树分配目录契约与执行代码,专属 pyproject 绑定同版本 Core,包说明与 CI 路径同步。惰性 facade 保留原符号索引并延后导入实际实现。现有目录注册器投影 companion provider,现有 CLI 分发将显式 Benchmark 调用送到原 benchmark_dispatch,研究 HTTP 路由在 Goal/source scope 判断后选择同一 store。安装身份复用分发归属与组合指纹,测试覆盖文件不重叠、未安装、版本不匹配、持久记录复用和所有权冲突。两份 RFC 交代了装配边界与后续 Workspace 组合。

规范基线见 monorepo-distribution-split-v0.md。I2 的唯一存储和内核拥有者由双轮的 File/SQLite 注册及同一 pack 重读验证。I3 的已有导出与命令通过惰性加载和兼容路径抽查。I4 和 I7 的未安装、版本不匹配拒绝通过,安装不完整时的可用状态与执行还不一致。

对主干的风险 / Risks

[P2] Toolkit 缺少启动必需模块时仍报告就绪。 benchmark_toolkit_installed 只核对 dispatch 和 store 两个入口的存在及 RECORD 归属。benchmark_dispatch 在登记子命令前就加载各命令实现。实际安装两个 wheel 后,我在独立测试环境中临时移走其中一个由 Toolkit RECORD 声明的 CLI 模块。两个入口与版本元数据仍存在。capability show benchmark-toolkit 继续返回 ready=true,loopx benchmark --help 却退出 1 并给出 ModuleNotFoundError。普通 Core 版本命令保持可用。恢复该模块后,目录和命令一起恢复。这意味着一个部分安装的组件可被发现为就绪,但目录给出的下一步会立即失败。建议在轻量装配检查中验证活跃入口所需的文件组,并在入口导入失败时返回可恢复的不可用诊断。新增回归同时验证完整 wheel、缺必需模块、修复安装与 Core 命令可用。定位在 安装所有权检查。

双 wheel 定向、懒加载与物理身份共 27 项通过。源码 Research/linked-source HTTP 验证 54 项通过、1 项失败。单项用准确基线与 head 对照都返回 404 而测试预期 409,归为既有 linked history 错误码差异。快速 premerge 的 6 项直接和 4 项所选检查通过,保留 benchmark-sensitive 人工门禁。以当前主干执行只读合并预演时,loopx/python_install_owner.py 与 packages/loopx-core/prepare.py 存在冲突。它们需要独立解决,和以上就绪误报是两项不同的实际条件。

我的整体评价 / Verdict

请求修复部分安装误报就绪的问题。原有的可选装配设计已证明正常安装、卸载及重装能够保留使用成果。把版本和文件归属判断接到可执行装配,并在入口提供重新安装提示,能让使用者按目录走通失败恢复。修复后应在整合主干的新准确 head 上重做完整/损坏安装对照。

适用范围为包、CLI 与现有 Research JSON 路由,未修改渲染界面。未验证范围包括 #9058 独立 Workspace 正式打包后的浏览器发布态、Linux 与 Windows 安装,以及具体 benchmark 家族运行。按原 RFC 逐步推进,其余发布和组合验收有独立边界。

English verdict: REQUEST_CHANGES at c8aa614. A partial Toolkit install advertises ready while its real CLI fails before command registration. Report unavailable and preserve a clear repair path, then verify it on the rebased head.

Comment thread loopx/python_install_owner.py Resolved
@loopx-agent
loopx-agent force-pushed the codex/core-benchmark-package-boundary-20261119 branch from c8aa614 to 9a5aa5e Compare November 26, 2026 15:10
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 26, 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 · Gemini · Google · self_reported

动机 / Motivation

在独立 Core 环境中部署或按需加装 Benchmark 工具包的运维人员、评测分析师与能力目录调用方。需要一种既保持 loopx-core 轻量内核纯洁性、又能按需加装或卸载 loopx-capability-benchmark-toolkit 的分包方式,并保证目录发现不虚报就绪且既有任务与分析记录完整保留。

改动前,独立 Core 无法在不破坏目录发现的前提下卸载/重装 Benchmark 执行包,且部分安装缺失子模块(如 benchmark_study.py)时目录仍误报 ready=true 并触发未捕获 traceback;改动后,Core 仅保留纯标准库目录与四臂契约,未装或版本不匹配或文件残缺时统一报告不可用并退出码 2 引导重装,完整加装同版本工具包后恢复能力并可跨卸载/Core 任务重放/重装无损读回既有分析包。

真实构建的 2.4.1 双 wheel 文件清单 100% 互斥(Core 1,982 项 vs Toolkit 43 项,交集为空);独立 Core 与 Core+Toolkit 82 项实装 wheel 用例全部无跳过通过;缺失 benchmark_study.py 时 capability show 准确切换为 installed=false/ready=false、commands 隐藏 benchmark、loopx benchmark --help 退出码 2,恢复文件后全链路恢复。本 PR 不将工具包拆入独立 Git 仓库、不发布 PyPI、不改动内核 Goal/Todo/Lease/Quota 写入语义,也不在本切片内打包 Workspace 或 Standard CLI 发行物。

当前增量后仍存在的缺口(Remaining gap):独立 Workspace 分包(#9058)、其余内置能力向 packages/ 迁移(M4/D2)、跨平台 Linux/Windows wheel 矩阵以及完整模型成本/效果对比仍留待后续切片验收。

改动思路 / Approach

作者未引入新的能力清单格式、配置文件或第二套评测存储,而是沿用仓库既有的分包与所有权模型:

将分包过滤收口在 prepare.py,将无导入副作用的同版本与完整 RECORD 归属核验统一交由 builtin_capability_installed,并由 catalog、cli_runtime 与 research_analysis_api 共同消费同一就绪真值,同时将包指纹聚合保留在 release_manifest.py,未新增第二套状态或配置。

交付 standalone Core 与 loopx-capability-benchmark-toolkit 的互不相交双 wheel 打包、完整安装校验、故障恢复与既有评估包留存;Workspace/Standard 分包与跨平台构建留待后续切片。

相比此前在 c8aa6147dd 上仅校验 benchmark_dispatch 与 trajectory_assessment_store 两个文件而留下部分安装误报 [P2] 缺口(PRRT_kwDOStEbEs66UGP6),最新提交 9a5aa5ec65874681d88b8a6e0c533fc2a79927db 已完整关闭该问题:不仅列出全部 10 个启动必选模块,还在 builtin_capability_installed 中核验发行包 RECORD 内每一项 loopx/*.py 文件在磁盘存在,并在 _run_command 捕获工具包自身缺失引发的 ModuleNotFoundError 转为可恢复的退出码 2 提示(同时继续向上抛出无关模块缺失异常)。普通全量安装(存在 loopx.cli)路径保持零改动。

具体改动 / Changes

本次共修改 17 个文件(+633 / -49):运行期与打包代码 8 个文件(+288 / -47)、CI 工作流 1 个(+14)、RFC 与包文档 4 个(+57 / -1)以及测试 3 个(+264 / -1),目标精准提交为 9a5aa5ec65874681d88b8a6e0c533fc2a79927db。

  • 规范基线映射:对照 PR 前不可变规范基线 docs/architecture/rfcs/monorepo-distribution-split-v0.md(提交 406f1cd76acb88c1f91fe43fe35b74df583b6eaa)逐条核对:
    • I2(内核真相唯一 owner 与零重复打包):implemented — packages/loopx-core/prepare.py 与 loopx/python_install_owner.py 确保双 wheel RECORD 零重叠且共用同一 trajectory_assessment_store,由 2.4.1 双 wheel 82 项无跳过测试验证。
    • I4(缺失可选包等价关闭态与可信不可用提示):implemented — catalog.py、cli_runtime.py 与 research_analysis_api.py 在缺失、版本不匹配或部分损坏时分别返回 ready=false、退出码 2 与 HTTP 503。
    • I6(公开/私有边界与许可证不变):implemented — packages/loopx-capability-benchmark-toolkit/pyproject.toml 保持 Apache-2.0,loopx check 扫描全部 18 个关联路径 0 错误。
    • I7 与 V1(未启用组件零初始化且按需加载):implemented — 目录发现阶段经 sys.modules 实测零加载执行期或存储模块,执行前拦截缺失前提。
    • V3(CLI 兼容与退出码契约):implemented — 普通 monorepo 基线与 HEAD 在 capability show benchmark-toolkit 和 benchmark --help 上输出完全一致,独立 Core 缺失时固定退出码 2。
    • M3 与 D2(Workspace/Standard 全套组合分包与全量能力迁移):deferred — 留待兄弟 PR #9058 / #9049 / #9061 与后续 RFC 切片。
  • RFC 双语更新:docs/architecture/rfcs/monorepo-distribution-split-v0.md 与 .zh-CN.md 同步补充 Benchmark Toolkit 分包与四臂契约保留说明,未放宽既有基线不变量,并通过 check_rfc_bilingual.py。

关键代码讲解

  1. builtin_capability_installed(loopx/python_install_owner.py#L52-L87):以零导入方式校验 loopx-core 与目标伴随包同版本、所有核心启动模块 origin 均归属于该包 RECORD,并逐一核验 RECORD 中每个 loopx/*.py 文件真实存在(解决部分安装遗漏问题)。
  2. BENCHMARK_TOOLKIT_STARTUP_MODULES(loopx/capabilities/benchmark_toolkit/catalog_entry.py#L17-L36):显式列出 benchmark_dispatch、全部 8 个 cli_commands.benchmark_* 子模块及 trajectory_assessment_store,使就绪判定与 CLI 实际 eager import 集合完全对齐。
  3. _run_command(loopx/cli_runtime.py#L1087-L1106):在独立 Core 下前置检查 benchmark_toolkit_installed(builtin_cli_present=False),并在 register_benchmark_command_group 阶段捕获 toolkit 自身 ModuleNotFoundError 转为退出码 2 提示,同时继续放行无关模块缺失错误。
  4. prepare_benchmark_source(packages/loopx-core/prepare.py#L91-L100):通过 _benchmark_execution_source 将 43 个执行/CLI/研究模块精准切分至工具包 wheel 并钉死 loopx-core==<version>,与 Core 中的 README.md、catalog_entry.py 和 four_arm_contract.py 完全互斥。
  5. ResearchAnalysisRequestMixin._research_analysis_store(loopx/presentation/research_analysis_api.py#L21-L32):将原先顶层硬导入改为按请求延迟校验 benchmark_toolkit_installed(),未安装或受损时安全返回 HTTP 503 research_analysis_unavailable。

对主干的风险 / Risks

无阻塞发现(No blocking finding)。 此前在 c8aa6147dd 上的 [P2] 线程 PRRT_kwDOStEbEs66UGP6 已在 9a5aa5ec65 验证彻底关闭并标记解决。以下是非阻塞集成风险与实测汇总:

  1. 跨 PR 合入协调(非阻塞):本 PR 与开放中的 #9049 及 #9058 共享 prepare.py、release_manifest.py、python_install_owner.py、cli_runtime.py、research_analysis_api.py 等文件,但针对当前主干 git merge-tree 干净无冲突;按合入顺序整合解决文本差异即可。
  2. 类型检查基线说明:ruff 10/10 通过;[tool.mypy] 17/17 与严格检查子集 4/4 零错误;cli_runtime.py 与 research_analysis_api.py 原文件未纳入 [tool.mypy] 且为非注解旧函数风格(cli_runtime.py 沿用已有模式多 1 处 int | None 赋值提示,research_analysis_api.py 沿用 mixin attr-defined 提示 61 -> 65,均非运行期回归)。
  3. 实测汇总:
    • 真实 2.4.1 构建双 wheel(loopx-core + loopx-capability-benchmark-toolkit)全套矩阵(含 File/SQLite 注册、卸载/Core 重放/重装、部分损坏/恢复):PASS(82 passed, 0 skipped in 478.34s;ZIP loopx/ 交集为空;独立 Core 缺失时 commands 不含 benchmark 且 benchmark --help 退出码 2)。
    • 广谱源码 pytest -n 6(benchmark、research API、capability registry、CLI entrypoint、architecture/、canary/):PASS(2,931 passed, 6 skipped in 294.19s,跳过均为 macOS APFS 非 UTF-8 文件名用例,无失败)。
    • ResearchAnalysisRequestMixin 不可用 HTTP 503 守卫、_run_command 仅吞 toolkit ModuleNotFoundError 而重抛无关异常、以及 python_install_owner.py 注入缺失 RECORD 条目变异测试:PASS。
    • 静态、治理与门禁:ruff PASS、npm run typecheck:control-plane PASS、check_rfc_bilingual.py PASS、clean-HOME docs-governance/semantic-vocabulary-drift/maintainability-ratchet smokes 3/3 PASS、loopx check(18 路径 0 错误)PASS;无 CPU 竞争下重跑 canary premerge --tier standard --timeout-seconds 300 19/19 全部通过(failures=0)(含 install-local-smoke.py 69.194s;先前提速前在并行 6 核测试竞争 CPU 时曾发生 1 次超 120s 超时,无竞争复跑已通过),gate.status 为 manual_review_required(仅因 benchmark_sensitive 表面需人工评审把关)。
    • 残余风险:macOS arm64 / Python 3.12 本地环境已完备实测,Linux/Windows 构建与远端 CI 未在本机运行(wait_for_ci: false)。

语义与 CI 对齐

  • semantic_alignment 为 aligned(reuse_existing):沿用既有 CapabilityRegistry 布尔状态、CLI 退出码 2、HTTP 503 与组合指纹计算,未新增任何共享控制面枚举或持久化状态;semantic-vocabulary-drift-smoke.py、control-plane-maintainability-ratchet-smoke.py、check_rfc_bilingual.py 与无竞争 canary premerge(19/19 failures=0)全部通过,远端 CI 按策略 wait_for_ci: false 未等待。

我的整体评价 / Verdict

  • Outcome Impact:long_horizon 判定为 preserved(Core 目标/任务/租约/配额执行与卸载重放全程零副作用通过,目录不再误报就绪);user_experience 判定为 improved(visual_review 为 not_applicable:CLI, capability catalog, Python wheel packaging, and Research Analysis 503 JSON guard only; no web UI or desktop visual surfaces changed)。
  • Observable Semantics & Code Volume:普通 monorepo 在基线 406f1cd76a 与 9a5aa5ec65 下返回一致;独立 Core 的安装/破损/卸载/恢复语义清晰可控(intentional_change_validated),改动体量(17 文件 +633/-49)与机制成本相称(code_volume: necessary、change_proportionality: proportionate),不扩大任何执行权限(authority_semantics: aligned),default_off_isolation: isolated。
  • 收尾提醒:上一轮旧提交 c8aa6147dd 上的 CHANGES_REQUESTED 评审(6004109129)仍处于待维护者按权限处置状态,本轮针对精确头 9a5aa5ec65874681d88b8a6e0c533fc2a79927db 已完整验证并给出正式赞成结论。

English Verdict: APPROVE

@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

[P2] 缺少 Toolkit 间接依赖时仍报告就绪。 从精确提交构建并安装 Core 与同版本 Benchmark Toolkit。用普通部分安装模拟缺少 trajectory_assessment.py,且原始 RECORD 保持完整。 原始 RECORD 仍有缺件,CPython 的 files 视图已省略它。目录保持 ready=true 与 benchmark 可见,实际 trajectory-packs 退出 2,同时产生新的非空 runtime fingerprint。 让既有安装归属 owner 从原始 wheel RECORD 取完整声明,再解析和核验关联的实际文件。目录、命令和运行时身份消费同一个完整性结果。 在两个解释器的真实 Core 加 Toolkit 安装中,把 store 的间接依赖移到安装树外,核对目录撤下、现有修复提示、缺件时无指纹以及恢复后原指纹和读取都恢复。保留 File/SQLite 的已有启动模块反例。 代码

动机 / Motivation

独立 Core 用户安装 Benchmark Toolkit 后,需要用命令目录确认能否继续读原来的分析资料,也需要正确辨别安装损坏。

完整安装时任务与分析记录能够读回。一个由 wheel 记录的间接依赖缺失后,命令目录仍宣称 Toolkit 可用,而用户沿该条目执行普通读取时收到重新安装提示。

本轮确认为 2.4.1 的实际两轮包。Python 3.12.15 与 3.14.8 均观察到目录仍为 ready、命令仍列出、实际读取退出 2、指纹仍存在。恢复原文件后目录、读取和原指纹恢复一致。

验证范围是已安装 wheel、既有 CLI 和本地合成 Goal 的只读分析。实际模型、具体 benchmark 家族、独立 Workspace 发布和性能收益分开验收。

改动思路 / Approach

让独立 Core 继续持有原有目录和状态,交由同版本 companion 提供可选实现是合适的。包准备、元数据读取和结果呈现在现有调用链上有清楚的分工。让既有安装归属 owner 从原始 wheel RECORD 取完整声明,再解析和核验关联的实际文件。目录、命令和运行时身份消费同一个完整性结果。 本次只需要修正元数据与实际文件的核对边界,避免增加一套指纹或额外人工确认。

具体改动 / Changes

核对精确提交 9a5aa5e 与变更基线 406f1cd 的 17 个文件。上一轮指出直接启动模块缺失。直接启动模块回归已通过,但本次间接依赖仍漏检。 四组 File/SQLite 安装、缺少启动模块、重装及原任务重放与其他定向检查合计 29 项通过;源检出上现有 HTTP 选定场景另有 7 项通过。 基线分发规范

  • C1。当前配置由现有包准备器提供两份同版本、独立归属的 wheel。真实安装与原状态读回通过。
  • C2。读取的是同一个已安装 wheel。builtin_capability_installed 使用的 files 视图会先丢掉缺失条目,随后验证只看到剩余成员。两种 Python 的原始 RECORD 对照均确认这个差异。CPython 读取实现

对主干的风险 / Risks

完整实装 CLI 可以读回本地分析目录;缺件时告警由执行入口发出,发现与身份依然错误。 修复后重做健康安装、单纯缺件和原文件恢复的三态对照。缺失文件移出安装树,避免另一个未归属文件意外触发检测。两处 PR 单独对当前主干的合并预览通过,彼此预览在七个共享位置冲突,包括 Core 打包器、安装归属与运行时指纹的所有者。标准预检中的本地安装烟测超时。

我的整体评价 / Verdict

REQUEST_CHANGES。 保留独立 wheel 与原来的工作账本,先让缺件后的命令、诊断和运行时指纹一致。验证使用实际 wheel 与隔离本地输入,范围覆盖当前 CLI 和安装边界。独立 Workspace 发布、原生跨平台安装和实时模型或提供方仍待各自验收。

English verdict: REQUEST_CHANGES at 9a5aa5e. A missing RECORD-declared file still produces a plausible runtime fingerprint. Resolve the shared declared-file check and verify healthy, missing and restored installs.

Comment thread loopx/python_install_owner.py Resolved
@mergify

mergify Bot commented Nov 26, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @cocolord.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

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 HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added needs-rebase Mergify: the pull request has merge conflicts with its base branch and removed needs-rebase Mergify: the pull request has merge conflicts with its base branch labels Nov 26, 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 · gemini-3.1-pro · Google · self_reported · effort_unavailable

动机 / Motivation

在独立 Core(loopx-core)环境中按需加装、升级或卸载 Benchmark Toolkit 可选包,以及依赖目录与运行时指纹识别安装完整性的运维人员与测试分析调用方。 改动前,独立 Core 无法单独安装或卸载 Benchmark Toolkit 执行实现,且当已安装 wheel 的 RECORD 中某个间接依赖文件(如 trajectory_assessment.py)缺失时,CPython Distribution.files 会将其静默跳过,导致目录仍误报 ready=true、loopx benchmark 命令行入口保留、实际执行退出 2 且仍产生非空运行时指纹。改动后,Core 仅保留纯标准库目录与四臂契约,目录与运行时身份统一通过 distribution_recorded_files 解析原始 RECORD:未装、版本不匹配或任一 loopx/ 工件缺失时均撤销 ready、隐藏并拒绝 benchmark 命令(退出码 2 引导安装)、不发射 package_fingerprint,而补齐重装后无损恢复既有的任务与分析包读回。 在 Python 3.14.8(5 个真实 2.4.1 wheel 共 96 项)和 Python 3.12.15(Core + Toolkit 共 27 项)实包测试中,完整安装、版本失配拒绝、启动模块及间接依赖缺失/恢复、双端 File/SQLite 任务重放、卸载保留记录与 5 包共存指纹均无跳过通过;缺失或损坏 toolkit 时 loopx capabilities、loopx commands 与 loopx benchmark 表现一致且无副作用,HTTP 研究分析端在工具包缺失时返回 503 research_analysis_unavailable。 本 PR 不将 Benchmark Toolkit 拆出独立 Git 仓库,不发布 PyPI,不改变 Core 内核 Goal/Todo/Lease/Quota 写入语义,也不在本切片中打包 Workspace(loopx-workspace 由独立切片推进)或执行完整 benchmark 家族评测与模型对比。 loopx-workspace 独立分包及 Workspace 启动后 HTTP 503 端到端实包回归、PyPI 公开发布与具体 benchmark 家族运行仍留待后续切片验收;旧 PR #9038 在先前提交上遗留的 REQUEST_CHANGES 审阅记录(6077546357)待维护者在认可本轮证据后按关闭流程处置。

改动思路 / Approach

边界层次 负责模块 关键不变量 / 失败语义
打包与目录裁剪 packages/loopx-core/prepare.py, packages/loopx-capability-benchmark-toolkit/ loopx-core 保留命名空间包下的 catalog_entry.py 与 four_arm_contract.py;可选 wheel 承载 __init__.py 与全部执行/CLI 模块,文件集合严格互斥
原始 RECORD 完整性真源 loopx/python_install_owner.py (distribution_recorded_files, builtin_capability_installed) 直接用 csv.reader 解析 dist.read_text("RECORD"),先校验版本再调用 find_spec,任何声明 loopx/ 非字节码工件不在磁盘即返回 False
运行时指纹与多包隔离 loopx/release_manifest.py (_owned_runtime_files, _distribution_runtime_fingerprint) 将 BENCHMARK_TOOLKIT_DISTRIBUTION 纳入伴随发行物校验,复用同一 distribution_recorded_files 解析结果,缺件或字节变化时拒绝输出 package_fingerprint
消费入口(发现/CLI/HTTP) loopx/capabilities/catalog.py, loopx/cli_runtime.py, loopx/presentation/research_analysis_api.py 发现零执行导入;独立 Core 缺件隐藏 benchmark 并在显式执行时退出 2 提示安装;分析 API 延迟加载并在未就绪时返回 HTTP 503 research_analysis_unavailable

将可执行包归属判定集中到 loopx/python_install_owner.py(distribution_recorded_files / is_distribution_artifact / builtin_capability_installed),让目录(loopx/capabilities/catalog.py)、CLI 路由(loopx/cli_runtime.py)、Workspace 延迟读入口(loopx/presentation/research_analysis_api.py)与运行时指纹(loopx/release_manifest.py)消费同一份基于原始 RECORD 的完整性事实,避免 CPython Distribution.files 静默忽略缺件引起的分歧。 保持 loopx/capabilities/benchmark_toolkit/ 为无 __init__.py 的命名空间包以隔离 catalog_entry.py 与 four_arm_contract.py 零副作用发现;loopx-capability-benchmark-toolkit 仅承载 benchmark_* CLI/能力模块,packages/loopx-core/prepare.py 保持与 #9049 Standard trio 的职责隔离。

具体改动 / Changes

  • 依据基准规范 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(固定修订 0e8c2b2b25de168422248db5f960fed8bcf1bcba)逐条核对当前精确提交 f54dd039ede751b44ed099a1d023e53a3c2b7bab(relative to origin/main @ 0e8c2b2b25de168422248db5f960fed8bcf1bcba 合并树 fa020602b0 无冲突,17 个文件 +665/−51,5 个提交均有 DCO):
    • S2 -> implemented:维持内核状态持久化、File/SQLite 任务恢复与 D2 分包隔离基础,经 5 个真实 2.4.1 wheel 双端重放及 release_runtime_identity 验证。
    • S8 -> implemented:能力目录报告就绪/版本/缺失回退提示并在独立 Core 中实现无副作用发现与安全退回;CLI 与 HTTP 研究分析入口均按完整安装与残缺失败关闭。
    • S12 -> implemented:新增 packages/loopx-capability-benchmark-toolkit/{pyproject.toml,README.md}、更新 .github/workflows/package-smoke.yml 与中英文 monorepo-distribution-split-v0.{md,zh-CN.md},通过双语校验与边界扫描。
    • S11 -> out_of_scope:按 #5072 与 S11 分工,具体 benchmark 家族执行与模型对比不在本次可选包拆分切片范围内。

关键代码讲解

  1. distribution_recorded_files:当已安装发行版提供原始 RECORD 文本时,以 csv.reader 逐行构造 PackagePath 并通过 distribution_record_path 解析绝对磁盘路径,避免 CPython Distribution.files 因内置 skip_missing_files 跳过磁盘缺失项而漏报缺件;仅当无 RECORD(如测试桩)时才回退到 installed.files。
  2. builtin_capability_installed:在无 loopx.cli 的独立 Core 模式下,先于 find_spec 核对 distribution(distribution_name).version == distribution("loopx-core").version,使未装 Core 环境的目录遍历保持零模块探测;接着校验全部启动模块 origin 落入 RECORD,并对所有 loopx/ 非字节码工件校验 path.is_file(),确保类似 trajectory_assessment.py 的间接依赖被删时立即判定未就绪。
  3. _owned_runtime_files:将 BENCHMARK_TOOLKIT_DISTRIBUTION 加入 _CORE_COMPANION_DISTRIBUTIONS 并改用共享 distribution_recorded_files + is_distribution_artifact,消除原先依赖 installed.files 时缺失声明文件后仍生成误导性非空 package_fingerprint 的漏洞。
  4. _record_for_installed_capability:当 builtin_cli_present 为假时,将 benchmark-toolkit 绑定到 loopx-capability-benchmark-toolkit provider 并在未安装或残缺时写入安装提示 BENCHMARK_TOOLKIT_INSTALL_HINT,不引入执行模块。
  5. _run_command:独立 Core 接收 benchmark 子命令时,先经 benchmark_toolkit_installed(builtin_cli_present=False) 门禁(失败则 parser.error 退出码 2),仅通过后才延迟挂载 register_benchmark_command_group,并在异常时只捕获工具包命名空间 ModuleNotFoundError。

对主干的风险 / Risks

  • 静态检查与兼容性说明: ruff check 对改动/新增的 10 个 .py 文件全过;mypy 默认 17 项核心契约(0 错)及新增/改造的 3 个严格模块(python_install_owner.py, release_manifest.py, catalog_entry.py)mypy --strict 0 错;loopx/presentation/research_analysis_api.py 沿用既有非类型化 HTTP Mixin 风格未进仓库 [tool.mypy] 严格清单(单独对其跑 mypy --strict 报既有 63 处 mixin 属性提示,属基线特性非本 PR 回归)。check_rfc_bilingual.py、typecheck:control-plane(0 错)及 loopx check(0 错、17 扫描文件)全通过。
  • 双解释器真实 Wheel 与反例验证:
    • Python 3.14.8 五包 2.4.1 真实 wheel 顺序矩阵(test_core_benchmark_distribution.py, test_distribution_runtime_identity.py, test_core_standard_distribution.py, test_core_distribution.py, test_installed_core_context.py):96 passed, 0 failed, 0 skipped(初次带 -n 4 并发跑时,因 test_installed_core_deep_doctor_rejects_missing_runtime_file 与并行测试共享同一可变 core-env 临时重命名 history.py 导致 1 例竞态;按 CI 的顺序执行无共享修改竞态 96/96 稳定通过,单测也单独复核 2/2 通过)。五包(loopx-core + standard trio + benchmark-toolkit)同装 k=installed 6/6 通过,干净 HOME 探针确认全部能力 ready=True、合法 package_fingerprint 且未加载 benchmark_dispatch/trajectory_assessment_store。
    • Python 3.12.15 真实 Core + Benchmark Toolkit wheel(test_core_benchmark_distribution.py + test_distribution_runtime_identity.py):27 passed, 0 failed, 0 skipped,覆盖 benchmark_study.py(启动模块)与 trajectory_assessment.py(间接依赖)两类文件移除→降级拒止/无指纹→恢复修复闭环。
    • 源码回归与标准门禁:pytest -n 4 覆盖架构/金丝雀/benchmark 能力/cli_entrypoint 共 2,885 passed, 6 skipped, 0 failed(6 项跳过为 macOS APFS 非 UTF-8 字节文件名测试),tests/presentation/test_research_analysis_api.py 52 passed, 70 skipped(70 项为 Windows 长路径跳项);独立回环 stub 探针验证 benchmark_toolkit_installed()=False 时 GET/POST /api/chat/research-analysis 均返回 503 research_analysis_unavailable;Goal canary premerge --tier standard 全部执行项 6/6 direct + 10/10 catalog + 8/8 risk_profile + 1/1 boundary 通过(0 失败,仅缺 author-side quality_receipt),未等待远端 GitHub CI(wait_for_ci: false)。
  • 非阻塞观察(P3): tests/presentation/test_research_analysis_api.py 尚无专门覆写 benchmark_toolkit_installed() -> False 的 503 单测断言,可在后续 Workspace 分包 PR 补齐;_record_for_installed_capability 在独立 Core 下为 benchmark-toolkit 统一设置 provider_id="loopx-capability-benchmark-toolkit",而旧三包在未安装时退回 "loopx",当前行为已由单测锁定且安全。

我的整体评价 / Verdict

APPROVE。 在不引入新持久态与默认语义漂移的前提下,本 PR 干净完成了 Benchmark Toolkit 的可选 wheel 拆分,并通过共享 RECORD 原文解析彻底修复了先前的间接依赖漏检与伪指纹问题。problem_context.outcome_impact:long_horizon 为 preserved(安装、降级修复或卸载 Benchmark Toolkit 不会修改既有 Goal 注册表与任务/分析记录;经实包 File/SQLite 隔离安装验证,卸载后原 Core 任务经 --resume-turn-key 无副作用重放且不重跑 host,重新安装 Toolkit 后原有 trajectory-packs 与 package_fingerprint 原样恢复。),user_experience 为 improved(未装、版本失配或部分损坏安装下,loopx capability show benchmark-toolkit 统一报告 installed=false/ready=false 并给出可执行安装提示,loopx commands 隐藏 benchmark,显式调用 loopx benchmark 退出码 2 提示重装而非抛出 ModuleNotFoundError;5 个真实 wheel 安装并存时目录全部就绪且无意外导入执行模块。),visual_review 为 not_applicable(未修改前端打包页面、样式或交互布局(仅 loopx/presentation/research_analysis_api.py 增加 toolkit 缺失时的 503 JSON 保护),无渲染视图变化,因此视觉评审为 not_applicable。)。未引入新共享词表(沿用现有能力与分布词表),保留兼容与双包协作边界无需进一步强制精简。审阅批准结论覆盖至当前精确头 f54dd039ede751b44ed099a1d023e53a3c2b7bab,待既有遗留审查(6077546357)按维护者权限关闭后即可推进合并,PR 保持 OPEN。

English verdict: APPROVE at f54dd03. Standalone Core cleanly isolates benchmark discovery and refuses missing/partial/mismatched Toolkit installations via raw wheel RECORD checks across Python 3.14.8 and Python 3.12.15 without regressing existing task replay or runtime identity.

loopx-agent
loopx-agent previously approved these changes Nov 26, 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.2-sol · OpenAI · runtime_reported · xhigh

没有发现阻塞项。未查询托管 CI,未跑真实 Benchmark 作业或发布 wheel。

动机 / Motivation

只装 Core、按需增加 Benchmark Toolkit 并在移除或修复后恢复既有分析的操作者。 构建当前 Core 与 Toolkit 的真实 wheel,在两个本地后端分别对照只装 Core、完整安装、缺件、修复和移除。 两个后端缺件后都从目录撤下 Benchmark,CLI 给出匹配 wheel 安装指引,身份不再生成。补齐后恢复原指纹及已有分析,Core 始终可用。 实际 Benchmark 作业、完整模型成本与公开发布在本次包边界之外。 旧有 Core 装机无法独立选择 Toolkit,间接文件缺失也可能让目录、CLI 与运行时身份对同一装机得出不同结论。 交付可单独启用、撤下和恢复的 Toolkit wheel,并保持 Core 原有入口及权威状态。 对照契约 对照修订 0e8c2b2b25de168422248db5f960fed8bcf1bcba。

  • I2 Core 的 Goal、工作和结算继续使用单一既有 owner,打包没有第二份执行代码。 通过。
  • I4 可选包缺失或不完整时 Core 保持可用且相关能力明确不可用。 通过。
  • I7 未选择时不初始化可选包,启动条件不满足时阻止分派并提示修复。 通过。

改动思路 / Approach

Python 负责打包、安装归属和需求加载。既有 Benchmark 数据和 Core 领取、结算逻辑继续由原 owner 持有。 让目录、CLI 和运行时身份共享原始 RECORD 观测,避免重复判断或先导入后检查的副作用。 只装 Core 时没有可选执行模块。旧候选会漏掉 metadata.files 已过滤的间接依赖。 上一轮暴露 CPython files 忽略缺件,新提交对同一实装反例与恢复身份完成验证。 对仓库经验采用其中的最小真实路径方法,分别核对正常操作、失败和恢复后的结果。

具体改动 / Changes

精确提交 f54dd039ede751b44ed099a1d023e53a3c2b7bab,17 个文件 +665/−51。17 个文件包含 R2 交付文档与实装覆盖。生产新增集中在安装判断与按需路由,沿用 Toolkit 执行代码与安装 owner。

  • distribution_recorded_files。从原始 RECORD 读取包含磁盘缺件的声明,为就绪和指纹提供共同列表。 代码
  • builtin_capability_installed。导入前核对匹配发行版、入口拥有权以及声明文件是否存在。 代码
  • _distribution_runtime_fingerprint。按同一归属列表拒绝损坏装机的指纹,完整恢复后原身份读回。 代码
  • _run_command。Core-only 明确退出 2,健康包按需分派既有 benchmark owner。 代码

27 项隔离实包测试通过,涵盖 File/SQLite 与直接或间接依赖缺失。29 项研究 HTTP 回归通过。 定向回归测试

对主干的风险 / Risks

旧反例中的间接依赖现在在 File 和 SQLite 均拒绝启动且不会生成指纹,修复后可继续读取原分析。HTTP 回归覆盖既有作用域、重读及恢复调用。 标准本地预检 19 项执行检查均通过。Benchmark 敏感变更仍有独立的合入资格人工项。 只读 merge-tree 和签署检查通过。未查询托管 CI,未跑真实 Benchmark 作业或发布 wheel。

语义与 CI 对齐

在真实触发下保留调用方所选的范围。两个后端缺件后都从目录撤下 Benchmark,CLI 给出匹配 wheel 安装指引,身份不再生成。补齐后恢复原指纹及已有分析,Core 始终可用。 用真实 Core 与 Toolkit wheel 重跑 File/SQLite 安装、缺件、修复、移除以及研究 HTTP 回归。 复用现有词汇,约束由既有源码拥有者执行。

我的整体评价 / Verdict

APPROVE。 沿用当前原始 RECORD owner 及版本约束。独立保持后续完整 Benchmark 家族的资格和发布边界。 已保存分析在移除和补装后能重开,收窄普通 Core 的依赖闭包,用户能看到具体修复提示。 保留现有命令、数据及 HTTP 形状。Core 与 Toolkit 的版本匹配属于安装契约。 这已交付独立安装与恢复路径,真实 Benchmark 得分和完整成本仍需后续评估。

English verdict: APPROVE at f54dd03. The real Core and Toolkit wheels pass installation, missing-file refusal, stable identity restoration, and removal on File and SQLite. Research HTTP parity passes. Separate benchmark qualification and merge policy still apply.

@mergify

mergify Bot commented Nov 26, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @cocolord.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

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 HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 26, 2026
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent force-pushed the codex/core-benchmark-package-boundary-20261119 branch from f54dd03 to 4f1cb45 Compare November 26, 2026 20:44
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 26, 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.2-sol · OpenAI · runtime_reported · xhigh

当前 Package Smoke 的两个阻断点已独立复现。

[P2] 第二个 Toolkit 验证步骤复用非空目录。 Core job 初次完成 Toolkit 准备后,到达第二个同名步骤。 同一路径首次准备退出 0,第二次报 the output directory must be empty 并退出 1。此后 Workspace wheel 构建被跳过。 保留一处 Toolkit 验证步骤。

[P2] 包和 Dashboard 的独立 PR 会跳过 Package Smoke。 PR 仅修改 packages 下的文件、Dashboard 文件或 scripts/chat_bundle.py。 三个基线可触发路径在当前 PR 过滤中均失配,后续 push/main 才会触发。 恢复 packages/、apps/presentation/dashboard/ 和 scripts/chat_bundle.py 三条原有 PR 路径。

动机 / Motivation

按需安装 Toolkit 的 Core 用户,及在 PR 上验证 Core、Workspace 和 Dashboard 改动的维护者。 构建精确提交的三份 wheel,核对安装与 HTTP 恢复。再按同一个 Core job 的目录顺序实际执行两次 Toolkit 源打包准备,并用现有路径逐一对照 PR 触发器。 wheel 安装、移除与 HTTP 恢复通过。两个 Toolkit 步骤复用同一 runner 目录,第二次准备退出 1,后续 Workspace 构建会被跳过。三个既有 PR 路径在当前触发器均失配。 本地已运行真实安装与 Workspace HTTP。托管 CI、公开发布、实际 Benchmark 作业及模型成本未验证。 重基需要保留现有可选包的发布验收,并让新 Toolkit 安装与分析恢复走实际交付入口。 Core 独立可用,Toolkit 可安装与恢复,合入前的既有包和 Dashboard 变更继续触发验证。 对照契约 对照修订 6915df67db6a8836df344a661f295006873a3ba8。

  • I2 Core 的状态和结算仍由已有 owner 提供。 通过。
  • I4 缺失 Toolkit 时拒绝相关执行,恢复后继续原分析。 通过。
  • I7 包的落地验证可完整执行,既有发布输入保持 PR 验收覆盖。 当前反例成立。

改动思路 / Approach

Core 保留持久 Goal 与能力目录。Workspace 持有 HTTP 入口,Toolkit 提供存储实现,现有 Package Smoke 承担组合安装验收。 重用已存在的版本与 RECORD 裁定,工作流中只需增加一处可选包验证,并保留其原有调用范围。 当前主干的 Package Smoke 在包、Dashboard 和 bundle 构建脚本的 PR 上触发。Core 与 Workspace 已使用共享归属判断。 上一个头的 RECORD 间接缺件修复已复跑。新故障集中于当前重基后的 Package Smoke 工作流组合。 对仓库经验采用其中的最小真实路径方法,分别核对正常操作、失败和恢复后的结果。

具体改动 / Changes

精确提交 4f1cb45357748608bb10b5c94e854fd7e824e035,17 个文件 +531/−7。Core 与 Workspace 拆分后,当前 17 路径增量主要为 Toolkit 打包、共享适配和测试。重复资格步骤增加失败路径。

  • core job Toolkit qualification。第二个运行块复用第一个块已填充的 runner 临时目录。 代码
  • pull_request.paths。新增本 PR 的测试文件,原包、Dashboard 和构建脚本过滤已被移除。 代码
  • _stage_source。拒绝用非空目录准备发行版,保护上一批构建输入。 代码
  • _research_analysis_store。按实际 Toolkit 健康决定分析读取或返回具体 503。 代码
  • builtin_capability_installed。用共同的安装 owner 核对版本与声明文件。 代码

两份实际 Core、Toolkit 包的安装及身份覆盖 29 项通过,研究 HTTP 源码测试 29 项通过。独立真实 Workspace 服务验证 503、200、503、200、503,跨 Goal 请求始终 404,原合成状态未被改写。 定向回归测试

对主干的风险 / Risks

仅装 Core 和 Workspace 时分析 HTTP 返回 503,装 Toolkit 为 200,移走间接依赖再变 503,恢复为 200,卸载为 503。当前 job 的同目录两次准备为 0、1。基线接受的三个单路径 PR 在现头都失配。 标准本地预检 19 项执行检查均通过。Benchmark 敏感变更仍有独立的合入资格人工项。 只读 merge-tree 和签署检查通过。本地已运行真实安装与 Workspace HTTP。托管 CI、公开发布、实际 Benchmark 作业及模型成本未验证。

语义与 CI 对齐

在真实触发下保留调用方所选的范围。wheel 安装、移除与 HTTP 恢复通过。两个 Toolkit 步骤复用同一 runner 目录,第二次准备退出 1,后续 Workspace 构建会被跳过。三个既有 PR 路径在当前触发器均失配。 同一 runner 先走 Toolkit 验证,再走 Workspace 构建。对照包、Dashboard 与脚本三个单路径 PR 都触发 Package Smoke。 复用现有词汇,约束由既有源码拥有者执行。

我的整体评价 / Verdict

REQUEST_CHANGES。 只保留一处 Toolkit 资格验证,并恢复三个既有 pull_request 路径。继续用共享 RECORD 和独立 wheel 验证。 运行时的 Toolkit 安装与恢复已通过实包回读。当前工作流会中断后续包验证,并漏掉原有包和 Dashboard 的 PR 触发。 保留既有命令、目录及分析数据。发布工作流继续覆盖当前 Core、Workspace 和 Dashboard 输入。 先恢复现有 Package Smoke 的可达性,再保留已经验证通过的可选 wheel 生命周期。

English verdict: REQUEST_CHANGES at 4f1cb45. Installed Toolkit recovery passes. Package Smoke runs the same preparation twice against one nonempty directory, so the second step fails before Workspace packaging. The rebase also removes the PR triggers for packages, Dashboard, and the bundle script. Keep one qualification step and restore those triggers.

Comment thread .github/workflows/package-smoke.yml Resolved
Comment thread .github/workflows/package-smoke.yml Resolved
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

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