Repository navigation
fix(ci): accept installed Stage 2C backup provenance - #6040
Conversation
Signed-off-by: Duang777 <duangjl007@gmail.com>
…aseline-contracts Signed-off-by: Duang777 <duangjl007@gmail.com> # Conflicts: # examples/shared-goal-authority-e2e/mutants.py
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=xhigh.
精确 head ac2af0f90bafaec6340ac8095c99d262040e67ce,不可变PR差异基线 f098fbe7ee44eba22ddc99dea34245ea8123dd89;全量差异已核验。
动机
维护任务恢复测试的贡献者,需要确认从已安装发行包启动的新进程能正确备份和导入隔离任务。 旧测试要求 pytest 与备份子进程导入包的磁盘路径完全相等;源码目录运行 pytest、目录外运行已安装包时,合法流程也会在断言处失败。新测试检查子进程实际导入的包文件存在且属于 loopx,继续验证备份成功及后续恢复。 我独立构建并安装精确 head 的 wheel,父进程读取源码、子进程读取安装包;相同环境的旧版本 14 项失败、4 项通过,head 的 18 项恢复测试与55项定位测试共73项通过。 本次只修复既有测试的包路径判断,不修改备份、导入、租约、历史回放或运行权限;本机验证没有覆盖 Linux/Python 3.11 的完整工作流,也没有操作真实在用 Goal。
改动思路
复用既有 backup 测试 helper,纠正源码路径必须等于安装路径的错误假设,并保留返回码、JSON成功、归档字节、历史无新效果和后续写入断言;不增加生产兼容分支或另一套测试。 工作流已经从当前 checkout 构建并按哈希安装 wheel;测试只需接受真实安装位置,不应把父进程源码位置当子进程唯一合法位置。 完整边界是既有恢复测试 helper 的 provenance 判断维修,生产状态和恢复行为没有改变。
具体改动
完整差异仅 tests/control_plane/test_cold_source_disposition_e2e.py 的 backup() 第121–125行,+4/-1。第111–120行仍通过同一 sys.executable 在隔离目录启动真实 CLI,首先输出 loopx.__file__。现在读取 stderr 首行并确认文件存在、文件名为 __init__.py、父目录为 loopx;第125–130行继续要求退出码0、有效JSON及 ok=true。
独立依据是修改前已有的 .github/workflows/python-tests.yml,修订 4bdcb2eeed64582b99cfc46b213ed755839a69b8,stage2c-suite:从 checkout 构建 wheel、计算SHA256并带哈希安装,再执行目录外真实 CLI、进程死亡和恢复用例。该工作流提供“当前源码包”的来源约束,helper 的文件形状检查并不单独证明版本身份。PR不修改工作流。File/SQLite 源、原生产写入进程、缺失四个原 producer 的接收端、租约先释放、未证明原操作的拒绝、归档字节及后来写入/重放断言全部保留。
对主干的风险
我按不可变 merge-base f098fbe7ee44eba22ddc99dea34245ea8123dd89 对照全量 PR,而不是把后来 main 的其他差异算入此 PR。两端生产目录与 pyproject blob 完全相同,使用同一精确 head wheel、同一测试 fixture,仅各自测试源码不同。旧版14次错误拒绝安装包路径;head完整恢复18项加定位55项共73项通过(74.74秒),Ruff与diff check通过。测试由源码目录的父进程调用,目录外子进程实际读取安装包,未通过 editable 安装或 source PYTHONPATH绕过问题。
准备时第一次构建缺少Chat bundle,补做真实bundle后wheel构建安装成功;第一次测试命令写错locator文件路径,exit4未执行测试,随后改为正确路径完成上述验证。保留这两次失败,不算作产品失败或通过。当前环境为macOS/Python3.14.8,Linux/Python3.11完整分片、xdist及独立sdist全套未测;没有查询或等待CI。现有工作流来源校验若失效,文件形状本身不足以识别错误发行包,这是保留的边界。
我的整体评价
APPROVE,无阻塞发现。贡献者可以再次通过正确的安装包运行方式验证恢复;长程行为保持,实际测试仍检查历史无重复效果和后来可继续写入。复用现有helper与wheel来源owner,相关维护性检查没有发现需要额外抽象的地方。批准覆盖这个既有测试维修,不证明完整Linux工作流、真实线上迁移或整个产品验收,也不授予合并权限。
English verdict: APPROVE - head ac2af0f. The existing helper incorrectly required the installed child package path to equal pytest source provenance. With the same built wheel and fixture, immutable base fails 14 cases at that assertion; exact head passes 18 real recovery cases and 55 locator cases. Build/hash workflow provenance and original success/history/continuation assertions are retained. Ruff and diff checks pass. Exact Linux/Python 3.11 shard remains untested; CI was not consulted.
Goal And Delivered Outcome
backup()runs outside the checkout withoutPYTHONPATH. The Stage 2C lane installs the checkout wheel first, so the subprocess correctly imports that wheel while pytest imports the checkout source.loopx/__init__.pyfrom the installed package, and all 18 cold-source cases pass with separate checkout and installed-copy import paths.main.Author Declaration
Implemented against
.github/workflows/python-tests.ymlatac2af0f90bafaec6340ac8095c99d262040e67ceare the basis.PYTHONPATH.tests/control_plane/test_cold_source_disposition_e2e.py::backuppython -m pytest -q tests/control_plane/test_cold_source_disposition_e2e.pytests/control_plane/test_cold_source_disposition_e2e.py::backupmain. The exact Linux wheel lane remains for GitHub Actions.Scope And Continuation
Validation
ac2af0f90bafaec6340ac8095c99d262040e67ceintegrationpassedpython -m pytest -q tests/control_plane/test_cold_source_disposition_e2e.py; 18 passed with separate checkout and installed-copy package paths.staticpassedpython -m ruff check tests/control_plane/test_cold_source_disposition_e2e.py.unitpassedpython -m pytest -q tests/control_plane/test_shadow_mutant_locators.py; 55 passed after resolving the parallelmainupdate.regression_paritypassedFrontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).