Skip to content

fix(ci): accept installed Stage 2C backup provenance - #6040

Merged
huangruiteng merged 2 commits into
mainfrom
codex/fix-stage2c-baseline-contracts
Oct 10, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/fix-stage2c-baseline-contracts

Conversation

@Duang777

@Duang777 Duang777 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Stage 2C wheel qualification failed because the test required a subprocess to import LoopX from the same path as the pytest process.
  • Goal/source and gap: backup() runs outside the checkout without PYTHONPATH. The Stage 2C lane installs the checkout wheel first, so the subprocess correctly imports that wheel while pytest imports the checkout source.
  • Observable before and after, with the validation row that proves it: The public CI baseline failed 14 cases at the path-equality assertion. The final head accepts an existing loopx/__init__.py from the installed package, and all 18 cold-source cases pass with separate checkout and installed-copy import paths.
  • Issue/task and intended base: No issue. Base: main.

Author Declaration

  • Written by: model_agent (OpenAI ChatGPT)

Implemented against

  • Specification and revision: No written specification; the reproduced Stage 2C failure and the workflow contract in .github/workflows/python-tests.yml at ac2af0f90bafaec6340ac8095c99d262040e67ce are the basis.
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
The backup subprocess runs outside the checkout without a source PYTHONPATH. implemented tests/control_plane/test_cold_source_disposition_e2e.py::backup python -m pytest -q tests/control_plane/test_cold_source_disposition_e2e.py
Provenance checks accept the installed wheel while rejecting a missing or malformed package path. implemented tests/control_plane/test_cold_source_disposition_e2e.py::backup The same test file passes with pytest importing the checkout and the subprocess importing an installed copy.
  • Self-check before submission: Read the Stage 2C workflow and the full affected test. Ran the cold-source file with distinct parent and child package locations, Ruff, and the locator tests added by current main. The exact Linux wheel lane remains for GitHub Actions.

Scope And Continuation

  • Completed scope and remaining work: Complete within this scope. The assertion now checks the imported package artifact instead of requiring source and wheel paths to match.
  • Slice boundary / successor: N/A. Production behavior is unchanged.

Validation

  • Tested revision: ac2af0f90bafaec6340ac8095c99d262040e67ce
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
integration passed python -m pytest -q tests/control_plane/test_cold_source_disposition_e2e.py; 18 passed with separate checkout and installed-copy package paths.
static passed python -m ruff check tests/control_plane/test_cold_source_disposition_e2e.py.
unit passed python -m pytest -q tests/control_plane/test_shadow_mutant_locators.py; 55 passed after resolving the parallel main update.
regression_parity passed Public baseline job failed the 14 affected cases at the source-versus-wheel path assertion. The final head passes all 18 cases under distinct package paths.
  • Coverage and gaps: The changed helper is used by every affected backup flow in this test file. GitHub Actions will run the exact Linux wheel build and Stage 2C shard.

Frontend / Visual Evidence

  • UI impact: none
  • Before: N/A
  • After: N/A
  • States and viewports shown: N/A
  • Source data: none
  • Attention review: N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference, when applicable: N/A

Shared-authority RFC fixture impact

  • N/A. This PR changes only the Stage 2C package provenance assertion.

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

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 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: 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.

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