@systemfsoftware/stryker-js-instrumenter 10.0.1 → 11.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @systemfsoftware/stryker-js-instrumenter
2
2
 
3
+ ## 11.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Mutant identity, status, location, coverage and run options are re-exported from `@systemfsoftware/stryker-js-plugin-interface` as `Mutant`; `Mutator` now holds the registry, catalog and selection, and `Source` holds `LineStarts`, `Offset`, `ScriptOrigin` and `Span`. A mutant switch on a conditional's test is printed in parentheses now, so a ternary-test mutant no longer replaces the whole conditional. Mutants ignored by a `// Stryker disable` directive no longer shift the placed replacements beside them, so every activated arm runs its own replacement.
8
+
9
+ Import the moved identity types from the plugin interface.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies:
14
+ - @systemfsoftware/stryker-js-plugin-interface@11.0.0
15
+
3
16
  ## 10.0.1
4
17
 
5
18
  ### Patch Changes
package/README.md CHANGED
@@ -18,6 +18,8 @@ The instrumenter is used internally by the Stryker mutation testing framework to
18
18
 
19
19
  File formats resolve through a format registry: `coreFormatRegistry` carries the built-in `js`/`ts`/`tsx` entries, `frameworkEntryOf` adapts a framework's `Framework` object into an entry, and `registerEntries` folds additions into a registry (an extension already claimed stays with the earlier entry). `instrument(files, options, registry)` and `disableTypeChecks(file, registry)` accept that registry — defaulting to the core one — and `instrument` returns the files it skipped because no entry claimed their extension.
20
20
 
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
+
21
23
  ## Opt-in mutators
22
24
 
23
25
  Three mutators that plant Effect concurrency faults are available on request and stay out of the default set. Enable any subset in your Stryker config:
@@ -34,7 +36,7 @@ Three mutators that plant Effect concurrency faults are available on request and
34
36
  - **SynchronizationRemoval** drops the guarding effect of `Semaphore.withPermits`/`withPermit` and `Effect.uninterruptible`, letting code that assumed exclusivity or uninterruptibility run without it.
35
37
  - **FinalizerEscape** weakens `Effect.ensuring`, `Effect.onExit`, `Effect.onError`, and `Effect.onInterrupt` so their cleanup no longer runs on interruption.
36
38
 
37
- Naming a mutator that does not exist fails the run and lists the names that do. The replacements these mutators plant use Effect 4 APIs, so a repository on Effect 3.x must not opt in.
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.
38
40
 
39
41
  ## License
40
42
 
package/dist/index.d.mts CHANGED
@@ -3,10 +3,12 @@ import * as Result from "effect/Result";
3
3
  import * as S from "effect/Schema";
4
4
  import * as Effect from "effect/Effect";
5
5
  import { Handle, Workflow } from "@systemfsoftware/effect-cell-types";
6
+ import { Mutant, MutatorCatalog, Options } from "@systemfsoftware/stryker-js-plugin-interface";
6
7
  import * as Arr from "effect/Array";
8
+ import { StockCatalog } from "@systemfsoftware/stryker-js-cli-contract";
7
9
  import { EmbeddedDocument, FormatId, Framework, FrameworkContext } from "@systemfsoftware/stryker-framework-interface";
8
- import "oxc-parser";
9
10
  import "@oxc-project/types";
11
+ import "oxc-parser";
10
12
  //#region src/ErrorText.schema.d.ts
