diff --git a/.clinerules/tooling.md b/.clinerules/tooling.md index ebe612f..28bd521 100644 --- a/.clinerules/tooling.md +++ b/.clinerules/tooling.md @@ -11,9 +11,10 @@ What "installed" means, in this order: 1. `.config/dotnet-tools.json`, committed, pinning `dotnet-stryker` — a local tool, so `dotnet tool restore` is the whole setup and no clone has to install anything globally. -2. `stryker-config.json` at the root: `test-projects`, `test-runner`, `target-framework`, `configuration`, +2. `stryker-config.json` at the root: `test-runner`, `target-framework`, `configuration`, `mutation-level`, `coverage-analysis`, `thresholds`, `reporters`, `break-on-initial-test-failure` and - `mutate`. The workflow and a local run read this one file. + `mutate`. The workflow and a local run read this one file. Stryker 5.1.0 runs in solution context: the + test project is discovered from the solution, so the config carries no `test-projects`. 3. A workflow that restores the same manifest, so the pin is stated once. 4. A README section (`Building and testing` → mutation testing) saying how to run it and how to read the report, and a longer record under `docs/` when there is something worth recording. @@ -22,9 +23,9 @@ Setting it up on a repository that has none of this: ```powershell dotnet new tool-manifest # writes .config/dotnet-tools.json -dotnet tool install dotnet-stryker --version 5.0.0 # the version stryker-config.json is written for +dotnet tool install dotnet-stryker --version 5.1.0 # the version stryker-config.json is written for dotnet tool restore -dotnet stryker --config-file stryker-config.json --project .csproj --mutate "**/.cs" +dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "src//**/*.cs" ``` `StrykerOutput/` (the default output directory) and `artifacts/` are ignored; reports are never committed. diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index bd86614..5ccda36 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-stryker": { - "version": "5.0.0", + "version": "5.1.0", "commands": [ "dotnet-stryker" ], diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 59fff09..716c299 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -127,8 +127,9 @@ jobs: 10.0.x # The version is the repository's own, not this workflow's: .config/dotnet-tools.json pins - # dotnet-stryker to the version stryker-config.json is written for (5.0.0 is the first that speaks - # Microsoft.Testing.Platform, through `--test-runner mtp`), so a local run and this one cannot drift. + # dotnet-stryker to the version stryker-config.json is written for (5.1.0 still speaks + # Microsoft.Testing.Platform through `--test-runner mtp`), so a local run and this one cannot drift. + # 5.1.0 runs in solution context: the solution names the tests and --mutate scopes the layer. - name: Restore the tools run: dotnet tool restore @@ -141,7 +142,8 @@ jobs: mkdir -p "artifacts/mutation/$LAYER" args=( --config-file stryker-config.json - --project "$LAYER.csproj" + --solution SharpCorePDF.slnx + --mutate "src/$LAYER/**/*.cs" --output "artifacts/mutation/$LAYER" ) # A scheduled run passes neither input, and stryker-config.json then decides both. diff --git a/README.md b/README.md index a453aad..372bd50 100644 --- a/README.md +++ b/README.md @@ -473,10 +473,10 @@ encrypted documents the merge engine writes were checked the same way with qpdf, dotnet tool restore # Stryker is a local tool: .config\dotnet-tools.json states the version # One layer of the four under src/ -- the SharpCorePDF project itself is a meta package with no code: -dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Domain.csproj --output artifacts/mutation/Domain +dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "src/SharpCorePDF.Domain/**/*.cs" --output artifacts/mutation/Domain # One file, when one change is the question: -dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Infrastructure.csproj --mutate "**/ImagePixels.cs" +dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "**/ImagePixels.cs" # The reading, out of the report it leaves behind: python .\docs\tools\mutation-summary.py .\artifacts\mutation\Domain\reports\mutation-report.json --detail diff --git a/docs/mutation-testing.md b/docs/mutation-testing.md index f08ec99..c5829d7 100644 --- a/docs/mutation-testing.md +++ b/docs/mutation-testing.md @@ -31,13 +31,13 @@ dotnet tool restore # One layer. The five projects under src/ are four layers and a meta package: SharpCorePDF itself has no # code to mutate. -dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Domain.csproj --output artifacts/mutation/Domain +dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "src/SharpCorePDF.Domain/**/*.cs" --output artifacts/mutation/Domain # One file, when the question is about one file -dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Domain.csproj --mutate "**/PageRange.cs" +dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "**/PageRange.cs" # Only the lines a branch changes against main -dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Domain.csproj --since:main +dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "src/SharpCorePDF.Domain/**/*.cs" --since:main # The reading, out of the report the run leaves behind python ./docs/tools/mutation-summary.py ./artifacts/mutation/Domain/reports/mutation-report.json --detail @@ -128,7 +128,8 @@ baseline would come from. ``` The path is the command that was run: that first sweep predates `.config/dotnet-tools.json`, and installed the -tool with `--tool-path .tools`. The manifest and `.tools/` hold the same 5.0.0, so `dotnet stryker` after +tool with `--tool-path .tools`. The manifest and `.tools/` held the same 5.0.0 at the time; the manifest now +pins 5.1.0, and the solution-context re-run is recorded at the end of this file. `dotnet stryker` after `dotnet tool restore` is the same tool from one pin — which is what the commands above and `mutation.yml` use, and what a clone has without any install step. @@ -781,3 +782,17 @@ What survived, read one by one: and it is the next thing to add if this service's suite is extended. + +## 5.1.0 — the solution-context reading (2026-11-14) + +`dotnet tool update dotnet-stryker --version 5.1.0` moves the harness to a version that runs in solution +context: it finds `SharpCorePDF.slnx`, discovers the test project itself, and refuses a `test-projects` +entry in `stryker-config.json`. The key is gone; the workflow and the commands above name the solution and +scope the layer with `--mutate`. The configuration is otherwise unchanged. + +The scoped reading of `Services/PdfDiagnoserService.cs` with 5.1.0 is **38.46%** (5 killed, 8 survived, +11 compile errors, 13 mutants), against 42.86% on 5.0.0. The survivor set is the same one the 1.7.0 record +names — the redundant null guard, the exception message string, the four `ConfigureAwait` arguments and +the two warning-merge statements — and the single kill that moved is a mutant 5.1.0's Safe Mode rejects +at compile time rather than executes. No test changed, and no new survivor appeared. + diff --git a/docs/parity.md b/docs/parity.md index 4b843e0..ed246c9 100644 --- a/docs/parity.md +++ b/docs/parity.md @@ -278,12 +278,13 @@ delivered by this document. python docs/tools/validate-pdfa.py --verapdf --profile 2b archive-2b.pdf python docs/tools/validate-pdfa.py --verapdf archive-1b.pdf archive-3b.pdf ``` - All ten files report `PASS` — five profiles of each of the two documents — and `compliance.yml` repeats the + All twelve files report `PASS` — six profiles of each of the two documents — and `compliance.yml` repeats the run on every push and once a week with the validator pinned and `--require-version` passed, so the claim cannot age into a sentence in a document. Two more implementations read the same files through `validate-pdfa-cross.py`: Apache PDFBox preflight, - which shares no code with veraPDF and votes on `1b` while parsing `2b`/`3b` without a verdict, and - Ghostscript, which rewrites the document as archival output from what it understood. The agreement has + which shares no code with veraPDF and votes on `1b` while parsing the other profiles without a verdict, + and Ghostscript, which rewrites the document as archival output from what it understood. Neither has a + PDF/A-4 mode, so veraPDF is the only reading of that profile. The agreement has teeth: a `2b` file judged as `1b` is rejected by veraPDF and by PDFBox independently. The earlier 1.30.3 run found one defect the unit tests had not: a CID font subset without a `/CIDSet` stream fails ISO 19005-1 clause 6.3.5-3, and the authoring writer did not emit one. It does diff --git a/stryker-config.json b/stryker-config.json index 4319e6e..96d9f8e 100644 --- a/stryker-config.json +++ b/stryker-config.json @@ -1,8 +1,5 @@ { "stryker-config": { - "test-projects": [ - "tests/SharpCorePDF.Tests/SharpCorePDF.Tests.csproj" - ], "test-runner": "mtp", "target-framework": "net11.0", "configuration": "Release", @@ -22,7 +19,7 @@ "report-file-name": "mutation-report", "break-on-initial-test-failure": true, "mutate": [ - "**/*" + "src/**/*.cs" ] } }