Summary
Implement item #2 of the build-performance umbrella (#363): shard the CDK Jest suite across a CI job matrix so the now-dominant //cdk:test (~298s after #357/#359) runs in parallel slices and aggregates into the single required build check.
Design is documented in docs/design/CI_BUILD_PERFORMANCE.md (PR #364, §"Item #2 — sharding the CDK suite").
Parent: #363. Predecessor: #357 (done, PR #359 merged).
Approach (fan-out + aggregate gate)
build-shard (matrix: shard ∈ [1..4]) # parallel; NOT individually required
│
▼
build (needs: build-shard) # single required context on merge_group
build-shard runs jest --shard=${{ matrix.shard }}/4 for the CDK suite (~119 test files) + uploads per-shard coverage.
- A single
build job needs: [build-shard], fails if any shard failed, and remains the one required status context (stable name regardless of shard count).
- Non-test tasks (
//cdk:synth:quiet, //cli:*, //docs:build, //agent:quality, drift checks) and the deploy artifact (cdk-agentcore-out) produced exactly once, off the shard critical path.
- Cross-shard coverage merge before threshold enforcement (each shard sees only its slice).
- Self-mutation/drift check runs once (aggregate job), not per-shard.
Acceptance criteria
Implementer notes (from the design doc)
- Overhead dominates past ~4 shards (~95s fixed per-job checkout/install/cache). 4-way is the start; measure before going higher; maximize cache hit-rate first.
--shard partitions by file count, not runtime — watch for a heavy suite skewing one shard.
- Do not mark individual shard jobs required (context-name fragility / queue deadlock risk).
References
🤖 Generated with Claude Code
Summary
Implement item #2 of the build-performance umbrella (#363): shard the CDK Jest suite across a CI job matrix so the now-dominant
//cdk:test(~298s after #357/#359) runs in parallel slices and aggregates into the single requiredbuildcheck.Design is documented in
docs/design/CI_BUILD_PERFORMANCE.md(PR #364, §"Item #2 — sharding the CDK suite").Parent: #363. Predecessor: #357 (done, PR #359 merged).
Approach (fan-out + aggregate gate)
build-shardrunsjest --shard=${{ matrix.shard }}/4for the CDK suite (~119 test files) + uploads per-shard coverage.buildjobneeds: [build-shard], fails if any shard failed, and remains the one required status context (stable name regardless of shard count).//cdk:synth:quiet,//cli:*,//docs:build,//agent:quality, drift checks) and the deploy artifact (cdk-agentcore-out) produced exactly once, off the shard critical path.Acceptance criteria
buildcheck remains a single stable context that reports onmerge_group(feat(ci): require secrets/deps/SAST on every PR — make the merge gate enforceable (incident #313 class) #327) and fails if any shard fails.cdk-agentcore-outstill produced exactly once; deploy.yml unaffected.mise run buildsemantics preserved for local (non-CI) runs.Implementer notes (from the design doc)
--shardpartitions by file count, not runtime — watch for a heavy suite skewing one shard.References
docs/design/CI_BUILD_PERFORMANCE.md(PR docs(design): CI build performance roadmap + implementer notes (#363) #364).github/workflows/build.yml🤖 Generated with Claude Code