Skip to content

Count split distribution preparations by their build command - #9794

Open
cocolord wants to merge 33 commits into
loopx-project:mainfrom
cocolord:codex/qualify-package-smoke-preparations-20261202
Open

cocolord wants to merge 33 commits into
loopx-project:mainfrom
cocolord:codex/qualify-package-smoke-preparations-20261202

Conversation

@cocolord

@cocolord cocolord commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Delivery

Verify the split package smoke's preparation commands and outputs. The matched installation Doctor checks list Benchmark Toolkit and Workspace as expected companions. Count their actual prepare invocations and retain the unique output and build ordering assertions.

Qualification

  • The old assertion reproduced on the current package workflow after the metapackage smoke added companion receipt checks.
  • On f40684a911, all 170 CI resource policy tests passed. Ruff and standard premerge passed.
  • Local workflow mutations that repeat a preparation, reuse an output or reverse the Toolkit and Workspace build order are rejected.

RFC #5072.

Review follow-up

Follow-up at 2cf1054 retains the mainline core-companions-aware selection, the original paths, and the preparation order. It now rejects a duplicate distribution even when the second invocation names a different output. All 170 CI-policy tests and local quick premerge passed; a duplicate Workspace command with a distinct output was rejected.

Review follow-up

Revision ee1401116e against main@dc0505ea3a. Normalize the preparation script path before identifying the build command. All 170 CI resource policy tests passed, and an injected duplicate using ./packages/loopx-core/prepare.py was rejected.

Review follow-up

Revision a6935236c5 against main@3956eb54f7. The preparation policy recognizes both uv extra spellings and leading shell assignments. The CI resource policy suite passed 170 tests. Three mutated real workflow steps using these equivalent command forms each failed at the duplicate Workspace preparation check.

Review follow-up

Revision bc9a5f2c84 against main@355a887e55. Synced the same one-file proposal with current main. The CI policy suite passed all 170 tests. On copies of the current workflow, one preparation with --extra=test, a leading environment assignment, or a dot-relative script path passed in each form. Adding a second Workspace preparation with a different output directory failed the distribution count in all three forms. The two forms identified in review reproduced the missed duplicate on the reviewed revision. Scoped Ruff, RFC diff validation and quick premerge passed.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
@mergify

mergify Bot commented Dec 2, 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 Dec 2, 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

评审提交 f40684a911dd1b8984ce687376b2d0b7f5eae561,比较基线 b4110f30aefbd78ec503de0e5c3d37f5f510f92b,核对当前主干 5f51b79ac2cf5cec3cc251f471b1716e1bcea933。维护 split package CI、Core 及 companion 合格性的开发者。 旧测试把 Doctor 到处出现的软件包名也计入,导致在旧工作流中重复计数。主干 #9725 已按实际准备输出检查,并支持 core-companions 依赖。 只改变现有 CI 政策测试;GitHub Actions 实际打包和发布流程沿用原 workflow。

提案改为解析实际 prepare.py 的命令参数,能发现同一 distribution 换输出目录的重复准备。但当前工作流已把准备步骤放在 core-companions,提案仍只读 core 聚合任务。

改动思路 / Approach

package-smoke 的 core 聚合检查依赖 core-execution 与 core-companions。后者实际拥有 companion 准备;测试需读取本次工作流的执行步骤。 现行 package-smoke workflow 拥有真实任务拆分,当前测试负责断言准备输出顺序。

具体改动 / Changes

验收依据

  • 读取当前执行 job 从 core-companions 取实际执行步骤,聚合 job 不含准备命令。 对应位置
  • 保留重复和顺序断言 实际 argv 匹配可补现有的重复软件包缺口。 对应位置

对主干的风险 / Risks

现头旧工作流与当前主干各自 170 项 CI 政策测试通过。两侧测试都能抓住输出重用与反序;现头额外抓住同一 Toolkit 使用新目录重复准备。 把当前提案的测试对准主干工作流,因 core 聚合任务没有准备命令而抛 KeyError;普通合入也在同一测试内容发生冲突。 精确头标准 premerge 和 170 项 CI 策略测试通过;当前集成失败及三组修改对照经独立复验。 验证在本地解析当前 YAML 并执行原测试和三个变异,没有执行远端打包或发布。

我的整体评价 / Verdict

请求修改。以主干 #9725 的 companion job 选择为基础,只补能抓同一 distribution 换输出目录重复准备的断言,保留 Toolkit 与 Workspace 的原输出和顺序。 原提案替换当前测试会破坏正常 CI 校验。其新增的重复 distribution 检查可单独保留。

