mutant-cafe 0.1.3 → 0.1.5

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"],
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 file: Schema.String,\n functionName: Schema.String,\n reason: Schema.String,\n});\nexport type NotMutated = typeof NotMutated.Type;\n\nexport const RunReport = Schema.Struct({\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});\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 interface Viability {\n readonly viable: boolean;\n readonly diagnostics: ReadonlyArray<string>;\n}\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 } 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 for (const fn of discovered.functions) {\n const generated = [...generateFunction(fn)];\n if (!generated.length) notMutated.push({ file: fn.file, functionName: fn.name, reason: fn.skipReason ?? `opaque return or no synthesizable value: ${fn.displayReturnType}` });\n mutants.push(...generated);\n }\n return { mutants, notMutated };\n },\n catch: (error) => loadError(config.tsconfig, error),\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.try({\n try: () => oracle.checkViable(mutant),\n catch: (error) => loadError(\"\", error),\n }),\n };\n}\n\nfunction loadError(tsconfig: string, error: unknown): ProgramLoadError {\n return Schema.is(ProgramLoadError)(error) ? error : new ProgramLoadError({\n tsconfig, diagnostics: [error instanceof Error ? error.message : String(error)],\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/** Pure generation over the oracle's compiler-independent description. */\nexport function* generateFunction(fn: MutableFunction): Generator<Mutant> {\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 switch (shape.kind) {\n case \"Effect\": {\n const succeed = api(\"Effect\", \"succeed\");\n if (succeed) {\n for (const value of shape.values) {\n if (!fn.equivalentValues.includes(value.text)) 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) yield candidate(\"EffectFail\", `${fail}(${error.text})`, error, `${fail}(${error.text}) [${error.synthetic ? \"synthetic tag cast\" : \"constructed error\"}]`);\n const value = shape.values[0];\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) {\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 if (original) 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 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 shape.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 shape.values) yield candidate(\"StreamOne\", `${make}(${value.text})`, value);\n if (fail) for (const error of shape.errors) 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) 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 shape.values) {\n if (shape.kind === \"Literal\" && 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) throw new ProgramLoadError({ tsconfig: this.configPath, diagnostics: [`File not loaded: ${mutant.file}`] });\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 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 diagnostics = [...mutated.getSyntacticDiagnostics(changed), ...mutated.getSemanticDiagnostics(changed)];\n return { viable: diagnostics.length === 0, diagnostics: diagnosticsText(diagnostics) };\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 visit = (node: ts.Node): void => {\n if (isFunction(node) && node.body && !mutable(node, checker)) {\n notMutated.push({ file, functionName: functionName(node, checker), reason: \"unsupported function position: callback, array element or curried implementation\" });\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) notMutated.push({ file, functionName: name, 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, reason: \"generic: naked or context-only type-parameter return\" });\n } else found.push({\n file, name, 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, 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) notMutated.push({ file, functionName: name, reason });\n else if (!config.functionFilter.length || config.functionFilter.some(filter => matchesGlob(name, filter))) {\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, 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 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 };\n },\n checkViable(mutant) {\n const session = owners.get(resolve(mutant.file));\n if (!session) throw new ProgramLoadError({ tsconfig: \"\", diagnostics: [\"Generate mutants before checking viability\"] });\n return session.check(mutant);\n },\n };\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 const printed = checker.typeToTypeNode(type, location, ts.NodeBuilderFlags.NoTruncation);\n if (!printed) return 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: valuesOf(success, checker, node), 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) : 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 values = shapes.flatMap((shape) => shape.kind === \"Effect\" ? shape.values : []);\n const errors = shapes.flatMap((shape) => shape.kind === \"Effect\" ? shape.errors : []);\n return { kind: \"Effect\",\n values: [...new Map(values.map((value) => [value.text, value])).values()].sort((a, b) => a.text.localeCompare(b.text, \"en\")),\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 const values = a ? valuesOf(a, checker, node) : [];\n if (detected.kind === \"Option\") return { kind: \"Option\", values };\n const errors = e ? taggedValues(e, checker, node) : [];\n if (detected.kind === \"Layer\") return { kind: \"Layer\", errors };\n return { kind: detected.kind, values, errors };\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 values = valuesOf(type, checker, node);\n if (isFunction(node)) for (const parameter of node.parameters) {\n if (ts.isIdentifier(parameter.name) && !parameter.questionToken && !parameter.dotDotDotToken && checker.getTypeAtLocation(parameter) === type) {\n values.push({ text: parameter.name.text, synthetic: false });\n }\n }\n return { kind: boolean ? \"Boolean\" : literal ? \"Literal\" : \"Value\", values };\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 {\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.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 param = constructor.parameters[0];\n if (!param) return { text: `new ${visible.name}()`, synthetic: false };\n const fields = checker.getTypeOfSymbolAtLocation(param, location);\n if (fields.flags & (ts.TypeFlags.Void | ts.TypeFlags.Undefined)) return { text: `new ${visible.name}()`, synthetic: false };\n const value = valuesOf(fields, checker, location)[0];\n if (value && !value.synthetic) {\n const rest = param.valueDeclaration && ts.isParameter(param.valueDeclaration) && param.valueDeclaration.dotDotDotToken;\n return { text: `new ${visible.name}(${rest ? \"...\" : \"\"}${value.text})`, synthetic: false };\n }\n }\n }\n }\n return { text: `({ _tag: ${JSON.stringify(tag)} } as unknown as ${checker.typeToString(type, location, ts.TypeFormatFlags.NoTruncation)})`, synthetic: true };\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 const print = (t: ts.Type) => checker.typeToString(t, node, ts.TypeFormatFlags.NoTruncation);\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 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 (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 detected = family(type, checker);\n const valueType = detected?.args[0] ?? type;\n for (const field of valueType.getProperties()) {\n if (!(field.flags & ts.SymbolFlags.Optional) && !valuesOf(checker.getTypeOfSymbolAtLocation(field, node), checker, node).length) {\n return `no synthesizable value for field ${field.name}`;\n }\n }\n return `opaque return: ${checker.typeToString(type, node)}`;\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, depth = 0): Value[] {\n if (depth > 4 || type.flags & ts.TypeFlags.Never) return [];\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 ? valuesOf(inner, checker, location, depth + 1) : [];\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 // Only brand primitive intersections; never fabricate arbitrary structural intersections.\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 valuesOf(primitive, checker, location, depth + 1).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()) return [...type.types].sort((a, b) => a.isNumberLiteral() && b.isNumberLiteral() ? a.value - b.value : checker.typeToString(a).localeCompare(checker.typeToString(b), \"en\")).flatMap((member) => valuesOf(member, checker, location, depth + 1));\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) => valuesOf(t, checker, location, depth + 1)[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 ? valuesOf(element, checker, location, depth + 1) : [];\n return [value(\"[]\"), ...elements.map((v) => ({ text: `[${v.text}]`, synthetic: v.synthetic }))];\n }\n if (type.flags & ts.TypeFlags.Object && !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 = valuesOf(checker.getTypeOfSymbolAtLocation(prop, location), checker, location, depth + 1);\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 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(`({ ${fields.map(field => {\n const v = (field === changed ? replacement! : field.values[0]!).text;\n return `${JSON.stringify(field.name)}: ${literalFields.includes(field) ? `(${v} as const)` : v}`;\n }).join(\", \")} })`);\n const anonymous = !type.aliasSymbol && (!type.getSymbol() || [\"__type\", \"__object\"].includes(type.getSymbol()!.name));\n return [render(), ...(anonymous ? literalFields.flatMap(field => field.values.slice(1).map(v => render(field, v))) : [])];\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 if (timeoutMs === undefined) yield* Console.log(`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, 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}\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,\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 } }) => 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.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 // copying -> baseline -> generating -> 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 }) }\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\n },\n output: ({ context }) => context,\n initial: \"copying\",\n on: {\n CANCEL: { target: \".interrupted\" },\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: \"generating\", 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: \"testing\", 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 }),\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, MutantSource, Reporter, RunConfig, type BaselineFailed, type Mutant, type ProgramLoadError, type 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\";\n\nexport class UsageError extends Schema.TaggedError<UsageError>()(\"UsageError\", { message: Schema.String }) {}\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 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 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 inDiff = Option.getOrUndefined(input.inDiff);\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 ? { mutants: generated, notMutated: skipped }\n : yield* selectDiffScope({ root, diffPath: inDiff, mutants: generated, notMutated: skipped });\n const { mutants, notMutated } = selected;\n if (input.list) {\n for (const mutant of mutants) yield* Console.log(mutantLine(mutant, config.root, path));\n const counts = new Map<string, number>();\n for (const mutant of mutants) {\n const file = path.relative(root, path.resolve(root, mutant.file));\n counts.set(file, (counts.get(file) ?? 0) + 1);\n }\n for (const [file, count] of [...counts].sort(([a], [b]) => a.localeCompare(b))) yield* Console.log(`${file}: ${count} mutants`);\n yield* Console.log(`${mutants.length} mutants total; ${notMutated.length} not mutated`);\n if (options.onExit !== undefined) yield* options.onExit(0);\n return;\n }\n const reporter = yield* makeReporter({ root, outDir: config.outDir, mutants, notMutated });\n const report = yield* options.run(config, mutants).pipe(Effect.provideService(Reporter, reporter));\n yield* reporter.write(report);\n if (options.onExit !== undefined) yield* options.onExit(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.3\" })(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 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 = 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\";\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}) {\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.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 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 encoded = yield* jsonReport(report).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 (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 yield* Console.log(outcomes.map((outcome) => `${report.results.filter((result) => result.outcome === outcome).length} ${outcome}`).join(\", \") + `; ${options.notMutated?.length ?? 0} not mutated; ${(elapsed / 1000).toFixed(2)}s`);\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"],
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,E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,EACJ;AACA,SAAO,OAAW,QAAI,IAAI;AAC5B,CAAC;;;AZ3GD,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,YAAI,aAAa;AACnC,QAAM,OAAO,OAAO,OAAO,EAAE,MAAM,QAAQ,IAAI,GAAG,MAAM,QAAQ,KAAK,MAAM,CAAC,GAAG,IAAI,CAAC;AACpF,SAAc,aAAK,MAAM;AACvB,YAAQ,WAAW;AAAA,EACrB,CAAC;AACH,CAAC,EAAE,KAAY,gBAAQ,IAAI,CAAC;AAEhB,oBAAQ,IAAI;",
6
- "names": ["Schema", "Schema", "Schema", "fn", "succeed", "fail", "catchTag", "error", "die", "gen", "make", "layer", "fn", "result", "effect", "name", "symbol", "values", "error", "fn", "error", "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", "error", "relative", "lines", "error", "skipped"]
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,EACb,WAAkB,gBAAgB,UAAG;AAAA,EACrC,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;AAC9C,CAAC;;;AC1BD,YAAYA,aAAY;AAEjB,IAAM,mBAAN,cAAsC,oBA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AI;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"]
7
7
  }