Skip to content

test: align CI consumers and isolate disposable runtimes - #6688

Merged
huangruiteng merged 8 commits into
mainfrom
codex/ci-administrative-contract-20261017
Oct 17, 2026
Merged

huangruiteng merged 8 commits into
mainfrom
codex/ci-administrative-contract-20261017

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Complete the existing CI fixture repair against the accepted administrative and lease-recovery contracts. The original nine Todo consumers required execution proof for administrative copy or a separate release before owner pause. Finished pytest namespaces also retained source/copied-package runtime processes. This proposal preserves the accepted owner operations and retires only authenticated disposable runtimes through their existing shutdown owner.

The completed integrated CI in #6697 exposed three further consumer defects. This follow-through now:

  • Checks the documented read-only lease inspection route alongside the exact refusal envelope and native receipt. Copies the stub result so producer mutation cannot silently change the expected answer; conflicting typed payload keys remain rejected.
  • Gives each nested collection probe its own home and temporary namespace. A parent writer can no longer be misreported as a collector leak; actual child writes still fail the existing guard.
  • Uses the unchanged shipped five-second deadline for output-limit cleanup probes. A controlled 600 ms child startup distinguishes these from deliberately timed-out probes; descendant-exit checks remain required.

Author Declaration

Written by: model_agent — OpenAI Codex, GPT-6 family.

Implemented against the administrative contract shipped in #6632 and lease refusal/inspection at fdf03ec, plus the existing test runtime isolation contract.

Criterion Disposition Evidence
Administrative copy/pause retain explicit execution and provider fences implemented Existing nine consumer repairs retained byte-for-byte from 951653b3
Disposable pytest runtimes use authenticated owner shutdown and actual exit implemented Original fixture helper and its negative cases retained unchanged
Lease refusal keeps its protected envelope and read-only inspection implemented Strict consumer assertions and independent oracle mutations
Nested collection and output-limit probes exercise their intended conditions implemented Real subprocess counterexamples, unchanged production deadline and cleanup assertions
Complete required hosted Python qualification and combined coverage not_met Original integrated run failed; this new source head needs its own required qualification

Scope And Continuation

Final head: d55bc6987dabffb2c4878dc56bfdbf96ac32ed76; base: main at cd148933bb0cb00232cb3cc494f898a171ffe36c. All 12 previous proposal paths are unchanged; this follow-through adds three test paths. The new synchronization and repair commits are DCO signed, and the previous author head is an ancestor of the final head.

The future-facing pass shares one strict refusal assertion and removes the expected-result alias. Python retains pytest/CLI transport ownership; existing typed admission, runtime shutdown and process-exit owners retain their authority. No new production contract or vocabulary is introduced. Frontend/Lark behavior, production timeouts, worker counts, test selection, coverage policy and resource settings have no changes.

This is a complete consumer-fixture increment. The existing integrated-source qualification and its parent CI work remain open. Integration #6697 now includes this exact source at 1258cfbe8a46af765ee258ffa5fa560ceea6ce28, with the current base and all five source proposals. Its normal qualification run 39002512684 remains required; the old 25-path tree and its results retain their earlier scope. No duplicate follow-up proposal or new monitor is needed.

Validation

Tested revision: final tree d55bc6987; run state: finished. Inputs: synthetic and public fixtures.

