Repository navigation
Shard exhaustive CI runtime suites under five minutes #280
Description
Motivation
CI is the exhaustive correctness authority: every applicable TypeScript test runs under Deno, Node, and Bun. The corpus has grown beyond the useful wall-clock range of one job per runtime. At 5542c92, the standalone Deno suite took 22m07s, and the same suite reached the composability battery's former 30-minute ceiling.
This issue shortens the exhaustive CI critical path by splitting each runtime suite into deterministic weighted shards. It does not change which tests run.
Owner ruling (2026-08-22): the local affected-test selector formerly included in this issue is dropped. Deno's native --changed and --related commands remain the documented local affected-test mechanism. Closed PR #311 is not an implementation dependency.
Owner ruling (2026-08-22): choose the smallest measured shard counts that keep every exhaustive runtime suite below 300 seconds after runtime and dependency setup, for five consecutive CI runs. Setup, checkout, queue time, and dependency downloads are reported separately. If a run misses the target, update weights or shard counts and begin a fresh sequence of five runs.
Exhaustive sharding contract
For Deno, Node, and Bun, CI runs the complete discovered TypeScript test corpus minus only that runtime's recorded exclusions. No test runs in fewer runtimes than it does before this change.
scripts/lib/test-files.ts is the single source of discovery. Its result is the same corpus Deno's workspace test glob discovers. The recorded exclusions in scripts/runtime-test-exclusions.ts are applied to that set per runtime, retaining every reason and issue link.
Each runtime's applicable corpus is partitioned into deterministic, disjoint shards whose union is exactly that corpus. Every applicable file runs exactly once per runtime. A new or unmeasured file still belongs to exactly one shard and receives a conservative non-zero fallback weight.
Weights come from the corresponding runner's own per-file timing on the GitHub-hosted runner. They are versioned repository data changed only by an explicit remeasurement command; ordinary verification never rewrites them. Shards use deterministic longest-processing-time-first assignment, with stable tie-breaking, to minimize the longest shard rather than equalizing file counts.
The shard-count decision is empirical. Select the smallest counts that satisfy the five-run, 300-second target above. Record before/after per-file, per-shard, per-runtime, and overall makespan evidence together with the Actions run URLs and attempts.
All shard jobs run concurrently and preserve #279's ownership, cancellation, output, and clean-worktree invariants. A shard runs its assigned files serially through the runtime's existing runner; Deno --parallel and equivalent in-shard parallelism are outside this issue.
CI aggregation
The existing required green aggregate remains the delivery authority. It requires every runtime shard job and fails if any shard is missing, skipped unexpectedly, cancelled, crashes, or reports a test failure. The workflow regression parses the shard jobs, proves green.needs covers them, and proves the partition for each runtime is deterministic, disjoint, and exhaustive.
Check and log names identify the runtime and shard. Each shard retains complete first-failure output. The current exhaustive commands remain available for humans, debugging, composability verification, and weight validation.
Scope
Included:
- deterministic weighted sharding of
test-deno,test-node, andtest-bun; - one discovery source and the existing recorded runtime exclusions;
- explicit weight measurement and versioned weights;
- shard-count calibration and five consecutive timing runs;
greenand workflow regressions covering every shard; and- documentation of the exhaustive CI topology and remeasurement procedure.
Not included:
- a repository-specific affected-test selector or any revival of PR ✨ Run the tests a change affects, and weigh the corpus for shards (#280, PR A of two) #311;
- changes to the documented local affected-test policy;
- Deno
--parallelor other parallel execution inside a shard; - changes to what the composability job runs or when it runs; or
- a new
runtime-testsrequired check or a repository-ruleset mutation.
Plan gate
Before code, submit a short plan that identifies:
- the one discovery and exclusion flow shared by all three runtimes;
- the runner-native timing seam and versioned weight format;
- deterministic LPT assignment, fallback weights, and exact-once partition proof;
- the smallest measured shard counts proposed for the 300-second target;
- workflow job and
green.needsstructure, including failure and cancellation behavior; - regressions for discovery equivalence, exclusions, deterministic/disjoint/exhaustive partitioning, unmeasured files, and workflow aggregation; and
- the before/after measurement and five-consecutive-run validation procedure.
Acceptance criteria
- Make the full verification battery safe to run concurrently #279 is closed and its concurrency, cancellation, output, and cleanliness invariants remain intact.
test-deno,test-node, andtest-buneach run as deterministic weighted shards.- Every applicable test runs exactly once per supported runtime, minus only that runtime's recorded exclusions; no existing runtime coverage is lost.
- Versioned runner-native timing weights and an explicit remeasurement command exist; ordinary verification does not rewrite the weights.
- New or unmeasured tests receive a conservative non-zero weight and run in every applicable runtime.
- The selected shard counts are the smallest measured counts for which five consecutive CI runs keep every runtime suite below 300 seconds after setup.
- Timing evidence records run URLs and attempts, setup-excluded boundaries, per-file and per-shard durations, per-runtime makespan, overall makespan, and runner cost.
greenrequires every shard, and the CI workflow regression proves coverage plus deterministic, disjoint, exhaustive partitioning.- Logs identify runtime and shard and retain complete first-failure output.
- The full standing delivery battery and compiled smoke checks pass on the final PR head.
Activity
[-]Shard runtime tests to bring verification under three minutes[/-][+]Select affected tests locally and shard exhaustive CI under three minutes[/+]taras commentedon Aug 2, 2026
Sequencing ruling
Research and mechanism planning for #280 may proceed in parallel with the approved Stage-1 repair for #279, because they create no repository changes or competing PR.
Implementation remains blocked until the #279 repair and Stage 2 have merged and #279 is closed. Do not open a #280 implementation branch or PR before then. Revalidate the plan against the final #279 interfaces before code.
Parallel work should use an isolated clean clone and scratch caches so it cannot interfere with #279. Prioritize the two empirical uncertainties that determine the design: the exact supported seam for capturing Deno 2.9.1's native selected test-file set, and per-file/per-runtime timing plus runner overhead for choosing deterministic shard counts. Produce the complete plan required by this issue and stop for planner review; do not implement opportunistically.
taras commentedon Aug 3, 2026
Owner rulings for the #280 mechanism plan
The owner approved the following conservative selection and rollout policy:
no runtime testsclass for known test-irrelevant paths such as CI-only and lint/format-only configuration. Anything not deliberately classified remainsunknownand triggers the full corpus.--parallelmode remains separate work. Shard exhaustive CI runtime suites under five minutes #280 obtains parallelism through isolated exhaustive CI shards; Make the full verification battery safe to run concurrently #279 owns safe concurrency among the repository commands.runtime-testsis required. This is a separate owner-controlled post-merge configuration step; do not claim the check is required merely because the workflow defines it.These rulings amend the #280 contract and must appear in the next mechanism-plan revision before code.
taras commentedon Aug 3, 2026
Planner review of
enchanted-swimming-sundae.md— FAILReviewed the complete 522-line artifact, SHA-256
6c19bbcf6781610ab163a01e71f5576e923c496211c79ebd77333ba7bc03e151, against current #280, all #279 amendments, currentorigin/main(4a13be7), and open PR #304. The empirical selection and timing research is strong, and the per-candidate Deno seam plus weighted-sharding direction are retained. The plan cannot pass while its trigger table contradicts its own probes and the newly recorded owner rulings.Prescriptive revision prompt:
taras commentedon Aug 3, 2026
Planner review of
enchanted-swimming-sundae.mdrevision 2 — FAILReviewed the complete 583-line artifact, SHA-256
8ba7219ecac7d36ca1609b76fda6a42b0657306d4264890a4443cb58846e670d, against the current issue contract, owner rulings, repository AGENTS.md, Effection v4 AGENTS.md, and the live repository ruleset. The revised Deno-native reachability proof, total trigger table, failure policy, automated scratch-repository validation, sequential PR split, and delayed required-check rollout resolve the previous review findings.One blocking factual defect remains. Section 6 says ruleset
main(id13643935) has an emptyrulesarray. The live API response instead contains three active rules:deletion,non_fast_forward, andpull_requestwith its current parameters. There is norequired_status_checksrule, which is the narrower fact the plan needs. Updating a ruleset requires supplying its rules, and GitHub also requires an explicit strict/loose status-check policy; neither may be left for the implementor to choose or allowed to erase existing protection.Prescriptive revision prompt:
taras commentedon Aug 3, 2026
Planner review of
enchanted-swimming-sundae.mdrevision 3 — PASSReviewed the complete 627-line artifact, SHA-256
9a7977dfdc499dcd10291178e8957e6813110b73d7c824d54482a3c386ca165c, against the current #280 contract and owner rulings, repository AGENTS.md, Effection v4 AGENTS.md, currentmain(4a13be72ee2cecbb09c25b2bd5878fc0bddbef13), and live ruleset13643935.Revision 3 resolves the remaining defect. Its snapshot exactly matches the live active ruleset:
deletion,non_fast_forward, andpull_requestwith the recorded parameters; norequired_status_checksrule; unchanged default-branch conditions and empty bypass list. The later owner-controlled operation is additive, preserves and verifies every existing protection, stops on stale state, remains outside PR A and PR B, and does not ask the implementor to choose strict versus loose status policy.The unresolved strict-versus-loose choice does not block either implementation PR. It remains an explicit owner decision that must be recorded on #280 before the separate post-PR-B ruleset mutation. All previously approved selection, reachability, conservative fallback, automated validation, weighted exhaustive sharding, sequential-PR, #279 dependency, and AGENTS.md-compliance mechanisms remain intact.
taras commentedon Aug 3, 2026
Planner review of PR #311 at
490de0b65d6b80a4ddc6cda196fcbaf0dc47b909: FAIL.All ten checks are now complete and green, the head is mergeable, and there are no review threads. Those gates do not resolve the contract failures below.
First, PR #311 was opened before its explicit prerequisite. #280 comment
5160700394, the approved revision-3 plan, and the plan's delivery section all say PR A must not open until #279 Stage 2 has merged and #279 is closed. #279 is still OPEN, no Stage-2 PR has merged, and #311's own body acknowledges that Stage 2 remains open. The required final-interface and flag revalidation therefore could not have happened.Second, the implementation violates the repository and approved-plan code rules.
scripts/affected-tests.tsandscripts/measure-weights.tsadd top-levelawait main(...);scripts/affected-tests.tsaddsas const; and the scratch dynamic-import fixture adds an explicitPromiseannotation. The approved plan explicitly requires no casts, Promises, async, or await.Third, the PR body claims the full automated regression suite, but the approved §7.1 matrix is incomplete. The current tests do not exercise a real cross-workspace transitive edge; the
--no-checknegative half of the type-only proof; a real copy throughchangeSet; stagedgit rm; rename into and out of a triggering directory; an analyzable template dynamic import; a non-analyzable dynamic target that the test actually loads at runtime; every full-trigger and no-runtime class through the scratch-repository selection pipeline; the tracked bundle-generator input alongside the ignored output; or command-level aggregation/cancellation/cleanliness. There is no regression proving an unreadable base produces the promised remediation at the command boundary, all three runners finish when one fails, full first-failure output is retained, cancellation leaves no child process, or a full affected run leaves tracked content and modes unchanged.On the user's question: agents do not currently know to run affected tests.
AGENTS.mdis unchanged and still requires the exhaustive Deno test task. That is intentional for PR A under the approved two-PR rollout; PR B is the PR that changes the agent default, documents separately applicable checks and--all, installs exhaustive sharded CI, and closes #280. Do not move that policy change into PR A merely to answer the question early.Prescriptive repair prompt:
taras commentedon Aug 22, 2026
Owner ruling (2026-08-22): rescoped to shards only
This issue now delivers one thing: the exhaustive CI suites run as weighted shards to minimize wall-clock makespan. The local affected-test selector (PR A, #311) is dropped from this issue's scope.
Why now: the Deno suite is 22m07s standalone at 5542c92 (305 files, 677 tests), and under the composability battery it outgrew its 30m ceiling and reddened
main(#538, #539). The sharding half of the approved revision-3 plan was measured and proven (weighted split executed at 75/71/68s against 212s serial on the Aug-2 corpus) and does not depend on the selector; the selector half is what failed review on #311 and is what has kept the whole issue stalled since 2026-08-03. Deno-nativedeno test --changed/--relatedalready gives agents a documented affected-mode command (AGENTS.md, Test selection); a repository selector can return as its own issue if that proves insufficient.What carries over unchanged from the approved plan: weight measurement from the runner's own timing, longest-processing-time-first assignment, one discovery source (
scripts/lib/test-files.ts= Deno's glob), the recorded per-runtime exclusions applied to the same set,green.needscovering every shard job (the ci-workflow regression test enforces it), and CI remaining the correctness authority — every applicable test under every supported runtime, once.What is not in scope here:
--parallelinside a shard (the suite is not parallel-safe; separate issue), and any change to what the composability job runs (separate issue on the battery).Acceptance for the rescoped issue:
test-deno,test-node,test-buneach split into N weighted shard jobs with recorded before/after wall clock; thegreenaggregate requires every shard; theci-workflowtest parses the shard jobs; no test runs in fewer runtimes than it did.[-]Select affected tests locally and shard exhaustive CI under three minutes[/-][+]Shard exhaustive CI runtime suites under five minutes[/+]