@fairfox/polly 0.80.0 → 0.82.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.
@@ -0,0 +1,11 @@
1
+ import type { MutateConfig } from "./config.ts";
2
+ /** Run Stryker against the resolved config. Inherits stdio for the live reporter; returns the exit code. */
3
+ export declare function runStryker(cfg: MutateConfig): Promise<number>;
4
+ /** Build the useless-test report from an existing mutation.json (no Stryker run). */
5
+ export declare function reportFromFile(cfg: MutateConfig): Promise<string>;
6
+ /**
7
+ * If the Stryker config doesn't already load polly's verify-primitive ignorer,
8
+ * return a one-line tip. The ignorer must be in the config before the run (it's
9
+ * read at Stryker startup), so this advises rather than mutating the user's config.
10
+ */
11
+ export declare function presetAdvisory(cfg: MutateConfig): Promise<string | null>;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Verification artefact for the kill-matrix contract.
3
+ *
4
+ * The whole useless-test analysis rests on one fact: the patched bun runner
5
+ * emits a COMPLETE kill matrix — every test that detects a mutant appears in
6
+ * killedBy, not just the first. That depends on a pinned pair: (Bun version,
7
+ * plugin version + our patch). A Bun upgrade that changes JUnit output, or a
8
+ * patch that stops applying, would silently collapse killedBy to one id each —
9
+ * a green board with the redundancy signal quietly dead (the classic trap).
10
+ *
11
+ * `verifyMatrix` runs the full contract and returns the result; `isMatrixComplete`
12
+ * is the side-effect-free gate the report path consults to decide whether the
13
+ * redundancy/subsumption sections are trustworthy. Run the CLI form after any
14
+ * bump of Bun or the plugin:
15
+ *
16
+ * polly mutate verify # uses the existing report
17
+ * polly mutate verify --run # runs stryker first
18
+ */
19
+ import { type MutationReport } from "./ingest.ts";
20
+ export interface MatrixCheck {
21
+ ok: boolean;
22
+ checks: {
23
+ name: string;
24
+ ok: boolean;
25
+ detail: string;
26
+ }[];
27
+ }
28
+ /**
29
+ * Side-effect-free gate: is the kill matrix trustworthy for redundancy /
30
+ * subsumption analysis? True only when
31
+ * (a) some killed mutant has >1 killer — proof the no-bail patched runner
32
+ * recorded EVERY killer, not just the first (verifyMatrix check #4), and
33
+ * (b) coverage was collected — not every mutant is NoCoverage, which would
34
+ * mean the coverage dump broke (verifyMatrix check #5).
35
+ * Without both, REDUNDANCY/SUBSUMED would be computed off a partial matrix and
36
+ * lie, so the report path falls back to score + gaps + theatre only.
37
+ */
38
+ export declare function isMatrixComplete(report: MutationReport): boolean;
39
+ /**
40
+ * Run the full kill-matrix contract (all five checks), optionally running a
41
+ * fresh Stryker pass first. Returns the result rather than exiting, so callers
42
+ * decide what to do with it; the `import.meta.main` wrapper prints and sets the
43
+ * exit code.
44
+ */
45
+ export declare function verifyMatrix(opts?: {
46
+ reportPath?: string;
47
+ run?: boolean;
48
+ strykerConfig?: string;
49
+ }): Promise<MatrixCheck>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fairfox/polly",
3
- "version": "0.80.0",
3
+ "version": "0.82.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Multi-execution-context framework with reactive state and cross-context messaging for Chrome extensions, PWAs, and worker-based applications",
@@ -62,6 +62,10 @@
62
62
  "import": "./dist/tools/verify/src/stryker/index.js",
63
63
  "types": "./dist/tools/verify/src/stryker/index.d.ts"
64
64
  },
65
+ "./mutate": {
66
+ "import": "./dist/tools/mutate/src/index.js",
67
+ "types": "./dist/tools/mutate/src/index.d.ts"
68
+ },
65
69
  "./test": {
66
70
  "import": "./dist/tools/test/src/index.js",
67
71
  "types": "./dist/tools/test/src/index.d.ts"
@@ -191,7 +195,7 @@
191
195
  "@types/pixelmatch": "5.2.6",
192
196
  "@types/pngjs": "6.0.5",
193
197
  "@types/ws": "8.18.1",
194
- "dompurify": "3.4.2",
198
+ "dompurify": "3.4.10",
195
199
  "elysia": "1.4.28",
196
200
  "fast-check": "4.7.0",
197
201
  "marked": "18.0.3",
@@ -304,13 +308,5 @@
304
308
  "homepage": "https://github.com/AlexJeffcott/polly#readme",
305
309
  "trustedDependencies": [
306
310
  "node-datachannel"
307
- ],
308
- "overrides": {
309
- "basic-ftp": "^5.3.1",
310
- "brace-expansion": "^2.0.3",
311
- "file-type": "^21.3.1",
312
- "ip-address": "^10.1.1",
313
- "minimatch": "^9.0.6",
314
- "uuid": "^14.0.0"
315
- }
311
+ ]
316
312
  }