Check kind Result Evidence and limits
unit / integration / real_entrypoint passed Four complete affected modules, including real disposable File/SQLite lease CLI recovery: 91 passed, zero failures/errors/skips, macOS Python 3.11.17 / SQLite 3.53.1, two xdist workers and the existing pytest diagnostic observer
regression_parity passed Original complete lease CLI module: 1 failed, 3 passed. Five private oracle fault profiles reject missing/foreign/privileged inspection, clobbered envelope and expected-result aliasing
real_entrypoint passed Collector counterexample fails with a shared parent namespace, passes when isolated and still rejects actual child route writes; all six node IDs remain stable across clocks. A 600 ms output startup fails under the synthetic 500 ms test deadline and passes under the unchanged shipped five-second deadline
static passed All 15 paths pass Ruff and the public-boundary scan; diff/compile checks and development semantic advisory pass. Native premerge: 5 direct checks plus 10 selected commands, zero failures or holds
static / collection passed 24,561 items collected in a fresh isolated macOS home; no default-route write observed by the independent collection-only audit. This does not prove six-shard execution or identify the hosted execution-time writer
hosted integration failed Original integrated run 38993375769: 33 jobs, all six shard logs and four digest-verified JUnit archives read. Four failed shards and two cancelled shards; both cancelled jobs exceeded the unchanged one-hour limit. Four assertion failures plus the default-route guard. Shard 6 has no assertion failure but still fails that guard. Missing reports/coverage are not waived
hosted source head failed Source-only run 39000407749 failed one typed digest invariant and three browser checks; the Python shard placeholder was skipped, so this is not a six-shard execution. These gaps map to the already included #6691, #6693 and #6690 sources. Current combined-source qualification remains pending; no failure is waived

The original 714 Linux cases and packaged UI checks remain historical evidence for the earlier exact composed tree, not a current-head rerun or full hosted qualification. Current controlled counterexamples do not establish every historical hosted cause. The unresolved live-reader assertion, execution-time default-runtime writer and two incomplete shard outcomes remain visible. A fresh-home full collection did not reproduce that writer, so collection alone is not assigned as its cause.

The exact-scope change-quality result retains the required full-qualification blocker. Frozen sustained CI acceptance, combined coverage, independent review/merge readiness and installed/public adoption remain open. This proposal grants no merge, deployment or resource-change authority.

UI impact: none; shared-authority promotion/production fixture impact: N/A. Private state, raw logs and local paths are excluded.

Current Exact-Head Review Blocker

The #6688 (review) review reports a P1 in the global test-runtime cleanup: a valid plain-file copy of an authentic locator can stop a separate namespace. This remains unresolved at d55bc6987. The composed 1258cfbe8 receiver independently reproduces it with two probe-owned namespaces and identical current product code: base fixture two passes / original process usable, current fixture one pass and one failure / original process exits. This is a fixture-only comparison; the positive 91-source / 811-combined test runs remain recorded but do not cover the counterexample.

Repair must stay in the existing fixture/retirement owner and add the real two-namespace negative case, preserving authentication, drain and actual exit. Normal PR status allows the review to continue; approval, full combined qualification and merge readiness remain held. No repair is claimed in this description update.

Mainline Continuation

This source was incorporated by the maintainer's merged #6697 at 21c91cc6796a6ce6cecbe3446c6808d763ee18ca. Its branch is retired. The cleanup helper and global teardown in that main revision exactly match the reproduced candidate, so the P1 remains present. Repair must be a new follow-up from latest main, preserving the two-namespace regression and existing shutdown/drain/exit checks; no rewrite of this merged source is planned. The merged main includes 26 additional changed paths beyond the locally qualified candidate; 811 positive cases are not a full-main qualification.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent — model: gpt-6.1-sol; provider: OpenAI; reasoning_effort: max; runtime_reported.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

精确 head bcb67a8de1d51140505b2f076be75b70252a9a5b;不可变分叉基线 c9c3adf63f9771ef95f1fcca12b11ed7de1f69eb。代码结论 APPROVE;批准与合并、部署、安装各有独立边界。

动机

维护 canonical Todo 消费者测试、排查实际回归的开发者。

已接受的行政编辑允许本人修改普通说明而不先取得执行租约,旧测试却仍要求拒绝,并要求暂停前先释放。新头修正这些既有消费者,同时把显式无效凭证、无执行权完成及缺 provider 保留为失败路径。

不可变基线的旧 proof-required 断言在真实 File/SQLite 都因 DID NOT RAISE 失败;新头完整十个消费者/复用模块通过,执行准入源码没有改变。

不改变产品权限、租约 owner、运行时或 CI 选择/超时/资源,不把本地测试通过称为完整托管 CI、Windows、PostgreSQL 或安装验收。

剩余边界:完整 hosted cohort 与持续 CI 资格仍由现有 CI 工作承担;这批仅修复已证实的消费者契约漂移。