11
13
  declare const ErrorText_base: S.Class<ErrorText, S.Struct<{
12
14
  readonly text: S.NonEmptyString;
@@ -1341,57 +1343,6 @@ declare interface YieldExpression$1 extends Span$1 {
1341
1343
  //#region src/Location.schema.d.ts
1342
1344
  declare const Offset: S.Int;
1343
1345
  type Offset = typeof Offset.Type;
1344
- /** A 1-based line: the first line of a file is line 1. */
1345
- declare const Line: S.Int;
1346
- type Line = typeof Line.Type;
1347
- /** A 1-based column: the first character of a line is column 1. */
1348
- declare const Column: S.Int;
1349
- type Column = typeof Column.Type;
1350
- declare const Position: S.Struct<{
1351
- readonly line: S.Int;
1352
- readonly column: S.Int;
1353
- }>;
1354
- type Position = typeof Position.Type;
1355
- declare const Location: S.declare<{
1356
- readonly start: {
1357
- readonly line: number;
1358
- readonly column: number;
1359
- };
1360
- readonly end: {
1361
- readonly line: number;
1362
- readonly column: number;
1363
- };
1364
- }, {
1365
- readonly start: {
1366
- readonly line: number;
1367
- readonly column: number;
1368
- };
1369
- readonly end: {
1370
- readonly line: number;
1371
- readonly column: number;
1372
- };
1373
- }>;
1374
- type Location = typeof Location.Type;
1375
- declare const OpenEndLocation: S.declare<{
1376
- readonly start: {
1377
- readonly line: number;
1378
- readonly column: number;
1379
- };
1380
- readonly end?: {
1381
- readonly line: number;
1382
- readonly column: number;
1383
- } | undefined;
1384
- }, {
1385
- readonly start: {
1386
- readonly line: number;
1387
- readonly column: number;
1388
- };
1389
- readonly end?: {
1390
- readonly line: number;
1391
- readonly column: number;
1392
- } | undefined;
1393
- }>;
1394
- type OpenEndLocation = typeof OpenEndLocation.Type;
1395
1346
  declare const Span: S.declare<{
1396
1347
  readonly start: number;
1397
1348
  readonly end: number;
@@ -1456,6 +1407,94 @@ interface TsxAst extends BaseAst {
1456
1407
  type ScriptAst = JSAst | TSAst | TsxAst;
1457
1408
  type Ast = JSAst | TSAst | TsxAst | EmbeddedAst;
1458
1409
  //#endregion
1410
+ //#region src/Mutator.service.d.ts
1411
+ interface Mutable {
1412
+ mutatorName: string;
1413
+ ignoreReason?: string | undefined;
1414
+ replacement: Node_2;
1415
+ }
1416
+ interface Mutant$1 extends Mutable {
1417
+ readonly id: Mutant.MutantId;
1418
+ readonly fileName: string;
1419
+ readonly original: Node_2;
1420
+ readonly location: Mutant.Location;
1421
+ readonly replacementCode: string;
1422
+ }
1423
+ interface MutatorContext {
1424
+ readonly parent: Node_2 | undefined;
1425
+ readonly grandParent: Node_2 | undefined;
1426
+ readonly ancestors: readonly Node_2[];
1427
+ readonly mutantSetPolicy: Options.MutantSetPolicyType;
1428
+ }
1429
+ /**
1430
+ * One mutator: a pure function from a node to the mutants it produces.
1431
+ *
1432
+ * A function, not an object with a `mutate` method and a `name` field. The name
1433
+ * lived inside every mutator AND as its position in a hand-written list, so the
1434
+ * two could disagree; the registry's key is now the only place a name is
1435
+ * written.
1436
+ */
1437
+ type Mutator = (node: Node_2, context: MutatorContext) => Iterable<Node_2>;
1438
+ interface MutatorOptions {
1439
+ excludedMutations: string[];
1440
+ mutators: MutatorSelection;
1441
+ mutantSetPolicy: Options.MutantSetPolicyType;
1442
+ noHeader?: boolean;
1443
+ }
1444
+ /**
1445
+ * Every mutator this instrumenter can apply, named explicitly.
1446
+ *
1447
+ * This list is deliberately hand-written rather than self-registering. A
1448
+ * registry populated by import side effects — each mutator module calling
1449
+ * `registerMutator(self)` at module scope — makes the mutant population depend
1450
+ * on which imports were evaluated: import order decides the order, a bundler
1451
+ * that judges a side-effect-only import unused drops a mutator entirely, and
1452
+ * anything reading the array before the last import finished sees a short list.
1453
+ * Every one of those failures REMOVES mutants, which RAISES the mutation score,
1454
+ * so the tool reports a better number for doing less work and nothing anywhere
1455
+ * says so.
1456
+ *
1457
+ * Naming each mutator here costs one line when a mutator is added and makes
1458
+ * that line a compile-checked import instead of a runtime effect.
1459
+ *
1460
+ * `optInMutators` below follows the same hand-written rule, for the same
1461
+ * reason: a mutator exists for a run only when a human named it here.
1462
+ */
1463
+ declare const defaultMutators: Readonly<Record<StockCatalog.StockDefaultName, Mutator>>;
1464
+ declare const optInMutators: Readonly<Record<StockCatalog.StockOptInName, Mutator>>;
1465
+ type MutatorEntry = readonly [name: string, mutate: Mutator];
1466
+ interface MutatorRegistry {
1467
+ readonly defaults: Readonly<Record<string, Mutator>>;
1468
+ readonly optIn: Readonly<Record<string, Mutator>>;
1469
+ }
1470
+ declare const stockRegistry: MutatorRegistry;
1471
+ interface RegistryCatalog {
1472
+ readonly entries: ReadonlyArray<{
1473
+ readonly name: string;
1474
+ readonly tier: MutatorCatalog.Tier;
1475
+ }>;
1476
+ }
1477
+ interface RegistryContribution {
1478
+ readonly entries: ReadonlyArray<{
1479
+ readonly name: string;
1480
+ readonly implementation: Mutator;
1481
+ }>;
1482
+ }
1483
+ declare const registryOf: {
1484
+ (catalogs: ReadonlyArray<RegistryCatalog>, contributions: ReadonlyArray<RegistryContribution>): MutatorRegistry;
1485
+ (contributions: ReadonlyArray<RegistryContribution>): (catalogs: ReadonlyArray<RegistryCatalog>) => MutatorRegistry;
1486
+ };
1487
+ interface MutatorSelection {
1488
+ /** Every default, then each opt-in the run named, in the registry's declared order. */
1489
+ readonly active: readonly MutatorEntry[];
1490
+ /** Every name a `Stryker disable` directive may reference, selected or not. */
1491
+ readonly known: readonly string[];
1492
+ }
1493
+ declare const selectMutators: {
1494
+ (registry: MutatorRegistry, optInMutations: readonly string[]): MutatorSelection;
1495
+ (optInMutations: readonly string[]): (registry: MutatorRegistry) => MutatorSelection;
1496
+ };
1497
+ //#endregion
1459
1498
  //#region src/Instrument.schema.d.ts
1460
1499
  declare const InstrumentError_base: S.Class<InstrumentError, S.TaggedStruct<"InstrumentError", {
1461
1500
  readonly message: S.String;
@@ -1464,7 +1503,7 @@ declare const InstrumentError_base: S.Class<InstrumentError, S.TaggedStruct<"Ins
1464
1503
  declare class InstrumentError extends InstrumentError_base {
1465
1504
  get message(): string;
1466
1505
  }
1467
- declare const MutateDescriptionSchema: S.Union<readonly [S.Boolean, S.$Array<S.declare<{
1506
+ declare const MutateDescriptionSchema: S.Union<readonly [S.Boolean, S.$Array<S.decodeTo<S.declare<{
1468
1507
  readonly start: {
1469
1508
  readonly line: number;
1470
1509
  readonly column: number;
@@ -1482,7 +1521,16 @@ declare const MutateDescriptionSchema: S.Union<readonly [S.Boolean, S.$Array<S.d
1482
1521
  readonly line: number;
1483
1522
  readonly column: number;
1484
1523
  };
1485
- }>>]>;
1524
+ }>, S.Struct<{
1525
+ readonly start: S.Struct<{
1526
+ readonly line: S.Int;
1527
+ readonly column: S.Int;
1528
+ }>;
1529
+ readonly end: S.Struct<{
1530
+ readonly line: S.Int;
1531
+ readonly column: S.Int;
1532
+ }>;
1533
+ }>, never, never>>]>;
1486
1534
  type MutateDescription = typeof MutateDescriptionSchema.Type;
1487
1535
  interface FileDescription {
1488
1536
  readonly mutate: MutateDescription;
@@ -1491,10 +1539,13 @@ type FileDescriptions = Record<string, FileDescription>;
1491
1539
  declare const InstrumenterOptionsSchema: S.Struct<{
1492
1540
  readonly excludedMutations: S.$Array<S.String>;
1493
1541
  readonly ignorers: S.$Array<S.Unknown>;
1542
+ readonly mutators: S.Unknown;
1543
+ readonly mutantSetPolicy: S.Literals<readonly ["default", "full"]>;
1494
1544
  readonly noHeader: S.optional<S.Boolean>;
1495
- readonly optInMutations: S.optional<S.$Array<S.String>>;
1496
1545
  }>;
1497
- type InstrumenterOptions = typeof InstrumenterOptionsSchema.Type;
1546
+ type InstrumenterOptions = Omit<typeof InstrumenterOptionsSchema.Type, 'mutators'> & {
1547
+ readonly mutators: MutatorSelection;
1548
+ };
1498
1549
  declare const InstrumentFileSkip_base: S.Class<InstrumentFileSkip, S.TaggedStruct<"InstrumentFileSkip", {
1499
1550
  readonly file: S.String;
1500
1551
  readonly extension: S.String;
@@ -1505,7 +1556,7 @@ declare const InstrumentResult_base: S.Class<InstrumentResult$1, S.TaggedStruct<
1505
1556
  readonly files: S.$Array<S.Struct<{
1506
1557
  readonly name: S.decodeTo<S.brand<S.String, "CanonicalFileName">, S.String, never, never>;
1507
1558
  readonly content: S.String;
1508
- readonly mutate: S.Union<readonly [S.Boolean, S.$Array<S.declare<{
1559
+ readonly mutate: S.Union<readonly [S.Boolean, S.$Array<S.decodeTo<S.declare<{
1509
1560
  readonly start: {
1510
1561
  readonly line: number;
1511
1562
  readonly column: number;
@@ -1523,15 +1574,24 @@ declare const InstrumentResult_base: S.Class<InstrumentResult$1, S.TaggedStruct<
1523
1574
  readonly line: number;
1524
1575
  readonly column: number;
1525
1576
  };
1526
- }>>]>;
1577
+ }>, S.Struct<{
1578
+ readonly start: S.Struct<{
1579
+ readonly line: S.Int;
1580
+ readonly column: S.Int;
1581
+ }>;
1582
+ readonly end: S.Struct<{
1583
+ readonly line: S.Int;
1584
+ readonly column: S.Int;
1585
+ }>;
1586
+ }>, never, never>>]>;
1527
1587
  }>>;
1528
1588
  readonly mutants: S.$Array<S.Struct<{
1529
1589
  readonly _tag: S.tag<"Mutant">;
1530
1590
  readonly id: S.brand<S.String, "MutantId">;
1531
1591
  readonly fileName: S.decodeTo<S.brand<S.String, "CanonicalFileName">, S.String, never, never>;
1532
- readonly mutatorName: S.brand<S.NonEmptyString, "MutatorName">;
1592
+ readonly mutatorName: S.brand<S.String, "MutatorName">;
1533
1593
  readonly replacement: S.String;
1534
- readonly location: S.declare<{
1594
+ readonly location: S.decodeTo<S.declare<{
1535
1595
  readonly start: {
1536
1596
  readonly line: number;
1537
1597
  readonly column: number;
@@ -1549,7 +1609,16 @@ declare const InstrumentResult_base: S.Class<InstrumentResult$1, S.TaggedStruct<
1549
1609
  readonly line: number;
1550
1610
  readonly column: number;
1551
1611
  };
1552
- }>;
1612
+ }>, S.Struct<{
1613
+ readonly start: S.Struct<{
1614
+ readonly line: S.Int;
1615
+ readonly column: S.Int;
1616
+ }>;
1617
+ readonly end: S.Struct<{
1618
+ readonly line: S.Int;
1619
+ readonly column: S.Int;
1620
+ }>;
1621
+ }>, never, never>;
1553
1622
  readonly status: S.optional<S.Literals<readonly ["Killed", "Survived", "NoCoverage", "CompileError", "RuntimeError", "Timeout", "Ignored", "Pending"]>>;
1554
1623
  readonly statusReason: S.optional<S.String>;
1555
1624
  readonly coveredBy: S.optional<S.$Array<S.String>>;
@@ -1592,239 +1661,23 @@ interface PrinterContext {
1592
1661
  print: (file: Ast, context: PrinterContext) => Result.Result<string, PrintFailed>;
1593
1662
  }
1594
1663
  //#endregion
1595
- //#region src/Mutant.schema.d.ts
1596
- declare const MutantStatusSchema: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "CompileError", "RuntimeError", "Timeout", "Ignored", "Pending"]>;
1597
- type MutantStatus = typeof MutantStatusSchema.Type;
1598
- declare const SurvivorStatusSchema: S.Literals<readonly ["Survived", "NoCoverage"]>;
1599
- type SurvivorStatus = typeof SurvivorStatusSchema.Type;
1600
- declare const RememberedStatusSchema: S.Literals<readonly ["Survived", "Killed", "Timeout", "NoCoverage", "Ignored"]>;
1601
- type RememberedStatus = typeof RememberedStatusSchema.Type;
1602
- declare const EphemeralStatusSchema: S.Literals<readonly ["CompileError", "RuntimeError", "Pending"]>;
1603
- type EphemeralStatus = typeof EphemeralStatusSchema.Type;
1604
- declare const ActionableStatusSchema: S.Literals<readonly ["Survived", "NoCoverage", "Timeout", "RuntimeError"]>;
1605
- type ActionableStatus = typeof ActionableStatusSchema.Type;
1606
- declare const MutantId: S.brand<S.String, "MutantId">;
1607
- type MutantId = typeof MutantId.Type;
1608
- declare const MutatorName: S.brand<S.NonEmptyString, "MutatorName">;
1609
- type MutatorName = typeof MutatorName.Type;
1610
- declare const CanonicalFileName: S.decodeTo<S.brand<S.String, "CanonicalFileName">, S.String, never, never>;
1611
- type CanonicalFileName = typeof CanonicalFileName.Type;
1612
- /**
1613
- * A mutant's file location in the mutation-testing-report-schema contract:
1614
- * 1-based line and 1-based column, the same base the JSON report and the
1615
- * machine stream emit. Every producer on the instrument path (node spans,
1616
- * embedded-region shifts) targets this base; no downstream layer converts.
1617
- */
1618
- declare const Mutant$1: S.Struct<{
1619
- readonly _tag: S.tag<"Mutant">;
1620
- readonly id: S.brand<S.String, "MutantId">;
1621
- readonly fileName: S.decodeTo<S.brand<S.String, "CanonicalFileName">, S.String, never, never>;
1622
- readonly mutatorName: S.brand<S.NonEmptyString, "MutatorName">;
1623
- readonly replacement: S.String;
1624
- readonly location: S.declare<{
1625
- readonly start: {
1626
- readonly line: number;
1627
- readonly column: number;
1628
- };
1629
- readonly end: {
1630
- readonly line: number;
1631
- readonly column: number;
1632
- };
1633
- }, {
1634
- readonly start: {
1635
- readonly line: number;
1636
- readonly column: number;
1637
- };
1638
- readonly end: {
1639
- readonly line: number;
1640
- readonly column: number;
1641
- };
1642
- }>;
1643
- readonly status: S.optional<S.Literals<readonly ["Killed", "Survived", "NoCoverage", "CompileError", "RuntimeError", "Timeout", "Ignored", "Pending"]>>;
1644
- readonly statusReason: S.optional<S.String>;
1645
- readonly coveredBy: S.optional<S.$Array<S.String>>;
1646
- readonly static: S.optional<S.Boolean>;
1647
- readonly testsCompleted: S.optional<S.Finite>;
1648
- readonly description: S.optional<S.String>;
1649
- }>;
1650
- type Mutant$1 = typeof Mutant$1.Type;
1651
- declare const MutantFromUnknown: S.compose<S.Struct<{
1652
- readonly _tag: S.tag<"Mutant">;
1653
- readonly id: S.brand<S.String, "MutantId">;
1654
- readonly fileName: S.decodeTo<S.brand<S.String, "CanonicalFileName">, S.String, never, never>;
1655
- readonly mutatorName: S.brand<S.NonEmptyString, "MutatorName">;
1656
- readonly replacement: S.String;
1657
- readonly location: S.declare<{
1658
- readonly start: {
1659
- readonly line: number;
1660
- readonly column: number;
1661
- };
1662
- readonly end: {
1663
- readonly line: number;
1664
- readonly column: number;
1665
- };
1666
- }, {
1667
- readonly start: {
1668
- readonly line: number;
1669
- readonly column: number;
1670
- };
1671
- readonly end: {
1672
- readonly line: number;
1673
- readonly column: number;
1674
- };
1675
- }>;
1676
- readonly status: S.optional<S.Literals<readonly ["Killed", "Survived", "NoCoverage", "CompileError", "RuntimeError", "Timeout", "Ignored", "Pending"]>>;
1677
- readonly statusReason: S.optional<S.String>;
1678
- readonly coveredBy: S.optional<S.$Array<S.String>>;
1679
- readonly static: S.optional<S.Boolean>;
1680
- readonly testsCompleted: S.optional<S.Finite>;
1681
- readonly description: S.optional<S.String>;
1682
- }>, S.Unknown>;
1683
- type MutantFromUnknown = typeof MutantFromUnknown.Type;
1684
- declare const RunOptionsFields: {
1685
- timeout: S.Finite;
1686
- disableBail: S.Boolean;
1687
- };
1688
- declare const MutantActivationSchema: S.Literals<readonly ["runtime", "static"]>;
1689
- type MutantActivation = typeof MutantActivationSchema.Type;
1690
- declare const HitCount: S.Int;
1691
- declare const MutantRunOptionsSchema: S.Struct<{
1692
- readonly timeout: S.Finite;
1693
- readonly disableBail: S.Boolean;
1694
- readonly activeMutant: S.Struct<{
1695
- readonly _tag: S.tag<"Mutant">;
1696
- readonly id: S.brand<S.String, "MutantId">;
1697
- readonly fileName: S.decodeTo<S.brand<S.String, "CanonicalFileName">, S.String, never, never>;
1698
- readonly mutatorName: S.brand<S.NonEmptyString, "MutatorName">;
1699
- readonly replacement: S.String;
1700
- readonly location: S.declare<{
1701
- readonly start: {
1702
- readonly line: number;
1703
- readonly column: number;
1704
- };
1705
- readonly end: {
1706
- readonly line: number;
1707
- readonly column: number;
1708
- };
1709
- }, {
1710
- readonly start: {
1711
- readonly line: number;
1712
- readonly column: number;
1713
- };
1714
- readonly end: {
1715
- readonly line: number;
1716
- readonly column: number;
1717
- };
1718
- }>;
1719
- readonly status: S.optional<S.Literals<readonly ["Killed", "Survived", "NoCoverage", "CompileError", "RuntimeError", "Timeout", "Ignored", "Pending"]>>;
1720
- readonly statusReason: S.optional<S.String>;
1721
- readonly coveredBy: S.optional<S.$Array<S.String>>;
1722
- readonly static: S.optional<S.Boolean>;
1723
- readonly testsCompleted: S.optional<S.Finite>;
1724
- readonly description: S.optional<S.String>;
1725
- }>;
1726
- readonly sandboxFileName: S.String;
1727
- readonly mutantActivation: S.Literals<readonly ["runtime", "static"]>;
1728
- readonly reloadEnvironment: S.Boolean;
1729
- readonly testFilter: S.optionalKey<S.$Array<S.String>>;
1730
- readonly hitLimit: S.optionalKey<S.Int>;
1731
- }>;
1732
- declare const MutantCoverageSchema: S.Struct<{
1733
- readonly perTest: S.$Record<S.String, S.$Record<S.brand<S.String, "MutantId">, S.Int>>;
1734
- readonly static: S.$Record<S.brand<S.String, "MutantId">, S.Int>;
1735
- }>;
1736
- type MutantCoverage = typeof MutantCoverageSchema.Type;
1737
- type CoverageData = Record<string, number>;
1738
- type CoveragePerTestId = Record<string, CoverageData>;
1739
- interface Coverage {
1740
- readonly static: CoverageData;
1741
- readonly perTest: CoveragePerTestId;
1742
- }
1743
- interface RunOptions {
1744
- readonly timeout: number;
1745
- readonly disableBail: boolean;
1746
- }
1747
- interface MutantRunOptions extends RunOptions {
1748
- readonly testFilter?: readonly string[];
1749
- readonly hitLimit?: number;
1750
- readonly activeMutant: Mutant$1;
1751
- readonly sandboxFileName: string;
1752
- readonly mutantActivation: MutantActivation;
1753
- readonly reloadEnvironment: boolean;
1754
- }
1755
- interface EarlyResultPlan {
1756
- readonly plan: 'EarlyResult';
1757
- readonly mutant: Mutant$1;
1758
- }
1759
- interface RunPlan {
1760
- readonly plan: 'Run';
1761
- readonly mutant: Mutant$1;
1762
- readonly runOptions: MutantRunOptions;
1763
- readonly netTime: number;
1764
- }
1765
- type TestPlan = EarlyResultPlan | RunPlan;
1766
- type MutantTestCoverage = Mutant$1 & {
1767
- readonly coveredBy: ReadonlyArray<string> | undefined;
1768
- readonly static: boolean | undefined;
1769
- };
1770
- type RunMutantResult = Mutant$1 & {
1771
- readonly status: MutantStatus;
1772
- readonly statusReason?: string | undefined;
1773
- readonly testsCompleted?: number | undefined;
1774
- readonly killedBy?: readonly string[] | undefined;
1775
- readonly coveredBy?: readonly string[] | undefined;
1776
- readonly static?: boolean | undefined;
1777
- };
1778
- declare const InstrumenterContext_base: S.Class<InstrumenterContext, S.Struct<{
1779
- readonly activeMutant: S.optional<S.String>;
1780
- readonly currentTestId: S.optional<S.String>;
1781
- readonly mutantCoverage: S.optional<S.Struct<{
1782
- readonly perTest: S.$Record<S.String, S.$Record<S.brand<S.String, "MutantId">, S.Int>>;
1783
- readonly static: S.$Record<S.brand<S.String, "MutantId">, S.Int>;
1784
- }>>;
1785
- readonly hitCount: S.optional<S.Int>;
1786
- readonly hitLimit: S.optional<S.Int>;
1787
- }>, {}>;
1788
- declare class InstrumenterContext extends InstrumenterContext_base {
1789
- static readonly NAMESPACE = "__stryker__";
1790
- static readonly MUTATION_COVERAGE_OBJECT = "mutantCoverage";
1791
- static readonly ACTIVE_MUTANT = "activeMutant";
1792
- static readonly CURRENT_TEST_ID = "currentTestId";
1793
- static readonly HIT_COUNT = "hitCount";
1794
- static readonly HIT_LIMIT = "hitLimit";
1795
- static readonly ACTIVE_MUTANT_ENV_VARIABLE = "__STRYKER_ACTIVE_MUTANT__";
1796
- }
1797
- type MutantRunPlan = RunPlan;
1798
- type MutantEarlyResultPlan = EarlyResultPlan;
1799
- type MutantTestPlan = TestPlan;
1800
- //#endregion
1801
- //#region src/Mutator.service.d.ts
1802
- interface Mutable {
1803
- mutatorName: string;
1804
- ignoreReason?: string | undefined;
1805
- replacement: Node_2;
1806
- }
1807
- interface Mutant extends Mutable {
1808
- readonly id: MutantId;
1664
+ //#region src/MutantIdentity.d.ts
1665
+ interface MutantTuple {
1809
1666
  readonly fileName: string;
1810
- readonly original: Node_2;
1811
- readonly location: Location;
1667
+ readonly mutatorName: string;
1668
+ readonly originalCode: string;
1812
1669
  readonly replacementCode: string;
1813
1670
  }
1814
- interface MutatorOptions {
1815
- excludedMutations: string[];
1816
- optInMutations: readonly string[];
1817
- noHeader?: boolean;
1818
- }
1819
1671
  //#endregion
1820
1672
  //#region src/Transformer.service.d.ts
1821
1673
  interface TransformerOptions extends MutatorOptions {
1822
1674
  ignorers: readonly Ignorer[];
1823
1675
  }
1824
1676
  interface MutantCollector {
1825
- readonly nextIndex: number;
1826
- readonly append: (mutants: readonly Mutant[]) => void;
1827
- readonly map: <A>(transform: (mutant: Mutant) => A) => readonly A[];
1677
+ /** 0-based, counting this collector's earlier occurrences of the same tuple. */
1678
+ readonly ordinalOf: (tuple: MutantTuple) => number;
1679
+ readonly append: (mutants: readonly Mutant$1[]) => void;
1680
+ readonly map: <A>(transform: (mutant: Mutant$1) => A) => readonly A[];
1828
1681
  }
1829
1682
  type AstTransformer<T extends Ast = Ast> = (ast: T, mutantCollector: MutantCollector, context: TransformerContext) => Effect.Effect<readonly string[], ParseFailed | InstrumentError>;
1830
1683
  interface TransformerContext {
@@ -1892,7 +1745,7 @@ interface File extends FileDescription {
1892
1745
  }
1893
1746
  interface InstrumentResult {
1894
1747
  files: readonly File[];
1895
- mutants: readonly Mutant$1[];
1748
+ mutants: readonly Mutant.Mutant[];
1896
1749
  skipped: readonly InstrumentFileSkip[];
1897
1750
  }
1898
1751
  declare const instrument: {
@@ -1903,30 +1756,54 @@ declare const disableTypeChecks: {
1903
1756
  (file: File, registry?: FormatRegistry): Effect.Effect<File, InstrumentError>;
1904
1757
  (registry?: FormatRegistry): (file: File) => Effect.Effect<File, InstrumentError>;
1905
1758
  };
1759
+ //#endregion
1760
+ //#region src/InstrumentContext.schema.d.ts
1761
+ declare const InstrumenterContext_base: S.Class<InstrumenterContext, S.Struct<{
1762
+ readonly activeMutant: S.optional<S.String>;
1763
+ readonly currentTestId: S.optional<S.String>;
1764
+ readonly mutantCoverage: S.optional<S.Struct<{
1765
+ readonly perTest: S.$Record<S.String, S.decodeTo<S.$Record<S.brand<S.String, "MutantId">, S.Int>, S.$Record<S.String, S.Int>, never, never>>;
1766
+ readonly static: S.decodeTo<S.$Record<S.brand<S.String, "MutantId">, S.Int>, S.$Record<S.String, S.Int>, never, never>;
1767
+ }>>;
1768
+ readonly hitCount: S.optional<S.Int>;
1769
+ readonly hitLimit: S.optional<S.Int>;
1770
+ }>, {}>;
1771
+ declare class InstrumenterContext extends InstrumenterContext_base {
1772
+ static readonly NAMESPACE = "__stryker__";
1773
+ static readonly MUTATION_COVERAGE_OBJECT = "mutantCoverage";
1774
+ static readonly ACTIVE_MUTANT = "activeMutant";
1775
+ static readonly CURRENT_TEST_ID = "currentTestId";
1776
+ static readonly HIT_COUNT = "hitCount";
1777
+ static readonly HIT_LIMIT = "hitLimit";
1778
+ static readonly ACTIVE_MUTANT_ENV_VARIABLE = "__STRYKER_ACTIVE_MUTANT__";
1779
+ }
1906
1780
  declare namespace mod_d_exports$2 {
1907
- export { File, FileDescription, FileDescriptions, InstrumentError, InstrumentFileSkip, InstrumentResult, InstrumenterOptions, MutateDescription, ParserOptions, disableTypeChecks, instrument };
1781
+ export { File, FileDescription, FileDescriptions, InstrumentError, InstrumentFileSkip, InstrumentResult, InstrumenterContext, InstrumenterOptions, MutateDescription, ParserOptions, disableTypeChecks, instrument };
1908
1782
  }
1909
1783
  //#endregion
1910
1784
  //#region src/Location.d.ts
1911
1785
  export declare const lineStartsOf: (text: string) => LineStarts;
1912
1786
  export declare const positionAt: {
1913
- (lineStarts: LineStarts, offset: Offset): Position;
1914
- (offset: Offset): (lineStarts: LineStarts) => Position;
1787
+ (lineStarts: LineStarts, offset: Offset): Mutant.Position;
1788
+ (offset: Offset): (lineStarts: LineStarts) => Mutant.Position;
1915
1789
  };
1916
1790
  export declare const locationOf: {
1917
- (lineStarts: LineStarts, span: Span): Location;
1918
- (span: Span): (lineStarts: LineStarts) => Location;
1791
+ (lineStarts: LineStarts, span: Span): Mutant.Location;
1792
+ (span: Span): (lineStarts: LineStarts) => Mutant.Location;
1919
1793
  };
1920
1794
  export declare const originAt: {
1921
1795
  (lineStarts: LineStarts, offset: Offset): ScriptOrigin;
1922
1796
  (offset: Offset): (lineStarts: LineStarts) => ScriptOrigin;
1923
1797
  };
1924
1798
  export declare const offsetAt: {
1925
- (lineStarts: LineStarts, position: Position): Option.Option<Offset>;
1926
- (position: Position): (lineStarts: LineStarts) => Option.Option<Offset>;
1799
+ (lineStarts: LineStarts, position: Mutant.Position): Option.Option<Offset>;
1800
+ (position: Mutant.Position): (lineStarts: LineStarts) => Option.Option<Offset>;
1927
1801
  };
1928
1802
  declare namespace mod_d_exports$3 {
1929
- export { ActionableStatus, ActionableStatusSchema, CanonicalFileName, CanonicalFileName as CanonicalFileNameValue, Column, Coverage, CoverageData, CoveragePerTestId, EarlyResultPlan, EphemeralStatus, EphemeralStatusSchema, HitCount, InstrumenterContext, Line, LineStarts, Location, Mutant$1 as Mutant, MutantActivation, MutantActivationSchema, MutantCoverage, MutantCoverageSchema, MutantEarlyResultPlan, MutantFromUnknown, MutantFromUnknown as MutantFromUnknownValue, MutantId, MutantId as MutantIdValue, MutantRunOptions, MutantRunOptionsSchema, MutantRunPlan, MutantStatus, MutantStatusSchema, MutantTestCoverage, MutantTestPlan, MutatorName, MutatorName as MutatorNameValue, Offset, OpenEndLocation, Position, RememberedStatus, RememberedStatusSchema, RunMutantResult, RunOptions, RunOptionsFields, RunPlan, ScriptOrigin, Span, SurvivorStatus, SurvivorStatusSchema, TestPlan };
1803
+ export { Mutator, MutatorContext, MutatorEntry, MutatorRegistry, MutatorSelection, RegistryCatalog, RegistryContribution, defaultMutators, optInMutators, registryOf, selectMutators, stockRegistry };
1804
+ }
1805
+ declare namespace mod_d_exports$4 {
1806
+ export { LineStarts, Offset, ScriptOrigin, Span };
1930
1807
  }
1931
1808
  //#endregion
1932
- export { mod_d_exports as ErrorText, mod_d_exports$1 as Format, mod_d_exports$2 as Instrument, mod_d_exports$3 as Mutant };
1809
+ export { mod_d_exports as ErrorText, mod_d_exports$1 as Format, mod_d_exports$2 as Instrument, mod_d_exports$3 as Mutator, mod_d_exports$4 as Source };