Repository navigation
fix(ci): restore test isolation and let main qualification complete - #6833
Conversation
The session readback endpoint invokes runtime recovery before returning its snapshot. Build the existing fixture with the real controller and the same store and registry, preserving corrupted-receipt, retry, and no-reexecution assertions. Existing server_close owns controller cleanup. Signed-off-by: song <22676124+songoow@users.noreply.github.com> Signed-off-by: song <liusongstep@gmail.com>
Launch the quota observer with Python safe-path mode so an unrelated loopx cache or package in the detached working directory cannot shadow the installed observer. Preserve explicit source paths, consent, detachment, and best-effort semantics. Exercise the real Python-to-TypeScript path under both namespace and regular-package pollution, and scope mocked worker materialization to its owning test. Signed-off-by: song <22676124+songoow@users.noreply.github.com> Signed-off-by: song <liusongstep@gmail.com>
…ain runs Run existing repository invariants and Ruff before the source bundle admits expensive matrices. Keep runtime contracts mandatory, let bounded Python shards overlap browser and TypeScript checks, and retain full diagnostics only for scheduled or manual static failures. Preserve fail-closed aggregates, documented exemptions, shared shard capacity, and obsolete PR cleanup. Retain the active main candidate and only its latest pending successor. Signed-off-by: song <22676124+songoow@users.noreply.github.com> Signed-off-by: song <liusongstep@gmail.com>
Use the existing UTF-8 file-input contract when loading the owner-prepared source manifest. Preserve Unicode labels under legacy host locales while retaining strict decode failures before server startup, JSON validation, and read-only source behavior. The existing repository-wide text-I/O guard covers this regression. Signed-off-by: song <22676124+songoow@users.noreply.github.com> Signed-off-by: song <liusongstep@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Signed-off-by: song <22676124+songoow@users.noreply.github.com> Signed-off-by: song <liusongstep@gmail.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max
动机
维护者需要让一次完整 CI 得到可信的资格化结果;同一进程环境中的后台观察者和只读工作区也应使用正确的包与编码。 基线中真实 HTTP 测试缺少运行控制器,临时目录里的同名包会截获后台观察者导入,ASCII locale 又拒绝有效中文来源清单;另外新 main push 会取消正在执行的资格化。当前修复这些具体故障,把便宜静态检查放在构建前,并保留正在执行的 main 与最新待运行后继。
当前 head 增量的 Windows 实际选择器在本机 9 项通过,四个受影响 CI 模块 695 项及 1,868 subtests 通过,当前 standard 的 6 direct/18 selected 实际执行全过。先前 148 项、709 项及普通包证据仅在全部生产、前端和依赖字节不变的核验下复用;本机模拟不当作原生 Windows 通过。
本评审不宣称完整 hosted CI、原生 Windows、运行中 main 的实际后继调度或端到端吞吐已经通过,不修改 live ruleset、派发工作流、启用统计或授予合并权限。
原生 Windows、完整 hosted 分片/coverage/最终门禁和 main 采用仍未资格化;本机质量凭据 missing,digest 架构 guard 在 base/head 均同样失败,独立集成门保留。
改动思路
复用现有控制器装配、TypeScript 统计权威、CI classifier/verify-core 和 bundle owner;Python 只修子进程导入与文本 IO,CI 只调整有界调度与必需 lane 接线,无需另一套观察状态或准入系统。 这一组合 PR 交付五个可分别回退的原因修复:HTTP fixture、后台导入隔离、CI 准入/取消策略、UTF-8 清单与现有 Windows 长路径夹具/选择器;源测试、实际 CLI 和普通安装包验证其有用本地结果,托管采用另列。
CI 先让既有 classifier 判断整份不可变 diff,再做静态准入、构建及各必需 lane;最终 checks、pytest、merge-gate 继续拥有资格判断。来源编码、后台进程和 fixture 各自只修实际 IO 边界,没有让观察统计决定 Goal 工作,也没有新增用户导航、重复输入或确认回合。失败仍指向应修的原 lane;手动诊断是既有可选调查路径。
| 情形 | 当前行为 |
|---|---|
| 全量普通 PR、main push、merge group 的静态失败 | 不准入重型构建;最终资格仍失败 |
| 定时/手动全量静态失败 | 可继续诊断;最终资格仍失败 |
| 合法纯前端或文档豁免 | 保留原职责与显式 skipped;缺失不等于豁免 |
| main 正在运行时又有 push | 保留活动候选,只保留最新待运行后继 |
表格来自本 head 的源码与官方表达式语义,是流程说明;本地测试不证明 hosted 实际调度。
具体改动
精确 head 3be13d26cbb83bdfb9243c6f50806f977c595684,实际 merge base d6de821eb3abfd24184a849a7d0bf9ddd7ca2c6b,15 files +370/−132。主要规范为不可变 CI 职责与资格化契约,revision d6de821eb3abfd24184a849a7d0bf9ddd7ca2c6b;后台统计还核对同 revision 的 披露、撤销及观察范围。
Six complete Python shards— implemented:.github/workflows/python-tests.yml:test-shard/pytest; whole collection, 6 slots/2 workers, six nonempty coverage files, floor19.6 unchanged.Override and evidence— implemented:review_gate.py CHECK_OUTPUT/_verify, new kernel-contracts dependency and existing final aggregates.Resource cadence and supersession— implemented:Workflow concurrency retains event/PR groups; main cancellation and shard admission are deliberate proposed policy changes, not baseline equivalence. Required qualification and public-release workflow unchanged.Hosted qualification— deferred:Existing natural CI and maintainer qualification owner; keep Windows/full gates and main adoption gaps, no new ceremonial task.
关键代码讲解
新头仅在已验证 bdb 基础上增加三路径的长路径夹具/选择器修复;全部生产、前端、依赖和 setup 字节核同。原148/709/Node9与普通包执行保留其原 revision,不把复用说成新头重跑。当前受影响CI四模块695/1868、选择器9及standard6direct18selected已实际重跑。
-
workflow:110 把依赖锁、根模块预算和原 Ruff 范围移到构建之前;File authority、mypy 与 CLI budget 留在
kernel-contracts。Python 不再等待完整浏览器/TS 汇总,但仍为六个仓库级槽位、每片两个 worker、原完整 collection、全部 coverage 文件和 19.6% 联合门槛。所有剩余必需项仍进入最终汇总,没有用 scheduling 调整删除资格。 -
CHECK_OUTPUT / _verify在原 exact-key 校验中登记kernel-contracts。实际 CLI 正确集合成功,failure、skipped、cancelled、missing 四种输入均拒绝;本 PR 修改 CI 自身,实际分类结果也是 full,不能靠文档或标题获得豁免。 -
observe_quota_cycle只为原 Python child 添加-P,排除临时 cwd 的包优先级;项目最低 Python 已为 3.11。原PYTHONPATH、绝对 caller paths、detach flags、consent/generation、TS 聚合和 best-effort 主路径不变。新 fixture 隔离真实 materialized cache;namespace 与会执行代码的 regular package 两类原断言在 base 都失败,在源与普通包均通过。 -
runtime_workspace.main仅把来源清单 codec 固定为 UTF-8。真实 ASCII locale 且关闭 UTF-8 mode 时,base 报 UnicodeDecodeError;head 和普通包默认 bundle 入口都保留两个中文标签、完成两个实际 loopback 资产读取。坏 UTF-8 仍在建服务器前拒绝。HTTP receipt fixture 使用真实 controller,原坏状态、repair/retry、单次返回、原 turn 和禁止外发断言全保留。 -
当前长路径 fixture 在 Windows 使用现存 native temp,必要时仅向上选择能放下随机子目录的祖先;断言仍是实际128字符完整根与原完整命令预算,TemporaryDirectory只清理自身子目录。新增短/嵌套模拟和原生Windows选择器 guard 已纳入本机9项选择器和695项CI执行;这些仍不证明 Windows 文件系统本身。
对主干的风险
macOS / Python 3.12.15:十模块 148 pass、CI Python 709 pass/1888 subtests、Node 9 pass、kernel 7 pass、required Ruff 和 mypy17 pass。Goal-bound standard premerge 6 direct/18 selected 实际执行全部通过,外层仅质量凭据 missing 未过。普通 wheel 非 editable 安装,15 个相关 owner 与 head 字节一致;21 个已执行包测试通过,另一个 source-layout mock 失败如实保留,实际默认包入口和复制 bundle 完整性负例另行验证。 基线原 HTTP 两例 RemoteDisconnected/缺 runtime_controller;原断言与 deadline 的新同名包两例在基线都失败,全部产品模块来自 base。ASCII/UTF8-mode-off 下 base 拒绝有效中文清单,head 与普通包默认入口保留两标签、两实际 HTTP 资产读取;两边拒绝坏 UTF-8。实际 verify-core CLI 对 kernel-contracts failure/skipped/cancelled/missing 均非零拒绝,正确集合通过。
语义与 CI 对齐
另独立执行 digest 架构 guard:base/head 均1 fail,同 checkpoint_retention 与 runtime_workspace 两处相同字面量;guard/checkpoint全文件与workspace对应regex均未被本PR改变。保留该 required 失败和作者正在准备的第六修复,不把计划、取消的旧分片或其他绿项当完成,也不要求本头的无关编码修复冒领该结果。
这是明确的调度策略变化:旧规范写的是 Python 等待 checks、main push 取消活动验证及更广的非 PR 诊断;新方案不是这些条款的逐句等价,而是有界替代。六槽资源上限和全部硬资格不变,代价是稍后 TS/浏览器失败时 Python 可能已运行,main 最新结果也要等活动候选。新增 lane 属于现有 CI-local vocabulary,不是新的 LoopX 状态、授权或 quota 规则。
GitHub concurrency 文档 支持 single-pending 的替换语义;状态函数文档 说明没有状态谓词时隐含 success()。因此下游保留 !cancelled(),并显式要求直接 prerequisite 成功,防止诊断因祖先失败被默默丢弃;这不是 always 无条件放行。
普通包原测试是 21 pass、1 个 source-layout mock failure:该 mock 在调用真实 guard 前要求 site-packages 下存在开发仓库清单。保留该失败,不删断言或改计数;实际默认安装入口另行通过,真实安装 guard 也拒绝完整 bundle 的临时副本中被改坏的 index,原包未动。它不表示源布局测试在包内通过。
作者披露的 Linux 两次 120 秒 wrapper 超时和 Windows 长路径夹具失败均保留;本机 standard 实际18项通过不重写其历史原因。Windows 夹具在本 base/head 字节相同,我未运行原生 Windows、抓取或等待 CI,也未把作者的 hosted readback 算作自己的通过。质量凭据 missing 仍是独立合并限制。所有外部身份/container backend/模型均未作 live 验收;本地 HTTP 和后台统计仅使用隔离合成数据。
我的整体评价
当前代码结论 APPROVE,作为可独立回退的 justified_increment:已复现并修复的本地 caller 故障有真实结果,完整托管采用仍未资格化。复用现有控制器装配、TypeScript 统计权威、CI classifier/verify-core 和 bundle owner;Python 只修子进程导入与文本 IO,CI 只调整有界调度与必需 lane 接线,无需另一套观察状态或准入系统。 这一组合 PR 交付五个可分别回退的原因修复:HTTP fixture、后台导入隔离、CI 准入/取消策略、UTF-8 清单与现有 Windows 长路径夹具/选择器;源测试、实际 CLI 和普通安装包验证其有用本地结果,托管采用另列。
long_horizon=accepted_tradeoff:允许当前 main 完成、保留最新后继,同时诚实承认重叠算力和等待代价;不从结构或测试数推断 hosted 净收益。user_experience=improved:原 HTTP 恢复、后台 observer 和有效中文清单无需额外准备回合即可工作,原范围与停止边界保留。现有 owner 和五个原因提交足够清晰,没有需要在本切片新增的锁服务、缓存、状态机或泛化抽象。原生 Windows、完整 hosted 分片/coverage/最终门禁和 main 采用仍未资格化;本机质量凭据 missing,digest 架构 guard 在 base/head 均同样失败,独立集成门保留。 评审不授予 merge、dispatch、安装或 live ruleset 权限。
English verdict: APPROVE — Exact head 3be13d2. Original failures are independently reproduced. Production/package evidence is reused only after full byte-parity checks; the current delta passes nine selector tests, 695 CI tests/1,868 subtests and all6 direct/18 selected premerge executions. The same digest-owner architecture failure reproduces on base/head and remains a separate hold. Required CI gates and bounds remain. The source-layout package mock, missing quality receipt and unverified hosted/Windows/main-adoption dimensions are explicitly retained; no merge or dispatch is authorized.
Why this change
Full CI has been failing for several independent reasons, while long qualification runs also lose useful progress to scheduling. This repair keeps each cause in a separate signed commit and puts the fixes in one PR so one hosted run can qualify their combined behavior.
The base includes the existing module-placement repair in #6830, the amendment/request-control fixture repair in #6812, and the checkpoint contract reconciliation in #6817. This PR addresses the remaining paths without duplicating those changes.
Changes
Restore the real HTTP receipt fixture. The session snapshot endpoint calls runtime recovery. The inbox receipt test created a real server without its required controller, producing
AttributeError(runtime_controller)followed byRemoteDisconnected. Construct the real controller with the fixture's store and registry; existingserver_close()owns its cleanup. Preserve both damaged-receipt cases, repair/retry, unique return/turn, and no external-send assertions.Make detached observer imports independent of its temporary working directory. OpenCode worker materialization creates a
loopxdirectory beneath the process temp directory. That directory could shadow an editable installation when the quota observer launchedpython -m loopx.usage_goalfrom the same directory. Add Python 3.11's-Pto this child entry point, retain explicitPYTHONPATHand normal installed-package loading, and scope mocked worker cache materialization to its owning test. New regressions exercise the real quota → detached Python → TypeScript aggregation path with both a namespace directory and an executable same-name package. Consent, caller-path pinning, detach flags and best-effort return semantics remain covered.Admit expensive work after cheap checks, and let active main qualification finish.
kernel-contracts, included inchecks.Decode source manifests as UTF-8. The extended runtime suite exposed an existing source-wide text-I/O guard failure in
runtime_workspace.py. Pin the input encoding at the real manifest boundary. This also fixes a reproduced Unicode decode failure under an ASCII host locale; malformed UTF-8 still fails before server startup. The existing global guard already covers this invariant.Repair the next failure observed on native Windows. The first hosted run reached the CLI budget smoke and failed while creating its long-path fixture under nonexistent
D:\tmp. Use an existing native temporary parent on Windows, or its nearest ancestor that can contain the unchanged random child; preserve a real 128-character root, full JSON/Markdown command budgets and owned-directory cleanup. Keep the nested-temp regression under pytest's existing ownership with a controlled input length. Extend the existing Windows selector withlong_path_budget, so all three targeted regressions execute natively, and guard that selection. No new job, budget waiver or timeout change.Validation
Linux, Python 3.11.17, Node 24.19.0, isolated editable installations. All changed slices received independent read-only review.
First four commits — combined integration result: 86 tests passed with two xdist workers in 141.68 seconds across all nine usage, collector, worker, subprocess, receipt and workspace modules. This includes the previously failing global UTF-8 guard. The complete locally validated Git tree was compared with the published head
bdb583fea62f8e020766ae803721b76f5cd67a3a; both are9f07a89ce371a8bd8121205193148cbeccf3ed95.The repository-selected standard premerge run completed all six direct checks and 16 of 18 selected checks. The semantic-vocabulary and CLI-output-budget smokes initially reached the local wrapper's default 120-second limit without a diagnostic tail. Both subsequently passed under the same canary executor on the first four commits' published source tree (
9f07a89ce371a8bd8121205193148cbeccf3ed95) with the required local runtime permissions and a bounded diagnostic deadline: semantic vocabulary in 237.147 seconds, CLI output budget in 201.420 seconds, both exit 0 with empty stderr. The CLI check runs its base and head arms sequentially; the head arm had only just started around 118 seconds. The original timeout receipts remain recorded; the original standard premerge run is not relabeled as passing. No product or CI timeout or qualification threshold was increased.Fifth commit validation: the two new short/nested native-temp simulations both fail against the previous implementation with the matching directory-creation error. The final patch passed 10 targeted tests (6.69 s), all 9 tests selected by the actual Windows step on Linux (6.40 s), 2 owning workflow guards (1.24 s) and 2 global UTF-8 guards. The new workflow guard fails against the old selector. Independent failure injection on POSIX and simulated Windows short/long parents verified a real 128-character root and cleanup of only the owned child, preserving the parent and marker. Native filesystem and Windows-escaped output budgets remain subject to the hosted run.
The fifth commit's published head
3be13d26cbb83bdfb9243c6f50806f977c595684has complete treeecec546cdb08560918c34b2518d7cd0e16ab2715, identical to the locally reviewed and tested integration tree. Explicit scope, Ruff, whitespace and the staged RFC gate passed.The local
loopx pr-reviewtransport cannot read GitHub metadata in this environment, which has no authenticatedghexecutable. Independent source reviews were completed, but a capability-validated formal approval is not claimed.Hosted readback
The first Python Tests run passed change classification, the new early static lane, bundle admission, all TypeScript and browser shards, Stage 2c checks, Linux
kernel-contracts, coverage/acceptance summaries, and thechecksaggregate. DCO, Dependency Review, Frontstage Pages and Release Artifacts also passed. Its actual merge checkout86fe9dfee92e650dfadc1032fa014818d8cc79a4had the same complete9f07…source tree as the first four locally validated commits.That run exposed the native Windows missing-directory failure; this evidence led to the fifth commit above. The six Python shards were still running when the updated head was published. Their incomplete run is not reported as a pass.
A subsequent read of the canceled first-round shard logs also found a genuine failure recorded before cancellation: shard 3 failed
test_only_the_owner_module_states_a_whole_value_digest_shapeat 17:37:54 UTC. The existing checkpoint-retention and workspace adapters still state their own bare digest patterns. A sixth scoped repair is in progress to delegate both decisions to the established owner, preserving rejection behavior and the architecture guard. Cancellation does not waive this observed failure.The second Python Tests run is now qualifying head
3be13d2, including the added native Windows regressions. The current head's full Python shards, coverage, Windows lane and final gate are not yet reported as passing. This section will be updated with observed results.Tradeoffs and remaining qualification
Python can now overlap a later failing browser/TypeScript/contract lane. Its existing six-slot bound remains, but the scheduling change does not itself prove better hosted throughput. Full hosted Python shards, coverage, Windows and final gate still require natural CI evidence. A PR run also cannot prove the post-merge main-push cancellation behavior; that requires subsequent main runs.
The existing behavior in which unrelated label changes restart PR qualification remains a separate follow-up. This PR does not change live repository rulesets, merge-queue configuration or release workflows.
Rollback is by the five cause-specific commits. This is a completed repair proposal entering review, not a claim that repository-wide CI is already fully healthy.
中文说明
本 PR 先以四个独立提交修复真实 HTTP 测试装配、后台子进程导入污染、CI 准入与主干取消策略,以及扩展验证发现的 UTF-8 输入问题。九个相关模块在两个 xdist worker 下 86 项全部通过;两个此前在本地限时的 smoke 也分别于 237 秒、201 秒通过,原超时记录保留。
第一轮托管的 TypeScript、浏览器、Stage 2c、Linux 合约、checks 汇总及发布构建等已通过,但 Windows 暴露了长路径夹具使用不存在目录的问题。因此追加第五个独立修复提交,保留真实 128 字符路径、完整命令预算和清理约束,并把三个长路径回归纳入原生 Windows 选择器。本地增量测试及独立审查已通过,第二轮完整托管 CI 正在执行;尚未合并,也不把旧轮未完成的 Python 分片算作通过。