Conversation
Signed-off-by: Lihua <1017343802@qq.com>
|
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 |
huangruiteng
left a comment
There was a problem hiding this comment.
[P2] 已被主干替代,请关闭这项重复修复或去掉重复补丁:tests/architecture/test_semantic_development_probe.py:347–355 修改的同一 _run_probe_cli,已由合并的 #5251 在 d290f8ecf8fac2e2fce90231cd0f4a56d9a9267f 修复。最新检出的 main a51077fe76a17cf2f2fb4654abdecbb777be0506 已过滤该临时子进程的覆盖率注入,独立验证也不再产生丢失源码的报告错误。该 PR 的历史缺陷真实存在,但现在没有剩余交付缺口;不能仅因旧 base-to-head 测试通过而再合入同一修复。
动机
按 capability-owned pull_request_review_execution_contract_v2(policy 13)评审整个 850268bffc6f7123e88f578d3743f8f6da5c5c73 → f5ff95ce814c27e9a8a2f17340e0bc4832424fe1,并核验 latest main/相关已合并工作。原目标合理:复制进临时仓库的真实 CLI 不应把临时源码覆盖率并入主检出,否则 fixture 消失后报告失败。独立 base/head 对照复现并修复了这一故障。但 current goal 已由 #5251 的同 owner 修复完成,因此当前 PR 应撤去重复交付,而不是额外扩展 scope 来保留它。
改动思路
head 只为现有测试 helper 构造一个子进程环境,去掉 COV_CORE_* 和 COVERAGE_PROCESS_START,其余变量及 sys.executable、真实 CLI argv/cwd 保持原样。这是 pytest-cov 外部命名空间的精确 fixture 隔离,不是通用状态分类、权限规则或生产控制面 denylist。main 已在同一 helper 排除 COV_CORE_* / COVERAGE_*;两者实现细节并非字节相同,但本 PR 声明的污染故障已在现有主干边界解决。
具体改动
一文件 +9/-0;没有新 smoke、runner 或生产模块。检查了 probe_cli 复制文件清单、_run_probe_cli 和两个真实 CLI 调用测试,及 generate_semantic_inventory.py 的源码入口。pytest-cov 6.3.0 的启动 hook/engine 通过 COV_CORE_* 启用子进程覆盖率,说明隔离应发生在启动复制 CLI 的已有 helper,而非全局降低覆盖率门槛。
独立本地验证,Python 3.13.13 / pytest-cov 6.3.0 / coverage 7.16.2,分别使用三个检出的源码解释器:
- base、PR head、latest main 的
tests/architecture/test_semantic_development_probe.py --cov=loopx --cov-report=均为 17 passed;全部调用真实复制 CLI,不以 mock 提供输出。 - 同一独立 harness 读原生 CoverageData,移走仅由测试生成的临时源码,再运行真实
python -m coverage report:base 记录两个临时loopx/a.py并退出 1 /No source for code;PR head 和 latest main 都无临时文件并退出 0。 - 比较 base/head 的行覆盖:1160 个其他主源码文件的 line sets 相同。唯一差异是只由复制 CLI 导入的
consumer_report.py的 82 行被移除;相对路径合并曾将副本导入覆盖归入同名主源码,不能把这部分人工抬高的覆盖当作真实损失或声称所有数值完全相同。 - head Ruff 和 whole-diff whitespace 检查通过。DCO 存在。扫描了现有同文件/main 历史、相关测试/coverage workflow,以及作者近期 PR;唯一明确重复是已有 #5251 修复,并非凭作者身份推断贡献模式。
对主干的风险
没有生产行为、默认能力开关、typed state、actor authority 或 guidance/obligation 变更;没有必要的前端/Lark companion,也不需要 TS 迁移。局部真实 CLI 覆盖仍在,临时副本 instrumentation 不再伪装为主源码覆盖。长期验收与维护的收益来自已有主干修复;重复实现会增加冲突和维护负担,并可能在解决冲突时重新改变已收敛的环境隔离契约。
没有查询/等待 GitHub CI,也不继承作者对 Windows 或其他检查的结论。完整多分片合并及 19.6% 全仓库门槛未验证;focused report 的成功只证明源码可解析,不等于全仓库 coverage floor 达标,门槛未放宽。未跑完整 Python 套件、Windows、PostgreSQL 或打包 UI;这些没有被写成通过。
我的整体评价
REQUEST_CHANGES,理由是已被 current main 替代,而不是新发现的运行时 bug。最小处理是关闭本 PR 为 superseded;或者基于 latest main 删除重复补丁,只有存在明确不同、可独立复现的剩余问题时才保留。不要为维持 PR 增加重复 smoke 或扩大背景功能。future-facing pass:已复用正确的局部 subprocess owner,不建议添加全局 env sanitizer、并行 Python/TS owner 或新的协议层;先保留主干单一实现。
这一重复在合并后出现,没有证据证明收到重复贡献警告后仍反复提交,所以不建议贡献限制。修复历史缺陷的价值与当前无剩余 diff 价值应分开判断。本评审不关闭、合并或改写作者分支。
English verdict: REQUEST_CHANGES — independently reviewed exact head f5ff95ce814c27e9a8a2f17340e0bc4832424fe1. The historical coverage failure is reproduced at immutable base and fixed at this head, but the same fixture boundary is already fixed by merged #5251. Independently tested main a51077fe76a17cf2f2fb4654abdecbb777be0506 passes all 17 focused tests and the post-cleanup native coverage report without disposable sources. Close this as superseded or remove the duplicate patch on current main; retain a PR only for a separately evidenced remaining gap. Whole-suite/floor/Windows qualification is not claimed. No merge or branch-write authorization.
Goal and gap
Python shard coverage captured
loopx/a.pyfrom an isolated CLI fixture repository. The fixture is disposable; when the aggregate coverage job runs later, that source no longer exists andcoverage reportfails withNo source for code, even though all four test shards passed. This blocked the exact-head CI for #5418.Change
Do not inherit pytest-cov's subprocess instrumentation variables when launching the copied CLI from this fixture. The test still executes the real CLI behavior and the main checkout's Python coverage remains enabled. No runtime, API, UI, or coverage threshold changes.
Validation
No source for codeafter the temporary fixture was removed.test_semantic_development_probe.pypassed with--cov=loopx; the coverage data contains no disposable fixture source, andcoverage reportsucceeds after fixture cleanup.test_runtime_drains_admitted_write_before_exittest. The same test failed on main850268bff; separate #5442 passed its Windows job on head556a5ee24. This PR does not alter that test. Remaining remote checks and maintainer review are not yet accepted.中文
Python 分片覆盖率收集了隔离 CLI 测试仓库中的临时
loopx/a.py。汇总任务运行时该夹具源码已不存在,因此四个测试分片虽然通过,coverage report仍报No source for code;#5418 的精确版本 CI 因此受阻。本改动只在启动该夹具 CLI 时去掉 pytest-cov 的子进程注入变量,保留真实 CLI 行为测试及主检出源码的覆盖率。不改运行时、接口、界面或覆盖率阈值。修复前已复现汇总失败;修复后该测试文件 17 项带覆盖率通过,覆盖率数据不含临时源码,夹具清理后可正常生成报告。Ruff 和差异检查通过。精确版本 CI 的 Windows 检查在未修改的
test_runtime_drains_admitted_write_before_exit上失败;main850268bff同样失败,独立的 #5442 在其 head556a5ee24上已通过 Windows 检查。本 PR 不修改该测试;其余远端检查及维护者评审仍待验收。