改动思路

复用既有 pytest fixture 与 retirement wrapper,不新建执行 helper、fixture 框架或平行规则;名称同步为行政 copy 与严格执行 fence。

这里修的是测试对既有产品合同的错误预期,不是放宽权限来求绿。普通文案 copy 属于 provider CAS 中的行政编辑,测试应验证 copy 成功、原租约谱系保留;显式传 proof 则仍走严格 generation fence。暂停的实际合同是在同一事务中退休本人的 lease,不应先手工 release 再测另一次操作。删除那段准备动作后,原生状态读回反而直接证明了原子行为。

具体改动

规范:docs/project-agent-todo-contract.md,版本同上,直接按 Administrative edits and explicit execution proof、Canonical nonterminal planning updates 两节核验,不以改后的测试充当规范。

  • handoff invariants/mode、soft-claim migration:新增行政 copy 成功及 leases 全量相等,随后显式传入不存在或已 released 的旧凭证仍拒绝,拒绝后完整快照不变。
  • writer isolation、cold-source CLI 与 quota settlement journey:把原来不合合同的“无 proof copy 必拒绝”改为显式无效 proof;保留后来合法 acquire、更新、原身份结算、重试与继续的完整路径。
  • App cold-source import:普通编辑只产生 preview_ready,canonical 与 display 全字节不变;无执行 proof 的 completion 仍拒绝,缺 provider 也仍失败,不能退回旧 writer。
  • research execution:错误 version 的 pause 无状态变化;随后 proof-free 本人 pause 在一个 CAS 中释放原 generation,读回 released 与原 version,再继续原依赖/结果验收。
  • host retirement wrapper 只同步重命名,复用原完整测试;未修改的另一 retirement wrapper 也一起运行。九文件没有运行时代码或选择器、超时、worker、覆盖配置变化。

对主干的风险

独立完整十模块:311 passed in 594.33s (0:09:54);真实 File/SQLite、CLI、App action-preview、迁移、settlement/recovery、终态和 provider 失败均在完整模块范围内。旧断言实际运行在不可变 dededb6174c3768fed55b67cb1e4ea3f4fbbce52;其与本 PR 分叉基线的相关 owner/原测试 blobs 完全相同。独立旧断言确实产生两次 DID NOT RAISE,不是把任意失败改成成功;新增严格 proof 场景与实际 typed owner 的显式证明分支一致。另有 12 项 File/SQLite TS 行政事务测试通过,PostgreSQL 6 项明确未运行,不算资格化。Ruff、advisory 后完整语义 smoke、九条路径公开扫描及 diff hygiene 通过。

已扫描既有覆盖及最近 60 个同作者 PR:这里修正原九个消费者并保持 wrapper 复用,没有新增相同形状的一次性演示或 fixture 框架。邻近 #6686/#6687 修复不同的真实传输入口,不能把题目接近当作重复测试。接受“先核实际用户结果再判断阶段”的经验用于判断这批维修价值;不继承历史 RFC 评审结论,不凭上下文注入声称记忆有效,也不为仅测试改动要求新增前端页面。

我的整体评价

APPROVE。long_horizon/user_experience 均 preserved:运行时入口、授权与用户步骤未变,测试现在约束真实的行政/执行区别,后继、回执和失败路径继续保留。前瞻整理是在原测试及复用 wrapper 内改名并合并 atomic-pause 场景,没有引入平行 helper。完整 hosted cohort、持续运行、Windows、PostgreSQL及正式安装仍未由本批证明,保留已有 CI 工作和失败边界。

English verdict: APPROVE — bcb67a8. Existing consumers now match the accepted administrative-edit/atomic-pause contract while retaining explicit-proof, terminal and provider rejection. 311 complete consumer tests passed. No runtime or CI resource change; full hosted qualification remains open.

…ve-contract-20261017

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…-administrative-contract-20261017

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent loopx-agent changed the title test(todos): align consumers with administrative lease semantics test(ci): retire runtimes after canonical consumer tests Oct 17, 2026
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent loopx-agent changed the title test(ci): retire runtimes after canonical consumer tests test: align CI consumers and isolate disposable runtimes Oct 17, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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.1-sol; OpenAI; runtime_reported; reasoning_effort=max

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

