[CI]: main is red — kernel-contracts mypy (3834 errors) and 6 Python shards; PR shards needs-gated so no PR gets a complete suite
Summary
main (811c1a1f6) is red in two independent ways, and together they mean no pull request on current main can obtain a complete Python suite result:
kernel-contractsfails onmainitself: 3,834 mypy errors across 395 files (python -m mypy --platform linuxlocally reproduces exactly 3,834 on pristinemain).- The six
test-shardjobs onmain's own push run fail: 17 failing assertions across ~13 distinct tests (counts below). - ~~The workflow gates
test-shardandwindows-powershellbehindkernel-contracts(needs:inpython-tests.yml), so on every pull request those jobs are skipped.~~ CORRECTED 11-30: this causal claim was wrong. PR-side shard skipping is the deliberate two-tier impact-classifier policy codified in43d350178(#9499,docs/development/ci-impact-selection.md) — not needs-gating. Full shards are a main/nightly surface by design. See the correction comment below and the thread on #9567.
Concrete fallout already observed: two of my reviews were completed without any suite result, and in one case (#9304) the PR merged before I noticed the shards had never run. This issue exists so that gap is visible to everyone instead of being rediscovered per review.
Evidence (main tip 811c1a1f6, push-event run)
kernel-contracts: Found 3834 errors in 395 files, step "Type-check kernel contracts", exit 1. The error mass comes from the zero-Any/modularization wave currently in flight (dozens of open refactor PRs each reducing Any in separate modules) plus newly added code that does not yet satisfy strict mode.
Python shards (each caps at the ~54-minute session deadline; per-shard results below are what completed):
| Shard | Result | Distinct failures |
|---|---|---|
| 1 | 5 failed / 6940 passed | checkpoint provider fence (exact-source goal instance); quota authority settlement journey [file]; stride comparison followthrough [writeback-result-sqlite]; work yardstick receipt reentry [False-sqlite]; steward generic monitor todo |
| 2 | 1 failed / 4275 passed | stride comparison followthrough [manual-measurement-file] |
| 3 | 7 failed / 6311 passed | connected adapter status vocabulary owner; research execution loop sampled memory; stride comparison followthrough [writeback-result-file]; work yardstick receipt reentry [False-file]; host harness capabilities lookup; delegation turn context [64000-sqlite]; dashboard command stale recorded python |
| 4 | 2 failed / 6046 passed | long-chain projected closeout [grow-paged]; quota authority settlement journey [sqlite] |
| 5 | 2 failed / 3670 passed | integration branch legacy git bare record; long-chain projected closeout [switch-paged] |
| 6 | 0 failed / 3787 passed | (deadline hit before coverage completed) |
~13 distinct failing tests total. Several of them (stride comparison followthrough, long-chain projected closeout, work yardstick, connected adapter vocabulary owner) are visible in main's own CI across multiple days, not a single-run flake cluster.
Impact
- Pull-request authors, reviewers and merges have no suite evidence at all on current
main; the redkernel-contractsalso cascades into thechecksandmerge-gatejobs, so every PR shows three red checks unrelated to its diff. - Reviewers cannot distinguish "PR broke something" from "main was already red" without a local baseline run per review — which is not repeatable for hosted CI.
Suggested directions (maintainer's call)
- Land or coordinate the zero-
Anywave to drivekernel-contractsback to green onmain; until then, the strictly-typed surface keeps regressing under new features (the wave and new features are interleaving into the same 3,834-error mass). - Triage the ~13 distinct shard failures on
main— several look platform- or environment-shaped (dashboard launcher, integration-branch legacy git, delegation turn context), others look like real regressions (quota authority settlement journey, checkpoint provider fence). - Consider un-gating the shards from
kernel-contracts(or making the gate non-blocking temporarily) so PRs get suite results again while item 1 is in progress. The current gating means the suite signal is zero exactly when main is least stable. - Shard deadline tuning: 5–6 of 6 shards hit the ~54-minute cap; coverage per run is also incomplete on
mainitself.
Scope and qualification
- All numbers above come from
main's own push-event CI run and a localpython -m mypy --platform linuxrun on pristinemain(811c1a1f6), on native Windows for the local part. - I did not attempt to attribute the ~13 test failures to individual commits; that triage is exactly what this issue is asking for.
- Related observations were posted in PR threads (#9435 and #9559) while trying to complete reviews; this issue consolidates them into one tracker.
Cross-referencing #9567, which I filed earlier today with the same core finding (kernel-contracts red on main → PR-side test-shard/windows-powershell skipped) — this report is the more complete one, so this issue should be the canonical thread; the two data points mine adds:
- Regression window, bounded by run records: the last
kernel-contractssuccess I can find is pull-request run 45609043562 (2026-11-25, head83bbed022on baseb34f0e615); the first observed failure is main run on509360fb0at 2026-11-27T16:34Z. So the 3834-error state arrived somewhere inb34f0e615..509360fb0(I did not bisect it). - Main runs after 2026-11-27 that look "not failed" in the list view were mostly concurrency-cancelled before the job started — worth checking
kernel-contracts's own conclusion per run rather than the run-level conclusion when triaging.
Also for the record: PR #9435's review thread hit exactly the gap this issue describes — the reviewer initially withheld approval over "no complete suite result on this head" and ultimately ruled (with the same reasoning as this report) that no PR on current main can produce one, approving on local parity evidence instead (https://github.com/loopx-project/loopx/pull/9435#pullrequestreview-6103254175).
Partial triage of the ~13 distinct shard failures — one root-cause cluster, one environment gate, and a reproduction caveat
I ran the failing modules against pristine 811c1a1f6. The useful result is a
positive identification for one cluster; the rest cannot be attributed from this
machine, and the reason is worth recording so the next person does not repeat it.
0. Reproduction caveat (read this first)
My local run is not a faithful replica of test-shard:
| local | CI (test-shard) |
|
|---|---|---|
| OS | macOS | ubuntu-latest |
| Python | 3.14 | 3.11 |
| Node | 23.11 | 24 |
| SQLite (bundled) | 3.49.1 | (Node 24 driver) |
Two consequences, both measured:
- Every
[sqlite]variant fails locally for an environment reason. The run stops attests/control_plane/canonical_authority_fixture.py:160withSQLite authority runtime is not qualified (SQLite 3.49.1 ...), raised fromloopx/control_plane/coordination/local_authority_provider.ts:293. That is the documented gate, not the CI failure. 90 such blocks across my four batches. - Extra failures appear locally that CI does not report (work-yardstick,
delegation-turn-context, dashboard-launch, quota-journey
[file]). With Python 3.14 these are unverified; they may be 3.14/macOS artifacts.
So: I can only assert a failure is a main regression where it reproduces on a
non-sqlite provider and appears in CI's own list. Everything else below is
labelled accordingly.
1. Identified cluster: the stride result-page replay guard
Two of the three stride variants CI reports ([manual-measurement-file],
[writeback-result-file]) fail identically here, on the file provider:
tests/control_plane/test_stride_comparison_followthrough_cli.py:229
assert "exact scoped result" in refused["error"]
Actual: "Explore task result pages require current source replay; reread
scoped pages under the original Turn."
Expected path: "Selected candidate requires the current Todo's explicit link to
the exact scoped result; reread changed sources."
Both strings are in loopx/control_plane/work_items/stride_policy.ts:
:370is the message actually returned,:380is the message the test expects.
The guard at :364-371 walks each declared explore.result_pages entry and
requires it to resolve against context.explore_result_pages:
const deliveredPages = Array.isArray(context.explore_result_pages) ? ... : [];
for (const page of (explore.result_pages ?? []) as JsonObject[]) {
const resolved = deliveredPages.find(row => row.revision === page.revision &&
row.offset === page.offset && row.limit === page.limit && row.todo_id === page.todo_id);
if (!resolved || ...) return "…require current source replay…"; // :370
context.explore_result_pages is populated in one place:
// loopx/control_plane/work_items/replan_context.ts:778
if (source.review_pages !== undefined) context.explore_result_pages = source.review_pages;
So the page the caller submits is not resolving against the delivered set.
Either review_pages is no longer reaching the context, or the identity
comparison (revision/offset/limit/todo_id) no longer matches what the
delivery records. Because the earlier guard returns, the deeper check at :380
(the one the test is actually about) is unreachable — which is why the assertion
fails rather than passing on a different message.
[writeback-result-sqlite] cannot be tested here (environment gate above), but
its [file] twin failing makes it likely the same cause rather than a
provider-specific one.
This also plausibly covers test_long_chain_projected_closeout[grow-paged] and
[switch-paged], which abort on explore turn-context exiting 1
(subprocess.CalledProcessError around
--result-offset 3 --result-limit 3 --result-revision 2887c7d6…). I did not get
the CLI's stderr out of the CalledProcessError, so treat that link as a
hypothesis, not a finding.
2. Reproduces here, non-sqlite, but not yet root-caused
test_connected_adapter_status_vocabulary_owner::test_the_owner_is_not_a_registered_vocabulary_ownertest_quota_authority_settlement_journey::test_original_turn_refuses_readiness_from_a_replacement_lease[file]test_work_yardstick_cli::test_receipt_reentry_keeps_the_selected_work_outside_the_global_context_window[False-file]test_dashboard_command—five launch/resolution tests; CI reports only the "stale recorded python" one, so the other four are probably local artifacts.
3. Reported by CI, passes here — needs the CI environment or ordering
host_harness_capabilitieslookupresearch_execution_loop"sampled memory" (its[sqlite]sibling failed locally on the environment gate, the sampled-memory case itself passed)checkpoint_provider_fence"exact-source goal instance" — locally it dies on the SQLite gate, so unconfirmed either way
4. What would finish this triage
- A run on Python 3.11 + Node 24, which removes both confounders and lets
the
[sqlite]variants be judged at all. - The
python-diagnostics-*/longest_casesartifact (401 for me) or the shard stderr, to see the exact failure text CI recorded for each of the 13. - With those, the stride cluster above can be turned into a fix candidate
directly: decide whether the delivery should be populating
review_pages(replan_context.ts:778) or whether:364-371should compare a looser identity than the four-field equality it uses now.
I have not attempted a change; this is characterisation only, and section 1 is the only claim I would defend as a main regression right now.
Correction to my earlier comment: test-shard is not gated by kernel-contracts
I repeated a claim from an earlier report that test-shard and
windows-powershell list kernel-contracts under needs, and therefore skip
when it is red. Checking python-tests.yml directly, that is wrong:
| job | actual needs |
|---|---|
test-shard |
changes, chat-bundle |
windows-powershell |
changes, chat-bundle |
checks |
changes, kernel-static-checks, kernel-contracts, typescript-coverage, dashboard-acceptance, chat-bundle-browser |
pytest |
changes, checks, test-shard |
The real chain is kernel-contracts → checks → pytest. A red
kernel-contracts makes checks and pytest red on every pull request, but the
Python shards themselves still run and are still scored.
Why this matters for the two issues I raised it in:
- The capacity and imbalance numbers I derived in the #9567 comment are unaffected
— they come from
test-shard's own recordedselected_cases/finished_cases, which were produced by shards that did run. - But the framing was wrong: a permanently red required check is a real cost
(
pytestandcheckscan never pass, so reviewers learn to ignore them), and it is not the same as "PRs get no shard signal". PR shards do produce a signal;pytestjust cannot reflect it whilechecksis red. - I have not verified why the shards in the reported PR run showed
skipped;test-shardalso skips whenchangesclassifiespython_testsas false, which is a separate cause worth checking before concluding gating is responsible.
The source of the mistake is mine: I quoted the earlier report without checking the workflow. Same correction posted on #9586.
更正:本 issue 第 3 点的因果结论是错的(已同时改正正文)
我在正文里写"PR 分片被跳过是因为工作流把 test-shard needs 门控在 kernel-contracts 后面"。这个结论被 @gcl-coder 在 #9567 的复核推翻、@LIHUA919 也在 #9435 与 #9567 里做了归因更正:PR 侧跳过分片是 43d350178(#9499,docs/development/ci-impact-selection.md)有意设计的两级门控策略——完整分片属于 main/nightly 面,PR 按影响分类选择检查。我此前在第 549 行看到的 needs: 行属于别的 job,我把两件事拼错了因果。正文第 3 点已划掉并改正。
更正之后,本 issue 相对 #9567 仍然成立且可能增量的部分:
kernel-contracts在 main 上的 mypy 错误总量与本地复现(当时811c1a1f6上 3,834 条、395 文件,本地--platform linux精确一致;#9584 合并后现为 3,833)。#9567 的关注点是分片超时,mypy 质量门是否单独立项由维护者定。- 11-29 那轮 main push 运行的逐分片失败清单(17 条断言失败、约 13 个不同用例,按分片列名)——#9567 记录的是超时机制本身。
- 若干失败用例的交叉线索(
test_stride_comparison_followthrough_cli、test_long_chain_projected_closeout、test_work_yardstick_cli在我评审过的多个 PR head 与 main 上同样失败)。
如果维护者认为第 1、2 点并入 #9567 更好,可以把本 issue 关闭进去,我没有异议;保留或合并都行。
分诊接力:stride 簇根因已定位并修复 → #9748
接 @gcl-coder 在本 issue 的第 1 节(stride result-page replay guard 簇)。补上它列出的"收尾所差"之一:本机是 Python 3.12 + Node 24.20(Node 版本与 CI 一致,无 3.14/23.11 混淆因子),两个 [file] 变体在我的机器上以相同签名复现,随后定位到了确切根因:
根因:66508223a("slim state_refresh under 1000 LOC with zero Any")把 read_explore_context 的 review_pages 透传改写为 _str_list_or_empty(...)。该辅助函数只保留字符串元素,而 explore_review.result_pages 是 {revision, offset, limit, todo_id} 对象列表(stride_policy.ts 用四字段恒等比较的那一形状)——每一页都被静默滤空,review_pages or None 变成 None,交付的 explore context 从此不带 explore_result_pages,守卫(stride_policy.ts 的 context.explore_result_pages 查找)于是以 "Explore task result pages require current source replay" 提前拒绝,挡住测试真正要验的 exact-scoped-result 检查。
重构前的形状(state_refresh.py:1159,66508223a^):对象列表原样透传。
修复:#9748(单文件,+9/−5,DCO)——_result_pages_or_none 类型化透传(缺键 → None,[] → [],对象 → dict),退役已无调用的字符串辅助函数。
验证(native Windows,Python 3.12,Node 24.20,基线 dc43b5e9f):
- 修复前:两个
[file]变体以相同签名失败(本地复现); - 修复后:
test_wide_result_page_replays_every_linked_outcome_at_writeback4/4(file+sqlite × 两种模式)、整个 stride 测试文件 6/6; - gcl-coder 第 1 节末尾的假设同时被证实:
test_long_chain_projected_closeout的[grow-paged]/[switch-paged](CI 报红的另外两例)在此修复下 6/6 通过——它们的中止点(explore turn-context以--result-offset/--result-limit/--result-revision退出 1)正是同一根因的表现。
至此 #9586 清单的约 13 个失败里 4 个(两个 stride + 两个 paged closeout)已有根因与修复。其余(connected-adapter vocabulary owner、quota authority settlement journey、work yardstick、dashboard command、integration branch、research execution loop、checkpoint provider fence、steward generic monitor todo)仍待认领——其中 gcl-coder 标注的"本机环境无法判定的 sqlite/CI-only 子集"依然需要一台 Linux/CI 形态的环境。
分诊补充:剩余失败在本机(Windows / Python 3.12 / Node 24.20)的基线
gcl-coder 的分诊受限于 macOS + Python 3.14 + Node 23.11(sqlite 门 + 疑似 3.14 伪失败)。我的环境补了另一半:Node 24 与 CI 一致(sqlite 变体可判),Python 3.12。对象是 pristine main dc43b5e9f 的下列 CI 失败用例:
复现 → 真回归(7 个测试 ID,且跨平台:macOS/3.14 与 Windows/3.12 都挂)
quota_authority_settlement_journey::test_original_turn_refuses_readiness_from_a_replacement_lease[file]+[sqlite]work_yardstick_cli::test_receipt_reentry_keeps_the_selected_work_outside_the_global_context_window[False-file]、[False-sqlite]、[True-file]、[True-sqlite]test_steward_generic_monitor_todo::test_resolve_advancement_turn_id_handles_selection_deferral_and_precommit_retries
两点对既有分诊的修正/加强:
- work_yardstick 四个变体全部复现——gcl-coder 猜测的"可能是 3.14 伪失败"不成立(它们在 3.12/Windows 上同样失败);且 CI 只列了
[False-*],[True-*]也坏,是新增信号。 - journey 的
[sqlite]变体可判且确实失败——sqlite 环境门在本机不触发(Node 24 与 CI 一致),排除门控伪失败。
本机通过 → 平台/环境相关(与 gcl-coder 的归因一致,两条有分歧)
connected_adapter_status_vocabulary_owner:本机通过——与 gcl-coder"在 macOS/3.14 复现"分歧,提示该用例对 Python 版本或平台敏感,不是纯 main 回归。dashboard_command::test_dashboard_launcher_ignores_stale_recorded_python:本机通过——环境相关(CI runner PATH),与 gcl-coder 归因一致。integration_branchlegacy git:本机通过——runner git 环境,与 gcl-coder 归因一致。
仍缺:host_harness_capabilities lookup 与 research_execution_loop sampled memory 本轮未跑(不在选择器内);checkpoint_provider_fence exact-source 未跑。三者需要下一轮补齐,或等 CI 形态环境。
连同上一条评论(stride/paged closeout 簇的根因与 #9748 修复),#9586 清单的现状:4 个已修复待合并、7 个确认跨平台真回归待认领、2 个确认为平台/环境相关、3 个未跑。