@systemfsoftware/stryker-js-instrumenter 12.1.0 → 15.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 +56 -0
- package/README.md +10 -8
- package/dist/index.d.mts +956 -914
- package/dist/index.mjs +752 -326
- package/package.json +24 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-instrumenter
|
|
2
2
|
|
|
3
|
+
## 15.0.0
|
|
4
|
+
|
|
5
|
+
The repository's own mutation and test tooling now installs the v20.0.0 release tarballs; the published code and the dependencies a consumer installs are unchanged.
|
|
6
|
+
|
|
7
|
+
Nothing you configure or import changes: the instrumenter's behaviour and published API stay the same.
|
|
8
|
+
|
|
9
|
+
Every `Mutant` now carries a required `probeEligibility`: `Probed { kind }` when a dry run could compute the mutant's value from operands the original code already evaluates (`arithmetic`, `relational`, `unary` or `constant`), otherwise `Unprobed { reason }`. A mutant decoded or constructed without the field reads `Unprobed` with reason `not-decided`. The `Mutant` namespace exports the new schemas.
|
|
10
|
+
|
|
11
|
+
The instrumenter marks `Probed` the `-`, `*`, `/` and `%` arithmetic swaps, swaps of a `<`, `<=`, `>` or `>=` comparison, `+x`/`-x` sign flips, and `true`/`false` replacements of a comparison between two literals. Nothing reads the field yet: mutant statuses and the tests each mutant runs are unchanged.
|
|
12
|
+
|
|
13
|
+
Migration: code that builds a `Mutant` object literal must set `probeEligibility`.
|
|
14
|
+
|
|
15
|
+
AtomicUpdateSplit, SynchronizationRemoval and FinalizerEscape are now default mutators, so a run with no mutator option plants Effect concurrency faults; mutation scores and the set of mutants change. Mutator.optInMutators is removed and stockRegistry.optIn is empty; opt-in is a plugin catalog tier. The replacements use Effect 4 APIs and @systemfsoftware/stryker-js declares effect ^4.0.0 as a peer dependency, so a repository on Effect 3 must list the three in mutator.excludedMutations.
|
|
16
|
+
|
|
17
|
+
## 14.0.0
|
|
18
|
+
|
|
19
|
+
Arid rules now resolve the callee through the file's `effect` imports instead of matching its text. `E.logInfo('x')` after `import * as E from 'effect/Effect'` or `import * as E from 'effect'` (as `E.Effect.logInfo`) is Ignored as `arid-logging: Effect.logInfo`. A bare named import from `effect/Logger`, `effect/Metric`, `effect/Schedule` or `effect/Duration` now counts like the namespace form: `counter('requests')` after `import { counter } from 'effect/Metric'` is Ignored as `arid-telemetry: Metric.counter`. A local or imported `Effect`, `console` or `Date`, or an `Effect` that is never imported, is no longer arid, so its arguments are mutated again.
|
|
20
|
+
|
|
21
|
+
A mutant inside a function is no longer arid because of a call around that function. `Logger.make((options) => ...)` and the body of `Effect.withSpan(Effect.gen(function* () { ... }), 'span')` are mutated again; the `'span'` name is still Ignored. Every non-function argument of `Effect.fn` is Ignored as `arid-telemetry: Effect.fn`, whatever form the span name takes (string, template literal or member expression); the function body is mutated. The `arid-time` entry for `Date.now` is removed: `Date.now()` takes no arguments, so it never matched a mutant. Set `mutator.mutantSetPolicy: 'full'` to keep every arid mutant.
|
|
22
|
+
|
|
23
|
+
Build on effect 4.1.0. effect 4.1.0 removed the `effect/Crypto` module, which the published stryker-js and stryker-js-vitest-runner imported, so a mutation run on effect 4.1.0 failed with ERR_MODULE_NOT_FOUND. Both packages now take random identifiers from `effect/crypto/SecureRandom` (`NodeCrypto.layerSecureRandom`), and the effect peer range is now `^4.1.0`: `effect/crypto/*` does not exist in 4.0.x. Schema classes are branded as @effect/tsgo 0.63.0 requires, the MCP server registers its toolkit through the stdio transport's `registrations` option with a middleware that provides the engine services to each request, and file identity in the case-sensitivity probe is a bigint, as effect 4.1.0 reports it.
|
|
24
|
+
|
|
25
|
+
`ErrorText.errorTextOf` uses the errno format (`<name>: <code> (<syscall>) <stack>`) only when the error carries both a string `code` and a string `syscall`. An error that has a `code` but no `syscall` now renders as `<name>: <message>` followed by its stack, instead of `<name>: <code> (undefined) <stack>`. This covers Node's `ERR_*` errors and tagged errors that expose a reason `code`.
|
|
26
|
+
|
|
27
|
+
The nightly mutation run now also grades the instrumenter and the HTML reporter, so their workflow files are mutated alongside the other shipped packages.
|
|
28
|
+
|
|
29
|
+
Nothing you import changes: the instrumenter API, its options and its output stay the same.
|
|
30
|
+
|
|
31
|
+
## 13.0.0
|
|
32
|
+
|
|
33
|
+
Under the default `mutator.mutantSetPolicy`, a relational comparison in an `if`, loop, or ternary test no longer has its mutants Ignored by the sufficient-set table. That table dropped the complementary operator and one boolean literal at every such site, but its proof assumes numeric operands, which JavaScript does not guarantee. In `if (a < b)` with `a` null and `b` undefined, the dropped `true` mutant enters the branch and no kept mutant does, so a test that killed only that mutant went uncounted. Operands whose `valueOf` has side effects defeat the dropped operators the same way. Those mutants now run.
|
|
34
|
+
|
|
35
|
+
Breaking: default runs plant more active mutants in condition positions, so mutation scores and the set of mutants that run differ from the previous release. The generated mutants and their ids are unchanged. `Instrument.MutateDescriptionSchema` is exported, so a consumer can declare a file's `mutate` field with the same schema the instrumenter uses. The published package manifest lists two more development dependencies. Nothing you import or run from this package changes. Plugins that ignore a mutant must now say why. Each ignore rule id (`Mutant.IgnoreRuleId`) is documented in the schema with what it means and the option that keeps its mutants; the ids are stable.
|
|
36
|
+
|
|
37
|
+
Breaking:
|
|
38
|
+
|
|
39
|
+
- A checker answering `ignored` must give a reason of the form `<rule-id>: <detail>`, or the run fails naming the checker and the mutant. A third-party checker with no rule of its own uses the new `checker` rule: `checker: <detail>`.
|
|
40
|
+
- An ignorer whose `shouldIgnore` returns an empty or non-string reason now fails instrumentation, naming the ignorer, the mutant id, and the file. Return a non-empty string to ignore a mutant, or `undefined` to keep it. Under the default `mutator.mutantSetPolicy`, a relational comparison no longer runs its complement when the matching ordering mutant is kept: for `a < b`, `a >= b` is Ignored because every test that kills `a <= b` also kills it (likewise `>` for `<=`, `<=` for `>`, `<` for `>=`). This holds for every JavaScript operand, `NaN`, `BigInt`, strings, and `valueOf` side effects included. Its status reason reads `redundant-relational: subsumed by <dominator id> (complement): ...` and says what to do next.
|
|
41
|
+
|
|
42
|
+
A plugin `Mutant` gains an optional `subsumption` field: `{ _tag: 'Subsumed', rule, dominators }` on an `Ignored` mutant, or `{ _tag: 'Readmitted', rule, causes }` on one that is not Ignored, because it is re-admitted to run. A `Mutant` whose `subsumption` disagrees with its status does not decode. Set `mutator: { mutantSetPolicy: 'full' }` to run every complement.
|
|
43
|
+
|
|
44
|
+
## 12.1.2
|
|
45
|
+
|
|
46
|
+
Effect moves to `4.0.0-rc.117`, together with the `@effect/*` packages these libraries use. Projects that install `effect` next to them need the same release.
|
|
47
|
+
|
|
48
|
+
- The TypeScript checker and test-runner workers now bundle their own runtime, so the only modules they load from your project are the TypeScript compiler and your test framework.
|
|
49
|
+
- The test-runner plugin supports the framework's fifth major release.
|
|
50
|
+
- The ignorer interface re-exports the `oxc-parser` 0.150 AST, in which `FormalParameterRest.decorators` is `Array<Decorator>`. 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.
|
|
51
|
+
|
|
52
|
+
## 12.1.1
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- Updated dependencies:
|
|
57
|
+
- @systemfsoftware/stryker-js-plugin-interface@14.0.0
|
|
58
|
+
|
|
3
59
|
## 12.1.0
|
|
4
60
|
|
|
5
61
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -20,23 +20,25 @@ File formats resolve through a format registry: `coreFormatRegistry` carries the
|
|
|
20
20
|
|
|
21
21
|
`options.mutantSetPolicy` states which mutant set the run wants and is required: `'default'` is the product default, and `'full'` turns off the mutant-set pruning the instrumenter would otherwise apply, so the run keeps every mutation the selected mutators can plant.
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Effect concurrency mutators
|
|
24
24
|
|
|
25
|
-
Three mutators
|
|
25
|
+
Three default mutators plant Effect concurrency faults:
|
|
26
|
+
|
|
27
|
+
- **AtomicUpdateSplit** turns read-modify-write calls such as `Ref.update` or `SynchronizedRef.modify` into a separate read, a yield, and a separate write, so an interleaved mutation can lose an update.
|
|
28
|
+
- **SynchronizationRemoval** drops the guarding effect of `Semaphore.withPermits`/`withPermit` and `Effect.uninterruptible`, letting code that assumed exclusivity or uninterruptibility run without it.
|
|
29
|
+
- **FinalizerEscape** weakens `Effect.ensuring`, `Effect.onExit`, `Effect.onError`, and `Effect.onInterrupt` so their cleanup no longer runs on interruption.
|
|
30
|
+
|
|
31
|
+
The replacements these mutators plant use Effect 4 APIs. `@systemfsoftware/stryker-js` declares `effect` `^4.0.0` as a peer dependency, so Effect 3 is outside the supported range; a repository on Effect 3 must list the three in `mutator.excludedMutations`:
|
|
26
32
|
|
|
27
33
|
```json
|
|
28
34
|
{
|
|
29
35
|
"mutator": {
|
|
30
|
-
"
|
|
36
|
+
"excludedMutations": ["AtomicUpdateSplit", "SynchronizationRemoval", "FinalizerEscape"]
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
39
|
```
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
- **SynchronizationRemoval** drops the guarding effect of `Semaphore.withPermits`/`withPermit` and `Effect.uninterruptible`, letting code that assumed exclusivity or uninterruptibility run without it.
|
|
37
|
-
- **FinalizerEscape** weakens `Effect.ensuring`, `Effect.onExit`, `Effect.onError`, and `Effect.onInterrupt` so their cleanup no longer runs on interruption.
|
|
38
|
-
|
|
39
|
-
Naming a mutator that does not exist fails the run before instrumentation, as a config failure naming the entry. The replacements these mutators plant use Effect 4 APIs, so a repository on Effect 3.x must not opt in.
|
|
41
|
+
Every stock mutator is default-tier. `mutator.optInMutations` names opt-in entries from a plugin's mutator catalog; naming a stock mutator there, or a mutator no loaded catalog declares, fails the run before instrumentation as a config failure naming the entry.
|
|
40
42
|
|
|
41
43
|
## License
|
|
42
44
|
|