@fairfox/polly 0.91.0 → 0.92.1
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/dist/cli/polly.js +3 -3
- package/dist/cli/polly.js.map +3 -3
- package/dist/gallery/gallery.css +2 -2
- package/dist/gallery/gallery.js +248 -241
- package/dist/src/background/index.js +27 -11
- package/dist/src/background/index.js.map +2 -2
- package/dist/src/background/message-router.js +27 -11
- package/dist/src/background/message-router.js.map +2 -2
- package/dist/src/client/index.js +56 -56
- package/dist/src/client/index.js.map +4 -4
- package/dist/src/elysia/index.js +16 -7
- package/dist/src/elysia/index.js.map +4 -4
- package/dist/src/elysia/plugin.d.ts +4 -4
- package/dist/src/index.js +27 -11
- package/dist/src/index.js.map +2 -2
- package/dist/src/mesh.js +2 -2
- package/dist/src/mesh.js.map +3 -3
- package/dist/src/peer.js +6 -6
- package/dist/src/peer.js.map +3 -3
- package/dist/src/polly-ui/index.css +2 -2
- package/dist/src/polly-ui/markdown.js +1844 -1010
- package/dist/src/polly-ui/markdown.js.map +5 -5
- package/dist/src/polly-ui/styles.css +2 -2
- package/dist/src/shared/adapters/index.js +27 -11
- package/dist/src/shared/adapters/index.js.map +2 -2
- package/dist/src/shared/lib/context-helpers.js +27 -11
- package/dist/src/shared/lib/context-helpers.js.map +2 -2
- package/dist/src/shared/lib/message-bus.js +27 -11
- package/dist/src/shared/lib/message-bus.js.map +2 -2
- package/dist/src/shared/lib/resource.js +17 -1
- package/dist/src/shared/lib/resource.js.map +2 -2
- package/dist/src/shared/lib/state.js +17 -1
- package/dist/src/shared/lib/state.js.map +2 -2
- package/dist/src/shared/state/app-state.js +17 -1
- package/dist/src/shared/state/app-state.js.map +2 -2
- package/dist/tools/bdd/src/cli.js +20 -2
- package/dist/tools/bdd/src/cli.js.map +4 -4
- package/dist/tools/bdd/src/index.js +20 -2
- package/dist/tools/bdd/src/index.js.map +3 -3
- package/dist/tools/init/templates/pwa/package.json.template +2 -3
- package/dist/tools/mutate/src/args.d.ts +25 -3
- package/dist/tools/mutate/src/cli.js +3238 -312
- package/dist/tools/mutate/src/cli.js.map +32 -12
- package/dist/tools/mutate/src/config.d.ts +13 -2
- package/dist/tools/mutate/src/define.d.ts +76 -0
- package/dist/tools/mutate/src/engine/ast.d.ts +13 -0
- package/dist/tools/mutate/src/engine/baseline.d.ts +20 -0
- package/dist/tools/mutate/src/engine/cache.d.ts +32 -0
- package/dist/tools/mutate/src/engine/coverage.d.ts +60 -0
- package/dist/tools/mutate/src/engine/generate.d.ts +23 -0
- package/dist/tools/mutate/src/engine/graph.d.ts +11 -0
- package/dist/tools/mutate/src/engine/index.d.ts +16 -0
- package/dist/tools/mutate/src/engine/junit.d.ts +38 -0
- package/dist/tools/mutate/src/engine/operators.d.ts +14 -0
- package/dist/tools/mutate/src/engine/preload.d.ts +10 -0
- package/dist/tools/mutate/src/engine/preload.js +180 -0
- package/dist/tools/mutate/src/engine/preload.js.map +10 -0
- package/dist/tools/mutate/src/engine/probes.d.ts +12 -0
- package/dist/tools/mutate/src/engine/report-writer.d.ts +44 -0
- package/dist/tools/mutate/src/engine/runner.d.ts +31 -0
- package/dist/tools/mutate/src/engine/stray-writes.d.ts +25 -0
- package/dist/tools/mutate/src/engine/typecheck.d.ts +37 -0
- package/dist/tools/mutate/src/engine/types.d.ts +191 -0
- package/dist/tools/mutate/src/engine/verify-callsites.d.ts +9 -0
- package/dist/tools/mutate/src/engine/workdir.d.ts +16 -0
- package/dist/tools/mutate/src/engine-config.d.ts +7 -0
- package/dist/tools/mutate/src/index.d.ts +7 -3
- package/dist/tools/mutate/src/index.js +2821 -193
- package/dist/tools/mutate/src/index.js.map +26 -7
- package/dist/tools/mutate/src/ingest.d.ts +30 -1
- package/dist/tools/mutate/src/init.d.ts +2 -1
- package/dist/tools/mutate/src/migrate.d.ts +32 -0
- package/dist/tools/mutate/src/report.d.ts +3 -0
- package/dist/tools/mutate/src/run.d.ts +17 -8
- package/dist/tools/mutate/src/verify-matrix.d.ts +12 -15
- package/dist/tools/quality/src/cli.js +9 -9
- package/dist/tools/quality/src/cli.js.map +4 -4
- package/dist/tools/quality/src/index.js +9 -9
- package/dist/tools/quality/src/index.js.map +4 -4
- package/dist/tools/quality/src/no-tautology-ensures.d.ts +2 -2
- package/dist/tools/quality/src/plugins/import-checks.d.ts +1 -1
- package/dist/tools/test/src/adapters/index.js +3 -2
- package/dist/tools/test/src/adapters/index.js.map +3 -3
- package/dist/tools/test/src/coverage-policy/cli.d.ts +2 -2
- package/dist/tools/test/src/coverage-policy/cli.js +217 -17
- package/dist/tools/test/src/coverage-policy/cli.js.map +7 -5
- package/dist/tools/test/src/coverage-policy/index.d.ts +1 -1
- package/dist/tools/test/src/coverage-policy/index.js +213 -12
- package/dist/tools/test/src/coverage-policy/index.js.map +7 -5
- package/dist/tools/test/src/coverage-policy/mutate-targets.d.ts +29 -12
- package/dist/tools/test/src/e2e-mesh/index.js +6 -6
- package/dist/tools/test/src/e2e-mesh/index.js.map +4 -4
- package/dist/tools/test/src/e2e-relay/index.js +230 -226
- package/dist/tools/test/src/e2e-relay/index.js.map +7 -7
- package/dist/tools/test/src/index.js +3 -2
- package/dist/tools/test/src/index.js.map +3 -3
- package/dist/tools/test/src/visual/index.js +684 -511
- package/dist/tools/test/src/visual/index.js.map +11 -11
- package/dist/tools/verify/src/cli.js +17 -2
- package/dist/tools/verify/src/cli.js.map +4 -4
- package/dist/tools/verify/src/config.d.ts +1 -1
- package/dist/tools/verify/src/config.js +68 -3
- package/dist/tools/verify/src/config.js.map +4 -4
- package/dist/tools/verify/src/primitives/index.d.ts +34 -0
- package/dist/tools/visualize/src/cli.js +16 -1
- package/dist/tools/visualize/src/cli.js.map +3 -3
- package/package.json +29 -39
- package/dist/tools/verify/src/stryker/index.d.ts +0 -32
- package/dist/tools/verify/src/stryker/index.js +0 -86
- package/dist/tools/verify/src/stryker/index.js.map +0 -10
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../tools/mutate/src/
|
|
3
|
+
"sources": ["../tools/mutate/src/cli.ts", "../tools/test/src/coverage-policy/mutate-targets.ts", "../src/shared/lib/guards.ts", "../tools/mutate/src/define.ts", "../tools/mutate/src/args.ts", "../tools/mutate/src/config.ts", "../tools/mutate/src/migrate.ts", "../tools/mutate/src/decisions.ts", "../tools/mutate/src/ingest.ts", "../tools/mutate/src/init.ts", "../tools/mutate/src/run.ts", "../tools/mutate/src/engine/index.ts", "../tools/mutate/src/engine/baseline.ts", "../tools/mutate/src/engine/junit.ts", "../tools/mutate/src/engine/runner.ts", "../tools/mutate/src/engine/workdir.ts", "../tools/mutate/src/engine/cache.ts", "../tools/mutate/src/engine/coverage.ts", "../tools/mutate/src/engine/probes.ts", "../tools/mutate/src/engine/ast.ts", "../tools/mutate/src/engine/generate.ts", "../tools/mutate/src/engine/operators.ts", "../tools/mutate/src/engine/verify-callsites.ts", "../tools/mutate/src/engine/graph.ts", "../tools/mutate/src/engine/report-writer.ts", "../tools/mutate/src/engine/stray-writes.ts", "../tools/mutate/src/engine/typecheck.ts", "../tools/mutate/src/engine-config.ts", "../tools/mutate/src/report.ts", "../tools/mutate/src/verify-matrix.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n *
|
|
6
|
-
"/**\n *
|
|
7
|
-
"/**\n *
|
|
5
|
+
"#!/usr/bin/env bun\n/**\n * `polly mutate` — run mutation testing and surface useless/redundant\n * tests (the inverse reading of the kill matrix). Thin dispatcher over the\n * reusable functions in this directory.\n */\nimport { resolve } from \"node:path\";\nimport { findStrykerConfigs } from \"../../test/src/coverage-policy/mutate-targets.ts\";\nimport { parseMutateArgs } from \"./args.ts\";\nimport { resolveMutateConfig } from \"./config.ts\";\nimport { decide, status } from \"./decisions.ts\";\nimport { buildDb, loadMutationReport } from \"./ingest.ts\";\nimport { initConfig } from \"./init.ts\";\nimport { migrateConfig } from \"./migrate.ts\";\nimport { reportFromFile, resolveEngine, runBunEngine } from \"./run.ts\";\nimport { verifyMatrix } from \"./verify-matrix.ts\";\n\nconst HELP = `polly mutate — mutation testing + useless-test detection\n\nMutation testing breaks your code one edit at a time and checks whether a test\nfails; a surviving mutant is a line no test pins down — a truer signal than line\ncoverage, which only proves a line ran. Read the same kill matrix the other way\nand it also finds dead weight: redundant tests (every kill caught elsewhere) and\ntheatre (code a test ran but never actually checked). How the matrix is built:\ntools/mutate/README.md.\n\nUsage:\n polly mutate init [--force] Scaffold a polly.mutate.ts for this project\n polly mutate migrate [--write] Convert stryker.conf.json to polly.mutate.ts (prints it\n unless --write; --force overwrites an existing one)\n polly mutate [run] Run mutation testing, then print the useless-test report\n polly mutate report Print the report from an existing mutation.json\n polly mutate decisions Review verdicts: needs-review / stale / settled\n polly mutate decisions decide <file> <keep|prune|rewrite|investigate> \"<rationale>\"\n polly mutate verify [--run] Assert the kill-matrix contract (exit 1 on drift)\n polly mutate help Show this help\n\nFlags:\n --config <path> polly.mutate.ts, or a stryker.conf.json (default: ./polly.mutate.ts,\n else the discovered Stryker config, deprecated)\n --report <path> mutation report JSON (default: reports/mutation/mutation.json)\n --decisions <path> verdict log (default: .polly/test-debt/decisions.jsonl)\n --db <path> intermediate SQLite (default: in-memory)\n --no-report 'run' only — skip the analysis\n --files <a,b> mutate only these files (globs and :from-to ranges allowed)\n --since <git-ref> mutate only targets changed since the ref\n --in-tree run tests in the project dir, not a scratch cwd\n --concurrency <n> parallel test processes (default: config, else cores-1)\n --mode <fast|matrix> fast stops each run at the first failing test (default\n unless the config sets mode);\n matrix runs every test and records each killer (the kill matrix)\n --coverage <dynamic|static> dynamic (default) runs one probed pass to find the\n tests that run each mutant, and marks unrun code NoCoverage;\n static runs every test file that imports the target\n --no-cache rerun targets whose inputs are unchanged\n --no-typecheck run mutants the project's tsconfig rejects (default: report\n them CompileError without a run; needs typescript-7)\n --contracts <off|ensures|all> POLLY_CONTRACTS for every test process: a false\n requires/ensures throws, so each contract kills the mutants\n that falsify it (default all; ensures leaves requires inert;\n a baseline that violates a contract stops the run)\n -h, --help\n\nThe redundancy/subsumption sections need a COMPLETE kill matrix ('--mode matrix').\nWithout it the report degrades\nto score + gaps + theatre; 'polly mutate verify' diagnoses the matrix\n('verify --run' runs a matrix pass first).`;\n\nasync function openDb(\n reportPath: string,\n dbPath: string\n): Promise<ReturnType<typeof buildDb> | null> {\n if (!(await Bun.file(reportPath).exists())) {\n console.log(\n `no mutation report at ${reportPath}. Run 'polly mutate run' first, or pass --report <path>.`\n );\n return null;\n }\n return buildDb(await loadMutationReport(reportPath), dbPath);\n}\n\nasync function init(cwd: string, force: boolean): Promise<number> {\n const result = await initConfig(cwd, { force });\n if (!result.created) {\n console.log(`${result.configPath} already exists. Re-run with --force to overwrite.`);\n return 1;\n }\n console.log(`✓ wrote ${result.configPath}`);\n console.log(` import: ${result.specifier}`);\n console.log(` targets: ${result.mutate.join(\", \")}`);\n console.log(` tests: ${result.testGlob}`);\n for (const w of result.warnings) console.log(` ⚠ ${w}`);\n console.log(\"\\nNext: polly mutate run\");\n return 0;\n}\n\nasync function migrate(cwd: string, args: ReturnType<typeof parseMutateArgs>): Promise<number> {\n const strykerPath = args.config\n ? resolve(cwd, args.config)\n : ((await findStrykerConfigs(cwd))[0] ?? null);\n if (!strykerPath) {\n console.log(\"no stryker.conf.json found — pass --config <path>\");\n return 1;\n }\n const result = await migrateConfig(strykerPath, { write: args.write, force: args.force });\n for (const n of result.notes) console.log(`note: ${n}`);\n if (!args.write) {\n console.log(`\\n// ${result.path}\\n${result.source}`);\n console.log(\"Re-run with --write to write it.\");\n return 0;\n }\n if (!result.written) {\n console.log(`${result.path} already exists. Re-run with --force to overwrite.`);\n return 1;\n }\n console.log(`✓ wrote ${result.path}`);\n console.log(` ${strykerPath} is no longer read once polly.mutate.ts exists; delete it.`);\n return 0;\n}\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: a flat verb dispatcher — the branches are the command surface.\nasync function main(): Promise<number> {\n const args = parseMutateArgs(process.argv.slice(2));\n if (args.help) {\n console.log(HELP);\n return 0;\n }\n\n const cwd = process.cwd();\n // init and migrate write the config; they must work before one loads.\n if (args.verb === \"init\") return await init(cwd, args.force);\n if (args.verb === \"migrate\") return await migrate(cwd, args);\n const cfg = await resolveMutateConfig(cwd, args);\n\n switch (args.verb) {\n case \"run\": {\n resolveEngine(args);\n const code = await runBunEngine(cfg, args);\n if (code !== 0) return code;\n if (args.noReport) return 0;\n console.log(`\\n${await reportFromFile(cfg)}`);\n return 0;\n }\n\n case \"report\": {\n console.log(await reportFromFile(cfg));\n return 0;\n }\n\n case \"decisions\": {\n const db = await openDb(cfg.reportPath, cfg.dbPath);\n if (!db) return 1;\n try {\n if (args.rest[0] === \"decide\") {\n const [, file, verdict, ...r] = args.rest;\n if (!file || !verdict) {\n console.log(\n 'usage: polly mutate decisions decide <file> <keep|prune|rewrite|investigate> \"<rationale>\"'\n );\n return 1;\n }\n await decide(file, verdict, r.join(\" \").replace(/^\"|\"$/g, \"\"), db, cfg.decisionsPath);\n } else {\n console.log(await status(db, cfg.decisionsPath));\n }\n } finally {\n db.close();\n }\n return 0;\n }\n\n case \"verify\": {\n if (args.run) {\n resolveEngine(args);\n await runBunEngine(cfg, { ...args, mode: \"matrix\" });\n }\n const result = await verifyMatrix({ reportPath: cfg.reportPath });\n console.log(\"\\nKill-matrix contract:\");\n for (const c of result.checks) console.log(` ${c.ok ? \"✓\" : \"✗\"} ${c.name} (${c.detail})`);\n if (!result.ok) {\n console.log(\n \"\\n✗ Contract broken. Re-check the Bun version: matrix mode reads Bun's junit output (engine/junit.ts).\"\n );\n return 1;\n }\n console.log(\"\\n✓ Kill-matrix contract holds.\");\n return 0;\n }\n\n default:\n console.log(`Unknown subcommand: ${args.verb}\\n`);\n console.log(HELP);\n return 1;\n }\n}\n\nmain()\n .then((code) => process.exit(code))\n .catch((err) => {\n console.log(`\\n❌ ${err instanceof Error ? err.message : String(err)}`);\n process.exit(1);\n });\n",
|
|
6
|
+
"/**\n * @fairfox/polly/test/coverage — mutation target / test-glob validation.\n *\n * A mutation config's target and test lists are hand-curated. A path that is\n * renamed, or a glob whose directory moves, silently resolves to nothing —\n * fewer files (or none) are mutated and the only signal is a long mutation\n * run whose score quietly drops. This asserts, in milliseconds, that every\n * entry still resolves to at least one file.\n *\n * Reads both config formats: `polly.mutate.ts` at the root, and Stryker JSON\n * (deprecated) — a single `stryker.conf.json` at the root or a `stryker/`\n * directory of per-package shards.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { Glob } from \"bun\";\nimport { loadMutationConfig, MUTATION_CONFIG_FILE } from \"../../../mutate/src/define.ts\";\n\ninterface StrykerConfig {\n mutate?: string[];\n testFiles?: string[];\n bun?: { testFiles?: string[] };\n}\n\nexport interface MutateTargetIssue {\n config: string;\n /** `mutate`/`testFiles` for a Stryker config, `targets`/`tests.include` for polly.mutate.ts. */\n field: \"mutate\" | \"testFiles\" | \"targets\" | \"tests.include\";\n pattern: string;\n}\n\n/** One mutation config, reduced to the paths it names. */\nexport interface MutateConfigEntry {\n path: string;\n format: \"polly\" | \"stryker\";\n targets: { field: MutateTargetIssue[\"field\"]; patterns: string[] };\n tests: { field: MutateTargetIssue[\"field\"]; patterns: string[] };\n}\n\nexport interface MutateTargetReport {\n configs: string[];\n issues: MutateTargetIssue[];\n}\n\n/** Locate every Stryker config under the project root. */\nexport async function findStrykerConfigs(root: string): Promise<string[]> {\n const found: string[] = [];\n const single = join(root, \"stryker.conf.json\");\n if (existsSync(single)) found.push(single);\n\n const glob = new Glob(\"stryker/*.{json,conf.json}\");\n for await (const rel of glob.scan({ cwd: root, onlyFiles: true })) {\n found.push(join(root, rel));\n }\n return found.sort();\n}\n\n/** Every mutation config under `root`, both formats, with the paths each names. */\nexport async function findMutateConfigs(root: string): Promise<MutateConfigEntry[]> {\n const out: MutateConfigEntry[] = [];\n const polly = join(root, MUTATION_CONFIG_FILE);\n if (existsSync(polly)) {\n const config = await loadMutationConfig(polly);\n out.push({\n path: polly,\n format: \"polly\",\n targets: { field: \"targets\", patterns: config.targets },\n tests: { field: \"tests.include\", patterns: config.tests?.include ?? [] },\n });\n }\n for (const path of await findStrykerConfigs(root)) {\n const config = JSON.parse(readFileSync(path, \"utf8\")) as unknown as StrykerConfig;\n out.push({\n path,\n format: \"stryker\",\n targets: { field: \"mutate\", patterns: config.mutate ?? [] },\n tests: { field: \"testFiles\", patterns: config.testFiles ?? config.bun?.testFiles ?? [] },\n });\n }\n return out;\n}\n\nfunction isGlob(pattern: string): boolean {\n return pattern.includes(\"*\") || pattern.includes(\"?\") || pattern.includes(\"[\");\n}\n\n/** `file.ts:10-20` (or `:10:1-20:5`) names `file.ts`. */\nconst LINE_RANGE = /:\\d+(?::\\d+)?-\\d+(?::\\d+)?$/;\n\nasync function resolvesToFile(entry: string, cwd: string): Promise<boolean> {\n if (entry.startsWith(\"!\")) return true; // negations are filters, not targets\n const pattern = entry.replace(LINE_RANGE, \"\");\n if (!isGlob(pattern)) return existsSync(resolve(cwd, pattern));\n const glob = new Glob(pattern);\n for await (const _ of glob.scan({ cwd, onlyFiles: true })) return true;\n return false;\n}\n\nasync function checkField(\n configPath: string,\n field: MutateTargetIssue[\"field\"],\n patterns: string[],\n cwd: string\n): Promise<MutateTargetIssue[]> {\n const issues: MutateTargetIssue[] = [];\n for (const pattern of patterns) {\n if (!(await resolvesToFile(pattern, cwd))) {\n issues.push({ config: configPath, field, pattern });\n }\n }\n return issues;\n}\n\n/**\n * Validate every mutation config under `root`. polly.mutate.ts paths are\n * relative to its own directory (the root). Paths in a Stryker config are\n * relative to that config's directory; for the monorepo-root configs that is\n * the root, so Stryker globs resolve against `root`.\n */\nexport async function validateMutateTargets(root: string): Promise<MutateTargetReport> {\n const configs = await findMutateConfigs(root);\n const issues: MutateTargetIssue[] = [];\n for (const c of configs) {\n const cwd = c.format === \"polly\" ? dirname(c.path) : root;\n issues.push(...(await checkField(c.path, c.targets.field, c.targets.patterns, cwd)));\n issues.push(...(await checkField(c.path, c.tests.field, c.tests.patterns, cwd)));\n }\n return { configs: configs.map((c) => c.path), issues };\n}\n",
|
|
7
|
+
"/**\n * Type guards for walking `unknown` values safely.\n *\n * Polly touches a lot of shapes it doesn't own: parsed JSON bodies\n * from the signalling server, IndexedDB records, `postMessage`\n * payloads, storage adapter returns. TypeScript sees every one of\n * those as `unknown`, and the ergonomic-but-unsafe fix — a bare `as`\n * cast — hides every shape mismatch until runtime. The helpers below\n * are the thinnest possible layer that turns a runtime shape check\n * into a compile-time narrowing, so the code that follows can read\n * the value without a cast.\n *\n * Each guard checks own-properties only (`Object.hasOwn`), not the\n * prototype chain. Walking into a prototype would make a simple\n * `hasKeyInObject(x, \"toString\")` pass for any object, which is\n * never what a caller looking for a specific data key intends.\n */\n\n/** Narrow `input` to an object carrying its own `key`. Returns true\n * when the input is a non-null object with an own property under\n * the given key. The value under the key is left as `unknown`;\n * callers narrow further with `Array.isArray`, `typeof`, or another\n * guard. */\nexport function hasKeyInObject<K extends string>(\n input: unknown,\n key: K\n): input is Record<K, unknown> {\n return typeof input === \"object\" && input !== null && Object.hasOwn(input, key);\n}\n\n/** Narrow `input` to a plain object (non-null, non-array). Useful as\n * a prelude to reads off a record whose shape is known at the\n * call site but typed as `unknown`. */\nexport function isRecord(input: unknown): input is Record<string, unknown> {\n return typeof input === \"object\" && input !== null && !Array.isArray(input);\n}\n\n/**\n * Compile-time exhaustiveness check for discriminated unions.\n *\n * A string-literal union is decorative without one: add a third\n * variant and nothing flags the `switch` statements that only handled\n * the first two — the new case silently falls through whatever\n * `default` arm exists. Placing `assertNever` in that `default` arm\n * turns the gap into a type error, because `value` is only assignable\n * to `never` when every other case has already been handled. The\n * moment a variant is added and a switch forgets it, `value` is no\n * longer `never` and the call fails to type-check.\n *\n * ```ts\n * switch (event.kind) {\n * case \"a\": return handleA(event);\n * case \"b\": return handleB(event);\n * default: return assertNever(event);\n * }\n * ```\n *\n * The `throw` is the runtime backstop for the case TypeScript cannot\n * see — a value arriving from outside the type system (a parsed JSON\n * body, a `postMessage` payload) that violates the declared union.\n */\nexport function assertNever(value: never): never {\n throw new Error(`assertNever: unexpected value ${JSON.stringify(value)}`);\n}\n",
|
|
8
|
+
"/**\n * `polly.mutate.ts` — the typed config for `polly mutate`:\n *\n * import { defineMutation } from \"@fairfox/polly/mutate\";\n * export default defineMutation({\n * targets: [\"src/**\\/*.ts\", \"!src/**\\/*.test.ts\"],\n * tests: { include: [\"tests/**\\/*.test.ts\"] },\n * });\n *\n * Paths are relative to the config file's directory, which is also where the\n * tests run. `defineMutation` only checks the shape at the type level; the\n * CLI loads the file with a plain dynamic import and validates the default\n * export with `parseMutationConfig`, so a hand-written `.js` config with a\n * typo fails with a message, not a crash deep in the engine.\n */\nimport { isRecord } from \"../../../src/shared/lib/guards\";\nimport type { ContractsMode, CoverageMode, EngineMode, MutatorName } from \"./engine/types.ts\";\n\nexport const MUTATION_CONFIG_FILE = \"polly.mutate.ts\";\n\nexport interface MutationTests {\n /** Test-file globs. The engine runs only the files whose imports reach a target. */\n include: string[];\n /** Project preloads, passed to `bun test` before the injection preload. */\n preload?: string[];\n}\n\nexport interface CommandRunner {\n kind: \"command\";\n /**\n * The command, run once per mutant in the config dir; non-zero exit kills\n * the mutant. Every Bun process it starts gets the injection preload via\n * BUN_OPTIONS. No test selection, fast mode only.\n */\n argv: string[];\n}\n\ninterface MutationCommon {\n /** Files to mutate: globs, `!` exclusions, and `file.ts:10-20` line ranges. */\n targets: string[];\n /** fast stops at the first failing test; matrix records every killer. Default fast. */\n mode?: EngineMode;\n /**\n * dynamic: one probed pass over every test file finds the tests that run\n * each mutant; a mutant no test runs is NoCoverage. static: the test files\n * that import the target. Default dynamic; the command runner is always static.\n */\n coverage?: CoverageMode;\n /** Parallel test processes. Default: cores − 1. */\n concurrency?: number;\n /** Per-mutant timeout = baseline × factor + extraMs. Default 2 / 3000. */\n timeout?: { factor: number; extraMs: number };\n mutators?: { exclude?: MutatorName[] };\n /**\n * Report mutants the project's TypeScript config rejects as CompileError,\n * never run (TypeScript 7 through the `typescript-7` dependency). Default true.\n */\n typecheck?: boolean;\n /** Report mutants inside requires/ensures/… as Ignored (polly#143). Default true. */\n ignoreVerifyCallsites?: boolean;\n /**\n * POLLY_CONTRACTS for every test process: a false requires/ensures throws,\n * so each contract kills the mutants that falsify it. off keeps them\n * no-ops; ensures enforces postconditions only. Default all.\n */\n contracts?: ContractsMode;\n /** `polly mutate run` exits 1 when the score is below `break`. */\n thresholds?: { break?: number };\n /** Report path. Default reports/mutation/mutation.json. */\n report?: string;\n /** Verdict log. Default .polly/test-debt/decisions.jsonl. */\n decisions?: string;\n}\n\nexport type MutationConfig = MutationCommon &\n (\n | { runner?: { kind: \"bun-test\" }; tests: MutationTests }\n | { runner: CommandRunner; tests?: undefined }\n );\n\nexport function defineMutation(config: MutationConfig): MutationConfig {\n return config;\n}\n\nconst MUTATOR_NAMES: ReadonlySet<string> = new Set<MutatorName>([\n \"ArithmeticOperator\",\n \"ArrayDeclaration\",\n \"ArrowFunction\",\n \"AssignmentOperator\",\n \"BlockStatement\",\n \"BooleanLiteral\",\n \"ConditionalExpression\",\n \"EqualityOperator\",\n \"LogicalOperator\",\n \"MethodExpression\",\n \"ObjectLiteral\",\n \"OptionalChaining\",\n \"Regex\",\n \"StringLiteral\",\n \"UnaryOperator\",\n \"UpdateOperator\",\n]);\n\nfunction isMutatorName(value: unknown): value is MutatorName {\n return typeof value === \"string\" && MUTATOR_NAMES.has(value);\n}\n\nfunction strings(value: unknown, where: string): string[] {\n if (!Array.isArray(value) || !value.every((v) => typeof v === \"string\")) {\n throw new Error(`${where} must be an array of strings`);\n }\n return value;\n}\n\nfunction optionalNumber(value: unknown, where: string): number | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== \"number\" || !Number.isFinite(value))\n throw new Error(`${where} must be a number`);\n return value;\n}\n\nfunction optionalString(value: unknown, where: string): string | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== \"string\") throw new Error(`${where} must be a string`);\n return value;\n}\n\nfunction isEngineMode(v: unknown): v is EngineMode {\n return v === \"fast\" || v === \"matrix\";\n}\n\nfunction isCoverageMode(v: unknown): v is CoverageMode {\n return v === \"dynamic\" || v === \"static\";\n}\n\nfunction parseRun(raw: Record<string, unknown>, where: string): MutationCommon {\n const mode = raw[\"mode\"];\n if (mode !== undefined && !isEngineMode(mode)) {\n throw new Error(`${where}: mode must be \"fast\" or \"matrix\"`);\n }\n const concurrency = optionalNumber(raw[\"concurrency\"], `${where}: concurrency`);\n if (concurrency !== undefined && !(Number.isInteger(concurrency) && concurrency > 0)) {\n throw new Error(`${where}: concurrency must be a positive integer`);\n }\n const coverage = raw[\"coverage\"];\n if (coverage !== undefined && !isCoverageMode(coverage)) {\n throw new Error(`${where}: coverage must be \"dynamic\" or \"static\"`);\n }\n const common: MutationCommon = { targets: strings(raw[\"targets\"], `${where}: targets`) };\n if (isEngineMode(mode)) common.mode = mode;\n if (isCoverageMode(coverage)) common.coverage = coverage;\n if (concurrency !== undefined) common.concurrency = concurrency;\n const timeout = raw[\"timeout\"];\n if (timeout !== undefined) {\n if (!isRecord(timeout)) throw new Error(`${where}: timeout must be { factor, extraMs }`);\n const factor = optionalNumber(timeout[\"factor\"], `${where}: timeout.factor`) ?? 2;\n const extraMs = optionalNumber(timeout[\"extraMs\"], `${where}: timeout.extraMs`) ?? 3000;\n common.timeout = { factor, extraMs };\n }\n return common;\n}\n\nfunction parseMutants(raw: Record<string, unknown>, where: string): Partial<MutationCommon> {\n const out: Partial<MutationCommon> = {};\n const mutators = raw[\"mutators\"];\n if (mutators !== undefined) {\n if (!isRecord(mutators)) throw new Error(`${where}: mutators must be { exclude }`);\n const exclude = mutators[\"exclude\"] === undefined ? [] : mutators[\"exclude\"];\n if (!Array.isArray(exclude) || !exclude.every(isMutatorName)) {\n throw new Error(`${where}: mutators.exclude holds an unknown mutator name`);\n }\n out.mutators = { exclude };\n }\n const ignore = raw[\"ignoreVerifyCallsites\"];\n if (ignore !== undefined) {\n if (typeof ignore !== \"boolean\")\n throw new Error(`${where}: ignoreVerifyCallsites must be boolean`);\n out.ignoreVerifyCallsites = ignore;\n }\n const typecheck = raw[\"typecheck\"];\n if (typecheck !== undefined) {\n if (typeof typecheck !== \"boolean\") throw new Error(`${where}: typecheck must be boolean`);\n out.typecheck = typecheck;\n }\n return { ...out, ...parseContracts(raw, where) };\n}\n\nexport function isContractsMode(v: unknown): v is ContractsMode {\n return v === \"off\" || v === \"ensures\" || v === \"all\";\n}\n\nfunction parseContracts(raw: Record<string, unknown>, where: string): Partial<MutationCommon> {\n const contracts = raw[\"contracts\"];\n if (contracts === undefined) return {};\n if (!isContractsMode(contracts)) {\n throw new Error(`${where}: contracts must be \"off\", \"ensures\" or \"all\"`);\n }\n return { contracts };\n}\n\nfunction parseOutputs(raw: Record<string, unknown>, where: string): Partial<MutationCommon> {\n const out: Partial<MutationCommon> = {};\n const thresholds = raw[\"thresholds\"];\n if (thresholds !== undefined) {\n if (!isRecord(thresholds)) throw new Error(`${where}: thresholds must be { break }`);\n const brk = optionalNumber(thresholds[\"break\"], `${where}: thresholds.break`);\n out.thresholds = brk === undefined ? {} : { break: brk };\n }\n const report = optionalString(raw[\"report\"], `${where}: report`);\n if (report !== undefined) out.report = report;\n const decisions = optionalString(raw[\"decisions\"], `${where}: decisions`);\n if (decisions !== undefined) out.decisions = decisions;\n return out;\n}\n\nfunction parseCommon(raw: Record<string, unknown>, where: string): MutationCommon {\n return { ...parseRun(raw, where), ...parseMutants(raw, where), ...parseOutputs(raw, where) };\n}\n\n/** Validate a loaded config's default export. `where` names the file in errors. */\nexport function parseMutationConfig(raw: unknown, where: string): MutationConfig {\n if (!isRecord(raw)) throw new Error(`${where}: the default export must be a config object`);\n // targets, then runner/tests, then the rest: the order a rendered config reads in.\n const { targets, ...common } = parseCommon(raw, where);\n const runner = raw[\"runner\"];\n if (isRecord(runner) && runner[\"kind\"] === \"command\") {\n const argv = strings(runner[\"argv\"], `${where}: runner.argv`);\n if (argv.length === 0) throw new Error(`${where}: runner.argv is empty`);\n return { targets, runner: { kind: \"command\", argv }, ...common };\n }\n if (runner !== undefined && !(isRecord(runner) && runner[\"kind\"] === \"bun-test\")) {\n throw new Error(`${where}: runner.kind must be \"bun-test\" or \"command\"`);\n }\n const tests = raw[\"tests\"];\n if (!isRecord(tests)) throw new Error(`${where}: tests.include is required`);\n const include = strings(tests[\"include\"], `${where}: tests.include`);\n if (include.length === 0) throw new Error(`${where}: tests.include is empty`);\n const preload =\n tests[\"preload\"] === undefined\n ? undefined\n : strings(tests[\"preload\"], `${where}: tests.preload`);\n return { targets, tests: preload ? { include, preload } : { include }, ...common };\n}\n\n/** Import a `polly.mutate.ts` (or `.js`) and validate its default export. */\nexport async function loadMutationConfig(path: string): Promise<MutationConfig> {\n const mod: unknown = await import(path);\n const raw = isRecord(mod) ? mod[\"default\"] : undefined;\n return parseMutationConfig(raw, path);\n}\n",
|
|
9
|
+
"/**\n * Argument parsing for `polly mutate`. Hand-rolled (matching the rest of the\n * polly CLI), with the value-flag / bool-flag split that lets a flag value\n * (`--report path.json`) not be mistaken for a positional verb.\n */\n\nexport interface MutateArgs {\n /** First positional: \"run\" (default when bare) | \"report\" | \"decisions\" | \"verify\" | \"init\" | \"migrate\" | an unknown token to error on. */\n verb: string;\n /** Positionals after the verb (e.g. [\"decide\", file, verdict, ...rationale] for `decisions decide …`). */\n rest: string[];\n config?: string;\n report?: string;\n decisions?: string;\n db?: string;\n noReport: boolean;\n /** `verify --run` (run the engine in matrix mode before checking the contract). */\n run: boolean;\n /** `init --force` / `migrate --write --force` (overwrite an existing polly.mutate.ts). */\n force: boolean;\n /** `migrate --write` (write polly.mutate.ts instead of printing it). */\n write: boolean;\n help: boolean;\n /** `--engine bun` — accepted for old scripts; bun is the only engine. */\n engine?: string;\n /** `--mode fast|matrix` (bun engine). */\n mode?: string;\n /** `--coverage dynamic|static` (bun engine). */\n coverage?: string;\n /** `--concurrency <n>` (bun engine). */\n concurrency?: string;\n /** `--files a.ts,b.ts` — mutate only these targets (bun engine). */\n files?: string;\n /** `--since <git-ref>` — mutate only targets changed since the ref (bun engine). */\n since?: string;\n /** `--in-tree` — run test processes in the project cwd, not a scratch dir (bun engine). */\n inTree: boolean;\n /** `--no-cache` — ignore and do not reuse cached target results (bun engine). */\n noCache: boolean;\n /** `--no-typecheck` — run mutants the project's TypeScript config rejects instead of reporting CompileError. */\n noTypecheck: boolean;\n /** `--contracts off|ensures|all` — POLLY_CONTRACTS for every test process (bun engine). */\n contracts?: string;\n}\n\nconst KNOWN_VERBS = new Set([\"run\", \"report\", \"decisions\", \"verify\", \"init\", \"migrate\", \"help\"]);\nconst VALUE_FLAGS = new Set([\n \"--config\",\n \"--report\",\n \"--decisions\",\n \"--db\",\n \"--engine\",\n \"--mode\",\n \"--coverage\",\n \"--concurrency\",\n \"--files\",\n \"--since\",\n \"--contracts\",\n]);\n\nexport function parseMutateArgs(argv: string[]): MutateArgs {\n const positionals: string[] = [];\n const flags = new Map<string, string>();\n const bools = new Set<string>();\n\n let i = 0;\n while (i < argv.length) {\n const a = argv[i];\n if (a === undefined) break;\n if (VALUE_FLAGS.has(a)) {\n flags.set(a, argv[i + 1] ?? \"\");\n i += 2;\n } else {\n if (a.startsWith(\"-\")) bools.add(a);\n else positionals.push(a);\n i += 1;\n }\n }\n\n const verbRaw = positionals[0];\n const help = bools.has(\"--help\") || bools.has(\"-h\") || verbRaw === \"help\";\n const verb = verbRaw === undefined ? \"run\" : KNOWN_VERBS.has(verbRaw) ? verbRaw : verbRaw;\n\n return {\n verb,\n rest: positionals.slice(1),\n config: flags.get(\"--config\"),\n report: flags.get(\"--report\"),\n decisions: flags.get(\"--decisions\"),\n db: flags.get(\"--db\"),\n noReport: bools.has(\"--no-report\"),\n run: bools.has(\"--run\"),\n force: bools.has(\"--force\"),\n write: bools.has(\"--write\"),\n inTree: bools.has(\"--in-tree\"),\n noCache: bools.has(\"--no-cache\"),\n noTypecheck: bools.has(\"--no-typecheck\"),\n help,\n engine: flags.get(\"--engine\"),\n mode: flags.get(\"--mode\"),\n coverage: flags.get(\"--coverage\"),\n concurrency: flags.get(\"--concurrency\"),\n files: flags.get(\"--files\"),\n since: flags.get(\"--since\"),\n contracts: flags.get(\"--contracts\"),\n };\n}\n",
|
|
10
|
+
"/**\n * Resolve the config and paths `polly mutate` works with.\n *\n * The mutation config is `polly.mutate.ts` in the cwd, else the first\n * Stryker config `findStrykerConfigs` discovers, read through the migration\n * mapping (deprecated: `polly mutate migrate --write` converts it). Paths\n * inside a config resolve against its directory; CLI flags resolve against\n * the cwd.\n */\nimport { existsSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { findStrykerConfigs } from \"../../test/src/coverage-policy/mutate-targets.ts\";\nimport type { MutateArgs } from \"./args.ts\";\nimport { loadMutationConfig, MUTATION_CONFIG_FILE, type MutationConfig } from \"./define.ts\";\nimport { readStrykerConfig } from \"./migrate.ts\";\n\nconst DEFAULT_REPORT = \"reports/mutation/mutation.json\";\nconst DEFAULT_DECISIONS = \".polly/test-debt/decisions.jsonl\";\n\nexport interface LoadedMutationConfig {\n path: string;\n /** \"stryker\": read from a Stryker JSON through the migration mapping (deprecated). */\n format: \"polly\" | \"stryker\";\n config: MutationConfig;\n /** Migration notes (stryker format only). */\n notes: string[];\n}\n\nexport interface MutateConfig {\n cwd: string;\n /** The config the bun engine runs from. Null if none was found or it failed to load. */\n mutation: LoadedMutationConfig | null;\n /** Why a Stryker config found as the fallback could not be mapped (fatal only when the engine runs). */\n mutationError: string | null;\n /** mutation-testing-report-schema JSON the analysis reads. */\n reportPath: string;\n /** Intermediate SQLite db (\":memory:\" by default; a path persists it). */\n dbPath: string;\n /** Version-controlled human-verdict log. */\n decisionsPath: string;\n}\n\nasync function loadAt(path: string): Promise<LoadedMutationConfig> {\n if (path.endsWith(\".json\")) {\n const { config, notes } = await readStrykerConfig(path);\n return { path, format: \"stryker\", config, notes };\n }\n return { path, format: \"polly\", config: await loadMutationConfig(path), notes: [] };\n}\n\nexport async function resolveMutateConfig(cwd: string, args: MutateArgs): Promise<MutateConfig> {\n const explicit = args.config ? resolve(cwd, args.config) : null;\n // findStrykerConfigs returns sorted absolute paths; the root stryker.conf.json\n // sorts before any stryker/ shard, so [0] is the root config when present.\n const discoveredStryker = (await findStrykerConfigs(cwd))[0] ?? null;\n\n const local = resolve(cwd, MUTATION_CONFIG_FILE);\n const mutationPath = explicit ?? (existsSync(local) ? local : discoveredStryker);\n let mutation: LoadedMutationConfig | null = null;\n let mutationError: string | null = null;\n if (mutationPath?.endsWith(\".json\")) {\n // A Stryker config the mapping cannot read (a jest runner, say) must not\n // block the report verbs, which need no config, so it is not fatal here.\n try {\n mutation = await loadAt(mutationPath);\n } catch (err) {\n mutationError = err instanceof Error ? err.message : String(err);\n }\n } else if (mutationPath) {\n mutation = await loadAt(mutationPath);\n }\n\n const base = mutation ? dirname(mutation.path) : cwd;\n const fromConfig = (flag: string | undefined, key: string | undefined, fallback: string) =>\n flag ? resolve(cwd, flag) : resolve(base, key ?? fallback);\n return {\n cwd,\n mutation,\n mutationError,\n reportPath: fromConfig(args.report, mutation?.config.report, DEFAULT_REPORT),\n dbPath: args.db ? resolve(cwd, args.db) : \":memory:\",\n decisionsPath: fromConfig(args.decisions, mutation?.config.decisions, DEFAULT_DECISIONS),\n };\n}\n",
|
|
11
|
+
"/**\n * `polly mutate migrate [--write]` — turn a `stryker.conf.json` into a\n * `polly.mutate.ts`. The same mapping (`strykerToMutation`) is how the CLI\n * still reads a Stryker config it finds without a `polly.mutate.ts`, so the\n * fallback and the migrated file mean the same thing.\n *\n * mutate → targets\n * bun.testFiles → tests.include\n * bun.nodeArgs --preload → tests.preload\n * testRunner \"command\" → runner { kind: \"command\", argv }\n * concurrency → concurrency\n * timeoutFactor, timeoutMS → timeout { factor, extraMs }\n * disableBail → mode \"matrix\"\n * mutator.excludedMutations → mutators.exclude\n * thresholds.break → thresholds.break\n *\n * Everything else (plugins, ignorers, reporters, coverageAnalysis, …) is\n * Stryker machinery with no engine counterpart; each dropped key is listed\n * in the notes so nothing disappears silently.\n */\nimport { existsSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\nimport { isRecord } from \"../../../src/shared/lib/guards\";\nimport {\n MUTATION_CONFIG_FILE,\n type MutationConfig,\n type MutationTests,\n parseMutationConfig,\n} from \"./define.ts\";\n\n/** Stryker keys that are fully mapped; anything else is reported as dropped. */\nconst MAPPED = new Set([\n \"mutate\",\n \"testRunner\",\n \"bun\",\n \"commandRunner\",\n \"concurrency\",\n \"timeoutFactor\",\n \"timeoutMS\",\n \"disableBail\",\n \"mutator\",\n \"thresholds\",\n \"ignorers\",\n]);\n/** Keys that carry no meaning to keep — dropped without a note. */\nconst SILENT = new Set([\"$schema\", \"_comment\"]);\nconst SHELL_SYNTAX = /[|&;<>()$`\"'\\\\*?{}[\\]~]/;\n\nexport interface Migration {\n config: MutationConfig;\n notes: string[];\n}\n\n/** `--preload <p>` / `--preload=<p>` values from the bun runner's `nodeArgs`, as written. */\nexport function preloadArgs(nodeArgs: string[]): string[] {\n const out: string[] = [];\n nodeArgs.forEach((arg, i) => {\n const value =\n arg === \"--preload\"\n ? nodeArgs[i + 1]\n : arg.startsWith(\"--preload=\")\n ? arg.slice(10)\n : undefined;\n if (value) out.push(value);\n });\n return out;\n}\n\n/** A Stryker command string as argv; anything shell-shaped goes through `sh -c`. */\nexport function commandArgv(command: string): string[] {\n const trimmed = command.trim();\n return SHELL_SYNTAX.test(trimmed) ? [\"sh\", \"-c\", trimmed] : trimmed.split(/\\s+/);\n}\n\nfunction stringList(value: unknown): string[] {\n return Array.isArray(value) ? value.filter((v): v is string => typeof v === \"string\") : [];\n}\n\nfunction timeoutOf(raw: Record<string, unknown>): { factor: number; extraMs: number } | undefined {\n const factor = raw[\"timeoutFactor\"];\n const ms = raw[\"timeoutMS\"];\n if (typeof factor !== \"number\" && typeof ms !== \"number\") return undefined;\n // Stryker's defaults for the half that is missing.\n return {\n factor: typeof factor === \"number\" ? factor : 1.5,\n extraMs: typeof ms === \"number\" ? ms : 5000,\n };\n}\n\nfunction testsOf(raw: Record<string, unknown>, where: string): MutationTests {\n const bun = isRecord(raw[\"bun\"]) ? raw[\"bun\"] : {};\n const include = stringList(bun[\"testFiles\"]);\n if (include.length === 0) throw new Error(`${where} has no bun.testFiles`);\n const preload = preloadArgs(stringList(bun[\"nodeArgs\"]));\n return preload.length > 0 ? { include, preload } : { include };\n}\n\n/** `runner` or `tests`, by Stryker test runner. */\nfunction runnerOf(raw: Record<string, unknown>, where: string): Record<string, unknown> {\n const runnerName = raw[\"testRunner\"];\n if (runnerName === \"command\") {\n const cmd = isRecord(raw[\"commandRunner\"]) ? raw[\"commandRunner\"][\"command\"] : undefined;\n // Stryker's own default command.\n const argv = commandArgv(typeof cmd === \"string\" ? cmd : \"npm test\");\n return { runner: { kind: \"command\", argv } };\n }\n if (runnerName === undefined || runnerName === \"bun\") {\n return {\n tests: testsOf(raw, where),\n ...(raw[\"disableBail\"] === true ? { mode: \"matrix\" } : {}),\n };\n }\n throw new Error(\n `${where}: testRunner \"${String(runnerName)}\" has no polly counterpart (bun or command)`\n );\n}\n\nfunction tuningOf(raw: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n if (typeof raw[\"concurrency\"] === \"number\") out[\"concurrency\"] = raw[\"concurrency\"];\n const timeout = timeoutOf(raw);\n if (timeout) out[\"timeout\"] = timeout;\n const excluded = isRecord(raw[\"mutator\"]) ? stringList(raw[\"mutator\"][\"excludedMutations\"]) : [];\n if (excluded.length > 0) out[\"mutators\"] = { exclude: excluded };\n const brk = isRecord(raw[\"thresholds\"]) ? raw[\"thresholds\"][\"break\"] : undefined;\n if (typeof brk === \"number\") out[\"thresholds\"] = { break: brk };\n return out;\n}\n\n/** Map a parsed Stryker config to a `MutationConfig`, with a note per dropped key. */\nexport function strykerToMutation(raw: unknown, where: string): Migration {\n if (!isRecord(raw)) throw new Error(`${where} is not a JSON object`);\n const draft = { targets: stringList(raw[\"mutate\"]), ...runnerOf(raw, where), ...tuningOf(raw) };\n const notes: string[] = [];\n if (!stringList(raw[\"ignorers\"]).includes(\"polly-verify\")) {\n notes.push(\n \"ignoreVerifyCallsites defaults to true: requires/ensures mutants are reported Ignored (polly#143)\"\n );\n }\n const dropped = Object.keys(raw).filter((k) => !MAPPED.has(k) && !SILENT.has(k));\n if (dropped.length > 0) notes.push(`dropped Stryker-only keys: ${dropped.join(\", \")}`);\n return { config: parseMutationConfig(draft, where), notes };\n}\n\nexport async function readStrykerConfig(path: string): Promise<Migration> {\n return strykerToMutation(await Bun.file(path).json(), path);\n}\n\n/**\n * The specifier a config in `dir` imports `defineMutation` from: the package\n * export when it resolves there, else this source tree's own module (polly's\n * monorepo root has no `@fairfox/polly` in its node_modules).\n */\nexport function defineImportSpecifier(dir: string): string {\n try {\n Bun.resolveSync(\"@fairfox/polly/mutate\", dir);\n return \"@fairfox/polly/mutate\";\n } catch {\n const local = join(import.meta.dir, \"define.ts\");\n if (!existsSync(local)) return \"@fairfox/polly/mutate\";\n const rel = relative(dir, local);\n return rel.startsWith(\".\") ? rel : `./${rel}`;\n }\n}\n\n/** Biome's default line width; a longer line is left one-element-per-line. */\nconst LINE_WIDTH = 100;\n\n/**\n * Render a value as a TypeScript object literal in the shape biome's formatter\n * produces: unquoted keys, trailing commas, and an array of primitives on one\n * line when it fits in LINE_WIDTH, so `polly mutate init` passes `polly lint`.\n */\nfunction literal(value: unknown): string {\n return JSON.stringify(value, null, 2)\n .replace(/^(\\s*)\"([A-Za-z_$][\\w$]*)\":/gm, \"$1$2:\")\n .replace(/([^\\s[{,])(?=\\n\\s*[}\\]])/g, \"$1,\")\n .replace(\n /^([ ]*)([\\w$]+: )?\\[\\n((?:[ ]*(?:\"[^\"\\n]*\"|-?\\d+(?:\\.\\d+)?|true|false),\\n)+)([ ]*)\\](,?)$/gm,\n (m, indent, key, items, _close, comma) => {\n const inline = `${indent}${key ?? \"\"}[${items\n .trim()\n .replace(/,$/, \"\")\n .split(/,\\n\\s*/)\n .join(\", \")}]${comma}`;\n return inline.length <= LINE_WIDTH ? inline : m;\n }\n );\n}\n\nexport function renderMutationConfig(config: MutationConfig, specifier: string): string {\n return [\n `import { defineMutation } from \"${specifier}\";`,\n \"\",\n `export default defineMutation(${literal(config)});`,\n \"\",\n ].join(\"\\n\");\n}\n\nexport interface MigrateResult {\n /** Where the config goes (next to the Stryker config). */\n path: string;\n source: string;\n notes: string[];\n /** false when `write` was off or a config was already there without `force`. */\n written: boolean;\n existed: boolean;\n}\n\nexport async function migrateConfig(\n strykerPath: string,\n opts: { write?: boolean; force?: boolean } = {}\n): Promise<MigrateResult> {\n const { config, notes } = await readStrykerConfig(strykerPath);\n const dir = dirname(strykerPath);\n const path = join(dir, MUTATION_CONFIG_FILE);\n const source = renderMutationConfig(config, defineImportSpecifier(dir));\n const existed = existsSync(path);\n const written = Boolean(opts.write) && (!existed || Boolean(opts.force));\n if (written) await Bun.write(path, source);\n return { path, source, notes, written, existed };\n}\n",
|
|
8
12
|
"/**\n * Decisions log — the version-controlled human-judgement layer.\n *\n * The signals (kill matrix, subsumption) are derived and regenerable; they live\n * in the gitignored SQLite db. *Decisions* about them — \"this subsumed file is a\n * legitimate set of input-class guards, keep it\" — are precious, can't be\n * regenerated, and are committed here as JSONL (one record per line: mergeable,\n * diffable, append-only, last-write-wins per file).\n *\n * Identity is the test FILE (stable across describe restructuring; git tracks\n * renames). Each decision stores two freshness stamps:\n * - hash: a normalised content hash of the test file at decision time.\n * Differs → the test changed since you judged it → re-review.\n * - signal: the subsumption snapshot at decision time. Drifts (e.g. a test\n * elsewhere was deleted, so this file's kills became unique) → the\n * matrix around it changed → re-review.\n *\n * A decision is trusted only while BOTH still hold. That's what stops a \"keep\"\n * verdict from silently outliving the reason it was made.\n *\n * polly mutate decisions # status (the join)\n * polly mutate decisions decide <file> <verdict> \"<rationale>\"\n *\n * verdicts: keep | prune | rewrite | investigate\n */\nimport type { Database } from \"bun:sqlite\";\nimport { createHash } from \"node:crypto\";\nimport { buildDb, loadMutationReport, queryAll } from \"./ingest.ts\";\n\nconst DEFAULT_LOG = \".polly/test-debt/decisions.jsonl\";\nconst DEFAULT_REPORT = \"reports/mutation/mutation.json\";\nconst VERDICTS = [\"keep\", \"prune\", \"rewrite\", \"investigate\"];\n\nexport interface FileSignal {\n kills: number;\n uniqueKills: number;\n subsumed: boolean;\n}\ninterface Decision {\n file: string;\n verdict: string;\n rationale: string;\n signal: FileSignal;\n hash: string | null;\n decided: string;\n}\n\n/** Strip comments + collapse whitespace so formatting/comment edits don't trip the stamp.\n * Heuristic (not a full parser): a false change only triggers a harmless re-review. */\nfunction normalizeSource(src: string): string {\n return src\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\")\n .replace(/(^|[^:])\\/\\/[^\\n]*/g, \"$1\")\n .replace(/\\s+/g, \" \")\n .trim();\n}\nasync function fileHash(file: string): Promise<string | null> {\n const f = Bun.file(file);\n if (!(await f.exists())) return null;\n return createHash(\"sha256\")\n .update(normalizeSource(await f.text()))\n .digest(\"hex\")\n .slice(0, 16);\n}\n\nexport function fileSignals(db: Database): Map<string, FileSignal> {\n const rows = queryAll<{ file: string; kills: number; unique_kills: number }>(\n db,\n `\n\t\t\tWITH file_kill AS (SELECT DISTINCT t.file file, k.mutant_id mid FROM kills k JOIN tests t ON t.id=k.test_id),\n\t\t\t owner AS (SELECT mid, count(DISTINCT file) nf FROM file_kill GROUP BY mid)\n\t\t\tSELECT fk.file file, count(DISTINCT fk.mid) kills,\n\t\t\t sum(CASE WHEN o.nf=1 THEN 1 ELSE 0 END) unique_kills\n\t\t\tFROM file_kill fk JOIN owner o ON o.mid=fk.mid GROUP BY fk.file`\n );\n const m = new Map<string, FileSignal>();\n for (const r of rows)\n m.set(r.file, {\n kills: r.kills,\n uniqueKills: r.unique_kills,\n subsumed: r.kills > 0 && r.unique_kills === 0,\n });\n return m;\n}\n\nasync function loadDecisions(logPath: string): Promise<Map<string, Decision>> {\n const m = new Map<string, Decision>();\n const f = Bun.file(logPath);\n if (!(await f.exists())) return m;\n for (const line of (await f.text()).split(\"\\n\")) {\n const t = line.trim();\n if (!t) continue;\n const d = JSON.parse(t) as unknown as Decision;\n m.set(d.file, d); // last write wins\n }\n return m;\n}\n\n/** Why a decision no longer applies, or null if it still holds. */\nfunction staleReason(\n d: Decision,\n currentHash: string | null,\n current: FileSignal | undefined\n): string | null {\n if (!current) return \"file no longer kills any mutant (renamed/deleted/refactored?)\";\n if (d.hash !== currentHash) return \"test file changed since the decision\";\n if (d.signal.subsumed !== current.subsumed)\n return `subsumption flipped (${d.signal.subsumed} → ${current.subsumed})`;\n if (d.signal.uniqueKills > 0 !== current.uniqueKills > 0)\n return `unique-kill status changed (${d.signal.uniqueKills} → ${current.uniqueKills})`;\n return null;\n}\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: a linear join of signals against decisions — clearer as one pass than split.\nexport async function status(db: Database, logPath: string = DEFAULT_LOG): Promise<string> {\n const signals = fileSignals(db);\n const decisions = await loadDecisions(logPath);\n const needsReview: string[] = [];\n const stale: string[] = [];\n const settled: string[] = [];\n\n for (const [file, sig] of [...signals].sort((a, b) => b[1].kills - a[1].kills)) {\n const d = decisions.get(file);\n if (!d) {\n if (sig.subsumed) needsReview.push(` ${file} (${sig.kills} kills, 0 unique)`);\n continue;\n }\n const reason = staleReason(d, await fileHash(file), sig);\n if (reason) stale.push(` ${file} [${d.verdict}] — ${reason}`);\n else settled.push(` ${file} [${d.verdict}] ${d.rationale ? `— ${d.rationale}` : \"\"}`);\n }\n // decided files that have dropped out of the signal set entirely\n for (const [file, d] of decisions) {\n if (!signals.has(file)) stale.push(` ${file} [${d.verdict}] — file no longer in matrix`);\n }\n\n const out: string[] = [];\n out.push(`NEEDS REVIEW (subsumed files with no decision — ${needsReview.length})`);\n out.push(needsReview.length ? needsReview.join(\"\\n\") : \" none\");\n out.push(`\\nSTALE (decision's basis drifted — re-review — ${stale.length})`);\n out.push(stale.length ? stale.join(\"\\n\") : \" none\");\n out.push(`\\nSETTLED (fresh decisions, suppressed from action list — ${settled.length})`);\n out.push(settled.length ? settled.join(\"\\n\") : \" none\");\n return out.join(\"\\n\");\n}\n\nexport async function decide(\n file: string,\n verdict: string,\n rationale: string,\n db: Database,\n logPath: string = DEFAULT_LOG\n) {\n if (!VERDICTS.includes(verdict)) {\n console.log(`✗ verdict must be one of: ${VERDICTS.join(\", \")}`);\n process.exit(1);\n }\n const sig = fileSignals(db).get(file);\n if (!sig) {\n console.log(`✗ ${file} is not a test file that kills any mutant in the current matrix`);\n process.exit(1);\n }\n const decided = new Date().toISOString().slice(0, 10);\n const record: Decision = {\n file,\n verdict,\n rationale,\n signal: sig,\n hash: await fileHash(file),\n decided,\n };\n await Bun.write(\n logPath,\n ((await Bun.file(logPath).exists()) ? await Bun.file(logPath).text() : \"\") +\n JSON.stringify(record) +\n \"\\n\"\n );\n console.log(`✓ recorded: ${file} [${verdict}]${rationale ? ` — ${rationale}` : \"\"}`);\n}\n\nif (import.meta.main) {\n const db = buildDb(await loadMutationReport(DEFAULT_REPORT), \"reports/test-debt.sqlite\");\n const [cmd, ...rest] = process.argv.slice(2);\n if (cmd === \"decide\") {\n const [file, verdict, ...r] = rest;\n if (!file || !verdict) {\n console.log('usage: decide <file> <keep|prune|rewrite|investigate> \"<rationale>\"');\n process.exit(1);\n }\n await decide(file, verdict, r.join(\" \").replace(/^\"|\"$/g, \"\"), db);\n } else {\n console.log(await status(db));\n }\n db.close();\n}\n",
|
|
9
|
-
"/**\n * Ingest a
|
|
10
|
-
"/**\n * `polly mutate init` — scaffold a `
|
|
11
|
-
"/**\n * Orchestration for `polly mutate run` / `report`:
|
|
12
|
-
"/**\n * Test-debt report: derive the three signals from the kill matrix.\n *\n * gaps survived mutants — code no test pins (the Stryker direction)\n * redundancy tests/files whose every kill is also caught elsewhere\n * theatre covered-but-survived — code a test runs but no test detects\n * (the Survived status under coverageAnalysis \"all\")\n *\n * Redundancy is reported at BOTH file and case level. Decisions are keyed at\n * file level (stable identity); case level is the drill-down.\n */\nimport type { Database } from \"bun:sqlite\";\nimport { buildDb, loadMutationReport, queryAll, queryGet } from \"./ingest.ts\";\n\ntype SubsumedCase = { file: string; name: string; total: number };\ntype LineCount = { line: number; mutator: string; n: number };\n\n/** Greedy set cover: smallest set of `units` whose kill-sets cover all killed mutants. */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: a textbook greedy set-cover loop — clearer whole than split.\nfunction greedyCover(units: Map<string, Set<string>>, universe: Set<string>): string[] {\n const remaining = new Set(universe);\n const chosen: string[] = [];\n const pool = new Map([...units].map(([k, v]) => [k, new Set(v)]));\n while (remaining.size > 0) {\n let best: string | null = null;\n let bestGain = 0;\n for (const [unit, set] of pool) {\n let gain = 0;\n for (const m of set) if (remaining.has(m)) gain++;\n if (gain > bestGain) {\n bestGain = gain;\n best = unit;\n }\n }\n if (best === null || bestGain === 0) break; // remaining mutants killed by nobody (shouldn't happen for killed set)\n chosen.push(best);\n for (const m of pool.get(best) ?? []) remaining.delete(m);\n pool.delete(best);\n }\n return chosen;\n}\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: one report builder emitting all sections in order — splitting would scatter the shared db/out.\nexport function report(db: Database, opts: { matrixComplete?: boolean } = {}): string {\n // Defaults to true so `report(db)` is byte-identical to before (the parity\n // guard depends on this). When false — the kill matrix is partial (an\n // unpatched/bail runner) — the redundancy/subsumption sections would lie, so\n // they are suppressed and a warning shown; score/gaps/theatre still hold.\n const matrixComplete = opts.matrixComplete ?? true;\n const out: string[] = [];\n const p = (s = \"\") => out.push(s);\n\n // --- summary ---\n const tot = queryGet<{\n n: number;\n killed: number;\n survived: number;\n timeout: number;\n nocov: number;\n }>(\n db,\n \"SELECT count(*) n, sum(status='Killed') killed, sum(status='Survived') survived, sum(status='Timeout') timeout, sum(status='NoCoverage') nocov FROM mutants\"\n ) ?? { n: 0, killed: 0, survived: 0, timeout: 0, nocov: 0 };\n const nTests = queryGet<{ n: number }>(db, \"SELECT count(*) n FROM tests\")?.n ?? 0;\n const detected = tot.killed + tot.timeout;\n const score = ((detected / (tot.n - tot.nocov || 1)) * 100).toFixed(1);\n p(\n `MUTATION score ${score}% ${tot.killed} killed · ${tot.timeout} timeout · ${tot.survived} survived · ${tot.nocov} no-coverage (${tot.n} mutants, ${nTests} tests)`\n );\n\n if (matrixComplete) {\n // --- kill-multiplicity: how much slack is in the matrix ---\n const mult = queryAll<{ bucket: string; n: number }>(\n db,\n `\n\t\t\tSELECT CASE WHEN c=1 THEN '1' WHEN c=2 THEN '2' WHEN c BETWEEN 3 AND 5 THEN '3-5' ELSE '6+' END bucket, count(*) n\n\t\t\tFROM (SELECT mutant_id, count(*) c FROM kills GROUP BY mutant_id)\n\t\t\tGROUP BY bucket ORDER BY min(c)`\n );\n p(`\\nKILL MULTIPLICITY (killers per killed mutant — higher = more redundancy slack)`);\n for (const r of mult) p(` killed by ${String(r.bucket).padStart(3)} test(s): ${r.n}`);\n\n // --- redundancy ratio via greedy cover (case + file) ---\n const universe = new Set(\n queryAll<{ mutant_id: string }>(db, \"SELECT DISTINCT mutant_id FROM kills\").map(\n (r) => r.mutant_id\n )\n );\n const byTest = new Map<string, Set<string>>();\n for (const r of queryAll<{ test_id: string; mutant_id: string }>(\n db,\n \"SELECT test_id, mutant_id FROM kills\"\n )) {\n const set = byTest.get(r.test_id) ?? new Set<string>();\n byTest.set(r.test_id, set);\n set.add(r.mutant_id);\n }\n const byFile = new Map<string, Set<string>>();\n for (const r of queryAll<{ file: string; mid: string }>(\n db,\n \"SELECT t.file file, k.mutant_id mid FROM kills k JOIN tests t ON t.id=k.test_id\"\n )) {\n const set = byFile.get(r.file) ?? new Set<string>();\n byFile.set(r.file, set);\n set.add(r.mid);\n }\n const caseCover = greedyCover(byTest, universe);\n const fileCover = greedyCover(byFile, universe);\n p(`\\nREDUNDANCY RATIO (tests that kill something ÷ minimal covering set)`);\n p(\n ` case level: ${byTest.size} killing tests → ${caseCover.length} needed (${(byTest.size / Math.max(1, caseCover.length)).toFixed(2)}×, ~${byTest.size - caseCover.length} prunable)`\n );\n p(\n ` file level: ${byFile.size} killing files → ${fileCover.length} needed (${(byFile.size / Math.max(1, fileCover.length)).toFixed(2)}×, ~${byFile.size - fileCover.length} prunable)`\n );\n\n // --- fully subsumed FILES (every mutant they kill is killed elsewhere too) ---\n const subsumedFiles = queryAll<{ file: string; kills: number }>(\n db,\n `\n\t\t\tWITH file_kill AS (SELECT DISTINCT t.file file, k.mutant_id mid FROM kills k JOIN tests t ON t.id=k.test_id),\n\t\t\t owner AS (SELECT mid, count(DISTINCT file) nf, min(file) only_file FROM file_kill GROUP BY mid)\n\t\t\tSELECT fk.file, count(DISTINCT fk.mid) kills,\n\t\t\t sum(CASE WHEN o.nf=1 THEN 1 ELSE 0 END) unique_kills\n\t\t\tFROM file_kill fk JOIN owner o ON o.mid=fk.mid\n\t\t\tGROUP BY fk.file HAVING unique_kills=0 ORDER BY kills DESC`\n );\n p(`\\nSUBSUMED FILES (file-level identity — safe-to-review deletion candidates)`);\n if (subsumedFiles.length === 0)\n p(` none — every test file kills at least one mutant no other file catches`);\n for (const r of subsumedFiles) p(` ${r.file} (${r.kills} kills, 0 unique)`);\n\n // --- fully subsumed CASES (drill-down) ---\n const subsumedCases = queryAll<SubsumedCase>(\n db,\n `\n\t\t\tWITH mk AS (SELECT mutant_id, count(*) c FROM kills GROUP BY mutant_id),\n\t\t\t tk AS (SELECT test_id, count(*) total, sum(CASE WHEN mk.c=1 THEN 1 ELSE 0 END) uniq\n\t\t\t FROM kills JOIN mk USING(mutant_id) GROUP BY test_id)\n\t\t\tSELECT t.file, t.name, tk.total FROM tk JOIN tests t ON t.id=tk.test_id\n\t\t\tWHERE tk.total>0 AND tk.uniq=0 ORDER BY t.file, tk.total DESC`\n );\n const byFileCases = new Map<string, SubsumedCase[]>();\n for (const r of subsumedCases) {\n const rows = byFileCases.get(r.file) ?? [];\n byFileCases.set(r.file, rows);\n rows.push(r);\n }\n p(\n `\\nSUBSUMED CASES (${subsumedCases.length} individual tests whose every kill is caught elsewhere)`\n );\n for (const [file, rows] of byFileCases) {\n p(` ${file}`);\n for (const r of rows) p(` “${r.name}” (${r.total} kills, 0 unique)`);\n }\n } else {\n p(`\\n⚠ KILL MATRIX INCOMPLETE — redundancy/subsumption analysis suppressed.`);\n p(` Every mutant has at most one recorded killer, so \"which tests are redundant\"`);\n p(` cannot be derived. This needs the no-bail patched Bun runner (not shipped with`);\n p(\n ` @fairfox/polly). Run 'polly mutate verify' to diagnose. Score/gaps/theatre below still hold.`\n );\n }\n\n // Under coverageAnalysis \"all\", Stryker classifies a non-killed mutant as\n // NoCoverage (no test runs it — a true gap) or Survived (a test runs it but\n // nothing detects the mutation — theatre). That status split IS the\n // gap/theatre distinction; it requires coverage to be on (see README).\n const srcFile = queryGet<{ file: string }>(db, \"SELECT file FROM mutants LIMIT 1\")?.file;\n\n // --- gaps: code no test even executes ---\n const gaps = queryAll<LineCount>(\n db,\n \"SELECT line, mutator, count(*) n FROM mutants WHERE status='NoCoverage' GROUP BY line, mutator ORDER BY line\"\n );\n const gapTotal = gaps.reduce((a, r) => a + r.n, 0);\n p(`\\nGAPS (NoCoverage — no test executes this code: ${gapTotal})`);\n if (gapTotal === 0) p(` none — every mutable location is reached by some test`);\n for (const r of gaps) p(` ${srcFile}:${r.line} ${r.mutator}${r.n > 1 ? ` ×${r.n}` : \"\"}`);\n\n // --- theatre: covered but survived ---\n const theatre = queryAll<LineCount>(\n db,\n \"SELECT line, mutator, count(*) n FROM mutants WHERE status='Survived' GROUP BY line, mutator ORDER BY line\"\n );\n const theatreTotal = theatre.reduce((a, r) => a + r.n, 0);\n p(`\\nTHEATRE (Survived — code is covered but no test detects the mutation: ${theatreTotal})`);\n if (theatreTotal === 0) p(` none`);\n for (const r of theatre) p(` ${srcFile}:${r.line} ${r.mutator}${r.n > 1 ? ` ×${r.n}` : \"\"}`);\n\n return out.join(\"\\n\");\n}\n\nif (import.meta.main) {\n const reportPath = process.argv[2] ?? \"reports/mutation/mutation.json\";\n const db = buildDb(await loadMutationReport(reportPath), \"reports/test-debt.sqlite\");\n console.log(report(db));\n db.close();\n}\n",
|
|
13
|
-
"/**\n *
|
|
14
|
-
"
|
|
13
|
+
"/**\n * Ingest a mutation report (mutation-testing-report-schema) into a\n * regenerable SQLite database holding the kill matrix.\n *\n * The tool consumes the *schema*, never a specific runner — so the same\n * analysis works whether the matrix came from the patched bun runner, the\n * tap runner, or an eventual official Bun plugin. The db is a build artefact\n * (gitignored); decisions are kept elsewhere in version control.\n */\nimport { Database } from \"bun:sqlite\";\n\nexport interface MutationReport {\n schemaVersion: string;\n files: Record<string, { mutants: Mutant[] }>;\n testFiles?: Record<string, { tests: TestDef[] }>;\n /** Written by the bun engine; absent from Stryker-era reports. */\n contracts?: ReportContracts;\n}\ninterface Mutant {\n id: string;\n mutatorName: string;\n status: string;\n location: { start: { line: number; column: number } };\n killedBy?: string[];\n coveredBy?: string[];\n /** Contract ids (`<file>:<line>`) a killing test's failure named. */\n killedByContract?: string[];\n /** Every killer failed through a contract: no assertion caught the mutant. */\n contractOnly?: boolean;\n}\n\n/** The engine's contracts block: how the run enforced requires/ensures, and what it found. */\nexport interface ReportContracts {\n mode: \"off\" | \"ensures\" | \"all\";\n runner: \"bun-test\" | \"command\";\n sites: ContractSiteDef[];\n violations: { target: string; test: string; contracts: string[] }[];\n}\nexport interface ContractSiteDef {\n /** `<file>:<line>`, what `killedByContract` holds. */\n id: string;\n file: string;\n line: number;\n primitive: \"requires\" | \"ensures\";\n message?: string;\n handler?: { from: number; to: number };\n}\ninterface TestDef {\n id: string;\n name: string;\n location?: { start: { line: number; column: number } };\n}\n\nexport function buildDb(report: MutationReport, dbPath = \":memory:\"): Database {\n const db = new Database(dbPath);\n db.exec(\"PRAGMA journal_mode = WAL;\");\n db.exec(`\n\t\tDROP TABLE IF EXISTS kills;\n\t\tDROP TABLE IF EXISTS covers;\n\t\tDROP TABLE IF EXISTS contract_kills;\n\t\tDROP TABLE IF EXISTS contract_sites;\n\t\tDROP TABLE IF EXISTS contract_violations;\n\t\tDROP TABLE IF EXISTS report_meta;\n\t\tDROP TABLE IF EXISTS mutants;\n\t\tDROP TABLE IF EXISTS tests;\n\t\tCREATE TABLE tests (\n\t\t\tid TEXT PRIMARY KEY,\n\t\t\tfile TEXT NOT NULL,\n\t\t\tname TEXT NOT NULL,\n\t\t\tline INTEGER\n\t\t);\n\t\tCREATE TABLE mutants (\n\t\t\tid TEXT PRIMARY KEY,\n\t\t\tmutator TEXT NOT NULL,\n\t\t\tfile TEXT NOT NULL,\n\t\t\tline INTEGER,\n\t\t\tstatus TEXT NOT NULL,\n\t\t\tcontract_only INTEGER NOT NULL DEFAULT 0\n\t\t);\n\t\t-- requires/ensures sites and the mutants each one killed (bun engine, contracts on)\n\t\tCREATE TABLE contract_sites (\n\t\t\tid TEXT PRIMARY KEY,\n\t\t\tfile TEXT NOT NULL,\n\t\t\tline INTEGER NOT NULL,\n\t\t\tprimitive TEXT NOT NULL,\n\t\t\tmessage TEXT,\n\t\t\thandler_from INTEGER,\n\t\t\thandler_to INTEGER\n\t\t);\n\t\tCREATE TABLE contract_kills (\n\t\t\tmutant_id TEXT NOT NULL REFERENCES mutants(id),\n\t\t\tcontract_id TEXT NOT NULL,\n\t\t\tPRIMARY KEY (mutant_id, contract_id)\n\t\t);\n\t\tCREATE TABLE contract_violations (\n\t\t\ttarget TEXT NOT NULL,\n\t\t\ttest TEXT NOT NULL,\n\t\t\tcontract_id TEXT\n\t\t);\n\t\tCREATE TABLE report_meta (key TEXT PRIMARY KEY, value TEXT NOT NULL);\n\t\t-- the kill matrix: (mutant, test) where test detects mutant\n\t\tCREATE TABLE kills (\n\t\t\tmutant_id TEXT NOT NULL REFERENCES mutants(id),\n\t\t\ttest_id TEXT NOT NULL REFERENCES tests(id),\n\t\t\tPRIMARY KEY (mutant_id, test_id)\n\t\t);\n\t\t-- coverage matrix (populated only when the runner reports coveredBy)\n\t\tCREATE TABLE covers (\n\t\t\tmutant_id TEXT NOT NULL REFERENCES mutants(id),\n\t\t\ttest_id TEXT NOT NULL REFERENCES tests(id),\n\t\t\tPRIMARY KEY (mutant_id, test_id)\n\t\t);\n\t\tCREATE INDEX idx_kills_test ON kills(test_id);\n\t\tCREATE INDEX idx_kills_mutant ON kills(mutant_id);\n\t`);\n\n const insTest = db.prepare(\n \"INSERT OR IGNORE INTO tests (id, file, name, line) VALUES (?, ?, ?, ?)\"\n );\n const insMut = db.prepare(\n \"INSERT INTO mutants (id, mutator, file, line, status, contract_only) VALUES (?, ?, ?, ?, ?, ?)\"\n );\n const insKill = db.prepare(\"INSERT OR IGNORE INTO kills (mutant_id, test_id) VALUES (?, ?)\");\n const insCover = db.prepare(\"INSERT OR IGNORE INTO covers (mutant_id, test_id) VALUES (?, ?)\");\n const insContractKill = db.prepare(\n \"INSERT OR IGNORE INTO contract_kills (mutant_id, contract_id) VALUES (?, ?)\"\n );\n const insSite = db.prepare(\n \"INSERT OR IGNORE INTO contract_sites (id, file, line, primitive, message, handler_from, handler_to) VALUES (?, ?, ?, ?, ?, ?, ?)\"\n );\n const insViolation = db.prepare(\n \"INSERT INTO contract_violations (target, test, contract_id) VALUES (?, ?, ?)\"\n );\n const insMeta = db.prepare(\"INSERT INTO report_meta (key, value) VALUES (?, ?)\");\n\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: two flat insert loops inside one transaction — keeping them together is the point.\n const ingest = db.transaction(() => {\n for (const [file, tf] of Object.entries(report.testFiles ?? {})) {\n for (const t of tf.tests) {\n insTest.run(t.id, file || \"(unknown)\", t.name, t.location?.start.line ?? null);\n }\n }\n for (const [file, f] of Object.entries(report.files)) {\n for (const m of f.mutants) {\n insMut.run(\n m.id,\n m.mutatorName,\n file,\n m.location.start.line,\n m.status,\n m.contractOnly ? 1 : 0\n );\n for (const tid of m.killedBy ?? []) insKill.run(m.id, tid);\n for (const tid of m.coveredBy ?? []) insCover.run(m.id, tid);\n for (const cid of m.killedByContract ?? []) insContractKill.run(m.id, cid);\n }\n }\n const contracts = report.contracts;\n if (contracts) {\n insMeta.run(\"contracts_mode\", contracts.mode);\n insMeta.run(\"runner\", contracts.runner);\n for (const s of contracts.sites) {\n insSite.run(\n s.id,\n s.file,\n s.line,\n s.primitive,\n s.message ?? null,\n s.handler?.from ?? null,\n s.handler?.to ?? null\n );\n }\n for (const v of contracts.violations) {\n if (v.contracts.length === 0) insViolation.run(v.target, v.test, null);\n for (const cid of v.contracts) insViolation.run(v.target, v.test, cid);\n }\n }\n });\n ingest();\n return db;\n}\n\n// SQL rows and the on-disk report arrive untyped; these three helpers are the\n// single sanctioned cast boundary (the `as unknown as` escape hatch) so call\n// sites stay assertion-free and the column/shape types live next to the query.\nexport function queryAll<T>(db: Database, sql: string): T[] {\n return db.query(sql).all() as unknown as T[];\n}\nexport function queryGet<T>(db: Database, sql: string): T | null {\n return db.query(sql).get() as unknown as T | null;\n}\nexport async function loadMutationReport(path: string): Promise<MutationReport> {\n return (await Bun.file(path).json()) as unknown as MutationReport;\n}\n\nif (import.meta.main) {\n const reportPath = process.argv[2] ?? \"reports/mutation/mutation.json\";\n const dbPath = process.argv[3] ?? \"reports/test-debt.sqlite\";\n const db = buildDb(await loadMutationReport(reportPath), dbPath);\n const n = queryGet<{ t: number; m: number; k: number }>(\n db,\n \"SELECT (SELECT count(*) FROM tests) t, (SELECT count(*) FROM mutants) m, (SELECT count(*) FROM kills) k\"\n ) ?? { t: 0, m: 0, k: 0 };\n console.log(`Ingested ${reportPath} -> ${dbPath}`);\n console.log(` ${n.t} tests, ${n.m} mutants, ${n.k} kill-edges`);\n db.close();\n}\n",
|
|
14
|
+
"/**\n * `polly mutate init` — scaffold a `polly.mutate.ts` for a project: targets\n * from `src/` (or the whole tree), tests from `tests/` or `test/`. The import\n * specifier comes from `defineImportSpecifier`, so the file resolves in a\n * consumer project and in polly's own tree alike.\n */\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { MUTATION_CONFIG_FILE, type MutationConfig } from \"./define.ts\";\nimport { defineImportSpecifier, renderMutationConfig } from \"./migrate.ts\";\n\nexport interface InitResult {\n configPath: string;\n /** false when a config already existed and --force was not passed. */\n created: boolean;\n /** Where `defineMutation` is imported from. */\n specifier: string;\n mutate: string[];\n testGlob: string;\n warnings: string[];\n}\n\nfunction detectMutate(projectDir: string): string[] {\n if (existsSync(join(projectDir, \"src\"))) {\n return [\"src/**/*.ts\", \"!src/**/*.test.ts\", \"!src/**/*.d.ts\"];\n }\n return [\"**/*.ts\", \"!**/*.test.ts\", \"!**/*.d.ts\", \"!dist/**\", `!${MUTATION_CONFIG_FILE}`];\n}\n\nfunction detectTestGlob(projectDir: string): string {\n for (const d of [\"tests\", \"test\"]) {\n if (existsSync(join(projectDir, d))) return `${d}/**/*.test.ts`;\n }\n return \"**/*.test.ts\";\n}\n\nexport async function initConfig(\n projectDir: string,\n opts: { force?: boolean } = {}\n): Promise<InitResult> {\n const configPath = join(projectDir, MUTATION_CONFIG_FILE);\n const warnings: string[] = [];\n const specifier = defineImportSpecifier(projectDir);\n if (specifier === \"@fairfox/polly/mutate\") {\n try {\n Bun.resolveSync(specifier, projectDir);\n } catch {\n warnings.push(\"@fairfox/polly does not resolve here — install it, or the config cannot load\");\n }\n }\n\n const mutate = detectMutate(projectDir);\n const testGlob = detectTestGlob(projectDir);\n if (!existsSync(join(projectDir, \"src\"))) {\n warnings.push(\"no src/ directory — adjust `targets` to point at your source\");\n }\n if (!existsSync(join(projectDir, \"tests\")) && !existsSync(join(projectDir, \"test\"))) {\n warnings.push(`no tests/ directory — using \"${testGlob}\"; adjust tests.include if needed`);\n }\n\n if (existsSync(configPath) && !opts.force) {\n return { configPath, created: false, specifier, mutate, testGlob, warnings };\n }\n const config: MutationConfig = { targets: mutate, tests: { include: [testGlob] } };\n await Bun.write(configPath, renderMutationConfig(config, specifier));\n return { configPath, created: true, specifier, mutate, testGlob, warnings };\n}\n",
|
|
15
|
+
"/**\n * Orchestration for `polly mutate run` / `report`: run the Bun-native engine,\n * then read the mutation report and\n * produce the useless-test analysis — gating the redundancy/subsumption\n * sections on a complete (no-bail) kill matrix.\n */\nimport { relative } from \"node:path\";\nimport type { MutateArgs } from \"./args.ts\";\nimport type { MutateConfig } from \"./config.ts\";\nimport { mutationScore, runEngine } from \"./engine/index.ts\";\nimport type { ContractSite, EngineResult } from \"./engine/types.ts\";\nimport { engineConfigFor } from \"./engine-config.ts\";\nimport { buildDb, loadMutationReport } from \"./ingest.ts\";\nimport { report } from \"./report.ts\";\nimport { isMatrixComplete } from \"./verify-matrix.ts\";\n\n/** `--engine` survives for scripts that pass `--engine bun`; Stryker is gone. */\nexport function resolveEngine(args: MutateArgs): \"bun\" {\n const engine = args.engine ?? \"bun\";\n if (engine === \"bun\") return engine;\n if (engine === \"stryker\") {\n throw new Error(\"--engine stryker was removed; the bun engine (the default) replaces it\");\n }\n throw new Error(`unknown --engine \"${engine}\" (expected bun)`);\n}\n\n/** The notice printed when the bun engine reads a Stryker config; null for polly.mutate.ts. */\nexport function deprecationNotice(cfg: MutateConfig): string | null {\n const m = cfg.mutation;\n if (m?.format !== \"stryker\") return null;\n return [\n `deprecated: reading ${relative(cfg.cwd, m.path) || m.path} — Stryker is no longer supported; its config is read for migration only.`,\n \" 'polly mutate migrate --write' writes the equivalent polly.mutate.ts.\",\n ...m.notes.map((n) => ` ${n}`),\n ].join(\"\\n\");\n}\n\n/** `thresholds.break` failure line, or null when the score clears it (or none is set). */\nexport function thresholdFailure(score: number | null, cfg: MutateConfig): string | null {\n const floor = cfg.mutation?.config.thresholds?.break;\n if (floor === undefined || score === null || score >= floor) return null;\n return `mutation score ${score.toFixed(1)}% is below thresholds.break ${floor}%`;\n}\n\n/** Run the Bun-native engine and print a per-target summary. Returns the exit code. */\nexport async function runBunEngine(cfg: MutateConfig, args: MutateArgs): Promise<number> {\n const notice = deprecationNotice(cfg);\n if (notice) console.log(`${notice}\\n`);\n const engineCfg = await engineConfigFor(cfg, args);\n if (engineCfg.targets.length === 0) {\n console.log(\n args.since ? `no mutate targets changed since ${args.since}` : \"no mutate targets matched\"\n );\n return 0;\n }\n let lastPct = -1;\n const result = await runEngine(engineCfg, {\n log: (line) => console.log(line),\n progress: (done, total) => {\n const pct = Math.floor((100 * done) / total);\n if (pct >= lastPct + 10 || done === total) {\n lastPct = pct;\n console.log(` ${done}/${total} mutants`);\n }\n },\n });\n\n console.log(\"\\nfile | tests | killed | survived | timeout | no-cov | invalid | other | score\");\n const all = result.targets.flatMap((t) => t.results);\n for (const t of result.targets) {\n const count = (s: string) => t.results.filter((r) => r.status === s).length;\n const other =\n t.results.length -\n count(\"Killed\") -\n count(\"Survived\") -\n count(\"Timeout\") -\n count(\"NoCoverage\") -\n count(\"CompileError\");\n const score = mutationScore(t.results);\n console.log(\n [\n relative(engineCfg.cwd, t.file),\n t.coveringTests.length,\n count(\"Killed\"),\n count(\"Survived\"),\n count(\"Timeout\"),\n count(\"NoCoverage\"),\n count(\"CompileError\"),\n other,\n score === null ? \"n/a\" : `${score.toFixed(1)}%`,\n ].join(\" | \")\n );\n }\n const total = mutationScore(all);\n console.log(\n `\\n${all.length} mutants in ${(result.wallMs / 1000).toFixed(1)} s · score ${total === null ? \"n/a\" : `${total.toFixed(1)}%`} · report ${cfg.reportPath}`\n );\n const stray = result.strayWrites;\n if (stray && stray.mutants.length > 0) {\n console.log(\n `\\nwarning: mutant runs wrote ${stray.mutants.length} path(s) into ${stray.root} (not deleted — check, then remove):`\n );\n for (const path of stray.mutants) console.log(` ${path}`);\n }\n if (result.contractViolations.length > 0) {\n console.log(contractViolationsBlock(result, engineCfg.cwd));\n return 1;\n }\n const failure = thresholdFailure(total, cfg);\n if (failure) {\n console.log(`\\n✗ ${failure}`);\n return 1;\n }\n return 0;\n}\n\n/**\n * The block printed when a baseline failed through a contract: the unmutated\n * code, under one of its own tests, falsified a requires/ensures. That is a\n * finding about the test or the handler, not about any mutant, so the run\n * stops instead of scoring the target.\n */\nexport function contractViolationsBlock(result: EngineResult, cwd: string): string {\n const sites = new Map<string, ContractSite>(\n result.targets.flatMap((t) =>\n t.contracts.map((c): [string, ContractSite] => [`${relative(cwd, c.file)}:${c.line}`, c])\n )\n );\n const lines = [\n `\\n✗ TEST VIOLATES CONTRACT (${result.contractViolations.length}; the mutants of these targets did not run)`,\n ];\n for (const v of result.contractViolations) {\n const where = v.contracts.length === 0 ? \"\" : ` → ${v.contracts.join(\", \")}`;\n lines.push(` ${relative(cwd, v.target)}: ${v.test}${where}`);\n for (const id of v.contracts) {\n const site = sites.get(id);\n if (site) lines.push(` ${site.primitive}${site.message ? ` “${site.message}”` : \"\"}`);\n }\n }\n lines.push(\n \" A test drives a handler outside its declared precondition, or a handler breaks its own\",\n \" postcondition. Fix the test or the contract; '--contracts ensures' leaves requires inert,\",\n \" '--contracts off' restores the no-op primitives.\"\n );\n return lines.join(\"\\n\");\n}\n\n/** Build the useless-test report from an existing mutation.json (no engine run). */\nexport async function reportFromFile(cfg: MutateConfig): Promise<string> {\n if (!(await Bun.file(cfg.reportPath).exists())) {\n throw new Error(\n `no mutation report at ${cfg.reportPath}. Run 'polly mutate run' first, or pass --report <path>.`\n );\n }\n const mreport = await loadMutationReport(cfg.reportPath);\n const db = buildDb(mreport, cfg.dbPath);\n try {\n return report(db, { matrixComplete: isMatrixComplete(mreport) });\n } finally {\n db.close();\n }\n}\n",
|
|
16
|
+
"/**\n * The Bun-native mutation engine: generate → select → cache → baseline → run → report.\n *\n * generate oxc-parser spans, Stryker-named operators (generate.ts)\n * select one probed pass over every test file records which tests run\n * each mutant (coverage.ts); a mutant no test runs is\n * NoCoverage. Static selection: the test files whose import\n * closure reaches the target (graph.ts)\n * cache a target whose inputs are unchanged reuses its last results (cache.ts)\n * baseline run exactly that subset unmutated; it must pass, and its time\n * sets the per-mutant timeout (baseline.ts)\n * run one `bun test` per mutant, the mutant injected by a preload\n * plugin (preload.ts) — no sandbox copy; each process gets a fresh\n * scratch cwd (workdir.ts). Fast mode bails at the first failure;\n * matrix mode runs every test and records each killer (junit.ts).\n * A mutant the project's tsconfig rejects is CompileError and\n * never runs (typecheck.ts); the check overlaps the baselines\n * report mutation-testing-report-schema JSON (report-writer.ts)\n */\nimport { realpathSync } from \"node:fs\";\nimport { join, relative } from \"node:path\";\nimport { type Baseline, measureBaseline } from \"./baseline.ts\";\nimport {\n type CacheEntry,\n cachedResult,\n cacheKey,\n mutantSig,\n readCache,\n readCoverageCache,\n writeCache,\n writeCoverageCache,\n} from \"./cache.ts\";\nimport {\n COVERAGE_VERSION,\n type Coverage,\n collectCoverage,\n type MutantCoverage,\n type Selection,\n selectionFor,\n} from \"./coverage.ts\";\nimport { generateMutants } from \"./generate.ts\";\nimport {\n buildImportGraph,\n closureOf,\n coveringTests,\n findTestFiles,\n type ImportGraph,\n} from \"./graph.ts\";\nimport {\n contractKills,\n type JunitCase,\n killers,\n LOAD_FAILURE_NAME,\n loadFailureId,\n parseJunit,\n} from \"./junit.ts\";\nimport { toMutationReport, writeReport } from \"./report-writer.ts\";\nimport { pool, preloadPath, runBunTest } from \"./runner.ts\";\nimport { newPaths, snapshotWorktree } from \"./stray-writes.ts\";\nimport { typecheckMutants } from \"./typecheck.ts\";\nimport type {\n ContractSite,\n ContractViolationRecord,\n EngineConfig,\n EngineResult,\n Mutant,\n MutantResult,\n TargetSummary,\n TestRef,\n} from \"./types.ts\";\nimport { createWorkdirs, inCwd, type Workdirs } from \"./workdir.ts\";\n\nexport { collectCoverage, selectionFor } from \"./coverage.ts\";\nexport { applyMutant, generateMutants } from \"./generate.ts\";\nexport { buildImportGraph, coveringTests, findTestFiles } from \"./graph.ts\";\nexport { toMutationReport, writeReport } from \"./report-writer.ts\";\nexport { newPaths, snapshotWorktree } from \"./stray-writes.ts\";\nexport { typecheckMutants } from \"./typecheck.ts\";\nexport type * from \"./types.ts\";\nexport { VERIFY_PRIMITIVES } from \"./verify-callsites.ts\";\n\nexport interface EngineHooks {\n log?: (line: string) => void;\n progress?: (done: number, total: number) => void;\n}\n\ninterface PreparedTarget {\n file: string;\n mutants: Mutant[];\n compileErrors: Mutant[];\n /** The test files its baseline runs: every file some mutant selects. */\n covering: string[];\n /** Dynamic coverage: each mutant's tests, by mutant id. Null: every mutant runs `covering`. */\n selections: Map<string, Selection> | null;\n /** Dynamic coverage: the tests in `covering`, for the report's test list. */\n coverageTests: TestRef[];\n /** Something runs against it: a covering test file, or the command runner. */\n covered: boolean;\n cacheKey: string | null;\n cached: CacheEntry | null;\n contracts: ContractSite[];\n}\n\n/** Files outside the import graph that still change every result. */\nfunction projectFiles(cfg: EngineConfig): string[] {\n return [\n ...cfg.testPreload,\n ...[\"tsconfig.json\", \"bunfig.toml\", \"bun.lock\"].map((f) => join(cfg.cwd, f)),\n ];\n}\n\nexport async function runEngine(cfg: EngineConfig, hooks: EngineHooks = {}): Promise<EngineResult> {\n if (cfg.runner.kind === \"command\" && cfg.mode === \"matrix\") {\n throw new Error(\"matrix mode needs per-test results; the command runner has none\");\n }\n const workdirs = cfg.scratchCwd ? createWorkdirs(cfg.cwd) : null;\n try {\n return await run(cfg, hooks, workdirs);\n } finally {\n workdirs?.remove();\n }\n}\n\ninterface Generated {\n file: string;\n mutants: Mutant[];\n compileErrors: Mutant[];\n /** Static selection. */\n covering: string[];\n contracts: ContractSite[];\n}\n\nasync function generateAll(cfg: EngineConfig, graph: ImportGraph | null): Promise<Generated[]> {\n const out: Generated[] = [];\n for (const [index, target] of cfg.targets.entries()) {\n const file = realpathSync(target.file);\n const { mutants, compileErrors, contracts } = generateMutants(\n file,\n await Bun.file(file).text(),\n {\n ignoreVerifyCallsites: cfg.ignoreVerifyCallsites,\n lines: target.lines,\n idPrefix: `${index}.`,\n exclude: cfg.excludeMutators,\n }\n );\n out.push({\n file,\n mutants,\n compileErrors,\n covering: graph ? coveringTests(graph, file) : [],\n contracts,\n });\n }\n return out;\n}\n\n/** The coverage pass, from the cache when no file the graph knows has changed. */\nasync function dynamicCoverage(\n cfg: EngineConfig,\n graph: ImportGraph,\n generated: readonly Generated[],\n preloads: string[],\n workdirs: Workdirs | null,\n log: (line: string) => void\n): Promise<Coverage | null> {\n const targets = generated.map((g) => ({\n file: g.file,\n mutants: g.mutants.filter((m) => !m.ignoredReason),\n covering: g.covering,\n }));\n const key = cfg.cacheDir\n ? await cacheKey({\n mutants: targets.flatMap((t) => t.mutants),\n closure: [...graph.imports.keys()].sort(),\n projectFiles: projectFiles(cfg),\n settings: {\n coverage: COVERAGE_VERSION,\n targets: targets.map((t) => [t.file, t.mutants.length]),\n tests: graph.testFiles,\n contracts: cfg.contracts,\n },\n })\n : null;\n const cached = cfg.cacheDir && key ? await readCoverageCache(cfg.cacheDir, key) : null;\n if (cached) {\n log(\"coverage pass: from cache\");\n return cached;\n }\n const started = performance.now();\n const coverage = await collectCoverage({\n cwd: cfg.cwd,\n testFiles: graph.testFiles,\n targets,\n preloads,\n concurrency: cfg.concurrency,\n workdirs,\n contracts: cfg.contracts,\n log,\n });\n if (!coverage) return null;\n log(\n `coverage pass: ${Object.keys(coverage.tests).length} tests in ` +\n `${((performance.now() - started) / 1000).toFixed(1)} s`\n );\n if (cfg.cacheDir && key) writeCoverageCache(cfg.cacheDir, key, coverage);\n return coverage;\n}\n\nfunction sortedUnique(items: Iterable<string>): string[] {\n return [...new Set(items)].sort();\n}\n\ntype Picked = Pick<PreparedTarget, \"covering\" | \"selections\" | \"coverageTests\">;\n\n/** Each mutant's tests from the coverage pass; the baseline runs every file any of them picks. */\nfunction dynamicSelection(\n g: Generated,\n target: { mutants: Record<string, MutantCoverage> },\n coverage: Coverage\n): Picked {\n const selections = new Map<string, Selection>();\n for (const m of g.mutants) {\n const cov = target.mutants[m.id];\n if (cov) selections.set(m.id, selectionFor(cov, coverage));\n }\n const covering = sortedUnique([...selections.values()].flatMap((sel) => sel.files));\n const coverageTests = covering.flatMap((f) =>\n (coverage.byFile[f] ?? []).flatMap((id) => {\n const t = coverage.tests[id];\n return t ? [{ id: t.id, file: t.file, name: t.name, line: t.line }] : [];\n })\n );\n return { covering, selections, coverageTests };\n}\n\n/** The part of the cache key that dynamic selection adds. Ids are positional, so sigs. */\nfunction selectionKey(\n mutants: readonly Mutant[],\n selections: Map<string, Selection> | null\n): unknown[] | null {\n if (!selections) return null;\n return mutants.map((m) => {\n const sel = selections.get(m.id);\n return [mutantSig(m), sel?.files ?? [], sel?.namePattern ?? \"\"];\n });\n}\n\n/** The target with its cache key and, on a hit, its cached results. */\nasync function withCache(\n cfg: EngineConfig,\n graph: ImportGraph | null,\n g: Generated,\n picked: Picked\n): Promise<PreparedTarget> {\n const { covering, selections } = picked;\n const settings = {\n mode: cfg.mode,\n timeout: cfg.timeout,\n scratchCwd: cfg.scratchCwd,\n testPreload: cfg.testPreload,\n coverage: cfg.coverage,\n typecheck: cfg.typecheck,\n contracts: cfg.contracts,\n selections: selectionKey(g.mutants, selections),\n };\n // No import graph bounds what a command reads, so its results are never cached.\n const key =\n cfg.cacheDir && graph && covering.length > 0\n ? await cacheKey({\n mutants: g.mutants,\n closure: closureOf(graph, covering),\n projectFiles: projectFiles(cfg),\n settings,\n })\n : null;\n return {\n file: g.file,\n mutants: g.mutants,\n compileErrors: g.compileErrors,\n ...picked,\n covered: cfg.runner.kind === \"command\" || covering.length > 0,\n cacheKey: key,\n cached: cfg.cacheDir && key ? await readCache(cfg.cacheDir, key) : null,\n contracts: g.contracts,\n };\n}\n\nasync function prepare(\n cfg: EngineConfig,\n preloads: string[],\n workdirs: Workdirs | null,\n log: (line: string) => void\n): Promise<{ prepared: PreparedTarget[]; testFiles: number }> {\n // The command runner selects nothing: every mutant runs the whole command.\n const command = cfg.runner.kind === \"command\";\n const testFiles = command ? [] : await findTestFiles(cfg.cwd, cfg.testInclude);\n if (!command && testFiles.length === 0) {\n throw new Error(`no test files match ${cfg.testInclude.join(\", \")} under ${cfg.cwd}`);\n }\n const graph = command ? null : await buildImportGraph(testFiles);\n const generated = await generateAll(cfg, graph);\n const coverage =\n graph && cfg.coverage === \"dynamic\"\n ? await dynamicCoverage(cfg, graph, generated, preloads, workdirs, log)\n : null;\n const prepared: PreparedTarget[] = [];\n for (const [index, g] of generated.entries()) {\n const target = coverage?.targets[index];\n if (target?.kind === \"static\") {\n log(`${relative(cfg.cwd, g.file)}: static test selection (${target.reason})`);\n }\n const picked =\n coverage && target?.kind === \"dynamic\"\n ? dynamicSelection(g, target, coverage)\n : { covering: g.covering, selections: null, coverageTests: [] };\n prepared.push(await withCache(cfg, graph, g, picked));\n }\n return { prepared, testFiles: testFiles.length };\n}\n\n/** Every baseline that failed through a contract, logged as it is collected. */\nfunction collectContractViolations(\n cfg: EngineConfig,\n baselines: ReadonlyMap<PreparedTarget, Baseline | null>,\n log: (line: string) => void\n): ContractViolationRecord[] {\n const out: ContractViolationRecord[] = [];\n for (const [p, baseline] of baselines) {\n for (const v of baseline?.contractViolations ?? []) {\n out.push({ target: p.file, test: v.test, contracts: v.contracts });\n const where = v.contracts.length > 0 ? ` → ${v.contracts.join(\", \")}` : \"\";\n log(`${relative(cfg.cwd, p.file)}: test violates contract: ${v.test}${where}`);\n }\n }\n return out;\n}\n\n/** Some test runs the mutant: always under static selection, else when coverage picked a file. */\nfunction selected(p: PreparedTarget, mutant: Mutant): boolean {\n return !p.selections || (p.selections.get(mutant.id)?.files.length ?? 0) > 0;\n}\n\ninterface Job {\n target: number;\n mutant: Mutant;\n timeoutMs: number;\n inTree: boolean;\n}\n\nasync function runMutant(\n cfg: EngineConfig,\n workdirs: Workdirs | null,\n preloads: string[],\n p: PreparedTarget,\n baseline: Baseline,\n job: Job\n): Promise<MutantResult> {\n const matrix = cfg.mode === \"matrix\";\n const selection = p.selections?.get(job.mutant.id);\n const files = selection?.files ?? p.covering;\n const coveredBy = selection ? { coveredBy: selection.coveredBy } : {};\n let runCwd = cfg.cwd;\n const attempt = (namePattern: string | undefined) =>\n inCwd(job.inTree ? null : workdirs, cfg.cwd, (cwd) => {\n runCwd = cwd;\n return runBunTest(\n {\n cwd,\n files,\n preloads,\n contracts: cfg.contracts,\n env: {\n POLLY_MUTATE_FILE: job.mutant.file,\n POLLY_MUTATE_SPAN: JSON.stringify({\n start: job.mutant.start,\n end: job.mutant.end,\n replacement: job.mutant.replacement,\n }),\n },\n bail: !matrix,\n // A filtered run always reports, so a pattern that matched nothing shows.\n junit: matrix || namePattern !== undefined,\n timeoutMs: job.timeoutMs,\n ...(namePattern ? { namePattern } : {}),\n },\n cfg.runner\n );\n });\n let outcome = await attempt(selection?.namePattern);\n let cases: JunitCase[] = outcome.junitXml ? parseJunit(outcome.junitXml, runCwd) : [];\n if (\n selection?.namePattern &&\n !outcome.timedOut &&\n outcome.exitCode !== 0 &&\n matchedNothing(cases)\n ) {\n outcome = await attempt(undefined);\n cases = outcome.junitXml ? parseJunit(outcome.junitXml, runCwd) : [];\n }\n const durationMs = Math.round(outcome.ms);\n const result = { mutant: job.mutant, durationMs, ...coveredBy };\n if (outcome.timedOut) return { ...result, status: \"Timeout\" };\n if (outcome.exitCode === 0) return { ...result, status: \"Survived\" };\n if (!matrix) return { ...result, status: \"Killed\" };\n const ran = new Set(files);\n const reported = new Set([...baseline.reportedFiles].filter((f) => ran.has(f)));\n const killedBy = killers(cases, reported, cfg.cwd);\n return { ...result, status: \"Killed\", killedBy, ...contractAttribution(cfg, cases, killedBy) };\n}\n\n/**\n * Contracts on, matrix mode: the contracts the killing tests' failures name,\n * and whether every killer failed that way — then no assertion caught the\n * mutant, only a contract did.\n */\nfunction contractAttribution(\n cfg: EngineConfig,\n cases: readonly JunitCase[],\n killedBy: readonly string[]\n): Pick<MutantResult, \"killedByContract\" | \"contractOnly\"> {\n if (cfg.contracts === \"off\") return {};\n const kills = contractKills(cases, cfg.cwd);\n if (kills.length === 0) return {};\n const killedByContract = sortedUnique(kills.flatMap((k) => k.contracts));\n const failed = cases.filter((c) => c.status === \"failed\").length;\n // Every failed case named a contract, and no load-failure stand-in joined them.\n const contractOnly = kills.length === failed && killedBy.length === failed;\n return { killedByContract, ...(contractOnly ? { contractOnly: true } : {}) };\n}\n\n/** `bun test -t` exits 1 when its pattern matches no test; that is no kill. */\nfunction matchedNothing(cases: readonly JunitCase[]): boolean {\n return cases.length > 0 && cases.every((c) => c.status === \"skipped\");\n}\n\n/** A target's summary from the cache: results matched by mutant content. */\nfunction fromCache(p: PreparedTarget, entry: CacheEntry): TargetSummary {\n const bySig = new Map(entry.results.map((r) => [r.sig, r]));\n const results: MutantResult[] = [...p.mutants, ...p.compileErrors].map((mutant) => {\n const hit = bySig.get(mutantSig(mutant));\n if (!hit)\n return { mutant, status: \"RuntimeError\", statusReason: \"missing from the cache entry\" };\n const { sig: _sig, ...rest } = hit;\n return { mutant, ...rest };\n });\n results.sort((a, b) => a.mutant.start - b.mutant.start);\n return {\n file: p.file,\n coveringTests: p.covering,\n baselineMs: entry.baselineMs,\n inTree: entry.inTree,\n cached: true,\n tests: entry.tests,\n results,\n contracts: p.contracts,\n };\n}\n\n/** The baseline's tests, plus a stand-in for each file a mutant named as produced-no-results. */\nfunction testsFor(\n cfg: EngineConfig,\n p: PreparedTarget,\n baseline: Baseline,\n results: MutantResult[]\n): TestRef[] {\n const tests = [...baseline.tests];\n const known = new Set(tests.map((t) => t.id));\n for (const t of p.coverageTests) {\n if (!known.has(t.id)) {\n known.add(t.id);\n tests.push(t);\n }\n }\n const used = new Set(results.flatMap((r) => r.killedBy ?? []));\n for (const file of p.covering) {\n const id = loadFailureId(cfg.cwd, file);\n if (used.has(id) && !known.has(id)) tests.push({ id, file, name: LOAD_FAILURE_NAME, line: 0 });\n }\n return tests;\n}\n\nfunction unrun(mutant: Mutant, statusReason: string | undefined): MutantResult {\n return { mutant, status: \"RuntimeError\", statusReason };\n}\n\n/** The status of a mutant that never ran, or null when a run result decides. */\nfunction notRun(p: PreparedTarget, baseline: Baseline | null, mutant: Mutant): MutantResult | null {\n if (!p.covered) {\n const reason = p.selections ? \"no test ran this target\" : \"no test file imports this target\";\n return { mutant, status: \"NoCoverage\", statusReason: reason };\n }\n // A contract violated by the unmutated code voids the target, coverage included:\n // the throw stopped the test before it reached the rest of the handler.\n if (baseline?.contractViolations) return unrun(mutant, baseline.reason);\n if (!selected(p, mutant)) {\n return { mutant, status: \"NoCoverage\", statusReason: \"no test ran this code\", coveredBy: [] };\n }\n if (!baseline?.ok) return unrun(mutant, baseline?.reason);\n return null;\n}\n\nfunction summarise(\n cfg: EngineConfig,\n p: PreparedTarget,\n baseline: Baseline | null,\n byId: Map<string, MutantResult>,\n invalid: ReadonlyMap<string, string>,\n workdirs: Workdirs | null\n): TargetSummary {\n const results: MutantResult[] = p.mutants.map((mutant) => {\n if (mutant.ignoredReason)\n return { mutant, status: \"Ignored\", statusReason: mutant.ignoredReason };\n const typeError = invalid.get(mutant.id);\n if (typeError) return { mutant, status: \"CompileError\", statusReason: typeError };\n return (\n notRun(p, baseline, mutant) ?? byId.get(mutant.id) ?? unrun(mutant, \"mutant was not run\")\n );\n });\n for (const mutant of p.compileErrors) {\n results.push({ mutant, status: \"CompileError\", statusReason: \"mutated source does not parse\" });\n }\n results.sort((a, b) => a.mutant.start - b.mutant.start);\n return {\n file: p.file,\n coveringTests: p.covering,\n baselineMs: baseline?.ok ? Math.round(baseline.ms) : null,\n inTree: baseline?.inTree ?? !workdirs,\n cached: false,\n tests: baseline?.ok ? testsFor(cfg, p, baseline, results) : p.coverageTests,\n results,\n contracts: p.contracts,\n };\n}\n\nasync function run(\n cfg: EngineConfig,\n hooks: EngineHooks,\n workdirs: Workdirs | null\n): Promise<EngineResult> {\n const log = hooks.log ?? (() => undefined);\n const started = performance.now();\n const preloads = [...cfg.testPreload, preloadPath()];\n const beforeRun = snapshotWorktree(cfg.cwd);\n\n const { prepared, testFiles } = await prepare(cfg, preloads, workdirs, log);\n const totalMutants = prepared.reduce((n, p) => n + p.mutants.length, 0);\n const hits = prepared.filter((p) => p.cached).length;\n log(\n `${prepared.length} target(s), ${totalMutants} mutants, ` +\n (cfg.runner.kind === \"command\"\n ? `command \\`${cfg.runner.argv.join(\" \")}\\``\n : `${testFiles} test files in scope`) +\n `, ${cfg.mode} mode` +\n (cfg.runner.kind === \"bun-test\" ? `, ${cfg.coverage} coverage` : \"\") +\n (cfg.cacheDir ? `, ${hits} target(s) from cache` : \"\")\n );\n\n const fresh = prepared.filter((p) => !p.cached && p.covered);\n // The type filter is one tsgo process; it runs while the baselines use the pool.\n const [measured, typed] = await Promise.all([\n pool(fresh, cfg.concurrency, (p) => measureBaseline(cfg, workdirs, preloads, p, log)),\n cfg.typecheck\n ? typecheckMutants(\n prepared\n .filter((p) => !p.cached)\n .map((p) => ({ file: p.file, mutants: p.mutants.filter((m) => !m.ignoredReason) })),\n { cwd: cfg.cwd, log }\n )\n : null,\n ]);\n const invalid: ReadonlyMap<string, string> = typed?.invalid ?? new Map();\n const baselines = new Map(fresh.map((p, i) => [p, measured[i] ?? null]));\n const afterBaselines = snapshotWorktree(cfg.cwd);\n const contractViolations = collectContractViolations(cfg, baselines, log);\n\n const jobs: Job[] = [];\n prepared.forEach((p, target) => {\n const baseline = baselines.get(p);\n if (!baseline?.ok) return;\n const timeoutMs = Math.round(baseline.ms * cfg.timeout.factor + cfg.timeout.extraMs);\n for (const mutant of p.mutants) {\n if (!mutant.ignoredReason && !invalid.has(mutant.id) && selected(p, mutant))\n jobs.push({ target, mutant, timeoutMs, inTree: baseline.inTree });\n }\n });\n // Slowest targets first, so a long tail does not start last.\n jobs.sort((a, b) => b.timeoutMs - a.timeoutMs);\n\n let done = 0;\n const runResults = await pool(jobs, cfg.concurrency, async (job) => {\n const p = prepared[job.target];\n const baseline = p && baselines.get(p);\n if (!p || !baseline) throw new Error(`job for target ${job.target} has no baseline`);\n const result = await runMutant(cfg, workdirs, preloads, p, baseline, job);\n done++;\n hooks.progress?.(done, jobs.length);\n return result;\n });\n const byId = new Map(runResults.map((r) => [r.mutant.id, r]));\n\n const targets: TargetSummary[] = prepared.map((p) =>\n p.cached\n ? fromCache(p, p.cached)\n : summarise(cfg, p, baselines.get(p) ?? null, byId, invalid, workdirs)\n );\n\n const afterMutants = snapshotWorktree(cfg.cwd);\n const strayWrites = beforeRun\n ? {\n root: beforeRun.root,\n baseline: newPaths(beforeRun, afterBaselines),\n mutants: newPaths(afterBaselines, afterMutants),\n }\n : null;\n for (const path of strayWrites?.mutants ?? []) log(`warning: a mutant run wrote ${path}`);\n\n // After the last snapshot, so cache writes are never reported as stray.\n if (cfg.cacheDir) {\n targets.forEach((t, i) => {\n const p = prepared[i];\n if (!cfg.cacheDir || !p?.cacheKey || t.cached || t.baselineMs === null) return;\n writeCache(cfg.cacheDir, p.cacheKey, {\n baselineMs: t.baselineMs,\n inTree: t.inTree,\n tests: t.tests,\n results: t.results.map(cachedResult),\n });\n });\n }\n\n const result: EngineResult = {\n targets,\n wallMs: Math.round(performance.now() - started),\n strayWrites,\n contractViolations,\n };\n await writeReport(\n await toMutationReport(result, cfg.cwd, { contracts: cfg.contracts, runner: cfg.runner.kind }),\n cfg.reportPath\n );\n return result;\n}\n\n/** Stryker's score: detected / (detected + undetected); ignored and invalid mutants do not count. */\nexport function mutationScore(results: readonly MutantResult[]): number | null {\n let detected = 0;\n let valid = 0;\n for (const r of results) {\n if (r.status === \"Killed\" || r.status === \"Timeout\") detected++;\n if (\n r.status === \"Killed\" ||\n r.status === \"Timeout\" ||\n r.status === \"Survived\" ||\n r.status === \"NoCoverage\"\n )\n valid++;\n }\n return valid === 0 ? null : (100 * detected) / valid;\n}\n",
|
|
17
|
+
"/**\n * The baseline: a target's covering tests, run once with the injection\n * preload and no mutant. It must pass — a mutant \"killed\" by an already-red\n * test proves nothing — and its time sets the per-mutant timeout.\n *\n * Scratch cwd first. When that is red, try the project cwd: green there means\n * the tests depend on the cwd (fixtures read relative to it, say), so the\n * target runs in-tree, where the stray-write guard still reports leaks.\n *\n * In matrix mode the baseline also records every test it ran. A green run\n * whose junit report holds no test case means the reporter broke; the matrix\n * would then be empty without any error, so the target fails instead.\n *\n * With contracts on, a red baseline is read for contract violations: a test\n * that drives a handler outside its `requires`, or a handler that breaks its\n * own `ensures`. That is a finding, not flakiness, so it is reported at once\n * and never retried in-tree. The command runner has no per-test results, so\n * a red command is rerun once with contracts off: green there means the\n * command fails only through a contract.\n */\nimport { relative } from \"node:path\";\nimport { type ContractKill, contractKills, parseJunit, testId } from \"./junit.ts\";\nimport { type BunTestOutcome, runBunTest } from \"./runner.ts\";\nimport type { EngineConfig, TestRef } from \"./types.ts\";\nimport { inCwd, type Workdirs } from \"./workdir.ts\";\n\n/** Attempts before a red baseline marks a target untrustworthy (flaky subsets do exist). */\nconst BASELINE_ATTEMPTS = 3;\nconst BASELINE_TIMEOUT_MS = 300_000;\n\nexport interface Baseline {\n ok: boolean;\n ms: number;\n reason?: string;\n /** The target's tests need the project cwd, so its mutants run there. */\n inTree: boolean;\n /** Matrix mode: the tests that ran. */\n tests: TestRef[];\n /** Matrix mode: test files that reported at least one case. */\n reportedFiles: Set<string>;\n /** Contracts on: the tests (or the command) that fail through a contract. */\n contractViolations?: ContractKill[];\n}\n\ntype Attempt = Omit<Baseline, \"inTree\">;\n\nfunction failed(reason: string, contractViolations?: ContractKill[]): Attempt {\n return {\n ok: false,\n ms: 0,\n reason,\n tests: [],\n reportedFiles: new Set(),\n ...(contractViolations ? { contractViolations } : {}),\n };\n}\n\nconst COMMAND = \"(command)\";\n\n/** A red command rerun with contracts off: green means a contract alone fails it. */\nasync function commandViolatesContract(\n cfg: EngineConfig,\n cwd: string,\n preloads: string[],\n files: string[]\n): Promise<boolean> {\n const off = await runBunTest(\n {\n cwd,\n files,\n preloads,\n contracts: \"off\",\n bail: false,\n timeoutMs: BASELINE_TIMEOUT_MS,\n captureStderr: true,\n },\n cfg.runner\n );\n return off.exitCode === 0 && !off.timedOut;\n}\n\n/** A green run: in matrix mode, its tests from junit (an empty report is a failure). */\nfunction green(cfg: EngineConfig, cwd: string, outcome: BunTestOutcome): Attempt {\n if (cfg.mode === \"fast\") return { ok: true, ms: outcome.ms, tests: [], reportedFiles: new Set() };\n const cases = parseJunit(outcome.junitXml ?? \"\", cwd);\n if (cases.length === 0) {\n return failed(\"baseline passed but its junit report holds no test case (reporter broke?)\");\n }\n return {\n ok: true,\n ms: outcome.ms,\n tests: cases.map((c) => ({\n id: testId(cfg.cwd, c.file, c.name, c.line),\n file: c.file,\n name: c.name,\n line: c.line,\n })),\n reportedFiles: new Set(cases.map((c) => c.file)),\n };\n}\n\nasync function measureIn(\n cfg: EngineConfig,\n cwd: string,\n preloads: string[],\n files: string[]\n): Promise<Attempt> {\n let last = \"\";\n for (let attempt = 1; attempt <= BASELINE_ATTEMPTS; attempt++) {\n const outcome = await runBunTest(\n {\n cwd,\n files,\n preloads,\n contracts: cfg.contracts,\n bail: false,\n timeoutMs: BASELINE_TIMEOUT_MS,\n captureStderr: true,\n // Contracts on: a red run's failure text says whether a contract caused it.\n junit: cfg.mode === \"matrix\" || (cfg.contracts !== \"off\" && cfg.runner.kind === \"bun-test\"),\n },\n cfg.runner\n );\n if (outcome.exitCode === 0 && !outcome.timedOut) return green(cfg, cwd, outcome);\n last = outcome.timedOut\n ? `timed out after ${BASELINE_TIMEOUT_MS} ms`\n : `exit ${outcome.exitCode}`;\n const failLine = outcome.stderrTail?.match(/\\(fail\\)[^\\n]*/)?.[0];\n if (failLine) last += `: ${failLine}`;\n if (cfg.contracts === \"off\" || outcome.timedOut) continue;\n // Deterministic, so no retry: a contract is false on the unmutated code.\n const contract = await contractFailure(cfg, cwd, preloads, files, outcome.junitXml, last);\n if (contract) return contract;\n }\n return failed(`baseline red ${BASELINE_ATTEMPTS}× on the selected tests (${last})`);\n}\n\n/** The red run as a contract finding, or null when no contract explains it. */\nasync function contractFailure(\n cfg: EngineConfig,\n cwd: string,\n preloads: string[],\n files: string[],\n junitXml: string | undefined,\n last: string\n): Promise<Attempt | null> {\n if (cfg.runner.kind === \"command\") {\n if (!(await commandViolatesContract(cfg, cwd, preloads, files))) return null;\n return failed(\n `the command fails only with contracts on (POLLY_CONTRACTS=${cfg.contracts}): a scenario violates a contract`,\n [{ test: COMMAND, contracts: [] }]\n );\n }\n const cases = parseJunit(junitXml ?? \"\", cwd);\n const violations = contractKills(cases, cfg.cwd);\n if (violations.length === 0) return null;\n const red = cases.filter((c) => c.status === \"failed\").length;\n return failed(\n violations.length === red\n ? `${violations.length} test(s) violate contracts`\n : `baseline red (${last}) and ${violations.length} of ${red} failing test(s) violate contracts`,\n violations\n );\n}\n\nexport async function measureBaseline(\n cfg: EngineConfig,\n workdirs: Workdirs | null,\n preloads: string[],\n target: { file: string; covering: string[] },\n log: (line: string) => void\n): Promise<Baseline> {\n const scratch = await inCwd(workdirs, cfg.cwd, (cwd) =>\n measureIn(cfg, cwd, preloads, target.covering)\n );\n // A contract violation does not depend on the cwd: no in-tree retry.\n if (scratch.ok || !workdirs || scratch.contractViolations) {\n return { ...scratch, inTree: !workdirs };\n }\n const inTree = await measureIn(cfg, cfg.cwd, preloads, target.covering);\n if (inTree.ok) {\n log(\n `${relative(cfg.cwd, target.file)}: tests fail outside ${cfg.cwd} (${scratch.reason}); its mutants run in-tree`\n );\n }\n return { ...inTree, inTree: true };\n}\n",
|
|
18
|
+
"/**\n * Per-test results from `bun test --reporter=junit`, for matrix mode.\n *\n * Bun's XML nests one `<testsuite>` per file and one per `describe`; the\n * `classname` attribute lists the describe path innermost-first, so the full\n * name is rebuilt from the nesting instead. A test file that throws while\n * loading leaves no element at all — and so does a file with no tests. A file\n * the green baseline reported and a mutant run did not is a load failure;\n * `loadFailureId` names a stand-in test for it, so that mutant has a killer.\n *\n * One function, `testId`, builds the id for both the report's test list and\n * each mutant's `killedBy`, so the two always resolve against each other.\n */\nimport { realpathSync } from \"node:fs\";\nimport { relative, resolve } from \"node:path\";\n\nexport interface JunitCase {\n /** Absolute path of the test file. */\n file: string;\n /** describe path and test name, outermost first, joined with \" > \". */\n name: string;\n /** The same path joined with spaces: the full name `bun test -t` matches. */\n filterName: string;\n line: number;\n status: \"passed\" | \"failed\" | \"skipped\";\n /** A failed case: the `<failure>` message attribute and body, decoded. */\n failureMessage?: string;\n}\n\nconst ENTITIES: Record<string, string> = {\n \""\": '\"',\n \"'\": \"'\",\n \"<\": \"<\",\n \">\": \">\",\n \"&\": \"&\",\n};\n\nfunction decode(s: string): string {\n return s.replace(/&(?:quot|apos|lt|gt|amp|#(\\d+)|#x([0-9a-f]+));/gi, (m, dec, hex) => {\n if (dec) return String.fromCodePoint(Number(dec));\n if (hex) return String.fromCodePoint(Number.parseInt(hex, 16));\n return ENTITIES[m] ?? m;\n });\n}\n\nfunction attr(attrs: string, key: string): string {\n const m = new RegExp(`\\\\b${key}=\"([^\"]*)\"`).exec(attrs);\n return m?.[1] === undefined ? \"\" : decode(m[1]);\n}\n\nfunction caseStatus(body: string): JunitCase[\"status\"] {\n if (/<(?:failure|error)\\b/.test(body)) return \"failed\";\n return /<skipped\\b/.test(body) ? \"skipped\" : \"passed\";\n}\n\nconst FAILURE = /<(?:failure|error)\\b([^>]*?)(?:\\/>|>([\\s\\S]*?)<\\/(?:failure|error)>)/;\n\n/** The failure's message attribute, then its text, decoded; undefined when not failed. */\nfunction failureMessage(body: string): string | undefined {\n const m = FAILURE.exec(body);\n if (!m) return undefined;\n const parts = [attr(m[1] ?? \"\", \"message\"), decode(m[2] ?? \"\")].filter((s) => s.length > 0);\n return parts.join(\"\\n\");\n}\n\nconst TAG =\n /<testsuite\\b([^>]*?)(\\/?)>|<\\/testsuite>|<testcase\\b([^>]*?)(?:\\/>|>([\\s\\S]*?)<\\/testcase>)/g;\n\n/** `cwd` is the directory `bun test` ran in: Bun writes `file` relative to it when it can. */\nexport function parseJunit(xml: string, cwd: string): JunitCase[] {\n const cases: JunitCase[] = [];\n // The first suite level is the file; deeper levels are describe blocks.\n const suites: string[] = [];\n for (const [whole, suiteAttrs, selfClosing, caseAttrs, body] of xml.matchAll(TAG)) {\n if (whole.startsWith(\"</testsuite\")) suites.pop();\n else if (suiteAttrs !== undefined && selfClosing !== \"/\") suites.push(attr(suiteAttrs, \"name\"));\n else if (caseAttrs !== undefined) cases.push(caseFrom(suites, caseAttrs, body ?? \"\", cwd));\n }\n return cases;\n}\n\nfunction caseFrom(\n suites: readonly string[],\n caseAttrs: string,\n body: string,\n cwd: string\n): JunitCase {\n const path = [...suites.slice(1), attr(caseAttrs, \"name\")];\n const status = caseStatus(body);\n const message = status === \"failed\" ? failureMessage(body) : undefined;\n return {\n file: resolve(cwd, attr(caseAttrs, \"file\")),\n name: path.join(\" > \"),\n filterName: path.join(\" \"),\n line: Number(attr(caseAttrs, \"line\")) || 0,\n status,\n ...(message === undefined ? {} : { failureMessage: message }),\n };\n}\n\n/** `<file relative to the project>#<full name>@<line>`. */\nexport function testId(projectCwd: string, file: string, name: string, line: number): string {\n return `${relative(projectCwd, file)}#${name}@${line}`;\n}\n\n/**\n * The marker a ContractViolation's message starts with (verify primitives):\n * `[polly-contract ensures /abs/handlers.ts:50] the author's message`.\n */\nexport const CONTRACT_MARKER = /\\[polly-contract (requires|ensures) (.+?):(\\d+)\\]/g;\n\nfunction realOr(path: string): string {\n try {\n return realpathSync(path);\n } catch {\n return path;\n }\n}\n\n/** Contract ids (`<file relative to the project>:<line>`) named in a failure text, sorted unique. */\nexport function contractsIn(text: string, projectCwd: string): string[] {\n const ids = new Set<string>();\n for (const m of text.matchAll(CONTRACT_MARKER)) {\n if (m[2] && m[3]) ids.add(`${relative(projectCwd, realOr(m[2]))}:${m[3]}`);\n }\n return [...ids].sort();\n}\n\nexport interface ContractKill {\n /** junit.ts `testId` of the failed case. */\n test: string;\n contracts: string[];\n}\n\n/** Each failed case whose failure names a contract, with the contracts it names. */\nexport function contractKills(cases: readonly JunitCase[], projectCwd: string): ContractKill[] {\n const out: ContractKill[] = [];\n for (const c of cases) {\n if (c.status !== \"failed\" || c.failureMessage === undefined) continue;\n const contracts = contractsIn(c.failureMessage, projectCwd);\n if (contracts.length > 0) {\n out.push({ test: testId(projectCwd, c.file, c.name, c.line), contracts });\n }\n }\n return out;\n}\n\nexport const LOAD_FAILURE_NAME = \"(file produced no results)\";\n\nexport function loadFailureId(projectCwd: string, file: string): string {\n return testId(projectCwd, file, LOAD_FAILURE_NAME, 0);\n}\n\n/**\n * The tests that detected a mutant: every failed case, plus a stand-in for\n * each file the baseline reported that this run did not (it threw while\n * loading, or the process died first). Empty when the process failed for a reason no test file explains.\n */\nexport function killers(\n cases: readonly JunitCase[],\n baselineFiles: ReadonlySet<string>,\n projectCwd: string\n): string[] {\n const ids = cases\n .filter((c) => c.status === \"failed\")\n .map((c) => testId(projectCwd, c.file, c.name, c.line));\n const reported = new Set(cases.map((c) => c.file));\n for (const f of [...baselineFiles].sort()) {\n if (!reported.has(f)) ids.push(loadFailureId(projectCwd, f));\n }\n return ids;\n}\n",
|
|
19
|
+
"/**\n * Process execution: one `bun test` per mutant, a bounded pool, and a timeout\n * derived from each target's measured baseline.\n *\n * A fresh process per mutant is the floor Bun allows — `bun test` cannot be\n * re-entered in one process with a different module graph — but it costs tens\n * of milliseconds, and test selection keeps each run to the files that reach\n * the target.\n */\nimport { randomUUID } from \"node:crypto\";\nimport { existsSync, rmSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { ContractsMode, EngineRunner } from \"./types.ts\";\n\nexport interface BunTestRun {\n cwd: string;\n files: string[];\n /** Every `--preload`, in order; the mutant preload goes last. */\n preloads: string[];\n env?: Record<string, string>;\n /** POLLY_CONTRACTS for the process (both runner kinds). Unset: off. */\n contracts?: ContractsMode;\n bail: boolean;\n timeoutMs: number;\n /** Capture the tail of stderr (baselines only; mutant runs discard output). */\n captureStderr?: boolean;\n /** Ask for Bun's junit report and return its XML (matrix mode). */\n junit?: boolean;\n /** `bun test -t`: run only the tests whose full name matches. */\n namePattern?: string;\n}\n\nexport interface BunTestOutcome {\n exitCode: number;\n timedOut: boolean;\n ms: number;\n stderrTail?: string;\n /** The junit XML; undefined when not asked for or not written (a crash). */\n junitXml?: string;\n}\n\n/** The preload as built (dist) or as source (monorepo / bun-run-from-source). */\nexport function preloadPath(): string {\n const candidates = [\n `${import.meta.dir}/preload.js`,\n `${import.meta.dir}/engine/preload.js`,\n `${import.meta.dir}/preload.ts`,\n ];\n const found = candidates.find((c) => existsSync(c));\n if (!found)\n throw new Error(`polly mutate: cannot find the engine preload (looked in ${import.meta.dir})`);\n return found;\n}\n\n/** The engine's own variables never leak in from the shell; the run sets them. */\nfunction cleanEnv(extra: Record<string, string> | undefined): Record<string, string> {\n const env: Record<string, string> = {};\n for (const [k, v] of Object.entries(process.env)) {\n if (v !== undefined && !k.startsWith(\"POLLY_MUTATE_\") && k !== \"POLLY_CONTRACTS\") env[k] = v;\n }\n return { ...env, ...extra };\n}\n\nasync function readJunit(path: string | undefined): Promise<string | undefined> {\n if (!path) return undefined;\n const file = Bun.file(path);\n if (!(await file.exists())) return undefined;\n const xml = await file.text();\n rmSync(path, { force: true });\n return xml;\n}\n\n/**\n * The argv for one test process. `bun-test` builds the `bun test` line;\n * `command` runs the configured argv whole and reaches every Bun process it\n * starts through BUN_OPTIONS, so `files`, `bail` and `junit` do not apply.\n */\nfunction processArgv(\n runner: EngineRunner,\n run: BunTestRun,\n junitPath: string | undefined\n): { argv: string[]; env: Record<string, string> } {\n const env = { ...run.env, POLLY_CONTRACTS: run.contracts ?? \"off\" };\n if (runner.kind === \"command\") {\n const inherited = process.env[\"BUN_OPTIONS\"];\n const preloads = run.preloads.map((p) => `--preload=${p}`).join(\" \");\n return {\n argv: runner.argv,\n env: { ...env, BUN_OPTIONS: inherited ? `${inherited} ${preloads}` : preloads },\n };\n }\n return {\n argv: [\n \"bun\",\n \"test\",\n ...run.preloads.flatMap((p) => [\"--preload\", p]),\n ...(run.bail ? [\"--bail\"] : []),\n ...(run.namePattern ? [\"-t\", run.namePattern] : []),\n ...(junitPath ? [\"--reporter=junit\", `--reporter-outfile=${junitPath}`] : []),\n ...run.files,\n ],\n env,\n };\n}\n\nexport async function runBunTest(\n run: BunTestRun,\n runner: EngineRunner = { kind: \"bun-test\" }\n): Promise<BunTestOutcome> {\n const started = performance.now();\n const junitPath =\n run.junit && runner.kind === \"bun-test\"\n ? join(tmpdir(), `polly-mutate-junit-${randomUUID()}.xml`)\n : undefined;\n const { argv, env } = processArgv(runner, run, junitPath);\n // A command (`bun run bdd`) starts a process tree; its own group lets a\n // timeout kill the whole tree, not just the shell at the top.\n const group = runner.kind === \"command\";\n const proc = Bun.spawn(argv, {\n cwd: run.cwd,\n detached: group,\n env: cleanEnv(env),\n stdin: \"ignore\",\n stdout: \"ignore\",\n stderr: run.captureStderr ? \"pipe\" : \"ignore\",\n });\n let timedOut = false;\n const timer = setTimeout(() => {\n timedOut = true;\n if (group) process.kill(-proc.pid, 9);\n else proc.kill(9);\n }, run.timeoutMs);\n const stderrText =\n run.captureStderr && proc.stderr ? new Response(proc.stderr).text() : undefined;\n const exitCode = await proc.exited;\n clearTimeout(timer);\n const ms = performance.now() - started;\n const junitXml = await readJunit(junitPath);\n const outcome: BunTestOutcome = { exitCode, timedOut, ms, ...(junitXml ? { junitXml } : {}) };\n if (stderrText === undefined) return outcome;\n return { ...outcome, stderrTail: (await stderrText).slice(-2000) };\n}\n\n/** Run `fn` over `items` with at most `concurrency` in flight; results keep input order. */\nexport async function pool<T, R>(\n items: readonly T[],\n concurrency: number,\n fn: (item: T, index: number) => Promise<R>\n): Promise<R[]> {\n const results: R[] = new Array(items.length);\n let next = 0;\n const worker = async () => {\n while (next < items.length) {\n const i = next++;\n const item = items[i];\n if (item !== undefined) results[i] = await fn(item, i);\n }\n };\n await Promise.all(\n Array.from({ length: Math.max(1, Math.min(concurrency, items.length)) }, worker)\n );\n return results;\n}\n",
|
|
20
|
+
"/**\n * Scratch working directories. Each test process runs with a fresh, empty cwd\n * outside the project, so a mutant that turns a configured path into a\n * relative one writes into a throwaway directory instead of the repo.\n *\n * Bun reads two things from the cwd that the tests depend on, so the scratch\n * dir carries a copy of each:\n *\n * tsconfig.json `extends` the project's — Bun takes JSX settings\n * (jsxImportSource) from the cwd's tsconfig, not the file's\n * bunfig.toml the project's, re-rendered with every preload resolved to\n * an absolute path — Bun resolves bunfig preloads against\n * the cwd, even under `--config`\n *\n * Tests that read `process.cwd()` still break here. The engine detects that\n * from a red scratch baseline and runs that target in-tree instead.\n */\nimport { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\n\nexport interface Workdirs {\n root: string;\n /** A fresh cwd holding the project's tsconfig and bunfig. */\n create(): string;\n /** Remove one directory from `create()`. */\n release(dir: string): void;\n /** Remove every scratch directory. */\n remove(): void;\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\nfunction absolutePreload(spec: unknown, projectCwd: string): unknown {\n if (typeof spec !== \"string\") return spec;\n try {\n return Bun.resolveSync(spec, projectCwd);\n } catch {\n return spec;\n }\n}\n\n/** Resolve top-level `preload` and `[test].preload` (a string or a list) against the project. */\nexport function absolutiseBunfig(\n config: Record<string, unknown>,\n projectCwd: string\n): Record<string, unknown> {\n const fix = (v: unknown) =>\n Array.isArray(v)\n ? v.map((s) => absolutePreload(s, projectCwd))\n : absolutePreload(v, projectCwd);\n const out: Record<string, unknown> = { ...config };\n if (\"preload\" in out) out[\"preload\"] = fix(out[\"preload\"]);\n const test = out[\"test\"];\n if (isRecord(test) && \"preload\" in test) out[\"test\"] = { ...test, preload: fix(test[\"preload\"]) };\n return out;\n}\n\nconst tomlKey = (k: string) => (/^[A-Za-z0-9_-]+$/.test(k) ? k : JSON.stringify(k));\n\nfunction tomlValue(v: unknown): string {\n if (Array.isArray(v)) return `[${v.map(tomlValue).join(\", \")}]`;\n if (isRecord(v)) {\n return `{ ${Object.entries(v)\n .map(([k, x]) => `${tomlKey(k)} = ${tomlValue(x)}`)\n .join(\", \")} }`;\n }\n if (typeof v === \"string\") return JSON.stringify(v);\n return String(v);\n}\n\n/** TOML for the plain shapes a bunfig holds: scalars, arrays and nested tables. */\nexport function renderToml(config: Record<string, unknown>, prefix: string[] = []): string {\n const lines: string[] = [];\n const tables: [string, Record<string, unknown>][] = [];\n for (const [k, v] of Object.entries(config)) {\n if (isRecord(v)) tables.push([k, v]);\n else lines.push(`${tomlKey(k)} = ${tomlValue(v)}`);\n }\n const sections = tables.map(([k, v]) => {\n const path = [...prefix, k];\n return `[${path.map(tomlKey).join(\".\")}]\\n${renderToml(v, path)}`;\n });\n return [lines.join(\"\\n\"), ...sections].filter(Boolean).join(\"\\n\\n\");\n}\n\nexport function createWorkdirs(projectCwd: string): Workdirs {\n const root = mkdtempSync(join(tmpdir(), \"polly-mutate-\"));\n const files: Record<string, string> = {};\n const tsconfig = join(projectCwd, \"tsconfig.json\");\n if (existsSync(tsconfig)) files[\"tsconfig.json\"] = JSON.stringify({ extends: tsconfig });\n const bunfig = join(projectCwd, \"bunfig.toml\");\n if (existsSync(bunfig)) {\n const parsed: unknown = Bun.TOML.parse(readFileSync(bunfig, \"utf8\"));\n if (isRecord(parsed)) files[\"bunfig.toml\"] = renderToml(absolutiseBunfig(parsed, projectCwd));\n }\n return {\n root,\n create() {\n mkdirSync(root, { recursive: true });\n const dir = mkdtempSync(join(root, \"run-\"));\n for (const [name, text] of Object.entries(files)) writeFileSync(join(dir, name), text);\n return dir;\n },\n release: (dir) => rmSync(dir, { recursive: true, force: true }),\n remove: () => rmSync(root, { recursive: true, force: true }),\n };\n}\n\n/** Run `fn` in a fresh scratch cwd, or in `projectCwd` when `workdirs` is null. */\nexport async function inCwd<R>(\n workdirs: Workdirs | null,\n projectCwd: string,\n fn: (cwd: string) => Promise<R>\n): Promise<R> {\n if (!workdirs) return fn(projectCwd);\n const dir = workdirs.create();\n try {\n return await fn(dir);\n } finally {\n workdirs.release(dir);\n }\n}\n",
|
|
21
|
+
"/**\n * Per-target result cache in `.polly/mutate/cache/` (one JSON file per key).\n *\n * The key is a sha256 over everything a target's results depend on:\n * - the generated mutants (spans, replacements, operator names), which\n * covers both the target's text and the operator rules\n * - the text of every file in the covering tests' import closure, tests\n * included\n * - the project's preloads, tsconfig.json, bunfig.toml and bun.lock\n * - mode, timeout, cwd isolation, Bun's version and CACHE_VERSION\n * - dynamic coverage: each mutant's selected files and test-name pattern\n * Reach the import graph cannot see (a fixture file, `mock.module`) is not in\n * the key; `--no-cache` forces a fresh run.\n *\n * The coverage pass has its own entry (`coverage-<key>.json`), keyed on\n * every file the import graph holds, so any edit to the project's tested\n * code reruns it.\n *\n * Only targets with a green baseline are stored. Results are matched back by\n * mutant content, not id, because ids carry the target's position in the run.\n */\nimport { existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { Coverage } from \"./coverage.ts\";\nimport type { Mutant, MutantResult, MutantStatus, TestRef } from \"./types.ts\";\n\n/** Bump when the runner's semantics change in a way the key does not capture. */\nexport const CACHE_VERSION = 2;\n\nexport interface CachedResult {\n sig: string;\n status: MutantStatus;\n statusReason?: string;\n durationMs?: number;\n killedBy?: string[];\n coveredBy?: string[];\n killedByContract?: string[];\n contractOnly?: boolean;\n}\n\nexport interface CacheEntry {\n baselineMs: number;\n inTree: boolean;\n tests: TestRef[];\n results: CachedResult[];\n}\n\nexport function mutantSig(\n m: Pick<Mutant, \"start\" | \"end\" | \"replacement\" | \"mutatorName\">\n): string {\n return `${m.mutatorName}:${m.start}:${m.end}:${m.replacement}`;\n}\n\nasync function textOrEmpty(path: string): Promise<string> {\n const file = Bun.file(path);\n return (await file.exists()) ? file.text() : \"\";\n}\n\nexport async function cacheKey(input: {\n mutants: readonly Mutant[];\n closure: readonly string[];\n projectFiles: readonly string[];\n settings: unknown;\n}): Promise<string> {\n const hash = new Bun.CryptoHasher(\"sha256\");\n hash.update(JSON.stringify({ v: CACHE_VERSION, bun: Bun.version, settings: input.settings }));\n for (const m of input.mutants) hash.update(`${mutantSig(m)}|${m.ignoredReason ?? \"\"}\\n`);\n for (const f of [...input.closure, ...input.projectFiles]) {\n hash.update(`\\0${f}\\0`);\n hash.update(await textOrEmpty(f));\n }\n return hash.digest(\"hex\");\n}\n\nexport async function readCache(dir: string, key: string): Promise<CacheEntry | null> {\n const file = Bun.file(join(dir, `${key}.json`));\n if (!(await file.exists())) return null;\n try {\n const entry: CacheEntry = await file.json();\n return Array.isArray(entry.results) ? entry : null;\n } catch {\n return null;\n }\n}\n\nfunction writeEntry(dir: string, name: string, value: unknown): void {\n mkdirSync(dir, { recursive: true });\n // The directory ignores itself, so a consumer's repo needs no .gitignore edit.\n const ignore = join(dir, \".gitignore\");\n if (!existsSync(ignore)) writeFileSync(ignore, \"*\\n\");\n writeFileSync(join(dir, name), `${JSON.stringify(value)}\\n`);\n}\n\nexport function writeCache(dir: string, key: string, entry: CacheEntry): void {\n writeEntry(dir, `${key}.json`, entry);\n}\n\nexport function writeCoverageCache(dir: string, key: string, coverage: Coverage): void {\n writeEntry(dir, `coverage-${key}.json`, coverage);\n}\n\nexport async function readCoverageCache(dir: string, key: string): Promise<Coverage | null> {\n const file = Bun.file(join(dir, `coverage-${key}.json`));\n if (!(await file.exists())) return null;\n try {\n const coverage: Coverage = await file.json();\n return Array.isArray(coverage.targets) ? coverage : null;\n } catch {\n return null;\n }\n}\n\nexport function cachedResult(r: MutantResult): CachedResult {\n return {\n sig: mutantSig(r.mutant),\n status: r.status,\n ...(r.statusReason ? { statusReason: r.statusReason } : {}),\n ...(r.durationMs === undefined ? {} : { durationMs: r.durationMs }),\n ...(r.killedBy ? { killedBy: r.killedBy } : {}),\n ...(r.coveredBy ? { coveredBy: r.coveredBy } : {}),\n ...(r.killedByContract ? { killedByContract: r.killedByContract } : {}),\n ...(r.contractOnly ? { contractOnly: true } : {}),\n };\n}\n",
|
|
22
|
+
"/**\n * Dynamic coverage: which tests run each mutant's code.\n *\n * One pass, before any mutant runs: every test file under `tests.include`\n * runs once (split over `concurrency` processes) with the\n * targets served probed (probes.ts) by the preload's coverage mode. Hits land\n * in buckets the preload keeps per test file:\n *\n * inside test k the k-th test the file ran; the k-th non-skipped junit\n * case names it. A file whose counts differ, or whose tests\n * overlapped (concurrent tests), falls back to \"between\"\n * between tests beforeAll of a later describe, timers: the whole file\n * while loading module top-level code. Bun shares one module registry\n * across the files of a process, so this runs once, in\n * whichever file loaded the module first. Such a mutant is\n * \"static\": every file that imports the target or hit any\n * of its probes runs it, as whole files\n *\n * Per mutant this gives the test ids that ran it (`coveredBy`) and the test\n * files to run: named tests through `bun test -t`, or whole files. No hit\n * means NoCoverage, decided without running anything. Because the pass runs\n * every test file, reach the import graph cannot see (`mock.module`, a\n * computed `import()`) is seen.\n *\n * Each process runs in a scratch cwd, as baselines do; a red one reruns in the\n * project cwd, since a test that fails early stops before it reaches the code\n * it would have covered.\n *\n * A target keeps static selection (graph.ts) when its probes do not parse, or\n * when the graph says a test imports it but the plugin never served it (a\n * project preload loaded it first). A coverage process that writes no data\n * (it crashed or timed out) turns the whole pass off.\n *\n * Limit: a test that fails only through state an earlier test left behind\n * (a lazy cache filled once) is not selected, so its kill is lost. That is\n * the price of per-test selection, as with Stryker's `perTest`.\n */\nimport { mkdtempSync, realpathSync, rmSync, writeFileSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { isRecord } from \"../../../../src/shared/lib/guards\";\nimport { type JunitCase, parseJunit, testId } from \"./junit.ts\";\nimport { instrument } from \"./probes.ts\";\nimport { pool, runBunTest } from \"./runner.ts\";\nimport type { ContractsMode, Mutant, TestRef } from \"./types.ts\";\nimport { inCwd, type Workdirs } from \"./workdir.ts\";\n\n/** Bump when attribution changes; part of the coverage cache key. */\nexport const COVERAGE_VERSION = 1;\nconst COVERAGE_TIMEOUT_MS = 600_000;\n/** A longer `-t` pattern runs the whole files instead. */\nconst MAX_PATTERN = 8_000;\n\nexport interface MutantCoverage {\n /** Test ids that ran the mutant's code inside the test body or its hooks. */\n tests: string[];\n /** Test files to run whole: hits between tests, unordered files, static mutants. */\n files: string[];\n}\n\nexport type TargetCoverage =\n | { kind: \"dynamic\"; mutants: Record<string, MutantCoverage> }\n | { kind: \"static\"; reason: string };\n\nexport interface CoverageTest extends TestRef {\n /** The full name `bun test -t` matches. */\n filterName: string;\n}\n\nexport interface Coverage {\n targets: TargetCoverage[];\n /** Every test the pass ran (not skipped), by id. */\n tests: Record<string, CoverageTest>;\n /** Test file → ids of its tests. */\n byFile: Record<string, string[]>;\n}\n\nexport interface CoverageTarget {\n file: string;\n /** Mutants to probe (ignored ones are left out). */\n mutants: readonly Mutant[];\n /** Static selection: test files whose import closure reaches the target. */\n covering: readonly string[];\n}\n\nexport interface CoverageRun {\n cwd: string;\n testFiles: readonly string[];\n targets: readonly CoverageTarget[];\n /** Project preloads, then the engine preload. */\n preloads: string[];\n concurrency: number;\n /** Scratch cwds (workdir.ts); null runs in `cwd`. */\n workdirs: Workdirs | null;\n /** POLLY_CONTRACTS for the pass, as for every other run. */\n contracts: ContractsMode;\n log: (line: string) => void;\n}\n\ninterface FileHits {\n load: number[];\n between: number[];\n tests: number[][];\n overlapped: boolean;\n}\n\ninterface ChunkHits {\n served: number[];\n outside: number[];\n files: FileHits[];\n}\n\nconst numbers = (v: unknown): number[] =>\n Array.isArray(v) ? v.filter((x): x is number => typeof x === \"number\") : [];\n\nfunction parseHits(raw: unknown): ChunkHits | null {\n if (!isRecord(raw) || !Array.isArray(raw[\"files\"])) return null;\n return {\n served: numbers(raw[\"served\"]),\n outside: numbers(raw[\"outside\"]),\n files: raw[\"files\"].filter(isRecord).map((f) => ({\n load: numbers(f[\"load\"]),\n between: numbers(f[\"between\"]),\n tests: Array.isArray(f[\"tests\"]) ? f[\"tests\"].map(numbers) : [],\n overlapped: f[\"overlapped\"] === true,\n })),\n };\n}\n\nfunction real(path: string): string {\n try {\n return realpathSync(path);\n } catch {\n return path;\n }\n}\n\n/** Contiguous slices, so neighbouring files still share a process as in a full run. */\nexport function chunk<T>(items: readonly T[], n: number): T[][] {\n const count = Math.max(1, Math.min(n, items.length));\n const size = Math.ceil(items.length / count);\n const out: T[][] = [];\n for (let i = 0; i < items.length; i += size) out.push(items.slice(i, i + size));\n return out;\n}\n\n/** What one probe was hit by, across every chunk. */\ninterface ProbeHits {\n tests: Set<string>;\n files: Set<string>;\n /** Files loading when module top-level code hit it. */\n loads: Set<string>;\n static: boolean;\n}\n\nfunction newProbeHits(): ProbeHits {\n return { tests: new Set(), files: new Set(), loads: new Set(), static: false };\n}\n\nclass Attribution {\n readonly probes = new Map<number, ProbeHits>();\n readonly served = new Set<number>();\n readonly tests: Record<string, CoverageTest> = {};\n readonly byFile: Record<string, string[]> = {};\n\n constructor(private readonly cwd: string) {}\n\n private at(probe: number): ProbeHits {\n let hits = this.probes.get(probe);\n if (!hits) {\n hits = newProbeHits();\n this.probes.set(probe, hits);\n }\n return hits;\n }\n\n private record(c: JunitCase): string {\n const id = testId(this.cwd, c.file, c.name, c.line);\n if (!this.tests[id]) {\n this.tests[id] = { id, file: c.file, name: c.name, line: c.line, filterName: c.filterName };\n const file = real(c.file);\n this.byFile[file] = [...(this.byFile[file] ?? []), id];\n }\n return id;\n }\n\n /** One chunk: its hits (indexed by the plan's test list) and its junit cases. */\n add(testFiles: readonly string[], hits: ChunkHits, cases: readonly JunitCase[]): void {\n for (const t of hits.served) this.served.add(t);\n for (const p of hits.outside) this.at(p).static = true;\n const ran = new Map<string, JunitCase[]>();\n for (const c of cases) {\n if (c.status === \"skipped\") continue;\n const file = real(c.file);\n ran.set(file, [...(ran.get(file) ?? []), c]);\n }\n hits.files.forEach((f, i) => {\n const file = testFiles[i];\n if (!file) return;\n const fileCases = ran.get(file) ?? [];\n const ids = fileCases.map((c) => this.record(c));\n for (const p of f.load) {\n const h = this.at(p);\n h.static = true;\n h.loads.add(file);\n }\n for (const p of f.between) this.at(p).files.add(file);\n const ordered = !f.overlapped && f.tests.length === ids.length;\n f.tests.forEach((probes, k) => {\n const id = ids[k];\n for (const p of probes) {\n if (ordered && id) this.at(p).tests.add(id);\n else this.at(p).files.add(file);\n }\n });\n });\n }\n}\n\ninterface Probed {\n target: number;\n ids: string[];\n}\n\nasync function planTargets(run: CoverageRun): Promise<{\n plan: { file: string; code: string }[];\n probes: Probed[];\n failed: Map<number, string>;\n}> {\n const plan: { file: string; code: string }[] = [];\n const probes: Probed[] = [];\n const failed = new Map<number, string>();\n for (const [target, t] of run.targets.entries()) {\n const probed = instrument(t.file, await Bun.file(t.file).text(), t.mutants, probes.length);\n if (!probed) {\n failed.set(target, \"its probed source does not parse\");\n continue;\n }\n plan.push({ file: t.file, code: probed.code });\n for (const ids of probed.probes) probes.push({ target, ids });\n }\n return { plan, probes, failed };\n}\n\nfunction sorted(set: Iterable<string>): string[] {\n return [...new Set(set)].sort();\n}\n\n/** Every file that touched the target: its static mutants run in all of them. */\nfunction usersOf(\n t: CoverageTarget,\n attribution: Attribution,\n mine: readonly { probe: number }[]\n): Set<string> {\n const users = new Set(t.covering);\n for (const { probe } of mine) {\n const h = attribution.probes.get(probe);\n if (!h) continue;\n const testFiles = [...h.tests].flatMap((id) => {\n const file = attribution.tests[id]?.file;\n return file ? [real(file)] : [];\n });\n for (const f of [...testFiles, ...h.files, ...h.loads]) users.add(f);\n }\n return users;\n}\n\nfunction targetCoverage(\n run: CoverageRun,\n target: number,\n attribution: Attribution,\n probes: readonly Probed[]\n): TargetCoverage {\n const t = run.targets[target];\n if (!t) return { kind: \"static\", reason: \"missing target\" };\n const mine = probes.flatMap((p, probe) => (p.target === target ? [{ probe, ids: p.ids }] : []));\n if (!attribution.served.has(target) && t.covering.length > 0) {\n return {\n kind: \"static\",\n reason: \"a test imports it but the coverage pass never loaded it (a project preload may)\",\n };\n }\n const users = usersOf(t, attribution, mine);\n const mutants: Record<string, MutantCoverage> = {};\n for (const { probe, ids } of mine) {\n const h = attribution.probes.get(probe) ?? newProbeHits();\n const files = h.static ? [...users, ...h.files] : [...h.files];\n const cov = { tests: sorted(h.tests), files: sorted(files) };\n for (const id of ids) mutants[id] = cov;\n }\n return { kind: \"dynamic\", mutants };\n}\n\n/** Run the pass. Null when a process wrote no data: every target then keeps static selection. */\nexport async function collectCoverage(run: CoverageRun): Promise<Coverage | null> {\n const { plan, probes, failed } = await planTargets(run);\n const dir = mkdtempSync(join(tmpdir(), \"polly-mutate-coverage-\"));\n try {\n const planPath = join(dir, \"plan.json\");\n writeFileSync(planPath, JSON.stringify({ targets: plan, tests: run.testFiles }));\n const attribution = new Attribution(run.cwd);\n const chunks = chunk(run.testFiles, run.concurrency);\n const outcomes = await pool(chunks, run.concurrency, async (files, i) => {\n const out = join(dir, `hits-${i}.json`);\n const attempt = (workdirs: Workdirs | null) =>\n inCwd(workdirs, run.cwd, async (cwd) => {\n rmSync(out, { force: true });\n const outcome = await runBunTest({\n cwd,\n files,\n preloads: run.preloads,\n env: { POLLY_MUTATE_COVERAGE: planPath, POLLY_MUTATE_COVERAGE_OUT: out },\n contracts: run.contracts,\n bail: false,\n junit: true,\n timeoutMs: COVERAGE_TIMEOUT_MS,\n captureStderr: true,\n });\n const file = Bun.file(out);\n const hits = (await file.exists()) ? parseHits(await file.json()) : null;\n return { outcome, hits, cwd };\n });\n const scratch = await attempt(run.workdirs);\n if (scratch.outcome.exitCode === 0 || !run.workdirs) return scratch;\n run.log(\n `coverage pass: process ${i + 1}/${chunks.length} is red in a scratch cwd; rerun in-tree`\n );\n return attempt(null);\n });\n for (const [i, { outcome, hits, cwd }] of outcomes.entries()) {\n if (!hits) {\n run.log(\n `coverage pass: process ${i + 1}/${chunks.length} wrote no data (${outcome.timedOut ? \"timed out\" : `exit ${outcome.exitCode}`}); every target keeps static selection`\n );\n return null;\n }\n if (outcome.exitCode !== 0) {\n const failLine = outcome.stderrTail?.match(/\\(fail\\)[^\\n]*/)?.[0] ?? \"\";\n run.log(\n `coverage pass: tests failed in process ${i + 1}/${chunks.length} (exit ${outcome.exitCode}) ${failLine}`.trim()\n );\n }\n attribution.add(run.testFiles, hits, parseJunit(outcome.junitXml ?? \"\", cwd));\n }\n const targets = run.targets.map((_, i): TargetCoverage => {\n const reason = failed.get(i);\n if (reason) return { kind: \"static\", reason };\n return targetCoverage(run, i, attribution, probes);\n });\n return { targets, tests: attribution.tests, byFile: attribution.byFile };\n } finally {\n rmSync(dir, { recursive: true, force: true });\n }\n}\n\nexport interface Selection {\n /** Test files to pass to `bun test`; empty means NoCoverage. */\n files: string[];\n /** `bun test -t`, when every selected test is named. */\n namePattern?: string;\n coveredBy: string[];\n}\n\nconst escapeRegex = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\nexport function selectionFor(cov: MutantCoverage, coverage: Coverage): Selection {\n const named = cov.tests.flatMap((id) => {\n const t = coverage.tests[id];\n return t ? [t] : [];\n });\n const files = sorted([...cov.files, ...named.map((t) => real(t.file))]);\n const coveredBy = sorted([...cov.tests, ...cov.files.flatMap((f) => coverage.byFile[f] ?? [])]);\n if (cov.files.length > 0 || named.length === 0) return { files, coveredBy };\n const pattern = `^(?:${sorted(named.map((t) => escapeRegex(t.filterName))).join(\"|\")})$`;\n return pattern.length > MAX_PATTERN\n ? { files, coveredBy }\n : { files, namePattern: pattern, coveredBy };\n}\n",
|
|
23
|
+
"/**\n * Coverage probes: the target's source with a hit call at the innermost\n * place that runs whenever a mutant's code can run. The coverage pass\n * (coverage.ts) serves this text instead of the original; no mutant is\n * applied, so the tests see the original behaviour.\n *\n * A probe site is one of:\n *\n * statement a statement in a statement list: `;hit(n);` goes before it\n * block a block (a BlockStatement mutant's own span): after `{`\n * lone a statement that is not in a list (`if (a) return b;`):\n * wrapped as `{;hit(n);…}`\n * expression an arrow's expression body, a class field value or a\n * default value: wrapped as `(hit(n), …)`\n *\n * Each mutant takes the innermost site whose span holds its span. A site\n * that runs at least whenever the mutant's code runs over-approximates\n * coverage, which costs time but never a kill. Inserted text holds no\n * newline, so every line number in the target stays the same.\n */\nimport { parseSync } from \"oxc-parser\";\nimport { type AstNode, children, isAstNode } from \"./ast.ts\";\nimport type { Mutant } from \"./types.ts\";\n\nexport const HIT = \"globalThis.__pollyMutateHit?.\";\n\nconst PARSE_OPTIONS = { preserveParens: false };\nconst LIST_PARENTS = new Set([\"Program\", \"BlockStatement\", \"StaticBlock\", \"TSModuleBlock\"]);\nconst LONE_PARENTS: Record<string, readonly string[]> = {\n IfStatement: [\"consequent\", \"alternate\"],\n ForStatement: [\"body\"],\n ForInStatement: [\"body\"],\n ForOfStatement: [\"body\"],\n WhileStatement: [\"body\"],\n DoWhileStatement: [\"body\"],\n WithStatement: [\"body\"],\n};\nconst ANONYMOUS = new Set([\"FunctionExpression\", \"ArrowFunctionExpression\", \"ClassExpression\"]);\n\ntype SiteKind = \"statement\" | \"block\" | \"lone\" | \"expression\";\n\ninterface Site {\n kind: SiteKind;\n start: number;\n end: number;\n /** Where `statement` and `block` probes go. */\n at: number;\n}\n\nexport interface Instrumented {\n code: string;\n /** Mutant ids per probe, indexed by `probe - firstProbe`. */\n probes: string[][];\n}\n\n/** `\"use strict\"` and friends; a probe before one would end the directive prologue. */\nfunction isDirective(node: AstNode | undefined): boolean {\n return node?.type === \"ExpressionStatement\" && typeof node[\"directive\"] === \"string\";\n}\n\nfunction afterDirectives(statements: AstNode[], from: number): number {\n let at = from;\n for (const s of statements) {\n if (!isDirective(s)) break;\n at = s.end;\n }\n return at;\n}\n\nfunction inList(parent: AstNode, key: string): boolean {\n return (\n (LIST_PARENTS.has(parent.type) && key === \"body\") ||\n (parent.type === \"SwitchCase\" && key === \"consequent\")\n );\n}\n\n/** A statement that is not in a list; a wrapped declaration would change its scope. */\nfunction isLone(node: AstNode, parent: AstNode, key: string): boolean {\n return (\n (LONE_PARENTS[parent.type]?.includes(key) ?? false) &&\n node.type !== \"BlockStatement\" &&\n !node.type.endsWith(\"Declaration\")\n );\n}\n\nfunction isWrappedValue(node: AstNode, parent: AstNode, key: string): boolean {\n const value =\n (parent.type === \"ArrowFunctionExpression\" &&\n key === \"body\" &&\n parent[\"expression\"] === true) ||\n ((parent.type === \"PropertyDefinition\" || parent.type === \"AccessorProperty\") &&\n key === \"value\") ||\n (parent.type === \"AssignmentPattern\" && key === \"right\");\n // `x = () => {}` names the function \"x\"; a comma expression would drop the name.\n const named = parent.type !== \"ArrowFunctionExpression\" && ANONYMOUS.has(node.type);\n return value && !named;\n}\n\n/** The sites `node` offers, given the key it hangs under in `parent`. */\nfunction sitesOf(node: AstNode, parent: AstNode | undefined, key: string): Site[] {\n const sites: Site[] = [];\n const span = { start: node.start, end: node.end };\n if (node.type === \"BlockStatement\" || node.type === \"StaticBlock\") {\n sites.push({\n kind: \"block\",\n ...span,\n at: afterDirectives(children(node, \"body\"), node.start + 1),\n });\n }\n if (!parent) return sites;\n if (inList(parent, key)) {\n // A directive's own probe goes after it, where it cannot end the prologue.\n sites.push({ kind: \"statement\", ...span, at: isDirective(node) ? node.end : node.start });\n } else if (isLone(node, parent, key)) {\n sites.push({ kind: \"lone\", ...span, at: node.start });\n } else if (isWrappedValue(node, parent, key)) {\n sites.push({ kind: \"expression\", ...span, at: node.start });\n }\n return sites;\n}\n\nfunction collectSites(program: AstNode): Site[] {\n const sites: Site[] = [];\n const visit = (node: AstNode, parent: AstNode | undefined, key: string) => {\n sites.push(...sitesOf(node, parent, key));\n for (const [k, value] of Object.entries(node)) {\n const list = Array.isArray(value) ? value : [value];\n for (const c of list) if (isAstNode(c)) visit(c, node, k);\n }\n };\n for (const s of children(program, \"body\")) visit(s, program, \"body\");\n return sites;\n}\n\n/** The innermost site holding `[start, end)`; null for a span no site holds. */\nfunction innermost(sites: readonly Site[], start: number, end: number): Site | null {\n let best: Site | null = null;\n for (const s of sites) {\n if (s.start > start || s.end < end) continue;\n if (!best || s.end - s.start < best.end - best.start) best = s;\n // A block mutant spans its block: its probe is the block's own, not the statement's.\n else if (s.end - s.start === best.end - best.start && s.kind === \"block\") best = s;\n }\n return best;\n}\n\ninterface Edit {\n at: number;\n text: string;\n /** Closing text sorts before opening text at one offset; then by nesting. */\n order: [number, number];\n}\n\nfunction edits(site: Site, probe: number): Edit[] {\n const hit = `${HIT}(${probe})`;\n const open = (text: string): Edit => ({ at: site.at, text, order: [1, -site.end] });\n const close = (text: string): Edit => ({ at: site.end, text, order: [0, -site.start] });\n switch (site.kind) {\n case \"statement\":\n case \"block\":\n return [open(`;${hit};`)];\n case \"lone\":\n return [open(`{;${hit};`), close(\"}\")];\n case \"expression\":\n return [open(`(${hit},`), close(\")\")];\n }\n}\n\nfunction applyEdits(src: string, all: Edit[]): string {\n all.sort((a, b) => a.at - b.at || a.order[0] - b.order[0] || a.order[1] - b.order[1]);\n let out = \"\";\n let from = 0;\n for (const e of all) {\n out += src.slice(from, e.at) + e.text;\n from = e.at;\n }\n return out + src.slice(from);\n}\n\n/**\n * Probe calls numbered from `firstProbe`. Null when the result does not\n * parse (the target then keeps static selection).\n */\nexport function instrument(\n file: string,\n src: string,\n mutants: readonly Mutant[],\n firstProbe: number\n): Instrumented | null {\n const parsed = parseSync(file, src, PARSE_OPTIONS);\n if (parsed.errors.length > 0 || !isAstNode(parsed.program)) return null;\n const sites = collectSites(parsed.program);\n const bySite = new Map<Site, string[]>();\n for (const m of mutants) {\n const site = innermost(sites, m.start, m.end);\n if (!site) return null;\n bySite.set(site, [...(bySite.get(site) ?? []), m.id]);\n }\n const probes: string[][] = [];\n const all: Edit[] = [];\n for (const [site, ids] of bySite) {\n all.push(...edits(site, firstProbe + probes.length));\n probes.push(ids);\n }\n const code = applyEdits(src, all);\n if (parseSync(file, code, PARSE_OPTIONS).errors.length > 0) return null;\n return { code, probes };\n}\n",
|
|
24
|
+
"/**\n * Narrow views over oxc-parser's ESTree / TS-ESTree output. The walker treats\n * the AST as plain data, so these guards replace casts: every field read goes\n * through a typeof check.\n */\nimport { isRecord } from \"../../../../src/shared/lib/guards\";\n\nexport interface AstNode {\n type: string;\n start: number;\n end: number;\n [key: string]: unknown;\n}\n\nexport function isAstNode(value: unknown): value is AstNode {\n return (\n isRecord(value) &&\n typeof value[\"type\"] === \"string\" &&\n typeof value[\"start\"] === \"number\" &&\n typeof value[\"end\"] === \"number\"\n );\n}\n\n/** The child node under `key`, or undefined when absent or not a node. */\nexport function child(node: AstNode, key: string): AstNode | undefined {\n const value = node[key];\n return isAstNode(value) ? value : undefined;\n}\n\nexport function children(node: AstNode, key: string): AstNode[] {\n const value = node[key];\n return Array.isArray(value) ? value.filter(isAstNode) : [];\n}\n\nexport function stringField(node: AstNode, key: string): string | undefined {\n const value = node[key];\n return typeof value === \"string\" ? value : undefined;\n}\n\n/** `foo(...)` → \"foo\"; `verify.foo(...)` → \"foo\"; computed access is not resolved. */\nexport function calleeName(call: AstNode): string | undefined {\n const callee = child(call, \"callee\");\n if (!callee) return undefined;\n if (callee.type === \"Identifier\") return stringField(callee, \"name\");\n if (callee.type === \"MemberExpression\" && callee[\"computed\"] !== true) {\n const property = child(callee, \"property\");\n if (property?.type === \"Identifier\") return stringField(property, \"name\");\n }\n return undefined;\n}\n",
|
|
25
|
+
"/**\n * Mutant generation: parse a target with oxc-parser, walk the runtime part of\n * the tree, and collect span replacements from the operators.\n *\n * Type-only syntax is never mutated — a mutant there changes nothing Bun\n * executes — and neither are decorators or `declare` statements (Stryker's\n * skip rules). Mutants inside polly verify primitives are kept but marked\n * ignored, the way Stryker's polly-verify ignorer reports them.\n *\n * Parentheses are not nodes (`preserveParens: false`), as in the Babel AST\n * Stryker walks, so operators that look at a parent see the real one.\n */\nimport { parseSync } from \"oxc-parser\";\nimport { type AstNode, calleeName, children, isAstNode } from \"./ast.ts\";\nimport { OPERATORS, type OperatorContext } from \"./operators.ts\";\nimport type { ContractSite, Mutant, MutatorName, Position } from \"./types.ts\";\nimport { VERIFY_PRIMITIVES, verifyCallsiteReason } from \"./verify-callsites.ts\";\n\n/** TS nodes that wrap a runtime expression. Every other `TS*` node is type-only. */\nconst TS_RUNTIME_WRAPPERS = new Set([\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"TSNonNullExpression\",\n \"TSInstantiationExpression\",\n \"TSTypeAssertion\",\n // `constructor(private x = 1)`: the default is runtime code.\n \"TSParameterProperty\",\n // A namespace body runs; only `declare namespace` / `declare module` is type-only.\n \"TSModuleBlock\",\n]);\nconst PARSE_OPTIONS = { preserveParens: false };\nconst TYPE_KEYS = new Set([\"typeAnnotation\", \"returnType\", \"typeParameters\", \"typeArguments\"]);\nconst SKIPPED_STATEMENTS = new Set([\"ImportDeclaration\", \"ExportAllDeclaration\", \"Decorator\"]);\n\nfunction isSkipped(node: AstNode): boolean {\n if (SKIPPED_STATEMENTS.has(node.type)) return true;\n if (node.type === \"VariableDeclaration\") return node[\"declare\"] === true;\n if (node.type === \"TSModuleDeclaration\") return node[\"declare\"] === true;\n return node.type.startsWith(\"TS\") && !TS_RUNTIME_WRAPPERS.has(node.type);\n}\n\nexport interface GenerateOptions {\n ignoreVerifyCallsites?: boolean;\n /** Keep only mutants that start inside this 1-based inclusive line range. */\n lines?: { from: number; to: number };\n /** Prefix for mutant ids, so ids stay unique across files in one report. */\n idPrefix?: string;\n /** Mutators whose edits are dropped (polly.mutate.ts `mutators.exclude`). */\n exclude?: readonly MutatorName[];\n}\n\nexport interface GenerateResult {\n mutants: Mutant[];\n /** Mutants whose mutated text no longer parses. Reported, never run. */\n compileErrors: Mutant[];\n /** Every requires/ensures call, whole file, whatever `lines` and the ignore flag say. */\n contracts: ContractSite[];\n}\n\nexport function lineIndex(src: string): (offset: number) => Position {\n const starts = [0];\n for (let i = 0; i < src.length; i++) if (src.charCodeAt(i) === 10) starts.push(i + 1);\n return (offset) => {\n let lo = 0;\n let hi = starts.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if ((starts[mid] ?? 0) <= offset) lo = mid;\n else hi = mid - 1;\n }\n return { line: lo + 1, column: offset - (starts[lo] ?? 0) + 1 };\n };\n}\n\nexport function applyMutant(src: string, m: Pick<Mutant, \"start\" | \"end\" | \"replacement\">): string {\n return src.slice(0, m.start) + m.replacement + src.slice(m.end);\n}\n\n/** The polly#143 reason when `node` is a call to a verify primitive. */\nfunction verifyReason(node: AstNode): string | undefined {\n if (node.type !== \"CallExpression\") return undefined;\n const name = calleeName(node);\n return name && VERIFY_PRIMITIVES.has(name) ? verifyCallsiteReason(name) : undefined;\n}\n\nconst FUNCTION_NODES = new Set([\n \"FunctionDeclaration\",\n \"FunctionExpression\",\n \"ArrowFunctionExpression\",\n]);\n\n/**\n * The contract site when `node` is a requires/ensures call: its line, its\n * message literal, and the handler it sits in — the nearest enclosing\n * `bus.on(...)` call, else the nearest enclosing function.\n */\nfunction contractSite(\n file: string,\n node: AstNode,\n ancestors: readonly AstNode[],\n position: (offset: number) => Position\n): ContractSite | undefined {\n if (node.type !== \"CallExpression\") return undefined;\n const name = calleeName(node);\n if (name !== \"requires\" && name !== \"ensures\") return undefined;\n const second = children(node, \"arguments\")[1];\n const message =\n second?.type === \"Literal\" && typeof second[\"value\"] === \"string\" ? second[\"value\"] : undefined;\n const handlerNode =\n [...ancestors].reverse().find((a) => a.type === \"CallExpression\" && calleeName(a) === \"on\") ??\n [...ancestors].reverse().find((a) => FUNCTION_NODES.has(a.type));\n const handler = handlerNode\n ? { from: position(handlerNode.start).line, to: position(handlerNode.end).line }\n : undefined;\n return {\n file,\n line: position(node.start).line,\n primitive: name,\n ...(message === undefined ? {} : { message }),\n ...(handler ? { handler } : {}),\n };\n}\n\n/** Child nodes with the key they hang under, minus type annotations. */\nfunction runtimeChildren(node: AstNode): [string, AstNode][] {\n const out: [string, AstNode][] = [];\n for (const [k, value] of Object.entries(node)) {\n if (TYPE_KEYS.has(k)) continue;\n const list = Array.isArray(value) ? value : [value];\n for (const c of list) if (isAstNode(c)) out.push([k, c]);\n }\n return out;\n}\n\nexport function generateMutants(\n file: string,\n src: string,\n opts: GenerateOptions = {}\n): GenerateResult {\n const parsed = parseSync(file, src, PARSE_OPTIONS);\n const first = parsed.errors[0];\n if (first) throw new Error(`${file}: cannot parse target: ${first.message}`);\n\n const position = lineIndex(src);\n const ignoreVerify = opts.ignoreVerifyCallsites ?? true;\n const prefix = opts.idPrefix ?? \"\";\n const seen = new Set<string>();\n const excluded = new Set(opts.exclude ?? []);\n const all: Mutant[] = [];\n const contracts: ContractSite[] = [];\n\n const ancestors: AstNode[] = [];\n const visit = (node: AstNode, key: string, ignored: string | undefined) => {\n if (isSkipped(node)) return;\n const parent = ancestors[ancestors.length - 1];\n const site = contractSite(file, node, ancestors, position);\n if (site) contracts.push(site);\n\n const ignoredHere = ignored ?? (ignoreVerify ? verifyReason(node) : undefined);\n const ctx: OperatorContext = {\n src,\n parent,\n key,\n ancestors,\n emit(start: number, end: number, replacement: string, mutatorName: MutatorName) {\n if (excluded.has(mutatorName)) return;\n // Two operators can propose the same edit; keep one.\n const dedupe = `${start}:${end}:${replacement}`;\n if (seen.has(dedupe)) return;\n seen.add(dedupe);\n all.push({\n id: \"\",\n file,\n mutatorName,\n start,\n end,\n replacement,\n location: { start: position(start), end: position(end) },\n ...(ignoredHere ? { ignoredReason: ignoredHere } : {}),\n });\n },\n };\n for (const op of OPERATORS) op(node, ctx);\n\n ancestors.push(node);\n for (const [k, c] of runtimeChildren(node)) visit(c, k, ignoredHere);\n ancestors.pop();\n };\n\n for (const statement of parsed.program.body) {\n if (isAstNode(statement)) visit(statement, \"body\", undefined);\n }\n\n const inRange = opts.lines\n ? all.filter(\n (m) =>\n m.location.start.line >= (opts.lines?.from ?? 0) &&\n m.location.start.line <= (opts.lines?.to ?? 0)\n )\n : all;\n inRange.sort((a, b) => a.start - b.start || a.end - b.end);\n inRange.forEach((m, i) => {\n m.id = `${prefix}${i}`;\n });\n\n const mutants: Mutant[] = [];\n const compileErrors: Mutant[] = [];\n for (const m of inRange) {\n if (parseSync(file, applyMutant(src, m), PARSE_OPTIONS).errors.length > 0)\n compileErrors.push(m);\n else mutants.push(m);\n }\n return { mutants, compileErrors, contracts };\n}\n",
|
|
26
|
+
"/**\n * Mutation operators, named and shaped after Stryker's mutators so reports\n * stay comparable. Each operator looks at one node and proposes zero or more\n * span replacements through `emit`; the generator owns traversal, ids and\n * locations.\n *\n * Operators work on source spans, not on regenerated code: a mutant is the\n * original text with one slice swapped, so formatting, comments and every\n * other line stay byte-identical.\n *\n * The rules follow @stryker-mutator/instrumenter 9.6.1 (`dist/src/mutators/`).\n * Intended differences are listed in tools/mutate/README.md.\n */\nimport { mutate as mutateRegex } from \"weapon-regex\";\nimport { isRecord } from \"../../../../src/shared/lib/guards\";\nimport { type AstNode, calleeName, child, children, isAstNode, stringField } from \"./ast.ts\";\nimport type { MutatorName } from \"./types.ts\";\n\nexport interface OperatorContext {\n src: string;\n parent: AstNode | undefined;\n /** The key under which `node` hangs off `parent` (e.g. \"test\", \"key\"). */\n key: string;\n /** Every ancestor, outermost first; the last entry is `parent`. */\n ancestors: readonly AstNode[];\n emit(start: number, end: number, replacement: string, mutator: MutatorName): void;\n}\n\ntype Operator = (node: AstNode, ctx: OperatorContext) => void;\n\nconst EQUALITY: Record<string, string[]> = {\n \"<\": [\"<=\", \">=\"],\n \"<=\": [\"<\", \">\"],\n \">\": [\">=\", \"<=\"],\n \">=\": [\">\", \"<\"],\n \"==\": [\"!=\"],\n \"!=\": [\"==\"],\n \"===\": [\"!==\"],\n \"!==\": [\"===\"],\n};\nconst ARITHMETIC: Record<string, string> = { \"+\": \"-\", \"-\": \"+\", \"*\": \"/\", \"/\": \"*\", \"%\": \"*\" };\nconst LOGICAL: Record<string, string> = { \"&&\": \"||\", \"||\": \"&&\", \"??\": \"&&\" };\nconst ASSIGNMENT: Record<string, string> = {\n \"+=\": \"-=\",\n \"-=\": \"+=\",\n \"*=\": \"/=\",\n \"/=\": \"*=\",\n \"%=\": \"*=\",\n \"<<=\": \">>=\",\n \">>=\": \"<<=\",\n \"&=\": \"|=\",\n \"|=\": \"&=\",\n \"&&=\": \"||=\",\n \"||=\": \"&&=\",\n \"??=\": \"&&=\",\n};\n/** Logical assignments still apply to a string right-hand side; the rest are concatenation-like. */\nconst STRING_SAFE_ASSIGNMENTS = new Set([\"&&=\", \"||=\", \"??=\"]);\nconst BOOLEAN_OPERATORS = new Set([\"!=\", \"!==\", \"&&\", \"<\", \"<=\", \"==\", \"===\", \">\", \">=\", \"||\"]);\nconst LOOPS = new Set([\"ForStatement\", \"WhileStatement\", \"DoWhileStatement\"]);\nconst EMPTY_STRING_REPLACEMENT = '\"Stryker was here!\"';\n\n/**\n * Method name → swap, or null to drop the call (`a.filter(f)` → `a`). Stryker\n * adds the reverse of each swap except for `setUTCDate`.\n */\nconst METHODS: ReadonlyMap<string, string | null> = (() => {\n const forward: [string, string | null][] = [\n [\"charAt\", null],\n [\"endsWith\", \"startsWith\"],\n [\"every\", \"some\"],\n [\"filter\", null],\n [\"reverse\", null],\n [\"slice\", null],\n [\"sort\", null],\n [\"substr\", null],\n [\"substring\", null],\n [\"toLocaleLowerCase\", \"toLocaleUpperCase\"],\n [\"toLowerCase\", \"toUpperCase\"],\n [\"trim\", null],\n [\"trimEnd\", \"trimStart\"],\n [\"min\", \"max\"],\n [\"setDate\", \"setTime\"],\n [\"setFullYear\", \"setMonth\"],\n [\"setHours\", \"setMinutes\"],\n [\"setSeconds\", \"setMilliseconds\"],\n [\"setUTCDate\", \"setTime\"],\n [\"setUTCFullYear\", \"setUTCMonth\"],\n [\"setUTCHours\", \"setUTCMinutes\"],\n [\"setUTCSeconds\", \"setUTCMilliseconds\"],\n ];\n const map = new Map(forward);\n for (const [name, swap] of forward) {\n if (swap && name !== \"setUTCDate\" && name !== \"getUTCDate\") map.set(swap, name);\n }\n return map;\n})();\n\n/** Offset of `op` between two operands, skipping comments and parentheses in the gap. */\nfunction operatorOffset(src: string, op: string, left: AstNode, right: AstNode): number {\n const gap = src.slice(left.end, right.start);\n const at = gap.replace(/\\/\\*[\\s\\S]*?\\*\\/|\\/\\/[^\\n]*/g, (c) => \" \".repeat(c.length)).indexOf(op);\n return at === -1 ? -1 : left.end + at;\n}\n\n/** Babel's StringLiteral or TemplateLiteral, the two types Stryker's string checks name. */\nfunction isStringNode(node: AstNode | undefined): boolean {\n if (!node) return false;\n return (\n (node.type === \"Literal\" && typeof node[\"value\"] === \"string\") ||\n node.type === \"TemplateLiteral\"\n );\n}\n\nconst text = (src: string, node: AstNode) => src.slice(node.start, node.end);\n\ninterface BinaryParts {\n op: string;\n left: AstNode;\n right: AstNode;\n /** Offset of the operator token in the source. */\n at: number;\n}\n\nfunction binaryParts(node: AstNode, src: string): BinaryParts | undefined {\n const op = stringField(node, \"operator\");\n const left = child(node, \"left\");\n const right = child(node, \"right\");\n if (!op || !left || !right) return undefined;\n const at = operatorOffset(src, op, left, right);\n return at === -1 ? undefined : { op, left, right, at };\n}\n\nconst binary: Operator = (node, ctx) => {\n if (node.type !== \"BinaryExpression\") return;\n const parts = binaryParts(node, ctx.src);\n if (!parts) return;\n const { op, left, right, at } = parts;\n const span = (rep: string, mutator: MutatorName) => ctx.emit(at, at + op.length, rep, mutator);\n for (const rep of EQUALITY[op] ?? []) span(rep, \"EqualityOperator\");\n const arith = ARITHMETIC[op];\n // Stryker's concatenation guard, as written: the right operand, and the\n // left operand — or the left's own right operand when the left is binary.\n const leftProbe = left.type === \"BinaryExpression\" ? child(left, \"right\") : left;\n if (arith && !isStringNode(right) && !isStringNode(leftProbe)) span(arith, \"ArithmeticOperator\");\n};\n\nconst logical: Operator = (node, ctx) => {\n if (node.type !== \"LogicalExpression\") return;\n const parts = binaryParts(node, ctx.src);\n const rep = parts && LOGICAL[parts.op];\n if (!parts || !rep) return;\n const { op, left, right, at } = parts;\n if (op !== \"??\") {\n ctx.emit(at, at + op.length, rep, \"LogicalOperator\");\n return;\n }\n // `??` cannot sit next to `&&`/`||` without parentheses, so in a chain such\n // as `a ?? b ?? c` the bare swap does not parse. Parenthesise the result and\n // any logical operand. Every slice between the operands is kept, because\n // parentheses in the source are not part of any node's span.\n const operand = (n: AstNode) =>\n n.type === \"LogicalExpression\" ? `(${text(ctx.src, n)})` : text(ctx.src, n);\n const slice = (from: number, to: number) => ctx.src.slice(from, to);\n ctx.emit(\n node.start,\n node.end,\n `(${slice(node.start, left.start)}${operand(left)}${slice(left.end, at)}${rep}${slice(at + op.length, right.start)}${operand(right)}${slice(right.end, node.end)})`,\n \"LogicalOperator\"\n );\n};\n\nconst assignment: Operator = (node, ctx) => {\n if (node.type !== \"AssignmentExpression\") return;\n const parts = binaryParts(node, ctx.src);\n const rep = parts && ASSIGNMENT[parts.op];\n if (!parts || !rep) return;\n if (isStringNode(parts.right) && !STRING_SAFE_ASSIGNMENTS.has(parts.op)) return;\n ctx.emit(parts.at, parts.at + parts.op.length, rep, \"AssignmentOperator\");\n};\n\nconst booleanLiteral: Operator = (node, ctx) => {\n if (node.type === \"Literal\" && typeof node[\"value\"] === \"boolean\") {\n ctx.emit(node.start, node.end, String(!node[\"value\"]), \"BooleanLiteral\");\n }\n // Stryker files `!x` → `x` under BooleanLiteral, not UnaryOperator. Only the\n // one-character operator goes: in `!(x)` the `(` sits before the argument's span.\n if (node.type === \"UnaryExpression\" && node[\"operator\"] === \"!\") {\n ctx.emit(node.start, node.start + 1, \"\", \"BooleanLiteral\");\n }\n};\n\nconst UNARY: Record<string, string> = { \"+\": \"-\", \"-\": \"+\", \"~\": \"\" };\n\nconst unary: Operator = (node, ctx) => {\n if (node.type !== \"UnaryExpression\") return;\n const op = stringField(node, \"operator\");\n const rep = op === undefined ? undefined : UNARY[op];\n // Every operator here is one character at the node's start.\n if (rep !== undefined) ctx.emit(node.start, node.start + 1, rep, \"UnaryOperator\");\n};\n\nconst update: Operator = (node, ctx) => {\n if (node.type !== \"UpdateExpression\") return;\n const op = stringField(node, \"operator\");\n const arg = child(node, \"argument\");\n if (!op || !arg) return;\n const at = node[\"prefix\"] === true ? node.start : arg.end;\n const opAt = ctx.src.indexOf(op, at);\n if (opAt === -1 || opAt >= node.end) return;\n ctx.emit(opAt, opAt + 2, op === \"++\" ? \"--\" : \"++\", \"UpdateOperator\");\n};\n\n/** Stryker's `isValidParent`: strings that are names or module specifiers, not values. */\nfunction isStructuralString(node: AstNode, ctx: OperatorContext): boolean {\n const p = ctx.parent;\n if (!p) return false;\n if (p.type.startsWith(\"Export\") || p.type === \"ImportExpression\") return true;\n if (p.type === \"JSXAttribute\" || p.type === \"ExpressionStatement\") return true;\n if ((p.type === \"Property\" || p.type === \"PropertyDefinition\") && child(p, \"key\") === node) {\n return true;\n }\n if (p.type !== \"CallExpression\") return false;\n const callee = child(p, \"callee\");\n return (\n callee?.type === \"Identifier\" && (callee[\"name\"] === \"require\" || callee[\"name\"] === \"Symbol\")\n );\n}\n\nconst stringLiteral: Operator = (node, ctx) => {\n if (node.type === \"TemplateLiteral\") {\n const quasis = children(node, \"quasis\");\n const value = quasis[0]?.[\"value\"];\n const empty = quasis.length === 1 && isRecord(value) && value[\"raw\"] === \"\";\n ctx.emit(node.start, node.end, empty ? \"`Stryker was here!`\" : \"``\", \"StringLiteral\");\n return;\n }\n if (node.type !== \"Literal\" || typeof node[\"value\"] !== \"string\") return;\n if (isStructuralString(node, ctx)) return;\n ctx.emit(\n node.start,\n node.end,\n node[\"value\"] === \"\" ? EMPTY_STRING_REPLACEMENT : '\"\"',\n \"StringLiteral\"\n );\n};\n\nfunction isBooleanExpression(node: AstNode): boolean {\n if (node.type !== \"BinaryExpression\" && node.type !== \"LogicalExpression\") return false;\n const op = stringField(node, \"operator\");\n return op !== undefined && BOOLEAN_OPERATORS.has(op);\n}\n\n/** Loop and `if` tests, then boolean expressions anywhere else. Returns whether it emitted. */\nfunction conditionalTest(node: AstNode, ctx: OperatorContext): boolean {\n const p = ctx.parent;\n const emit = (rep: string) => ctx.emit(node.start, node.end, rep, \"ConditionalExpression\");\n // A loop forced to `true` never terminates; Stryker only tries `false`.\n if (p && ctx.key === \"test\" && LOOPS.has(p.type)) {\n emit(\"false\");\n return true;\n }\n if (p?.type === \"IfStatement\" && ctx.key === \"test\") {\n emit(\"true\");\n emit(\"false\");\n return true;\n }\n if (!isBooleanExpression(node)) return false;\n // `true || y` is the same mutant as forcing the whole `||` to true, and\n // `false && y` the same as forcing the `&&` to false; Stryker skips both.\n const parentOp = p?.type === \"LogicalExpression\" ? stringField(p, \"operator\") : undefined;\n if (parentOp !== \"||\") emit(\"true\");\n if (parentOp !== \"&&\") emit(\"false\");\n return true;\n}\n\n/** `for (;;)` → `for (;false;)`. */\nfunction forWithoutTest(node: AstNode, ctx: OperatorContext): void {\n const init = child(node, \"init\");\n const open = ctx.src.indexOf(\"(\", node.start);\n const semi = open === -1 ? -1 : ctx.src.indexOf(\";\", init ? init.end : open);\n if (semi !== -1) ctx.emit(semi + 1, semi + 1, \"false\", \"ConditionalExpression\");\n}\n\n/** A non-fallthrough `case` loses its statements. */\nfunction emptySwitchCase(node: AstNode, ctx: OperatorContext): void {\n const body = children(node, \"consequent\");\n const first = body[0];\n const last = body[body.length - 1];\n if (first && last) ctx.emit(first.start, last.end, \"\", \"ConditionalExpression\");\n}\n\nconst conditional: Operator = (node, ctx) => {\n if (conditionalTest(node, ctx)) return;\n if (node.type === \"ForStatement\" && !child(node, \"test\")) forWithoutTest(node, ctx);\n if (node.type === \"SwitchCase\") emptySwitchCase(node, ctx);\n};\n\nfunction containsSuperCall(node: AstNode): boolean {\n if (node.type === \"CallExpression\" && child(node, \"callee\")?.type === \"Super\") return true;\n for (const value of Object.values(node)) {\n const list = Array.isArray(value) ? value : [value];\n for (const c of list) if (isAstNode(c) && containsSuperCall(c)) return true;\n }\n return false;\n}\n\n/**\n * Stryker's invalid-constructor rule (stryker-js#2314, #2474): emptying a\n * constructor that calls super() is skipped only when the class also has TS\n * parameter properties or initialised (non-private) fields, because only then\n * does the emptied body fail to compile.\n */\nfunction isInvalidConstructorBody(ctx: OperatorContext, block: AstNode): boolean {\n const n = ctx.ancestors.length;\n const fn = ctx.ancestors[n - 1];\n const method = ctx.ancestors[n - 2];\n const classBody = ctx.ancestors[n - 3];\n if (!fn || method?.type !== \"MethodDefinition\" || method[\"kind\"] !== \"constructor\") return false;\n const paramProps = children(fn, \"params\").some((param) => param.type === \"TSParameterProperty\");\n const initialisedFields =\n classBody?.type === \"ClassBody\" &&\n children(classBody, \"body\").some(\n (m) =>\n m.type === \"PropertyDefinition\" &&\n child(m, \"value\") !== undefined &&\n child(m, \"key\")?.type !== \"PrivateIdentifier\"\n );\n return (paramProps || initialisedFields) && containsSuperCall(block);\n}\n\nconst block: Operator = (node, ctx) => {\n if (node.type !== \"BlockStatement\" || children(node, \"body\").length === 0) return;\n if (isInvalidConstructorBody(ctx, node)) return;\n ctx.emit(node.start, node.end, \"{}\", \"BlockStatement\");\n};\n\nconst arrayDeclaration: Operator = (node, ctx) => {\n if (node.type === \"ArrayExpression\") {\n const empty = children(node, \"elements\").length === 0;\n ctx.emit(node.start, node.end, empty ? '[\"Stryker was here\"]' : \"[]\", \"ArrayDeclaration\");\n return;\n }\n if (node.type !== \"CallExpression\" && node.type !== \"NewExpression\") return;\n const callee = child(node, \"callee\");\n if (callee?.type !== \"Identifier\" || callee[\"name\"] !== \"Array\") return;\n const args = children(node, \"arguments\").length === 0 ? \"[]\" : \"\";\n const prefix = node.type === \"NewExpression\" ? \"new \" : \"\";\n ctx.emit(node.start, node.end, `${prefix}Array(${args})`, \"ArrayDeclaration\");\n};\n\nconst objectLiteral: Operator = (node, ctx) => {\n if (node.type === \"ObjectExpression\" && children(node, \"properties\").length > 0) {\n ctx.emit(node.start, node.end, \"{}\", \"ObjectLiteral\");\n }\n};\n\nconst arrowFunction: Operator = (node, ctx) => {\n if (node.type !== \"ArrowFunctionExpression\") return;\n const body = child(node, \"body\");\n if (!body || body.type === \"BlockStatement\" || node[\"expression\"] === false) return;\n if (body.type === \"Identifier\" && body[\"name\"] === \"undefined\") return;\n ctx.emit(node.start, node.end, \"() => undefined\", \"ArrowFunction\");\n};\n\nconst optionalChaining: Operator = (node, ctx) => {\n if (node[\"optional\"] !== true) return;\n if (node.type === \"MemberExpression\") {\n const object = child(node, \"object\");\n if (!object) return;\n const q = ctx.src.indexOf(\"?.\", object.end);\n if (q === -1 || q >= node.end) return;\n ctx.emit(q, q + 2, node[\"computed\"] === true ? \"\" : \".\", \"OptionalChaining\");\n }\n if (node.type === \"CallExpression\") {\n const callee = child(node, \"callee\");\n if (!callee) return;\n const q = ctx.src.indexOf(\"?.\", callee.end);\n if (q === -1 || q >= node.end) return;\n ctx.emit(q, q + 2, \"\", \"OptionalChaining\");\n }\n};\n\nconst methodExpression: Operator = (node, ctx) => {\n if (node.type !== \"CallExpression\") return;\n const callee = child(node, \"callee\");\n if (callee?.type !== \"MemberExpression\" || callee[\"computed\"] === true) return;\n const property = child(callee, \"property\");\n const object = child(callee, \"object\");\n if (property?.type !== \"Identifier\" || !object) return;\n const name = stringField(property, \"name\");\n const swap = name === undefined ? undefined : METHODS.get(name);\n if (swap === undefined) return;\n if (swap === null) ctx.emit(node.start, node.end, text(ctx.src, object), \"MethodExpression\");\n else ctx.emit(property.start, property.end, swap, \"MethodExpression\");\n};\n\n/** weapon-regex at mutation level 1, as Stryker calls it. An unparseable pattern yields none. */\nfunction regexPatterns(pattern: string, flags: string | undefined): string[] {\n if (pattern.length === 0) return [];\n try {\n return mutateRegex(pattern, flags, { mutationLevels: [1] }).map((m) => m.pattern);\n } catch {\n return [];\n }\n}\n\nconst regex: Operator = (node, ctx) => {\n if (node.type !== \"Literal\") return;\n const literal = node[\"regex\"];\n if (isRecord(literal)) {\n const pattern = literal[\"pattern\"];\n const flags = typeof literal[\"flags\"] === \"string\" ? literal[\"flags\"] : \"\";\n if (typeof pattern !== \"string\") return;\n for (const p of regexPatterns(pattern, flags)) {\n ctx.emit(node.start, node.end, `/${p}/${flags}`, \"Regex\");\n }\n return;\n }\n // `new RegExp(\"…\")` — the pattern string, when it is the first argument.\n const p = ctx.parent;\n if (typeof node[\"value\"] !== \"string\" || p?.type !== \"NewExpression\") return;\n if (calleeName(p) !== \"RegExp\" || child(p, \"callee\")?.type !== \"Identifier\") return;\n const [first, second] = children(p, \"arguments\");\n if (first !== node) return;\n const flags = second?.type === \"Literal\" ? stringField(second, \"value\") : undefined;\n for (const pattern of regexPatterns(node[\"value\"], flags)) {\n ctx.emit(node.start, node.end, JSON.stringify(pattern), \"Regex\");\n }\n};\n\nexport const OPERATORS: readonly Operator[] = [\n binary,\n logical,\n assignment,\n booleanLiteral,\n unary,\n update,\n stringLiteral,\n regex,\n conditional,\n block,\n arrayDeclaration,\n objectLiteral,\n arrowFunction,\n optionalChaining,\n methodExpression,\n];\n",
|
|
27
|
+
"/**\n * The polly verify primitives whose argument expressions are runtime no-ops.\n * A mutation anywhere inside a call to one of these cannot be killed by a test,\n * so its mutants are excluded from scoring (polly#143).\n *\n * The single source: generate.ts marks mutants inside these calls Ignored.\n */\nexport const VERIFY_PRIMITIVES: ReadonlySet<string> = new Set([\n \"requires\",\n \"ensures\",\n \"invariant\",\n \"stateConstraint\",\n \"forAllPeers\",\n \"somePeer\",\n]);\n\nexport function verifyCallsiteReason(name: string): string {\n return (\n `Inside polly's ${name}(...) — a runtime no-op (compiled away in production, ` +\n `translated to a TLA+ assertion in verification). No test can observe or kill ` +\n `mutations here, so they are excluded from the score (polly#143).`\n );\n}\n",
|
|
28
|
+
"/**\n * Static test selection: which test files can reach a target?\n *\n * Starting from every test file, follow resolved imports (Bun's own resolver,\n * so tsconfig `paths` such as `@/` work) through project source, never into\n * node_modules. A test covers a target when the target is in its import\n * closure. Reach that no import names — `mock.module`, a computed `import()`,\n * a global set by another file — is invisible here; a dynamic coverage pass is\n * the planned answer to that.\n */\nimport { realpathSync } from \"node:fs\";\nimport { dirname, extname } from \"node:path\";\nimport { Glob } from \"bun\";\n\nconst SOURCE_EXTENSIONS = new Set([\".ts\", \".tsx\", \".js\", \".jsx\", \".mts\", \".cts\", \".mjs\", \".cjs\"]);\n\nexport interface ImportGraph {\n testFiles: string[];\n /** file → files it imports (absolute, symlink-resolved). */\n imports: Map<string, string[]>;\n}\n\nfunction loaderFor(file: string): \"ts\" | \"tsx\" | \"js\" | \"jsx\" {\n const ext = extname(file);\n if (ext === \".tsx\") return \"tsx\";\n if (ext === \".jsx\") return \"jsx\";\n if (ext === \".ts\" || ext === \".mts\" || ext === \".cts\") return \"ts\";\n return \"js\";\n}\n\nfunction real(path: string): string {\n try {\n return realpathSync(path);\n } catch {\n return path;\n }\n}\n\nexport async function findTestFiles(cwd: string, include: string[]): Promise<string[]> {\n const found = new Set<string>();\n for (const pattern of include) {\n for await (const f of new Glob(pattern).scan({ cwd, absolute: true, onlyFiles: true })) {\n if (!f.includes(\"/node_modules/\")) found.add(real(f));\n }\n }\n return [...found].sort();\n}\n\nconst transpilers = new Map<string, Bun.Transpiler>();\nfunction scan(file: string, text: string): string[] {\n const loader = loaderFor(file);\n let t = transpilers.get(loader);\n if (!t) {\n t = new Bun.Transpiler({ loader });\n transpilers.set(loader, t);\n }\n try {\n return t.scanImports(text).map((i) => i.path);\n } catch {\n return [];\n }\n}\n\n/** Project source files `file` imports at runtime, resolved the way Bun resolves them. */\nfunction resolveImports(file: string, text: string): string[] {\n const out: string[] = [];\n for (const spec of scan(file, text)) {\n if (spec.startsWith(\"bun:\") || spec.startsWith(\"node:\")) continue;\n let resolved: string;\n try {\n resolved = real(Bun.resolveSync(spec, dirname(file)));\n } catch {\n continue;\n }\n if (!resolved.includes(\"/node_modules/\") && SOURCE_EXTENSIONS.has(extname(resolved))) {\n out.push(resolved);\n }\n }\n return out;\n}\n\nexport async function buildImportGraph(testFiles: string[]): Promise<ImportGraph> {\n const imports = new Map<string, string[]>();\n const queue = [...testFiles];\n for (let file = queue.pop(); file !== undefined; file = queue.pop()) {\n if (imports.has(file)) continue;\n const out = resolveImports(file, await Bun.file(file).text());\n imports.set(file, out);\n queue.push(...out.filter((f) => !imports.has(f)));\n }\n return { testFiles, imports };\n}\n\nfunction importersOf(graph: ImportGraph): Map<string, string[]> {\n const importers = new Map<string, string[]>();\n for (const [from, tos] of graph.imports) {\n for (const to of tos) importers.set(to, [...(importers.get(to) ?? []), from]);\n }\n return importers;\n}\n\n/** Test files whose import closure contains `target`, sorted. */\nexport function coveringTests(graph: ImportGraph, target: string): string[] {\n const importers = importersOf(graph);\n const wanted = real(target);\n const seen = new Set([wanted]);\n const stack = [wanted];\n for (let f = stack.pop(); f !== undefined; f = stack.pop()) {\n const fresh = (importers.get(f) ?? []).filter((p) => !seen.has(p));\n for (const p of fresh) seen.add(p);\n stack.push(...fresh);\n }\n const tests = new Set(graph.testFiles);\n return [...seen].filter((f) => tests.has(f)).sort();\n}\n\n/** Every project file `files` load, themselves included, sorted. */\nexport function closureOf(graph: ImportGraph, files: readonly string[]): string[] {\n const seen = new Set(files);\n const stack = [...files];\n for (let f = stack.pop(); f !== undefined; f = stack.pop()) {\n for (const next of graph.imports.get(f) ?? []) {\n if (!seen.has(next)) {\n seen.add(next);\n stack.push(next);\n }\n }\n }\n return [...seen].sort();\n}\n",
|
|
29
|
+
"/**\n * Write the engine's results as a mutation-testing-report-schema document —\n * the same shape Stryker's json reporter writes — so `polly mutate report`,\n * `decisions`, `verify` and the mutation-testing-elements HTML viewer read it\n * unchanged.\n *\n * Fast mode (`--bail`) does not know which test killed a mutant, so\n * `killedBy` stays empty and `isMatrixComplete` correctly reports the matrix\n * as incomplete; the redundancy sections of the report then stay off. Matrix\n * mode fills `killedBy` and `testFiles[].tests[]` from the same ids (junit.ts).\n * Dynamic coverage fills `coveredBy` in either mode, with ids from the same\n * function, and adds the tests it saw to `testFiles[].tests[]`.\n *\n * Contracts add `killedByContract` / `contractOnly` per mutant and a\n * top-level `contracts` block (mode, runner, every site, every baseline\n * violation). The schema sets additionalProperties nowhere that matters, so\n * the viewer and the Stryker-era readers ignore them.\n */\nimport { mkdirSync } from \"node:fs\";\nimport { dirname, relative } from \"node:path\";\nimport type { MutationReport, ReportContracts } from \"../ingest.ts\";\nimport type { ContractsMode, EngineResult } from \"./types.ts\";\n\nexport const ENGINE_NAME = \"polly mutate (bun engine)\";\n\nexport interface WrittenReport extends MutationReport {\n thresholds: { high: number; low: number };\n framework: { name: string };\n files: Record<\n string,\n {\n language: string;\n source: string;\n mutants: {\n id: string;\n mutatorName: string;\n replacement: string;\n status: string;\n statusReason?: string;\n location: {\n start: { line: number; column: number };\n end: { line: number; column: number };\n };\n killedBy: string[];\n coveredBy: string[];\n killedByContract: string[];\n contractOnly?: boolean;\n }[];\n }\n >;\n contracts: ReportContracts;\n}\n\nexport interface ReportMeta {\n contracts: ContractsMode;\n runner: \"bun-test\" | \"command\";\n}\n\nexport async function toMutationReport(\n result: EngineResult,\n cwd: string,\n meta: ReportMeta\n): Promise<WrittenReport> {\n const files: WrittenReport[\"files\"] = {};\n const testFiles: NonNullable<MutationReport[\"testFiles\"]> = {};\n for (const target of result.targets) {\n const rel = relative(cwd, target.file);\n files[rel] = {\n language:\n target.file.endsWith(\".js\") || target.file.endsWith(\".jsx\") ? \"javascript\" : \"typescript\",\n source: await Bun.file(target.file).text(),\n mutants: target.results.map((r) => ({\n id: r.mutant.id,\n mutatorName: r.mutant.mutatorName,\n replacement: r.mutant.replacement,\n status: r.status,\n ...(r.statusReason ? { statusReason: r.statusReason } : {}),\n location: r.mutant.location,\n killedBy: r.killedBy ?? [],\n coveredBy: r.coveredBy ?? [],\n killedByContract: r.killedByContract ?? [],\n ...(r.contractOnly ? { contractOnly: true } : {}),\n })),\n };\n for (const t of target.coveringTests) testFiles[relative(cwd, t)] ??= { tests: [] };\n for (const t of target.tests) {\n const rel = relative(cwd, t.file);\n testFiles[rel] ??= { tests: [] };\n const entry = testFiles[rel];\n if (!entry.tests.some((x) => x.id === t.id)) {\n entry.tests.push({\n id: t.id,\n name: t.name,\n location: { start: { line: t.line, column: 1 } },\n });\n }\n }\n }\n const sites = result.targets.flatMap((t) =>\n t.contracts.map((c) => ({\n id: `${relative(cwd, c.file)}:${c.line}`,\n file: relative(cwd, c.file),\n line: c.line,\n primitive: c.primitive,\n ...(c.message === undefined ? {} : { message: c.message }),\n ...(c.handler ? { handler: c.handler } : {}),\n }))\n );\n return {\n schemaVersion: \"1\",\n thresholds: { high: 80, low: 60 },\n framework: { name: ENGINE_NAME },\n files,\n testFiles,\n contracts: {\n mode: meta.contracts,\n runner: meta.runner,\n sites,\n violations: result.contractViolations.map((v) => ({\n target: relative(cwd, v.target),\n test: v.test,\n contracts: v.contracts,\n })),\n },\n };\n}\n\nexport async function writeReport(report: WrittenReport, path: string): Promise<void> {\n mkdirSync(dirname(path), { recursive: true });\n await Bun.write(path, `${JSON.stringify(report, null, 2)}\\n`);\n}\n",
|
|
30
|
+
"/**\n * Stray-write detection. Mutant runs share the project's working tree (no\n * sandbox copy), so a mutant that redirects a write — a storage path, a temp\n * dir — leaves a file in the repo. Polly's own storage-adapter.ts did exactly\n * this (`st/orage-adapter-id` in the repo root after every full run).\n *\n * The engine snapshots `git status` before the run, after the baselines and\n * after the mutants, and reports each new entry. It never deletes: a path that\n * is new to git may still be the user's own work in progress.\n *\n * Untracked files are listed one by one (`--untracked-files=all`), so a new\n * file inside an already-untracked directory still shows. Ignored paths are\n * listed as their matching pattern (`--ignored=matching`): a write to a new\n * `*.log` shows, a write inside an existing `node_modules/` does not.\n */\nexport interface WorktreeSnapshot {\n /** Absolute repo root; entry paths are relative to it. */\n root: string;\n /** `XY path` lines, so a clean → modified change counts as new. */\n entries: Set<string>;\n}\n\nfunction git(cwd: string, args: string[]): string | null {\n const proc = Bun.spawnSync([\"git\", \"-C\", cwd, ...args], { stdout: \"pipe\", stderr: \"ignore\" });\n return proc.exitCode === 0 ? proc.stdout.toString() : null;\n}\n\n/** Null when `cwd` is not inside a git worktree (or git is not installed). */\nexport function snapshotWorktree(cwd: string): WorktreeSnapshot | null {\n const root = git(cwd, [\"rev-parse\", \"--show-toplevel\"])?.trim();\n if (!root) return null;\n const out = git(root, [\n \"status\",\n \"--porcelain=v1\",\n \"-z\",\n \"--untracked-files=all\",\n \"--ignored=matching\",\n ]);\n if (out === null) return null;\n const entries = new Set<string>();\n const tokens = out.split(\"\\0\");\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (!token) continue;\n entries.add(token);\n // A rename or copy is followed by its source path as a separate token.\n if (token[0] === \"R\" || token[0] === \"C\") i++;\n }\n return { root, entries };\n}\n\n/** Paths (relative to the repo root) whose `git status` entry is in `after` but not `before`. */\nexport function newPaths(\n before: WorktreeSnapshot | null,\n after: WorktreeSnapshot | null\n): string[] {\n if (!before || !after || before.root !== after.root) return [];\n const paths = new Set<string>();\n for (const entry of after.entries) if (!before.entries.has(entry)) paths.add(entry.slice(3));\n return [...paths].sort();\n}\n",
|
|
31
|
+
"/**\n * Type-aware mutant filter: a mutant the project's own TypeScript config\n * rejects is not a fault a developer could have shipped, so it is reported\n * `CompileError` and never run. Measured on polly's 44 targets before this\n * filter existed: 1,848 of 4,894 mutants (38 %) failed to type-check, among\n * them 323 of the 974 survivors — a third of the review queue.\n *\n * Mechanism: one `tsgo` process through TypeScript 7's `unstable/async` API,\n * with a virtual file system. The project is opened through a virtual\n * `tsconfig.polly-mutate.json` beside the nearest `tsconfig.json` that lists\n * the target; it extends that config and relaxes three options\n * (`TYPECHECK_OVERRIDES`), because a mutant routinely leaves a block\n * unreachable or a binding unused and neither is a type error. Each mutant is\n * then served as the target's text through the same virtual file system and\n * only the target's own diagnostics are read: on polly, checking every\n * importer as well found no extra mutant in 4,894 and cost 12 s of 57.\n *\n * The verdict is relative: a mutant is invalid when its error-category\n * diagnostics include one (by code and text) the unmutated file does not\n * have, so a project whose target already fails to type-check still gets a\n * filter, and never a false `CompileError`.\n *\n * `typescript-7` is the npm alias polly depends on (`npm:typescript@7.0.2`,\n * exact), so polly's own `typescript` can stay on the version its other tools\n * need. The sync flavour of the API cannot run under Bun; the async one can.\n */\nimport { existsSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\nimport { applyMutant } from \"./generate.ts\";\nimport type { Mutant } from \"./types.ts\";\n\ntype AsyncApi = typeof import(\"typescript-7/unstable/async\");\ntype Api = InstanceType<AsyncApi[\"API\"]>;\ntype Snapshot = Awaited<ReturnType<Api[\"updateSnapshot\"]>>;\ntype Diagnostic = Awaited<\n ReturnType<ReturnType<Snapshot[\"getProjects\"]>[number][\"program\"][\"getSemanticDiagnostics\"]>\n>[number];\n\n/** Relaxed in the virtual config: mutants make code unreachable and bindings unused by design. */\nexport const TYPECHECK_OVERRIDES = {\n allowUnreachableCode: true,\n noUnusedLocals: false,\n noUnusedParameters: false,\n};\n\nexport const TYPECHECK_CONFIG_NAME = \"tsconfig.polly-mutate.json\";\n\n/** Caps a verdict's text, so a long assignability chain does not swamp the report. */\nconst REASON_LIMIT = 300;\n\nexport interface TypecheckTarget {\n /** Absolute, symlink-resolved. */\n file: string;\n mutants: readonly Mutant[];\n}\n\nexport interface TypecheckOutcome {\n /** Mutant id → `TS<code>: <text>` of the first error the unmutated file does not have. */\n invalid: Map<string, string>;\n /** Targets the filter could not check, each with why. Their mutants run as usual. */\n skipped: { file: string; reason: string }[];\n /** Mutants that were checked (skipped targets excluded). */\n checked: number;\n wallMs: number;\n}\n\nexport interface TypecheckOptions {\n /** For log lines: paths print relative to it. */\n cwd: string;\n log?: (line: string) => void;\n}\n\n/** The TypeScript 7 API module, or null when `typescript-7` is not installed. */\nasync function loadApi(): Promise<AsyncApi | null> {\n try {\n return await import(\"typescript-7/unstable/async\");\n } catch {\n return null;\n }\n}\n\n/** `tsconfig.json` paths from the file's directory upward, nearest first. */\nexport function tsconfigCandidates(file: string): string[] {\n const out: string[] = [];\n let dir = dirname(file);\n for (;;) {\n const candidate = join(dir, \"tsconfig.json\");\n if (existsSync(candidate)) out.push(candidate);\n const parent = dirname(dir);\n if (parent === dir) return out;\n dir = parent;\n }\n}\n\nfunction virtualConfigFor(tsconfig: string): string {\n return join(dirname(tsconfig), TYPECHECK_CONFIG_NAME);\n}\n\nconst VIRTUAL_CONFIG_TEXT = JSON.stringify({\n extends: \"./tsconfig.json\",\n compilerOptions: TYPECHECK_OVERRIDES,\n});\n\nfunction errorKeys(api: AsyncApi, diagnostics: readonly Diagnostic[]): string[] {\n return diagnostics\n .filter((d) => d.category === api.DiagnosticCategory.Error)\n .map((d) => `${d.code}|${d.text}`);\n}\n\nfunction reasonOf(key: string): string {\n const sep = key.indexOf(\"|\");\n const text = key.slice(sep + 1).replace(/\\s+/g, \" \");\n const reason = `TS${key.slice(0, sep)}: ${text}`;\n return reason.length > REASON_LIMIT ? `${reason.slice(0, REASON_LIMIT - 1)}…` : reason;\n}\n\n/** One tsgo session: a virtual FS overlay, the latest snapshot, and the projects opened so far. */\nclass Session {\n private snapshot: Snapshot | null = null;\n private readonly overlay = new Map<string, string>();\n /** tsconfig.json → its virtual override config, or null when it could not be opened. */\n private readonly opened = new Map<string, string | null>();\n private readonly api: Api;\n\n constructor(\n private readonly mod: AsyncApi,\n cwd: string\n ) {\n this.api = new mod.API({\n cwd,\n fs: {\n readFile: (f) => this.overlay.get(f),\n fileExists: (f) => (this.overlay.has(f) ? true : undefined),\n },\n });\n }\n\n private async update(\n params: Parameters<Api[\"updateSnapshot\"]>[0]\n ): Promise<NonNullable<Snapshot>> {\n const next = await this.api.updateSnapshot(params);\n await this.snapshot?.dispose();\n this.snapshot = next;\n return next;\n }\n\n private program(config: string) {\n const project = this.snapshot?.getProject(config);\n if (!project) throw new Error(`polly mutate: tsgo lost the project ${config}`);\n return project.program;\n }\n\n /** The virtual config of the nearest tsconfig.json whose program lists `file`, or null. */\n async projectFor(file: string): Promise<string | null> {\n for (const tsconfig of tsconfigCandidates(file)) {\n let config = this.opened.get(tsconfig);\n if (config === undefined) {\n config = virtualConfigFor(tsconfig);\n this.overlay.set(config, VIRTUAL_CONFIG_TEXT);\n const snap = await this.update({ openProjects: [config] });\n if (!snap.getProject(config)) config = null;\n this.opened.set(tsconfig, config);\n }\n if (config === null) continue;\n const project = this.snapshot?.getProject(config);\n if (project?.rootFiles.some((f) => samePath(f, file))) return config;\n }\n return null;\n }\n\n private async errorsIn(config: string, file: string): Promise<string[]> {\n const program = this.program(config);\n const [syntactic, semantic] = await Promise.all([\n program.getSyntacticDiagnostics(file),\n program.getSemanticDiagnostics(file),\n ]);\n return [...errorKeys(this.mod, syntactic), ...errorKeys(this.mod, semantic)];\n }\n\n /** Verdicts for one target: mutant id → reason, for the mutants that add an error. */\n async check(config: string, target: TypecheckTarget, src: string): Promise<Map<string, string>> {\n const invalid = new Map<string, string>();\n const baseline = new Set(await this.errorsIn(config, target.file));\n try {\n for (const m of target.mutants) {\n this.overlay.set(target.file, applyMutant(src, m));\n await this.update({ fileChanges: { changed: [target.file] } });\n const fresh = (await this.errorsIn(config, target.file)).find((k) => !baseline.has(k));\n if (fresh !== undefined) invalid.set(m.id, reasonOf(fresh));\n }\n } finally {\n this.overlay.delete(target.file);\n await this.update({ fileChanges: { changed: [target.file] } });\n }\n return invalid;\n }\n\n async close(): Promise<void> {\n await this.api.close();\n }\n}\n\nfunction samePath(a: string, b: string): boolean {\n return a === b || a.toLowerCase() === b.toLowerCase();\n}\n\n/**\n * Type-check every mutant of every target. Null when `typescript-7` is not\n * installed (logged; the engine then runs every mutant).\n */\nexport async function typecheckMutants(\n targets: readonly TypecheckTarget[],\n opts: TypecheckOptions\n): Promise<TypecheckOutcome | null> {\n const log = opts.log ?? (() => undefined);\n const started = performance.now();\n const outcome: TypecheckOutcome = { invalid: new Map(), skipped: [], checked: 0, wallMs: 0 };\n const withConfig = targets.filter((t) => {\n if (tsconfigCandidates(t.file).length > 0) return true;\n outcome.skipped.push({ file: t.file, reason: \"no tsconfig.json above it\" });\n return false;\n });\n if (withConfig.length === 0) {\n for (const s of outcome.skipped) log(`type filter: ${relative(opts.cwd, s.file)}: ${s.reason}`);\n outcome.wallMs = Math.round(performance.now() - started);\n return outcome;\n }\n const mod = await loadApi();\n if (!mod) {\n log(\n \"type filter off: typescript-7 is not installed (bun add typescript-7@npm:typescript@7.0.2)\"\n );\n return null;\n }\n const session = new Session(mod, opts.cwd);\n try {\n for (const target of withConfig) {\n const config = await session.projectFor(target.file);\n if (!config) {\n outcome.skipped.push({ file: target.file, reason: \"no tsconfig.json includes it\" });\n continue;\n }\n const src = await Bun.file(target.file).text();\n const verdicts = await session.check(config, target, src);\n for (const [id, reason] of verdicts) outcome.invalid.set(id, reason);\n outcome.checked += target.mutants.length;\n }\n } finally {\n await session.close();\n }\n outcome.wallMs = Math.round(performance.now() - started);\n for (const s of outcome.skipped) log(`type filter: ${relative(opts.cwd, s.file)}: ${s.reason}`);\n log(\n `type filter: ${outcome.invalid.size} of ${outcome.checked} mutants fail to type-check ` +\n `(${(outcome.wallMs / 1000).toFixed(1)} s)`\n );\n return outcome;\n}\n",
|
|
32
|
+
"/**\n * Build the bun engine's config from the loaded mutation config\n * (`polly.mutate.ts`, or a Stryker JSON read through the migration mapping)\n * plus CLI flags.\n */\nimport { availableParallelism } from \"node:os\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { Glob } from \"bun\";\nimport type { MutateArgs } from \"./args.ts\";\nimport type { MutateConfig } from \"./config.ts\";\nimport { isContractsMode, MUTATION_CONFIG_FILE, type MutationConfig } from \"./define.ts\";\nimport type {\n ContractsMode,\n CoverageMode,\n EngineConfig,\n EngineMode,\n MutateTarget,\n} from \"./engine/types.ts\";\n\nconst RANGE = /^(.*?):(\\d+)(?::\\d+)?-(\\d+)(?::\\d+)?$/;\n\nasync function scanGlob(cwd: string, pattern: string): Promise<string[]> {\n const out: string[] = [];\n for await (const f of new Glob(pattern).scan({ cwd, absolute: true, onlyFiles: true })) {\n if (!f.includes(\"/node_modules/\")) out.push(f);\n }\n return out;\n}\n\nfunction parseEntry(entry: string): { pattern: string; lines?: { from: number; to: number } } {\n const range = RANGE.exec(entry);\n if (!range?.[1]) return { pattern: entry };\n return { pattern: range[1], lines: { from: Number(range[2]), to: Number(range[3]) } };\n}\n\n/** Expand Stryker `mutate` entries: globs, `!` exclusions, and `file.ts:10-20` ranges. */\nexport async function expandMutateEntries(cwd: string, entries: string[]): Promise<MutateTarget[]> {\n const negated = entries.filter((x) => x.startsWith(\"!\"));\n const excluded = new Set(\n (await Promise.all(negated.map((e) => scanGlob(cwd, e.slice(1))))).flat()\n );\n const targets = new Map<string, MutateTarget>();\n for (const entry of entries.filter((x) => !x.startsWith(\"!\"))) {\n const { pattern, lines } = parseEntry(entry);\n const files = (await scanGlob(cwd, pattern)).filter((f) => !excluded.has(f));\n for (const f of files) targets.set(f, lines ? { file: f, lines } : { file: f });\n }\n return [...targets.values()].sort((a, b) => a.file.localeCompare(b.file));\n}\n\nasync function changedSince(cwd: string, ref: string): Promise<Set<string>> {\n const proc = Bun.spawn([\"git\", \"diff\", \"--name-only\", \"--relative\", ref], {\n cwd,\n stdout: \"pipe\",\n stderr: \"pipe\",\n });\n const [out, code] = await Promise.all([new Response(proc.stdout).text(), proc.exited]);\n if (code !== 0)\n throw new Error(\n `git diff --name-only ${ref} failed: ${await new Response(proc.stderr).text()}`\n );\n return new Set(\n out\n .split(\"\\n\")\n .filter(Boolean)\n .map((p) => resolve(cwd, p))\n );\n}\n\nasync function selectTargets(\n dir: string,\n config: MutationConfig,\n args: MutateArgs\n): Promise<MutateTarget[]> {\n const entries = args.files\n ? args.files\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean)\n : config.targets;\n const targets = await expandMutateEntries(dir, entries);\n if (!args.since) return targets;\n const changed = await changedSince(dir, args.since);\n return targets.filter((t) => changed.has(t.file));\n}\n\nfunction resolveConcurrency(flag: string | undefined, fromConfig: number | undefined): number {\n if (flag === undefined) return fromConfig ?? Math.max(1, availableParallelism() - 1);\n const n = Number(flag);\n if (!(Number.isInteger(n) && n > 0)) {\n throw new Error(`--concurrency must be a positive integer, got \"${flag}\"`);\n }\n return n;\n}\n\nfunction resolveMode(flag: string | undefined, config: MutationConfig): EngineMode {\n const mode = flag ?? config.mode ?? \"fast\";\n if (mode !== \"fast\" && mode !== \"matrix\") {\n throw new Error(`--mode ${mode}: expected fast or matrix`);\n }\n if (mode === \"matrix\" && config.runner?.kind === \"command\") {\n throw new Error(\"matrix mode needs per-test results; the command runner has none (use fast)\");\n }\n return mode;\n}\n\nfunction resolveCoverage(flag: string | undefined, config: MutationConfig): CoverageMode {\n const coverage = flag ?? config.coverage ?? \"dynamic\";\n if (coverage !== \"dynamic\" && coverage !== \"static\") {\n throw new Error(`--coverage ${coverage}: expected dynamic or static`);\n }\n return coverage;\n}\n\nfunction resolveContracts(flag: string | undefined, config: MutationConfig): ContractsMode {\n const contracts = flag ?? config.contracts ?? \"all\";\n if (!isContractsMode(contracts)) {\n throw new Error(`--contracts ${contracts}: expected off, ensures or all`);\n }\n return contracts;\n}\n\n/** The engine's config from the loaded mutation config plus CLI flags (flags win). */\nexport async function engineConfigFor(cfg: MutateConfig, args: MutateArgs): Promise<EngineConfig> {\n if (!cfg.mutation) {\n throw new Error(\n cfg.mutationError ??\n `no ${MUTATION_CONFIG_FILE} found — run 'polly mutate init', or pass --config <path>`\n );\n }\n const { config, path } = cfg.mutation;\n const dir = dirname(path);\n const mode = resolveMode(args.mode, config);\n const command = config.runner?.kind === \"command\" ? config.runner : null;\n return {\n cwd: dir,\n targets: await selectTargets(dir, config, args),\n runner: command ?? { kind: \"bun-test\" },\n testInclude: config.tests?.include ?? [],\n testPreload: (config.tests?.preload ?? []).map((p) => resolve(dir, p)),\n mode,\n // The command runner reports no per-test results to attribute hits to.\n coverage: command ? \"static\" : resolveCoverage(args.coverage, config),\n concurrency: resolveConcurrency(args.concurrency, config.concurrency),\n timeout: config.timeout ?? { factor: 2, extraMs: 3000 },\n typecheck: !args.noTypecheck && (config.typecheck ?? true),\n excludeMutators: config.mutators?.exclude ?? [],\n ignoreVerifyCallsites: config.ignoreVerifyCallsites ?? true,\n contracts: resolveContracts(args.contracts, config),\n // A command runs where its package.json is; it gets no scratch cwd.\n scratchCwd: !(args.inTree || command),\n cacheDir: args.noCache ? null : join(dir, \".polly\", \"mutate\", \"cache\"),\n reportPath: cfg.reportPath,\n };\n}\n",
|
|
33
|
+
"/**\n * Test-debt report: derive the three signals from the kill matrix.\n *\n * gaps survived mutants — code no test pins (the Stryker direction)\n * redundancy tests/files whose every kill is also caught elsewhere\n * theatre covered-but-survived — code a test runs but no test detects\n * (the Survived status under coverageAnalysis \"all\")\n * contracts (bun engine, contracts on) mutants only a requires/ensures\n * caught, kills per contract, and contracts whose handler was\n * exercised yet never fired — a contract without teeth\n *\n * Redundancy is reported at BOTH file and case level. Decisions are keyed at\n * file level (stable identity); case level is the drill-down.\n */\nimport type { Database } from \"bun:sqlite\";\nimport { buildDb, loadMutationReport, queryAll, queryGet } from \"./ingest.ts\";\n\ntype SubsumedCase = { file: string; name: string; total: number };\ntype LineCount = { file: string; line: number; mutator: string; n: number };\ntype SiteKills = {\n id: string;\n primitive: string;\n message: string | null;\n n: number;\n exercised: number;\n};\n\n/** The CONTRACTS section; nothing when the report has no contracts block (Stryker-era). */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: one section with its three lists, kept together like the others.\nfunction contractsSection(db: Database, p: (s?: string) => void): void {\n const meta = new Map(\n queryAll<{ key: string; value: string }>(db, \"SELECT key, value FROM report_meta\").map((r) => [\n r.key,\n r.value,\n ])\n );\n const mode = meta.get(\"contracts_mode\");\n if (mode === undefined) return;\n const nSites = queryGet<{ n: number }>(db, \"SELECT count(*) n FROM contract_sites\")?.n ?? 0;\n p(`\\nCONTRACTS (requires/ensures as kill oracles — mode ${mode}, ${nSites} site(s))`);\n if (mode === \"off\") {\n p(\n ` off — the sites are inventoried only; 'polly mutate run --contracts all' makes each one fail the test that falsifies it`\n );\n return;\n }\n const violations = queryAll<{ target: string; test: string; contract_id: string | null }>(\n db,\n \"SELECT target, test, contract_id FROM contract_violations ORDER BY target, test, contract_id\"\n );\n if (violations.length > 0) {\n p(\n ` TEST VIOLATES CONTRACT (the unmutated code fails a contract under a test: ${violations.length})`\n );\n for (const v of violations) {\n p(` ${v.target}: ${v.test}${v.contract_id ? ` → ${v.contract_id}` : \"\"}`);\n }\n }\n if (meta.get(\"runner\") === \"command\") {\n p(\n ` command runner: no per-test results, so kills are not attributed to contracts; compare the killed count against a --contracts off run`\n );\n return;\n }\n if (mode === \"ensures\") p(` requires sites are inventoried, not enforced (mode ensures)`);\n const only = queryAll<LineCount>(\n db,\n \"SELECT file, line, mutator, count(*) n FROM mutants WHERE contract_only=1 GROUP BY file, line, mutator ORDER BY file, line\"\n );\n const onlyTotal = only.reduce((a, r) => a + r.n, 0);\n p(` CONTRACT-ONLY KILLS (no test assertion caught these; a contract did: ${onlyTotal})`);\n for (const r of only) p(` ${r.file}:${r.line} ${r.mutator}${r.n > 1 ? ` ×${r.n}` : \"\"}`);\n if (nSites === 0) return;\n const sites = queryAll<SiteKills>(\n db,\n `SELECT s.id, s.primitive, s.message,\n (SELECT count(*) FROM contract_kills k WHERE k.contract_id = s.id) n,\n (SELECT count(*) FROM mutants m\n WHERE m.file = s.file AND s.handler_from IS NOT NULL\n AND m.line BETWEEN s.handler_from AND s.handler_to\n AND m.status IN ('Killed', 'Survived', 'Timeout')) exercised\n FROM contract_sites s ORDER BY n DESC, s.id`\n );\n p(` KILLS PER CONTRACT`);\n for (const s of sites) {\n p(` ${s.id} ${s.primitive} ${s.n} kill(s)${s.message ? ` “${s.message}”` : \"\"}`);\n }\n const toothless = sites.filter((s) => s.n === 0 && s.exercised > 0);\n const idle = sites.filter((s) => s.n === 0 && s.exercised === 0);\n p(\n ` CONTRACTS WITHOUT TEETH (the handler's mutants ran, the contract never fired: ${toothless.length})`\n );\n if (toothless.length === 0) p(` none`);\n for (const s of toothless) p(` ${s.id} ${s.primitive}${s.message ? ` “${s.message}”` : \"\"}`);\n if (idle.length > 0) {\n p(` HANDLER NOT EXERCISED (no mutant in the contract's handler ran: ${idle.length})`);\n for (const s of idle) p(` ${s.id} ${s.primitive}`);\n }\n}\n\n/** Greedy set cover: smallest set of `units` whose kill-sets cover all killed mutants. */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: a textbook greedy set-cover loop — clearer whole than split.\nfunction greedyCover(units: Map<string, Set<string>>, universe: Set<string>): string[] {\n const remaining = new Set(universe);\n const chosen: string[] = [];\n const pool = new Map([...units].map(([k, v]) => [k, new Set(v)]));\n while (remaining.size > 0) {\n let best: string | null = null;\n let bestGain = 0;\n for (const [unit, set] of pool) {\n let gain = 0;\n for (const m of set) if (remaining.has(m)) gain++;\n if (gain > bestGain) {\n bestGain = gain;\n best = unit;\n }\n }\n if (best === null || bestGain === 0) break; // remaining mutants killed by nobody (shouldn't happen for killed set)\n chosen.push(best);\n for (const m of pool.get(best) ?? []) remaining.delete(m);\n pool.delete(best);\n }\n return chosen;\n}\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: one report builder emitting all sections in order — splitting would scatter the shared db/out.\nexport function report(db: Database, opts: { matrixComplete?: boolean } = {}): string {\n // Defaults to true so `report(db)` is byte-identical to before (the parity\n // guard depends on this). When false — the kill matrix is partial (an\n // unpatched/bail runner) — the redundancy/subsumption sections would lie, so\n // they are suppressed and a warning shown; score/gaps/theatre still hold.\n const matrixComplete = opts.matrixComplete ?? true;\n const out: string[] = [];\n const p = (s = \"\") => out.push(s);\n\n // --- summary ---\n const tot = queryGet<{\n n: number;\n killed: number;\n survived: number;\n timeout: number;\n nocov: number;\n invalid: number;\n ignored: number;\n }>(\n db,\n \"SELECT count(*) n, sum(status='Killed') killed, sum(status='Survived') survived, sum(status='Timeout') timeout, sum(status='NoCoverage') nocov, sum(status='CompileError') invalid, sum(status='Ignored') ignored FROM mutants\"\n ) ?? { n: 0, killed: 0, survived: 0, timeout: 0, nocov: 0, invalid: 0, ignored: 0 };\n const nTests = queryGet<{ n: number }>(db, \"SELECT count(*) n FROM tests\")?.n ?? 0;\n // Stryker's score, the same one `run` prints: detected / (detected +\n // undetected). CompileError, Ignored and RuntimeError mutants are not in it.\n const detected = tot.killed + tot.timeout;\n const valid = detected + tot.survived + tot.nocov;\n const score = valid === 0 ? \"n/a\" : `${((detected / valid) * 100).toFixed(1)}%`;\n const excluded = [\n tot.invalid > 0 ? `${tot.invalid} invalid` : \"\",\n tot.ignored > 0 ? `${tot.ignored} ignored` : \"\",\n ]\n .filter(Boolean)\n .map((s) => ` · ${s}`)\n .join(\"\");\n p(\n `MUTATION score ${score} ${tot.killed} killed · ${tot.timeout} timeout · ${tot.survived} survived · ${tot.nocov} no-coverage${excluded} (${tot.n} mutants, ${nTests} tests)`\n );\n\n if (matrixComplete) {\n // --- kill-multiplicity: how much slack is in the matrix ---\n const mult = queryAll<{ bucket: string; n: number }>(\n db,\n `\n\t\t\tSELECT CASE WHEN c=1 THEN '1' WHEN c=2 THEN '2' WHEN c BETWEEN 3 AND 5 THEN '3-5' ELSE '6+' END bucket, count(*) n\n\t\t\tFROM (SELECT mutant_id, count(*) c FROM kills GROUP BY mutant_id)\n\t\t\tGROUP BY bucket ORDER BY min(c)`\n );\n p(`\\nKILL MULTIPLICITY (killers per killed mutant — higher = more redundancy slack)`);\n for (const r of mult) p(` killed by ${String(r.bucket).padStart(3)} test(s): ${r.n}`);\n\n // --- redundancy ratio via greedy cover (case + file) ---\n const universe = new Set(\n queryAll<{ mutant_id: string }>(db, \"SELECT DISTINCT mutant_id FROM kills\").map(\n (r) => r.mutant_id\n )\n );\n const byTest = new Map<string, Set<string>>();\n for (const r of queryAll<{ test_id: string; mutant_id: string }>(\n db,\n \"SELECT test_id, mutant_id FROM kills\"\n )) {\n const set = byTest.get(r.test_id) ?? new Set<string>();\n byTest.set(r.test_id, set);\n set.add(r.mutant_id);\n }\n const byFile = new Map<string, Set<string>>();\n for (const r of queryAll<{ file: string; mid: string }>(\n db,\n \"SELECT t.file file, k.mutant_id mid FROM kills k JOIN tests t ON t.id=k.test_id\"\n )) {\n const set = byFile.get(r.file) ?? new Set<string>();\n byFile.set(r.file, set);\n set.add(r.mid);\n }\n const caseCover = greedyCover(byTest, universe);\n const fileCover = greedyCover(byFile, universe);\n p(`\\nREDUNDANCY RATIO (tests that kill something ÷ minimal covering set)`);\n p(\n ` case level: ${byTest.size} killing tests → ${caseCover.length} needed (${(byTest.size / Math.max(1, caseCover.length)).toFixed(2)}×, ~${byTest.size - caseCover.length} prunable)`\n );\n p(\n ` file level: ${byFile.size} killing files → ${fileCover.length} needed (${(byFile.size / Math.max(1, fileCover.length)).toFixed(2)}×, ~${byFile.size - fileCover.length} prunable)`\n );\n\n // --- fully subsumed FILES (every mutant they kill is killed elsewhere too) ---\n const subsumedFiles = queryAll<{ file: string; kills: number }>(\n db,\n `\n\t\t\tWITH file_kill AS (SELECT DISTINCT t.file file, k.mutant_id mid FROM kills k JOIN tests t ON t.id=k.test_id),\n\t\t\t owner AS (SELECT mid, count(DISTINCT file) nf, min(file) only_file FROM file_kill GROUP BY mid)\n\t\t\tSELECT fk.file, count(DISTINCT fk.mid) kills,\n\t\t\t sum(CASE WHEN o.nf=1 THEN 1 ELSE 0 END) unique_kills\n\t\t\tFROM file_kill fk JOIN owner o ON o.mid=fk.mid\n\t\t\tGROUP BY fk.file HAVING unique_kills=0 ORDER BY kills DESC`\n );\n p(`\\nSUBSUMED FILES (file-level identity — safe-to-review deletion candidates)`);\n if (subsumedFiles.length === 0)\n p(` none — every test file kills at least one mutant no other file catches`);\n for (const r of subsumedFiles) p(` ${r.file} (${r.kills} kills, 0 unique)`);\n\n // --- fully subsumed CASES (drill-down) ---\n const subsumedCases = queryAll<SubsumedCase>(\n db,\n `\n\t\t\tWITH mk AS (SELECT mutant_id, count(*) c FROM kills GROUP BY mutant_id),\n\t\t\t tk AS (SELECT test_id, count(*) total, sum(CASE WHEN mk.c=1 THEN 1 ELSE 0 END) uniq\n\t\t\t FROM kills JOIN mk USING(mutant_id) GROUP BY test_id)\n\t\t\tSELECT t.file, t.name, tk.total FROM tk JOIN tests t ON t.id=tk.test_id\n\t\t\tWHERE tk.total>0 AND tk.uniq=0 ORDER BY t.file, tk.total DESC`\n );\n const byFileCases = new Map<string, SubsumedCase[]>();\n for (const r of subsumedCases) {\n const rows = byFileCases.get(r.file) ?? [];\n byFileCases.set(r.file, rows);\n rows.push(r);\n }\n p(\n `\\nSUBSUMED CASES (${subsumedCases.length} individual tests whose every kill is caught elsewhere)`\n );\n for (const [file, rows] of byFileCases) {\n p(` ${file}`);\n for (const r of rows) p(` “${r.name}” (${r.total} kills, 0 unique)`);\n }\n } else {\n p(`\\n⚠ KILL MATRIX INCOMPLETE — redundancy/subsumption analysis suppressed.`);\n p(` Every mutant has at most one recorded killer, so \"which tests are redundant\"`);\n p(` cannot be derived. Run 'polly mutate run --mode matrix' (every`);\n p(\n ` killer recorded), or 'polly mutate verify' to diagnose. Score/gaps/theatre below still hold.`\n );\n }\n\n // A non-killed mutant is NoCoverage (no test reaches it — a true gap) or\n // Survived (a test reaches it but nothing detects the mutation — theatre).\n // That status split IS the gap/theatre distinction (see README).\n // Each line names its own file: a run holds many targets.\n const byLine = (status: string) =>\n queryAll<LineCount>(\n db,\n `SELECT file, line, mutator, count(*) n FROM mutants WHERE status='${status}' GROUP BY file, line, mutator ORDER BY file, line`\n );\n const lineOf = (r: LineCount) =>\n ` ${r.file}:${r.line} ${r.mutator}${r.n > 1 ? ` ×${r.n}` : \"\"}`;\n\n // --- gaps: code no test even executes ---\n const gaps = byLine(\"NoCoverage\");\n const gapTotal = gaps.reduce((a, r) => a + r.n, 0);\n p(`\\nGAPS (NoCoverage — no test executes this code: ${gapTotal})`);\n if (gapTotal === 0) p(` none — every mutable location is reached by some test`);\n for (const r of gaps) p(lineOf(r));\n\n // --- theatre: covered but survived ---\n const theatre = byLine(\"Survived\");\n const theatreTotal = theatre.reduce((a, r) => a + r.n, 0);\n p(`\\nTHEATRE (Survived — code is covered but no test detects the mutation: ${theatreTotal})`);\n if (theatreTotal === 0) p(` none`);\n for (const r of theatre) p(lineOf(r));\n\n contractsSection(db, p);\n\n return out.join(\"\\n\");\n}\n\nif (import.meta.main) {\n const reportPath = process.argv[2] ?? \"reports/mutation/mutation.json\";\n const db = buildDb(await loadMutationReport(reportPath), \"reports/test-debt.sqlite\");\n console.log(report(db));\n db.close();\n}\n",
|
|
34
|
+
"/**\n * Verification artefact for the kill-matrix contract.\n *\n * The whole useless-test analysis rests on one fact: matrix mode emits a\n * COMPLETE kill matrix — every test that detects a mutant appears in killedBy,\n * not just the first. That depends on Bun's junit output (engine/junit.ts). A\n * Bun upgrade that changes it, or a `--bail` that creeps back into matrix runs,\n * would silently collapse killedBy to one id each — a green board with the\n * redundancy signal quietly dead (the classic trap).\n *\n * `verifyMatrix` runs the full contract and returns the result; `isMatrixComplete`\n * is the side-effect-free gate the report path consults to decide whether the\n * redundancy/subsumption sections are trustworthy. Run the CLI form after any\n * Bun bump:\n *\n * polly mutate verify # uses the existing report\n * polly mutate verify --run # runs the engine in matrix mode first\n */\nimport { loadMutationReport, type MutationReport } from \"./ingest.ts\";\n\nconst DEFAULT_REPORT = \"reports/mutation/mutation.json\";\n\nexport interface MatrixCheck {\n ok: boolean;\n checks: { name: string; ok: boolean; detail: string }[];\n}\n\n/**\n * Side-effect-free gate: is the kill matrix trustworthy for redundancy /\n * subsumption analysis? True only when\n * (a) some killed mutant has >1 killer — proof the no-bail matrix run\n * recorded EVERY killer, not just the first (verifyMatrix check #4), and\n * (b) coverage was collected — not every mutant is NoCoverage, which would\n * mean the coverage dump broke (verifyMatrix check #5).\n * Without both, REDUNDANCY/SUBSUMED would be computed off a partial matrix and\n * lie, so the report path falls back to score + gaps + theatre only.\n */\nexport function isMatrixComplete(report: MutationReport): boolean {\n const mutants = Object.values(report.files).flatMap((f) => f.mutants);\n if (mutants.length === 0) return false;\n const killed = mutants.filter((m) => m.status === \"Killed\");\n const multiKiller = killed.some((m) => (m.killedBy ?? []).length > 1);\n const noCov = mutants.filter((m) => m.status === \"NoCoverage\").length;\n const coverageCollected = noCov < mutants.length;\n return multiKiller && coverageCollected;\n}\n\n/**\n * Run the full kill-matrix contract (all five checks) on a report. Returns the\n * result rather than exiting, so callers decide what to do with it.\n * `polly mutate verify --run` writes a fresh matrix-mode report first.\n */\nexport async function verifyMatrix(opts: { reportPath?: string } = {}): Promise<MatrixCheck> {\n const reportPath = opts.reportPath ?? DEFAULT_REPORT;\n\n if (!(await Bun.file(reportPath).exists())) {\n return {\n ok: false,\n checks: [\n {\n name: \"report exists\",\n ok: false,\n detail: `no report at ${reportPath}. Run 'polly mutate verify --run' first.`,\n },\n ],\n };\n }\n\n const report = await loadMutationReport(reportPath);\n const checks: { name: string; ok: boolean; detail: string }[] = [];\n const add = (name: string, ok: boolean, detail: string) => checks.push({ name, ok, detail });\n\n // 1. schema present\n add(\"schema version present\", !!report.schemaVersion, `schemaVersion=${report.schemaVersion}`);\n\n // 2. testFiles keyed by real paths, not the \"\" bucket (file-level identity intact)\n const tfKeys = Object.keys(report.testFiles ?? {});\n const realPaths = tfKeys.filter((k) => k && k !== \"(unknown)\");\n add(\n \"testFiles keyed by real paths\",\n realPaths.length > 0 && !tfKeys.includes(\"\"),\n `${realPaths.length} file(s): ${realPaths.slice(0, 2).join(\", \")}${realPaths.length > 2 ? \"…\" : \"\"}`\n );\n\n // 3. test ids resolve\n const testIds = new Set(\n Object.values(report.testFiles ?? {}).flatMap((tf) => tf.tests.map((t) => t.id))\n );\n const mutants = Object.values(report.files).flatMap((f) => f.mutants);\n const killed = mutants.filter((m) => m.status === \"Killed\");\n const danglingKb = killed.filter((m) => (m.killedBy ?? []).some((id) => !testIds.has(id)));\n add(\n \"every killedBy id resolves to a test\",\n danglingKb.length === 0,\n `${danglingKb.length} dangling`\n );\n\n // 4. THE contract: a complete matrix means some killed mutant has >1 killer.\n // If bail silently re-engaged, every killedBy would have length 1.\n const withKb = killed.filter((m) => (m.killedBy ?? []).length > 0);\n const multi = killed.filter((m) => (m.killedBy ?? []).length > 1);\n add(\n \"killed mutants carry killedBy\",\n killed.length > 0 && withKb.length === killed.length,\n `${withKb.length}/${killed.length}`\n );\n add(\n \"matrix is complete (no-bail): >1 killer exists\",\n multi.length > 0,\n `${multi.length} mutant(s) killed by >1 test — collapses to 0 if bail re-engages`\n );\n\n // 5. coverage extraction works: if the afterAll dump fails, the coverage map is\n // empty and EVERY mutant reads NoCoverage (theatre/gap split dies).\n const noCov = mutants.filter((m) => m.status === \"NoCoverage\").length;\n add(\n \"coverage collected (not all NoCoverage)\",\n noCov < mutants.length,\n `${noCov}/${mutants.length} NoCoverage — all-NoCoverage means the coverage dump broke`\n );\n\n return { ok: checks.every((c) => c.ok), checks };\n}\n"
|
|
15
35
|
],
|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