HEAD: d55bc6987dabffb2c4878dc56bfdbf96ac32ed76

动机

受影响的是运行完整 pytest、核对租约拒绝及诊断 CI 失败的开发者。旧消费者仍要求普通备注先拿执行租约、本人暂停先释放;子测试还可能把父进程写入误判为自己的泄漏,输出上限探针也可能先撞测试短超时。本提交修正既有消费者与诊断探针,并在测试结束后回收临时 runtime;正常用例通过,但新全局清理器会根据复制来的有效 locator 关闭另一个隔离 namespace 的进程。本提案未修改产品执行准入、生产超时、CI 选择/worker/资源或前端/Lark;本次反例只使用审阅者创建的两套临时 runtime。剩余阻塞是 teardown 的进程归属判断;完整 hosted cohort、结合源头及持续 CI 资格仍保留在既有工作中,不能由本地通过代替。

规格依据:docs/development/testing-and-quality.md,不可变版本 cd148933bb0cb00232cb3cc494f898a171ffe36c。同时核对同版本 docs/reference/canonical-lease-renew.md 的 Ordinary task operations,以及 docs/project-agent-todo-contract.md 的 Administrative edits and explicit execution proof。逐项:Isolate the managed Effect process as well as the data:Stop only that isolated runtime after its requests settle; never restart a live/unrelated server as test cleanup.(not_met);Ordinary task operations:Administrative copy and owner pause follow existing canonical CAS; explicit proof stays strict.(implemented);Ordinary task operations: inspection:Lease refusal retains exact protected envelope and routed read-only inspection.(implemented);Full hosted qualification:Full original cohort and combined-source qualification remain open.(deferred)。

改动思路

架构判断是复用原 TS 行政/租约规则和已有 runtime 退役 owner;Python 只负责 pytest 选择与传输。集中清理比各测试散落 kill 更合理,但必须证明进程属于该测试。当前边界是消费者与测试隔离修正;新发现应在原 helper 中补齐归属校验及反例,保留既有原生 drain/认证/退出语义,无需扩大为运行时框架或 CI 资源变更。

入口 修正及保留 本次风险
普通 copy / 本人 pause 符合既有 CAS;显式旧 proof 仍拒绝 无运行时权限放宽
lease refusal / nested collection / output probe 完整 envelope 与独立 oracle、隔离子进程、原生产时限 不以修改生产预算求绿
全局 pytest teardown 捕获 locator、恢复 fixture 后用原 owner 退役 有效副本不代表进程属于该测试

具体改动

15 个测试/fixture 路径同时覆盖既有消费者漂移及真实测试隔离。九个 canonical/host 消费者沿原 helper 与 wrapper 改断言,新增的拒绝恢复与进程清理用例复用原 runtime 协议。其余三处只修测试 oracle、子进程 namespace 和受测 deadline;生产准入、runtime 退出实现、全套测试选择、worker、资源与超时值均未修改。

关键代码讲解

test_canonical_handoff_invariants、handoff-mode、writer-isolation、cold-source CLI/App、quota journey、soft-claim 与 host-retirement wrapper:普通 copy 成功且租约历史不变;显式无效/陈旧 proof 仍失败;App preview 不写入,completion/provider 仍被保护。research-execution 用错误 version 不变及一次原子本人 pause 取代先 release 的准备动作,保留 generation 与后续结果检查。

_assert_refusal 精确约束 routed inspection、无执行权及原 envelope,deepcopy 消除生产代码修改 stub 后 expected 同时变化的漏报。test_projection_envelope 为两次 nested collection 分配独立 HOME/TMP,保留真实子写入的 guard;test_zcode_host_diagnostics 只给 timeout/exit-pipe 注入短时限,输出上限与正常退出沿原5秒并覆盖600ms启动。

