Repository navigation
ci(scripts): read the shard sizes from ci.yml's matrix blocks instead of copying them - #26488
Merged
Merged
Conversation
… of copying them scripts/lib/ci-shard-matrix.mjs reads a job's `strategy.matrix.shard` from ci.yml as text (the literal list, or a planned matrix's full-roster fallback) and refuses every other shape; there is no default. partition-test-shards.mjs's SHARD_COUNT, check-required-contexts.mjs's shard-name collision anchor and check-shard-attestation.mjs's live-ci.yml anchors now ask it, so /8 and /3 are spelled in the workflow only. The reader's --self-test runs through `pnpm check:shard-attestation`. Claude-Session: https://claude.ai/code/session_01ADHkmT3NzSaaWLSdqdDPMd Co-authored-by: Claude <noreply@anthropic.com>
A multi-segment import specifier from partition-test-shards.mjs reads as a watch hint that the modules importing it would lose (dispatch-gates self-test, 'promoting N module(s) to gate files subtracts no inherited hint'); a sibling import is the refused single-segment shape. Claude-Session: https://claude.ai/code/session_01ADHkmT3NzSaaWLSdqdDPMd Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · devx seat 2 · 2026-10-27T05:02ZSeat
Landing: ready + auto-merge once CI on this head is green. |
This was referenced Oct 27, 2026
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Part of #26443
Part of #26431
Clause-②: no
Metadata-protocol: none
维护者速读
scripts/ci-shard-matrix.mjs,从 ci.yml 的matrix:读分片数;分片器、必需上下文自测、分片证明自测三处不再自抄 /8、/3。scripts/ci-shard-matrix.mjs(读取与拒收规则)、scripts/partition-test-shards.mjs的SHARD_COUNT一行、scripts/check-shard-attestation.mjs自测里改成派生的锚点。node scripts/ci-shard-matrix.mjs应打印test 8 planned/dogfood 3 literal/test-ui 16 literal三行。What changes
scripts/ci-shard-matrix.mjs, the one reader of ci.yml's shard-matrix sizes. It reads a job'sstrategy.matrix.shardas text (noyamldependency, becausecheck-shard-attestation.mjsruns in jobs that install none andpartition-test-shards.mjsneeds the count synchronously at import). It understands the two spellings ci.yml uses: a literal list[1, 2, 3], and a planned matrixfromJSON(... || 'FALLBACK'), whose size is the full-roster fallback. Every other shape is refused with an error naming the job: no such job, nomatrix:, noshard:, twomatrix:blocks, a planned matrix with no fallback, a block sequence, a scalar, quoted items, or a list that is not exactly 1..N. There is no default count.scripts/partition-test-shards.mjs:SHARD_COUNTis nowliveShardTotal('test')instead of the literal8. Self-test step 4 no longer compares the matrix with a copy of itself; it still reads back the two other ci.yml spellings (--shard N/Mand the attestation's--total).scripts/check-required-contexts.mjs: battery (9)'s shadowing-collision anchorname: Test Core (… matrix.shard …/N)is built from the live matrix size. Two header lines that still said/3now say/N.scripts/check-shard-attestation.mjs: every self-test anchor taken from the live ci.yml derives its size from the reader. That covers the live display names of both matrices, theTEST_MATRIX/GATE_PLANfallback rosters, the--leg "test/N:roster anchor, the literal-list control and theTEST_NAME/dogfood-name anchors. It also adds one assertion that the live test matrix reads as the planned shape those ci: Test UI always starts 16 shard runners and Test Core 8, even when the affected set is one package, and an empty shard still pays checkout + install + closure build before learning it has nothing to run #26084 anchors assume (325 → 326 assertions).package.json:check:shard-attestationrunsnode scripts/ci-shard-matrix.mjs --self-testfirst. lint.yml already runs that alias, so the reader's self-test runs in CI andcheck:self-test-wiredcounts it (239 → 240 scripts) without a workflow edit.Why
The shard sizes were spelled in five self-tests and fixtures, and no copy was the authority. ci.yml's
matrix:blocks are. Resizing a matrix meant editing every copy (#26443 Measured). This PR does the devx half. The ui half (two/16fixtures underui/scripts/__tests__/) andscripts/pm/check-expected-skips.mjs(the #26431 roster child) are left for their own cards, so neither card closes here.Tests
node scripts/ci-shard-matrix.mjs --self-test:✓ ci-shard-matrix self-test: 27 cases pass across 5 batteries (live: test=8, dogfood=3, test-ui=16).The batteries are the live ci.yml (4), the literal list (3), the planned matrix (3), job boundaries (3) and refusals with no default (14). The refusal battery includes a checkout with no ci.yml (ENOENT, not defaulted). It uses the battery-name floor and the verdict handshake copied fromcheck-agent-model-declared.mjs.node scripts/partition-test-shards.mjs --self-test:self-test OK (75 measured packages -> 78 shard items, 8 shards, …), exit 0.node scripts/check-required-contexts.mjs --self-test:174 assertions, exit 0.node scripts/check-shard-attestation.mjs --self-test:326 assertions, exit 0.node scripts/ci/plan-test-core-shards.mjs --self-test(importsSHARD_COUNT): exit 0.Verification
Gate families from
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat head35440f1d: 44 derived, and all 44 ran locally with exit 0. They includepnpm check:pm-dispatch-gates(✓ dispatch-gates self-test (fast tier): 1935 cases pass),check:self-test-wired,check:required-contexts,check:shard-attestation,check:cross-package-test-inputs, and the four dist readers after a./packages/**build under the verify lock.--ranreconciliation:44 derived, 44 run, 0 NOT-MEASURED (a DERIVED zero), 0 UNRUN. The dispatch-gates slow tier was not run locally (no script is deleted or renamed). It runs on push to main and on the schedule.Acceptance notes
scripts/ci-shard-matrix.mjs, not under a newscripts/lib/. I wrote it underscripts/lib/first. Thencheck:pm-dispatch-gateswent red on one case:promoting 34 module(s) to gate files subtracts no inherited hint from any other family — LOST: scripts/check-test-completeness.mjs … <- scripts/partition-test-shards.mjs (scripts/lib/ci-shard-matrix.mjs). A multi-segment import specifier reads as a watch hint, and the modules that importpartition-test-shards.mjswould lose it. A sibling specifier is the refused single-segment shape, and the case is green with it.git grep -nE "/(3|8|16)\b" scripts/*.mjs scripts/pm/*.mjs(ui excluded, see below) has 105 hits outside the reader andcheck-expected-skips.mjs. None of them copies a live ci.yml matrix size. By class:Test Core (3/3)in measured-incident comments.WORKFLOW_TEXTfor run 38021470264, the six-shard replays, and thetest-N-of-3synthetic judge fixtures.scripts/pm/ci-failure.mjsFixture shard (… /3)).@objectstack/cli 2/3), which are not matrix sizes.options 1/2/3,15/16).ui/scripts/__tests__/select-affected-tests-wiring.test.ts:54andui/scripts/__tests__/select-affected-tests.test.ts:450-453(/16) belong todomain:ui.scripts/pm/check-expected-skips.mjs:316,330,359belongs to the ci(gates): retire the transcription pins — tests and gates that hold a hand-typed count or table equal to the tree and red on every unrelated move (parent of eight) #26431 roster child.scripts/ci/select-shard-timings-run.mjs:117still declaresSHARD_COUNT = 8. Its header says that value is only its matchers' default (each run is judged at its ownTest Core (N/M)width). The card's grep does not cover it, and neither does this card's file surface.scripts/pm/dispatch-gates.self-test.mjs:4898-4900spellsTest UI (… /16)in a syntheticuiJobFixture, not a read of ci.yml.Human Minimum
packages/specholds no runtime logic. (no spec change)pnpm lintpasses. (no formatter ran;pnpm lintwas not run locally, it is a repo-wide scan CI owns)main, one pull request.skip-changeset)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmT3NzSaaWLSdqdDPMd
Generated by Claude Code