English verdict: REQUEST_CHANGES at f40684a. Request changes. The candidate reads the aggregate core job and fails against the current workflow. Keep the duplicate-distribution check on the existing core-companions-aware fixture.

Comment thread tests/test_ci_resource_policy.py Outdated
@@ -403,24 +404,27 @@ def test_nightly_schedules_exist_and_release_publication_never_fires_on_schedule

def test_package_smoke_prepares_each_distribution_output_once_before_workspace() -> None:
steps = workflow("package-smoke")["jobs"]["core"]["steps"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 测试只读取 core 步骤,漏掉当前的 core-companions。 把当前提案的测试对准主干工作流,因 core 聚合任务没有准备命令而抛 KeyError;普通合入也在同一测试内容发生冲突。 以主干 #9725 的 companion job 选择为基础,只补能抓同一 distribution 换输出目录重复准备的断言,保留 Toolkit 与 Workspace 的原输出和顺序。 已合入的 #9725

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
@cocolord
cocolord requested a review from loopx-agent December 2, 2026 14:27
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Dec 2, 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

评审提交 2cf10542189d530f1c830e4e4e9560157a579a8c,比较基线 ffcdbfbe81dfaac77e61bd720033659f897ac0b6,另核对当前主干 30e198c4648084b1795e957b01ac481324098fd9。维护拆分包工作流和预合并检查的开发者需要在 Toolkit 和 Workspace 构建前校验实际准备命令。主干的既有测试读取 core-companions,检查真实准备输出的唯一性和 Toolkit→Workspace 顺序。旧评审要求保留这个选择。 在当前 core-companions 注入一次重复的 Toolkit prepare 命令,只给 Python 脚本路径加 ./,参数和输出与原命令相同。

当前提交修复了旧 job 选择问题。它保留原流程,拒绝反序和原写法下的重复,也能抓住同一 distribution 换目录的重复准备。 两条命令运行同一脚本并写到同一路径。主干断言拒绝,候选的完整 argv 前缀比较跳过第二条,策略测试仍通过。 只调整现有政策测试,生产打包、权限、工具接口和发布动作均沿用现有工作流。

改动思路 / Approach

沿同一个政策测试解析 shell argv,再核对 distribution 和输出。现有工作流决定执行 job,政策测试检查准备命令的身份和先后顺序。无需新增 smoke 或复制 policy owner。

具体改动 / Changes

  • 当前提交修复了旧 job 选择问题。它保留原流程,拒绝反序和原写法下的重复,也能抓住同一 distribution 换目录的重复准备。
  • shlex 排除了注释中仅提到脚本名的误报。
  • [P2] 仅识别固定路径会漏掉同一 prepare.py 写入同一输出。 在当前 core-companions 注入一次重复的 Toolkit prepare 命令,只给 Python 脚本路径加 ./,参数和输出与原命令相同。 两条命令运行同一脚本并写到同一路径。主干断言拒绝,候选的完整 argv 前缀比较跳过第二条,策略测试仍通过。 对照位置

验收依据 · 旧评审

  • 现行执行任务 实际选择 core-companions,原工作流通过。
  • 准备身份、输出与顺序 原写法的重复和反序被拒绝,等价路径反例仍会通过。

对主干的风险 / Risks

同一准备脚本换用仓库相对路径的常见写法后,重复输出可能在现有门禁放行。该边界影响 CI 保护,生产运行路径不随这一测试直接改变。本轮 170 项 CI policy 测试和 Ruff 通过,精确头与当前主干可形成干净组合树。现行 YAML 加六种对照验证。[loopx canary] premerge done: passed selected=3 failures=0。 本地使用真实工作流 YAML 和原测试入口,对准备命令做合成替换。没有启动远端构建或发布。

我的整体评价 / Verdict

请求修改。保留已修复的 job 选择和新增的 distribution 检查。保留已有 job 选择和 argv 解析,对脚本路径做最小规范化,使有无 ./ 的同一路径都进入 distribution、输出和顺序检查,并保留此成对反例。

English verdict: REQUEST_CHANGES at 2cf1054. The current workflow selection is fixed, but an equivalent ./ script path hides a duplicate preparation and output that the main-branch gate rejects. Keep the existing assertions and normalize the script path.

Comment thread tests/test_ci_resource_policy.py Outdated
if not line.lstrip().startswith("uv run "):
continue
command = shlex.split(line)
if command[:len(prepare)] != prepare:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 仅识别固定路径会漏掉同一 prepare.py 写入同一输出。 在当前 core-companions 注入一次重复的 Toolkit prepare 命令,只给 Python 脚本路径加 ./,参数和输出与原命令相同。 两条命令运行同一脚本并写到同一路径。主干断言拒绝,候选的完整 argv 前缀比较跳过第二条,策略测试仍通过。 保留已有 job 选择和 argv 解析,对脚本路径做最小规范化,使有无 ./ 的同一路径都进入 distribution、输出和顺序检查,并保留此成对反例。

…dback-dec02

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
@cocolord
cocolord requested a review from loopx-agent December 3, 2026 09:54
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>

@huangruiteng huangruiteng 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

维护拆分包构建和 CI 策略的开发者,需要在合并前发现对同一发行包的重复准备。 旧问题来自按命令字面拼写识别同一个脚本。当前提交能识别带 ./ 的路径,仍跳过等价的 uv 参数写法和行首环境赋值。 同一真实 workflow 的两组对照中,基线能拒绝重复准备,现头的策略测试错误放行。 本次改动限于已有的 CI 策略测试。

改动思路 / Approach

仍由 package-smoke workflow 决定实际 job 和命令,原 pytest 断言负责检查实际发行包、输出和顺序。 现头沿用 core-companions 选择及回归断言。判断脚本身份还应覆盖工作流中等价的常用命令包装,以便同一准备动作进入同一组唯一性检查。

具体改动 / Changes

比较基线 dc0505e,依据 .github/workflows/package-smoke.yml。这次改了 1 个文件,增加 18 行、删除 4 行。读取实际准备步骤 已确认。保持准备输出唯一和构建顺序 仍有下面的缺口。 仓库依据 上一轮评审

[P2] 保留等价 prepare 命令的重复检测。把重复 Workspace 准备命令的 uv 参数改为 --extra=test,或在行首加 LOOPX_USAGE_PING=0,仍会调用同一个 prepare.py 并写到同一输出。用真实 CLI 的 --help 验证两种写法都能到达脚本。旧策略断言拒绝这两组重复,现头因固定前缀提前跳过它们。请让已支持的等价命令进入现有的发行包、输出和顺序检查。 对应代码或段落

对主干的风险 / Risks

基线和现头的完整 CI 策略测试各 170 项通过,Ruff 通过。将实际 YAML 注入同一个策略测试,核对 11 种输入。两次旧评审涉及的 job 选择和 ./ 路径均修复。新增的换目录重复能被拒绝,顺序与不同发行包共用输出仍被拒绝,两组等价命令用了原有输出,恰好被现头跳过。 以主干 ca020c4 为参照,快速预合并的 5 项直接检查和 3 项所选检查通过,三方合成无冲突。 本轮未查询远端 CI。 未执行远端打包或发布。

我的整体评价 / Verdict

对精确提交 ee14011 请求修改。保留已修复的脚本路径判断和 core-companions 选择。补上同一准备操作带等价参数或环境赋值的成对验证,使单个准备动作仍通过、同一输出的两次准备仍失败。

English verdict: REQUEST_CHANGES at ee14011. The current head fixes the ./ path issue, but two equivalent prepare commands are skipped before duplicate distribution and output validation. Both are rejected at the merge base.

Comment thread tests/test_ci_resource_policy.py Outdated
if not re.match(r"^\s*uv\s+run(?:\s|$)", line):
continue
command = shlex.split(line)
if command[:5] != python_prefix or len(command) <= len(python_prefix):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 保留等价 prepare 命令的重复检测

把重复 Workspace 准备命令的 uv 参数改为 --extra=test,或在行首加 LOOPX_USAGE_PING=0,仍会调用同一个 prepare.py 并写到同一输出。用真实 CLI 的 --help 验证两种写法都能到达脚本。旧策略断言拒绝这两组重复,现头因固定前缀提前跳过它们。请让已支持的等价命令进入现有的发行包、输出和顺序检查。

cocolord and others added 9 commits December 4, 2026 02:23
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
…dec04

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
cocolord and others added 3 commits December 4, 2026 15:27
…0073-queue-current

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…-outcome-scope

Signed-off-by: huangruiteng <huangrt01@163.com>
huangruiteng and others added 9 commits December 4, 2026 18:00
Signed-off-by: huangruiteng <huangrt01@163.com>
…w-deferred-outcome-scope

Review the scope of blocked work before deferring a Goal outcome
…concile-10069-reward-memory-current-main-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…concile-10073-node-scripts-current-main-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…concile-10068-settlement-current-main-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…concile-10043-workbench-core-current-main-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…rd-memory-config-on-status-20261204-0SIMP8

Defer Reward Memory configuration imports on disabled quota status
…concile-10073-node-tool-environment-after-10069-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…concile-10068-ordinary-quota-settlement-after-10069-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>

@huangruiteng huangruiteng 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-astra · OpenAI · runtime_reported · high

请求修改。仓库支持的两种打包命令会跳过重复检查。

动机 / Motivation

受审版本 bc9a5f2c8404dbe970e12e543260086a16c8ea31,比较基线 355a887e55006b0440061d21c021f96aaff77561。维护 Toolkit 和 Workspace 拆分打包流程的贡献者依赖这一判断。基线拒绝两条写往同一输出目录的 Workspace 准备命令,包括直接调用 Python 和普通 uv run。

在同一份 core-companions 工作流上添加第二条相同输出的 Workspace 准备步骤,逐一运行基线与受审版本的原测试函数。 在完全相同的工作流输入上,候选遗漏两种重复准备。原始写法、--extra=test、前置环境变量和点相对路径的重复仍被拒绝。 只调整仓库策略测试。打包工作流和 prepare.py 的执行行为沿用现有实现。

改动思路 / Approach

只调整仓库策略测试。打包工作流和 prepare.py 的执行行为沿用现有实现。保留已有的 shlex、脚本路径规范化与发行包集合。先识别直接 Python 或受支持的 uv 前缀,再对相同脚本的参数执行现有断言。 规范

验收项 prepare-output-identity。保留已有的 shlex、脚本路径规范化与发行包集合。先识别直接 Python 或受支持的 uv 前缀,再对相同脚本的参数执行现有断言。

具体改动 / Changes

已复核上轮关注的环境变量、--extra=test 和点相对路径,它们的重复都触发断言。新的失败对照使用同一工作流、同一发行包和同一输出。 在完全相同的工作流输入上,候选遗漏两种重复准备。原始写法、--extra=test、前置环境变量和点相对路径的重复仍被拒绝。 原版工作流在两侧都通过,四种带 test extra 的重复在两侧都被拒绝。 实现

对照只替换运行命令的前缀。工作流的 job、脚本路径、发行包、输出目录和步骤位置在两侧均相同。

对主干的风险 / Risks

170 项 CI 策略测试和快速预合并均通过。完成 Chat bundle 构建后,直接调用 prepare.py 在临时目录实际生成了 Workspace 的 pyproject.toml。 日常 CI 对现有规范写法仍有效。后续换用文档中的直接 Python 调用时,重复打包可能在策略测试中得到绿灯。 当前主干 f8f19b11ed 的本地试合成功。

我的整体评价 / Verdict

请求修改。仓库支持的两种打包命令会跳过重复检查。 保留已有的 shlex、脚本路径规范化与发行包集合。先识别直接 Python 或受支持的 uv 前缀,再对相同脚本的参数执行现有断言。

英文简短结论

English verdict: REQUEST_CHANGES at bc9a5f2. The policy test misses duplicate preparations through the documented direct Python entry point. Count the underlying script consistently.

Comment thread tests/test_ci_resource_policy.py Outdated
match = re.search(r'--output\s+"([^"]+)"|--output\s+(\S+)', line)
assert match is not None, line
prepare_outputs.append(match.group(1) or match.group(2))
if not re.search(r"\buv\s+run\b", line):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 计入直接 Python 调用的重复打包

在 core-companions 再添加一条相同输出的 Workspace 准备命令,按 Core README 的写法直接用 Python 运行。基线拒绝重复,候选在此提前跳过。同样的情况也出现在普通 uv run python。实际运行该脚本可以生成 Workspace 源码包。请把这两种入口归入同一个脚本身份检查,同时保留现有顺序和唯一性断言。

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更新到 bd090b910a9d21dea648912a776240254b2fbc46。策略检查会把 python、普通 uv run python 和两种 --extra test 写法归到同一 prepare 脚本,再按发行包和输出目录核对唯一性,继续检查 Benchmark Toolkit 在 Workspace 之前准备。

在真实 core-companions 步骤后分别加入两种直接调用,前一版漏掉重复,当前提交都拒绝。用两种入口实际生成了 Workspace 源码目录,逐文件比较一致。五种等价写法的重复检查已纳入回归,175 项 CI 策略测试和 quick premerge 通过。

cocolord and others added 7 commits December 4, 2026 22:49
…in-python-tool-environment-20261204-YJh0LD

Find Node installed in the Python tool environment
…concile-10068-ordinary-settlement-after-10073-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…y-reward-memory-settlement-20261204-uyJhW5

Defer staged Reward Memory on ordinary quota settlement
…concile-10043-workbench-installed-after-10068-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…installed-core-entry-20261203

fix(workbench): start managed Core through the installed CLI
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.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.

3 participants