@systemfsoftware/stryker-js-cli-contract 0.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +74 -0
- package/README.md +12 -10
- package/contract/span-taxonomy.json +52 -0
- package/contract/stock-catalog.json +3 -3
- package/contract/stream.schema.json +663 -154
- package/dist/index.d.mts +1839 -55
- package/dist/index.mjs +180 -53
- package/package.json +13 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-cli-contract
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
Tests: the contract version law fetches a treeless clone's missing trees by the base commit, which GitHub serves, not by tree hash, which it refuses.
|
|
6
|
+
|
|
7
|
+
These packages depend on the plugin interface whose Mutant gains a required probeEligibility; nothing they export or do changes.
|
|
8
|
+
|
|
9
|
+
The stock catalog marks AtomicUpdateSplit, SynchronizationRemoval and FinalizerEscape default-tier, and every stock entry is default-tier. StockCatalog.StockOptInName and StockCatalog.StockMutatorName are removed; StockCatalog.StockDefaultName names every stock mutator.
|
|
10
|
+
|
|
11
|
+
`ShardPlan` is version 2 and carries a required `scope`: `Unscoped`, `DiffScoped` with `base`, `head`, `sources` and `files`, or `FullScope` with those and `reason`. A scoped plan's `files` lists the repository-relative paths it schedules mutants in, and `sources` is a SHA-256 digest of each of those paths paired with the git blob digest of the content the working tree holds there, the empty digest for a path the tree no longer holds. Version 1 plans no longer decode, and the `PlanKnown` stream event carries the new shape, so `StreamSchemaVersion` moves to `9.0`.
|
|
12
|
+
|
|
13
|
+
The run stream moves to schema version 10.0: the embedded ShardPlan version 2 scope makes version 9.0 readers reject plans that the stream now carries. Readers that pin schemaVersion 9.0 must move to 10.0.
|
|
14
|
+
|
|
15
|
+
## 1.0.0
|
|
16
|
+
|
|
17
|
+
The span taxonomy names `rpc.typeQuery`, the span a checker worker records when it serves the `typeQuery` RPC. It carries the same `rpc.method` attribute as the other served RPC spans, and the published span-taxonomy document lists it.
|
|
18
|
+
|
|
19
|
+
Regenerate the stream schema on effect 4.1.0, which writes the safe-integer range onto every integer and non-negative integer field (`minimum` 0 and `maximum` 9007199254740991, or both bounds for signed integers). A consumer that validates a stream line against the published document now refuses an integer beyond 2^53 - 1, which the previous document admitted.
|
|
20
|
+
|
|
21
|
+
The run stream moves to schema version 9.0, because the contract version law counts the narrower integer fields as a breaking stream change.
|
|
22
|
+
|
|
23
|
+
The published manifest no longer lists the `released-stryker-js-cli-contract` and `released-stryker-js-plugin-interface` development dependencies. Nothing a consumer imports or runs changes.
|
|
24
|
+
|
|
25
|
+
Tests: the contract version law finds its released baseline with one fetch from a treeless clone.
|
|
26
|
+
|
|
27
|
+
The verdict on the mutation score now runs inside its own span, `stryker.mutationReporting.judgeScore`, which the span taxonomy declares. The verdict's log lines are recorded as events under that span instead of directly on `stryker.mutationReporting.reportAll`. Exit codes and log text are as before: a score below `thresholds.break` exits 1, a score equal to it passes, and a reporter that fails on the final report still exits 3 when the score is also below the threshold.
|
|
28
|
+
|
|
29
|
+
The span taxonomy names `stryker.report.sarif`, the span the built-in SARIF reporter records while it reads the finished report and writes `mutation.sarif`. The published span-taxonomy document lists it.
|
|
30
|
+
|
|
31
|
+
`RunEvent.RunEventWireText` decodes the whole machine-mode output of a run into its run events. Blank and whitespace-only lines are skipped, and the first line that is not a run event is refused at its 0-based line position. Encoding writes one wire line per event.
|
|
32
|
+
|
|
33
|
+
The sandbox is acquired the same way as before: in place or copied, with the same backup restore, build command and node_modules links. `stryker.sandbox.build.run` and `stryker.sandbox.symlink_node_modules` still sit inside `stryker.sandbox.acquire`, the symlink span and its "Start symlink node_modules" debug line still appear on every run, and an in-place run still restores its original files when the sandbox closes. The copy and preprocessing step inside the acquisition now has its own span, `stryker.sandbox.prepare`, which the span taxonomy declares.
|
|
34
|
+
|
|
35
|
+
## 0.5.0
|
|
36
|
+
|
|
37
|
+
The verdict line's `phaseDurations` gains `check` and `reporting`. `check` is checker-busy wall-clock (the union of the intervals in which any checker was starting or checking); it overlaps the other phases, and a run with no checker configured reports `{ "_tag": "not-run" }` rather than zero. `reporting` runs from the end of mutant execution to the verdict, so `mutation-test` now stops where `reporting` starts, and the five sequential phases add up to the elapsed time.
|
|
38
|
+
|
|
39
|
+
Breaking:
|
|
40
|
+
|
|
41
|
+
- The stream emits a `phase` event for `reporting`, so `RunPhase` gains that value; exhaustive matches over `RunPhase` must handle it.
|
|
42
|
+
- `mutation-test` no longer includes reporting time.
|
|
43
|
+
- Verdict lines written before this release decode both new members as `{ "_tag": "not-recorded" }`. The published package manifest lists three more development dependencies. Nothing you import or run from this package changes. Tests: the contract version law checks the released documents against the version main declares, not the committed one. A version PR is now judged by the version it declares instead of being refused as a stale baseline. A pin that lags main's version is still refused. Without `origin/main` the law reports `main-baseline-unavailable` with `git fetch origin main` as the next step, and the package's test task is no longer cached. No shipped file changes. Every machine-stream mutant line now carries `statusReason`. An Ignored line names the rule that removed it as `<rule-id>: <detail>` (for example `arid-logging: Effect.logInfo`); other statuses carry their note or `null`. `stryker merge` keeps the reason in the JSON report.
|
|
44
|
+
|
|
45
|
+
Breaking:
|
|
46
|
+
|
|
47
|
+
- The stream `schemaVersion` is now `8.0`, which also adds the `subsumption` key. A mutant line without `statusReason`, or an Ignored line whose reason names no known rule, is refused. `stryker merge` refuses a shard stream of another major version, naming both versions.
|
|
48
|
+
- `RunEvent.RunMutantTestedEvent` carries `statusReason`. Building or decoding an Ignored event whose reason names no ignore rule fails.
|
|
49
|
+
- `RunEvent.RunEvent` is a tagged union keyed by `_tag`: use its `cases`, `guards` and `match` to handle each event kind. **Breaking:** the run stream moves to schema version `8.0`. Every `mutant` line has a required `subsumption` key: `null`, a `Subsumed` reference (rule and dominator ids) on an Ignored line, or a `Readmitted` reference (rule, each dominator and its cause code) on a line that is not Ignored. A line that lacks the key or whose reference disagrees with its status is refused. `stryker merge` refuses a `7.0` shard stream and keeps `subsumption` in the merged report. Read the key, or set `mutator: { mutantSetPolicy: 'full' }` to get only `null`.
|
|
50
|
+
|
|
51
|
+
The incremental report keeps the reference on each record, and a record carrying one is never remembered: it counts under the new reuse refusal `decidedPerRun`.
|
|
52
|
+
|
|
53
|
+
Subsumed mutants are Ignored, so the mutation score covers only the kept mutants and differs from a `full`-policy run.
|
|
54
|
+
|
|
55
|
+
## 0.4.0
|
|
56
|
+
|
|
57
|
+
An incremental run now reuses `CompileError` verdicts instead of type-checking
|
|
58
|
+
every one again. A verdict is kept only while nothing that fed the check
|
|
59
|
+
changed: the mutant and its replacement, every file the checker's TypeScript
|
|
60
|
+
program loaded (including transitive and bundled declaration files), every
|
|
61
|
+
tsconfig in the `extends` chain and its project references, the TypeScript
|
|
62
|
+
version, the checker version and its options. Otherwise the mutant is
|
|
63
|
+
re-checked. The reuse stream line reports such refusals as `programChanged`
|
|
64
|
+
(or `closureAnalysisFailed` when the closure analysis failed); lines without a
|
|
65
|
+
count still decode.
|
|
66
|
+
|
|
67
|
+
Breaking: a configured checker must answer the new `digest` RPC, so upgrade
|
|
68
|
+
checker plugins together with this release. A `plan` stream line can now carry a `projects` array naming, for every planned project, how many mutants were reused, how many will run, the refused count per reason, and the reason a whole incremental report was discarded. The machine stream version is unchanged: a stream line without `projects` still decodes, and consumers that read reuse numbers from a plan can now see why a plan scheduled work it expected to reuse. The published package now includes its changelog. Enable the `@effect/language-service` tsgo plugin in every source package's `tsconfig.app.json` and `tsconfig.test.json`, and bump `@effect/tsgo` to `^0.50.0`. This turns on Effect-aware diagnostics during `effect-tsgo` type checking; it changes no runtime behaviour or public API.
|
|
69
|
+
|
|
70
|
+
## 0.3.1
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Updated dependencies:
|
|
75
|
+
- @systemfsoftware/stryker-js-plugin-interface@14.0.0
|
|
76
|
+
|
|
3
77
|
## 0.3.0
|
|
4
78
|
|
|
5
79
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -16,20 +16,22 @@ pnpm add @systemfsoftware/stryker-js-cli-contract
|
|
|
16
16
|
|
|
17
17
|
The package groups its exports into namespaces. `RunEvent` holds the machine
|
|
18
18
|
stream: the `RunEvent` union of every event kind the CLI emits, each event's
|
|
19
|
-
class,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
`
|
|
27
|
-
|
|
19
|
+
class, two newline-delimited JSON codecs, and `StreamSchemaVersion` (`10.0`, the
|
|
20
|
+
version the stream declares). `RunEventWireLine` reads one line. `RunEventWireText`
|
|
21
|
+
reads a whole stdout: it skips blank and whitespace-only lines, and it refuses the
|
|
22
|
+
first other line that is not an event, at that line's 0-based position.
|
|
23
|
+
`OutputMode` holds the output mode and its signal (`OutputMode`, `ModeSignal`) as
|
|
24
|
+
the stream header carries them. `StockCatalog` holds the stock mutator catalog,
|
|
25
|
+
every entry of which is default-tier, and its name vocabulary (`StockCatalog`,
|
|
26
|
+
`StockDefaultName`). `SpanTaxonomy` holds the names the CLI's traces use and each
|
|
27
|
+
member's attributes (`Spans`, `SpanName`, `SpanMember`, `spanMembers`), plus
|
|
28
|
+
`rpcServedSpanOf` for the RPC method spans a plugin worker serves.
|
|
28
29
|
|
|
29
30
|
```ts
|
|
30
31
|
import { RunEvent } from '@systemfsoftware/stryker-js-cli-contract'
|
|
31
32
|
|
|
32
|
-
const
|
|
33
|
+
const event = Schema.decodeUnknownResult(RunEvent.RunEventWireLine)(line)
|
|
34
|
+
const events = Schema.decodeUnknownResult(RunEvent.RunEventWireText)(stdout)
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
## Published documents
|
|
@@ -16,6 +16,15 @@
|
|
|
16
16
|
"name": "stryker.checker.check_plans",
|
|
17
17
|
"attributes": {}
|
|
18
18
|
},
|
|
19
|
+
{
|
|
20
|
+
"id": "stryker.checker.digest",
|
|
21
|
+
"name": "stryker.checker.digest",
|
|
22
|
+
"attributes": {
|
|
23
|
+
"stryker.checker.name": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
19
28
|
{
|
|
20
29
|
"id": "stryker.checker.group",
|
|
21
30
|
"name": "stryker.checker.group",
|
|
@@ -43,6 +52,11 @@
|
|
|
43
52
|
"name": "stryker.checker_pool.check_plans",
|
|
44
53
|
"attributes": {}
|
|
45
54
|
},
|
|
55
|
+
{
|
|
56
|
+
"id": "stryker.checker_pool.program_digest",
|
|
57
|
+
"name": "stryker.checker_pool.program_digest",
|
|
58
|
+
"attributes": {}
|
|
59
|
+
},
|
|
46
60
|
{
|
|
47
61
|
"id": "stryker.checker_pool.split_checked",
|
|
48
62
|
"name": "stryker.checker_pool.split_checked",
|
|
@@ -312,6 +326,11 @@
|
|
|
312
326
|
"name": "stryker.mutationReporting.emitVerdict",
|
|
313
327
|
"attributes": {}
|
|
314
328
|
},
|
|
329
|
+
{
|
|
330
|
+
"id": "stryker.mutationReporting.judgeScore",
|
|
331
|
+
"name": "stryker.mutationReporting.judgeScore",
|
|
332
|
+
"attributes": {}
|
|
333
|
+
},
|
|
315
334
|
{
|
|
316
335
|
"id": "stryker.mutationReporting.manifestVersion",
|
|
317
336
|
"name": "stryker.mutationReporting.manifestVersion",
|
|
@@ -549,6 +568,11 @@
|
|
|
549
568
|
"name": "stryker.report.progress.consumeEvent",
|
|
550
569
|
"attributes": {}
|
|
551
570
|
},
|
|
571
|
+
{
|
|
572
|
+
"id": "stryker.report.sarif",
|
|
573
|
+
"name": "stryker.report.sarif",
|
|
574
|
+
"attributes": {}
|
|
575
|
+
},
|
|
552
576
|
{
|
|
553
577
|
"id": "stryker.reporterStream.attach",
|
|
554
578
|
"name": "stryker.reporterStream.attach",
|
|
@@ -657,6 +681,15 @@
|
|
|
657
681
|
"name": "RpcClient.onEventBatch",
|
|
658
682
|
"attributes": {}
|
|
659
683
|
},
|
|
684
|
+
{
|
|
685
|
+
"id": "rpc.digest",
|
|
686
|
+
"name": "rpc.digest",
|
|
687
|
+
"attributes": {
|
|
688
|
+
"rpc.method": {
|
|
689
|
+
"type": "string"
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
660
693
|
{
|
|
661
694
|
"id": "rpc.dryRun",
|
|
662
695
|
"name": "rpc.dryRun",
|
|
@@ -751,6 +784,15 @@
|
|
|
751
784
|
"name": "RpcServer.onEventBatch",
|
|
752
785
|
"attributes": {}
|
|
753
786
|
},
|
|
787
|
+
{
|
|
788
|
+
"id": "rpc.typeQuery",
|
|
789
|
+
"name": "rpc.typeQuery",
|
|
790
|
+
"attributes": {
|
|
791
|
+
"rpc.method": {
|
|
792
|
+
"type": "string"
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
},
|
|
754
796
|
{
|
|
755
797
|
"id": "stryker.run.conclude",
|
|
756
798
|
"name": "stryker.run.conclude",
|
|
@@ -866,6 +908,11 @@
|
|
|
866
908
|
"name": "stryker.sandbox.move_entry",
|
|
867
909
|
"attributes": {}
|
|
868
910
|
},
|
|
911
|
+
{
|
|
912
|
+
"id": "stryker.sandbox.prepare",
|
|
913
|
+
"name": "stryker.sandbox.prepare",
|
|
914
|
+
"attributes": {}
|
|
915
|
+
},
|
|
869
916
|
{
|
|
870
917
|
"id": "stryker.sandbox.preprocess.disable_type_checks",
|
|
871
918
|
"name": "stryker.sandbox.preprocess.disable_type_checks",
|
|
@@ -1059,6 +1106,11 @@
|
|
|
1059
1106
|
"name": "typescript-checker.compiler.nodes",
|
|
1060
1107
|
"attributes": {}
|
|
1061
1108
|
},
|
|
1109
|
+
{
|
|
1110
|
+
"id": "typescript-checker.compiler.programDigest",
|
|
1111
|
+
"name": "typescript-checker.compiler.programDigest",
|
|
1112
|
+
"attributes": {}
|
|
1113
|
+
},
|
|
1062
1114
|
{
|
|
1063
1115
|
"id": "typescript-checker.compiler.scoped",
|
|
1064
1116
|
"name": "typescript-checker.compiler.scoped",
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
{
|
|
341
341
|
"id": "atomic-update-split",
|
|
342
342
|
"name": "AtomicUpdateSplit",
|
|
343
|
-
"tier": "
|
|
343
|
+
"tier": "default",
|
|
344
344
|
"definition": "A `Ref` or `SynchronizedRef` atomic update — `modify`, `modifySome`, `update`, `updateSome`, `updateAndGet`, `getAndUpdate` — is split into a read, a snapshot update and a write, so a lost update survives. The `Effect` module has to be in scope, and the reference and the handler have to be movable.",
|
|
345
345
|
"examples": [
|
|
346
346
|
{
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
{
|
|
365
365
|
"id": "synchronization-removal",
|
|
366
366
|
"name": "SynchronizationRemoval",
|
|
367
|
-
"tier": "
|
|
367
|
+
"tier": "default",
|
|
368
368
|
"definition": "The lock a call takes is dropped: `Semaphore.withPermits(sem, n, effect)` and `Semaphore.withPermit(sem, effect)` become the guarded effect, their piped forms become `self => self`, `Effect.uninterruptible(effect)` becomes `effect`, and `Effect.uninterruptibleMask(f)` becomes `Effect.suspend(() => f(Effect.interruptible))`. A guard that is not droppable, and a method-form call whose guard is built on the spot, are refused.",
|
|
369
369
|
"examples": [
|
|
370
370
|
{
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
{
|
|
395
395
|
"id": "finalizer-escape",
|
|
396
396
|
"name": "FinalizerEscape",
|
|
397
|
-
"tier": "
|
|
397
|
+
"tier": "default",
|
|
398
398
|
"definition": "A finalizer is kept only for the path that did not interrupt: `Effect.ensuring(effect, fin)` re-runs `fin` when the exit was not an interruption, `Effect.onError(effect, h)` re-runs `h` when the cause carries none, a release bracket wraps its release the same way, and `Effect.onInterrupt(effect, h)` drops the handler. A handler built by a call, and a cleanup that yields while it is moved, are refused.",
|
|
399
399
|
"examples": [
|
|
400
400
|
{
|