fix(packaging): include runtime receipt reader - #5096
huangruiteng merged 1 commit into
Conversation
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
Duang777
left a comment
There was a problem hiding this comment.
Exact-head self-review for 16ed9f6: APPROVE for maintainer review. The package-data entry includes the missing runtime TypeScript module in built artifacts, and the installed-artifact provenance check now fails directly if that resource regresses. Wheel and sdist installed E2E each passed all 5 stages. No unrelated files are included.
|
Exact-head CI update for |
huangruiteng
left a comment
There was a problem hiding this comment.
Exact-head review: 16ed9f690f5a1bb4c3e4b95806de5044df16ba47(base 71dbfd5e605da4e7efdb58c87cd3f4a96d39e0e5)。无阻塞发现;评审结论独立于作者自评或远端 CI。
动机
本问题是发布制品与源码路径不一致:源码已经通过 rollout receipt/quota readback 导入 control_plane/runtime/receipt_log_snapshot.ts,但该包没有 TypeScript package-data 规则。源码测试可以看见文件,wheel/sdist 用户却在 native runtime ready 之前失败。这直接影响安装后的真实使用,不是仅让测试知道一个文件名。
改动思路
最小修复应留在已有 distribution owner:按现有 control-plane 子包惯例增加 runtime 的 *.ts 规则,同时扩展现有隔离安装 E2E 的资源来源检查。单文件 installer copy、checkout 路径 fallback 或新的包装框架会复制权威,而且可能掩盖制品漏包;没有必要。资源可用不等于 capability 被启用,本 PR 不改变任何 provider/Goal 激活门或权限。
具体改动
整个 PR 只有两处新增行:pyproject.toml 声明 runtime 子包 TS 资源,examples/shared-goal-authority-e2e/installed.py 的原 provenance 列表增加 receipt reader。源模块、缓存/回执语义、CLI 参数及用户配置都未改变。测试扩展复用现有 runner,既检查安装位置,也继续执行真实 console/native runtime 和独立 provider 读回。
关键代码讲解
tool.setuptools.package-data / loopx.control_plane.runtime(pyproject L60):输入是现有 tracked runtime 模块 → setuptools 依照子包*.ts收集资源 → wheel/sdist 提供安装后 module resolution 所需字节。消费者是既有rollout_receipt_log.ts与quota/settlement_readback.ts;不是新创建的功能。缺资源应修 build contract,不能退回 checkout。InstalledQualification.run / installed_resource_provenance(L111、L125):artifact → 空 venv、安装后 console、独立 cwd及清理后的环境 → importlib.resources 读该 TS 字节并校验全部路径在已安装包内 → 继续 bootstrap、三次真实 mutation、默认 qualification、独立 file store readback、rollback 与新 lineage。漏资源或 native startup 失败都不能记作通过。
我独立准备了相同 base/head frontend build 前置条件并构建两种制品。archive 检查:base wheel/sdist 都没有该模块;head 两者包含与 source 相同的字节(SHA256 19ae2c8daa7c0dbf489897f885bf8a414bf8d0fae2b3a64adc88ce68b773039e)。实际 base 安装成功之后,console_handoff_mode_hard_lease 仍因 TS runtime 提前退出而失败;head wheel 和 sdist 分别通过全部 5 个阶段,均为 0 failed、0 pending、0 unverified。因此没有只依据 archive presence 或作者的“已验证”断言批准。
对主干的风险
新增规则沿用已有 per-domain 范围,没有把 repository 临时材料或任意目录带进包,也没有改 reader 实现。真实安装验证排除了源码 import 路径泄漏,覆盖后续 mutation、回执数量、rollback 和重新 bootstrap 的可持续路径。Dashboard 的既有 bundle 构建作为发布前置条件通过,UI/first-screen 内容没有变化,不需要 companion frontend/Lark 修改。
本地 premerge 的 install-local smoke 仍失败,但我在不可变 base 上用相同命令复现了相同 identity:examples/install-local-smoke.py:416 的 AssertionError: This command is read-only。断言及 skill 文本路径不在本 PR 两行的因果链内;该既有问题必须保留为独立修复/合并检查,不能因此要求此 PR 改 unrelated 文案,也不能说整体检查全绿。初次 semantic smoke 缺 Node 依赖,npm ci 后已通过。Ruff、diff/compile/public-boundary、其他 selected local checks及真实安装路径均有独立证据,远端 CI 未查询或等待。
bounded future-facing pass 已体现为按 domain 的 wildcard,而非硬编码单个文件,使同一 runtime owner 的下一次资源新增不会再遗漏;provenance 仍在既有 owner。更宽的 dependency scanner 不属于本次已证实缺口,不添加 speculative abstraction。
我的整体评价
APPROVE。这两行虽小,但完整修复一个已复现、用户可见的 distribution failure,并在既有 durable E2E 中约束回归;范围足够而没有混入 state-machine 重构。没有阻塞发现。独立红 smoke 的归因与 PR verdict 分开,合并仍需 maintainer 的 exact-head readiness,评审不等于绕过门禁。
English verdict: APPROVE - exact head 16ed9f6; base artifact omission and native startup failure reproduced; head wheel/sdist each passed all five isolated real CLI/native lifecycle stages. The identical pre-existing source-install text assertion is reported separately, not attributed to this PR.
Summary
loopx.control_plane.runtimeTypeScript resources in wheels and sdistsreceipt_log_snapshot.tsduring installed-artifact provenance checksRoot cause
receipt_log_snapshot.tswas added underloopx/control_plane/runtime, but that package had no TypeScript package-data rule. Installed builds omitted the module, so the managed Node runtime exited withERR_MODULE_NOT_FOUNDbefore becoming ready.Validation
installed_resource_provenancenpm ci --ignore-scriptspython3 examples/install-local-smoke.pystill fails on the unchangedorigin/mainassertionThis command is read-only; the same failure remains on this branch and is unrelated to these two packaging lines.