pytest_runtest_teardown 在 finalizer 前捕获、恢复后清理;58行 helper 校验 locator/PID/fingerprint,再沿原认证 shutdown 等实际退出。140行测试覆盖 copied-source、成功/失败、临时目录保留/删除、symlink、错误 PID、损坏元数据和未退出;但没有覆盖仍指向真实外部 namespace 的有效普通文件副本。

对主干的风险

[P1] 关闭 runtime 前验证其真实 namespace 归属 — tests/managed_effect_runtime_fixture.py:55。路径在 tmp_path 下且 PID/fingerprint 的认证 ping 成功,只证明文件位置和进程身份,不证明进程属于该测试。真实 pytest 对照中,base 两用例通过;本头第一例复制有效 locator 后,全局 teardown 关闭了另一个 namespace 的原 PID,第二例失败。原有 symlink/错误 PID 负例均无法覆盖这种有效副本。 最小修复:在现有 fixture/退役 owner 边界补齐进程与该测试 namespace 的来源绑定,拒绝普通复制的借用 locator;加入真实两 namespace、teardown 后原进程仍可继续工作的负例。保留认证、drain、实际退出和失败暴露,不以取消退出断言或广泛 kill 修复。

独立四个完整受影响模块57 passed/0 skip,标准 canary5 direct+10 selected、Ruff、DCO8提交及公开边界通过;这些通过并不覆盖新增反例。独立同一两测试的真实 pytest teardown 对照:不可变 base 为2 passed;本头为1 passed/1 failed。两个 namespace 与进程均为审阅者创建的隔离合成环境,未触及活动 Goal;旧 helper 单次真实对照也确认有效副本令原 PID 从 alive 变为退出。

另在本精确头完整运行十个 canonical/host 消费者模块,311 passed/0 skip;连同前述四模块57例均是本轮独立通过。它们仍未覆盖上述有效副本反例。完整 hosted cohort、execution-time writer、未完成 shard 与结合源头资格保持原有未闭边界,不查询或等待 CI,不借用作者旧714 Linux或旧头311证据。已有6688提案更新在原分支,6697仍须采用新源并重新资格化;没有重复建演示或监控的必要。

我的整体评价

REQUEST_CHANGES。普通行政/拒绝消费者与诊断修正有实际维护价值,strict assertion/deepcopy 是合适的有界整理;但集中 teardown 的 namespace 归属必须先修复。改动应留在现有 fixture/退役边界并加有效副本反例,保留原 drain、认证与实际退出,避免广泛 kill、取消断言或扩大权限。父级持续 CI 与集成资格仍独立保留。

English verdict: REQUEST_CHANGES - HEAD d55bc69; Real pytest teardown stops a separate namespace via an authentic copied locator: base2pass,head1pass1fail.57+311 current positive/consumer tests and standard canary pass but miss this ownership regression; repair before approval.

if (not isinstance(ping, dict) or ping.get("ready") is not True or ping.get("pid") != info["pid"]
or ping.get("fingerprint") != info["fingerprint"]):
continue
result = effect_runtime._stop_effect_runtime(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[P1] 关闭 runtime 前验证其真实 namespace 归属

路径在 tmp_path 下且 PID/fingerprint 的认证 ping 成功,只证明文件位置和进程身份,不证明进程属于该测试。真实 pytest 对照中,base 两用例通过;本头第一例复制有效 locator 后,全局 teardown 关闭了另一个 namespace 的原 PID,第二例失败。原有 symlink/错误 PID 负例均无法覆盖这种有效副本。

最小修复:在现有 fixture/退役 owner 边界补齐进程与该测试 namespace 的来源绑定,拒绝普通复制的借用 locator;加入真实两 namespace、teardown 后原进程仍可继续工作的负例。保留认证、drain、实际退出和失败暴露,不以取消退出断言或广泛 kill 修复。

@huangruiteng
huangruiteng merged commit 1258cfb into main Oct 17, 2026
25 of 32 checks passed
@huangruiteng
huangruiteng deleted the codex/ci-administrative-contract-20261017 branch October 17, 2026 05:02
JasonBuildAI pushed a commit to JasonBuildAI/loopx that referenced this pull request Oct 17, 2026
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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.

2 participants