@mark1russell7/rigor-mutation 0.2.5 → 0.2.7

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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-DYF5roXk.js","names":["TEST"],"sources":["../src/lane.ts","../src/cut.ts","../src/config.ts","../src/score.ts","../src/disables.ts","../src/load.ts","../src/sandbox.ts","../src/run.ts"],"sourcesContent":["import { matchesGlob, posix } from \"node:path\";\nimport { STOP_MINUTES, TARGET_MINUTES } from \"./plan.ts\";\n\n/**\n * The lane file of a repository (`mutation.json`) names the packages that the mutation tests mutate. A package has\n * its folder, its globs and an optional gate. A big package has parts, so that each part has its own runner.\n */\n\n/** The mutation tests of one package. */\nexport interface PackageLane {\n /** This field gives the folder of the package, from the folder of the lane file. Stryker starts in this folder. */\n readonly dir: string;\n /**\n * These globs give the files to mutate, from `dir`. A glob with `!` removes the files of the globs before it. A glob\n * with the suffix `:<from>-<to>` gives only those lines of its files, as Stryker reads it.\n */\n readonly mutate: readonly string[];\n /**\n * Each part has its own globs. The `!` globs of `mutate` also apply to each part. Each file of `mutate` must be in\n * exactly one part, so that a full run mutates each file one time. Line ranges can cut one file into parts: then the\n * ranges of the parts must cover each line of the file one time. `partErrors` examines this.\n */\n readonly parts?: Readonly<Record<string, readonly string[]>>;\n /** This field gives the lowest mutation score in percent that passes. Without a gate, the lane only reports the score. */\n readonly gate?: number;\n /**\n * This field tells what the gate of a package with parts reads. With `part`, the default, each part must have a score\n * at the gate. With `package`, the sum of the mutants of the parts must have a score at the gate.\n */\n readonly gateOver?: \"part\" | \"package\";\n /** This field gives the Vitest config file, from `dir`. Without it, Vitest finds its config in `dir`. */\n readonly vitestConfig?: string;\n /**\n * This field gives the time in milliseconds that the clock adds to the time of the tests for each mutant. The\n * default is 120000. A short time on a loaded runner stops mutants that the tests detect later.\n */\n readonly timeoutMS?: number;\n /** This field gives the time in minutes for the run of the tests without mutants. The default is 15. */\n readonly dryRunTimeoutMinutes?: number;\n /**\n * These options go into the Stryker config of each selection of the package, for example `ignoreStatic`. The lane\n * owns the keys of `STRYKER_OWNED`, so the field cannot have them.\n */\n readonly stryker?: Readonly<Record<string, unknown>>;\n /**\n * Each test file of this field is on the disk, and no report reads it. The value gives the reason. `scores\n * --test-files` fails for each other test file on the disk that the report does not read. The file is from `dir`.\n */\n readonly notRead?: Readonly<Record<string, string>>;\n /**\n * Each file of this field has a dynamic import with a computed path, and the value gives the reason. The related walk\n * of Vitest does not follow this type of import. `load-check --collect` fails for each other file of the run with one.\n */\n readonly computedImports?: Readonly<Record<string, string>>;\n /**\n * This field gives the most static runs in the plan of each file, from `dir`. The key `*` gives the limit of each other\n * file. A static run starts each test. `plan-check` fails a file over its limit.\n */\n readonly staticLimits?: Readonly<Record<string, number>>;\n /**\n * Each group of this field has its globs and a count of parts. The cost maps of the lane cut the files of the group\n * into the parts `<group>.1` to `<group>.<count>`. A group is a part for `partErrors`. Its globs have no line range.\n */\n readonly cuts?: Readonly<Record<string, CutGroup>>;\n}\n\n/** A group of files that the cost maps cut into `count` parts of near the same planned net time. */\nexport interface CutGroup {\n readonly files: readonly string[];\n readonly count: number;\n}\n\n/** The keys of the Stryker config that the lane owns. The field `stryker` of a package cannot have them. */\nexport const STRYKER_OWNED: readonly string[] = [\"mutate\", \"thresholds\", \"jsonReporter\", \"htmlReporter\", \"timeoutMS\", \"dryRunTimeoutMinutes\"];\n\n/** The lane file: the packages of the mutation tests, and the list of the disabled mutants. */\nexport interface Lane {\n readonly packages: Readonly<Record<string, PackageLane>>;\n /** This field gives the list of the disabled mutants, from the folder of the lane file. The default is `mutation-disables.json`. */\n readonly disables?: string;\n /**\n * This field gives the highest fall of the test count in percent against the last good count. The default is 20.\n * `scores --last` fails a selection with a higher fall: the report did not read all the tests.\n */\n readonly maxTestFall?: number;\n /** Each selection of this field can have a higher fall of its test count. The value gives the reason. */\n readonly plannedFalls?: Readonly<Record<string, string>>;\n /** This field gives the planned net time of one minute of the clock, for the estimate of `plan-check`. The default is 9.8. */\n readonly planPerClock?: number;\n /** This field gives the target of the estimate of a selection, in minutes. `plan-check` warns of a selection over it. The default is 100. */\n readonly targetMinutes?: number;\n /** This field gives the stop of the estimate of a selection, in minutes. `plan-check` fails a selection over it. The default is 140. */\n readonly stopMinutes?: number;\n /** This field gives the file of the cost maps, from the folder of the lane file. Without it, each line of a group has the weight 1. */\n readonly costs?: string;\n}\n\n/** The default of `maxTestFall` of the lane, in percent. */\nexport const MAX_TEST_FALL = 20;\n\n/** A selection is one Stryker run: a package (`collections`) or a part of a package (`collections.impl`). */\nexport interface Selection {\n readonly name: string;\n readonly pkg: string;\n readonly dir: string;\n readonly mutate: readonly string[];\n readonly gate: number | undefined;\n readonly vitestConfig: string | undefined;\n readonly timeoutMS: number | undefined;\n readonly dryRunTimeoutMinutes: number | undefined;\n readonly stryker: Readonly<Record<string, unknown>> | undefined;\n /** A numbered part of a group of `cuts` has its group, the count of parts and its index from 0. */\n readonly cut?: CutPart;\n}\n\n/** The place of a numbered part in its group of `cuts`. */\nexport interface CutPart {\n readonly group: string;\n readonly count: number;\n readonly index: number;\n}\n\n/**\n * This function gives the entries of `mutate` of a numbered part of a group, from the cut of the group by cost. The\n * CLI reads the files and the cost maps. The globs are the globs of the group, with the `!` globs of the package.\n */\nexport type CutOf = (pkg: string, cut: CutPart, globs: readonly string[]) => readonly string[];\n\nconst NAME = /^[\\w-]+$/;\n\n/** A `mutate` entry with a range, as Stryker reads it: `src/a.ts:1-300`, or `src/a.ts:1:4-300:2` with columns. */\nconst RANGE = /^(.+?):(\\d+)(?::(\\d+))?-(\\d+)(?::(\\d+))?$/;\n\nconst isRecord = (x: unknown): x is Record<string, unknown> => typeof x === \"object\" && x !== null && !Array.isArray(x);\n\n/** This function tells if a value is an object of names, each with a reason that is not empty. */\nconst isReasons = (x: unknown): x is Record<string, string> => isRecord(x) && Object.values(x).every((r) => typeof r === \"string\" && r.trim() !== \"\");\n\nconst isGlobs = (x: unknown): x is string[] => Array.isArray(x) && x.length > 0 && x.every((g) => typeof g === \"string\" && g !== \"\");\n\n/** This function examines a package of the lane file. It gives the errors, with the name of the package. */\nfunction packageErrors(name: string, p: unknown): string[] {\n if (!NAME.test(name)) return [`the package name \"${name}\" has a character that is not a letter, a digit, \"_\" or \"-\"`];\n if (!isRecord(p)) return [`${name}: the package is not an object`];\n const errors: string[] = [];\n if (typeof p[\"dir\"] !== \"string\" || p[\"dir\"] === \"\") errors.push(`${name}: \"dir\" is not a folder name`);\n if (!isGlobs(p[\"mutate\"])) errors.push(`${name}: \"mutate\" is not a list of globs`);\n else if (p[\"mutate\"].every((g) => g.startsWith(\"!\"))) errors.push(`${name}: \"mutate\" has only \"!\" globs`);\n const gate = p[\"gate\"];\n const gateOver = p[\"gateOver\"];\n if (gateOver !== undefined && gateOver !== \"part\" && gateOver !== \"package\") errors.push(`${name}: \"gateOver\" is not \"part\" or \"package\"`);\n else if (gateOver === \"package\" && p[\"parts\"] === undefined && p[\"cuts\"] === undefined) errors.push(`${name}: \"gateOver\" is \"package\", but the package has no parts`);\n if (gate !== undefined && (typeof gate !== \"number\" || !(gate >= 0 && gate <= 100))) errors.push(`${name}: \"gate\" is not a percent from 0 to 100`);\n if (p[\"vitestConfig\"] !== undefined && typeof p[\"vitestConfig\"] !== \"string\") errors.push(`${name}: \"vitestConfig\" is not a file name`);\n for (const field of [\"timeoutMS\", \"dryRunTimeoutMinutes\"]) {\n const v = p[field];\n if (v !== undefined && !(typeof v === \"number\" && Number.isInteger(v) && v > 0)) errors.push(`${name}: \"${field}\" is not a positive integer`);\n }\n const stryker = p[\"stryker\"];\n if (stryker !== undefined) {\n if (!isRecord(stryker)) errors.push(`${name}: \"stryker\" is not an object`);\n else {\n const owned = Object.keys(stryker).filter((k) => STRYKER_OWNED.includes(k));\n if (owned.length > 0) errors.push(`${name}: \"stryker\" has ${owned.map((k) => `\"${k}\"`).join(\", \")}, but the lane owns these keys`);\n }\n }\n if (p[\"notRead\"] !== undefined && !isReasons(p[\"notRead\"])) errors.push(`${name}: \"notRead\" is not an object of files, each with a reason`);\n if (p[\"computedImports\"] !== undefined && !isReasons(p[\"computedImports\"])) errors.push(`${name}: \"computedImports\" is not an object of files, each with a reason`);\n const parts = p[\"parts\"];\n const limits = p[\"staticLimits\"];\n if (limits !== undefined && !(isRecord(limits) && Object.values(limits).every((n) => typeof n === \"number\" && Number.isInteger(n) && n >= 0))) {\n errors.push(`${name}: \"staticLimits\" is not an object of files, each with a count of 0 or more`);\n }\n const cuts = p[\"cuts\"];\n if (cuts !== undefined) {\n if (!isRecord(cuts) || Object.keys(cuts).length === 0) errors.push(`${name}: \"cuts\" is not an object with groups`);\n else {\n for (const [group, cut] of Object.entries(cuts)) {\n if (!NAME.test(group)) errors.push(`${name}: the group name \"${group}\" has a character that is not a letter, a digit, \"_\" or \"-\"`);\n if (isRecord(parts) && parts[group] !== undefined) errors.push(`${name}: \"${group}\" is a part and a group of \"cuts\"`);\n const files = isRecord(cut) ? cut[\"files\"] : undefined;\n const count = isRecord(cut) ? cut[\"count\"] : undefined;\n if (!isGlobs(files) || files.some((g) => g.startsWith(\"!\") || RANGE.test(g))) errors.push(`${name}.${group}: \"files\" is not a list of globs without \"!\" and without a line range`);\n if (!(typeof count === \"number\" && Number.isInteger(count) && count >= 1)) errors.push(`${name}.${group}: \"count\" is not a positive integer`);\n }\n }\n }\n if (parts !== undefined) {\n if (!isRecord(parts) || Object.keys(parts).length === 0) errors.push(`${name}: \"parts\" is not an object with parts`);\n else {\n for (const [part, globs] of Object.entries(parts)) {\n if (!NAME.test(part)) errors.push(`${name}: the part name \"${part}\" has a character that is not a letter, a digit, \"_\" or \"-\"`);\n if (!isGlobs(globs) || globs.some((g) => g.startsWith(\"!\"))) errors.push(`${name}.${part}: the part is not a list of globs without \"!\"`);\n }\n }\n }\n return errors;\n}\n\n/**\n * This function examines the JSON of a lane file and gives the lane.\n *\n * @throws Error with each problem of the file\n */\nexport function parseLane(json: unknown): Lane {\n if (!isRecord(json) || !isRecord(json[\"packages\"])) throw new Error(`the lane has no object \"packages\"`);\n const errors = Object.entries(json[\"packages\"]).flatMap(([name, p]) => packageErrors(name, p));\n if (Object.keys(json[\"packages\"]).length === 0) errors.push(`the lane has no packages`);\n if (json[\"disables\"] !== undefined && typeof json[\"disables\"] !== \"string\") errors.push(`\"disables\" is not a file name`);\n const fall = json[\"maxTestFall\"];\n if (fall !== undefined && (typeof fall !== \"number\" || !(fall >= 0 && fall <= 100))) errors.push(`\"maxTestFall\" is not a percent from 0 to 100`);\n const planned = json[\"plannedFalls\"];\n if (planned !== undefined && !isReasons(planned)) errors.push(`\"plannedFalls\" is not an object of selections, each with a reason`);\n if (json[\"costs\"] !== undefined && (typeof json[\"costs\"] !== \"string\" || json[\"costs\"] === \"\")) errors.push(`\"costs\" is not a file name`);\n const positive = (v: unknown): v is number => typeof v === \"number\" && v > 0 && Number.isFinite(v);\n for (const field of [\"planPerClock\", \"targetMinutes\", \"stopMinutes\"]) {\n if (json[field] !== undefined && !positive(json[field])) errors.push(`\"${field}\" is not a positive number`);\n }\n const target = json[\"targetMinutes\"] ?? TARGET_MINUTES;\n const stop = json[\"stopMinutes\"] ?? STOP_MINUTES;\n if (positive(target) && positive(stop) && stop < target) errors.push(`\"stopMinutes\" (${String(stop)}) is less than \"targetMinutes\" (${String(target)})`);\n if (errors.length > 0) throw new Error(`the lane is not valid:\\n ${errors.join(\"\\n \")}`);\n const lane = json as unknown as Lane;\n const names = new Set(selectionNames(lane));\n const unknown = Object.keys(lane.plannedFalls ?? {}).filter((n) => !names.has(n));\n if (unknown.length > 0) throw new Error(`the lane is not valid:\\n \"plannedFalls\" names no selection of the lane: ${unknown.join(\", \")}`);\n return lane;\n}\n\n/** This function gives the numbered parts of a group: the group itself for a count of 1. */\nconst numberedParts = (name: string, count: number): string[] => (count === 1 ? [name] : Array.from({ length: count }, (_unused, i) => `${name}.${String(i + 1)}`));\n\n/** This function tells if a package has parts or groups of `cuts`. */\nconst hasParts = (p: PackageLane): boolean => p.parts !== undefined || p.cuts !== undefined;\n\n/**\n * This function gives the names of all the selections of a lane. These are each package, each part of the package,\n * and each group of `cuts` of the package with its numbered parts.\n */\nexport function selectionNames(lane: Lane): string[] {\n return Object.entries(lane.packages).flatMap(([name, p]) => [\n name,\n ...Object.keys(p.parts ?? {}).map((part) => `${name}.${part}`),\n ...Object.entries(p.cuts ?? {}).flatMap(([group, cut]) => [...new Set([`${name}.${group}`, ...numberedParts(`${name}.${group}`, cut.count)])]),\n ]);\n}\n\n/**\n * This function gives the selections of a full run. These are the parts and the numbered parts of each package with\n * parts or groups, else the package. Each file is in one run.\n */\nexport function runSelections(lane: Lane): string[] {\n return Object.entries(lane.packages).flatMap(([name, p]) =>\n !hasParts(p)\n ? [name]\n : [...Object.keys(p.parts ?? {}).map((part) => `${name}.${part}`), ...Object.entries(p.cuts ?? {}).flatMap(([group, cut]) => numberedParts(`${name}.${group}`, cut.count))],\n );\n}\n\n/** This function gives the selections of a full run of one package: its parts and numbered parts, else the package. */\nexport function packageRuns(lane: Lane, pkg: string): string[] {\n return runSelections({ packages: Object.fromEntries(Object.entries(lane.packages).filter(([name]) => name === pkg)) });\n}\n\n/**\n * This function gives the selection of a name. The name is a package, a part, a group of `cuts` or a numbered part of a\n * group. A numbered part mutates the entries that `cutOf` gives. Without `cutOf`, it mutates its full group.\n *\n * @throws Error when the lane has no selection of that name\n */\nexport function select(lane: Lane, name: string, cutOf?: CutOf): Selection {\n const [pkg = \"\", part, number, ...rest] = name.split(\".\");\n const p = lane.packages[pkg];\n const group = part === undefined ? undefined : p?.cuts?.[part];\n const globs = part === undefined ? undefined : (p?.parts?.[part] ?? group?.files);\n const index = Number(number) - 1;\n const cut = group !== undefined && part !== undefined && group.count > 1 && number === String(index + 1) && index >= 0 && index < group.count ? { group: part, count: group.count, index } : undefined;\n if (p === undefined || rest.length > 0 || (part !== undefined && globs === undefined) || (number !== undefined && cut === undefined)) {\n throw new Error(`the lane has no selection \"${name}\". It has: ${selectionNames(lane).join(\", \")}`);\n }\n // Stryker applies a \"!\" glob to the globs before it, so the \"!\" globs of the package go after the globs of the part.\n const not = p.mutate.filter((g) => g.startsWith(\"!\"));\n const own = globs === undefined ? p.mutate : [...(cut === undefined || cutOf === undefined ? globs : cutOf(pkg, cut, [...globs, ...not])), ...not];\n const base = { name, pkg, dir: p.dir, mutate: own, gate: p.gate, vitestConfig: p.vitestConfig, timeoutMS: p.timeoutMS, dryRunTimeoutMinutes: p.dryRunTimeoutMinutes, stryker: p.stryker };\n return cut === undefined ? base : { ...base, cut };\n}\n\n\n/** This type is a `mutate` entry with a range of lines. */\ninterface LineRange {\n readonly entry: string;\n readonly glob: string;\n readonly from: number;\n readonly to: number;\n readonly columns: boolean;\n}\n\nfunction rangeOf(entry: string): LineRange | undefined {\n const m = RANGE.exec(entry);\n if (m?.[1] === undefined) return undefined;\n return { entry, glob: m[1], from: Number(m[2]), to: Number(m[4]), columns: m[3] !== undefined || m[5] !== undefined };\n}\n\n/** This function gives the glob of a `mutate` entry, with no range. */\nconst globOf = (entry: string): string => rangeOf(entry)?.glob ?? entry;\n\n/**\n * This function tells if globs select a file. It reads the globs as Stryker does. A glob adds its files. A glob with\n * `!` removes its files from the files of the globs before it. A glob with a line range selects its files.\n */\nexport function globsSelect(globs: readonly string[], file: string): boolean {\n let selected = false;\n for (const g of globs) {\n if (g.startsWith(\"!\")) {\n if (selected && matchesGlob(file, globOf(g.slice(1)))) selected = false;\n } else if (!selected && matchesGlob(file, globOf(g))) selected = true;\n }\n return selected;\n}\n\n/**\n * This function gives what globs select of a selected file. The value is \"all\" when a glob with no range selects the\n * file. Otherwise it is the line ranges of the file.\n */\nfunction coverOf(globs: readonly string[], file: string): \"all\" | LineRange[] {\n const adds = globs.filter((g) => !g.startsWith(\"!\") && matchesGlob(file, globOf(g)));\n if (adds.some((g) => rangeOf(g) === undefined)) return \"all\";\n return adds.flatMap((g) => rangeOf(g) ?? []);\n}\n\n/** A test file and its source file of the same name: `src/a.test.ts` tests `src/a.ts`. */\nconst TEST_FILE = /^(.+)\\.(?:test|spec)(\\.[^./]+)$/;\n\n/**\n * This function gives the changed files of a selection, from the folder of its package. The globs of the selection\n * select the files. A file that the selection takes in line ranges gives one entry for each range, `src/a.ts:1-300`.\n * A changed test file gives its source file of the same name, when the selection takes it and `exists` finds it.\n *\n * @param changed - the changed paths, from the folder of the lane file, with `/`\n * @param exists - this function tells if a file, from the folder of the package, exists. The default finds each file.\n */\nexport function changedFiles(selection: Selection, changed: readonly string[], exists: (file: string) => boolean = () => true): string[] {\n const dir = posix.normalize(selection.dir.replaceAll(\"\\\\\", \"/\"));\n const sourceOf = (f: string): string | undefined => {\n if (globsSelect(selection.mutate, f)) return f;\n const source = f.replace(TEST_FILE, \"$1$2\");\n return source !== f && globsSelect(selection.mutate, source) && exists(source) ? source : undefined;\n };\n const files = changed\n .map((f) => posix.relative(dir, posix.normalize(f.replaceAll(\"\\\\\", \"/\"))))\n .flatMap((f) => (f === \"\" || f.startsWith(\"../\") || posix.isAbsolute(f) ? [] : (sourceOf(f) ?? [])));\n return [...new Set(files)]\n .flatMap((f) => {\n const cover = coverOf(selection.mutate, f);\n return cover === \"all\" ? [f] : cover.map((r) => `${f}${r.entry.slice(r.glob.length)}`);\n });\n}\n\n/** This function gives the errors of the line ranges of one file in the parts of a package. */\nfunction rangeErrors(pkg: string, file: string, ranges: readonly { part: string; range: LineRange }[], lines: number | undefined): string[] {\n const errors: string[] = [];\n for (const { part, range } of ranges) {\n if (range.columns) errors.push(`${pkg}: the range ${range.entry} of the part ${part} has columns. A part can cut a file only by lines`);\n else if (range.from < 1 || range.from > range.to) errors.push(`${pkg}: the range ${range.entry} of the part ${part} has no lines`);\n }\n if (errors.length > 0) return errors;\n let next = 1;\n let last = \"\";\n for (const { part, range } of ranges.toSorted((x, y) => x.range.from - y.range.from || x.range.to - y.range.to)) {\n if (range.from > next) errors.push(`${pkg}: the lines ${String(next)}-${String(range.from - 1)} of ${file} are in no part`);\n else if (range.from < next) errors.push(`${pkg}: the lines ${String(range.from)}-${String(Math.min(range.to, next - 1))} of ${file} are in the parts ${last} and ${part}`);\n if (range.to >= next) {\n next = range.to + 1;\n last = part;\n }\n }\n if (lines !== undefined && next <= lines) errors.push(`${pkg}: the lines ${String(next)}-${String(lines)} of ${file} are in no part`);\n return errors;\n}\n\n/**\n * This function examines the parts of a package against its files. It gives an error for each file of `mutate` in no\n * part. It also gives an error for each file in two parts, and for each file of a part that is not in `mutate`. A\n * package with no parts has no errors.\n *\n * Parts can cut one file by line ranges. Then the function gives an error for each gap and each overlap of the\n * ranges. With `lines`, it also gives an error for the lines after the last range.\n *\n * @param files - the source files of the package, from its folder, with `/`\n * @param lines - this function gives the number of lines of a file of `files`\n */\nexport function partErrors(lane: Lane, pkg: string, files: readonly string[], lines?: (file: string) => number): string[] {\n const p = lane.packages[pkg];\n if (p === undefined || !hasParts(p)) return [];\n const parts = [...Object.keys(p.parts ?? {}), ...Object.keys(p.cuts ?? {})].map((part) => ({ part, mutate: select(lane, `${pkg}.${part}`).mutate }));\n const errors: string[] = [];\n for (const file of files) {\n const inMutate = globsSelect(p.mutate, file);\n const inParts = parts.filter((x) => globsSelect(x.mutate, file)).map((x) => x.part);\n const covers = parts.filter((x) => inParts.includes(x.part)).map((x) => ({ part: x.part, cover: coverOf(x.mutate, file) }));\n const ranged = covers.every((x) => x.cover !== \"all\");\n if (inMutate && inParts.length === 0) errors.push(`${pkg}: the file ${file} is in no part, so a full run does not mutate it`);\n else if (inParts.length > 1 && !ranged) errors.push(`${pkg}: the file ${file} is in more than one part: ${inParts.join(\", \")}`);\n else if (!inMutate && inParts.length > 0) errors.push(`${pkg}: the file ${file} is in the part ${inParts.join(\", \")}, but not in \"mutate\"`);\n else if (inParts.length > 0 && ranged) {\n const ranges = covers.flatMap((x) => (x.cover === \"all\" ? [] : x.cover.map((range) => ({ part: x.part, range }))));\n errors.push(...rangeErrors(pkg, file, ranges, lines?.(file)));\n }\n }\n return errors;\n}\n","/**\n * The cut of a group of files by cost. A group of the lane gives a count of parts of near the same planned net time. A\n * cost map of each file comes from the plan of a run, and it gives the cost of each segment of the file. A segment ends\n * on a closing line, so a mutant of the body of a method stays in one part. The cut thus follows the cost of the lines,\n * and not the size of the files.\n */\nimport type { LinePlan } from \"./plan.ts\";\n\n/** The closing line of a method of a class, or of a function at the top of a file. */\nconst CLOSING_LINE = /^ {0,2}\\}$/u;\n\n/** The first line of a declaration at the top of a file or in a class body, with its name. */\nconst DECLARATION = /^ {0,2}(?:export +)?(?:(?:async|static|private|protected|public|readonly|get|set|declare|abstract) +)*(?:(?:function\\*?|class|const|let|interface|type|enum) +)?([#$A-Za-z_][\\w$]*) *[(<=:{]/u;\n\n/** The words that start a statement and not a declaration. */\nconst STATEMENTS: ReadonlySet<string> = new Set([\"if\", \"for\", \"while\", \"switch\", \"return\", \"throw\", \"do\", \"try\", \"catch\", \"else\"]);\n\n/** A segment of a text: a run of lines that ends on a closing line, with the name of its first declaration. */\nexport interface Segment {\n readonly key: string;\n /** The first line of the segment, counted from 1. */\n readonly start: number;\n /** The last line of the segment, counted from 1. */\n readonly end: number;\n}\n\n/** This function gives the lines of a text. */\nconst linesOf = (text: string): string[] => text.split(/\\r?\\n/u);\n\n/**\n * This function cuts a text into segments. Each segment ends on a closing line, and the last segment ends on the last\n * line. The key of a segment is the name of its first declaration, with `#2` for the second segment of that name. A\n * segment with no name has the key `@n`. A key thus stays the same when a change moves the lines.\n */\nexport function segmentsOf(text: string): Segment[] {\n const lines = linesOf(text);\n const segments: Segment[] = [];\n const seen = new Map<string, number>();\n let start = 1;\n let name: string | undefined;\n const close = (end: number): void => {\n const base = name ?? `@${String(segments.length + 1)}`;\n const n = (seen.get(base) ?? 0) + 1;\n seen.set(base, n);\n segments.push({ key: n === 1 ? base : `${base}#${String(n)}`, start, end });\n start = end + 1;\n name = undefined;\n };\n lines.forEach((line, index) => {\n const declared = DECLARATION.exec(line)?.[1];\n if (name === undefined && declared !== undefined && !STATEMENTS.has(declared)) name = declared;\n if (CLOSING_LINE.test(line)) close(index + 1);\n });\n if (start <= lines.length) close(lines.length);\n return segments;\n}\n\n/** The cost map of a file: the planned net time of each segment in milliseconds, from the plan of a run. */\nexport interface CostMap {\n /** The run that gave the plan. */\n readonly run: string;\n readonly segments: Readonly<Record<string, number>>;\n}\n\n/** The cost maps of a lane: a map for each file, by the name of its package and its path from the package folder. */\nexport type CostMaps = Readonly<Record<string, Readonly<Record<string, CostMap>>>>;\n\n/** This function gives the cost map of a text from the plan of its lines: the planned net time of each segment. */\nexport function costMapOf(text: string, run: string, lines: readonly LinePlan[]): CostMap {\n const segments = segmentsOf(text);\n const cost: Record<string, number> = Object.fromEntries(segments.map((segment) => [segment.key, 0]));\n for (const [line, , , netMs] of lines) {\n const segment = segments.find((s) => s.start <= line && line <= s.end);\n if (segment !== undefined) cost[segment.key] = (cost[segment.key] ?? 0) + netMs;\n }\n return { run, segments: cost };\n}\n\n/**\n * This function gives the weight of each line of a text from a cost map. A segment spreads its cost over its lines. A\n * segment that the map does not name has the mean cost of a line of the named segments. Thus a new function has a cost.\n */\nexport function lineWeights(text: string, map: CostMap): number[] {\n const segments = segmentsOf(text);\n const named = segments.filter((s) => map.segments[s.key] !== undefined);\n const namedLines = named.reduce((sum, s) => sum + s.end - s.start + 1, 0);\n const namedCost = named.reduce((sum, s) => sum + (map.segments[s.key] ?? 0), 0);\n const mean = namedLines === 0 ? 1 : namedCost / namedLines;\n return segments.flatMap((s) => {\n const size = s.end - s.start + 1;\n const cost = map.segments[s.key];\n return Array.from({ length: size }, () => (cost === undefined ? mean : cost / size));\n });\n}\n\n/** A file of a group: its path from the folder of its package, its lines, and the weight of each line. */\nexport interface WeightedFile {\n readonly path: string;\n readonly lines: readonly string[];\n readonly weights: readonly number[];\n}\n\n/**\n * This function gives the weight of each line of each file from the cost maps of its package. A file with no map has\n * the mean weight of a line of the files with a map, so a new file has a cost. With no map, each line has the weight 1.\n */\nexport function weightedFiles(texts: readonly { readonly path: string; readonly text: string }[], maps: Readonly<Record<string, CostMap>> = {}): WeightedFile[] {\n const known = texts.flatMap(({ path, text }) => {\n const map = maps[path];\n return map === undefined ? [] : [lineWeights(text, map)];\n });\n const lineCount = known.reduce((n, w) => n + w.length, 0);\n const mean = lineCount === 0 ? 1 : known.flat().reduce((n, w) => n + w, 0) / lineCount;\n return texts.map(({ path, text }) => {\n const lines = linesOf(text);\n const map = maps[path];\n return { path, lines, weights: map === undefined ? lines.map(() => mean) : lineWeights(text, map) };\n });\n}\n\n/** The weight of a cut into parts: the weight of its largest part, and the sum of the squares of the weights of its parts. */\ninterface CutWeight {\n readonly max: number;\n readonly squares: number;\n /** The index of the candidate before the last part of the cut, or -1 for a cut of one part. */\n readonly before: number;\n}\n\n/**\n * This function gives the lightest cut of the lines at the candidates into `count` parts. It gives the index of the\n * candidate at the end of each part but the last. With a limit, a part over the limit is not possible, and the lightest\n * cut has the smallest squares. With no limit, the lightest cut has the smallest largest part, then the smallest squares.\n */\nfunction lightestCut(candidates: readonly number[], sumTo: (at: number) => number, total: number, count: number, limit?: number): { readonly picks: number[]; readonly max: number } {\n const lighter = (x: CutWeight, y: CutWeight | undefined): boolean =>\n y === undefined || (limit === undefined ? x.max < y.max || (x.max === y.max && x.squares < y.squares) : x.squares < y.squares);\n const extend = (prior: CutWeight | undefined, from: number, to: number, before: number): CutWeight | undefined => {\n const weight = sumTo(to) - sumTo(from);\n if (prior === undefined || (limit !== undefined && weight > limit)) return undefined;\n return { max: Math.max(prior.max, weight), squares: prior.squares + weight ** 2, before };\n };\n const start: CutWeight = { max: 0, squares: 0, before: -1 };\n // The value cuts[p][k] is the lightest cut of the lines up to the candidate k into p + 1 parts.\n const cuts: (CutWeight | undefined)[][] = [candidates.map((end) => extend(start, -1, end, -1))];\n for (let part = 1; part < count - 1; part += 1) {\n const last = cuts[part - 1] ?? [];\n cuts.push(\n candidates.map((end, k) => {\n let best: CutWeight | undefined;\n for (let i = part - 1; i < k; i += 1) {\n const cut = extend(last[i], candidates[i] ?? -1, end, i);\n if (cut !== undefined && lighter(cut, best)) best = cut;\n }\n return best;\n }),\n );\n }\n let best: CutWeight | undefined;\n (cuts[count - 2] ?? []).forEach((prior, k) => {\n const cut = extend(prior, candidates[k] ?? -1, total, k);\n if (cut !== undefined && lighter(cut, best)) best = cut;\n });\n const picks: number[] = [];\n let at = best?.before ?? -1;\n for (let part = count - 2; part >= 0; part -= 1) {\n picks.unshift(at);\n at = cuts[part]?.[at]?.before ?? -1;\n }\n return { picks, max: best?.max ?? Number.POSITIVE_INFINITY };\n}\n\n/**\n * This function gives the last line of each part but the last, counted from 1. A line is an end line when `isEnd` of\n * its index from 0 is true. Of all cuts at end lines into `count` parts, it takes the cuts with the smallest largest\n * part. Of these, it takes the cut with the smallest sum of squares.\n *\n * @throws Error when the lines have fewer end lines than the count of parts needs\n */\nfunction endsOf(size: number, isEnd: (at: number) => boolean, count: number, weights: readonly number[]): number[] {\n if (count < 2) return [];\n const sums: number[] = [];\n let total = 0;\n for (let at = 0; at < size; at += 1) {\n total += weights[at] ?? 0;\n sums.push(total);\n }\n // A position of the sums is a line from 0. The position -1 is before the first line, and `size` is after the last line.\n const sumTo = (at: number): number => (at < 0 ? 0 : at >= size ? total : (sums[at] ?? 0));\n // The candidates are the end lines before the last line. A cut after the last line gives an empty part.\n const candidates = Array.from({ length: Math.max(0, size - 1) }, (_unused, at) => at).filter(isEnd);\n if (candidates.length < count - 1) throw new Error(`the files have ${String(candidates.length + 1)} places for the end of a part, and the cut needs ${String(count)}`);\n const { max } = lightestCut(candidates, sumTo, size, count);\n const { picks } = lightestCut(candidates, sumTo, size, count, max);\n return picks.map((pick) => (candidates[pick] ?? 0) + 1);\n}\n\n/**\n * This function cuts the files of a group into `count` parts of near the same weight. It gives the entries of `mutate`\n * of each part. The files follow one another in their order. A part ends on the closing line of a method, or on the last\n * line of a file. A part holds whole files, and a range of lines of a file at each end. Each input gives one result.\n *\n * @throws Error when the files have fewer end lines than the count of parts needs\n */\nexport function cutByCost(files: readonly WeightedFile[], count: number): string[][] {\n const lines = files.flatMap((file) => file.lines);\n const starts: number[] = [];\n let at = 0;\n for (const file of files) {\n starts.push(at);\n at += file.lines.length;\n }\n // The last line of each file but the last file is an end. The last part ends on the last line of all files.\n const fileEnds = new Set(starts.slice(1).map((start) => start - 1));\n const isEnd = (line: number): boolean => fileEnds.has(line) || CLOSING_LINE.test(lines[line] ?? \"\");\n const ends = endsOf(lines.length, isEnd, count, files.flatMap((file) => file.weights));\n return Array.from({ length: count }, (_unused, part) => {\n const from = (ends[part - 1] ?? 0) + 1;\n const to = ends[part] ?? lines.length;\n return files.flatMap((file, index) => {\n const start = starts[index] ?? 0;\n const first = Math.max(from, start + 1) - start;\n const last = Math.min(to, start + file.lines.length) - start;\n if (first > last) return [];\n return [first === 1 && last === file.lines.length ? file.path : `${file.path}:${String(first)}-${String(last)}`];\n });\n });\n}\n\n/** This function gives the planned net time of the entries of a part in milliseconds: the sum of the weights of their lines. */\nexport function plannedMs(entries: readonly string[], files: readonly WeightedFile[]): number {\n const byPath = new Map(files.map((file) => [file.path, file.weights]));\n return entries.reduce((sum, entry) => {\n const [, path = entry, first, last] = /^(.+):(\\d+)-(\\d+)$/u.exec(entry) ?? [];\n const weights = byPath.get(path) ?? [];\n const from = first === undefined ? 1 : Number(first);\n const to = last === undefined ? weights.length : Number(last);\n return sum + weights.slice(from - 1, to).reduce((n, w) => n + w, 0);\n }, 0);\n}\n\n/**\n * This function reads the JSON of a file of cost maps.\n *\n * @throws Error when the JSON is not an object of packages, each an object of files, each with a run and segments\n */\nexport function parseCostMaps(json: unknown): CostMaps {\n const isRecord = (x: unknown): x is Record<string, unknown> => typeof x === \"object\" && x !== null && !Array.isArray(x);\n const isMap = (m: unknown): boolean =>\n isRecord(m) && typeof m[\"run\"] === \"string\" && isRecord(m[\"segments\"]) && Object.values(m[\"segments\"]).every((n) => typeof n === \"number\" && n >= 0);\n if (!isRecord(json) || !Object.values(json).every((files) => isRecord(files) && Object.values(files).every(isMap))) {\n throw new Error(`the cost maps are not an object of packages, each an object of files, each with \"run\" and \"segments\"`);\n }\n return json as CostMaps;\n}\n","import type { Selection } from \"./lane.ts\";\n\n/** The options of `strykerConfig`. */\nexport interface ConfigOptions {\n /** This option gives the number of test processes. The default is 2. */\n readonly concurrency?: number;\n /** This option gives the folder of the reports, from the folder of the package. The default is `reports/mutation`. */\n readonly reportDir?: string;\n /**\n * When this option is true, Stryker starts only the tests without mutants, and it does not stop at the first failed\n * test. Use it to see if the tests pass under Stryker before a long run.\n */\n readonly dryRun?: boolean;\n /**\n * When this option is true, Stryker starts the tests without mutants and makes its plan. The reporter `rigor-partial`\n * writes the plan into `plan.json` and stops Stryker. No mutant runs. `plan-check` reads the plan.\n */\n readonly plan?: boolean;\n /**\n * When this option is false, Stryker does not rewrite the tsconfig of the package in its sandbox. The default is true.\n * The rewrite uses `parseConfigFileTextToJson`, and TypeScript 7 does not have it. Refer to `rewritesTsconfig`.\n */\n readonly tsconfigRewrite?: boolean;\n}\n\n/** The Stryker config of one selection, as JSON. Stryker starts in the folder of the package. The field `stryker` of the lane adds keys. */\nexport interface StrykerConfig {\n readonly [key: string]: unknown;\n readonly testRunner: \"vitest\";\n readonly plugins: readonly string[];\n readonly vitest?: { readonly configFile: string };\n readonly mutate: readonly string[];\n readonly coverageAnalysis: \"perTest\";\n readonly reporters: readonly string[];\n readonly htmlReporter: { readonly fileName: string };\n readonly jsonReporter: { readonly fileName: string };\n readonly thresholds: { readonly high: number; readonly low: number; readonly break: null };\n readonly concurrency: number;\n readonly timeoutMS: number;\n readonly dryRunTimeoutMinutes: number;\n readonly tsconfigFile?: string;\n readonly dryRunOnly?: true;\n readonly disableBail?: true;\n readonly rigorPartial?: { readonly stopAfterPlan: true };\n}\n\n/**\n * The file URL of the module of the reporter `rigor-partial`: the source in the workspace, the build in the package of\n * npm. The reporter writes each tested mutant at once, so a stop of Stryker keeps a partial score.\n */\nexport const PARTIAL_PLUGIN: string = new URL(import.meta.url.endsWith(\".ts\") ? \"./reporter.ts\" : \"./reporter.js\", import.meta.url).href;\n\n/** The default folder of the reports, from the folder of the package. */\nexport const REPORT_DIR = \"reports/mutation\";\n\n/**\n * The default time in milliseconds that the clock adds to the time of the tests for each mutant. The default of\n * Stryker is 5000. On a loaded CI runner that time stopped mutants that the tests detected later.\n */\nexport const TIMEOUT_MS = 120_000;\n\n/**\n * The value of `tsconfigFile` when the rewrite of the tsconfig is off. No project has this file, so Stryker finds no\n * tsconfig to rewrite.\n */\nexport const NO_TSCONFIG = \"tsconfig.no-stryker-rewrite.json\";\n\n/**\n * This function tells if Stryker can rewrite a tsconfig with a TypeScript of the major version `major`. Stryker 10.1\n * parses the tsconfig with `parseConfigFileTextToJson`, and TypeScript 7 removed it. When no TypeScript is found, the\n * answer is true, and the config keeps the default of Stryker.\n */\nexport function rewritesTsconfig(major: number | undefined): boolean {\n return major === undefined || major < 7;\n}\n\n/** The default time in minutes for the run of the tests without mutants. The default of Stryker is 5. */\nexport const DRY_RUN_TIMEOUT_MINUTES = 15;\n\n/**\n * This function gives the Stryker config of a selection. The break of Stryker is off, because the gate of each\n * package is in `scoreReport`. Stryker 10.1.0 or later is necessary with Vitest 5: version 10.0 started no test on each\n * mutant (stryker-js issue 6210).\n */\nexport function strykerConfig(selection: Selection, options: ConfigOptions = {}): StrykerConfig {\n const reportDir = options.reportDir ?? REPORT_DIR;\n const low = selection.gate ?? 60;\n return {\n testRunner: \"vitest\",\n plugins: [\"@stryker-mutator/vitest-runner\", PARTIAL_PLUGIN],\n ...(selection.vitestConfig === undefined ? {} : { vitest: { configFile: selection.vitestConfig } }),\n mutate: selection.mutate,\n coverageAnalysis: \"perTest\",\n reporters: [\"clear-text\", \"progress\", \"html\", \"json\", \"rigor-partial\"],\n htmlReporter: { fileName: `${reportDir}/index.html` },\n jsonReporter: { fileName: `${reportDir}/mutation.json` },\n thresholds: { high: Math.max(low, 90), low, break: null },\n concurrency: options.concurrency ?? 2,\n timeoutMS: selection.timeoutMS ?? TIMEOUT_MS,\n dryRunTimeoutMinutes: selection.dryRunTimeoutMinutes ?? DRY_RUN_TIMEOUT_MINUTES,\n ...(options.tsconfigRewrite === false ? { tsconfigFile: NO_TSCONFIG } : {}),\n // The keys of the lane field \"stryker\" replace the keys above, but \"--concurrency\" replaces its \"concurrency\".\n ...selection.stryker,\n ...(options.concurrency === undefined ? {} : { concurrency: options.concurrency }),\n ...(options.dryRun === true ? { dryRunOnly: true, disableBail: true } : {}),\n ...(options.plan === true ? { rigorPartial: { stopAfterPlan: true } } : {}),\n };\n}\n","/**\n * The score of a Stryker report, with the gate of the package. The score counts the detected mutants, out of the\n * mutants that a test covers or that survive. Compile errors, runtime errors and ignored mutants do not count.\n *\n * Stryker gives the status `Timeout` for two events. The hit limit stops a mutant with an endless loop: its\n * `statusReason` starts with `Hit limit`, and the mutant is detected. The clock stops a mutant that took too long. The\n * load of the runner can cause this. Thus the mutant is not detected for certain, and it counts as not detected.\n */\n\n/** A mutant of the JSON report of Stryker (the schema of mutation-testing-elements). */\nexport interface Mutant {\n readonly status: string;\n readonly mutatorName: string;\n /** Stryker gives the reason of some statuses here. A `Timeout` of the hit limit has a reason that starts with `Hit limit`. */\n readonly statusReason?: string | undefined;\n readonly location: { readonly start: { readonly line: number } };\n}\n\n/** The JSON report of Stryker: the mutants of each mutated file, and the tests of each test file that the run read. */\nexport interface MutationReport {\n readonly files: Readonly<Record<string, { readonly mutants: readonly Mutant[] }>>;\n /** Stryker gives this field when the test runner tells the tests, as the Vitest runner does. */\n readonly testFiles?: Readonly<Record<string, { readonly tests: readonly { readonly name: string }[] }>> | undefined;\n}\n\n/**\n * The three reads of a score. A `block` is a score under its gate. A `no read` is a score that does not read the tests.\n * Its cause is no report, no mutant that counts, no detected mutant, or a run that did not read all the tests. A no read is not a pass.\n */\nexport type ScoreOutcome = \"pass\" | \"block\" | \"no read\";\n\n/** The score of one selection. */\nexport interface Score {\n readonly name: string;\n readonly gate: number | undefined;\n /** The mutants with the status `Killed`, and the mutants that the hit limit stopped. */\n readonly detected: number;\n /** The mutants that the hit limit stopped. They are in `detected`. */\n readonly hitLimit: number;\n /** The mutants that the clock stopped. They count as not detected, and they are in `survived`. */\n readonly clockTimeouts: number;\n /** The mutants that count: detected, survived or with no coverage. */\n readonly valid: number;\n /** Each mutant that survived, had no coverage or was stopped by the clock, as `file:line Mutator`. */\n readonly survived: readonly string[];\n /** The score in percent. It is 0 when no mutant counts. */\n readonly percent: number;\n /** The score in percent with the clock time-outs counted as detected, as Stryker counts them. The gate does not read it. */\n readonly percentWithClock: number;\n /** The count of the tests that the run read, from `testFiles` of the report. It is undefined when the report has no `testFiles`. */\n readonly tests: number | undefined;\n readonly pass: boolean;\n /** The reason of a failure. */\n readonly reason: string | undefined;\n /** The read of the score. The functions of this package always give it. A score from an older version has no outcome. */\n readonly outcome?: ScoreOutcome;\n /** This field marks a partial score: a time limit stopped Stryker, and the score reads only the mutants that ran. */\n readonly partial?: PartialCosts;\n}\n\n/** The costs of a run that a time limit stopped. */\nexport interface PartialCosts {\n /** The mutants that Stryker tested before the stop. */\n readonly tested: number;\n /** The mutants of the plan. It is undefined when the run stopped before the plan. */\n readonly planned: number | undefined;\n /** The minutes from the start of Stryker to the last line of the file. */\n readonly minutes: number;\n /** The minutes for all the mutants of the plan, at the rate of the mutants that ran. Early results do not count. It is undefined with no rate. */\n readonly estimate: number | undefined;\n}\n\n/** The read of `partial.jsonl`: a report of the mutants that ran, and the costs of the run. */\nexport interface PartialRun extends PartialCosts {\n readonly report: MutationReport;\n /** This field tells if Stryker wrote its last line. Then the run did not stop. */\n readonly done: boolean;\n}\n\n/**\n * This function reads the lines of the reporter `rigor-partial`. A stop of the process can cut the last line, so the\n * function ignores a last line that is not JSON.\n *\n * @throws Error when a line before the last one is not JSON, or when the file has no start line\n */\nexport function parsePartial(text: string): PartialRun {\n const raw = text.split(\"\\n\").filter((line) => line.trim() !== \"\");\n const lines = raw.flatMap((line, i): Record<string, unknown>[] => {\n try {\n return [JSON.parse(line) as Record<string, unknown>];\n } catch (error) {\n if (i === raw.length - 1) return [];\n throw new Error(`the line ${String(i + 1)} of the partial file is not JSON`, { cause: error });\n }\n });\n const at = (l: Record<string, unknown> | undefined): number => (typeof l?.[\"at\"] === \"number\" ? l[\"at\"] : 0);\n const start = lines.find((l) => l[\"event\"] === \"start\");\n if (start === undefined) throw new Error(`the partial file has no start line`);\n const plan = lines.find((l) => l[\"event\"] === \"plan\");\n const mutants = lines.filter((l) => l[\"event\"] === \"mutant\");\n const files: Record<string, { mutants: Mutant[] }> = {};\n for (const m of mutants) {\n const reason = typeof m[\"statusReason\"] === \"string\" ? { statusReason: m[\"statusReason\"] } : {};\n (files[String(m[\"file\"])] ??= { mutants: [] }).mutants.push({ status: String(m[\"status\"]), ...reason, mutatorName: String(m[\"mutatorName\"]), location: { start: { line: Number(m[\"line\"]) } } });\n }\n const minutes = (to: number, from: number): number => (to - from) / 60_000;\n const last = at(lines.at(-1));\n const planned = typeof plan?.[\"mutants\"] === \"number\" ? plan[\"mutants\"] : undefined;\n const run = typeof plan?.[\"run\"] === \"number\" ? plan[\"run\"] : undefined;\n // Stryker reports the mutants with an early result (no coverage, ignored, from the cache) just after the plan, and\n // they take no time. So the rate reads only the tested mutants that ran: the lines of all the mutants less the early ones.\n const lastMutant = at(mutants.at(-1));\n const ran = planned === undefined || run === undefined ? 0 : mutants.length - (planned - run);\n const estimate =\n run === undefined || ran <= 0 || lastMutant <= at(plan)\n ? undefined\n : minutes(at(plan), at(start)) + (minutes(lastMutant, at(plan)) * run) / ran;\n return { report: { files }, tested: mutants.length, planned, minutes: minutes(last, at(start)), estimate, done: lines.some((l) => l[\"event\"] === \"done\") };\n}\n\n/**\n * This function gives the score of a run that a time limit stopped. The score reads only the mutants that ran, so it\n * is a no read with the mark `partial`. The reason gives the costs, for the size of the next parts.\n */\nexport function partialScore(run: PartialRun, selection: { readonly name: string; readonly gate: number | undefined }): Score {\n const score = scoreReport(run.report, selection);\n const of = run.planned === undefined ? \"an unknown count of\" : String(run.planned);\n const estimate = run.estimate === undefined ? \"\" : ` All the mutants need an estimated ${run.estimate.toFixed(0)} minutes.`;\n const reason = `partial: Stryker stopped after ${run.minutes.toFixed(1)} minutes and tested ${String(run.tested)} of ${of} mutants. The score of the mutants that ran is ${score.percent.toFixed(2)} %.${estimate}`;\n const { tested, planned, minutes } = run;\n return { ...score, pass: false, reason, outcome: \"no read\", partial: { tested, planned, minutes, estimate: run.estimate } };\n}\n\nconst UNDETECTED = new Set([\"Survived\", \"NoCoverage\"]);\n\n/** This function tells if the hit limit of Stryker stopped a mutant. Then the mutant has an endless loop, and it is detected. */\nexport const isHitLimit = (m: Mutant): boolean => m.status === \"Timeout\" && (m.statusReason ?? \"\").startsWith(\"Hit limit\");\n\n/**\n * This function examines the JSON of a Stryker report and gives the report.\n *\n * @throws Error when the JSON has no files with mutants\n */\nexport function parseReport(json: unknown): MutationReport {\n const files = typeof json === \"object\" && json !== null ? (json as { files?: unknown }).files : undefined;\n if (typeof files !== \"object\" || files === null) throw new Error(`the report has no object \"files\"`);\n for (const [file, data] of Object.entries(files)) {\n if (!Array.isArray((data as { mutants?: unknown } | null)?.mutants)) throw new Error(`the report has no list \"mutants\" for ${file}`);\n }\n const testFiles = (json as { testFiles?: unknown }).testFiles;\n if (testFiles !== undefined) {\n if (typeof testFiles !== \"object\" || testFiles === null) throw new Error(`the field \"testFiles\" of the report is not an object`);\n for (const [file, data] of Object.entries(testFiles)) {\n if (!Array.isArray((data as { tests?: unknown } | null)?.tests)) throw new Error(`the report has no list \"tests\" for the test file ${file}`);\n }\n }\n return json as MutationReport;\n}\n\n/** This function gives the count of the tests of a report, or undefined when the report has no `testFiles`. */\nexport function testCount(report: MutationReport): number | undefined {\n if (report.testFiles === undefined) return undefined;\n return Object.values(report.testFiles).reduce((sum, f) => sum + f.tests.length, 0);\n}\n\n/**\n * This function compares a test count with the last good count. It gives the reason of a failure when the count fell\n * by more than `maxFall` percent, else undefined. A report that reads fewer tests is no read of the score.\n *\n * @param maxFall - the highest fall in percent that passes\n */\nexport function testFall(tests: number, last: number, maxFall: number): string | undefined {\n if (last <= 0 || tests >= last) return undefined;\n const fall = (100 * (last - tests)) / last;\n if (fall <= maxFall) return undefined;\n return `the run read ${String(tests)} tests, ${fall.toFixed(1)} % fewer than the last good count ${String(last)} (the limit is ${String(maxFall)} %), so the score is no read`;\n}\n\n/**\n * This function gives each test file on the disk that the report does not read, and that `notRead` does not name.\n * The files of the report and of the disk are from the folder of the package.\n *\n * @param onDisk - the test files of the package, from its folder, with `/`\n * @param dir - the folder of the package, to make a full path of the report relative\n */\nexport function unreadTestFiles(report: MutationReport, onDisk: readonly string[], notRead: Readonly<Record<string, string>> = {}, dir = \"\"): string[] {\n const read = readTestFiles([report], dir);\n return onDisk.filter((f) => !read.has(f) && notRead[f] === undefined);\n}\n\n/** This function gives the test files that the reports read, from the folder of the package, with `/`. */\nfunction readTestFiles(reports: readonly MutationReport[], dir: string): Set<string> {\n const root = dir.replaceAll(\"\\\\\", \"/\").replace(/\\/?$/, \"/\");\n return new Set(\n reports.flatMap((report) =>\n Object.keys(report.testFiles ?? {}).map((f) => {\n const file = f.replaceAll(\"\\\\\", \"/\");\n return dir !== \"\" && file.startsWith(root) ? file.slice(root.length) : file.replace(/^\\.\\//, \"\");\n }),\n ),\n );\n}\n\n/** The faults of the test files of a package over the reports of all its selections (LANE.FILES). */\nexport interface TestFileFaults {\n /** These test files are on the disk, no report reads them, and `notRead` does not name them. */\n readonly unread: readonly string[];\n /** These entries of `notRead` are not true: the file is not on the disk, or a report reads it. */\n readonly stale: readonly string[];\n}\n\n/**\n * This function examines the test files of a package over the reports of all its selections (LANE.FILES). A part\n * starts only its related test files, so only all the parts together show a test file that no part reads.\n *\n * @param reports - the reports of all the selections of the package\n * @param onDisk - the test files of the package, from its folder, with `/`\n * @param dir - the folder of the package, to make a full path of a report relative\n */\nexport function testFileFaults(reports: readonly MutationReport[], onDisk: readonly string[], notRead: Readonly<Record<string, string>> = {}, dir = \"\"): TestFileFaults {\n return readFaults(readTestFiles(reports, dir), onDisk, notRead);\n}\n\n/**\n * This function examines the test files of a package against the test files that its selections read (LANE.FILES).\n * `load-check --collect` gives the files that the selections start. The reports give the files that they read.\n *\n * @param read - the test files that the selections read, from the folder of the package, with `/`\n * @param onDisk - the test files of the package, from its folder, with `/`\n */\nexport function readFaults(read: ReadonlySet<string>, onDisk: readonly string[], notRead: Readonly<Record<string, string>> = {}): TestFileFaults {\n const files = new Set(onDisk);\n return {\n unread: onDisk.filter((f) => !read.has(f) && notRead[f] === undefined),\n stale: Object.keys(notRead).filter((f) => !files.has(f) || read.has(f)),\n };\n}\n\n/**\n * This function gives a score that fails for a reason, with the outcome `no read`. A score that failed already keeps its\n * first reason, and gets the new one after it. A score under its gate with a second reason is also a no read.\n */\nexport function failScore(score: Score, reason: string): Score {\n return { ...score, pass: false, outcome: \"no read\", reason: score.reason === undefined ? reason : `${score.reason}. Also ${reason}` };\n}\n\n/**\n * This function gives the score of a report and applies the gate. A report with no mutants that count fails, also\n * without a gate: Stryker found no files. A report with mutants that count and none detected also fails: the test\n * runner started no test on the mutants. Stryker 10.0 with Vitest 5 gave this result.\n */\nexport function scoreReport(report: MutationReport, selection: { readonly name: string; readonly gate: number | undefined }): Score {\n let detected = 0;\n let valid = 0;\n let hitLimit = 0;\n let clockTimeouts = 0;\n const survived: string[] = [];\n for (const [file, data] of Object.entries(report.files)) {\n for (const m of data.mutants) {\n const at = `${file}:${String(m.location.start.line)} ${m.mutatorName}`;\n if (m.status === \"Killed\" || isHitLimit(m)) {\n detected++;\n valid++;\n if (m.status === \"Timeout\") hitLimit++;\n } else if (m.status === \"Timeout\") {\n clockTimeouts++;\n valid++;\n survived.push(`${at} (the clock stopped it)`);\n } else if (UNDETECTED.has(m.status)) {\n valid++;\n survived.push(at);\n }\n }\n }\n const percent = valid === 0 ? 0 : (100 * detected) / valid;\n const percentWithClock = valid === 0 ? 0 : (100 * (detected + clockTimeouts)) / valid;\n const { name, gate } = selection;\n const [outcome, reason]: [ScoreOutcome, string | undefined] =\n valid === 0\n ? [\"no read\", \"the report has no mutants that count: Stryker found no files to mutate, or it did not start\"]\n : detected === 0\n ? [\"no read\", `the tests detected none of the ${String(valid)} mutants: the test runner started no test on the mutants`]\n : gate !== undefined && percent < gate\n ? [\"block\", `the score ${percent.toFixed(2)} % is under the gate ${String(gate)} %`]\n : [\"pass\", undefined];\n return { name, gate, detected, hitLimit, clockTimeouts, valid, survived, percent, percentWithClock, tests: testCount(report), pass: reason === undefined, reason, outcome };\n}\n\n/**\n * This function gives the score of a package from the scores of its parts, and applies the gate of the package. It sums\n * the mutants of the parts. A part that fails makes the package a no read: a part has no gate of its own here.\n * A missing part also makes the package a no read, because the sum does not count its mutants.\n *\n * @param missing - the parts of the package that have no score in this read\n */\nexport function packageScore(name: string, gate: number | undefined, parts: readonly Score[], missing: readonly string[] = []): Score {\n const sum = (count: (s: Score) => number): number => parts.reduce((total, s) => total + count(s), 0);\n const detected = sum((s) => s.detected);\n const valid = sum((s) => s.valid);\n const clockTimeouts = sum((s) => s.clockTimeouts);\n const percent = valid === 0 ? 0 : (100 * detected) / valid;\n const percentWithClock = valid === 0 ? 0 : (100 * (detected + clockTimeouts)) / valid;\n const failed = parts.filter((s) => !s.pass).map((s) => s.name);\n const [outcome, reason]: [ScoreOutcome, string | undefined] =\n parts.length === 0\n ? [\"no read\", \"the package has no scores of its parts\"]\n : missing.length > 0\n ? [\"no read\", `the read has no score of the parts ${missing.join(\", \")}, so the sum does not count their mutants`]\n : failed.length > 0\n ? [\"no read\", `the parts ${failed.join(\", \")} fail, so the sum of the parts has no meaning`]\n : gate !== undefined && percent < gate\n ? [\"block\", `the score ${percent.toFixed(2)} % of all the parts is under the gate ${String(gate)} %`]\n : [\"pass\", undefined];\n const tests = parts.every((s) => s.tests !== undefined) ? sum((s) => s.tests ?? 0) : undefined;\n return { name, gate, detected, hitLimit: sum((s) => s.hitLimit), clockTimeouts, valid, survived: parts.flatMap((s) => s.survived), percent, percentWithClock, tests, pass: reason === undefined, reason, outcome };\n}\n\n/** This function gives the time-outs of a score as text: the count of each kind, and the score that counts the clock time-outs as detected. */\nconst timeouts = (s: Score): string =>\n `time-outs: ${String(s.hitLimit)} hit limit, ${String(s.clockTimeouts)} clock (${s.percentWithClock.toFixed(2)} % with the clock time-outs as detected)`;\n\n/** This function gives one line for a score, with the name of the selection and its result. The time-outs are in it when the report has some. */\nexport function formatScore(s: Score): string {\n const gate = s.gate === undefined ? \"no gate\" : `gate ${String(s.gate)} %`;\n const result = s.pass ? \"pass\" : `FAIL: ${s.reason ?? \"\"}`;\n const time = s.hitLimit + s.clockTimeouts === 0 ? \"\" : `, ${timeouts(s)}`;\n const tests = s.tests === undefined ? \"\" : `, ${String(s.tests)} tests`;\n return `${s.name}: ${s.percent.toFixed(2)} % (${String(s.detected)} of ${String(s.valid)}, ${String(s.survived.length)} survived${time}${tests}), ${gate}: ${result}`;\n}\n\n/** This function gives a Markdown table of scores, for the summary of a CI job. */\nexport function summaryMarkdown(scores: readonly Score[]): string {\n const rows = scores.map(\n (s) =>\n `| ${s.name} | ${s.percent.toFixed(2)} % | ${String(s.detected)} | ${String(s.valid)} | ${String(s.survived.length)} | ${String(s.clockTimeouts)} | ${s.percentWithClock.toFixed(2)} % | ${s.gate === undefined ? \"none\" : `${String(s.gate)} %`} | ${s.pass ? \"pass\" : `fail: ${s.reason ?? \"\"}`} | ${s.tests === undefined ? \"?\" : String(s.tests)} |`,\n );\n return [\n \"| Selection | Score | Detected | Valid | Survived | Clock time-outs | Score with them | Gate | Result | Tests |\",\n \"| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- | ---: |\",\n ...rows,\n \"\",\n ].join(\"\\n\");\n}\n","/**\n * A comment `// Stryker disable next-line <Mutator>: <reason>` disables a mutant that is equivalent. The disable\n * raises the score, so each one is also in a list with its reason. These functions find the comments in the\n * sources and compare them with the list.\n */\n\n/** One disable comment of a source file. */\nexport interface Disable {\n readonly file: string;\n readonly comment: string;\n}\n\n/** The result of `compareDisables`. */\nexport interface DisableCheck {\n /** The comments of the sources that are not in the list, as `file: comment`. */\n readonly added: readonly string[];\n /** The comments of the list that are not in the sources, as `file: comment`. */\n readonly removed: readonly string[];\n /** The comments with no reason after a colon. */\n readonly noReason: readonly Disable[];\n readonly ok: boolean;\n}\n\n/** This function finds each `Stryker disable` comment of the files. A file name uses `/`. */\nexport function findDisables(files: readonly { readonly file: string; readonly text: string }[]): Disable[] {\n return files.flatMap(({ file, text }) =>\n text\n .split(\"\\n\")\n .filter((line) => line.includes(\"Stryker disable\"))\n .map((line) => ({ file, comment: line.trim() })),\n );\n}\n\nconst counts = (xs: readonly Disable[]): Map<string, number> => {\n const m = new Map<string, number>();\n for (const x of xs) {\n const k = `${x.file}: ${x.comment}`;\n m.set(k, (m.get(k) ?? 0) + 1);\n }\n return m;\n};\n\n/**\n * This function tells if a comment has a reason: a mutator name, a colon, a space and a text. It reads the text by\n * index, so its time is linear in the length of the comment (a regular expression here was quadratic).\n */\nfunction hasReason(comment: string): boolean {\n const start = comment.indexOf(\"Stryker disable \");\n if (start < 0) return false;\n const rest = comment.slice(start + \"Stryker disable \".length);\n const colon = rest.indexOf(\":\");\n return colon > 0 && rest[colon + 1] === \" \" && /\\S/.test(rest[colon + 2] ?? \"\");\n}\n\n/** This function compares the comments of the sources with the list. A file with the same comment two times needs it two times in the list. */\nexport function compareDisables(found: readonly Disable[], listed: readonly Disable[]): DisableCheck {\n const noReason = found.filter((d) => !hasReason(d.comment));\n const a = counts(found);\n const b = counts(listed);\n const added = [...a].filter(([k, n]) => n > (b.get(k) ?? 0)).map(([k]) => k);\n const removed = [...b].filter(([k, n]) => n > (a.get(k) ?? 0)).map(([k]) => k);\n return { added, removed, noReason, ok: added.length === 0 && removed.length === 0 && noReason.length === 0 };\n}\n","/**\n * The load check. Stryker copies the folder of a package to `<dir>/.stryker-tmp/sandbox-*` and starts the tests there.\n * A relative path that leaves the folder then finds no file. A test file that does not load gives no failed test, so\n * each mutant that it detects survives with no error (V-072 of Vex). This check finds these paths before Stryker. It\n * reads only the files that the run loads, so a script of the folder that no test loads can leave the folder.\n */\nimport { posix } from \"node:path\";\n\n/** A relative path in a file of a package that leaves the folder of the package. */\nexport interface LeavingPath {\n /** The file, from the folder of the package, with `/`. */\n readonly file: string;\n /** The line of the path, from 1. */\n readonly line: number;\n /** The path as the file writes it. */\n readonly path: string;\n}\n\n/** A file of a package and its text. */\nexport interface PackageFile {\n /** The file, from the folder of the package, with `/`. */\n readonly file: string;\n readonly text: string;\n}\n\n// The paths that a module loads: import and export from, import(), require(), vi.mock() and the other vi functions,\n// and new URL(path, import.meta.url).\n// The optional \"(\" and its spaces are one group, so that each space has one match (no slow backtracking).\nconst LOADED = /(?:\\bfrom|\\bimport|\\brequire|\\bvi\\.\\w+|\\bnew\\s+URL)\\s*(?:\\(\\s*)?([\"'`])([^\"'`\\r\\n]*)\\1/g;\n// Each relative path string of a config file, for example setupFiles: [\"../testkit/setup.ts\"].\nconst CONFIG_PATH = /([\"'`])(\\.\\.?\\/[^\"'`\\r\\n]*)\\1/g;\n// A type import or export: the test runner removes it, so it loads no file.\nconst TYPE_ONLY = /^\\s*(?:import|export)\\s+type\\b/;\nconst COMMENT = /^\\s*(?:\\/\\/|\\/\\*|\\*)/;\nconst CONFIG_FILE = /(?:^|\\/)vite(?:st)?\\.(?:config|workspace)\\.[cm]?[jt]s$/;\n\n/**\n * This function tells if a file is a config file of Vitest or Vite. Each relative path string of a config file must\n * stay in the folder.\n *\n * @param vitestConfig - the field `vitestConfig` of the lane, from the folder of the package\n */\nexport function isConfigFile(file: string, vitestConfig?: string): boolean {\n return CONFIG_FILE.test(file) || (vitestConfig !== undefined && posix.normalize(vitestConfig.replaceAll(\"\\\\\", \"/\")) === file);\n}\n\nfunction leaves(file: string, path: string): boolean {\n if (!(path === \".\" || path === \"..\" || path.startsWith(\"./\") || path.startsWith(\"../\")) || path.includes(\"${\")) return false;\n const target = posix.normalize(posix.join(posix.dirname(file), path));\n return target === \"..\" || target.startsWith(\"../\");\n}\n\nconst TEST = /\\.(?:test|spec)\\.[cm]?[jt]sx?$/;\nconst EXTENSIONS = [\"\", \".ts\", \".tsx\", \".mts\", \".cts\", \".js\", \".mjs\", \".cjs\", \"/index.ts\", \"/index.js\"];\n\n/** This function gives each relative path of one file, with its line. It does not read comments and type imports. */\nfunction pathsOf(file: string, text: string, vitestConfig: string | undefined): { line: number; path: string }[] {\n const pattern = isConfigFile(file, vitestConfig) ? CONFIG_PATH : LOADED;\n return text.split(\"\\n\").flatMap((lineText, i) => {\n if (COMMENT.test(lineText) || TYPE_ONLY.test(lineText)) return [];\n return [...lineText.matchAll(pattern)].map((m) => ({ line: i + 1, path: m[2] ?? \"\" })).filter((p) => p.path.startsWith(\".\"));\n });\n}\n\n/** This function gives the file of the package that a relative path in the folder loads, or undefined. */\nfunction target(file: string, path: string, known: ReadonlySet<string>): string | undefined {\n const base = posix.normalize(posix.join(posix.dirname(file), path));\n const stem = base.replace(/\\.(?:[cm]?js|jsx)$/, \"\");\n return [...EXTENSIONS.map((e) => base + e), ...EXTENSIONS.slice(1).map((e) => stem + e)].find((f) => known.has(f));\n}\n\n/**\n * This function gives each relative path of the files that leaves the folder of the package. It reads the files that\n * the run loads. These are the test files, the config files, and each file that they load in the folder.\n * In a config file it reads each relative path string, for example a setup file. It does not read comments and type\n * imports.\n *\n * @param files - the files of the package, from its folder\n * @param vitestConfig - the field `vitestConfig` of the lane\n */\nexport function leavingPaths(files: readonly PackageFile[], vitestConfig?: string): LeavingPath[] {\n return loadWalk(files, vitestConfig).leaving.toSorted(byPlace);\n}\n\n/** This function orders places by file, then by line. */\nfunction byPlace(a: { readonly file: string; readonly line: number }, b: { readonly file: string; readonly line: number }): number {\n if (a.file === b.file) return a.line - b.line;\n return a.file < b.file ? -1 : 1;\n}\n\n/** This function walks the files that the run loads, from the test files and the config files. It gives them and the paths that leave the folder. */\nfunction loadWalk(files: readonly PackageFile[], vitestConfig: string | undefined): { readonly loaded: ReadonlySet<string>; readonly leaving: LeavingPath[] } {\n const texts = new Map(files.map((f) => [f.file, f.text]));\n const known = new Set(texts.keys());\n const queue = files.map((f) => f.file).filter((f) => TEST.test(f) || isConfigFile(f, vitestConfig));\n const loaded = new Set(queue);\n const leaving: LeavingPath[] = [];\n for (let next = queue.shift(); next !== undefined; next = queue.shift()) {\n for (const { line, path } of pathsOf(next, texts.get(next) ?? \"\", vitestConfig)) {\n if (leaves(next, path)) leaving.push({ file: next, line, path });\n else {\n const t = target(next, path, known);\n if (t !== undefined && !loaded.has(t)) {\n loaded.add(t);\n queue.push(t);\n }\n }\n }\n }\n return { loaded, leaving };\n}\n\n// A dynamic import whose path is not one string: a name, a call, or a template with an expression.\nconst COMPUTED_IMPORT = /\\bimport\\s*\\(\\s*(?!([\"'])[^\"'`\\r\\n]*\\1|`[^`$\\r\\n]*`)/;\n\n/** A dynamic import with a computed path in a file that the run loads. */\nexport interface ComputedImport {\n /** The file, from the folder of the package, with `/`. */\n readonly file: string;\n /** The line of the import, from 1. */\n readonly line: number;\n}\n\n/**\n * This function gives each dynamic import with a computed path in the files that the run loads. The related walk of\n * Vitest does not follow this type of import. So no selection starts a test file that reaches the mutated files only through\n * it, and each mutant of these files survives. The function does not read comments and config files.\n *\n * @param files - the files of the package, from its folder\n * @param vitestConfig - the field `vitestConfig` of the lane\n */\nexport function computedImports(files: readonly PackageFile[], vitestConfig?: string): ComputedImport[] {\n const { loaded } = loadWalk(files, vitestConfig);\n return files\n .filter((f) => loaded.has(f.file) && !isConfigFile(f.file, vitestConfig))\n .flatMap((f) => f.text.split(\"\\n\").flatMap((lineText, i) => (COMMENT.test(lineText) || !COMPUTED_IMPORT.test(lineText) ? [] : [{ file: f.file, line: i + 1 }])))\n .toSorted(byPlace);\n}\n\n// A type import or export to its semicolon, also on more than one line. The test runner removes it.\nconst TYPE_STATEMENT = /^[ \\t]*(?:import|export)[ \\t]+type\\b[^;]*;/gm;\n\n/** This function replaces each type import and export with its line ends, so the lines of the other paths stay. */\nfunction withoutTypeStatements(text: string): string {\n return text.replace(TYPE_STATEMENT, (statement) => statement.replace(/[^\\n]/g, \"\"));\n}\n\n/**\n * This function gives the test files that the related mode of the Vitest runner starts for a selection. A test file\n * is related when it loads a file of the selection, directly or through other files of the package. The function\n * does not read comments and type imports. The order is the order of `files`.\n *\n * @param files - the files of the package, from its folder\n * @param selected - the function that tells if a file is a file of the selection\n */\nexport function relatedTestFiles(files: readonly PackageFile[], selected: (file: string) => boolean): string[] {\n const texts = new Map(files.map((f) => [f.file, withoutTypeStatements(f.text)]));\n const known = new Set(texts.keys());\n const loads = (file: string): string[] =>\n pathsOf(file, texts.get(file) ?? \"\", undefined).flatMap(({ path }) => {\n const t = target(file, path, known);\n return t === undefined ? [] : [t];\n });\n const reaches = (test: string): boolean => {\n const queue = [test];\n const loaded = new Set(queue);\n for (let next = queue.shift(); next !== undefined; next = queue.shift()) {\n for (const t of loads(next)) {\n if (!TEST.test(t) && selected(t)) return true;\n if (!loaded.has(t)) {\n loaded.add(t);\n queue.push(t);\n }\n }\n }\n return false;\n };\n return files.map((f) => f.file).filter((f) => TEST.test(f) && reaches(f));\n}\n\n/** A test file as the collect of Vitest gives it (`load-check --collect`). */\nexport interface CollectedFile {\n /** The file, with `/`. */\n readonly file: string;\n /** The messages of the errors of the file. A file that does not load has one or more. */\n readonly errors: readonly string[];\n /** The number of tests and suites at the top of the file. */\n readonly children: number;\n}\n\n/** The collect of Vitest in the folder of a package. */\nexport interface Collected {\n /** The version of Vitest that the folder of the package resolves. */\n readonly version: string;\n /** The real path of the entry `vitest/node` that the folder resolves. */\n readonly path: string;\n readonly files: readonly CollectedFile[];\n /** The messages of the errors outside a test file. */\n readonly unhandled: readonly string[];\n /** The test files that the related mode of Vitest starts for each selection, by the name of the selection. */\n readonly selections: Readonly<Record<string, readonly string[]>>;\n}\n\n/** The request of the collect script: the folder, the config, and the mutated files of each selection. */\nexport interface CollectRequest {\n /** The folder where Vitest collects: the copy of the folder of the package. */\n readonly dir: string;\n /** The config of Vitest, from `dir`. */\n readonly config?: string;\n /** The mutated files of each selection, from `dir`, by the name of the selection. */\n readonly selections: Readonly<Record<string, readonly string[]>>;\n}\n\n/**\n * This function gives the reason of each fault of a collect. A test file that does not load gives no failed test, so\n * each mutant that it detects survives (V-090 of Vex). A test file with no test detects no mutant. An error outside a\n * test file and a package with no test file are faults too.\n */\nexport function collectFaults(collected: Collected): string[] {\n const faults = collected.files.flatMap((f) => {\n if (f.errors.length > 0) return [`${f.file}: the file does not load: ${f.errors.join(\" \")}`];\n return f.children === 0 ? [`${f.file}: the file holds no test`] : [];\n });\n faults.push(...collected.unhandled.map((e) => `an error outside a test file: ${e}`));\n if (collected.files.length === 0) faults.push(\"Vitest finds no test file\");\n return faults;\n}\n","/**\n * The copy of `load-check --collect`. Stryker copies the files of a package to its sandbox, and it leaves out each file\n * of its ignore rules. This copy takes the same files. So a test file loads in the copy only if it loads in Stryker.\n * The walk is a port of `resolveInputFileNames` of `project-reader.js` in `@stryker-mutator/core` 10.\n */\nimport { copyFileSync, existsSync, mkdirSync, mkdtempSync, readdirSync, rmSync, symlinkSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join } from \"node:path\";\n\n/** The rules that Stryker 10 applies to each project (`ALWAYS_IGNORE` of `project-reader.js`). */\nconst ALWAYS_IGNORE: readonly string[] = [\"node_modules\", \".git\", \"*.tsbuildinfo\", \"/stryker.log\", \".next\", \".nuxt\", \".svelte-kit\"];\n\n/** A rule of `minimatch`, as Stryker makes it. */\ninterface Rule {\n readonly negate: boolean;\n match(path: string, partial?: boolean): boolean;\n}\n\n/** The class `Minimatch` of `minimatch`. */\ntype MinimatchClass = new (pattern: string, options: { dot: boolean; flipNegate: boolean; nocase: boolean }) => Rule;\n\nconst text = (value: unknown, otherwise: string): string => (typeof value === \"string\" ? value : otherwise);\nconst fileName = (reporter: unknown): string | undefined => {\n if (typeof reporter !== \"object\" || reporter === null) return undefined;\n const name: unknown = (reporter as { fileName?: unknown }).fileName;\n return typeof name === \"string\" ? name : undefined;\n};\n\n/**\n * This function gives the ignore rules of Stryker for a Stryker config, in the order of Stryker. The defaults of\n * `tempDirName`, `incrementalFile` and the reporters are the defaults of Stryker 10.\n *\n * @param config - the Stryker config of a selection, from `strykerConfig`\n */\nexport function ignoreRules(config: Readonly<Record<string, unknown>>): string[] {\n const patterns = config[\"ignorePatterns\"];\n return [\n ...ALWAYS_IGNORE,\n tempDirOf(config),\n text(config[\"incrementalFile\"], \"reports/stryker-incremental.json\"),\n fileName(config[\"htmlReporter\"]) ?? \"reports/mutation/mutation.html\",\n fileName(config[\"jsonReporter\"]) ?? \"reports/mutation/mutation.json\",\n ...(Array.isArray(patterns) ? patterns.filter((p): p is string => typeof p === \"string\") : []),\n ];\n}\n\n/** This function gives the folder of the sandboxes of Stryker for a Stryker config. */\nexport function tempDirOf(config: Readonly<Record<string, unknown>>): string {\n return text(config[\"tempDirName\"], \".stryker-tmp\");\n}\n\n/**\n * This function gives the `Minimatch` of the Stryker that the folder `dir` resolves. Each folder uses its own Stryker,\n * so the rules match as in its run. It gives a reason when the folder resolves no Stryker.\n */\nexport function minimatchOf(dir: string): MinimatchClass | string {\n try {\n const core = createRequire(join(dir, \"package.json\")).resolve(\"@stryker-mutator/core/package.json\");\n return (createRequire(core)(\"minimatch\") as { Minimatch: MinimatchClass }).Minimatch;\n } catch (e) {\n return `the folder resolves no @stryker-mutator/core, so the check cannot apply the ignore rules of Stryker: ${e instanceof Error ? e.message : String(e)}`;\n }\n}\n\n/**\n * This function gives each file of the folder `root` that Stryker copies to its sandbox, from `root`, with `/`. A rule\n * with `!` takes a file back. Stryker does not go into a folder that a rule leaves out.\n *\n * @param rules - the ignore rules, from `ignoreRules`\n */\nexport function sandboxFiles(root: string, rules: readonly string[], Minimatch: MinimatchClass): string[] {\n const matchers = rules.map((pattern) => new Minimatch(pattern, { dot: true, flipNegate: true, nocase: true }));\n const matchesFile = (name: string, path: string, rule: Rule): boolean => rule.match(name) || rule.match(path) || rule.match(`/${path}`);\n const matchesDirectory = (name: string, path: string, rule: Rule): boolean =>\n matchesFile(name, path, rule) || rule.match(`/${path}/`) || rule.match(`${path}/`) || (rule.negate && (rule.match(`/${path}`, true) || rule.match(path, true)));\n const files: string[] = [];\n const crawl = (relativeDir: string): void => {\n for (const entry of readdirSync(join(root, relativeDir), { withFileTypes: true })) {\n const path = relativeDir === \"\" ? entry.name : `${relativeDir}/${entry.name}`;\n let included = true;\n for (const rule of matchers) {\n if (rule.negate === included) continue;\n const match = entry.isDirectory() ? matchesDirectory(entry.name, path, rule) : matchesFile(entry.name, path, rule);\n if (match) included = rule.negate;\n }\n if (!included) continue;\n if (entry.isDirectory()) crawl(path);\n else files.push(path);\n }\n };\n crawl(\"\");\n return files.toSorted();\n}\n\n/**\n * This function copies the files of `sandboxFiles` to a new folder in `<dir>/<tempDir>`, as Stryker makes its sandbox.\n * It links the `node_modules` of the folder. On an error it removes the part of the copy that it made.\n */\nexport function copyOfFolder(dir: string, files: readonly string[], tempDir: string): string {\n const base = join(dir, tempDir);\n mkdirSync(base, { recursive: true });\n const copy = mkdtempSync(join(base, \"load-check-\"));\n try {\n for (const file of files) {\n mkdirSync(dirname(join(copy, file)), { recursive: true });\n copyFileSync(join(dir, file), join(copy, file));\n }\n if (existsSync(join(dir, \"node_modules\"))) symlinkSync(join(dir, \"node_modules\"), join(copy, \"node_modules\"), \"junction\");\n return copy;\n } catch (e) {\n removeCopy(copy);\n throw e;\n }\n}\n\n/** This function removes a copy of `copyOfFolder`, and its folder of sandboxes when nothing else is in it. */\nexport function removeCopy(copy: string): void {\n rmSync(copy, { recursive: true, force: true });\n const base = dirname(copy);\n if (existsSync(base) && readdirSync(base).length === 0) rmSync(base, { recursive: true, force: true });\n}\n","/**\n * The CLI `rigor-mutation`. The work is in `runCli`, so a test can start the CLI in a fixture folder.\n */\nimport { spawnSync } from \"node:child_process\";\nimport { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync, appendFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join, relative, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { parseArgs } from \"node:util\";\nimport { escapeWorkflowData, escapeWorkflowProperty } from \"@mark1russell7/text\";\nimport { REPORT_DIR, rewritesTsconfig, strykerConfig } from \"./config.ts\";\nimport { compareDisables, findDisables, type Disable } from \"./disables.ts\";\nimport { collectFaults, computedImports, leavingPaths, relatedTestFiles, type Collected, type CollectRequest, type PackageFile } from \"./load.ts\";\nimport { costMapOf, cutByCost, parseCostMaps, plannedMs, weightedFiles, type CostMap, type CostMaps, type WeightedFile } from \"./cut.ts\";\nimport { changedFiles, globsSelect, MAX_TEST_FALL, packageRuns, parseLane, partErrors, runSelections, select, selectionNames, type CutOf, type Lane, type Selection } from \"./lane.ts\";\nimport { clockMinutes, parsePlan, PLAN_FILE, readPlan, STOP_MINUTES, TARGET_MINUTES, type LinePlan } from \"./plan.ts\";\nimport { PARTIAL_FILE } from \"./reporter.ts\";\nimport { copyOfFolder, ignoreRules, minimatchOf, removeCopy, sandboxFiles, tempDirOf } from \"./sandbox.ts\";\nimport { failScore, formatScore, packageScore, parsePartial, parseReport, readFaults, partialScore, scoreReport, summaryMarkdown, testFall, testFileFaults, unreadTestFiles, type MutationReport, type Score } from \"./score.ts\";\n\n/** The input and the output of the CLI. */\nexport interface CliIo {\n readonly cwd: string;\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\n /** The environment. With `GITHUB_ACTIONS` set to `true`, `scores` writes an annotation for each score that does not pass and each planned fall. */\n readonly env?: Readonly<Record<string, string | undefined>>;\n}\n\n/** The help text of the CLI. */\nexport const HELP: string = `rigor-mutation: the mutation tests of a repository, with Stryker and a gate for each package.\n\n rigor-mutation list [--runs] [--changed <file>]\n the packages and the parts of the lane. With --runs, the\n selections of a full run: the parts of a package with parts.\n With --changed, only the runs with a changed file.\n rigor-mutation dir <selection> the folder of the package of a selection\n rigor-mutation config <selection> [--out <file>] [--concurrency <n>] [--dry-run | --plan] [--changed <file>]\n the Stryker config of a selection, as JSON. With --dry-run,\n Stryker starts only the tests. With --plan, Stryker also makes\n its plan, writes it into plan.json and stops. With --changed,\n it mutates only the changed files of the selection.\n rigor-mutation scores <selection>... [--report <file> | --reports <dir>] [--summary <file>]\n [--last <file>] [--write-last <file>] [--test-files] [--alone]\n the score of each selection, with its gate and its count\n of tests. --reports reads <dir>/mutation-<selection>/mutation.json.\n A package with \"gateOver\": \"package\" also gets\n the score of its parts together, a no read without all its parts.\n --alone gives no line for the package: the job of one part\n then fails only for a no read. With --last, a fall of the count of more than\n maxTestFall % (default 20) against the file fails. With\n --write-last, the counts of the passed selections go in\n the file. With --test-files, a test file that the run\n starts and that the report does not read fails. With no\n --alone, a package with all its selections named also\n fails for a test file that no report reads, and for an\n entry of \"notRead\" that is not true.\n rigor-mutation plan-check <selection>... [--report <file> | --reports <dir>]\n the estimate of the clock of each selection from its plan.json,\n against \"targetMinutes\" (default 100) and \"stopMinutes\" (default\n 140) at \"planPerClock\" (default 9.8). A selection over the\n target gives a warning. A selection over the stop fails, and so\n does a file over its count of \"staticLimits\". --reports reads\n <dir>/mutation-<selection>/plan.json.\n rigor-mutation costs <run> --reports <dir> write the cost maps of the lane into the file of \"costs\", from\n <dir>/mutation-<selection>/plan.json of each selection of the\n run <run>. A file of the plans with no line gets a map of 0.\n The maps of the other files stay.\n rigor-mutation cost-check [<selection>...] the estimate of the clock of each numbered part of a group of\n \"cuts\" under the cost maps. A part over \"targetMinutes\" fails.\n No selection checks each numbered part of the lane.\n rigor-mutation minutes the target and the stop of the lane, as the lines\n target=<minutes> and stop=<minutes> for GITHUB_OUTPUT.\n rigor-mutation disables [--write] compare the disable comments with their list\n rigor-mutation load-check [<selection>...] [--collect] [--runner <file>]\n refuse each relative path of a package that leaves its folder.\n Stryker starts the tests in a copy of the folder, so such a\n path finds no file. No selection checks each package.\n With --collect, the Vitest of each package also loads each\n test file in a copy of the folder, as Stryker does. A file\n that does not load, has no test or that no selection\n starts fails, and so does a computed dynamic import that\n \"computedImports\" does not name. With --runner, the\n version and the path of each Vitest go in the file.\n\n --lane <file> the lane file. The default is mutation.json.\n --changed <file> a file with one changed path on each line, from the folder of the lane file,\n for example the output of git diff --name-only. A changed test file selects\n its source file of the same name.\n\nA selection is a package (\"collections\"), a part of a package (\"collections.impl\"), a group of\n\"cuts\" (\"collections.base\") or a numbered part of a group (\"collections.base.2\"). The cost maps\ncut a group into numbered parts of near the same cost. A part ends on a closing line or at the end\nof a file. Each file of a package with parts must be in exactly one part or group. list --runs, and config and scores\nof a part, fail when it is not.\nThe score of a selection reads <dir>/${REPORT_DIR}/mutation.json, or the file of --report.\n`;\n\nconst SOURCE = /\\.(?:[cm]?[jt]s|tsx)$/;\nconst TEST = /\\.(?:test|spec)\\.[^.]+$/;\nconst SKIP = new Set([\"node_modules\", \"build\", \"dist\", \"reports\", \"coverage\"]);\n\n/**\n * This function gives each source file of a folder, from `root`, with `/`. It skips the outputs and the dot folders,\n * and the tests when `tests` is false.\n */\nfunction sourcesOf(root: string, dir: string, tests = false): string[] {\n return readdirSync(dir, { withFileTypes: true })\n .toSorted((x, y) => x.name.localeCompare(y.name))\n .flatMap((e) => {\n const path = resolve(dir, e.name);\n if (e.isDirectory()) return e.name.startsWith(\".\") || SKIP.has(e.name) ? [] : sourcesOf(root, path, tests);\n return e.isFile() && SOURCE.test(e.name) && (tests || !TEST.test(e.name)) ? [relative(root, path).replaceAll(\"\\\\\", \"/\")] : [];\n });\n}\n\n/** The script of `load-check --collect`. It is beside this file, in the source and in the build. */\nconst COLLECT_SCRIPT = fileURLToPath(new URL(import.meta.url.endsWith(\".ts\") ? \"./collect.ts\" : \"./collect.js\", import.meta.url));\n\n/**\n * This function starts the collect of Vitest in a copy of the folder `dir`, in a new process. The copy takes the files\n * that Stryker copies to its sandbox. The function gives the collect, or the reason when the process gives no collect.\n *\n * @param selections - the mutated files of each selection, from `dir`\n * @param config - the Stryker config of the package, for its ignore rules\n */\nfunction collectIn(dir: string, vitestConfig: string | undefined, selections: Readonly<Record<string, readonly string[]>>, config: Readonly<Record<string, unknown>>): Collected | string {\n const Minimatch = minimatchOf(dir);\n if (typeof Minimatch === \"string\") return Minimatch;\n const tmp = mkdtempSync(join(tmpdir(), \"rigor-mutation-collect-\"));\n try {\n const copy = copyOfFolder(dir, sandboxFiles(dir, ignoreRules(config), Minimatch), tempDirOf(config));\n try {\n const out = join(tmp, \"collected.json\");\n const request: CollectRequest = { dir: copy, ...(vitestConfig === undefined ? {} : { config: vitestConfig }), selections };\n writeFileSync(join(tmp, \"request.json\"), JSON.stringify(request));\n const r = spawnSync(process.execPath, [COLLECT_SCRIPT, join(tmp, \"request.json\"), out], { cwd: copy, encoding: \"utf8\", maxBuffer: 64 * 1024 * 1024 });\n // Vitest sets the exit code 1 for a file that does not load, so the file of the collect decides, not the code.\n if (!existsSync(out)) {\n const why = (r.error?.message ?? `${r.stdout}${r.stderr}`).trim().split(\"\\n\").slice(-5).join(\" \");\n return `the collect of Vitest exited with ${String(r.status)}: ${why}`;\n }\n return JSON.parse(readFileSync(out, \"utf8\")) as Collected;\n } finally {\n removeCopy(copy);\n }\n } finally {\n rmSync(tmp, { recursive: true, force: true });\n }\n}\n\n/** The options of `load-check`. */\ninterface LoadCheckOptions {\n /** With true, Vitest also collects each test file of each package (`--collect`). */\n readonly collect: boolean;\n /** The file for the version and the path of the Vitest of each package (`--runner`). */\n readonly runner: string | undefined;\n}\n\n/**\n * This function gives the faults of the collect of a package (`load-check --collect`). A test file that does not load\n * is a fault. A test file that no selection starts is a fault (LANE.FILES). A computed dynamic import that the lane\n * does not name is a fault.\n */\nfunction collectCheck(lane: Lane, laneDir: string, pkg: string, files: readonly PackageFile[]): { readonly faults: string[]; readonly collected: Collected | undefined } {\n const p = lane.packages[pkg];\n if (p === undefined) return { faults: [], collected: undefined };\n const own = packageRuns(lane, pkg).map((n) => selectIn(lane, laneDir, n));\n const sources = files.map((f) => f.file).filter((f) => !TEST.test(f));\n const mutated = Object.fromEntries(own.map((s) => [s.name, sources.filter((f) => globsSelect(s.mutate, f))]));\n const config = own[0] === undefined ? {} : strykerConfig(own[0]);\n const collected = collectIn(resolve(laneDir, p.dir), p.vitestConfig, mutated, config);\n const computed = computedImports(files, p.vitestConfig);\n const allowed = p.computedImports ?? {};\n const faults = [\n ...computed.filter((c) => allowed[c.file] === undefined).map((c) => `${c.file}:${String(c.line)}: a dynamic import with a computed path. The related mode of Vitest does not follow it, so a test file that reaches the mutated files only through it starts in no selection. Import the file by its path, or give the reason in \"computedImports\"`),\n ...Object.keys(allowed).filter((f) => !computed.some((c) => c.file === f)).map((f) => `\"computedImports\" is not true: ${f} has no dynamic import with a computed path that the run loads`),\n ];\n if (typeof collected === \"string\") return { faults: [collected, ...faults], collected: undefined };\n const onDisk = files.map((f) => f.file).filter((f) => TEST.test(f));\n const started = new Set(own.flatMap((s) => (runsAllTests(s) ? onDisk : (collected.selections[s.name] ?? []))));\n const { unread, stale } = readFaults(started, onDisk, p.notRead);\n faults.push(\n ...collectFaults(collected),\n ...unread.map((f) => `${f}: no selection starts the file, and \"notRead\" does not give its reason`),\n ...stale.map((f) => `\"notRead\" is not true: ${f} is not on the disk, or a selection starts it`),\n );\n return { faults, collected };\n}\n\n/** This function checks the relative paths of the package of each selection, and with `--collect`, the load of each test file (`load-check`). */\nfunction loadCheck(lane: Lane, laneDir: string, names: readonly string[], io: CliIo, options: LoadCheckOptions): number {\n const pkgs = [...new Set((names.length === 0 ? Object.keys(lane.packages) : names.map((n) => select(lane, n).pkg)))];\n let failed = 0;\n let unread = 0;\n const runners: Record<string, { version: string; path: string }> = {};\n for (const pkg of pkgs) {\n const s = select(lane, pkg);\n const dir = resolve(laneDir, s.dir);\n if (!existsSync(dir)) throw new Error(`${pkg}: the folder ${s.dir} does not exist`);\n const files = sourcesOf(dir, dir, true)\n .filter((f) => !f.endsWith(\".d.ts\"))\n .map((file) => ({ file, text: readFileSync(resolve(dir, file), \"utf8\") }));\n const found = leavingPaths(files, s.vitestConfig);\n for (const p of found) {\n io.stderr(`${s.dir}/${p.file}:${String(p.line)}: \"${p.path}\" leaves the folder ${s.dir}. In the copy of Stryker it finds no file.\n`);\n }\n if (found.length === 0) io.stdout(`load-check ${pkg}: ${String(files.length)} files, no relative path leaves ${s.dir}\n`);\n else failed += 1;\n if (!options.collect) continue;\n const { faults, collected } = collectCheck(lane, laneDir, pkg, files);\n for (const fault of faults) io.stderr(`${s.dir}: ${fault}\\n`);\n if (collected !== undefined) {\n runners[pkg] = { version: collected.version, path: collected.path };\n if (faults.length === 0) io.stdout(`load-check ${pkg}: Vitest ${collected.version} loads ${String(collected.files.length)} test files in a copy of ${s.dir}, and the selections start each one\\n`);\n }\n if (faults.length > 0) unread += 1;\n }\n if (options.runner !== undefined) {\n const file = resolve(io.cwd, options.runner);\n mkdirSync(dirname(file), { recursive: true });\n writeFileSync(file, `${JSON.stringify(runners, null, 2)}\\n`);\n }\n if (failed > 0) io.stderr(`load-check: ${String(failed)} packages have a relative path that leaves their folder. Import the file from its package, or move it into the folder.\n`);\n if (unread > 0) io.stderr(`No read: ${String(unread)} packages have a test file that Vitest does not load, that holds no test, or that no selection starts. A mutant that only this file detects survives, so a score of the package is not a reading.\n`);\n return failed > 0 || unread > 0 ? 1 : 0;\n}\n\nconst readJson = (file: string): unknown => JSON.parse(readFileSync(file, \"utf8\"));\n\n/**\n * This function gives the major version of the `typescript` that the folder `dir` resolves, or undefined when the\n * folder resolves none. In a usual install, Stryker resolves the same version, because it starts in that folder.\n */\nfunction typescriptMajor(dir: string): number | undefined {\n let file: string;\n try {\n file = createRequire(join(dir, \"package.json\")).resolve(\"typescript/package.json\");\n } catch {\n return undefined;\n }\n const version: unknown = (readJson(file) as { version?: unknown }).version;\n const major = typeof version === \"string\" ? Number.parseInt(version, 10) : Number.NaN;\n return Number.isInteger(major) ? major : undefined;\n}\n\n/**\n * This function examines the parts of the packages against their source files.\n *\n * @throws Error with each file that is in no part, in more than one part, or in a part and not in `mutate`\n */\n/** This function gives the number of lines of a text. A last line break does not start a line. */\nconst lineCount = (text: string): number => (text === \"\" ? 0 : text.split(\"\\n\").length - (text.endsWith(\"\\n\") ? 1 : 0));\n\n/** This function tells if a file of the package of a selection, from its folder, exists. */\nconst existsIn =\n (laneDir: string, s: Selection) =>\n (file: string): boolean =>\n existsSync(resolve(laneDir, s.dir, file));\n\n/** This function gives the cost maps of the lane, or none when the lane has no file of maps or the file does not exist. */\nfunction costMapsOf(lane: Lane, laneDir: string): CostMaps {\n const file = lane.costs === undefined ? undefined : resolve(laneDir, lane.costs);\n return file === undefined || !existsSync(file) ? {} : parseCostMaps(readJson(file));\n}\n\n/** This function gives the files of a group of a package, in the order of their paths, with the weight of each line. */\nfunction groupFiles(lane: Lane, laneDir: string, pkg: string, globs: readonly string[], maps: CostMaps): WeightedFile[] {\n const dir = resolve(laneDir, lane.packages[pkg]?.dir ?? \".\");\n const texts = sourcesOf(dir, dir)\n .filter((file) => globsSelect(globs, file))\n .map((path) => ({ path, text: readFileSync(resolve(dir, path), \"utf8\") }));\n return weightedFiles(texts, maps[pkg] ?? {});\n}\n\n/** The cut of each lane, so that each command reads the files of a group one time. */\nconst cuts = new WeakMap<Lane, CutOf>();\n\n/** This function gives the selection of a name, with the cut by cost of a numbered part of a group. */\nfunction selectIn(lane: Lane, laneDir: string, name: string): Selection {\n let cutOf = cuts.get(lane);\n if (cutOf === undefined) {\n const maps = costMapsOf(lane, laneDir);\n const parts = new Map<string, string[][]>();\n cutOf = (pkg, cut, globs) => {\n const key = `${pkg}.${cut.group}`;\n const cutParts = parts.get(key) ?? cutByCost(groupFiles(lane, laneDir, pkg, globs, maps), cut.count);\n parts.set(key, cutParts);\n return cutParts[cut.index] ?? [];\n };\n cuts.set(lane, cutOf);\n }\n return select(lane, name, cutOf);\n}\n\nfunction checkParts(lane: Lane, laneDir: string, pkgs: readonly string[]): void {\n const errors = pkgs.flatMap((pkg) => {\n const p = lane.packages[pkg];\n if (p === undefined || (p.parts === undefined && p.cuts === undefined)) return [];\n const dir = resolve(laneDir, p.dir);\n if (!existsSync(dir)) return [`${pkg}: the folder ${p.dir} does not exist`];\n return partErrors(lane, pkg, sourcesOf(dir, dir), (file) => lineCount(readFileSync(resolve(dir, file), \"utf8\")));\n });\n if (errors.length > 0) throw new Error(`the parts do not cover each file exactly one time:\\n ${errors.join(\"\\n \")}`);\n}\n\n/** This function examines the parts of the package of each selection that is a part. */\nconst checkPartsOf = (lane: Lane, laneDir: string, names: readonly string[]): void =>\n checkParts(lane, laneDir, [...new Set(names.map((n) => select(lane, n)).filter((s) => s.name !== s.pkg).map((s) => s.pkg))]);\n\nfunction disables(lane: Lane, laneDir: string, write: boolean, io: CliIo): number {\n const files = new Set<string>();\n for (const [name, p] of Object.entries(lane.packages)) {\n const dir = resolve(laneDir, p.dir);\n if (!existsSync(dir)) throw new Error(`${name}: the folder ${p.dir} does not exist`);\n for (const f of sourcesOf(laneDir, dir)) files.add(f);\n }\n const found = findDisables([...files].map((file) => ({ file, text: readFileSync(resolve(laneDir, file), \"utf8\") })));\n const listFile = resolve(laneDir, lane.disables ?? \"mutation-disables.json\");\n const listed = existsSync(listFile) ? (readJson(listFile) as Disable[]) : [];\n const check = compareDisables(found, listed);\n for (const d of check.noReason) io.stderr(`a disable without a reason after a colon: ${d.file}: ${d.comment}\\n`);\n if (write) {\n if (check.noReason.length > 0) return 1;\n writeFileSync(listFile, `${JSON.stringify(found, null, 2)}\\n`);\n io.stdout(`disables: wrote ${String(found.length)} comments to ${relative(io.cwd, listFile).replaceAll(\"\\\\\", \"/\")}\\n`);\n return 0;\n }\n const perFile = new Map<string, number>();\n for (const d of found) perFile.set(d.file, (perFile.get(d.file) ?? 0) + 1);\n io.stdout(`disables: ${String(found.length)} in ${String(perFile.size)} files\\n`);\n for (const [file, n] of perFile) io.stdout(` ${file}: ${String(n)}\\n`);\n for (const k of check.added) io.stderr(`not in the list: ${k}\\n`);\n for (const k of check.removed) io.stderr(`in the list, not in the sources: ${k}\\n`);\n if (check.added.length > 0 || check.removed.length > 0) {\n io.stderr(\"disables: the sources and the list are not the same. Add each new disable with its reason, or start with --write and examine the diff.\\n\");\n }\n return check.ok ? 0 : 1;\n}\n\n/** The options of `scores`. */\ninterface ScoresOptions {\n readonly report: string | undefined;\n readonly reports: string | undefined;\n readonly summary: string | undefined;\n readonly last: string | undefined;\n readonly writeLast: string | undefined;\n readonly testFiles: boolean;\n /** This field tells if the command gives no score of a package from its parts, for the job of one part. */\n readonly alone?: boolean;\n}\n\n/**\n * This function gives the score of each selection (`scores`). With `last`, it compares the test count with the last\n * good count (LANE.TESTS of Vex). With `testFiles`, it compares the test files that the run starts with the report (LANE.FILES).\n */\nfunction scores(lane: Lane, laneDir: string, names: readonly string[], o: ScoresOptions, io: CliIo): number {\n if (names.length === 0) throw new Error(`\"scores\" takes one or more selections`);\n if (o.report !== undefined && names.length > 1) throw new Error(`--report takes one selection`);\n if (o.report !== undefined && o.reports !== undefined) throw new Error(`\"scores\" takes --report or --reports, not both`);\n checkPartsOf(lane, laneDir, names);\n const lastFile = o.last === undefined ? undefined : resolve(io.cwd, o.last);\n const last = lastFile === undefined || !existsSync(lastFile) ? {} : readCounts(lastFile);\n if (lastFile !== undefined && !existsSync(lastFile)) io.stdout(`scores: the file ${o.last ?? \"\"} does not exist, so no count is compared\n`);\n const notes = new Map<string, string[]>(names.map((n) => [n, []]));\n const note = (name: string, line: string): void => void notes.set(name, [...(notes.get(name) ?? []), line]);\n const reports = new Map<string, MutationReport>();\n const falls: PlannedFall[] = [];\n // The gate of a package with \"gateOver\": \"package\" reads the sum of its parts, so a part has no gate of its own.\n const byPackage = (s: Selection): boolean => s.name !== s.pkg && lane.packages[s.pkg]?.gateOver === \"package\";\n const results: Score[] = names.map((name) => {\n const all = selectIn(lane, laneDir, name);\n const s = byPackage(all) ? { ...all, gate: undefined } : all;\n if (s !== all) note(name, ` the gate of ${s.pkg} reads all its parts together`);\n const file =\n o.reports !== undefined\n ? resolve(io.cwd, o.reports, `mutation-${name}`, \"mutation.json\")\n : o.report === undefined\n ? resolve(laneDir, s.dir, REPORT_DIR, \"mutation.json\")\n : resolve(io.cwd, o.report);\n if (!existsSync(file)) {\n // A time limit stopped Stryker: the reporter rigor-partial wrote the mutants that ran, with the costs.\n const partial = join(dirname(file), PARTIAL_FILE);\n if (existsSync(partial)) return partialScore(parsePartial(readFileSync(partial, \"utf8\")), s);\n const reason = `the report ${relative(io.cwd, file)} does not exist`;\n return { name, gate: s.gate, detected: 0, hitLimit: 0, clockTimeouts: 0, valid: 0, survived: [], percent: 0, percentWithClock: 0, tests: undefined, pass: false, reason, outcome: \"no read\" };\n }\n const report = parseReport(readJson(file));\n reports.set(name, report);\n let score = scoreReport(report, s);\n const before = last[name];\n if (lastFile !== undefined && before !== undefined) {\n if (score.tests === undefined) score = failScore(score, `the report has no \"testFiles\", so the count of the tests is not known`);\n else {\n const fall = testFall(score.tests, before, lane.maxTestFall ?? MAX_TEST_FALL);\n const planned = lane.plannedFalls?.[name];\n if (fall !== undefined && planned === undefined) score = failScore(score, fall);\n else if (fall !== undefined) {\n const text = `${fall.replace(/, so the score is no read$/, \"\")}. The reason: ${planned ?? \"\"}`;\n note(name, ` a planned fall: ${text}`);\n falls.push({ name, text });\n }\n }\n }\n if (o.testFiles) score = checkTestFiles(lane, laneDir, s, report, score, (line) => note(name, line));\n return score;\n });\n const faults = o.testFiles && o.alone !== true ? testFileReasons(lane, laneDir, names, reports, note) : new Map<string, string>();\n const packages = o.alone === true ? [] : names.map((n) => select(lane, n)).filter(byPackage).map((s) => s.pkg);\n const totals = [...new Set(packages)].map((pkg) => {\n const p = lane.packages[pkg];\n const parts = results.filter((r) => select(lane, r.name).pkg === pkg && r.name !== pkg);\n // A no read is never a pass: a part that the command does not name makes the package a no read.\n const missing = packageRuns(lane, pkg).filter((n) => n !== pkg && !names.includes(n));\n return packageScore(pkg, p?.gate, parts, missing);\n });\n // A fault of the test files of a package fails its sum, or each of its selections when it has no sum.\n const withFault = (s: Score, pkg: string): Score => {\n const reason = faults.get(pkg);\n return reason === undefined ? s : failScore(s, reason);\n };\n const summed = new Set(totals.map((t) => t.name));\n const shown = [\n ...results.map((r) => (summed.has(select(lane, r.name).pkg) ? r : withFault(r, select(lane, r.name).pkg))),\n ...totals.map((t) => withFault(t, t.name)),\n ];\n for (const s of shown) {\n io.stdout(`${formatScore(s)}\n`);\n for (const line of notes.get(s.name) ?? []) io.stdout(`${line}\n`);\n if (!s.pass) for (const m of s.survived) io.stdout(` survived: ${m}\n`);\n }\n if (o.summary !== undefined) appendFileSync(resolve(io.cwd, o.summary), `### Mutation scores\n\n${summaryMarkdown(shown)}\n`);\n if (o.writeLast !== undefined) {\n const out = resolve(io.cwd, o.writeLast);\n const counts = { ...(existsSync(out) ? readCounts(out) : {}) };\n for (const s of results) if (s.pass && s.tests !== undefined) counts[s.name] = s.tests;\n mkdirSync(dirname(out), { recursive: true });\n writeFileSync(out, `${JSON.stringify(Object.fromEntries(Object.entries(counts).toSorted(([a], [b]) => (a < b ? -1 : 1))), null, 2)}\n`);\n }\n if (io.env?.[\"GITHUB_ACTIONS\"] === \"true\") for (const line of annotations(shown, falls)) io.stdout(`${line}\n`);\n const failed = shown.filter((s) => !s.pass).map((s) => s.name);\n if (failed.length > 0) io.stderr(`The gate failed for ${failed.join(\", \")}.\n`);\n return failed.length > 0 ? 1 : 0;\n}\n\n/**\n * This function examines the test files of each package whose selections the command names in full, over all their\n * reports (LANE.FILES). A part starts only its related test files, so one part does not show a test file that no part\n * reads. The function gives the reason of the fault of each package, and notes each file.\n */\nfunction testFileReasons(lane: Lane, laneDir: string, names: readonly string[], reports: ReadonlyMap<string, MutationReport>, note: (name: string, line: string) => void): Map<string, string> {\n const reasons = new Map<string, string>();\n for (const [pkg, p] of Object.entries(lane.packages)) {\n const own = packageRuns(lane, pkg);\n const read = own.flatMap((n) => reports.get(n) ?? []);\n // A selection that is not named, or that has no full report, is a no read already.\n if (!own.every((n) => names.includes(n)) || read.length < own.length) continue;\n // The notes go under the sum of the package, or else under its last selection.\n const at = own[0] === pkg || p.gateOver === \"package\" ? pkg : (own.at(-1) ?? pkg);\n // A report with no \"testFiles\" fails its own selection. The note tells that the check over the parts did not run.\n const blind = own.filter((n) => reports.get(n)?.testFiles === undefined);\n if (blind.length > 0) {\n note(at, ` the test files of ${pkg} over all its selections are not known: the reports of ${blind.join(\", \")} have no \"testFiles\"`);\n continue;\n }\n const dir = resolve(laneDir, p.dir);\n const onDisk = sourcesOf(dir, dir, true).filter((f) => TEST.test(f) && !f.endsWith(\".d.ts\"));\n const { unread, stale } = testFileFaults(read, onDisk, p.notRead, dir);\n for (const f of unread) note(at, ` read by no selection: ${p.dir}/${f}`);\n for (const f of stale) note(at, ` \"notRead\" is not true: ${p.dir}/${f}`);\n const parts: string[] = [];\n if (unread.length > 0) parts.push(`no selection reads ${String(unread.length)} test files, and \"notRead\" does not give their reason`);\n if (stale.length > 0) parts.push(`${String(stale.length)} entries of \"notRead\" name a file that is not on the disk or that a report reads`);\n if (parts.length > 0) reasons.set(pkg, `the test files of ${pkg}: ${parts.join(\". Also, \")}`);\n }\n return reasons;\n}\n\n/** A fall of the test count that the lane plans, with its text. The score passes, and its annotation tells the fall. */\ninterface PlannedFall {\n readonly name: string;\n readonly text: string;\n}\n\n/**\n * This function gives a warning annotation for each score that does not pass and each planned fall. The annotation is on\n * the check line, so a no read is not a green check with the reason only in the log. This is true also for a run that\n * only reports. The title of a no read gives the count of the no reads and of the selections.\n */\nfunction annotations(results: readonly Score[], falls: readonly PlannedFall[]): string[] {\n const noReads = results.filter((s) => !s.pass && s.outcome !== \"block\");\n const line = (title: string, message: string): string => `::warning title=${escapeWorkflowProperty(title)}::${escapeWorkflowData(message)}`;\n return [\n ...noReads.map((s) => line(`Mutation gate: no read, ${String(noReads.length)} of ${String(results.length)} selections`, `${s.name}: ${s.reason ?? \"\"}`)),\n ...results.filter((s) => !s.pass && s.outcome === \"block\").map((s) => line(\"Mutation gate: under the gate\", `${s.name}: ${s.reason ?? \"\"}`)),\n ...falls.map((f) => line(\"Mutation gate: a planned fall of the tests\", `${f.name}: ${f.text}`)),\n ];\n}\n\n/** The options of `plan-check`. */\ninterface PlanCheckOptions {\n readonly report: string | undefined;\n readonly reports: string | undefined;\n}\n\n/**\n * This function reads the plan of each selection (`plan-check`). It gives the estimate of the clock of each selection.\n * It warns of a selection over its target. It fails a selection over its stop or with no plan, and a file over its\n * limit of static runs.\n */\nfunction planCheck(lane: Lane, laneDir: string, names: readonly string[], o: PlanCheckOptions, io: CliIo): number {\n if (names.length === 0) throw new Error(`\"plan-check\" takes one or more selections`);\n if (o.report !== undefined && names.length > 1) throw new Error(`--report takes one selection`);\n if (o.report !== undefined && o.reports !== undefined) throw new Error(`\"plan-check\" takes --report or --reports, not both`);\n let failed = 0;\n let warned = 0;\n const actions = io.env?.[\"GITHUB_ACTIONS\"] === \"true\";\n for (const name of names) {\n const s = select(lane, name);\n const file =\n o.reports !== undefined\n ? resolve(io.cwd, o.reports, `mutation-${name}`, PLAN_FILE)\n : o.report === undefined\n ? resolve(laneDir, s.dir, REPORT_DIR, PLAN_FILE)\n : resolve(io.cwd, o.report);\n if (!existsSync(file)) {\n failed += 1;\n io.stdout(`${name}: FAIL: there is no plan at ${relative(io.cwd, file).replaceAll(\"\\\\\", \"/\")}. Start Stryker with the config of \"config --plan\".\\n`);\n continue;\n }\n const limits = lane.packages[s.pkg]?.staticLimits;\n const read = readPlan(name, parsePlan(readJson(file)), {\n ...(lane.planPerClock === undefined ? {} : { planPerClock: lane.planPerClock }),\n ...(lane.targetMinutes === undefined ? {} : { targetMinutes: lane.targetMinutes }),\n ...(lane.stopMinutes === undefined ? {} : { stopMinutes: lane.stopMinutes }),\n ...(limits === undefined ? {} : { staticLimits: limits }),\n });\n io.stdout(`${read.line}\\n${read.warnings.map((w) => ` WARN: ${w}\\n`).join(\"\")}${read.faults.map((f) => ` FAIL: ${f}\\n`).join(\"\")}`);\n // The estimate has an error of 28 minutes in the mean, so a selection over its target gives a warning with a mark.\n if (actions) for (const w of read.warnings) io.stdout(`::warning title=${escapeWorkflowProperty(\"Mutation plan: over the target\")}::${escapeWorkflowData(w)}\\n`);\n if (read.warnings.length > 0) warned += 1;\n if (read.faults.length > 0) failed += 1;\n }\n const over = warned === 0 ? \"\" : `, and ${String(warned)} of them are over the target`;\n io.stdout(failed === 0 ? `plan-check: each plan of ${String(names.length)} selections is in its limits${over}\\n` : `plan-check: ${String(failed)} of ${String(names.length)} selections fail${over}\\n`);\n return failed === 0 ? 0 : 1;\n}\n\n/**\n * This function writes the cost maps of the lane from the plans of a run (`costs`). It adds the plan lines of each file\n * over the selections, so a file in two parts gets one map. A file that a selection mutates with no plan gets a map of\n * 0. The maps of the files of the other selections stay.\n */\nfunction writeCosts(lane: Lane, laneDir: string, run: string, reports: string | undefined, io: CliIo): number {\n if (lane.costs === undefined) throw new Error(`the lane has no field \"costs\" for the file of the cost maps`);\n if (reports === undefined) throw new Error(`\"costs\" takes --reports <dir>`);\n const lines = new Map<string, Map<string, LinePlan[]>>();\n const read: string[] = [];\n for (const name of selectionNames(lane)) {\n const file = resolve(io.cwd, reports, `mutation-${name}`, PLAN_FILE);\n if (!existsSync(file)) continue;\n read.push(name);\n const s = selectIn(lane, laneDir, name);\n const dir = resolve(laneDir, s.dir);\n const files = lines.get(s.pkg) ?? new Map<string, LinePlan[]>();\n lines.set(s.pkg, files);\n for (const source of sourcesOf(dir, dir).filter((f) => globsSelect(s.mutate, f))) files.set(source, files.get(source) ?? []);\n for (const [source, plan] of Object.entries(parsePlan(readJson(file)).files)) files.set(source, [...(files.get(source) ?? []), ...plan.lines]);\n }\n if (read.length === 0) throw new Error(`there is no plan of a selection of the lane in ${reports}`);\n const maps: Record<string, Record<string, CostMap>> = Object.fromEntries(Object.entries(costMapsOf(lane, laneDir)).map(([pkg, files]) => [pkg, { ...files }]));\n let count = 0;\n for (const [pkg, files] of lines) {\n const dir = resolve(laneDir, lane.packages[pkg]?.dir ?? \".\");\n const own = maps[pkg] ?? {};\n maps[pkg] = own;\n for (const [source, plan] of files) {\n if (!existsSync(resolve(dir, source))) continue;\n own[source] = costMapOf(readFileSync(resolve(dir, source), \"utf8\"), run, plan);\n count += 1;\n }\n }\n const sorted = (x: Readonly<Record<string, unknown>>): Record<string, unknown> => Object.fromEntries(Object.entries(x).toSorted(([a], [b]) => a.localeCompare(b)));\n const out = resolve(laneDir, lane.costs);\n mkdirSync(dirname(out), { recursive: true });\n writeFileSync(out, `${JSON.stringify(sorted(Object.fromEntries(Object.entries(maps).map(([pkg, files]) => [pkg, sorted(files)]))), null, 2)}\\n`);\n io.stdout(`costs: ${String(count)} files from the plans of ${String(read.length)} selections of the run ${run}, in ${relative(io.cwd, out).replaceAll(\"\\\\\", \"/\")}\\n`);\n return 0;\n}\n\n/**\n * This function gives the estimate of the clock of each numbered part of a group under the cost maps (`cost-check`).\n * A part over the target fails, and so does a group with no cost map. The check reads only the files on the disk, so\n * each commit gives one result.\n */\nfunction costCheck(lane: Lane, laneDir: string, names: readonly string[], io: CliIo): number {\n const all = runSelections(lane).filter((n) => select(lane, n).cut !== undefined);\n const named = names.length === 0 ? all : names;\n const maps = costMapsOf(lane, laneDir);\n const target = lane.targetMinutes ?? TARGET_MINUTES;\n let failed = 0;\n for (const name of named) {\n const s = selectIn(lane, laneDir, name);\n if (s.cut === undefined) throw new Error(`the selection ${name} is not a numbered part of a group of \"cuts\"`);\n const group = lane.packages[s.pkg]?.cuts?.[s.cut.group];\n const not = (lane.packages[s.pkg]?.mutate ?? []).filter((g) => g.startsWith(\"!\"));\n const files = groupFiles(lane, laneDir, s.pkg, [...(group?.files ?? []), ...not], maps);\n const entries = s.mutate.filter((g) => !g.startsWith(\"!\"));\n const minutes = clockMinutes(plannedMs(entries, files), lane.planPerClock);\n const mapped = files.some((f) => maps[s.pkg]?.[f.path] !== undefined);\n const fault = !mapped\n ? `the group ${s.pkg}.${s.cut.group} has no cost map. Write the maps with \"costs\" from the plans of a run.`\n : minutes > target\n ? `the estimate of ${minutes.toFixed(0)} minutes is over the target of ${String(target)}. Raise the count of the group ${s.pkg}.${s.cut.group}.`\n : undefined;\n io.stdout(`${name}: ${String(entries.length)} entries, with an estimate of ${minutes.toFixed(0)} minutes of the clock under the cost maps.${fault === undefined ? \"\" : `\\n FAIL: ${fault}`}\\n`);\n if (fault !== undefined) failed += 1;\n }\n io.stdout(failed === 0 ? `cost-check: each of ${String(named.length)} parts is in its target\\n` : `cost-check: ${String(failed)} of ${String(named.length)} parts fail\\n`);\n return failed === 0 ? 0 : 1;\n}\n\n/** This function reads a file of test counts: an object from each selection to its count. */\nfunction readCounts(file: string): Record<string, number> {\n const json = readJson(file);\n const ok = typeof json === \"object\" && json !== null && !Array.isArray(json) && Object.values(json).every((n) => Number.isInteger(n) && (n as number) >= 0);\n if (!ok) throw new Error(`the file ${file} is not an object of test counts`);\n return json as Record<string, number>;\n}\n\n/** This function tells if the Vitest runner of a selection starts all the tests: the lane sets `vitest.related` to false. */\nfunction runsAllTests(s: Selection): boolean {\n const vitest = s.stryker?.[\"vitest\"];\n return typeof vitest === \"object\" && vitest !== null && (vitest as Record<string, unknown>)[\"related\"] === false;\n}\n\n/**\n * This function fails a score when the report does not read a test file that the run starts. The related mode of the\n * Vitest runner starts each test file that loads a file of the selection (LANE.FILES). So a part does not start the\n * test files of the other parts. With `vitest.related` false, the run starts each test file on the disk.\n */\nfunction checkTestFiles(lane: Lane, laneDir: string, s: Selection, report: MutationReport, score: Score, note: (line: string) => void): Score {\n const p = lane.packages[s.pkg];\n if (p === undefined) return score;\n const dir = resolve(laneDir, p.dir);\n if (report.testFiles === undefined) return failScore(score, `the report has no \"testFiles\", so the test files that it read are not known`);\n const files = sourcesOf(dir, dir, true).filter((f) => !f.endsWith(\".d.ts\"));\n const onDisk = files.filter((f) => TEST.test(f));\n const started = runsAllTests(s)\n ? onDisk\n : relatedTestFiles(\n files.map((file) => ({ file, text: readFileSync(resolve(dir, file), \"utf8\") })),\n (file) => globsSelect(s.mutate, file),\n );\n const unread = unreadTestFiles(report, started, p.notRead, dir);\n for (const f of unread) note(` not read: ${p.dir}/${f}`);\n if (unread.length === 0) return score;\n return failScore(score, `the report does not read ${String(unread.length)} test files that the run starts. Each one is no read, unless \"notRead\" of the package gives its reason`);\n}\n\n/** This function starts the CLI with its arguments and gives the exit code. */\nexport function runCli(argv: readonly string[], io: CliIo): number {\n const { values, positionals } = parseArgs({\n args: [...argv],\n allowPositionals: true,\n options: {\n lane: { type: \"string\", default: \"mutation.json\" },\n out: { type: \"string\" },\n concurrency: { type: \"string\" },\n report: { type: \"string\" },\n reports: { type: \"string\" },\n summary: { type: \"string\" },\n write: { type: \"boolean\", default: false },\n runs: { type: \"boolean\", default: false },\n \"dry-run\": { type: \"boolean\", default: false },\n plan: { type: \"boolean\", default: false },\n changed: { type: \"string\" },\n last: { type: \"string\" },\n \"write-last\": { type: \"string\" },\n \"test-files\": { type: \"boolean\", default: false },\n alone: { type: \"boolean\", default: false },\n collect: { type: \"boolean\", default: false },\n runner: { type: \"string\" },\n help: { type: \"boolean\", default: false },\n },\n });\n const [command, ...names] = positionals;\n if (values.help || command === undefined) {\n io.stdout(HELP);\n return command === undefined && !values.help ? 1 : 0;\n }\n const laneFile = resolve(io.cwd, values.lane);\n const laneDir = dirname(laneFile);\n const lane = parseLane(readJson(laneFile));\n const changed =\n values.changed === undefined\n ? undefined\n : readFileSync(resolve(io.cwd, values.changed), \"utf8\")\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\");\n const one = (): string => {\n if (names.length !== 1 || names[0] === undefined) throw new Error(`\"${command}\" takes one selection`);\n return names[0];\n };\n switch (command) {\n case \"list\": {\n if (values.runs) checkParts(lane, laneDir, Object.keys(lane.packages));\n if (changed !== undefined && !values.runs) throw new Error(`--changed of \"list\" takes --runs`);\n const runs = values.runs ? runSelections(lane) : selectionNames(lane);\n const shown = changed === undefined ? runs : runs.filter((n) => changedFiles(selectIn(lane, laneDir, n), changed, existsIn(laneDir, select(lane, n))).length > 0);\n io.stdout(shown.length === 0 ? \"\" : `${shown.join(\"\\n\")}\\n`);\n return 0;\n }\n case \"dir\":\n io.stdout(`${relative(io.cwd, resolve(laneDir, select(lane, one()).dir)).replaceAll(\"\\\\\", \"/\") || \".\"}\\n`);\n return 0;\n case \"config\": {\n const concurrency = values.concurrency === undefined ? undefined : Number(values.concurrency);\n if (concurrency !== undefined && !(Number.isInteger(concurrency) && concurrency > 0)) throw new Error(`--concurrency is not a positive integer`);\n if (values[\"dry-run\"] && values.plan) throw new Error(`\"config\" takes --dry-run or --plan, not both`);\n checkPartsOf(lane, laneDir, [one()]);\n const all = selectIn(lane, laneDir, one());\n const files = changed === undefined ? undefined : changedFiles(all, changed, existsIn(laneDir, all));\n if (files?.length === 0) throw new Error(`the selection ${all.name} has no changed file`);\n const selection = files === undefined ? all : { ...all, mutate: files };\n const tsconfigRewrite = rewritesTsconfig(typescriptMajor(resolve(laneDir, all.dir)));\n const options = { ...(concurrency === undefined ? {} : { concurrency }), dryRun: values[\"dry-run\"], plan: values.plan, tsconfigRewrite };\n const text = `${JSON.stringify(strykerConfig(selection, options), null, 2)}\\n`;\n if (values.out === undefined) io.stdout(text);\n else {\n mkdirSync(dirname(resolve(io.cwd, values.out)), { recursive: true });\n writeFileSync(resolve(io.cwd, values.out), text);\n }\n return 0;\n }\n case \"scores\":\n return scores(lane, laneDir, names, { report: values.report, reports: values.reports, summary: values.summary, last: values.last, writeLast: values[\"write-last\"], testFiles: values[\"test-files\"], alone: values.alone }, io);\n case \"plan-check\":\n return planCheck(lane, laneDir, names, { report: values.report, reports: values.reports }, io);\n case \"costs\":\n return writeCosts(lane, laneDir, one(), values.reports, io);\n case \"cost-check\":\n return costCheck(lane, laneDir, names, io);\n case \"minutes\":\n io.stdout(`target=${String(lane.targetMinutes ?? TARGET_MINUTES)}\\nstop=${String(lane.stopMinutes ?? STOP_MINUTES)}\\n`);\n return 0;\n case \"disables\":\n return disables(lane, laneDir, values.write, io);\n case \"load-check\":\n return loadCheck(lane, laneDir, names, io, { collect: values.collect, runner: values.runner });\n default:\n io.stderr(`unknown command \"${command}\"\\n\\n${HELP}`);\n return 1;\n }\n}\n"],"mappings":";;;;;;;;;;;AAyEA,MAAa,gBAAmC;CAAC;CAAU;CAAc;CAAgB;CAAgB;CAAa;AAAsB;AAuD5I,MAAM,OAAO;;AAGb,MAAM,QAAQ;AAEd,MAAM,YAAY,MAA6C,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,MAAM,QAAQ,CAAC;;AAGtH,MAAM,aAAa,MAA4C,SAAS,CAAC,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,MAAM,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,EAAE;AAEpJ,MAAM,WAAW,MAA8B,MAAM,QAAQ,CAAC,KAAK,EAAE,SAAS,KAAK,EAAE,OAAO,MAAM,OAAO,MAAM,YAAY,MAAM,EAAE;;AAGnI,SAAS,cAAc,MAAc,GAAsB;CACzD,IAAI,CAAC,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,qBAAqB,KAAK,4DAA4D;CACpH,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,GAAG,KAAK,+BAA+B;CACjE,MAAM,SAAmB,CAAC;CAC1B,IAAI,OAAO,EAAE,WAAW,YAAY,EAAE,WAAW,IAAI,OAAO,KAAK,GAAG,KAAK,6BAA6B;CACtG,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,KAAK,GAAG,KAAK,kCAAkC;MAC5E,IAAI,EAAE,SAAS,CAAC,OAAO,MAAM,EAAE,WAAW,GAAG,CAAC,GAAG,OAAO,KAAK,GAAG,KAAK,8BAA8B;CACxG,MAAM,OAAO,EAAE;CACf,MAAM,WAAW,EAAE;CACnB,IAAI,aAAa,KAAA,KAAa,aAAa,UAAU,aAAa,WAAW,OAAO,KAAK,GAAG,KAA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