Conversation
Signed-off-by: Lihua <1017343802@qq.com> Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
Signed-off-by: Lihua <1017343802@qq.com> Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
This baseline repair also unblocks #5338. On #5338 exact head |
|
CI dependency update: Exact job: https://github.com/loopx-project/loopx/actions/runs/36692413558/job/109813982376 The independent one-line fix is #5345. It restores the desktop button to the existing 26px contract, leaves the mobile 44px touch target unchanged, and passes the packaged |
cocolord
left a comment
There was a problem hiding this comment.
动机
这个 PR 修复的是当前主干的测试基线,而不是通过改生产逻辑来追求绿灯。主干已经有两个经过源码重建验证的 Python/TypeScript generated twin,也已经会在待升级提示存在时投影 turn_start_capability_hook_dispatch;旧测试仍分别假定数量为 1、该字段不存在。另一个真实 CI 失败来自 Host 子进程在被终止时恰好进行原地写入,读取方先看到 27、随后看到空串,从而把半写文件误判成子进程仍在运行。
改动思路
改动保留现有生产 owner,只修正三个测试观察点:generated-twin 用当前两个 source-verified pair 作为显式 ratchet,并继续用 mutation 证明新增 authored twin 会消耗独立模块预算;prompt-upgrade 在比较其余决策字段不变之前,先验证 typed dispatch 的 hook/capability 身份和投影内容;Host fixture 先写同目录 staged 文件,再用原子 rename 发布完整计数,使“返回后 marker 是否继续变化”仍是有效的存活判据。
具体改动
test_turn_contract_generation.py将已验证 generated twin 数从 1 更新为 2,原有超预算负例保持不变。test_prompt_upgrade_hook.py对 baseline 无 dispatch、pending 恰有一条 read、heartbeat.prompt_upgrade/automation-prompt-upgrade身份以及与公开 hint 的字段一致性作显式断言;只有这个已验证字段被排除在其余决策字段的等值比较之外。host_process.test.ts把 counter 从原地覆盖改为marker.next写完后renameSync,不修改被测 Host 实现、超时或清理语义。
关键代码讲解
test_new_independent_twin_cannot_hide_behind_generated_pair 仍会注入足量的 authored twin 并要求预算检查失败,因此不是简单放宽计数;prompt-upgrade 用 dispatch 内的 hook_id、capability_id 和完整 hint 字段锁住 typed route;Host 的 publish 只有在 staged 内容完整时才替换可观察 marker,存活子进程仍会在下一次完整 tick 改变它。
对主干的风险
whole-diff 没有生产代码、公共 API、持久状态或权限变化。主要风险是测试修复掩盖真实回归:这里 generated-twin 的 mutation 负例仍在,prompt 测试先校验新增字段再做窄范围排除,Host oracle 只屏蔽终止瞬间的半写状态,并未屏蔽返回后的完整写入。更新后的 immutable base 上同一 Python 命令稳定失败 3 项,新 exact head 38/38 通过;Host 新 exact head 完整复跑 10 次共 90 项通过,来源 CI 的 leader_exit 失败明确记录为空串与 27 的差异。Ruff、diff hygiene、DCO、4 个 Python shard、3 个 TypeScript shard、mutation、平台与集成检查均通过。
当前 merge readiness 仍有独立 hold:chat-bundle-browser 与 dashboard-acceptance 都在 execution-chip 的 28px hairline 断言失败;immutable base ba1e92d860027d2cf209d869249dcf61e6a11651 的对应两项以相同签名失败,且本 PR 不改 Dashboard/UI。checks、pytest、merge-gate 只是传播这两个结果。因此按 policy-12 不要求本 PR 修复无关主干问题,但合并前仍需由维护者处理或解除这些红项。
#5339 含有重叠的 Python 基线修复,但它是更大的 installer PR;本 PR 独立落地后应由 #5339 在 rebase 时消解重复。最新提交只是签署合并当前 main,贡献 diff 与前一 head 完全一致;审批仅绑定 fbd56efe262e75d6dc0ac3f00224addf58ea6d7f,不替代合并前的 freshness/merge-readiness 检查。
我的整体评价
这是一个有明确 before/after 收益的窄测试修复:它解除会持续阻塞其他 PR 的三项确定性基线假红,并修复一个有历史 CI 反例的观察竞态,同时把三个观察点保留为可失败的具体契约,没有新增一次性 smoke、框架或生产兼容层。对长周期交付是正向的,对终端用户行为保持不变;相关 future-facing pass 不需要额外抽象。未发现由本 PR 引入的阻断项,批准该 exact head,但不授予合并权限;上面的 UI 红项仍是独立 merge-readiness hold。
English verdict: APPROVE - exact head fbd56efe262e75d6dc0ac3f00224addf58ea6d7f restores three reproduced baseline assertions and removes a demonstrated partial-write test-oracle race without production changes; focused base/head checks, ten Host-suite repetitions, lint, DCO, and every changed-code CI shard passed. Two unrelated UI jobs fail identically on the immutable base and remain a separate merge-readiness hold.
|
Exact-head run The independent UI repair #5345 is now green on exact head After #5345 lands, this branch can be synchronized once and rerun without mixing the two baseline repairs. |
|
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 |
Summary
These changes repair the current
mainfailures blocking #5340. They do not change production runtime behavior. The original author is preserved on both commits.Validation
python -m pytest -q tests/architecture/test_turn_contract_generation.py tests/control_plane/test_prompt_upgrade_hook.py(38 passed)tests/control_plane_ts/host_process.test.ts(9 passed)ruff check tests/architecture/test_turn_contract_generation.py tests/control_plane/test_prompt_upgrade_hook.pygit diff --check origin/main...HEAD