Repository navigation
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
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 协作完成边界收口:
- 打包过滤边界(
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,避免导入目录条目时触发执行门面副作用)。 - 目录能力投影边界(
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. - 当前 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返回拒绝。
- I2 (内核真相唯一 owner 与零重复实现路径):implemented — 仅保留
- 对 RFC 双语修订的独立审查:PR 同时在
docs/architecture/rfcs/monorepo-distribution-split-v0.md与.zh-CN.md中新增 1 段关于 D2 边界的说明(确认 Core 保留目录元数据与四臂契约、benchmark 执行留在普通发行物)。该说明忠实反映上述既定 I2/I4 边界,未修改原有基线不变量或放宽验收门禁,中英文语义一致(check_rfc_bilingual.py通过)。
关键代码讲解
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以防导入目录数据时连带执行门面初始化。
- 在源码暂存筛选中以
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,不修改模块级常量自身。
- 在注册内置能力前用
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与所有执行模块被移除,目录构建仍能零外部依赖、零私有导入安全加载。
- 仅依赖 Python 标准库与
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.0wheel 的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模块存在与否作为全量安装判定代理,未来若loopxmeta-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.0wheel 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
left a comment
There was a problem hiding this comment.
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.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | Gemini | Google | self_reported
Target Exact Head: c8aa614
动机 / Motivation
- 受影响调用方(Affected caller / operator):安装独立
loopx-corewheel 的运维人员与开发者、在核心任务后按需加装或卸载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-toolkitwheel 后即可在原 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 与后续里程碑。
- 包边界与文件所有权隔离:
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_*.py9 个适配器移出 Core,改由--distribution loopx-capability-benchmark-toolkit打入独立 wheel,使 Core 中的benchmark_toolkit退化为 PEP 420 namespace package;同时将research_analysis_api.py与runtime_workspace.py从 Core 排除。 - 惰性包入口与零执行发现:合入自 #9034 的
loopx/capabilities/benchmark_toolkit/__init__.py用_EXPORTS+__getattr__+__dir__+TYPE_CHECKING替代原本的 31 条顶层 eager import,保证仅访问目录元数据或单项符号时不会牵连其余 30 余个重型执行/实验模块。 - 版本与物理 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,双 wheelRECORD零重叠,由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 正文新增段落存在历史口径衔接差,但不影响核心不变量或机器验收门禁。
关键代码讲解
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。
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,既防错配版本也不触发目标模块导入。
- 先判断
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。
- 当
loopx/presentation/research_analysis_api.py—ResearchAnalysisRequestMixin._research_analysis_store/_research_analysis_read/_research_analysis_write- 移除模块顶层对
trajectory_assessment_store的硬导入,改为请求鉴权与源校验通过后再调用benchmark_toolkit_installed(),未安装或版本不匹配时返回 HTTP 503research_analysis_unavailable;并将except块中的store.PackUnavailable改为运行时判别以防store is None时抛出AttributeError。
- 移除模块顶层对
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 协调事项:
- [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_MODULESvsWORKSPACE_MODULES过滤谓词、research_analysis_api.py中版本/RECORD 守卫 vsimport_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。 - [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 引入)。 - 验证与边界矩阵:
- 双 wheel 物理打包与 RECORD 互不相交:PASS(
loopx_core1,874 条 vsloopx_capability_benchmark_toolkit49 条,重叠 0)。 - 隔离 venv 验证:仅 Core(
capability show报installed=False、sys.modules零执行模块、benchmark退出码 2);Core+Toolkit(capability show报ready=True、doctor --deep通过、199 个__all__符号与 43 个模块可正常导入、four-arm-contractCLI 返回合格 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.py80 passed;test_research_analysis_api.py+test_capability_extension_registry.py+test_benchmark_toolkit.py303 passed;test_control_plane_import_boundaries.py+test_top_level_module_budget.py+test_package_kernel_import_ratchet.py+test_cli_entrypoint.py339 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人工评审门禁)。
- 双 wheel 物理打包与 RECORD 互不相交:PASS(
- 残余风险(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,复用既有CapabilityRegistryprovider 布尔状态、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).
|
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 |
loopx-agent
left a comment
There was a problem hiding this comment.
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.
Signed-off-by: cicolord <[email protected]>
Signed-off-by: cicolord <[email protected]>
…istration Signed-off-by: LoopX Agent <[email protected]>
c8aa614 to
9a5aa5e
Compare
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-toolkitwheel supplies the existingloopx benchmarkcommands and assessment store. Core supplies the catalog and its referenced four-arm contract. Capability discovery reports the installed provider and leaves execution unloaded.Rebased onto latest
main(a9c275052a54) and resolved[P2]review thread (PRRT_kwDOStEbEs66UGP6) on partial Toolkit installs:loopx/python_install_owner.py:builtin_capability_installednow verifies that everyloopx/*.pyfile listed in the matching packageRECORDexists on disk viadistribution_record_path(keeping catalog discovery side-effect free without importing implementation modules).loopx/capabilities/benchmark_toolkit/catalog_entry.py:BENCHMARK_TOOLKIT_STARTUP_MODULESexplicitly coversloopx.capabilities.benchmark_toolkit.benchmark_dispatch, all eightloopx.cli_commands.benchmark_*submodules (boundary,concurrency,continuation,experiment_board,rebalance,study,token_capacity,trajectory), andloopx.capabilities.benchmark_toolkit.trajectory_assessment_store.loopx/cli_runtime.py:register_benchmark_command_groupon standalone Core catches missing toolkitModuleNotFoundError(loopx.capabilities.benchmark_toolkit/loopx.cli_commands.benchmark_*) and exits with code2andBENCHMARK_TOOLKIT_INSTALL_HINTinstead of an unhandled traceback, while re-raising unrelated missing dependency errors.tests/test_core_benchmark_distribution.py: Addedtest_partial_toolkit_install_reports_unavailable_until_repaired[file|sqlite]verifying that deleting an installed toolkit submodule (benchmark_study.py) switches toolkit readiness to unavailable (installed=false,ready=false,loopx commandshidesbenchmark), failsloopx benchmark --helpwith exit code2and the reinstall hint, leaves Core task commands working, and recoversready=trueandexit 0once restored.Related to #5072 and #9058. Reuses the lazy-loading commit from #9034 (
f0afdefb87), the package boundary commit (5213b2f141), and9a5aa5ec6587.Author declaration
model_agent(Antigravity / Gemini, building on prior OpenAI Codex commits#9034/#9038)git commit -s).Verification
Tested exact head
9a5aa5ec65874681d88b8a6e0c533fc2a79927dbrebased ontomain@a9c275052a54on macOS arm64, Python 3.12, with real built2.4.1wheels and synthetic fixtures:loopx-core+loopx-capability-benchmark-toolkitwheels (2.4.1)82 passed, 0 skipped, 0 failed in 475.06sacrosstest_core_benchmark_distribution.py(5/5),test_distribution_runtime_identity.py(18/18),test_benchmark_toolkit_loading.py(6/6), andtest_core_distribution.py(53/53), including File/SQLite CLI registration, version/digest checks, Core replay after removal, and partial-install unavailability/recovery.pytest -n 6 -rs)3,716 passed, 107 skipped, 0 failed in 863.26sacross benchmark, research, capability, distribution,cli_entrypoint,tests/architecture/, andtests/canary/(skips are macOS APFS filename checks, unbuilt-wheel env checks covered above, Linux-only memory/fsize checks, live host binary checks, and optionalharbor).ruff check(10changed.pyfiles clean);check_rfc_bilingual.py --base origin/main --head HEADpassed;npm run typecheck:control-plane(0errors);mypy --no-incremental --follow-imports=silenton typed files (python_install_owner.py,catalog_entry.py,release_manifest.py,packages/loopx-core/prepare.py) clean (0issues);docs-governance-smoke.py&semantic-vocabulary-drift-smoke.pyok; public-boundary check across488files clean (0errors,9non-literalcredentialprose warnings).tier=standard)19/19executed checks passed (failures=0):6direct checks pass,10/10catalog canaries pass (install-local-smoke.py,codex-cli-packaged-install-smoke.py,loopx-update-smoke.py, maintainability ratchet, semantic vocabulary drift, task lease),8/8risk-profile smokes pass,1/1public-boundary scan clean. Reportsmanual_hold_count=1(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
scripts/check_rfc_bilingual.py --base origin/main --head HEAD.Signed-off-bytrailer (git commit -s).