mutant-cafe 0.1.5 → 0.1.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.
package/dist/bin.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../cli/src/bin.ts", "../../core/src/Config.ts", "../../core/src/Errors.ts", "../../core/src/Mutant.ts", "../../core/src/Services.ts", "../../engine/src/index.ts", "../../engine/src/Generate.ts", "../../engine/src/TypeScriptOracle.ts", "../../runner/src/Scratch.ts", "../../runner/src/TestRunner.ts", "../../runner/src/Preflight.ts", "../../runner/src/Run.ts", "../../cli/src/Command.ts", "../../cli/src/Diff.ts", "../../cli/src/ExitCode.ts", "../../cli/src/Reporter.ts", "../../cli/src/UnifiedDiff.ts", "../../cli/src/Summary.ts", "../../cli/src/Git.ts"],
4
- "sourcesContent": ["#!/usr/bin/env -S node --experimental-strip-types\nimport * as NodeRuntime from \"@effect/platform-node/NodeRuntime\";\nimport * as NodeServices from \"@effect/platform-node/NodeServices\";\nimport { MutantSourceLive } from \"@mutant-cafe/engine\";\nimport { runMutants, ScratchLive, TestRunnerLive } from \"@mutant-cafe/runner\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Stream from \"effect/Stream\";\n\nimport { runCli, type Run } from \"./Command.ts\";\n\nconst run: Run = (config, mutants) => runMutants(config, Stream.fromIterable(mutants));\n\nconst live = Layer.mergeAll(MutantSourceLive, ScratchLive, TestRunnerLive).pipe(\n Layer.provideMerge(NodeServices.layer)\n);\n\nconst main = Effect.gen(function* () {\n const code = yield* runCli({ root: process.cwd(), args: process.argv.slice(2), run });\n yield* Effect.sync(() => {\n process.exitCode = code;\n });\n}).pipe(Effect.provide(live));\n\nNodeRuntime.runMain(main);\n", "import * as Schema from \"effect/Schema\";\n\nexport const RunConfig = Schema.Struct({\n root: Schema.String,\n tsconfig: Schema.String,\n include: Schema.Array(Schema.String),\n exclude: Schema.Array(Schema.String),\n functionFilter: Schema.Array(Schema.String),\n inDiff: Schema.optional(Schema.String),\n exportedOnly: Schema.optional(Schema.Boolean),\n jobs: Schema.Int,\n timeoutMs: Schema.optional(Schema.Int),\n timeoutMultiplier: Schema.Finite,\n minimumTimeoutMs: Schema.Int,\n neverTimeoutMs: Schema.Int,\n outDir: Schema.String,\n});\nexport type RunConfig = typeof RunConfig.Type;\n\nexport const ConfigFile = Schema.Struct({\n include: Schema.optional(Schema.Array(Schema.String)),\n exclude: Schema.optional(Schema.Array(Schema.String)),\n functionFilter: Schema.optional(Schema.Array(Schema.String)),\n jobs: Schema.optional(Schema.Int),\n timeoutMultiplier: Schema.optional(Schema.Finite),\n minimumTimeoutMs: Schema.optional(Schema.Int),\n});\nexport type ConfigFile = typeof ConfigFile.Type;\n", "import * as Schema from \"effect/Schema\";\n\nexport class ProgramLoadError extends Schema.TaggedError<ProgramLoadError>()(\"ProgramLoadError\", {\n tsconfig: Schema.String,\n reason: Schema.optional(Schema.Literal(\"selection\")),\n diagnostics: Schema.Array(Schema.String),\n}) {}\n\nexport class BaselineFailed extends Schema.TaggedError<BaselineFailed>()(\"BaselineFailed\", {\n exitCode: Schema.Int,\n command: Schema.Array(Schema.String),\n output: Schema.String,\n}) {}\n\nexport class ScratchError extends Schema.TaggedError<ScratchError>()(\"ScratchError\", {\n operation: Schema.String,\n path: Schema.String,\n message: Schema.String,\n}) {}\n\nexport class TestSpawnError extends Schema.TaggedError<TestSpawnError>()(\"TestSpawnError\", {\n command: Schema.Array(Schema.String),\n message: Schema.String,\n}) {}\n\nexport class DiffParseError extends Schema.TaggedError<DiffParseError>()(\"DiffParseError\", {\n path: Schema.String,\n message: Schema.String,\n}) {}\n\nexport class ReportWriteError extends Schema.TaggedError<ReportWriteError>()(\"ReportWriteError\", {\n path: Schema.String,\n message: Schema.String,\n}) {}\n", "import * as Schema from \"effect/Schema\";\n\nexport const Genre = Schema.Literals([\n \"EffectSucceed\",\n \"EffectFail\",\n \"SwallowTag\",\n \"TagToDefect\",\n \"EffectDie\",\n \"EffectNever\",\n \"OptionNone\",\n \"OptionSome\",\n \"StreamEmpty\",\n \"StreamOne\",\n \"StreamFail\",\n \"LayerFail\",\n \"LayerDie\",\n \"SchemaAcceptAnything\",\n \"BooleanFlip\",\n \"LiteralCycle\",\n \"FnValue\",\n]);\nexport type Genre = typeof Genre.Type;\n\nexport const Span = Schema.Struct({\n start: Schema.Struct({ line: Schema.Int, column: Schema.Int }),\n end: Schema.Struct({ line: Schema.Int, column: Schema.Int }),\n});\nexport type Span = typeof Span.Type;\n\nexport const Replacement = Schema.Struct({\n startOffset: Schema.Int,\n endOffset: Schema.Int,\n text: Schema.String,\n});\nexport type Replacement = typeof Replacement.Type;\n\nexport const Mutant = Schema.Struct({\n id: Schema.String,\n file: Schema.String,\n functionName: Schema.String,\n returnType: Schema.String,\n displayReturnType: Schema.optional(Schema.String),\n genre: Genre,\n description: Schema.String,\n span: Span,\n replacement: Replacement,\n synthetic: Schema.Boolean,\n});\nexport type Mutant = typeof Mutant.Type;\n\nexport const Outcome = Schema.Literals([\"caught\", \"missed\", \"unviable\", \"timeout\", \"untested\", \"unreliable\"]);\nexport type Outcome = typeof Outcome.Type;\n\nexport const MutantResult = Schema.Struct({\n mutant: Mutant,\n outcome: Outcome,\n durationMs: Schema.Int,\n testCommand: Schema.Array(Schema.String),\n diagnostics: Schema.Array(Schema.String),\n output: Schema.optional(Schema.String),\n});\nexport type MutantResult = typeof MutantResult.Type;\n\nexport const SelectionIssue = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"runner\"), reason: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"warning\"), reason: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"target\"), file: Schema.String, reason: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"built\"), files: Schema.optional(Schema.Array(Schema.String)), testFiles: Schema.Array(Schema.String), reason: Schema.String }),\n]);\nexport type SelectionIssue = typeof SelectionIssue.Type;\n\nexport const Baseline = Schema.Struct({\n durationMs: Schema.Int,\n testCommand: Schema.Array(Schema.String),\n unreliable: Schema.optional(Schema.Array(SelectionIssue)),\n});\nexport type Baseline = typeof Baseline.Type;\n\nexport const NotMutated = Schema.Struct({\n // Optional on decode for existing schemaVersion 2 reports; discovery always supplies it.\n span: Schema.optional(Span),\n file: Schema.String,\n functionName: Schema.String,\n reason: Schema.String,\n});\nexport type NotMutated = typeof NotMutated.Type;\n\n// Additive optional fields preserve decoding of schemaVersion 2 reports.\nexport const SelectionCounts = Schema.Struct({\n selected: Schema.Int,\n run: Schema.Int,\n budgetSkipped: Schema.Int,\n});\nexport type SelectionCounts = typeof SelectionCounts.Type;\n\nexport const MutantList = Schema.Struct({\n schemaVersion: Schema.Literal(2),\n tool: Schema.Literal(\"mutant.cafe\"),\n mutants: Schema.Array(Mutant),\n notMutated: Schema.Array(NotMutated),\n counts: SelectionCounts,\n});\nexport type MutantList = typeof MutantList.Type;\n\nexport const RunReport = Schema.Struct({\n selected: Schema.optional(Schema.Int),\n run: Schema.optional(Schema.Int),\n budgetSkipped: Schema.optional(Schema.Int),\n schemaVersion: Schema.Literal(2),\n tool: Schema.Literal(\"mutant.cafe\"),\n root: Schema.String,\n baseline: Baseline,\n timeoutMs: Schema.Int,\n results: Schema.Array(MutantResult),\n failure: Schema.optional(Schema.String),\n notMutated: Schema.optional(Schema.Array(NotMutated)),\n});\nexport type RunReport = typeof RunReport.Type;\n", "import * as Context from \"effect/Context\";\nimport type * as Effect from \"effect/Effect\";\nimport type * as Scope from \"effect/Scope\";\nimport type * as Stream from \"effect/Stream\";\n\nimport type { RunConfig } from \"./Config.ts\";\nimport type {\n BaselineFailed,\n ProgramLoadError,\n ReportWriteError,\n ScratchError,\n TestSpawnError,\n} from \"./Errors.ts\";\nimport type { Baseline, Mutant, MutantResult, NotMutated, RunReport } from \"./Mutant.ts\";\n\nexport type Viability =\n | { readonly viable: boolean; readonly diagnostics: ReadonlyArray<string>; readonly analysisFailed?: never }\n | { readonly viable: false; readonly diagnostics: ReadonlyArray<string>; readonly analysisFailed: NotMutated };\n\nexport class MutantSource extends Context.Service<\n MutantSource,\n {\n readonly notMutated: (config: RunConfig) => Effect.Effect<ReadonlyArray<NotMutated>, ProgramLoadError>;\n readonly generate: (config: RunConfig) => Stream.Stream<Mutant, ProgramLoadError>;\n readonly checkViable: (mutant: Mutant) => Effect.Effect<Viability, ProgramLoadError>;\n }\n>()(\"mutant.cafe/MutantSource\") {}\n\nexport interface ScratchDir {\n readonly path: string;\n readonly apply: (mutant: Mutant) => Effect.Effect<void, ScratchError>;\n readonly revert: (mutant: Mutant) => Effect.Effect<void, ScratchError>;\n}\n\nexport class Scratch extends Context.Service<\n Scratch,\n {\n readonly acquire: (root: string) => Effect.Effect<ScratchDir, ScratchError, Scope.Scope>;\n }\n>()(\"mutant.cafe/Scratch\") {}\n\nexport type TestStatus = \"passed\" | \"failed\" | \"timedOut\" | \"untested\";\n\nexport interface TestRun {\n readonly status: TestStatus;\n readonly durationMs: number;\n readonly command: ReadonlyArray<string>;\n readonly output: string;\n readonly testsCollected?: boolean;\n readonly testFiles?: ReadonlyArray<string>;\n}\n\nexport class TestRunner extends Context.Service<\n TestRunner,\n {\n readonly baseline: (dir: ScratchDir, tsconfig?: string) => Effect.Effect<Baseline, BaselineFailed | TestSpawnError>;\n readonly runRelated: (\n dir: ScratchDir,\n file: string,\n timeoutMs: number\n ) => Effect.Effect<TestRun, TestSpawnError>;\n }\n>()(\"mutant.cafe/TestRunner\") {}\n\nexport class Reporter extends Context.Service<\n Reporter,\n {\n readonly progress: (result: MutantResult) => Effect.Effect<void>;\n readonly write: (report: RunReport) => Effect.Effect<void, ReportWriteError>;\n }\n>()(\"mutant.cafe/Reporter\") {}\n", "import { MutantSource, ProgramLoadError, type Mutant, type NotMutated, type RunConfig, type Viability } from \"@mutant-cafe/core\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Stream from \"effect/Stream\";\nimport * as Schema from \"effect/Schema\";\nimport { generateFunction } from \"./Generate.ts\";\nimport type { TypeOracle } from \"./TypeOracle.ts\";\nimport { makeTypeScriptOracle } from \"./TypeScriptOracle.ts\";\n\nexport { makeTypeScriptOracle } from \"./TypeScriptOracle.ts\";\nexport type { TypeOracle } from \"./TypeOracle.ts\";\n\n/** Each layer build owns its warm compiler and original-source cache. */\nexport const MutantSourceLive: Layer.Layer<MutantSource> = Layer.effect(\n MutantSource,\n Effect.sync(() => makeMutantSource(makeTypeScriptOracle())),\n);\n\nexport function makeMutantSource(oracle: TypeOracle): MutantSource[\"Service\"] {\n // Discovery results belong to the call, not to the warm compiler. Asking for\n // another selection cannot clear a caller's skips or partially consumed stream.\n const discover = (config: RunConfig) => Effect.try({\n try: () => {\n const discovered = oracle.discover(config);\n const notMutated: NotMutated[] = [...discovered.notMutated];\n const mutants: Mutant[] = [];\n const failed = new Set<typeof discovered.functions[number]>();\n const generatedFunctions = discovered.functions.map(fn => {\n try {\n const iterator = generateFunction(fn);\n const generated: Mutant[] = [];\n let step = iterator.next();\n while (!step.done) { generated.push(step.value); step = iterator.next(); }\n if (step.value) {\n failed.add(fn);\n notMutated.push({ file: fn.file, functionName: fn.name, span: fn.span, reason: step.value });\n return { fn, generated: [] };\n }\n return { fn, generated };\n }\n catch (error) {\n failed.add(fn);\n notMutated.push({ file: fn.file, functionName: fn.name, span: fn.span,\n reason: `analysis failed: ${error instanceof Error ? error.message : String(error)}` });\n return { fn, generated: [] };\n }\n });\n for (const { fn, generated } of generatedFunctions) {\n if (failed.has(fn)) continue;\n {\n const reasons = [...(fn.notices ?? [])];\n if (!generated.length && !reasons.length) reasons.push(fn.skipReason ?? `return not synthesizable (type ${fn.displayReturnType})`);\n const innerMutated = !generated.length && generatedFunctions.some(({ fn: inner, generated }) => inner.file === fn.file && inner.startOffset > fn.startOffset\n && inner.endOffset < fn.endOffset && generated.length > 0);\n if (innerMutated && !generated.length) {\n for (let i = 0; i < reasons.length; i++) if (reasons[i]!.startsWith(\"return not synthesizable\")) reasons[i] += \"; inner functions mutated\";\n }\n if (reasons.length) notMutated.push({ file: fn.file, functionName: fn.name, span: fn.span, reason: [...new Set(reasons)].join(\"; \") });\n }\n mutants.push(...generated);\n }\n return { mutants, notMutated: [...new Map(notMutated.map(item => [JSON.stringify(item), item])).values()] };\n },\n catch: (error) => {\n if (Schema.is(ProgramLoadError)(error)) return error;\n // Unexpected outer defects are not config failures. Target analysis is isolated above.\n throw error;\n },\n });\n return {\n notMutated: (config) => discover(config).pipe(Effect.map(result => result.notMutated)),\n generate: (config) => Stream.unwrap(discover(config).pipe(Effect.map(result => Stream.fromIterable(result.mutants)))),\n checkViable: (mutant) => Effect.sync((): Viability => {\n try { return oracle.checkViable(mutant); }\n catch (error) { return { viable: false, diagnostics: [], analysisFailed: {\n file: mutant.file, functionName: mutant.functionName, span: mutant.span,\n reason: `analysis failed: ${error instanceof Error ? error.message : String(error)}`,\n } }; }\n }),\n };\n}\n", "// A content digest is pure synchronous work; Effect 4.1.2 has no Crypto module.\n// @effect-diagnostics-next-line nodeBuiltinImport:off\nimport { createHash } from \"node:crypto\";\nimport type { Genre, Mutant } from \"@mutant-cafe/core\";\nimport type { MutableFunction, Value } from \"./TypeOracle.ts\";\n\n/** Generate from the oracle description; deferred compiler checks stay behind its port. */\nexport function* generateFunction(fn: MutableFunction): Generator<Mutant, string | undefined> {\n const issue = fn.generationIssue?.();\n if (issue) return issue;\n const api = fn.api;\n const candidate = (genre: Genre, expression: string, value: Value = { text: \"\", synthetic: false }, description = expression): Mutant => {\n // A return annotation on the inner function preserves the public inferred\n // contract, even when this replacement only produces never or Option<never>.\n const pinned = `((): ${fn.returnType} => (${expression}))()`;\n const text = fn.block\n ? `{ return ${fn.generator ? \"yield* \" : \"\"}${pinned}; }`\n : `(${pinned})`;\n return makeMutant(fn, genre, text, value.synthetic, description);\n };\n const shape = fn.shape;\n const fits = (value: Value): boolean => new TextEncoder().encode(value.text).byteLength <= 2048;\n const values = \"values\" in shape ? shape.values.filter(fits) : [];\n switch (shape.kind) {\n case \"Effect\": {\n const succeed = api(\"Effect\", \"succeed\");\n if (succeed) {\n for (const value of values) {\n if (!fn.equivalentValues.includes(value.text) && !(fn.generator && value.text === fn.literal)) yield candidate(\"EffectSucceed\", `${succeed}(${value.text})`, value);\n }\n }\n const fail = api(\"Effect\", \"fail\");\n const catchTag = api(\"Effect\", \"catchTag\");\n for (const error of shape.errors) {\n if (fail && fits(error)) yield candidate(\"EffectFail\", `${fail}(${error.text})`, error, `${fail}(${error.text}) [${error.synthetic ? \"synthetic tag cast\" : \"constructed error\"}]`);\n const recoveries: ReadonlyArray<Value | undefined> = values.length\n ? shape.enumerateRecoveries ? values : values.slice(0, 1)\n : [undefined];\n // Evaluate the original body, rather than replacing its error path with an unconditional failure.\n const gen = api(\"Effect\", \"gen\");\n const original = fn.generator\n ? gen && `((): ${fn.returnType} => ${gen}(function* () ${fn.original}))()`\n : fn.block ? `((): ${fn.returnType} => ${fn.original})()` : `((): ${fn.returnType} => (${fn.original}))()`;\n for (const value of recoveries) {\n const die = api(\"Effect\", \"die\");\n const recovery = value && succeed ? `${succeed}(${value.text})`\n : die ? `${die}(${JSON.stringify(`mutant.cafe: swallowed ${error.tag}`)})` : undefined;\n if (catchTag && recovery && original) {\n yield candidate(value ? \"SwallowTag\" : \"TagToDefect\", `${original}.pipe(${catchTag}(${JSON.stringify(error.tag)}, () => ${recovery}))`, value, value ? `body.pipe(${catchTag}(${JSON.stringify(error.tag)}, () => ${recovery}))` : `turn ${error.tag} into a defect`);\n }\n }\n }\n const die = api(\"Effect\", \"die\");\n if (die) yield candidate(\"EffectDie\", `${die}(\"mutant.cafe\")`);\n const never = api(\"Effect\", \"never\");\n if (never) yield candidate(\"EffectNever\", never);\n break;\n }\n case \"Option\": {\n const none = api(\"Option\", \"none\");\n const some = api(\"Option\", \"some\");\n if (none) yield candidate(\"OptionNone\", `${none}()`);\n if (some) for (const value of values) yield candidate(\"OptionSome\", `${some}(${value.text})`, value);\n break;\n }\n case \"Stream\": {\n const empty = api(\"Stream\", \"empty\");\n const make = api(\"Stream\", \"make\");\n const fail = api(\"Stream\", \"fail\");\n if (empty) yield candidate(\"StreamEmpty\", empty);\n if (make) for (const value of values) yield candidate(\"StreamOne\", `${make}(${value.text})`, value);\n if (fail) for (const error of shape.errors) if (fits(error)) yield candidate(\"StreamFail\", `${fail}(${error.text})`, error);\n break;\n }\n case \"Layer\": {\n const layer = api(\"Layer\", \"effectContext\");\n const fail = api(\"Effect\", \"fail\");\n const die = api(\"Effect\", \"die\");\n if (layer && die) yield candidate(\"LayerDie\", `${layer}(${die}(\"mutant.cafe\"))`);\n if (layer && fail) {\n // Layer output is contravariant. Let the pinned return type infer the\n // complete output context, not just the first service found in the body.\n for (const error of shape.errors) if (fits(error)) yield candidate(\"LayerFail\", `${layer}(${fail}(${error.text}))`, error);\n }\n break;\n }\n case \"Void\":\n yield makeMutant(fn, \"FnValue\", \"{}\", false, \"an empty body\");\n break;\n default: {\n const genre = shape.kind === \"Boolean\" ? \"BooleanFlip\" : shape.kind === \"Literal\" ? \"LiteralCycle\" : \"FnValue\";\n for (const value of values) {\n if (value.text === fn.literal) continue;\n yield candidate(genre, value.text, value);\n }\n }\n }\n}\n\nfunction makeMutant(fn: MutableFunction, genre: Genre, text: string, synthetic: boolean, description: string): Mutant {\n const additions = fn.extraImports?.filter(item => text.includes(`${item.namespace}.`)) ?? [];\n const prefix = fn.sourcePrefix ?? \"\";\n const insertion = fn.importInsertionOffset ?? 0;\n const replacement = additions.length && fn.sourcePrefix !== undefined\n ? { startOffset: 0, endOffset: fn.endOffset, text: prefix.slice(0, insertion) + (insertion ? \"\\n\" : \"\") + additions.map(item => item.statement).join(\"\\n\") + \"\\n\" + prefix.slice(insertion) + text }\n : { startOffset: fn.startOffset, endOffset: fn.endOffset, text };\n // Identity describes the logical edit, never the physical prefix retained to\n // insert imports. Source line shifts above a binding do not retarget its id.\n const id = createHash(\"sha256\").update(JSON.stringify([fn.identityFile ?? fn.file, fn.name, fn.identityOrdinal ?? 0, fn.logicalSpan, genre, text, additions.map(item => item.statement)])).digest(\"hex\").slice(0, 24);\n return {\n id, file: fn.file, functionName: fn.name, returnType: fn.returnType, displayReturnType: fn.displayReturnType, genre,\n description: `replace ${fn.name} -> ${fn.returnType} with ${description}`,\n span: fn.span, replacement, synthetic,\n };\n}\n", "// Compiler-host boundary: TS requires synchronous native paths; matchesGlob has no Effect Path equivalent.\n// @effect-diagnostics-next-line nodeBuiltinImport:off\nimport { dirname, resolve, relative, matchesGlob } from \"node:path\";\nimport ts from \"typescript\";\nimport { ProgramLoadError, type Mutant, type NotMutated, type RunConfig, type Viability } from \"@mutant-cafe/core\";\nimport type { MutableFunction, ReturnShape, TaggedValue, TypeOracle, Value } from \"./TypeOracle.ts\";\n\ntype FunctionNode = ts.FunctionDeclaration | ts.ArrowFunction | ts.FunctionExpression | ts.MethodDeclaration;\ntype Family = \"Effect\" | \"Option\" | \"Stream\" | \"Layer\";\n\nconst diagnosticsText = (items: ReadonlyArray<ts.Diagnostic>): string[] => items.map((d) => {\n const message = ts.flattenDiagnosticMessageText(d.messageText, \"\\n\");\n if (!d.file || d.start === undefined) return `TS${d.code}: ${message}`;\n const position = d.file.getLineAndCharacterOfPosition(d.start);\n return `${d.file.fileName}:${position.line + 1}:${position.character + 1} TS${d.code}: ${message}`;\n});\n\nclass ProgramSession {\n readonly host: ts.CompilerHost;\n readonly originals = new Map<string, ts.SourceFile>();\n program: ts.Program;\n overlay: { file: string; text: string } | undefined;\n\n readonly configPath: string;\n\n constructor(configPath: string) {\n this.configPath = configPath;\n const config = ts.readConfigFile(configPath, ts.sys.readFile);\n if (config.error) throw new ProgramLoadError({ tsconfig: configPath, diagnostics: diagnosticsText([config.error]) });\n const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, resolve(configPath, \"..\"));\n if (parsed.errors.length) throw new ProgramLoadError({ tsconfig: configPath, diagnostics: diagnosticsText(parsed.errors) });\n this.host = ts.createCompilerHost(parsed.options, true);\n const read = this.host.getSourceFile;\n this.host.getSourceFile = (file, languageVersion, onError, shouldCreateNewSourceFile) => {\n const absolute = resolve(file);\n if (this.overlay?.file === absolute) return ts.createSourceFile(file, this.overlay.text, languageVersion, true);\n const cached = this.originals.get(absolute);\n if (cached) return cached;\n const source = read(file, languageVersion, onError, shouldCreateNewSourceFile);\n if (source) this.originals.set(absolute, source);\n return source;\n };\n this.program = ts.createProgram(parsed.fileNames, parsed.options, this.host);\n const errors = [...this.program.getOptionsDiagnostics(), ...this.program.getSyntacticDiagnostics()];\n if (errors.length) throw new ProgramLoadError({ tsconfig: configPath, diagnostics: diagnosticsText(errors) });\n }\n\n check(mutant: Mutant): Viability {\n const file = resolve(mutant.file);\n const source = this.originals.get(file);\n if (!source) return { viable: false, diagnostics: [], analysisFailed: { file: mutant.file, functionName: mutant.functionName, span: mutant.span, reason: \"analysis failed: source file was not loaded\" } };\n const { startOffset, endOffset, text } = mutant.replacement;\n if (startOffset < 0 || endOffset < startOffset || endOffset > source.text.length) {\n return { viable: false, diagnostics: [\"Replacement offsets are outside the original file\"] };\n }\n const analysisFailed = (reason: string): Viability => ({ viable: false, diagnostics: [],\n analysisFailed: { file: mutant.file, functionName: mutant.functionName, span: mutant.span, reason } });\n this.overlay = { file, text: source.text.slice(0, startOffset) + text + source.text.slice(endOffset) };\n try {\n const mutated = ts.createProgram({ rootNames: this.program.getRootFileNames(), options: this.program.getCompilerOptions(), host: this.host, oldProgram: this.program });\n const changed = mutated.getSourceFile(file);\n if (!changed) throw new Error(`Mutated source not found: ${file}`);\n const issue = typedCallIssue(changed, mutated.getTypeChecker(), true);\n if (issue) return analysisFailed(issue);\n const diagnostics = [...mutated.getSyntacticDiagnostics(changed), ...mutated.getSemanticDiagnostics(changed)];\n return { viable: diagnostics.length === 0, diagnostics: diagnosticsText(diagnostics) };\n } catch (error) {\n return analysisFailed(`analysis failed: ${error instanceof Error ? error.message : String(error)}`);\n } finally {\n this.overlay = undefined;\n }\n }\n}\n\n/** TS 6 is intentionally a runtime analysis dependency, not the workspace compiler. */\nexport function makeTypeScriptOracle(): TypeOracle {\n const sessions = new Map<string, ProgramSession>();\n const owners = new Map<string, ProgramSession>();\n return {\n discover(config) {\n const notMutated: NotMutated[] = [];\n const functions: MutableFunction[] = [];\n const configPath = resolve(config.root, config.tsconfig);\n let session = sessions.get(configPath);\n if (!session) {\n session = new ProgramSession(configPath);\n sessions.set(configPath, session);\n }\n const checker = session.program.getTypeChecker();\n const matched = new Set<string>();\n for (const source of session.program.getSourceFiles()) {\n const file = resolve(source.fileName);\n const local = relative(config.root, file).replaceAll(\"\\\\\", \"/\");\n // Test support lives beside the project, so judge it relative to the tsconfig.\n const project = relative(dirname(configPath), file).replaceAll(\"\\\\\", \"/\");\n if (source.isDeclarationFile || local.startsWith(\"../\") || /(?:^|\\/)(?:node_modules|__tests__|__mocks__|tests?)\\//.test(project) || /\\.(?:test|spec)\\.[cm]?[jt]sx?$/.test(local)) continue;\n for (const glob of config.include) if (matchesGlob(local, glob)) matched.add(glob);\n if (config.include.length && !config.include.some((glob) => matchesGlob(local, glob))) continue;\n if (config.exclude.some((glob) => matchesGlob(local, glob))) continue;\n owners.set(file, session);\n const api = imports(source);\n const excluded = new Set<ts.Node>();\n const visit = (node: ts.Node): void => {\n try {\n if (isFunction(node) && node.body && !mutable(node, checker)) {\n if (!ts.findAncestor(node.parent, parent => excluded.has(parent))) notMutated.push({ file, functionName: `${functionName(node, checker)}.<callback>`, span: nodeSpan(node), reason: \"callback position (not mutated yet)\" });\n }\n if (isFunction(node) && node.body && mutable(node, checker)) {\n const name = functionName(node, checker);\n const reason = skipped(node) ? \"excluded by @mutants-skip\"\n : config.exportedOnly && !publicOwner(node, checker) ? \"excluded by --exported-only\"\n : config.functionFilter.length && !config.functionFilter.some(filter => matchesGlob(name, filter)) ? \"excluded by function filter\"\n : undefined;\n if (reason) { excluded.add(node); notMutated.push({ file, functionName: name, span: nodeSpan(node.body), reason }); }\n if (!reason && (!config.functionFilter.length || config.functionFilter.some((filter) => matchesGlob(name, filter)))) {\n const signature = checker.getSignatureFromDeclaration(node);\n if (signature) {\n const wrapped = wrappedEffect(node, checker);\n const type = wrapped ?? checker.getReturnTypeOfSignature(signature);\n const generator = wrapped && ts.isFunctionExpression(node) ? node : generatorBody(node, checker);\n const body = generator?.body ?? node.body;\n const start = body.getStart(source);\n const end = body.getEnd();\n const a = source.getLineAndCharacterOfPosition(start);\n const b = source.getLineAndCharacterOfPosition(end);\n const beforePipeables = wrapped && ts.isFunctionExpression(node) ? generatorContract(node, checker) : undefined;\n const shape = beforePipeables?.shape ?? shapeOf(type, checker, node, body);\n const originals = equivalentSuccessValues(body, api);\n if ((!beforePipeables && (type.flags & ts.TypeFlags.TypeParameter) && !(\"values\" in shape && shape.values.length)) || (beforePipeables ? !nameableContract(beforePipeables, checker, node) : hasUnnameableType(type, checker, node))) {\n notMutated.push({ file, functionName: name, span: nodeSpan(node), reason: \"generic: naked or context-only type-parameter return\" });\n } else found.push({\n file, name, functionLike: true, functionSpan: nodeSpan(body), generationIssue: () => typedCallIssue(body, checker), notices: shapeNotices(shape, type, checker, node), returnType: beforePipeables?.text ?? returnTypeText(type, checker, node),\n displayReturnType: node.type?.getText(source) ?? checker.typeToString(type, node),\n skipReason: beforePipeables ? `no synthesizable generator success value: ${beforePipeables.text}` : synthesisReason(type, checker, node),\n equivalentValues: shape.kind === \"Effect\" ? shape.values.filter((value) => isEquivalentSuccess(value.text, originals)).map((value) => value.text) : [],\n span: { start: { line: a.line + 1, column: a.character + 1 }, end: { line: b.line + 1, column: b.character + 1 } },\n startOffset: start, endOffset: end, original: body.getText(source),\n identityFile: local, logicalSpan: { offset: start - node.getStart(source), length: end - start },\n sourcePrefix: source.text.slice(0, start), importInsertionOffset: importInsertionOffset(source), extraImports: mutationImports(source),\n literal: literalOfBody(body, checker),\n block: ts.isBlock(body), generator: generator !== undefined,\n shape, api,\n });\n } else notMutated.push({ file, functionName: name, span: nodeSpan(node), reason: \"missing callable signature\" });\n }\n }\n // A Layer value is a buildable program even when it is not a function.\n if ((ts.isVariableDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertyAssignment(node)) && node.initializer) {\n const type = checker.getTypeAtLocation(node.initializer);\n if (family(type, checker)?.kind === \"Layer\") {\n const name = valuePath(node);\n const reason = skippedNode(node) ? \"excluded by @mutants-skip\"\n : config.exportedOnly && !publicOwner(node, checker) ? \"excluded by --exported-only\"\n : config.functionFilter.length && !config.functionFilter.some(filter => matchesGlob(name, filter)) ? \"excluded by function filter\" : undefined;\n if (reason) { excluded.add(node.initializer); notMutated.push({ file, functionName: name, span: nodeSpan(node.initializer), reason }); }\n if (!reason) {\n const body = node.initializer;\n const a = source.getLineAndCharacterOfPosition(body.getStart(source));\n const b = source.getLineAndCharacterOfPosition(body.getEnd());\n found.push({ file, name, functionLike: false, generationIssue: () => typedCallIssue(body, checker), notices: shapeNotices(shapeOf(type, checker, node, body), type, checker, node), returnType: returnTypeText(type, checker, node), displayReturnType: checker.typeToString(type, node),\n equivalentValues: [], span: { start: { line: a.line + 1, column: a.character + 1 }, end: { line: b.line + 1, column: b.character + 1 } },\n startOffset: body.getStart(source), endOffset: body.getEnd(), original: body.getText(source), literal: undefined,\n identityFile: local, logicalSpan: { offset: body.getStart(source) - node.getStart(source), length: body.getWidth(source) },\n sourcePrefix: source.text.slice(0, body.getStart(source)), importInsertionOffset: importInsertionOffset(source), extraImports: mutationImports(source),\n block: false, generator: false, shape: shapeOf(type, checker, node, body), api });\n }\n }\n }\n } catch (error) {\n // Source analysis is best-effort. A single checker hole must not masquerade as a config failure.\n const target = isFunction(node) ? node.body\n : (ts.isVariableDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertyAssignment(node)) ? node.initializer : undefined;\n if (target) notMutated.push({ file, functionName: valuePath(node), span: nodeSpan(target),\n reason: `analysis failed: ${error instanceof Error ? error.message : String(error)}` });\n }\n ts.forEachChild(node, visit);\n };\n const found: MutableFunction[] = [];\n visit(source);\n const occurrences = new Map<string, number>();\n for (const fn of found) {\n const ordinal = occurrences.get(fn.name) ?? 0;\n occurrences.set(fn.name, ordinal + 1);\n functions.push({ ...fn, identityOrdinal: ordinal });\n }\n }\n const unmatched = config.include.filter((glob) => !matched.has(glob));\n if (unmatched.length) throw new ProgramLoadError({ tsconfig: configPath, reason: \"selection\", diagnostics: unmatched.map((glob) => {\n const target = relative(config.root, resolve(config.root, glob));\n const outside = target === \"..\" || target.startsWith(\"../\");\n return `No source file matched ${JSON.stringify(glob)}${outside ? \" (path is outside the package root)\" : \"\"}`;\n }) });\n return { functions, notMutated: [...new Map(notMutated.map(item => [JSON.stringify(item), item])).values()] };\n },\n checkViable(mutant) {\n const session = owners.get(resolve(mutant.file));\n if (!session) return { viable: false, diagnostics: [], analysisFailed: { file: mutant.file, functionName: mutant.functionName, span: mutant.span, reason: \"analysis failed: generate mutants before checking viability\" } };\n return session.check(mutant);\n },\n };\n}\n\nfunction typedCallIssue(body: ts.Node, checker: ts.TypeChecker, includeNested = false): string | undefined {\n let issue: string | undefined;\n const visit = (node: ts.Node): void => {\n if (isFunction(node) && !includeNested) return; // Nested implementations have their own discovery boundary.\n if (ts.isCallExpression(node) && node.typeArguments?.length) {\n const signature = checker.getResolvedSignature(node);\n // Unresolved imports and any-typed receivers may produce a synthetic signature with no declaration.\n // A missing declaration is data, not an exception manufactured to exercise a catch.\n if (!signature || (!signature.declaration && checker.getTypeAtLocation(node.expression).flags & ts.TypeFlags.Any)) {\n issue = `analysis failed: compiler supplied no declaration for typed call ${node.expression.getText()}; check its import or receiver type`;\n return;\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(body);\n return issue;\n}\n\nfunction nodeSpan(node: ts.Node): Mutant[\"span\"] {\n const source = node.getSourceFile();\n const a = source.getLineAndCharacterOfPosition(node.getStart(source));\n const b = source.getLineAndCharacterOfPosition(node.getEnd());\n return { start: { line: a.line + 1, column: a.character + 1 }, end: { line: b.line + 1, column: b.character + 1 } };\n}\n\nfunction isFunction(node: ts.Node): node is FunctionNode {\n return ts.isFunctionDeclaration(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node) || ts.isMethodDeclaration(node);\n}\n\n\nfunction functionValue(node: FunctionNode, checker: ts.TypeChecker): ts.Node {\n const wrapper = wrappedEffect(node, checker);\n // A generator passed to Effect.gen is an implementation, not a curried value.\n return wrapper && checker.getTypeAtLocation(node.parent).getCallSignatures().length ? node.parent : node;\n}\n\nfunction returnedBy(node: FunctionNode, checker: ts.TypeChecker): FunctionNode | undefined {\n let value = functionValue(node, checker);\n while (ts.isParenthesizedExpression(value.parent)) value = value.parent;\n const parent = value.parent;\n if (ts.isArrowFunction(parent) && parent.body === value) return parent;\n if (ts.isReturnStatement(parent) && parent.expression === value && ts.isBlock(parent.parent) && isFunction(parent.parent.parent)) return parent.parent.parent;\n return undefined;\n}\n\nfunction mutable(node: FunctionNode, checker: ts.TypeChecker): boolean {\n if (ts.isMethodDeclaration(node) || ts.isFunctionDeclaration(node)) return true;\n let current: ts.Node = wrappedEffect(node, checker) ? node.parent : node;\n while (ts.isParenthesizedExpression(current.parent)) current = current.parent;\n return returnedBy(node, checker) !== undefined || ((ts.isVariableDeclaration(current.parent) || ts.isPropertyAssignment(current.parent) || ts.isPropertyDeclaration(current.parent)) && current.parent.initializer === current);\n}\n\nfunction layerBody(boundary: FunctionNode, checker: ts.TypeChecker): boolean {\n let enclosing: ts.Node = boundary.parent;\n while (!ts.isSourceFile(enclosing) && !isFunction(enclosing)) {\n if (ts.isCallExpression(enclosing) && family(checker.getTypeAtLocation(enclosing), checker)?.kind === \"Layer\") return true;\n enclosing = enclosing.parent;\n }\n return false;\n}\n\nfunction returnsLayer(node: FunctionNode, checker: ts.TypeChecker): boolean {\n const signature = checker.getSignatureFromDeclaration(node);\n if (!signature) return false;\n const type = checker.getReturnTypeOfSignature(signature);\n return (type.isUnion() ? type.types : [type]).every(member => family(member, checker)?.kind === \"Layer\");\n}\n\nfunction serviceProperty(node: ts.Node, boundary: FunctionNode, checker: ts.TypeChecker): boolean {\n if (!(ts.isPropertyAssignment(node) || ts.isShorthandPropertyAssignment(node)) || !ts.isObjectLiteralExpression(node.parent)) return false;\n const object = node.parent;\n const call = object.parent;\n return ts.isCallExpression(call) && call.arguments[0] === object\n && ts.isPropertyAccessExpression(call.expression) && call.expression.name.text === \"of\"\n && ts.isReturnStatement(call.parent) && call.parent.parent === boundary.body && layerBody(boundary, checker);\n}\n\nfunction serviceMethod(node: FunctionNode, boundary: FunctionNode, checker: ts.TypeChecker): boolean {\n if (!layerBody(boundary, checker) || !boundary.body) return false;\n const declaration = ts.findAncestor(node, ts.isVariableDeclaration);\n let returned = false;\n const visit = (child: ts.Node): void => {\n if (isFunction(child)) return;\n if (ts.isReturnStatement(child) && child.expression && ts.isCallExpression(child.expression)) {\n const call = child.expression;\n const object = call.arguments[0];\n if (ts.isPropertyAccessExpression(call.expression) && call.expression.name.text === \"of\" && object && ts.isObjectLiteralExpression(object)) {\n returned ||= object.properties.some(prop => {\n if (ts.isPropertyAssignment(prop) && (prop.initializer === functionValue(node, checker)\n || (declaration && ts.isIdentifier(prop.initializer) && checker.getSymbolAtLocation(prop.initializer)?.valueDeclaration === declaration))) return true;\n if (ts.isShorthandPropertyAssignment(prop)) return checker.getShorthandAssignmentValueSymbol(prop)?.valueDeclaration === declaration;\n return false;\n });\n }\n }\n ts.forEachChild(child, visit);\n };\n visit(boundary.body);\n return returned;\n}\n\nfunction exportedBinding(binding: ts.VariableDeclaration | ts.FunctionDeclaration | ts.ClassDeclaration, checker: ts.TypeChecker): boolean {\n let declaration: ts.Declaration = binding;\n let symbol = binding.name ? checker.getSymbolAtLocation(binding.name) : undefined;\n let container = ts.findAncestor(binding, node => ts.isSourceFile(node) || ts.isModuleBlock(node));\n while (container) {\n const module = ts.isSourceFile(container) ? checker.getSymbolAtLocation(container)\n : ts.isModuleBlock(container) && ts.isModuleDeclaration(container.parent) ? checker.getSymbolAtLocation(container.parent.name) : undefined;\n if (!module || !checker.getExportsOfModule(module).some(item => {\n const target = item.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(item) : item;\n return target === symbol || target.valueDeclaration === declaration;\n })) return false;\n if (ts.isSourceFile(container)) return true;\n if (!ts.isModuleBlock(container) || !ts.isModuleDeclaration(container.parent)) return false;\n declaration = container.parent;\n symbol = module;\n container = ts.findAncestor(container.parent, node => ts.isSourceFile(node) || ts.isModuleBlock(node));\n }\n return false;\n}\n\nfunction publicOwner(node: ts.Node, checker: ts.TypeChecker, seen = new Set<ts.Node>()): boolean {\n if (seen.has(node)) return false;\n seen.add(node);\n let current = node;\n let binding: ts.VariableDeclaration | ts.FunctionDeclaration | ts.ClassDeclaration | undefined;\n let value = isFunction(node) ? node : undefined;\n let throughService = false;\n while (!ts.isSourceFile(current)) {\n if (current !== node && isFunction(current)) {\n const method = value ? serviceMethod(value, current, checker) : serviceProperty(node, current, checker);\n if (!(value && returnedBy(value, checker) === current) && !method && !(throughService && returnsLayer(current, checker))) return false;\n throughService ||= method;\n value = current;\n }\n if (ts.isVariableDeclaration(current) || ts.isFunctionDeclaration(current) || ts.isClassDeclaration(current)) binding = current;\n current = current.parent;\n }\n if (!binding) return false;\n if (exportedBinding(binding, checker)) return true;\n // Follow value bindings (including shorthand aliases), not calls from an\n // exported implementation. Calling a helper does not make it a public path.\n let exposed = false;\n const declaration = binding;\n const visit = (child: ts.Node): void => {\n if (exposed) return;\n const referenced = ts.isShorthandPropertyAssignment(child) ? checker.getShorthandAssignmentValueSymbol(child)\n : ts.isPropertyAssignment(child) && ts.isIdentifier(child.initializer) ? checker.getSymbolAtLocation(child.initializer)\n : ts.isExportAssignment(child) && ts.isIdentifier(child.expression) ? checker.getSymbolAtLocation(child.expression) : undefined;\n if (referenced?.valueDeclaration === declaration) {\n exposed = ts.isExportAssignment(child) || publicOwner(child, checker, seen);\n }\n ts.forEachChild(child, visit);\n };\n visit(current);\n return exposed;\n}\n\nfunction skipped(node: FunctionNode): boolean { return skippedNode(node); }\nfunction skippedNode(node: ts.Node): boolean {\n let current: ts.Node = node;\n while (!ts.isSourceFile(current)) {\n if (ts.getJSDocTags(current).some((tag) => tag.tagName.text === \"mutants-skip\")) return true;\n current = current.parent;\n }\n return false;\n}\n\nfunction valuePath(node: ts.Node): string {\n const parts: string[] = [];\n let current = node;\n while (!ts.isSourceFile(current)) {\n if ((ts.isVariableDeclaration(current) || ts.isPropertyAssignment(current) || ts.isPropertyDeclaration(current) || ts.isMethodDeclaration(current) || ts.isFunctionDeclaration(current) || ts.isClassDeclaration(current) || ts.isModuleDeclaration(current)) && current.name) parts.unshift(current.name.getText());\n current = current.parent;\n }\n return parts.join(\".\") || \"default\";\n}\n\nfunction functionName(node: FunctionNode, checker: ts.TypeChecker): string {\n let path = valuePath(node);\n let parent = returnedBy(node, checker);\n while (parent) { path += \".<inner>\"; parent = returnedBy(parent, checker); }\n return path;\n}\n\nfunction wrappedEffect(node: FunctionNode, checker: ts.TypeChecker): ts.Type | undefined {\n if (!ts.isFunctionExpression(node) || !node.asteriskToken || !ts.isCallExpression(node.parent)) return undefined;\n const result = checker.getTypeAtLocation(node.parent);\n if (family(result, checker)?.kind === \"Effect\") return result;\n const signature = result.getCallSignatures()[0];\n if (!signature) return undefined;\n const returned = checker.getReturnTypeOfSignature(signature);\n return family(returned, checker)?.kind === \"Effect\" ? returned : undefined;\n}\n\nfunction nameableContract(contract: { readonly types: ReadonlyArray<ts.Type> }, checker: ts.TypeChecker, node: ts.Node): boolean {\n return contract.types.every(type => !hasUnnameableType(type, checker, node));\n}\n\nfunction hasUnnameableType(type: ts.Type, checker: ts.TypeChecker, location: ts.Node): boolean {\n // An explicit return annotation already supplies an in-scope spelling (including type-only aliases).\n if (isFunction(location) && location.type && !location.asteriskToken) return false;\n const printed = ts.createSourceFile(\"contract.ts\", `type Contract = ${returnTypeText(type, checker, location)};`, ts.ScriptTarget.Latest, true);\n let missing = false;\n const visit = (node: ts.Node): void => {\n if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && !checker.resolveName(node.typeName.text, location, ts.SymbolFlags.Type, false)) missing = true;\n ts.forEachChild(node, visit);\n };\n visit(printed);\n return missing;\n}\n\nfunction generatorContract(node: ts.FunctionExpression, checker: ts.TypeChecker): { shape: ReturnShape; text: string; types: ReadonlyArray<ts.Type> } | undefined {\n const signature = checker.getSignatureFromDeclaration(node);\n if (!signature || !node.body) return undefined;\n const iterator = checker.getReturnTypeOfSignature(signature);\n const args = checker.getTypeArguments(iterator as ts.TypeReference);\n const [yielded, success] = args;\n if (!yielded || !success) return undefined;\n const effects = (yielded.isUnion() ? yielded.types : [yielded]).flatMap(t => {\n const f = family(t, checker);\n return f?.kind === \"Effect\" ? [f] : [];\n });\n const print = (t: ts.Type) => returnTypeText(t, checker, node);\n const union = (index: number) => [...new Set(effects.flatMap(f => f.args[index] ? [print(f.args[index]!)] : []))].join(\" | \") || \"never\";\n return {\n types: [success, ...effects.flatMap(effect => effect.args.slice(1))],\n text: `import(\"effect/Effect\").Effect<${print(success)}, ${union(1)}, ${union(2)}>`,\n\n shape: { kind: \"Effect\", values: boundedValues(success, checker, node).values, omittedValues: boundedValues(success, checker, node).omitted, synthesisIssues: boundedValues(success, checker, node).issues, enumerateRecoveries: smallFinite(success), errors: [...new Map(effects.flatMap(f => f.args[1] ? taggedValues(f.args[1], checker, node) : []).map(e => [e.tag, e])).values()] },\n };\n}\n\nfunction literalOfBody(body: ts.ConciseBody, checker: ts.TypeChecker): string | undefined {\n const first = ts.isBlock(body) && body.statements.length === 1 ? body.statements[0] : undefined;\n const expression = ts.isBlock(body) ? first && ts.isReturnStatement(first) ? first.expression : undefined : body;\n if (!expression) return undefined;\n const type = checker.getTypeAtLocation(expression);\n return type.isStringLiteral() ? JSON.stringify(type.value) : type.isNumberLiteral() ? String(type.value)\n : type.flags & ts.TypeFlags.BooleanLiteral ? checker.typeToString(type) : undefined;\n}\n\nfunction generatorBody(node: FunctionNode, checker: ts.TypeChecker): ts.FunctionExpression | undefined {\n if (!node.body) return undefined;\n const expression = ts.isBlock(node.body)\n ? node.body.statements.length === 1 && ts.isReturnStatement(node.body.statements[0]!) ? node.body.statements[0]!.expression : undefined\n : node.body;\n // The return type identifies Effect; only select a direct generator callback of the wrapper.\n const signature = checker.getSignatureFromDeclaration(node);\n if (!signature || family(checker.getReturnTypeOfSignature(signature), checker)?.kind !== \"Effect\") return undefined;\n if (expression && ts.isCallExpression(expression)) {\n return expression.arguments.find((arg): arg is ts.FunctionExpression => ts.isFunctionExpression(arg) && arg.asteriskToken !== undefined);\n }\n return undefined;\n}\n\nfunction imports(source: ts.SourceFile): MutableFunction[\"api\"] {\n const namespaces = new Map<string, string>();\n const named = new Map<string, string>();\n for (const statement of source.statements) {\n if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier) || statement.importClause?.isTypeOnly) continue;\n const path = statement.moduleSpecifier.text;\n const bindings = statement.importClause?.namedBindings;\n if (!bindings) continue;\n if (ts.isNamespaceImport(bindings)) {\n if (path.startsWith(\"effect/\")) namespaces.set(path.slice(7), bindings.name.text);\n if (path === \"effect\") for (const module of [\"Effect\", \"Option\", \"Stream\", \"Layer\"]) namespaces.set(module, `${bindings.name.text}.${module}`);\n }\n if (ts.isNamedImports(bindings)) for (const binding of bindings.elements) {\n if (binding.isTypeOnly) continue;\n const imported = (binding.propertyName ?? binding.name).text;\n if (path === \"effect\") namespaces.set(imported, binding.name.text);\n else if (path.startsWith(\"effect/\")) named.set(`${path.slice(7)}.${imported}`, binding.name.text);\n }\n }\n return (module, member) => {\n const namespace = namespaces.get(module);\n return namespace ? `${namespace}.${member}` : named.get(`${module}.${member}`) ?? `${mutationNamespace(source, module)}.${member}`;\n };\n}\n\nfunction importInsertionOffset(source: ts.SourceFile): number {\n let offset = source.text.startsWith(\"#!\") ? (source.text.indexOf(\"\\n\") + 1 || source.text.length) : 0;\n for (const statement of source.statements) {\n if (!ts.isExpressionStatement(statement) || !ts.isStringLiteral(statement.expression)) break;\n offset = statement.getEnd();\n }\n return offset;\n}\n\nfunction mutationNamespace(source: ts.SourceFile, module: string): string {\n let name = `__mutantCafe${module}`;\n while (source.text.includes(name)) name += \"_\";\n return name;\n}\n\nfunction mutationImports(source: ts.SourceFile): NonNullable<MutableFunction[\"extraImports\"]> {\n return [\"Effect\", \"Option\", \"Stream\", \"Layer\"].map(module => {\n const namespace = mutationNamespace(source, module);\n return { namespace, statement: `import * as ${namespace} from \"effect/${module}\";` };\n });\n}\n\nfunction family(type: ts.Type, checker: ts.TypeChecker): { kind: Family; args: ReadonlyArray<ts.Type> } | undefined {\n const symbol = type.aliasSymbol ?? type.getSymbol();\n const name = symbol?.getName();\n // Declaration provenance prevents a user-defined Effect-shaped name from being mistaken for Effect.\n const fromEffect = symbol?.declarations?.some((d) => /(?:^|\\/)effect\\/(?:.*\\/)?(?:Effect|Option|Stream|Layer)\\.(?:d\\.)?ts$/.test(d.getSourceFile().fileName));\n if (fromEffect && (name === \"Effect\" || name === \"Option\" || name === \"Stream\" || name === \"Layer\")) {\n const args = type.aliasTypeArguments ?? ((type.flags & ts.TypeFlags.Object) && (type as ts.ObjectType).objectFlags & ts.ObjectFlags.Reference ? checker.getTypeArguments(type as ts.TypeReference) : []);\n return { kind: name, args };\n }\n // Type aliases may hide a referenced interface; union aliases retain their own type arguments.\n const direct = type.getSymbol();\n if (direct && direct !== symbol) {\n const name = direct.getName();\n if ((name === \"Effect\" || name === \"Stream\" || name === \"Layer\") && direct.declarations?.some((d) => d.getSourceFile().fileName.includes(\"/effect/\"))) {\n return { kind: name, args: checker.getTypeArguments(type as ts.TypeReference) };\n }\n }\n if (type.isUnion()) {\n const members = type.types;\n const option = members.every((member) => {\n const symbol = member.getSymbol();\n return (symbol?.name === \"Some\" || symbol?.name === \"None\") && symbol.declarations?.some((d) => /\\/effect\\/.*Option\\.(?:d\\.)?ts$/.test(d.getSourceFile().fileName));\n });\n if (option && members[0]) {\n const first = members.find((m) => m.getSymbol()?.name === \"Some\") ?? members[0];\n return { kind: \"Option\", args: checker.getTypeArguments(first as ts.TypeReference) };\n }\n }\n if (type.flags & ts.TypeFlags.Object && (type as ts.ObjectType).objectFlags & (ts.ObjectFlags.Class | ts.ObjectFlags.Interface)) {\n for (const base of checker.getBaseTypes(type as ts.InterfaceType) ?? []) {\n const detected = family(base, checker);\n if (detected) return detected;\n }\n }\n return undefined;\n}\n\nfunction shapeOf(type: ts.Type, checker: ts.TypeChecker, node: ts.Node, body: ts.ConciseBody): ReturnShape {\n if (type.isUnion() && type.types.every((member) => family(member, checker)?.kind === \"Effect\")) {\n const shapes = type.types.map((member) => shapeOf(member, checker, node, body));\n const successes = type.types.flatMap(member => family(member, checker)?.args[0] ?? []);\n const bounded = boundCandidates(successes.flatMap(success => valuesOf(success, checker, node)), successes, node);\n const errors = shapes.flatMap((shape) => shape.kind === \"Effect\" ? shape.errors : []);\n return { kind: \"Effect\",\n values: bounded.values, omittedValues: bounded.omitted, synthesisIssues: shapes.flatMap(shape => shape.synthesisIssues ?? []), enumerateRecoveries: bounded.values.length <= 4 && successes.every(smallFinite),\n errors: [...new Map(errors.map((error) => [error.tag, error])).values()].sort((a, b) => a.tag.localeCompare(b.tag, \"en\")),\n };\n }\n const detected = family(type, checker);\n if (detected) {\n const [a, e] = detected.args;\n if (detected.kind === \"Layer\") return { kind: \"Layer\", errors: e ? taggedValues(e, checker, node) : [] };\n const bounded = a ? boundedValues(a, checker, node) : { values: [], omitted: 0, issues: [] };\n const values = bounded.values;\n if (detected.kind === \"Option\") return { kind: \"Option\", values, omittedValues: bounded.omitted, synthesisIssues: bounded.issues };\n const errors = e ? taggedValues(e, checker, node) : [];\n return { kind: detected.kind, values, errors, omittedValues: bounded.omitted, synthesisIssues: bounded.issues, enumerateRecoveries: a !== undefined && smallFinite(a) };\n }\n if (type.flags & ts.TypeFlags.Void) return { kind: \"Void\", values: [] };\n const members = type.isUnion() ? type.types : [type];\n const boolean = members.every((t) => (t.flags & (ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral)) !== 0);\n const literal = members.every((t) => t.isLiteral());\n const bounded = boundedValues(type, checker, node);\n const values = bounded.values;\n if (isFunction(node)) for (const parameter of node.parameters) {\n if (ts.isIdentifier(parameter.name) && checker.isTypeAssignableTo(checker.getTypeAtLocation(parameter), type)) {\n values.push({ text: parameter.name.text, synthetic: false });\n }\n }\n return { kind: boolean ? \"Boolean\" : literal ? \"Literal\" : \"Value\", values, omittedValues: bounded.omitted, synthesisIssues: bounded.issues };\n}\n\nfunction taggedValues(type: ts.Type, checker: ts.TypeChecker, location: ts.Node): TaggedValue[] {\n return (type.isUnion() ? type.types : [type]).flatMap((member) => {\n const tag = member.getProperty(\"_tag\");\n if (!tag) return [];\n const tagType = checker.getTypeOfSymbolAtLocation(tag, location);\n if (!tagType.isStringLiteral()) return [];\n const value = constructError(member, checker, location, tagType.value);\n return [{ ...value, tag: tagType.value }];\n });\n}\n\nfunction constructError(type: ts.Type, checker: ts.TypeChecker, location: ts.Node, tag: string): Value & { readonly reason?: string } {\n const synthetic = (reason?: string): Value & { readonly reason?: string } => ({\n text: `({ _tag: ${JSON.stringify(tag)} } as unknown as ${returnTypeText(type, checker, location)})`, synthetic: true,\n ...(reason ? { reason } : {}),\n });\n const symbol = type.getSymbol();\n if (symbol) {\n const visible = checker.getSymbolsInScope(location, ts.SymbolFlags.Value | ts.SymbolFlags.Alias).find((candidate) => {\n if (candidate.declarations?.some((declaration) => (ts.isImportClause(declaration) && declaration.isTypeOnly)\n || (ts.isImportSpecifier(declaration) && (declaration.isTypeOnly || declaration.parent.parent.isTypeOnly)))) return false;\n const target = candidate.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(candidate) : candidate;\n // Exported Data.TaggedError classes may expose distinct value/type\n // symbols for the same class declaration.\n return target === symbol || (symbol.declarations?.some((declaration) => target.declarations?.includes(declaration)) ?? false);\n });\n if (visible) {\n const constructor = checker.getTypeOfSymbolAtLocation(visible, location).getConstructSignatures()[0];\n if (constructor) {\n const arguments_: string[] = [];\n for (const param of constructor.parameters) {\n const fields = checker.getTypeOfSymbolAtLocation(param, location);\n if (fields.flags & (ts.TypeFlags.Void | ts.TypeFlags.Undefined)) continue;\n const issues = new Set<string>();\n const value = valuesOf(fields, checker, location, new Set(), 0, issues)[0];\n if (!value || value.synthetic) {\n const reason = synthesisReason(fields, checker, location);\n const field = /\\(field ([^)]+)\\)/.exec(reason)?.[1];\n const detail = field ? `field ${field}` : `argument ${param.name} is not synthesizable`;\n return synthetic(detail + (issues.size ? ` (${[...issues].join(\"; \")})` : \"\"));\n }\n const declaration = param.valueDeclaration;\n const rest = declaration && ts.isParameter(declaration) && declaration.dotDotDotToken;\n arguments_.push(`${rest ? \"...\" : \"\"}${value.text}`);\n }\n return { text: `new ${visible.name}(${arguments_.join(\", \")})`, synthetic: false };\n }\n }\n if (symbol.declarations?.some(ts.isClassDeclaration)) {\n return synthetic(visible ? \"constructor arguments are not synthesizable\" : \"class is not available as a value; import its constructor\");\n }\n }\n return synthetic();\n}\n\n// Without UseAliasDefinedOutsideCurrentScope the checker emits import(\"./module\").Name\n// for names not visible here, including transitive error and Brand references.\nfunction returnTypeText(type: ts.Type, checker: ts.TypeChecker, node: ts.Node): string {\n if (isFunction(node) && node.type && !node.asteriskToken && checker.getTypeFromTypeNode(node.type) === type) return node.type.getText();\n const print = (t: ts.Type): string => {\n if (t.isUnion()) return t.types.map(print).join(\" | \");\n const symbol = t.getSymbol();\n if (symbol && !checker.resolveName(symbol.name, node, ts.SymbolFlags.Type, false)) {\n const alias = checker.getSymbolsInScope(node, ts.SymbolFlags.Type | ts.SymbolFlags.Alias).find(candidate => {\n const target = candidate.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(candidate) : candidate;\n return !!target.declarations?.length && checker.getDeclaredTypeOfSymbol(target) === t;\n });\n if (alias) return alias.name;\n }\n return checker.typeToString(t, node, ts.TypeFormatFlags.NoTruncation);\n };\n if (type.isUnion()) {\n const members = type.types.map((member) => family(member, checker));\n if (members.every((member) => member?.kind === \"Effect\")) {\n const args = [0, 1, 2].map((index) => [...new Set(members.flatMap((member) => member?.args[index] ? [print(member.args[index]!)] : []))].sort().join(\" | \") || \"never\");\n return `import(\"effect/Effect\").Effect<${args.join(\", \")}>`;\n }\n }\n const detected = family(type, checker);\n if (detected) return `import(\"effect/${detected.kind}\").${detected.kind}<${detected.args.map(print).join(\", \")}>`;\n return print(type);\n}\n\n// Compare only literal data, never evaluate user code. Canonical keys make\n// differently quoted object literals equivalent without treating calls as equal.\nfunction literalData(node: ts.Node): unknown {\n if (ts.isParenthesizedExpression(node) || ts.isAsExpression(node) || ts.isSatisfiesExpression(node)) return literalData(node.expression);\n if (ts.isStringLiteral(node) || ts.isNumericLiteral(node)) return [node.kind, node.text];\n if (ts.isIdentifier(node) && node.text === \"undefined\") return [\"undefined\"];\n if (ts.isPrefixUnaryExpression(node)) return [node.operator, literalData(node.operand)];\n if (ts.isArrayLiteralExpression(node)) {\n const items = node.elements.map(literalData);\n return items.every(item => item !== undefined) ? [\"array\", items] : undefined;\n }\n if (node.kind === ts.SyntaxKind.TrueKeyword || node.kind === ts.SyntaxKind.FalseKeyword || node.kind === ts.SyntaxKind.NullKeyword) return [node.kind];\n if (ts.isObjectLiteralExpression(node)) {\n const fields: Array<readonly [string, unknown]> = [];\n for (const field of node.properties) {\n if (!ts.isPropertyAssignment(field) || !field.name || ts.isComputedPropertyName(field.name)) return undefined;\n const value = literalData(field.initializer);\n if (value === undefined) return undefined;\n fields.push([field.name.getText().replace(/^[\"']|[\"']$/g, \"\"), value]);\n }\n return fields.sort(([a], [b]) => a.localeCompare(b, \"en\"));\n }\n return undefined;\n}\n\nfunction equivalentSuccessValues(body: ts.ConciseBody, api: MutableFunction[\"api\"]): ReadonlyArray<string> {\n const values: string[] = [];\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node) && node.expression.getText() === api(\"Effect\", \"succeed\") && node.arguments[0]) {\n const value = literalData(node.arguments[0]);\n if (value !== undefined) values.push(JSON.stringify(value));\n }\n ts.forEachChild(node, visit);\n };\n visit(body);\n return values;\n}\n\nfunction isEquivalentSuccess(text: string, values: ReadonlyArray<string>): boolean {\n const source = ts.createSourceFile(\"literal.ts\", `(${text})`, ts.ScriptTarget.Latest, true);\n const statement = source.statements[0];\n if (!statement || !ts.isExpressionStatement(statement)) return false;\n const value = literalData(statement.expression);\n return value !== undefined && values.includes(JSON.stringify(value));\n}\n\nfunction synthesisReason(type: ts.Type, checker: ts.TypeChecker, node: ts.Node): string {\n if (type.flags & (ts.TypeFlags.TypeParameter | ts.TypeFlags.IndexedAccess)) return \"generic return cannot be synthesized\";\n const valueType = family(type, checker)?.args[0] ?? type;\n // Protocol properties are implementation details, not fields a caller can supply.\n const field = valueType.getProperties().find(field => /^[$\\w]+$/.test(field.name)\n && !(field.flags & ts.SymbolFlags.Optional) && !valuesOf(checker.getTypeOfSymbolAtLocation(field, node), checker, node).length);\n const symbol = valueType.aliasSymbol ?? valueType.getSymbol();\n const name = symbol && !symbol.name.startsWith(\"__\") ? symbol.name\n : valueType.isUnion() ? \"union\" : valueType.flags & ts.TypeFlags.Object || valueType.isIntersection() ? \"object\" : checker.typeToString(valueType, node);\n return field ? `return not synthesizable (field ${field.name})` : `return not synthesizable (type ${name})`;\n}\n\nfunction valueKey(text: string): string {\n const source = ts.createSourceFile(\"value.ts\", `(${text})`, ts.ScriptTarget.Latest, true);\n const statement = source.statements[0];\n const data = statement && ts.isExpressionStatement(statement) ? literalData(statement.expression) : undefined;\n return data === undefined ? text : JSON.stringify(data);\n}\n\n/** Finite literal sets are exhaustive up to eight; open/recursive shapes use six representatives.\n * Undefined is retained separately, so optional returns keep their absence path. */\nfunction boundedValues(type: ts.Type, checker: ts.TypeChecker, node: ts.Node): { values: Value[]; omitted: number; issues: string[] } {\n const issues = new Set<string>();\n return { ...boundCandidates(valuesOf(type, checker, node, new Set(), 0, issues), [type], node), issues: [...issues] };\n}\n\nfunction smallFinite(type: ts.Type): boolean {\n const members = type.isUnion() ? type.types : [type];\n return members.length <= 4 && members.every(member => member.isLiteral()\n || !!(member.flags & (ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral | ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.Void)));\n}\n\nfunction boundCandidates(candidates: ReadonlyArray<Value>, types: ReadonlyArray<ts.Type>, node: ts.Node): { values: Value[]; omitted: number } {\n const unique = [...new Map(candidates.map(value => [valueKey(value.text), value])).values()];\n const members = types.flatMap(type => type.isUnion() ? type.types : [type]);\n const finite = members.length <= 8 && members.every(member => member.isLiteral()\n || !!(member.flags & (ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral | ts.TypeFlags.Null | ts.TypeFlags.Undefined)));\n if (finite || unique.length <= 6) return { values: unique, omitted: 0 };\n const absence = unique.find(value => value.text === \"undefined\");\n const defined = unique.filter(value => value !== absence);\n const preferred = [\"null\", '\\\"\\\"', \"0\", \"false\", \"[]\", \"({ })\"].flatMap(text => {\n const candidate = defined.find(value => valueKey(value.text) === valueKey(text));\n return candidate ? [candidate] : [];\n });\n const original = returnedDiscriminants(node);\n const priority = defined.filter(candidate => {\n const source = ts.createSourceFile(\"value.ts\", `(${candidate.text})`, ts.ScriptTarget.Latest, true);\n const statement = source.statements[0];\n return statement && ts.isExpressionStatement(statement) && objectDiscriminants(statement.expression).some(key => original.has(key));\n });\n const selected = [...new Set([...priority, ...preferred, ...defined])].slice(0, 6);\n if (absence) selected.push(absence);\n return { values: selected, omitted: unique.length - selected.length };\n}\n\nfunction objectDiscriminants(node: ts.Node): string[] {\n while (ts.isParenthesizedExpression(node) || ts.isAsExpression(node) || ts.isSatisfiesExpression(node)) node = node.expression;\n if (!ts.isObjectLiteralExpression(node)) return [];\n return node.properties.flatMap(field => {\n if (!ts.isPropertyAssignment(field) || ts.isComputedPropertyName(field.name)) return [];\n let value = field.initializer;\n while (ts.isParenthesizedExpression(value) || ts.isAsExpression(value) || ts.isSatisfiesExpression(value)) value = value.expression;\n return ts.isStringLiteral(value) || ts.isNumericLiteral(value)\n ? [JSON.stringify([field.name.getText().replace(/^[\"']|[\"']$/g, \"\"), value.text])] : [];\n });\n}\n\nfunction returnedDiscriminants(node: ts.Node): Set<string> {\n if (!isFunction(node) || !node.body) return new Set();\n const result = new Set(objectDiscriminants(node.body));\n const visit = (child: ts.Node): void => {\n if (isFunction(child)) return;\n if (ts.isReturnStatement(child) && child.expression) for (const key of objectDiscriminants(child.expression)) result.add(key);\n ts.forEachChild(child, visit);\n };\n visit(node.body);\n return result;\n}\n\nfunction shapeNotices(shape: ReturnShape, type: ts.Type, checker: ts.TypeChecker, node: ts.Node): string[] {\n const notices: string[] = [...(shape.synthesisIssues ?? [])];\n const valueType = family(type, checker)?.args[0] ?? type;\n if (\"values\" in shape && shape.values.some(value => new TextEncoder().encode(value.text).byteLength > 2048)) notices.push(\"synthesized value exceeds 2048 bytes\");\n const omitted = shape.omittedValues ?? 0;\n if (omitted) notices.push(`${omitted} more values not generated (representative cap)`);\n if (\"errors\" in shape) for (const error of shape.errors) {\n if (error.reason !== undefined) notices.push(`cannot construct ${error.tag}: ${error.reason}`);\n if (new TextEncoder().encode(error.text).byteLength > 2048) notices.push(`cannot construct ${error.tag}: synthesized value exceeds 2048 bytes`);\n }\n if (\"values\" in shape && !shape.values.length && !(valueType.flags & ts.TypeFlags.Never) && shape.kind !== \"Void\") {\n notices.push(synthesisReason(type, checker, node));\n }\n return notices;\n}\n\n/** Bounded synthesis: cycles or unavailable required fields produce no fabricated value. */\nfunction valuesOf(type: ts.Type, checker: ts.TypeChecker, location: ts.Node, ancestors: ReadonlySet<ts.Type> = new Set(), depth = 0, issues = new Set<string>()): Value[] {\n if (depth > 4) { issues.add(\"synthesis depth limit (4) reached\"); return []; }\n if (ancestors.has(type) || type.flags & ts.TypeFlags.Never) return [];\n const values = synthesizeValues(type, checker, location, ancestors, depth, issues);\n const bounded = values.filter(value => new TextEncoder().encode(value.text).byteLength <= 2048);\n if (bounded.length !== values.length) issues.add(\"synthesized value exceeds 2048 bytes\");\n return bounded;\n}\n\nfunction synthesizeValues(type: ts.Type, checker: ts.TypeChecker, location: ts.Node, ancestors: ReadonlySet<ts.Type>, depth: number, issues: Set<string>): Value[] {\n const descend = (inner: ts.Type): Value[] => valuesOf(inner, checker, location, new Set([...ancestors, type]), depth + 1, issues);\n const value = (text: string): Value => ({ text, synthetic: false });\n const detected = family(type, checker);\n if (detected && (detected.kind === \"Option\" || detected.kind === \"Effect\")) {\n const api = imports(location.getSourceFile());\n const inner = detected.args[0];\n const values = inner ? descend(inner) : [];\n const wrap = api(detected.kind, detected.kind === \"Option\" ? \"some\" : \"succeed\");\n const none = detected.kind === \"Option\" ? api(\"Option\", \"none\") : undefined;\n return [\n ...(none ? [value(`${none}()`)] : []),\n ...(wrap ? values.map((v) => ({ text: `${wrap}(${v.text})`, synthetic: v.synthetic })) : []),\n ];\n }\n if (type.isIntersection()) {\n // Primitive brands need a cast. Structural intersections synthesize their required fields below.\n const primitive = type.types.find(member => member.flags & (ts.TypeFlags.String | ts.TypeFlags.Number));\n const brand = type.types.some(member => member.getProperties().some(prop => prop.name.includes(\"Brand\")));\n if (primitive && brand) return descend(primitive).map(v => ({ ...v, text: `(${v.text} as ${returnTypeText(type, checker, location)})` }));\n }\n const symbol = type.getSymbol();\n if ((symbol?.name === \"ReadonlySet\" || symbol?.name === \"Set\" || symbol?.name === \"ReadonlyMap\" || symbol?.name === \"Map\")\n && symbol.declarations?.some(d => /\\/lib\\.es.*\\.d\\.ts$/.test(d.getSourceFile().fileName))) {\n return [value(symbol.name.endsWith(\"Set\") ? \"new Set()\" : \"new Map()\")];\n }\n if (type.isUnion()) {\n const members = [...type.types];\n // The checker can intern scalar unions in different orders across selections.\n // Tagged structural variants retain their declaration order for cap selection.\n if (members.every(member => member.isLiteral() || !!(member.flags & (ts.TypeFlags.BooleanLiteral | ts.TypeFlags.Null | ts.TypeFlags.Undefined)))) {\n members.sort((a, b) => a.isNumberLiteral() && b.isNumberLiteral() ? a.value - b.value : checker.typeToString(a).localeCompare(checker.typeToString(b), \"en\"));\n }\n return members.flatMap(member => descend(member));\n }\n if (type.isStringLiteral()) return [value(JSON.stringify(type.value))];\n if (type.isNumberLiteral()) return [value(String(type.value))];\n if (type.flags & ts.TypeFlags.BooleanLiteral) return [value(checker.typeToString(type))];\n if (type.flags & ts.TypeFlags.Boolean) return [value(\"true\"), value(\"false\")];\n if (type.flags & ts.TypeFlags.String) return [value('\"\"'), value('\"xyzzy\"')];\n if (type.flags & ts.TypeFlags.Number) return [value(\"0\"), value(\"1\"), value(\"-1\")];\n if (type.flags & ts.TypeFlags.BigInt) return [value(\"0n\"), value(\"1n\")];\n if (type.flags & ts.TypeFlags.Null) return [value(\"null\")];\n if (type.flags & (ts.TypeFlags.Unknown | ts.TypeFlags.Any)) return [value(\"undefined\")];\n if (type.flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Void)) return [value(\"undefined\")];\n if (checker.isTupleType(type)) {\n const elements = checker.getTypeArguments(type as ts.TypeReference).map((t) => descend(t)[0]);\n return elements.every((v) => v !== undefined) ? [value(`[${elements.map((v) => v.text).join(\", \")}]`)] : [];\n }\n if (checker.isArrayType(type) || checker.isArrayLikeType(type)) {\n const element = checker.getIndexTypeOfType(type, ts.IndexKind.Number);\n const elements = element ? descend(element) : [];\n return [value(\"[]\"), ...elements.map((v) => ({ text: `[${v.text}]`, synthetic: v.synthetic }))];\n }\n if ((type.flags & ts.TypeFlags.Object || type.isIntersection()) && !type.getCallSignatures().length && !type.getConstructSignatures().length) {\n const fields: Array<{ name: string; values: Value[] }> = [];\n for (const prop of type.getProperties()) {\n if (prop.flags & ts.SymbolFlags.Optional) continue;\n if (!/^[$\\w]+$/.test(prop.name)) return [];\n const values = descend(checker.getTypeOfSymbolAtLocation(prop, location));\n if (!values.length) return [];\n fields.push({ name: prop.name, values });\n }\n const literalFields = fields.filter(field => {\n const prop = type.getProperty(field.name);\n if (!prop) return false;\n const t = checker.getTypeOfSymbolAtLocation(prop, location);\n return (t.isUnion() ? t.types : [t]).every(member => member.isLiteral() || !!(member.flags & ts.TypeFlags.BooleanLiteral));\n });\n const render = (changed?: typeof fields[number], replacement?: Value): Value | undefined => {\n const parts: string[] = [];\n let bytes = 6; // ({ ... }) delimiters\n for (const field of fields) {\n const v = (field === changed ? replacement! : field.values[0]!).text;\n const part = `${JSON.stringify(field.name)}: ${literalFields.includes(field) ? `(${v} as const)` : v}`;\n bytes += new TextEncoder().encode(part).byteLength + (parts.length ? 2 : 0);\n if (bytes > 2048) { issues.add(\"synthesized value exceeds 2048 bytes\"); return undefined; }\n parts.push(part);\n }\n return value(`({ ${parts.join(\", \")} })`);\n };\n const first = render();\n if (!first) return []; // Do not expand a wide object into thousands of oversized variants.\n const anonymous = !type.aliasSymbol && (!type.getSymbol() || [\"__type\", \"__object\"].includes(type.getSymbol()!.name));\n return [first, ...(anonymous ? literalFields.flatMap(field => field.values.slice(1).map(v => render(field, v))).filter(value => value !== undefined) : [])];\n }\n return [];\n}\n", "import { Scratch, ScratchError, type Mutant, type ScratchDir } from \"@mutant-cafe/core\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Path from \"effect/Path\";\nimport type * as PlatformError from \"effect/PlatformError\";\n\nexport const ScratchLive = Layer.effect(Scratch, Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const failure = (operation: string, location: string, error: { readonly message: string }) =>\n new ScratchError({ operation, path: location, message: error.message });\n\n return Scratch.of({\n acquire: Effect.fn(\"Scratch.acquire\")(function* (root: string) {\n const source = path.resolve(root);\n // Preserve workspace-relative tsconfig extends and local package imports.\n // Vitest still runs in the requested package, not at the workspace root.\n let copyRoot = source;\n let ancestor = source;\n while (true) {\n if ((yield* fs.exists(path.join(ancestor, \"pnpm-workspace.yaml\"))) || (yield* fs.exists(path.join(ancestor, \".git\")))) {\n copyRoot = ancestor;\n break;\n }\n const parent = path.dirname(ancestor);\n if (parent === ancestor) break;\n ancestor = parent;\n }\n const temp = yield* Effect.acquireRelease(\n fs.makeTempDirectory({ prefix: \"mutant-cafe-\" }).pipe(\n Effect.mapError((error) => failure(\"create\", source, error))),\n (dir) => fs.remove(dir, { recursive: true }).pipe(Effect.orDie)\n );\n // Materialize source symlinks, except dependencies. No editable file in\n // the scratch tree may point back into the original checkout.\n const copy = (from: string, to: string, ancestors: ReadonlyArray<string>): Effect.Effect<void, ScratchError> =>\n Effect.gen(function* () {\n const real = yield* fs.realPath(from);\n const info = yield* fs.stat(from);\n if (info.type === \"Directory\") {\n if (ancestors.includes(real)) {\n return yield* Effect.fail(new ScratchError({ operation: \"copy\", path: from, message: \"Cyclic directory symlink\" }));\n }\n yield* fs.makeDirectory(to, { recursive: true });\n const entries = yield* fs.readDirectory(from);\n for (const entry of entries) {\n if ([\".git\", \"mutants.out\", \".agent_sources\", \".agent-sources\", \".brain\", \".pi\", \".rift\"].includes(entry)) continue;\n const src = path.join(from, entry);\n const dest = path.join(to, entry);\n if (entry === \"node_modules\") {\n // Own the directory so workspace/self links can point at the\n // copied package. Linking node_modules wholesale sends tests\n // importing their package name back to the original checkout.\n const linkDependencies = (from: string, to: string): Effect.Effect<void, PlatformError.PlatformError> => Effect.gen(function* () {\n yield* fs.makeDirectory(to, { recursive: true });\n for (const name of yield* fs.readDirectory(from)) {\n if ([\".vite\", \".vite-temp\", \".vitest\", \".cache\"].includes(name)) continue;\n const dependency = path.join(from, name);\n const destination = path.join(to, name);\n if (name.startsWith(\"@\")) {\n yield* linkDependencies(dependency, destination);\n continue;\n }\n const realDependency = yield* fs.realPath(dependency);\n const rel = path.relative(copyRoot, realDependency);\n const inside = rel !== \"..\" && !rel.startsWith(`..${path.sep}`) && !path.isAbsolute(rel) && !rel.split(path.sep).includes(\"node_modules\");\n yield* fs.symlink(inside ? path.join(temp, rel) : realDependency, destination);\n }\n });\n yield* linkDependencies(src, dest);\n } else {\n yield* copy(src, dest, [...ancestors, real]);\n }\n }\n } else if (info.type === \"File\") {\n yield* fs.copyFile(from, to);\n }\n }).pipe(Effect.mapError((error) => failure(\"copy\", from, error)));\n yield* copy(copyRoot, temp, []);\n const packageRoot = yield* fs.realPath(path.join(temp, path.relative(copyRoot, source))).pipe(\n Effect.mapError((error) => failure(\"resolve\", source, error)));\n\n const originals = new Map<string, Uint8Array>();\n const target = (mutant: Mutant) => Effect.gen(function* () {\n const relative = path.isAbsolute(mutant.file) ? path.relative(source, mutant.file) : mutant.file;\n const location = path.resolve(packageRoot, relative);\n const rel = path.relative(packageRoot, location);\n if (rel === \"\" || rel === \"..\" || rel.startsWith(`..${path.sep}`) || path.isAbsolute(rel) || rel.split(path.sep).includes(\"node_modules\")) {\n return yield* Effect.fail(new ScratchError({ operation: \"resolve\", path: mutant.file, message: \"Mutant file must be inside the copied source tree\" }));\n }\n const real = yield* fs.realPath(location).pipe(Effect.mapError((error) => failure(\"resolve\", location, error)));\n const realRelative = path.relative(packageRoot, real);\n if (realRelative === \"..\" || realRelative.startsWith(`..${path.sep}`) || path.isAbsolute(realRelative)) {\n return yield* Effect.fail(new ScratchError({ operation: \"resolve\", path: mutant.file, message: \"Mutant file resolves outside the scratch package\" }));\n }\n return location;\n });\n const dir: ScratchDir = {\n path: packageRoot,\n apply: Effect.fn(\"Scratch.apply\")(function* (mutant: Mutant) {\n const location = yield* target(mutant);\n const bytes = yield* fs.readFile(location);\n originals.set(location, bytes);\n const original = new TextDecoder(\"utf-8\", { ignoreBOM: true }).decode(bytes);\n const { startOffset, endOffset, text } = mutant.replacement;\n if (startOffset < 0 || endOffset < startOffset || endOffset > original.length) {\n return yield* Effect.fail(new ScratchError({ operation: \"apply\", path: location, message: \"Replacement offsets are outside the file\" }));\n }\n yield* fs.writeFileString(location, original.slice(0, startOffset) + text + original.slice(endOffset));\n }, (effect, mutant) => effect.pipe(Effect.mapError((error) => failure(\"apply\", mutant.file, error)))),\n revert: Effect.fn(\"Scratch.revert\")(function* (mutant: Mutant) {\n const location = yield* target(mutant);\n const bytes = originals.get(location);\n if (bytes !== undefined) {\n yield* fs.writeFile(location, bytes);\n originals.delete(location);\n }\n }, (effect, mutant) => effect.pipe(Effect.mapError((error) => failure(\"revert\", mutant.file, error))))\n };\n return dir;\n }, (effect, root) => effect.pipe(Effect.mapError((error) => error._tag === \"ScratchError\" ? error : failure(\"acquire\", root, error))))\n });\n}));\n", "import { BaselineFailed, TestRunner, TestSpawnError, type ScratchDir, type TestRun, type SelectionIssue } from \"@mutant-cafe/core\";\nimport * as Clock from \"effect/Clock\";\nimport * as Console from \"effect/Console\";\nimport { preflight } from \"./Preflight.ts\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport * as Stream from \"effect/Stream\";\nimport * as Schema from \"effect/Schema\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\nimport * as ChildProcessSpawner from \"effect/process/ChildProcessSpawner\";\n\nexport const TestRunnerLive = Layer.effect(TestRunner, Effect.gen(function* () {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const execute = Effect.fn(\"TestRunner.execute\")(function* (dir: ScratchDir, args: ReadonlyArray<string>, timeoutMs?: number) {\n // Dependency directories are linked to the source checkout. Disable both\n // result and transform caches so Vitest cannot write through those links.\n // npx resolves the project's own vitest without a package manager's\n // install-state checks, which fail in a scratch copy at a new path.\n const reporterDir = yield* fs.makeTempDirectoryScoped({ prefix: \"mutant-vitest-\" }).pipe(\n Effect.mapError((error) => new TestSpawnError({ command: [\"vitest\"], message: String(error) })));\n const reporter = path.join(reporterDir, \"reporter.mjs\");\n const marker = `mutant-cafe:${path.basename(reporterDir)}:`;\n // Vitest's reporter lifecycle is the machine-readable selection/progress\n // boundary. No human output parsing, and partial failures survive an outer kill.\n yield* fs.writeFileString(reporter, `import { relative } from \"node:path\";\n export default class {\n files = 0;\n onTestRunStart(specifications) { this.files = specifications.length; console.log(${JSON.stringify(marker + \"selected:\")} + JSON.stringify(specifications.map(spec => relative(process.cwd(), spec.moduleId)))); }\n onTestModuleCollected() { console.log(${JSON.stringify(marker + \"collected\")}); }\n onTestCaseResult(test) { if (test.result().state === \"failed\") console.log(${JSON.stringify(marker + \"failed\")}); }\n onTestRunEnd() { if (this.files === 0) console.log(${JSON.stringify(marker + \"empty\")}); }\n }`).pipe(Effect.mapError((error) => new TestSpawnError({ command: [\"vitest\"], message: String(error) })));\n const command = [\"npx\", \"--no\", \"vitest\", ...args, \"--reporter=default\", `--reporter=${reporter}`, \"--bail\", \"1\",\n ...(timeoutMs === undefined ? [] : [\"--testTimeout\", String(Math.max(1, Math.floor(timeoutMs / 2)))]),\n \"--no-cache\", \"--no-fsModuleCache\"];\n // Keep diagnostics off stdout so GitHub output is a Markdown document.\n if (timeoutMs === undefined) yield* Console.error(`Baseline command: ${command.join(\" \")} (cwd: ${dir.path})`);\n const started = yield* Clock.currentTimeMillis;\n const chunks: Array<string> = [];\n let exitCode = 1;\n const child = Effect.scoped(Effect.gen(function* () {\n const handle = yield* spawner.spawn(ChildProcess.make(command[0]!, command.slice(1), {\n cwd: dir.path,\n // Node's scoped spawner kills the detached process group, not just pnpm.\n detached: true,\n killSignal: \"SIGKILL\",\n forceKillAfter: \"100 millis\",\n stdin: \"ignore\"\n }));\n const collect = handle.all.pipe(Stream.decodeText(), Stream.runForEach((chunk) =>\n Effect.sync(() => { chunks.push(chunk); })));\n const [code] = yield* Effect.all([handle.exitCode, collect], { concurrency: \"unbounded\" });\n exitCode = code;\n return code === 0 ? \"passed\" as const : \"failed\" as const;\n }));\n const status = yield* (timeoutMs === undefined ? child : child.pipe(\n Effect.timeout(timeoutMs),\n Effect.catchTag(\"TimeoutError\", () => Effect.succeed(\"timedOut\" as const))\n )).pipe(Effect.mapError((error) => new TestSpawnError({ command, message: error.message })));\n const ended = yield* Clock.currentTimeMillis;\n const output = chunks.join(\"\");\n const failed = output.includes(marker + \"failed\");\n const selection = output.split(\"\\n\").find(line => line.includes(marker + \"selected:\"))?.split(marker + \"selected:\")[1];\n const selected = selection === undefined ? [] : yield* Schema.decodeEffect(Schema.fromJsonString(Schema.Array(Schema.String)))(selection).pipe(\n Effect.mapError(error => new TestSpawnError({ command, message: `Cannot decode Vitest selected files: ${String(error)}` })));\n const run: TestRun = {\n status: failed ? \"failed\" : status === \"passed\" && output.includes(marker + \"empty\") ? \"untested\" : status,\n durationMs: ended - started, command, output,\n testsCollected: output.includes(marker + \"collected\"),\n testFiles: selected,\n };\n return { ...run, exitCode };\n }, Effect.scoped);\n return TestRunner.of({\n baseline: Effect.fn(\"TestRunner.baseline\")(function* (dir: ScratchDir, tsconfig?: string) {\n const unreliable: ReadonlyArray<SelectionIssue> = yield* preflight(dir.path, tsconfig).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), Effect.catch(error => Effect.succeed([{ kind: \"warning\" as const, reason: `Cannot verify runner selection: ${String(error)}` }])));\n for (const issue of unreliable) yield* Console.warn(`Warning (${issue.kind}): ${issue.reason}`);\n if (unreliable.some(issue => issue.kind === \"runner\")) {\n const command = [\"npx\", \"--no\", \"vitest\", \"run\", \"--passWithNoTests\"];\n yield* Console.warn(`Baseline command (not executed: unsupported runner): ${command.join(\" \")}`);\n return { durationMs: 0, testCommand: command, unreliable };\n }\n const run = yield* execute(dir, [\"run\", \"--passWithNoTests\"]);\n if (run.status !== \"passed\" && run.status !== \"untested\") {\n return yield* Effect.fail(new BaselineFailed({ exitCode: run.exitCode, output: run.output, command: run.command }));\n }\n return { durationMs: run.durationMs, testCommand: run.command, unreliable };\n }),\n runRelated: Effect.fn(\"TestRunner.runRelated\")(function* (dir: ScratchDir, file: string, timeoutMs: number) {\n const related = yield* execute(dir, [\"related\", file, \"--run\", \"--passWithNoTests\"], timeoutMs);\n if (related.status !== \"untested\") return related;\n const remaining = Math.max(1, timeoutMs - related.durationMs);\n const full = yield* execute(dir, [\"run\", \"--passWithNoTests\"], remaining);\n return { ...full, status: full.status === \"passed\" ? \"untested\" as const : full.status, durationMs: related.durationMs + full.durationMs,\n output: related.output + \"\\nFull-suite fallback:\\n\" + full.output };\n })\n });\n}));\n", "import { SelectionIssue, type Baseline } from \"@mutant-cafe/core\";\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from \"effect/Schema\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\nimport * as ChildProcessSpawner from \"effect/process/ChildProcessSpawner\";\n\nconst Issues = Schema.Array(SelectionIssue);\n\n// Run against installed Vitest. Source mapping is evidence, not an override of\n// its selection: built-entry issues are conditional on the tests actually run.\nconst probe = String.raw`\nimport { readFile, readdir } from \"node:fs/promises\";\nimport { resolve, relative, dirname, isAbsolute, sep } from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { fileURLToPath } from \"node:url\";\nconst root = process.cwd();\nconst issues = [];\nconst pkg = JSON.parse(await readFile(\"package.json\", \"utf8\").catch(error => { if (error.code === \"ENOENT\") return \"{}\"; throw error; }));\nconst script = pkg.scripts?.test;\nconst vitestScript = !script || /(?:^|[\\s/])vitest(?=\\s|$|[;&|])/.test(script);\nconst delegated = script && /(?:\\bturbo\\s+(?:run\\s+)?test\\b|\\bpnpm\\s+(?:-r|--recursive|--filter\\s+\\S+)\\s+(?:run\\s+)?test\\b)/.test(script);\nconst otherRunner = script && /(?:^|&&\\s*|;\\s*)(?:(?:pnpm\\s+exec|npx)\\s+)?(?:node\\s+(?:\\S+\\s+)*--test(?=\\s|$)|(?:jest|mocha|ava|tap)(?=\\s|$)|bun\\s+test(?=\\s|$))/.test(script);\nif (otherRunner) {\n issues.push({ kind: \"runner\", reason: 'package.json scripts.test = ' + JSON.stringify(script) + '; mutant.cafe only runs Vitest' });\n} else {\n if (!vitestScript) issues.push({ kind: \"warning\", reason: 'package.json scripts.test = ' + JSON.stringify(script) + (delegated ? '; delegated test runner: Vitest selection is unverified' : '; unknown test wrapper: Vitest selection is unverified') });\n let ctx;\n try {\n const { createVitest } = await import(\"vitest/node\");\n ctx = await createVitest(\"test\", { root, watch: false, cache: false, fsModuleCache: false });\n const selected = new Set((await ctx.globTestSpecifications()).map(spec => resolve(spec.moduleId)));\n const sources = new Map();\n async function walk(dir) {\n for (const entry of await readdir(dir, { withFileTypes: true })) {\n if ([\"node_modules\", \".git\", \".brain\", \".pi\", \".agent_sources\", \"mutants.out\", \"dist\"].includes(entry.name)) continue;\n const file = resolve(dir, entry.name);\n if (entry.isDirectory()) await walk(file);\n else if (/\\.[cm]?[jt]sx?$/.test(file)) sources.set(file, await readFile(file, \"utf8\"));\n }\n }\n await walk(root);\n // Read only explicit rootDir/outDir evidence, including JSONC and extends.\n // Do not depend on a compiler API in the tested package or infer build layout.\n async function configOptions(file, seen = new Set()) {\n if (seen.has(file)) throw new Error('cyclic tsconfig extends');\n const text = await readFile(file, 'utf8');\n const json = text.replace(/\"(?:\\\\.|[^\"\\\\])*\"|\\/\\*[\\s\\S]*?\\*\\/|\\/\\/[^\\r\\n]*/g, token => token.startsWith('\"') ? token : token.replace(/[^\\r\\n]/g, ' '))\n .replace(/(\"(?:\\\\.|[^\"\\\\])*\")|,\\s*(?=[}\\]])/g, (token, string) => string ?? '');\n const config = JSON.parse(json);\n let options = {};\n for (const base of Array.isArray(config.extends) ? config.extends : typeof config.extends === 'string' ? [config.extends] : []) {\n const path = base.startsWith('.') || isAbsolute(base) ? resolve(dirname(file), base) : createRequire(file).resolve(base);\n const candidate = await readFile(path).then(() => path, () => path + '.json');\n options = { ...options, ...await configOptions(candidate, new Set([...seen, file])) };\n }\n for (const key of ['rootDir', 'outDir']) if (typeof config.compilerOptions?.[key] === 'string') options[key] = resolve(dirname(file), config.compilerOptions[key]);\n return options;\n }\n let options = {};\n try { options = await configOptions(resolve(root, process.argv[1])); }\n catch { /* No proven mapping: restrict by importing tests only. */ }\n function sourceFile(path) {\n return [path, path.replace(/\\.[cm]?js$/, '.ts'), path.replace(/\\.[cm]?js$/, '.mts'), path.replace(/\\.[cm]?js$/, '.cts'), path + '.ts', path + '.tsx', path + '.mts', path + '.cts', resolve(path, 'index.ts')].find(p => sources.has(p) && !/\\.d\\.[cm]?ts$/.test(p));\n }\n function exportTypes(specifier) {\n const key = specifier === pkg.name ? '.' : './' + specifier.slice(pkg.name.length + 1);\n let entry = pkg.exports;\n let wildcard;\n if (entry && typeof entry === 'object' && Object.keys(entry).some(key => key.startsWith('.'))) {\n if (key in entry) entry = entry[key];\n else {\n const pattern = Object.keys(entry).find(pattern => pattern.includes('*') && key.startsWith(pattern.split('*')[0]) && key.endsWith(pattern.split('*')[1]));\n if (!pattern) return;\n const [before, after] = pattern.split('*');\n wildcard = key.slice(before.length, after.length ? -after.length : undefined);\n entry = entry[pattern];\n }\n } else if (key !== '.') return;\n function types(value) {\n if (!value || typeof value !== 'object') return;\n if (typeof value.types === 'string') return value.types;\n return types(value.types) ?? types(value.import) ?? types(value.default);\n }\n const path = types(entry) ?? (key === '.' ? pkg.types : undefined);\n return typeof path === 'string' ? resolve(root, wildcard === undefined ? path : path.replaceAll('*', wildcard)) : undefined;\n }\n function mappedSource(entry, types) {\n for (const path of [types, entry]) {\n if (!path) continue;\n if (/\\.[cm]?tsx?$/.test(path) && !/\\.d\\.[cm]?ts$/.test(path)) {\n const direct = sourceFile(path);\n if (direct) return direct;\n }\n if (!options.rootDir || !options.outDir) continue;\n const inside = relative(options.outDir, path);\n if (inside === '..' || inside.startsWith('..' + sep) || isAbsolute(inside)) continue;\n const stem = inside.replace(/(?:\\.d)?\\.[cm]?[jt]sx?$/, '');\n const mapped = sourceFile(resolve(options.rootDir, stem));\n if (mapped) return mapped;\n }\n }\n const edges = new Map();\n const built = [];\n for (const [file, text] of sources) {\n const dependencies = new Set();\n edges.set(file, dependencies);\n for (const match of text.matchAll(/(?:from\\s*|import\\s*\\(?\\s*|require\\s*\\(\\s*)[\"']([^\"']+)[\"']/g)) {\n let target;\n let source;\n const specifier = match[1];\n if (specifier.startsWith('.')) target = resolve(dirname(file), specifier);\n else {\n try {\n const self = pkg.name && (specifier === pkg.name || specifier.startsWith(pkg.name + '/'));\n target = self ? fileURLToPath(import.meta.resolve(specifier)) : createRequire(file).resolve(specifier);\n if (self && (!/\\.[cm]?tsx?$/.test(target) || /\\.d\\.[cm]?ts$/.test(target))) {\n source = mappedSource(target, exportTypes(specifier));\n built.push({ importer: file, source, reason: relative(root, file) + ' imports ' + specifier + '; self entry resolves to built output ' + relative(root, target) + ', not mutated TypeScript source' + (source ? '; mapped source ' + relative(root, source) : '; source mapping unavailable') });\n }\n } catch { continue; }\n }\n const candidate = source ?? sourceFile(target);\n if (candidate) dependencies.add(candidate);\n }\n }\n function dependencies(file, seen = new Set()) {\n if (seen.has(file)) return seen;\n seen.add(file);\n for (const dependency of edges.get(file) ?? []) dependencies(dependency, seen);\n return seen;\n }\n const closures = new Map([...selected].map(file => [file, dependencies(file)]));\n for (const entry of built) {\n const testFiles = [...selected].filter(file => closures.get(file).has(entry.importer)).map(file => relative(root, file));\n if (testFiles.length) issues.push({ kind: 'built', ...(entry.source ? { files: [...dependencies(entry.source)].map(file => relative(root, file)) } : {}), testFiles, reason: entry.reason });\n }\n const reached = new Set([...closures.values()].flatMap(files => [...files]));\n for (const [file, text] of sources) {\n const testFile = /\\.(?:test|spec)\\.[cm]?[jt]sx?$/.test(file)\n || (/[\"'](?:node:test|vitest|@effect\\/vitest)[\"']/.test(text) && /\\b(?:it|test|describe)\\s*(?:\\.|\\()/.test(text));\n if (reached.has(file) || !testFile) continue;\n for (const target of dependencies(file)) {\n if (target !== file) issues.push({ kind: 'target', file: relative(root, target), reason: relative(root, file) + ' imports this target but is absent from Vitest resolved test files' });\n }\n }\n } catch (error) {\n issues.push({ kind: 'warning', reason: 'Cannot verify Vitest resolved selection: ' + String(error) });\n } finally { await ctx?.close(); }\n}\nconsole.log('mutant-cafe-preflight:' + JSON.stringify([...new Map(issues.map(issue => [JSON.stringify(issue), issue])).values()]));\n`;\n\nexport const preflight = Effect.fn(\"TestRunner.preflight\")(function* (root: string, tsconfig = \"tsconfig.json\") {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(ChildProcess.make(\"node\", [\"--input-type=module\", \"--eval\", probe, tsconfig], { cwd: root, stdin: \"ignore\" }));\n const encoded = output.split(\"\\n\").find(line => line.startsWith(\"mutant-cafe-preflight:\"))?.slice(\"mutant-cafe-preflight:\".length);\n const issues = encoded === undefined\n ? [{ kind: \"warning\" as const, reason: \"Vitest selection probe returned no evidence\" }]\n : yield* Schema.decodeEffect(Schema.fromJsonString(Issues))(encoded);\n return issues;\n});\n\n/** Only runner/omitted-target evidence is unconditional. Built imports require\n * both a source-closure match (when known) and the actual selected test set. */\nexport function unreliableFor(baseline: Baseline, file: string, testFiles?: ReadonlyArray<string>): ReadonlyArray<SelectionIssue> {\n return baseline.unreliable?.filter(issue => {\n switch (issue.kind) {\n case \"runner\": return true;\n case \"warning\": return false;\n case \"target\": return issue.file === file;\n case \"built\": return (issue.files === undefined || issue.files.includes(file))\n && (testFiles?.some(test => issue.testFiles.includes(test)) ?? false);\n }\n }) ?? [];\n}\n", "import {\n MutantSource, MutantResult, NotMutated, Reporter, Scratch, TestRunner,\n type Baseline, BaselineFailed, type Mutant,\n type ProgramLoadError, type ReportWriteError, type RunConfig, type RunReport,\n type ScratchDir, type ScratchError, type TestSpawnError\n} from \"@mutant-cafe/core\";\nimport { createEffectActor, createEffectLogic, join, send, setupEffect } from \"@xstate/effect\";\nimport { types } from \"xstate\";\nimport * as Effect from \"effect/Effect\";\nimport * as Pool from \"effect/Pool\";\nimport * as Path from \"effect/Path\";\nimport * as Result from \"effect/Result\";\nimport * as Schema from \"effect/Schema\";\nimport * as Scope from \"effect/Scope\";\nimport * as Stream from \"effect/Stream\";\nimport { unreliableFor } from \"./Preflight.ts\";\n\ntype RunError = BaselineFailed | ScratchError | TestSpawnError | ProgramLoadError | ReportWriteError;\n// XState freezes plain context objects in development. A pool is a live\n// resource, not immutable run data; keep its internals behind a class handle.\nclass ScratchPool {\n readonly value: Pool.Pool<ScratchDir, ScratchError>;\n constructor(value: Pool.Pool<ScratchDir, ScratchError>) { this.value = value; }\n}\ninterface RunState {\n readonly baseline: Baseline;\n readonly timeoutMs: number;\n readonly failure: RunError | undefined;\n readonly pool: ScratchPool | undefined;\n readonly pending: ReadonlyArray<Mutant>;\n readonly results: ReadonlyArray<MutantResult>;\n readonly reported: boolean;\n readonly notMutated: ReadonlyArray<NotMutated>;\n}\n\n/** A separate actor owns each run. Its resources outlive invoked phase tasks. */\nexport const runMutants = Effect.fn(\"Runner.runMutants\")(function* (\n config: RunConfig, mutants?: Stream.Stream<Mutant, ProgramLoadError>\n) {\n const scratch = yield* Scratch;\n const tests = yield* TestRunner;\n const source = yield* MutantSource;\n const reporter = yield* Reporter;\n const scope = yield* Scope.Scope;\n const path = yield* Path.Path;\n const jobs = Math.max(1, Math.floor(config.jobs));\n const report = (state: RunState): RunReport => ({\n schemaVersion: 2, tool: \"mutant.cafe\", root: config.root,\n baseline: state.baseline, timeoutMs: state.timeoutMs, results: state.results, notMutated: state.notMutated,\n ...(state.failure === undefined ? {} : { failure: state.failure._tag === \"BaselineFailed\" ? `${state.failure._tag}: ${state.failure.command.join(\" \")}\\n${state.failure.output.slice(-8000)}` : String(state.failure) })\n });\n const capture = <A, R>(effect: Effect.Effect<A, RunError, R>) => Effect.result(effect);\n const copying = createEffectLogic(() => capture(Effect.gen(function* () {\n const pool = yield* Pool.make({ acquire: scratch.acquire(config.root), size: jobs }).pipe(\n Effect.provideService(Scope.Scope, scope));\n // Force the first acquisition in the copying phase. The pool owns the\n // tree; this short lease does not reserve a worker during later tests.\n yield* Effect.scoped(Pool.get(pool));\n return new ScratchPool(pool);\n })));\n const baselining = createEffectLogic(({ input }: { input: ScratchPool | undefined }) => capture(Effect.gen(function* () {\n if (input === undefined) return yield* Effect.die(\"Missing scratch pool\");\n const baseline = yield* Effect.scoped(Effect.gen(function* () {\n const dir = yield* Pool.get(input.value);\n return yield* tests.baseline(dir, path.isAbsolute(config.tsconfig) ? path.relative(config.root, config.tsconfig) : config.tsconfig);\n }));\n return { baseline, timeoutMs: config.timeoutMs ?? Math.max(config.minimumTimeoutMs, Math.ceil(config.timeoutMultiplier * baseline.durationMs)) };\n })));\n const generating = createEffectLogic(() => capture(Stream.runCollect(mutants ?? source.generate(config))));\n const testing = createEffectLogic(({ input }: { input: {\n readonly state: RunState;\n readonly record: (result: MutantResult) => Effect.Effect<void>;\n readonly skip: (entry: NotMutated) => Effect.Effect<void>;\n } }) => capture(Effect.gen(function* () {\n const dirs = input.state.pool?.value;\n if (dirs === undefined) return yield* Effect.die(\"Missing scratch pool\");\n // Measure the original related selection once per file before applying any\n // mutant. Slow unrelated tests must not manufacture a caught never mutant.\n const neverBudgets = new Map<string, number>();\n for (const mutant of input.state.pending) {\n if (mutant.genre !== \"EffectNever\" || neverBudgets.has(mutant.file) || unreliableFor(input.state.baseline, path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file).length > 0) continue;\n const measured = yield* Effect.scoped(Effect.gen(function* () {\n const dir = yield* Pool.get(dirs);\n return yield* tests.runRelated(dir, path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file, input.state.timeoutMs);\n }));\n if (measured.status === \"failed\" || measured.status === \"timedOut\") {\n return yield* new BaselineFailed({ exitCode: 1, output: measured.output, command: measured.command });\n }\n neverBudgets.set(mutant.file, Math.max(config.neverTimeoutMs, Math.ceil(measured.durationMs * config.timeoutMultiplier)));\n }\n yield* Stream.fromIterable(input.state.pending).pipe(\n Stream.mapEffect((mutant) => Effect.scoped(Effect.gen(function* () {\n const viability = yield* source.checkViable(mutant);\n if (viability.analysisFailed) { yield* input.skip(viability.analysisFailed); return; }\n if (!viability.viable) {\n const result: MutantResult = { mutant, outcome: \"unviable\", durationMs: 0, testCommand: [], diagnostics: viability.diagnostics };\n yield* input.record(result);\n yield* reporter.progress(result);\n return;\n }\n const localFile = path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file;\n const unreliable = unreliableFor(input.state.baseline, localFile);\n if (unreliable.length) {\n const result: MutantResult = { mutant, outcome: \"unreliable\", durationMs: 0, testCommand: input.state.baseline.testCommand, diagnostics: unreliable.map(issue => issue.reason) };\n yield* input.record(result);\n yield* reporter.progress(result);\n return;\n }\n const dir = yield* Pool.get(dirs);\n const run = yield* Effect.acquireUseRelease(\n dir.apply(mutant),\n () => tests.runRelated(dir, path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file, mutant.genre === \"EffectNever\" ? neverBudgets.get(mutant.file)! : input.state.timeoutMs),\n // A dirty directory must never return to the pool, even on cancel.\n () => dir.revert(mutant).pipe(Effect.orDie)\n );\n const selectedIssues = unreliableFor(input.state.baseline, localFile, run.testFiles);\n const result: MutantResult = {\n mutant,\n // A kill before collection proves nothing about whether tests noticed.\n outcome: selectedIssues.length ? \"unreliable\" : run.status === \"timedOut\" ? (mutant.genre === \"EffectNever\" && run.testsCollected ? \"caught\" : \"timeout\")\n : run.status === \"failed\" ? \"caught\" : run.status === \"untested\" ? \"untested\" : \"missed\",\n durationMs: run.durationMs,\n testCommand: run.command,\n diagnostics: selectedIssues.map(issue => issue.reason),\n ...(run.output === \"\" ? {} : { output: run.output })\n };\n yield* input.record(result);\n yield* reporter.progress(result);\n })), { concurrency: jobs }),\n Stream.runDrain\n );\n })));\n const reporting = createEffectLogic(({ input }: { input: RunState }) => capture(\n input.reported ? Effect.void : reporter.write(report(input))\n ));\n // generating -> (empty: reporting | copying -> baseline -> testing) -> reporting -> done.\n // Domain failures travel as actor outputs; completed results are events so\n // interruption can report the machine's current state, not a task-local array.\n const machine = setupEffect({\n schemas: {\n context: types<RunState>(),\n events: { CANCEL: Schema.Struct({}), RESULT: Schema.Struct({ result: MutantResult }), SKIP: Schema.Struct({ entry: NotMutated }) }\n },\n actors: { copying, baselining, generating, testing, reporting }\n }).createMachine({\n context: {\n baseline: { durationMs: 0, testCommand: [] },\n timeoutMs: config.timeoutMs ?? config.minimumTimeoutMs,\n failure: undefined, pool: undefined, pending: [], results: [], reported: false, notMutated: []\n },\n output: ({ context }) => context,\n initial: \"generating\",\n on: {\n CANCEL: { target: \".interrupted\" },\n SKIP: ({ context, event }) => ({ context: { ...context, notMutated: [...new Map([...context.notMutated, event.entry].map(entry => [JSON.stringify(entry), entry])).values()] } }),\n RESULT: ({ context, event }) => ({ context: { ...context, results: [...context.results, event.result] } })\n },\n states: {\n copying: { invoke: { src: \"copying\", onDone: ({ context, event }) => Result.isSuccess(event.output)\n ? { target: \"baseline\", context: { ...context, pool: event.output.success } }\n : { target: \"failed\", context: { ...context, failure: event.output.failure } } } },\n baseline: { invoke: {\n src: \"baselining\", input: ({ context }) => context.pool,\n onDone: ({ context, event }) => Result.isSuccess(event.output)\n ? { target: \"testing\", context: { ...context, ...event.output.success } }\n : { target: \"reporting\", context: { ...context, failure: event.output.failure,\n baseline: event.output.failure._tag === \"BaselineFailed\" ? { durationMs: 0, testCommand: event.output.failure.command } : context.baseline\n } }\n } },\n generating: { invoke: { src: \"generating\", onDone: ({ context, event }) => Result.isSuccess(event.output)\n ? { target: event.output.success.length ? \"copying\" : \"reporting\", context: { ...context, pending: event.output.success } }\n : { target: \"reporting\", context: { ...context, failure: event.output.failure } } } },\n testing: { invoke: {\n src: \"testing\", input: ({ context, self }) => ({\n state: context,\n // Queue completion before progress can trigger CANCEL. The parent's\n // FIFO mailbox commits this result before handling that cancellation.\n record: (result) => send(self, { type: \"RESULT\", result }),\n skip: (entry) => send(self, { type: \"SKIP\", entry })\n }),\n onDone: ({ context, event }) => ({ target: \"reporting\", context: {\n ...context, failure: Result.isFailure(event.output) ? event.output.failure : context.failure\n } })\n } },\n reporting: { invoke: {\n src: \"reporting\", input: ({ context }) => context,\n onDone: ({ context, event }) => ({ target: \"done\", context: {\n ...context, reported: Result.isSuccess(event.output), failure: Result.isFailure(event.output) ? event.output.failure : context.failure\n } })\n } },\n interrupted: { invoke: {\n src: \"reporting\", input: ({ context }) => context,\n onDone: ({ context, event }) => ({ target: \"done\", context: {\n ...context, reported: Result.isSuccess(event.output), failure: Result.isFailure(event.output) ? event.output.failure : context.failure\n } })\n } },\n failed: { type: \"final\" },\n done: { type: \"final\" }\n }\n });\n // Close the actor host before the outer pool scope. Stopping an invocation\n // requests interruption; host release waits for its process/revert finalizers.\n const state = yield* Effect.scoped(Effect.gen(function* () {\n const actor = yield* createEffectActor(machine);\n // Domain failures are task outputs; only unexpected actor defects reach join.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off -- Domain errors are captured above.\n return yield* join(actor).pipe(Effect.orDie, Effect.onInterrupt(() => Effect.gen(function* () {\n yield* send(actor, { type: \"CANCEL\" });\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off -- Wait for the partial report before releasing the actor host.\n yield* join(actor).pipe(Effect.orDie);\n })));\n }));\n if (state.failure !== undefined) return yield* state.failure;\n return report(state);\n}, Effect.scoped);\n", "import { ConfigFile, MutantList, MutantSource, Reporter, RunConfig, type BaselineFailed, type Mutant, type ProgramLoadError, ReportWriteError, type RunReport, type Scratch, type ScratchError, type TestRunner, type TestSpawnError } from \"@mutant-cafe/core\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Ref from \"effect/Ref\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as Command from \"effect/cli/Command\";\nimport * as Flag from \"effect/cli/Flag\";\nimport { selectDiffScope } from \"./Diff.ts\";\nimport { errorExitCode, reportExitCode } from \"./ExitCode.ts\";\nimport { makeReporter, mutantLine } from \"./Reporter.ts\";\nimport { markdownSummary } from \"./Summary.ts\";\n\nimport { git, repositoryRoot, UsageError } from \"./Git.ts\";\nexport { UsageError } from \"./Git.ts\";\n\nexport type Run = (config: RunConfig, mutants: ReadonlyArray<Mutant>) => Effect.Effect<RunReport,\n BaselineFailed | ScratchError | TestSpawnError | ProgramLoadError | ReportWriteError,\n MutantSource | Scratch | TestRunner | Reporter | Path.Path>;\n\nconst flags = {\n list: Flag.Boolean(\"list\").pipe(Flag.withDefault(false), Flag.withDescription(\"List mutants and skipped function count without running tests\")),\n inDiff: Flag.String(\"in-diff\").pipe(Flag.optional, Flag.withDescription(\"Only mutate bodies overlapping this unified diff\")),\n inDiffRange: Flag.String(\"in-diff-range\").pipe(Flag.optional, Flag.withDescription(\"Only mutate bodies overlapping git diff A...B or A..B; exclusive with --in-diff\")),\n maxMutants: Flag.Int(\"max-mutants\").pipe(Flag.optional, Flag.withDescription(\"Keep first N selected mutants ordered by repository path, line, column, id; N >= 0\")),\n format: Flag.String(\"format\").pipe(Flag.withDefault(\"text\"), Flag.withDescription(\"Output format: text (default), json (--list only), or github (Markdown and GITHUB_STEP_SUMMARY)\")),\n summaryMd: Flag.String(\"summary-md\").pipe(Flag.optional, Flag.withDescription(\"Write Markdown summary to this file\")),\n summaryMarker: Flag.String(\"summary-marker\").pipe(Flag.withDefault(\"<!-- mutant.cafe -->\"), Flag.withDescription(\"Override the first-line sticky-comment marker\")),\n advisory: Flag.Boolean(\"advisory\").pipe(Flag.withDefault(false), Flag.withDescription(\"Exit 0 for outcomes and baseline failure; keep usage/internal errors\")),\n include: Flag.String(\"file\").pipe(Flag.atLeast(0), Flag.withDescription(\"Include source glob relative to package root; repeatable\")),\n exclude: Flag.String(\"exclude\").pipe(Flag.atLeast(0), Flag.withDescription(\"Exclude source glob; repeatable\")),\n exportedOnly: Flag.Boolean(\"exported-only\").pipe(Flag.withDefault(false), Flag.withDescription(\"Only exported binding paths, returned curried functions and Layer service methods; exclude local helpers\")),\n jobs: Flag.Int(\"jobs\").pipe(Flag.optional, Flag.withDescription(\"Concurrent scratch/test workers; default 1\")),\n timeout: Flag.Finite(\"timeout\").pipe(Flag.optional, Flag.withDescription(\"Absolute test timeout in seconds\")),\n timeoutMultiplier: Flag.Finite(\"timeout-multiplier\").pipe(Flag.optional, Flag.withDescription(\"Baseline duration multiplier; default 5\")),\n minimumTimeout: Flag.Finite(\"minimum-test-timeout\").pipe(Flag.optional, Flag.withDescription(\"Minimum test timeout in seconds\")),\n output: Flag.String(\"output\").pipe(Flag.withDefault(\"mutants.out\"), Flag.withDescription(\"Report directory; default mutants.out\")),\n tsconfig: Flag.String(\"tsconfig\").pipe(Flag.withDefault(\"tsconfig.json\"), Flag.withDescription(\"TypeScript project path; default tsconfig.json\")),\n};\n\nexport const makeCommand = (options: {\n readonly root: string;\n readonly run: Run;\n readonly onExit?: (code: number) => Effect.Effect<void>;\n}) => Command.make(\"mutant-cafe\", flags, (input) => Effect.gen(function*() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const root = path.resolve(options.root);\n const range = Option.getOrUndefined(input.inDiffRange);\n const inDiff = Option.getOrUndefined(input.inDiff);\n const maxMutants = Option.getOrUndefined(input.maxMutants);\n const summaryMd = Option.getOrUndefined(input.summaryMd);\n if (range !== undefined && inDiff !== undefined) return yield* new UsageError({ message: \"--in-diff-range and --in-diff are mutually exclusive\" });\n if (range !== undefined && (!/^[^\\s.][^\\s]*\\.{2,3}[^\\s.][^\\s]*$/.test(range) || range.startsWith(\"-\") || range.includes(\"....\"))) {\n return yield* new UsageError({ message: \"--in-diff-range expects A...B or A..B\" });\n }\n if (maxMutants !== undefined && (!Number.isSafeInteger(maxMutants) || maxMutants < 0)) return yield* new UsageError({ message: \"--max-mutants must be a nonnegative safe integer\" });\n if (![\"text\", \"json\", \"github\"].includes(input.format) || (input.format === \"json\" && !input.list)) return yield* new UsageError({ message: \"--format expects text, github, or json with --list\" });\n if (/[\\r\\n]/.test(input.summaryMarker)) return yield* new UsageError({ message: \"--summary-marker must be one line\" });\n const gitRoot = range !== undefined ? yield* repositoryRoot(root) : yield* repositoryRoot(root).pipe(Effect.catch(() => Effect.succeed(root)));\n const diffText = range === undefined ? undefined : yield* git(gitRoot, [\"diff\", \"--no-ext-diff\", \"--no-color\", range, \"--\"]);\n const configPath = path.join(root, \"mutants.config.json\");\n const fileConfig = (yield* fs.exists(configPath))\n ? yield* fs.readFileString(configPath).pipe(\n Effect.flatMap(Schema.decodeEffect(Schema.fromJsonString(ConfigFile))),\n Effect.mapError((error) => new UsageError({ message: `Invalid mutants.config.json: ${String(error)}` })),\n ) : {};\n const timeoutMs = Option.map(input.timeout, (seconds) => Math.ceil(seconds * 1000));\n const config = yield* Schema.decodeEffect(RunConfig)({\n root,\n tsconfig: input.tsconfig,\n exportedOnly: input.exportedOnly,\n include: input.include.length > 0 ? input.include : fileConfig.include ?? [\"**/*.{ts,tsx}\"],\n exclude: input.exclude.length > 0 ? input.exclude : fileConfig.exclude ?? [],\n functionFilter: fileConfig.functionFilter ?? [],\n ...(inDiff === undefined ? {} : { inDiff }),\n jobs: Option.getOrElse(input.jobs, () => fileConfig.jobs ?? 1),\n ...(Option.isSome(timeoutMs) ? { timeoutMs: timeoutMs.value } : {}),\n timeoutMultiplier: Option.getOrElse(input.timeoutMultiplier, () => fileConfig.timeoutMultiplier ?? 5),\n minimumTimeoutMs: Option.match(input.minimumTimeout, { onNone: () => fileConfig.minimumTimeoutMs ?? 20_000, onSome: (seconds) => Math.ceil(seconds * 1000) }),\n neverTimeoutMs: 1_000,\n outDir: input.output,\n }).pipe(Effect.mapError((error) => new UsageError({ message: String(error) })));\n if (config.jobs < 1 || config.timeoutMultiplier <= 0 || config.minimumTimeoutMs <= 0 || (config.timeoutMs !== undefined && config.timeoutMs <= 0)) {\n return yield* new UsageError({ message: \"Jobs and timeout values must be positive\" });\n }\n const source = yield* MutantSource;\n const generated = yield* Stream.runCollect(source.generate(config)).pipe(\n Effect.mapError((error) => error.reason === \"selection\"\n ? new UsageError({ message: error.diagnostics.join(\"\\n\") }) : error)\n );\n const skipped = yield* source.notMutated(config);\n const selected = inDiff === undefined && diffText === undefined ? { mutants: generated, notMutated: skipped }\n : yield* selectDiffScope({ root, diffPath: inDiff ?? `git diff ${range}`, ...(diffText === undefined ? {} : { diffText }), mutants: generated, notMutated: skipped });\n const relative = (mutant: Mutant) => path.relative(gitRoot, path.resolve(root, mutant.file)).replaceAll(\"\\\\\", \"/\");\n const compare = (a: string, b: string) => a < b ? -1 : a > b ? 1 : 0;\n const ordered = [...selected.mutants].sort((a, b) => compare(relative(a), relative(b)) || a.span.start.line - b.span.start.line || a.span.start.column - b.span.start.column || compare(a.id, b.id));\n const mutants = ordered.slice(0, maxMutants);\n const notMutated = selected.notMutated;\n const counts = { selected: ordered.length, run: 0, budgetSkipped: ordered.length - mutants.length };\n if (mutants.length === 0) {\n const cause = ordered.length > 0 ? \"budget\" : range !== undefined ? \"range\"\n : inDiff !== undefined || diffText !== undefined ? \"diff\"\n : config.functionFilter.length || config.exportedOnly ? \"filter\" : \"file selection\";\n yield* Console.error(`0 mutants selected (${counts.selected} before budget); cause: ${cause}. Baseline skipped.`);\n }\n const markdown = input.format === \"github\" || summaryMd !== undefined ? {\n gitRoot, marker: input.summaryMarker, advisory: input.advisory, stdout: input.format === \"github\",\n files: [...(summaryMd === undefined ? [] : [path.resolve(root, summaryMd)]),\n ...(input.format === \"github\" && process.env.GITHUB_STEP_SUMMARY ? [process.env.GITHUB_STEP_SUMMARY] : [])],\n } : undefined;\n if (input.list && markdown !== undefined) {\n const text = markdownSummary({ ...markdown, root, path, notMutated: notMutated.length,\n report: { schemaVersion: 2, tool: \"mutant.cafe\", root, baseline: { durationMs: 0, testCommand: [] }, timeoutMs: 0, results: [], ...counts } });\n for (const file of new Set(markdown.files)) yield* fs.writeFileString(file, text).pipe(\n Effect.mapError(error => new ReportWriteError({ path: file, message: String(error) })));\n if (markdown.stdout) {\n yield* Console.log(text);\n if (options.onExit !== undefined) yield* options.onExit(0);\n return;\n }\n }\n if (input.list && input.format === \"json\") {\n yield* Console.log(yield* Schema.encodeEffect(Schema.fromJsonString(MutantList))({ schemaVersion: 2, tool: \"mutant.cafe\", mutants, notMutated, counts }));\n if (options.onExit !== undefined) yield* options.onExit(0);\n return;\n }\n if (input.list) {\n for (const mutant of mutants) yield* Console.log(mutantLine(mutant, config.root, path));\n const perFile = new Map<string, number>();\n for (const mutant of mutants) {\n const file = path.relative(root, path.resolve(root, mutant.file));\n perFile.set(file, (perFile.get(file) ?? 0) + 1);\n }\n for (const [file, count] of [...perFile].sort(([a], [b]) => a.localeCompare(b))) yield* Console.log(`${file}: ${count} mutants`);\n yield* Console.log(`${mutants.length} mutants total; ${notMutated.length} not mutated; ${counts.selected} selected, 0 run, ${counts.budgetSkipped} budget-skipped`);\n if (options.onExit !== undefined) yield* options.onExit(0);\n return;\n }\n const reporter = yield* makeReporter({ root, outDir: config.outDir, mutants, notMutated, selected: counts.selected, budgetSkipped: counts.budgetSkipped, ...(markdown === undefined ? {} : { markdown }) });\n // Selection is final here: no scratch tree or test process can add information when it is empty.\n const report = yield* (mutants.length === 0\n ? Effect.succeed<RunReport>({ schemaVersion: 2, tool: \"mutant.cafe\", root,\n baseline: { durationMs: 0, testCommand: [] }, timeoutMs: 0, results: [] })\n : options.run(config, mutants)).pipe(Effect.provideService(Reporter, reporter),\n Effect.catchTag(\"BaselineFailed\", error => Effect.gen(function*() {\n const failed: RunReport = { schemaVersion: 2, tool: \"mutant.cafe\", root,\n baseline: { durationMs: 0, testCommand: error.command }, timeoutMs: config.timeoutMs ?? config.minimumTimeoutMs, results: [],\n failure: `BaselineFailed: ${error.command.join(\" \")}\\n${error.output.slice(-8000)}` };\n yield* reporter.write(failed);\n if (!input.advisory) return yield* error;\n if (markdown === undefined) yield* Console.log(\"Advisory: baseline failed; would exit 4 without --advisory.\");\n return failed;\n })));\n if (input.advisory && reportExitCode(report) !== 0 && markdown === undefined) yield* Console.log(`Advisory: would exit ${reportExitCode(report)} without --advisory.`);\n yield* reporter.write(report);\n if (options.onExit !== undefined) yield* options.onExit(input.advisory ? 0 : reportExitCode(report));\n}));\n\n// The executable's runtime supplies core services. No engine or runner package is\n// imported here; the integration layer owns that choice.\nexport const runCli = Effect.fn(\"runCli\")(function*(options: {\n readonly root: string;\n readonly args: ReadonlyArray<string>;\n readonly run: Run;\n}) {\n const code = yield* Ref.make(0);\n const command = makeCommand({ ...options, onExit: (value) => Ref.set(code, value) });\n yield* Command.runWith(command, { version: \"0.1.5\" })(options.args).pipe(\n Effect.catch((error) => Effect.gen(function*() {\n yield* Console.error(error._tag === \"ProgramLoadError\" ? `${error.tsconfig}:\\n${error.diagnostics.join(\"\\n\")}`\n : error._tag === \"BaselineFailed\" ? `Baseline failed (${error.exitCode}): ${error.command.join(\" \")}\\n${error.output.slice(-8000)}`\n : String(error));\n yield* Ref.set(code, errorExitCode(error));\n })),\n Effect.catchDefect((defect) => Effect.gen(function*() {\n yield* Console.error(`Internal error: ${String(defect)}`);\n yield* Ref.set(code, 70);\n })),\n );\n return yield* Ref.get(code);\n});\n", "import { DiffParseError, type Mutant, type NotMutated } from \"@mutant-cafe/core\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\n\nexport class DiffMismatch extends Schema.TaggedError<DiffMismatch>()(\"DiffMismatch\", {\n path: Schema.String,\n message: Schema.String,\n}) {}\n\ninterface NewLine { readonly number: number; readonly text: string; readonly added: boolean; readonly noNewline: boolean }\ninterface FilePatch { readonly file: string; readonly lines: ReadonlyArray<NewLine> }\n\n// Counts, ordering and new-side text are checked, not merely the presence of @@.\nexport const parseDiff = (text: string, path: string) => Effect.try({\n try: (): ReadonlyArray<FilePatch> => {\n const fail = (message: string): never => { throw new DiffParseError({ path, message }); };\n if (text === \"\") return [];\n const input = text.split(\"\\n\");\n if (input.at(-1) === \"\") input.pop();\n const patches: FilePatch[] = [];\n let i = 0;\n let sawFile = false;\n while (i < input.length) {\n const line = input[i++]!;\n if (line.startsWith(\"diff --git \") || /^(index |new file mode |deleted file mode |old mode |new mode |similarity index |rename from |rename to )/.test(line)) continue;\n if (!line.startsWith(\"--- \")) fail(\"Expected a unified diff file header\");\n const next = input[i++];\n if (!next?.startsWith(\"+++ \")) fail(\"Missing new-side file header\");\n const raw = next!.slice(4).split(\"\\t\")[0]!;\n const decoded: unknown = raw.startsWith('\"') ? JSON.parse(raw) : raw;\n if (typeof decoded !== \"string\") fail(\"Invalid file path\");\n const file = String(decoded).replace(/^b\\//, \"\");\n const lines: NewLine[] = [];\n let hunks = 0;\n let previousEnd = 0;\n let previousOldEnd = 0;\n while (input[i]?.startsWith(\"@@\")) {\n const match = /^@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@(?:.*)$/.exec(input[i++]!);\n if (!match) fail(\"Invalid hunk header\");\n let oldRemaining = Number(match![2] ?? 1);\n let newRemaining = Number(match![4] ?? 1);\n let newLine = Number(match![3]);\n const oldStart = Number(match![1]);\n const oldCount = oldRemaining;\n if (![oldStart, oldRemaining, newLine, newRemaining].every(Number.isSafeInteger)) fail(\"Hunk range is not a safe integer\");\n if ((oldRemaining > 0 && oldStart === 0) || (newRemaining > 0 && newLine === 0)) fail(\"Nonempty hunk cannot start at zero\");\n if (newLine < previousEnd || oldStart < previousOldEnd) fail(\"Overlapping or unordered hunks\");\n let previousPrefix = \"\";\n const markNoNewline = () => {\n if (previousPrefix === \"+\" || previousPrefix === \" \") {\n const last = lines.at(-1);\n if (last === undefined || last.noNewline) fail(\"Unexpected no-newline marker\");\n lines[lines.length - 1] = { ...last!, noNewline: true };\n } else if (previousPrefix !== \"-\") fail(\"Unexpected no-newline marker\");\n previousPrefix = \"\";\n };\n hunks++;\n while (oldRemaining > 0 || newRemaining > 0) {\n const body = input[i++];\n if (body === \"\\\\") { markNoNewline(); continue; }\n if (body === undefined) fail(\"Truncated hunk\");\n const prefix = body![0];\n if (prefix === \" \" || prefix === \"-\") oldRemaining--;\n if (prefix === \" \" || prefix === \"+\") {\n newRemaining--;\n lines.push({ number: newLine++, text: body!.slice(1), added: prefix === \"+\", noNewline: false });\n } else if (prefix !== \"-\") fail(\"Invalid hunk line\");\n previousPrefix = prefix!;\n if (oldRemaining < 0 || newRemaining < 0) fail(\"Hunk count does not match its body\");\n }\n if (input[i] === \"\\\\") { markNoNewline(); i++; }\n previousEnd = newLine;\n previousOldEnd = oldStart + oldCount;\n }\n if (hunks === 0) fail(\"File has no hunks\");\n sawFile = true;\n if (file !== \"/dev/null\") patches.push({ file, lines });\n }\n if (!sawFile) fail(\"No unified diff found\");\n return patches;\n },\n catch: (error) => Schema.is(DiffParseError)(error) ? error : new DiffParseError({ path, message: String(error) }),\n});\n\nexport const selectDiffScope = Effect.fn(\"selectDiffScope\")(function*(options: {\n readonly root: string;\n readonly diffPath: string;\n readonly diffText?: string;\n readonly mutants: ReadonlyArray<Mutant>;\n readonly notMutated: ReadonlyArray<NotMutated>;\n}) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const diffPath = path.resolve(options.root, options.diffPath);\n const text = options.diffText ?? (yield* fs.readFileString(diffPath).pipe(Effect.mapError((error) => new DiffParseError({ path: diffPath, message: String(error) }))));\n const patches = yield* parseDiff(text, diffPath);\n const gitRoot = yield* Effect.scoped(Effect.gen(function* () {\n const handle = yield* ChildProcess.make(\"git\", [\"rev-parse\", \"--show-toplevel\"], { cwd: options.root, stderr: \"ignore\" });\n const [output, code] = yield* Effect.all([Stream.mkString(Stream.decodeText(handle.stdout)), handle.exitCode], { concurrency: \"unbounded\" });\n if (Number(code) !== 0 || !output.trim()) return options.root;\n const physicalRoot = yield* fs.realPath(options.root);\n return path.resolve(options.root, path.relative(physicalRoot, output.trim()));\n })).pipe(Effect.catch(() => Effect.succeed(options.root)));\n const changed = new Map<string, Set<number>>();\n for (const patch of patches) {\n const repositoryPath = path.resolve(gitRoot, patch.file);\n // Validate both interpretations against the tree: a --relative diff can\n // name a file that also exists at the toplevel but has different contents.\n const candidates = [...new Set([repositoryPath, path.resolve(options.root, patch.file)])];\n let absolute: string | undefined;\n for (const candidate of candidates) {\n const relative = path.relative(gitRoot, candidate);\n if (relative === \"..\" || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {\n return yield* new DiffParseError({ path: diffPath, message: \"Diff path escapes repository root\" });\n }\n if (!(yield* fs.exists(candidate))) continue;\n const current = yield* fs.readFileString(candidate).pipe(Effect.mapError((error) => new DiffMismatch({ path: patch.file, message: String(error) })));\n const lines = current.split(\"\\n\");\n const finalLine = current.endsWith(\"\\n\") ? lines.length - 1 : lines.length;\n if (patch.lines.every((line) => {\n const newlineMismatch = line.noNewline\n ? line.number !== finalLine || current.endsWith(\"\\n\")\n : line.number === finalLine && !current.endsWith(\"\\n\");\n return lines[line.number - 1] === line.text && !newlineMismatch;\n })) { absolute = candidate; break; }\n }\n if (absolute === undefined) return yield* new DiffMismatch({ path: patch.file, message: \"New-side lines do not match the tree at the Git toplevel or working directory\" });\n const added = changed.get(absolute) ?? new Set<number>();\n for (const line of patch.lines) if (line.added) added.add(line.number);\n changed.set(absolute, added);\n }\n return {\n mutants: options.mutants.filter((mutant) => {\n const added = changed.get(path.resolve(options.root, mutant.file));\n const end = mutant.span.end.line - (mutant.span.end.column === 1 ? 1 : 0);\n return added !== undefined && [...added].some((line) => line >= mutant.span.start.line && line <= end);\n }),\n notMutated: options.notMutated.filter(item => changed.has(path.resolve(options.root, item.file))),\n };\n});\n\nexport const selectInDiff = (options: {\n readonly root: string;\n readonly diffPath: string;\n readonly mutants: ReadonlyArray<Mutant>;\n}) => selectDiffScope({ ...options, notMutated: [] }).pipe(Effect.map(result => result.mutants));\n", "import type { RunReport } from \"@mutant-cafe/core\";\n\nexport const reportExitCode = (report: RunReport): number =>\n report.results.some((result) => result.outcome === \"missed\") ? 2 :\n report.results.some((result) => result.outcome === \"unreliable\") ? 7 :\n report.results.some((result) => result.outcome === \"untested\") ? 2 :\n report.results.some((result) => result.outcome === \"timeout\") ? 3 : 0;\n\nexport const errorExitCode = (error: { readonly _tag: string }): number => {\n switch (error._tag) {\n case \"BaselineFailed\": return 4;\n case \"DiffMismatch\": return 5;\n case \"DiffParseError\": return 6;\n case \"ProgramLoadError\": case \"UsageError\": case \"ShowHelp\": case \"InvalidValue\": case \"MissingFlag\":\n case \"UnrecognizedArgument\": return 1;\n default: return 70;\n }\n};\n", "import { Reporter, ReportWriteError, RunReport, Mutant, type MutantResult, type NotMutated } from \"@mutant-cafe/core\";\nimport * as Clock from \"effect/Clock\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport { unifiedDiff } from \"./UnifiedDiff.ts\";\nimport { countsLine, markdownSummary } from \"./Summary.ts\";\n\nexport const mutantLine = (mutant: Mutant, root: string, path: Path.Path): string =>\n `${path.relative(root, path.resolve(root, mutant.file))}:${mutant.span.start.line}:${mutant.span.start.column}: ${mutant.description.replace(mutant.returnType, shortType(mutant.displayReturnType ?? mutant.returnType))} [${mutant.id}]`;\n\nconst shortType = (text: string): string => {\n const line = text.replace(/\\s+/g, \" \");\n return line.length > 80 ? line.slice(0, 79) + \"\u2026\" : line;\n};\n\nconst outcomes = [\"caught\", \"missed\", \"timeout\", \"unviable\", \"untested\", \"unreliable\"] as const;\nconst jsonReport = Schema.encodeEffect(Schema.fromJsonString(RunReport));\nconst logText = (result: MutantResult): string => [\n ...(\"output\" in result && typeof result.output === \"string\" ? [result.output] : []),\n ...result.diagnostics,\n].join(\"\\n\");\n\nexport const makeReporter = Effect.fn(\"makeReporter\")(function*(options: {\n readonly root: string;\n readonly outDir: string;\n readonly mutants: ReadonlyArray<Mutant>;\n readonly notMutated?: ReadonlyArray<NotMutated>;\n readonly selected?: number;\n readonly budgetSkipped?: number;\n readonly markdown?: {\n readonly gitRoot: string;\n readonly marker: string;\n readonly advisory: boolean;\n readonly stdout: boolean;\n readonly files: ReadonlyArray<string>;\n };\n}) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const dir = path.resolve(options.root, options.outDir);\n const started = yield* Clock.currentTimeMillis;\n const semaphore = yield* Semaphore.make(1);\n const results: MutantResult[] = [];\n let pendingError: ReportWriteError | undefined;\n let summarized = false;\n const writeError = (error: unknown) => new ReportWriteError({ path: dir, message: String(error) });\n const ids = new Set<string>();\n for (const mutant of options.mutants) {\n if (!/^[A-Za-z0-9_-]+$/.test(mutant.id) || ids.has(mutant.id)) return yield* writeError(\"Mutant ids must be unique safe filenames\");\n ids.add(mutant.id);\n }\n yield* Effect.gen(function*() {\n // Rotating an ancestor would move the source tree. An unrelated output path\n // is allowed, but an old directory is removed only if it is our report.\n const relative = path.relative(dir, path.resolve(options.root));\n if (relative === \"\" || (relative !== \"..\" && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative))) {\n return yield* new ReportWriteError({ path: dir, message: \"Output cannot be the project root or an ancestor\" });\n }\n if (yield* fs.exists(dir)) {\n if (!(yield* fs.exists(path.join(dir, \"mutants.json\")))) return yield* writeError(\"Existing output is not a mutant report; choose another --output\");\n if (yield* fs.exists(`${dir}.old`)) {\n if (!(yield* fs.exists(path.join(`${dir}.old`, \"mutants.json\")))) return yield* writeError(\"Previous output is not a mutant report; choose another --output\");\n yield* fs.remove(`${dir}.old`, { recursive: true });\n }\n yield* fs.rename(dir, `${dir}.old`);\n }\n yield* fs.makeDirectory(path.join(dir, \"diff\"), { recursive: true });\n yield* fs.makeDirectory(path.join(dir, \"logs\"), { recursive: true });\n }).pipe(Effect.mapError(writeError));\n // Encode the actual core contract, not a second report shape.\n const encodedMutants = yield* Schema.encodeEffect(Schema.fromJsonString(Schema.Array(Mutant)))(options.mutants).pipe(Effect.mapError(writeError));\n yield* fs.writeFileString(path.join(dir, \"mutants.json\"), encodedMutants).pipe(Effect.mapError(writeError));\n yield* fs.writeFileString(path.join(dir, \"not-mutated.txt\"), (options.notMutated ?? []).map(item => `${path.relative(options.root, item.file)}:${item.span?.start.line ?? \"?\"}:${item.span?.start.column ?? \"?\"}: ${item.functionName}: ${item.reason}\\n`).join(\"\")).pipe(Effect.mapError(writeError));\n yield* Effect.forEach(outcomes, (outcome) => fs.writeFileString(path.join(dir, `${outcome}.txt`), \"\"), { discard: true }).pipe(Effect.mapError(writeError));\n for (const mutant of options.mutants) {\n const original = yield* fs.readFileString(path.resolve(options.root, mutant.file)).pipe(Effect.mapError(writeError));\n yield* fs.writeFileString(path.join(dir, \"diff\", `${mutant.id}.diff`), unifiedDiff(original, original.slice(0, mutant.replacement.startOffset) + mutant.replacement.text + original.slice(mutant.replacement.endOffset), path.relative(options.root, path.resolve(options.root, mutant.file)).replaceAll(\"\\\\\", \"/\"))).pipe(Effect.mapError(writeError));\n }\n const writeLists = (items: ReadonlyArray<MutantResult>) => Effect.forEach(outcomes, (outcome) => {\n const lines = items.filter((result) => result.outcome === outcome).map((result) => mutantLine(result.mutant, options.root, path));\n return fs.writeFileString(path.join(dir, `${outcome}.txt`), lines.length === 0 ? \"\" : lines.join(\"\\n\") + \"\\n\");\n }, { discard: true });\n const service = Reporter.of({\n progress: (result) => semaphore.withPermit(Effect.gen(function*() {\n results.push(result);\n if (!options.markdown?.stdout) yield* Console.log(`${result.outcome} ${mutantLine(result.mutant, options.root, path)} (${result.durationMs}ms)`);\n yield* Effect.gen(function*() {\n if (!ids.has(result.mutant.id)) return yield* writeError(\"Progress result does not belong to this report\");\n yield* writeLists(results);\n yield* fs.writeFileString(path.join(dir, \"logs\", `${result.mutant.id}.log`), logText(result));\n }).pipe(Effect.catch((error) => Effect.gen(function*() {\n if (pendingError === undefined) {\n pendingError = writeError(error);\n yield* Console.warn(`Report write failed: ${pendingError.message}`);\n }\n })));\n })),\n write: (report) => semaphore.withPermit(Effect.gen(function*() {\n if (pendingError !== undefined) return yield* pendingError;\n const notMutated = [...new Map([...(options.notMutated ?? []), ...(report.notMutated ?? [])].map(item => [JSON.stringify(item), item])).values()];\n yield* fs.writeFileString(path.join(dir, \"not-mutated.txt\"), notMutated.map(item => `${path.relative(options.root, item.file)}:${item.span?.start.line ?? \"?\"}:${item.span?.start.column ?? \"?\"}: ${item.functionName}: ${item.reason}\\n`).join(\"\")).pipe(Effect.mapError(writeError));\n const counted: RunReport = { ...report, notMutated, selected: options.selected ?? options.mutants.length,\n run: report.results.length, budgetSkipped: options.budgetSkipped ?? 0 };\n const encoded = yield* jsonReport(counted).pipe(Effect.mapError(writeError));\n yield* fs.writeFileString(path.join(dir, \"outcomes.json.tmp\"), encoded).pipe(Effect.mapError(writeError));\n yield* fs.rename(path.join(dir, \"outcomes.json.tmp\"), path.join(dir, \"outcomes.json\")).pipe(Effect.mapError(writeError));\n yield* writeLists(report.results).pipe(Effect.mapError(writeError));\n for (const result of report.results) {\n if (!ids.has(result.mutant.id)) return yield* writeError(\"Final result does not belong to this report\");\n yield* fs.writeFileString(path.join(dir, \"logs\", `${result.mutant.id}.log`), logText(result)).pipe(Effect.mapError(writeError));\n }\n // The runner writes on completion or interrupt and the CLI writes again\n // as the owner of the final report; files are idempotent, the summary prints once.\n if (options.markdown !== undefined) {\n const markdown = markdownSummary({ ...options.markdown, root: options.root, path, report: counted, notMutated: notMutated.length });\n for (const file of new Set(options.markdown.files)) {\n yield* fs.writeFileString(file, markdown).pipe(Effect.mapError(error => new ReportWriteError({ path: file, message: String(error) })));\n }\n if (!summarized && options.markdown.stdout) yield* Console.log(markdown);\n }\n if (summarized) return;\n summarized = true;\n if (report.results.some(result => result.outcome === \"unreliable\")) yield* Console.warn(\"Unreliable: the configured Vitest run cannot see all tests. See unreliable.txt and per-mutant diagnostics; these are not missed mutants.\");\n const elapsed = (yield* Clock.currentTimeMillis) - started;\n if (!options.markdown?.stdout) yield* Console.log(countsLine(counted, notMutated.length) + `; ${(elapsed / 1000).toFixed(2)}s`);\n if (options.markdown === undefined && report.failure !== undefined) yield* Console.warn(report.failure);\n })),\n });\n return service;\n});\n\nexport const ReporterLive = (options: Parameters<typeof makeReporter>[0]) =>\n Layer.effect(Reporter, makeReporter(options));\n", "interface LineEdit { readonly sign: \" \" | \"+\" | \"-\"; readonly text: string }\n\n// Myers' shortest edit path. Function-body mutations commonly retain almost\n// every line inside a new wrapper, so a prefix/suffix-only diff is not enough.\nconst shortestEdits = (before: ReadonlyArray<string>, after: ReadonlyArray<string>): ReadonlyArray<LineEdit> => {\n const frontier = new Map<number, number>([[1, 0]]);\n const trace: Array<Map<number, number>> = [];\n for (let distance = 0; distance <= before.length + after.length; distance++) {\n trace.push(new Map(frontier));\n for (let diagonal = -distance; diagonal <= distance; diagonal += 2) {\n const down = diagonal === -distance || (diagonal !== distance && (frontier.get(diagonal - 1) ?? -Infinity) < (frontier.get(diagonal + 1) ?? -Infinity));\n let x = down ? frontier.get(diagonal + 1) ?? 0 : (frontier.get(diagonal - 1) ?? 0) + 1;\n let y = x - diagonal;\n while (x < before.length && y < after.length && before[x] === after[y]) { x++; y++; }\n frontier.set(diagonal, x);\n if (x < before.length || y < after.length) continue;\n const result: LineEdit[] = [];\n x = before.length;\n y = after.length;\n for (let depth = trace.length - 1; depth >= 0; depth--) {\n const previous = trace[depth]!;\n const k = x - y;\n const down = k === -depth || (k !== depth && (previous.get(k - 1) ?? -Infinity) < (previous.get(k + 1) ?? -Infinity));\n const previousK = down ? k + 1 : k - 1;\n const previousX = previous.get(previousK) ?? 0;\n const previousY = previousX - previousK;\n while (x > previousX && y > previousY) { result.push({ sign: \" \", text: before[--x]! }); y--; }\n if (depth === 0) break;\n if (x === previousX) result.push({ sign: \"+\", text: after[--y]! });\n else result.push({ sign: \"-\", text: before[--x]! });\n }\n return result.reverse();\n }\n }\n return [];\n};\n\nconst edits = (before: ReadonlyArray<string>, after: ReadonlyArray<string>): ReadonlyArray<LineEdit> => {\n let prefix = 0;\n while (prefix < before.length && prefix < after.length && before[prefix] === after[prefix]) prefix++;\n let suffix = 0;\n while (suffix < before.length - prefix && suffix < after.length - prefix && before[before.length - suffix - 1] === after[after.length - suffix - 1]) suffix++;\n const left = before.slice(prefix, before.length - suffix);\n const right = after.slice(prefix, after.length - suffix);\n const shared = new Set(left);\n const middle: ReadonlyArray<LineEdit> = right.some((text) => shared.has(text))\n ? shortestEdits(left, right)\n : [...left.map((text): LineEdit => ({ sign: \"-\", text })), ...right.map((text): LineEdit => ({ sign: \"+\", text }))];\n return [...before.slice(0, prefix).map((text): LineEdit => ({ sign: \" \", text })), ...middle,\n ...before.slice(before.length - suffix).map((text): LineEdit => ({ sign: \" \", text }))];\n};\n\nconst lines = (text: string): ReadonlyArray<string> => {\n if (!text) return [];\n const result = text.split(\"\\n\");\n if (text.endsWith(\"\\n\")) result.pop();\n else result[result.length - 1] += \"\\n\\\\";\n return result;\n};\n\nexport const unifiedDiff = (original: string, modified: string, file: string): string => {\n if (original === modified) return \"\";\n const changes = edits(lines(original), lines(modified));\n const positions: Array<{ readonly old: number; readonly next: number }> = [];\n let old = 1;\n let next = 1;\n for (const edit of changes) {\n positions.push({ old, next });\n if (edit.sign !== \"+\") old++;\n if (edit.sign !== \"-\") next++;\n }\n const changed = changes.flatMap((edit, index) => edit.sign === \" \" ? [] : [index]);\n const quotePath = (path: string) => /[\\s\"\\\\]/.test(path) ? JSON.stringify(path) : path;\n const output = [`--- ${quotePath(`a/${file}`)}`, `+++ ${quotePath(`b/${file}`)}`];\n for (let i = 0; i < changed.length; i++) {\n const start = Math.max(0, changed[i]! - 3);\n let last = changed[i]!;\n while (i + 1 < changed.length && changed[i + 1]! - last <= 7) last = changed[++i]!;\n const hunk = changes.slice(start, last + 4);\n const oldCount = hunk.filter((edit) => edit.sign !== \"+\").length;\n const newCount = hunk.filter((edit) => edit.sign !== \"-\").length;\n const position = positions[start]!;\n output.push(`@@ -${oldCount ? position.old : position.old - 1},${oldCount} +${newCount ? position.next : position.next - 1},${newCount} @@`, ...hunk.map((edit) => edit.sign + edit.text));\n }\n return [...output, \"\"].join(\"\\n\");\n};\n", "import type { RunReport } from \"@mutant-cafe/core\";\nimport type * as Path from \"effect/Path\";\nimport { reportExitCode } from \"./ExitCode.ts\";\n\nexport const outcomeNames = [\"caught\", \"missed\", \"timeout\", \"unviable\", \"untested\", \"unreliable\"] as const;\n\nexport const countsLine = (report: RunReport, notMutated: number): string =>\n `${report.selected ?? report.results.length} selected, ${report.run ?? report.results.length} run, ${report.budgetSkipped ?? 0} budget-skipped; ` +\n outcomeNames.map(outcome => `${report.results.filter(result => result.outcome === outcome).length} ${outcome}`).join(\", \") +\n `; ${notMutated} not mutated`;\n\n// HTML entities avoid starting code spans; backslashes protect table separators.\nconst cell = (text: string): string => text.replaceAll(\"&\", \"&amp;\").replaceAll(\"<\", \"&lt;\").replaceAll(\">\", \"&gt;\")\n .replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"|\", \"\\\\|\").replaceAll(\"`\", \"&#96;\").replace(/[\\r\\n]+/g, \" \");\n\nexport const markdownSummary = (options: {\n readonly report: RunReport;\n readonly root: string;\n readonly gitRoot: string;\n readonly path: Path.Path;\n readonly marker: string;\n readonly notMutated: number;\n readonly advisory: boolean;\n}): string => {\n const { report, path } = options;\n const rows = report.results.filter(result => result.outcome === \"missed\" || result.outcome === \"timeout\" || result.outcome === \"untested\" || result.outcome === \"unreliable\");\n const exit = report.failure?.startsWith(\"BaselineFailed\") ? 4 : reportExitCode(report);\n return [options.marker, countsLine(report, options.notMutated), \"\",\n ...(report.failure === undefined ? [] : [`Failure: ${cell(report.failure)}`, \"\"]),\n options.advisory ? `Advisory: would exit ${exit} without --advisory.` : `Exit code: ${exit}.`, \"\",\n ...(rows.length ? [\"| File:line | Function | Description | Outcome |\", \"| --- | --- | --- | --- |\"] : report.failure === undefined ? [\"No actionable mutants.\"] : []),\n ...rows.slice(0, 50).map(({ mutant, outcome }) => `| ${cell(path.relative(options.gitRoot, path.resolve(options.root, mutant.file)).replaceAll(\"\\\\\", \"/\"))}:${mutant.span.start.line} | ${cell(mutant.functionName)} | ${cell(mutant.description)} | ${outcome} |`),\n ...(rows.length > 50 ? [\"\", `and ${rows.length - 50} more`] : []), \"\",\n ].join(\"\\n\");\n};\n", "import * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\n\nexport class UsageError extends Schema.TaggedError<UsageError>()(\"UsageError\", { message: Schema.String }) {}\n\nexport const git = Effect.fn(\"git\")(function*(root: string, args: ReadonlyArray<string>) {\n const command = `git ${args.join(\" \")}`;\n return yield* Effect.scoped(Effect.gen(function*() {\n const handle = yield* ChildProcess.make(\"git\", args, { cwd: root });\n const [stdout, stderr, code] = yield* Effect.all([\n Stream.mkString(Stream.decodeText(handle.stdout)),\n Stream.mkString(Stream.decodeText(handle.stderr)), handle.exitCode,\n ], { concurrency: \"unbounded\" });\n if (Number(code) !== 0) return yield* new UsageError({ message: `${command}:\\n${stderr}` });\n return stdout;\n })).pipe(Effect.mapError(error => error._tag === \"UsageError\" ? error : new UsageError({ message: `${command}: ${String(error)}` })));\n});\n\nexport const repositoryRoot = Effect.fn(\"repositoryRoot\")(function*(root: string) {\n const path = yield* Path.Path;\n const fs = yield* FileSystem.FileSystem;\n const top = (yield* git(root, [\"rev-parse\", \"--show-toplevel\"])).trim();\n const physical = yield* fs.realPath(root).pipe(Effect.mapError(error => new UsageError({ message: String(error) })));\n return path.resolve(root, path.relative(physical, top));\n});\n"],
5
- "mappings": ";;;AACA,YAAY,iBAAiB;AAC7B,YAAY,kBAAkB;;;ACF9B,YAAY,YAAY;AAEjB,IAAM,YAAmB,cAAO;AAAA,EACrC,MAAa;AAAA,EACb,UAAiB;AAAA,EACjB,SAAgB,aAAa,aAAM;AAAA,EACnC,SAAgB,aAAa,aAAM;AAAA,EACnC,gBAAuB,aAAa,aAAM;AAAA,EAC1C,QAAe,gBAAgB,aAAM;AAAA,EACrC,cAAqB,gBAAgB,cAAO;AAAA,EAC5C,MAAa;AAAA,E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A,EAAMA,OAAM,YAAY,KAAK,IAAI,CAAC,KACxGA,OAAM,SAAS,mBAAmB,oBAAoBA,OAAM,QAAQ,MAAMA,OAAM,QAAQ,KAAK,GAAG,CAAC;AAAA,EAAKA,OAAM,OAAO,MAAM,IAAK,CAAC,KAC/H,OAAOA,MAAK,CAAC;AACjB,aAAW,QAAI,MAAM,cAAcA,MAAK,CAAC;AAAA,IAC3C,CAAC,CAAC;AAAA,IACK,oBAAY,CAAC,WAAkB,YAAI,aAAY;AACpD,aAAe,eAAM,mBAAmB,OAAO,MAAM,CAAC,EAAE;AACxD,aAAW,QAAI,MAAM,EAAE;AAAA,IACzB,CAAC,CAAC;AAAA,EACJ;AACA,SAAO,OAAW,QAAI,IAAI;AAC5B,CAAC;;;AZ7KD,IAAM,MAAW,CAAC,QAAQ,YAAY,WAAW,QAAe,qBAAa,OAAO,CAAC;AAErF,IAAM,OAAa,gBAAS,kBAAkB,aAAa,cAAc,EAAE;AAAA,EACnE,oBAA0B,kBAAK;AACvC;AAEA,IAAM,OAAc,aAAI,aAAa;AACnC,QAAM,OAAO,OAAO,OAAO,EAAE,MAAM,QAAQ,IAAI,GAAG,MAAM,QAAQ,KAAK,MAAM,CAAC,GAAG,IAAI,CAAC;AACpF,SAAc,cAAK,MAAM;AACvB,YAAQ,WAAW;AAAA,EACrB,CAAC;AACH,CAAC,EAAE,KAAY,iBAAQ,IAAI,CAAC;AAEhB,oBAAQ,IAAI;",
6
- "names": ["Schema", "Schema", "Schema", "fn", "succeed", "fail", "catchTag", "error", "gen", "die", "make", "layer", "error", "fn", "result", "effect", "name", "symbol", "bounded", "values", "field", "types", "value", "fn", "error", "generated", "result", "Effect", "Layer", "error", "dir", "from", "to", "relative", "effect", "Effect", "Schema", "Effect", "Layer", "FileSystem", "Path", "Stream", "Schema", "ChildProcess", "ChildProcessSpawner", "error", "run", "Effect", "Path", "Schema", "Stream", "state", "effect", "result", "run", "Effect", "Layer", "Stream", "Console", "Effect", "FileSystem", "Path", "Schema", "Stream", "Effect", "FileSystem", "Path", "Schema", "Stream", "ChildProcess", "fail", "lines", "match", "error", "relative", "result", "error", "Clock", "Console", "Effect", "FileSystem", "Layer", "Path", "Schema", "result", "down", "result", "result", "error", "relative", "lines", "Effect", "FileSystem", "Path", "Schema", "Stream", "ChildProcess", "error", "error", "skipped", "relative"]
3
+ "sources": ["../../cli/src/bin.ts", "../../core/src/Config.ts", "../../core/src/Errors.ts", "../../core/src/Mutant.ts", "../../core/src/Services.ts", "../../core/src/Telemetry.ts", "../../core/src/Selection.ts", "../../engine/src/index.ts", "../../engine/src/Generate.ts", "../../engine/src/TypeScriptOracle.ts", "../../runner/src/Scratch.ts", "../../runner/src/Poison.ts", "../../runner/src/TestRunner.ts", "../../runner/src/Preflight.ts", "../../runner/src/ProcessTree.ts", "../../runner/src/ProcessTrace.ts", "../../runner/src/WarmRunner.ts", "../../runner/src/WarmPolicy.ts", "../../runner/src/VitestHost.ts", "../../runner/src/Mode.ts", "../../runner/src/Run.ts", "../../cli/src/Command.ts", "../../cli/src/Diff.ts", "../../cli/src/ExitCode.ts", "../../cli/src/Reporter.ts", "../../cli/src/UnifiedDiff.ts", "../../cli/src/Summary.ts", "../../cli/src/Git.ts"],
4
+ "sourcesContent": ["#!/usr/bin/env -S node --experimental-strip-types\nimport * as NodeRuntime from \"@effect/platform-node/NodeRuntime\";\nimport * as NodeServices from \"@effect/platform-node/NodeServices\";\nimport { MutantSourceLive } from \"@mutant-cafe/engine\";\nimport { runMutants, ScratchLive, TestRunnerLive } from \"@mutant-cafe/runner\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Stream from \"effect/Stream\";\n\nimport { runCli, type Run } from \"./Command.ts\";\n\nconst run: Run = (config, mutants) => runMutants(config, Stream.fromIterable(mutants));\n\nconst live = Layer.mergeAll(MutantSourceLive, ScratchLive, TestRunnerLive).pipe(\n Layer.provideMerge(NodeServices.layer)\n);\n\nconst main = Effect.gen(function* () {\n const code = yield* runCli({ root: process.cwd(), args: process.argv.slice(2), run });\n yield* Effect.sync(() => {\n process.exitCode = code;\n });\n}).pipe(Effect.provide(live));\n\nNodeRuntime.runMain(main);\n", "import * as Schema from \"effect/Schema\";\n\nexport const DEFAULT_BASELINE_TIMEOUT_MS = 30 * 60 * 1000;\n\nexport const RunConfig = Schema.Struct({\n root: Schema.String,\n tsconfig: Schema.String,\n include: Schema.Array(Schema.String),\n exclude: Schema.Array(Schema.String),\n functionFilter: Schema.Array(Schema.String),\n inDiff: Schema.optional(Schema.String),\n exportedOnly: Schema.optional(Schema.Boolean),\n cold: Schema.optional(Schema.Boolean),\n warm: Schema.optional(Schema.Boolean),\n jobs: Schema.Int,\n timeoutMs: Schema.optional(Schema.Int),\n baselineTimeoutMs: Schema.optional(Schema.Int),\n timeoutMultiplier: Schema.Finite,\n minimumTimeoutMs: Schema.Int,\n neverTimeoutMs: Schema.Int,\n outDir: Schema.String,\n});\nexport type RunConfig = typeof RunConfig.Type;\n\nexport const ConfigFile = Schema.Struct({\n include: Schema.optional(Schema.Array(Schema.String)),\n exclude: Schema.optional(Schema.Array(Schema.String)),\n functionFilter: Schema.optional(Schema.Array(Schema.String)),\n jobs: Schema.optional(Schema.Int),\n timeoutMultiplier: Schema.optional(Schema.Finite),\n minimumTimeoutMs: Schema.optional(Schema.Int),\n baselineTimeoutMs: Schema.optional(Schema.Int),\n});\nexport type ConfigFile = typeof ConfigFile.Type;\n", "import * as Schema from \"effect/Schema\";\n\nexport class ProgramLoadError extends Schema.TaggedError<ProgramLoadError>()(\"ProgramLoadError\", {\n tsconfig: Schema.String,\n reason: Schema.optional(Schema.Literal(\"selection\")),\n diagnostics: Schema.Array(Schema.String),\n}) {}\n\n/** Keep the actual argv in reports, but name the runner in human diagnostics. */\nexport const formatTestCommand = (command: ReadonlyArray<string>): string => command[1]?.endsWith(\"/launch.mjs\")\n ? `vitest ${command.slice(2).filter(arg => arg === \"--reporter=default\" || !arg.startsWith(\"--reporter=\")).join(\" \")} (via ${command.join(\" \")})`\n : command.join(\" \");\n\nexport class BaselineFailed extends Schema.TaggedError<BaselineFailed>()(\"BaselineFailed\", {\n exitCode: Schema.Int,\n command: Schema.Array(Schema.String),\n output: Schema.String,\n}) {}\n\nexport class BaselineTimedOut extends Schema.TaggedError<BaselineTimedOut>()(\"BaselineTimedOut\", {\n timeoutMs: Schema.Int,\n command: Schema.Array(Schema.String),\n message: Schema.String,\n}) {}\n\nexport class ScratchError extends Schema.TaggedError<ScratchError>()(\"ScratchError\", {\n operation: Schema.String,\n path: Schema.String,\n message: Schema.String,\n}) {}\n\nexport class TestSpawnError extends Schema.TaggedError<TestSpawnError>()(\"TestSpawnError\", {\n kind: Schema.optional(Schema.Literals([\"reporter\", \"vitest-version\"])),\n command: Schema.Array(Schema.String),\n message: Schema.String,\n}) {}\n\nexport class DiffParseError extends Schema.TaggedError<DiffParseError>()(\"DiffParseError\", {\n path: Schema.String,\n message: Schema.String,\n}) {}\n\nexport class ReportWriteError extends Schema.TaggedError<ReportWriteError>()(\"ReportWriteError\", {\n path: Schema.String,\n message: Schema.String,\n}) {}\n", "import * as Schema from \"effect/Schema\";\n\nexport const Genre = Schema.Literals([\n \"EffectSucceed\",\n \"EffectFail\",\n \"SwallowTag\",\n \"TagToDefect\",\n \"EffectDie\",\n \"EffectNever\",\n \"OptionNone\",\n \"OptionSome\",\n \"StreamEmpty\",\n \"StreamOne\",\n \"StreamFail\",\n \"LayerFail\",\n \"LayerDie\",\n \"SchemaAcceptAnything\",\n \"BooleanFlip\",\n \"LiteralCycle\",\n \"FnValue\",\n]);\nexport type Genre = typeof Genre.Type;\n\nexport const Span = Schema.Struct({\n start: Schema.Struct({ line: Schema.Int, column: Schema.Int }),\n end: Schema.Struct({ line: Schema.Int, column: Schema.Int }),\n});\nexport type Span = typeof Span.Type;\n\nexport const Replacement = Schema.Struct({\n startOffset: Schema.Int,\n endOffset: Schema.Int,\n text: Schema.String,\n});\nexport type Replacement = typeof Replacement.Type;\n\nexport const Mutant = Schema.Struct({\n id: Schema.String,\n file: Schema.String,\n functionName: Schema.String,\n returnType: Schema.String,\n displayReturnType: Schema.optional(Schema.String),\n genre: Genre,\n description: Schema.String,\n span: Span,\n replacement: Replacement,\n synthetic: Schema.Boolean,\n});\nexport type Mutant = typeof Mutant.Type;\n\nexport const Outcome = Schema.Literals([\"caught\", \"missed\", \"unviable\", \"timeout\", \"untested\", \"unreliable\"]);\nexport type Outcome = typeof Outcome.Type;\n\nexport const MutantResult = Schema.Struct({\n mutant: Mutant,\n outcome: Outcome,\n durationMs: Schema.Int,\n testCommand: Schema.Array(Schema.String),\n diagnostics: Schema.Array(Schema.String),\n output: Schema.optional(Schema.String),\n timeoutMs: Schema.optional(Schema.Int),\n outerTimeoutMs: Schema.optional(Schema.Int),\n backstopMs: Schema.optional(Schema.Finite),\n hangBudgetBaseMs: Schema.optional(Schema.Finite),\n telemetryWarnings: Schema.optional(Schema.Array(Schema.String)),\n testWorkers: Schema.optional(Schema.Int),\n testConcurrency: Schema.optional(Schema.Int),\n});\nexport type MutantResult = typeof MutantResult.Type;\n\nexport const SelectionIssue = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"runner\"), reason: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"warning\"), reason: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"target\"), file: Schema.String, reason: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"built\"), files: Schema.optional(Schema.Array(Schema.String)), testFiles: Schema.Array(Schema.String), reason: Schema.String }),\n]);\nexport type SelectionIssue = typeof SelectionIssue.Type;\n\nexport const Baseline = Schema.Struct({\n durationMs: Schema.Int,\n testCommand: Schema.Array(Schema.String),\n unreliable: Schema.optional(Schema.Array(SelectionIssue)),\n testDurations: Schema.optional(Schema.Record(Schema.String, Schema.Finite)),\n testTimeouts: Schema.optional(Schema.Record(Schema.String, Schema.Finite)),\n testWorkers: Schema.optional(Schema.Int),\n testConcurrency: Schema.optional(Schema.Int),\n testFileDurations: Schema.optional(Schema.Record(Schema.String, Schema.Finite)),\n startupMs: Schema.optional(Schema.Int),\n probeSupported: Schema.optional(Schema.Boolean),\n testableMutants: Schema.optional(Schema.Int),\n telemetryWarnings: Schema.optional(Schema.Array(Schema.String)),\n hostPid: Schema.optional(Schema.Int),\n testTimeoutDetails: Schema.optional(Schema.Record(Schema.String, Schema.Finite)),\n runnerMode: Schema.optional(Schema.Literals([\"cold\", \"warm\"])),\n runnerModeReason: Schema.optional(Schema.String),\n calibration: Schema.optional(Schema.Struct({ coldMs: Schema.Int, warmMs: Schema.Int, warmStartupMs: Schema.Int, overheadMs: Schema.optional(Schema.Int), coldStartupMs: Schema.optional(Schema.Int), warmRunStartupMs: Schema.optional(Schema.Int), testFiles: Schema.Int, mutants: Schema.Int })),\n});\nexport type Baseline = typeof Baseline.Type;\n\nexport const NotMutated = Schema.Struct({\n // Optional on decode for existing schemaVersion 2 reports; discovery always supplies it.\n span: Schema.optional(Span),\n file: Schema.String,\n functionName: Schema.String,\n reason: Schema.String,\n});\nexport type NotMutated = typeof NotMutated.Type;\n\n// Additive optional fields preserve decoding of schemaVersion 2 reports.\nexport const SelectionCounts = Schema.Struct({\n selected: Schema.Int,\n run: Schema.Int,\n budgetSkipped: Schema.Int,\n});\nexport type SelectionCounts = typeof SelectionCounts.Type;\n\nexport const MutantList = Schema.Struct({\n schemaVersion: Schema.Literal(2),\n tool: Schema.Literal(\"mutant.cafe\"),\n mutants: Schema.Array(Mutant),\n notMutated: Schema.Array(NotMutated),\n counts: SelectionCounts,\n});\nexport type MutantList = typeof MutantList.Type;\n\nexport const ReachabilityProbe = Schema.Struct({\n file: Schema.String,\n status: Schema.Literals([\"unreachable\", \"reachable\", \"unsupported\"]),\n durationMs: Schema.Int,\n testCommand: Schema.Array(Schema.String),\n output: Schema.String,\n});\nexport type ReachabilityProbe = typeof ReachabilityProbe.Type;\n\nexport const RunReport = Schema.Struct({\n hostRestarts: Schema.optional(Schema.Int),\n poolResets: Schema.optional(Schema.Int),\n reachabilityProbes: Schema.optional(Schema.Array(ReachabilityProbe)),\n selected: Schema.optional(Schema.Int),\n run: Schema.optional(Schema.Int),\n budgetSkipped: Schema.optional(Schema.Int),\n schemaVersion: Schema.Literal(2),\n tool: Schema.Literal(\"mutant.cafe\"),\n root: Schema.String,\n baseline: Baseline,\n timeoutMs: Schema.Int,\n results: Schema.Array(MutantResult),\n failure: Schema.optional(Schema.String),\n notMutated: Schema.optional(Schema.Array(NotMutated)),\n});\nexport type RunReport = typeof RunReport.Type;\n", "import * as Context from \"effect/Context\";\nimport type * as Effect from \"effect/Effect\";\nimport type * as Scope from \"effect/Scope\";\nimport type * as Stream from \"effect/Stream\";\n\nimport type { RunConfig } from \"./Config.ts\";\nimport type {\n BaselineFailed, BaselineTimedOut,\n ProgramLoadError,\n ReportWriteError,\n ScratchError,\n TestSpawnError,\n} from \"./Errors.ts\";\nimport type { Baseline, Mutant, MutantResult, NotMutated, ReachabilityProbe, RunReport } from \"./Mutant.ts\";\n\nexport type Viability =\n | { readonly viable: boolean; readonly diagnostics: ReadonlyArray<string>; readonly analysisFailed?: never }\n | { readonly viable: false; readonly diagnostics: ReadonlyArray<string>; readonly analysisFailed: NotMutated };\n\nexport class MutantSource extends Context.Service<\n MutantSource,\n {\n readonly notMutated: (config: RunConfig) => Effect.Effect<ReadonlyArray<NotMutated>, ProgramLoadError>;\n readonly generate: (config: RunConfig) => Stream.Stream<Mutant, ProgramLoadError>;\n readonly checkViable: (mutant: Mutant) => Effect.Effect<Viability, ProgramLoadError>;\n }\n>()(\"mutant.cafe/MutantSource\") {}\n\nexport interface ScratchDir {\n readonly path: string;\n /** Package-relative original-path links that are not mutation targets. */\n readonly linkedRoots?: ReadonlyArray<string>;\n readonly apply: (mutant: Mutant) => Effect.Effect<void, ScratchError>;\n readonly revert: (mutant: Mutant) => Effect.Effect<void, ScratchError>;\n readonly poison?: (mutant: Mutant, signal: string, token: string) => Effect.Effect<void, ScratchError>;\n}\n\nexport class Scratch extends Context.Service<\n Scratch,\n {\n /** Discover package-relative links without creating a scratch tree. */\n readonly inspect?: (root: string) => Effect.Effect<ReadonlyArray<string>, ScratchError>;\n readonly acquire: (root: string) => Effect.Effect<ScratchDir, ScratchError, Scope.Scope>;\n }\n>()(\"mutant.cafe/Scratch\") {}\n\nexport type TestStatus = \"passed\" | \"failed\" | \"timedOut\" | \"untested\";\n\nexport interface TestRun {\n readonly status: TestStatus;\n readonly durationMs: number;\n readonly command: ReadonlyArray<string>;\n readonly output: string;\n readonly backstopMs?: number | undefined;\n readonly telemetryWarnings?: ReadonlyArray<string> | undefined;\n readonly testsCollected?: boolean;\n readonly testFiles?: ReadonlyArray<string>;\n readonly testDurations?: Readonly<Record<string, number>>;\n readonly testTimeouts?: Readonly<Record<string, number>>;\n readonly testWorkers?: number | undefined;\n readonly testConcurrency?: number | undefined;\n readonly testFileDurations?: Readonly<Record<string, number>>;\n readonly startupMs?: number;\n readonly hostPid?: number;\n readonly testTimeoutDetails?: Readonly<Record<string, number>>;\n readonly probeSupported?: boolean;\n readonly probeLoaded?: boolean;\n}\n\nexport class TestRunner extends Context.Service<\n TestRunner,\n {\n readonly open?: (dir: ScratchDir, cold: boolean, warm?: boolean, mutants?: number) => Effect.Effect<void, TestSpawnError, Scope.Scope>;\n readonly invalidate?: (dir: ScratchDir, file: string) => Effect.Effect<void, TestSpawnError>;\n readonly stats?: Effect.Effect<{ readonly hostRestarts: number; readonly poolResets: number }>;\n readonly calibrate?: (dir: ScratchDir, testableMutants: number, copies: number) => Effect.Effect<Partial<Baseline>, BaselineFailed | BaselineTimedOut | TestSpawnError>;\n readonly selectRelated?: (dir: ScratchDir, file: string) => Effect.Effect<ReadonlyArray<string> | undefined, TestSpawnError>;\n readonly probeReachability?: (dir: ScratchDir, mutant: Mutant, timeoutMs: number) => Effect.Effect<ReachabilityProbe, ScratchError | TestSpawnError>;\n readonly baseline: (dir: ScratchDir, tsconfig?: string, timeoutMs?: number) => Effect.Effect<Baseline, BaselineFailed | BaselineTimedOut | TestSpawnError>;\n readonly runRelated: (\n dir: ScratchDir,\n file: string,\n timeoutMs: number,\n testTimeoutMs?: number\n ) => Effect.Effect<TestRun, TestSpawnError>;\n }\n>()(\"mutant.cafe/TestRunner\") {}\n\nexport class Reporter extends Context.Service<\n Reporter,\n {\n readonly progress: (result: MutantResult) => Effect.Effect<void>;\n readonly write: (report: RunReport) => Effect.Effect<void, ReportWriteError>;\n }\n>()(\"mutant.cafe/Reporter\") {}\n", "import type { RunReport } from \"./Mutant.ts\";\n\nexport const telemetryInteger = (value: unknown): value is number => typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0;\nconst finite = (value: unknown) => typeof value === \"number\" && Number.isFinite(value) && value >= 0;\nconst numericRecord = (value: unknown) => typeof value === \"object\" && value !== null && !Array.isArray(value) && Object.values(value).every(finite);\nconst calibration = (value: unknown) => typeof value === \"object\" && value !== null && !Array.isArray(value) &&\n [\"coldMs\", \"warmMs\", \"warmStartupMs\", \"testFiles\", \"mutants\"].every(key => telemetryInteger(Reflect.get(value, key))) && Object.values(value).every(item => item === undefined || telemetryInteger(item));\nconst validators: Readonly<Record<string, (value: unknown) => boolean>> = {\n durationMs: telemetryInteger, timeoutMs: telemetryInteger, outerTimeoutMs: telemetryInteger, startupMs: telemetryInteger,\n testWorkers: telemetryInteger, testConcurrency: telemetryInteger, hostPid: telemetryInteger, testableMutants: telemetryInteger,\n hostRestarts: telemetryInteger, poolResets: telemetryInteger, firstTestStart: finite, hangBudgetBaseMs: finite,\n testDurations: numericRecord, testTimeouts: numericRecord, testFileDurations: numericRecord, testTimeoutDetails: numericRecord, calibration,\n backstopMs: finite,\n runnerModeReason: value => typeof value === \"string\",\n runnerMode: value => value === \"cold\" || value === \"warm\",\n telemetryWarnings: value => Array.isArray(value) && value.every(item => typeof item === \"string\")\n};\nconst describe = (value: unknown) => typeof value === \"string\" ? JSON.stringify(value.slice(0, 128)) : value === null || typeof value !== \"object\" ? String(value) : \"[object]\";\n\n/** Retain outcomes when ancillary data is malformed. Never mutate the input. */\nexport function cleanTelemetry<T extends object>(input: T, location: string, required: ReadonlyArray<string> = [\"durationMs\"]): { value: T; warnings: string[] } {\n const value = { ...input };\n const warnings: string[] = [];\n for (const [key, valid] of Object.entries(validators)) {\n const item: unknown = Reflect.get(value, key);\n if (item === undefined || valid(item)) continue;\n warnings.push(`Internal reporter telemetry error: ${location}.${key}=${describe(item)}; ${required.includes(key) ? \"using zero\" : \"omitted\"}`);\n if (required.includes(key)) Reflect.set(value, key, 0);\n else Reflect.deleteProperty(value, key);\n }\n return { value, warnings };\n}\n\nexport function sanitizeReportTelemetry(report: RunReport): { report: RunReport; warnings: string[] } {\n const root = cleanTelemetry(report, \"report\", [\"timeoutMs\"]);\n const baseline = cleanTelemetry(report.baseline, \"baseline\");\n const results = report.results.map((result, index) => cleanTelemetry(result, `results[${index}]`));\n const warnings = [...new Set([...root.warnings, ...baseline.warnings, ...(baseline.value.telemetryWarnings ?? []), ...results.flatMap(result => [...result.warnings, ...(result.value.telemetryWarnings ?? [])])])];\n return { report: { ...root.value, baseline: { ...baseline.value, ...(warnings.length ? { telemetryWarnings: warnings } : {}) }, results: results.map(result => result.value) }, warnings };\n}\n", "import * as Effect from \"effect/Effect\";\nimport * as Path from \"effect/Path\";\nimport type { Mutant, NotMutated } from \"./Mutant.ts\";\n\n/** One boundary-aware linked-file decision for CLI budgets and runner safety. */\nexport const excludeLinkedCandidates = Effect.fn(\"Selection.excludeLinkedCandidates\")(function* (\n root: string, candidates: ReadonlyArray<Mutant>, linkedRoots: ReadonlyArray<string>\n) {\n const path = yield* Path.Path;\n const mutants: Mutant[] = [];\n const skipped: NotMutated[] = [];\n for (const mutant of candidates) {\n const file = path.isAbsolute(mutant.file) ? path.relative(root, mutant.file) : mutant.file;\n const linked = linkedRoots.some(link => {\n const relative = path.relative(link, file);\n return relative === \"\" || (relative !== \"..\" && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative));\n });\n if (linked) skipped.push({ file: path.resolve(root, file), functionName: mutant.functionName, span: mutant.span,\n reason: \"Source is in a linked ignored tree; original files are not mutation targets\" });\n else mutants.push(mutant);\n }\n return { mutants, notMutated: [...new Map(skipped.map(entry => [JSON.stringify(entry), entry])).values()] };\n});\n", "import { MutantSource, ProgramLoadError, type Mutant, type NotMutated, type RunConfig, type Viability } from \"@mutant-cafe/core\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Stream from \"effect/Stream\";\nimport * as Schema from \"effect/Schema\";\nimport { generateFunction } from \"./Generate.ts\";\nimport type { TypeOracle } from \"./TypeOracle.ts\";\nimport { makeTypeScriptOracle } from \"./TypeScriptOracle.ts\";\n\nexport { makeTypeScriptOracle } from \"./TypeScriptOracle.ts\";\nexport type { TypeOracle } from \"./TypeOracle.ts\";\n\n/** Each layer build owns its warm compiler and original-source cache. */\nexport const MutantSourceLive: Layer.Layer<MutantSource> = Layer.effect(\n MutantSource,\n Effect.sync(() => makeMutantSource(makeTypeScriptOracle())),\n);\n\nexport function makeMutantSource(oracle: TypeOracle): MutantSource[\"Service\"] {\n // Discovery results belong to the call, not to the warm compiler. Asking for\n // another selection cannot clear a caller's skips or partially consumed stream.\n const discover = (config: RunConfig) => Effect.try({\n try: () => {\n const discovered = oracle.discover(config);\n const notMutated: NotMutated[] = [...discovered.notMutated];\n const mutants: Mutant[] = [];\n const failed = new Set<typeof discovered.functions[number]>();\n const generatedFunctions = discovered.functions.map(fn => {\n try {\n const iterator = generateFunction(fn);\n const generated: Mutant[] = [];\n let step = iterator.next();\n while (!step.done) { generated.push(step.value); step = iterator.next(); }\n if (step.value) {\n failed.add(fn);\n notMutated.push({ file: fn.file, functionName: fn.name, span: fn.span, reason: step.value });\n return { fn, generated: [] };\n }\n return { fn, generated };\n }\n catch (error) {\n failed.add(fn);\n notMutated.push({ file: fn.file, functionName: fn.name, span: fn.span,\n reason: `analysis failed: ${error instanceof Error ? error.message : String(error)}` });\n return { fn, generated: [] };\n }\n });\n for (const { fn, generated } of generatedFunctions) {\n if (failed.has(fn)) continue;\n {\n const reasons = [...(fn.notices ?? [])];\n if (!generated.length && !reasons.length) reasons.push(fn.skipReason ?? `return not synthesizable (type ${fn.displayReturnType})`);\n const innerMutated = !generated.length && generatedFunctions.some(({ fn: inner, generated }) => inner.file === fn.file && inner.startOffset > fn.startOffset\n && inner.endOffset < fn.endOffset && generated.length > 0);\n if (innerMutated && !generated.length) {\n for (let i = 0; i < reasons.length; i++) if (reasons[i]!.startsWith(\"return not synthesizable\")) reasons[i] += \"; inner functions mutated\";\n }\n if (reasons.length) notMutated.push({ file: fn.file, functionName: fn.name, span: fn.span, reason: [...new Set(reasons)].join(\"; \") });\n }\n mutants.push(...generated);\n }\n return { mutants, notMutated: [...new Map(notMutated.map(item => [JSON.stringify(item), item])).values()] };\n },\n catch: (error) => {\n if (Schema.is(ProgramLoadError)(error)) return error;\n // Unexpected outer defects are not config failures. Target analysis is isolated above.\n throw error;\n },\n });\n return {\n notMutated: (config) => discover(config).pipe(Effect.map(result => result.notMutated)),\n generate: (config) => Stream.unwrap(discover(config).pipe(Effect.map(result => Stream.fromIterable(result.mutants)))),\n checkViable: (mutant) => Effect.sync((): Viability => {\n try { return oracle.checkViable(mutant); }\n catch (error) { return { viable: false, diagnostics: [], analysisFailed: {\n file: mutant.file, functionName: mutant.functionName, span: mutant.span,\n reason: `analysis failed: ${error instanceof Error ? error.message : String(error)}`,\n } }; }\n }),\n };\n}\n", "// A content digest is pure synchronous work; Effect 4.1.2 has no Crypto module.\n// @effect-diagnostics-next-line nodeBuiltinImport:off\nimport { createHash } from \"node:crypto\";\nimport type { Genre, Mutant } from \"@mutant-cafe/core\";\nimport type { MutableFunction, Value } from \"./TypeOracle.ts\";\n\n/** Generate from the oracle description; deferred compiler checks stay behind its port. */\nexport function* generateFunction(fn: MutableFunction): Generator<Mutant, string | undefined> {\n const issue = fn.generationIssue?.();\n if (issue) return issue;\n const api = fn.api;\n const candidate = (genre: Genre, expression: string, value: Value = { text: \"\", synthetic: false }, description = expression): Mutant => {\n // A return annotation on the inner function preserves the public inferred\n // contract, even when this replacement only produces never or Option<never>.\n const pinned = `((): ${fn.returnType} => (${expression}))()`;\n const text = fn.block\n ? `{ return ${fn.generator ? \"yield* \" : \"\"}${pinned}; }`\n : `(${pinned})`;\n return makeMutant(fn, genre, text, value.synthetic, description);\n };\n const shape = fn.shape;\n const fits = (value: Value): boolean => new TextEncoder().encode(value.text).byteLength <= 2048;\n const values = \"values\" in shape ? shape.values.filter(fits) : [];\n switch (shape.kind) {\n case \"Effect\": {\n const succeed = api(\"Effect\", \"succeed\");\n if (succeed) {\n for (const value of values) {\n if (!fn.equivalentValues.includes(value.text) && !(fn.generator && value.text === fn.literal)) yield candidate(\"EffectSucceed\", `${succeed}(${value.text})`, value);\n }\n }\n const fail = api(\"Effect\", \"fail\");\n const catchTag = api(\"Effect\", \"catchTag\");\n for (const error of shape.errors) {\n if (fail && fits(error)) yield candidate(\"EffectFail\", `${fail}(${error.text})`, error, `${fail}(${error.text}) [${error.synthetic ? \"synthetic tag cast\" : \"constructed error\"}]`);\n const recoveries: ReadonlyArray<Value | undefined> = values.length\n ? shape.enumerateRecoveries ? values : values.slice(0, 1)\n : [undefined];\n // Evaluate the original body, rather than replacing its error path with an unconditional failure.\n const gen = api(\"Effect\", \"gen\");\n const original = fn.generator\n ? gen && `((): ${fn.returnType} => ${gen}(function* () ${fn.original}))()`\n : fn.block ? `((): ${fn.returnType} => ${fn.original})()` : `((): ${fn.returnType} => (${fn.original}))()`;\n for (const value of recoveries) {\n const die = api(\"Effect\", \"die\");\n const recovery = value && succeed ? `${succeed}(${value.text})`\n : die ? `${die}(${JSON.stringify(`mutant.cafe: swallowed ${error.tag}`)})` : undefined;\n if (catchTag && recovery && original) {\n yield candidate(value ? \"SwallowTag\" : \"TagToDefect\", `${original}.pipe(${catchTag}(${JSON.stringify(error.tag)}, () => ${recovery}))`, value, value ? `body.pipe(${catchTag}(${JSON.stringify(error.tag)}, () => ${recovery}))` : `turn ${error.tag} into a defect`);\n }\n }\n }\n const die = api(\"Effect\", \"die\");\n if (die) yield candidate(\"EffectDie\", `${die}(\"mutant.cafe\")`);\n const never = api(\"Effect\", \"never\");\n if (never) yield candidate(\"EffectNever\", never);\n break;\n }\n case \"Option\": {\n const none = api(\"Option\", \"none\");\n const some = api(\"Option\", \"some\");\n if (none) yield candidate(\"OptionNone\", `${none}()`);\n if (some) for (const value of values) yield candidate(\"OptionSome\", `${some}(${value.text})`, value);\n break;\n }\n case \"Stream\": {\n const empty = api(\"Stream\", \"empty\");\n const make = api(\"Stream\", \"make\");\n const fail = api(\"Stream\", \"fail\");\n if (empty) yield candidate(\"StreamEmpty\", empty);\n if (make) for (const value of values) yield candidate(\"StreamOne\", `${make}(${value.text})`, value);\n if (fail) for (const error of shape.errors) if (fits(error)) yield candidate(\"StreamFail\", `${fail}(${error.text})`, error);\n break;\n }\n case \"Layer\": {\n const layer = api(\"Layer\", \"effectContext\");\n const fail = api(\"Effect\", \"fail\");\n const die = api(\"Effect\", \"die\");\n if (layer && die) yield candidate(\"LayerDie\", `${layer}(${die}(\"mutant.cafe\"))`);\n if (layer && fail) {\n // Layer output is contravariant. Let the pinned return type infer the\n // complete output context, not just the first service found in the body.\n for (const error of shape.errors) if (fits(error)) yield candidate(\"LayerFail\", `${layer}(${fail}(${error.text}))`, error);\n }\n break;\n }\n case \"Void\":\n if (!fn.equivalentValues.includes(\"{}\")) yield makeMutant(fn, \"FnValue\", \"{}\", false, \"an empty body\");\n break;\n default: {\n const genre = shape.kind === \"Boolean\" ? \"BooleanFlip\" : shape.kind === \"Literal\" ? \"LiteralCycle\" : \"FnValue\";\n for (const value of values) {\n if (value.text === fn.literal || fn.equivalentValues.includes(value.text)) continue;\n yield candidate(genre, value.text, value);\n }\n }\n }\n}\n\nfunction makeMutant(fn: MutableFunction, genre: Genre, text: string, synthetic: boolean, description: string): Mutant {\n const additions = fn.extraImports?.filter(item => text.includes(`${item.namespace}.`)) ?? [];\n const prefix = fn.sourcePrefix ?? \"\";\n const insertion = fn.importInsertionOffset ?? 0;\n const replacement = additions.length && fn.sourcePrefix !== undefined\n ? { startOffset: 0, endOffset: fn.endOffset, text: prefix.slice(0, insertion) + (insertion ? \"\\n\" : \"\") + additions.map(item => item.statement).join(\"\\n\") + \"\\n\" + prefix.slice(insertion) + text }\n : { startOffset: fn.startOffset, endOffset: fn.endOffset, text };\n // Identity describes the logical edit, never the physical prefix retained to\n // insert imports. Source line shifts above a binding do not retarget its id.\n const id = createHash(\"sha256\").update(JSON.stringify([fn.identityFile ?? fn.file, fn.name, fn.identityOrdinal ?? 0, fn.logicalSpan, genre, text, additions.map(item => item.statement)])).digest(\"hex\").slice(0, 24);\n return {\n id, file: fn.file, functionName: fn.name, returnType: fn.returnType, displayReturnType: fn.displayReturnType, genre,\n description: `replace ${fn.name} -> ${fn.returnType} with ${description}`,\n span: fn.span, replacement, synthetic,\n };\n}\n", "// Compiler-host boundary: TS requires synchronous native paths; matchesGlob has no Effect Path equivalent.\n// @effect-diagnostics-next-line nodeBuiltinImport:off\nimport { dirname, resolve, relative, matchesGlob } from \"node:path\";\nimport ts from \"typescript\";\nimport { ProgramLoadError, type Mutant, type NotMutated, type RunConfig, type Viability } from \"@mutant-cafe/core\";\nimport type { MutableFunction, ReturnShape, TaggedValue, TypeOracle, Value } from \"./TypeOracle.ts\";\n\ntype FunctionNode = ts.FunctionDeclaration | ts.ArrowFunction | ts.FunctionExpression | ts.MethodDeclaration;\ntype Family = \"Effect\" | \"Option\" | \"Stream\" | \"Layer\";\n\nconst diagnosticsText = (items: ReadonlyArray<ts.Diagnostic>): string[] => items.map((d) => {\n const message = ts.flattenDiagnosticMessageText(d.messageText, \"\\n\");\n if (!d.file || d.start === undefined) return `TS${d.code}: ${message}`;\n const position = d.file.getLineAndCharacterOfPosition(d.start);\n return `${d.file.fileName}:${position.line + 1}:${position.character + 1} TS${d.code}: ${message}`;\n});\n\nclass ProgramSession {\n readonly host: ts.CompilerHost;\n readonly originals = new Map<string, ts.SourceFile>();\n program: ts.Program;\n overlay: { file: string; text: string } | undefined;\n\n readonly configPath: string;\n\n constructor(configPath: string) {\n this.configPath = configPath;\n const config = ts.readConfigFile(configPath, ts.sys.readFile);\n if (config.error) throw new ProgramLoadError({ tsconfig: configPath, diagnostics: diagnosticsText([config.error]) });\n const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, resolve(configPath, \"..\"));\n if (parsed.errors.length) throw new ProgramLoadError({ tsconfig: configPath, diagnostics: diagnosticsText(parsed.errors) });\n // Analysis never emits or persists build state, even for incremental/noEmit projects.\n parsed.options.incremental = false;\n delete parsed.options.tsBuildInfoFile;\n this.host = ts.createCompilerHost(parsed.options, true);\n const read = this.host.getSourceFile;\n this.host.getSourceFile = (file, languageVersion, onError, shouldCreateNewSourceFile) => {\n const absolute = resolve(file);\n if (this.overlay?.file === absolute) return ts.createSourceFile(file, this.overlay.text, languageVersion, true);\n const cached = this.originals.get(absolute);\n if (cached) return cached;\n const source = read(file, languageVersion, onError, shouldCreateNewSourceFile);\n if (source) this.originals.set(absolute, source);\n return source;\n };\n this.program = ts.createProgram(parsed.fileNames, parsed.options, this.host);\n const errors = [...this.program.getOptionsDiagnostics(), ...this.program.getSyntacticDiagnostics()];\n if (errors.length) throw new ProgramLoadError({ tsconfig: configPath, diagnostics: diagnosticsText(errors) });\n }\n\n check(mutant: Mutant): Viability {\n const file = resolve(mutant.file);\n const source = this.originals.get(file);\n if (!source) return { viable: false, diagnostics: [], analysisFailed: { file: mutant.file, functionName: mutant.functionName, span: mutant.span, reason: \"analysis failed: source file was not loaded\" } };\n const { startOffset, endOffset, text } = mutant.replacement;\n if (startOffset < 0 || endOffset < startOffset || endOffset > source.text.length) {\n return { viable: false, diagnostics: [\"Replacement offsets are outside the original file\"] };\n }\n const analysisFailed = (reason: string): Viability => ({ viable: false, diagnostics: [],\n analysisFailed: { file: mutant.file, functionName: mutant.functionName, span: mutant.span, reason } });\n this.overlay = { file, text: source.text.slice(0, startOffset) + text + source.text.slice(endOffset) };\n try {\n const mutated = ts.createProgram({ rootNames: this.program.getRootFileNames(), options: this.program.getCompilerOptions(), host: this.host, oldProgram: this.program });\n const changed = mutated.getSourceFile(file);\n if (!changed) throw new Error(`Mutated source not found: ${file}`);\n const issue = typedCallIssue(changed, mutated.getTypeChecker(), true);\n if (issue) return analysisFailed(issue);\n const diagnostics = [...mutated.getSyntacticDiagnostics(changed), ...mutated.getSemanticDiagnostics(changed)];\n return { viable: diagnostics.length === 0, diagnostics: diagnosticsText(diagnostics) };\n } catch (error) {\n return analysisFailed(`analysis failed: ${error instanceof Error ? error.message : String(error)}`);\n } finally {\n this.overlay = undefined;\n }\n }\n}\n\n/** TS 6 is intentionally a runtime analysis dependency, not the workspace compiler. */\nexport function makeTypeScriptOracle(): TypeOracle {\n const sessions = new Map<string, ProgramSession>();\n const owners = new Map<string, ProgramSession>();\n return {\n discover(config) {\n const notMutated: NotMutated[] = [];\n const functions: MutableFunction[] = [];\n const configPath = resolve(config.root, config.tsconfig);\n let session = sessions.get(configPath);\n if (!session) {\n session = new ProgramSession(configPath);\n sessions.set(configPath, session);\n }\n const checker = session.program.getTypeChecker();\n const matched = new Set<string>();\n for (const source of session.program.getSourceFiles()) {\n const file = resolve(source.fileName);\n const local = relative(config.root, file).replaceAll(\"\\\\\", \"/\");\n // Test support lives beside the project, so judge it relative to the tsconfig.\n const project = relative(dirname(configPath), file).replaceAll(\"\\\\\", \"/\");\n if (source.isDeclarationFile || local.startsWith(\"../\") || /(?:^|\\/)(?:node_modules|__tests__|__mocks__|tests?)\\//.test(project) || /\\.(?:test|spec)\\.[cm]?[jt]sx?$/.test(local)) continue;\n for (const glob of config.include) if (matchesGlob(local, glob)) matched.add(glob);\n if (config.include.length && !config.include.some((glob) => matchesGlob(local, glob))) continue;\n if (config.exclude.some((glob) => matchesGlob(local, glob))) continue;\n owners.set(file, session);\n const api = imports(source);\n const excluded = new Set<ts.Node>();\n const visit = (node: ts.Node): void => {\n try {\n if (isFunction(node) && node.body && !mutable(node, checker)) {\n if (!ts.findAncestor(node.parent, parent => excluded.has(parent))) notMutated.push({ file, functionName: `${functionName(node, checker)}.<callback>`, span: nodeSpan(node), reason: \"callback position (not mutated yet)\" });\n }\n if (isFunction(node) && node.body && mutable(node, checker)) {\n const name = functionName(node, checker);\n const reason = skipped(node) ? \"excluded by @mutants-skip\"\n : config.exportedOnly && !publicOwner(node, checker) ? \"excluded by --exported-only\"\n : config.functionFilter.length && !config.functionFilter.some(filter => matchesGlob(name, filter)) ? \"excluded by function filter\"\n : undefined;\n if (reason) { excluded.add(node); notMutated.push({ file, functionName: name, span: nodeSpan(node.body), reason }); }\n if (!reason && (!config.functionFilter.length || config.functionFilter.some((filter) => matchesGlob(name, filter)))) {\n const signature = checker.getSignatureFromDeclaration(node);\n if (signature) {\n const wrapped = wrappedEffect(node, checker);\n const type = wrapped ?? checker.getReturnTypeOfSignature(signature);\n const generator = wrapped && ts.isFunctionExpression(node) ? node : generatorBody(node, checker);\n const body = generator?.body ?? node.body;\n const start = body.getStart(source);\n const end = body.getEnd();\n const a = source.getLineAndCharacterOfPosition(start);\n const b = source.getLineAndCharacterOfPosition(end);\n const beforePipeables = wrapped && ts.isFunctionExpression(node) ? generatorContract(node, checker) : undefined;\n const shape = beforePipeables?.shape ?? shapeOf(type, checker, node, body);\n const originals = generator ? equivalentLiteralValues(body) : equivalentSuccessValues(body, checker);\n if ((!beforePipeables && (type.flags & ts.TypeFlags.TypeParameter) && !(\"values\" in shape && shape.values.length)) || (beforePipeables ? !nameableContract(beforePipeables, checker, node) : hasUnnameableType(type, checker, node))) {\n notMutated.push({ file, functionName: name, span: nodeSpan(node), reason: \"generic: naked or context-only type-parameter return\" });\n } else found.push({\n file, name, functionLike: true, functionSpan: nodeSpan(body), generationIssue: () => typedCallIssue(body, checker), notices: shapeNotices(shape, type, checker, node), returnType: beforePipeables?.text ?? returnTypeText(type, checker, node),\n displayReturnType: node.type?.getText(source) ?? checker.typeToString(type, node),\n skipReason: beforePipeables ? `no synthesizable generator success value: ${beforePipeables.text}` : synthesisReason(type, checker, node),\n equivalentValues: shape.kind === \"Void\" && ts.isBlock(body) && body.statements.length === 0 ? [\"{}\"]\n : \"values\" in shape ? shape.values.filter((value) => isEquivalentSuccess(value.text, shape.kind === \"Effect\" ? originals : equivalentLiteralValues(body))).map((value) => value.text) : [],\n span: { start: { line: a.line + 1, column: a.character + 1 }, end: { line: b.line + 1, column: b.character + 1 } },\n startOffset: start, endOffset: end, original: body.getText(source),\n identityFile: local, logicalSpan: { offset: start - node.getStart(source), length: end - start },\n sourcePrefix: source.text.slice(0, start), importInsertionOffset: importInsertionOffset(source), extraImports: mutationImports(source),\n literal: literalOfBody(body, checker),\n block: ts.isBlock(body), generator: generator !== undefined,\n shape, api,\n });\n } else notMutated.push({ file, functionName: name, span: nodeSpan(node), reason: \"missing callable signature\" });\n }\n }\n // A Layer value is a buildable program even when it is not a function.\n if ((ts.isVariableDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertyAssignment(node)) && node.initializer) {\n const type = checker.getTypeAtLocation(node.initializer);\n if (family(type, checker)?.kind === \"Layer\") {\n const name = valuePath(node);\n const reason = skippedNode(node) ? \"excluded by @mutants-skip\"\n : config.exportedOnly && !publicOwner(node, checker) ? \"excluded by --exported-only\"\n : config.functionFilter.length && !config.functionFilter.some(filter => matchesGlob(name, filter)) ? \"excluded by function filter\" : undefined;\n if (reason) { excluded.add(node.initializer); notMutated.push({ file, functionName: name, span: nodeSpan(node.initializer), reason }); }\n if (!reason) {\n const body = node.initializer;\n const a = source.getLineAndCharacterOfPosition(body.getStart(source));\n const b = source.getLineAndCharacterOfPosition(body.getEnd());\n found.push({ file, name, functionLike: false, generationIssue: () => typedCallIssue(body, checker), notices: shapeNotices(shapeOf(type, checker, node, body), type, checker, node), returnType: returnTypeText(type, checker, node), displayReturnType: checker.typeToString(type, node),\n equivalentValues: [], span: { start: { line: a.line + 1, column: a.character + 1 }, end: { line: b.line + 1, column: b.character + 1 } },\n startOffset: body.getStart(source), endOffset: body.getEnd(), original: body.getText(source), literal: undefined,\n identityFile: local, logicalSpan: { offset: body.getStart(source) - node.getStart(source), length: body.getWidth(source) },\n sourcePrefix: source.text.slice(0, body.getStart(source)), importInsertionOffset: importInsertionOffset(source), extraImports: mutationImports(source),\n block: false, generator: false, shape: shapeOf(type, checker, node, body), api });\n }\n }\n }\n } catch (error) {\n // Source analysis is best-effort. A single checker hole must not masquerade as a config failure.\n const target = isFunction(node) ? node.body\n : (ts.isVariableDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertyAssignment(node)) ? node.initializer : undefined;\n if (target) notMutated.push({ file, functionName: valuePath(node), span: nodeSpan(target),\n reason: `analysis failed: ${error instanceof Error ? error.message : String(error)}` });\n }\n ts.forEachChild(node, visit);\n };\n const found: MutableFunction[] = [];\n visit(source);\n const occurrences = new Map<string, number>();\n for (const fn of found) {\n const ordinal = occurrences.get(fn.name) ?? 0;\n occurrences.set(fn.name, ordinal + 1);\n functions.push({ ...fn, identityOrdinal: ordinal });\n }\n }\n const unmatched = config.include.filter((glob) => !matched.has(glob));\n if (unmatched.length) throw new ProgramLoadError({ tsconfig: configPath, reason: \"selection\", diagnostics: unmatched.map((glob) => {\n const target = relative(config.root, resolve(config.root, glob));\n const outside = target === \"..\" || target.startsWith(\"../\");\n return `No source file matched ${JSON.stringify(glob)}${outside ? \" (path is outside the package root)\" : \"\"}`;\n }) });\n return { functions, notMutated: [...new Map(notMutated.map(item => [JSON.stringify(item), item])).values()] };\n },\n checkViable(mutant) {\n const session = owners.get(resolve(mutant.file));\n if (!session) return { viable: false, diagnostics: [], analysisFailed: { file: mutant.file, functionName: mutant.functionName, span: mutant.span, reason: \"analysis failed: generate mutants before checking viability\" } };\n return session.check(mutant);\n },\n };\n}\n\nfunction typedCallIssue(body: ts.Node, checker: ts.TypeChecker, includeNested = false): string | undefined {\n let issue: string | undefined;\n const visit = (node: ts.Node): void => {\n if (isFunction(node) && !includeNested) return; // Nested implementations have their own discovery boundary.\n if (ts.isCallExpression(node) && node.typeArguments?.length) {\n const signature = checker.getResolvedSignature(node);\n // Unresolved imports and any-typed receivers may produce a synthetic signature with no declaration.\n // A missing declaration is data, not an exception manufactured to exercise a catch.\n if (!signature || (!signature.declaration && checker.getTypeAtLocation(node.expression).flags & ts.TypeFlags.Any)) {\n issue = `analysis failed: compiler supplied no declaration for typed call ${node.expression.getText()}; check its import or receiver type`;\n return;\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(body);\n return issue;\n}\n\nfunction nodeSpan(node: ts.Node): Mutant[\"span\"] {\n const source = node.getSourceFile();\n const a = source.getLineAndCharacterOfPosition(node.getStart(source));\n const b = source.getLineAndCharacterOfPosition(node.getEnd());\n return { start: { line: a.line + 1, column: a.character + 1 }, end: { line: b.line + 1, column: b.character + 1 } };\n}\n\nfunction isFunction(node: ts.Node): node is FunctionNode {\n return ts.isFunctionDeclaration(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node) || ts.isMethodDeclaration(node);\n}\n\n\nfunction functionValue(node: FunctionNode, checker: ts.TypeChecker): ts.Node {\n const wrapper = wrappedEffect(node, checker);\n // A generator passed to Effect.gen is an implementation, not a curried value.\n return wrapper && checker.getTypeAtLocation(node.parent).getCallSignatures().length ? node.parent : node;\n}\n\nfunction returnedBy(node: FunctionNode, checker: ts.TypeChecker): FunctionNode | undefined {\n let value = functionValue(node, checker);\n while (ts.isParenthesizedExpression(value.parent)) value = value.parent;\n const parent = value.parent;\n if (ts.isArrowFunction(parent) && parent.body === value) return parent;\n if (ts.isReturnStatement(parent) && parent.expression === value && ts.isBlock(parent.parent) && isFunction(parent.parent.parent)) return parent.parent.parent;\n return undefined;\n}\n\nfunction mutable(node: FunctionNode, checker: ts.TypeChecker): boolean {\n if (ts.isMethodDeclaration(node) || ts.isFunctionDeclaration(node)) return true;\n let current: ts.Node = wrappedEffect(node, checker) ? node.parent : node;\n while (ts.isParenthesizedExpression(current.parent)) current = current.parent;\n return returnedBy(node, checker) !== undefined || ((ts.isVariableDeclaration(current.parent) || ts.isPropertyAssignment(current.parent) || ts.isPropertyDeclaration(current.parent)) && current.parent.initializer === current);\n}\n\nfunction layerBody(boundary: FunctionNode, checker: ts.TypeChecker): boolean {\n let enclosing: ts.Node = boundary.parent;\n while (!ts.isSourceFile(enclosing) && !isFunction(enclosing)) {\n if (ts.isCallExpression(enclosing) && family(checker.getTypeAtLocation(enclosing), checker)?.kind === \"Layer\") return true;\n enclosing = enclosing.parent;\n }\n return false;\n}\n\nfunction returnsLayer(node: FunctionNode, checker: ts.TypeChecker): boolean {\n const signature = checker.getSignatureFromDeclaration(node);\n if (!signature) return false;\n const type = checker.getReturnTypeOfSignature(signature);\n return (type.isUnion() ? type.types : [type]).every(member => family(member, checker)?.kind === \"Layer\");\n}\n\nfunction serviceProperty(node: ts.Node, boundary: FunctionNode, checker: ts.TypeChecker): boolean {\n if (!(ts.isPropertyAssignment(node) || ts.isShorthandPropertyAssignment(node)) || !ts.isObjectLiteralExpression(node.parent)) return false;\n const object = node.parent;\n const call = object.parent;\n return ts.isCallExpression(call) && call.arguments[0] === object\n && ts.isPropertyAccessExpression(call.expression) && call.expression.name.text === \"of\"\n && ts.isReturnStatement(call.parent) && call.parent.parent === boundary.body && layerBody(boundary, checker);\n}\n\nfunction serviceMethod(node: FunctionNode, boundary: FunctionNode, checker: ts.TypeChecker): boolean {\n if (!layerBody(boundary, checker) || !boundary.body) return false;\n const declaration = ts.findAncestor(node, ts.isVariableDeclaration);\n let returned = false;\n const visit = (child: ts.Node): void => {\n if (isFunction(child)) return;\n if (ts.isReturnStatement(child) && child.expression && ts.isCallExpression(child.expression)) {\n const call = child.expression;\n const object = call.arguments[0];\n if (ts.isPropertyAccessExpression(call.expression) && call.expression.name.text === \"of\" && object && ts.isObjectLiteralExpression(object)) {\n returned ||= object.properties.some(prop => {\n if (ts.isPropertyAssignment(prop) && (prop.initializer === functionValue(node, checker)\n || (declaration && ts.isIdentifier(prop.initializer) && checker.getSymbolAtLocation(prop.initializer)?.valueDeclaration === declaration))) return true;\n if (ts.isShorthandPropertyAssignment(prop)) return checker.getShorthandAssignmentValueSymbol(prop)?.valueDeclaration === declaration;\n return false;\n });\n }\n }\n ts.forEachChild(child, visit);\n };\n visit(boundary.body);\n return returned;\n}\n\nfunction exportedBinding(binding: ts.VariableDeclaration | ts.FunctionDeclaration | ts.ClassDeclaration, checker: ts.TypeChecker): boolean {\n let declaration: ts.Declaration = binding;\n let symbol = binding.name ? checker.getSymbolAtLocation(binding.name) : undefined;\n let container = ts.findAncestor(binding, node => ts.isSourceFile(node) || ts.isModuleBlock(node));\n while (container) {\n const module = ts.isSourceFile(container) ? checker.getSymbolAtLocation(container)\n : ts.isModuleBlock(container) && ts.isModuleDeclaration(container.parent) ? checker.getSymbolAtLocation(container.parent.name) : undefined;\n if (!module || !checker.getExportsOfModule(module).some(item => {\n const target = item.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(item) : item;\n return target === symbol || target.valueDeclaration === declaration;\n })) return false;\n if (ts.isSourceFile(container)) return true;\n if (!ts.isModuleBlock(container) || !ts.isModuleDeclaration(container.parent)) return false;\n declaration = container.parent;\n symbol = module;\n container = ts.findAncestor(container.parent, node => ts.isSourceFile(node) || ts.isModuleBlock(node));\n }\n return false;\n}\n\nfunction publicOwner(node: ts.Node, checker: ts.TypeChecker, seen = new Set<ts.Node>()): boolean {\n if (seen.has(node)) return false;\n seen.add(node);\n let current = node;\n let binding: ts.VariableDeclaration | ts.FunctionDeclaration | ts.ClassDeclaration | undefined;\n let value = isFunction(node) ? node : undefined;\n let throughService = false;\n while (!ts.isSourceFile(current)) {\n if (current !== node && isFunction(current)) {\n const method = value ? serviceMethod(value, current, checker) : serviceProperty(node, current, checker);\n if (!(value && returnedBy(value, checker) === current) && !method && !(throughService && returnsLayer(current, checker))) return false;\n throughService ||= method;\n value = current;\n }\n if (ts.isVariableDeclaration(current) || ts.isFunctionDeclaration(current) || ts.isClassDeclaration(current)) binding = current;\n current = current.parent;\n }\n if (!binding) return false;\n if (exportedBinding(binding, checker)) return true;\n // Follow value bindings (including shorthand aliases), not calls from an\n // exported implementation. Calling a helper does not make it a public path.\n let exposed = false;\n const declaration = binding;\n const visit = (child: ts.Node): void => {\n if (exposed) return;\n const referenced = ts.isShorthandPropertyAssignment(child) ? checker.getShorthandAssignmentValueSymbol(child)\n : ts.isPropertyAssignment(child) && ts.isIdentifier(child.initializer) ? checker.getSymbolAtLocation(child.initializer)\n : ts.isExportAssignment(child) && ts.isIdentifier(child.expression) ? checker.getSymbolAtLocation(child.expression) : undefined;\n if (referenced?.valueDeclaration === declaration) {\n exposed = ts.isExportAssignment(child) || publicOwner(child, checker, seen);\n }\n ts.forEachChild(child, visit);\n };\n visit(current);\n return exposed;\n}\n\nfunction skipped(node: FunctionNode): boolean { return skippedNode(node); }\nfunction skippedNode(node: ts.Node): boolean {\n let current: ts.Node = node;\n while (!ts.isSourceFile(current)) {\n if (ts.getJSDocTags(current).some((tag) => tag.tagName.text === \"mutants-skip\")) return true;\n current = current.parent;\n }\n return false;\n}\n\nfunction valuePath(node: ts.Node): string {\n const parts: string[] = [];\n let current = node;\n while (!ts.isSourceFile(current)) {\n if ((ts.isVariableDeclaration(current) || ts.isPropertyAssignment(current) || ts.isPropertyDeclaration(current) || ts.isMethodDeclaration(current) || ts.isFunctionDeclaration(current) || ts.isClassDeclaration(current) || ts.isModuleDeclaration(current)) && current.name) parts.unshift(current.name.getText());\n current = current.parent;\n }\n return parts.join(\".\") || \"default\";\n}\n\nfunction functionName(node: FunctionNode, checker: ts.TypeChecker): string {\n let path = valuePath(node);\n let parent = returnedBy(node, checker);\n while (parent) { path += \".<inner>\"; parent = returnedBy(parent, checker); }\n return path;\n}\n\nfunction wrappedEffect(node: FunctionNode, checker: ts.TypeChecker): ts.Type | undefined {\n if (!ts.isFunctionExpression(node) || !node.asteriskToken || !ts.isCallExpression(node.parent)) return undefined;\n const result = checker.getTypeAtLocation(node.parent);\n if (family(result, checker)?.kind === \"Effect\") return result;\n const signature = result.getCallSignatures()[0];\n if (!signature) return undefined;\n const returned = checker.getReturnTypeOfSignature(signature);\n return family(returned, checker)?.kind === \"Effect\" ? returned : undefined;\n}\n\nfunction nameableContract(contract: { readonly types: ReadonlyArray<ts.Type> }, checker: ts.TypeChecker, node: ts.Node): boolean {\n return contract.types.every(type => !hasUnnameableType(type, checker, node));\n}\n\nfunction hasUnnameableType(type: ts.Type, checker: ts.TypeChecker, location: ts.Node): boolean {\n // An explicit return annotation already supplies an in-scope spelling (including type-only aliases).\n if (isFunction(location) && location.type && !location.asteriskToken) return false;\n const printed = ts.createSourceFile(\"contract.ts\", `type Contract = ${returnTypeText(type, checker, location)};`, ts.ScriptTarget.Latest, true);\n let missing = false;\n const visit = (node: ts.Node): void => {\n if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && !checker.resolveName(node.typeName.text, location, ts.SymbolFlags.Type, false)) missing = true;\n ts.forEachChild(node, visit);\n };\n visit(printed);\n return missing;\n}\n\nfunction generatorContract(node: ts.FunctionExpression, checker: ts.TypeChecker): { shape: ReturnShape; text: string; types: ReadonlyArray<ts.Type> } | undefined {\n const signature = checker.getSignatureFromDeclaration(node);\n if (!signature || !node.body) return undefined;\n const iterator = checker.getReturnTypeOfSignature(signature);\n const args = checker.getTypeArguments(iterator as ts.TypeReference);\n const [yielded, success] = args;\n if (!yielded || !success) return undefined;\n const effects = (yielded.isUnion() ? yielded.types : [yielded]).flatMap(t => {\n const f = family(t, checker);\n return f?.kind === \"Effect\" ? [f] : [];\n });\n const print = (t: ts.Type) => returnTypeText(t, checker, node);\n const union = (index: number) => [...new Set(effects.flatMap(f => f.args[index] ? [print(f.args[index]!)] : []))].join(\" | \") || \"never\";\n return {\n types: [success, ...effects.flatMap(effect => effect.args.slice(1))],\n text: `import(\"effect/Effect\").Effect<${print(success)}, ${union(1)}, ${union(2)}>`,\n\n shape: { kind: \"Effect\", values: boundedValues(success, checker, node).values, omittedValues: boundedValues(success, checker, node).omitted, synthesisIssues: boundedValues(success, checker, node).issues, enumerateRecoveries: smallFinite(success), errors: [...new Map(effects.flatMap(f => f.args[1] ? taggedValues(f.args[1], checker, node) : []).map(e => [e.tag, e])).values()] },\n };\n}\n\nfunction literalOfBody(body: ts.ConciseBody, checker: ts.TypeChecker): string | undefined {\n const expression = returnedExpression(body);\n if (!expression) return undefined;\n // Type assertions do not change runtime values. Never infer equivalence\n // from the return type of a call, getter, or an assertion to another literal.\n if (ts.isStringLiteral(expression)) return JSON.stringify(expression.text);\n if (ts.isNumericLiteral(expression)) return String(Number(expression.text));\n if (expression.kind === ts.SyntaxKind.TrueKeyword) return \"true\";\n if (expression.kind === ts.SyntaxKind.FalseKeyword) return \"false\";\n if (expression.kind === ts.SyntaxKind.NullKeyword) return \"null\";\n if (ts.isIdentifier(expression)) {\n let symbol = checker.getSymbolAtLocation(expression);\n if (symbol && symbol.flags & ts.SymbolFlags.Alias) symbol = checker.getAliasedSymbol(symbol);\n const constant = symbol?.declarations?.some(declaration => ts.isEnumMember(declaration)\n || (ts.isVariableDeclaration(declaration) && ts.isVariableDeclarationList(declaration.parent) && !!(declaration.parent.flags & ts.NodeFlags.Const)));\n if (constant) {\n const type = checker.getTypeAtLocation(expression);\n if (type.isStringLiteral()) return JSON.stringify(type.value);\n if (type.isNumberLiteral()) return String(type.value);\n if (type.flags & ts.TypeFlags.BooleanLiteral) return checker.typeToString(type);\n }\n }\n return undefined;\n}\n\nfunction generatorBody(node: FunctionNode, checker: ts.TypeChecker): ts.FunctionExpression | undefined {\n if (!node.body) return undefined;\n const expression = ts.isBlock(node.body)\n ? node.body.statements.length === 1 && ts.isReturnStatement(node.body.statements[0]!) ? node.body.statements[0]!.expression : undefined\n : node.body;\n // The return type identifies Effect; only select a direct generator callback of the wrapper.\n const signature = checker.getSignatureFromDeclaration(node);\n if (!signature || family(checker.getReturnTypeOfSignature(signature), checker)?.kind !== \"Effect\") return undefined;\n if (expression && ts.isCallExpression(expression)) {\n return expression.arguments.find((arg): arg is ts.FunctionExpression => ts.isFunctionExpression(arg) && arg.asteriskToken !== undefined);\n }\n return undefined;\n}\n\nfunction imports(source: ts.SourceFile): MutableFunction[\"api\"] {\n const namespaces = new Map<string, string>();\n const named = new Map<string, string>();\n for (const statement of source.statements) {\n if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier) || statement.importClause?.isTypeOnly) continue;\n const path = statement.moduleSpecifier.text;\n const bindings = statement.importClause?.namedBindings;\n if (!bindings) continue;\n if (ts.isNamespaceImport(bindings)) {\n if (path.startsWith(\"effect/\")) namespaces.set(path.slice(7), bindings.name.text);\n if (path === \"effect\") for (const module of [\"Effect\", \"Option\", \"Stream\", \"Layer\"]) namespaces.set(module, `${bindings.name.text}.${module}`);\n }\n if (ts.isNamedImports(bindings)) for (const binding of bindings.elements) {\n if (binding.isTypeOnly) continue;\n const imported = (binding.propertyName ?? binding.name).text;\n if (path === \"effect\") namespaces.set(imported, binding.name.text);\n else if (path.startsWith(\"effect/\")) named.set(`${path.slice(7)}.${imported}`, binding.name.text);\n }\n }\n return (module, member) => {\n const namespace = namespaces.get(module);\n return namespace ? `${namespace}.${member}` : named.get(`${module}.${member}`) ?? `${mutationNamespace(source, module)}.${member}`;\n };\n}\n\nfunction importInsertionOffset(source: ts.SourceFile): number {\n let offset = source.text.startsWith(\"#!\") ? (source.text.indexOf(\"\\n\") + 1 || source.text.length) : 0;\n for (const statement of source.statements) {\n if (!ts.isExpressionStatement(statement) || !ts.isStringLiteral(statement.expression)) break;\n offset = statement.getEnd();\n }\n return offset;\n}\n\nfunction mutationNamespace(source: ts.SourceFile, module: string): string {\n let name = `__mutantCafe${module}`;\n while (source.text.includes(name)) name += \"_\";\n return name;\n}\n\nfunction mutationImports(source: ts.SourceFile): NonNullable<MutableFunction[\"extraImports\"]> {\n return [\"Effect\", \"Option\", \"Stream\", \"Layer\"].map(module => {\n const namespace = mutationNamespace(source, module);\n return { namespace, statement: `import * as ${namespace} from \"effect/${module}\";` };\n });\n}\n\nfunction family(type: ts.Type, checker: ts.TypeChecker): { kind: Family; args: ReadonlyArray<ts.Type> } | undefined {\n const symbol = type.aliasSymbol ?? type.getSymbol();\n const name = symbol?.getName();\n // Declaration provenance prevents a user-defined Effect-shaped name from being mistaken for Effect.\n const fromEffect = symbol?.declarations?.some((d) => /(?:^|\\/)effect\\/(?:.*\\/)?(?:Effect|Option|Stream|Layer)\\.(?:d\\.)?ts$/.test(d.getSourceFile().fileName));\n if (fromEffect && (name === \"Effect\" || name === \"Option\" || name === \"Stream\" || name === \"Layer\")) {\n const args = type.aliasTypeArguments ?? ((type.flags & ts.TypeFlags.Object) && (type as ts.ObjectType).objectFlags & ts.ObjectFlags.Reference ? checker.getTypeArguments(type as ts.TypeReference) : []);\n return { kind: name, args };\n }\n // Type aliases may hide a referenced interface; union aliases retain their own type arguments.\n const direct = type.getSymbol();\n if (direct && direct !== symbol) {\n const name = direct.getName();\n if ((name === \"Effect\" || name === \"Stream\" || name === \"Layer\") && direct.declarations?.some((d) => d.getSourceFile().fileName.includes(\"/effect/\"))) {\n return { kind: name, args: checker.getTypeArguments(type as ts.TypeReference) };\n }\n }\n if (type.isUnion()) {\n const members = type.types;\n const option = members.every((member) => {\n const symbol = member.getSymbol();\n return (symbol?.name === \"Some\" || symbol?.name === \"None\") && symbol.declarations?.some((d) => /\\/effect\\/.*Option\\.(?:d\\.)?ts$/.test(d.getSourceFile().fileName));\n });\n if (option && members[0]) {\n const first = members.find((m) => m.getSymbol()?.name === \"Some\") ?? members[0];\n return { kind: \"Option\", args: checker.getTypeArguments(first as ts.TypeReference) };\n }\n }\n if (type.flags & ts.TypeFlags.Object && (type as ts.ObjectType).objectFlags & (ts.ObjectFlags.Class | ts.ObjectFlags.Interface)) {\n for (const base of checker.getBaseTypes(type as ts.InterfaceType) ?? []) {\n const detected = family(base, checker);\n if (detected) return detected;\n }\n }\n return undefined;\n}\n\nfunction shapeOf(type: ts.Type, checker: ts.TypeChecker, node: ts.Node, body: ts.ConciseBody): ReturnShape {\n if (type.isUnion() && type.types.every((member) => family(member, checker)?.kind === \"Effect\")) {\n const shapes = type.types.map((member) => shapeOf(member, checker, node, body));\n const successes = type.types.flatMap(member => family(member, checker)?.args[0] ?? []);\n const bounded = boundCandidates(successes.flatMap(success => valuesOf(success, checker, node)), successes, node);\n const errors = shapes.flatMap((shape) => shape.kind === \"Effect\" ? shape.errors : []);\n return { kind: \"Effect\",\n values: bounded.values, omittedValues: bounded.omitted, synthesisIssues: shapes.flatMap(shape => shape.synthesisIssues ?? []), enumerateRecoveries: bounded.values.length <= 4 && successes.every(smallFinite),\n errors: [...new Map(errors.map((error) => [error.tag, error])).values()].sort((a, b) => a.tag.localeCompare(b.tag, \"en\")),\n };\n }\n const detected = family(type, checker);\n if (detected) {\n const [a, e] = detected.args;\n if (detected.kind === \"Layer\") return { kind: \"Layer\", errors: e ? taggedValues(e, checker, node) : [] };\n const bounded = a ? boundedValues(a, checker, node) : { values: [], omitted: 0, issues: [] };\n const values = bounded.values;\n if (detected.kind === \"Option\") return { kind: \"Option\", values, omittedValues: bounded.omitted, synthesisIssues: bounded.issues };\n const errors = e ? taggedValues(e, checker, node) : [];\n return { kind: detected.kind, values, errors, omittedValues: bounded.omitted, synthesisIssues: bounded.issues, enumerateRecoveries: a !== undefined && smallFinite(a) };\n }\n if (type.flags & ts.TypeFlags.Void) return { kind: \"Void\", values: [] };\n const members = type.isUnion() ? type.types : [type];\n const boolean = members.every((t) => (t.flags & (ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral)) !== 0);\n const literal = members.every((t) => t.isLiteral());\n const bounded = boundedValues(type, checker, node);\n const values = bounded.values;\n if (isFunction(node)) for (const parameter of node.parameters) {\n if (ts.isIdentifier(parameter.name) && checker.isTypeAssignableTo(checker.getTypeAtLocation(parameter), type)) {\n values.push({ text: parameter.name.text, synthetic: false });\n }\n }\n return { kind: boolean ? \"Boolean\" : literal ? \"Literal\" : \"Value\", values, omittedValues: bounded.omitted, synthesisIssues: bounded.issues };\n}\n\nfunction taggedValues(type: ts.Type, checker: ts.TypeChecker, location: ts.Node): TaggedValue[] {\n return (type.isUnion() ? type.types : [type]).flatMap((member) => {\n const tag = member.getProperty(\"_tag\");\n if (!tag) return [];\n const tagType = checker.getTypeOfSymbolAtLocation(tag, location);\n if (!tagType.isStringLiteral()) return [];\n const value = constructError(member, checker, location, tagType.value);\n return [{ ...value, tag: tagType.value }];\n });\n}\n\nfunction constructError(type: ts.Type, checker: ts.TypeChecker, location: ts.Node, tag: string): Value & { readonly reason?: string } {\n const synthetic = (reason?: string): Value & { readonly reason?: string } => ({\n text: `({ _tag: ${JSON.stringify(tag)} } as unknown as ${returnTypeText(type, checker, location)})`, synthetic: true,\n ...(reason ? { reason } : {}),\n });\n const symbol = type.getSymbol();\n if (symbol) {\n const visible = checker.getSymbolsInScope(location, ts.SymbolFlags.Value | ts.SymbolFlags.Alias).find((candidate) => {\n if (candidate.declarations?.some((declaration) => (ts.isImportClause(declaration) && declaration.isTypeOnly)\n || (ts.isImportSpecifier(declaration) && (declaration.isTypeOnly || declaration.parent.parent.isTypeOnly)))) return false;\n const target = candidate.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(candidate) : candidate;\n // Exported Data.TaggedError classes may expose distinct value/type\n // symbols for the same class declaration.\n return target === symbol || (symbol.declarations?.some((declaration) => target.declarations?.includes(declaration)) ?? false);\n });\n if (visible) {\n const constructor = checker.getTypeOfSymbolAtLocation(visible, location).getConstructSignatures()[0];\n if (constructor) {\n const arguments_: string[] = [];\n for (const param of constructor.parameters) {\n const fields = checker.getTypeOfSymbolAtLocation(param, location);\n if (fields.flags & (ts.TypeFlags.Void | ts.TypeFlags.Undefined)) continue;\n const issues = new Set<string>();\n const value = valuesOf(fields, checker, location, new Set(), 0, issues)[0];\n if (!value || value.synthetic) {\n const reason = synthesisReason(fields, checker, location);\n const field = /\\(field ([^)]+)\\)/.exec(reason)?.[1];\n const detail = field ? `field ${field}` : `argument ${param.name} is not synthesizable`;\n return synthetic(detail + (issues.size ? ` (${[...issues].join(\"; \")})` : \"\"));\n }\n const declaration = param.valueDeclaration;\n const rest = declaration && ts.isParameter(declaration) && declaration.dotDotDotToken;\n arguments_.push(`${rest ? \"...\" : \"\"}${value.text}`);\n }\n return { text: `new ${visible.name}(${arguments_.join(\", \")})`, synthetic: false };\n }\n }\n if (symbol.declarations?.some(ts.isClassDeclaration)) {\n return synthetic(visible ? \"constructor arguments are not synthesizable\" : \"class is not available as a value; import its constructor\");\n }\n }\n return synthetic();\n}\n\n// Without UseAliasDefinedOutsideCurrentScope the checker emits import(\"./module\").Name\n// for names not visible here, including transitive error and Brand references.\nfunction returnTypeText(type: ts.Type, checker: ts.TypeChecker, node: ts.Node): string {\n if (isFunction(node) && node.type && !node.asteriskToken && checker.getTypeFromTypeNode(node.type) === type) return node.type.getText();\n const print = (t: ts.Type): string => {\n if (t.isUnion()) return t.types.map(print).join(\" | \");\n const symbol = t.getSymbol();\n if (symbol && !checker.resolveName(symbol.name, node, ts.SymbolFlags.Type, false)) {\n const alias = checker.getSymbolsInScope(node, ts.SymbolFlags.Type | ts.SymbolFlags.Alias).find(candidate => {\n const target = candidate.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(candidate) : candidate;\n return !!target.declarations?.length && checker.getDeclaredTypeOfSymbol(target) === t;\n });\n if (alias) return alias.name;\n }\n return checker.typeToString(t, node, ts.TypeFormatFlags.NoTruncation);\n };\n if (type.isUnion()) {\n const members = type.types.map((member) => family(member, checker));\n if (members.every((member) => member?.kind === \"Effect\")) {\n const args = [0, 1, 2].map((index) => [...new Set(members.flatMap((member) => member?.args[index] ? [print(member.args[index]!)] : []))].sort().join(\" | \") || \"never\");\n return `import(\"effect/Effect\").Effect<${args.join(\", \")}>`;\n }\n }\n const detected = family(type, checker);\n if (detected) return `import(\"effect/${detected.kind}\").${detected.kind}<${detected.args.map(print).join(\", \")}>`;\n return print(type);\n}\n\n// Compare only literal data, never evaluate user code. Canonical keys make\n// differently quoted object literals equivalent without treating calls as equal.\nfunction literalData(node: ts.Node): unknown {\n if (ts.isParenthesizedExpression(node) || ts.isAsExpression(node) || ts.isSatisfiesExpression(node) || ts.isTypeAssertionExpression(node) || ts.isNonNullExpression(node)) return literalData(node.expression);\n if (ts.isStringLiteral(node) || ts.isNumericLiteral(node)) return [node.kind, node.text];\n if (ts.isIdentifier(node) && node.text === \"undefined\") return [\"undefined\"];\n if (ts.isPrefixUnaryExpression(node)) {\n const operand = literalData(node.operand);\n return operand === undefined ? undefined : [node.operator, operand];\n }\n if (ts.isArrayLiteralExpression(node)) {\n const items = node.elements.map(literalData);\n return items.every(item => item !== undefined) ? [\"array\", items] : undefined;\n }\n if (node.kind === ts.SyntaxKind.TrueKeyword || node.kind === ts.SyntaxKind.FalseKeyword || node.kind === ts.SyntaxKind.NullKeyword) return [node.kind];\n if (ts.isObjectLiteralExpression(node)) {\n const fields: Array<readonly [string, unknown]> = [];\n for (const field of node.properties) {\n if (!ts.isPropertyAssignment(field) || !field.name || ts.isComputedPropertyName(field.name)) return undefined;\n const value = literalData(field.initializer);\n if (value === undefined) return undefined;\n fields.push([field.name.getText().replace(/^[\"']|[\"']$/g, \"\"), value]);\n }\n return fields.sort(([a], [b]) => a.localeCompare(b, \"en\"));\n }\n return undefined;\n}\n\nfunction unwrapped(node: ts.Expression): ts.Expression {\n while (ts.isParenthesizedExpression(node) || ts.isAsExpression(node) || ts.isSatisfiesExpression(node) || ts.isTypeAssertionExpression(node) || ts.isNonNullExpression(node)) node = node.expression;\n return node;\n}\n\nfunction returnedExpression(body: ts.ConciseBody): ts.Expression | undefined {\n if (!ts.isBlock(body)) return unwrapped(body);\n const statement = body.statements.length === 1 ? body.statements[0] : undefined;\n return statement && ts.isReturnStatement(statement) && statement.expression ? unwrapped(statement.expression) : undefined;\n}\n\nfunction equivalentLiteralValues(body: ts.ConciseBody): ReadonlyArray<string> {\n const expression = returnedExpression(body);\n const value = expression && literalData(expression);\n return value === undefined ? [] : [JSON.stringify(value)];\n}\n\n/** Only a direct, pure constructor is a no-op. Nested successes, taps and\n * statements before a return are observable work, not equivalent bodies. */\nfunction equivalentSuccessValues(body: ts.ConciseBody, checker: ts.TypeChecker): ReadonlyArray<string> {\n const expression = returnedExpression(body);\n if (!expression) return [];\n const namespace = (node: ts.Expression, seen = new Set<ts.Symbol>()): boolean => {\n node = unwrapped(node);\n if (!ts.isIdentifier(node) && !ts.isPropertyAccessExpression(node)) return false;\n // A receiver such as getEffect().succeed may itself do observable work.\n if (ts.isPropertyAccessExpression(node) && !namespace(node.expression, seen)) return false;\n let symbol = checker.getSymbolAtLocation(ts.isPropertyAccessExpression(node) ? node.name : node);\n if (!symbol || seen.has(symbol)) return false;\n seen.add(symbol);\n if (symbol.flags & ts.SymbolFlags.Alias) symbol = checker.getAliasedSymbol(symbol);\n return symbol.declarations?.some(declaration => {\n if (ts.isSourceFile(declaration)) return /\\/node_modules\\/effect\\/(?:.*\\/)?(?:Effect|index)\\.(?:d\\.)?ts$/.test(declaration.fileName);\n return ts.isVariableDeclaration(declaration) && !!declaration.initializer && ts.isVariableDeclarationList(declaration.parent)\n && !!(declaration.parent.flags & ts.NodeFlags.Const) && namespace(declaration.initializer, seen);\n }) ?? false;\n };\n const member = (node: ts.Expression, seen = new Set<ts.Symbol>()): string | undefined => {\n node = unwrapped(node);\n if (!ts.isIdentifier(node) && !ts.isPropertyAccessExpression(node)) return undefined;\n if (ts.isPropertyAccessExpression(node) && !namespace(node.expression)) return undefined;\n let symbol = checker.getSymbolAtLocation(ts.isPropertyAccessExpression(node) ? node.name : node);\n if (!symbol || seen.has(symbol)) return undefined;\n seen.add(symbol);\n if (symbol.flags & ts.SymbolFlags.Alias) symbol = checker.getAliasedSymbol(symbol);\n for (const declaration of symbol.declarations ?? []) {\n if (/\\/node_modules\\/effect\\/(?:.*\\/)?Effect\\.(?:d\\.)?ts$/.test(declaration.getSourceFile().fileName)) return symbol.name === \"void_\" ? \"void\" : symbol.name;\n if (ts.isVariableDeclaration(declaration) && declaration.initializer && ts.isVariableDeclarationList(declaration.parent)\n && declaration.parent.flags & ts.NodeFlags.Const) return member(declaration.initializer, seen);\n }\n return undefined;\n };\n if (member(expression) === \"void\") return [JSON.stringify([\"undefined\"])];\n if (!ts.isCallExpression(expression) || expression.arguments.length !== 1 || member(expression.expression) !== \"succeed\") return [];\n const value = literalData(expression.arguments[0]!);\n return value === undefined ? [] : [JSON.stringify(value)];\n}\n\nfunction isEquivalentSuccess(text: string, values: ReadonlyArray<string>): boolean {\n const source = ts.createSourceFile(\"literal.ts\", `(${text})`, ts.ScriptTarget.Latest, true);\n const statement = source.statements[0];\n if (!statement || !ts.isExpressionStatement(statement)) return false;\n const value = literalData(statement.expression);\n return value !== undefined && values.includes(JSON.stringify(value));\n}\n\nfunction synthesisReason(type: ts.Type, checker: ts.TypeChecker, node: ts.Node): string {\n if (type.flags & (ts.TypeFlags.TypeParameter | ts.TypeFlags.IndexedAccess)) return \"generic return cannot be synthesized\";\n const valueType = family(type, checker)?.args[0] ?? type;\n // Protocol properties are implementation details, not fields a caller can supply.\n const field = valueType.getProperties().find(field => /^[$\\w]+$/.test(field.name)\n && !(field.flags & ts.SymbolFlags.Optional) && !valuesOf(checker.getTypeOfSymbolAtLocation(field, node), checker, node).length);\n const symbol = valueType.aliasSymbol ?? valueType.getSymbol();\n const name = symbol && !symbol.name.startsWith(\"__\") ? symbol.name\n : valueType.isUnion() ? \"union\" : valueType.flags & ts.TypeFlags.Object || valueType.isIntersection() ? \"object\" : checker.typeToString(valueType, node);\n return field ? `return not synthesizable (field ${field.name})` : `return not synthesizable (type ${name})`;\n}\n\nfunction valueKey(text: string): string {\n const source = ts.createSourceFile(\"value.ts\", `(${text})`, ts.ScriptTarget.Latest, true);\n const statement = source.statements[0];\n const data = statement && ts.isExpressionStatement(statement) ? literalData(statement.expression) : undefined;\n return data === undefined ? text : JSON.stringify(data);\n}\n\n/** Finite literal sets are exhaustive up to eight; open/recursive shapes use six representatives.\n * Undefined is retained separately, so optional returns keep their absence path. */\nfunction boundedValues(type: ts.Type, checker: ts.TypeChecker, node: ts.Node): { values: Value[]; omitted: number; issues: string[] } {\n const issues = new Set<string>();\n return { ...boundCandidates(valuesOf(type, checker, node, new Set(), 0, issues), [type], node), issues: [...issues] };\n}\n\nfunction smallFinite(type: ts.Type): boolean {\n const members = type.isUnion() ? type.types : [type];\n return members.length <= 4 && members.every(member => member.isLiteral()\n || !!(member.flags & (ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral | ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.Void)));\n}\n\nfunction boundCandidates(candidates: ReadonlyArray<Value>, types: ReadonlyArray<ts.Type>, node: ts.Node): { values: Value[]; omitted: number } {\n const unique = [...new Map(candidates.map(value => [valueKey(value.text), value])).values()];\n const members = types.flatMap(type => type.isUnion() ? type.types : [type]);\n const finite = members.length <= 8 && members.every(member => member.isLiteral()\n || !!(member.flags & (ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral | ts.TypeFlags.Null | ts.TypeFlags.Undefined)));\n if (finite || unique.length <= 6) return { values: unique, omitted: 0 };\n const absence = unique.find(value => value.text === \"undefined\");\n const defined = unique.filter(value => value !== absence);\n const preferred = [\"null\", '\\\"\\\"', \"0\", \"false\", \"[]\", \"({ })\"].flatMap(text => {\n const candidate = defined.find(value => valueKey(value.text) === valueKey(text));\n return candidate ? [candidate] : [];\n });\n const original = returnedDiscriminants(node);\n const priority = defined.filter(candidate => {\n const source = ts.createSourceFile(\"value.ts\", `(${candidate.text})`, ts.ScriptTarget.Latest, true);\n const statement = source.statements[0];\n return statement && ts.isExpressionStatement(statement) && objectDiscriminants(statement.expression).some(key => original.has(key));\n });\n const selected = [...new Set([...priority, ...preferred, ...defined])].slice(0, 6);\n if (absence) selected.push(absence);\n return { values: selected, omitted: unique.length - selected.length };\n}\n\nfunction objectDiscriminants(node: ts.Node): string[] {\n while (ts.isParenthesizedExpression(node) || ts.isAsExpression(node) || ts.isSatisfiesExpression(node)) node = node.expression;\n if (!ts.isObjectLiteralExpression(node)) return [];\n return node.properties.flatMap(field => {\n if (!ts.isPropertyAssignment(field) || ts.isComputedPropertyName(field.name)) return [];\n let value = field.initializer;\n while (ts.isParenthesizedExpression(value) || ts.isAsExpression(value) || ts.isSatisfiesExpression(value)) value = value.expression;\n return ts.isStringLiteral(value) || ts.isNumericLiteral(value)\n ? [JSON.stringify([field.name.getText().replace(/^[\"']|[\"']$/g, \"\"), value.text])] : [];\n });\n}\n\nfunction returnedDiscriminants(node: ts.Node): Set<string> {\n if (!isFunction(node) || !node.body) return new Set();\n const result = new Set(objectDiscriminants(node.body));\n const visit = (child: ts.Node): void => {\n if (isFunction(child)) return;\n if (ts.isReturnStatement(child) && child.expression) for (const key of objectDiscriminants(child.expression)) result.add(key);\n ts.forEachChild(child, visit);\n };\n visit(node.body);\n return result;\n}\n\nfunction shapeNotices(shape: ReturnShape, type: ts.Type, checker: ts.TypeChecker, node: ts.Node): string[] {\n const notices: string[] = [...(shape.synthesisIssues ?? [])];\n const valueType = family(type, checker)?.args[0] ?? type;\n if (\"values\" in shape && shape.values.some(value => new TextEncoder().encode(value.text).byteLength > 2048)) notices.push(\"synthesized value exceeds 2048 bytes\");\n const omitted = shape.omittedValues ?? 0;\n if (omitted) notices.push(`${omitted} more values not generated (representative cap)`);\n if (\"errors\" in shape) for (const error of shape.errors) {\n if (error.reason !== undefined) notices.push(`cannot construct ${error.tag}: ${error.reason}`);\n if (new TextEncoder().encode(error.text).byteLength > 2048) notices.push(`cannot construct ${error.tag}: synthesized value exceeds 2048 bytes`);\n }\n if (\"values\" in shape && !shape.values.length && !(valueType.flags & ts.TypeFlags.Never) && shape.kind !== \"Void\") {\n notices.push(synthesisReason(type, checker, node));\n }\n return notices;\n}\n\n/** Bounded synthesis: cycles or unavailable required fields produce no fabricated value. */\nfunction valuesOf(type: ts.Type, checker: ts.TypeChecker, location: ts.Node, ancestors: ReadonlySet<ts.Type> = new Set(), depth = 0, issues = new Set<string>()): Value[] {\n if (depth > 4) { issues.add(\"synthesis depth limit (4) reached\"); return []; }\n if (ancestors.has(type) || type.flags & ts.TypeFlags.Never) return [];\n const values = synthesizeValues(type, checker, location, ancestors, depth, issues);\n const bounded = values.filter(value => new TextEncoder().encode(value.text).byteLength <= 2048);\n if (bounded.length !== values.length) issues.add(\"synthesized value exceeds 2048 bytes\");\n return bounded;\n}\n\nfunction synthesizeValues(type: ts.Type, checker: ts.TypeChecker, location: ts.Node, ancestors: ReadonlySet<ts.Type>, depth: number, issues: Set<string>): Value[] {\n const descend = (inner: ts.Type): Value[] => valuesOf(inner, checker, location, new Set([...ancestors, type]), depth + 1, issues);\n const value = (text: string): Value => ({ text, synthetic: false });\n const detected = family(type, checker);\n if (detected && (detected.kind === \"Option\" || detected.kind === \"Effect\")) {\n const api = imports(location.getSourceFile());\n const inner = detected.args[0];\n const values = inner ? descend(inner) : [];\n const wrap = api(detected.kind, detected.kind === \"Option\" ? \"some\" : \"succeed\");\n const none = detected.kind === \"Option\" ? api(\"Option\", \"none\") : undefined;\n return [\n ...(none ? [value(`${none}()`)] : []),\n ...(wrap ? values.map((v) => ({ text: `${wrap}(${v.text})`, synthetic: v.synthetic })) : []),\n ];\n }\n if (type.isIntersection()) {\n // Primitive brands need a cast. Structural intersections synthesize their required fields below.\n const primitive = type.types.find(member => member.flags & (ts.TypeFlags.String | ts.TypeFlags.Number));\n const brand = type.types.some(member => member.getProperties().some(prop => prop.name.includes(\"Brand\")));\n if (primitive && brand) return descend(primitive).map(v => ({ ...v, text: `(${v.text} as ${returnTypeText(type, checker, location)})` }));\n }\n const symbol = type.getSymbol();\n if ((symbol?.name === \"ReadonlySet\" || symbol?.name === \"Set\" || symbol?.name === \"ReadonlyMap\" || symbol?.name === \"Map\")\n && symbol.declarations?.some(d => /\\/lib\\.es.*\\.d\\.ts$/.test(d.getSourceFile().fileName))) {\n return [value(symbol.name.endsWith(\"Set\") ? \"new Set()\" : \"new Map()\")];\n }\n if (type.isUnion()) {\n const members = [...type.types];\n // The checker can intern scalar unions in different orders across selections.\n // Tagged structural variants retain their declaration order for cap selection.\n if (members.every(member => member.isLiteral() || !!(member.flags & (ts.TypeFlags.BooleanLiteral | ts.TypeFlags.Null | ts.TypeFlags.Undefined)))) {\n members.sort((a, b) => a.isNumberLiteral() && b.isNumberLiteral() ? a.value - b.value : checker.typeToString(a).localeCompare(checker.typeToString(b), \"en\"));\n }\n return members.flatMap(member => descend(member));\n }\n if (type.isStringLiteral()) return [value(JSON.stringify(type.value))];\n if (type.isNumberLiteral()) return [value(String(type.value))];\n if (type.flags & ts.TypeFlags.BooleanLiteral) return [value(checker.typeToString(type))];\n if (type.flags & ts.TypeFlags.Boolean) return [value(\"true\"), value(\"false\")];\n if (type.flags & ts.TypeFlags.String) return [value('\"\"'), value('\"xyzzy\"')];\n if (type.flags & ts.TypeFlags.Number) return [value(\"0\"), value(\"1\"), value(\"-1\")];\n if (type.flags & ts.TypeFlags.BigInt) return [value(\"0n\"), value(\"1n\")];\n if (type.flags & ts.TypeFlags.Null) return [value(\"null\")];\n if (type.flags & (ts.TypeFlags.Unknown | ts.TypeFlags.Any)) return [value(\"undefined\")];\n if (type.flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Void)) return [value(\"undefined\")];\n if (checker.isTupleType(type)) {\n const elements = checker.getTypeArguments(type as ts.TypeReference).map((t) => descend(t)[0]);\n return elements.every((v) => v !== undefined) ? [value(`[${elements.map((v) => v.text).join(\", \")}]`)] : [];\n }\n if (checker.isArrayType(type) || checker.isArrayLikeType(type)) {\n const element = checker.getIndexTypeOfType(type, ts.IndexKind.Number);\n const elements = element ? descend(element) : [];\n return [value(\"[]\"), ...elements.map((v) => ({ text: `[${v.text}]`, synthetic: v.synthetic }))];\n }\n if ((type.flags & ts.TypeFlags.Object || type.isIntersection()) && !type.getCallSignatures().length && !type.getConstructSignatures().length) {\n const fields: Array<{ name: string; values: Value[] }> = [];\n for (const prop of type.getProperties()) {\n if (prop.flags & ts.SymbolFlags.Optional) continue;\n if (!/^[$\\w]+$/.test(prop.name)) return [];\n const values = descend(checker.getTypeOfSymbolAtLocation(prop, location));\n if (!values.length) return [];\n fields.push({ name: prop.name, values });\n }\n const literalFields = fields.filter(field => {\n const prop = type.getProperty(field.name);\n if (!prop) return false;\n const t = checker.getTypeOfSymbolAtLocation(prop, location);\n return (t.isUnion() ? t.types : [t]).every(member => member.isLiteral() || !!(member.flags & ts.TypeFlags.BooleanLiteral));\n });\n const render = (changed?: typeof fields[number], replacement?: Value): Value | undefined => {\n const parts: string[] = [];\n let bytes = 6; // ({ ... }) delimiters\n for (const field of fields) {\n const v = (field === changed ? replacement! : field.values[0]!).text;\n const part = `${JSON.stringify(field.name)}: ${literalFields.includes(field) ? `(${v} as const)` : v}`;\n bytes += new TextEncoder().encode(part).byteLength + (parts.length ? 2 : 0);\n if (bytes > 2048) { issues.add(\"synthesized value exceeds 2048 bytes\"); return undefined; }\n parts.push(part);\n }\n return value(`({ ${parts.join(\", \")} })`);\n };\n const first = render();\n if (!first) return []; // Do not expand a wide object into thousands of oversized variants.\n const anonymous = !type.aliasSymbol && (!type.getSymbol() || [\"__type\", \"__object\"].includes(type.getSymbol()!.name));\n return [first, ...(anonymous ? literalFields.flatMap(field => field.values.slice(1).map(v => render(field, v))).filter(value => value !== undefined) : [])];\n }\n return [];\n}\n", "import { Scratch, ScratchError, type Mutant, type ScratchDir } from \"@mutant-cafe/core\";\nimport * as Effect from \"effect/Effect\";\nimport * as Console from \"effect/Console\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Path from \"effect/Path\";\nimport type * as PlatformError from \"effect/PlatformError\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\nimport * as ChildProcessSpawner from \"effect/process/ChildProcessSpawner\";\nimport * as Stream from \"effect/Stream\";\nimport * as Schema from \"effect/Schema\";\nimport { poisonInsertion } from \"./Poison.ts\";\n\nexport const ScratchLive = Layer.effect(Scratch, Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const failure = (operation: string, location: string, error: { readonly message: string }) =>\n new ScratchError({ operation, path: location, message: error.message });\n\n const skipVanished = (from: string, to: string) => <E extends PlatformError.PlatformError | ScratchError>(effect: Effect.Effect<void, E>) => effect.pipe(Effect.catch(error => {\n if (error._tag !== \"PlatformError\" || error.reason._tag !== \"NotFound\") return Effect.fail(error);\n return Effect.gen(function* () {\n const entry = yield* fs.lstat(from).pipe(Effect.result);\n if (entry._tag === \"Success\") {\n if (entry.success.type !== \"SymbolicLink\") return yield* Effect.fail(error);\n const target = yield* fs.stat(from).pipe(Effect.result);\n if (target._tag === \"Success\") return yield* Effect.fail(error);\n if (target.failure.reason._tag !== \"NotFound\") return yield* Effect.fail(target.failure);\n yield* Console.warn(`Warning: scratch copy skipped a dangling symlink: ${from}`);\n } else if (entry.failure.reason._tag !== \"NotFound\") return yield* Effect.fail(entry.failure);\n // Only our partial destination is removed, never a source entry.\n yield* fs.remove(to, { recursive: true, force: true });\n yield* Effect.logDebug(\"Scratch copy skipped a vanished source\", { source: from });\n });\n }));\n\n const discover = Effect.fn(\"Scratch.discover\")(function* (root: string) {\n let source = path.resolve(root);\n // Preserve workspace-relative tsconfig extends and local package imports.\n // Vitest still runs in the requested package, not at the workspace root.\n let copyRoot = source;\n let ancestor = source;\n while (true) {\n if ((yield* fs.exists(path.join(ancestor, \"pnpm-workspace.yaml\"))) || (yield* fs.exists(path.join(ancestor, \".git\")))) {\n copyRoot = ancestor;\n break;\n }\n const parent = path.dirname(ancestor);\n if (parent === ancestor) break;\n ancestor = parent;\n }\n const git = (args: ReadonlyArray<string>, cwd = source) => Effect.scoped(Effect.gen(function* () {\n const env = { ...process.env };\n for (const key of [\"GIT_DIR\", \"GIT_WORK_TREE\", \"GIT_INDEX_FILE\"]) delete env[key];\n const child = yield* spawner.spawn(ChildProcess.make(\"git\", [\"-C\", cwd, ...args], { stdin: \"ignore\", env, extendEnv: false }));\n const [code, output] = yield* Effect.all([child.exitCode, child.stdout.pipe(Stream.decodeText(), Stream.mkString), child.stderr.pipe(Stream.runDrain)], { concurrency: \"unbounded\" });\n return { code, output };\n }));\n // Git is optional outside repositories. Do not make a non-Git project\n // depend on a Git executable merely to retain the recursive fallback.\n let gitAncestor = source;\n let inRepository = false;\n while (true) {\n if (yield* fs.exists(path.join(gitAncestor, \".git\"))) { inRepository = true; break; }\n const parent = path.dirname(gitAncestor);\n if (parent === gitAncestor) break;\n gitAncestor = parent;\n }\n let selected: Set<string> | undefined;\n let directories: Set<string> | undefined;\n const linked = new Set<string>();\n const unreadable = new Set<string>();\n const ignoredRoots = new Set<string>();\n const pruneUnreadable = (location: string) => Effect.gen(function* () {\n unreadable.add(location);\n yield* Console.warn(`Warning: scratch copy skipped an unreadable ignored tree: ${location}`);\n });\n const originalSource = source;\n const originalCopyRoot = copyRoot;\n if (inRepository) yield* Effect.gen(function* () {\n const repository = yield* git([\"rev-parse\", \"--show-toplevel\"]);\n if (repository.code !== 0) return yield* new ScratchError({ operation: \"git rev-parse\", path: source, message: `Git exited ${repository.code}` });\n // Git returns physical paths (not /tmp aliases); use the same basis\n // before deriving the scratch package path or remapping self-links.\n source = yield* fs.realPath(source);\n copyRoot = path.resolve(repository.output.trim());\n const files = yield* git([\"ls-files\", \"--cached\", \"--others\", \"--exclude-standard\", \"--full-name\", \"-z\"], copyRoot).pipe(Effect.mapError(error => failure(\"git\", source, error)));\n if (files.code !== 0) return yield* Effect.fail(new ScratchError({ operation: \"git ls-files\", path: source, message: `Git exited ${files.code}` }));\n selected = new Set(files.output.split(\"\\0\").filter(Boolean).map(file => path.resolve(copyRoot, file)));\n const ignored = yield* git([\"ls-files\", \"--others\", \"--ignored\", \"--exclude-standard\", \"--directory\", \"-z\"], copyRoot);\n if (ignored.code !== 0) return yield* new ScratchError({ operation: \"git ls-files\", path: source, message: `Git exited ${ignored.code}` });\n // Keep ignored environment, build and generated files. Only prune\n // independent ignored checkouts/dependency trees, never their contents.\n const independent = (dir: string): Effect.Effect<boolean, PlatformError.PlatformError> => Effect.gen(function* () {\n if ((yield* fs.exists(path.join(dir, \".git\"))) || (yield* fs.exists(path.join(dir, \"node_modules\")))) return true;\n for (const name of yield* fs.readDirectory(dir)) {\n const child = path.join(dir, name);\n const info = yield* fs.lstat(child).pipe(Effect.result);\n if (info._tag === \"Failure\") {\n if (info.failure.reason._tag === \"PermissionDenied\") { yield* pruneUnreadable(child); continue; }\n return yield* info.failure;\n }\n if (info.success.type === \"Directory\" && (yield* independent(child))) return true;\n }\n return false;\n }).pipe(Effect.catch(error => error.reason._tag === \"PermissionDenied\"\n ? pruneUnreadable(dir).pipe(Effect.as(false)) : Effect.fail(error)));\n for (const file of ignored.output.split(\"\\0\").filter(Boolean)) {\n const target = path.resolve(copyRoot, file);\n if (path.relative(copyRoot, target).split(path.sep).some(part => [\"node_modules\", \".git\", \"mutants.out\", \".agent_sources\", \".agent-sources\", \".brain\", \".pi\", \".rift\"].includes(part))) continue;\n ignoredRoots.add(target);\n const info = yield* fs.lstat(target).pipe(Effect.result);\n if (info._tag === \"Failure\") {\n if (info.failure.reason._tag === \"NotFound\") continue;\n if (info.failure.reason._tag === \"PermissionDenied\") { yield* pruneUnreadable(target); continue; }\n return yield* info.failure;\n }\n if (info.success.type !== \"Directory\") { selected.add(target); continue; }\n if (yield* independent(target)) linked.add(target);\n else selected.add(target);\n }\n // Ignored does not mean unused: a workspace dependency may export\n // prebuilt output. Preserve each declared entry's top-level tree so\n // relative imports and wildcard/conditional exports stay loadable.\n const PackageEntries = Schema.fromJsonString(Schema.Struct({\n exports: Schema.optional(Schema.Unknown), imports: Schema.optional(Schema.Unknown),\n main: Schema.optional(Schema.String), module: Schema.optional(Schema.String), types: Schema.optional(Schema.String)\n }));\n const targets = (entry: unknown): ReadonlyArray<string> => typeof entry === \"string\" ? [entry]\n : Array.isArray(entry) ? entry.flatMap(targets)\n : entry !== null && typeof entry === \"object\" ? Object.values(entry).flatMap(targets) : [];\n for (const file of [...selected]) {\n if (path.basename(file) !== \"package.json\" || !(yield* fs.exists(file))) continue;\n const decoded = yield* Schema.decodeEffect(PackageEntries)(yield* fs.readFileString(file)).pipe(Effect.result);\n if (decoded._tag === \"Failure\") {\n yield* Console.warn(`Warning: cannot inspect package entry points for scratch copying: ${file}`);\n continue;\n }\n const pkg = decoded.success;\n const root = path.dirname(file);\n const entries = [...targets(pkg.exports), ...targets(pkg.imports)].filter(entry => entry.startsWith(\"./\"));\n entries.push(...[pkg.main, pkg.module, pkg.types].filter((entry): entry is string => entry !== undefined));\n for (const entry of entries) {\n const relative = path.relative(root, path.resolve(root, entry));\n if (!relative || relative === \"..\" || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) continue;\n const first = relative.split(path.sep)[0]!;\n if (![\"node_modules\", \".git\"].includes(first)) selected.add(path.join(root, first));\n }\n }\n directories = new Set([copyRoot]);\n for (const file of [...selected, ...linked]) {\n let parent = path.dirname(file);\n while (parent !== copyRoot && parent !== path.dirname(parent)) { directories.add(parent); parent = path.dirname(parent); }\n }\n }).pipe(Effect.catch(error => Effect.gen(function* () {\n yield* Console.warn(`Warning: Git scratch discovery failed; using recursive copy: ${error.message}`);\n source = originalSource;\n copyRoot = originalCopyRoot;\n selected = undefined;\n directories = undefined;\n linked.clear();\n unreadable.clear();\n ignoredRoots.clear();\n })));\n const linkedRoots = () => [...linked].filter(root => !selected?.has(root) && !unreadable.has(root)).map(root => path.relative(source, root))\n .filter(root => root !== \"..\" && !root.startsWith(`..${path.sep}`) && !path.isAbsolute(root));\n return { source, copyRoot, selected, directories, linked, unreadable, ignoredRoots, pruneUnreadable, linkedRoots };\n }, (effect, root) => effect.pipe(Effect.mapError(error => failure(\"discover\", root, error))));\n\n return Scratch.of({\n inspect: Effect.fn(\"Scratch.inspect\")(function* (root: string) { return (yield* discover(root)).linkedRoots(); }),\n acquire: Effect.fn(\"Scratch.acquire\")(function* (root: string) {\n const plan = yield* discover(root);\n const { source, copyRoot, selected, directories, linked, unreadable, ignoredRoots, pruneUnreadable } = plan;\n // Only failures of source-side reads may be skipped. Node's adapter uses\n // the first argument as the error path even for copyFile/symlink writes.\n const skipUnreadable = (from: string, to: string, enabled: boolean) => <E extends PlatformError.PlatformError | ScratchError>(effect: Effect.Effect<void, E>): Effect.Effect<void, E | PlatformError.PlatformError> => effect.pipe(Effect.catch((error): Effect.Effect<void, E | PlatformError.PlatformError> =>\n enabled && error._tag === \"PlatformError\" && error.reason._tag === \"PermissionDenied\" && error.reason.pathOrDescriptor === from\n && [\"access\", \"realPath\", \"stat\", \"lstat\", \"readDirectory\"].includes(error.reason.method)\n ? pruneUnreadable(from).pipe(Effect.andThen(fs.remove(to, { recursive: true, force: true }))) : Effect.fail(error)));\n const temp = yield* Effect.acquireRelease(\n fs.makeTempDirectory({ prefix: \"mutant-cafe-\" }).pipe(\n Effect.mapError((error) => failure(\"create\", source, error))),\n (dir) => fs.remove(dir, { recursive: true, force: true }).pipe(Effect.interruptible, Effect.timeout(30_000), Effect.catch(error => Console.warn(`Warning: scratch removal did not complete within its cleanup budget: ${error.message}`, { path: dir })))\n );\n // Materialize editable source symlinks. Dependencies and pruned trees\n // remain linked; target() rejects writes through links out of scratch.\n const copy = (from: string, to: string, ancestors: ReadonlyArray<string>, filter = true, ignored = false): Effect.Effect<void, ScratchError> =>\n Effect.gen(function* () {\n if (unreadable.has(from)) return;\n // Declared package entry trees must be copied, even when they hold\n // their own node_modules (for example preserveModules output).\n if (linked.has(from) && !selected?.has(from)) { yield* fs.symlink(from, to); return; }\n const real = yield* fs.realPath(from);\n const info = yield* fs.stat(from);\n if (info.type === \"Directory\") {\n if (ancestors.includes(real)) {\n return yield* Effect.fail(new ScratchError({ operation: \"copy\", path: from, message: \"Cyclic directory symlink\" }));\n }\n yield* fs.makeDirectory(to, { recursive: true });\n const entries = yield* fs.readDirectory(from);\n for (const entry of entries) {\n if ([\".git\", \"mutants.out\", \".agent_sources\", \".agent-sources\", \".brain\", \".pi\", \".rift\"].includes(entry)) continue;\n const src = path.join(from, entry);\n const dest = path.join(to, entry);\n // Never descend into ignored trees just to discover dependency folders.\n // Dependency links are needed only at the selected package ancestors.\n const filterChildren = filter && !selected?.has(from);\n if (filterChildren && selected && directories && !selected.has(src) && !directories.has(src) && !linked.has(src) && entry !== \"node_modules\") continue;\n if (entry === \"node_modules\") {\n // Own the directory so workspace/self links can point at the\n // copied package. Linking node_modules wholesale sends tests\n // importing their package name back to the original checkout.\n const linkDependencies = (from: string, to: string, ignored: boolean): Effect.Effect<void, PlatformError.PlatformError> => Effect.gen(function* () {\n yield* fs.makeDirectory(to, { recursive: true });\n for (const name of yield* fs.readDirectory(from)) {\n if ([\".vite\", \".vite-temp\", \".vitest\", \".cache\"].includes(name)) continue;\n const dependency = path.join(from, name);\n const destination = path.join(to, name);\n yield* Effect.gen(function* () {\n if (name.startsWith(\"@\")) {\n yield* linkDependencies(dependency, destination, ignored);\n return;\n }\n const realDependency = yield* fs.realPath(dependency);\n const rel = path.relative(copyRoot, realDependency);\n const inside = rel !== \"..\" && !rel.startsWith(`..${path.sep}`) && !path.isAbsolute(rel) && !rel.split(path.sep).includes(\"node_modules\")\n && (!selected || selected.has(realDependency) || directories?.has(realDependency));\n yield* fs.symlink(inside ? path.join(temp, rel) : realDependency, destination);\n }).pipe(skipVanished(dependency, destination), skipUnreadable(dependency, destination, ignored));\n }\n });\n yield* linkDependencies(src, dest, ignored || ignoredRoots.has(from)).pipe(skipVanished(src, dest), skipUnreadable(src, dest, ignored || ignoredRoots.has(from)));\n } else {\n yield* copy(src, dest, [...ancestors, real], filterChildren, ignored || ignoredRoots.has(from));\n }\n }\n } else if (info.type === \"File\") {\n if (ignored || ignoredRoots.has(from)) yield* fs.access(from, { readable: true });\n yield* fs.copyFile(from, to);\n }\n }).pipe(skipVanished(from, to), skipUnreadable(from, to, ignored || ignoredRoots.has(from)), Effect.mapError((error) => failure(\"copy\", from, error)));\n yield* copy(copyRoot, temp, []);\n const packageRoot = yield* fs.realPath(path.join(temp, path.relative(copyRoot, source))).pipe(\n Effect.mapError((error) => failure(\"resolve\", source, error)));\n\n const packageRelative = path.relative(yield* fs.realPath(temp), packageRoot);\n if (packageRelative === \"..\" || packageRelative.startsWith(`..${path.sep}`) || path.isAbsolute(packageRelative)) {\n return yield* new ScratchError({ operation: \"resolve\", path: source, message: \"Requested package is inside a linked ignored tree; refusing to mutate the original checkout. Choose an editable source package outside that tree.\" });\n }\n\n const originals = new Map<string, Uint8Array>();\n const target = (mutant: Mutant) => Effect.gen(function* () {\n const relative = path.isAbsolute(mutant.file) ? path.relative(source, mutant.file) : mutant.file;\n const location = path.resolve(packageRoot, relative);\n const rel = path.relative(packageRoot, location);\n if (rel === \"\" || rel === \"..\" || rel.startsWith(`..${path.sep}`) || path.isAbsolute(rel) || rel.split(path.sep).includes(\"node_modules\")) {\n return yield* Effect.fail(new ScratchError({ operation: \"resolve\", path: mutant.file, message: \"Mutant file must be inside the copied source tree\" }));\n }\n const real = yield* fs.realPath(location).pipe(Effect.mapError((error) => failure(\"resolve\", location, error)));\n const realRelative = path.relative(packageRoot, real);\n if (realRelative === \"..\" || realRelative.startsWith(`..${path.sep}`) || path.isAbsolute(realRelative)) {\n return yield* Effect.fail(new ScratchError({ operation: \"resolve\", path: mutant.file, message: \"Mutant file resolves outside the scratch package\" }));\n }\n return location;\n });\n const dir: ScratchDir = {\n path: packageRoot,\n linkedRoots: plan.linkedRoots(),\n apply: Effect.fn(\"Scratch.apply\")(function* (mutant: Mutant) {\n const location = yield* target(mutant);\n const bytes = yield* fs.readFile(location);\n originals.set(location, bytes);\n const original = new TextDecoder(\"utf-8\", { ignoreBOM: true }).decode(bytes);\n const { startOffset, endOffset, text } = mutant.replacement;\n if (startOffset < 0 || endOffset < startOffset || endOffset > original.length) {\n return yield* Effect.fail(new ScratchError({ operation: \"apply\", path: location, message: \"Replacement offsets are outside the file\" }));\n }\n yield* fs.writeFileString(location, original.slice(0, startOffset) + text + original.slice(endOffset));\n }, (effect, mutant) => effect.pipe(Effect.mapError((error) => failure(\"apply\", mutant.file, error)))),\n poison: Effect.fn(\"Scratch.poison\")(function* (mutant: Mutant, signal: string, token: string) {\n const location = yield* target(mutant);\n const bytes = yield* fs.readFile(location).pipe(Effect.mapError(error => failure(\"probe\", location, error)));\n const original = new TextDecoder(\"utf-8\", { ignoreBOM: true }).decode(bytes);\n const insertion = poisonInsertion(original, signal, token);\n yield* dir.apply({ ...mutant, replacement: { startOffset: insertion.offset, endOffset: insertion.offset, text: insertion.text } });\n }),\n revert: Effect.fn(\"Scratch.revert\")(function* (mutant: Mutant) {\n const location = yield* target(mutant);\n const bytes = originals.get(location);\n if (bytes !== undefined) {\n yield* fs.writeFile(location, bytes);\n originals.delete(location);\n }\n }, (effect, mutant) => effect.pipe(Effect.mapError((error) => failure(\"revert\", mutant.file, error))))\n };\n return dir;\n }, (effect, root) => effect.pipe(Effect.mapError((error) => error._tag === \"ScratchError\" ? error : failure(\"acquire\", root, error))))\n });\n}));\n", "/** Keep BOMs, shebangs and directive prologues ahead of temporary probe code. */\nexport function prologueEnd(source: string): number {\n let position = source.charCodeAt(0) === 0xfeff ? 1 : 0;\n if (source.startsWith(\"#!\", position)) {\n const newline = source.indexOf(\"\\n\", position);\n position = newline < 0 ? source.length : newline + 1;\n }\n const trivia = (from: number): number => {\n let at = from;\n while (at < source.length) {\n if (/\\s/.test(source[at]!)) { at++; continue; }\n if (source.startsWith(\"//\", at)) {\n const end = source.indexOf(\"\\n\", at);\n at = end < 0 ? source.length : end + 1;\n continue;\n }\n if (source.startsWith(\"/*\", at)) {\n const end = source.indexOf(\"*/\", at + 2);\n at = end < 0 ? source.length : end + 2;\n continue;\n }\n break;\n }\n return at;\n };\n while (position < source.length) {\n const start = trivia(position);\n const quote = source[start];\n if (quote !== '\"' && quote !== \"'\") break;\n let end = start + 1;\n while (end < source.length && source[end] !== quote) end += source[end] === \"\\\\\" ? 2 : 1;\n if (end >= source.length) break;\n end++;\n const next = trivia(end);\n if (source[next] === \";\") { position = next + 1; continue; }\n const continuation = /^(?:[([.`+*/%<>=!?:&,|^~\\-]|in\\b|instanceof\\b)/.test(source.slice(next));\n if (next === source.length || (!continuation && /[\\r\\n]/.test(source.slice(end, next)))) { position = next; continue; }\n break;\n }\n return position;\n}\n\nexport function poisonInsertion(source: string, signal: string, token: string): { readonly offset: number; readonly text: string } {\n return { offset: prologueEnd(source), text: `\\ntry { globalThis.process.getBuiltinModule(\"node:fs\").writeFileSync(${JSON.stringify(signal)}, ${JSON.stringify(token)}); }\ncatch { console.error(${JSON.stringify(token)}); }\ntry { globalThis[globalThis.Symbol.for(${JSON.stringify(token)})] = true; } catch {}\nthrow new Error(${JSON.stringify(token)});\\n` };\n}\n", "import { cleanTelemetry, DEFAULT_BASELINE_TIMEOUT_MS, BaselineFailed, BaselineTimedOut, formatTestCommand, TestRunner, TestSpawnError, type ScratchDir, type TestRun, type SelectionIssue, type Mutant } from \"@mutant-cafe/core\";\nimport * as Clock from \"effect/Clock\";\nimport * as Console from \"effect/Console\";\nimport { preflight } from \"./Preflight.ts\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport * as Stream from \"effect/Stream\";\nimport * as Schema from \"effect/Schema\";\nimport * as Scope from \"effect/Scope\";\n// @effect-diagnostics-next-line nodeBuiltinImport:off -- Resolve the target Vitest API for an external setup module.\nimport { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\nimport * as ChildProcessSpawner from \"effect/process/ChildProcessSpawner\";\nimport { openWarmRunner } from \"./WarmRunner.ts\";\nimport { reporterSource, vitestLauncherSource, type ProbeOptions } from \"./VitestHost.ts\";\nimport { acquireProcessTree } from \"./ProcessTree.ts\";\nimport { chooseMode, startupCost, type Calibration } from \"./Mode.ts\";\n\nconst baselineTimedOut = (timeoutMs: number, command: ReadonlyArray<string>) => new BaselineTimedOut({ timeoutMs, command,\n message: `Baseline exceeded ${timeoutMs / 1000} seconds overall, including selection and startup. Increase --baseline-timeout (seconds), or baselineTimeoutMs in mutants.config.json, for a longer suite.` });\n\nexport const TestRunnerLive = Layer.effect(TestRunner, Effect.gen(function* () {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n let warmDisabled = false;\n let modeReason: string | undefined;\n const sessions = new Map<string, Effect.Success<ReturnType<typeof openWarmRunner>>>();\n const auto = new Map<string, { readonly startupMs: number; readonly mutants: number }>();\n const primers = new Map<string, TestRun>();\n const backstopTotals = new Map<string, number>();\n let baselineBudgetMs = DEFAULT_BASELINE_TIMEOUT_MS;\n const lastCommands = new Map<string, ReadonlyArray<string>>();\n const onBackstop = (dir: string) => (ms: number) => { backstopTotals.set(dir, (backstopTotals.get(dir) ?? 0) + ms); };\n const scopes = new Map<string, Scope.Scope>();\n const openedAt = new Map<string, number>();\n const selectors = new Map<string, Effect.Success<ReturnType<typeof openWarmRunner>>>();\n let automaticMode: \"pending\" | \"cold\" | \"warm\" = \"pending\";\n let hostRestarts = 0;\n let poolResets = 0;\n let warned = false;\n const warn = (message: string) => Effect.suspend(() => { if (warned) return Effect.void; warned = true; return Console.warn(message); });\n const sessionOptions = { onRestart: () => { hostRestarts++; }, onPoolReset: () => { poolResets++; } };\n const execute = Effect.fn(\"TestRunner.execute\")(function* (dir: ScratchDir, args: ReadonlyArray<string>, timeoutMs?: number, testTimeoutMs?: number, forceCold = false, probe?: ProbeOptions) {\n const overallMs = timeoutMs ?? baselineBudgetMs;\n const beforeBackstop = backstopTotals.get(dir.path) ?? 0;\n const backstopMs = () => Math.max(0, (backstopTotals.get(dir.path) ?? 0) - beforeBackstop);\n const session = sessions.get(dir.path);\n if (session !== undefined && !warmDisabled && !auto.has(dir.path) && !forceCold) {\n if (timeoutMs === undefined) yield* Console.error(`Baseline command: vitest run --reporter=default (warm Node API, cwd: ${dir.path})`);\n const run = yield* session.run(args[0] === \"related\" ? args[1] : undefined, overallMs, testTimeoutMs ?? (timeoutMs === undefined ? undefined : Math.max(1, Math.floor(timeoutMs / 2))), probe);\n if (run !== undefined) return { ...run, backstopMs: backstopMs(), exitCode: run.status === \"passed\" || run.status === \"untested\" ? 0 : 1 };\n }\n // Dependency directories are linked to the source checkout. Disable both\n // result and transform caches so Vitest cannot write through those links.\n // Launch the project's installed CLI through our already-running Node.\n // No PATH search, npm wrapper, shell shim or package-manager install checks\n // may block the parent thread before its startup deadline can fire.\n const reporterDir = yield* fs.makeTempDirectoryScoped({ prefix: \"mutant-vitest-\" }).pipe(\n Effect.mapError((error) => new TestSpawnError({ command: [\"vitest\"], message: String(error) })));\n const reporter = path.join(reporterDir, \"reporter.mjs\");\n const launcher = path.join(reporterDir, \"launch.mjs\");\n yield* fs.writeFileString(launcher, vitestLauncherSource).pipe(Effect.mapError(error => new TestSpawnError({ command: [\"vitest\"], message: String(error) })));\n const marker = `mutant-cafe:${path.basename(reporterDir)}:`;\n // Vitest's reporter lifecycle is the machine-readable selection/progress\n // boundary. No human output parsing, and partial failures survive an outer kill.\n yield* fs.writeFileString(reporter, reporterSource(marker, probe)).pipe(Effect.mapError((error) => new TestSpawnError({ command: [\"vitest\"], message: String(error) })));\n const command = [process.execPath, launcher, ...args, \"--reporter=default\", `--reporter=${reporter}`, \"--bail\", \"1\",\n ...(timeoutMs === undefined ? [] : [\"--testTimeout\", String(testTimeoutMs ?? Math.max(1, Math.floor(timeoutMs / 2))), \"--hookTimeout\", String(testTimeoutMs ?? Math.max(1, Math.floor(timeoutMs / 2)))]),\n \"--no-cache\", \"--no-fsModuleCache\"];\n // Keep diagnostics off stdout so GitHub output is a Markdown document.\n const started = yield* Clock.currentTimeMillis;\n const owned = yield* acquireProcessTree(dir.path, onBackstop(dir.path), openedAt.get(dir.path)).pipe(Effect.provideService(FileSystem.FileSystem, fs),\n Effect.mapError(error => new TestSpawnError({ command, message: String(error) })));\n const chunks: Array<string> = [];\n let exitCode = 1;\n const child = Effect.scoped(Effect.gen(function* () {\n if (timeoutMs === undefined) yield* Console.error(`Baseline command: ${formatTestCommand(command)} (cwd: ${dir.path})`);\n lastCommands.set(dir.path, command);\n yield* owned.trace(\"cold-spawn-start\", { budgetMs: overallMs });\n const handle = yield* spawner.spawn(ChildProcess.make(command[0]!, command.slice(1), {\n cwd: dir.path,\n env: owned.env,\n // Node's scoped spawner kills the detached process group, not just pnpm.\n detached: true,\n killSignal: \"SIGKILL\",\n forceKillAfter: \"100 millis\",\n stdin: \"ignore\"\n }));\n yield* Effect.sync(() => owned.addRoot(handle.pid));\n yield* owned.trace(\"cold-spawn\", { childPid: handle.pid });\n const collect = handle.all.pipe(Stream.decodeText(), Stream.runForEach((chunk) =>\n Effect.sync(() => { chunks.push(chunk); })));\n const [code] = yield* Effect.all([handle.exitCode.pipe(Effect.tap(() => owned.cleanup)), collect], { concurrency: \"unbounded\" });\n exitCode = code;\n return code === 0 ? \"passed\" as const : \"failed\" as const;\n }).pipe(Effect.onInterrupt(() => owned.cleanup)));\n const status = yield* child.pipe(\n Effect.timeout(overallMs),\n Effect.catchTag(\"TimeoutError\", () => Effect.sync(() => { exitCode = 124; chunks.push(`\\nVitest timed out after ${overallMs}ms overall, including startup.\\n`); return \"timedOut\" as const; }))\n ).pipe(Effect.mapError((error) => new TestSpawnError({ command, message: error.message })));\n yield* owned.cleanup;\n const ended = yield* Clock.currentTimeMillis;\n const output = chunks.join(\"\");\n const failed = output.includes(marker + \"failed\");\n const selection = output.split(\"\\n\").find(line => line.includes(marker + \"selected:\"))?.split(marker + \"selected:\")[1];\n const selected = selection === undefined ? [] : yield* Schema.decodeEffect(Schema.fromJsonString(Schema.Array(Schema.String)))(selection).pipe(\n Effect.mapError(error => new TestSpawnError({ command, kind: \"reporter\", message: `Internal cold reporter protocol error in selected files: ${String(error)}` })));\n const telemetryWarnings: string[] = [];\n for (const part of output.split(marker + \"telemetryWarning:\").slice(1)) {\n const warning = Schema.decodeOption(Schema.fromJsonString(Schema.String))(part.split(\"\\n\")[0]!);\n if (warning._tag === \"Some\") telemetryWarnings.push(warning.value);\n }\n const testDurations: Record<string, number> = {};\n const testFileDurations: Record<string, number> = {};\n let firstTestStart = 0;\n const testTimeouts: Record<string, number> = {};\n const testTimeoutDetails: Record<string, number> = {};\n for (const line of output.split(\"\\n\")) {\n const entry = line.split(marker + \"duration:\")[1];\n if (entry === undefined) continue;\n const decoded = Schema.decodeOption(Schema.fromJsonString(Schema.Struct({ file: Schema.String, duration: Schema.Finite, timeout: Schema.Finite, key: Schema.String, start: Schema.Finite })))(entry);\n if (decoded._tag === \"None\") { telemetryWarnings.push(\"Internal reporter telemetry error: invalid cold timing marker; omitted\"); continue; }\n const timing = decoded.value;\n if (timing.start > 0) firstTestStart = firstTestStart ? Math.min(firstTestStart, timing.start) : timing.start;\n testDurations[timing.file] = Math.max(testDurations[timing.file] ?? 0, timing.duration);\n testTimeoutDetails[timing.key] = timing.timeout;\n testTimeouts[timing.file] = Math.max(testTimeouts[timing.file] ?? 0, timing.timeout);\n }\n for (const part of output.split(marker + \"fileDuration:\").slice(1)) {\n const decoded = Schema.decodeOption(Schema.fromJsonString(Schema.Struct({ file: Schema.String, duration: Schema.Finite })))(part.split(\"\\n\")[0]!);\n if (decoded._tag === \"None\") { telemetryWarnings.push(\"Internal reporter telemetry error: invalid cold file timing marker; omitted\"); continue; }\n const timing = decoded.value;\n testFileDurations[timing.file] = timing.duration;\n }\n const run: TestRun = {\n status: failed ? \"failed\" : status === \"passed\" && output.includes(marker + \"empty\") ? \"untested\" : status,\n durationMs: ended - started, command, output,\n testsCollected: output.includes(marker + \"collected\"),\n testFiles: selected, testDurations, testTimeouts, testTimeoutDetails, testFileDurations,\n startupMs: firstTestStart ? Math.max(0, Math.ceil(firstTestStart - started)) : 0,\n probeSupported: output.includes(marker + \"probeSupported:true\"),\n probeLoaded: output.includes(marker + \"probeLoaded\"),\n testWorkers: output.includes(marker + \"workers:\") ? Number(output.split(marker + \"workers:\")[1]?.split(\"\\n\")[0]) : undefined,\n testConcurrency: Math.max(0, ...output.split(marker + \"concurrency:\").slice(1).map(part => Number(part.split(\"\\n\")[0]))),\n };\n const cleaned = cleanTelemetry(run, \"cold run\");\n return { ...cleaned.value, backstopMs: backstopMs(), telemetryWarnings: [...telemetryWarnings, ...cleaned.warnings], exitCode };\n }, Effect.scoped);\n return TestRunner.of({\n stats: Effect.sync(() => ({ hostRestarts, poolResets })),\n open: Effect.fn(\"TestRunner.open\")(function* (dir: ScratchDir, cold: boolean, warm = false, mutants = 1) {\n scopes.set(dir.path, yield* Scope.Scope);\n openedAt.set(dir.path, yield* Clock.currentTimeMillis);\n yield* Effect.addFinalizer(() => Effect.sync(() => {\n sessions.delete(dir.path); selectors.delete(dir.path); auto.delete(dir.path); primers.delete(dir.path); scopes.delete(dir.path); backstopTotals.delete(dir.path); openedAt.delete(dir.path); lastCommands.delete(dir.path);\n if (scopes.size === 0) { baselineBudgetMs = DEFAULT_BASELINE_TIMEOUT_MS; warmDisabled = false; automaticMode = \"pending\"; hostRestarts = 0; poolResets = 0; warned = false; modeReason = undefined; }\n }));\n if (cold) modeReason = \"Explicit --cold\";\n if (cold || warmDisabled || (!warm && automaticMode === \"cold\")) return;\n const started = yield* Clock.currentTimeMillis;\n const session = yield* openWarmRunner(dir, reason => { warmDisabled = true; modeReason = reason; }, { ...sessionOptions, quiet: !warm, warn, onBackstop: onBackstop(dir.path), processesSince: openedAt.get(dir.path) }).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.mapError(error => error._tag === \"TestSpawnError\" ? error : new TestSpawnError({ command: [\"vitest\", \"warm\"], message: String(error) })));\n sessions.set(dir.path, session);\n if (warmDisabled || (!warm && automaticMode === \"cold\")) { yield* session.disable; return; }\n if (warm) modeReason = \"Explicit --warm; supported configuration\";\n if (!warm && automaticMode === \"pending\") auto.set(dir.path, { startupMs: (yield* Clock.currentTimeMillis) - started, mutants });\n\n }),\n invalidate: (dir, file) => sessions.get(dir.path)?.invalidate(file) ?? Effect.void,\n selectRelated: Effect.fn(\"TestRunner.selectRelated\")(function* (dir: ScratchDir, file: string) {\n const session = sessions.get(dir.path);\n if (session !== undefined && !warmDisabled) return yield* session.select(file);\n let selector = selectors.get(dir.path) ?? selectors.values().next().value;\n if (!selector) {\n const scope = scopes.get(dir.path);\n if (!scope) return undefined;\n selector = yield* openWarmRunner(dir, () => {}, { quiet: true, selectionOnly: true, onBackstop: onBackstop(dir.path), processesSince: openedAt.get(dir.path) }).pipe(Effect.provideService(FileSystem.FileSystem, fs),\n Effect.provideService(Scope.Scope, scope), Effect.mapError(error => error._tag === \"TestSpawnError\" ? error : new TestSpawnError({ command: [\"vitest\", \"select\"], message: String(error) })));\n selectors.set(dir.path, selector);\n }\n return yield* selector.select(file);\n }),\n probeReachability: Effect.fn(\"TestRunner.probeReachability\")(function* (dir: ScratchDir, mutant: Mutant, timeoutMs: number) {\n if (!dir.poison) return { file: mutant.file, status: \"unsupported\" as const, durationMs: 0, testCommand: [], output: \"Scratch adapter cannot poison modules\" };\n const temporary = yield* fs.makeTempDirectoryScoped({ prefix: \"mutant-probe-\" });\n const signal = path.join(temporary, \"loaded\");\n const control = path.join(temporary, \"control\");\n const token = `mutant-cafe-probe:${path.basename(temporary)}`;\n const setupFile = path.join(temporary, \"setup.mjs\");\n const vitest = yield* Effect.try({ try: () => pathToFileURL(path.join(path.dirname(createRequire(path.join(dir.path, \"package.json\")).resolve(\"vitest/package.json\")), \"dist/index.js\")).href,\n catch: error => new TestSpawnError({ command: [\"vitest\", \"probe\"], message: String(error) }) });\n yield* fs.writeFileString(setupFile, `import { beforeAll, afterAll } from ${JSON.stringify(vitest)};\n beforeAll(() => globalThis.process.getBuiltinModule(\"node:fs\").writeFileSync(${JSON.stringify(control)}, \"ready\"));\n afterAll(() => { if (globalThis[Symbol.for(${JSON.stringify(token)})]) throw new Error(${JSON.stringify(token)}); });`);\n const started = yield* Clock.currentTimeMillis;\n const invalidate = () => sessions.get(dir.path)?.invalidate(mutant.file) ?? Effect.void;\n const run = yield* Effect.acquireUseRelease(\n dir.poison(mutant, signal, token),\n () => Effect.gen(function* () {\n yield* invalidate();\n return yield* execute(dir, [\"run\", \"--passWithNoTests\"], timeoutMs, undefined, false, { token, setupFile });\n }),\n () => dir.revert(mutant).pipe(Effect.andThen(invalidate), Effect.orDie)\n );\n const supported = yield* fs.exists(control);\n const loaded = (yield* fs.exists(signal)) || run.probeLoaded === true;\n return { file: mutant.file,\n status: !supported ? \"unsupported\" as const : run.status === \"passed\" && !loaded ? \"unreachable\" as const : \"reachable\" as const,\n durationMs: (yield* Clock.currentTimeMillis) - started, testCommand: run.command, output: run.output };\n }, effect => effect.pipe(Effect.scoped, Effect.mapError(error => error._tag === \"ScratchError\" || error._tag === \"TestSpawnError\" ? error :\n new TestSpawnError({ command: [\"vitest\", \"probe\"], message: String(error) })))),\n baseline: Effect.fn(\"TestRunner.baseline\")(function* (dir: ScratchDir, tsconfig?: string, timeoutMs = DEFAULT_BASELINE_TIMEOUT_MS) {\n baselineBudgetMs = timeoutMs;\n lastCommands.delete(dir.path);\n const unreliable: ReadonlyArray<SelectionIssue> = yield* preflight(dir.path, tsconfig, timeoutMs, { processesSince: openedAt.get(dir.path), onBackstop: onBackstop(dir.path) }).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), Effect.catch(error => error._tag === \"TestSpawnError\" && error.kind === \"vitest-version\" ? Effect.fail(error) : Effect.succeed([{ kind: \"warning\" as const, reason: `Cannot verify runner selection: ${String(error)}` }])));\n for (const issue of unreliable) yield* Console.warn(`Warning (${issue.kind}): ${issue.reason}`);\n if (unreliable.some(issue => issue.kind === \"runner\")) {\n const command = [\"npx\", \"--no\", \"vitest\", \"run\", \"--passWithNoTests\"];\n yield* Console.warn(`Baseline command (not executed: unsupported runner): ${command.join(\" \")}`);\n return { durationMs: 0, testCommand: command, unreliable, runnerMode: \"cold\" as const, runnerModeReason: \"Unsupported test runner\" };\n }\n const run = yield* execute(dir, [\"run\", \"--passWithNoTests\"], undefined, undefined, auto.has(dir.path));\n if (run.status === \"timedOut\") return yield* baselineTimedOut(timeoutMs, run.command);\n if (run.status !== \"passed\" && run.status !== \"untested\") {\n return yield* Effect.fail(new BaselineFailed({ exitCode: run.exitCode, output: run.output, command: run.command }));\n }\n if (sessions.has(dir.path)) yield* sessions.get(dir.path)!.invalidate(run.testFiles?.[0] ?? \"package.json\");\n if (auto.has(dir.path)) primers.set(dir.path, run);\n return { durationMs: run.durationMs, testCommand: run.command, unreliable, hostPid: run.hostPid, telemetryWarnings: run.telemetryWarnings, testTimeoutDetails: run.testTimeoutDetails,\n testDurations: run.testDurations, testTimeouts: run.testTimeouts, testWorkers: run.testWorkers, testConcurrency: run.testConcurrency,\n testFileDurations: run.testFileDurations, startupMs: run.startupMs, probeSupported: run.probeSupported,\n runnerModeReason: modeReason ?? (auto.has(dir.path) ? \"Auto calibration pending\" : \"Cold execution; no warm session\"),\n runnerMode: sessions.has(dir.path) && !warmDisabled && !auto.has(dir.path) ? \"warm\" as const : \"cold\" as const };\n }, (effect, dir, _tsconfig?: string, timeoutMs = DEFAULT_BASELINE_TIMEOUT_MS) => effect.pipe(\n Effect.timeout(timeoutMs), Effect.catchTag(\"TimeoutError\", () => Effect.fail(baselineTimedOut(timeoutMs, lastCommands.get(dir.path) ?? []))))),\n calibrate: Effect.fn(\"TestRunner.calibrate\")(function* (dir: ScratchDir, mutants: number, copies: number) {\n const primer = primers.get(dir.path) ?? primers.values().next().value;\n if (!primer || automaticMode !== \"pending\" || auto.size === 0 || warmDisabled) return {};\n const disable = Effect.gen(function* () {\n automaticMode = \"cold\"; warmDisabled = true; auto.clear();\n for (const session of sessions.values()) yield* session.disable;\n });\n if (mutants <= (primer.testFiles?.length ?? 0)) {\n modeReason = `Auto: small selection (${mutants} testable mutants across ${primer.testFiles?.length ?? 0} files)`;\n yield* disable;\n return { runnerMode: \"cold\" as const, runnerModeReason: modeReason, testableMutants: mutants };\n }\n // A successful primer warmed the filesystem for BOTH measured runs.\n const startups = [...auto.values()].map(entry => entry.startupMs);\n auto.clear();\n // Finish the cold process before warm global-setup services are started.\n const cold = yield* execute(dir, [\"run\", \"--passWithNoTests\"], undefined, undefined, true);\n if (cold.status === \"timedOut\") return yield* baselineTimedOut(baselineBudgetMs, cold.command);\n if (cold.status !== \"passed\" && cold.status !== \"untested\") return yield* new BaselineFailed({ exitCode: cold.exitCode, output: cold.output, command: cold.command });\n const warm = yield* execute(dir, [\"run\", \"--passWithNoTests\"]);\n if (warm.status === \"timedOut\") return yield* baselineTimedOut(baselineBudgetMs, warm.command);\n if (warm.status !== \"passed\" && warm.status !== \"untested\") return yield* new BaselineFailed({ exitCode: warm.exitCode, output: warm.output, command: warm.command });\n const calibration: Calibration = { coldMs: cold.durationMs, warmMs: warm.durationMs,\n warmStartupMs: startupCost(startups, copies),\n overheadMs: warm.durationMs + cold.durationMs, coldStartupMs: cold.startupMs ?? 0, warmRunStartupMs: warm.startupMs ?? 0, testFiles: cold.testFiles?.length ?? 0, mutants };\n const sameSelection = JSON.stringify([...(warm.testFiles ?? [])].sort()) === JSON.stringify([...(cold.testFiles ?? [])].sort());\n const choice = !warmDisabled && warm.status === cold.status && sameSelection ? chooseMode(calibration) : \"cold\";\n modeReason = warmDisabled ? (modeReason ?? \"Warm execution failed during calibration\") : !sameSelection || warm.status !== cold.status ? \"Auto: cold/warm selection or status mismatch\" : `Auto: paired measurements favor ${choice}`;\n automaticMode = choice;\n auto.clear();\n if (choice === \"cold\") yield* disable;\n else if (sessions.has(dir.path)) yield* sessions.get(dir.path)!.invalidate(warm.testFiles?.[0] ?? \"package.json\");\n const run = choice === \"cold\" ? cold : warm;\n return { runnerMode: choice, runnerModeReason: modeReason, calibration, testableMutants: mutants, hostPid: run.hostPid };\n }),\n runRelated: Effect.fn(\"TestRunner.runRelated\")(function* (dir: ScratchDir, file: string, timeoutMs: number, testTimeoutMs?: number) {\n const related = yield* execute(dir, [\"related\", file, \"--run\", \"--passWithNoTests\"], timeoutMs, testTimeoutMs);\n if (related.status !== \"untested\") return related;\n const remaining = Math.max(1, timeoutMs - related.durationMs);\n const full = yield* execute(dir, [\"run\", \"--passWithNoTests\"], remaining, testTimeoutMs);\n return { ...full, status: full.status === \"passed\" ? \"untested\" as const : full.status, durationMs: related.durationMs + full.durationMs, backstopMs: (related.backstopMs ?? 0) + (full.backstopMs ?? 0),\n output: related.output + \"\\nFull-suite fallback:\\n\" + full.output };\n })\n });\n}));\n", "import { DEFAULT_BASELINE_TIMEOUT_MS, SelectionIssue, TestSpawnError, type Baseline } from \"@mutant-cafe/core\";\nimport * as Effect from \"effect/Effect\";\nimport * as Clock from \"effect/Clock\";\nimport * as Schema from \"effect/Schema\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\nimport * as ChildProcessSpawner from \"effect/process/ChildProcessSpawner\";\nimport { acquireProcessTree } from \"./ProcessTree.ts\";\n\nconst Issues = Schema.Array(SelectionIssue);\n\n// Run against installed Vitest. Source mapping is evidence, not an override of\n// its selection: built-entry issues are conditional on the tests actually run.\nconst probe = String.raw`\nimport { readFile, readdir } from \"node:fs/promises\";\nimport { resolve, relative, dirname, isAbsolute, sep } from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { fileURLToPath } from \"node:url\";\nconst root = process.cwd();\nconst issues = [];\nconst pkg = JSON.parse(await readFile(\"package.json\", \"utf8\").catch(error => { if (error.code === \"ENOENT\") return \"{}\"; throw error; }));\nconst script = pkg.scripts?.test;\nconst vitestScript = !script || /(?:^|[\\s/])vitest(?=\\s|$|[;&|])/.test(script);\nconst delegated = script && /(?:\\bturbo\\s+(?:run\\s+)?test\\b|\\bpnpm\\s+(?:-r|--recursive|--filter\\s+\\S+)\\s+(?:run\\s+)?test\\b)/.test(script);\nconst otherRunner = script && /(?:^|&&\\s*|;\\s*)(?:(?:pnpm\\s+exec|npx)\\s+)?(?:node\\s+(?:\\S+\\s+)*--test(?=\\s|$)|(?:jest|mocha|ava|tap)(?=\\s|$)|bun\\s+test(?=\\s|$))/.test(script);\nif (otherRunner) {\n issues.push({ kind: \"runner\", reason: 'package.json scripts.test = ' + JSON.stringify(script) + '; mutant.cafe only runs Vitest' });\n} else {\n if (!vitestScript) issues.push({ kind: \"warning\", reason: 'package.json scripts.test = ' + JSON.stringify(script) + (delegated ? '; delegated test runner: Vitest selection is unverified' : '; unknown test wrapper: Vitest selection is unverified') });\n // Resolve from the adopter's package, not mutant.cafe's bundled dependencies.\n const require = createRequire(resolve(root, \"package.json\"));\n let version;\n try { version = JSON.parse(await readFile(require.resolve(\"vitest/package.json\"), \"utf8\")).version; } catch {}\n if (typeof version === \"string\" && /^\\d+\\./.test(version) && Number(version.split(\".\")[0]) < 5) {\n console.log(\"mutant-cafe-vitest-version:\" + JSON.stringify(version));\n process.exit(0);\n }\n let ctx;\n try {\n const { createVitest } = await import(\"vitest/node\");\n ctx = await createVitest(\"test\", { root, watch: false, cache: false, fsModuleCache: false });\n const selected = new Set((await ctx.globTestSpecifications()).map(spec => resolve(spec.moduleId)));\n const sources = new Map();\n async function walk(dir) {\n for (const entry of await readdir(dir, { withFileTypes: true })) {\n if ([\"node_modules\", \".git\", \".brain\", \".pi\", \".agent_sources\", \"mutants.out\", \"dist\"].includes(entry.name)) continue;\n const file = resolve(dir, entry.name);\n if (entry.isDirectory()) await walk(file);\n else if (/\\.[cm]?[jt]sx?$/.test(file)) sources.set(file, await readFile(file, \"utf8\"));\n }\n }\n await walk(root);\n // Read only explicit rootDir/outDir evidence, including JSONC and extends.\n // Do not depend on a compiler API in the tested package or infer build layout.\n async function configOptions(file, seen = new Set()) {\n if (seen.has(file)) throw new Error('cyclic tsconfig extends');\n const text = await readFile(file, 'utf8');\n const json = text.replace(/\"(?:\\\\.|[^\"\\\\])*\"|\\/\\*[\\s\\S]*?\\*\\/|\\/\\/[^\\r\\n]*/g, token => token.startsWith('\"') ? token : token.replace(/[^\\r\\n]/g, ' '))\n .replace(/(\"(?:\\\\.|[^\"\\\\])*\")|,\\s*(?=[}\\]])/g, (token, string) => string ?? '');\n const config = JSON.parse(json);\n let options = {};\n for (const base of Array.isArray(config.extends) ? config.extends : typeof config.extends === 'string' ? [config.extends] : []) {\n const path = base.startsWith('.') || isAbsolute(base) ? resolve(dirname(file), base) : createRequire(file).resolve(base);\n const candidate = await readFile(path).then(() => path, () => path + '.json');\n options = { ...options, ...await configOptions(candidate, new Set([...seen, file])) };\n }\n for (const key of ['rootDir', 'outDir']) if (typeof config.compilerOptions?.[key] === 'string') options[key] = resolve(dirname(file), config.compilerOptions[key]);\n return options;\n }\n let options = {};\n try { options = await configOptions(resolve(root, process.argv[1])); }\n catch { /* No proven mapping: restrict by importing tests only. */ }\n function sourceFile(path) {\n return [path, path.replace(/\\.[cm]?js$/, '.ts'), path.replace(/\\.[cm]?js$/, '.mts'), path.replace(/\\.[cm]?js$/, '.cts'), path + '.ts', path + '.tsx', path + '.mts', path + '.cts', resolve(path, 'index.ts')].find(p => sources.has(p) && !/\\.d\\.[cm]?ts$/.test(p));\n }\n function exportTypes(specifier) {\n const key = specifier === pkg.name ? '.' : './' + specifier.slice(pkg.name.length + 1);\n let entry = pkg.exports;\n let wildcard;\n if (entry && typeof entry === 'object' && Object.keys(entry).some(key => key.startsWith('.'))) {\n if (key in entry) entry = entry[key];\n else {\n const pattern = Object.keys(entry).find(pattern => pattern.includes('*') && key.startsWith(pattern.split('*')[0]) && key.endsWith(pattern.split('*')[1]));\n if (!pattern) return;\n const [before, after] = pattern.split('*');\n wildcard = key.slice(before.length, after.length ? -after.length : undefined);\n entry = entry[pattern];\n }\n } else if (key !== '.') return;\n function types(value) {\n if (!value || typeof value !== 'object') return;\n if (typeof value.types === 'string') return value.types;\n return types(value.types) ?? types(value.import) ?? types(value.default);\n }\n const path = types(entry) ?? (key === '.' ? pkg.types : undefined);\n return typeof path === 'string' ? resolve(root, wildcard === undefined ? path : path.replaceAll('*', wildcard)) : undefined;\n }\n function mappedSource(entry, types) {\n for (const path of [types, entry]) {\n if (!path) continue;\n if (/\\.[cm]?tsx?$/.test(path) && !/\\.d\\.[cm]?ts$/.test(path)) {\n const direct = sourceFile(path);\n if (direct) return direct;\n }\n if (!options.rootDir || !options.outDir) continue;\n const inside = relative(options.outDir, path);\n if (inside === '..' || inside.startsWith('..' + sep) || isAbsolute(inside)) continue;\n const stem = inside.replace(/(?:\\.d)?\\.[cm]?[jt]sx?$/, '');\n const mapped = sourceFile(resolve(options.rootDir, stem));\n if (mapped) return mapped;\n }\n }\n const edges = new Map();\n const built = [];\n for (const [file, text] of sources) {\n const dependencies = new Set();\n edges.set(file, dependencies);\n for (const match of text.matchAll(/(?:from\\s*|import\\s*\\(?\\s*|require\\s*\\(\\s*)[\"']([^\"']+)[\"']/g)) {\n let target;\n let source;\n const specifier = match[1];\n if (specifier.startsWith('.')) target = resolve(dirname(file), specifier);\n else {\n try {\n const self = pkg.name && (specifier === pkg.name || specifier.startsWith(pkg.name + '/'));\n target = self ? fileURLToPath(import.meta.resolve(specifier)) : createRequire(file).resolve(specifier);\n if (self && (!/\\.[cm]?tsx?$/.test(target) || /\\.d\\.[cm]?ts$/.test(target))) {\n source = mappedSource(target, exportTypes(specifier));\n built.push({ importer: file, source, reason: relative(root, file) + ' imports ' + specifier + '; self entry resolves to built output ' + relative(root, target) + ', not mutated TypeScript source' + (source ? '; mapped source ' + relative(root, source) : '; source mapping unavailable') });\n }\n } catch { continue; }\n }\n const candidate = source ?? sourceFile(target);\n if (candidate) dependencies.add(candidate);\n }\n }\n function dependencies(file, seen = new Set()) {\n if (seen.has(file)) return seen;\n seen.add(file);\n for (const dependency of edges.get(file) ?? []) dependencies(dependency, seen);\n return seen;\n }\n const closures = new Map([...selected].map(file => [file, dependencies(file)]));\n for (const entry of built) {\n const testFiles = [...selected].filter(file => closures.get(file).has(entry.importer)).map(file => relative(root, file));\n if (testFiles.length) issues.push({ kind: 'built', ...(entry.source ? { files: [...dependencies(entry.source)].map(file => relative(root, file)) } : {}), testFiles, reason: entry.reason });\n }\n const reached = new Set([...closures.values()].flatMap(files => [...files]));\n for (const [file, text] of sources) {\n const testFile = /\\.(?:test|spec)\\.[cm]?[jt]sx?$/.test(file)\n || (/[\"'](?:node:test|vitest|@effect\\/vitest)[\"']/.test(text) && /\\b(?:it|test|describe)\\s*(?:\\.|\\()/.test(text));\n if (reached.has(file) || !testFile) continue;\n for (const target of dependencies(file)) {\n if (target !== file) issues.push({ kind: 'target', file: relative(root, target), reason: relative(root, file) + ' imports this target but is absent from Vitest resolved test files' });\n }\n }\n } catch (error) {\n issues.push({ kind: 'warning', reason: 'Cannot verify Vitest resolved selection: ' + String(error) });\n } finally { await ctx?.close(); }\n}\nconsole.log('mutant-cafe-preflight:' + JSON.stringify([...new Map(issues.map(issue => [JSON.stringify(issue), issue])).values()]));\n`;\n\ninterface PreflightOptions { readonly processesSince?: number | undefined; readonly onBackstop?: (ms: number) => void }\nexport const preflight = Effect.fn(\"TestRunner.preflight\")(function* (root: string, tsconfig = \"tsconfig.json\", timeoutMs = DEFAULT_BASELINE_TIMEOUT_MS, options: PreflightOptions = {}) {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const since = options.processesSince ?? (yield* Clock.currentTimeMillis);\n const owned = yield* acquireProcessTree(root, options.onBackstop, since);\n yield* owned.trace(\"preflight-start\", { budgetMs: timeoutMs });\n const output = yield* spawner.string(ChildProcess.make(process.execPath, [\"--input-type=module\", \"--eval\", probe, tsconfig], { cwd: root, env: owned.env, detached: true, killSignal: \"SIGKILL\", forceKillAfter: \"100 millis\", stdin: \"ignore\" })).pipe(Effect.onInterrupt(() => owned.cleanup));\n yield* owned.trace(\"preflight-done\");\n const version = output.split(\"\\n\").find(line => line.startsWith(\"mutant-cafe-vitest-version:\"))?.slice(\"mutant-cafe-vitest-version:\".length);\n if (version !== undefined) {\n const found = yield* Schema.decodeEffect(Schema.fromJsonString(Schema.String))(version);\n return yield* new TestSpawnError({ kind: \"vitest-version\", command: [\"vitest\"], message: `mutant.cafe needs vitest >= 5.0, found ${found}` });\n }\n const encoded = output.split(\"\\n\").find(line => line.startsWith(\"mutant-cafe-preflight:\"))?.slice(\"mutant-cafe-preflight:\".length);\n const issues = encoded === undefined\n ? [{ kind: \"warning\" as const, reason: \"Vitest selection probe returned no evidence\" }]\n : yield* Schema.decodeEffect(Schema.fromJsonString(Issues))(encoded);\n return issues;\n}, (effect, _root, _tsconfig = \"tsconfig.json\", timeoutMs = DEFAULT_BASELINE_TIMEOUT_MS, _options: PreflightOptions = {}) => effect.pipe(Effect.timeout(timeoutMs), Effect.scoped));\n\n/** Only runner/omitted-target evidence is unconditional. Built imports require\n * both a source-closure match (when known) and the actual selected test set. */\nexport function unreliableFor(baseline: Baseline, file: string, testFiles?: ReadonlyArray<string>): ReadonlyArray<SelectionIssue> {\n return baseline.unreliable?.filter(issue => {\n switch (issue.kind) {\n case \"runner\": return true;\n case \"warning\": return false;\n case \"target\": return issue.file === file;\n case \"built\": return (issue.files === undefined || issue.files.includes(file))\n && (testFiles?.some(test => issue.testFiles.includes(test)) ?? false);\n }\n }) ?? [];\n}\n", "import { TestSpawnError } from \"@mutant-cafe/core\";\nimport { createEffectActor, createEffectLogic, join, send, setupEffect } from \"@xstate/effect\";\nimport { types } from \"xstate\";\nimport { processTraceSource } from \"./ProcessTrace.ts\";\nimport * as Console from \"effect/Console\";\nimport * as Clock from \"effect/Clock\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Result from \"effect/Result\";\nimport * as Schema from \"effect/Schema\";\nimport * as Semaphore from \"effect/Semaphore\";\n// @effect-diagnostics-next-line nodeBuiltinImport:off -- OS process inspection and PID signals have no portable Effect service.\nimport { execFile } from \"node:child_process\";\n// @effect-diagnostics-next-line nodeBuiltinImport:off -- Adapt the OS inspector's callback API at this boundary.\nimport { promisify } from \"node:util\";\n// @effect-diagnostics-next-line nodeBuiltinImport:off -- Ownership labels must not collide across unrelated processes.\nimport { randomUUID } from \"node:crypto\";\n// @effect-diagnostics-next-line nodeBuiltinImport:off -- NODE_OPTIONS --import needs a file URL, including paths with spaces.\nimport { pathToFileURL } from \"node:url\";\n\nconst execute = promisify(execFile);\n// Warning-only recognition spans selectors and execution sessions. These paths\n// never authorize a signal: discover() still uses only its own ledger.\nconst liveLedgers = new Set<string>();\nexport const ProcessInspector = Context.Reference<{\n readonly inspect: (args: ReadonlyArray<string>) => Effect.Effect<{ readonly stdout: string }, TestSpawnError>;\n readonly signal?: (pid: number, signal: \"SIGSTOP\" | \"SIGKILL\") => void;\n}>(\"mutant.cafe/ProcessInspector\", { defaultValue: () => ({ inspect: args => Effect.tryPromise({\n try: signal => execute(\"/bin/ps\", [...args], { signal, encoding: \"utf8\", maxBuffer: 32 * 1024 * 1024, timeout: 2000, env: { PATH: process.env.PATH, LC_ALL: \"C\", TZ: \"UTC\" } }),\n catch: () => new TestSpawnError({ command: [\"ps\"], message: \"Cannot inspect owned test processes\" })\n}) }) });\n// A reaped or inaccessible PID makes lsof exit 1, even with useful stdout.\n// Aborted, signalled and other failures must still take the warning path.\nconst PartialCwd = Schema.Struct({ code: Schema.Literal(1), stdout: Schema.String, signal: Schema.optional(Schema.Null), killed: Schema.optional(Schema.Literal(false)) });\nexport const inspectScratchCwd = (pids: ReadonlyArray<number>, probe: {\n readonly live: (pid: number) => boolean;\n readonly read: (pids: ReadonlyArray<number>, signal: AbortSignal) => Promise<{ readonly stdout: string }>;\n} = {\n live: pid => { if (pid <= 0) return false; try { process.kill(pid, 0); return true; } catch { return false; } },\n read: (pids, signal) => execute(\"/usr/sbin/lsof\", [\"-b\", \"-w\", \"-n\", \"-P\", \"-a\", \"-d\", \"cwd\", \"-p\", pids.join(\",\"), \"-Fpn\"], { signal, encoding: \"utf8\", timeout: 2000, maxBuffer: 32 * 1024 * 1024, env: { PATH: process.env.PATH, LC_ALL: \"C\" } })\n}) => Effect.tryPromise({\n // @effect-diagnostics-next-line asyncFunction:off -- Native execFile adapter preserves partial stdout while Effect supplies cancellation.\n try: async signal => {\n const live = pids.filter(probe.live);\n if (!live.length) return { stdout: \"\" };\n try { return await probe.read(live, signal); }\n catch (error) {\n const partial = Schema.decodeUnknownOption(PartialCwd)(error);\n if (partial._tag === \"Some\") return { stdout: partial.value.stdout };\n throw error;\n }\n },\n catch: () => new TestSpawnError({ command: [\"lsof\"], message: \"Cannot inspect scratch working directories\" })\n});\nconst tokenKey = \"MUTANT_CAFE_PROCESS_TOKEN\";\nconst ledgerKey = \"MUTANT_CAFE_PROCESS_LEDGER\";\nconst preloadKey = \"MUTANT_CAFE_PROCESS_PRELOAD\";\n\n// Record native children at spawn, not when their parent eventually exits.\n// Updating builtin ESM exports also covers `import { spawn } from node:child_process`.\nconst preloadSource = `import cp from \"node:child_process\";\n${processTraceSource}\nimport { appendFileSync } from \"node:fs\";\nimport { syncBuiltinESMExports } from \"node:module\";\nconst nativeExec = Symbol.for(\"mutant.cafe.nativeExecFile\");\nconst inspect = cp[nativeExec] ?? (cp[nativeExec] = cp.execFile);\nconst ledger = process.env.${ledgerKey};\nconst token = process.env.${tokenKey};\nconst preload = process.env.${preloadKey};\ntraceProcess(\"preload-start\");\n// Async native inspection plus an independent timer: execFileSync's timeout\n// still waits for a kernel-blocked helper to exit, freezing the Node thread.\nconst record = pid => new Promise(resolve => {\n if (!pid || !ledger) return resolve();\n const began = performance.now();\n const phase = process.env.MUTANT_CAFE_PROCESS_PHASE;\n let settled = false; let child;\n const done = (stage, started = \"\") => {\n if (settled) return;\n settled = true; clearTimeout(timer);\n if (started) try { appendFileSync(ledger, JSON.stringify({ pid, birth: started, phase }) + \"\\\\n\"); } catch {}\n traceProcess(stage, { targetPid: pid, elapsedMs: performance.now() - began });\n resolve();\n };\n const timer = setTimeout(() => {\n done(\"ps-record-timeout\");\n try { child?.kill(\"SIGKILL\"); } catch {}\n child?.stdout?.destroy(); child?.stderr?.destroy(); child?.unref();\n }, 1000);\n traceProcess(\"ps-record-start\", { targetPid: pid });\n try {\n child = inspect(\"/bin/ps\", [\"-p\", String(pid), \"-o\", \"lstart=\"], { encoding: \"utf8\", timeout: 1000, killSignal: \"SIGKILL\", env: { LC_ALL: \"C\", TZ: \"UTC\" } }, (error, stdout) => done(error ? \"ps-record-failed\" : \"ps-record-done\", error ? \"\" : stdout.trim()));\n } catch { done(\"ps-record-failed\"); }\n});\nif (ledger && token && preload) {\n// Await only our own birth before user code can busy-loop. Child-spawn records\n// are asynchronous; implicit Node children also record themselves here.\nawait record(process.pid);\ntraceProcess(\"preload-ready\");\nconst environment = node => {\n const env = { ...process.env };\n const ownImport = \"--import=\" + preload;\n const original = (env.NODE_OPTIONS || \"\").replaceAll(ownImport, \"\").trim();\n if (node && env.${ledgerKey} === ledger && env.${tokenKey} === token) env.NODE_OPTIONS = (original + \" \" + ownImport).trim();\n else if (original) env.NODE_OPTIONS = original;\n else delete env.NODE_OPTIONS;\n return env;\n};\nconst options = (value, node) => value?.env !== undefined ? value : ({ ...value, env: environment(node) });\nfor (const name of [\"spawn\", \"fork\", \"execFile\", \"exec\"]) {\n const original = cp[name];\n const wrapped = function (...args) {\n const index = name === \"exec\" ? 1 : Array.isArray(args[1]) || (args[1] === undefined && args.length > 2) ? 2 : 1;\n const value = typeof args[index] === \"object\" && args[index] !== null ? args[index] : undefined;\n const node = name === \"fork\" ? (value?.execPath || process.execPath) === process.execPath : args[0] === process.execPath;\n if (typeof args[index] === \"function\") args.splice(index, 0, options(undefined, node));\n else args[index] = options(value, node);\n traceProcess(\"spawn-start\", { method: name, node });\n const child = original.apply(this, args);\n traceProcess(\"spawn-return\", { method: name, childPid: child.pid, node });\n child.once(\"spawn\", () => traceProcess(\"spawn\", { method: name, childPid: child.pid, node }));\n // Exact birth inspection cannot block spawn: a minimal-env child can be\n // orphaned before this async callback if its parent exits immediately.\n // Without a birth row, surviving PPID edge or label, it stays warning-only\n // (cwd/argv backstop). A PID plus approximate spawn time is not reuse proof.\n void record(child.pid);\n return child;\n };\n const custom = Symbol.for(\"nodejs.util.promisify.custom\");\n const descriptors = Object.getOwnPropertyDescriptors(original);\n delete descriptors[custom];\n Object.defineProperties(wrapped, descriptors);\n if (name === \"exec\" || name === \"execFile\") Object.defineProperty(wrapped, custom, { value: (...args) => {\n let child;\n const promise = new Promise((resolve, reject) => {\n child = wrapped(...args, (error, stdout, stderr) => {\n if (error) { error.stdout = stdout; error.stderr = stderr; reject(error); }\n else resolve({ stdout, stderr });\n });\n });\n promise.child = child;\n return promise;\n } });\n cp[name] = wrapped;\n}\nsyncBuiltinESMExports();\n}\n`;\n\nconst Record = Schema.Struct({ pid: Schema.Int, birth: Schema.String });\ntype Record = typeof Record.Type;\ninterface ProcessInfo extends Record { readonly ppid: number; readonly pgid: number; readonly state: string; readonly argv: string }\ninterface CleanupState {\n readonly pending: ReadonlyArray<ProcessInfo>;\n readonly round: number;\n readonly failure: string | undefined;\n}\n\nexport const acquireProcessTree = Effect.fn(\"ProcessTree.acquire\")(function* (scratch?: string, onBackstop?: (durationMs: number) => void, processesSince?: number) {\n const fs = yield* FileSystem.FileSystem;\n const directory = yield* fs.makeTempDirectory({ prefix: \"mutant-processes-\" });\n const ledger = `${directory}/pids.jsonl`;\n const script = `${directory}/register.mjs`;\n const token = yield* Effect.sync(randomUUID);\n const url = pathToFileURL(script).href;\n yield* fs.writeFileString(ledger, \"\");\n yield* fs.writeFileString(script, preloadSource);\n liveLedgers.add(ledger);\n const trace = (stage: string, details: { readonly [key: string]: number | string } = {}) => {\n const destination = process.env.MUTANT_CAFE_PROCESS_TRACE;\n return destination ? Clock.currentTimeMillis.pipe(Effect.flatMap(at => fs.writeFileString(destination, JSON.stringify({ at, pid: process.pid, ppid: process.ppid, stage, ...details }) + \"\\n\", { flag: \"a\" })), Effect.timeout(100), Effect.catch(() => Effect.void)) : Effect.void;\n };\n const roots = new Set<number>();\n const command = [\"vitest\", \"process-cleanup\"];\n // Never include inspector output: it can contain environment values.\n const inspector = yield* ProcessInspector;\n // The complete sweep, not each PID or retry, owns this deadline. Actor tasks\n // must be interruptible too: stopping their host waits for invocation cleanup.\n let deadline = Infinity;\n let lastSnapshot: Map<number, ProcessInfo> | undefined;\n let ledgerRows: ReadonlyArray<Record> = [];\n const verified = new Map<number, ProcessInfo>();\n let effectiveKeep = new Set<number>();\n const kill = inspector.signal ?? ((pid: number, signal: \"SIGSTOP\" | \"SIGKILL\") => { process.kill(pid, signal); });\n const bounded = <A, E, R>(phase: string, effect: Effect.Effect<A, E, R>, limit = 7000) => Effect.suspend(() => {\n const remaining = Math.min(limit, deadline - performance.now());\n if (remaining <= 0) return Effect.fail(new TestSpawnError({ command, message: `Cleanup deadline exceeded during ${phase}` }));\n return effect.pipe(Effect.interruptible, Effect.timeout(remaining), Effect.mapError(() => new TestSpawnError({ command, message: `Cleanup ${phase} failed or exceeded its ${Math.ceil(remaining)} ms budget` })));\n });\n const inspect = (args: ReadonlyArray<string>) => bounded(\"ps inspection\", Effect.gen(function* () {\n const began = performance.now();\n yield* trace(\"inspect-start\", { operation: args[0] ?? \"ps\" });\n const result = yield* inspector.inspect(args);\n yield* trace(\"inspect-done\", { elapsedMs: performance.now() - began });\n return result;\n }), 2000);\n const snapshot = Effect.gen(function* () {\n const result = yield* inspect([\"-A\", \"-ww\", \"-o\", \"pid=,ppid=,pgid=,stat=,lstart=,args=\"]);\n const found = new Map<number, ProcessInfo>();\n for (const line of result.stdout.split(\"\\n\")) {\n const match = /^\\s*(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\S+)\\s+((?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\s+\\w{3}\\s+\\d+\\s+\\d{2}:\\d{2}:\\d{2}\\s+\\d{4})(?:\\s+(.*))?$/.exec(line);\n if (!match) continue;\n const pid = Number(match[1]);\n if (pid !== process.pid && !match[4]!.startsWith(\"Z\")) found.set(pid, { pid, ppid: Number(match[2]), pgid: Number(match[3]), state: match[4]!, birth: match[5]!.trim(), argv: match[6] ?? \"\" });\n }\n for (const [pid, item] of verified) if (found.get(pid)?.birth !== item.birth) verified.delete(pid);\n lastSnapshot = found;\n return found;\n });\n const discover = (preserved: ReadonlySet<number>, retained: ReadonlyArray<Record>) => Effect.gen(function* () {\n const registered = yield* fs.readFileString(ledger).pipe(Effect.mapError(() => new TestSpawnError({ command, message: \"Cannot read the test process ownership ledger\" })));\n ledgerRows = registered.split(\"\\n\").flatMap(line => {\n const parsed = Schema.decodeOption(Schema.fromJsonString(Record))(line);\n return parsed._tag === \"Some\" ? [parsed.value] : [];\n });\n const table = yield* snapshot;\n const keep = new Set(preserved);\n const subtrees = new Set(retained.filter(item => table.get(item.pid)?.birth === item.birth).map(item => item.pid));\n let keepAdded: boolean;\n do { keepAdded = false; for (const item of table.values()) if (subtrees.has(item.ppid) && !subtrees.has(item.pid)) { subtrees.add(item.pid); keepAdded = true; } } while (keepAdded);\n for (const pid of subtrees) keep.add(pid);\n effectiveKeep = keep;\n const owned = new Set<number>();\n const claim = (pid: number) => {\n owned.add(pid);\n const item = table.get(pid);\n if (item && !keep.has(pid)) verified.set(pid, item);\n };\n const closeDescendants = () => {\n let added: boolean;\n do {\n added = false;\n for (const item of table.values()) if (owned.has(item.ppid) && !owned.has(item.pid)) { claim(item.pid); added = true; }\n } while (added);\n };\n const uncertain = new Set<number>();\n for (const item of ledgerRows) if (table.get(item.pid)?.birth === item.birth) claim(item.pid);\n // Claim unlabelled descendants before fallible label inspection. Emergency\n // parent kills must not orphan children before the next sweep can claim them.\n closeDescendants();\n // A child may have daemonized and lost its PPID before cleanup. Its inherited\n // unguessable label remains evidence of ownership even across setsid/exec.\n // This raw output is never logged, returned, or stored in the report.\n if (process.platform === \"linux\") {\n yield* Effect.forEach([...table.keys()], pid => fs.readFileString(`/proc/${pid}/environ`).pipe(\n Effect.catch(() => Effect.succeed(\"\")), Effect.tap(environment => Effect.sync(() => {\n if (!owned.has(pid) && environment.split(\"\\0\").includes(`${tokenKey}=${token}`)) { claim(pid); closeDescendants(); }\n }))), { concurrency: 8, discard: true });\n } else {\n const labelled = yield* inspect([\"axeww\", \"-o\", \"pid=,lstart=,command=\"]);\n const label = new RegExp(\"(?:^|\\\\s)\" + tokenKey + \"=\" + token + \"(?:\\\\s|$)\");\n // Environments can contain newlines. Bulk rows nominate candidates only;\n // verify their individual environment, never a token in somebody's argv.\n const rows = [...labelled.stdout.matchAll(/^\\s*(\\d+)\\s+((?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\s+\\w{3}\\s+\\d+\\s+\\d{2}:\\d{2}:\\d{2}\\s+\\d{4})\\s/gm)];\n for (const [index, row] of rows.entries()) {\n const pid = Number(row[1]);\n const record = labelled.stdout.slice(row.index, rows[index + 1]?.index);\n if (owned.has(pid) || table.get(pid)?.birth !== row[2]?.trim() || !label.test(record)) continue;\n const argv = yield* inspect([\"ww\", \"-p\", String(pid), \"-o\", \"command=\"]).pipe(Effect.result);\n const environment = yield* inspect([\"eww\", \"-p\", String(pid), \"-o\", \"command=\"]).pipe(Effect.result);\n const after = yield* inspect([\"ww\", \"-p\", String(pid), \"-o\", \"command=\"]).pipe(Effect.result);\n if (Result.isFailure(argv) || Result.isFailure(environment) || Result.isFailure(after)) continue;\n const prefix = argv.success.stdout.trimEnd();\n if (prefix && prefix === after.success.stdout.trimEnd() && environment.success.stdout.startsWith(prefix + \" \") &&\n label.test(environment.success.stdout.slice(prefix.length))) uncertain.add(pid);\n }\n }\n // Discover non-Node descendants too, without assuming they kept our env.\n closeDescendants();\n // Darwin's ps output cannot distinguish a copied label inside an env value\n // from an actual key. A label alone must never authorize signalling another\n // session: require its birth ledger or current PPID chain, otherwise warn.\n const unverified = [...uncertain].filter(pid => !owned.has(pid));\n if (unverified.length && ![...owned].some(pid => !keep.has(pid))) return yield* new TestSpawnError({ command, message: `Cannot verify test process ownership for PIDs: ${unverified.join(\", \")}; not signalled` });\n if (unverified.length) yield* Console.warn(`Warning: unverified process PIDs ${unverified.join(\", \")}; not signalled. Cleaning verified descendants first.`);\n return [...owned].flatMap(pid => table.has(pid) && !keep.has(pid) ? [table.get(pid)!] : []);\n });\n const signal = (pending: ReadonlyArray<ProcessInfo>, value: \"SIGSTOP\" | \"SIGKILL\") => Effect.gen(function* () {\n const current = yield* snapshot;\n for (const item of pending) {\n if (current.get(item.pid)?.birth !== item.birth) continue; // PID was reused: it is no longer ours.\n yield* Effect.sync(() => {\n try {\n if (roots.has(item.pid) && current.get(item.pid)?.pgid === item.pid) kill(-item.pid, value);\n } catch { /* The group may already be gone. Still check the PID. */ }\n try { kill(item.pid, value); }\n catch { /* Verification below reports any survivor by PID. */ }\n });\n }\n });\n // A scratch-path match nominates a survivor for warning, never for killing.\n const inspectUnowned = Effect.gen(function* () {\n if (!scratch) return;\n const table = lastSnapshot ?? (yield* snapshot);\n const registered = yield* Effect.forEach([...liveLedgers], path => fs.readFileString(path).pipe(Effect.catch(() => Effect.succeed(\"\"))));\n const known = new Set(registered.join(\"\\n\").split(\"\\n\").flatMap(line => {\n const parsed = Schema.decodeOption(Schema.fromJsonString(Record))(line);\n return parsed._tag === \"Some\" && table.get(parsed.value.pid)?.birth === parsed.value.birth ? [parsed.value.pid] : [];\n }));\n const candidates = new Set<number>();\n // A process older than this scratch session cannot have been started by its\n // tests. Round down for ps's one-second birth precision. No signal uses this\n // warning-only fence; Linux ownership-label discovery remains unchanged.\n const since = processesSince === undefined ? -Infinity : Math.floor(processesSince / 1000) * 1000;\n const possible = [...table.values()].filter(item => !known.has(item.pid) && (processesSince === undefined || Date.parse(item.birth + \" UTC\") >= since));\n for (const item of possible) if (item.argv.includes(scratch)) candidates.add(item.pid);\n if (process.platform === \"linux\") yield* Effect.forEach(possible.map(item => item.pid), pid => fs.readLink(`/proc/${pid}/cwd`).pipe(\n Effect.catch(() => Effect.succeed(\"\")), Effect.tap(cwd => Effect.sync(() => { if (cwd === scratch || cwd.startsWith(scratch + \"/\")) candidates.add(pid); }))), { concurrency: 8, discard: true });\n else if (process.platform === \"darwin\" && possible.length) {\n const cwdStarted = performance.now();\n yield* trace(\"cwd-start\", { candidates: possible.length });\n const cwd = yield* inspectScratchCwd(possible.map(item => item.pid)).pipe(Effect.catch(() => Console.warn(\"Warning: cannot inspect scratch working directories; argv backstop remains active\").pipe(Effect.as({ stdout: \"\" }))));\n yield* trace(\"cwd-done\", { elapsedMs: performance.now() - cwdStarted });\n let pid = 0;\n for (const row of cwd.stdout.split(\"\\n\")) {\n if (row.startsWith(\"p\")) pid = Number(row.slice(1));\n if (row.startsWith(\"n\") && (row.slice(1) === scratch || row.slice(1).startsWith(scratch + \"/\"))) candidates.add(pid);\n }\n }\n const survivors = [...candidates].filter(pid => table.has(pid) && !known.has(pid));\n if (survivors.length) yield* Console.warn(`Warning: unowned scratch-related process PIDs ${survivors.join(\", \")} survived; not signalled because ownership is unproven`);\n }).pipe(Effect.catch(() => Console.warn(\"Warning: cannot inspect unowned scratch-related survivors; no unverified PID was signalled\")));\n const warnUnowned = Effect.gen(function* () {\n if (!scratch) return;\n const started = yield* Clock.currentTimeMillis;\n // Do not repeat a failed first snapshot during teardown.\n if (!lastSnapshot) return yield* Console.warn(\"Warning: scratch backstop unavailable without a process snapshot; no unverified PID was signalled\");\n yield* bounded(\"scratch backstop\", inspectUnowned, 2000).pipe(Effect.catch(error => Console.warn(`Warning: ${error.message}; unowned PIDs were not signalled`)));\n const elapsed = Math.max(0, (yield* Clock.currentTimeMillis) - started);\n yield* Effect.sync(() => onBackstop?.(elapsed));\n });\n const semaphore = yield* Semaphore.make(1);\n type Outcome = \"clean\" | \"warning\";\n let closed: Outcome | undefined;\n const sweep = (preserved: ReadonlyArray<number>, retained: ReadonlyArray<Record> = []) => Effect.scoped(Effect.gen(function* () {\n deadline = performance.now() + 10_000;\n lastSnapshot = undefined;\n ledgerRows = [];\n verified.clear();\n const keep = new Set(preserved);\n effectiveKeep = keep;\n const discovering = createEffectLogic(() => bounded(\"discovery\", discover(keep, retained)).pipe(Effect.result));\n const stopping = createEffectLogic(({ input }: { input: ReadonlyArray<ProcessInfo> }) => bounded(\"stop\", signal(input, \"SIGSTOP\"), 3000).pipe(Effect.result));\n const killing = createEffectLogic(({ input }: { input: ReadonlyArray<ProcessInfo> }) => bounded(\"kill\", signal(input, \"SIGKILL\"), 3000).pipe(Effect.result));\n // tracking -> discovering -> stopping -> killing -> verifying -> closed.\n // A newly discovered descendant repeats stopping. Unverifiable ownership\n // warns rather than blocking the remaining mutation run.\n const machine = setupEffect({ schemas: { context: types<CleanupState>(), events: { CLOSE: Schema.Struct({}) } },\n actors: { discovering, stopping, killing } }).createMachine({\n context: { pending: [], round: 0, failure: undefined }, output: ({ context }) => context,\n initial: \"tracking\", states: {\n tracking: { on: { CLOSE: { target: \"discovering\" } } },\n discovering: { invoke: { src: \"discovering\", onDone: ({ context, event }) => Result.isFailure(event.output)\n ? { target: \"failed\", context: { ...context, failure: event.output.failure.message } }\n : { target: event.output.success.length ? \"stopping\" : \"closed\", context: { ...context, pending: event.output.success } } } },\n stopping: { invoke: { src: \"stopping\", input: ({ context }) => context.pending, onDone: ({ context, event }) => Result.isFailure(event.output)\n ? { target: \"failed\", context: { ...context, failure: event.output.failure.message } }\n : { target: \"killing\" } } },\n killing: { invoke: { src: \"killing\", input: ({ context }) => context.pending, onDone: ({ context, event }) => Result.isFailure(event.output)\n ? { target: \"failed\", context: { ...context, failure: event.output.failure.message } }\n : { target: \"verifying\" } } },\n verifying: { invoke: { src: \"discovering\", onDone: ({ context, event }) => {\n if (Result.isFailure(event.output)) return { target: \"failed\", context: { ...context, failure: event.output.failure.message } };\n const remaining = event.output.success;\n if (!remaining.length) return { target: \"closed\", context: { ...context, pending: [] } };\n return context.round < 3 ? { target: \"stopping\", context: { ...context, pending: remaining, round: context.round + 1 } }\n : { target: \"failed\", context: { ...context, pending: remaining, failure: `Cannot kill owned test PIDs: ${remaining.map(item => item.pid).join(\", \")}` } };\n } } },\n closed: { type: \"final\" }, failed: { type: \"final\" }\n }\n });\n const actor = yield* createEffectActor(machine);\n yield* send(actor, { type: \"CLOSE\" });\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off -- Inspection failures are machine outputs; join failures are unexpected actor defects.\n const joined = yield* bounded(\"state machine\", join(actor), 8000).pipe(Effect.result);\n const result = joined._tag === \"Success\" ? joined.success : { ...actor.getSnapshot().context, failure: joined.failure.message };\n if (result.failure) {\n yield* Effect.sync(() => {\n actor.stop();\n // A deadline cannot abandon children already birth-matched in this sweep.\n // No further inspection is required, and stale ledger-only PIDs never enter\n // this set. Signal individual PIDs, not groups that may contain keepers.\n for (const item of verified.values()) { try { kill(item.pid, \"SIGKILL\"); } catch { /* Warn below; exit could not be verified. */ } }\n });\n const unverified = [...new Set(ledgerRows.filter(item => !verified.has(item.pid) && !effectiveKeep.has(item.pid)).map(item => item.pid))];\n yield* Console.warn(`Warning: cleanup degraded; SIGKILL attempted for birth-verified PIDs ${[...verified.keys()].join(\", \") || \"none\"}; exit unconfirmed; unverified ledger PIDs ${unverified.join(\", \") || \"none\"} were not signalled`);\n }\n yield* warnUnowned;\n if (result.failure) yield* Console.warn(`Warning: ${result.failure} (tracked PIDs ${(result.pending.length ? result.pending.map(item => item.pid) : [...roots]).join(\", \")}); ownership ledger kept at ${ledger}; continuing without reusing the host`);\n return result.failure ? \"warning\" as const : \"clean\" as const;\n })).pipe(Effect.uninterruptible);\n const reap = (preserved: ReadonlyArray<number>, retained: ReadonlyArray<Record> = []) => semaphore.withPermit(Effect.suspend(() => closed === undefined ? sweep(preserved, retained) : Effect.succeed(closed)));\n const cleanup = semaphore.withPermit(Effect.gen(function* () {\n if (closed === undefined) closed = yield* sweep([]);\n }));\n yield* Effect.addFinalizer(() => Effect.gen(function* () {\n yield* cleanup;\n if (closed === \"clean\") yield* fs.remove(directory, { recursive: true }).pipe(Effect.interruptible, Effect.timeout(2000),\n Effect.catch(error => Console.warn(`Warning: cannot remove process ledger directory: ${error.message}`)));\n }).pipe(Effect.ensuring(Effect.sync(() => { liveLedgers.delete(ledger); }))));\n const existing = process.env.NODE_OPTIONS ?? \"\";\n return {\n env: { ...process.env, MUTANT_CAFE_PROCESS_PHASE: undefined, [tokenKey]: token, [ledgerKey]: ledger, [preloadKey]: url, NODE_OPTIONS: `${existing} --import=${url}`.trim() },\n addRoot: (pid: number) => { roots.add(pid); }, cleanup, reap, trace\n };\n});\nexport type OwnedProcessTree = Effect.Success<ReturnType<typeof acquireProcessTree>>;\n", "// Opt-in, local JSONL diagnostics. Never record argv, environments or tokens.\n// Shared verbatim by the ownership preload and generated Vitest reporter.\nexport const processTraceSource = String.raw`\nimport { appendFileSync as appendProcessTrace } from \"node:fs\";\nconst traceProcess = (stage, details = {}) => {\n const destination = process.env.MUTANT_CAFE_PROCESS_TRACE;\n if (destination) try {\n appendProcessTrace(destination, JSON.stringify({ at: Date.now(), pid: process.pid, ppid: process.ppid, stage, ...details }) + \"\\n\");\n } catch { /* Diagnostics cannot determine a verdict or prevent cleanup. */ }\n};\n`;\n", "import { cleanTelemetry, DEFAULT_BASELINE_TIMEOUT_MS, TestSpawnError, type ScratchDir, type TestRun } from \"@mutant-cafe/core\";\nimport { createEffectActor, send, setupEffect } from \"@xstate/effect\";\n// @effect-diagnostics-next-line nodeBuiltinImport:off -- Node IPC (process.send) is not exposed by Effect's spawner.\nimport { spawn, type ChildProcess } from \"node:child_process\";\nimport * as Clock from \"effect/Clock\";\nimport * as Effect from \"effect/Effect\";\nimport * as Console from \"effect/Console\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Schema from \"effect/Schema\";\nimport * as Scope from \"effect/Scope\";\nimport * as Exit from \"effect/Exit\";\nimport { acquireProcessTree, type OwnedProcessTree } from \"./ProcessTree.ts\";\nimport { reporterSource, vitestHostSource, type ProbeOptions } from \"./VitestHost.ts\";\n\nconst Message = Schema.Union([\n Schema.Struct({ type: Schema.Literal(\"ready\") }),\n Schema.Struct({ type: Schema.Literal(\"retained\"), pids: Schema.Array(Schema.Struct({ pid: Schema.Int, birth: Schema.String })) }),\n Schema.Struct({ type: Schema.Literal(\"invalidated\") }),\n Schema.Struct({ type: Schema.Literal(\"collected\") }),\n Schema.Struct({ type: Schema.Literal(\"failed\") }),\n Schema.Struct({ type: Schema.Literal(\"selected\"), files: Schema.Array(Schema.String) }),\n Schema.Struct({ type: Schema.Literal(\"selection\"), files: Schema.Array(Schema.String) }),\n Schema.Struct({ type: Schema.Literal(\"probeLoaded\") }),\n Schema.Struct({ type: Schema.Literal(\"quiescing\") }), Schema.Struct({ type: Schema.Literal(\"quiesced\") }), Schema.Struct({ type: Schema.Literal(\"healthy\") }),\n Schema.Struct({ type: Schema.Literal(\"fallback\"), message: Schema.String }),\n Schema.Struct({ type: Schema.Literal(\"crash\"), message: Schema.String }),\n Schema.Struct({ type: Schema.Literal(\"result\"), status: Schema.Literals([\"passed\", \"failed\", \"untested\"]),\n testFiles: Schema.Array(Schema.String), testsCollected: Schema.Boolean,\n testDurations: Schema.Record(Schema.String, Schema.Finite), testTimeouts: Schema.Record(Schema.String, Schema.Finite), testWorkers: Schema.optional(Schema.Int), testConcurrency: Schema.optional(Schema.Int), telemetryWarnings: Schema.optional(Schema.Array(Schema.String)), testFileDurations: Schema.Record(Schema.String, Schema.Finite), firstTestStart: Schema.Finite, probeSupported: Schema.Boolean, probeLoaded: Schema.Boolean, testTimeoutDetails: Schema.Record(Schema.String, Schema.Finite), crashed: Schema.Boolean })\n]);\ntype Message = typeof Message.Type;\n\nexport class ReporterMessageError extends Error { readonly kind = \"reporter\"; }\nexport function decodeWarmMessage(value: unknown): Message {\n try {\n const raw = Schema.decodeUnknownSync(Schema.Record(Schema.String, Schema.Unknown))(value);\n const cleaned = cleanTelemetry(raw, \"warm message\");\n if (raw.type === \"result\") {\n for (const [key, fallback] of Object.entries({ testDurations: {}, testTimeouts: {}, testFileDurations: {}, testTimeoutDetails: {}, firstTestStart: 0 }))\n if (cleaned.value[key] === undefined) Reflect.set(cleaned.value, key, fallback);\n const previous = cleaned.value.telemetryWarnings;\n Reflect.set(cleaned.value, \"telemetryWarnings\", [...(Array.isArray(previous) ? previous : []), ...cleaned.warnings]);\n }\n return Schema.decodeUnknownSync(Message)(cleaned.value);\n } catch (error) {\n // SchemaError.toString omits the actual value. This is a protocol frame,\n // not captured test stdout; keep a bounded diagnostic alongside the issue.\n const actual = (() => { try { return JSON.stringify(value)?.slice(0, 4096) ?? String(value); } catch { return \"[unserializable frame]\"; } })();\n throw new ReporterMessageError(`Internal warm reporter protocol error: ${String(error)}; received ${actual}`);\n }\n}\n\n// One pending request per scratch copy. IPC carries only parsed reporter data;\n// stdout is diagnostic text, never an outcome parser for the warm adapter.\nclass Host {\n readonly child: ChildProcess;\n readonly exited: Promise<void>;\n readonly tree: OwnedProcessTree;\n readonly scope: Scope.Closeable;\n output = \"\";\n collected = false;\n failed = false;\n testFiles: ReadonlyArray<string> = [];\n runPending: Promise<Message> | undefined;\n retained: ReadonlyArray<{ readonly pid: number; readonly birth: string }> = [];\n private pending: { resolve: (value: Message) => void; reject: (error: Error) => void } | undefined;\n private startup: Promise<Message>;\n private quiescing: (() => void) | undefined;\n private quiesced: (() => void) | undefined;\n constructor(root: string, script: string, reporter: string, tree: OwnedProcessTree, scope: Scope.Closeable, selectionOnly = false, decode = decodeWarmMessage) {\n this.tree = tree;\n this.scope = scope;\n this.child = spawn(process.execPath, [script, reporter, selectionOnly ? \"select\" : \"run\"], {\n cwd: root, env: tree.env, detached: true, stdio: [\"ignore\", \"pipe\", \"pipe\", \"ipc\"]\n });\n if (this.child.pid) tree.addRoot(this.child.pid);\n this.startup = this.wait();\n this.child.stdout?.on(\"data\", chunk => { this.output += String(chunk); });\n this.child.stderr?.on(\"data\", chunk => { this.output += String(chunk); });\n this.child.on(\"message\", value => {\n try {\n const message = decode(value);\n if (message.type === \"retained\") { this.retained = message.pids; return; }\n if (message.type === \"quiescing\") { this.quiescing?.(); return; }\n if (message.type === \"quiesced\") { this.quiesced?.(); return; }\n if (message.type === \"collected\") { this.collected = true; return; }\n if (message.type === \"failed\") { this.failed = true; return; }\n if (message.type === \"probeLoaded\") return;\n if (message.type === \"selected\") { this.testFiles = message.files; return; }\n const pending = this.pending;\n this.pending = undefined;\n pending?.resolve(message);\n } catch (error) { this.pending?.reject(error instanceof ReporterMessageError ? error : new ReporterMessageError(String(error))); }\n });\n // @effect-diagnostics-next-line newPromise:off -- Promise bridge for the native IPC adapter, scoped by openWarmRunner.\n this.exited = new Promise<void>(resolve => this.child.once(\"close\", () => {\n this.pending?.reject(new Error(`Vitest host exited: ${this.output.slice(-4000)}`));\n this.pending = undefined;\n resolve();\n }));\n this.child.on(\"error\", error => { this.pending?.reject(error); this.pending = undefined; });\n }\n private wait() {\n // @effect-diagnostics-next-line newPromise:off -- One IPC reply, consumed by Effect.tryPromise at the service boundary.\n return new Promise<Message>((resolve, reject) => { this.pending = { resolve, reject }; });\n }\n quiesce() {\n // Native IPC phase acknowledgements are separate from a still-pending run.\n // @effect-diagnostics-next-line newPromise:off -- IPC phase acknowledgement.\n const started = new Promise<void>(resolve => { this.quiescing = resolve; });\n // @effect-diagnostics-next-line newPromise:off -- IPC phase acknowledgement.\n const done = new Promise<void>(resolve => { this.quiesced = resolve; });\n this.post({ type: \"quiesce\" });\n return { started, done };\n }\n ready() { return this.startup; }\n request(message: object) {\n const response = this.wait();\n this.post(message);\n return response;\n }\n post(message: object) {\n if (this.child.connected) this.child.send(message, error => {\n if (error) this.pending?.reject(error);\n });\n else this.pending?.reject(new Error(\"Vitest host disconnected\"));\n }\n close() { return Scope.close(this.scope, Exit.succeed(undefined)); }\n grace() {\n const self = this;\n return Effect.gen(function* () {\n self.post({ type: \"close\" });\n const exited = Effect.promise(() => self.exited);\n // The scope's next finalizer kills and verifies the entire owned tree,\n // even when the host exited but an escaped grandchild retained its pipes.\n const result = yield* exited.pipe(Effect.interruptible, Effect.timeout(500), Effect.result);\n if (result._tag === \"Failure\") yield* Effect.sync(() => {\n // Native ChildProcess still owns this handle; unlike a bare saved PID,\n // kill() cannot target a PID that was reaped and reused.\n self.child.kill(\"SIGKILL\");\n });\n });\n }\n}\n\n// idle -> running -> cancelling -> (idle | restarting) -> idle\n// Two crashes for one mutant: restarting -> failed -> cold (terminal).\nconst lifecycle = setupEffect({ schemas: { events: {\n RUN: Schema.Struct({}), DONE: Schema.Struct({}), CANCEL: Schema.Struct({}),\n RESTART: Schema.Struct({}), READY: Schema.Struct({}), FAIL: Schema.Struct({}), FALLBACK: Schema.Struct({})\n} } }).createMachine({\n initial: \"idle\",\n on: { FAIL: { target: \".failed\" }, FALLBACK: { target: \".cold\" } },\n states: {\n idle: { on: { RUN: { target: \"running\" }, RESTART: { target: \"restarting\" } } },\n running: { on: { DONE: { target: \"idle\" }, CANCEL: { target: \"cancelling\" }, RESTART: { target: \"restarting\" } } },\n cancelling: { on: { DONE: { target: \"idle\" }, RESTART: { target: \"restarting\" } } },\n restarting: { on: { READY: { target: \"idle\" } } },\n failed: { on: { FALLBACK: { target: \"cold\" } } },\n cold: { type: \"final\" }\n }\n});\n\nexport const openWarmRunner = Effect.fn(\"TestRunner.openWarm\")(function* (dir: ScratchDir, onFallback: (reason: string) => void, options: { readonly selectionOnly?: boolean; readonly quiet?: boolean; readonly onRestart?: () => void; readonly onPoolReset?: () => void; readonly onBackstop?: (durationMs: number) => void; readonly processesSince?: number | undefined; readonly warn?: (message: string) => Effect.Effect<void>; readonly decodeMessage?: typeof decodeWarmMessage } = {}) {\n const fs = yield* FileSystem.FileSystem;\n const parentScope = yield* Scope.Scope;\n const temp = yield* fs.makeTempDirectoryScoped({ prefix: \"mutant-warm-\" });\n const script = `${temp}/host.mjs`;\n const reporter = `${temp}/reporter.mjs`;\n yield* fs.writeFileString(script, vitestHostSource);\n yield* fs.writeFileString(reporter, reporterSource(\"mutant-warm:\"));\n const actor = yield* createEffectActor(lifecycle);\n let host: Host | undefined;\n const attempt = <A>(fn: () => Promise<A>) => Effect.tryPromise({ try: fn,\n catch: error => new TestSpawnError({ command: [\"vitest\", \"warm\"], message: String(error), ...(error instanceof ReporterMessageError ? { kind: \"reporter\" as const } : {}) }) }).pipe(Effect.interruptible);\n const close = () => host === undefined ? Effect.void : host.close();\n const abortHost = (error: TestSpawnError) => Effect.gen(function* () {\n yield* send(actor, { type: \"FAIL\" });\n yield* close();\n return yield* error;\n });\n yield* Effect.addFinalizer(() => close().pipe(Effect.orDie));\n const start = Effect.gen(function* () {\n const scope = yield* Scope.make();\n yield* Effect.addFinalizer(() => Scope.close(scope, Exit.succeed(undefined))).pipe(Effect.provideService(Scope.Scope, parentScope));\n const tree = yield* acquireProcessTree(dir.path, options.onBackstop, options.processesSince).pipe(Effect.provideService(Scope.Scope, scope), Effect.provideService(FileSystem.FileSystem, fs),\n Effect.mapError(error => new TestSpawnError({ command: [\"vitest\", \"warm\"], message: String(error) })));\n const active = new Host(dir.path, script, reporter, tree, scope, options.selectionOnly === true, options.decodeMessage);\n host = active;\n yield* Effect.addFinalizer(() => active.grace()).pipe(Effect.provideService(Scope.Scope, scope));\n const initialized = yield* attempt(() => host!.ready()).pipe(Effect.timeout(30_000),\n Effect.mapError(error => error._tag === \"TestSpawnError\" ? error : new TestSpawnError({ command: [\"vitest\", \"warm\"], message: String(error) })), Effect.result);\n if (initialized._tag === \"Failure\") return yield* abortHost(initialized.failure);\n const ready = initialized.success;\n if (ready.type !== \"ready\") {\n if (!options.quiet) yield* (options.warn ?? Console.warn)(`Warning: warm Vitest unavailable; using cold mode: ${\"message\" in ready ? ready.message : ready.type}`);\n yield* Effect.sync(() => onFallback(\"message\" in ready ? ready.message : `Unexpected startup frame: ${ready.type}`));\n yield* send(actor, { type: \"FALLBACK\" });\n yield* close();\n }\n });\n const retire = Effect.gen(function* () {\n yield* send(actor, { type: \"RESTART\" });\n yield* close();\n });\n const restart = Effect.gen(function* () {\n yield* retire;\n yield* start;\n yield* Effect.sync(() => options.onRestart?.());\n if (actor.getSnapshot().value !== \"cold\") yield* send(actor, { type: \"READY\" });\n });\n yield* start;\n const isCold = () => actor.getSnapshot().value === \"cold\";\n const invalidate = Effect.fn(\"Warm.invalidate\")(function* (file: string) {\n if (isCold() || actor.getSnapshot().value === \"failed\") return;\n if (actor.getSnapshot().value === \"restarting\") {\n // The caller restored the source before invalidating. Do not initialize a\n // replacement's config while the timed-out mutation is still on disk.\n yield* start;\n yield* Effect.sync(() => options.onRestart?.());\n if (!isCold()) yield* send(actor, { type: \"READY\" });\n return;\n }\n const result = yield* attempt(() => host!.request({ type: \"invalidate\", file })).pipe(Effect.timeout(1_000), Effect.result);\n if (result._tag === \"Failure\" && result.failure._tag === \"TestSpawnError\" && result.failure.kind === \"reporter\") return yield* abortHost(result.failure);\n // A fresh host has no stale transforms. Never return a dirty graph to the pool.\n if (result._tag === \"Failure\") yield* restart;\n });\n const finish = Effect.fn(\"Warm.finish\")(function* (active: Host, pending: Promise<Message>) {\n const pool = active.quiesce();\n const started = yield* attempt(() => pool.started).pipe(Effect.timeout(500), Effect.result);\n const clean = yield* active.tree.reap(active.child.pid === undefined ? [] : [active.child.pid], active.retained);\n if (clean !== \"clean\" || started._tag === \"Failure\") return false;\n yield* attempt(() => pool.done).pipe(Effect.timeout(100), Effect.result);\n const settled = yield* attempt(() => pending).pipe(Effect.timeout(500), Effect.result);\n const health = settled._tag === \"Success\" ? yield* attempt(() => active.request({ type: \"ping\" })).pipe(Effect.timeout(500), Effect.result) : settled;\n return clean === \"clean\" && started._tag === \"Success\" && health._tag === \"Success\" && health.success.type === \"healthy\";\n });\n const run = Effect.fn(\"Warm.run\")(function* (file: string | undefined, timeoutMs?: number, testTimeout?: number, probe?: ProbeOptions): Effect.fn.Return<TestRun | undefined, TestSpawnError> {\n if (isCold()) return undefined;\n if (options.selectionOnly) return yield* abortHost(new TestSpawnError({ command: [\"vitest\", \"select\"], kind: \"reporter\", message: \"Selection-only host cannot execute tests\" }));\n const command = [\"vitest\", ...(file ? [\"related\", file, \"--run\"] : [\"run\"]), \"--reporter=default\"];\n for (let crash = 0; crash < 2; crash++) {\n const active = host!;\n active.output = \"\";\n active.collected = false;\n active.failed = false;\n active.testFiles = [];\n const started = yield* Clock.currentTimeMillis;\n active.runPending = undefined;\n const budgetMs = timeoutMs ?? DEFAULT_BASELINE_TIMEOUT_MS;\n const operation = Effect.gen(function* () {\n yield* active.tree.trace(\"warm-attempt-start\", { budgetMs });\n yield* send(actor, { type: \"RUN\" });\n const pending = active.request({ type: \"run\", file, testTimeout, probe });\n active.runPending = pending;\n return yield* attempt(() => pending);\n });\n const result = yield* operation.pipe(Effect.interruptible, Effect.timeout(budgetMs), Effect.result);\n const pending = active.runPending;\n if (result._tag === \"Success\" && result.success.type === \"result\" && !result.success.crashed) {\n if (pending && (yield* finish(active, pending))) yield* send(actor, { type: \"DONE\" });\n else yield* retire;\n return { ...result.success, startupMs: result.success.firstTestStart > 0 ? Math.max(0, Math.ceil(result.success.firstTestStart - started)) : 0,\n ...(active.child.pid === undefined ? {} : { hostPid: active.child.pid }), command, output: active.output, durationMs: (yield* Clock.currentTimeMillis) - started };\n }\n if (result._tag === \"Failure\" && result.failure._tag === \"TimeoutError\") {\n yield* Effect.sync(() => options.onPoolReset?.());\n yield* active.tree.trace(\"warm-deadline\", { budgetMs });\n const failedAtDeadline = active.failed;\n yield* send(actor, { type: \"CANCEL\" });\n // cancelCurrentRun waits for the test: enforce a separate recovery grace.\n active.post({ type: \"cancel\" });\n if (pending && (yield* finish(active, pending))) yield* send(actor, { type: \"DONE\" });\n else yield* retire;\n return { status: failedAtDeadline ? \"failed\" : \"timedOut\", command, output: active.output, durationMs: (yield* Clock.currentTimeMillis) - started,\n ...(active.child.pid === undefined ? {} : { hostPid: active.child.pid }), testsCollected: active.collected, testFiles: active.testFiles };\n }\n if (result._tag === \"Failure\" && result.failure._tag === \"TestSpawnError\" && result.failure.kind === \"reporter\") return yield* abortHost(result.failure);\n yield* Effect.sync(() => options.onPoolReset?.());\n if (crash === 0) {\n yield* Console.warn(`Warning: Vitest pool crashed; restarting once: ${result._tag === \"Failure\" ? String(result.failure) : \"message\" in result.success ? result.success.message : result.success.type}`);\n if (pending && (yield* finish(active, pending))) yield* send(actor, { type: \"DONE\" });\n else yield* restart;\n }\n else {\n yield* send(actor, { type: \"FAIL\" });\n yield* close();\n yield* Console.warn(\"Warning: Vitest pool crashed twice for one mutant; using cold mode for the rest of this run\");\n yield* Effect.sync(() => onFallback(\"Vitest pool crashed twice for one mutant\"));\n yield* send(actor, { type: \"FALLBACK\" });\n }\n if (isCold()) return undefined;\n }\n return undefined;\n }, effect => effect.pipe(Effect.onInterrupt(() => Effect.gen(function* () {\n yield* send(actor, { type: \"CANCEL\" });\n const active = host;\n yield* Effect.sync(() => options.onPoolReset?.());\n active?.post({ type: \"cancel\" });\n if (active?.runPending && (yield* finish(active, active.runPending).pipe(Effect.orDie))) yield* send(actor, { type: \"DONE\" });\n else {\n yield* retire.pipe(Effect.orDie);\n // A cancelled run must not start a fresh host from its restore finalizer.\n yield* Effect.sync(() => onFallback(\"Interrupted run retired its unhealthy host\"));\n yield* send(actor, { type: \"FALLBACK\" });\n }\n }))));\n const disable = Effect.gen(function* () {\n if (isCold()) return;\n yield* close();\n yield* send(actor, { type: \"FALLBACK\" });\n });\n const select = Effect.fn(\"Warm.select\")(function* (file: string) {\n if (isCold()) return undefined;\n const result = yield* attempt(() => host!.request({ type: \"select\", file })).pipe(Effect.timeout(30_000), Effect.result);\n if (result._tag === \"Success\" && result.success.type === \"selection\") return result.success.files;\n if (result._tag === \"Failure\" && result.failure._tag === \"TestSpawnError\" && result.failure.kind === \"reporter\") return yield* abortHost(result.failure);\n yield* restart;\n return undefined;\n });\n return { run, invalidate, disable, select };\n});\n", "// Shared verbatim with the target-process host and policy regression tests.\nexport const warmPolicySource = String.raw`\nfunction warmRefusal(version, ctx, selectionOnly = false) {\n if (!/^5\\./.test(version)) return \"unverified Vitest major: \" + version + \" (verified: 5)\";\n if (!ctx) return null;\n const writable = (object, key) => {\n while (object) {\n const field = Object.getOwnPropertyDescriptor(object, key);\n if (field) return field.writable === true;\n object = Object.getPrototypeOf(object);\n }\n return false;\n };\n for (const key of [\"pool\", \"cancelPromise\", \"runningPromise\", \"configOverride\", \"reporters\", \"initializeGlobalSetup\"])\n if (!(key in ctx) || !writable(ctx, key)) return \"unsupported private field: \" + key;\n if (!Object.isExtensible(ctx) || !Object.isExtensible(ctx.configOverride) || typeof ctx.watcher?.invalidates?.add !== \"function\" || typeof ctx.vite?.transformRequest !== \"function\")\n return \"unsupported transform/invalidation boundary\";\n if (!Object.isExtensible(ctx.config) || ctx.projects.some(project => !project.vite?.environments || Object.values(project.vite.environments).some(environment => typeof environment.moduleGraph?.getModulesByFile !== \"function\")))\n return \"unsupported private module graph\";\n if (selectionOnly) return null;\n for (const config of [ctx.config, ...ctx.projects.flatMap(project => [project.config, project.vite.config.test ?? {}])]) {\n if (config.globalSetup && (!Array.isArray(config.globalSetup) || config.globalSetup.length)) return \"globalSetup requires cold execution for per-mutant parity\";\n if (config.browser?.enabled || (config.pool !== undefined && ![\"forks\", \"threads\"].includes(config.pool))) return \"unsupported warm pool: \" + (config.browser?.enabled ? \"browser\" : (typeof config.pool === \"string\" ? config.pool : \"custom\"));\n }\n return null;\n}\n`;\n\nexport const workerDeathSource = String.raw`\nfunction workerDied(error, seen = new Set()) {\n if (!error || typeof error !== \"object\" || seen.has(error)) return false;\n seen.add(error);\n const description = String(error.name ?? \"\") + \" \" + String(error.message ?? \"\");\n const diagnostic = error.name !== \"AssertionError\";\n return (diagnostic && (description.includes(\"Worker exited unexpectedly\") || description.includes(\"[vitest-pool]:\")\n || (typeof error.code === \"string\" && error.code.startsWith(\"ERR_WORKER_\"))))\n || workerDied(error.cause, seen) || workerDied(error.error, seen) || workerDied(error.result, seen)\n || (Array.isArray(error.errors) && error.errors.some(item => workerDied(item, seen)))\n || (Array.isArray(error.tasks) && error.tasks.some(item => workerDied(item, seen)));\n}\n`;\n", "// Executed in the target project's Node process, not in the CLI's dependency graph.\n// API verified against Vitest 5.1.0. Unsupported API shapes use the cold adapter.\nimport { warmPolicySource, workerDeathSource } from \"./WarmPolicy.ts\";\nimport { processTraceSource } from \"./ProcessTrace.ts\";\n\nexport interface ProbeOptions { readonly token: string; readonly setupFile: string }\n\n// Resolve project files in the killable child, never in the deadline owner's\n// thread. Even a blocked package lookup/native loader remains behind its timer.\nexport const vitestLauncherSource = `\nimport { createRequire } from \"node:module\";\nimport { dirname, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n${processTraceSource}\ntraceProcess(\"vitest-resolve-start\");\nconst require = createRequire(pathToFileURL(process.cwd() + \"/package.json\"));\nconst pkgFile = require.resolve(\"vitest/package.json\");\nconst pkg = require(pkgFile);\nconst bin = typeof pkg.bin === \"string\" ? pkg.bin : pkg.bin?.vitest;\nif (typeof bin !== \"string\") throw new Error(\"Installed Vitest has no CLI bin\");\nconst cli = resolve(dirname(pkgFile), bin);\nprocess.argv = [process.execPath, cli, ...process.argv.slice(2)];\ntraceProcess(\"vitest-resolved\");\nawait import(pathToFileURL(cli).href);\n`;\n\nexport const reporterSource = (marker: string, probe?: ProbeOptions) => `\nimport { relative, dirname } from \"node:path\";\n${processTraceSource}\n${workerDeathSource}\nexport default class {\n files = []; collected = false; failed = false; durations = {}; timeouts = {}; workers = 0; concurrency = 0; fileDurations = {}; firstTestStart = 0; verdict = null; crashed = false;\n constructor(token = ${JSON.stringify(probe?.token ?? null)}, setupFile = ${JSON.stringify(probe?.setupFile ?? null)}) { this.token = token; this.setupFile = setupFile; this.loaded = false; this.originals = []; this.timeoutDetails = {}; this.activeModules = new Set(); this.hooks = new Map(); this.allowances = []; this.telemetryWarnings = []; }\n onInit(ctx) {\n traceProcess(\"vitest-start\");\n this.ctx = ctx;\n if (!this.setupFile) return;\n for (const vite of new Set(ctx.projects.map(project => project.vite.config))) {\n const fs = vite.server?.fs;\n if (fs) { this.allowances.push([fs, fs.allow]); fs.allow = [...fs.allow, dirname(this.setupFile)]; }\n }\n for (const config of new Set(ctx.projects.map(project => project.config))) {\n this.originals.push([config, config.setupFiles]);\n config.setupFiles = [this.setupFile, ...config.setupFiles];\n }\n }\n restore() {\n for (const [config, setupFiles] of this.originals) config.setupFiles = setupFiles;\n for (const [fs, allow] of this.allowances) fs.allow = allow;\n this.originals = []; this.allowances = [];\n }\n onHookStart(hook) { this.hooks.set(hook.entity.id + hook.name, performance.now()); }\n onHookEnd(hook) {\n const module = hook.entity.module ?? hook.entity;\n const started = this.hooks.get(hook.entity.id + hook.name);\n if (module.moduleId && started !== undefined) {\n const file = relative(process.cwd(), module.moduleId);\n this.durations[file] = Math.max(this.durations[file] ?? 0, performance.now() - started);\n console.log(${JSON.stringify(marker + \"duration:\")} + JSON.stringify({ file, duration: this.durations[file], timeout: 0, key: file + \"::hook::\" + hook.entity.id + hook.name, start: this.firstTestStart }));\n }\n }\n onUserConsoleLog(log) {\n if (this.token && log.content.includes(this.token)) { this.loaded = true; process.send?.({ type: \"probeLoaded\" }); console.log(${JSON.stringify(marker + \"probeLoaded\")}); }\n }\n onTestRunStart(specifications) {\n traceProcess(\"test-run-start\", { files: specifications.length });\n this.probeSupported = specifications.every(spec => [\"forks\", \"threads\", \"vmForks\", \"vmThreads\"].includes(spec.pool) && spec.project.config.environment === \"node\");\n console.log(${JSON.stringify(marker + \"probeSupported:\")} + JSON.stringify(this.probeSupported));\n const workers = this.ctx.config.maxWorkers;\n this.workers = Number.isSafeInteger(workers) && workers > 0 ? workers : undefined;\n if (this.workers !== undefined) console.log(${JSON.stringify(marker + \"workers:\")} + this.workers);\n else {\n const warning = \"Internal reporter telemetry error: testWorkers=\" + String(workers) + \"; resolved worker budget unavailable, omitted\";\n this.telemetryWarnings.push(warning);\n console.log(${JSON.stringify(marker + \"telemetryWarning:\")} + JSON.stringify(warning));\n }\n this.files = specifications.map(spec => relative(process.cwd(), spec.moduleId));\n process.send?.({ type: \"selected\", files: this.files });\n console.log(${JSON.stringify(marker + \"selected:\")} + JSON.stringify(this.files));\n }\n onTestModuleStart(module) {\n traceProcess(\"test-module-start\");\n this.activeModules.add(module.moduleId);\n this.concurrency = Math.max(this.concurrency, this.activeModules.size);\n console.log(${JSON.stringify(marker + \"concurrency:\")} + this.concurrency);\n }\n onTestModuleCollected() {\n this.collected = true;\n process.send?.({ type: \"collected\" });\n console.log(${JSON.stringify(marker + \"collected\")});\n }\n onTestModuleEnd(module) {\n const file = relative(process.cwd(), module.moduleId);\n this.crashed ||= (module.errors?.() ?? []).some(error => workerDied(error));\n const timing = module.diagnostic();\n this.fileDurations[file] = timing.duration + timing.collectDuration + timing.prepareDuration + timing.setupDuration + timing.environmentSetupDuration;\n console.log(${JSON.stringify(marker + \"fileDuration:\")} + JSON.stringify({ file, duration: this.fileDurations[file] }));\n this.activeModules.delete(module.moduleId);\n }\n onTestCaseResult(test) {\n const result = test.result();\n this.crashed ||= (result.errors ?? []).some(error => workerDied(error));\n const state = result.state;\n if (state === \"failed\") { this.failed = true; process.send?.({ type: \"failed\" }); console.log(${JSON.stringify(marker + \"failed\")}); }\n if (state === \"passed\") {\n const start = test.diagnostic()?.startTime ?? 0;\n if (start > 0) this.firstTestStart = this.firstTestStart ? Math.min(this.firstTestStart, start) : start;\n const file = relative(process.cwd(), test.module.moduleId);\n this.durations[file] = Math.max(this.durations[file] ?? 0, test.diagnostic()?.duration ?? 0);\n this.timeouts[file] = Math.max(this.timeouts[file] ?? 0, test.options.timeout ?? 0);\n this.timeoutDetails[file + \"::\" + test.id] = test.options.timeout ?? 0;\n console.log(${JSON.stringify(marker + \"duration:\")} + JSON.stringify({ file, duration: this.durations[file], timeout: this.timeouts[file], key: file + \"::\" + test.id, start: this.firstTestStart }));\n }\n }\n onTestRunEnd(modules, errors = [], state) {\n this.verdict = state ?? null;\n this.crashed ||= errors.some(error => workerDied(error)) || modules.some(module => workerDied(module.task) || (module.errors?.() ?? []).some(error => workerDied(error)));\n // Vitest's official run verdict also covers cancelled or pending modules.\n // Parallel bail can omit case-result hooks and module-end results.\n if ((state != null && state !== \"passed\") || (!this.ctx?.config.dangerouslyIgnoreUnhandledErrors && errors.length)) { this.failed = true; process.send?.({ type: \"failed\" }); console.log(${JSON.stringify(marker + \"failed\")}); }\n if (!this.files.length) console.log(${JSON.stringify(marker + \"empty\")});\n this.restore();\n }\n}`;\n\nexport const vitestHostSource = String.raw`\nimport { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { resolve } from \"node:path\";\nimport { readFileSync } from \"node:fs\";\nconst require = createRequire(resolve(\"package.json\"));\nconst { default: Reporter } = await import(pathToFileURL(process.argv[2]).href);\n${warmPolicySource}\n${workerDeathSource}\nlet ctx;\nlet reporter;\nconst retained = () => {\n try { return readFileSync(process.env.MUTANT_CAFE_PROCESS_LEDGER, \"utf8\").split(\"\\n\").filter(Boolean).flatMap(line => { try { const item = JSON.parse(line); return item.phase === \"setup\" ? [{ pid: item.pid, birth: item.birth }] : []; } catch { return []; } }); }\n catch { return []; }\n};\nconst setup = async fn => {\n const previous = process.env.MUTANT_CAFE_PROCESS_PHASE;\n process.env.MUTANT_CAFE_PROCESS_PHASE = \"setup\";\n try { return await fn(); } finally { if (previous === undefined) delete process.env.MUTANT_CAFE_PROCESS_PHASE; else process.env.MUTANT_CAFE_PROCESS_PHASE = previous; }\n};\ntry {\n const version = JSON.parse(readFileSync(require.resolve(\"vitest/package.json\"), \"utf8\")).version;\n const versionRefusal = warmRefusal(version, null);\n if (versionRefusal) throw new Error(versionRefusal);\n const { createVitest } = await import(pathToFileURL(require.resolve(\"vitest/node\")).href);\n if (typeof createVitest !== \"function\") throw new Error(\"createVitest is unavailable\");\n ctx = await setup(() => createVitest({ root: process.cwd(), run: true, watch: false, cache: false, fsModuleCache: false,\n bail: 1, passWithNoTests: true, reporters: [\"default\", new Reporter()] }, { plugins: [{ name: \"mutant-cafe-health\", resolveId(id) { if (id === \"virtual:mutant-cafe-health\") return \"\\0mutant-cafe-health\"; }, load(id) { if (id === \"\\0mutant-cafe-health\") return \"export default 1\"; } }] }));\n if (typeof ctx.runTestSpecifications !== \"function\" || typeof ctx.invalidateFile !== \"function\"\n || typeof ctx.cancelCurrentRun !== \"function\" || typeof ctx.getRelevantTestSpecifications !== \"function\" || typeof ctx.initializeGlobalSetup !== \"function\") {\n throw new Error(\"installed Vitest does not expose the supported warm API\");\n }\n const refusal = warmRefusal(version, ctx, process.argv[3] === \"select\");\n if (refusal) throw new Error(refusal);\n const isolated = config => config.isolate !== false &&\n !Object.values(config.poolOptions ?? {}).some(pool => pool?.isolate === false);\n const script = JSON.parse(readFileSync(resolve(\"package.json\"), \"utf8\")).scripts?.test ?? \"\";\n if (process.argv[3] !== \"select\" && (/(?:^|\\s)--no-isolate(?:\\s|$)|--isolate(?:=|\\s+)false/.test(script) || !isolated(ctx.config) || !isolated(ctx.vite.config.test ?? {}) ||\n ctx.projects.some(project => !isolated(project.config) || !isolated(project.vite.config.test ?? {})))) {\n throw new Error(\"isolate: false (including poolOptions or --no-isolate) cannot reset module state\");\n }\n const initialize = ctx.initializeGlobalSetup.bind(ctx);\n ctx.initializeGlobalSetup = (...args) => setup(async () => {\n const result = await initialize(...args);\n process.send({ type: \"retained\", pids: retained() });\n return result;\n });\n await setup(() => ctx.standalone());\n process.send({ type: \"retained\", pids: retained() });\n process.send({ type: \"ready\" });\n} catch (error) {\n process.send({ type: \"fallback\", message: String(error) });\n await ctx?.close();\n process.exit(0);\n}\n// invalidateFile clears Vitest's transform cache. Walk importers explicitly as\n// well, and queue every path for the pool's module runner invalidation boundary.\nfunction invalidate(file) {\n const paths = new Set([resolve(file)]);\n for (const project of ctx.projects) {\n for (const environment of Object.values(project.vite.environments)) {\n const seen = new Set();\n const visit = module => {\n if (seen.has(module)) return;\n seen.add(module);\n if (module.file) paths.add(module.file);\n for (const importer of module.importers) visit(importer);\n };\n for (const module of environment.moduleGraph.getModulesByFile(resolve(file)) ?? []) visit(module);\n }\n }\n for (const path of paths) { ctx.invalidateFile(path); ctx.watcher.invalidates.add(path); }\n}\nconst defaultReporters = ctx.reporters.filter(reporter => !(reporter instanceof Reporter));\nprocess.on(\"message\", async request => {\n try {\n if (request.type === \"close\") { await ctx.close(); process.exit(0); }\n if (request.type === \"cancel\") { await ctx.cancelCurrentRun(\"keyboard-input\"); return; }\n if (request.type === \"invalidate\") { invalidate(request.file); process.send({ type: \"invalidated\" }); return; }\n if (request.type === \"ping\") {\n if (!ctx.runningPromise) ctx.cancelPromise = undefined;\n const module = ctx.vite.moduleGraph?.getModuleById(\"\\0mutant-cafe-health\");\n if (module) ctx.vite.moduleGraph.invalidateModule(module);\n const transformed = await ctx.vite.transformRequest(\"virtual:mutant-cafe-health\");\n if (!transformed?.code) throw new Error(\"health transform failed\");\n process.send({ type: \"healthy\" });\n return;\n }\n if (request.type === \"quiesce\") {\n const pool = ctx.pool;\n ctx.pool = undefined;\n let closing;\n try { closing = pool?.close?.(); } catch { /* Disposable pool is already dead. */ }\n process.send({ type: \"quiescing\" });\n try { await closing; } catch { /* Parent verifies and reaps its children. */ }\n process.send({ type: \"quiesced\" });\n return;\n }\n if (request.type === \"select\") {\n ctx.config.related = [resolve(request.file)];\n const specs = await ctx.getRelevantTestSpecifications();\n process.send({ type: \"selection\", files: specs.map(spec => spec.moduleId) });\n return;\n }\n if (request.type !== \"run\") return;\n if (process.argv[3] === \"select\") {\n process.send({ type: \"protocolError\", message: \"Selection-only host cannot execute tests\" });\n return;\n }\n reporter = new Reporter(request.probe?.token ?? null, request.probe?.setupFile ?? null);\n reporter.onInit(ctx);\n ctx.reporters = [...defaultReporters, reporter];\n ctx.config.related = request.file ? [resolve(request.file)] : undefined;\n if (request.testTimeout === undefined) { delete ctx.configOverride.testTimeout; delete ctx.configOverride.hookTimeout; }\n else { ctx.configOverride.testTimeout = request.testTimeout; ctx.configOverride.hookTimeout = request.testTimeout; }\n const specs = await ctx.getRelevantTestSpecifications();\n // The shared adapter handles the full-suite fallback and remaining budget.\n const empty = specs.length === 0;\n let result;\n try { result = await ctx.runTestSpecifications(specs, !request.file); }\n catch (error) {\n // A thrown run error (for example a mutant breaking global setup) is a\n // failure, not evidence that the host or a worker died.\n console.error(error?.stack ?? String(error));\n reporter.failed = true;\n reporter.verdict = \"failed\";\n result = { unhandledErrors: [error] };\n }\n if (![\"passed\", \"failed\", \"interrupted\"].includes(reporter.verdict)) throw new Error(\"installed Vitest does not expose the supported current-run verdict\");\n // Use the official current-run verdict, not retained module state. In a\n // parallel bail, child failures can exist while the module stays pending.\n process.send({ type: \"retained\", pids: retained() });\n const failed = reporter.failed || (!ctx.config.dangerouslyIgnoreUnhandledErrors && result.unhandledErrors.length > 0);\n process.send({ type: \"result\", status: failed ? \"failed\" : empty ? \"untested\" : \"passed\",\n testFiles: reporter.files, testsCollected: reporter.collected, testDurations: reporter.durations, testTimeouts: reporter.timeouts, testWorkers: reporter.workers, testConcurrency: reporter.concurrency, testFileDurations: reporter.fileDurations, firstTestStart: reporter.firstTestStart, probeSupported: reporter.probeSupported, probeLoaded: reporter.loaded, testTimeoutDetails: reporter.timeoutDetails,\n telemetryWarnings: reporter.telemetryWarnings, crashed: reporter.crashed || result.unhandledErrors.some(error => workerDied(error)) });\n process.exitCode = 0;\n } catch (error) { reporter?.restore(); process.send({ type: \"crash\", message: String(error) }); }\n});\n`;\n", "export interface Calibration {\n readonly coldMs: number;\n readonly warmMs: number;\n readonly warmStartupMs: number;\n readonly testFiles: number;\n readonly mutants: number;\n readonly overheadMs?: number | undefined;\n readonly coldStartupMs?: number | undefined;\n readonly warmRunStartupMs?: number | undefined;\n}\n\nexport function startupCost(observed: ReadonlyArray<number>, copies: number): number {\n return Math.max(0, copies - observed.length) * Math.max(0, ...observed);\n}\n\n/** Only future costs matter: samples and opened-copy startup are already paid. */\nexport function chooseMode(sample: Calibration): \"warm\" | \"cold\" {\n const fixedSaving = (sample.coldStartupMs ?? 0) - (sample.warmRunStartupMs ?? 0);\n const savingPerFile = (sample.coldMs - sample.warmMs - fixedSaving) / Math.max(1, sample.testFiles);\n const savingPerMutant = fixedSaving + savingPerFile;\n return sample.warmMs * 10 <= sample.coldMs * 9 &&\n savingPerMutant * sample.mutants > sample.warmStartupMs ? \"warm\" : \"cold\";\n}\n", "import {\n excludeLinkedCandidates, sanitizeReportTelemetry, MutantSource, MutantResult, NotMutated, ReachabilityProbe, Reporter, Scratch, TestRunner,\n Baseline, BaselineFailed, BaselineTimedOut, formatTestCommand, type Mutant,\n type ProgramLoadError, type ReportWriteError, type RunConfig, type RunReport,\n type ScratchDir, ScratchError, type TestSpawnError\n} from \"@mutant-cafe/core\";\nimport { createEffectActor, createEffectLogic, join, send, setupEffect } from \"@xstate/effect\";\nimport { types } from \"xstate\";\nimport * as Effect from \"effect/Effect\";\nimport * as Console from \"effect/Console\";\nimport * as Pool from \"effect/Pool\";\nimport * as Path from \"effect/Path\";\nimport * as Result from \"effect/Result\";\nimport * as Schema from \"effect/Schema\";\nimport * as Scope from \"effect/Scope\";\nimport * as Stream from \"effect/Stream\";\nimport { unreliableFor } from \"./Preflight.ts\";\n\ntype RunError = BaselineFailed | BaselineTimedOut | ScratchError | TestSpawnError | ProgramLoadError | ReportWriteError;\n// XState freezes plain context objects in development. A pool is a live\n// resource, not immutable run data; keep its internals behind a class handle.\nclass ScratchPool {\n readonly value: Pool.Pool<ScratchDir, ScratchError>;\n constructor(value: Pool.Pool<ScratchDir, ScratchError>) { this.value = value; }\n}\ninterface RunState {\n readonly baseline: Baseline;\n readonly timeoutMs: number;\n readonly failure: RunError | undefined;\n readonly pool: ScratchPool | undefined;\n readonly pending: ReadonlyArray<Mutant>;\n readonly results: ReadonlyArray<MutantResult>;\n readonly reported: boolean;\n readonly notMutated: ReadonlyArray<NotMutated>;\n readonly probes: ReadonlyArray<ReachabilityProbe>;\n readonly hostRestarts: number;\n readonly poolResets: number;\n}\n\n/** A separate actor owns each run. Its resources outlive invoked phase tasks. */\nexport const runMutants = Effect.fn(\"Runner.runMutants\")(function* (\n config: RunConfig, mutants?: Stream.Stream<Mutant, ProgramLoadError>\n) {\n const scratch = yield* Scratch;\n const tests = yield* TestRunner;\n const source = yield* MutantSource;\n const reporter = yield* Reporter;\n const scope = yield* Scope.Scope;\n const path = yield* Path.Path;\n const jobs = Math.max(1, Math.floor(config.jobs));\n const report = (state: RunState): RunReport => sanitizeReportTelemetry({\n schemaVersion: 2, tool: \"mutant.cafe\", root: config.root,\n baseline: state.baseline, timeoutMs: state.timeoutMs, results: state.results, notMutated: state.notMutated, reachabilityProbes: state.probes, hostRestarts: state.hostRestarts, poolResets: state.poolResets,\n ...(state.failure === undefined ? {} : { failure: state.failure._tag === \"BaselineTimedOut\" ? `BaselineTimedOut: ${state.failure.message}` : state.failure._tag === \"BaselineFailed\" ? `${state.failure._tag}: ${formatTestCommand(state.failure.command)}\\n${state.failure.output.slice(-8000)}` : String(state.failure) })\n }).report;\n const capture = <A, R>(effect: Effect.Effect<A, RunError, R>) => Effect.result(effect);\n const copying = createEffectLogic(({ input }: { input: number }) => capture(Effect.gen(function* () {\n const acquire = Effect.gen(function* () {\n const dir = yield* scratch.acquire(config.root);\n if (tests.open) yield* tests.open(dir, config.cold ?? false, config.warm ?? false, input);\n return dir;\n }).pipe(Effect.mapError(error => error._tag === \"ScratchError\" ? error : new ScratchError({ operation: \"warm runner\", path: config.root, message: String(error) })));\n const pool = yield* Pool.make({ acquire, size: jobs }).pipe(\n Effect.provideService(Scope.Scope, scope));\n // Force the first acquisition in the copying phase. The pool owns the\n // tree; this short lease does not reserve a worker during later tests.\n yield* Effect.scoped(Pool.get(pool));\n return new ScratchPool(pool);\n })));\n const baselining = createEffectLogic(({ input }: { input: ScratchPool | undefined }) => capture(Effect.gen(function* () {\n if (input === undefined) return yield* Effect.die(\"Missing scratch pool\");\n const baseline = yield* Effect.scoped(Effect.gen(function* () {\n const dir = yield* Pool.get(input.value);\n return yield* tests.baseline(dir, path.isAbsolute(config.tsconfig) ? path.relative(config.root, config.tsconfig) : config.tsconfig, config.baselineTimeoutMs);\n }));\n return { baseline, timeoutMs: config.timeoutMs ?? Math.max(config.minimumTimeoutMs, Math.ceil(config.timeoutMultiplier * baseline.durationMs)) };\n })));\n const generating = createEffectLogic(() => capture(Stream.runCollect(mutants ?? source.generate(config))));\n const testing = createEffectLogic(({ input }: { input: {\n readonly state: RunState;\n readonly record: (result: MutantResult) => Effect.Effect<void>;\n readonly skip: (entry: NotMutated) => Effect.Effect<void>;\n readonly probe: (entry: ReachabilityProbe) => Effect.Effect<void>;\n readonly updateBaseline: (entry: Baseline) => Effect.Effect<void>;\n } }) => capture(Effect.gen(function* () {\n const dirs = input.state.pool?.value;\n if (dirs === undefined) return yield* Effect.die(\"Missing scratch pool\");\n // Exclude original-path links before viability, calibration or poisoning.\n // Reuse the existing SKIP event: linked files are not failed mutations.\n const linkedRoots = yield* Effect.scoped(Pool.get(dirs).pipe(Effect.map(dir => dir.linkedRoots ?? [])));\n const eligible = yield* excludeLinkedCandidates(config.root, input.state.pending, linkedRoots);\n for (const entry of eligible.notMutated) yield* input.skip(entry);\n const pending = eligible.mutants;\n let baseline = input.state.baseline;\n const viabilityById = new Map<string, Effect.Success<ReturnType<typeof source.checkViable>>>();\n // Auto needs a count before sampling; forced modes check inside the jobs\n // stream so oracle work overlaps native test processes. Auto preflight is\n // concurrent too, and reports rejected candidates as soon as they finish.\n const preReported = new Set<string>();\n if (!config.cold && !config.warm && tests.calibrate) yield* Effect.forEach(pending, mutant => Effect.gen(function* () {\n const viability = yield* source.checkViable(mutant);\n viabilityById.set(mutant.id, viability);\n if (viability.analysisFailed) { preReported.add(mutant.id); yield* input.skip(viability.analysisFailed); }\n else if (!viability.viable) {\n preReported.add(mutant.id);\n const result: MutantResult = { mutant, outcome: \"unviable\", durationMs: 0, testCommand: [], diagnostics: viability.diagnostics };\n yield* input.record(result);\n yield* reporter.progress(result);\n }\n }), { concurrency: jobs, discard: true });\n const unreachable = new Map<string, ReachabilityProbe>();\n const selectRelated = tests.selectRelated;\n const probeReachability = tests.probeReachability;\n if (input.state.baseline.probeSupported && selectRelated && probeReachability) {\n const seen = new Set<string>();\n const builtTests = input.state.baseline.unreliable?.flatMap(issue => issue.kind === \"built\" ? issue.testFiles : []) ?? [];\n for (const mutant of pending) {\n if (viabilityById.has(mutant.id) && !viabilityById.get(mutant.id)?.viable) continue;\n const file = path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file;\n if (seen.has(file)) continue;\n seen.add(file);\n if (unreliableFor(input.state.baseline, file, builtTests).length) continue;\n const probe = yield* Effect.scoped(Effect.gen(function* () {\n const dir = yield* Pool.get(dirs);\n if (!dir.poison) return undefined;\n const files = yield* selectRelated(dir, file);\n if (files === undefined || files.length) return undefined;\n return yield* probeReachability(dir, { ...mutant, file }, input.state.timeoutMs);\n }));\n if (probe) {\n yield* input.probe(probe);\n if (probe.status === \"unreachable\") unreachable.set(file, probe);\n }\n }\n }\n const calibrate = tests.calibrate;\n if (calibrate) {\n const testable = pending.filter(mutant => {\n const file = path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file;\n return viabilityById.get(mutant.id)?.viable && !unreachable.has(file) && !unreliableFor(baseline, file).length;\n }).length;\n const selected = yield* Effect.scoped(Effect.gen(function* () {\n const dir = yield* Pool.get(dirs);\n return yield* calibrate(dir, testable, config.jobs);\n }));\n baseline = { ...baseline, ...selected };\n yield* input.updateBaseline(baseline);\n }\n if (!config.cold && !config.warm) yield* Console.warn(`Vitest auto mode: ${baseline.runnerMode ?? \"cold\"}; ${baseline.runnerModeReason ?? \"Cold execution; no warm session\"}`);\n // Measure the original related selection once per file before applying any\n // mutant. Slow unrelated tests must not manufacture a caught never mutant.\n const neverBudgets = new Map<string, number>();\n const neverLimits = new Map<string, number>();\n const neverBases = new Map<string, number>();\n const neverAllowances = new Map<string, number>();\n for (const mutant of pending) {\n if (viabilityById.has(mutant.id) && !viabilityById.get(mutant.id)?.viable) continue;\n if (unreachable.has(path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file)) continue;\n if (mutant.genre !== \"EffectNever\" || neverBudgets.has(mutant.file) || unreliableFor(input.state.baseline, path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file).length > 0) continue;\n let probeTimeout = Math.max(1, Math.floor(input.state.timeoutMs / 2));\n const originalTimeouts = new Set(Object.values(baseline.testTimeoutDetails ?? {}));\n while (originalTimeouts.has(probeTimeout)) probeTimeout++;\n const measured = yield* Effect.scoped(Effect.gen(function* () {\n const dir = yield* Pool.get(dirs);\n return yield* tests.runRelated(dir, path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file, input.state.timeoutMs, probeTimeout);\n }));\n if (measured.status === \"timedOut\") return yield* new BaselineTimedOut({ timeoutMs: input.state.timeoutMs, command: measured.command,\n message: `Clean related probe exceeded ${input.state.timeoutMs / 1000} seconds. Increase --timeout for a longer probe.` });\n if (measured.status === \"failed\") {\n return yield* new BaselineFailed({ exitCode: 1, output: measured.output, command: measured.command });\n }\n const files = measured.testFiles ?? Object.keys(measured.testDurations ?? baseline.testDurations ?? {});\n // The clean baseline owns timings. The related probe selects files only;\n // its imposed test timeout must not become an alleged explicit override.\n const slowest = Math.max(0, ...files.map(file => baseline.testDurations?.[file] ?? measured.testDurations?.[file] ?? 0));\n const relatedDuration = baseline.testFileDurations === undefined ? baseline.durationMs :\n files.reduce((sum, file) => sum + (baseline.testFileDurations?.[file] ?? 0), 0);\n neverAllowances.set(mutant.file, Math.ceil(relatedDuration) + (baseline.startupMs ?? 0));\n neverBases.set(mutant.file, slowest);\n neverBudgets.set(mutant.file, Math.max(2_000, config.neverTimeoutMs, Math.ceil(slowest * config.timeoutMultiplier)));\n // A default changes under the clean probe's imposed timeout. An explicit\n // option remains identical, including an option equal to the config default.\n const explicit = Object.entries(baseline.testTimeoutDetails ?? {}).filter(([key, value]) => value > 0 && measured.testTimeoutDetails?.[key] === value).map(([, value]) => value);\n neverLimits.set(mutant.file, Math.max(0, ...explicit));\n }\n yield* Stream.fromIterable(pending).pipe(\n Stream.mapEffect((mutant) => Effect.scoped(Effect.gen(function* () {\n if (preReported.has(mutant.id)) return;\n const viability = viabilityById.get(mutant.id) ?? (yield* source.checkViable(mutant));\n if (viability.analysisFailed) { yield* input.skip(viability.analysisFailed); return; }\n if (!viability.viable) {\n const result: MutantResult = { mutant, outcome: \"unviable\", durationMs: 0, testCommand: [], diagnostics: viability.diagnostics };\n yield* input.record(result);\n yield* reporter.progress(result);\n return;\n }\n const localFile = path.isAbsolute(mutant.file) ? path.relative(config.root, mutant.file) : mutant.file;\n const unreliable = unreliableFor(input.state.baseline, localFile);\n if (unreliable.length) {\n const result: MutantResult = { mutant, outcome: \"unreliable\", durationMs: 0, testCommand: input.state.baseline.testCommand, diagnostics: unreliable.map(issue => issue.reason) };\n yield* input.record(result);\n yield* reporter.progress(result);\n return;\n }\n const cached = unreachable.get(localFile);\n if (cached) {\n const result: MutantResult = { mutant, outcome: \"untested\", durationMs: 0, testCommand: [],\n diagnostics: [\"The full-suite module-load probe passed without loading this file\"] };\n yield* input.record(result);\n yield* reporter.progress(result);\n return;\n }\n const dir = yield* Pool.get(dirs);\n const testTimeoutMs = mutant.genre === \"EffectNever\" ? neverBudgets.get(mutant.file)! : undefined;\n const timeoutMs = testTimeoutMs === undefined ? input.state.timeoutMs : Math.max(testTimeoutMs, neverLimits.get(mutant.file) ?? 0) + (neverAllowances.get(mutant.file) ?? 0);\n const run = yield* Effect.acquireUseRelease(\n dir.apply(mutant),\n () => Effect.gen(function* () {\n if (tests.invalidate) yield* tests.invalidate(dir, localFile);\n return yield* tests.runRelated(dir, localFile, timeoutMs, testTimeoutMs);\n }),\n // Restore and re-invalidate even on interruption before leasing again.\n () => Effect.gen(function* () {\n yield* dir.revert(mutant);\n if (tests.invalidate) yield* tests.invalidate(dir, localFile);\n }).pipe(Effect.orDie)\n );\n const selectedIssues = unreliableFor(input.state.baseline, localFile, run.testFiles);\n const result: MutantResult = {\n mutant,\n // A kill before collection proves nothing about whether tests noticed.\n outcome: selectedIssues.length ? \"unreliable\" : run.status === \"timedOut\" ? (mutant.genre === \"EffectNever\" && run.testsCollected ? \"caught\" : \"timeout\")\n : run.status === \"failed\" ? \"caught\" : run.status === \"untested\" ? \"untested\" : \"missed\",\n durationMs: run.durationMs,\n timeoutMs: testTimeoutMs ?? timeoutMs,\n outerTimeoutMs: timeoutMs,\n ...(testTimeoutMs === undefined ? {} : { hangBudgetBaseMs: neverBases.get(mutant.file) }),\n backstopMs: run.backstopMs,\n telemetryWarnings: run.telemetryWarnings,\n testWorkers: run.testWorkers,\n testConcurrency: run.testConcurrency,\n testCommand: run.command,\n diagnostics: selectedIssues.map(issue => issue.reason),\n ...(run.output === \"\" ? {} : { output: run.output })\n };\n yield* input.record(result);\n yield* reporter.progress(result);\n })), { concurrency: jobs }),\n Stream.runDrain\n );\n })));\n const reporting = createEffectLogic(({ input }: { input: RunState }) => capture(Effect.gen(function* () {\n const stats = yield* tests.stats ?? Effect.succeed({ hostRestarts: 0, poolResets: 0 });\n if (!input.reported) yield* reporter.write({ ...report(input), ...stats });\n return stats;\n })));\n // generating -> (empty: reporting | copying -> baseline -> testing) -> reporting -> done.\n // Domain failures travel as actor outputs; completed results are events so\n // interruption can report the machine's current state, not a task-local array.\n const machine = setupEffect({\n schemas: {\n context: types<RunState>(),\n events: { CANCEL: Schema.Struct({}), RESULT: Schema.Struct({ result: MutantResult }), SKIP: Schema.Struct({ entry: NotMutated }), PROBE: Schema.Struct({ entry: ReachabilityProbe }), BASELINE: Schema.Struct({ entry: Baseline }) }\n },\n actors: { copying, baselining, generating, testing, reporting }\n }).createMachine({\n context: {\n baseline: { durationMs: 0, testCommand: [] },\n timeoutMs: config.timeoutMs ?? config.minimumTimeoutMs,\n failure: undefined, pool: undefined, pending: [], results: [], reported: false, notMutated: [], probes: [], hostRestarts: 0, poolResets: 0\n },\n output: ({ context }) => context,\n initial: \"generating\",\n on: {\n CANCEL: { target: \".interrupted\" },\n BASELINE: ({ context, event }) => ({ context: { ...context, baseline: event.entry } }),\n PROBE: ({ context, event }) => ({ context: { ...context, probes: [...context.probes, event.entry] } }),\n SKIP: ({ context, event }) => ({ context: { ...context, notMutated: [...new Map([...context.notMutated, event.entry].map(entry => [JSON.stringify(entry), entry])).values()] } }),\n RESULT: ({ context, event }) => ({ context: { ...context, results: [...context.results, event.result] } })\n },\n states: {\n copying: { invoke: { src: \"copying\", input: ({ context }) => context.pending.length, onDone: ({ context, event }) => Result.isSuccess(event.output)\n ? { target: \"baseline\", context: { ...context, pool: event.output.success } }\n : { target: \"failed\", context: { ...context, failure: event.output.failure } } } },\n baseline: { invoke: {\n src: \"baselining\", input: ({ context }) => context.pool,\n onDone: ({ context, event }) => Result.isSuccess(event.output)\n ? { target: \"testing\", context: { ...context, ...event.output.success } }\n : { target: \"reporting\", context: { ...context, failure: event.output.failure,\n baseline: (event.output.failure._tag === \"BaselineFailed\" || event.output.failure._tag === \"BaselineTimedOut\") ? { durationMs: 0, testCommand: event.output.failure.command } : context.baseline\n } }\n } },\n generating: { invoke: { src: \"generating\", onDone: ({ context, event }) => Result.isSuccess(event.output)\n ? { target: event.output.success.length ? \"copying\" : \"reporting\", context: { ...context, pending: event.output.success } }\n : { target: \"reporting\", context: { ...context, failure: event.output.failure } } } },\n testing: { invoke: {\n src: \"testing\", input: ({ context, self }) => ({\n state: context,\n // Queue completion before progress can trigger CANCEL. The parent's\n // FIFO mailbox commits this result before handling that cancellation.\n record: (result) => send(self, { type: \"RESULT\", result }),\n skip: (entry) => send(self, { type: \"SKIP\", entry }),\n probe: (entry) => send(self, { type: \"PROBE\", entry }),\n updateBaseline: (entry) => send(self, { type: \"BASELINE\", entry })\n }),\n onDone: ({ context, event }) => ({ target: \"reporting\", context: {\n ...context, failure: Result.isFailure(event.output) ? event.output.failure : context.failure\n } })\n } },\n reporting: { invoke: {\n src: \"reporting\", input: ({ context }) => context,\n onDone: ({ context, event }) => ({ target: \"done\", context: {\n ...context, ...(Result.isSuccess(event.output) ? event.output.success : {}), reported: Result.isSuccess(event.output), failure: Result.isFailure(event.output) ? event.output.failure : context.failure\n } })\n } },\n interrupted: { invoke: {\n src: \"reporting\", input: ({ context }) => context,\n onDone: ({ context, event }) => ({ target: \"done\", context: {\n ...context, ...(Result.isSuccess(event.output) ? event.output.success : {}), reported: Result.isSuccess(event.output), failure: Result.isFailure(event.output) ? event.output.failure : context.failure\n } })\n } },\n failed: { type: \"final\" },\n done: { type: \"final\" }\n }\n });\n // Close the actor host before the outer pool scope. Stopping an invocation\n // requests interruption; host release waits for its process/revert finalizers.\n const state = yield* Effect.scoped(Effect.gen(function* () {\n const actor = yield* createEffectActor(machine);\n // Domain failures are task outputs; only unexpected actor defects reach join.\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off -- Domain errors are captured above.\n return yield* join(actor).pipe(Effect.orDie, Effect.onInterrupt(() => Effect.gen(function* () {\n yield* send(actor, { type: \"CANCEL\" });\n // @effect-diagnostics-next-line anyUnknownInErrorContext:off -- Wait for the partial report before releasing the actor host.\n yield* join(actor).pipe(Effect.orDie);\n })));\n }));\n if (state.failure !== undefined) return yield* state.failure;\n return report(state);\n}, Effect.scoped);\n", "import { excludeLinkedCandidates, DEFAULT_BASELINE_TIMEOUT_MS, formatTestCommand, ConfigFile, MutantList, MutantSource, Reporter, RunConfig, type BaselineFailed, type BaselineTimedOut, type Mutant, type ProgramLoadError, ReportWriteError, type RunReport, Scratch, type ScratchError, type TestRunner, type TestSpawnError } from \"@mutant-cafe/core\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Ref from \"effect/Ref\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as Command from \"effect/cli/Command\";\nimport * as Flag from \"effect/cli/Flag\";\nimport { selectDiffScope } from \"./Diff.ts\";\nimport { errorExitCode, reportExitCode } from \"./ExitCode.ts\";\nimport { makeReporter, mutantLine } from \"./Reporter.ts\";\nimport { markdownSummary } from \"./Summary.ts\";\n\nimport { git, repositoryRoot, UsageError } from \"./Git.ts\";\nexport { UsageError } from \"./Git.ts\";\n\nexport type Run = (config: RunConfig, mutants: ReadonlyArray<Mutant>) => Effect.Effect<RunReport,\n BaselineFailed | BaselineTimedOut | ScratchError | TestSpawnError | ProgramLoadError | ReportWriteError,\n MutantSource | Scratch | TestRunner | Reporter | Path.Path>;\n\nconst flags = {\n list: Flag.Boolean(\"list\").pipe(Flag.withDefault(false), Flag.withDescription(\"List mutants and skipped function count without running tests\")),\n inDiff: Flag.String(\"in-diff\").pipe(Flag.optional, Flag.withDescription(\"Only mutate bodies overlapping this unified diff\")),\n inDiffRange: Flag.String(\"in-diff-range\").pipe(Flag.optional, Flag.withDescription(\"Only mutate bodies overlapping git diff A...B or A..B; exclusive with --in-diff\")),\n maxMutants: Flag.Int(\"max-mutants\").pipe(Flag.optional, Flag.withDescription(\"Keep first N selected mutants ordered by repository path, line, column, id; N >= 0\")),\n format: Flag.String(\"format\").pipe(Flag.withDefault(\"text\"), Flag.withDescription(\"Output format: text (default), json (--list only), or github (Markdown and GITHUB_STEP_SUMMARY)\")),\n summaryMd: Flag.String(\"summary-md\").pipe(Flag.optional, Flag.withDescription(\"Write Markdown summary to this file\")),\n summaryMarker: Flag.String(\"summary-marker\").pipe(Flag.withDefault(\"<!-- mutant.cafe -->\"), Flag.withDescription(\"Override the first-line sticky-comment marker\")),\n advisory: Flag.Boolean(\"advisory\").pipe(Flag.withDefault(false), Flag.withDescription(\"Exit 0 for outcomes and baseline failure; keep usage/internal errors\")),\n include: Flag.String(\"file\").pipe(Flag.atLeast(0), Flag.withDescription(\"Include source glob relative to package root; repeatable\")),\n exclude: Flag.String(\"exclude\").pipe(Flag.atLeast(0), Flag.withDescription(\"Exclude source glob; repeatable\")),\n exportedOnly: Flag.Boolean(\"exported-only\").pipe(Flag.withDefault(false), Flag.withDescription(\"Only exported binding paths, returned curried functions and Layer service methods; exclude local helpers\")),\n warm: Flag.Boolean(\"warm\").pipe(Flag.withDefault(false), Flag.withDescription(\"Force a persistent Vitest instance instead of automatic selection\")),\n cold: Flag.Boolean(\"cold\").pipe(Flag.withDefault(false), Flag.withDescription(\"Start a fresh Vitest process for each test execution\")),\n jobs: Flag.Int(\"jobs\").pipe(Flag.optional, Flag.withDescription(\"Concurrent scratch/test workers; default 1\")),\n timeout: Flag.Finite(\"timeout\").pipe(Flag.optional, Flag.withDescription(\"Absolute test timeout in seconds, including startup\")),\n baselineTimeout: Flag.Finite(\"baseline-timeout\").pipe(Flag.optional, Flag.withDescription(\"Overall baseline deadline in seconds, including selection and startup; default 1800 (30 minutes)\")),\n timeoutMultiplier: Flag.Finite(\"timeout-multiplier\").pipe(Flag.optional, Flag.withDescription(\"Baseline duration multiplier; default 5\")),\n minimumTimeout: Flag.Finite(\"minimum-test-timeout\").pipe(Flag.optional, Flag.withDescription(\"Minimum test timeout in seconds\")),\n output: Flag.String(\"output\").pipe(Flag.withDefault(\"mutants.out\"), Flag.withDescription(\"Report directory; default mutants.out\")),\n tsconfig: Flag.String(\"tsconfig\").pipe(Flag.withDefault(\"tsconfig.json\"), Flag.withDescription(\"TypeScript project path; default tsconfig.json\")),\n};\n\nexport const makeCommand = (options: {\n readonly root: string;\n readonly run: Run;\n readonly onExit?: (code: number) => Effect.Effect<void>;\n}) => Command.make(\"mutant-cafe\", flags, (input) => Effect.gen(function*() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const root = path.resolve(options.root);\n if (input.cold && input.warm) return yield* new UsageError({ message: \"--warm and --cold are mutually exclusive\" });\n const range = Option.getOrUndefined(input.inDiffRange);\n const inDiff = Option.getOrUndefined(input.inDiff);\n const maxMutants = Option.getOrUndefined(input.maxMutants);\n const summaryMd = Option.getOrUndefined(input.summaryMd);\n if (range !== undefined && inDiff !== undefined) return yield* new UsageError({ message: \"--in-diff-range and --in-diff are mutually exclusive\" });\n if (range !== undefined && (!/^[^\\s.][^\\s]*\\.{2,3}[^\\s.][^\\s]*$/.test(range) || range.startsWith(\"-\") || range.includes(\"....\"))) {\n return yield* new UsageError({ message: \"--in-diff-range expects A...B or A..B\" });\n }\n if (maxMutants !== undefined && (!Number.isSafeInteger(maxMutants) || maxMutants < 0)) return yield* new UsageError({ message: \"--max-mutants must be a nonnegative safe integer\" });\n if (![\"text\", \"json\", \"github\"].includes(input.format) || (input.format === \"json\" && !input.list)) return yield* new UsageError({ message: \"--format expects text, github, or json with --list\" });\n if (/[\\r\\n]/.test(input.summaryMarker)) return yield* new UsageError({ message: \"--summary-marker must be one line\" });\n const gitRoot = range !== undefined ? yield* repositoryRoot(root) : yield* repositoryRoot(root).pipe(Effect.catch(() => Effect.succeed(root)));\n const diffText = range === undefined ? undefined : yield* git(gitRoot, [\"diff\", \"--no-ext-diff\", \"--no-color\", range, \"--\"]);\n const configPath = path.join(root, \"mutants.config.json\");\n const fileConfig = (yield* fs.exists(configPath))\n ? yield* fs.readFileString(configPath).pipe(\n Effect.flatMap(Schema.decodeEffect(Schema.fromJsonString(ConfigFile))),\n Effect.mapError((error) => new UsageError({ message: `Invalid mutants.config.json: ${String(error)}` })),\n ) : {};\n const timeoutMs = Option.map(input.timeout, (seconds) => Math.ceil(seconds * 1000));\n const config = yield* Schema.decodeEffect(RunConfig)({\n root,\n tsconfig: input.tsconfig,\n exportedOnly: input.exportedOnly,\n include: input.include.length > 0 ? input.include : fileConfig.include ?? [\"**/*.{ts,tsx}\"],\n exclude: input.exclude.length > 0 ? input.exclude : fileConfig.exclude ?? [],\n functionFilter: fileConfig.functionFilter ?? [],\n ...(inDiff === undefined ? {} : { inDiff }),\n cold: input.cold,\n warm: input.warm,\n jobs: Option.getOrElse(input.jobs, () => fileConfig.jobs ?? 1),\n ...(Option.isSome(timeoutMs) ? { timeoutMs: timeoutMs.value } : {}),\n baselineTimeoutMs: Option.match(input.baselineTimeout, { onNone: () => fileConfig.baselineTimeoutMs ?? DEFAULT_BASELINE_TIMEOUT_MS, onSome: seconds => Math.ceil(seconds * 1000) }),\n timeoutMultiplier: Option.getOrElse(input.timeoutMultiplier, () => fileConfig.timeoutMultiplier ?? 5),\n minimumTimeoutMs: Option.match(input.minimumTimeout, { onNone: () => fileConfig.minimumTimeoutMs ?? 20_000, onSome: (seconds) => Math.ceil(seconds * 1000) }),\n neverTimeoutMs: 1_000,\n outDir: input.output,\n }).pipe(Effect.mapError((error) => new UsageError({ message: String(error) })));\n if (config.jobs < 1 || config.timeoutMultiplier <= 0 || config.minimumTimeoutMs <= 0 || (config.timeoutMs !== undefined && config.timeoutMs <= 0) || (config.baselineTimeoutMs !== undefined && config.baselineTimeoutMs <= 0)) {\n return yield* new UsageError({ message: \"Jobs and timeout values must be positive\" });\n }\n const source = yield* MutantSource;\n const generated = yield* Stream.runCollect(source.generate(config)).pipe(\n Effect.mapError((error) => error.reason === \"selection\"\n ? new UsageError({ message: error.diagnostics.join(\"\\n\") }) : error)\n );\n const skipped = yield* source.notMutated(config);\n const selected = inDiff === undefined && diffText === undefined ? { mutants: generated, notMutated: skipped }\n : yield* selectDiffScope({ root, diffPath: inDiff ?? `git diff ${range}`, ...(diffText === undefined ? {} : { diffText }), mutants: generated, notMutated: skipped });\n const scratch = yield* Scratch;\n const roots = selected.mutants.length && scratch.inspect ? yield* scratch.inspect(root) : [];\n const eligible = yield* excludeLinkedCandidates(root, selected.mutants, roots);\n const relative = (mutant: Mutant) => path.relative(gitRoot, path.resolve(root, mutant.file)).replaceAll(\"\\\\\", \"/\");\n const compare = (a: string, b: string) => a < b ? -1 : a > b ? 1 : 0;\n const ordered = [...eligible.mutants].sort((a, b) => compare(relative(a), relative(b)) || a.span.start.line - b.span.start.line || a.span.start.column - b.span.start.column || compare(a.id, b.id));\n const mutants = ordered.slice(0, maxMutants);\n const notMutated = [...new Map([...selected.notMutated, ...eligible.notMutated].map(entry => [JSON.stringify(entry), entry])).values()];\n const counts = { selected: ordered.length, run: 0, budgetSkipped: ordered.length - mutants.length };\n if (mutants.length === 0) {\n const cause = ordered.length > 0 ? \"budget\" : eligible.notMutated.length > 0 ? \"linked ignored trees\" : range !== undefined ? \"range\"\n : inDiff !== undefined || diffText !== undefined ? \"diff\"\n : config.functionFilter.length || config.exportedOnly ? \"filter\" : \"file selection\";\n yield* Console.error(`0 mutants selected (${counts.selected} before budget); cause: ${cause}. Baseline skipped.`);\n }\n const markdown = input.format === \"github\" || summaryMd !== undefined ? {\n gitRoot, marker: input.summaryMarker, advisory: input.advisory, stdout: input.format === \"github\",\n files: [...(summaryMd === undefined ? [] : [path.resolve(root, summaryMd)]),\n ...(input.format === \"github\" && process.env.GITHUB_STEP_SUMMARY ? [process.env.GITHUB_STEP_SUMMARY] : [])],\n } : undefined;\n if (input.list && markdown !== undefined) {\n const text = markdownSummary({ ...markdown, root, path, notMutated: notMutated.length,\n report: { schemaVersion: 2, tool: \"mutant.cafe\", root, baseline: { durationMs: 0, testCommand: [] }, timeoutMs: 0, results: [], ...counts } });\n for (const file of new Set(markdown.files)) yield* fs.writeFileString(file, text).pipe(\n Effect.mapError(error => new ReportWriteError({ path: file, message: String(error) })));\n if (markdown.stdout) {\n yield* Console.log(text);\n if (options.onExit !== undefined) yield* options.onExit(0);\n return;\n }\n }\n if (input.list && input.format === \"json\") {\n yield* Console.log(yield* Schema.encodeEffect(Schema.fromJsonString(MutantList))({ schemaVersion: 2, tool: \"mutant.cafe\", mutants, notMutated, counts }));\n if (options.onExit !== undefined) yield* options.onExit(0);\n return;\n }\n if (input.list) {\n for (const mutant of mutants) yield* Console.log(mutantLine(mutant, config.root, path));\n const perFile = new Map<string, number>();\n for (const mutant of mutants) {\n const file = path.relative(root, path.resolve(root, mutant.file));\n perFile.set(file, (perFile.get(file) ?? 0) + 1);\n }\n for (const [file, count] of [...perFile].sort(([a], [b]) => a.localeCompare(b))) yield* Console.log(`${file}: ${count} mutants`);\n yield* Console.log(`${mutants.length} mutants total; ${notMutated.length} not mutated; ${counts.selected} selected, 0 run, ${counts.budgetSkipped} budget-skipped`);\n if (options.onExit !== undefined) yield* options.onExit(0);\n return;\n }\n const reporter = yield* makeReporter({ root, outDir: config.outDir, mutants, notMutated, selected: counts.selected, budgetSkipped: counts.budgetSkipped, ...(markdown === undefined ? {} : { markdown }) });\n // Selection is final here: no scratch tree or test process can add information when it is empty.\n const report = yield* (mutants.length === 0\n ? Effect.succeed<RunReport>({ schemaVersion: 2, tool: \"mutant.cafe\", root,\n baseline: { durationMs: 0, testCommand: [] }, timeoutMs: 0, results: [] })\n : options.run(config, mutants)).pipe(Effect.provideService(Reporter, reporter),\n Effect.catchTag(\"BaselineFailed\", error => Effect.gen(function*() {\n const failed: RunReport = { schemaVersion: 2, tool: \"mutant.cafe\", root,\n baseline: { durationMs: 0, testCommand: error.command }, timeoutMs: config.timeoutMs ?? config.minimumTimeoutMs, results: [],\n failure: `BaselineFailed: ${formatTestCommand(error.command)}\\n${error.output.slice(-8000)}` };\n yield* reporter.write(failed);\n if (!input.advisory) return yield* error;\n if (markdown === undefined) yield* Console.log(\"Advisory: baseline failed; would exit 4 without --advisory.\");\n return failed;\n })), Effect.catchTag(\"BaselineTimedOut\", error => Effect.gen(function* () {\n const timedOut: RunReport = { schemaVersion: 2, tool: \"mutant.cafe\", root,\n baseline: { durationMs: 0, testCommand: error.command }, timeoutMs: config.timeoutMs ?? config.minimumTimeoutMs, results: [],\n failure: `BaselineTimedOut: ${error.message}` };\n yield* reporter.write(timedOut);\n if (!input.advisory) return yield* error;\n return timedOut;\n })));\n if (input.advisory && reportExitCode(report) !== 0 && markdown === undefined) yield* Console.log(`Advisory: would exit ${reportExitCode(report)} without --advisory.`);\n yield* reporter.write(report);\n if (options.onExit !== undefined) yield* options.onExit(input.advisory ? 0 : reportExitCode(report));\n}));\n\n// The executable's runtime supplies core services. No engine or runner package is\n// imported here; the integration layer owns that choice.\nexport const runCli = Effect.fn(\"runCli\")(function*(options: {\n readonly root: string;\n readonly args: ReadonlyArray<string>;\n readonly run: Run;\n}) {\n const code = yield* Ref.make(0);\n const command = makeCommand({ ...options, onExit: (value) => Ref.set(code, value) });\n yield* Command.runWith(command, { version: \"0.1.7\" })(options.args).pipe(\n Effect.catch((error) => Effect.gen(function*() {\n yield* Console.error(error._tag === \"ProgramLoadError\" ? `${error.tsconfig}:\\n${error.diagnostics.join(\"\\n\")}`\n : error._tag === \"TestSpawnError\" && error.kind === \"vitest-version\" ? error.message\n : error._tag === \"BaselineTimedOut\" ? error.message\n : error._tag === \"BaselineFailed\" ? `Baseline failed (${error.exitCode}): ${formatTestCommand(error.command)}\\n${error.output.slice(-8000)}`\n : String(error));\n yield* Ref.set(code, errorExitCode(error));\n })),\n Effect.catchDefect((defect) => Effect.gen(function*() {\n yield* Console.error(`Internal error: ${String(defect)}`);\n yield* Ref.set(code, 70);\n })),\n );\n return yield* Ref.get(code);\n});\n", "import { DiffParseError, type Mutant, type NotMutated } from \"@mutant-cafe/core\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\n\nexport class DiffMismatch extends Schema.TaggedError<DiffMismatch>()(\"DiffMismatch\", {\n path: Schema.String,\n message: Schema.String,\n}) {}\n\ninterface NewLine { readonly number: number; readonly text: string; readonly added: boolean; readonly noNewline: boolean }\ninterface FilePatch { readonly file: string; readonly lines: ReadonlyArray<NewLine> }\n\n// Counts, ordering and new-side text are checked, not merely the presence of @@.\nexport const parseDiff = (text: string, path: string) => Effect.try({\n try: (): ReadonlyArray<FilePatch> => {\n const fail = (message: string): never => { throw new DiffParseError({ path, message }); };\n if (text === \"\") return [];\n const input = text.split(\"\\n\");\n if (input.at(-1) === \"\") input.pop();\n const patches: FilePatch[] = [];\n let i = 0;\n let sawFile = false;\n while (i < input.length) {\n const line = input[i++]!;\n if (line.startsWith(\"diff --git \") || /^(index |new file mode |deleted file mode |old mode |new mode |similarity index |rename from |rename to )/.test(line)) continue;\n if (!line.startsWith(\"--- \")) fail(\"Expected a unified diff file header\");\n const next = input[i++];\n if (!next?.startsWith(\"+++ \")) fail(\"Missing new-side file header\");\n const raw = next!.slice(4).split(\"\\t\")[0]!;\n const decoded: unknown = raw.startsWith('\"') ? JSON.parse(raw) : raw;\n if (typeof decoded !== \"string\") fail(\"Invalid file path\");\n const file = String(decoded).replace(/^b\\//, \"\");\n const lines: NewLine[] = [];\n let hunks = 0;\n let previousEnd = 0;\n let previousOldEnd = 0;\n while (input[i]?.startsWith(\"@@\")) {\n const match = /^@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@(?:.*)$/.exec(input[i++]!);\n if (!match) fail(\"Invalid hunk header\");\n let oldRemaining = Number(match![2] ?? 1);\n let newRemaining = Number(match![4] ?? 1);\n let newLine = Number(match![3]);\n const oldStart = Number(match![1]);\n const oldCount = oldRemaining;\n if (![oldStart, oldRemaining, newLine, newRemaining].every(Number.isSafeInteger)) fail(\"Hunk range is not a safe integer\");\n if ((oldRemaining > 0 && oldStart === 0) || (newRemaining > 0 && newLine === 0)) fail(\"Nonempty hunk cannot start at zero\");\n if (newLine < previousEnd || oldStart < previousOldEnd) fail(\"Overlapping or unordered hunks\");\n let previousPrefix = \"\";\n const markNoNewline = () => {\n if (previousPrefix === \"+\" || previousPrefix === \" \") {\n const last = lines.at(-1);\n if (last === undefined || last.noNewline) fail(\"Unexpected no-newline marker\");\n lines[lines.length - 1] = { ...last!, noNewline: true };\n } else if (previousPrefix !== \"-\") fail(\"Unexpected no-newline marker\");\n previousPrefix = \"\";\n };\n hunks++;\n while (oldRemaining > 0 || newRemaining > 0) {\n const body = input[i++];\n if (body === \"\\\\") { markNoNewline(); continue; }\n if (body === undefined) fail(\"Truncated hunk\");\n const prefix = body![0];\n if (prefix === \" \" || prefix === \"-\") oldRemaining--;\n if (prefix === \" \" || prefix === \"+\") {\n newRemaining--;\n lines.push({ number: newLine++, text: body!.slice(1), added: prefix === \"+\", noNewline: false });\n } else if (prefix !== \"-\") fail(\"Invalid hunk line\");\n previousPrefix = prefix!;\n if (oldRemaining < 0 || newRemaining < 0) fail(\"Hunk count does not match its body\");\n }\n if (input[i] === \"\\\\") { markNoNewline(); i++; }\n previousEnd = newLine;\n previousOldEnd = oldStart + oldCount;\n }\n if (hunks === 0) fail(\"File has no hunks\");\n sawFile = true;\n if (file !== \"/dev/null\") patches.push({ file, lines });\n }\n if (!sawFile) fail(\"No unified diff found\");\n return patches;\n },\n catch: (error) => Schema.is(DiffParseError)(error) ? error : new DiffParseError({ path, message: String(error) }),\n});\n\nexport const selectDiffScope = Effect.fn(\"selectDiffScope\")(function*(options: {\n readonly root: string;\n readonly diffPath: string;\n readonly diffText?: string;\n readonly mutants: ReadonlyArray<Mutant>;\n readonly notMutated: ReadonlyArray<NotMutated>;\n}) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const diffPath = path.resolve(options.root, options.diffPath);\n const text = options.diffText ?? (yield* fs.readFileString(diffPath).pipe(Effect.mapError((error) => new DiffParseError({ path: diffPath, message: String(error) }))));\n const patches = yield* parseDiff(text, diffPath);\n const gitRoot = yield* Effect.scoped(Effect.gen(function* () {\n const handle = yield* ChildProcess.make(\"git\", [\"rev-parse\", \"--show-toplevel\"], { cwd: options.root, stderr: \"ignore\" });\n const [output, code] = yield* Effect.all([Stream.mkString(Stream.decodeText(handle.stdout)), handle.exitCode], { concurrency: \"unbounded\" });\n if (Number(code) !== 0 || !output.trim()) return options.root;\n const physicalRoot = yield* fs.realPath(options.root);\n return path.resolve(options.root, path.relative(physicalRoot, output.trim()));\n })).pipe(Effect.catch(() => Effect.succeed(options.root)));\n const changed = new Map<string, Set<number>>();\n for (const patch of patches) {\n const repositoryPath = path.resolve(gitRoot, patch.file);\n // Validate both interpretations against the tree: a --relative diff can\n // name a file that also exists at the toplevel but has different contents.\n const candidates = [...new Set([repositoryPath, path.resolve(options.root, patch.file)])];\n let absolute: string | undefined;\n for (const candidate of candidates) {\n const relative = path.relative(gitRoot, candidate);\n if (relative === \"..\" || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {\n return yield* new DiffParseError({ path: diffPath, message: \"Diff path escapes repository root\" });\n }\n if (!(yield* fs.exists(candidate))) continue;\n const current = yield* fs.readFileString(candidate).pipe(Effect.mapError((error) => new DiffMismatch({ path: patch.file, message: String(error) })));\n const lines = current.split(\"\\n\");\n const finalLine = current.endsWith(\"\\n\") ? lines.length - 1 : lines.length;\n if (patch.lines.every((line) => {\n const newlineMismatch = line.noNewline\n ? line.number !== finalLine || current.endsWith(\"\\n\")\n : line.number === finalLine && !current.endsWith(\"\\n\");\n return lines[line.number - 1] === line.text && !newlineMismatch;\n })) { absolute = candidate; break; }\n }\n if (absolute === undefined) return yield* new DiffMismatch({ path: patch.file, message: \"New-side lines do not match the tree at the Git toplevel or working directory\" });\n const added = changed.get(absolute) ?? new Set<number>();\n for (const line of patch.lines) if (line.added) added.add(line.number);\n changed.set(absolute, added);\n }\n return {\n mutants: options.mutants.filter((mutant) => {\n const added = changed.get(path.resolve(options.root, mutant.file));\n const end = mutant.span.end.line - (mutant.span.end.column === 1 ? 1 : 0);\n return added !== undefined && [...added].some((line) => line >= mutant.span.start.line && line <= end);\n }),\n notMutated: options.notMutated.filter(item => changed.has(path.resolve(options.root, item.file))),\n };\n});\n\nexport const selectInDiff = (options: {\n readonly root: string;\n readonly diffPath: string;\n readonly mutants: ReadonlyArray<Mutant>;\n}) => selectDiffScope({ ...options, notMutated: [] }).pipe(Effect.map(result => result.mutants));\n", "import type { RunReport } from \"@mutant-cafe/core\";\n\nexport const reportExitCode = (report: RunReport): number =>\n report.results.some((result) => result.outcome === \"missed\") ? 2 :\n report.results.some((result) => result.outcome === \"unreliable\") ? 7 :\n report.results.some((result) => result.outcome === \"untested\") ? 2 :\n report.results.some((result) => result.outcome === \"timeout\") || report.failure?.startsWith(\"BaselineTimedOut:\") ? 3 : 0;\n\nexport const errorExitCode = (error: { readonly _tag: string; readonly kind?: string | undefined }): number => {\n switch (error._tag) {\n case \"BaselineFailed\": return 4;\n case \"BaselineTimedOut\": return 3;\n case \"TestSpawnError\": return error.kind === \"vitest-version\" ? 8 : 70;\n case \"DiffMismatch\": return 5;\n case \"DiffParseError\": return 6;\n case \"ProgramLoadError\": case \"UsageError\": case \"ShowHelp\": case \"InvalidValue\": case \"MissingFlag\":\n case \"UnrecognizedArgument\": return 1;\n default: return 70;\n }\n};\n", "import { sanitizeReportTelemetry, Reporter, ReportWriteError, RunReport, Mutant, type MutantResult, type NotMutated } from \"@mutant-cafe/core\";\nimport * as Clock from \"effect/Clock\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport { unifiedDiff } from \"./UnifiedDiff.ts\";\nimport { countsLine, markdownSummary } from \"./Summary.ts\";\n\nexport const mutantLine = (mutant: Mutant, root: string, path: Path.Path): string =>\n `${path.relative(root, path.resolve(root, mutant.file))}:${mutant.span.start.line}:${mutant.span.start.column}: ${mutant.description.replace(mutant.returnType, shortType(mutant.displayReturnType ?? mutant.returnType))} [${mutant.id}]`;\n\nconst shortType = (text: string): string => {\n const line = text.replace(/\\s+/g, \" \");\n return line.length > 80 ? line.slice(0, 79) + \"\u2026\" : line;\n};\n\nconst outcomes = [\"caught\", \"missed\", \"timeout\", \"unviable\", \"untested\", \"unreliable\"] as const;\nconst jsonReport = Schema.encodeEffect(Schema.fromJsonString(RunReport));\nconst logText = (result: MutantResult): string => [\n ...(\"output\" in result && typeof result.output === \"string\" ? [result.output] : []),\n ...result.diagnostics,\n].join(\"\\n\");\n\nexport const makeReporter = Effect.fn(\"makeReporter\")(function*(options: {\n readonly root: string;\n readonly outDir: string;\n readonly mutants: ReadonlyArray<Mutant>;\n readonly notMutated?: ReadonlyArray<NotMutated>;\n readonly selected?: number;\n readonly budgetSkipped?: number;\n readonly markdown?: {\n readonly gitRoot: string;\n readonly marker: string;\n readonly advisory: boolean;\n readonly stdout: boolean;\n readonly files: ReadonlyArray<string>;\n };\n}) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const dir = path.resolve(options.root, options.outDir);\n const started = yield* Clock.currentTimeMillis;\n const semaphore = yield* Semaphore.make(1);\n const results: MutantResult[] = [];\n let pendingError: ReportWriteError | undefined;\n let summarized = false;\n const telemetryWarned = new Set<string>();\n const writeError = (error: unknown) => new ReportWriteError({ path: dir, message: String(error) });\n const ids = new Set<string>();\n for (const mutant of options.mutants) {\n if (!/^[A-Za-z0-9_-]+$/.test(mutant.id) || ids.has(mutant.id)) return yield* writeError(\"Mutant ids must be unique safe filenames\");\n ids.add(mutant.id);\n }\n yield* Effect.gen(function*() {\n // Rotating an ancestor would move the source tree. An unrelated output path\n // is allowed, but an old directory is removed only if it is our report.\n const relative = path.relative(dir, path.resolve(options.root));\n if (relative === \"\" || (relative !== \"..\" && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative))) {\n return yield* new ReportWriteError({ path: dir, message: \"Output cannot be the project root or an ancestor\" });\n }\n if (yield* fs.exists(dir)) {\n if (!(yield* fs.exists(path.join(dir, \"mutants.json\")))) return yield* writeError(\"Existing output is not a mutant report; choose another --output\");\n if (yield* fs.exists(`${dir}.old`)) {\n if (!(yield* fs.exists(path.join(`${dir}.old`, \"mutants.json\")))) return yield* writeError(\"Previous output is not a mutant report; choose another --output\");\n yield* fs.remove(`${dir}.old`, { recursive: true });\n }\n yield* fs.rename(dir, `${dir}.old`);\n }\n yield* fs.makeDirectory(path.join(dir, \"diff\"), { recursive: true });\n yield* fs.makeDirectory(path.join(dir, \"logs\"), { recursive: true });\n }).pipe(Effect.mapError(writeError));\n // Encode the actual core contract, not a second report shape.\n const encodedMutants = yield* Schema.encodeEffect(Schema.fromJsonString(Schema.Array(Mutant)))(options.mutants).pipe(Effect.mapError(writeError));\n yield* fs.writeFileString(path.join(dir, \"mutants.json\"), encodedMutants).pipe(Effect.mapError(writeError));\n yield* fs.writeFileString(path.join(dir, \"not-mutated.txt\"), (options.notMutated ?? []).map(item => `${path.relative(options.root, item.file)}:${item.span?.start.line ?? \"?\"}:${item.span?.start.column ?? \"?\"}: ${item.functionName}: ${item.reason}\\n`).join(\"\")).pipe(Effect.mapError(writeError));\n yield* Effect.forEach(outcomes, (outcome) => fs.writeFileString(path.join(dir, `${outcome}.txt`), \"\"), { discard: true }).pipe(Effect.mapError(writeError));\n for (const mutant of options.mutants) {\n const original = yield* fs.readFileString(path.resolve(options.root, mutant.file)).pipe(Effect.mapError(writeError));\n yield* fs.writeFileString(path.join(dir, \"diff\", `${mutant.id}.diff`), unifiedDiff(original, original.slice(0, mutant.replacement.startOffset) + mutant.replacement.text + original.slice(mutant.replacement.endOffset), path.relative(options.root, path.resolve(options.root, mutant.file)).replaceAll(\"\\\\\", \"/\"))).pipe(Effect.mapError(writeError));\n }\n const writeLists = (items: ReadonlyArray<MutantResult>) => Effect.forEach(outcomes, (outcome) => {\n const lines = items.filter((result) => result.outcome === outcome).map((result) => mutantLine(result.mutant, options.root, path));\n return fs.writeFileString(path.join(dir, `${outcome}.txt`), lines.length === 0 ? \"\" : lines.join(\"\\n\") + \"\\n\");\n }, { discard: true });\n const service = Reporter.of({\n progress: (result) => semaphore.withPermit(Effect.gen(function*() {\n results.push(result);\n if (!options.markdown?.stdout) yield* Console.log(`${result.outcome} ${mutantLine(result.mutant, options.root, path)} (${result.durationMs}ms)`);\n yield* Effect.gen(function*() {\n if (!ids.has(result.mutant.id)) return yield* writeError(\"Progress result does not belong to this report\");\n yield* writeLists(results);\n yield* fs.writeFileString(path.join(dir, \"logs\", `${result.mutant.id}.log`), logText(result));\n }).pipe(Effect.catch((error) => Effect.gen(function*() {\n if (pendingError === undefined) {\n pendingError = writeError(error);\n yield* Console.warn(`Report write failed: ${pendingError.message}`);\n }\n })));\n })),\n write: (report) => semaphore.withPermit(Effect.gen(function*() {\n if (pendingError !== undefined) return yield* pendingError;\n const notMutated = [...new Map([...(options.notMutated ?? []), ...(report.notMutated ?? [])].map(item => [JSON.stringify(item), item])).values()];\n yield* fs.writeFileString(path.join(dir, \"not-mutated.txt\"), notMutated.map(item => `${path.relative(options.root, item.file)}:${item.span?.start.line ?? \"?\"}:${item.span?.start.column ?? \"?\"}: ${item.functionName}: ${item.reason}\\n`).join(\"\")).pipe(Effect.mapError(writeError));\n const telemetry = sanitizeReportTelemetry(report);\n const counted: RunReport = { ...telemetry.report, notMutated, selected: options.selected ?? options.mutants.length,\n run: report.results.length, budgetSkipped: options.budgetSkipped ?? 0 };\n const encoded = yield* jsonReport(counted).pipe(Effect.mapError(writeError));\n yield* fs.writeFileString(path.join(dir, \"outcomes.json.tmp\"), encoded).pipe(Effect.mapError(writeError));\n yield* fs.rename(path.join(dir, \"outcomes.json.tmp\"), path.join(dir, \"outcomes.json\")).pipe(Effect.mapError(writeError));\n yield* writeLists(report.results).pipe(Effect.mapError(writeError));\n for (const result of report.results) {\n if (!ids.has(result.mutant.id)) return yield* writeError(\"Final result does not belong to this report\");\n yield* fs.writeFileString(path.join(dir, \"logs\", `${result.mutant.id}.log`), logText(result)).pipe(Effect.mapError(writeError));\n }\n // Telemetry warnings cannot prevent persisting the outcomes above.\n for (const warning of telemetry.warnings) if (!telemetryWarned.has(warning)) {\n telemetryWarned.add(warning);\n yield* Console.warn(warning);\n }\n // The runner writes on completion or interrupt and the CLI writes again\n // as the owner of the final report; files are idempotent, the summary prints once.\n if (options.markdown !== undefined) {\n const markdown = markdownSummary({ ...options.markdown, root: options.root, path, report: counted, notMutated: notMutated.length });\n for (const file of new Set(options.markdown.files)) {\n yield* fs.writeFileString(file, markdown).pipe(Effect.mapError(error => new ReportWriteError({ path: file, message: String(error) })));\n }\n if (!summarized && options.markdown.stdout) yield* Console.log(markdown);\n }\n if (summarized) return;\n summarized = true;\n if (report.results.some(result => result.outcome === \"unreliable\")) yield* Console.warn(\"Unreliable: the configured Vitest run cannot see all tests. See unreliable.txt and per-mutant diagnostics; these are not missed mutants.\");\n const elapsed = (yield* Clock.currentTimeMillis) - started;\n if (!options.markdown?.stdout) yield* Console.log(countsLine(counted, notMutated.length) + `; ${(elapsed / 1000).toFixed(2)}s`);\n if (options.markdown === undefined && report.failure !== undefined) yield* Console.warn(report.failure);\n })),\n });\n return service;\n});\n\nexport const ReporterLive = (options: Parameters<typeof makeReporter>[0]) =>\n Layer.effect(Reporter, makeReporter(options));\n", "interface LineEdit { readonly sign: \" \" | \"+\" | \"-\"; readonly text: string }\n\n// Myers' shortest edit path. Function-body mutations commonly retain almost\n// every line inside a new wrapper, so a prefix/suffix-only diff is not enough.\nconst shortestEdits = (before: ReadonlyArray<string>, after: ReadonlyArray<string>): ReadonlyArray<LineEdit> => {\n const frontier = new Map<number, number>([[1, 0]]);\n const trace: Array<Map<number, number>> = [];\n for (let distance = 0; distance <= before.length + after.length; distance++) {\n trace.push(new Map(frontier));\n for (let diagonal = -distance; diagonal <= distance; diagonal += 2) {\n const down = diagonal === -distance || (diagonal !== distance && (frontier.get(diagonal - 1) ?? -Infinity) < (frontier.get(diagonal + 1) ?? -Infinity));\n let x = down ? frontier.get(diagonal + 1) ?? 0 : (frontier.get(diagonal - 1) ?? 0) + 1;\n let y = x - diagonal;\n while (x < before.length && y < after.length && before[x] === after[y]) { x++; y++; }\n frontier.set(diagonal, x);\n if (x < before.length || y < after.length) continue;\n const result: LineEdit[] = [];\n x = before.length;\n y = after.length;\n for (let depth = trace.length - 1; depth >= 0; depth--) {\n const previous = trace[depth]!;\n const k = x - y;\n const down = k === -depth || (k !== depth && (previous.get(k - 1) ?? -Infinity) < (previous.get(k + 1) ?? -Infinity));\n const previousK = down ? k + 1 : k - 1;\n const previousX = previous.get(previousK) ?? 0;\n const previousY = previousX - previousK;\n while (x > previousX && y > previousY) { result.push({ sign: \" \", text: before[--x]! }); y--; }\n if (depth === 0) break;\n if (x === previousX) result.push({ sign: \"+\", text: after[--y]! });\n else result.push({ sign: \"-\", text: before[--x]! });\n }\n return result.reverse();\n }\n }\n return [];\n};\n\nconst edits = (before: ReadonlyArray<string>, after: ReadonlyArray<string>): ReadonlyArray<LineEdit> => {\n let prefix = 0;\n while (prefix < before.length && prefix < after.length && before[prefix] === after[prefix]) prefix++;\n let suffix = 0;\n while (suffix < before.length - prefix && suffix < after.length - prefix && before[before.length - suffix - 1] === after[after.length - suffix - 1]) suffix++;\n const left = before.slice(prefix, before.length - suffix);\n const right = after.slice(prefix, after.length - suffix);\n const shared = new Set(left);\n const middle: ReadonlyArray<LineEdit> = right.some((text) => shared.has(text))\n ? shortestEdits(left, right)\n : [...left.map((text): LineEdit => ({ sign: \"-\", text })), ...right.map((text): LineEdit => ({ sign: \"+\", text }))];\n return [...before.slice(0, prefix).map((text): LineEdit => ({ sign: \" \", text })), ...middle,\n ...before.slice(before.length - suffix).map((text): LineEdit => ({ sign: \" \", text }))];\n};\n\nconst lines = (text: string): ReadonlyArray<string> => {\n if (!text) return [];\n const result = text.split(\"\\n\");\n if (text.endsWith(\"\\n\")) result.pop();\n else result[result.length - 1] += \"\\n\\\\";\n return result;\n};\n\nexport const unifiedDiff = (original: string, modified: string, file: string): string => {\n if (original === modified) return \"\";\n const changes = edits(lines(original), lines(modified));\n const positions: Array<{ readonly old: number; readonly next: number }> = [];\n let old = 1;\n let next = 1;\n for (const edit of changes) {\n positions.push({ old, next });\n if (edit.sign !== \"+\") old++;\n if (edit.sign !== \"-\") next++;\n }\n const changed = changes.flatMap((edit, index) => edit.sign === \" \" ? [] : [index]);\n const quotePath = (path: string) => /[\\s\"\\\\]/.test(path) ? JSON.stringify(path) : path;\n const output = [`--- ${quotePath(`a/${file}`)}`, `+++ ${quotePath(`b/${file}`)}`];\n for (let i = 0; i < changed.length; i++) {\n const start = Math.max(0, changed[i]! - 3);\n let last = changed[i]!;\n while (i + 1 < changed.length && changed[i + 1]! - last <= 7) last = changed[++i]!;\n const hunk = changes.slice(start, last + 4);\n const oldCount = hunk.filter((edit) => edit.sign !== \"+\").length;\n const newCount = hunk.filter((edit) => edit.sign !== \"-\").length;\n const position = positions[start]!;\n output.push(`@@ -${oldCount ? position.old : position.old - 1},${oldCount} +${newCount ? position.next : position.next - 1},${newCount} @@`, ...hunk.map((edit) => edit.sign + edit.text));\n }\n return [...output, \"\"].join(\"\\n\");\n};\n", "import type { RunReport } from \"@mutant-cafe/core\";\nimport type * as Path from \"effect/Path\";\nimport { reportExitCode } from \"./ExitCode.ts\";\n\nexport const outcomeNames = [\"caught\", \"missed\", \"timeout\", \"unviable\", \"untested\", \"unreliable\"] as const;\n\nconst backstopCosts = (report: RunReport): string => {\n const samples = report.results.flatMap(result => result.backstopMs !== undefined && Number.isFinite(result.backstopMs) ? [result.backstopMs] : []).sort((a, b) => a - b);\n if (!samples.length) return \"\";\n const percentile = (p: number) => samples[Math.max(0, Math.ceil(samples.length * p) - 1)]!.toFixed(1);\n return `; backstop per mutant p50 ${percentile(0.5)} ms, p90 ${percentile(0.9)} ms (${samples.length} measured)`;\n};\n\nexport const countsLine = (report: RunReport, notMutated: number): string =>\n `${report.selected ?? report.results.length} selected, ${report.run ?? report.results.length} run, ${report.budgetSkipped ?? 0} budget-skipped; ` +\n outcomeNames.map(outcome => `${report.results.filter(result => result.outcome === outcome).length} ${outcome}`).join(\", \") +\n `; ${notMutated} not mutated` + (report.hostRestarts === undefined ? \"\" : `; ${report.hostRestarts} host restarts, ${report.poolResets ?? 0} pool resets`) + backstopCosts(report);\n\n// HTML entities avoid starting code spans; backslashes protect table separators.\nconst cell = (text: string): string => text.replaceAll(\"&\", \"&amp;\").replaceAll(\"<\", \"&lt;\").replaceAll(\">\", \"&gt;\")\n .replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"|\", \"\\\\|\").replaceAll(\"`\", \"&#96;\").replace(/[\\r\\n]+/g, \" \");\n\nexport const markdownSummary = (options: {\n readonly report: RunReport;\n readonly root: string;\n readonly gitRoot: string;\n readonly path: Path.Path;\n readonly marker: string;\n readonly notMutated: number;\n readonly advisory: boolean;\n}): string => {\n const { report, path } = options;\n const rows = report.results.filter(result => result.outcome === \"missed\" || result.outcome === \"timeout\" || result.outcome === \"untested\" || result.outcome === \"unreliable\");\n const exit = report.failure?.startsWith(\"BaselineFailed\") ? 4 : reportExitCode(report);\n return [options.marker, countsLine(report, options.notMutated), \"\",\n ...(report.failure === undefined ? [] : [`Failure: ${cell(report.failure)}`, \"\"]),\n options.advisory ? `Advisory: would exit ${exit} without --advisory.` : `Exit code: ${exit}.`, \"\",\n ...(rows.length ? [\"| File:line | Function | Description | Outcome |\", \"| --- | --- | --- | --- |\"] : report.failure === undefined ? [\"No actionable mutants.\"] : []),\n ...rows.slice(0, 50).map(({ mutant, outcome }) => `| ${cell(path.relative(options.gitRoot, path.resolve(options.root, mutant.file)).replaceAll(\"\\\\\", \"/\"))}:${mutant.span.start.line} | ${cell(mutant.functionName)} | ${cell(mutant.description)} | ${outcome} |`),\n ...(rows.length > 50 ? [\"\", `and ${rows.length - 50} more`] : []), \"\",\n ].join(\"\\n\");\n};\n", "import * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as ChildProcess from \"effect/process/ChildProcess\";\n\nexport class UsageError extends Schema.TaggedError<UsageError>()(\"UsageError\", { message: Schema.String }) {}\n\nexport const git = Effect.fn(\"git\")(function*(root: string, args: ReadonlyArray<string>) {\n const command = `git ${args.join(\" \")}`;\n return yield* Effect.scoped(Effect.gen(function*() {\n const handle = yield* ChildProcess.make(\"git\", args, { cwd: root });\n const [stdout, stderr, code] = yield* Effect.all([\n Stream.mkString(Stream.decodeText(handle.stdout)),\n Stream.mkString(Stream.decodeText(handle.stderr)), handle.exitCode,\n ], { concurrency: \"unbounded\" });\n if (Number(code) !== 0) return yield* new UsageError({ message: `${command}:\\n${stderr}` });\n return stdout;\n })).pipe(Effect.mapError(error => error._tag === \"UsageError\" ? error : new UsageError({ message: `${command}: ${String(error)}` })));\n});\n\nexport const repositoryRoot = Effect.fn(\"repositoryRoot\")(function*(root: string) {\n const path = yield* Path.Path;\n const fs = yield* FileSystem.FileSystem;\n const top = (yield* git(root, [\"rev-parse\", \"--show-toplevel\"])).trim();\n const physical = yield* fs.realPath(root).pipe(Effect.mapError(error => new UsageError({ message: String(error) })));\n return path.resolve(root, path.relative(physical, top));\n});\n"],
5
+ "mappings": ";;;AACA,YAAY,iBAAiB;AAC7B,YAAY,kBAAkB;;;ACF9B,YAAY,YAAY;AAEjB,IAAM,8BAA8B,KAAK,KAAK;AAE9C,IAAM,YAAmB,cAAO;AAAA,EACrC,MAAa;AAAA,EACb,UAAiB;AAAA,EACjB,SAAgB,aAAa,aAAM;AAAA,EACnC,SAAgB,aAAa,aAAM;AAAA,EACnC,gBAAuB,aAAa,aAAM;AAAA,EAC1C,QAAe,gBAAgB,aAAM;AAAA,EACrC,cAAqB,gBAAgB,cAAO;AAAA,EAC5C,MAAa,gBAAgB,cAAO;AAAA,EACpC,MAAa,gBAAgB,cAAO;AAAA,EACpC,MAAa;AAAA,EACb,WAAkB,gBAAgB,UAAG;AAAA,EACrC,mBAA0B,gBAAgB,UAAG;AAAA,EAC7C,mBAA0B;AAAA,EAC1B,kBAAyB;AAAA,EACzB,gBAAuB;AAAA,EACvB,QAAe;AACjB,CAAC;AAGM,IAAM,aAAoB,cAAO;AAAA,EACtC,SAAgB,gBAAgB,aAAa,aAAM,CAAC;AAAA,EACpD,SAAgB,gBAAgB,aAAa,aAAM,CAAC;AAAA,EACpD,gBAAuB,gBAAgB,aAAa,aAAM,CAAC;AAAA,EAC3D,MAAa,gBAAgB,UAAG;AAAA,EAChC,mBAA0B,gBAAgB,aAAM;AAAA,EAChD,kBAAyB,gBAAgB,UAAG;AAAA,EAC5C,mBAA0B,gBAAgB,UAAG;AAC/C,CAAC;;;AChCD,YAAYA,aAAY;AAEjB,IAAM,mBAAN,cAAsC,oBAA8B,EAAE,oBAAoB;AAAA,EAC/F,UAAiB;AAAA,EACjB,QAAe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AY,CAAC,WAAkB,aAAI,aAAY;AACpD,aAAe,eAAM,mBAAmB,OAAO,MAAM,CAAC,EAAE;AACxD,aAAW,QAAI,MAAM,EAAE;AAAA,IACzB,CAAC,CAAC;AAAA,EACJ;AACA,SAAO,OAAW,QAAI,IAAI;AAC5B,CAAC;;;ArBhMD,IAAM,MAAW,CAAC,QAAQ,YAAY,WAAW,QAAe,qBAAa,OAAO,CAAC;AAErF,IAAM,OAAa,gBAAS,kBAAkB,aAAa,cAAc,EAAE;AAAA,EACnE,oBAA0B,kBAAK;AACvC;AAEA,IAAM,OAAc,aAAI,aAAa;AACnC,QAAM,OAAO,OAAO,OAAO,EAAE,MAAM,QAAQ,IAAI,GAAG,MAAM,QAAQ,KAAK,MAAM,CAAC,GAAG,IAAI,CAAC;AACpF,SAAc,cAAK,MAAM;AACvB,YAAQ,WAAW;AAAA,EACrB,CAAC;AACH,CAAC,EAAE,KAAY,iBAAQ,IAAI,CAAC;AAEhB,oBAAQ,IAAI;",
6
+ "names": ["Schema", "Schema", "result", "skipped", "relative", "Effect", "Schema", "fn", "succeed", "fail", "catchTag", "error", "gen", "die", "make", "layer", "error", "fn", "result", "effect", "name", "symbol", "bounded", "values", "field", "types", "finite", "value", "fn", "error", "generated", "result", "Effect", "Layer", "Path", "Stream", "Schema", "error", "effect", "git", "root", "relative", "dir", "from", "to", "ignored", "Clock", "Console", "Effect", "Clock", "Schema", "ChildProcess", "ChildProcessSpawner", "Console", "Context", "Effect", "FileSystem", "Schema", "probe", "pids", "live", "error", "Record", "signal", "effect", "result", "match", "effect", "Effect", "Layer", "FileSystem", "Path", "Stream", "Schema", "Scope", "pathToFileURL", "ChildProcess", "ChildProcessSpawner", "createEffectActor", "send", "setupEffect", "Clock", "Effect", "Console", "FileSystem", "Schema", "probe", "error", "resolve", "result", "setupEffect", "createEffectActor", "fn", "close", "send", "run", "probe", "pending", "effect", "warn", "execute", "probe", "run", "error", "pathToFileURL", "effect", "calibration", "createEffectActor", "createEffectLogic", "join", "send", "setupEffect", "types", "Effect", "Console", "Path", "Result", "Schema", "Scope", "Stream", "state", "effect", "createEffectLogic", "error", "result", "probe", "run", "setupEffect", "types", "send", "createEffectActor", "join", "Effect", "Layer", "Stream", "Console", "Effect", "FileSystem", "Path", "Schema", "Stream", "Effect", "FileSystem", "Path", "Schema", "Stream", "ChildProcess", "fail", "lines", "match", "error", "relative", "result", "error", "Clock", "Console", "Effect", "FileSystem", "Layer", "Path", "Schema", "Semaphore", "result", "down", "result", "result", "error", "relative", "lines", "Effect", "FileSystem", "Path", "Schema", "Stream", "ChildProcess", "error", "error", "skipped", "relative"]
7
7
  }