Repository navigation
feat(repo): plan deterministic LPT mutation shards with stryker plan - #187
Merged
Merged
Conversation
systemfsoftware-maker
force-pushed
the
stryker/sota-2-plan
branch
from
October 6, 2026 03:44
49d5a98 to
57bac72
Compare
Add the ShardPlan contract (version 1) to @systemfsoftware/stryker-js-cli-contract and a new `stryker plan` subcommand that discovers each project's mutants without running tests, decides reuse through the existing incremental-diff workflow, costs every scheduled mutant, and packs mutants across shards with a longest-processing-time heuristic. Emit the plan on the `plan` stream event, which moves the stream schema version to 4.0 Verdict-Semantics: unchanged
Replace the shard plan's S.Number fields with S.Finite so effect-tsgo's schemaNumber diagnostic and the RunEventWireLine round-trip law hold without a suppression. Regenerate the stream contract document and the API report Verdict-Semantics: unchanged
The property ∀c_Mutants_≡LptKeepsTheBusiestShardWithinFourThirdsOfAveragePlusLargestItem falsified at seed 6: costs near Number.MAX_VALUE summed to Infinity, PlannedShard.make refused the non-finite predictedSeconds, and planShards threw Error: Schema validation failed instead of returning a plan. Bound costMs to 2^53-1 ms so every shard total over a realizable mutant list stays a finite double, and pin the refusal boundary with the falsifying cost in an in-source law Verdict-Semantics: unchanged
origin/main's worker line already declares 4.0, so the plan event added by this branch has to sit above it. Raise the literal, regenerate the stream contract document, move the wire fixtures to the new version, and restate the new version in the contract changeset Verdict-Semantics: unchanged
The plan-stream commit raised StreamSchemaVersion from 4.0 to 5.0 and updated the unit literals, but failing-run.e2e.test.ts still pinned the dry-run error document to 4.0, so e2e rest-1 failed strict equality against the packed CLI's 5.0 Verdict-Semantics: unchanged
systemfsoftware-maker
force-pushed
the
stryker/sota-2-plan
branch
from
October 6, 2026 07:35
57bac72 to
4b6ee05
Compare
Contributor
There was a problem hiding this comment.
Reviewed by Kiro: SOTA-ENGINE track 2: stryker plan packs mutants into deterministic LPT shards from the recorded cost model; getOrThrowWith only in an integration test. No threshold, exclude or scope change. All checks green on this head; merges cleanly after #183.
This was referenced Oct 6, 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.
What changed
stryker plan --target-seconds N [--max-shards K] [--projects <dir>...] [--out <file>] [--full]discovers each project's mutants without running tests, decides reuse against that project's incremental report, costs every scheduled mutant, and packs mutants across shards with longest-processing-time (LPT) list scheduling. It emits a versionedShardPlan(project mutant lists, predicted seconds, GitHub Actions matrix) on the newplanstream event, deterministic for the same inputs.ShardPlanis a new minor contract of@systemfsoftware/stryker-js-cli-contract.This branch also closes the flaky property the plan's full turbo test run exposed:
∀c_Mutants_≡LptKeepsTheBusiestShardWithinFourThirdsOfAveragePlusLargestItemfalsified at seed 6: three mutants costing 3.4927206787701224e293 ms, 1.7976931348623123e308 ms and 1.8961673493674487e-132 ms withmaxShards: 1sum toInfinity;PlannedShard.makerefuses a non-finitepredictedSeconds, soplanShardsthrewError: Schema validation failedinstead of returning a plan.costMsis now bounded toNumber.MAX_SAFE_INTEGERms, so any shard total over a realizable mutant list stays a finite double and every accepted command has a representable plan. The LPT bound itself is untouched; the in-source refusal law pins the boundary with the falsifying cost.origin/main's worker line already declares stream schema version
4.0, so this branch raisesStreamSchemaVersionto5.0and regeneratespackages/stryker-js-cli-contract/contract/stream.schema.json; the wire fixtures move with it.Borrowed
avg + (1 - 1/m) * largestRejected
mutants[i::n]or chunked id lists): blind to the cost model, it parks the expensive mutants on one shard and makes the wall clock the max instead of the meanFailing before (recorded)
planShardsthrewError: Schema validation failedon it (Infinity shard total ->predictedSecondsrejected).∀c_CostMsRefusal_≡RepresentableCostMsfailed against the unbounded schema:Gates (this worktree, rebased onto origin/main 5289c07)
vitest run src/plan-shards.workflow.ts src/__tests__/plan-shards.workflow.property.test.tsvitest run tests/plan.integration.test.ts(afterbuild)vitest run tests/run-event-stream.integration.test.ts tests/framework-stream.integration.test.tsvitest run tests/run-event-wire-line.integration.test.tscostMs<= 2^53-1pnpm build(cli-contract, stryker-js; includes typecheck)pnpm lint(both packages),pnpm lint:tsgopnpm format:check,pnpm guard:projectsscripts/guards/check-contract-versions.tsscripts/guards/check-verdict-semantics.tsMutation runs are never executed locally (engine refusal); the plan unit suites use fake/small fixtures.