Repository navigation
test(core): require installed provenance before qualification - #8818
Conversation
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
There was a problem hiding this comment.
Reviewer: model_agent; GPT-6; OpenAI; self_reported.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
运行 Core 安装资格测试的维护者和 CI。选择普通 editable 解释器时,单选执行测试仍显示 PASS;修复后在任务创建前明确拒绝来源错误。此前错误的绿色结果可能被当成拆包安装依据,因此仅在单独 identity 用例中检查版本不够。五种无效来源均被提前拒绝,真实安装继续经过原执行与恢复检查。本 PR 不证明 wheel 内容真实性、实际模型采用或完整 R1/M3。剩余缺口包括原十项、完整 D2/D5 闭包、真实模型与完整成本,以及完成前的原目标完整回归。
这个修复交付一个完整的资格边界:即使只选择执行或上下文用例,来源错误也不能启动 Task。它修的是可以真实复现的误资格,不以增加用例或文档条数证明进展。
改动思路 / Approach
共享检查放在既有 core_python fixture 返回解释器之前。该 fixture 用隔离 Python 从测试临时目录导入包,检查 Core 版本、共装和 editable 标记,并核对实际命名空间与安装记录。合法 wheel 返回同一解释器,继续原 Task、CLI、validator、journal、恢复与结算路径;没有 opt-in 时仍在启动 subprocess 前 skip。
原 identity 用例中的 metadata 检查迁入公共 fixture,其他 namespace、help、manifest 和 doctor 断言保留。上下文测试也复用该 fixture,无需另一套安装规则。没有修改生产 admission、增加注册前提或另造 C1 decision owner。比复制完整安装检查到每个用例更小且充分的修复,就是在现有公共入口前检查实际来源。
具体改动 / Changes
规范为接受前 2485aac6958c54b6f392f40beb9f5c5d43b1bdd2 的 docs/architecture/rfcs/monorepo-distribution-split-v0.md §9/§11。R1 与 M3 对源码装配和干净拆包安装的区分,由本 fixture 保护其证据来源。V1 的两个 preset 闭包、V2 的完整权限矩阵、V3 的完整命令语料、V4 的真实 managed Task、V5 的实际模型上下文采用、V10 的完整成本,以及 M3 发布均 deferred,由原 R1/M3 工作继续。新 checkpoint 没有替代这些验收,也没有重新解释 #8813 的旧 source-checkout 图。
关键代码讲解
core_python在返回前运行-Iprobe,拒绝普通发行包共装及 editable Core,要求 RECORD 中存在loopx/__init__.py且其安装路径对应实际导入包。这里只检查安装来源归属,不认证文件内容。test_installed_core_identity_help_and_unavailable_workspace删除了已经共享的重复 metadata 检查,其他 identity 行为保持。12 个主文件 installed-Core 入口与导入 fixture 的上下文消费者继续受同一个来源检查保护。- 英文 checkpoint 及中文镜像只追加这个缺口、验证和限制。反例明确为缺少
loopx/__init__.py的 RECORD 条目,未扩大为整个 RECORD 缺失。
对主干的风险 / Risks
主要风险是把合法安装误判为非法,或在其他测试已经派发任务后才发现来源错误。实际 selected pytest 对照使用同一合法任务与 observer:旧 fixture 的 ordinary 环境通过并派发十次 CLI;新 fixture 的普通包、共装、source shadow、缺少 init RECORD 条目和真实 PEP660 editable 五种来源在 setup 失败,Task、body 和 CLI 都未进入。未设置 opt-in 保留明确 skip。失败结果和旧源码没有改写。
最终 B 的完整 tests/test_core_distribution.py 为 32 PASS,完整 tests/control_plane/test_installed_core_context.py 为 6 PASS;都没有 failure、error 或 skip,分别记录 225、64 次 CLI 派发。正例使用独立环境重新安装固定 main wheel,其 1902 个生产源文件与 reviewed head 相同;故障注入后安装记录文件恢复,旧环境与 seals 保持不变。Root 独立读回全部 JUnit、73 个封存文件、三文件 blobs、tree 和 wheel 源字节。上下文 suite 的控制器与 fixture 是合成输入,因此不外推为实际模型采用。
最终 head 的标准 premerge 通过 5 个直接检查和 11 个自动检查,Ruff 与双语 RFC 检查通过。首次 premerge 因新工作树缺少 TypeScript 开发依赖失败;安装既定依赖后对 unchanged head 完整重跑通过,未跳过失败项或修改预算。当前远端 CI 为 22 success、4 failure、4 skipped、3 in progress、6 pending。失败为两个 chat-bundle-browser、dashboard-browser(1) 与 windows-powershell,原因均保持 unresolved;未完成检查不记为成功,也未声称这些失败属于基线。本地验证独立覆盖当前改动,CI 与合入 readiness 仍分开判断。
整个 diff 只有测试与两篇 RFC;生产源码与 parent 逐字节一致。原 host、validator、执行/回放/失败断言、原六行为 checker 保留。C1 638b7e3c23f0 与本次三路径无交集;本结论不继承或授予整个 C1 的批准。最坏情况下可以回退 fixture 修改和这对 checkpoint,不迁移或重写任何运行状态。
合入决策:在 2026-11-15T08:21:43Z 的 readiness 观测中,head 仍相同且 MERGEABLE,零 review threads,exact-head COMMENTED 批准结论有效。远端为 27 success、5 failure、8 pending,新增的 typescript-core(2/3) 原因也保持 unresolved。完整安装的 38 项与所有本地必需检查通过,当前没有未解决 finding 或缺失必需验证;依既有 maintainer/admin 授权,仅对 CI status/readiness hold 使用 admin bypass,保留全部失败与 pending,不绕过 review、源版本、双语或真实路径门。
我的整体评价 / Verdict
APPROVE,8818@ba7e556ffd1b97317b8f77081f63dde4fd01648d 是 justified_increment,零阻塞性发现。long_horizon 与 user_experience 的生产路径 preserved;安装资格误用被提前拦截,未增加用户操作、确认或治理前提。检查了完整测试及双语文档 diff;本次没有修改渲染页面、前端请求、设置或 UI 内容。实际模型、installed App、Lark 和完整成本范围保持未验证。
既有 fixture 的共享比逐用例复制检查更可维护;本域的局部简化已经通过迁移重复 identity 检查完成。扫描既有安装/context 覆盖及最近同作者 PR 后,没有发现同形 smoke 批量复制或一次性 builder。完整原目标仍由原 R1 工作继续,不能用本次测试资格修复关闭十项验收。合入还需 unchanged head 的审批 closeout 与 readiness;CI-only hold 只按已有 maintainer 授权处理。
English verdict: APPROVE 8818@ba7e556ffd1b97317b8f77081f63dde4fd01648d; 0 blocking findings. Exact-source provenance counterexamples and installed real-path coverage pass; broader model, platform and full R1/cost qualification remain separate.
Core qualification could pass a selected execution test when
LOOPX_CORE_TEST_PYTHONpointed to an ordinary editable checkout. The shared fixture now checks the actual imported package against installed Core metadata and its RECORD before any Task preparation or CLI dispatch. It rejects ordinary co-installs, editable Core and mismatched package ownership; unset opt-in still produces an explicit skip.This continues the R1/M3 qualification work in the accepted small-kernel RFC and follows #8813. The English and Chinese checkpoints preserve source-checkout versus installed-wheel evidence, the original ten requirements and the remaining full-goal regression. Production admission, C1 owners and the existing execution oracles are unchanged.
Core 资格用例此前只信任解释器环境变量,普通 editable 源码环境也能通过单选执行测试。现在由公共 fixture 在 Task/CLI 派发前核对版本、真实导入包及 Core 安装记录;原 identity 检查复用同一入口,既有 host、validator、执行和回放断言保留。此改动保护测试资格的来源,真实模型、wheel 字节认证和完整成本仍需分别验证。
Validation of the exact test source reproduced the previous false qualification (10 CLI calls), rejected five invalid environments before Task/body/CLI dispatch, retained the opt-in skip, and passed identity plus File/SQLite execution and replay on a real Core wheel. RFC bilingual and Ruff checks pass. At final head ba7e556, the complete installed-Core file passes 32 cases and the complete installed context file passes 6 cases, with zero failure/error/skip. The frozen wheel has 1902 production source files identical to the reviewed checkout. Independent artifact, JUnit, source/tree/blob and post-fault installation readback pass. Standard premerge passes 5 direct and 11 automated checks after installing the missing TypeScript development dependency; the initial failed run is retained. Remote browser and Windows checks have unresolved failures and pending jobs, recorded separately from required local validation and merge readiness. This fixture guard does not complete the original R1/M3 requirements or full-goal regression.
Merged after exact-head review and required local validation. The final readiness observation retained 29 successful, 7 failed and 6 pending checks; CI causes remain unresolved. Existing maintainer/admin authorization was used only for the CI readiness hold, with a valid exact-head COMMENTED approval conclusion and zero unresolved review threads. Merge commit
37a79decfe9964212c5a0795cd22e869e4191775has the same full tree as reviewed headba7e556ffd1b97317b8f77081f63dde4fd01648d.