@opsydyn/oxlint-effect 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["call"],"sources":["../src/effect-version.ts","../src/index.ts"],"sourcesContent":["export type EffectVersion = 3 | 4;\n\nexport function effectVersionFor(options: readonly unknown[]): EffectVersion {\n const first = options[0];\n if (typeof first !== \"object\" || first === null || !Object.hasOwn(first, \"effectVersion\")) return 4;\n const value = (first as Record<string, unknown>).effectVersion;\n if (value === 3 || value === 4) return value;\n throw new Error(\"effectVersion must be 3 or 4\");\n}\n\nexport function withEffectVersionSchema(schema: readonly unknown[]): readonly unknown[] {\n const first = schema[0] as { properties?: Record<string, unknown> } | undefined;\n return [{\n type: \"object\",\n additionalProperties: false,\n ...first,\n properties: { ...first?.properties, effectVersion: { type: \"integer\", enum: [3, 4] } },\n }, ...schema.slice(1)];\n}\n\n// Compact runtime projection; tests require exact agreement with the evidence inventory.\nexport const versionSensitiveRules = [\n \"no-react-state\",\n \"no-runtime-runfork\",\n \"no-or-die-outside-boundary\",\n \"no-inline-runtime-provide\",\n \"no-console-in-effect-flow\",\n \"no-effect-log-without-structured-context\",\n \"require-span-on-public-service-method\",\n \"no-runpromise-in-non-async-test-body\",\n \"require-effect-flip-for-error-test\",\n \"no-test-mock-layer-when-default-available\",\n \"prefer-pipe-for-behavior\",\n \"prefer-decorated-effect-before-gen\",\n \"no-workflow-in-behavior-pipe\",\n \"no-mixed-pillar-function\",\n \"no-clever-effect-expression\",\n \"prefer-effect-service\",\n \"no-layer-provide-in-service-definition\",\n \"require-service-accessors\",\n \"require-service-dependencies\",\n \"no-manual-service-object-export\",\n \"no-layer-merge-in-request-handler\",\n \"no-service-method-returning-promise\",\n \"prefer-layer-pipe\",\n \"no-inline-layer-provide-in-program\",\n \"prefer-layer-mergeall-for-infrastructure\",\n \"no-service-layer-scatter\",\n \"no-json-parse-without-schema\",\n \"no-date-now-in-effect\",\n \"no-effect-all-step-sequencing\",\n \"no-async-effect-combinator-callback\",\n \"no-throw-in-effect-logic\",\n \"no-swallowed-catch-all\",\n \"no-try-catch-in-effect-logic\",\n \"no-promise-api-in-effect-logic\",\n \"no-wrapgraphql-catchall\",\n \"no-naked-object-state-update\",\n \"no-early-catchall-null\",\n \"no-exception-domain-error\",\n \"no-expected-state-as-error\",\n \"no-catchall-generic-rethrow\",\n \"no-log-only-error-handling\",\n \"no-fromnullable-nullish-coalesce\",\n \"no-model-overlay-cast\",\n \"no-string-sentinel-return\",\n \"no-string-sentinel-const\",\n \"prefer-gen-for-workflow\",\n \"no-business-logic-in-pipe\",\n \"no-flatmap-ladder\",\n \"no-effect-side-effect-wrapper\",\n \"no-ternary\",\n \"no-return-in-arrow\",\n \"no-branch-in-object\",\n \"no-hidden-effect-execution\",\n \"no-boundary-try-catch-without-effect-map\",\n \"no-run-effect-outside-boundary\",\n \"no-effect-async\",\n \"no-effect-fn-generator\",\n \"no-nested-effect-gen\",\n \"no-yield-without-star-in-effect-gen\",\n \"no-effect-orElse-ladder\",\n \"no-fire-and-forget-fork\",\n \"no-fork-in-loop\",\n \"no-race-without-cleanup\",\n \"no-unobserved-fiber\",\n \"no-blocking-call-in-effect\",\n \"no-promise-concurrency-in-effect\",\n \"no-shared-mutable-state-across-fibers\",\n \"no-timeout-with-noninterruptible-promise\",\n \"no-uninterruptible-concurrent-region\",\n \"no-unbounded-queue-or-pubsub\",\n \"no-global-mutable-concurrency-state\",\n \"no-manual-deferred-coordination\",\n \"no-acquire-without-scoped-release\",\n \"no-manual-resource-close\",\n \"no-unbound-scope\",\n \"no-resource-succeed-escape\",\n \"no-resource-without-acquire-release\",\n \"no-request-scoped-long-lived-resource\",\n \"no-global-resource-singleton\",\n \"no-run-with-open-resource\",\n \"no-nested-acquire-release\",\n \"no-missing-layer-provision-at-run\",\n \"no-yield-with-held-semaphore-permit\",\n \"no-yield-with-held-mutable-ref\",\n \"no-unscoped-background-fiber\",\n] as const;\n\nexport const legacyOnlyRules = [\n \"no-runtime-runfork\",\n \"require-service-accessors\",\n \"require-service-dependencies\",\n \"no-effect-async\",\n \"no-effect-orElse-ladder\",\n] as const;\n","import { definePlugin, defineRule } from \"@oxlint/plugins\";\nimport { effectVersionFor, legacyOnlyRules, versionSensitiveRules, withEffectVersionSchema } from \"./effect-version.ts\";\nimport type { EffectVersion } from \"./effect-version.ts\";\nexport type { EffectVersion } from \"./effect-version.ts\";\nimport type { RuleOptionsSchema } from \"@oxlint/plugins\";\nimport type { Context as OxlintContext, ESTree } from \"@oxlint/plugins\";\n\ntype Node = {\n type?: string;\n [key: string]: unknown;\n};\n\nfunction isObjectValue(value: unknown): value is Node {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction isIdentifier(node: unknown, name?: string): node is Node & { name: string } {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"Identifier\" &&\n typeof (node as Node).name === \"string\" &&\n (name === undefined || (node as Node).name === name)\n );\n}\n\nfunction isMemberExpression(node: unknown, objectName: string, propertyName: string): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const member = node as Node;\n return (\n member.type === \"MemberExpression\" &&\n member.computed !== true &&\n isIdentifier(member.object, objectName) &&\n isIdentifier(member.property, propertyName)\n );\n}\n\nfunction isEffectMemberCall(node: unknown): node is Node & { arguments: unknown[] } {\n return isMemberCall(node, \"Effect\") && Array.isArray((node as Node).arguments);\n}\n\nfunction firstArgument(node: Node & { arguments: unknown[] }): unknown {\n return node.arguments[0];\n}\n\nfunction isEffectMemberCallNamed(\n node: unknown,\n propertyName: string,\n): node is Node & { arguments: unknown[] } {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n const callee = node.callee as Node;\n return isIdentifier((callee.property as Node | undefined), propertyName);\n}\n\nfunction hasDeepNestedEffectFirstArgument(node: unknown): node is Node & { arguments: unknown[] } {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n const inner = firstArgument(node);\n if (!isEffectMemberCall(inner)) {\n return false;\n }\n\n return isEffectMemberCall(firstArgument(inner));\n}\n\nfunction hasNestedEffectCallArgument(node: unknown): node is Node & { arguments: unknown[] } {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n return node.arguments.slice(0, 2).some((argument) => isEffectMemberCall(argument));\n}\n\nfunction containsEffectMemberCallNamed(\n node: unknown,\n propertyName: string,\n seen = new WeakSet<object>(),\n): boolean {\n return findNode(node, (node) => isEffectMemberCallNamed(node, propertyName), seen) !== undefined;\n}\n\nfunction getFlatMapLadderMessage(node: unknown, version: EffectVersion): string | undefined {\n if (\n (isEffectMemberCallNamed(node, \"flatMap\") || (version === 4 && isEffectMemberCallNamed(node, \"flatMapEager\"))) &&\n (containsEffectMemberCallNamed(node.arguments, \"flatMap\") || (version === 4 && containsEffectMemberCallNamed(node.arguments, \"flatMapEager\")))\n ) {\n return \"Rule: avoid nested Effect.flatMap. Why: it hides sequencing and pushes laddered control flow. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.\";\n }\n\n if (\n isEffectMemberCallNamed(node, \"flatten\") &&\n containsEffectMemberCallNamed(firstArgument(node), \"map\")\n ) {\n return \"Rule: avoid map+flatten ladders. Why: they hide sequencing. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.\";\n }\n\n return undefined;\n}\n\nconst orElseSequencingCalls = [\"flatMap\", \"zipRight\", \"as\", \"tap\"] as const;\n\nfunction hasOrElseSequencingFirstArgument(node: unknown): node is Node & { arguments: unknown[] } {\n if (!isEffectMemberCallNamed(node, \"orElse\")) {\n return false;\n }\n\n const first = firstArgument(node);\n return orElseSequencingCalls.some((propertyName) => (\n containsEffectMemberCallNamed(first, propertyName)\n ));\n}\n\nfunction isPipeCall(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n if (call.type !== \"CallExpression\") {\n return false;\n }\n\n if (isIdentifier(call.callee, \"pipe\")) {\n return true;\n }\n\n const callee = call.callee;\n return (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).property, \"pipe\")\n );\n}\n\nfunction containsPipeCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isPipeCall(node), seen) !== undefined;\n}\n\nfunction isArrowIifeCall(node: unknown): node is Node & { callee: Node; arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n Array.isArray(call.arguments) &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"ArrowFunctionExpression\"\n );\n}\n\nfunction isInlineFunctionIifeCall(node: unknown): node is Node & { callee: Node; arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n Array.isArray(call.arguments) &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n ((call.callee as Node).type === \"ArrowFunctionExpression\" ||\n (call.callee as Node).type === \"FunctionExpression\")\n );\n}\n\nfunction findArrowIifeCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n return findNode(node, isArrowIifeCall, seen);\n}\n\nfunction findReturnStatements(node: unknown, seen = new WeakSet<object>()): unknown[] {\n if (Array.isArray(node)) {\n return node.flatMap((child) => findReturnStatements(child, seen));\n }\n\n if (!isObjectValue(node)) {\n return [];\n }\n\n if (seen.has(node)) {\n return [];\n }\n seen.add(node);\n\n if ((node as Node).type === \"ReturnStatement\") {\n return [node];\n }\n\n return Object.entries(node).flatMap(([key, child]) => (\n key === \"parent\" ? [] : findReturnStatements(child, seen)\n ));\n}\n\nfunction isSchemaFilterCall(node: unknown, version: EffectVersion): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n const name = version === 3 ? \"filter\" : \"makeFilter\";\n return (\n call.type === \"CallExpression\" &&\n (isMemberExpression(call.callee, \"S\", name) ||\n isMemberExpression(call.callee, \"Schema\", name))\n );\n}\n\nfunction directArrowCallbackReturns(node: unknown, version: EffectVersion): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const call = node as Node;\n if (call.type !== \"CallExpression\" || !Array.isArray(call.arguments) || isSchemaFilterCall(call, version)) {\n return [];\n }\n\n return call.arguments.flatMap((argument) => {\n if (\n !isObjectValue(argument) ||\n (argument as Node).type !== \"ArrowFunctionExpression\"\n ) {\n return [];\n }\n\n const body = (argument as Node).body;\n if (!isObjectValue(body) || (body as Node).type !== \"BlockStatement\") {\n return [];\n }\n\n return findReturnStatements(body);\n });\n}\n\nfunction directFunctionCallbackReturns(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const call = node as Node;\n if (call.type !== \"CallExpression\" || !Array.isArray(call.arguments)) {\n return [];\n }\n\n return call.arguments.flatMap((argument) => {\n if (\n !isObjectValue(argument) ||\n (argument as Node).type !== \"FunctionExpression\" ||\n (argument as Node).generator === true\n ) {\n return [];\n }\n\n return findReturnStatements((argument as Node).body);\n });\n}\n\nfunction isGeneratorFunctionExpression(node: unknown): node is Node & { body: unknown } {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"FunctionExpression\" &&\n (node as Node).generator === true\n );\n}\n\nfunction getEffectGeneratorArgument(\n node: unknown,\n propertyName: \"fn\" | \"gen\",\n version: EffectVersion = 3,\n): (Node & { body: unknown }) | undefined {\n const namedFn = version === 4 && propertyName === \"fn\" && isObjectValue(node)\n && (node as Node).type === \"CallExpression\" && isEffectMemberCallNamed((node as Node).callee, \"fn\");\n if (!isEffectMemberCallNamed(node, propertyName) && !namedFn) {\n return undefined;\n }\n\n const fn = version === 4 ? ((node as Node).arguments as unknown[]).find(isGeneratorFunctionExpression) : firstArgument(node as Node & { arguments: unknown[] });\n return isGeneratorFunctionExpression(fn) ? fn : undefined;\n}\n\nfunction isEffectGeneratorCall(node: unknown, propertyName: \"fn\" | \"gen\", version: EffectVersion = 3): boolean {\n return getEffectGeneratorArgument(node, propertyName, version) !== undefined;\n}\n\nconst effectConstructionBoundaries = new Set([\"gen\", \"sync\", \"try\", \"tryPromise\", \"fn\"]);\n\nfunction isEffectConstructionBoundary(node: unknown, version: EffectVersion = 3): node is Node & { arguments: unknown[] } {\n if (isEffectMemberCall(node)) {\n const property = (node.callee as Node).property;\n if (isIdentifier(property) && (effectConstructionBoundaries.has(property.name) ||\n (version === 4 && (property.name === \"fnUntraced\" || property.name === \"fnUntracedEager\")))) {\n return true;\n }\n }\n\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return call.type === \"CallExpression\" && isEffectMemberCallNamed(call.callee, \"fn\");\n}\n\nfunction isDateNowCall(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"CallExpression\" &&\n isMemberExpression((node as Node).callee, \"Date\", \"now\")\n );\n}\n\nfunction findYieldWithoutStarInEffectGen(node: unknown, version: EffectVersion): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\", version);\n return generator ? findEffectLogicNode(node, version, (child) => isObjectValue(child) && (child as Node).type === \"YieldExpression\" && (child as Node).delegate !== true) : undefined;\n}\n\nfunction findPipedYields(node: unknown, seen = new WeakSet<object>()): unknown[] {\n if (Array.isArray(node)) {\n return node.flatMap((child) => findPipedYields(child, seen));\n }\n\n if (!isObjectValue(node)) {\n return [];\n }\n\n if (seen.has(node)) {\n return [];\n }\n seen.add(node);\n\n if (\n (node as Node).type === \"YieldExpression\" &&\n (node as Node).delegate === true &&\n isPipeCall((node as Node).argument)\n ) {\n return [node];\n }\n\n return Object.entries(node).flatMap(([key, child]) => (\n key === \"parent\" ? [] : findPipedYields(child, seen)\n ));\n}\n\nfunction repeatedPipedYieldInEffectGen(node: unknown): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\");\n if (!generator) {\n return undefined;\n }\n\n const pipedYields = findPipedYields(generator.body);\n return pipedYields.length >= 2 ? pipedYields[1] : undefined;\n}\n\nfunction containsNodeType(node: unknown, type: string, seen = new WeakSet<object>()): boolean {\n if (Array.isArray(node)) {\n return node.some((child) => containsNodeType(child, type, seen));\n }\n\n if (!isObjectValue(node)) {\n return false;\n }\n\n if (seen.has(node)) {\n return false;\n }\n seen.add(node);\n\n if ((node as Node).type === type) {\n return true;\n }\n\n return Object.entries(node).some(([key, child]) => (\n key !== \"parent\" && containsNodeType(child, type, seen)\n ));\n}\n\nfunction containsIdentifierNamed(node: unknown, name: string, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isIdentifier(node, name), seen) !== undefined;\n}\n\nfunction containsEffectMemberCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isEffectMemberCall(node), seen) !== undefined;\n}\n\nfunction singleYieldVariableName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return undefined;\n }\n\n const declarations = (node as Node).declarations;\n if (!Array.isArray(declarations) || declarations.length !== 1) {\n return undefined;\n }\n\n const declaration = declarations[0];\n if (\n !isObjectValue(declaration) ||\n (declaration as Node).type !== \"VariableDeclarator\" ||\n !isIdentifier((declaration as Node).id) ||\n typeof (declaration as Node).init !== \"object\" ||\n (declaration as Node).init === null ||\n ((declaration as Node).init as Node).type !== \"YieldExpression\" ||\n ((declaration as Node).init as Node).delegate !== true\n ) {\n return undefined;\n }\n\n return ((declaration as Node).id as Node & { name: string }).name;\n}\n\nfunction isPureMappingReturn(node: unknown, yieldedName: string): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"ReturnStatement\") {\n return false;\n }\n\n const argument = (node as Node).argument;\n return (\n argument !== undefined &&\n !isIdentifier(argument, yieldedName) &&\n !containsNodeType(argument, \"YieldExpression\") &&\n !containsNodeType(argument, \"AwaitExpression\") &&\n !containsEffectMemberCall(argument) &&\n !containsIdentifierNamed(argument, \"Promise\")\n );\n}\n\nfunction genForMappingNode(node: unknown): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\");\n if (!generator || typeof generator.body !== \"object\" || generator.body === null) {\n return undefined;\n }\n\n const body = generator.body as Node;\n const statements = Array.isArray(body.body) ? body.body : [];\n if (statements.length !== 2) {\n return undefined;\n }\n\n const yieldedName = singleYieldVariableName(statements[0]);\n return yieldedName && isPureMappingReturn(statements[1], yieldedName)\n ? node\n : undefined;\n}\n\nconst workflowSequencingCombinators = new Set([\"andThen\", \"flatMap\", \"tap\", \"zipRight\"]);\n\nfunction pipeOperatorArguments(node: unknown): unknown[] {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return [];\n }\n\n const call = node as Node;\n const args = Array.isArray(call.arguments) ? call.arguments : [];\n if (isIdentifier(call.callee, \"pipe\")) {\n return args.slice(1);\n }\n\n const callee = call.callee;\n if (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).property, \"pipe\")\n ) {\n return args;\n }\n\n return [];\n}\n\nfunction isWorkflowSequencingOperator(node: unknown, version: EffectVersion = 3): boolean {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n const property = ((node.callee as Node).property as Node | undefined);\n return isIdentifier(property) && (version === 3\n ? workflowSequencingCombinators.has(property.name)\n : property.name === \"flatMapEager\" || (property.name !== \"zipRight\" && workflowSequencingCombinators.has(property.name)));\n}\n\nfunction workflowSequencingPipeline(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (!isPipeCall(node)) {\n return undefined;\n }\n\n const sequencingCount = pipeOperatorArguments(node)\n .filter((argument) => isWorkflowSequencingOperator(argument, version))\n .length;\n\n return sequencingCount >= 3 ? node : undefined;\n}\n\nfunction isFlowCall(node: unknown): node is Node & { arguments: unknown[] } {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"CallExpression\" &&\n Array.isArray((node as Node).arguments) &&\n isIdentifier((node as Node).callee, \"flow\")\n );\n}\n\nfunction isLargeFlowCall(node: unknown): boolean {\n return isFlowCall(node) && node.arguments.length >= 5;\n}\n\nfunction containsAsyncFunction(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isObjectValue(node) &&\n ((node as Node).type === \"ArrowFunctionExpression\" ||\n (node as Node).type === \"FunctionExpression\") &&\n (node as Node).async === true, seen) !== undefined;\n}\n\nfunction isEffectfulFlowArgument(node: unknown): boolean {\n return (\n containsEffectMemberCall(node) ||\n containsNodeType(node, \"YieldExpression\") ||\n containsNodeType(node, \"AwaitExpression\") ||\n containsAsyncFunction(node) ||\n containsConsoleCall(node) ||\n containsIdentifierNamed(node, \"Promise\") ||\n containsIdentifierNamed(node, \"Runtime\")\n );\n}\n\nfunction effectfulFlowArgument(node: unknown): unknown | undefined {\n if (!isFlowCall(node)) {\n return undefined;\n }\n\n return node.arguments.find((argument) => isEffectfulFlowArgument(argument));\n}\n\nfunction inlineNonTrivialFlowArgument(node: unknown): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n return (call.arguments ?? []).find((argument) => (\n isFlowCall(argument) && argument.arguments.length >= 3\n ));\n}\n\nconst pureTransformationImpureNames = new Set([\n \"Date\",\n \"Runtime\",\n \"fetch\",\n \"import\",\n \"queueMicrotask\",\n \"require\",\n \"setInterval\",\n \"setTimeout\",\n]);\n\nfunction pureTransformationCallName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const callee = (node as Node).callee;\n if (isIdentifier(callee)) {\n return callee.name;\n }\n\n if (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).property)\n ) {\n return ((callee as Node).property as Node & { name: string }).name;\n }\n\n return undefined;\n}\n\nfunction isPureTransformationCall(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const name = pureTransformationCallName(node);\n return (\n !containsEffectMemberCall(node) &&\n !containsNodeType(node, \"AwaitExpression\") &&\n !containsNodeType(node, \"YieldExpression\") &&\n !containsIdentifierNamed(node, \"Promise\") &&\n !containsConsoleCall(node) &&\n !pureTransformationImpureNames.has(name ?? \"\") &&\n !(\n typeof (node as Node).callee === \"object\" &&\n (node as Node).callee !== null &&\n isIdentifier(((node as Node).callee as Node).object, \"console\")\n )\n );\n}\n\nfunction pureTransformationCallDepth(node: unknown): number {\n if (!isPureTransformationCall(node)) {\n return 0;\n }\n\n const call = node as Node & { arguments?: unknown[]; callee?: unknown };\n const childDepth = [call.callee, ...(call.arguments ?? [])]\n .filter((child) => !isFunctionLike(child))\n .reduce<number>((maxDepth, child) => Math.max(maxDepth, pureTransformationCallDepth(child)), 0);\n return childDepth + 1;\n}\n\nfunction preferFlowForPurePipelineNode(node: unknown): unknown | undefined {\n if (pureTransformationCallDepth(node) < 3) {\n return undefined;\n }\n\n const parent = isObjectValue(node) ? (node as Node).parent : undefined;\n return isPureTransformationCall(parent) ? undefined : node;\n}\n\nfunction businessLogicInPipeCallback(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (!isPipeCall(node)) {\n return undefined;\n }\n\n for (const part of pipeOperatorArguments(node)) {\n if (!isEffectMemberCallNamed(part, \"flatMap\") &&\n !(version === 4 && isEffectMemberCallNamed(part, \"flatMapEager\"))) {\n continue;\n }\n\n const callback = part.arguments.find(isFunctionLike);\n if (!callback) {\n continue;\n }\n\n const body = (callback as Node).body;\n const hasControlFlow = [\n \"IfStatement\",\n \"SwitchStatement\",\n \"ForStatement\",\n \"ForInStatement\",\n \"ForOfStatement\",\n \"WhileStatement\",\n \"DoWhileStatement\",\n ].some((type) => containsNodeType(body, type));\n const hasServiceRetrieval = findNode(body, isYieldedServiceDependency) !== undefined;\n const effectStepCount = findNodes(body, isEffectMemberCall).length;\n\n if (hasControlFlow || hasServiceRetrieval || effectStepCount >= 2) {\n return callback;\n }\n }\n\n return undefined;\n}\n\nconst behaviorDecorationOperators = new Set([\n \"annotateLogs\",\n \"as\",\n \"catchAll\",\n \"catchSome\",\n \"catchTag\",\n \"map\",\n \"mapBoth\",\n \"provide\",\n \"retry\",\n \"tap\",\n \"tapError\",\n \"timeout\",\n \"timeoutFail\",\n \"withSpan\",\n]);\n\nconst effect4RecoveryOperatorNames = [\n \"catch\", \"catchEager\", \"catchCause\", \"catchDefect\", \"catchIf\", \"catchFilter\",\n \"catchCauseIf\", \"catchCauseFilter\", \"catchTag\", \"catchTags\", \"catchReason\", \"catchReasons\",\n] as const;\nfunction isBehaviorDecorationOperator(node: unknown, version: EffectVersion = 3): boolean {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n const property = ((node.callee as Node).property as Node | undefined);\n if (!isIdentifier(property)) return false;\n const name = property.name;\n return version === 3 ? behaviorDecorationOperators.has(name)\n : (name !== \"catchAll\" && name !== \"catchSome\" && name !== \"timeoutFail\" && behaviorDecorationOperators.has(name)) ||\n (effect4RecoveryOperatorNames as readonly string[]).includes(name) || name === \"timeoutOption\" || name === \"timeoutOrElse\" || name === \"catchNoSuchElement\";\n}\n\nfunction isExistingEffectExpression(node: unknown): boolean {\n return isEffectMemberCall(node) || isPipeCall(node);\n}\n\nfunction staticBehaviorCall(node: unknown, version: EffectVersion): unknown | undefined {\n if (!isBehaviorDecorationOperator(node, version)) {\n return undefined;\n }\n\n const first = (node as Node & { arguments: unknown[] }).arguments[0];\n return isExistingEffectExpression(first) ? node : undefined;\n}\n\nfunction isBehaviorDecoratedYield(node: unknown, version: EffectVersion): boolean {\n if (\n !isObjectValue(node) ||\n (node as Node).type !== \"YieldExpression\" ||\n (node as Node).delegate !== true ||\n !isPipeCall((node as Node).argument)\n ) {\n return false;\n }\n\n return pipeOperatorArguments((node as Node).argument)\n .some((argument) => isBehaviorDecorationOperator(argument, version));\n}\n\nfunction repeatedDecoratedYieldInEffectGen(node: unknown, version: EffectVersion): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\", version);\n if (!generator) {\n return undefined;\n }\n\n const decoratedYields = findNodes(generator.body, (child) => isBehaviorDecoratedYield(child, version), new WeakSet<object>(), true, version === 4);\n return decoratedYields.length >= 2 ? decoratedYields[1] : undefined;\n}\n\nfunction workflowInBehaviorPipe(node: unknown, version: EffectVersion): unknown | undefined {\n if (!isPipeCall(node)) {\n return undefined;\n }\n\n const parts = pipeOperatorArguments(node);\n const hasBehaviorDecoration = parts.some((part) => isBehaviorDecorationOperator(part, version));\n if (!hasBehaviorDecoration) {\n return undefined;\n }\n\n const workflowCount = parts\n .filter((part) => isWorkflowSequencingOperator(part, version))\n .length;\n const hasEmbeddedControlFlow = parts.some((part) => (\n containsNodeType(part, \"IfStatement\") ||\n containsNodeType(part, \"SwitchStatement\") ||\n containsNodeType(part, \"ForStatement\") ||\n containsNodeType(part, \"ForInStatement\") ||\n containsNodeType(part, \"ForOfStatement\") ||\n containsNodeType(part, \"WhileStatement\")\n ));\n\n return workflowCount >= 2 || hasEmbeddedControlFlow ? node : undefined;\n}\n\ntype StylePillar = \"workflow\" | \"pure\" | \"behavior\" | \"layer\";\n\nfunction stylePillarsInNode(\n node: unknown,\n version: EffectVersion,\n pillars = new Set<StylePillar>(),\n seen = new WeakSet<object>(),\n): Set<StylePillar> {\n if (isEffectMemberCallNamed(node, \"gen\") || isWorkflowSequencingOperator(node, version)) {\n pillars.add(\"workflow\");\n }\n\n if (isFlowCall(node)) {\n pillars.add(\"pure\");\n }\n\n if (isBehaviorDecorationOperator(node, version)) {\n pillars.add(\"behavior\");\n }\n\n if (isMemberCall(node, \"Layer\") || isMemberExpression(node, \"Layer\", \"pipe\")) {\n pillars.add(\"layer\");\n }\n\n if (Array.isArray(node)) {\n for (const child of node) {\n stylePillarsInNode(child, version, pillars, seen);\n }\n return pillars;\n }\n\n if (!isObjectValue(node)) {\n return pillars;\n }\n\n if (seen.has(node)) {\n return pillars;\n }\n seen.add(node);\n\n for (const [key, child] of Object.entries(node)) {\n if (key !== \"parent\") {\n stylePillarsInNode(child, version, pillars, seen);\n }\n }\n\n return pillars;\n}\n\nfunction isFunctionLike(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (\n (node as Node).type === \"FunctionDeclaration\" ||\n (node as Node).type === \"FunctionExpression\" ||\n (node as Node).type === \"ArrowFunctionExpression\"\n )\n );\n}\n\nfunction mixedPillarFunctionNode(node: unknown, version: EffectVersion): unknown | undefined {\n if (!isFunctionLike(node)) {\n return undefined;\n }\n\n const body = (node as Node).body;\n return stylePillarsInNode(body, version).size >= 3 ? node : undefined;\n}\n\nfunction callExpressionDepth(node: unknown, seen = new WeakSet<object>()): number {\n if (Array.isArray(node)) {\n return node.reduce((maxDepth, child) => Math.max(maxDepth, callExpressionDepth(child, seen)), 0);\n }\n\n if (!isObjectValue(node)) {\n return 0;\n }\n\n if (seen.has(node)) {\n return 0;\n }\n seen.add(node);\n\n const childDepth = Object.entries(node).reduce((maxDepth, [key, child]) => (\n key === \"parent\" ? maxDepth : Math.max(maxDepth, callExpressionDepth(child, seen))\n ), 0);\n\n return (node as Node).type === \"CallExpression\" ? childDepth + 1 : childDepth;\n}\n\nfunction cleverEffectExpressionNode(node: unknown, version: EffectVersion): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const pillars = stylePillarsInNode(node, version);\n const hasWrapperTrick = isInlineFunctionIifeCall(node) || findArrowIifeCall(node) !== undefined;\n return pillars.size >= 2 && (callExpressionDepth(node) >= 4 || hasWrapperTrick) ? node : undefined;\n}\n\nfunction oversizedAnonymousConceptNode(node: unknown): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n for (const argument of call.arguments ?? []) {\n if (\n !isObjectValue(argument) ||\n !isFunctionLike(argument)\n ) {\n continue;\n }\n\n const body = (argument as Node).body;\n if (\n isObjectValue(body) &&\n (body as Node).type === \"BlockStatement\" &&\n Array.isArray((body as Node).body) &&\n ((body as Node).body as unknown[]).length >= 3\n ) {\n return argument;\n }\n }\n\n return undefined;\n}\n\nfunction calleeContainsEffectService(node: unknown, version: EffectVersion = 3): boolean {\n if (isMemberExpression(node, version === 3 ? \"Effect\" : \"Context\", \"Service\")) {\n return true;\n }\n\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n return calleeContainsEffectService((node as Node).callee, version);\n}\n\nfunction effectServiceOptionsObject(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n if (!calleeContainsEffectService(call.callee, version)) {\n return undefined;\n }\n\n return [...(call.arguments ?? [])]\n .reverse()\n .find((argument) => (\n isObjectValue(argument) &&\n (argument as Node).type === \"ObjectExpression\"\n ));\n}\n\nfunction effectServiceClassOptions(node: unknown): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"ClassDeclaration\") {\n return undefined;\n }\n\n return effectServiceOptionsObject((node as Node).superClass);\n}\n\nfunction serviceConstructionOptions(node: unknown, version: EffectVersion): unknown | undefined {\n if (version === 3) return effectServiceClassOptions(node);\n const kind = (node as Node | undefined)?.type;\n return effectServiceOptionsObject(kind === \"ClassDeclaration\" || kind === \"ClassExpression\" ? (node as Node).superClass : node, version);\n}\n\nfunction serviceConstructionImplementation(options: unknown, version: EffectVersion): unknown {\n return version === 3 ? objectPropertyValue(options, \"effect\") ?? objectPropertyValue(options, \"scoped\") : objectPropertyValue(options, \"make\");\n}\n\nfunction isContextTagCall(node: unknown): boolean {\n return isMemberCall(node, \"Context\", \"Tag\") || isMemberCall(node, \"Context\", \"GenericTag\");\n}\n\nfunction containsLayerProvideCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isMemberCall(node, \"Layer\", \"provide\"), seen) !== undefined;\n}\n\nfunction hasAccessorsTrue(options: unknown): boolean {\n return isBooleanLiteral(objectPropertyValue(options, \"accessors\"), true);\n}\n\nfunction namespaceEffectImport(node: unknown): unknown | undefined {\n if (!isEffectEcosystemImport(getImportSource(node) ?? \"\")) {\n return undefined;\n }\n\n const specifiers = isObjectValue(node) ? (node as Node).specifiers : undefined;\n return Array.isArray(specifiers)\n ? specifiers.find((specifier) => (\n isObjectValue(specifier) &&\n (specifier as Node).type === \"ImportNamespaceSpecifier\"\n ))\n : undefined;\n}\n\nfunction isYieldedServiceDependency(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"YieldExpression\" &&\n (node as Node).delegate === true &&\n isIdentifier((node as Node).argument) &&\n ((node as Node).argument as { name: string }).name.endsWith(\"Service\")\n );\n}\n\nfunction findNode(\n node: unknown,\n predicate: (node: unknown) => boolean,\n seen = new WeakSet<object>(),\n ownScope = false,\n): unknown | undefined {\n if (ownScope && (!isObjectValue(node) || seen.has(node) || isFunctionLike(node) ||\n (node as Node).type === \"ClassDeclaration\" || (node as Node).type === \"ClassExpression\")) return undefined;\n if (predicate(node)) {\n return node;\n }\n\n if (Array.isArray(node)) {\n for (const child of node) {\n const match = findNode(child, predicate, seen, ownScope);\n if (match) {\n return match;\n }\n }\n return undefined;\n }\n\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n if (seen.has(node)) {\n return undefined;\n }\n seen.add(node);\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n const match = findNode(child, predicate, seen, ownScope);\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction findNodes(\n node: unknown,\n predicate: (node: unknown) => boolean,\n seen = new WeakSet<object>(),\n stopAtMatch = false,\n ownScope = false,\n): unknown[] {\n if (ownScope && isFunctionLike(node)) return [];\n if (stopAtMatch && isObjectValue(node) && seen.has(node)) return [];\n const matches = predicate(node) ? [node] : [];\n if (stopAtMatch && matches.length) return matches;\n\n if (Array.isArray(node)) {\n return node.flatMap((child) => findNodes(child, predicate, seen, stopAtMatch, ownScope)).concat(matches);\n }\n\n if (!isObjectValue(node)) {\n return matches;\n }\n\n if (seen.has(node)) {\n return matches;\n }\n seen.add(node);\n\n return Object.entries(node).reduce<unknown[]>(\n (collected, [key, child]) => (\n key === \"parent\" ? collected : collected.concat(findNodes(child, predicate, seen, stopAtMatch, ownScope))\n ),\n matches,\n );\n}\n\nfunction serviceDependencyWithoutDeclaration(options: unknown): unknown | undefined {\n if (objectPropertyValue(options, \"dependencies\")) {\n return undefined;\n }\n\n return findNode(\n objectPropertyValue(options, \"effect\") ?? objectPropertyValue(options, \"scoped\"),\n isYieldedServiceDependency,\n );\n}\n\nfunction isLayerCompositionCall(node: unknown): boolean {\n if (!isMemberCall(node, \"Layer\")) {\n return false;\n }\n\n const property = ((node as Node).callee as Node).property;\n return isIdentifier(property) && (property.name === \"provide\" || property.name.startsWith(\"merge\"));\n}\n\nfunction isRequestHandler(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"FunctionDeclaration\") {\n return false;\n }\n\n const id = (node as Node).id;\n return isIdentifier(id) && /(handler|route|request)$/i.test(id.name);\n}\n\nfunction layerCompositionInRequestHandler(node: unknown): unknown | undefined {\n if (!isRequestHandler(node)) {\n return undefined;\n }\n\n return findNode((node as Node).body, isLayerCompositionCall) ? node : undefined;\n}\n\nfunction layerProvideCallTower(node: unknown): unknown | undefined {\n if (!isMemberCall(node, \"Layer\", \"provide\")) {\n return undefined;\n }\n\n return findNode(firstArgument(node as Node & { arguments: unknown[] }), (child) => (\n child !== node && isMemberCall(child, \"Layer\", \"provide\")\n ));\n}\n\nfunction isEffectOrLayerProvideCall(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"provide\") || isMemberCall(node, \"Layer\", \"provide\");\n}\n\nfunction inlineLayerProvideInProgram(node: unknown, version: EffectVersion = 3): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\", version) ??\n (version === 4 ? getEffectGeneratorArgument(node, \"fn\", version) : undefined);\n return generator ? (version === 4\n ? findOwnCallbackNode(generator.body, isEffectOrLayerProvideCall)\n : findNode(generator.body, isEffectOrLayerProvideCall)) : undefined;\n}\n\nfunction layerMergeChain(node: unknown): unknown | undefined {\n if (!isMemberCall(node, \"Layer\", \"merge\")) {\n return undefined;\n }\n\n return ((node as Node).arguments as unknown[] | undefined)\n ?.find((argument) => findNode(argument, (child) => (\n child !== node && isMemberCall(child, \"Layer\", \"merge\")\n )));\n}\n\nfunction isLayerLikeDeclarationName(node: unknown): boolean {\n return isIdentifier(node) && /(Layer|Live)$/.test(node.name);\n}\n\nfunction scatteredLayerProvideDeclaration(node: unknown): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return undefined;\n }\n\n return ((node as Node).declarations as unknown[] | undefined)\n ?.find((declarator) => (\n isObjectValue(declarator) &&\n isLayerLikeDeclarationName((declarator as Node).id) &&\n findNode((declarator as Node).init, isEffectOrLayerProvideCall)\n ));\n}\n\nfunction functionReturnsPromise(node: unknown, version: EffectVersion = 3): boolean {\n if (!isFunctionLike(node)) {\n return false;\n }\n\n if (isIdentifierTypeReference(returnTypeAnnotation(node), \"Promise\")) return true;\n if (version === 3) return findPromiseApiCall((node as Node).body) !== undefined;\n if ((node as Node).async === true) return true;\n const isPromise = (value: unknown) => isPromiseStaticApiCall(value) || isPromiseChainCall(value, version) ||\n (isObjectValue(value) && (value as Node).type === \"NewExpression\" && isIdentifier((value as Node).callee, \"Promise\"));\n const body = (node as Node).body;\n return isPromise(body) || findOwnCallbackNode(body, (child) => isObjectValue(child) &&\n (child as Node).type === \"ReturnStatement\" && isPromise((child as Node).argument)) !== undefined;\n}\n\nfunction isPromiseReturningProperty(node: unknown, version: EffectVersion = 3): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"Property\" &&\n functionReturnsPromise((node as Node).value, version)\n );\n}\n\nfunction promiseReturningServiceMethod(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 3) return findNode(node, isPromiseReturningProperty);\n // Inspect constructed shapes, not callback options inside Promise adapters.\n const seen = new WeakSet<object>();\n const inspect = (value: unknown): unknown | undefined => {\n if (!isObjectValue(value) || seen.has(value)) return undefined;\n seen.add(value);\n const current = value as Node;\n if (current.type === \"ObjectExpression\") return (current.properties as unknown[] | undefined)?.find((property) => isPromiseReturningProperty(property, version));\n if (isFunctionLike(value)) {\n const body = current.body as Node | undefined;\n if (body?.type !== \"BlockStatement\") return inspect(body);\n for (const returned of findNodes(body, (child) => isObjectValue(child) && (child as Node).type === \"ReturnStatement\", new WeakSet<object>(), true, true)) {\n const method = inspect((returned as Node).argument);\n if (method) return method;\n }\n return undefined;\n }\n const generator = getEffectGeneratorArgument(value, \"gen\", version) ?? getEffectGeneratorArgument(value, \"fn\", version);\n if (generator) return inspect(generator);\n const first = Array.isArray(current.arguments) ? current.arguments[0] : undefined;\n if (isEffectMemberCallNamed(value, \"succeed\") || isEffectMemberCallNamed(value, \"sync\")) return inspect(first);\n if (isPipeCall(value)) {\n const callee = current.callee as Node | undefined;\n return inspect(callee?.type === \"MemberExpression\" ? callee.object : first);\n }\n return undefined;\n };\n return inspect(objectPropertyValue(node, \"make\"));\n}\n\nfunction objectHasServiceMethod(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"ObjectExpression\") {\n return false;\n }\n\n const properties = (node as Node).properties;\n return Array.isArray(properties) && properties.some((propertyNode) => (\n isObjectValue(propertyNode) &&\n (propertyNode as Node).type === \"Property\" &&\n (isFunctionLike((propertyNode as Node).value) ||\n isEffectMemberCallNamed((propertyNode as Node).value, \"fn\"))\n ));\n}\n\nfunction manualServiceObjectExport(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const declaration = (node as Node).declaration;\n if (!isObjectValue(declaration)) {\n return undefined;\n }\n\n if ((declaration as Node).type !== \"VariableDeclaration\") {\n return undefined;\n }\n\n for (const declarator of ((declaration as Node).declarations as unknown[] | undefined) ?? []) {\n if (\n isObjectValue(declarator) &&\n isIdentifier((declarator as Node).id) &&\n ((declarator as Node).id as { name: string }).name.endsWith(\"Service\") &&\n objectHasServiceMethod((declarator as Node).init)\n ) {\n return declarator;\n }\n }\n\n return undefined;\n}\n\nfunction isAsyncFunctionCallback(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n ((node as Node).type === \"ArrowFunctionExpression\" ||\n (node as Node).type === \"FunctionExpression\") &&\n (node as Node).async === true\n );\n}\n\nconst effectAsyncCallbackCombinators = new Set([\n \"andThen\",\n \"catchAll\",\n \"catchTag\",\n \"filterOrFail\",\n \"flatMap\",\n \"forEach\",\n \"map\",\n \"orElse\",\n \"tap\",\n]);\n\nconst effect4LogicCallbackOperators = new Set([\n ...[...effectAsyncCallbackCombinators].filter((name) => name !== \"catchAll\" && name !== \"orElse\"),\n \"mapEager\",\n \"flatMapEager\",\n ...effect4RecoveryOperatorNames,\n]);\n\nfunction effectLogicCallbackOperators(version: EffectVersion): ReadonlySet<string> {\n return version === 3 ? effectAsyncCallbackCombinators : effect4LogicCallbackOperators;\n}\n\nfunction effectLogicCallbacks(node: unknown, version: EffectVersion): unknown[] {\n if (!isEffectMemberCall(node)) return [];\n const property = (node.callee as Node).property;\n if (!isIdentifier(property) || !effectLogicCallbackOperators(version).has(property.name)) return [];\n return node.arguments.flatMap((argument) => {\n if (isFunctionLike(argument)) return [argument];\n if (version === 4 && (property.name === \"catchTags\" || property.name === \"catchReasons\") && isObjectExpression(argument)) {\n return ((argument as Node).properties as Node[]).map((entry) => entry.value).filter(isFunctionLike);\n }\n return [];\n });\n}\n\nfunction findOwnCallbackNode(node: unknown, predicate: (node: unknown) => boolean): unknown | undefined {\n return findNode(node, predicate, new WeakSet<object>(), true);\n}\n\nfunction findAsyncEffectCombinatorCallback(node: unknown, version: EffectVersion): unknown | undefined {\n return effectLogicCallbacks(node, version).find(isAsyncFunctionCallback);\n}\n\nfunction findEffectLogicNode(node: unknown, version: EffectVersion, predicate: (child: unknown) => boolean): unknown | undefined {\n const search = version === 3 ? findNode : findOwnCallbackNode;\n const generator = getEffectGeneratorArgument(node, \"gen\", version);\n if (generator) return search(generator.body, predicate);\n for (const callback of effectLogicCallbacks(node, version)) {\n const match = search(callbackBody(callback), predicate);\n if (match) return match;\n }\n return undefined;\n}\n\nfunction findEffectStatement(node: unknown, version: EffectVersion, type: \"ThrowStatement\" | \"TryStatement\"): unknown | undefined {\n return findEffectLogicNode(node, version, (child) => isObjectValue(child) && (child as Node).type === type);\n}\n\nconst promiseStaticApiMethods = new Set([\"all\", \"allSettled\", \"any\", \"race\", \"reject\", \"resolve\"]);\n\nfunction isPromiseStaticApiCall(node: unknown): boolean {\n return isMemberCall(node, \"Promise\") && promiseStaticApiMethods.has(String((((node as Node).callee as Node).property as Node).name));\n}\n\nfunction isPromiseChainCall(node: unknown, version: EffectVersion = 3): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n const receiver = (callee as Node | undefined)?.object as Node | undefined;\n return (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n (version === 3 || isPromiseStaticApiCall(receiver) ||\n (receiver?.type === \"NewExpression\" && isIdentifier(receiver.callee, \"Promise\")) ||\n isPromiseChainCall(receiver, version)) &&\n (isIdentifier((callee as Node).property, \"then\") ||\n isIdentifier((callee as Node).property, \"catch\") ||\n isIdentifier((callee as Node).property, \"finally\"))\n );\n}\n\nfunction findPromiseApiCall(node: unknown): unknown | undefined {\n return findNode(node, (child) => isPromiseStaticApiCall(child) || isPromiseChainCall(child));\n}\n\nfunction findPromiseApiInEffectLogic(node: unknown, version: EffectVersion): unknown | undefined {\n return findEffectLogicNode(node, version, (child) => isPromiseStaticApiCall(child) || isPromiseChainCall(child, version));\n}\n\nconst promiseConcurrencyMethods = new Set([\"all\", \"allSettled\", \"any\", \"race\"]);\n\nfunction isPromiseConcurrencyCall(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n return (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).object, \"Promise\") &&\n isIdentifier((callee as Node).property) &&\n promiseConcurrencyMethods.has(((callee as Node).property as { name: string }).name)\n );\n}\n\nfunction findPromiseConcurrencyCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n if (Array.isArray(node)) {\n for (const child of node) {\n const match = findPromiseConcurrencyCall(child, seen);\n if (match) {\n return match;\n }\n }\n return undefined;\n }\n\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n if (seen.has(node)) {\n return undefined;\n }\n seen.add(node);\n\n if (isPromiseConcurrencyCall(node)) {\n return node;\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n const match = findPromiseConcurrencyCall(child, seen);\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction findPromiseConcurrencyInEffectLogic(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 4) {\n const callback = getEffectGeneratorArgument(node, \"fn\", version) ?? (isEffectMemberCallNamed(node, \"sync\") ? firstArgument(node) : undefined);\n return (callback ? findOwnCallbackNode(callbackBody(callback), isPromiseConcurrencyCall) : undefined) ?? findEffectLogicNode(node, version, isPromiseConcurrencyCall);\n }\n const generator = getEffectGeneratorArgument(node, \"gen\");\n if (generator) {\n return findPromiseConcurrencyCall(generator.body);\n }\n\n if (isEffectMemberCallNamed(node, \"sync\")) {\n const body = callbackBody(firstArgument(node));\n return body ? findPromiseConcurrencyCall(body) : undefined;\n }\n\n if (!isEffectMemberCall(node)) {\n return undefined;\n }\n\n const callee = node.callee as Node;\n const property = callee.property;\n if (!isIdentifier(property) || !effectAsyncCallbackCombinators.has(property.name)) {\n return undefined;\n }\n\n for (const argument of node.arguments) {\n const body = callbackBody(argument);\n const match = body ? findPromiseConcurrencyCall(body) : undefined;\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction callbackHasParameter(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const callback = node as Node;\n return (\n (callback.type === \"ArrowFunctionExpression\" || callback.type === \"FunctionExpression\") &&\n Array.isArray(callback.params) &&\n callback.params.length > 0\n );\n}\n\nfunction isCancellationAwareTryPromise(node: unknown): boolean {\n if (!isEffectMemberCallNamed(node, \"tryPromise\")) {\n return false;\n }\n\n const argument = firstArgument(node);\n if (callbackHasParameter(argument)) {\n return true;\n }\n\n return callbackHasParameter(objectPropertyValue(argument, \"try\"));\n}\n\nfunction isNoninterruptiblePromiseEffect(node: unknown): boolean {\n if (isEffectMemberCallNamed(node, \"promise\")) {\n return true;\n }\n\n return isEffectMemberCallNamed(node, \"tryPromise\") && !isCancellationAwareTryPromise(node);\n}\n\nconst effect4TimeoutMembers = new Set([\"timeout\", \"timeoutOption\", \"timeoutOrElse\"]);\n\nfunction pipeSource(node: Node): unknown {\n return isIdentifier(node.callee, \"pipe\") ? (node.arguments as unknown[])[0] : (node.callee as Node).object;\n}\n\nfunction noninterruptiblePromiseTimeoutNode(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 4) {\n let effect: unknown;\n if ([...effect4TimeoutMembers].some(name => isEffectMemberCallNamed(node, name))) effect = firstArgument(node as Node & { arguments: unknown[] });\n else if (isObjectValue(node) && (node as Node).type === \"CallExpression\" &&\n [...effect4TimeoutMembers].some(name => isEffectMemberCallNamed((node as Node).callee, name))) effect = firstArgument(node as Node & { arguments: unknown[] });\n else if (isPipeCall(node) && [...effect4TimeoutMembers].some(name => isEffectMemberCallNamed(((node as Node).arguments as unknown[]).at(-1), name))) effect = pipeSource(node as Node);\n if (isEffectMemberCallNamed(effect, \"promise\")) return callbackHasParameter(firstArgument(effect as Node & { arguments: unknown[] })) ? undefined : effect;\n return isEffectMemberCallNamed(effect, \"tryPromise\") && !isCancellationAwareTryPromise(effect) ? effect : undefined;\n }\n if (!isEffectMemberCallNamed(node, \"timeout\")) {\n return undefined;\n }\n\n const effect = firstArgument(node);\n return isNoninterruptiblePromiseEffect(effect) ? effect : undefined;\n}\n\nconst blockingSyncObjectNames = new Set([\"crypto\", \"fs\", \"zlib\"]);\n\nfunction isBlockingSyncCall(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n if (isIdentifier(callee)) {\n return callee.name.endsWith(\"Sync\");\n }\n\n if (\n !isObjectValue(callee) ||\n (callee as Node).type !== \"MemberExpression\" ||\n (callee as Node).computed === true ||\n !isIdentifier((callee as Node).object) ||\n !isIdentifier((callee as Node).property)\n ) {\n return false;\n }\n\n const objectName = ((callee as Node).object as { name: string }).name;\n const propertyName = ((callee as Node).property as { name: string }).name;\n return blockingSyncObjectNames.has(objectName) && propertyName.endsWith(\"Sync\");\n}\n\nfunction findBlockingSyncCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n if (Array.isArray(node)) {\n for (const child of node) {\n const match = findBlockingSyncCall(child, seen);\n if (match) {\n return match;\n }\n }\n return undefined;\n }\n\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n if (seen.has(node)) {\n return undefined;\n }\n seen.add(node);\n\n if (isBlockingSyncCall(node)) {\n return node;\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n const match = findBlockingSyncCall(child, seen);\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction findBlockingSyncCallInEffectLogic(node: unknown, version: EffectVersion = 3): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\", version) ?? (version === 4 ? getEffectGeneratorArgument(node, \"fn\", version) : undefined);\n const search = version === 4 ? (body: unknown) => findOwnCallbackNode(body, isBlockingSyncCall) : findBlockingSyncCall;\n if (generator) {\n return search(generator.body);\n }\n\n if (isEffectMemberCallNamed(node, \"sync\")) {\n const body = callbackBody(firstArgument(node));\n return body ? search(body) : undefined;\n }\n\n return undefined;\n}\n\nconst effectRunMethods = new Set([\n \"runCallback\",\n \"runFork\",\n \"runPromise\",\n \"runPromiseExit\",\n \"runSync\",\n \"runSyncExit\",\n]);\n\nfunction effectRunExecution(node: unknown, version: EffectVersion): { program: unknown; hasContext: boolean } | undefined {\n if (isEffectMemberCall(node)) {\n const property = (node.callee as Node).property;\n if (isIdentifier(property) && effectRunMethods.has(property.name)) {\n return { program: firstArgument(node), hasContext: false };\n }\n }\n if (version !== 4 || !isObjectValue(node) || (node as Node).type !== \"CallExpression\") return undefined;\n const factory = (node as Node).callee;\n if (!isEffectMemberCall(factory)) return undefined;\n const property = (factory.callee as Node).property;\n if (isIdentifier(property) && property.name.endsWith(\"With\") && effectRunMethods.has(property.name.slice(0, -4))) {\n return { program: firstArgument(node as Node & { arguments: unknown[] }), hasContext: true };\n }\n return undefined;\n}\n\nfunction isEffectRunCall(node: unknown, version: EffectVersion): boolean {\n return effectRunExecution(node, version) !== undefined;\n}\n\nfunction isEffectOrDieReference(node: unknown, version: EffectVersion): boolean {\n return (\n isMemberExpression(node, \"Effect\", \"orDie\") ||\n isEffectMemberCallNamed(node, \"orDie\") ||\n (version === 3 && (isMemberExpression(node, \"Effect\", \"orDieWith\") || isEffectMemberCallNamed(node, \"orDieWith\")))\n );\n}\n\nfunction findEffectOrDieOutsideBoundary(node: unknown, version: EffectVersion): unknown | undefined {\n if (isEffectOrDieReference(node, version)) {\n return node;\n }\n\n if (isPipeCall(node)) {\n return pipeParts(node).find((part) => isEffectOrDieReference(part, version));\n }\n\n return undefined;\n}\n\nfunction isSwallowedCatchAllBody(node: unknown, version: EffectVersion = 3): boolean {\n return (\n isEffectMemberCallNamed(node, \"succeed\") ||\n (isEffectMemberCallNamed(node, \"asVoid\") && (version === 3 || isSwallowedCatchAllBody(firstArgument(node as Node & { arguments: unknown[] }), version))) ||\n isEffectMemberCallNamed(node, \"ignore\") ||\n isEffectVoidMember(node)\n );\n}\n\nfunction getSwallowedCatchAllHandler(node: unknown, version: EffectVersion): unknown | undefined {\n if (version === 3) {\n if (!isEffectMemberCallNamed(node, \"catchAll\")) return undefined;\n const body = callbackBody(firstArgument(node));\n return isSwallowedCatchAllBody(body) ? body : undefined;\n }\n for (const callback of errorHandlerCallbacks(node, plainCatchOperators(version))) {\n const body = callbackBody(callback);\n if (isSwallowedCatchAllBody(body, version)) return body;\n for (const statement of handlerReturnStatements(body)) {\n if (isSwallowedCatchAllBody((statement as Node).argument, version)) return (statement as Node).argument;\n }\n }\n return undefined;\n}\n\nfunction isEffectIgnoreReference(node: unknown): boolean {\n return isMemberExpression(node, \"Effect\", \"ignore\") || isEffectMemberCallNamed(node, \"ignore\");\n}\n\nfunction findEffectIgnore(node: unknown): unknown | undefined {\n if (isEffectIgnoreReference(node)) {\n return node;\n }\n\n if (isPipeCall(node)) {\n return pipeParts(node).find((part) => isEffectIgnoreReference(part));\n }\n\n return undefined;\n}\n\nfunction isConsoleCall(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"MemberExpression\" &&\n (call.callee as Node).computed !== true &&\n isIdentifier((call.callee as Node).object, \"console\") &&\n isIdentifier((call.callee as Node).property)\n );\n}\n\nfunction consoleCallsInEffectFlow(node: unknown, version: EffectVersion = 3): unknown[] {\n if (isEffectConstructionBoundary(node, version)) {\n return findNodes((node as Node).arguments, isConsoleCall);\n }\n\n const options = serviceConstructionOptions(node, version);\n return options\n ? findNodes(\n serviceConstructionImplementation(options, version),\n isConsoleCall,\n )\n : [];\n}\n\nconst errorHandlingOperators = new Set([\"catchAll\", \"catchTag\", \"catchTags\", \"tapError\"]);\n\nfunction isStaticLogMessage(node: unknown): boolean {\n return isStringLiteral(node) || (\n isObjectValue(node) &&\n (node as Node).type === \"TemplateLiteral\"\n );\n}\n\nfunction isEffectErrorLogCall(node: unknown): node is Node & { arguments: unknown[] } {\n return isEffectMemberCallNamed(node, \"logError\") || isEffectMemberCallNamed(node, \"logWarning\");\n}\n\nfunction isObjectExpression(node: unknown): boolean {\n return isObjectValue(node) && (node as Node).type === \"ObjectExpression\";\n}\n\nfunction hasStructuredLogContext(candidate: unknown, logCall: Node & { arguments: unknown[] }): boolean {\n if (findNode(candidate, (node) => isEffectMemberCallNamed(node, \"annotateLogs\"))) {\n return true;\n }\n\n return logCall.arguments.slice(1).some((argument) => (\n isObjectExpression(argument) || !isStaticLogMessage(argument)\n ));\n}\n\nfunction contextlessErrorLogs(node: unknown): unknown[] {\n return findNodes(node, (candidate) => (\n isEffectErrorLogCall(candidate) &&\n isStaticLogMessage(firstArgument(candidate)) &&\n !hasStructuredLogContext(node, candidate)\n ));\n}\n\nfunction errorHandlerBodies(node: unknown, version: EffectVersion = 3): unknown[] {\n if (!isEffectMemberCall(node)) {\n return [];\n }\n\n const property = ((node as Node).callee as Node).property;\n if (!isIdentifier(property) || !(version === 3 ? errorHandlingOperators.has(property.name)\n : property.name === \"tapError\" || property.name === \"catchNoSuchElement\" || (effect4RecoveryOperatorNames as readonly string[]).includes(property.name))) {\n return [];\n }\n\n const arguments_ = (node as Node).arguments as unknown[];\n return (version === 4 ? arguments_.flatMap(argument =>\n (property.name === \"catchTags\" || property.name === \"catchReasons\") && isObjectExpression(argument)\n ? ((argument as Node).properties as Node[]).map(entry => entry.value).filter(isFunctionLike) : [argument]) : arguments_)\n .map(callbackBody)\n .filter((body): body is unknown => body !== undefined);\n}\n\nfunction isIdentifierCall(node: unknown, name: string): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return call.type === \"CallExpression\" && isIdentifier(call.callee, name);\n}\n\nfunction isMemberCall(node: unknown, objectName: string, propertyName?: string): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"MemberExpression\" &&\n (call.callee as Node).computed !== true &&\n isIdentifier((call.callee as Node).object, objectName) &&\n isIdentifier((call.callee as Node).property) &&\n (propertyName === undefined || isIdentifier((call.callee as Node).property, propertyName))\n );\n}\n\nfunction isEffectLogCall(node: unknown): boolean {\n return isMemberCall(node, \"Effect\") && (((node as Node).callee as Node).property as { name: string }).name.startsWith(\"log\");\n}\n\nfunction containsConsoleCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, isConsoleCall, seen) !== undefined;\n}\n\nfunction containsWrapperSideEffect(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isIdentifierCall(node, \"setState\") ||\n isMemberCall(node, \"Atom\", \"set\") ||\n isIdentifierCall(node, \"invalidate\") ||\n isEffectLogCall(node) ||\n isConsoleCall(node), seen) !== undefined;\n}\n\nfunction containsAllStepSideEffect(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isMemberCall(node, \"Ref\", \"set\") ||\n isMemberCall(node, \"Atom\", \"set\") ||\n isMemberCall(node, \"SubscriptionRef\", \"set\") ||\n isMemberCall(node, \"Reactivity\", \"invalidate\") ||\n isMemberCall(node, \"Fiber\", \"interrupt\") ||\n isEffectLogCall(node), seen) !== undefined;\n}\n\nfunction hasConcurrencyOne(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const object = node as Node;\n if (object.type !== \"ObjectExpression\" || !Array.isArray(object.properties)) {\n return false;\n }\n\n return object.properties.some((entry) => {\n if (!isObjectValue(entry)) {\n return false;\n }\n\n const prop = entry as Node;\n const key = prop.key;\n const value = prop.value as Node | undefined;\n return (\n ((isIdentifier(key, \"concurrency\")) ||\n (isObjectValue(key) && (key as Node).value === \"concurrency\")) &&\n isObjectValue(value) &&\n ((value.type === \"Literal\" || value.type === \"NumericLiteral\") && value.value === 1)\n );\n });\n}\n\nfunction hasConcurrencyOption(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const object = node as Node;\n if (object.type !== \"ObjectExpression\" || !Array.isArray(object.properties)) {\n return false;\n }\n\n return object.properties.some((entry) => {\n if (!isObjectValue(entry)) {\n return false;\n }\n\n const key = (entry as Node).key;\n return (\n isIdentifier(key, \"concurrency\") ||\n (isObjectValue(key) && (key as Node).value === \"concurrency\")\n );\n });\n}\n\nfunction isCollectionMapCall(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"MemberExpression\" &&\n (call.callee as Node).computed !== true &&\n isIdentifier((call.callee as Node).property, \"map\")\n );\n}\n\nfunction isUnboundedMappedEffectAll(node: unknown): boolean {\n return (\n isEffectMemberCallNamed(node, \"all\") &&\n isCollectionMapCall(firstArgument(node)) &&\n !hasConcurrencyOption((node as Node & { arguments: unknown[] }).arguments[1])\n );\n}\n\nfunction containsEffectForkCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n return findNode(node, child => isEffectMemberCallNamed(child, \"fork\"), seen);\n}\n\nfunction v4ForkConstruction(node: unknown): unknown | undefined {\n if (isEffectMemberCallNamed(node, \"forkChild\") || isEffectMemberCallNamed(node, \"forkDetach\")) return node;\n if (isObjectValue(node) && (node as Node).type === \"CallExpression\" &&\n (isEffectMemberCallNamed((node as Node).callee, \"forkChild\") || isEffectMemberCallNamed((node as Node).callee, \"forkDetach\"))) return node;\n if (!isPipeCall(node)) return undefined;\n const operator = ((node as Node).arguments as unknown[] | undefined)?.at(-1);\n if (isEffectMemberCallNamed(operator, \"forkChild\") || isEffectMemberCallNamed(operator, \"forkDetach\")) return operator;\n if (!isObjectValue(operator) || (operator as Node).type !== \"MemberExpression\") return undefined;\n const member = operator as Node;\n return member.computed !== true && isIdentifier(member.object, \"Effect\") &&\n (isIdentifier(member.property, \"forkChild\") || isIdentifier(member.property, \"forkDetach\")) ? operator : undefined;\n}\n\nfunction discardedFork(node: unknown, version: EffectVersion): unknown | undefined {\n if (version === 3) return isEffectMemberCallNamed(node, \"fork\") ? node : undefined;\n const expression = isObjectValue(node) && (node as Node).type === \"YieldExpression\"\n ? (node as Node).argument : node;\n return v4ForkConstruction(expression);\n}\n\nfunction containsEffectMemberCallInSet(\n node: unknown,\n propertyNames: ReadonlySet<string>,\n seen = new WeakSet<object>(),\n): boolean {\n return findNode(node, child => isEffectMemberCall(child) && isIdentifier((child.callee as Node).property) && propertyNames.has(((child.callee as Node).property as { name: string }).name), seen) !== undefined;\n}\n\nconst highRiskEffectMembers = new Set([\n \"sleep\",\n \"await\",\n \"promise\",\n \"tryPromise\",\n \"fork\",\n \"forkDaemon\",\n \"forkScoped\",\n \"all\",\n \"forEach\",\n \"race\",\n \"raceAll\",\n]);\n\nconst effectfulSynchronizedRefMembers = new Set([\n \"modifyEffect\",\n \"modifySomeEffect\",\n \"updateEffect\",\n \"updateAndGetEffect\",\n]);\n\nfunction containsHighRiskSuspension(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => (isEffectMemberCall(child) && isIdentifier((child.callee as Node).property) && highRiskEffectMembers.has(((child.callee as Node).property as { name: string }).name)) || isMemberCall(child, \"Queue\", \"take\") || isMemberCall(child, \"Deferred\", \"await\"), seen) !== undefined;\n}\n\nfunction isAnyObjectMemberCallNamed(node: unknown, propertyName: string): node is Node & { arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n Array.isArray(call.arguments) &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"MemberExpression\" &&\n (call.callee as Node).computed !== true &&\n isIdentifier((call.callee as Node).property, propertyName)\n );\n}\n\nfunction heldSemaphoreWork(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 4 && isPipeCall(node)) {\n const operator = ((node as Node).arguments as unknown[]).at(-1);\n return isAnyObjectMemberCallNamed(operator, \"withPermit\") || isAnyObjectMemberCallNamed(operator, \"withPermits\") ? pipeSource(node as Node) : undefined;\n }\n if (version === 4 && [node, isObjectValue(node) ? (node as Node).callee : undefined].some(call => isMemberCall(call, \"TSemaphore\", \"withPermit\") || isMemberCall(call, \"TSemaphore\", \"withPermits\"))) return undefined;\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n if (!Array.isArray(call.arguments)) {\n return undefined;\n }\n\n if (\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"CallExpression\"\n ) {\n const inner = call.callee as Node;\n if (\n (isAnyObjectMemberCallNamed(inner, \"withPermit\") || isAnyObjectMemberCallNamed(inner, \"withPermits\")) &&\n call.arguments.length > 0\n ) {\n return call.arguments[0];\n }\n }\n\n if (isMemberCall(call, \"TSemaphore\", \"withPermit\") || isMemberCall(call, \"TSemaphore\", \"withPermits\")) {\n return call.arguments[0];\n }\n\n if (isAnyObjectMemberCallNamed(call, \"withPermit\") || isAnyObjectMemberCallNamed(call, \"withPermits\")) {\n return call.arguments.at(-1);\n }\n\n return undefined;\n}\n\nfunction synchronizedRefModifierWork(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 4) {\n const operator = isPipeCall(node) ? ((node as Node).arguments as unknown[]).at(-1) : (node as Node)?.callee;\n const owner = [node, operator].find(call => isEffectfulSynchronizedRefCall(call, \"SynchronizedRef\") || isEffectfulSynchronizedRefCall(call, \"SubscriptionRef\"));\n if (owner) {\n const arguments_ = (owner as Node).arguments as unknown[];\n return owner !== node || arguments_.length > 1 ? arguments_.at(-1) : undefined;\n }\n return undefined;\n }\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n if (!Array.isArray(call.arguments)) {\n return undefined;\n }\n\n if (isEffectfulSynchronizedRefCall(call.callee, \"SynchronizedRef\") && call.arguments.length > 0) return ((call.callee as Node).arguments as unknown[]).at(-1);\n\n if (isEffectfulSynchronizedRefCall(call, \"SynchronizedRef\") && call.arguments.length > 1) {\n return call.arguments.at(-1);\n }\n\n if (isAnyEffectfulSynchronizedRefCall(call) && !isEffectfulSynchronizedRefCall(call, \"SynchronizedRef\")) {\n return call.arguments.at(-1);\n }\n\n return undefined;\n}\n\nfunction isEffectfulSynchronizedRefCall(node: unknown, objectName: string): boolean {\n return isAnyEffectfulSynchronizedRefCall(node) && isIdentifier(((node as Node).callee as Node).object, objectName);\n}\n\nfunction isAnyEffectfulSynchronizedRefCall(node: unknown): boolean {\n return [...effectfulSynchronizedRefMembers].some((propertyName) => isAnyObjectMemberCallNamed(node, propertyName));\n}\n\nconst deferredConstructorMembers = new Set([\"make\", \"unsafeMake\", \"makeUnsafe\"]);\nconst deferredTimeoutMembers = new Set([\n \"timeout\",\n \"timeoutOption\",\n \"timeoutFail\",\n \"timeoutFailCause\",\n \"timeoutTo\",\n]);\nconst deferredInterruptionMembers = new Set([\"race\", \"raceFirst\", \"raceAll\", \"interruptible\", \"scoped\"]);\n\nfunction isEffectMemberExpressionNamed(node: unknown, propertyName: string): boolean {\n return isMemberExpression(node, \"Effect\", propertyName);\n}\n\nfunction isDeferredConstructorCall(node: unknown): boolean {\n return isMemberCall(node, \"Deferred\") && deferredConstructorMembers.has((((node as Node).callee as Node).property as { name: string }).name);\n}\n\nfunction isDeferredAwaitCall(node: unknown): node is Node & { arguments: unknown[] } {\n return isMemberCall(node, \"Deferred\", \"await\") && Array.isArray((node as Node).arguments);\n}\n\nfunction deferredBindingName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclarator\") {\n return undefined;\n }\n\n const declaration = node as Node;\n if (!isIdentifier(declaration.id) || !findNode(declaration.init, isDeferredConstructorCall)) {\n return undefined;\n }\n\n return declaration.id.name;\n}\n\nfunction hasMatchingDeferredFinalizer(node: unknown, bindingName: string): boolean {\n return Boolean(findNode(node, (candidate) => {\n if (!isMemberCall(candidate, \"Effect\", \"addFinalizer\") && !isMemberCall(candidate, \"Scope\", \"addFinalizer\")) {\n return false;\n }\n\n const arguments_ = (candidate as Node & { arguments?: unknown[] }).arguments;\n return Array.isArray(arguments_) && arguments_.some((argument) => {\n const body = callbackBody(argument);\n return body !== undefined && containsIdentifierNamed(body, bindingName);\n });\n }));\n}\n\nfunction isEffectScopedPipeCall(node: unknown): boolean {\n if (!isPipeCall(node)) {\n return false;\n }\n\n const arguments_ = (node as Node & { arguments?: unknown[] }).arguments;\n return Array.isArray(arguments_) && arguments_.some((argument) => isEffectMemberExpressionNamed(argument, \"scoped\"));\n}\n\nfunction isDeferredAwaitProtected(node: unknown, bindingName: string, version: EffectVersion = 3, references: readonly { identifier: unknown }[] = []): boolean {\n let current = isObjectValue(node) ? (node as Node).parent : undefined;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) {\n return false;\n }\n seen.add(current);\n\n if (\n (isEffectMemberCall(current) && (() => {\n const property = ((current as Node).callee as Node).property;\n return isIdentifier(property) && (\n (version === 4 ? effect4TimeoutMembers.has(property.name) || v4RaceMembers.has(property.name) || property.name === \"interruptible\" || property.name === \"scoped\" : deferredTimeoutMembers.has(property.name) || deferredInterruptionMembers.has(property.name))\n );\n })()) ||\n (version === 3 ? isEffectScopedPipeCall(current) : isPipeCall(current) && (() => {\n const operator = ((current as Node).arguments as unknown[]).at(-1);\n return [...effect4TimeoutMembers, ...v4RaceMembers, \"interruptible\", \"scoped\"].some(name => isEffectMemberCallNamed(operator, name) || isEffectMemberExpressionNamed(operator, name));\n })()) ||\n (version === 4 && (current as Node).type === \"CallExpression\" && isEffectMemberCall((current as Node).callee) && (() => {\n const name = (((current as Node).callee as Node).callee as Node).property;\n return isIdentifier(name) && (effect4TimeoutMembers.has(name.name) || v4RaceMembers.has(name.name));\n })())\n ) {\n return true;\n }\n\n if (isFunctionLike(current)) {\n if (version === 3 ? hasMatchingDeferredFinalizer(current, bindingName) : references.some(reference => {\n for (let owner = (reference.identifier as Node).parent as Node | undefined; owner && nodeWithin(owner, current); owner = owner.parent as Node | undefined) {\n if (isMemberCall(owner, \"Effect\", \"addFinalizer\") || isMemberCall(owner, \"Scope\", \"addFinalizer\")) return true;\n }\n return false;\n })) return true;\n if (version === 4) {\n const parent = (current as Node).parent;\n if (getEffectGeneratorArgument(parent, \"gen\", 4) !== current && getEffectGeneratorArgument(parent, \"fn\", 4) !== current && !effectLogicCallbacks(parent, 4).includes(current)) return false;\n }\n }\n\n current = (current as Node).parent;\n }\n\n return false;\n}\n\nconst raceCleanupCalls = new Set([\n \"acquireRelease\",\n \"acquireUseRelease\",\n \"ensuring\",\n \"forkIn\",\n \"forkScoped\",\n \"scoped\",\n]);\n\nconst v4RaceMembers = new Set([\"race\", \"raceAll\", \"raceFirst\", \"raceAllFirst\"]);\n\nfunction isV4RaceMember(node: unknown): boolean {\n return [...v4RaceMembers].some(name => isEffectMemberCallNamed(node, name) || isEffectMemberExpressionNamed(node, name));\n}\n\nfunction v4RaceConstruction(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") return false;\n return isV4RaceMember(node) || isV4RaceMember((node as Node).callee) ||\n (isPipeCall(node) && isV4RaceMember(((node as Node).arguments as unknown[] | undefined)?.at(-1)));\n}\n\nfunction isEffectRaceWithoutCleanup(node: unknown, version: EffectVersion = 3): boolean {\n if (version === 4) {\n if (!v4RaceConstruction(node)) return false;\n const parent = (node as Node).parent;\n if (isObjectValue(parent) && v4RaceConstruction(parent) &&\n ((parent as Node).callee === node || (isPipeCall(parent) && ((parent as Node).arguments as unknown[] | undefined)?.at(-1) === node))) return false;\n const hasCleanup = (value: unknown) => findNode(value, candidate => [...raceCleanupCalls].some(name =>\n isEffectMemberCallNamed(candidate, name) || isEffectMemberExpressionNamed(candidate, name))) !== undefined;\n if (hasCleanup((node as Node).arguments) || hasCleanup(((node as Node).callee as Node | undefined)?.arguments)) return false;\n let current = parent;\n const seen = new WeakSet<object>();\n while (isObjectValue(current) && !seen.has(current)) {\n seen.add(current);\n if (isFunctionLike(current) &&\n getEffectGeneratorArgument((current as Node).parent, \"gen\", 4) !== current &&\n getEffectGeneratorArgument((current as Node).parent, \"fn\", 4) !== current &&\n !(isEffectMemberCallNamed((current as Node).parent, \"acquireUseRelease\") &&\n (((current as Node).parent as Node).arguments as unknown[] | undefined)?.[1] === current)) break;\n if (isEffectMemberCall(current) && raceCleanupCalls.has(((current.callee as Node).property as Node).name as string)) return false;\n if (isPipeCall(current) && hasCleanup((current as Node).arguments)) return false;\n current = (current as Node).parent;\n }\n return true;\n }\n if (!isEffectMemberCallNamed(node, \"race\") && !isEffectMemberCallNamed(node, \"raceAll\")) {\n return false;\n }\n\n return !containsEffectMemberCallInSet((node as Node & { arguments: unknown[] }).arguments, raceCleanupCalls);\n}\n\nfunction isUnboundedEffectForEach(node: unknown): boolean {\n return (\n isEffectMemberCallNamed(node, \"forEach\") &&\n !hasConcurrencyOption((node as Node & { arguments: unknown[] }).arguments[2])\n );\n}\n\nconst retryCalls = new Set([\"retry\"]);\n\nfunction isUnboundedConcurrentRetry(node: unknown): boolean {\n return (\n (isUnboundedMappedEffectAll(node) || isUnboundedEffectForEach(node)) &&\n containsEffectMemberCallInSet((node as Node & { arguments: unknown[] }).arguments, retryCalls)\n );\n}\n\nfunction variableDeclarationIdentifierNames(node: unknown): string[] {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return [];\n }\n\n const declarations = (node as Node).declarations;\n if (!Array.isArray(declarations)) {\n return [];\n }\n\n return declarations.flatMap((declaration) => {\n if (!isObjectValue(declaration)) {\n return [];\n }\n\n const id = (declaration as Node).id;\n return isIdentifier(id) ? [id.name] : [];\n });\n}\n\nfunction collectDeclaredIdentifierNames(\n node: unknown,\n names = new Set<string>(),\n seen = new WeakSet<object>(),\n): Set<string> {\n if (Array.isArray(node)) {\n for (const child of node) {\n collectDeclaredIdentifierNames(child, names, seen);\n }\n return names;\n }\n\n if (!isObjectValue(node)) {\n return names;\n }\n\n if (seen.has(node)) {\n return names;\n }\n seen.add(node);\n\n if ((node as Node).type === \"VariableDeclaration\") {\n for (const name of variableDeclarationIdentifierNames(node)) {\n names.add(name);\n }\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key !== \"parent\") {\n collectDeclaredIdentifierNames(child, names, seen);\n }\n }\n\n return names;\n}\n\nconst mutatingCollectionMethods = new Set([\n \"add\",\n \"clear\",\n \"delete\",\n \"pop\",\n \"push\",\n \"reverse\",\n \"set\",\n \"shift\",\n \"sort\",\n \"splice\",\n \"unshift\",\n]);\n\nfunction mutatedIdentifierName(node: unknown): string | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const candidate = node as Node;\n if (\n candidate.type === \"AssignmentExpression\" &&\n isIdentifier(candidate.left)\n ) {\n return candidate.left.name;\n }\n\n if (\n candidate.type === \"UpdateExpression\" &&\n isIdentifier(candidate.argument)\n ) {\n return candidate.argument.name;\n }\n\n if (\n candidate.type === \"CallExpression\" &&\n typeof candidate.callee === \"object\" &&\n candidate.callee !== null &&\n (candidate.callee as Node).type === \"MemberExpression\" &&\n (candidate.callee as Node).computed !== true &&\n isIdentifier((candidate.callee as Node).object) &&\n isIdentifier((candidate.callee as Node).property) &&\n mutatingCollectionMethods.has(((candidate.callee as Node).property as { name: string }).name)\n ) {\n return ((candidate.callee as Node).object as { name: string }).name;\n }\n\n return undefined;\n}\n\nfunction findSharedMutableStateMutation(\n node: unknown,\n mutableNames: ReadonlySet<string>,\n localNames = collectDeclaredIdentifierNames(node),\n seen = new WeakSet<object>(),\n): unknown | undefined {\n if (Array.isArray(node)) {\n for (const child of node) {\n const match = findSharedMutableStateMutation(child, mutableNames, localNames, seen);\n if (match) {\n return match;\n }\n }\n return undefined;\n }\n\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n if (seen.has(node)) {\n return undefined;\n }\n seen.add(node);\n\n const mutatedName = mutatedIdentifierName(node);\n if (mutatedName && mutableNames.has(mutatedName) && !localNames.has(mutatedName)) {\n return node;\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n const match = findSharedMutableStateMutation(child, mutableNames, localNames, seen);\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction concurrentEffectWorkNode(node: unknown): unknown | undefined {\n if (\n isEffectMemberCallNamed(node, \"fork\") ||\n isEffectMemberCallNamed(node, \"all\") ||\n isEffectMemberCallNamed(node, \"forEach\")\n ) {\n return (node as Node & { arguments: unknown[] }).arguments;\n }\n\n return undefined;\n}\n\nfunction v4SharedStateWork(node: unknown): unknown | undefined {\n if (isEffectMemberCallNamed(node, \"all\") || isEffectMemberCallNamed(node, \"forEach\")) return (node as Node).arguments;\n if (!v4ForkConstruction(node)) return undefined;\n if (!isPipeCall(node)) return firstArgument(node as Node & { arguments: unknown[] });\n const receiver = ((node as Node).callee as Node).object;\n return isIdentifier((node as Node).callee, \"pipe\") ? firstArgument(node as Node & { arguments: unknown[] }) : receiver;\n}\n\nfunction nodeWithin(node: unknown, owner: unknown): boolean {\n if (Array.isArray(owner)) return owner.some(entry => nodeWithin(node, entry));\n for (let current = node as Node | undefined; current; current = current.parent as Node | undefined) {\n if (current === owner) return true;\n }\n return false;\n}\n\nfunction mutationAtReference(reference: unknown): unknown | undefined {\n const identifier = reference as Node;\n const parent = identifier.parent as Node | undefined;\n if (parent?.type === \"AssignmentExpression\" && parent.left === identifier) return parent;\n if (parent?.type === \"UpdateExpression\" && parent.argument === identifier) return parent;\n if (parent?.type === \"MemberExpression\" && parent.object === identifier && parent.computed !== true &&\n isIdentifier(parent.property) && mutatingCollectionMethods.has(parent.property.name)) {\n const call = parent.parent as Node | undefined;\n if (call?.type === \"CallExpression\" && call.callee === parent) return call;\n }\n return undefined;\n}\n\nfunction lexicalWorkMutation(work: unknown, variables: ReturnType<OxlintContext[\"sourceCode\"][\"getDeclaredVariables\"]>): unknown | undefined {\n for (const variable of variables) {\n if (variable.identifiers.some(identifier => nodeWithin(identifier, work))) continue;\n const mutation = variable.references.map(reference => mutationAtReference(reference.identifier)).find(node => node && nodeWithin(node, work));\n if (mutation) return mutation;\n }\n return undefined;\n}\n\nconst concurrentWorkMembers = new Set([\n \"fork\",\n \"forkScoped\",\n \"forkDaemon\",\n \"all\",\n \"forEach\",\n \"race\",\n \"raceFirst\",\n \"raceAll\",\n]);\n\nconst resourceAcquisitionVerbs = new Set([\n \"open\",\n \"connect\",\n \"create\",\n \"start\",\n \"listen\",\n \"subscribe\",\n \"acquire\",\n]);\n\nconst resourceLikeTerms = new Set([\n \"client\",\n \"connection\",\n \"conn\",\n \"pool\",\n \"db\",\n \"database\",\n \"file\",\n \"socket\",\n \"stream\",\n \"server\",\n \"subscription\",\n \"handle\",\n]);\n\nconst resourceCleanupMethods = new Set([\"close\", \"destroy\", \"dispose\", \"cleanup\"]);\n\nfunction identifierNameTokens(name: string): string[] {\n return name\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .map((token) => token.toLowerCase());\n}\n\nfunction isResourceLikeName(name: string): boolean {\n return identifierNameTokens(name).some((token) => resourceLikeTerms.has(token));\n}\n\nfunction isResourceLikeExpression(node: unknown): boolean {\n if (isIdentifier(node)) {\n return isResourceLikeName(node.name);\n }\n\n if (!isMemberExpressionNode(node)) {\n return false;\n }\n\n const member = node as Node;\n if (member.computed === true) {\n return false;\n }\n\n return (\n (isIdentifier(member.property) && isResourceLikeName(member.property.name)) ||\n isResourceLikeExpression(member.object)\n );\n}\n\nfunction isResourceCleanupCall(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const call = node as Node;\n const callee = call.callee;\n if (\n !isObjectValue(callee) ||\n (callee as Node).type !== \"MemberExpression\" ||\n (callee as Node).computed === true ||\n !isIdentifier((callee as Node).property)\n ) {\n return false;\n }\n\n const member = callee as Node & { property: Node & { name: string } };\n return (\n resourceCleanupMethods.has(member.property.name) &&\n isResourceLikeExpression(member.object)\n );\n}\n\nfunction concurrentWorkArguments(node: unknown, version: EffectVersion = 3): unknown[] | undefined {\n if (version === 4) {\n const operator = isPipeCall(node) ? ((node as Node).arguments as unknown[]).at(-1) : (node as Node)?.callee;\n const matches = (call: unknown) => [...effect4ConcurrentCalls].some(name => isEffectMemberCallNamed(call, name) || isEffectMemberExpressionNamed(call, name));\n if (matches(node)) return (node as Node).arguments as unknown[];\n if (matches(operator)) return [...((operator as Node).arguments as unknown[] ?? []), ...(isPipeCall(node) ? [pipeSource(node as Node)] : (node as Node).arguments as unknown[])];\n return undefined;\n }\n if (!isEffectMemberCall(node)) {\n return undefined;\n }\n\n const property = ((node as Node).callee as Node).property;\n return isIdentifier(property) && concurrentWorkMembers.has(property.name)\n ? (node as Node & { arguments: unknown[] }).arguments\n : undefined;\n}\n\nfunction resourceAcquisitionCall(node: unknown): node is Node & { callee: Node } {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const call = node as Node;\n const callee = call.callee;\n let name: string | undefined;\n\n if (isIdentifier(callee)) {\n name = callee.name;\n } else if (isObjectValue(callee) && (callee as Node).type === \"MemberExpression\") {\n const member = callee as Node;\n if (member.computed !== true && isIdentifier(member.property)) {\n name = member.property.name;\n }\n }\n\n if (!name || name === \"acquireRelease\" || name === \"acquireUseRelease\") {\n return false;\n }\n\n const tokens = identifierNameTokens(name);\n return (\n tokens.some((token) => resourceAcquisitionVerbs.has(token)) &&\n isResourceLikeName(name)\n );\n}\n\nfunction hasScopedReleaseEvidence(node: unknown, bindingName?: string): boolean {\n if (\n isEffectMemberCallNamed(node, \"acquireRelease\") ||\n isEffectMemberCallNamed(node, \"acquireUseRelease\") ||\n isEffectMemberCallNamed(node, \"scoped\") ||\n isEffectScopedPipeCall(node)\n ) {\n return true;\n }\n\n return bindingName !== undefined && hasMatchingDeferredFinalizer(node, bindingName);\n}\n\nfunction matchingFinalizerBindingNames(node: unknown): Set<string> {\n const bindingNames = new Set<string>();\n for (const candidate of findNodes(node, (child) => (\n isObjectValue(child) && (child as Node).type === \"VariableDeclarator\"\n ))) {\n const declaration = candidate as Node;\n if (\n isIdentifier(declaration.id) &&\n findNode(declaration.init, resourceAcquisitionCall) &&\n hasMatchingDeferredFinalizer(node, declaration.id.name)\n ) {\n bindingNames.add(declaration.id.name);\n }\n }\n return bindingNames;\n}\n\nfunction collectUnscopedResourceAcquisitions(\n node: unknown,\n matches: unknown[],\n seen = new WeakSet<object>(),\n ownedBindings = new Set<string>(),\n owned = false,\n version: EffectVersion = 3,\n): void {\n if (Array.isArray(node)) {\n for (const child of node) {\n collectUnscopedResourceAcquisitions(child, matches, seen, ownedBindings, owned, version);\n }\n return;\n }\n\n if (!isObjectValue(node) || seen.has(node)) {\n return;\n }\n seen.add(node);\n\n if (version === 4 && isFunctionLike(node)) {\n const parent = (node as Node).parent;\n if (getEffectGeneratorArgument(parent, \"gen\", 4) !== node && getEffectGeneratorArgument(parent, \"fn\", 4) !== node && !effectLogicCallbacks(parent, 4).includes(node) &&\n ![\"sync\", \"suspend\", \"promise\", \"tryPromise\"].some(name => isEffectMemberCallNamed(parent, name)) && !isAnyObjectMemberCallNamed(parent, \"map\")) return;\n }\n\n if (hasScopedReleaseEvidence(node)) {\n return;\n }\n\n const nextOwnedBindings = isFunctionLike(node) ? new Set([...ownedBindings, ...matchingFinalizerBindingNames(node)]) : ownedBindings;\n\n const declaration = (node as Node).type === \"VariableDeclarator\" ? node as Node : undefined;\n const declarationName = declaration && isIdentifier(declaration.id) ? declaration.id.name : undefined;\n const declarationIsOwned = declarationName !== undefined && nextOwnedBindings.has(declarationName);\n\n if (resourceAcquisitionCall(node) && !owned) {\n matches.push(node);\n return;\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n collectUnscopedResourceAcquisitions(\n child,\n matches,\n seen,\n nextOwnedBindings,\n owned || declarationIsOwned,\n version,\n );\n }\n}\n\nfunction findUnscopedResourceAcquisition(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n const matches: unknown[] = [];\n collectUnscopedResourceAcquisitions(node, matches, seen);\n return matches[0];\n}\n\nfunction findUnscopedResourceAcquisitions(node: unknown, version: EffectVersion = 3): unknown[] {\n const matches: unknown[] = [];\n collectUnscopedResourceAcquisitions(node, matches, undefined, undefined, false, version);\n return matches;\n}\n\nconst concurrentEffectCalls = new Set([\"all\", \"forEach\", \"fork\", \"race\", \"raceAll\"]);\n\nfunction containsConcurrentOperation(node: unknown, seen = new WeakSet<object>()): boolean {\n if (containsEffectMemberCallInSet(node, concurrentEffectCalls)) {\n return true;\n }\n\n if (isMemberCall(node, \"Queue\", \"take\")) {\n return true;\n }\n\n if (Array.isArray(node)) {\n return node.some((child) => containsConcurrentOperation(child, seen));\n }\n\n if (!isObjectValue(node)) {\n return false;\n }\n\n if (seen.has(node)) {\n return false;\n }\n seen.add(node);\n\n return Object.entries(node).some(([key, child]) => (\n key !== \"parent\" && containsConcurrentOperation(child, seen)\n ));\n}\n\nconst effect4ConcurrentCalls = new Set([\"all\", \"forEach\", \"forkChild\", \"forkDetach\", \"forkScoped\", \"forkIn\", \"race\", \"raceAll\", \"raceFirst\", \"raceAllFirst\"]);\n\nfunction containsEffect4ConcurrentOperation(node: unknown, permit = false): boolean {\n return !!findOwnCallbackNode(node, child => {\n if (isMemberCall(child, \"Queue\", \"take\") || isMemberCall(child, \"PubSub\", \"take\") ||\n [...effect4ConcurrentCalls].some(name => isEffectMemberCallNamed(child, name) || isEffectMemberExpressionNamed(child, name)) ||\n permit && ([\"sleep\", \"promise\", \"tryPromise\"].some(name => isEffectMemberCallNamed(child, name)) || isMemberCall(child, \"Deferred\", \"await\"))) return true;\n const generator = getEffectGeneratorArgument(child, \"gen\", 4) ?? getEffectGeneratorArgument(child, \"fn\", 4);\n if (generator && containsEffect4ConcurrentOperation(generator.body, permit)) return true;\n return effectLogicCallbacks(child, 4).some(callback => containsEffect4ConcurrentOperation(callbackBody(callback), permit));\n });\n}\n\nfunction isUninterruptibleConcurrentRegion(node: unknown, version: EffectVersion = 3): boolean {\n if (version === 4) {\n const work = isEffectMemberCallNamed(node, \"uninterruptible\") ? firstArgument(node as Node & { arguments: unknown[] }) :\n isPipeCall(node) && isEffectMemberExpressionNamed(((node as Node).arguments as unknown[]).at(-1), \"uninterruptible\") ? pipeSource(node as Node) : undefined;\n return work !== undefined && containsEffect4ConcurrentOperation(work);\n }\n return (\n isEffectMemberCallNamed(node, \"uninterruptible\") &&\n containsConcurrentOperation((node as Node & { arguments: unknown[] }).arguments[0])\n );\n}\n\nfunction isUnboundedQueueOrPubSub(node: unknown, version: EffectVersion = 3): boolean {\n if (isMemberCall(node, \"Queue\", \"unbounded\") || isMemberCall(node, \"PubSub\", \"unbounded\")) return true;\n if (version !== 4) return false;\n if (isMemberCall(node, \"PubSub\", \"makeAtomicUnbounded\")) return true;\n if (!isMemberCall(node, \"Queue\", \"make\")) return false;\n const options = firstArgument(node as Node & { arguments: unknown[] });\n if (!options || isIdentifier(options, \"undefined\")) return true;\n if (!isObjectExpression(options)) return false;\n if (((options as Node).properties as Node[]).some(entry => entry.type === \"SpreadElement\")) return false;\n const capacity = objectPropertyValue(options, \"capacity\");\n return !capacity ||\n isIdentifier(capacity, \"undefined\") || isIdentifier(capacity, \"Infinity\") ||\n (isObjectValue(capacity) && (capacity as Node).type === \"MemberExpression\" &&\n (capacity as Node).computed !== true && isIdentifier((capacity as Node).object, \"Number\") && isIdentifier((capacity as Node).property, \"POSITIVE_INFINITY\"));\n}\n\nfunction isMutableContainerInit(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const candidate = node as Node;\n return (\n candidate.type === \"ObjectExpression\" ||\n candidate.type === \"ArrayExpression\" ||\n (\n candidate.type === \"NewExpression\" &&\n (isIdentifier(candidate.callee, \"Map\") || isIdentifier(candidate.callee, \"Set\"))\n ) ||\n (\n candidate.type === \"CallExpression\" &&\n (isIdentifier(candidate.callee, \"Map\") || isIdentifier(candidate.callee, \"Set\"))\n )\n );\n}\n\nfunction mutableGlobalDeclarationNames(node: unknown): string[] {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return [];\n }\n\n const declaration = node as Node;\n const declarations = Array.isArray(declaration.declarations) ? declaration.declarations : [];\n if (declaration.kind === \"let\" || declaration.kind === \"var\") {\n return variableDeclarationIdentifierNames(node);\n }\n\n return declarations.flatMap((entry) => {\n if (!isObjectValue(entry)) {\n return [];\n }\n\n const id = (entry as Node).id;\n return isIdentifier(id) && isMutableContainerInit((entry as Node).init) ? [id.name] : [];\n });\n}\n\nfunction forkedFiberVariableName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclarator\") {\n return undefined;\n }\n\n const declarator = node as Node;\n return isIdentifier(declarator.id) && isEffectMemberCallNamed(declarator.init, \"fork\")\n ? declarator.id.name\n : undefined;\n}\n\nconst fiberObservationCalls = new Set([\"await\", \"interrupt\", \"join\"]);\n\nfunction observedFiberVariableName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n const callee = call.callee;\n if (\n !isObjectValue(callee) ||\n (callee as Node).type !== \"MemberExpression\" ||\n (callee as Node).computed === true ||\n !isIdentifier((callee as Node).object, \"Fiber\") ||\n !isIdentifier((callee as Node).property) ||\n !fiberObservationCalls.has(((callee as Node).property as { name: string }).name) ||\n !Array.isArray(call.arguments)\n ) {\n return undefined;\n }\n\n const [fiber] = call.arguments;\n return isIdentifier(fiber) ? fiber.name : undefined;\n}\n\nfunction v4FiberObservedReference(reference: unknown): boolean {\n if (!isIdentifier(reference)) return false;\n const parent = reference.parent as Node | undefined;\n if (!parent) return false;\n if (parent.type === \"ReturnStatement\" && parent.argument === reference) return true;\n if (observedFiberVariableName(parent) === reference.name && firstArgument(parent as Node & { arguments: unknown[] }) === reference) return true;\n const pipe = parent.type === \"MemberExpression\" && parent.object === reference ? parent.parent : parent;\n return isPipeCall(pipe) && findNode((pipe as Node).arguments, candidate =>\n [...fiberObservationCalls].some(name => isMemberExpression(candidate, \"Fiber\", name))) !== undefined;\n}\n\nfunction isEffectAsVoidPipeArgument(node: unknown): boolean {\n return isMemberExpression(node, \"Effect\", \"asVoid\") || isMemberCall(node, \"Effect\", \"asVoid\");\n}\n\nfunction isEffectAllAsVoidPipe(node: unknown): node is Node & { callee: Node; arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n if (\n call.type !== \"CallExpression\" ||\n !Array.isArray(call.arguments) ||\n typeof call.callee !== \"object\" ||\n call.callee === null ||\n (call.callee as Node).type !== \"MemberExpression\" ||\n (call.callee as Node).computed === true ||\n !isIdentifier((call.callee as Node).property, \"pipe\")\n ) {\n return false;\n }\n\n return (\n isEffectMemberCallNamed((call.callee as Node).object, \"all\") &&\n call.arguments.some((argument) => isEffectAsVoidPipeArgument(argument))\n );\n}\n\nfunction pipeParts(node: unknown): unknown[] {\n if (!isObjectValue(node) || !isPipeCall(node)) {\n return [];\n }\n\n const call = node as Node & { arguments: unknown[] };\n if (isIdentifier(call.callee, \"pipe\")) {\n return call.arguments;\n }\n\n const callee = call.callee as Node;\n return [callee.object, ...call.arguments];\n}\n\nfunction isPipeStartingWithEffect(node: unknown): boolean {\n const [first] = pipeParts(node);\n return first !== undefined && containsEffectMemberCall(first);\n}\n\nfunction isEffectWrapperAliasExpression(node: unknown): boolean {\n if (isPipeStartingWithEffect(node)) {\n return true;\n }\n\n if (\n isObjectValue(node) &&\n (node as Node).type === \"ArrowFunctionExpression\"\n ) {\n const body = (node as Node).body;\n return isEffectMemberCall(body) || isPipeStartingWithEffect(body);\n }\n\n return false;\n}\n\nfunction hasEffectWrapperAliasReturn(node: unknown): boolean {\n return findReturnStatements(node).some((returnNode) => (\n isObjectValue(returnNode) &&\n (isEffectWrapperAliasExpression((returnNode as Node).argument) ||\n isEffectMemberCall((returnNode as Node).argument))\n ));\n}\n\nfunction isQualifiedTypeReference(node: unknown, leftName: string, rightName: string): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"TSTypeReference\") {\n return false;\n }\n\n const typeName = (node as Node).typeName;\n return (\n isObjectValue(typeName) &&\n (typeName as Node).type === \"TSQualifiedName\" &&\n isIdentifier((typeName as Node).left, leftName) &&\n isIdentifier((typeName as Node).right, rightName)\n );\n}\n\nfunction isIdentifierTypeReference(node: unknown, name: string): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"TSTypeReference\" &&\n isIdentifier((node as Node).typeName, name)\n );\n}\n\nfunction typeArguments(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const container = (node as Node).typeParameters ?? (node as Node).typeArguments;\n if (!isObjectValue(container)) {\n return [];\n }\n\n const params = (container as Node).params ?? (container as Node).arguments;\n return Array.isArray(params) ? params : [];\n}\n\nfunction isGenericErrorType(node: unknown): boolean {\n return isIdentifier(node, \"Error\") || isIdentifierTypeReference(node, \"Error\");\n}\n\nfunction returnTypeAnnotation(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const returnType = (node as Node).returnType;\n if (!isObjectValue(returnType)) {\n return undefined;\n }\n\n return (returnType as Node).typeAnnotation ?? returnType;\n}\n\nfunction hasExplicitEffectReturnType(node: unknown, declaredReturnType?: unknown): boolean {\n return (\n isQualifiedTypeReference(returnTypeAnnotation(node), \"Effect\", \"Effect\") ||\n isQualifiedTypeReference(declaredReturnType, \"Effect\", \"Effect\")\n );\n}\n\nfunction operationReturnExpressions(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const body = (node as Node).body;\n if (!isObjectValue(body)) {\n return [];\n }\n\n if ((body as Node).type !== \"BlockStatement\") {\n return [body];\n }\n\n const collectReturns = (current: unknown, seen = new WeakSet<object>()): unknown[] => {\n if (Array.isArray(current)) {\n return current.flatMap((child) => collectReturns(child, seen));\n }\n\n if (!isObjectValue(current) || seen.has(current)) {\n return [];\n }\n seen.add(current);\n\n const currentNode = current as Node;\n if (currentNode.type === \"ReturnStatement\") {\n return [currentNode.argument];\n }\n if (\n currentNode.type === \"ArrowFunctionExpression\" ||\n currentNode.type === \"FunctionExpression\" ||\n currentNode.type === \"FunctionDeclaration\"\n ) {\n return [];\n }\n\n return Object.entries(currentNode).flatMap(([key, child]) => (\n key === \"parent\" ? [] : collectReturns(child, seen)\n ));\n };\n\n return collectReturns(body);\n}\n\nfunction returnedEffectExpressions(node: unknown): unknown[] {\n return operationReturnExpressions(node).filter((expression) => (\n isEffectMemberCall(expression) || isPipeStartingWithEffect(expression)\n ));\n}\n\nfunction containsDirectEffectSpan(expression: unknown): boolean {\n return isEffectMemberCallNamed(expression, \"withSpan\") || (\n isPipeCall(expression) && pipeParts(expression).some((part) => isEffectMemberCallNamed(part, \"withSpan\"))\n );\n}\n\nfunction publicEffectOperationWithoutSpan(node: unknown, declaredReturnType?: unknown): unknown | undefined {\n if (!hasExplicitEffectReturnType(node, declaredReturnType)) {\n return undefined;\n }\n\n const expressions = returnedEffectExpressions(node);\n return expressions.length === 0 || expressions.some((expression) => !containsDirectEffectSpan(expression))\n ? node\n : undefined;\n}\n\ntype ExportedFunctionValue = {\n readonly functionNode: unknown;\n readonly declaredReturnType?: unknown;\n};\n\nfunction declaredFunctionReturnType(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const annotation = (node as Node).typeAnnotation;\n if (!isObjectValue(annotation)) {\n return undefined;\n }\n\n return returnTypeAnnotation((annotation as Node).typeAnnotation ?? annotation);\n}\n\nfunction exportedFunctionValues(node: unknown): ExportedFunctionValue[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const exportNode = node as Node;\n if (exportNode.type !== \"ExportNamedDeclaration\" && exportNode.type !== \"ExportDefaultDeclaration\") {\n return [];\n }\n\n const declaration = exportNode.declaration;\n if (!isObjectValue(declaration)) {\n return [];\n }\n\n if ((declaration as Node).type === \"FunctionDeclaration\") {\n return [{ functionNode: declaration }];\n }\n\n if ((declaration as Node).type !== \"VariableDeclaration\") {\n return [];\n }\n\n return (((declaration as Node).declarations as unknown[] | undefined) ?? []).flatMap((declarator) => {\n if (!isObjectValue(declarator)) {\n return [];\n }\n\n const init = (declarator as Node).init;\n return (\n isObjectValue(init) &&\n ((init as Node).type === \"ArrowFunctionExpression\" || (init as Node).type === \"FunctionExpression\")\n ) ? [{\n functionNode: init,\n declaredReturnType: declaredFunctionReturnType((declarator as Node).id),\n }] : [];\n });\n}\n\nfunction serviceMethodFunctions(options: unknown, version: EffectVersion = 3): unknown[] {\n if (version === 4) {\n const seen = new WeakSet<object>();\n const objects = (value: unknown): unknown[] => {\n if (!isObjectValue(value) || seen.has(value)) return [];\n seen.add(value);\n if (isObjectExpression(value)) return [value];\n if (isFunctionLike(value)) return operationReturnExpressions(value).flatMap(objects);\n const generator = getEffectGeneratorArgument(value, \"gen\", version) ?? getEffectGeneratorArgument(value, \"fn\", version);\n if (generator) return objects(generator);\n if (isEffectMemberCallNamed(value, \"succeed\") || isEffectMemberCallNamed(value, \"sync\") || isEffectMemberCallNamed(value, \"suspend\")) return objects(firstArgument(value as Node & { arguments: unknown[] }));\n if (isPipeCall(value)) {\n const callee = (value as Node).callee as Node;\n return objects(callee.type === \"MemberExpression\" ? callee.object : firstArgument(value as Node & { arguments: unknown[] }));\n }\n return [];\n };\n return objects(objectPropertyValue(options, \"make\")).flatMap(value => ((value as Node).properties as Node[]).filter(entry => entry.type === \"Property\" && isFunctionLike(entry.value)).map(entry => entry.value));\n }\n const implementation = objectPropertyValue(options, \"effect\") ?? objectPropertyValue(options, \"scoped\");\n const generator = getEffectGeneratorArgument(implementation, \"gen\");\n const returnedObject = generator\n ? operationReturnExpressions(generator).find(isObjectExpression)\n : isEffectMemberCallNamed(implementation, \"succeed\") && isObjectExpression(firstArgument(implementation))\n ? firstArgument(implementation)\n : undefined;\n\n if (!returnedObject) {\n return [];\n }\n\n const properties = (returnedObject as Node).properties;\n if (!Array.isArray(properties)) {\n return [];\n }\n\n return properties.flatMap((property) => {\n if (!isObjectValue(property) || (property as Node).type !== \"Property\") {\n return [];\n }\n\n const value = (property as Node).value;\n return (\n isObjectValue(value) &&\n ((value as Node).type === \"ArrowFunctionExpression\" || (value as Node).type === \"FunctionExpression\")\n ) ? [value] : [];\n });\n}\n\nfunction serviceEffectOperationWithoutSpan(node: unknown): unknown | undefined {\n const expressions = returnedEffectExpressions(node);\n return expressions.some((expression) => !containsDirectEffectSpan(expression)) ? node : undefined;\n}\n\nfunction genericEffectErrorReturnType(node: unknown): unknown | undefined {\n const target = effectErrorChannelTarget(node);\n return target && isGenericErrorType(target.errorChannel)\n ? target.annotation\n : undefined;\n}\n\ntype PublicEffectErrorTarget = {\n readonly annotation: unknown;\n readonly errorChannel: unknown;\n};\n\nfunction effectErrorChannelTarget(\n node: unknown,\n declaredReturnType?: unknown,\n): PublicEffectErrorTarget | undefined {\n const annotation = returnTypeAnnotation(node) ?? declaredReturnType;\n if (!isQualifiedTypeReference(annotation, \"Effect\", \"Effect\")) {\n return undefined;\n }\n\n const [, errorChannel] = typeArguments(annotation);\n return errorChannel === undefined ? undefined : { annotation, errorChannel };\n}\n\nfunction exportedEffectErrorTargets(node: unknown): PublicEffectErrorTarget[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const exportNode = node as Node;\n if (\n exportNode.type !== \"ExportNamedDeclaration\" &&\n exportNode.type !== \"ExportDefaultDeclaration\"\n ) {\n return [];\n }\n\n return exportedFunctionValues(exportNode).flatMap(({ functionNode, declaredReturnType }) => {\n const target = effectErrorChannelTarget(functionNode, declaredReturnType);\n return target ? [target] : [];\n });\n}\n\nfunction exportedGenericEffectErrorTarget(node: unknown): unknown | undefined {\n return exportedEffectErrorTargets(node).find((target) => (\n isGenericErrorType(target.errorChannel)\n ))?.annotation;\n}\n\ntype ErrorChannelShape = \"Error\" | \"unknown\" | \"string\" | \"number\" | \"boolean\";\n\nfunction unwrappedType(node: unknown): unknown {\n let current = node;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return current;\n seen.add(current);\n\n if ((current as Node).type !== \"TSParenthesizedType\") return current;\n current = (current as Node).typeAnnotation;\n }\n\n return current;\n}\n\nfunction errorChannelShape(node: unknown): ErrorChannelShape | undefined {\n const type = unwrappedType(node);\n if (isGenericErrorType(type)) return \"Error\";\n\n if (!isObjectValue(type)) return undefined;\n\n switch ((type as Node).type) {\n case \"TSUnknownKeyword\":\n return \"unknown\";\n case \"TSStringKeyword\":\n return \"string\";\n case \"TSNumberKeyword\":\n return \"number\";\n case \"TSBooleanKeyword\":\n return \"boolean\";\n default:\n return undefined;\n }\n}\n\nfunction mixedErrorChannelShapes(node: unknown): Set<ErrorChannelShape> {\n const type = unwrappedType(node);\n if (!isObjectValue(type) || (type as Node).type !== \"TSUnionType\") {\n return new Set();\n }\n\n const types = (type as Node).types;\n if (!Array.isArray(types)) return new Set();\n\n return new Set(types.flatMap((member) => {\n const shape = errorChannelShape(member);\n return shape ? [shape] : [];\n }));\n}\n\nfunction containsQualifiedTypeReference(\n node: unknown,\n leftName: string,\n rightName: string,\n seen = new WeakSet<object>(),\n): boolean {\n return findNode(node, (node) => isQualifiedTypeReference(node, leftName, rightName), seen) !== undefined;\n}\n\nfunction containsWrapGraphqlCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isIdentifierCall(child, \"wrapGraphqlCall\"), seen) !== undefined;\n}\n\nfunction isApplyResponseFlatMap(node: unknown, version: EffectVersion): boolean {\n return (\n (isEffectMemberCallNamed(node, \"flatMap\") || (version === 4 && isEffectMemberCallNamed(node, \"flatMapEager\"))) &&\n isIdentifier(firstArgument(node), \"applyResponse\")\n );\n}\n\nfunction containsApplyResponseFlatMap(node: unknown, version: EffectVersion, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isApplyResponseFlatMap(child, version), seen) !== undefined;\n}\n\nfunction findEffectCatchAll(node: unknown, version: EffectVersion, seen = new WeakSet<object>()): unknown | undefined {\n return findNode(node, child => isEffectMemberCall(child) && plainCatchOperators(version).has(((child.callee as Node).property as { name: string }).name), seen);\n}\n\nfunction getWrapGraphqlCatchAll(node: unknown, version: EffectVersion): unknown | undefined {\n const parts = pipeParts(node);\n if (parts.length === 0) {\n return undefined;\n }\n\n const catchAll = findEffectCatchAll(parts, version);\n if (!catchAll) {\n return undefined;\n }\n\n return containsWrapGraphqlCall(parts) || containsApplyResponseFlatMap(parts, version)\n ? catchAll\n : undefined;\n}\n\nconst atomOperationMethods = new Set([\"get\", \"set\", \"update\", \"modify\", \"refresh\"]);\n\nfunction callbackBody(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const callback = node as Node;\n if (callback.type !== \"ArrowFunctionExpression\" && callback.type !== \"FunctionExpression\") {\n return undefined;\n }\n\n return callback.body;\n}\n\nfunction isAtomOperationCall(node: unknown): node is Node & { arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n if (\n call.type !== \"CallExpression\" ||\n !Array.isArray(call.arguments) ||\n typeof call.callee !== \"object\" ||\n call.callee === null ||\n (call.callee as Node).type !== \"MemberExpression\" ||\n (call.callee as Node).computed === true\n ) {\n return false;\n }\n\n const callee = call.callee as Node;\n return (\n (isIdentifier(callee.object, \"Atom\") || isIdentifier(callee.object, \"atomRegistry\")) &&\n isIdentifier(callee.property) &&\n atomOperationMethods.has((callee.property as { name: string }).name)\n );\n}\n\nfunction findAtomOperationCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n return findNode(node, isAtomOperationCall, seen);\n}\n\nfunction findAtomOperationInsideEffectSync(node: unknown): unknown | undefined {\n if (!isEffectMemberCallNamed(node, \"sync\")) {\n return undefined;\n }\n\n const body = callbackBody(firstArgument(node));\n return body ? findAtomOperationCall(body) : undefined;\n}\n\nfunction isCollectionAtomIdentifier(node: unknown): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n\n return /(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(node.name);\n}\n\nfunction getCollectionAtomReadTarget(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const call = node as Node;\n if (call.type !== \"CallExpression\" || !Array.isArray(call.arguments)) {\n return undefined;\n }\n\n const isFamilyRead =\n isIdentifier(call.callee, \"get\") ||\n isMemberExpression(call.callee, \"Atom\", \"get\") ||\n isMemberExpression(call.callee, \"get\", \"get\");\n\n if (!isFamilyRead) {\n return undefined;\n }\n\n const [atom] = call.arguments;\n return isCollectionAtomIdentifier(atom) ? atom : undefined;\n}\n\nfunction findFamilyCollectionRead(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n return getCollectionAtomReadTarget(findNode(node, child => getCollectionAtomReadTarget(child) !== undefined, seen));\n}\n\nfunction isEffectProvideWithSingleArgument(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"provide\") && node.arguments.length === 1;\n}\n\nfunction findInlineRuntimeProvide(node: unknown): unknown | undefined {\n if (!isPipeCall(node)) {\n return undefined;\n }\n\n return pipeParts(node).find((part) => isEffectProvideWithSingleArgument(part));\n}\n\nfunction hasObjectSpread(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isObjectValue(child) && (child as Node).type === \"SpreadElement\", seen) !== undefined;\n}\n\nfunction isRefStateUpdateWithSpread(node: unknown): boolean {\n if (!isMemberCall(node, \"Ref\", \"update\") && !isMemberCall(node, \"Ref\", \"modify\")) {\n return false;\n }\n\n const callback = (node as Node & { arguments: unknown[] }).arguments[1];\n const body = callbackBody(callback);\n return hasObjectSpread(body);\n}\n\nfunction isEmptyObjectExpression(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"ObjectExpression\" &&\n Array.isArray((node as Node).properties) &&\n ((node as Node).properties as unknown[]).length === 0\n );\n}\n\nfunction containsObjectEntriesCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isMemberCall(child, \"Object\", \"entries\"), seen) !== undefined;\n}\n\nfunction isNakedObjectStateUpdate(node: unknown): boolean {\n if (isRefStateUpdateWithSpread(node)) {\n return true;\n }\n\n if (isMemberCall(node, \"Object\", \"assign\")) {\n const args = (node as Node & { arguments: unknown[] }).arguments;\n return args.length >= 3 && isEmptyObjectExpression(args[0]);\n }\n\n if (isMemberCall(node, \"Object\", \"fromEntries\")) {\n return containsObjectEntriesCall((node as Node & { arguments: unknown[] }).arguments[0]);\n }\n\n return isMemberCall(node, \"JSON\", \"stringify\") || isMemberCall(node, \"JSON\", \"parse\");\n}\n\nfunction isEffectSucceedVariableArgument(node: unknown): boolean {\n if (isIdentifier(node)) {\n return true;\n }\n\n return (\n isObjectValue(node) &&\n (node as Node).type === \"MemberExpression\"\n );\n}\n\nfunction isVariableAsAssertion(node: unknown, version: EffectVersion = 3): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return false;\n }\n\n return ((node as Node).declarations as unknown[] | undefined)?.some((declaration) => {\n if (!isObjectValue(declaration)) {\n return false;\n }\n\n const init = (declaration as Node).init;\n return (\n isObjectValue(init) &&\n (init as Node).type === \"TSAsExpression\" &&\n typeof (init as Node).typeAnnotation === \"object\" &&\n (init as Node).typeAnnotation !== null &&\n ((init as Node).typeAnnotation as Node).type !== \"TSConstKeyword\" &&\n !(version === 4 && ((init as Node).typeAnnotation as Node).type === \"TSTypeReference\" &&\n isIdentifier(((init as Node).typeAnnotation as Node).typeName, \"const\"))\n );\n }) ?? false;\n}\n\nfunction isTypeofBooleanCheck(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"BinaryExpression\") {\n return false;\n }\n\n const binary = node as Node;\n if (binary.operator !== \"===\") {\n return false;\n }\n\n const left = binary.left;\n const right = binary.right;\n return (\n isObjectValue(left) &&\n (left as Node).type === \"UnaryExpression\" &&\n (left as Node).operator === \"typeof\" &&\n isObjectValue(right) &&\n ((right as Node).type === \"Literal\" || (right as Node).type === \"StringLiteral\") &&\n (right as Node).value === \"boolean\"\n );\n}\n\nfunction isMatchOrElseNullCall(node: unknown): boolean {\n return isMatchBranchCall(node, \"orElse\") && isNullLiteral(arrowCallbackBody(node.arguments[0]));\n}\n\nfunction isStringLiteral(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n ((node as Node).type === \"Literal\" || (node as Node).type === \"StringLiteral\") &&\n typeof (node as Node).value === \"string\"\n );\n}\n\nfunction isUndefinedIdentifier(node: unknown): boolean {\n return isIdentifier(node, \"undefined\");\n}\n\nfunction isNullishRewrap(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"LogicalExpression\" &&\n (node as Node).operator === \"??\" &&\n (isNullLiteral((node as Node).right) || isUndefinedIdentifier((node as Node).right))\n );\n}\n\nfunction isOptionFromNullableNullishCoalesce(node: unknown, version: EffectVersion = 3): boolean {\n return (\n isMemberCall(node, \"Option\", version === 3 ? \"fromNullable\" : \"fromNullishOr\") &&\n isNullishRewrap((node as Node & { arguments: unknown[] }).arguments[0])\n );\n}\n\nfunction objectPropertyValue(node: unknown, keyName: string): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"ObjectExpression\") {\n return undefined;\n }\n\n for (const property of ((node as Node).properties as unknown[] | undefined) ?? []) {\n if (!isObjectValue(property)) {\n continue;\n }\n\n const key = (property as Node).key;\n if (isIdentifier(key, keyName)) {\n return (property as Node).value;\n }\n }\n\n return undefined;\n}\n\nfunction isBooleanTrueComparison(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"BinaryExpression\") {\n return false;\n }\n\n const binary = node as Node;\n return (\n binary.operator === \"===\" &&\n (isBooleanLiteral(binary.left, true) || isBooleanLiteral(binary.right, true))\n );\n}\n\nfunction isOptionBooleanNormalization(node: unknown): boolean {\n if (!isMemberCall(node, \"Option\", \"match\")) {\n return false;\n }\n\n const config = (node as Node & { arguments: unknown[] }).arguments[1];\n const onSome = objectPropertyValue(config, \"onSome\");\n const onNone = objectPropertyValue(config, \"onNone\");\n return (\n isBooleanTrueComparison(arrowCallbackBody(onSome)) &&\n isBooleanLiteral(arrowCallbackBody(onNone), false)\n );\n}\n\nfunction isStringSentinelConst(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return false;\n }\n\n return ((node as Node).declarations as unknown[] | undefined)?.some((declaration) => (\n isObjectValue(declaration) &&\n isStringLiteral((declaration as Node).init)\n )) ?? false;\n}\n\nfunction isBooleanLiteral(node: unknown, value: boolean): boolean {\n return (\n isObjectValue(node) &&\n ((node as Node).type === \"Literal\" || (node as Node).type === \"BooleanLiteral\") &&\n (node as Node).value === value\n );\n}\n\nfunction isEffectVoidMember(node: unknown): boolean {\n return isMemberExpression(node, \"Effect\", \"void\");\n}\n\nfunction isMatchBranchCall(node: unknown, propertyName?: \"when\" | \"orElse\"): node is Node & { arguments: unknown[] } {\n return isMemberCall(node, \"Match\", propertyName) && Array.isArray((node as Node).arguments);\n}\n\nfunction arrowCallbackBody(node: unknown): unknown | undefined {\n if (\n !isObjectValue(node) ||\n (node as Node).type !== \"ArrowFunctionExpression\"\n ) {\n return undefined;\n }\n\n return (node as Node).body;\n}\n\nfunction isVoidMatchBranch(node: unknown): boolean {\n if (!isMatchBranchCall(node)) {\n return false;\n }\n\n const [first, second] = node.arguments;\n if (isIdentifier((node.callee as Node).property, \"when\")) {\n return (\n (isBooleanLiteral(first, true) || isBooleanLiteral(first, false)) &&\n isEffectVoidMember(arrowCallbackBody(second))\n );\n }\n\n return (\n isIdentifier((node.callee as Node).property, \"orElse\") &&\n isEffectVoidMember(arrowCallbackBody(first))\n );\n}\n\nconst branchSequencingEffectCalls = [\"flatMap\", \"map\", \"andThen\", \"tap\", \"zipRight\"] as const;\n\nfunction isStreamMemberCall(node: unknown): boolean {\n return isMemberCall(node, \"Stream\");\n}\n\nfunction containsBranchSequencingCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => branchSequencingEffectCalls.some((propertyName) => isEffectMemberCallNamed(node, propertyName)) ||\n isPipeCall(node) ||\n isStreamMemberCall(node), seen) !== undefined;\n}\n\nfunction isSequencingBranchBody(node: unknown): boolean {\n return containsEffectMemberCall(node) && containsBranchSequencingCall(node);\n}\n\nfunction containsSequencingMatchBranch(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isMatchBranchCall(child) && isSequencingBranchBody(isIdentifier((child.callee as Node).property, \"when\") ? arrowCallbackBody(child.arguments[1]) : arrowCallbackBody(child.arguments[0])), seen) !== undefined;\n}\n\nfunction containsMatchBranchCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isMatchBranchCall(node), seen) !== undefined;\n}\n\nfunction isOptionMatchCall(node: unknown): node is Node & { arguments: unknown[] } {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"CallExpression\" &&\n Array.isArray((node as Node).arguments) &&\n isMemberExpression((node as Node).callee, \"Option\", \"match\")\n );\n}\n\nfunction isExpressionBodiedArrowCall(node: unknown): boolean {\n const body = arrowCallbackBody(node);\n return (\n isObjectValue(body) &&\n (body as Node).type === \"CallExpression\"\n );\n}\n\nfunction findEffectGenCall(node: unknown): unknown | undefined {\n return findNode(node, (child) => isEffectMemberCallNamed(child, \"gen\"));\n}\n\nfunction isMatchValuePipeCall(node: unknown): boolean {\n if (!isPipeCall(node) || !isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n const callee = call.callee as Node;\n const object = callee.object;\n return (\n isObjectValue(object) &&\n (object as Node).type === \"CallExpression\" &&\n isMemberExpression((object as Node).callee, \"Match\", \"value\")\n );\n}\n\nfunction isObjectBranchCall(node: unknown, version: EffectVersion): boolean {\n return (\n isMatchValuePipeCall(node) ||\n (isObjectValue(node) &&\n (node as Node).type === \"CallExpression\" &&\n (isMemberExpression((node as Node).callee, \"Option\", \"match\") ||\n isMemberExpression((node as Node).callee, version === 3 ? \"Either\" : \"Result\", \"match\")))\n );\n}\n\nfunction containsObjectBranchCall(node: unknown, version: EffectVersion, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isObjectBranchCall(node, version), seen) !== undefined;\n}\n\nfunction objectPropertyValues(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const object = node as Node;\n if (object.type !== \"ObjectExpression\" || !Array.isArray(object.properties)) {\n return [];\n }\n\n return object.properties\n .map((property) => (\n isObjectValue(property) ? (property as Node).value : undefined\n ))\n .filter((value) => value !== undefined);\n}\n\nfunction isRawDomainIdAlias(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"TSTypeAliasDeclaration\") {\n return false;\n }\n\n const aliasName = (node as Node).id;\n const typeAnnotation = (node as Node).typeAnnotation as Node | undefined;\n return (\n isIdentifier(aliasName) &&\n /(?:Id|ID)$/.test(aliasName.name) &&\n (typeAnnotation?.type === \"TSStringKeyword\" || typeAnnotation?.type === \"TSNumberKeyword\")\n );\n}\n\nfunction isBooleanTypeAnnotation(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const annotation = node as Node;\n if (annotation.type === \"TSBooleanKeyword\") {\n return true;\n }\n\n return (\n annotation.type === \"TSTypeAnnotation\" &&\n typeof annotation.typeAnnotation === \"object\" &&\n annotation.typeAnnotation !== null &&\n (annotation.typeAnnotation as Node).type === \"TSBooleanKeyword\"\n );\n}\n\nfunction unwrapTypeAnnotation(node: unknown): Node | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const annotation = node as Node;\n if (\n annotation.type === \"TSTypeAnnotation\" &&\n typeof annotation.typeAnnotation === \"object\" &&\n annotation.typeAnnotation !== null\n ) {\n return annotation.typeAnnotation as Node;\n }\n\n return annotation;\n}\n\nfunction isStringOrNumberTypeAnnotation(node: unknown): boolean {\n const annotation = unwrapTypeAnnotation(node);\n return annotation?.type === \"TSStringKeyword\" || annotation?.type === \"TSNumberKeyword\";\n}\n\nfunction isAnyOrObjectTypeAnnotation(node: unknown): boolean {\n const annotation = unwrapTypeAnnotation(node);\n return annotation?.type === \"TSAnyKeyword\" || annotation?.type === \"TSObjectKeyword\";\n}\n\nfunction isDateTypeAnnotation(node: unknown): boolean {\n const annotation = unwrapTypeAnnotation(node);\n return (\n annotation?.type === \"TSTypeReference\" &&\n isIdentifier((annotation as Node).typeName, \"Date\")\n );\n}\n\nfunction primitiveDomainParameters(node: unknown): unknown[] {\n if (!isObjectValue(node) || !Array.isArray((node as Node).params)) {\n return [];\n }\n\n const domainNamePattern =\n /(?:id|amount|currency|account|user|order|customer|invoice|payment|price|total|quantity|transfer|fund|balance)/i;\n return ((node as Node).params as unknown[]).filter((param) => (\n isIdentifier(param) &&\n isStringOrNumberTypeAnnotation((param as Node).typeAnnotation) &&\n domainNamePattern.test(param.name)\n ));\n}\n\nfunction hasPrimitiveHeavyDomainParameters(node: unknown): boolean {\n return primitiveDomainParameters(node).length >= 3;\n}\n\nfunction isBooleanDomainFlagParameter(node: unknown): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n\n return (\n /^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(node.name) &&\n isBooleanTypeAnnotation((node as Node).typeAnnotation)\n );\n}\n\nfunction functionBooleanDomainFlagParameters(node: unknown): unknown[] {\n if (!isObjectValue(node) || !Array.isArray((node as Node).params)) {\n return [];\n }\n\n return ((node as Node).params as unknown[]).filter(isBooleanDomainFlagParameter);\n}\n\nfunction getPropertyName(node: unknown): string | undefined {\n if (isIdentifier(node)) {\n return node.name;\n }\n\n if (isObjectValue(node) && typeof (node as Node).value === \"string\") {\n return (node as Node).value as string;\n }\n\n return undefined;\n}\n\nfunction isRawTimeFieldName(name: string): boolean {\n return /(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(name);\n}\n\nfunction isRawTimeDomainField(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"TSPropertySignature\") {\n return false;\n }\n\n const property = node as Node;\n const propertyName = getPropertyName(property.key);\n const typeAnnotation = property.typeAnnotation;\n return (\n propertyName !== undefined &&\n isRawTimeFieldName(propertyName) &&\n (isStringOrNumberTypeAnnotation(typeAnnotation) || isDateTypeAnnotation(typeAnnotation))\n );\n}\n\nfunction typeMembers(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const object = node as Node;\n if (\n object.type === \"TSInterfaceDeclaration\" &&\n typeof object.body === \"object\" &&\n object.body !== null &&\n Array.isArray((object.body as Node).body)\n ) {\n return (object.body as Node).body as unknown[];\n }\n\n if (object.type === \"TSTypeLiteral\" && Array.isArray(object.members)) {\n return object.members as unknown[];\n }\n\n return [];\n}\n\nfunction isErrorLikeTypeName(node: unknown): boolean {\n return isIdentifier(node) && /(?:Error|Failure|Fault)$/i.test(node.name);\n}\n\nfunction isTagOnlyTypeShape(node: unknown): boolean {\n const members = typeMembers(node);\n return members.length === 1 && getPropertyName((members[0] as Node).key) === \"_tag\";\n}\n\nfunction isEmptyTaggedErrorPayload(node: unknown): boolean {\n const superTypeArguments = isObjectValue(node)\n ? (node as Node).superTypeArguments\n : undefined;\n const superParameters = isObjectValue(superTypeArguments)\n ? ((superTypeArguments as Node).params ?? (superTypeArguments as Node).arguments)\n : undefined;\n const parameters = Array.isArray(superParameters) ? superParameters : typeArguments(node);\n if (parameters.length === 0) {\n return true;\n }\n\n const payload = parameters[0];\n return (\n isObjectValue(payload) &&\n ((payload as Node).type === \"TSObjectKeyword\" ||\n ((payload as Node).type === \"TSTypeLiteral\" && typeMembers(payload).length === 0))\n );\n}\n\nfunction emptyErrorTagNode(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const declaration = node as Node;\n if (\n (declaration.type === \"TSTypeAliasDeclaration\" || declaration.type === \"TSInterfaceDeclaration\") &&\n isErrorLikeTypeName(declaration.id) &&\n isTagOnlyTypeShape(\n declaration.type === \"TSTypeAliasDeclaration\" ? declaration.typeAnnotation : declaration,\n )\n ) {\n return node;\n }\n\n if (\n declaration.type === \"ClassDeclaration\" &&\n isMemberCall(declaration.superClass, \"Data\", \"TaggedError\") &&\n isEmptyTaggedErrorPayload(declaration)\n ) {\n return node;\n }\n\n return undefined;\n}\n\nfunction rawTimeDomainFields(node: unknown): unknown[] {\n return typeMembers(node).filter(isRawTimeDomainField);\n}\n\nfunction isOverloadedOptionsParameter(node: unknown): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n\n return (\n /^(?:opts|options|config)$/i.test(node.name) &&\n isAnyOrObjectTypeAnnotation((node as Node).typeAnnotation)\n );\n}\n\nfunction overloadedOptionsParameters(node: unknown): unknown[] {\n if (!isObjectValue(node) || !Array.isArray((node as Node).params)) {\n return [];\n }\n\n return ((node as Node).params as unknown[]).filter(isOverloadedOptionsParameter);\n}\n\nconst comparisonOperators = new Set([\"==\", \"===\", \"!=\", \"!==\", \">\", \">=\", \"<\", \"<=\"]);\n\nfunction comparisonCount(node: unknown, seen = new WeakSet<object>()): number {\n if (Array.isArray(node)) {\n return node.reduce((count, child) => count + comparisonCount(child, seen), 0);\n }\n\n if (!isObjectValue(node)) {\n return 0;\n }\n\n if (seen.has(node)) {\n return 0;\n }\n seen.add(node);\n\n const expression = node as Node;\n if (expression.type === \"BinaryExpression\" && comparisonOperators.has(String(expression.operator))) {\n return 1;\n }\n\n if (expression.type !== \"LogicalExpression\") {\n return 0;\n }\n\n return comparisonCount(expression.left, seen) + comparisonCount(expression.right, seen);\n}\n\nfunction isDomainLogicConditional(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"LogicalExpression\" &&\n comparisonCount(node) >= 3\n );\n}\n\nfunction stateFlagMember(node: unknown): { objectName: string; propertyName: string } | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"MemberExpression\") {\n return undefined;\n }\n\n const member = node as Node;\n if (member.computed === true || !isIdentifier(member.object) || !isIdentifier(member.property)) {\n return undefined;\n }\n\n const propertyName = member.property.name;\n if (!/(?:cancelled|canceled|shipped|approved|rejected|pending|active|inactive|enabled|disabled|locked|archived|deleted|submitted|processing|failed|complete|completed)$/i.test(propertyName)) {\n return undefined;\n }\n\n return {\n objectName: member.object.name,\n propertyName,\n };\n}\n\nfunction collectStateFlagMembers(\n node: unknown,\n members = new Map<string, Set<string>>(),\n seen = new WeakSet<object>(),\n): Map<string, Set<string>> {\n const member = stateFlagMember(node);\n if (member) {\n const properties = members.get(member.objectName) ?? new Set<string>();\n properties.add(member.propertyName);\n members.set(member.objectName, properties);\n return members;\n }\n\n if (Array.isArray(node)) {\n for (const child of node) {\n collectStateFlagMembers(child, members, seen);\n }\n return members;\n }\n\n if (!isObjectValue(node)) {\n return members;\n }\n\n if (seen.has(node)) {\n return members;\n }\n seen.add(node);\n\n const expression = node as Node;\n if (expression.type !== \"LogicalExpression\") {\n return members;\n }\n\n collectStateFlagMembers(expression.left, members, seen);\n collectStateFlagMembers(expression.right, members, seen);\n return members;\n}\n\nfunction isImplicitStateMachineObject(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"LogicalExpression\") {\n return false;\n }\n\n return Array.from(collectStateFlagMembers(node).values()).some((properties) => properties.size >= 2);\n}\n\nfunction isAdhocEffectFail(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"fail\") && isStringLiteral(firstArgument(node));\n}\n\nfunction isErrorLikeIdentifier(node: unknown): boolean {\n return isIdentifier(node) && /(?:error|err|cause|failure|reason)/i.test(node.name);\n}\n\nfunction isErrorMessageReference(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"MemberExpression\") {\n return false;\n }\n\n const member = node as Node;\n return (\n member.computed !== true &&\n isIdentifier(member.property, \"message\") &&\n isErrorLikeIdentifier(member.object)\n );\n}\n\nfunction isStringifiedErrorMessage(node: unknown): boolean {\n if (isErrorMessageReference(node)) return true;\n if (!isObjectValue(node)) return false;\n\n const expression = node as Node;\n if (expression.type === \"BinaryExpression\" && expression.operator === \"+\") {\n return isStringifiedErrorMessage(expression.left) || isStringifiedErrorMessage(expression.right);\n }\n\n return expression.type === \"TemplateLiteral\" && Array.isArray(expression.expressions) && (\n expression.expressions as unknown[]\n ).some((child) => isStringifiedErrorMessage(child));\n}\n\nfunction isEffectFailFromErrorMessage(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"fail\") && isStringifiedErrorMessage(firstArgument(node));\n}\n\nfunction isGenericErrorConstruction(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"NewExpression\" &&\n isIdentifier((node as Node).callee, \"Error\")\n );\n}\n\nfunction isEffectFailWithGenericError(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"fail\") && isGenericErrorConstruction(firstArgument(node));\n}\n\nfunction errorHandlerCallbacks(node: unknown, operators: ReadonlySet<string>): unknown[] {\n if (!isEffectMemberCall(node)) return [];\n\n const property = ((node as Node).callee as Node).property;\n if (!isIdentifier(property) || !operators.has(property.name)) return [];\n\n return (node as Node & { arguments: unknown[] }).arguments.filter(isFunctionLike);\n}\n\nfunction plainCatchOperators(version: EffectVersion): ReadonlySet<string> {\n return version === 3 ? catchAllOperators : catchOperators;\n}\n\nfunction handlerReturnStatements(node: unknown, seen = new WeakSet<object>()): unknown[] {\n if (Array.isArray(node)) return node.flatMap((child) => handlerReturnStatements(child, seen));\n if (!isObjectValue(node) || seen.has(node) || isFunctionLike(node)) return [];\n seen.add(node);\n if ((node as Node).type === \"ReturnStatement\") return [node];\n return Object.entries(node).flatMap(([key, child]) => key === \"parent\" ? [] : handlerReturnStatements(child, seen));\n}\n\nfunction catchAllGenericRethrow(node: unknown, version: EffectVersion): unknown | undefined {\n for (const callback of errorHandlerCallbacks(node, plainCatchOperators(version))) {\n const body = callbackBody(callback);\n if (isEffectFailWithGenericError(body)) return body;\n\n for (const returnNode of handlerReturnStatements(body)) {\n if (isEffectFailWithGenericError((returnNode as Node).argument)) {\n return (returnNode as Node).argument;\n }\n }\n }\n\n return undefined;\n}\n\nconst modeledErrorOperators = new Set([\n \"catchSome\",\n \"catchTag\",\n \"catchTags\",\n \"fail\",\n \"mapBoth\",\n \"mapError\",\n]);\n\nfunction isModeledErrorOperation(node: unknown): boolean {\n if (!isEffectMemberCall(node)) return false;\n\n const property = ((node as Node).callee as Node).property;\n return isIdentifier(property) && modeledErrorOperators.has(property.name);\n}\n\nconst legacyLogOnlyOperators = new Set([\"catchAll\", \"tapError\"]);\n\nfunction logOnlyErrorHandler(node: unknown, version: EffectVersion): unknown | undefined {\n const callbacks = version === 3\n ? errorHandlerCallbacks(node, legacyLogOnlyOperators)\n : effectLogicCallbacks(node, version).filter(() =>\n /^catch/.test(String((((node as Node).callee as Node).property as Node).name)));\n for (const callback of callbacks) {\n const body = callbackBody(callback);\n const search = version === 3 ? findNode : findOwnCallbackNode;\n const log = search(body, isEffectLogCall);\n if (!log) continue;\n\n const modeled = search(body, (child) => isModeledErrorOperation(child) ||\n (version === 4 && (isEffectMemberCallNamed(child, \"failCause\") || isEffectMemberCallNamed(child, \"die\"))));\n if (!modeled) return log;\n }\n\n return undefined;\n}\n\nconst catchAllOperators = new Set([\"catchAll\"]);\nconst catchOperators = new Set([\"catch\", \"catchEager\"]);\nconst expectedDomainStateNames = new Set([\"NotFound\", \"Missing\", \"Empty\", \"None\"]);\n\nfunction isFallbackRecoveryValue(node: unknown): boolean {\n return (\n isNullLiteral(node) ||\n isUndefinedIdentifier(node) ||\n (isIdentifier(node) && /(?:fallback|default)/i.test(node.name))\n );\n}\n\nfunction isFallbackRecoveryEffect(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"succeed\") && isFallbackRecoveryValue(firstArgument(node));\n}\n\nfunction earlyCatchAllFallback(node: unknown, version: EffectVersion): unknown | undefined {\n for (const callback of errorHandlerCallbacks(node, plainCatchOperators(version))) {\n const body = callbackBody(callback);\n if (isFallbackRecoveryEffect(body)) return body;\n\n for (const returnNode of handlerReturnStatements(body)) {\n if (isFallbackRecoveryEffect((returnNode as Node).argument)) {\n return (returnNode as Node).argument;\n }\n }\n }\n\n return undefined;\n}\n\nfunction isExpectedDomainStateFailure(node: unknown): boolean {\n if (!isEffectMemberCallNamed(node, \"fail\")) return false;\n\n const argument = firstArgument(node);\n return isStringLiteral(argument) && expectedDomainStateNames.has(String((argument as Node).value));\n}\n\nfunction isDomainErrorConstruction(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"NewExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n return isIdentifier(callee) && /(?:Error|Exception)$/.test(callee.name);\n}\n\nfunction isDomainExceptionThrow(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"ThrowStatement\") {\n return false;\n }\n\n return isDomainErrorConstruction((node as Node).argument);\n}\n\nfunction findDomainExceptionInEffectLogic(node: unknown, version: EffectVersion): unknown | undefined {\n return findEffectLogicNode(node, version, isDomainExceptionThrow);\n}\n\nfunction isThrowNewStringError(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"ThrowStatement\") {\n return false;\n }\n\n const argument = (node as Node).argument;\n return (\n isObjectValue(argument) &&\n (argument as Node).type === \"NewExpression\" &&\n isIdentifier((argument as Node).callee, \"Error\") &&\n Array.isArray((argument as Node).arguments) &&\n isStringLiteral(((argument as Node).arguments as unknown[])[0])\n );\n}\n\nfunction hasRawDomainIdParameter(node: unknown): boolean {\n if (!isObjectValue(node) || !Array.isArray((node as Node).params)) {\n return false;\n }\n\n return ((node as Node).params as unknown[]).some((param) => (\n isIdentifier(param) &&\n /(?:^id$|Id$|ID$)/.test(param.name) &&\n isStringOrNumberTypeAnnotation((param as Node).typeAnnotation)\n ));\n}\n\nfunction isContextEncodedDomainFunction(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"FunctionDeclaration\") {\n return false;\n }\n\n const id = (node as Node).id;\n return (\n isIdentifier(id) &&\n /(?:Admin|Public|Internal|External|Private|Backoffice|Panel)/.test(id.name) &&\n hasRawDomainIdParameter(node)\n );\n}\n\nfunction isStringLiteralComparison(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"BinaryExpression\") {\n return false;\n }\n\n const binary = node as Node;\n return (\n [\"==\", \"===\", \"!=\", \"!==\"].includes(String(binary.operator)) &&\n (isStringLiteral(binary.left) || isStringLiteral(binary.right)) &&\n !isTypeofBooleanCheck(binary)\n );\n}\n\nfunction report(context: OxlintContext, node: unknown, message: string) {\n context.report({ message, node: node as ESTree.Node });\n}\n\nfunction isNullLiteral(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const literal = node as Node;\n return (\n literal.type === \"NullLiteral\" ||\n (literal.type === \"Literal\" && literal.value === null)\n );\n}\n\nfunction getImportSource(node: unknown): string | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const source = (node as Node).source;\n if (typeof source === \"string\") {\n return source;\n }\n\n if (isObjectValue(source)) {\n const value = (source as Node).value;\n if (typeof value === \"string\") {\n return value;\n }\n }\n\n return undefined;\n}\n\nconst defaultBoundaryPaths = [\n \"bin/**\", \"scripts/**\", \"cli/**\", \"**/main.ts\",\n \"app/api/**/route.ts\", \"server/**\", \"*.test.ts\", \"*.spec.ts\",\n] as const;\n\nconst defaultTestPaths = [\"**/*.test.*\", \"**/*.spec.*\", \"**/__tests__/**\"] as const;\n\nconst defaultConfigPaths = [\"**/config/**\", \"**/*Config.ts\", \"**/*ConfigLayer.ts\"] as const;\n\nconst boundaryPathOptionsSchema = [{\n type: \"object\",\n properties: {\n boundaryPaths: { type: \"array\", items: { type: \"string\" } },\n },\n additionalProperties: false,\n}] as const;\n\nconst processEnvPathOptionsSchema = [{\n type: \"object\",\n properties: {\n boundaryPaths: { type: \"array\", items: { type: \"string\" } },\n configPaths: { type: \"array\", items: { type: \"string\" } },\n },\n additionalProperties: false,\n}] as const;\n\nfunction rulePathOptions(context: OxlintContext): Record<string, unknown> {\n const firstOption = context.options[0];\n return isObjectValue(firstOption)\n ? firstOption as Record<string, unknown>\n : {};\n}\n\nfunction stringArrayOption(options: Record<string, unknown>, name: string): readonly string[] | undefined {\n const value = options[name];\n return Array.isArray(value) && value.every((item) => typeof item === \"string\")\n ? value\n : undefined;\n}\n\nfunction normalisePath(path: string): string {\n return path.replace(/\\\\/g, \"/\").replace(/^\\.\\/+/, \"\").replace(/\\/{2,}/g, \"/\").replace(/\\/$/, \"\");\n}\n\nfunction globSegmentToRegExp(segment: string): string {\n return segment.replace(/[|\\\\{}()[\\]^$+?.]/g, \"\\\\$&\").replace(/\\*/g, \"[^/]*\");\n}\n\nfunction globToRegExp(pattern: string): RegExp {\n const normalisedPattern = normalisePath(pattern);\n if (normalisedPattern === \"**\") {\n return /^.*$/;\n }\n\n const segments = normalisedPattern.split(\"/\");\n const startsWithGlobstar = segments[0] === \"**\";\n const firstSegment = startsWithGlobstar ? 1 : 0;\n let expression = startsWithGlobstar ? \"^(?:.*/)?\" : \"(?:^|.*/)\";\n\n for (let index = firstSegment; index < segments.length; index += 1) {\n const segment = segments[index];\n const isLastSegment = index === segments.length - 1;\n\n if (segment === \"**\") {\n expression += isLastSegment ? \"(?:/.*)?\" : \"(?:/[^/]+)*\";\n continue;\n }\n\n if (index > firstSegment) {\n expression += \"/\";\n }\n expression += globSegmentToRegExp(segment);\n }\n\n return new RegExp(`${expression}$`);\n}\n\nfunction pathMatchesPattern(filename: string, pattern: string): boolean {\n return globToRegExp(pattern).test(normalisePath(filename));\n}\n\nfunction boundaryPathsFor(context: OxlintContext): readonly string[] {\n return stringArrayOption(rulePathOptions(context), \"boundaryPaths\") ?? defaultBoundaryPaths;\n}\n\nfunction isBoundaryPath(context: OxlintContext): boolean {\n return boundaryPathsFor(context).some((pattern) => pathMatchesPattern(context.filename, pattern));\n}\n\nfunction isTestPath(context: OxlintContext): boolean {\n return defaultTestPaths.some((pattern) => pathMatchesPattern(context.filename, pattern));\n}\n\nfunction configPathsFor(context: OxlintContext): readonly string[] {\n return stringArrayOption(rulePathOptions(context), \"configPaths\") ?? defaultConfigPaths;\n}\n\nfunction isConfigPath(context: OxlintContext): boolean {\n return configPathsFor(context).some((pattern) => pathMatchesPattern(context.filename, pattern));\n}\n\nfunction isEffectEcosystemImport(source: string): boolean {\n return (\n source === \"effect\" ||\n source.startsWith(\"effect/\") ||\n source === \"@effect-atom/atom-react\"\n );\n}\n\nfunction directTestCallback(node: unknown): Node | undefined {\n if (\n !isIdentifierCall(node, \"it\") &&\n !isIdentifierCall(node, \"test\") &&\n !isIdentifierCall(node, \"specify\") &&\n !isIdentifierCall(node, \"bench\")\n ) {\n return undefined;\n }\n\n const arguments_ = (node as Node & { arguments?: unknown[] }).arguments;\n const callback = arguments_?.at(-1);\n return isFunctionLike(callback) ? callback as Node : undefined;\n}\n\nfunction isPromiseRunExecution(node: unknown, version: EffectVersion): boolean {\n return isEffectMemberCallNamed(node, \"runPromise\") || (version === 4 &&\n isObjectValue(node) &&\n isEffectMemberCallNamed((node as Node).callee, \"runPromiseWith\") &&\n effectRunExecution(node, version)?.program !== undefined);\n}\n\nfunction discardedRunPromiseInTestCallback(callback: Node, version: EffectVersion = 3): Node | undefined {\n const body = callback.body;\n if (isPromiseRunExecution(body, version)) {\n return undefined;\n }\n\n if (\n !isObjectValue(body) ||\n (body as Node).type !== \"BlockStatement\" ||\n !Array.isArray((body as Node).body)\n ) {\n return undefined;\n }\n\n for (const statement of (body as Node & { body: unknown[] }).body) {\n if (\n isObjectValue(statement) &&\n (statement as Node).type === \"ExpressionStatement\" &&\n isPromiseRunExecution((statement as Node).expression, version)\n ) {\n return (statement as Node).expression as Node;\n }\n }\n\n return undefined;\n}\n\nfunction nodesInDirectTestCallback(\n callback: Node,\n predicate: (node: Node) => boolean,\n): Node[] {\n const matches: Node[] = [];\n const seen = new WeakSet<object>();\n\n function visit(node: unknown, isRoot = false): void {\n if (Array.isArray(node)) {\n for (const child of node) {\n visit(child);\n }\n return;\n }\n\n if (!isObjectValue(node) || seen.has(node)) {\n return;\n }\n seen.add(node);\n\n const candidate = node as Node;\n if (!isRoot && isFunctionLike(candidate)) {\n return;\n }\n if (predicate(candidate)) {\n matches.push(candidate);\n }\n\n for (const [key, child] of Object.entries(candidate)) {\n if (key !== \"parent\") {\n visit(child);\n }\n }\n }\n\n visit(callback, true);\n return matches;\n}\n\nfunction isEffectRunPromiseRejectsMember(node: unknown, version: EffectVersion = 3): node is Node {\n if (\n !isObjectValue(node) ||\n (node as Node).type !== \"MemberExpression\" ||\n (node as Node).computed === true ||\n !isIdentifier((node as Node).property, \"rejects\")\n ) {\n return false;\n }\n\n const expectation = (node as Node).object;\n if (!isIdentifierCall(expectation, \"expect\")) {\n return false;\n }\n\n const arguments_ = (expectation as Node).arguments;\n if (!Array.isArray(arguments_)) {\n return false;\n }\n\n const argument = arguments_[0];\n return isPromiseRunExecution(argument, version);\n}\n\nfunction isServiceDefaultReference(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"MemberExpression\" &&\n (node as Node).computed !== true &&\n isIdentifier((node as Node).property, \"Default\")\n );\n}\n\nfunction isManualTestLayer(node: unknown): boolean {\n return isMemberCall(node, \"Layer\", \"succeed\") || isMemberCall(node, \"Layer\", \"effect\");\n}\n\nfunction manualLayersNextToServiceDefault(node: unknown): Node[] {\n if (!isMemberCall(node, \"Layer\", \"provide\")) {\n return [];\n }\n\n const arguments_ = (node as Node).arguments;\n if (!Array.isArray(arguments_) || !arguments_.some(isServiceDefaultReference)) {\n return [];\n }\n\n return arguments_.filter(isManualTestLayer) as Node[];\n}\n\nfunction importsEffectSchema(node: unknown): boolean {\n const source = getImportSource(node);\n if (source === \"effect/Schema\") {\n return true;\n }\n\n if (source !== \"effect\" || !isObjectValue(node)) {\n return false;\n }\n\n const specifiers = (node as Node).specifiers;\n return Array.isArray(specifiers) && specifiers.some((specifier) => {\n if (!isObjectValue(specifier)) {\n return false;\n }\n\n const item = specifier as Node;\n return item.type === \"ImportSpecifier\" && isIdentifier(item.imported, \"Schema\");\n });\n}\n\nfunction createEffectGatedStatementRule(\n visitorName: \"IfStatement\" | \"SwitchStatement\" | \"ConditionalExpression\",\n message: string | ((version: EffectVersion) => string),\n) {\n return defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n [visitorName](node: any) {\n if (hasEffectEcosystemImport) {\n report(context, node, typeof message === \"string\" ? message : message(effectVersionFor(context.options)));\n }\n },\n };\n },\n });\n}\n\nconst reactStateHooks = new Set([\n \"useState\",\n \"useReducer\",\n \"useContext\",\n \"useCallback\",\n \"useEffect\",\n \"useSyncExternalStore\",\n]);\n\nconst noReactState = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n CallExpression(node: any) {\n const callee = node.callee;\n const hookName = isIdentifier(callee)\n ? callee.name\n : isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n isIdentifier((callee as Node).property)\n ? ((callee as Node).property as { name: string }).name\n : undefined;\n\n if (hookName && reactStateHooks.has(hookName)) {\n report(\n context,\n callee,\n version === 3\n ? \"Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.\"\n : \"Rule: avoid React state hooks. Why: they bypass externally owned reactive state. Fix: pass explicit state as props or use a compatible reactive adapter at the UI boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noIfStatement = createEffectGatedStatementRule(\n \"IfStatement\",\n \"Rule: avoid imperative if branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type or Effect combinators instead.\",\n);\n\nconst noSwitchStatement = createEffectGatedStatementRule(\n \"SwitchStatement\",\n \"Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead.\",\n);\n\nconst noTernary = createEffectGatedStatementRule(\n \"ConditionalExpression\",\n (version) => `Rule: avoid ternary expressions. Why: they hide control flow inside expressions. Fix: use Option.match/${version === 3 ? \"Either\" : \"Result\"}.match/Match.value or data combinators, then run one Effect pipeline.`,\n);\n\nconst noReturnNull = createVersionedEffectCallbackRule(\n (node: any) => isNullLiteral(node.argument) ? node : undefined,\n () => \"Rule: avoid returning null. Why: null is a sentinel that forces defensive guards. Fix: use Option.none for absence or Effect.fail for errors.\",\n false,\n false,\n [\"ReturnStatement\"],\n);\n\nconst noOptionAs = createVersionedEffectCallbackRule(\n (node: any) => isMemberExpression(node.callee, \"Option\", \"as\") ? node : undefined,\n () => \"Rule: avoid Option.as. Why: it hides selection and encourages placeholder flows. Fix: use Option.map or Option.match and return the value explicitly.\",\n);\n\nconst noEffectNever = createVersionedEffectCallbackRule(\n (node) => isMemberExpression(node, \"Effect\", \"never\") ? node : undefined,\n () => \"Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.\",\n false,\n false,\n [\"MemberExpression\"],\n);\n\nconst noArrowLadder = createVersionedEffectCallbackRule(\n (node) => isArrowIifeCall(node) ? findArrowIifeCall(node.callee.body) : undefined,\n (version) => \"Rule: avoid nested IIFEs. Why: they hide sequencing and push wrapper hacks. Fix: bind a named context with const and keep one flat pipeline with a single Match/Option decision.\",\n);\n\nconst noBranchInObject = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n ObjectExpression(node: any) {\n if (objectPropertyValues(node).some((value) => containsObjectBranchCall(value, version))) {\n report(\n context,\n node,\n `Rule: avoid Match/Option/${version === 3 ? \"Either\" : \"Result\"} inside object literals. Why: it hides the decision and invites workaround scaffolding. Fix: compute the value first (context), then build the object from named values with one flat decision.`,\n );\n }\n },\n };\n },\n});\n\nconst noIifeWrapper = createVersionedEffectCallbackRule(\n (node) => isInlineFunctionIifeCall(node) ? node : undefined,\n () => \"Rule: avoid immediate invocation of inline functions. Why: it hides decisions and sequencing. Fix: bind a named context with const and keep one Match/Option decision in a flat pipeline.\",\n);\n\nconst noReturnInArrow = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n CallExpression(node: any) {\n for (const returnNode of directArrowCallbackReturns(node, version)) {\n report(\n context,\n returnNode,\n \"Rule: avoid block-bodied arrow callbacks with returns. Why: they hide local control flow. Fix: use expression-only callbacks and move the logic into a single pipeline (pipe/Match/Option/A.map).\",\n );\n }\n },\n };\n },\n});\n\nconst noReturnInCallback = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n for (const returnNode of directFunctionCallbackReturns(node)) {\n report(\n context,\n returnNode,\n \"Rule: avoid returns inside inline callbacks. Why: they hide control flow. Prefer expression-only callbacks, but leaf-level Effect branches with local bindings may use returns when needed.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectFnGenerator = createVersionedEffectCallbackRule(\n (node, version) => isEffectGeneratorCall(node, \"fn\", version) ? node : undefined,\n () => \"Rule: avoid Effect.fn generator wrappers. Why: they hide sequencing and dodge ladder rules. Fix: keep a single flat pipeline or use one Effect.gen.\",\n);\n\nconst noEffectSyncConsole = createVersionedEffectCallbackRule(\n (node) => isEffectMemberCallNamed(node, \"sync\") && containsConsoleCall(firstArgument(node)) ? node : undefined,\n () => \"Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call.\",\n);\n\nfunction createCollectedEffectRule(\n find: (node: unknown, version: EffectVersion) => unknown[],\n message: string,\n visitorNames: string[],\n) {\n return defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let imported = false;\n const candidates: object[] = [];\n const seen = new WeakSet<object>();\n const collect = (node: unknown) => {\n for (const target of find(node, version)) {\n if (!isObjectValue(target) || seen.has(target)) continue;\n seen.add(target);\n candidates.push(target);\n }\n };\n return {\n ImportDeclaration(node: unknown) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) imported = true;\n },\n ...Object.fromEntries(visitorNames.map(name => [name, collect])),\n \"Program:exit\"() {\n if (imported) for (const target of candidates) report(context, target, message);\n },\n };\n },\n });\n}\n\nconst observabilityVisitors = [\"CallExpression\", \"ClassDeclaration\", \"ClassExpression\"];\nconst noConsoleInEffectFlow = createCollectedEffectRule(\n consoleCallsInEffectFlow,\n \"Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.\",\n observabilityVisitors,\n);\n\nconst noEffectLogWithoutStructuredContext = createCollectedEffectRule(\n (node, version) => {\n const options = serviceConstructionOptions(node, version);\n const implementation = options && serviceConstructionImplementation(options, version);\n return [...errorHandlerBodies(node, version), ...(implementation ? [implementation] : [])].flatMap(contextlessErrorLogs);\n },\n \"Rule: add structured context to Effect.logError or Effect.logWarning. Why: static failure messages cannot be correlated. Fix: include an error or context object, or use Effect.annotateLogs(...).\",\n observabilityVisitors,\n);\n\nconst requireSpanOnPublicServiceMethod = createCollectedEffectRule(\n (node, version) => {\n const options = serviceConstructionOptions(node, version);\n return [\n ...exportedFunctionValues(node).map(operation => publicEffectOperationWithoutSpan(operation.functionNode, operation.declaredReturnType)),\n ...(options ? serviceMethodFunctions(options, version).map(serviceEffectOperationWithoutSpan) : []),\n ].filter(candidate => candidate !== undefined);\n },\n \"Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).\",\n [...observabilityVisitors, \"ExportNamedDeclaration\", \"ExportDefaultDeclaration\"],\n);\n\nconst noRunpromiseInNonAsyncTestBody = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n const candidates: Node[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (!isTestPath(context)) {\n return;\n }\n\n const callback = directTestCallback(node);\n const candidate = callback && discardedRunPromiseInTestCallback(callback, version);\n if (candidate) {\n candidates.push(candidate);\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const candidate of candidates) {\n report(\n context,\n candidate,\n \"Rule: do not discard Effect.runPromise in a test body. Why: the test can finish before the Effect result is observed. Fix: await or return Effect.runPromise so the test framework observes completion.\",\n );\n }\n },\n };\n },\n});\n\nconst requireEffectFlipForErrorTest = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n const candidates: Node[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (!isTestPath(context)) {\n return;\n }\n\n const callback = directTestCallback(node);\n if (callback) {\n candidates.push(...nodesInDirectTestCallback(callback, candidate => isEffectRunPromiseRejectsMember(candidate, version)));\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const candidate of candidates) {\n report(\n context,\n candidate,\n \"Rule: prefer Effect.flip for expected typed Effect failures in tests. Why: it turns the expected failure into a successful error value for structural assertions. Fix: flip the Effect, then assert the error _tag, message, and fields.\",\n );\n }\n },\n };\n },\n});\n\nconst noTestMockLayerWhenDefaultAvailable = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const candidates: Node[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (isTestPath(context)) {\n candidates.push(...manualLayersNextToServiceDefault(node));\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const candidate of candidates) {\n report(\n context,\n candidate,\n \"Rule: avoid a manual test layer beside an explicit service Default layer. Why: the test is already opting into the service's real default composition and the sibling mock can hide that contract. Fix: use the Default layer with its required infrastructure, or remove Default when a replacement is intentional.\",\n );\n }\n },\n };\n },\n});\n\nconst noNestedEffectGen = createVersionedEffectCallbackRule(\n (node, version) => { const generator = getEffectGeneratorArgument(node, \"gen\", version); return generator ? version === 3 ? findEffectGenCall(generator.body) : findOwnCallbackNode(generator.body, (child) => isEffectMemberCallNamed(child, \"gen\")) : undefined; },\n (version) => \"Rule: avoid nested Effect.gen. Why: nested generators hide sequencing. Fix: flatten to a single Effect.gen per method or a single flat pipeline.\",\n);\n\nconst noYieldWithoutStarInEffectGen = createVersionedEffectCallbackRule(\n findYieldWithoutStarInEffectGen,\n (version) => version === 3\n ? \"Rule: use yield* inside Effect.gen. Why: plain yield returns an Effect value without delegating to the Effect interpreter. Fix: replace `yield Effect.x` with `yield* Effect.x`.\"\n : \"Rule: use yield* inside Effect.gen. Why: delegation preserves the yielded Effect's result typing and keeps workflow style consistent. Fix: replace `yield Effect.x` with `yield* Effect.x`.\",\n);\n\nconst noPipedYieldInGen = createVersionedEffectCallbackRule(\n repeatedPipedYieldInEffectGen,\n (version) => \"Rule: avoid repeated piped yields inside Effect.gen. Why: decorated effects hidden inside generator steps obscure the workflow. Fix: extract decorated effects first, then yield the named workflow steps.\",\n);\n\nconst noGenForMapping = createVersionedEffectCallbackRule(\n genForMappingNode,\n (version) => \"Rule: avoid Effect.gen for simple mapping. Why: tiny generators hide pure transformations behind workflow syntax. Fix: map the yielded effect with Effect.map or a named pure transformation.\",\n);\n\nconst preferGenForWorkflow = createVersionedEffectCallbackRule(\n workflowSequencingPipeline,\n (version) => \"Rule: prefer Effect.gen for workflow sequencing. Why: long flatMap/andThen/tap pipelines read like imperative workflow. Fix: move the sequential story into one Effect.gen and keep pipe for behavior decoration.\",\n);\n\nconst noLargeAnonymousFlow = createVersionedEffectCallbackRule(\n (node) => isLargeFlowCall(node) ? node : undefined,\n (version) => \"Rule: avoid large anonymous flow expressions. Why: long pure transformation chains need a domain name. Fix: extract a named flow or split the transformation into named pure steps.\",\n);\n\nconst noEffectInFlow = createVersionedEffectCallbackRule(\n effectfulFlowArgument,\n (version) => \"Rule: avoid Effect work inside flow. Why: flow should stay a reusable pure transformation boundary. Fix: keep Effect sequencing, logging, retries, and dependency access in Effect pipelines.\",\n);\n\nconst preferNamedFlow = createVersionedEffectCallbackRule(\n inlineNonTrivialFlowArgument,\n (version) => \"Rule: prefer named flow transformations. Why: non-trivial pure transformations passed inline are hard to reuse and review. Fix: extract the flow to a named const.\",\n);\n\nconst preferFlowForPurePipeline = createVersionedEffectCallbackRule(\n preferFlowForPurePipelineNode,\n (version) => \"Rule: prefer flow for a deep pure call pipeline. Why: nested transformation towers hide the data pipeline and make reuse difficult. Fix: name the pure steps and compose them with flow, or keep the pipeline short.\",\n);\n\nconst noBusinessLogicInPipe = createVersionedEffectCallbackRule(\n businessLogicInPipeCallback,\n (version) => \"Rule: keep business workflow logic out of Effect.pipe callbacks. Why: branching, service lookup, and multi-step effects are hard to read as decoration. Fix: move the workflow into Effect.gen and reserve pipe for behavior around the completed effect.\",\n);\n\nconst preferPipeForBehavior = createVersionedEffectCallbackRule(\n staticBehaviorCall,\n () => \"Rule: prefer .pipe() for behavior decoration. Why: retry, timeout, spans, logging, recovery, DI, and value transforms decorate an existing effect. Fix: write `program.pipe(Effect.retry(policy))` instead of `Effect.retry(program, policy)`.\",\n);\nconst preferDecoratedEffectBeforeGen = createVersionedEffectCallbackRule(\n repeatedDecoratedYieldInEffectGen,\n () => \"Rule: extract decorated effects before Effect.gen. Why: repeated retry/timeout/span/logging decorators inside generator yields bury behavior policy in workflow steps. Fix: name the decorated effects first, then yield the workflow story.\",\n);\nconst noWorkflowInBehaviorPipe = createVersionedEffectCallbackRule(\n workflowInBehaviorPipe,\n () => \"Rule: avoid workflow sequencing inside behavior pipes. Why: behavior pipes should answer how an effect behaves, not hide the workflow story. Fix: move multi-step sequencing into Effect.gen and keep retry/timeout/spans/logging as decorators around named effects.\",\n);\nconst noMixedPillarFunction = createVersionedEffectCallbackRule(\n mixedPillarFunctionNode,\n (version) => \"Rule: avoid mixing Effect style pillars in one function. Why: workflow, pure transformation, behavior decoration, and Layer wiring each need a clear boundary. Fix: extract named concepts for each pillar and compose them at the call site.\",\n false,\n false,\n [\"FunctionDeclaration\",\"FunctionExpression\",\"ArrowFunctionExpression\"],\n);\n\nconst noCleverEffectExpression = createVersionedEffectCallbackRule(\n cleverEffectExpressionNode,\n (version) => \"Rule: avoid clever Effect expressions. Why: deeply nested expressions that combine style pillars hide the domain story. Fix: extract named workflow, pure transformation, and behavior steps.\",\n);\n\nconst preferExtractedConcept = createVersionedEffectCallbackRule(\n oversizedAnonymousConceptNode,\n (version) => \"Rule: prefer extracting named concepts from oversized anonymous callbacks. Why: multi-step inline callbacks hide domain intent. Fix: name the transformation, policy, or workflow step before passing it into Effect.\",\n);\n\nconst preferEffectService = createVersionedEffectCallbackRule(\n (node, version) => isContextTagCall(node) || (version === 4 && isEffectMemberCallNamed(node, \"Service\")) ? node : undefined,\n (version) => version === 3\n ? \"Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.\"\n : \"Rule: prefer Context.Service. Fix: migrate legacy Context.Tag, Context.GenericTag or Effect.Service definitions to Context.Service; construct implementations with make and explicit Layer wiring where needed.\",\n);\n\nconst noLayerProvideInServiceDefinition = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ClassDeclaration(node: any) {\n if (version === 4) return;\n const options = effectServiceClassOptions(node);\n if (hasEffectEcosystemImport && options && containsLayerProvideCall(options)) {\n report(\n context,\n options,\n \"Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.\",\n );\n }\n },\n CallExpression(node: any) {\n if (version === 3 || !hasEffectEcosystemImport) return;\n const options = effectServiceOptionsObject(node, version);\n const make = options && objectPropertyValue(options, \"make\");\n if (make && containsLayerProvideCall(make)) {\n report(context, options, \"Rule: do not assemble layers inside Context.Service make. Fix: keep make focused on constructing the implementation and compose Layer.provide at app/test boundaries.\");\n }\n },\n };\n },\n});\n\nconst requireServiceAccessors = defineRule({\n create(context: OxlintContext) {\n if (effectVersionFor(context.options) === 4) return {};\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ClassDeclaration(node: any) {\n const options = effectServiceClassOptions(node);\n if (hasEffectEcosystemImport && options && !hasAccessorsTrue(options)) {\n report(\n context,\n options,\n \"Rule: set accessors: true. Fix: add it to Effect.Service options.\",\n );\n }\n },\n };\n },\n});\n\nconst requireServiceDependencies = defineRule({\n create(context: OxlintContext) {\n if (effectVersionFor(context.options) === 4) return {};\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ClassDeclaration(node: any) {\n const options = effectServiceClassOptions(node);\n const dependency = options ? serviceDependencyWithoutDeclaration(options) : undefined;\n if (hasEffectEcosystemImport && dependency) {\n report(\n context,\n dependency,\n \"Rule: declare service dependencies.\",\n );\n }\n },\n };\n },\n});\n\nconst noNamespaceEffectImport = defineRule({\n create(context: OxlintContext) {\n return {\n ImportDeclaration(node: any) {\n const namespaceImport = namespaceEffectImport(node);\n if (namespaceImport) {\n report(\n context,\n namespaceImport,\n \"Rule: avoid namespace imports from Effect packages.\",\n );\n }\n },\n };\n },\n});\n\nconst noManualServiceObjectExport = createVersionedEffectCallbackRule(\n manualServiceObjectExport,\n (version) => \"Rule: avoid exported manual service objects.\",\n false,\n false,\n [\"ExportNamedDeclaration\"],\n);\n\nconst preferLayerPipe = createVersionedEffectCallbackRule(\n layerProvideCallTower,\n (version) => \"Rule: prefer Layer.pipe for nested layer provisioning.\",\n);\n\nconst noInlineLayerProvideInProgram = createVersionedEffectCallbackRule(\n inlineLayerProvideInProgram,\n (version) => \"Rule: avoid inline layer provisioning inside programs.\",\n);\n\nconst preferLayerMergeallForInfrastructure = createVersionedEffectCallbackRule(\n layerMergeChain,\n (version) => \"Rule: prefer Layer.mergeAll for infrastructure layer groups.\",\n);\n\nconst noServiceLayerScatter = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n let scatteredLayerCount = 0;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclaration(node: any) {\n const target = hasEffectEcosystemImport ? scatteredLayerProvideDeclaration(node) : undefined;\n if (!target) {\n return;\n }\n\n scatteredLayerCount += 1;\n if (scatteredLayerCount >= 3) {\n report(\n context,\n target,\n \"Rule: group service layers by concern.\",\n );\n }\n },\n };\n },\n});\n\nconst noLayerMergeInRequestHandler = createVersionedEffectCallbackRule(\n layerCompositionInRequestHandler,\n (version) => \"Rule: avoid Layer composition inside request handlers.\",\n false,\n false,\n [\"FunctionDeclaration\"],\n);\n\nconst noServiceMethodReturningPromise = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ClassDeclaration(node: any) {\n if (version === 4) return;\n const options = effectServiceClassOptions(node);\n const method = options ? promiseReturningServiceMethod(options) : undefined;\n if (hasEffectEcosystemImport && method) {\n report(\n context,\n method,\n \"Rule: return Effect from service methods.\",\n );\n }\n },\n CallExpression(node: any) {\n if (version === 3 || !hasEffectEcosystemImport) return;\n const options = effectServiceOptionsObject(node, version);\n const method = options && promiseReturningServiceMethod(options, version);\n if (method) report(context, method, \"Rule: return Effect from service methods. Fix: expose an Effect-returning Context.Service method and keep Promise interop inside an Effect adapter.\");\n },\n };\n },\n});\n\nconst noMatchVoidBranch = createVersionedEffectCallbackRule(\n (node) => isVoidMatchBranch(node) ? node : undefined,\n (version) => \"Rule: avoid void Match branches. Why: they hide guard-style control flow. Fix: remove the no-op branch or select a value and run one Effect pipeline outside the Match.\",\n);\n\nconst noMatchEffectBranch = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (isMatchValuePipeCall(node) && containsSequencingMatchBranch(node.arguments)) {\n report(\n context,\n node,\n \"Rule: avoid multi-step sequencing inside Match branches. Why: it hides control flow. Fix: select a value in Match, then run one Effect pipeline outside. Avoid data-encoded conditionals (Option.toArray/forEach) that only rewrap the branch.\",\n );\n }\n\n if (isOptionMatchCall(node) && isSequencingBranchBody(node.arguments)) {\n report(\n context,\n node,\n \"Rule: avoid multi-step sequencing inside Option.match branches. Why: it hides control flow. Prefer selecting a value in Option.match, then run one Effect pipeline outside. Leaf-level flows with local bindings may keep Option.match but should stay linear.\",\n );\n }\n },\n };\n },\n});\n\nconst warnEffectSyncWrapper = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n const callback = firstArgument(node);\n const body = arrowCallbackBody(callback);\n if (\n hasEffectEcosystemImport &&\n isEffectMemberCallNamed(node, \"sync\") &&\n isExpressionBodiedArrowCall(callback) &&\n !isConsoleCall(body)\n ) {\n report(\n context,\n node,\n \"Rule: avoid Effect.sync around side effects. Why: it hides intent. Fix: use Effect.log* or an explicit pipeline step for the side effect.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectSideEffectWrapper = defineRule({\n create(context: OxlintContext) {\n const sequencing = effectVersionFor(context.options) === 3 ? \"zipRight\" : \"andThen\";\n return {\n CallExpression(node: any) {\n if (isEffectMemberCallNamed(node, \"as\") && containsWrapperSideEffect(firstArgument(node))) {\n report(\n context,\n node,\n \"Rule: avoid Effect.as for side effects. Why: it hides side effects and turns them into placeholders. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.\",\n );\n }\n\n if (\n isEffectMemberCallNamed(node, sequencing) &&\n containsWrapperSideEffect(firstArgument(node))\n ) {\n report(\n context,\n node,\n `Rule: avoid Effect.${sequencing} for side effects. Why: it hides side effects and discards values. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`,\n );\n }\n },\n };\n },\n});\n\nconst noEffectAllStepSequencing = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (\n isEffectMemberCallNamed(node, \"all\") &&\n containsAllStepSideEffect(node.arguments[0]) &&\n hasConcurrencyOne(node.arguments[1])\n ) {\n report(\n context,\n node,\n \"Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.\",\n );\n }\n\n if (\n isEffectAllAsVoidPipe(node) &&\n containsAllStepSideEffect(firstArgument((node.callee as Node).object as Node & {\n arguments: unknown[];\n }))\n ) {\n report(\n context,\n node,\n \"Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.\",\n );\n }\n },\n };\n },\n});\n\nfunction createVersionedEffectCallbackRule(\n find: (node: unknown, version: EffectVersion, context: OxlintContext) => unknown,\n message: (version: EffectVersion) => string,\n multiple = false,\n boundary = false,\n visitorNames = [\"CallExpression\"],\n) {\n return defineRule({\n ...(boundary ? { meta: { schema: boundaryPathOptionsSchema } } : {}),\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let imported = false;\n const reported = multiple ? new WeakSet<object>() : undefined;\n const visit = (node: unknown) => {\n const target = imported && (!boundary || !isBoundaryPath(context)) ? find(node, version, context) : undefined;\n if (!target) return;\n for (const entry of multiple ? target as object[] : [target]) {\n if (reported?.has(entry as object)) continue;\n reported?.add(entry as object);\n report(context, entry, message(version));\n }\n };\n return {\n ImportDeclaration(node: unknown) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) imported = true;\n },\n ...Object.fromEntries(visitorNames.map(name => [name, visit])),\n };\n },\n });\n}\n\nconst noAsyncEffectCombinatorCallback = createVersionedEffectCallbackRule(\n findAsyncEffectCombinatorCallback,\n () => \"Rule: avoid async callbacks in Effect combinators. Why: async callbacks return Promises and bypass Effect failure, interruption, and tracing semantics. Fix: adapt with Effect.tryPromise, compose with gen/flatMap, and keep map pure.\",\n);\nconst noThrowInEffectLogic = createVersionedEffectCallbackRule(\n (node, version) => findEffectStatement(node, version, \"ThrowStatement\"),\n (version) => `Rule: avoid throw inside Effect logic. Why: thrown exceptions ${version === 3 ? \"bypass typed Effect error channels and interruption semantics\" : \"are not typed domain failures\"}. Fix: yield* Effect.fail(taggedError) in gen, or return it from flatMap; keep map pure.`,\n);\nconst noOrDieOutsideBoundary = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n const target = findEffectOrDieOutsideBoundary(node, version);\n if (target) {\n report(\n context,\n target,\n `Rule: avoid Effect.orDie outside runtime boundaries. Why: converting typed failures into defects hides recoverable domain errors. Fix: keep typed errors in domain logic and reserve ${version === 3 ? \"orDie/orDieWith\" : \"orDie\"} for explicit application boundaries.`,\n );\n }\n },\n };\n },\n});\n\nconst noSwallowedCatchAll = createVersionedEffectCallbackRule(\n getSwallowedCatchAllHandler,\n (version) => `Rule: avoid swallowing errors in ${version === 3 ? \"catchAll\" : \"catch/catchEager\"}. Why: succeed/void recovery can hide failures without telemetry or typed recovery. Fix: log, re-fail with a structured error, or recover through an explicit domain branch.`,\n);\n\nconst noEmptyErrorTag = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n TSTypeAliasDeclaration(node: any) {\n if (hasEffectEcosystemImport && emptyErrorTagNode(node)) {\n report(\n context,\n node,\n \"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.\",\n );\n }\n },\n TSInterfaceDeclaration(node: any) {\n if (hasEffectEcosystemImport && emptyErrorTagNode(node)) {\n report(\n context,\n node,\n \"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.\",\n );\n }\n },\n ClassDeclaration(node: any) {\n if (hasEffectEcosystemImport && emptyErrorTagNode(node)) {\n report(\n context,\n node,\n \"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.\",\n );\n }\n },\n };\n },\n});\n\nconst noEarlyCatchallNull = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (hasEffectEcosystemImport && !isBoundaryPath(context)) {\n const target = earlyCatchAllFallback(node, version);\n if (target) {\n report(\n context,\n target,\n \"Rule: avoid catching errors too early. Why: null, undefined, or fallback recovery inside domain logic forces higher layers to handle an untyped absence. Fix: let the typed error propagate and recover at a meaningful boundary with catchTag or an explicit Option result.\",\n );\n }\n }\n },\n };\n },\n});\n\nconst noExpectedStateAsError = createVersionedEffectCallbackRule(\n (node) => isExpectedDomainStateFailure(node) ? node : undefined,\n (version) => `Rule: model expected domain states as data. Why: failing with NotFound, Missing, Empty, or None overloads the error channel and encourages broad ${version === 3 ? \"catchAll\" : \"catch\"} recovery. Fix: return Option, ${version === 3 ? \"Either\" : \"Result\"}, or a tagged result for expected state and reserve Effect.fail for exceptional failures.`,\n);\nconst noExceptionDomainError = createVersionedEffectCallbackRule(\n findDomainExceptionInEffectLogic,\n () => \"Rule: do not use exceptions for domain errors. Why: throw new *Error inside Effect logic bypasses typed failure channels, supervision, and structured recovery. Fix: return Effect.fail with a Data.TaggedError or structured domain error.\",\n);\nconst noEffectFailErrorMessage = createVersionedEffectCallbackRule(\n (node) => isEffectFailFromErrorMessage(node) ? node : undefined,\n () => \"Rule: preserve structured errors instead of strings. Why: converting error.message to a string loses the original tag, cause, and context. Fix: fail with the error or map it to a structured Data.TaggedError.\",\n);\n\nconst noCatchallGenericRethrow = createVersionedEffectCallbackRule(\n catchAllGenericRethrow,\n (version) => `Rule: do not rethrow generic Error from ${version === 3 ? \"catchAll\" : \"catch\"}. Why: ${version === 3 ? \"catchAll\" : \"catch\"} should preserve or model the original failure instead of erasing its domain type. Fix: use mapError, catchTag, or Effect.fail with a structured tagged error and cause.`,\n);\n\nconst noLogOnlyErrorHandling = createVersionedEffectCallbackRule(\n logOnlyErrorHandler,\n () => \"Rule: do not stop at logging an Effect error. Why: logs alone do not preserve a typed failure or define recovery ownership. Fix: map or re-fail with a structured domain error after adding observability.\",\n);\nconst noEffectIgnore = createVersionedEffectCallbackRule(\n findEffectIgnore,\n () => \"Rule: avoid Effect.ignore. Why: ignoring failable effects hides failure ownership. Fix: handle the error with typed recovery, log and re-fail, or isolate the ignore at an explicit boundary with a documented reason.\",\n);\n\nconst noTryCatchInEffectLogic = createVersionedEffectCallbackRule(\n (node, version) => findEffectStatement(node, version, \"TryStatement\"),\n (version) => `Rule: avoid try/catch inside Effect logic. Why: it bypasses typed error channels and can miss interruption/cause semantics. Fix: use Effect.try, Effect.${version === 3 ? \"catchAll\" : \"catch\"}, Effect.catchTag, or typed error combinators.`,\n);\nconst noPromiseApiInEffectLogic = createVersionedEffectCallbackRule(\n findPromiseApiInEffectLogic,\n () => \"Rule: avoid Promise APIs inside Effect logic. Why: Promise APIs bypass Effect scheduling, typed errors, cancellation, and tracing. Fix: use Effect.all, Effect.tryPromise, or move Promise interop to a boundary adapter.\",\n);\nconst noTryCatch = defineRule({\n create(context: OxlintContext) {\n return {\n TryStatement(node: any) {\n report(\n context,\n node,\n \"Rule: avoid try/catch in Effect files. Why: it bypasses Effect error channels and reintroduces imperative control flow. Fix: model failures in Effect and handle them with typed errors and Effect combinators.\",\n );\n },\n };\n },\n});\n\nconst noEffectWrapperAlias = defineRule({\n create(context: OxlintContext) {\n return {\n VariableDeclaration(node: any) {\n for (const declaration of node.declarations ?? []) {\n if (isEffectWrapperAliasExpression(declaration.init)) {\n report(\n context,\n node,\n \"Rule: avoid Effect wrapper aliases (`const x = ...Effect...`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.\",\n );\n }\n }\n },\n FunctionDeclaration(node: any) {\n if (hasEffectWrapperAliasReturn(node.body)) {\n report(\n context,\n node,\n \"Rule: avoid Effect wrapper aliases (`function x(...) { return Effect... }`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.\",\n );\n }\n },\n };\n },\n});\n\nconst noManualEffectChannels = defineRule({\n create(context: OxlintContext) {\n return {\n TSTypeReference(node: any) {\n if (\n isQualifiedTypeReference(node, \"Effect\", \"Effect\") ||\n isQualifiedTypeReference(node, \"Layer\", \"Layer\")\n ) {\n report(\n context,\n node,\n \"Rule: avoid manual Effect channel tuples (`Effect.Effect<...>` / `Layer.Layer<...>`). Why: channels compose through the Effect pipeline and services; hand-written tuples desync from the real flow. Fix: drop the generic and let the return type infer from the Effect/Layer you return, or expose a service method that returns the effect directly.\",\n );\n }\n },\n };\n },\n});\n\nconst noWrapgraphqlCatchall = createVersionedEffectCallbackRule(\n getWrapGraphqlCatchAll,\n (version) => `Rule: avoid ${version === 3 ? \"catchAll\" : \"catch/catchEager\"} after wrapGraphqlCall/applyResponse. Why: the envelope already surfaces structured errors. Fix: handle errors in the response mapping instead of ${version === 3 ? \"catchAll\" : \"catch/catchEager\"}.`,\n);\n\nconst noRenderSideEffects = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ExpressionStatement(node: any) {\n if (\n hasEffectEcosystemImport &&\n isMatchValuePipeCall(node.expression) &&\n containsMatchBranchCall((node.expression as Node).arguments)\n ) {\n report(\n context,\n node.expression,\n \"Rule: avoid Match.value(...).pipe(...) as a statement. Why: it runs side effects during render. Fix: move the side effect into an Effect runtime action or event handler, and keep Match as a pure expression.\",\n );\n }\n },\n };\n },\n});\n\nconst noAtomRegistryEffectSync = createVersionedEffectCallbackRule(\n findAtomOperationInsideEffectSync,\n () => \"Rule: do not wrap Atom/atomRegistry ops in Effect.sync. Why: it hides side effects and breaks atom flow. Fix: call Atom.get/Atom.set/Atom.update/Atom.modify/Atom.refresh directly.\",\n);\n\nconst noFamilyCollectionRead = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (!isMemberCall(node, \"Atom\", \"family\")) {\n return;\n }\n\n const collectionAtom = findFamilyCollectionRead(node.arguments);\n if (collectionAtom) {\n report(\n context,\n collectionAtom,\n \"Keyed projection atom reads collection atom. Why: Atom.family should project from keyed/source atoms, not broad collection state. Fix: pass the keyed atom into the family or create a keyed source atom before reading.\",\n );\n }\n },\n };\n },\n});\n\nconst noInlineRuntimeProvide = createVersionedEffectCallbackRule(\n findInlineRuntimeProvide,\n (version) => `Rule: do not inline runtime provisioning inside local helper Effect code. Why: \\`yield* SomeRuntime.pipe(Effect.provide(SomeRuntimeLive))\\` and equivalent inline provide chains hide dependency assembly instead of owning it at ${version === 3 ? \"an Effect.Service\" : \"a Context.Service\"} boundary or one exported Effect boundary. Fix: declare the live dependency on the owning service or provide it once at the exported boundary, then \\`yield*\\` the runtime or service directly inside the body.`,\n);\n\nconst noNakedObjectStateUpdate = defineRule({\n create(context: OxlintContext) {\n const constructors = effectVersionFor(context.options) === 3 ? \"Schema.make` or field `.make\" : \"schema .make\";\n return {\n CallExpression(node: any) {\n if (isNakedObjectStateUpdate(node)) {\n report(\n context,\n node,\n `Rule: avoid naked JS state patching/rebuild and raw JSON shortcuts in Effect transitions. Why: spread/Object.assign/fromEntries and inline JSON parse/stringify hide state intent and bypass explicit model contracts. Fix: use \\`effect/Record\\` combinators (\\`Record.set\\` / \\`Record.modify\\` / \\`Record.remove\\`) inside \\`Struct.evolve\\`, rebuild with schema constructors (\\`${constructors}\\`), and keep serialization at boundaries with schema encode/decode flows. Use \\`linting.md\\` guidance when available.`,\n );\n }\n },\n };\n },\n});\n\nconst noEffectSucceedVariable = createVersionedEffectCallbackRule(\n (node) => isEffectMemberCallNamed(node, \"succeed\") && isEffectSucceedVariableArgument(firstArgument(node)) ? node : undefined,\n () => \"Rule: avoid Effect.succeed(variable) as a branch placeholder. Why: it hides a decision and turns data into pseudo-control flow. Fix: select a plain value (Option/Match) and then run one Effect pipeline after the decision; if you already read the state, return it as a value. Avoid Option.toArray/forEach hacks that just re-encode the branch.\",\n);\n\nconst noEffectTypeAlias = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n TSTypeAliasDeclaration(node: any) {\n if (\n hasEffectEcosystemImport &&\n containsQualifiedTypeReference(node.typeAnnotation, \"Effect\", \"Effect\")\n ) {\n report(\n context,\n node.typeAnnotation,\n \"Rule: avoid Effect.Effect type aliases. Why: they hide the service surface and make types opaque. Fix: keep Effect types on service methods or inline at the call site.\",\n );\n }\n },\n };\n },\n});\n\nconst noPublicGenericEffectError = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ExportNamedDeclaration(node: any) {\n const target = hasEffectEcosystemImport ? exportedGenericEffectErrorTarget(node) : undefined;\n if (target) {\n report(\n context,\n target,\n \"Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.\",\n );\n }\n },\n ExportDefaultDeclaration(node: any) {\n const target = hasEffectEcosystemImport ? exportedGenericEffectErrorTarget(node) : undefined;\n if (target) {\n report(\n context,\n target,\n \"Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.\",\n );\n }\n },\n };\n },\n});\n\nfunction createPublicEffectErrorChannelRule(\n context: OxlintContext,\n matches: (target: PublicEffectErrorTarget) => boolean,\n message: string,\n) {\n let hasEffectEcosystemImport = false;\n\n const visitExport = (node: any) => {\n if (!hasEffectEcosystemImport) return;\n\n for (const target of exportedEffectErrorTargets(node)) {\n if (matches(target)) {\n report(context, target.annotation, message);\n }\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ExportNamedDeclaration: visitExport,\n ExportDefaultDeclaration: visitExport,\n };\n}\n\nconst noErrorAsPublicEffectError = defineRule({\n create(context: OxlintContext) {\n return createPublicEffectErrorChannelRule(\n context,\n ({ errorChannel }) => isGenericErrorType(errorChannel),\n \"Rule: model public errors as tagged Effect failures, not generic Error. Why: Error hides recovery semantics and domain context. Fix: return a domain-specific Data.TaggedError or tagged error union.\",\n );\n },\n});\n\nconst noUnknownPublicErrorChannel = defineRule({\n create(context: OxlintContext) {\n return createPublicEffectErrorChannelRule(\n context,\n ({ errorChannel }) => errorChannelShape(errorChannel) === \"unknown\",\n \"Rule: do not expose unknown as a public Effect error channel. Why: callers cannot recover by tag or type. Fix: return a tagged domain error union with operation-specific context.\",\n );\n },\n});\n\nconst noMixedEffectErrorShapes = defineRule({\n create(context: OxlintContext) {\n return createPublicEffectErrorChannelRule(\n context,\n ({ errorChannel }) => mixedErrorChannelShapes(errorChannel).size > 1,\n \"Rule: keep the public Effect error channel structurally consistent. Why: mixing Error, primitives, and unknown makes recovery ambiguous. Fix: map failures to one tagged error union.\",\n );\n },\n});\n\nconst noModelOverlayCast = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclaration(node: any) {\n if (hasEffectEcosystemImport && isVariableAsAssertion(node, version)) {\n report(\n context,\n node,\n \"Rule: avoid `as` assertions on decoded model flow. Why: assertions hide schema drift and allow untyped overlays. Fix: decode with the correct schema type and read fields directly.\",\n );\n }\n },\n };\n },\n});\n\nconst noUnknownBooleanCoercionHelper = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n let hasMatchOrElseNull = false;\n const booleanChecks: unknown[] = [];\n const reported = new WeakSet<object>();\n\n const reportBooleanCheck = (node: unknown) => {\n if (!isObjectValue(node) || reported.has(node)) {\n return;\n }\n\n reported.add(node);\n report(\n context,\n node,\n \"Rule: avoid local unknown-to-boolean coercion helpers in services. Why: runtime coercion belongs at schema boundary, not in service flow. Fix: decode boolean optionality in schema and read typed booleans in the Effect pipeline.\",\n );\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n BinaryExpression(node: any) {\n if (!hasEffectEcosystemImport || !isTypeofBooleanCheck(node)) {\n return;\n }\n\n if (hasMatchOrElseNull) {\n reportBooleanCheck(node);\n } else {\n booleanChecks.push(node);\n }\n },\n CallExpression(node: any) {\n if (!hasEffectEcosystemImport || !isMatchOrElseNullCall(node)) {\n return;\n }\n\n hasMatchOrElseNull = true;\n for (const check of booleanChecks) {\n reportBooleanCheck(check);\n }\n },\n };\n },\n});\n\nconst noFromnullableNullishCoalesce = createVersionedEffectCallbackRule(\n (node, version) => isOptionFromNullableNullishCoalesce(node, version) ? node : undefined,\n (version) => `Rule: avoid nullish re-wrap inside Option.${version === 3 ? \"fromNullable\" : \"fromNullishOr\"}. Why: \\`x ?? null\\` and \\`x ?? undefined\\` add noise and hide source shape. Fix: pass the source directly to Option.${version === 3 ? \"fromNullable\" : \"fromNullishOr\"}.`,\n);\n\nconst noOptionBooleanNormalization = createVersionedEffectCallbackRule(\n (node) => isOptionBooleanNormalization(node) ? node : undefined,\n (version) => \"Rule: avoid repeated Option boolean normalization (`onSome: value === true, onNone: false`). Why: it scatters coercion rules across services. Fix: normalize once at schema boundary and read booleans directly.\",\n);\n\nconst noStringSentinelReturn = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n CallExpression(node: any) {\n if (isEffectMemberCallNamed(node, \"succeed\") && isStringLiteral(firstArgument(node))) {\n report(\n context,\n node,\n `Rule: avoid returning string tokens. Why: it encodes control flow and forces defensive branching. Fix: return domain values (Option/${version === 3 ? \"Either\" : \"Result\"}/tagged unions) or real Effect results instead.`,\n );\n }\n },\n };\n },\n});\n\nconst noStringSentinelConst = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n VariableDeclaration(node: any) {\n if (isStringSentinelConst(node)) {\n report(\n context,\n node,\n `Rule: avoid string status constants. Why: they encode control flow and force defensive branching. Fix: use tagged unions, Option/${version === 3 ? \"Either\" : \"Result\"}, or meaningful domain values instead of string tokens.`,\n );\n }\n },\n };\n },\n});\n\nconst noRawDomainIdAlias = createVersionedEffectCallbackRule(\n (node) => isRawDomainIdAlias(node) ? node : undefined,\n (version) => \"Rule: avoid raw primitive domain ID aliases. Why: `type UserId = string` does not protect boundaries from swapped IDs. Fix: use Schema branded IDs or a domain constructor that validates and brands the value.\",\n false,\n false,\n [\"TSTypeAliasDeclaration\"],\n);\n\nconst noBooleanDomainFlag = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n const checkFunctionParameters = (node: unknown) => {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const param of functionBooleanDomainFlagParameters(node)) {\n report(\n context,\n param,\n \"Rule: avoid boolean behavior flags in domain operations. Why: flags like `shouldNotify` hide use cases and create implicit branching. Fix: model intent with a command/tagged union or split the operation into explicit functions.\",\n );\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n FunctionDeclaration: checkFunctionParameters,\n FunctionExpression: checkFunctionParameters,\n ArrowFunctionExpression: checkFunctionParameters,\n };\n },\n});\n\nconst noMagicDomainString = createVersionedEffectCallbackRule(\n (node) => isStringLiteralComparison(node) ? node : undefined,\n (version) => \"Rule: avoid magic domain string comparisons. Why: comparing domain state to raw strings scatters status vocabulary and misses exhaustiveness. Fix: use a tagged union, Schema literal union, or Match over a named domain status.\",\n false,\n false,\n [\"BinaryExpression\"],\n);\n\nconst noRawDomainPrimitiveParams = createVersionedEffectCallbackRule(\n (node) => hasPrimitiveHeavyDomainParameters(node) ? node : undefined,\n (version) => \"Rule: avoid primitive-heavy domain parameters. Why: clusters of raw string/number domain values are easy to swap and have no invariant boundary. Fix: introduce branded types or a command/schema object with named validated fields.\",\n false,\n false,\n [\"FunctionDeclaration\",\"FunctionExpression\",\"ArrowFunctionExpression\"],\n);\n\nconst noRawTimeDomainField = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n const checkTypeMembers = (node: unknown) => {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const field of rawTimeDomainFields(node)) {\n report(\n context,\n field,\n \"Rule: avoid raw time fields in domain models. Why: number and Date fields hide units, clock ownership, and duration semantics. Fix: model durations with Effect Duration and keep raw timestamps at decode/encode boundaries.\",\n );\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n TSInterfaceDeclaration: checkTypeMembers,\n TSTypeLiteral: checkTypeMembers,\n };\n },\n});\n\nconst nodeFsImportSources = new Set([\"fs\", \"node:fs\", \"fs/promises\", \"node:fs/promises\"]);\n\nconst nodeBuiltinImportSources = new Set([\n \"assert\", \"assert/strict\", \"async_hooks\", \"buffer\", \"child_process\", \"cluster\", \"console\",\n \"constants\", \"crypto\", \"dgram\", \"diagnostics_channel\", \"dns\", \"dns/promises\", \"domain\",\n \"events\", \"fs\", \"fs/promises\", \"http\", \"http2\", \"https\", \"inspector\", \"inspector/promises\",\n \"module\", \"net\", \"os\", \"path\", \"path/posix\", \"path/win32\", \"perf_hooks\", \"process\",\n \"punycode\", \"querystring\", \"readline\", \"readline/promises\", \"repl\", \"stream\",\n \"stream/consumers\", \"stream/promises\", \"stream/web\", \"string_decoder\", \"sys\", \"timers\",\n \"timers/promises\", \"tls\", \"trace_events\", \"tty\", \"url\", \"util\", \"util/types\", \"v8\", \"vm\",\n \"wasi\", \"worker_threads\", \"zlib\",\n]);\n\nfunction isNodeBuiltinImport(source: string): boolean {\n return source.startsWith(\"node:\") || nodeBuiltinImportSources.has(source);\n}\n\nfunction isMemberExpressionNode(node: unknown): node is Node {\n return (\n isObjectValue(node) &&\n ((node as Node).type === \"MemberExpression\" || (node as Node).type === \"OptionalMemberExpression\")\n );\n}\n\nfunction isNamedMemberProperty(member: Node, name: string): boolean {\n return (\n (member.computed !== true && isIdentifier(member.property, name)) ||\n (member.computed === true && isStringLiteral(member.property) && (member.property as Node).value === name)\n );\n}\n\nfunction isProcessEnvMember(node: unknown): boolean {\n return (\n isMemberExpressionNode(node) &&\n isIdentifier(node.object, \"process\") &&\n isNamedMemberProperty(node, \"env\")\n );\n}\n\nfunction isProcessEnvRead(node: unknown): boolean {\n if (!isMemberExpressionNode(node)) return false;\n if (isProcessEnvMember(node.object)) return true;\n if (!isProcessEnvMember(node)) return false;\n\n const parent = node.parent;\n return !isMemberExpressionNode(parent) || parent.object !== node;\n}\n\nfunction isProcessEnvWriteTarget(node: unknown): boolean {\n if (!isMemberExpressionNode(node) || typeof node.parent !== \"object\" || node.parent === null) {\n return false;\n }\n\n const parent = node.parent as Node;\n return parent.type === \"AssignmentExpression\" && parent.left === node;\n}\n\nconst noNodePlatformInSharedCode = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isNodeBuiltinImport(source) && !isBoundaryPath(context)) {\n report(\n context,\n node,\n \"Rule: avoid Node platform imports in shared code. Why: reusable modules must not require a Node runtime. Fix: move the import behind a configured application boundary or an Effect platform service.\",\n );\n }\n },\n };\n },\n});\n\nconst noProcessEnvDirectRead = defineRule({\n meta: { schema: processEnvPathOptionsSchema },\n create(context: OxlintContext) {\n return {\n MemberExpression(node: any) {\n if (\n isProcessEnvRead(node) &&\n !isProcessEnvWriteTarget(node) &&\n !isBoundaryPath(context) &&\n !isConfigPath(context)\n ) {\n report(\n context,\n node,\n \"Rule: avoid direct process.env reads outside configuration boundaries. Why: ambient configuration leaks runtime coupling into domain code. Fix: decode environment values in a configured Config service or Layer and depend on that service.\",\n );\n }\n },\n };\n },\n});\n\nfunction getNodeFsRequireSource(node: unknown): string | undefined {\n if (\n !isObjectValue(node) ||\n (node as Node).type !== \"CallExpression\" ||\n !isIdentifier((node as Node).callee, \"require\")\n ) {\n return undefined;\n }\n\n const argument = ((node as Node).arguments as unknown[] | undefined)?.[0];\n if (!isStringLiteral(argument)) return undefined;\n\n const source = (argument as Node).value as string;\n return nodeFsImportSources.has(source) ? source : undefined;\n}\n\nconst noNodeFsInEffectCode = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n let functionDepth = 0;\n const nodeFsReferences: Array<{ node: unknown; source: string }> = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n if (source && nodeFsImportSources.has(source)) {\n nodeFsReferences.push({ node, source });\n }\n },\n FunctionDeclaration() {\n functionDepth += 1;\n },\n \"FunctionDeclaration:exit\"() {\n functionDepth -= 1;\n },\n FunctionExpression() {\n functionDepth += 1;\n },\n \"FunctionExpression:exit\"() {\n functionDepth -= 1;\n },\n ArrowFunctionExpression() {\n functionDepth += 1;\n },\n \"ArrowFunctionExpression:exit\"() {\n functionDepth -= 1;\n },\n CallExpression(node: any) {\n if (functionDepth !== 0) return;\n const source = getNodeFsRequireSource(node);\n if (source) nodeFsReferences.push({ node, source });\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) return;\n for (const { node, source } of nodeFsReferences) {\n report(context, node, `Rule: avoid Node fs imports or require calls in Effect code (${source}). Why: direct Node filesystem APIs make reusable Effect modules platform-specific. Fix: move filesystem work behind an Effect platform service at the application boundary.`);\n }\n },\n };\n },\n});\n\nconst noHiddenEffectExecution = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n const runCalls: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n },\n CallExpression(node: any) {\n if (isEffectRunCall(node, version)) runCalls.push(node);\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || isBoundaryPath(context)) return;\n for (const node of runCalls) {\n report(\n context,\n (node as Node).callee,\n \"Rule: avoid hidden Effect execution. Why: Effect.run* fixes runtime ownership inside reusable code. Fix: return the Effect and execute it from a configured application, CLI, worker, route, or test boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst boundaryEffectHandlingMethods = new Set([\n \"try\",\n \"tryPromise\",\n \"mapError\",\n \"catchAll\",\n \"catchTag\",\n \"catchTags\",\n]);\n\nfunction containsBoundaryEffectHandling(\n node: unknown,\n version: EffectVersion,\n): boolean {\n return findNode(node, candidate => {\n if (isEffectRunCall(candidate, version)) return true;\n if (!isEffectMemberCall(candidate)) return false;\n const property = ((candidate as Node).callee as Node).property;\n if (!isIdentifier(property)) return false;\n return version === 3 ? boundaryEffectHandlingMethods.has(property.name)\n : (property.name !== \"catchAll\" && boundaryEffectHandlingMethods.has(property.name)) ||\n (effect4RecoveryOperatorNames as readonly string[]).includes(property.name) || property.name === \"catchNoSuchElement\";\n }) !== undefined;\n}\n\nconst noBoundaryTryCatchWithoutEffectMap = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n TryStatement(node: any) {\n if (!node.handler || !isBoundaryPath(context) || containsBoundaryEffectHandling(node, version)) {\n return;\n }\n\n report(\n context,\n node,\n version === 3\n ? \"Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, catchAll, or execute a mapped Effect program.\"\n : \"Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, Effect.catch, or execute a mapped Effect program.\",\n );\n },\n };\n },\n});\n\nconst noJsonParseWithoutSchema = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n let hasEffectSchemaImport = false;\n const jsonParseCalls: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n if (importsEffectSchema(node)) hasEffectSchemaImport = true;\n },\n CallExpression(node: any) {\n if (isMemberExpression(node.callee, \"JSON\", \"parse\")) {\n jsonParseCalls.push(node);\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || hasEffectSchemaImport) return;\n for (const node of jsonParseCalls) {\n report(\n context,\n node,\n version === 3\n ? \"Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: decode unknown input with Schema.decodeUnknown at the boundary.\"\n : \"Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: use Schema.fromJsonString with Schema.decodeUnknownEffect at the boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noDateNowInEffect = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n const collectedDateCalls = new WeakSet<object>();\n const dateNowCalls: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n },\n CallExpression(node: any) {\n if (!isEffectConstructionBoundary(node, version)) return;\n\n for (const dateNowCall of findNodes(node.arguments, isDateNowCall)) {\n if (collectedDateCalls.has(dateNowCall as object)) continue;\n collectedDateCalls.add(dateNowCall as object);\n dateNowCalls.push(dateNowCall);\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) return;\n for (const dateNowCall of dateNowCalls) {\n report(\n context,\n dateNowCall,\n \"Rule: avoid Date.now inside Effect logic. Why: direct wall-clock reads make programs nondeterministic and difficult to test. Fix: obtain time through Effect Clock or DateTime at the boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noNewDateInDomainLogic = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const dateConstructions: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n },\n NewExpression(node: any) {\n if (isIdentifier(node.callee, \"Date\")) dateConstructions.push(node);\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || isBoundaryPath(context)) return;\n for (const node of dateConstructions) {\n report(\n context,\n node,\n \"Rule: avoid new Date in Effect domain logic. Why: direct wall-clock construction makes domain behaviour nondeterministic and difficult to test. Fix: obtain time through Effect Clock or model time at the boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noOverloadedOptionsObject = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n const checkFunctionParameters = (node: unknown) => {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const param of overloadedOptionsParameters(node)) {\n report(\n context,\n param,\n \"Rule: avoid overloaded options objects. Why: `opts`, `options`, and `config` typed as any/object hide required fields and validation. Fix: accept unknown at the boundary and decode with Schema, or use a named typed command/config model.\",\n );\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n FunctionDeclaration: checkFunctionParameters,\n FunctionExpression: checkFunctionParameters,\n ArrowFunctionExpression: checkFunctionParameters,\n };\n },\n});\n\nconst noDomainLogicInConditional = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n LogicalExpression(node: any) {\n if (hasEffectEcosystemImport && isDomainLogicConditional(node)) {\n report(\n context,\n node,\n \"Rule: avoid embedding domain logic in conditionals. Why: multi-clause business rules become hard to test, reuse, and audit. Fix: extract a named domain predicate or validation Effect and call that from the branch.\",\n );\n }\n },\n };\n },\n});\n\nconst noImplicitStateMachineObject = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n LogicalExpression(node: any) {\n if (hasEffectEcosystemImport && isImplicitStateMachineObject(node)) {\n report(\n context,\n node,\n \"Rule: avoid implicit state machines made from boolean flags. Why: multiple flags on one domain object allow impossible states. Fix: model the lifecycle as a tagged union or Data.TaggedEnum.\",\n );\n }\n },\n };\n },\n});\n\nconst noAdhocDomainError = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (hasEffectEcosystemImport && isAdhocEffectFail(node)) {\n report(\n context,\n node,\n \"Rule: avoid ad hoc domain errors. Why: string failures hide recovery semantics and observability. Fix: use Data.TaggedError or a structured domain error union.\",\n );\n }\n },\n ThrowStatement(node: any) {\n if (hasEffectEcosystemImport && isThrowNewStringError(node)) {\n report(\n context,\n node,\n \"Rule: avoid ad hoc domain errors. Why: thrown string Error values bypass typed Effect error channels. Fix: return Effect.fail with a structured tagged domain error.\",\n );\n }\n },\n };\n },\n});\n\nconst noDomainMeaningByFolderOnly = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n FunctionDeclaration(node: any) {\n if (hasEffectEcosystemImport && isContextEncodedDomainFunction(node)) {\n report(\n context,\n node,\n \"Rule: avoid domain meaning by folder or context naming alone. Why: admin/public/internal meaning should be represented in types or services, not inferred from helper names. Fix: encode context with branded IDs, commands, policies, or service boundaries.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectAs = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (isMemberExpression(node.callee, \"Effect\", \"as\")) {\n report(\n context,\n node.callee,\n \"Rule: avoid Effect.as wrappers. Why: they can hide meaningful sequencing or value flow. Fix: return the intended value directly or use explicit Effect.map/andThen.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectDo = defineRule({\n create(context: OxlintContext) {\n return {\n MemberExpression(node: any) {\n if (isMemberExpression(node, \"Effect\", \"Do\")) {\n report(\n context,\n node,\n \"Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.\",\n );\n }\n },\n };\n },\n});\n\nfunction createForbiddenMemberCallRule(objectName: string, propertyName: string, message: string, legacyOnly = false) {\n return defineRule({\n create(context: OxlintContext) {\n if (legacyOnly && effectVersionFor(context.options) === 4) return {};\n return {\n CallExpression(node: any) {\n if (isMemberExpression(node.callee, objectName, propertyName)) {\n report(context, node.callee, message);\n }\n },\n };\n },\n });\n}\n\nconst noEffectBind = createForbiddenMemberCallRule(\n \"Effect\",\n \"bind\",\n \"Rule: avoid Effect.bind. Why: it obscures linear data flow behind builder-style binding. Fix: use Effect.gen or a direct pipe with flatMap/map.\",\n);\n\nconst noRuntimeRunFork = createForbiddenMemberCallRule(\n \"Runtime\",\n \"runFork\",\n \"Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.\",\n true,\n);\n\nconst noRunEffectOutsideBoundary = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (hasEffectEcosystemImport && !isBoundaryPath(context) && isEffectRunCall(node, version)) {\n report(\n context,\n node.callee,\n \"Rule: avoid running Effects outside runtime boundaries. Why: direct Effect.run* calls scatter execution ownership. Fix: return Effects from domain logic and run them at the app, CLI, worker, route, or test boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectAsync = createForbiddenMemberCallRule(\n \"Effect\",\n \"async\",\n \"Rule: avoid Effect.async. Why: manual callback bridges are easy to leak or resume incorrectly. Fix: use scoped Effect APIs or a dedicated platform adapter.\",\n true,\n);\n\nconst noNestedEffectCall = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (hasDeepNestedEffectFirstArgument(node)) {\n report(\n context,\n node,\n \"Rule: avoid deeply nested Effect calls (Effect.xx(Effect.yy(Effect.zz(...)))). Why: they hide sequencing and spread flow. Fix: build values first, then run one flat Effect pipeline.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectLadder = defineRule({\n create(context: OxlintContext) {\n return {\n VariableDeclaration(node: any) {\n for (const declaration of node.declarations ?? []) {\n if (hasDeepNestedEffectFirstArgument(declaration.init)) {\n report(\n context,\n declaration.init,\n \"Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.\",\n );\n }\n }\n },\n ReturnStatement(node: any) {\n if (hasDeepNestedEffectFirstArgument(node.argument)) {\n report(\n context,\n node.argument,\n \"Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.\",\n );\n }\n },\n };\n },\n});\n\nconst noFlatMapLadder = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n VariableDeclaration(node: any) {\n for (const declaration of node.declarations ?? []) {\n const message = getFlatMapLadderMessage(declaration.init, version);\n if (message) {\n report(context, declaration.init, message);\n }\n }\n },\n ReturnStatement(node: any) {\n const message = getFlatMapLadderMessage(node.argument, version);\n if (message) {\n report(context, node.argument, message);\n }\n },\n };\n },\n});\n\nconst noPipeLadder = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (isPipeCall(node) && containsPipeCall(node.arguments)) {\n report(\n context,\n node,\n \"Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.\",\n );\n }\n },\n };\n },\n});\n\nconst noCallTower = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (hasNestedEffectCallArgument(node)) {\n report(\n context,\n node,\n \"Rule: avoid nested Effect call towers (Effect.fn(Effect.fn(...))). Why: it hides sequencing. Fix: build the inner Effect first, then use pipe/Effect.flatMap/Effect.andThen for a single flat pipeline.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectOrElseLadder = defineRule({\n create(context: OxlintContext) {\n if (effectVersionFor(context.options) === 4) return {};\n return {\n CallExpression(node: any) {\n if (hasOrElseSequencingFirstArgument(node)) {\n report(\n context,\n node,\n \"Rule: avoid Effect.orElse around sequencing chains. Why: it hides error handling and splits the flow. Fix: move error handling to a single terminal decision after the pipeline.\",\n );\n }\n },\n };\n },\n});\n\nconst noUnboundedEffectAll = createVersionedEffectCallbackRule(\n (node) => isUnboundedMappedEffectAll(node) ? node : undefined,\n (version) => \"Rule: avoid unbounded Effect.all policies over mapped collections. Why: an explicit concurrency option makes scheduling policy visible; omission defaults to sequential execution, not unlimited parallelism. Fix: pass an explicit `{ concurrency: n }` option or use a bounded batching strategy.\",\n);\n\nconst noFireAndForgetFork = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ExpressionStatement(node: any) {\n const version = effectVersionFor(context.options);\n const fork = hasEffectEcosystemImport ? discardedFork(node.expression, version) : undefined;\n if (fork) {\n report(\n context,\n fork,\n version === 3\n ? \"Rule: avoid fire-and-forget Effect.fork. Why: detached fibers hide failure, interruption, and ownership. Fix: bind the fiber and join/await/interrupt it, or use Effect.forkScoped / Effect.forkIn with an explicit scope.\"\n : \"Rule: avoid discarded Effect.forkChild / Effect.forkDetach constructions or handles. Why: a bare construction is lazy and starts no work; yielding then discarding the fiber loses explicit observation. Child fibers follow parent lifetime, detached fibers do not. Fix: retain and join/await/interrupt the fiber, or use forkScoped / forkIn with explicit scope ownership.\",\n );\n }\n },\n };\n },\n});\n\nconst noForkInLoop = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n const checkLoop = (node: unknown) => {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n const version = effectVersionFor(context.options);\n const fork = version === 3 ? containsEffectForkCall((node as Node).body)\n : findOwnCallbackNode((node as Node).body, child => v4ForkConstruction(child) !== undefined);\n if (fork) {\n report(\n context,\n version === 4 ? v4ForkConstruction(fork) : fork,\n version === 3\n ? \"Rule: avoid Effect.fork inside loops. Why: loop-spawned fibers create unbounded concurrency and unclear ownership. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit or a scoped supervisor.\"\n : \"Rule: avoid Effect.forkChild / Effect.forkDetach inside loops. Why: per-item forks lack a collection-wide concurrency budget even when handles are retained. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit; preserve observation and lifetime ownership.\",\n );\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ForStatement: checkLoop,\n ForInStatement: checkLoop,\n ForOfStatement: checkLoop,\n WhileStatement: checkLoop,\n DoWhileStatement: checkLoop,\n };\n },\n});\n\nconst noRaceWithoutCleanup = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n const version = effectVersionFor(context.options);\n if (hasEffectEcosystemImport && isEffectRaceWithoutCleanup(node, version)) {\n report(\n context,\n node,\n version === 3\n ? \"Rule: avoid Effect.race without loser cleanup. Why: racing effects without ensuring/scoped cleanup can leak losing work or resources. Fix: wrap raced effects with Effect.ensuring/acquireRelease or use a scoped race boundary.\"\n : \"Rule: require visible cleanup ownership around Effect races. Why: race operators interrupt losers, but resource release still needs a finalizer or scope. Fix: expose ensuring/acquireRelease or a scoped race boundary; race/raceAll select success, raceFirst/raceAllFirst select first completion.\",\n );\n }\n },\n };\n },\n});\n\nconst noUnobservedFiber = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const forkedFibers = new Map<string, unknown>();\n const observedFibers = new Set<string>();\n const v4Bindings = new Set<any>();\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclarator(node: any) {\n if (effectVersionFor(context.options) === 4) {\n if (isIdentifier(node.id) && node.init?.type === \"YieldExpression\" && v4ForkConstruction(node.init.argument)) v4Bindings.add(node);\n return;\n }\n const name = forkedFiberVariableName(node);\n if (name) {\n forkedFibers.set(name, node);\n }\n },\n CallExpression(node: any) {\n if (effectVersionFor(context.options) === 4) return;\n const name = observedFiberVariableName(node);\n if (name) {\n observedFibers.add(name);\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n if (effectVersionFor(context.options) === 4) {\n for (const node of v4Bindings) {\n const variables = context.sourceCode?.getDeclaredVariables(node) ?? [];\n if (!variables.some(variable => variable.references.some(reference => v4FiberObservedReference(reference.identifier)))) {\n report(context, node, \"Rule: avoid unobserved forked fibers. Why: yielded child/detached handles need explicit observation or ownership transfer. Fix: join/await/interrupt the same lexical binding, return it to its owner, or use scoped fork APIs. This checks reference syntax, not whether observation executes.\");\n }\n }\n return;\n }\n\n for (const [name, node] of forkedFibers) {\n if (!observedFibers.has(name)) {\n report(\n context,\n node,\n \"Rule: avoid unobserved forked fibers. Why: forked fiber failures and interruption should be observed. Fix: pass the fiber to Fiber.join, Fiber.await, Fiber.interrupt, or use scoped fork APIs.\",\n );\n }\n }\n },\n };\n },\n});\n\nconst noUnboundedConcurrentRetry = createVersionedEffectCallbackRule(\n node => isUnboundedConcurrentRetry(node) ? node : undefined,\n () => \"Rule: avoid unbounded concurrent retry policies. Why: inline retries need an explicit collection scheduling policy; omitted concurrency defaults to sequential execution, not unlimited parallelism. Fix: add an explicit concurrency limit and a bounded retry/backoff policy. This heuristic checks option presence, not its bound or retry count.\",\n);\nconst noBlockingCallInEffect = createVersionedEffectCallbackRule(\n findBlockingSyncCallInEffectLogic,\n version => `Rule: avoid blocking sync calls inside Effect logic. Why: synchronous I/O or CPU work blocks the executing JavaScript thread; wrapping it in a Promise does not offload it. Fix: use genuinely asynchronous platform APIs via Effect.${version === 4 ? \"callback\" : \"async\"}/tryPromise, or a dedicated worker for blocking work. Sync suffix recognition is a heuristic.`,\n);\n\nconst noPromiseConcurrencyInEffect = createVersionedEffectCallbackRule(\n findPromiseConcurrencyInEffectLogic,\n version => `Rule: avoid Promise concurrency APIs inside Effect logic. Why: raw Promise aggregation does not own interruption of its underlying operations. Fix: use bounded Effect.all/forEach, Effect.${version === 4 ? \"result\" : \"either\"} for settled outcomes, raceFirst for first completion or race for first success, with signal-aware boundary adapters. Preserve application error semantics explicitly.`,\n);\n\nconst noSharedMutableStateAcrossFibers = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const mutableNames = new Set<string>();\n const declarations: any[] = [];\n const workNodes: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclaration(node: any) {\n if (node.kind !== \"let\" && node.kind !== \"var\") {\n return;\n }\n\n if (effectVersionFor(context.options) === 4) {\n declarations.push(node);\n return;\n }\n\n for (const name of variableDeclarationIdentifierNames(node)) {\n mutableNames.add(name);\n }\n },\n CallExpression(node: any) {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n if (effectVersionFor(context.options) === 4) {\n const work = v4SharedStateWork(node);\n if (work) workNodes.push(work);\n return;\n }\n\n const workNode = concurrentEffectWorkNode(node);\n if (!workNode) {\n return;\n }\n\n const mutationNode = findSharedMutableStateMutation(workNode, mutableNames);\n if (mutationNode) {\n report(\n context,\n mutationNode,\n \"Rule: avoid mutating shared state across fibers. Why: outer let/var state mutated from forked or parallel work creates nondeterministic races. Fix: model shared state with Ref/SynchronizedRef/Queue or aggregate immutable results with bounded Effect.all/forEach.\",\n );\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || effectVersionFor(context.options) !== 4) return;\n const variables = declarations.flatMap(node => context.sourceCode.getDeclaredVariables(node));\n for (const work of workNodes) {\n const mutation = lexicalWorkMutation(work, variables);\n if (mutation) report(context, mutation, \"Rule: avoid mutating shared state across fibers. Why: outer let/var writes in child/detached or collection work couple workers through mutable state. Fix: use Ref updates or aggregate immutable results. This checks lexical inline work, not execution or a proven data race; collections default to sequential execution.\");\n }\n },\n };\n },\n});\n\nconst noTimeoutWithNoninterruptiblePromise = createVersionedEffectCallbackRule(\n noninterruptiblePromiseTimeoutNode,\n () => \"Rule: avoid timeout around noninterruptible Promise effects. Why: Effect timeout interrupts the wrapper, but the underlying operation stops only if it observes cancellation. Fix: accept and forward AbortSignal in the adapter to an API that honours it. Parameter presence is a syntax heuristic, not proof of cancellation.\",\n);\nconst noUninterruptibleConcurrentRegion = createVersionedEffectCallbackRule(\n (node, version) => isUninterruptibleConcurrentRegion(node, version) ? node : undefined,\n () => \"Rule: avoid uninterruptible concurrent regions. Why: broad masking around collection, fork, race or waiting work can defer cancellation and shutdown. Fix: keep only a short critical section masked and explicitly restore interruption for long-running work. Scoping alone does not restore interruptibility; syntax does not prove the mask is actually executed.\",\n);\nconst noUnboundedQueueOrPubSub = createVersionedEffectCallbackRule(\n (node, version) => isUnboundedQueueOrPubSub(node, version) ? node : undefined,\n () => \"Rule: avoid unbounded Queue or PubSub constructors. Why: unbounded buffers hide backpressure and can fail under load. Fix: use Queue.bounded / PubSub.bounded with an explicit capacity at the owning boundary.\",\n);\n\nconst noGlobalMutableConcurrencyState = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const globalMutableNames = new Set<string>();\n const declarations: any[] = [];\n const workNodes: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclaration(node: any) {\n if (effectVersionFor(context.options) === 4) { declarations.push(node); return; }\n for (const name of mutableGlobalDeclarationNames(node)) {\n globalMutableNames.add(name);\n }\n },\n CallExpression(node: any) {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n if (effectVersionFor(context.options) === 4) {\n const work = v4SharedStateWork(node);\n if (work) workNodes.push(work);\n return;\n }\n const workNode = concurrentEffectWorkNode(node);\n if (!workNode) {\n return;\n }\n\n const mutationNode = findSharedMutableStateMutation(workNode, globalMutableNames);\n if (mutationNode) {\n report(\n context,\n mutationNode,\n \"Rule: avoid global mutable concurrency state. Why: module-scope mutable state touched from concurrent Effect work behaves like shared mutable global state. Fix: move ownership into Ref/SynchronizedRef/Queue/Layer state or pass immutable values through bounded effects.\",\n );\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || effectVersionFor(context.options) !== 4) return;\n const variables = declarations.flatMap(node => context.sourceCode.getDeclaredVariables(node).filter(variable =>\n (variable.scope.type === \"module\" || variable.scope.type === \"global\") && mutableGlobalDeclarationNames(node).includes(variable.name)));\n for (const work of workNodes) {\n const mutation = lexicalWorkMutation(work, variables);\n if (mutation) report(context, mutation, \"Rule: avoid global mutable concurrency state. Why: module-owned let/var or mutable containers couple inline workers. Fix: own Ref or immutable results in a service/layer. Lexical syntax does not prove execution or a data race; default collections are sequential.\");\n }\n },\n };\n },\n});\n\nconst noManualDeferredCoordination = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const deferredScopes = [new Set<string>()];\n const reported = new WeakSet<object>();\n const bindings: any[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n FunctionDeclaration() {\n deferredScopes.push(new Set());\n },\n \"FunctionDeclaration:exit\"() {\n deferredScopes.pop();\n },\n FunctionExpression() {\n deferredScopes.push(new Set());\n },\n \"FunctionExpression:exit\"() {\n deferredScopes.pop();\n },\n ArrowFunctionExpression() {\n deferredScopes.push(new Set());\n },\n \"ArrowFunctionExpression:exit\"() {\n deferredScopes.pop();\n },\n VariableDeclarator(node: any) {\n if (effectVersionFor(context.options) === 4) {\n const init = node.init?.type === \"YieldExpression\" ? node.init.argument : node.init;\n if (isIdentifier(node.id) && (isMemberCall(init, \"Deferred\", \"make\") || isMemberCall(init, \"Deferred\", \"makeUnsafe\"))) bindings.push(node);\n return;\n }\n const name = deferredBindingName(node);\n if (name) {\n deferredScopes.at(-1)?.add(name);\n }\n },\n CallExpression(node: any) {\n if (effectVersionFor(context.options) === 4) return;\n if (!hasEffectEcosystemImport || !isDeferredAwaitCall(node)) {\n return;\n }\n\n const binding = firstArgument(node);\n if (!isIdentifier(binding) || !deferredScopes.at(-1)?.has(binding.name)) {\n return;\n }\n\n if (isDeferredAwaitProtected(node, binding.name) || reported.has(node)) {\n return;\n }\n\n reported.add(node);\n report(\n context,\n node,\n \"Rule: avoid unbounded manual Deferred coordination. Why: a local latch can wait forever and make shutdown or failure ownership implicit. Fix: bound the await with a timeout/race, keep it interruptible, or tie completion and cleanup to a scope finalizer.\",\n );\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || effectVersionFor(context.options) !== 4) return;\n for (const binding of bindings) for (const variable of context.sourceCode.getDeclaredVariables(binding)) for (const reference of variable.references) {\n const call = (reference.identifier as unknown as Node).parent;\n if (isDeferredAwaitCall(call) && firstArgument(call) === reference.identifier && !isDeferredAwaitProtected(call, variable.name, 4, variable.references)) {\n report(context, call, \"Rule: avoid unbounded manual Deferred coordination. Why: a local latch needs visible completion or cancellation ownership. Fix: use a timeout/race or an interruptible owner with a same-binding finalizer. Scope/interruptibility/finalizer markers alone do not prove eventual completion.\");\n }\n }\n },\n };\n },\n});\n\nconst noAcquireWithoutScopedRelease = createVersionedEffectCallbackRule(\n (node, version) => {\n const work = concurrentWorkArguments(node, version);\n return work ? findUnscopedResourceAcquisitions(work, version) : undefined;\n },\n version => `Rule: avoid resource acquisition without scoped release. Why: acquiring a client, connection, file, or handle inside concurrent work can outlive failures and interruption. Fix: ${version === 3 ? \"wrap acquisition in acquireRelease/acquireUseRelease, use Effect.scoped, or register a matching finalizer.\" : \"own release; a scope marker is insufficient.\"}`,\n true,\n);\n\nconst noYieldWithHeldSemaphorePermit = createVersionedEffectCallbackRule(\n (node, version) => {\n const work = heldSemaphoreWork(node, version);\n return work && (version === 4 ? containsEffect4ConcurrentOperation(work, true) : containsHighRiskSuspension(work)) ? node : undefined;\n },\n () => \"Rule: avoid suspension while holding a semaphore permit. Why: unrelated waits hold capacity needed by other work. Fix: narrow coordination critical sections when semantics allow. Async work may intentionally be permit-bound; moving it outside changes concurrency limits. This strict policy is not leak detection.\",\n);\n\nconst noYieldWithHeldMutableRef = createVersionedEffectCallbackRule(\n (node, version) => {\n const callback = synchronizedRefModifierWork(node, version);\n return callback && (version === 3 ? containsHighRiskSuspension(callback) : containsEffect4ConcurrentOperation(callbackBody(callback) ?? callback, true)) ? node : undefined;\n },\n version => `Rule: avoid suspension while holding synchronized reference coordination. Why: effectful SynchronizedRef modifiers hold internal coordination while the callback sleeps, awaits, or starts concurrent work. Fix: ${version === 3 ? \"compute the effect outside the modifier and commit a short synchronous state transition.\" : \"move independent work outside; retain atomicity.\"}`,\n);\n\nconst preventDynamicImports = defineRule({\n create(context: OxlintContext) {\n return {\n ImportExpression(node: any) {\n report(\n context,\n node,\n \"Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.\",\n );\n },\n };\n },\n});\n\nconst noUnscopedBackgroundFiber = createVersionedEffectCallbackRule(\n (node, version) => {\n if (version === 3) return isEffectMemberCallNamed(node, \"forkDaemon\") && !containsEffectMemberCallNamed(firstArgument(node), \"supervised\") ? node : undefined;\n const operator = isPipeCall(node) ? ((node as Node).arguments as unknown[]).at(-1) : (node as Node)?.callee;\n if (isEffectMemberCallNamed(node, \"forkDetach\")) {\n const input = firstArgument(node);\n return input && !isIdentifier(input, \"undefined\") && !isObjectExpression(input) ? node : undefined;\n }\n return isEffectMemberCallNamed(operator, \"forkDetach\") || isEffectMemberExpressionNamed(operator, \"forkDetach\") ? node : undefined;\n },\n version => `Rule: avoid unscoped background fibers. Why: Effect.${version === 3 ? \"forkDaemon\" : \"forkDetach\"} detaches work from the caller's scope and can outlive failures and shutdown. Fix: use forkScoped/forkIn ${version === 3 ? \"or make supervisor ownership explicit in the child effect.\" : \"or child ownership; join is not lifetime ownership.\"}`,\n);\n\nfunction resourceReleaseCallbackArguments(node: unknown, version: EffectVersion = 3): readonly unknown[] {\n if (!isObjectValue(node) || !Array.isArray((node as Node).arguments)) {\n return [];\n }\n\n const arguments_ = (node as Node & { arguments: unknown[] }).arguments;\n const offset = isEffectMemberCallNamed(node, \"acquireUseRelease\") ? 2\n : isResourceAcquireReleaseCall(node, version) ? 1\n : isEffectMemberCallNamed(node, \"addFinalizer\") ? 0\n : isMemberCall(node, \"Scope\", \"addFinalizer\") || isMemberCall(node, \"Scope\", \"addFinalizerExit\") ? 1\n : -1;\n return offset < 0 ? [] : arguments_.slice(offset, version === 4 || offset === 0 ? offset + 1 : undefined);\n}\n\nfunction resourceAncestor(node: unknown, matches: (node: Node) => boolean): Node | undefined {\n let current = isObjectValue(node) ? (node as Node).parent : undefined;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return undefined;\n seen.add(current);\n if (matches(current as Node)) return current as Node;\n current = (current as Node).parent;\n }\n\n return undefined;\n}\n\nfunction hasReleaseOwnership(node: unknown, version: EffectVersion = 3): boolean {\n return resourceAncestor(node, current => (version === 4 || isFunctionLike(current)) &&\n resourceReleaseCallbackArguments(current.parent, version).some(argument => argument === current)) !== undefined;\n}\n\nfunction createResourceLifetimeRule(\n matches: (node: unknown, version: EffectVersion) => boolean,\n message: (version: EffectVersion) => string,\n) {\n return createVersionedEffectCallbackRule((node, version) => matches(node, version) ? node : undefined, message, false, true);\n}\n\nconst noManualResourceClose = createResourceLifetimeRule(\n (node, version) => isResourceCleanupCall(node) && !hasReleaseOwnership(node, version),\n () => \"Rule: avoid manual resource cleanup. Why: direct close/dispose calls can bypass Effect scope ownership. Fix: acquire the resource with Effect.acquireRelease or register cleanup with a Scope finalizer.\",\n);\n\nfunction isScopeMakeCall(node: unknown): node is Node & { arguments: unknown[] } {\n return isMemberCall(node, \"Scope\", \"make\") && Array.isArray((node as Node).arguments);\n}\n\nfunction isScopeCloseFor(node: unknown, bindingName: string): boolean {\n return isMemberCall(node, \"Scope\", \"close\") && isIdentifier(firstArgument(node as Node & { arguments: unknown[] }), bindingName);\n}\n\nconst lexicalScopeNodeTypes = new Set([\n \"BlockStatement\",\n \"CatchClause\",\n \"ForInStatement\",\n \"ForOfStatement\",\n \"ForStatement\",\n \"Program\",\n \"SwitchStatement\",\n]);\n\nfunction lexicalScopeNode(node: unknown): Node | undefined {\n return resourceAncestor(node, current => lexicalScopeNodeTypes.has(current.type ?? \"\") || isFunctionLike(current));\n}\n\nfunction isWithinLexicalScope(node: unknown, scope: Node): boolean {\n let current = node;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return false;\n seen.add(current);\n\n if (current === scope) return true;\n current = (current as Node).parent;\n }\n\n return false;\n}\n\nfunction lexicalScopeDepth(scope: Node): number {\n let depth = 0;\n let current: unknown = scope;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return depth;\n seen.add(current);\n depth += 1;\n current = (current as Node).parent;\n }\n\n return depth;\n}\n\nfunction patternBindingIdentifiers(pattern: unknown): Node[] {\n if (isIdentifier(pattern)) return [pattern];\n if (!isObjectValue(pattern)) return [];\n\n const node = pattern as Node;\n switch (node.type) {\n case \"ArrayPattern\":\n return Array.isArray(node.elements)\n ? node.elements.flatMap((element) => patternBindingIdentifiers(element))\n : [];\n case \"AssignmentPattern\":\n return patternBindingIdentifiers(node.left);\n case \"ObjectPattern\":\n return Array.isArray(node.properties)\n ? node.properties.flatMap((property) => {\n if (!isObjectValue(property)) return [];\n\n const propertyNode = property as Node;\n if (propertyNode.type === \"Property\") {\n return patternBindingIdentifiers(propertyNode.value);\n }\n if (propertyNode.type === \"RestElement\") {\n return patternBindingIdentifiers(propertyNode.argument);\n }\n return [];\n })\n : [];\n case \"RestElement\":\n return patternBindingIdentifiers(node.argument);\n case \"TSParameterProperty\":\n return patternBindingIdentifiers(node.parameter);\n default:\n return [];\n }\n}\n\nfunction lexicalBindingsInFunction(functionNode: Node): Node[] {\n return findNodes(functionNode.body, (candidate) => (\n isObjectValue(candidate) &&\n lexicalBindingIdentifiers(candidate as Node).length > 0 &&\n enclosingFunction(candidate) === functionNode\n )) as Node[];\n}\n\nfunction lexicalBindingIdentifiers(binding: Node): Node[] {\n if (binding.type === \"VariableDeclarator\") {\n return patternBindingIdentifiers(binding.id);\n }\n\n if (binding.type === \"CatchClause\") {\n return patternBindingIdentifiers(binding.param);\n }\n\n return (\n (binding.type === \"ClassDeclaration\" || binding.type === \"FunctionDeclaration\") &&\n isIdentifier(binding.id)\n )\n ? [binding.id]\n : [];\n}\n\nfunction lexicalBindingScope(binding: Node): Node | undefined {\n return binding.type === \"CatchClause\"\n ? lexicalScopeNode(binding.param)\n : lexicalScopeNode(binding);\n}\n\nfunction variableBindingForReference(reference: unknown, functionNode: Node): Node | undefined {\n if (!isIdentifier(reference)) return undefined;\n\n let best: Node | undefined;\n let bestDepth = -1;\n\n for (const binding of lexicalBindingsInFunction(functionNode)) {\n if (!lexicalBindingIdentifiers(binding).some((identifier) => (\n isIdentifier(identifier, reference.name)\n ))) continue;\n\n const scope = lexicalBindingScope(binding);\n if (scope === undefined || !isWithinLexicalScope(reference, scope)) continue;\n\n const depth = lexicalScopeDepth(scope);\n if (depth > bestDepth) {\n best = binding;\n bestDepth = depth;\n }\n }\n\n return best;\n}\n\nfunction directScopeMakeInitializer(init: unknown, scopeMake: unknown): boolean {\n if (init === scopeMake) return true;\n\n return (\n isObjectValue(init) &&\n (init as Node).type === \"YieldExpression\" &&\n (init as Node).delegate === true &&\n (init as Node).argument === scopeMake\n );\n}\n\nfunction enclosingFunction(node: unknown): Node | undefined {\n return resourceAncestor(node, isFunctionLike);\n}\n\nfunction scopeMakeBindingDeclaration(node: unknown): Node | undefined {\n let current = isObjectValue(node) ? (node as Node).parent : undefined;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return undefined;\n seen.add(current);\n\n if (\n (current as Node).type === \"VariableDeclarator\" &&\n isIdentifier((current as Node).id) &&\n directScopeMakeInitializer((current as Node).init, node)\n ) {\n return current as Node;\n }\n\n if (isFunctionLike(current)) return undefined;\n current = (current as Node).parent;\n }\n\n return undefined;\n}\n\nfunction hasMatchingScopeClose(node: unknown): boolean {\n const declaration = scopeMakeBindingDeclaration(node);\n const functionNode = enclosingFunction(node);\n if (declaration === undefined || functionNode === undefined) return false;\n\n const bindingName = ((declaration.id as Node & { name: string }).name);\n\n return findNodes(\n functionNode.body,\n (candidate) => (\n isScopeCloseFor(candidate, bindingName) &&\n enclosingFunction(candidate) === functionNode &&\n variableBindingForReference(\n firstArgument(candidate as Node & { arguments: unknown[] }),\n functionNode,\n ) === declaration\n ),\n ).length > 0;\n}\n\nfunction scopeCloseUsesCallbackParameter(\n node: unknown,\n parameter: Node & { name: string },\n callback: Node,\n): boolean {\n const reference = firstArgument(node as Node & { arguments: unknown[] });\n if (!isIdentifier(reference, parameter.name)) return false;\n\n return (\n variableBindingForReference(reference, callback) === undefined &&\n Array.isArray(callback.params) &&\n (callback.params as unknown[]).some((candidate) => candidate === parameter)\n );\n}\n\nfunction hasMatchingScopeReleaseCallback(node: Node & { arguments: unknown[] }): boolean {\n const arguments_ = (node as Node & { arguments: unknown[] }).arguments;\n const callbacks = isEffectMemberCallNamed(node, \"acquireUseRelease\")\n ? arguments_.slice(2)\n : arguments_.slice(1);\n\n return callbacks.some((callback) => {\n if (!isFunctionLike(callback)) return false;\n const parameter = ((callback as Node).params as unknown[] | undefined)?.[0];\n if (!isIdentifier(parameter)) return false;\n\n return findNodes(\n (callback as Node).body,\n (candidate) => (\n isScopeCloseFor(candidate, parameter.name) &&\n enclosingFunction(candidate) === callback &&\n scopeCloseUsesCallbackParameter(candidate, parameter, callback as Node)\n ),\n ).length > 0;\n });\n}\n\nfunction hasScopeOwner(node: unknown, version: EffectVersion = 3): boolean {\n return resourceAncestor(node, current => (\n version === 3 && (isEffectMemberCallNamed(current, \"scoped\") || isMemberCall(current, \"Layer\", \"scoped\"))\n ) || (\n isResourceAcquireReleaseCall(current, version) && firstArgument(current) === node && hasMatchingScopeReleaseCallback(current)\n )) !== undefined || hasMatchingScopeClose(node);\n}\n\nconst noUnboundScope = createResourceLifetimeRule(\n (node, version) => isScopeMakeCall(node) && !hasScopeOwner(node, version),\n version => `Rule: bind Scope.make to an owned lifecycle. Why: an unbound Scope can leak resources and finalizers. Fix: ${version === 3 ? \"use Effect.scoped/Layer.scoped, close the scope explicitly, or acquire it with a matching release callback.\" : \"use Effect.scope or acquire it with a matching Scope.close release callback. Effect.scoped alone does not own a separate scope.\"}`,\n);\n\nconst noResourceSucceedEscape = createResourceLifetimeRule(\n node => isEffectMemberCallNamed(node, \"succeed\") && isResourceLikeExpression(firstArgument(node)),\n () => \"Rule: do not let live resources escape through Effect.succeed. Why: ordinary success values do not express resource lifetime ownership. Fix: keep the resource inside Effect.acquireRelease, Scope, or a service layer.\",\n);\n\nfunction isResourceLikeConstruction(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"NewExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n let name: string | undefined;\n if (isIdentifier(callee)) {\n name = callee.name;\n } else if (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).property)\n ) {\n name = ((callee as Node).property as Node & { name: string }).name;\n }\n\n return name !== undefined && isResourceLikeName(name);\n}\n\nfunction isResourceLifecycleCandidate(node: unknown): boolean {\n return resourceAcquisitionCall(node) || isResourceLikeConstruction(node);\n}\n\nfunction isResourceAcquireReleaseCall(node: unknown, version: EffectVersion = 3): node is Node & { arguments: unknown[] } {\n return (\n isEffectMemberCallNamed(node, \"acquireRelease\") ||\n (version === 3 && isEffectMemberCallNamed(node, \"acquireReleaseInterruptible\")) ||\n isEffectMemberCallNamed(node, \"acquireUseRelease\")\n );\n}\n\nfunction hasResourceLifecycleOwner(node: unknown, version: EffectVersion = 3): boolean {\n if (hasReleaseOwnership(node, version)) {\n return true;\n }\n\n return resourceAncestor(node, current => (\n isResourceAcquireReleaseCall(current, version) ||\n isEffectMemberCallNamed(current, \"scoped\") ||\n (version === 3 && isMemberCall(current, \"Layer\", \"scoped\")) ||\n isEffectScopedPipeCall(current)\n )) !== undefined;\n}\n\nfunction resourceLexicalScope(node: unknown): Node | undefined {\n return resourceAncestor(node, current => isFunctionLike(current) || current.type === \"Program\");\n}\n\nfunction unownedResourcesInScope(scope: Node, version: EffectVersion = 3): unknown[] {\n return findNodes(scope, (candidate) => (\n isResourceLifecycleCandidate(candidate) &&\n resourceLexicalScope(candidate) === scope &&\n !hasResourceLifecycleOwner(candidate, version)\n ));\n}\n\nfunction nestedAcquireReleaseNode(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (!isResourceAcquireReleaseCall(node, version)) {\n return undefined;\n }\n\n return findNodes(node, candidate => isResourceAcquireReleaseCall(candidate, version)).length >= 3 ? node : undefined;\n}\n\nfunction requestLifecycleFunctionName(node: unknown): string | undefined {\n if (!isObjectValue(node) || !isFunctionLike(node)) {\n return undefined;\n }\n\n const functionNode = node as Node;\n if (isIdentifier(functionNode.id)) {\n return functionNode.id.name;\n }\n\n const parent = functionNode.parent;\n if (!isObjectValue(parent)) {\n return undefined;\n }\n\n if ((parent as Node).type === \"VariableDeclarator\" && isIdentifier((parent as Node).id)) {\n return ((parent as Node).id as Node & { name: string }).name;\n }\n\n if (\n (parent as Node).type === \"Property\" &&\n isIdentifier((parent as Node).key)\n ) {\n return ((parent as Node).key as Node & { name: string }).name;\n }\n\n return undefined;\n}\n\nfunction isRequestLifecycleFunction(node: unknown): boolean {\n const name = requestLifecycleFunctionName(node);\n return name !== undefined && /(?:handler|route|request|endpoint|controller)$/i.test(name);\n}\n\nfunction requestResourceOwner(node: unknown, version: EffectVersion): Node | undefined {\n if (version === 3) return enclosingFunction(node);\n return resourceAncestor(node, current => {\n if (!isFunctionLike(current)) return false;\n const parent = current.parent;\n return getEffectGeneratorArgument(parent, \"gen\", 4) !== current &&\n getEffectGeneratorArgument(parent, \"fn\", 4) !== current &&\n !effectLogicCallbacks(parent, 4).includes(current) &&\n ![\"sync\", \"suspend\", \"promise\", \"tryPromise\"].some(name => isEffectMemberCallNamed(parent, name) && parent.arguments.includes(current));\n });\n}\n\nfunction requestScopedResourceNodes(node: unknown, version: EffectVersion = 3): unknown[] {\n if (!isRequestLifecycleFunction(node) || !isObjectValue(node)) {\n return [];\n }\n\n const functionNode = node as Node;\n return findNodes(functionNode.body, (candidate) => (\n isResourceLifecycleCandidate(candidate) && requestResourceOwner(candidate, version) === functionNode\n ));\n}\n\nfunction openResourceInRunScope(node: unknown, version: EffectVersion = 3): unknown | undefined {\n const scope = resourceLexicalScope(node);\n if (scope === undefined) {\n return undefined;\n }\n\n return unownedResourcesInScope(scope, version)[0];\n}\n\nfunction programInitializerForReference(reference: unknown, version: EffectVersion = 3, context?: OxlintContext): unknown | undefined {\n if (!isIdentifier(reference)) {\n return undefined;\n }\n\n if (version === 4) {\n const root = resourceAncestor(reference, node => node.type === \"Program\");\n if (!root || !context?.sourceCode) return undefined;\n const declaration = findNodes(root, node => isObjectValue(node) && (node as Node).type === \"VariableDeclarator\")\n .find(node => context.sourceCode.getDeclaredVariables(node as ESTree.VariableDeclarator).some(variable => variable.references.some(entry => Object.is(entry.identifier, reference))));\n return (declaration as Node | undefined)?.init;\n }\n\n const functionScope = enclosingFunction(reference);\n const scopes = functionScope === undefined ? [] : [functionScope];\n let current = isObjectValue(reference)\n ? (reference as Node).parent\n : undefined;\n const seen = new WeakSet<object>();\n while (isObjectValue(current)) {\n if (seen.has(current)) {\n break;\n }\n seen.add(current);\n if ((current as Node).type === \"Program\") {\n scopes.push(current as Node);\n break;\n }\n current = (current as Node).parent;\n }\n\n for (const scope of scopes) {\n const declaration = findNode(scope, (candidate) => (\n isObjectValue(candidate) &&\n (candidate as Node).type === \"VariableDeclarator\" &&\n isIdentifier((candidate as Node).id, reference.name) &&\n (candidate as Node).init !== undefined\n ));\n if (declaration) {\n return (declaration as Node).init;\n }\n }\n\n return undefined;\n}\n\nfunction effectRunMissingLayerProvision(node: unknown, version: EffectVersion, context: OxlintContext): boolean {\n const execution = effectRunExecution(node, version);\n if (!execution) {\n return false;\n }\n\n const argument = execution.program;\n const search = (program: unknown, predicate: (node: unknown) => boolean) => version === 3\n ? findNode(program, predicate)\n : findNode(program, node => predicate(node) && requestResourceOwner(node, 4) === enclosingFunction(program));\n const program = search(argument, isYieldedServiceDependency) !== undefined\n ? argument\n : programInitializerForReference(argument, version, context) ?? argument;\n\n return (\n search(program, isYieldedServiceDependency) !== undefined &&\n search(program, isEffectOrLayerProvideCall) === undefined\n );\n}\n\nconst noResourceWithoutAcquireRelease = createResourceLifetimeRule(\n (node, version) => resourceAcquisitionCall(node) && !hasResourceLifecycleOwner(node, version),\n version => `Rule: acquire resources with an Effect release owner. Why: open/connect/create calls can leak across failure and interruption when they are ordinary calls. Fix: use Effect.acquireRelease, Effect.acquireUseRelease, ${version === 3 ? \"Effect.scoped, \" : \"\"}or a matching finalizer.`,\n);\n\nconst noRequestScopedLongLivedResource = createVersionedEffectCallbackRule(\n requestScopedResourceNodes,\n () => \"Rule: do not acquire long-lived resources inside request-scoped handlers. Why: per-request clients and pools multiply connections and make shutdown ownership ambiguous. Fix: provide the resource through a Layer or a longer-lived service boundary.\",\n true, true, [\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"],\n);\n\nconst noGlobalResourceSingleton = createVersionedEffectCallbackRule(\n node => enclosingFunction(node) === undefined && isResourceLikeConstruction(node) ? node : undefined,\n version => `Rule: do not create global resource singletons in Effect modules. Why: module-level clients and pools bypass Layer ownership and make tests and shutdown order implicit. Fix: construct the resource in a Layer${version === 3 ? \" or Effect.Service\" : \" using Context.Service\"} and provide it at the application boundary.`,\n false, true, [\"NewExpression\"],\n);\n\nconst noRunWithOpenResource = createVersionedEffectCallbackRule(\n (node, version) => isEffectRunCall(node, version) && openResourceInRunScope(node, version) !== undefined ? node : undefined,\n () => \"Rule: do not run an Effect while an unowned resource is open in the same scope. Why: runtime execution can finish without closing the resource. Fix: move acquisition into acquireRelease/scoped ownership and run only the managed effect.\",\n);\n\nconst noNestedAcquireRelease = createVersionedEffectCallbackRule(\n nestedAcquireReleaseNode,\n () => \"Rule: avoid deeply nested resource acquisition. Why: nested release stacks are difficult to audit and compose. Fix: build a named Layer or combine independent resources into one managed acquisition boundary.\",\n);\n\nconst noMissingLayerProvisionAtRun = createVersionedEffectCallbackRule(\n (node, version, context) => effectRunMissingLayerProvision(node, version, context) ? node : undefined,\n version => version === 3\n ? \"Rule: provide service layers before running an Effect that retrieves services. Why: an unprovided tag fails at runtime and hides the dependency contract at the boundary. Fix: compose the required Layer and use Effect.provide or Layer.provide before Effect.run*.\"\n : \"Rule: make service layer provision visible before running. Why: a context argument or Service-shaped yield does not prove Layer ownership. Fix: provide the required Layer before Effect.run*. This is syntax policy, not dependency type checking.\",\n);\n\nconst rules = {\n \"no-react-state\": noReactState,\n \"no-if-statement\": noIfStatement,\n \"no-switch-statement\": noSwitchStatement,\n \"no-ternary\": noTernary,\n \"no-return-null\": noReturnNull,\n \"no-option-as\": noOptionAs,\n \"no-effect-never\": noEffectNever,\n \"no-arrow-ladder\": noArrowLadder,\n \"no-branch-in-object\": noBranchInObject,\n \"no-iife-wrapper\": noIifeWrapper,\n \"no-return-in-arrow\": noReturnInArrow,\n \"no-return-in-callback\": noReturnInCallback,\n \"no-effect-fn-generator\": noEffectFnGenerator,\n \"no-effect-sync-console\": noEffectSyncConsole,\n \"no-console-in-effect-flow\": noConsoleInEffectFlow,\n \"no-effect-log-without-structured-context\": noEffectLogWithoutStructuredContext,\n \"require-span-on-public-service-method\": requireSpanOnPublicServiceMethod,\n \"no-runpromise-in-non-async-test-body\": noRunpromiseInNonAsyncTestBody,\n \"require-effect-flip-for-error-test\": requireEffectFlipForErrorTest,\n \"no-test-mock-layer-when-default-available\": noTestMockLayerWhenDefaultAvailable,\n \"no-nested-effect-gen\": noNestedEffectGen,\n \"no-yield-without-star-in-effect-gen\": noYieldWithoutStarInEffectGen,\n \"no-piped-yield-in-gen\": noPipedYieldInGen,\n \"no-gen-for-mapping\": noGenForMapping,\n \"prefer-gen-for-workflow\": preferGenForWorkflow,\n \"no-business-logic-in-pipe\": noBusinessLogicInPipe,\n \"no-large-anonymous-flow\": noLargeAnonymousFlow,\n \"no-effect-in-flow\": noEffectInFlow,\n \"prefer-named-flow\": preferNamedFlow,\n \"prefer-flow-for-pure-pipeline\": preferFlowForPurePipeline,\n \"prefer-pipe-for-behavior\": preferPipeForBehavior,\n \"prefer-decorated-effect-before-gen\": preferDecoratedEffectBeforeGen,\n \"no-workflow-in-behavior-pipe\": noWorkflowInBehaviorPipe,\n \"no-mixed-pillar-function\": noMixedPillarFunction,\n \"no-clever-effect-expression\": noCleverEffectExpression,\n \"prefer-extracted-concept\": preferExtractedConcept,\n \"prefer-effect-service\": preferEffectService,\n \"no-layer-provide-in-service-definition\": noLayerProvideInServiceDefinition,\n \"require-service-accessors\": requireServiceAccessors,\n \"require-service-dependencies\": requireServiceDependencies,\n \"no-namespace-effect-import\": noNamespaceEffectImport,\n \"no-manual-service-object-export\": noManualServiceObjectExport,\n \"no-layer-merge-in-request-handler\": noLayerMergeInRequestHandler,\n \"no-service-method-returning-promise\": noServiceMethodReturningPromise,\n \"prefer-layer-pipe\": preferLayerPipe,\n \"no-inline-layer-provide-in-program\": noInlineLayerProvideInProgram,\n \"prefer-layer-mergeall-for-infrastructure\": preferLayerMergeallForInfrastructure,\n \"no-service-layer-scatter\": noServiceLayerScatter,\n \"no-match-void-branch\": noMatchVoidBranch,\n \"no-json-parse-without-schema\": noJsonParseWithoutSchema,\n \"no-date-now-in-effect\": noDateNowInEffect,\n \"no-new-date-in-domain-logic\": noNewDateInDomainLogic,\n \"no-match-effect-branch\": noMatchEffectBranch,\n \"warn-effect-sync-wrapper\": warnEffectSyncWrapper,\n \"no-effect-side-effect-wrapper\": noEffectSideEffectWrapper,\n \"no-effect-all-step-sequencing\": noEffectAllStepSequencing,\n \"no-async-effect-combinator-callback\": noAsyncEffectCombinatorCallback,\n \"no-throw-in-effect-logic\": noThrowInEffectLogic,\n \"no-or-die-outside-boundary\": noOrDieOutsideBoundary,\n \"no-swallowed-catch-all\": noSwallowedCatchAll,\n \"no-effect-ignore\": noEffectIgnore,\n \"no-try-catch-in-effect-logic\": noTryCatchInEffectLogic,\n \"no-promise-api-in-effect-logic\": noPromiseApiInEffectLogic,\n \"no-try-catch\": noTryCatch,\n \"no-effect-wrapper-alias\": noEffectWrapperAlias,\n \"no-manual-effect-channels\": noManualEffectChannels,\n \"no-wrapgraphql-catchall\": noWrapgraphqlCatchall,\n \"no-render-side-effects\": noRenderSideEffects,\n \"no-atom-registry-effect-sync\": noAtomRegistryEffectSync,\n \"no-family-collection-read\": noFamilyCollectionRead,\n \"no-inline-runtime-provide\": noInlineRuntimeProvide,\n \"no-naked-object-state-update\": noNakedObjectStateUpdate,\n \"no-effect-succeed-variable\": noEffectSucceedVariable,\n \"no-effect-type-alias\": noEffectTypeAlias,\n \"no-public-generic-effect-error\": noPublicGenericEffectError,\n \"no-early-catchall-null\": noEarlyCatchallNull,\n \"no-empty-error-tag\": noEmptyErrorTag,\n \"no-expected-state-as-error\": noExpectedStateAsError,\n \"no-exception-domain-error\": noExceptionDomainError,\n \"no-effect-fail-error-message\": noEffectFailErrorMessage,\n \"no-catchall-generic-rethrow\": noCatchallGenericRethrow,\n \"no-log-only-error-handling\": noLogOnlyErrorHandling,\n \"no-error-as-public-effect-error\": noErrorAsPublicEffectError,\n \"no-unknown-public-error-channel\": noUnknownPublicErrorChannel,\n \"no-mixed-effect-error-shapes\": noMixedEffectErrorShapes,\n \"no-model-overlay-cast\": noModelOverlayCast,\n \"no-unknown-boolean-coercion-helper\": noUnknownBooleanCoercionHelper,\n \"no-fromnullable-nullish-coalesce\": noFromnullableNullishCoalesce,\n \"no-option-boolean-normalization\": noOptionBooleanNormalization,\n \"no-string-sentinel-return\": noStringSentinelReturn,\n \"no-string-sentinel-const\": noStringSentinelConst,\n \"no-raw-domain-id-alias\": noRawDomainIdAlias,\n \"no-boolean-domain-flag\": noBooleanDomainFlag,\n \"no-magic-domain-string\": noMagicDomainString,\n \"no-raw-domain-primitive-params\": noRawDomainPrimitiveParams,\n \"no-raw-time-domain-field\": noRawTimeDomainField,\n \"no-hidden-effect-execution\": noHiddenEffectExecution,\n \"no-boundary-try-catch-without-effect-map\": noBoundaryTryCatchWithoutEffectMap,\n \"no-node-fs-in-effect-code\": noNodeFsInEffectCode,\n \"no-node-platform-in-shared-code\": noNodePlatformInSharedCode,\n \"no-process-env-direct-read\": noProcessEnvDirectRead,\n \"no-overloaded-options-object\": noOverloadedOptionsObject,\n \"no-domain-logic-in-conditional\": noDomainLogicInConditional,\n \"no-implicit-state-machine-object\": noImplicitStateMachineObject,\n \"no-adhoc-domain-error\": noAdhocDomainError,\n \"no-domain-meaning-by-folder-only\": noDomainMeaningByFolderOnly,\n \"no-effect-as\": noEffectAs,\n \"no-effect-do\": noEffectDo,\n \"no-effect-bind\": noEffectBind,\n \"no-runtime-runfork\": noRuntimeRunFork,\n \"no-run-effect-outside-boundary\": noRunEffectOutsideBoundary,\n \"no-effect-async\": noEffectAsync,\n \"prevent-dynamic-imports\": preventDynamicImports,\n \"no-nested-effect-call\": noNestedEffectCall,\n \"no-effect-ladder\": noEffectLadder,\n \"no-flatmap-ladder\": noFlatMapLadder,\n \"no-pipe-ladder\": noPipeLadder,\n \"no-call-tower\": noCallTower,\n \"no-effect-orElse-ladder\": noEffectOrElseLadder,\n \"no-unbounded-effect-all\": noUnboundedEffectAll,\n \"no-fire-and-forget-fork\": noFireAndForgetFork,\n \"no-fork-in-loop\": noForkInLoop,\n \"no-race-without-cleanup\": noRaceWithoutCleanup,\n \"no-unobserved-fiber\": noUnobservedFiber,\n \"no-unbounded-concurrent-retry\": noUnboundedConcurrentRetry,\n \"no-blocking-call-in-effect\": noBlockingCallInEffect,\n \"no-promise-concurrency-in-effect\": noPromiseConcurrencyInEffect,\n \"no-shared-mutable-state-across-fibers\": noSharedMutableStateAcrossFibers,\n \"no-timeout-with-noninterruptible-promise\": noTimeoutWithNoninterruptiblePromise,\n \"no-uninterruptible-concurrent-region\": noUninterruptibleConcurrentRegion,\n \"no-unbounded-queue-or-pubsub\": noUnboundedQueueOrPubSub,\n \"no-global-mutable-concurrency-state\": noGlobalMutableConcurrencyState,\n \"no-manual-deferred-coordination\": noManualDeferredCoordination,\n \"no-acquire-without-scoped-release\": noAcquireWithoutScopedRelease,\n \"no-manual-resource-close\": noManualResourceClose,\n \"no-unbound-scope\": noUnboundScope,\n \"no-resource-succeed-escape\": noResourceSucceedEscape,\n \"no-resource-without-acquire-release\": noResourceWithoutAcquireRelease,\n \"no-request-scoped-long-lived-resource\": noRequestScopedLongLivedResource,\n \"no-global-resource-singleton\": noGlobalResourceSingleton,\n \"no-run-with-open-resource\": noRunWithOpenResource,\n \"no-nested-acquire-release\": noNestedAcquireRelease,\n \"no-missing-layer-provision-at-run\": noMissingLayerProvisionAtRun,\n \"no-yield-with-held-semaphore-permit\": noYieldWithHeldSemaphorePermit,\n \"no-yield-with-held-mutable-ref\": noYieldWithHeldMutableRef,\n \"no-unscoped-background-fiber\": noUnscopedBackgroundFiber,\n};\n\nfor (const ruleName of versionSensitiveRules) {\n const rule = rules[ruleName];\n rule.meta = {\n ...rule.meta,\n schema: withEffectVersionSchema(Array.isArray(rule.meta?.schema) ? rule.meta.schema : []) as RuleOptionsSchema,\n };\n}\n\ntype RuleName = keyof typeof rules;\n\nconst strictTestingObservabilityAndQaRuleNames = [\n \"no-runpromise-in-non-async-test-body\",\n \"require-effect-flip-for-error-test\",\n \"no-test-mock-layer-when-default-available\",\n] as const satisfies readonly RuleName[];\n\ntype StrictTestingObservabilityAndQaRuleName =\n typeof strictTestingObservabilityAndQaRuleNames[number];\n\nconst strictConcurrencySafetyRuleNames = [\n \"no-manual-deferred-coordination\",\n \"no-yield-with-held-semaphore-permit\",\n \"no-yield-with-held-mutable-ref\",\n \"no-unscoped-background-fiber\",\n] as const satisfies readonly RuleName[];\n\nconst strictErrorModelingRuleNames = [\n \"no-early-catchall-null\",\n \"no-empty-error-tag\",\n] as const satisfies readonly RuleName[];\n\nconst strictEffectFlowRuleNames = [\n \"no-business-logic-in-pipe\",\n] as const satisfies readonly RuleName[];\n\nconst strictPureTransformationRuleNames = [\n \"prefer-flow-for-pure-pipeline\",\n] as const satisfies readonly RuleName[];\n\nconst strictResourceLifetimeRuleNames = [\n \"no-request-scoped-long-lived-resource\",\n \"no-global-resource-singleton\",\n \"no-nested-acquire-release\",\n \"no-missing-layer-provision-at-run\",\n] as const satisfies readonly RuleName[];\n\ntype StrictRuleName = StrictTestingObservabilityAndQaRuleName |\n typeof strictConcurrencySafetyRuleNames[number] |\n typeof strictErrorModelingRuleNames[number] |\n typeof strictEffectFlowRuleNames[number] |\n typeof strictPureTransformationRuleNames[number] |\n typeof strictResourceLifetimeRuleNames[number];\n\nexport type EffectRuleOptions = {\n effectVersion?: EffectVersion;\n boundaryPaths?: readonly string[];\n configPaths?: readonly string[];\n};\nexport type EffectRuleEntry = \"error\" | [\"error\", EffectRuleOptions];\n\ntype ApplicableRuleName<N extends RuleName, V extends EffectVersion> =\n V extends 4 ? Exclude<N, typeof legacyOnlyRules[number]> : N;\ntype VersionedRuleEntry<N extends RuleName, V extends EffectVersion> =\n N extends typeof versionSensitiveRules[number] ? [\"error\", { effectVersion: V }] : \"error\";\n\nfunction rulesFromNames<const T extends readonly RuleName[], const V extends EffectVersion>(ruleNames: T, version: V) {\n return Object.fromEntries(\n ruleNames.filter((ruleName) => version === 3 || !(legacyOnlyRules as readonly string[]).includes(ruleName))\n .map((ruleName) => [`linteffect/${ruleName}`, (versionSensitiveRules as readonly string[]).includes(ruleName)\n ? [\"error\", { effectVersion: version }] : \"error\"]),\n ) as { [N in ApplicableRuleName<T[number], V> as `linteffect/${N}`]: VersionedRuleEntry<N, V> };\n}\n\nfunction presetFor<const T extends Record<`linteffect/${string}`, EffectRuleEntry>>(groupRules: T) {\n return {\n jsPlugins,\n rules: groupRules,\n } as const;\n}\n\nexport const jsPlugins = [\n {\n name: \"linteffect\",\n specifier: \"@opsydyn/oxlint-effect\",\n },\n] as const;\n\nfunction createVersionedConfigurations<const V extends EffectVersion>(version: V) {\n const reactAndRuntimeBoundariesRules = rulesFromNames([\n \"no-react-state\",\n \"no-runtime-runfork\",\n \"no-run-effect-outside-boundary\",\n \"no-or-die-outside-boundary\",\n \"prevent-dynamic-imports\",\n \"no-render-side-effects\",\n \"no-inline-runtime-provide\",\n ] as const, version);\n\n const effectCompositionRules = rulesFromNames([\n \"no-effect-as\",\n \"no-effect-do\",\n \"no-effect-bind\",\n \"no-effect-async\",\n \"no-effect-ignore\",\n \"no-effect-never\",\n \"no-effect-fn-generator\",\n \"no-nested-effect-gen\",\n \"no-yield-without-star-in-effect-gen\",\n \"no-async-effect-combinator-callback\",\n \"no-throw-in-effect-logic\",\n \"no-try-catch-in-effect-logic\",\n \"no-promise-api-in-effect-logic\",\n \"no-swallowed-catch-all\",\n \"no-manual-effect-channels\",\n \"no-effect-type-alias\",\n \"no-public-generic-effect-error\",\n ] as const, version);\n\n const concurrencySafetyRules = rulesFromNames([\n \"no-unbounded-effect-all\",\n \"no-fire-and-forget-fork\",\n \"no-fork-in-loop\",\n \"no-race-without-cleanup\",\n \"no-unobserved-fiber\",\n \"no-unbounded-concurrent-retry\",\n \"no-blocking-call-in-effect\",\n \"no-promise-concurrency-in-effect\",\n \"no-shared-mutable-state-across-fibers\",\n \"no-timeout-with-noninterruptible-promise\",\n \"no-uninterruptible-concurrent-region\",\n \"no-unbounded-queue-or-pubsub\",\n \"no-global-mutable-concurrency-state\",\n ...strictConcurrencySafetyRuleNames,\n \"no-acquire-without-scoped-release\",\n ] as const, version);\n\n const resourceLifetimeRules = rulesFromNames([\n \"no-manual-resource-close\",\n \"no-unbound-scope\",\n \"no-resource-succeed-escape\",\n \"no-resource-without-acquire-release\",\n ...strictResourceLifetimeRuleNames,\n \"no-run-with-open-resource\",\n ] as const, version);\n\n const pipelineShapeAndSequencingRules = rulesFromNames([\n \"no-nested-effect-call\",\n \"no-effect-ladder\",\n \"no-flatmap-ladder\",\n \"no-pipe-ladder\",\n \"no-call-tower\",\n \"no-effect-orElse-ladder\",\n \"no-effect-wrapper-alias\",\n \"warn-effect-sync-wrapper\",\n \"no-effect-side-effect-wrapper\",\n \"no-effect-all-step-sequencing\",\n \"no-effect-succeed-variable\",\n ] as const, version);\n\n const branchingAndLocalControlFlowRules = rulesFromNames([\n \"no-if-statement\",\n \"no-switch-statement\",\n \"no-ternary\",\n \"no-try-catch\",\n \"no-arrow-ladder\",\n \"no-iife-wrapper\",\n \"no-return-in-arrow\",\n \"no-return-in-callback\",\n \"no-return-null\",\n \"no-branch-in-object\",\n ] as const, version);\n\n const optionMatchAndDataNormalizationRules = rulesFromNames([\n \"no-option-as\",\n \"no-match-void-branch\",\n \"no-match-effect-branch\",\n \"no-model-overlay-cast\",\n \"no-unknown-boolean-coercion-helper\",\n \"no-fromnullable-nullish-coalesce\",\n \"no-option-boolean-normalization\",\n \"no-string-sentinel-return\",\n \"no-string-sentinel-const\",\n ] as const, version);\n\n const atomStateAndPlatformBoundariesRules = rulesFromNames([\n \"no-effect-sync-console\",\n \"no-atom-registry-effect-sync\",\n \"no-family-collection-read\",\n \"no-naked-object-state-update\",\n \"no-wrapgraphql-catchall\",\n ] as const, version);\n\n const domainModelingRules = rulesFromNames([\n \"no-raw-domain-id-alias\",\n \"no-boolean-domain-flag\",\n \"no-magic-domain-string\",\n \"no-raw-domain-primitive-params\",\n \"no-raw-time-domain-field\",\n \"no-overloaded-options-object\",\n \"no-domain-logic-in-conditional\",\n \"no-implicit-state-machine-object\",\n \"no-adhoc-domain-error\",\n \"no-domain-meaning-by-folder-only\",\n \"no-new-date-in-domain-logic\",\n ] as const, version);\n\n const dddErrorModelingRuleNames = [\n \"no-error-as-public-effect-error\",\n \"no-unknown-public-error-channel\",\n \"no-mixed-effect-error-shapes\",\n \"no-expected-state-as-error\",\n ] as const;\n type DddErrorModelingRuleName = typeof dddErrorModelingRuleNames[number];\n\n const errorModelingRuleNames = [\n ...dddErrorModelingRuleNames,\n \"no-early-catchall-null\",\n \"no-empty-error-tag\",\n \"no-exception-domain-error\",\n \"no-effect-fail-error-message\",\n \"no-catchall-generic-rethrow\",\n \"no-log-only-error-handling\",\n ] as const;\n\n const errorModelingRules = rulesFromNames(errorModelingRuleNames, version);\n\n const dddRules = {\n ...domainModelingRules,\n ...errorModelingRules,\n } as const;\n\n const effectFlowRules = rulesFromNames([\n \"no-piped-yield-in-gen\",\n \"no-gen-for-mapping\",\n \"prefer-gen-for-workflow\",\n ...strictEffectFlowRuleNames,\n ] as const, version);\n\n const pureTransformationRules = rulesFromNames([\n \"no-large-anonymous-flow\",\n \"no-effect-in-flow\",\n \"prefer-named-flow\",\n ...strictPureTransformationRuleNames,\n ] as const, version);\n\n const behaviorDecorationRules = rulesFromNames([\n \"prefer-pipe-for-behavior\",\n \"prefer-decorated-effect-before-gen\",\n \"no-workflow-in-behavior-pipe\",\n ] as const, version);\n\n const styleSeparationRules = rulesFromNames([\n \"no-mixed-pillar-function\",\n \"no-clever-effect-expression\",\n \"prefer-extracted-concept\",\n ] as const, version);\n\n const serviceAndLayerArchitectureRules = rulesFromNames([\n \"prefer-effect-service\",\n \"no-layer-provide-in-service-definition\",\n \"require-service-accessors\",\n \"require-service-dependencies\",\n \"no-namespace-effect-import\",\n \"no-manual-service-object-export\",\n \"no-layer-merge-in-request-handler\",\n \"no-service-method-returning-promise\",\n \"prefer-layer-pipe\",\n \"no-inline-layer-provide-in-program\",\n \"prefer-layer-mergeall-for-infrastructure\",\n \"no-service-layer-scatter\",\n ] as const, version);\n\n const platformAndBoundaryHygieneRules = rulesFromNames([\n \"no-hidden-effect-execution\",\n \"no-boundary-try-catch-without-effect-map\",\n \"no-node-fs-in-effect-code\",\n \"no-json-parse-without-schema\",\n \"no-date-now-in-effect\",\n \"no-node-platform-in-shared-code\",\n \"no-process-env-direct-read\",\n ] as const, version);\n\n const testingObservabilityAndQaRules = rulesFromNames([\n \"no-console-in-effect-flow\",\n \"no-effect-log-without-structured-context\",\n \"require-span-on-public-service-method\",\n ...strictTestingObservabilityAndQaRuleNames,\n ] as const, version);\n\n const allRules = rulesFromNames(Object.keys(rules) as RuleName[], version);\n const recommendedExcludedRuleNames = [\n ...strictTestingObservabilityAndQaRuleNames,\n ...strictConcurrencySafetyRuleNames,\n ...strictErrorModelingRuleNames,\n ...strictEffectFlowRuleNames,\n ...strictPureTransformationRuleNames,\n ...strictResourceLifetimeRuleNames,\n ...dddErrorModelingRuleNames,\n \"no-resource-succeed-escape\",\n ] as readonly RuleName[];\n const recommendedRuleNames = (Object.keys(rules) as RuleName[]).filter(\n (ruleName): ruleName is Exclude<\n RuleName,\n StrictRuleName | DddErrorModelingRuleName | \"no-resource-succeed-escape\"\n > => (\n !recommendedExcludedRuleNames.includes(ruleName)\n ),\n );\n const recommendedRules = rulesFromNames(recommendedRuleNames, version);\n\n const ruleGroups = {\n reactAndRuntimeBoundaries: reactAndRuntimeBoundariesRules,\n effectComposition: effectCompositionRules,\n concurrencySafety: concurrencySafetyRules,\n resourceLifetime: resourceLifetimeRules,\n pipelineShapeAndSequencing: pipelineShapeAndSequencingRules,\n branchingAndLocalControlFlow: branchingAndLocalControlFlowRules,\n optionMatchAndDataNormalization: optionMatchAndDataNormalizationRules,\n atomStateAndPlatformBoundaries: atomStateAndPlatformBoundariesRules,\n domainModeling: domainModelingRules,\n errorModeling: errorModelingRules,\n ddd: dddRules,\n effectFlow: effectFlowRules,\n pureTransformation: pureTransformationRules,\n behaviorDecoration: behaviorDecorationRules,\n styleSeparation: styleSeparationRules,\n serviceAndLayerArchitecture: serviceAndLayerArchitectureRules,\n platformAndBoundaryHygiene: platformAndBoundaryHygieneRules,\n testingObservabilityAndQa: testingObservabilityAndQaRules,\n } as const;\n\n const recommended = presetFor(recommendedRules);\n const typeAware = {\n options: {\n typeAware: true,\n },\n jsPlugins,\n rules: recommended.rules,\n } as const;\n const reactAndRuntimeBoundaries = presetFor(reactAndRuntimeBoundariesRules);\n const effectComposition = presetFor(effectCompositionRules);\n const concurrencySafety = presetFor(concurrencySafetyRules);\n const resourceLifetime = presetFor(resourceLifetimeRules);\n const pipelineShapeAndSequencing = presetFor(pipelineShapeAndSequencingRules);\n const branchingAndLocalControlFlow = presetFor(branchingAndLocalControlFlowRules);\n const optionMatchAndDataNormalization = presetFor(optionMatchAndDataNormalizationRules);\n const atomStateAndPlatformBoundaries = presetFor(atomStateAndPlatformBoundariesRules);\n const domainModeling = presetFor(domainModelingRules);\n const errorModeling = presetFor(errorModelingRules);\n const ddd = presetFor(dddRules);\n const effectFlow = presetFor(effectFlowRules);\n const pureTransformation = presetFor(pureTransformationRules);\n const behaviorDecoration = presetFor(behaviorDecorationRules);\n const styleSeparation = presetFor(styleSeparationRules);\n const serviceAndLayerArchitecture = presetFor(serviceAndLayerArchitectureRules);\n const platformAndBoundaryHygiene = presetFor(platformAndBoundaryHygieneRules);\n const testingObservabilityAndQa = presetFor(testingObservabilityAndQaRules);\n\n const presets = {\n recommended,\n typeAware,\n reactAndRuntimeBoundaries,\n effectComposition,\n concurrencySafety,\n resourceLifetime,\n pipelineShapeAndSequencing,\n branchingAndLocalControlFlow,\n optionMatchAndDataNormalization,\n atomStateAndPlatformBoundaries,\n domainModeling,\n errorModeling,\n ddd,\n effectFlow,\n pureTransformation,\n behaviorDecoration,\n styleSeparation,\n serviceAndLayerArchitecture,\n platformAndBoundaryHygiene,\n testingObservabilityAndQa,\n } as const;\n\n return {\n jsPlugins,\n reactAndRuntimeBoundariesRules,\n effectCompositionRules,\n concurrencySafetyRules,\n resourceLifetimeRules,\n pipelineShapeAndSequencingRules,\n branchingAndLocalControlFlowRules,\n optionMatchAndDataNormalizationRules,\n atomStateAndPlatformBoundariesRules,\n domainModelingRules,\n errorModelingRules,\n dddRules,\n effectFlowRules,\n pureTransformationRules,\n behaviorDecorationRules,\n styleSeparationRules,\n serviceAndLayerArchitectureRules,\n platformAndBoundaryHygieneRules,\n testingObservabilityAndQaRules,\n allRules,\n recommendedRules,\n ruleGroups,\n recommended,\n typeAware,\n reactAndRuntimeBoundaries,\n effectComposition,\n concurrencySafety,\n resourceLifetime,\n pipelineShapeAndSequencing,\n branchingAndLocalControlFlow,\n optionMatchAndDataNormalization,\n atomStateAndPlatformBoundaries,\n domainModeling,\n errorModeling,\n ddd,\n effectFlow,\n pureTransformation,\n behaviorDecoration,\n styleSeparation,\n serviceAndLayerArchitecture,\n platformAndBoundaryHygiene,\n testingObservabilityAndQa,\n presets,\n } as const;\n}\n\nexport const {\n reactAndRuntimeBoundariesRules,\n effectCompositionRules,\n concurrencySafetyRules,\n resourceLifetimeRules,\n pipelineShapeAndSequencingRules,\n branchingAndLocalControlFlowRules,\n optionMatchAndDataNormalizationRules,\n atomStateAndPlatformBoundariesRules,\n domainModelingRules,\n errorModelingRules,\n dddRules,\n effectFlowRules,\n pureTransformationRules,\n behaviorDecorationRules,\n styleSeparationRules,\n serviceAndLayerArchitectureRules,\n platformAndBoundaryHygieneRules,\n testingObservabilityAndQaRules,\n allRules,\n recommendedRules,\n ruleGroups,\n recommended,\n typeAware,\n reactAndRuntimeBoundaries,\n effectComposition,\n concurrencySafety,\n resourceLifetime,\n pipelineShapeAndSequencing,\n branchingAndLocalControlFlow,\n optionMatchAndDataNormalization,\n atomStateAndPlatformBoundaries,\n domainModeling,\n errorModeling,\n ddd,\n effectFlow,\n pureTransformation,\n behaviorDecoration,\n styleSeparation,\n serviceAndLayerArchitecture,\n platformAndBoundaryHygiene,\n testingObservabilityAndQa,\n presets,\n} = createVersionedConfigurations(4);\n\n/** Legacy Effect 3 presets; default exports target Effect 4. */\nexport const effect3 = createVersionedConfigurations(3);\n\nexport default definePlugin({\n meta: {\n name: \"linteffect\",\n },\n rules,\n});\n"],"mappings":"AAEA,SAAgB,EAAiB,GAC/B,MAAM,EAAQ,EAAQ,GACtB,GAAqB,iBAAV,GAA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A,wCACA,2CACA,uCACA,+BACA,yCACG,GACH,qCACU,GAEN,EAAwB,GAAe,CAC3C,2BACA,mBACA,6BACA,yCACG,GACH,6BACU,GAEN,EAAkC,GAAe,CACrD,wBACA,mBACA,oBACA,iBACA,gBACA,0BACA,0BACA,2BACA,gCACA,gCACA,8BACU,GAEN,EAAoC,GAAe,CACvD,kBACA,sBACA,aACA,eACA,kBACA,kBACA,qBACA,wBACA,iBACA,uBACU,GAEN,EAAuC,GAAe,CAC1D,eACA,uBACA,yBACA,wBACA,qCACA,mCACA,kCACA,4BACA,4BACU,GAEN,EAAsC,GAAe,CACzD,yBACA,+BACA,4BACA,+BACA,2BACU,GAEN,EAAsB,GAAe,CACzC,yBACA,yBACA,yBACA,iCACA,2BACA,+BACA,iCACA,mCACA,wBACA,mCACA,+BACU,GAEN,EAA4B,CAChC,kCACA,kCACA,+BACA,8BAcI,EAAqB,GAAe,IATrC,EACH,yBACA,qBACA,4BACA,+BACA,8BACA,8BAGgE,GAE5D,EAAW,IACZ,KACA,GAGC,EAAkB,GAAe,CACrC,wBACA,qBACA,6BACG,IACO,GAEN,EAA0B,GAAe,CAC7C,0BACA,oBACA,uBACG,IACO,GAEN,EAA0B,GAAe,CAC7C,2BACA,qCACA,gCACU,GAEN,EAAuB,GAAe,CAC1C,2BACA,8BACA,4BACU,GAEN,EAAmC,GAAe,CACtD,wBACA,yCACA,4BACA,+BACA,6BACA,kCACA,oCACA,sCACA,oBACA,qCACA,2CACA,4BACU,GAEN,EAAkC,GAAe,CACrD,6BACA,2CACA,4BACA,+BACA,wBACA,kCACA,8BACU,GAEN,EAAiC,GAAe,CACpD,4BACA,2CACA,2CACG,IACO,GAEN,EAAW,GAAe,OAAO,KAAK,IAAsB,GAC5D,EAA+B,IAChC,MACA,MACA,MACA,MACA,MACA,MACA,EACH,8BAUI,EAAmB,GARK,OAAO,KAAK,IAAsB,OAC7D,IAIE,EAA6B,SAAS,IAGmB,GAExD,EAAa,CACjB,0BAA2B,EAC3B,kBAAmB,EACnB,kBAAmB,EACnB,iBAAkB,EAClB,2BAA4B,EAC5B,6BAA8B,EAC9B,gCAAiC,EACjC,+BAAgC,EAChC,eAAgB,EAChB,cAAe,EACf,IAAK,EACL,WAAY,EACZ,mBAAoB,EACpB,mBAAoB,EACpB,gBAAiB,EACjB,4BAA6B,EAC7B,2BAA4B,EAC5B,0BAA2B,GAGvB,EAAc,GAAU,GACxB,EAAY,CAChB,QAAS,CACP,WAAW,GAEb,aACA,MAAO,EAAY,OAEf,EAA4B,GAAU,GACtC,EAAoB,GAAU,GAC9B,EAAoB,GAAU,GAC9B,EAAmB,GAAU,GAC7B,EAA6B,GAAU,GACvC,EAA+B,GAAU,GACzC,EAAkC,GAAU,GAC5C,EAAiC,GAAU,GAC3C,EAAiB,GAAU,GAC3B,EAAgB,GAAU,GAC1B,EAAM,GAAU,GAChB,EAAa,GAAU,GACvB,EAAqB,GAAU,GAC/B,EAAqB,GAAU,GAC/B,EAAkB,GAAU,GAC5B,EAA8B,GAAU,GACxC,EAA6B,GAAU,GACvC,EAA4B,GAAU,GAyB5C,MAAO,CACL,aACA,iCACA,yBACA,yBACA,wBACA,kCACA,oCACA,uCACA,sCACA,sBACA,qBACA,WACA,kBACA,0BACA,0BACA,uBACA,mCACA,kCACA,iCACA,WACA,mBACA,aACA,cACA,YACA,4BACA,oBACA,oBACA,mBACA,6BACA,+BACA,kCACA,iCACA,iBACA,gBACA,MACA,aACA,qBACA,qBACA,kBACA,8BACA,6BACA,4BACA,QAAA,CAjEA,cACA,YACA,4BACA,oBACA,oBACA,mBACA,6BACA,+BACA,kCACA,iCACA,iBACA,gBACA,MACA,aACA,qBACA,qBACA,kBACA,8BACA,6BACA,6BAgDJ,kEDz+PA,MAAa,GAAwB,CACnC,iBACA,qBACA,6BACA,4BACA,4BACA,2CACA,wCACA,uCACA,qCACA,4CACA,2BACA,qCACA,+BACA,2BACA,8BACA,wBACA,yCACA,4BACA,+BACA,kCACA,oCACA,sCACA,oBACA,qC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,oCACA,GAAA,oBACA,GAAA,mBACA,GAAA,SACA,GAAA,gBACA,GAAA,wBACA,GAAA,wBACA,GAAA,qBACA,GAAA,iCACA,GAAA,gCACA,GAAA,+BACA,GAAA,SACA,GAAA,iBACA,GAAA,WACA,GAAA,YACA,GAAA,UACA,GAAA,0BACA,GAAA,kBACA,GAAA,kBACA,GAAA,iBACA,GAAA,2BACA,GAAA,6BACA,GAAA,gCACA,GAAA,+BACA,GAAA,eACA,GAAA,cACA,GAAA,IACA,GAAA,WACA,GAAA,mBACA,GAAA,mBACA,GAAA,gBACA,GAAA,4BACA,GAAA,2BACA,GAAA,0BACA,GAAA,QACA,IACE,GAA8B,GAGrB,GAAU,GAA8B,GAErD,IAAA,GAAe,GAAa,CAC1B,KAAM,CACJ,KAAM,cAER"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["call"],"sources":["../src/effect-version.ts","../src/index.ts"],"sourcesContent":["export type EffectVersion = 3 | 4;\n\nexport function effectVersionFor(options: readonly unknown[]): EffectVersion {\n const first = options[0];\n if (typeof first !== \"object\" || first === null || !Object.hasOwn(first, \"effectVersion\")) return 4;\n const value = (first as Record<string, unknown>).effectVersion;\n if (value === 3 || value === 4) return value;\n throw new Error(\"effectVersion must be 3 or 4\");\n}\n\nexport function withEffectVersionSchema(schema: readonly unknown[]): readonly unknown[] {\n const first = schema[0] as { properties?: Record<string, unknown> } | undefined;\n return [{\n type: \"object\",\n additionalProperties: false,\n ...first,\n properties: { ...first?.properties, effectVersion: { type: \"integer\", enum: [3, 4] } },\n }, ...schema.slice(1)];\n}\n\n// Compact runtime projection; tests require exact agreement with the evidence inventory.\nexport const versionSensitiveRules = [\n \"no-react-state\",\n \"no-runtime-runfork\",\n \"no-or-die-outside-boundary\",\n \"no-inline-runtime-provide\",\n \"no-console-in-effect-flow\",\n \"no-effect-log-without-structured-context\",\n \"require-span-on-public-service-method\",\n \"no-runpromise-in-non-async-test-body\",\n \"require-effect-flip-for-error-test\",\n \"no-test-mock-layer-when-default-available\",\n \"prefer-pipe-for-behavior\",\n \"prefer-decorated-effect-before-gen\",\n \"no-workflow-in-behavior-pipe\",\n \"no-mixed-pillar-function\",\n \"no-clever-effect-expression\",\n \"prefer-effect-service\",\n \"no-layer-provide-in-service-definition\",\n \"require-service-accessors\",\n \"require-service-dependencies\",\n \"no-manual-service-object-export\",\n \"no-layer-merge-in-request-handler\",\n \"no-service-method-returning-promise\",\n \"prefer-layer-pipe\",\n \"no-inline-layer-provide-in-program\",\n \"prefer-layer-mergeall-for-infrastructure\",\n \"no-service-layer-scatter\",\n \"no-json-parse-without-schema\",\n \"no-date-now-in-effect\",\n \"no-effect-all-step-sequencing\",\n \"no-async-effect-combinator-callback\",\n \"no-throw-in-effect-logic\",\n \"no-swallowed-catch-all\",\n \"no-try-catch-in-effect-logic\",\n \"no-promise-api-in-effect-logic\",\n \"no-wrapgraphql-catchall\",\n \"no-naked-object-state-update\",\n \"no-early-catchall-null\",\n \"no-exception-domain-error\",\n \"no-expected-state-as-error\",\n \"no-catchall-generic-rethrow\",\n \"no-log-only-error-handling\",\n \"no-fromnullable-nullish-coalesce\",\n \"no-model-overlay-cast\",\n \"no-string-sentinel-return\",\n \"no-string-sentinel-const\",\n \"prefer-gen-for-workflow\",\n \"no-business-logic-in-pipe\",\n \"no-flatmap-ladder\",\n \"no-effect-side-effect-wrapper\",\n \"no-ternary\",\n \"no-return-in-arrow\",\n \"no-branch-in-object\",\n \"no-hidden-effect-execution\",\n \"no-boundary-try-catch-without-effect-map\",\n \"no-run-effect-outside-boundary\",\n \"no-effect-async\",\n \"no-effect-fn-generator\",\n \"no-nested-effect-gen\",\n \"no-yield-without-star-in-effect-gen\",\n \"no-effect-orElse-ladder\",\n \"no-fire-and-forget-fork\",\n \"no-fork-in-loop\",\n \"no-race-without-cleanup\",\n \"no-unobserved-fiber\",\n \"no-blocking-call-in-effect\",\n \"no-promise-concurrency-in-effect\",\n \"no-shared-mutable-state-across-fibers\",\n \"no-timeout-with-noninterruptible-promise\",\n \"no-uninterruptible-concurrent-region\",\n \"no-unbounded-queue-or-pubsub\",\n \"no-global-mutable-concurrency-state\",\n \"no-manual-deferred-coordination\",\n \"no-acquire-without-scoped-release\",\n \"no-manual-resource-close\",\n \"no-unbound-scope\",\n \"no-resource-succeed-escape\",\n \"no-resource-without-acquire-release\",\n \"no-request-scoped-long-lived-resource\",\n \"no-global-resource-singleton\",\n \"no-run-with-open-resource\",\n \"no-nested-acquire-release\",\n \"no-missing-layer-provision-at-run\",\n \"no-yield-with-held-semaphore-permit\",\n \"no-yield-with-held-mutable-ref\",\n \"no-unscoped-background-fiber\",\n] as const;\n\nexport const legacyOnlyRules = [\n \"no-runtime-runfork\",\n \"require-service-accessors\",\n \"require-service-dependencies\",\n \"no-effect-async\",\n \"no-effect-orElse-ladder\",\n] as const;\n","import { definePlugin, defineRule } from \"@oxlint/plugins\";\nimport { effectVersionFor, legacyOnlyRules, versionSensitiveRules, withEffectVersionSchema } from \"./effect-version.ts\";\nimport type { EffectVersion } from \"./effect-version.ts\";\nexport type { EffectVersion } from \"./effect-version.ts\";\nimport type { RuleOptionsSchema } from \"@oxlint/plugins\";\nimport type { Context as OxlintContext, ESTree, Scope } from \"@oxlint/plugins\";\n\ntype Node = {\n type?: string;\n [key: string]: unknown;\n};\n\nfunction isObjectValue(value: unknown): value is Node {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction isIdentifier(node: unknown, name?: string): node is Node & { name: string } {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"Identifier\" &&\n typeof (node as Node).name === \"string\" &&\n (name === undefined || (node as Node).name === name)\n );\n}\n\nfunction isMemberExpression(node: unknown, objectName: string, propertyName: string): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const member = node as Node;\n return (\n member.type === \"MemberExpression\" &&\n member.computed !== true &&\n isIdentifier(member.object, objectName) &&\n isIdentifier(member.property, propertyName)\n );\n}\n\nfunction isEffectMemberCall(node: unknown): node is Node & { arguments: unknown[] } {\n return isMemberCall(node, \"Effect\") && Array.isArray((node as Node).arguments);\n}\n\nfunction firstArgument(node: Node & { arguments: unknown[] }): unknown {\n return node.arguments[0];\n}\n\nfunction isEffectMemberCallNamed(\n node: unknown,\n propertyName: string,\n): node is Node & { arguments: unknown[] } {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n const callee = node.callee as Node;\n return isIdentifier((callee.property as Node | undefined), propertyName);\n}\n\nfunction hasDeepNestedEffectFirstArgument(node: unknown): node is Node & { arguments: unknown[] } {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n const inner = firstArgument(node);\n if (!isEffectMemberCall(inner)) {\n return false;\n }\n\n return isEffectMemberCall(firstArgument(inner));\n}\n\nfunction hasNestedEffectCallArgument(node: unknown): node is Node & { arguments: unknown[] } {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n return node.arguments.slice(0, 2).some((argument) => isEffectMemberCall(argument));\n}\n\nfunction containsEffectMemberCallNamed(\n node: unknown,\n propertyName: string,\n seen = new WeakSet<object>(),\n): boolean {\n return findNode(node, (node) => isEffectMemberCallNamed(node, propertyName), seen) !== undefined;\n}\n\nfunction getFlatMapLadderMessage(node: unknown, version: EffectVersion): string | undefined {\n if (\n (isEffectMemberCallNamed(node, \"flatMap\") || (version === 4 && isEffectMemberCallNamed(node, \"flatMapEager\"))) &&\n (containsEffectMemberCallNamed(node.arguments, \"flatMap\") || (version === 4 && containsEffectMemberCallNamed(node.arguments, \"flatMapEager\")))\n ) {\n return \"Rule: avoid nested Effect.flatMap. Why: it hides sequencing and pushes laddered control flow. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.\";\n }\n\n if (\n isEffectMemberCallNamed(node, \"flatten\") &&\n containsEffectMemberCallNamed(firstArgument(node), \"map\")\n ) {\n return \"Rule: avoid map+flatten ladders. Why: they hide sequencing. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.\";\n }\n\n return undefined;\n}\n\nconst orElseSequencingCalls = [\"flatMap\", \"zipRight\", \"as\", \"tap\"] as const;\n\nfunction hasOrElseSequencingFirstArgument(node: unknown): node is Node & { arguments: unknown[] } {\n if (!isEffectMemberCallNamed(node, \"orElse\")) {\n return false;\n }\n\n const first = firstArgument(node);\n return orElseSequencingCalls.some((propertyName) => (\n containsEffectMemberCallNamed(first, propertyName)\n ));\n}\n\nfunction isPipeCall(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n if (call.type !== \"CallExpression\") {\n return false;\n }\n\n if (isIdentifier(call.callee, \"pipe\")) {\n return true;\n }\n\n const callee = call.callee;\n return (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).property, \"pipe\")\n );\n}\n\nfunction containsPipeCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isPipeCall(node), seen) !== undefined;\n}\n\nfunction isArrowIifeCall(node: unknown): node is Node & { callee: Node; arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n Array.isArray(call.arguments) &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"ArrowFunctionExpression\"\n );\n}\n\nfunction isInlineFunctionIifeCall(node: unknown): node is Node & { callee: Node; arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n Array.isArray(call.arguments) &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n ((call.callee as Node).type === \"ArrowFunctionExpression\" ||\n (call.callee as Node).type === \"FunctionExpression\")\n );\n}\n\nfunction findArrowIifeCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n return findNode(node, isArrowIifeCall, seen);\n}\n\nfunction findReturnStatements(node: unknown, seen = new WeakSet<object>()): unknown[] {\n if (Array.isArray(node)) {\n return node.flatMap((child) => findReturnStatements(child, seen));\n }\n\n if (!isObjectValue(node)) {\n return [];\n }\n\n if (seen.has(node)) {\n return [];\n }\n seen.add(node);\n\n if ((node as Node).type === \"ReturnStatement\") {\n return [node];\n }\n\n return Object.entries(node).flatMap(([key, child]) => (\n key === \"parent\" ? [] : findReturnStatements(child, seen)\n ));\n}\n\nfunction isSchemaFilterCall(node: unknown, version: EffectVersion): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n const name = version === 3 ? \"filter\" : \"makeFilter\";\n return (\n call.type === \"CallExpression\" &&\n (isMemberExpression(call.callee, \"S\", name) ||\n isMemberExpression(call.callee, \"Schema\", name))\n );\n}\n\nfunction directArrowCallbackReturns(node: unknown, version: EffectVersion): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const call = node as Node;\n if (call.type !== \"CallExpression\" || !Array.isArray(call.arguments) || isSchemaFilterCall(call, version)) {\n return [];\n }\n\n return call.arguments.flatMap((argument) => {\n if (\n !isObjectValue(argument) ||\n (argument as Node).type !== \"ArrowFunctionExpression\"\n ) {\n return [];\n }\n\n const body = (argument as Node).body;\n if (!isObjectValue(body) || (body as Node).type !== \"BlockStatement\") {\n return [];\n }\n\n return findReturnStatements(body);\n });\n}\n\nfunction directFunctionCallbackReturns(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const call = node as Node;\n if (call.type !== \"CallExpression\" || !Array.isArray(call.arguments)) {\n return [];\n }\n\n return call.arguments.flatMap((argument) => {\n if (\n !isObjectValue(argument) ||\n (argument as Node).type !== \"FunctionExpression\" ||\n (argument as Node).generator === true\n ) {\n return [];\n }\n\n return findReturnStatements((argument as Node).body);\n });\n}\n\nfunction isGeneratorFunctionExpression(node: unknown): node is Node & { body: unknown } {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"FunctionExpression\" &&\n (node as Node).generator === true\n );\n}\n\nfunction getEffectGeneratorArgument(\n node: unknown,\n propertyName: \"fn\" | \"gen\",\n version: EffectVersion = 3,\n): (Node & { body: unknown }) | undefined {\n const namedFn = version === 4 && propertyName === \"fn\" && isObjectValue(node)\n && (node as Node).type === \"CallExpression\" && isEffectMemberCallNamed((node as Node).callee, \"fn\");\n if (!isEffectMemberCallNamed(node, propertyName) && !namedFn) {\n return undefined;\n }\n\n const fn = version === 4 ? ((node as Node).arguments as unknown[]).find(isGeneratorFunctionExpression) : firstArgument(node as Node & { arguments: unknown[] });\n return isGeneratorFunctionExpression(fn) ? fn : undefined;\n}\n\nfunction isEffectGeneratorCall(node: unknown, propertyName: \"fn\" | \"gen\", version: EffectVersion = 3): boolean {\n return getEffectGeneratorArgument(node, propertyName, version) !== undefined;\n}\n\nconst effectConstructionBoundaries = new Set([\"gen\", \"sync\", \"try\", \"tryPromise\", \"fn\"]);\n\nfunction isEffectConstructionBoundary(node: unknown, version: EffectVersion = 3): node is Node & { arguments: unknown[] } {\n if (isEffectMemberCall(node)) {\n const property = (node.callee as Node).property;\n if (isIdentifier(property) && (effectConstructionBoundaries.has(property.name) ||\n (version === 4 && (property.name === \"fnUntraced\" || property.name === \"fnUntracedEager\")))) {\n return true;\n }\n }\n\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return call.type === \"CallExpression\" && isEffectMemberCallNamed(call.callee, \"fn\");\n}\n\nfunction isDateNowCall(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"CallExpression\" &&\n isMemberExpression((node as Node).callee, \"Date\", \"now\")\n );\n}\n\nfunction findYieldWithoutStarInEffectGen(node: unknown, version: EffectVersion): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\", version);\n return generator ? findEffectLogicNode(node, version, (child) => isObjectValue(child) && (child as Node).type === \"YieldExpression\" && (child as Node).delegate !== true) : undefined;\n}\n\nfunction findPipedYields(node: unknown, seen = new WeakSet<object>()): unknown[] {\n if (Array.isArray(node)) {\n return node.flatMap((child) => findPipedYields(child, seen));\n }\n\n if (!isObjectValue(node)) {\n return [];\n }\n\n if (seen.has(node)) {\n return [];\n }\n seen.add(node);\n\n if (\n (node as Node).type === \"YieldExpression\" &&\n (node as Node).delegate === true &&\n isPipeCall((node as Node).argument)\n ) {\n return [node];\n }\n\n return Object.entries(node).flatMap(([key, child]) => (\n key === \"parent\" ? [] : findPipedYields(child, seen)\n ));\n}\n\nfunction repeatedPipedYieldInEffectGen(node: unknown): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\");\n if (!generator) {\n return undefined;\n }\n\n const pipedYields = findPipedYields(generator.body);\n return pipedYields.length >= 2 ? pipedYields[1] : undefined;\n}\n\nfunction containsNodeType(node: unknown, type: string, seen = new WeakSet<object>()): boolean {\n if (Array.isArray(node)) {\n return node.some((child) => containsNodeType(child, type, seen));\n }\n\n if (!isObjectValue(node)) {\n return false;\n }\n\n if (seen.has(node)) {\n return false;\n }\n seen.add(node);\n\n if ((node as Node).type === type) {\n return true;\n }\n\n return Object.entries(node).some(([key, child]) => (\n key !== \"parent\" && containsNodeType(child, type, seen)\n ));\n}\n\nfunction containsIdentifierNamed(node: unknown, name: string, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isIdentifier(node, name), seen) !== undefined;\n}\n\nfunction containsEffectMemberCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isEffectMemberCall(node), seen) !== undefined;\n}\n\nfunction singleYieldVariableName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return undefined;\n }\n\n const declarations = (node as Node).declarations;\n if (!Array.isArray(declarations) || declarations.length !== 1) {\n return undefined;\n }\n\n const declaration = declarations[0];\n if (\n !isObjectValue(declaration) ||\n (declaration as Node).type !== \"VariableDeclarator\" ||\n !isIdentifier((declaration as Node).id) ||\n typeof (declaration as Node).init !== \"object\" ||\n (declaration as Node).init === null ||\n ((declaration as Node).init as Node).type !== \"YieldExpression\" ||\n ((declaration as Node).init as Node).delegate !== true\n ) {\n return undefined;\n }\n\n return ((declaration as Node).id as Node & { name: string }).name;\n}\n\nfunction isPureMappingReturn(node: unknown, yieldedName: string): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"ReturnStatement\") {\n return false;\n }\n\n const argument = (node as Node).argument;\n return (\n argument !== undefined &&\n !isIdentifier(argument, yieldedName) &&\n !containsNodeType(argument, \"YieldExpression\") &&\n !containsNodeType(argument, \"AwaitExpression\") &&\n !containsEffectMemberCall(argument) &&\n !containsIdentifierNamed(argument, \"Promise\")\n );\n}\n\nfunction genForMappingNode(node: unknown): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\");\n if (!generator || typeof generator.body !== \"object\" || generator.body === null) {\n return undefined;\n }\n\n const body = generator.body as Node;\n const statements = Array.isArray(body.body) ? body.body : [];\n if (statements.length !== 2) {\n return undefined;\n }\n\n const yieldedName = singleYieldVariableName(statements[0]);\n return yieldedName && isPureMappingReturn(statements[1], yieldedName)\n ? node\n : undefined;\n}\n\nconst workflowSequencingCombinators = new Set([\"andThen\", \"flatMap\", \"tap\", \"zipRight\"]);\n\nfunction pipeOperatorArguments(node: unknown): unknown[] {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return [];\n }\n\n const call = node as Node;\n const args = Array.isArray(call.arguments) ? call.arguments : [];\n if (isIdentifier(call.callee, \"pipe\")) {\n return args.slice(1);\n }\n\n const callee = call.callee;\n if (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).property, \"pipe\")\n ) {\n return args;\n }\n\n return [];\n}\n\nfunction isWorkflowSequencingOperator(node: unknown, version: EffectVersion = 3): boolean {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n const property = ((node.callee as Node).property as Node | undefined);\n return isIdentifier(property) && (version === 3\n ? workflowSequencingCombinators.has(property.name)\n : property.name === \"flatMapEager\" || (property.name !== \"zipRight\" && workflowSequencingCombinators.has(property.name)));\n}\n\nfunction workflowSequencingPipeline(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (!isPipeCall(node)) {\n return undefined;\n }\n\n const sequencingCount = pipeOperatorArguments(node)\n .filter((argument) => isWorkflowSequencingOperator(argument, version))\n .length;\n\n return sequencingCount >= 3 ? node : undefined;\n}\n\nfunction isFlowCall(node: unknown): node is Node & { arguments: unknown[] } {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"CallExpression\" &&\n Array.isArray((node as Node).arguments) &&\n isIdentifier((node as Node).callee, \"flow\")\n );\n}\n\nfunction isLargeFlowCall(node: unknown): boolean {\n return isFlowCall(node) && node.arguments.length >= 5;\n}\n\nfunction containsAsyncFunction(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isObjectValue(node) &&\n ((node as Node).type === \"ArrowFunctionExpression\" ||\n (node as Node).type === \"FunctionExpression\") &&\n (node as Node).async === true, seen) !== undefined;\n}\n\nfunction isEffectfulFlowArgument(node: unknown): boolean {\n return (\n containsEffectMemberCall(node) ||\n containsNodeType(node, \"YieldExpression\") ||\n containsNodeType(node, \"AwaitExpression\") ||\n containsAsyncFunction(node) ||\n containsConsoleCall(node) ||\n containsIdentifierNamed(node, \"Promise\") ||\n containsIdentifierNamed(node, \"Runtime\")\n );\n}\n\nfunction effectfulFlowArgument(node: unknown): unknown | undefined {\n if (!isFlowCall(node)) {\n return undefined;\n }\n\n return node.arguments.find((argument) => isEffectfulFlowArgument(argument));\n}\n\nfunction inlineNonTrivialFlowArgument(node: unknown): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n return (call.arguments ?? []).find((argument) => (\n isFlowCall(argument) && argument.arguments.length >= 3\n ));\n}\n\nconst pureTransformationImpureNames = new Set([\n \"Date\",\n \"Runtime\",\n \"fetch\",\n \"import\",\n \"queueMicrotask\",\n \"require\",\n \"setInterval\",\n \"setTimeout\",\n]);\n\nfunction pureTransformationCallName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const callee = (node as Node).callee;\n if (isIdentifier(callee)) {\n return callee.name;\n }\n\n if (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).property)\n ) {\n return ((callee as Node).property as Node & { name: string }).name;\n }\n\n return undefined;\n}\n\nfunction isPureTransformationCall(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const name = pureTransformationCallName(node);\n return (\n !containsEffectMemberCall(node) &&\n !containsNodeType(node, \"AwaitExpression\") &&\n !containsNodeType(node, \"YieldExpression\") &&\n !containsIdentifierNamed(node, \"Promise\") &&\n !containsConsoleCall(node) &&\n !pureTransformationImpureNames.has(name ?? \"\") &&\n !(\n typeof (node as Node).callee === \"object\" &&\n (node as Node).callee !== null &&\n isIdentifier(((node as Node).callee as Node).object, \"console\")\n )\n );\n}\n\nfunction pureTransformationCallDepth(node: unknown): number {\n if (!isPureTransformationCall(node)) {\n return 0;\n }\n\n const call = node as Node & { arguments?: unknown[]; callee?: unknown };\n const childDepth = [call.callee, ...(call.arguments ?? [])]\n .filter((child) => !isFunctionLike(child))\n .reduce<number>((maxDepth, child) => Math.max(maxDepth, pureTransformationCallDepth(child)), 0);\n return childDepth + 1;\n}\n\nfunction preferFlowForPurePipelineNode(node: unknown): unknown | undefined {\n if (pureTransformationCallDepth(node) < 3) {\n return undefined;\n }\n\n const parent = isObjectValue(node) ? (node as Node).parent : undefined;\n return isPureTransformationCall(parent) ? undefined : node;\n}\n\nfunction businessLogicInPipeCallback(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (!isPipeCall(node)) {\n return undefined;\n }\n\n for (const part of pipeOperatorArguments(node)) {\n if (!isEffectMemberCallNamed(part, \"flatMap\") &&\n !(version === 4 && isEffectMemberCallNamed(part, \"flatMapEager\"))) {\n continue;\n }\n\n const callback = part.arguments.find(isFunctionLike);\n if (!callback) {\n continue;\n }\n\n const body = (callback as Node).body;\n const hasControlFlow = [\n \"IfStatement\",\n \"SwitchStatement\",\n \"ForStatement\",\n \"ForInStatement\",\n \"ForOfStatement\",\n \"WhileStatement\",\n \"DoWhileStatement\",\n ].some((type) => containsNodeType(body, type));\n const hasServiceRetrieval = findNode(body, isYieldedServiceDependency) !== undefined;\n const effectStepCount = findNodes(body, isEffectMemberCall).length;\n\n if (hasControlFlow || hasServiceRetrieval || effectStepCount >= 2) {\n return callback;\n }\n }\n\n return undefined;\n}\n\nconst behaviorDecorationOperators = new Set([\n \"annotateLogs\",\n \"as\",\n \"catchAll\",\n \"catchSome\",\n \"catchTag\",\n \"map\",\n \"mapBoth\",\n \"provide\",\n \"retry\",\n \"tap\",\n \"tapError\",\n \"timeout\",\n \"timeoutFail\",\n \"withSpan\",\n]);\n\nconst effect4RecoveryOperatorNames = [\n \"catch\", \"catchEager\", \"catchCause\", \"catchDefect\", \"catchIf\", \"catchFilter\",\n \"catchCauseIf\", \"catchCauseFilter\", \"catchTag\", \"catchTags\", \"catchReason\", \"catchReasons\",\n] as const;\nfunction isBehaviorDecorationOperator(node: unknown, version: EffectVersion = 3): boolean {\n if (!isEffectMemberCall(node)) {\n return false;\n }\n\n const property = ((node.callee as Node).property as Node | undefined);\n if (!isIdentifier(property)) return false;\n const name = property.name;\n return version === 3 ? behaviorDecorationOperators.has(name)\n : (name !== \"catchAll\" && name !== \"catchSome\" && name !== \"timeoutFail\" && behaviorDecorationOperators.has(name)) ||\n (effect4RecoveryOperatorNames as readonly string[]).includes(name) || name === \"timeoutOption\" || name === \"timeoutOrElse\" || name === \"catchNoSuchElement\";\n}\n\nfunction isExistingEffectExpression(node: unknown): boolean {\n return isEffectMemberCall(node) || isPipeCall(node);\n}\n\nfunction staticBehaviorCall(node: unknown, version: EffectVersion): unknown | undefined {\n if (!isBehaviorDecorationOperator(node, version)) {\n return undefined;\n }\n\n const first = (node as Node & { arguments: unknown[] }).arguments[0];\n return isExistingEffectExpression(first) ? node : undefined;\n}\n\nfunction isBehaviorDecoratedYield(node: unknown, version: EffectVersion): boolean {\n if (\n !isObjectValue(node) ||\n (node as Node).type !== \"YieldExpression\" ||\n (node as Node).delegate !== true ||\n !isPipeCall((node as Node).argument)\n ) {\n return false;\n }\n\n return pipeOperatorArguments((node as Node).argument)\n .some((argument) => isBehaviorDecorationOperator(argument, version));\n}\n\nfunction repeatedDecoratedYieldInEffectGen(node: unknown, version: EffectVersion): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\", version);\n if (!generator) {\n return undefined;\n }\n\n const decoratedYields = findNodes(generator.body, (child) => isBehaviorDecoratedYield(child, version), new WeakSet<object>(), true, version === 4);\n return decoratedYields.length >= 2 ? decoratedYields[1] : undefined;\n}\n\nfunction workflowInBehaviorPipe(node: unknown, version: EffectVersion): unknown | undefined {\n if (!isPipeCall(node)) {\n return undefined;\n }\n\n const parts = pipeOperatorArguments(node);\n const hasBehaviorDecoration = parts.some((part) => isBehaviorDecorationOperator(part, version));\n if (!hasBehaviorDecoration) {\n return undefined;\n }\n\n const workflowCount = parts\n .filter((part) => isWorkflowSequencingOperator(part, version))\n .length;\n const hasEmbeddedControlFlow = parts.some((part) => (\n containsNodeType(part, \"IfStatement\") ||\n containsNodeType(part, \"SwitchStatement\") ||\n containsNodeType(part, \"ForStatement\") ||\n containsNodeType(part, \"ForInStatement\") ||\n containsNodeType(part, \"ForOfStatement\") ||\n containsNodeType(part, \"WhileStatement\")\n ));\n\n return workflowCount >= 2 || hasEmbeddedControlFlow ? node : undefined;\n}\n\ntype StylePillar = \"workflow\" | \"pure\" | \"behavior\" | \"layer\";\n\nfunction stylePillarsInNode(\n node: unknown,\n version: EffectVersion,\n pillars = new Set<StylePillar>(),\n seen = new WeakSet<object>(),\n): Set<StylePillar> {\n if (isEffectMemberCallNamed(node, \"gen\") || isWorkflowSequencingOperator(node, version)) {\n pillars.add(\"workflow\");\n }\n\n if (isFlowCall(node)) {\n pillars.add(\"pure\");\n }\n\n if (isBehaviorDecorationOperator(node, version)) {\n pillars.add(\"behavior\");\n }\n\n if (isMemberCall(node, \"Layer\") || isMemberExpression(node, \"Layer\", \"pipe\")) {\n pillars.add(\"layer\");\n }\n\n if (Array.isArray(node)) {\n for (const child of node) {\n stylePillarsInNode(child, version, pillars, seen);\n }\n return pillars;\n }\n\n if (!isObjectValue(node)) {\n return pillars;\n }\n\n if (seen.has(node)) {\n return pillars;\n }\n seen.add(node);\n\n for (const [key, child] of Object.entries(node)) {\n if (key !== \"parent\") {\n stylePillarsInNode(child, version, pillars, seen);\n }\n }\n\n return pillars;\n}\n\nfunction isFunctionLike(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (\n (node as Node).type === \"FunctionDeclaration\" ||\n (node as Node).type === \"FunctionExpression\" ||\n (node as Node).type === \"ArrowFunctionExpression\"\n )\n );\n}\n\nfunction mixedPillarFunctionNode(node: unknown, version: EffectVersion): unknown | undefined {\n if (!isFunctionLike(node)) {\n return undefined;\n }\n\n const body = (node as Node).body;\n return stylePillarsInNode(body, version).size >= 3 ? node : undefined;\n}\n\nfunction callExpressionDepth(node: unknown, seen = new WeakSet<object>()): number {\n if (Array.isArray(node)) {\n return node.reduce((maxDepth, child) => Math.max(maxDepth, callExpressionDepth(child, seen)), 0);\n }\n\n if (!isObjectValue(node)) {\n return 0;\n }\n\n if (seen.has(node)) {\n return 0;\n }\n seen.add(node);\n\n const childDepth = Object.entries(node).reduce((maxDepth, [key, child]) => (\n key === \"parent\" ? maxDepth : Math.max(maxDepth, callExpressionDepth(child, seen))\n ), 0);\n\n return (node as Node).type === \"CallExpression\" ? childDepth + 1 : childDepth;\n}\n\nfunction cleverEffectExpressionNode(node: unknown, version: EffectVersion): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const pillars = stylePillarsInNode(node, version);\n const hasWrapperTrick = isInlineFunctionIifeCall(node) || findArrowIifeCall(node) !== undefined;\n return pillars.size >= 2 && (callExpressionDepth(node) >= 4 || hasWrapperTrick) ? node : undefined;\n}\n\nfunction oversizedAnonymousConceptNode(node: unknown): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n for (const argument of call.arguments ?? []) {\n if (\n !isObjectValue(argument) ||\n !isFunctionLike(argument)\n ) {\n continue;\n }\n\n const body = (argument as Node).body;\n if (\n isObjectValue(body) &&\n (body as Node).type === \"BlockStatement\" &&\n Array.isArray((body as Node).body) &&\n ((body as Node).body as unknown[]).length >= 3\n ) {\n return argument;\n }\n }\n\n return undefined;\n}\n\nfunction calleeContainsEffectService(node: unknown, version: EffectVersion = 3): boolean {\n if (isMemberExpression(node, version === 3 ? \"Effect\" : \"Context\", \"Service\")) {\n return true;\n }\n\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n return calleeContainsEffectService((node as Node).callee, version);\n}\n\nfunction effectServiceOptionsObject(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n if (!calleeContainsEffectService(call.callee, version)) {\n return undefined;\n }\n\n return [...(call.arguments ?? [])]\n .reverse()\n .find((argument) => (\n isObjectValue(argument) &&\n (argument as Node).type === \"ObjectExpression\"\n ));\n}\n\nfunction effectServiceClassOptions(node: unknown): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"ClassDeclaration\") {\n return undefined;\n }\n\n return effectServiceOptionsObject((node as Node).superClass);\n}\n\nfunction serviceConstructionOptions(node: unknown, version: EffectVersion): unknown | undefined {\n if (version === 3) return effectServiceClassOptions(node);\n const kind = (node as Node | undefined)?.type;\n return effectServiceOptionsObject(kind === \"ClassDeclaration\" || kind === \"ClassExpression\" ? (node as Node).superClass : node, version);\n}\n\nfunction serviceConstructionImplementation(options: unknown, version: EffectVersion): unknown {\n return version === 3 ? objectPropertyValue(options, \"effect\") ?? objectPropertyValue(options, \"scoped\") : objectPropertyValue(options, \"make\");\n}\n\nfunction isContextTagCall(node: unknown): boolean {\n return isMemberCall(node, \"Context\", \"Tag\") || isMemberCall(node, \"Context\", \"GenericTag\");\n}\n\nfunction containsLayerProvideCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isMemberCall(node, \"Layer\", \"provide\"), seen) !== undefined;\n}\n\nfunction hasAccessorsTrue(options: unknown): boolean {\n return isBooleanLiteral(objectPropertyValue(options, \"accessors\"), true);\n}\n\nfunction namespaceEffectImport(node: unknown): unknown | undefined {\n if (!isEffectEcosystemImport(getImportSource(node) ?? \"\")) {\n return undefined;\n }\n\n const specifiers = isObjectValue(node) ? (node as Node).specifiers : undefined;\n return Array.isArray(specifiers)\n ? specifiers.find((specifier) => (\n isObjectValue(specifier) &&\n (specifier as Node).type === \"ImportNamespaceSpecifier\"\n ))\n : undefined;\n}\n\nfunction isYieldedServiceDependency(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"YieldExpression\" &&\n (node as Node).delegate === true &&\n isIdentifier((node as Node).argument) &&\n ((node as Node).argument as { name: string }).name.endsWith(\"Service\")\n );\n}\n\nfunction findNode(\n node: unknown,\n predicate: (node: unknown) => boolean,\n seen = new WeakSet<object>(),\n ownScope = false,\n): unknown | undefined {\n if (ownScope && (!isObjectValue(node) || seen.has(node) || isFunctionLike(node) ||\n (node as Node).type === \"ClassDeclaration\" || (node as Node).type === \"ClassExpression\")) return undefined;\n if (predicate(node)) {\n return node;\n }\n\n if (Array.isArray(node)) {\n for (const child of node) {\n const match = findNode(child, predicate, seen, ownScope);\n if (match) {\n return match;\n }\n }\n return undefined;\n }\n\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n if (seen.has(node)) {\n return undefined;\n }\n seen.add(node);\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n const match = findNode(child, predicate, seen, ownScope);\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction findNodes(\n node: unknown,\n predicate: (node: unknown) => boolean,\n seen = new WeakSet<object>(),\n stopAtMatch = false,\n ownScope = false,\n): unknown[] {\n if (ownScope && isFunctionLike(node)) return [];\n if (stopAtMatch && isObjectValue(node) && seen.has(node)) return [];\n const matches = predicate(node) ? [node] : [];\n if (stopAtMatch && matches.length) return matches;\n\n if (Array.isArray(node)) {\n return node.flatMap((child) => findNodes(child, predicate, seen, stopAtMatch, ownScope)).concat(matches);\n }\n\n if (!isObjectValue(node)) {\n return matches;\n }\n\n if (seen.has(node)) {\n return matches;\n }\n seen.add(node);\n\n return Object.entries(node).reduce<unknown[]>(\n (collected, [key, child]) => (\n key === \"parent\" ? collected : collected.concat(findNodes(child, predicate, seen, stopAtMatch, ownScope))\n ),\n matches,\n );\n}\n\nfunction serviceDependencyWithoutDeclaration(options: unknown): unknown | undefined {\n if (objectPropertyValue(options, \"dependencies\")) {\n return undefined;\n }\n\n return findNode(\n objectPropertyValue(options, \"effect\") ?? objectPropertyValue(options, \"scoped\"),\n isYieldedServiceDependency,\n );\n}\n\nfunction isLayerCompositionCall(node: unknown): boolean {\n if (!isMemberCall(node, \"Layer\")) {\n return false;\n }\n\n const property = ((node as Node).callee as Node).property;\n return isIdentifier(property) && (property.name === \"provide\" || property.name.startsWith(\"merge\"));\n}\n\nfunction isRequestHandler(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"FunctionDeclaration\") {\n return false;\n }\n\n const id = (node as Node).id;\n return isIdentifier(id) && /(handler|route|request)$/i.test(id.name);\n}\n\nfunction layerCompositionInRequestHandler(node: unknown): unknown | undefined {\n if (!isRequestHandler(node)) {\n return undefined;\n }\n\n return findNode((node as Node).body, isLayerCompositionCall) ? node : undefined;\n}\n\nfunction layerProvideCallTower(node: unknown): unknown | undefined {\n if (!isMemberCall(node, \"Layer\", \"provide\")) {\n return undefined;\n }\n\n return findNode(firstArgument(node as Node & { arguments: unknown[] }), (child) => (\n child !== node && isMemberCall(child, \"Layer\", \"provide\")\n ));\n}\n\nfunction isEffectOrLayerProvideCall(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"provide\") || isMemberCall(node, \"Layer\", \"provide\");\n}\n\nfunction inlineLayerProvideInProgram(node: unknown, version: EffectVersion = 3): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\", version) ??\n (version === 4 ? getEffectGeneratorArgument(node, \"fn\", version) : undefined);\n return generator ? (version === 4\n ? findOwnCallbackNode(generator.body, isEffectOrLayerProvideCall)\n : findNode(generator.body, isEffectOrLayerProvideCall)) : undefined;\n}\n\nfunction layerMergeChain(node: unknown): unknown | undefined {\n if (!isMemberCall(node, \"Layer\", \"merge\")) {\n return undefined;\n }\n\n return ((node as Node).arguments as unknown[] | undefined)\n ?.find((argument) => findNode(argument, (child) => (\n child !== node && isMemberCall(child, \"Layer\", \"merge\")\n )));\n}\n\nfunction isLayerLikeDeclarationName(node: unknown): boolean {\n return isIdentifier(node) && /(Layer|Live)$/.test(node.name);\n}\n\nfunction scatteredLayerProvideDeclaration(node: unknown): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return undefined;\n }\n\n return ((node as Node).declarations as unknown[] | undefined)\n ?.find((declarator) => (\n isObjectValue(declarator) &&\n isLayerLikeDeclarationName((declarator as Node).id) &&\n findNode((declarator as Node).init, isEffectOrLayerProvideCall)\n ));\n}\n\nfunction functionReturnsPromise(node: unknown, version: EffectVersion = 3): boolean {\n if (!isFunctionLike(node)) {\n return false;\n }\n\n if (isIdentifierTypeReference(returnTypeAnnotation(node), \"Promise\")) return true;\n if (version === 3) return findPromiseApiCall((node as Node).body) !== undefined;\n if ((node as Node).async === true) return true;\n const isPromise = (value: unknown) => isPromiseStaticApiCall(value) || isPromiseChainCall(value, version) ||\n (isObjectValue(value) && (value as Node).type === \"NewExpression\" && isIdentifier((value as Node).callee, \"Promise\"));\n const body = (node as Node).body;\n return isPromise(body) || findOwnCallbackNode(body, (child) => isObjectValue(child) &&\n (child as Node).type === \"ReturnStatement\" && isPromise((child as Node).argument)) !== undefined;\n}\n\nfunction isPromiseReturningProperty(node: unknown, version: EffectVersion = 3): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"Property\" &&\n functionReturnsPromise((node as Node).value, version)\n );\n}\n\nfunction promiseReturningServiceMethod(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 3) return findNode(node, isPromiseReturningProperty);\n // Inspect constructed shapes, not callback options inside Promise adapters.\n const seen = new WeakSet<object>();\n const inspect = (value: unknown): unknown | undefined => {\n if (!isObjectValue(value) || seen.has(value)) return undefined;\n seen.add(value);\n const current = value as Node;\n if (current.type === \"ObjectExpression\") return (current.properties as unknown[] | undefined)?.find((property) => isPromiseReturningProperty(property, version));\n if (isFunctionLike(value)) {\n const body = current.body as Node | undefined;\n if (body?.type !== \"BlockStatement\") return inspect(body);\n for (const returned of findNodes(body, (child) => isObjectValue(child) && (child as Node).type === \"ReturnStatement\", new WeakSet<object>(), true, true)) {\n const method = inspect((returned as Node).argument);\n if (method) return method;\n }\n return undefined;\n }\n const generator = getEffectGeneratorArgument(value, \"gen\", version) ?? getEffectGeneratorArgument(value, \"fn\", version);\n if (generator) return inspect(generator);\n const first = Array.isArray(current.arguments) ? current.arguments[0] : undefined;\n if (isEffectMemberCallNamed(value, \"succeed\") || isEffectMemberCallNamed(value, \"sync\")) return inspect(first);\n if (isPipeCall(value)) {\n const callee = current.callee as Node | undefined;\n return inspect(callee?.type === \"MemberExpression\" ? callee.object : first);\n }\n return undefined;\n };\n return inspect(objectPropertyValue(node, \"make\"));\n}\n\nfunction objectHasServiceMethod(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"ObjectExpression\") {\n return false;\n }\n\n const properties = (node as Node).properties;\n return Array.isArray(properties) && properties.some((propertyNode) => (\n isObjectValue(propertyNode) &&\n (propertyNode as Node).type === \"Property\" &&\n (isFunctionLike((propertyNode as Node).value) ||\n isEffectMemberCallNamed((propertyNode as Node).value, \"fn\"))\n ));\n}\n\nfunction manualServiceObjectExport(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const declaration = (node as Node).declaration;\n if (!isObjectValue(declaration)) {\n return undefined;\n }\n\n if ((declaration as Node).type !== \"VariableDeclaration\") {\n return undefined;\n }\n\n for (const declarator of ((declaration as Node).declarations as unknown[] | undefined) ?? []) {\n if (\n isObjectValue(declarator) &&\n isIdentifier((declarator as Node).id) &&\n ((declarator as Node).id as { name: string }).name.endsWith(\"Service\") &&\n objectHasServiceMethod((declarator as Node).init)\n ) {\n return declarator;\n }\n }\n\n return undefined;\n}\n\nfunction isAsyncFunctionCallback(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n ((node as Node).type === \"ArrowFunctionExpression\" ||\n (node as Node).type === \"FunctionExpression\") &&\n (node as Node).async === true\n );\n}\n\nconst effectAsyncCallbackCombinators = new Set([\n \"andThen\",\n \"catchAll\",\n \"catchTag\",\n \"filterOrFail\",\n \"flatMap\",\n \"forEach\",\n \"map\",\n \"orElse\",\n \"tap\",\n]);\n\nconst effect4LogicCallbackOperators = new Set([\n ...[...effectAsyncCallbackCombinators].filter((name) => name !== \"catchAll\" && name !== \"orElse\"),\n \"mapEager\",\n \"flatMapEager\",\n ...effect4RecoveryOperatorNames,\n]);\n\nfunction effectLogicCallbackOperators(version: EffectVersion): ReadonlySet<string> {\n return version === 3 ? effectAsyncCallbackCombinators : effect4LogicCallbackOperators;\n}\n\nfunction effectLogicCallbacks(node: unknown, version: EffectVersion): unknown[] {\n if (!isEffectMemberCall(node)) return [];\n const property = (node.callee as Node).property;\n if (!isIdentifier(property) || !effectLogicCallbackOperators(version).has(property.name)) return [];\n return node.arguments.flatMap((argument) => {\n if (isFunctionLike(argument)) return [argument];\n if (version === 4 && (property.name === \"catchTags\" || property.name === \"catchReasons\") && isObjectExpression(argument)) {\n return ((argument as Node).properties as Node[]).map((entry) => entry.value).filter(isFunctionLike);\n }\n return [];\n });\n}\n\nfunction findOwnCallbackNode(node: unknown, predicate: (node: unknown) => boolean): unknown | undefined {\n return findNode(node, predicate, new WeakSet<object>(), true);\n}\n\nfunction findAsyncEffectCombinatorCallback(node: unknown, version: EffectVersion): unknown | undefined {\n return effectLogicCallbacks(node, version).find(isAsyncFunctionCallback);\n}\n\nfunction findEffectLogicNode(node: unknown, version: EffectVersion, predicate: (child: unknown) => boolean): unknown | undefined {\n const search = version === 3 ? findNode : findOwnCallbackNode;\n const generator = getEffectGeneratorArgument(node, \"gen\", version);\n if (generator) return search(generator.body, predicate);\n // Named Effect.fn exists in both majors; retain the legacy gen shape above.\n const operation = getEffectGeneratorArgument(node, \"fn\", 4);\n if (operation) return findOwnCallbackNode(operation.body, predicate);\n for (const callback of effectLogicCallbacks(node, version)) {\n const match = search(callbackBody(callback), predicate);\n if (match) return match;\n }\n return undefined;\n}\n\nfunction findEffectStatement(node: unknown, version: EffectVersion, type: \"ThrowStatement\" | \"TryStatement\"): unknown | undefined {\n return findEffectLogicNode(node, version, (child) => isObjectValue(child) && (child as Node).type === type);\n}\n\nconst promiseStaticApiMethods = new Set([\"all\", \"allSettled\", \"any\", \"race\", \"reject\", \"resolve\"]);\n\nfunction isPromiseStaticApiCall(node: unknown): boolean {\n return isMemberCall(node, \"Promise\") && promiseStaticApiMethods.has(String((((node as Node).callee as Node).property as Node).name));\n}\n\nfunction isPromiseChainCall(node: unknown, version: EffectVersion = 3): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n const receiver = (callee as Node | undefined)?.object as Node | undefined;\n return (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n (version === 3 || isPromiseStaticApiCall(receiver) ||\n (receiver?.type === \"NewExpression\" && isIdentifier(receiver.callee, \"Promise\")) ||\n isPromiseChainCall(receiver, version)) &&\n (isIdentifier((callee as Node).property, \"then\") ||\n isIdentifier((callee as Node).property, \"catch\") ||\n isIdentifier((callee as Node).property, \"finally\"))\n );\n}\n\nfunction findPromiseApiCall(node: unknown): unknown | undefined {\n return findNode(node, (child) => isPromiseStaticApiCall(child) || isPromiseChainCall(child));\n}\n\nfunction findPromiseApiInEffectLogic(node: unknown, version: EffectVersion): unknown | undefined {\n return findEffectLogicNode(node, version, (child) => isPromiseStaticApiCall(child) || isPromiseChainCall(child, version));\n}\n\nconst promiseConcurrencyMethods = new Set([\"all\", \"allSettled\", \"any\", \"race\"]);\n\nfunction isPromiseConcurrencyCall(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n return (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).object, \"Promise\") &&\n isIdentifier((callee as Node).property) &&\n promiseConcurrencyMethods.has(((callee as Node).property as { name: string }).name)\n );\n}\n\nfunction findPromiseConcurrencyCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n if (Array.isArray(node)) {\n for (const child of node) {\n const match = findPromiseConcurrencyCall(child, seen);\n if (match) {\n return match;\n }\n }\n return undefined;\n }\n\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n if (seen.has(node)) {\n return undefined;\n }\n seen.add(node);\n\n if (isPromiseConcurrencyCall(node)) {\n return node;\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n const match = findPromiseConcurrencyCall(child, seen);\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction findPromiseConcurrencyInEffectLogic(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 4) {\n const callback = getEffectGeneratorArgument(node, \"fn\", version) ?? (isEffectMemberCallNamed(node, \"sync\") ? firstArgument(node) : undefined);\n return (callback ? findOwnCallbackNode(callbackBody(callback), isPromiseConcurrencyCall) : undefined) ?? findEffectLogicNode(node, version, isPromiseConcurrencyCall);\n }\n const generator = getEffectGeneratorArgument(node, \"gen\");\n if (generator) {\n return findPromiseConcurrencyCall(generator.body);\n }\n\n if (isEffectMemberCallNamed(node, \"sync\")) {\n const body = callbackBody(firstArgument(node));\n return body ? findPromiseConcurrencyCall(body) : undefined;\n }\n\n if (!isEffectMemberCall(node)) {\n return undefined;\n }\n\n const callee = node.callee as Node;\n const property = callee.property;\n if (!isIdentifier(property) || !effectAsyncCallbackCombinators.has(property.name)) {\n return undefined;\n }\n\n for (const argument of node.arguments) {\n const body = callbackBody(argument);\n const match = body ? findPromiseConcurrencyCall(body) : undefined;\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction callbackHasParameter(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const callback = node as Node;\n return (\n (callback.type === \"ArrowFunctionExpression\" || callback.type === \"FunctionExpression\") &&\n Array.isArray(callback.params) &&\n callback.params.length > 0\n );\n}\n\nfunction isCancellationAwareTryPromise(node: unknown): boolean {\n if (!isEffectMemberCallNamed(node, \"tryPromise\")) {\n return false;\n }\n\n const argument = firstArgument(node);\n if (callbackHasParameter(argument)) {\n return true;\n }\n\n return callbackHasParameter(objectPropertyValue(argument, \"try\"));\n}\n\nfunction isNoninterruptiblePromiseEffect(node: unknown): boolean {\n if (isEffectMemberCallNamed(node, \"promise\")) {\n return true;\n }\n\n return isEffectMemberCallNamed(node, \"tryPromise\") && !isCancellationAwareTryPromise(node);\n}\n\nconst effect4TimeoutMembers = new Set([\"timeout\", \"timeoutOption\", \"timeoutOrElse\"]);\n\nfunction pipeSource(node: Node): unknown {\n return isIdentifier(node.callee, \"pipe\") ? (node.arguments as unknown[])[0] : (node.callee as Node).object;\n}\n\nfunction noninterruptiblePromiseTimeoutNode(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 4) {\n let effect: unknown;\n if ([...effect4TimeoutMembers].some(name => isEffectMemberCallNamed(node, name))) effect = firstArgument(node as Node & { arguments: unknown[] });\n else if (isObjectValue(node) && (node as Node).type === \"CallExpression\" &&\n [...effect4TimeoutMembers].some(name => isEffectMemberCallNamed((node as Node).callee, name))) effect = firstArgument(node as Node & { arguments: unknown[] });\n else if (isPipeCall(node) && [...effect4TimeoutMembers].some(name => isEffectMemberCallNamed(((node as Node).arguments as unknown[]).at(-1), name))) effect = pipeSource(node as Node);\n if (isEffectMemberCallNamed(effect, \"promise\")) return callbackHasParameter(firstArgument(effect as Node & { arguments: unknown[] })) ? undefined : effect;\n return isEffectMemberCallNamed(effect, \"tryPromise\") && !isCancellationAwareTryPromise(effect) ? effect : undefined;\n }\n if (!isEffectMemberCallNamed(node, \"timeout\")) {\n return undefined;\n }\n\n const effect = firstArgument(node);\n return isNoninterruptiblePromiseEffect(effect) ? effect : undefined;\n}\n\nconst blockingSyncObjectNames = new Set([\"crypto\", \"fs\", \"zlib\"]);\n\nfunction isBlockingSyncCall(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n if (isIdentifier(callee)) {\n return callee.name.endsWith(\"Sync\");\n }\n\n if (\n !isObjectValue(callee) ||\n (callee as Node).type !== \"MemberExpression\" ||\n (callee as Node).computed === true ||\n !isIdentifier((callee as Node).object) ||\n !isIdentifier((callee as Node).property)\n ) {\n return false;\n }\n\n const objectName = ((callee as Node).object as { name: string }).name;\n const propertyName = ((callee as Node).property as { name: string }).name;\n return blockingSyncObjectNames.has(objectName) && propertyName.endsWith(\"Sync\");\n}\n\nfunction findBlockingSyncCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n if (Array.isArray(node)) {\n for (const child of node) {\n const match = findBlockingSyncCall(child, seen);\n if (match) {\n return match;\n }\n }\n return undefined;\n }\n\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n if (seen.has(node)) {\n return undefined;\n }\n seen.add(node);\n\n if (isBlockingSyncCall(node)) {\n return node;\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n const match = findBlockingSyncCall(child, seen);\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction findBlockingSyncCallInEffectLogic(node: unknown, version: EffectVersion = 3): unknown | undefined {\n const generator = getEffectGeneratorArgument(node, \"gen\", version) ?? (version === 4 ? getEffectGeneratorArgument(node, \"fn\", version) : undefined);\n const search = version === 4 ? (body: unknown) => findOwnCallbackNode(body, isBlockingSyncCall) : findBlockingSyncCall;\n if (generator) {\n return search(generator.body);\n }\n\n if (isEffectMemberCallNamed(node, \"sync\")) {\n const body = callbackBody(firstArgument(node));\n return body ? search(body) : undefined;\n }\n\n return undefined;\n}\n\nconst effectRunMethods = new Set([\n \"runCallback\",\n \"runFork\",\n \"runPromise\",\n \"runPromiseExit\",\n \"runSync\",\n \"runSyncExit\",\n]);\n\nfunction effectRunExecution(node: unknown, version: EffectVersion): { program: unknown; hasContext: boolean } | undefined {\n if (isEffectMemberCall(node)) {\n const property = (node.callee as Node).property;\n if (isIdentifier(property) && effectRunMethods.has(property.name)) {\n return { program: firstArgument(node), hasContext: false };\n }\n }\n if (version !== 4 || !isObjectValue(node) || (node as Node).type !== \"CallExpression\") return undefined;\n const factory = (node as Node).callee;\n if (!isEffectMemberCall(factory)) return undefined;\n const property = (factory.callee as Node).property;\n if (isIdentifier(property) && property.name.endsWith(\"With\") && effectRunMethods.has(property.name.slice(0, -4))) {\n return { program: firstArgument(node as Node & { arguments: unknown[] }), hasContext: true };\n }\n return undefined;\n}\n\nfunction isEffectRunCall(node: unknown, version: EffectVersion): boolean {\n return effectRunExecution(node, version) !== undefined;\n}\n\nfunction isEffectOrDieReference(node: unknown, version: EffectVersion): boolean {\n return (\n isMemberExpression(node, \"Effect\", \"orDie\") ||\n isEffectMemberCallNamed(node, \"orDie\") ||\n (version === 3 && (isMemberExpression(node, \"Effect\", \"orDieWith\") || isEffectMemberCallNamed(node, \"orDieWith\")))\n );\n}\n\nfunction findEffectOrDieOutsideBoundary(node: unknown, version: EffectVersion): unknown | undefined {\n if (isEffectOrDieReference(node, version)) {\n return node;\n }\n\n if (isPipeCall(node)) {\n return pipeParts(node).find((part) => isEffectOrDieReference(part, version));\n }\n\n return undefined;\n}\n\nfunction isSwallowedCatchAllBody(node: unknown, version: EffectVersion = 3): boolean {\n return (\n isEffectMemberCallNamed(node, \"succeed\") ||\n (isEffectMemberCallNamed(node, \"asVoid\") && (version === 3 || isSwallowedCatchAllBody(firstArgument(node as Node & { arguments: unknown[] }), version))) ||\n isEffectMemberCallNamed(node, \"ignore\") ||\n isEffectVoidMember(node)\n );\n}\n\nfunction getSwallowedCatchAllHandler(node: unknown, version: EffectVersion): unknown | undefined {\n if (version === 3) {\n if (!isEffectMemberCallNamed(node, \"catchAll\")) return undefined;\n const body = callbackBody(firstArgument(node));\n return isSwallowedCatchAllBody(body) ? body : undefined;\n }\n for (const callback of errorHandlerCallbacks(node, plainCatchOperators(version))) {\n const body = callbackBody(callback);\n if (isSwallowedCatchAllBody(body, version)) return body;\n for (const statement of handlerReturnStatements(body)) {\n if (isSwallowedCatchAllBody((statement as Node).argument, version)) return (statement as Node).argument;\n }\n }\n return undefined;\n}\n\nfunction isEffectIgnoreReference(node: unknown): boolean {\n return isMemberExpression(node, \"Effect\", \"ignore\") || isEffectMemberCallNamed(node, \"ignore\");\n}\n\nfunction findEffectIgnore(node: unknown): unknown | undefined {\n if (isEffectIgnoreReference(node)) {\n return node;\n }\n\n if (isPipeCall(node)) {\n return pipeParts(node).find((part) => isEffectIgnoreReference(part));\n }\n\n return undefined;\n}\n\nfunction isConsoleCall(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"MemberExpression\" &&\n (call.callee as Node).computed !== true &&\n isIdentifier((call.callee as Node).object, \"console\") &&\n isIdentifier((call.callee as Node).property)\n );\n}\n\nfunction consoleCallsInEffectFlow(node: unknown, version: EffectVersion = 3): unknown[] {\n if (isEffectConstructionBoundary(node, version)) {\n return findNodes((node as Node).arguments, isConsoleCall);\n }\n\n const options = serviceConstructionOptions(node, version);\n return options\n ? findNodes(\n serviceConstructionImplementation(options, version),\n isConsoleCall,\n )\n : [];\n}\n\nconst errorHandlingOperators = new Set([\"catchAll\", \"catchTag\", \"catchTags\", \"tapError\"]);\n\nfunction isStaticLogMessage(node: unknown): boolean {\n return isStringLiteral(node) || (\n isObjectValue(node) &&\n (node as Node).type === \"TemplateLiteral\"\n );\n}\n\nfunction isEffectErrorLogCall(node: unknown): node is Node & { arguments: unknown[] } {\n return isEffectMemberCallNamed(node, \"logError\") || isEffectMemberCallNamed(node, \"logWarning\");\n}\n\nfunction isObjectExpression(node: unknown): boolean {\n return isObjectValue(node) && (node as Node).type === \"ObjectExpression\";\n}\n\nfunction hasStructuredLogContext(candidate: unknown, logCall: Node & { arguments: unknown[] }): boolean {\n if (findNode(candidate, (node) => isEffectMemberCallNamed(node, \"annotateLogs\"))) {\n return true;\n }\n\n return logCall.arguments.slice(1).some((argument) => (\n isObjectExpression(argument) || !isStaticLogMessage(argument)\n ));\n}\n\nfunction contextlessErrorLogs(node: unknown): unknown[] {\n return findNodes(node, (candidate) => (\n isEffectErrorLogCall(candidate) &&\n isStaticLogMessage(firstArgument(candidate)) &&\n !hasStructuredLogContext(node, candidate)\n ));\n}\n\nfunction errorHandlerBodies(node: unknown, version: EffectVersion = 3): unknown[] {\n if (!isEffectMemberCall(node)) {\n return [];\n }\n\n const property = ((node as Node).callee as Node).property;\n if (!isIdentifier(property) || !(version === 3 ? errorHandlingOperators.has(property.name)\n : property.name === \"tapError\" || property.name === \"catchNoSuchElement\" || (effect4RecoveryOperatorNames as readonly string[]).includes(property.name))) {\n return [];\n }\n\n const arguments_ = (node as Node).arguments as unknown[];\n return (version === 4 ? arguments_.flatMap(argument =>\n (property.name === \"catchTags\" || property.name === \"catchReasons\") && isObjectExpression(argument)\n ? ((argument as Node).properties as Node[]).map(entry => entry.value).filter(isFunctionLike) : [argument]) : arguments_)\n .map(callbackBody)\n .filter((body): body is unknown => body !== undefined);\n}\n\nfunction isIdentifierCall(node: unknown, name: string): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return call.type === \"CallExpression\" && isIdentifier(call.callee, name);\n}\n\nfunction isMemberCall(node: unknown, objectName: string, propertyName?: string): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"MemberExpression\" &&\n (call.callee as Node).computed !== true &&\n isIdentifier((call.callee as Node).object, objectName) &&\n isIdentifier((call.callee as Node).property) &&\n (propertyName === undefined || isIdentifier((call.callee as Node).property, propertyName))\n );\n}\n\nfunction isEffectLogCall(node: unknown): boolean {\n return isMemberCall(node, \"Effect\") && (((node as Node).callee as Node).property as { name: string }).name.startsWith(\"log\");\n}\n\nfunction containsConsoleCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, isConsoleCall, seen) !== undefined;\n}\n\nfunction containsWrapperSideEffect(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isIdentifierCall(node, \"setState\") ||\n isMemberCall(node, \"Atom\", \"set\") ||\n isIdentifierCall(node, \"invalidate\") ||\n isEffectLogCall(node) ||\n isConsoleCall(node), seen) !== undefined;\n}\n\nfunction containsAllStepSideEffect(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isMemberCall(node, \"Ref\", \"set\") ||\n isMemberCall(node, \"Atom\", \"set\") ||\n isMemberCall(node, \"SubscriptionRef\", \"set\") ||\n isMemberCall(node, \"Reactivity\", \"invalidate\") ||\n isMemberCall(node, \"Fiber\", \"interrupt\") ||\n isEffectLogCall(node), seen) !== undefined;\n}\n\nfunction hasConcurrencyOne(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const object = node as Node;\n if (object.type !== \"ObjectExpression\" || !Array.isArray(object.properties)) {\n return false;\n }\n\n return object.properties.some((entry) => {\n if (!isObjectValue(entry)) {\n return false;\n }\n\n const prop = entry as Node;\n const key = prop.key;\n const value = prop.value as Node | undefined;\n return (\n ((isIdentifier(key, \"concurrency\")) ||\n (isObjectValue(key) && (key as Node).value === \"concurrency\")) &&\n isObjectValue(value) &&\n ((value.type === \"Literal\" || value.type === \"NumericLiteral\") && value.value === 1)\n );\n });\n}\n\nfunction hasUnboundedConcurrencyOption(node: unknown, context?: OxlintContext): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const object = node as Node;\n if (object.type !== \"ObjectExpression\" || !Array.isArray(object.properties)) {\n return false;\n }\n\n // Later properties win; an opaque spread/computed key may replace the budget.\n for (let index = object.properties.length - 1; index >= 0; index--) {\n const entry = object.properties[index] as Node;\n const key = entry.key as Node | undefined;\n if (entry.type === \"SpreadElement\" || (entry.computed && typeof key?.value !== \"string\")) return false;\n if (!isIdentifier(key, \"concurrency\") && key?.value !== \"concurrency\") continue;\n const value = entry.value as Node | undefined;\n if (isIdentifier(value, \"Infinity\") && context?.sourceCode?.getScope) {\n for (let scope: Scope | null = context.sourceCode.getScope(value as unknown as ESTree.Node); scope; scope = scope.upper) {\n const binding = scope.set.get(\"Infinity\");\n if (binding) return binding.defs.length === 0;\n }\n }\n return isIdentifier(value, \"Infinity\") || value?.value === \"unbounded\" || value?.value === Infinity;\n }\n return false;\n}\n\nfunction isUnboundedEffectAll(node: unknown, context?: OxlintContext): boolean {\n return (\n isEffectMemberCallNamed(node, \"all\") &&\n hasUnboundedConcurrencyOption((node as Node & { arguments: unknown[] }).arguments[1], context)\n );\n}\n\nfunction containsEffectForkCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n return findNode(node, child => isEffectMemberCallNamed(child, \"fork\"), seen);\n}\n\nfunction v4ForkConstruction(node: unknown): unknown | undefined {\n if (isEffectMemberCallNamed(node, \"forkChild\") || isEffectMemberCallNamed(node, \"forkDetach\")) return node;\n if (isObjectValue(node) && (node as Node).type === \"CallExpression\" &&\n (isEffectMemberCallNamed((node as Node).callee, \"forkChild\") || isEffectMemberCallNamed((node as Node).callee, \"forkDetach\"))) return node;\n if (!isPipeCall(node)) return undefined;\n const operator = ((node as Node).arguments as unknown[] | undefined)?.at(-1);\n if (isEffectMemberCallNamed(operator, \"forkChild\") || isEffectMemberCallNamed(operator, \"forkDetach\")) return operator;\n if (!isObjectValue(operator) || (operator as Node).type !== \"MemberExpression\") return undefined;\n const member = operator as Node;\n return member.computed !== true && isIdentifier(member.object, \"Effect\") &&\n (isIdentifier(member.property, \"forkChild\") || isIdentifier(member.property, \"forkDetach\")) ? operator : undefined;\n}\n\nfunction discardedFork(node: unknown, version: EffectVersion): unknown | undefined {\n if (version === 3) return isEffectMemberCallNamed(node, \"fork\") ? node : undefined;\n const expression = isObjectValue(node) && (node as Node).type === \"YieldExpression\"\n ? (node as Node).argument : node;\n return v4ForkConstruction(expression);\n}\n\nfunction containsEffectMemberCallInSet(\n node: unknown,\n propertyNames: ReadonlySet<string>,\n seen = new WeakSet<object>(),\n): boolean {\n return findNode(node, child => isEffectMemberCall(child) && isIdentifier((child.callee as Node).property) && propertyNames.has(((child.callee as Node).property as { name: string }).name), seen) !== undefined;\n}\n\nconst highRiskEffectMembers = new Set([\n \"sleep\",\n \"await\",\n \"promise\",\n \"tryPromise\",\n \"fork\",\n \"forkDaemon\",\n \"forkScoped\",\n \"all\",\n \"forEach\",\n \"race\",\n \"raceAll\",\n]);\n\nconst effectfulSynchronizedRefMembers = new Set([\n \"modifyEffect\",\n \"modifySomeEffect\",\n \"updateEffect\",\n \"updateAndGetEffect\",\n]);\n\nfunction containsHighRiskSuspension(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => (isEffectMemberCall(child) && isIdentifier((child.callee as Node).property) && highRiskEffectMembers.has(((child.callee as Node).property as { name: string }).name)) || isMemberCall(child, \"Queue\", \"take\") || isMemberCall(child, \"Deferred\", \"await\"), seen) !== undefined;\n}\n\nfunction isAnyObjectMemberCallNamed(node: unknown, propertyName: string): node is Node & { arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n return (\n call.type === \"CallExpression\" &&\n Array.isArray(call.arguments) &&\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"MemberExpression\" &&\n (call.callee as Node).computed !== true &&\n isIdentifier((call.callee as Node).property, propertyName)\n );\n}\n\nfunction heldSemaphoreWork(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 4 && isPipeCall(node)) {\n const operator = ((node as Node).arguments as unknown[]).at(-1);\n return isAnyObjectMemberCallNamed(operator, \"withPermit\") || isAnyObjectMemberCallNamed(operator, \"withPermits\") ? pipeSource(node as Node) : undefined;\n }\n if (version === 4 && [node, isObjectValue(node) ? (node as Node).callee : undefined].some(call => isMemberCall(call, \"TSemaphore\", \"withPermit\") || isMemberCall(call, \"TSemaphore\", \"withPermits\"))) return undefined;\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n if (!Array.isArray(call.arguments)) {\n return undefined;\n }\n\n if (\n typeof call.callee === \"object\" &&\n call.callee !== null &&\n (call.callee as Node).type === \"CallExpression\"\n ) {\n const inner = call.callee as Node;\n if (\n (isAnyObjectMemberCallNamed(inner, \"withPermit\") || isAnyObjectMemberCallNamed(inner, \"withPermits\")) &&\n call.arguments.length > 0\n ) {\n return call.arguments[0];\n }\n }\n\n if (isMemberCall(call, \"TSemaphore\", \"withPermit\") || isMemberCall(call, \"TSemaphore\", \"withPermits\")) {\n return call.arguments[0];\n }\n\n if (isAnyObjectMemberCallNamed(call, \"withPermit\") || isAnyObjectMemberCallNamed(call, \"withPermits\")) {\n return call.arguments.at(-1);\n }\n\n return undefined;\n}\n\nfunction synchronizedRefModifierWork(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (version === 4) {\n const operator = isPipeCall(node) ? ((node as Node).arguments as unknown[]).at(-1) : (node as Node)?.callee;\n const owner = [node, operator].find(call => isEffectfulSynchronizedRefCall(call, \"SynchronizedRef\") || isEffectfulSynchronizedRefCall(call, \"SubscriptionRef\"));\n if (owner) {\n const arguments_ = (owner as Node).arguments as unknown[];\n return owner !== node || arguments_.length > 1 ? arguments_.at(-1) : undefined;\n }\n return undefined;\n }\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n if (!Array.isArray(call.arguments)) {\n return undefined;\n }\n\n if (isEffectfulSynchronizedRefCall(call.callee, \"SynchronizedRef\") && call.arguments.length > 0) return ((call.callee as Node).arguments as unknown[]).at(-1);\n\n if (isEffectfulSynchronizedRefCall(call, \"SynchronizedRef\") && call.arguments.length > 1) {\n return call.arguments.at(-1);\n }\n\n if (isAnyEffectfulSynchronizedRefCall(call) && !isEffectfulSynchronizedRefCall(call, \"SynchronizedRef\")) {\n return call.arguments.at(-1);\n }\n\n return undefined;\n}\n\nfunction isEffectfulSynchronizedRefCall(node: unknown, objectName: string): boolean {\n return isAnyEffectfulSynchronizedRefCall(node) && isIdentifier(((node as Node).callee as Node).object, objectName);\n}\n\nfunction isAnyEffectfulSynchronizedRefCall(node: unknown): boolean {\n return [...effectfulSynchronizedRefMembers].some((propertyName) => isAnyObjectMemberCallNamed(node, propertyName));\n}\n\nconst deferredConstructorMembers = new Set([\"make\", \"unsafeMake\", \"makeUnsafe\"]);\nconst deferredTimeoutMembers = new Set([\n \"timeout\",\n \"timeoutOption\",\n \"timeoutFail\",\n \"timeoutFailCause\",\n \"timeoutTo\",\n]);\nconst deferredInterruptionMembers = new Set([\"race\", \"raceFirst\", \"raceAll\", \"interruptible\", \"scoped\"]);\n\nfunction isEffectMemberExpressionNamed(node: unknown, propertyName: string): boolean {\n return isMemberExpression(node, \"Effect\", propertyName);\n}\n\nfunction isDeferredConstructorCall(node: unknown): boolean {\n return isMemberCall(node, \"Deferred\") && deferredConstructorMembers.has((((node as Node).callee as Node).property as { name: string }).name);\n}\n\nfunction isDeferredAwaitCall(node: unknown): node is Node & { arguments: unknown[] } {\n return isMemberCall(node, \"Deferred\", \"await\") && Array.isArray((node as Node).arguments);\n}\n\nfunction deferredBindingName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclarator\") {\n return undefined;\n }\n\n const declaration = node as Node;\n if (!isIdentifier(declaration.id) || !findNode(declaration.init, isDeferredConstructorCall)) {\n return undefined;\n }\n\n return declaration.id.name;\n}\n\nfunction hasMatchingDeferredFinalizer(node: unknown, bindingName: string): boolean {\n return Boolean(findNode(node, (candidate) => {\n if (!isMemberCall(candidate, \"Effect\", \"addFinalizer\") && !isMemberCall(candidate, \"Scope\", \"addFinalizer\")) {\n return false;\n }\n\n const arguments_ = (candidate as Node & { arguments?: unknown[] }).arguments;\n return Array.isArray(arguments_) && arguments_.some((argument) => {\n const body = callbackBody(argument);\n return body !== undefined && containsIdentifierNamed(body, bindingName);\n });\n }));\n}\n\nfunction isEffectScopedPipeCall(node: unknown): boolean {\n if (!isPipeCall(node)) {\n return false;\n }\n\n const arguments_ = (node as Node & { arguments?: unknown[] }).arguments;\n return Array.isArray(arguments_) && arguments_.some((argument) => isEffectMemberExpressionNamed(argument, \"scoped\"));\n}\n\nfunction isDeferredAwaitProtected(node: unknown, bindingName: string, version: EffectVersion = 3, references: readonly { identifier: unknown }[] = []): boolean {\n let current = isObjectValue(node) ? (node as Node).parent : undefined;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) {\n return false;\n }\n seen.add(current);\n\n if (\n (isEffectMemberCall(current) && (() => {\n const property = ((current as Node).callee as Node).property;\n return isIdentifier(property) && (\n (version === 4 ? effect4TimeoutMembers.has(property.name) || v4RaceMembers.has(property.name) || property.name === \"interruptible\" || property.name === \"scoped\" : deferredTimeoutMembers.has(property.name) || deferredInterruptionMembers.has(property.name))\n );\n })()) ||\n (version === 3 ? isEffectScopedPipeCall(current) : isPipeCall(current) && (() => {\n const operator = ((current as Node).arguments as unknown[]).at(-1);\n return [...effect4TimeoutMembers, ...v4RaceMembers, \"interruptible\", \"scoped\"].some(name => isEffectMemberCallNamed(operator, name) || isEffectMemberExpressionNamed(operator, name));\n })()) ||\n (version === 4 && (current as Node).type === \"CallExpression\" && isEffectMemberCall((current as Node).callee) && (() => {\n const name = (((current as Node).callee as Node).callee as Node).property;\n return isIdentifier(name) && (effect4TimeoutMembers.has(name.name) || v4RaceMembers.has(name.name));\n })())\n ) {\n return true;\n }\n\n if (isFunctionLike(current)) {\n if (version === 3 ? hasMatchingDeferredFinalizer(current, bindingName) : references.some(reference => {\n for (let owner = (reference.identifier as Node).parent as Node | undefined; owner && nodeWithin(owner, current); owner = owner.parent as Node | undefined) {\n if (isMemberCall(owner, \"Effect\", \"addFinalizer\") || isMemberCall(owner, \"Scope\", \"addFinalizer\")) return true;\n }\n return false;\n })) return true;\n if (version === 4) {\n const parent = (current as Node).parent;\n if (getEffectGeneratorArgument(parent, \"gen\", 4) !== current && getEffectGeneratorArgument(parent, \"fn\", 4) !== current && !effectLogicCallbacks(parent, 4).includes(current)) return false;\n }\n }\n\n current = (current as Node).parent;\n }\n\n return false;\n}\n\nconst raceCleanupCalls = new Set([\n \"acquireRelease\",\n \"acquireUseRelease\",\n \"ensuring\",\n \"forkIn\",\n \"forkScoped\",\n \"scoped\",\n]);\n\nconst v4RaceMembers = new Set([\"race\", \"raceAll\", \"raceFirst\", \"raceAllFirst\"]);\n\nfunction isV4RaceMember(node: unknown): boolean {\n return [...v4RaceMembers].some(name => isEffectMemberCallNamed(node, name) || isEffectMemberExpressionNamed(node, name));\n}\n\nfunction v4RaceConstruction(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") return false;\n return isV4RaceMember(node) || isV4RaceMember((node as Node).callee) ||\n (isPipeCall(node) && isV4RaceMember(((node as Node).arguments as unknown[] | undefined)?.at(-1)));\n}\n\nfunction isEffectRaceWithoutCleanup(node: unknown, version: EffectVersion = 3): boolean {\n if (version === 4) {\n if (!v4RaceConstruction(node)) return false;\n const parent = (node as Node).parent;\n if (isObjectValue(parent) && v4RaceConstruction(parent) &&\n ((parent as Node).callee === node || (isPipeCall(parent) && ((parent as Node).arguments as unknown[] | undefined)?.at(-1) === node))) return false;\n const hasCleanup = (value: unknown) => findNode(value, candidate => [...raceCleanupCalls].some(name =>\n isEffectMemberCallNamed(candidate, name) || isEffectMemberExpressionNamed(candidate, name))) !== undefined;\n if (hasCleanup((node as Node).arguments) || hasCleanup(((node as Node).callee as Node | undefined)?.arguments)) return false;\n let current = parent;\n const seen = new WeakSet<object>();\n while (isObjectValue(current) && !seen.has(current)) {\n seen.add(current);\n if (isFunctionLike(current) &&\n getEffectGeneratorArgument((current as Node).parent, \"gen\", 4) !== current &&\n getEffectGeneratorArgument((current as Node).parent, \"fn\", 4) !== current &&\n !(isEffectMemberCallNamed((current as Node).parent, \"acquireUseRelease\") &&\n (((current as Node).parent as Node).arguments as unknown[] | undefined)?.[1] === current)) break;\n if (isEffectMemberCall(current) && raceCleanupCalls.has(((current.callee as Node).property as Node).name as string)) return false;\n if (isPipeCall(current) && hasCleanup((current as Node).arguments)) return false;\n current = (current as Node).parent;\n }\n return true;\n }\n if (!isEffectMemberCallNamed(node, \"race\") && !isEffectMemberCallNamed(node, \"raceAll\")) {\n return false;\n }\n\n return !containsEffectMemberCallInSet((node as Node & { arguments: unknown[] }).arguments, raceCleanupCalls);\n}\n\nfunction isUnboundedEffectForEach(node: unknown, context?: OxlintContext): boolean {\n return (\n isEffectMemberCallNamed(node, \"forEach\") &&\n hasUnboundedConcurrencyOption((node as Node & { arguments: unknown[] }).arguments.at(-1), context)\n );\n}\n\nconst retryCalls = new Set([\"retry\"]);\n\nfunction isUnboundedConcurrentRetry(node: unknown, context?: OxlintContext): boolean {\n return (\n (isUnboundedEffectAll(node, context) || isUnboundedEffectForEach(node, context)) &&\n containsEffectMemberCallInSet((node as Node & { arguments: unknown[] }).arguments, retryCalls)\n );\n}\n\nfunction variableDeclarationIdentifierNames(node: unknown): string[] {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return [];\n }\n\n const declarations = (node as Node).declarations;\n if (!Array.isArray(declarations)) {\n return [];\n }\n\n return declarations.flatMap((declaration) => {\n if (!isObjectValue(declaration)) {\n return [];\n }\n\n const id = (declaration as Node).id;\n return isIdentifier(id) ? [id.name] : [];\n });\n}\n\nfunction collectDeclaredIdentifierNames(\n node: unknown,\n names = new Set<string>(),\n seen = new WeakSet<object>(),\n): Set<string> {\n if (Array.isArray(node)) {\n for (const child of node) {\n collectDeclaredIdentifierNames(child, names, seen);\n }\n return names;\n }\n\n if (!isObjectValue(node)) {\n return names;\n }\n\n if (seen.has(node)) {\n return names;\n }\n seen.add(node);\n\n if ((node as Node).type === \"VariableDeclaration\") {\n for (const name of variableDeclarationIdentifierNames(node)) {\n names.add(name);\n }\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key !== \"parent\") {\n collectDeclaredIdentifierNames(child, names, seen);\n }\n }\n\n return names;\n}\n\nconst mutatingCollectionMethods = new Set([\n \"add\",\n \"clear\",\n \"delete\",\n \"pop\",\n \"push\",\n \"reverse\",\n \"set\",\n \"shift\",\n \"sort\",\n \"splice\",\n \"unshift\",\n]);\n\nfunction mutatedIdentifierName(node: unknown): string | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const candidate = node as Node;\n if (\n candidate.type === \"AssignmentExpression\" &&\n isIdentifier(candidate.left)\n ) {\n return candidate.left.name;\n }\n\n if (\n candidate.type === \"UpdateExpression\" &&\n isIdentifier(candidate.argument)\n ) {\n return candidate.argument.name;\n }\n\n if (\n candidate.type === \"CallExpression\" &&\n typeof candidate.callee === \"object\" &&\n candidate.callee !== null &&\n (candidate.callee as Node).type === \"MemberExpression\" &&\n (candidate.callee as Node).computed !== true &&\n isIdentifier((candidate.callee as Node).object) &&\n isIdentifier((candidate.callee as Node).property) &&\n mutatingCollectionMethods.has(((candidate.callee as Node).property as { name: string }).name)\n ) {\n return ((candidate.callee as Node).object as { name: string }).name;\n }\n\n return undefined;\n}\n\nfunction findSharedMutableStateMutation(\n node: unknown,\n mutableNames: ReadonlySet<string>,\n localNames = collectDeclaredIdentifierNames(node),\n seen = new WeakSet<object>(),\n): unknown | undefined {\n if (Array.isArray(node)) {\n for (const child of node) {\n const match = findSharedMutableStateMutation(child, mutableNames, localNames, seen);\n if (match) {\n return match;\n }\n }\n return undefined;\n }\n\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n if (seen.has(node)) {\n return undefined;\n }\n seen.add(node);\n\n const mutatedName = mutatedIdentifierName(node);\n if (mutatedName && mutableNames.has(mutatedName) && !localNames.has(mutatedName)) {\n return node;\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n const match = findSharedMutableStateMutation(child, mutableNames, localNames, seen);\n if (match) {\n return match;\n }\n }\n\n return undefined;\n}\n\nfunction concurrentEffectWorkNode(node: unknown): unknown | undefined {\n if (\n isEffectMemberCallNamed(node, \"fork\") ||\n isEffectMemberCallNamed(node, \"all\") ||\n isEffectMemberCallNamed(node, \"forEach\")\n ) {\n return (node as Node & { arguments: unknown[] }).arguments;\n }\n\n return undefined;\n}\n\nfunction v4SharedStateWork(node: unknown): unknown | undefined {\n if (isEffectMemberCallNamed(node, \"all\") || isEffectMemberCallNamed(node, \"forEach\")) return (node as Node).arguments;\n if (!v4ForkConstruction(node)) return undefined;\n if (!isPipeCall(node)) return firstArgument(node as Node & { arguments: unknown[] });\n const receiver = ((node as Node).callee as Node).object;\n return isIdentifier((node as Node).callee, \"pipe\") ? firstArgument(node as Node & { arguments: unknown[] }) : receiver;\n}\n\nfunction nodeWithin(node: unknown, owner: unknown): boolean {\n if (Array.isArray(owner)) return owner.some(entry => nodeWithin(node, entry));\n for (let current = node as Node | undefined; current; current = current.parent as Node | undefined) {\n if (current === owner) return true;\n }\n return false;\n}\n\nfunction mutationAtReference(reference: unknown): unknown | undefined {\n const identifier = reference as Node;\n const parent = identifier.parent as Node | undefined;\n if (parent?.type === \"AssignmentExpression\" && parent.left === identifier) return parent;\n if (parent?.type === \"UpdateExpression\" && parent.argument === identifier) return parent;\n if (parent?.type === \"MemberExpression\" && parent.object === identifier && parent.computed !== true &&\n isIdentifier(parent.property) && mutatingCollectionMethods.has(parent.property.name)) {\n const call = parent.parent as Node | undefined;\n if (call?.type === \"CallExpression\" && call.callee === parent) return call;\n }\n return undefined;\n}\n\nfunction lexicalWorkMutation(work: unknown, variables: ReturnType<OxlintContext[\"sourceCode\"][\"getDeclaredVariables\"]>): unknown | undefined {\n for (const variable of variables) {\n if (variable.identifiers.some(identifier => nodeWithin(identifier, work))) continue;\n const mutation = variable.references.map(reference => mutationAtReference(reference.identifier)).find(node => node && nodeWithin(node, work));\n if (mutation) return mutation;\n }\n return undefined;\n}\n\nconst concurrentWorkMembers = new Set([\n \"fork\",\n \"forkScoped\",\n \"forkDaemon\",\n \"all\",\n \"forEach\",\n \"race\",\n \"raceFirst\",\n \"raceAll\",\n]);\n\nconst resourceAcquisitionVerbs = new Set([\n \"open\",\n \"connect\",\n \"create\",\n \"start\",\n \"listen\",\n \"subscribe\",\n \"acquire\",\n]);\n\nconst resourceLikeTerms = new Set([\n \"client\",\n \"connection\",\n \"conn\",\n \"pool\",\n \"db\",\n \"database\",\n \"file\",\n \"socket\",\n \"stream\",\n \"server\",\n \"subscription\",\n \"handle\",\n]);\n\nconst resourceCleanupMethods = new Set([\"close\", \"destroy\", \"dispose\", \"cleanup\"]);\n\nfunction identifierNameTokens(name: string): string[] {\n return name\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .map((token) => token.toLowerCase());\n}\n\nfunction isResourceLikeName(name: string): boolean {\n return identifierNameTokens(name).some((token) => resourceLikeTerms.has(token));\n}\n\nfunction isResourceLikeExpression(node: unknown): boolean {\n if (isIdentifier(node)) {\n return isResourceLikeName(node.name);\n }\n\n if (!isMemberExpressionNode(node)) {\n return false;\n }\n\n const member = node as Node;\n if (member.computed === true) {\n return false;\n }\n\n return (\n (isIdentifier(member.property) && isResourceLikeName(member.property.name)) ||\n isResourceLikeExpression(member.object)\n );\n}\n\nfunction isResourceCleanupCall(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const call = node as Node;\n const callee = call.callee;\n if (\n !isObjectValue(callee) ||\n (callee as Node).type !== \"MemberExpression\" ||\n (callee as Node).computed === true ||\n !isIdentifier((callee as Node).property)\n ) {\n return false;\n }\n\n const member = callee as Node & { property: Node & { name: string } };\n return (\n resourceCleanupMethods.has(member.property.name) &&\n isResourceLikeExpression(member.object)\n );\n}\n\nfunction concurrentWorkArguments(node: unknown, version: EffectVersion = 3): unknown[] | undefined {\n if (version === 4) {\n const operator = isPipeCall(node) ? ((node as Node).arguments as unknown[]).at(-1) : (node as Node)?.callee;\n const matches = (call: unknown) => [...effect4ConcurrentCalls].some(name => isEffectMemberCallNamed(call, name) || isEffectMemberExpressionNamed(call, name));\n if (matches(node)) return (node as Node).arguments as unknown[];\n if (matches(operator)) return [...((operator as Node).arguments as unknown[] ?? []), ...(isPipeCall(node) ? [pipeSource(node as Node)] : (node as Node).arguments as unknown[])];\n return undefined;\n }\n if (!isEffectMemberCall(node)) {\n return undefined;\n }\n\n const property = ((node as Node).callee as Node).property;\n return isIdentifier(property) && concurrentWorkMembers.has(property.name)\n ? (node as Node & { arguments: unknown[] }).arguments\n : undefined;\n}\n\nfunction resourceAcquisitionCall(node: unknown): node is Node & { callee: Node } {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return false;\n }\n\n const call = node as Node;\n const callee = call.callee;\n let name: string | undefined;\n\n if (isIdentifier(callee)) {\n name = callee.name;\n } else if (isObjectValue(callee) && (callee as Node).type === \"MemberExpression\") {\n const member = callee as Node;\n if (member.computed !== true && isIdentifier(member.property)) {\n name = member.property.name;\n }\n }\n\n if (!name || name === \"acquireRelease\" || name === \"acquireUseRelease\") {\n return false;\n }\n\n const tokens = identifierNameTokens(name);\n return (\n tokens.some((token) => resourceAcquisitionVerbs.has(token)) &&\n isResourceLikeName(name)\n );\n}\n\nfunction hasScopedReleaseEvidence(node: unknown, bindingName?: string): boolean {\n if (\n isEffectMemberCallNamed(node, \"acquireRelease\") ||\n isEffectMemberCallNamed(node, \"acquireUseRelease\") ||\n isEffectMemberCallNamed(node, \"scoped\") ||\n isEffectScopedPipeCall(node)\n ) {\n return true;\n }\n\n return bindingName !== undefined && hasMatchingDeferredFinalizer(node, bindingName);\n}\n\nfunction matchingFinalizerBindingNames(node: unknown): Set<string> {\n const bindingNames = new Set<string>();\n for (const candidate of findNodes(node, (child) => (\n isObjectValue(child) && (child as Node).type === \"VariableDeclarator\"\n ))) {\n const declaration = candidate as Node;\n if (\n isIdentifier(declaration.id) &&\n findNode(declaration.init, resourceAcquisitionCall) &&\n hasMatchingDeferredFinalizer(node, declaration.id.name)\n ) {\n bindingNames.add(declaration.id.name);\n }\n }\n return bindingNames;\n}\n\nfunction collectUnscopedResourceAcquisitions(\n node: unknown,\n matches: unknown[],\n seen = new WeakSet<object>(),\n ownedBindings = new Set<string>(),\n owned = false,\n version: EffectVersion = 3,\n): void {\n if (Array.isArray(node)) {\n for (const child of node) {\n collectUnscopedResourceAcquisitions(child, matches, seen, ownedBindings, owned, version);\n }\n return;\n }\n\n if (!isObjectValue(node) || seen.has(node)) {\n return;\n }\n seen.add(node);\n\n if (version === 4 && isFunctionLike(node)) {\n const parent = (node as Node).parent;\n if (getEffectGeneratorArgument(parent, \"gen\", 4) !== node && getEffectGeneratorArgument(parent, \"fn\", 4) !== node && !effectLogicCallbacks(parent, 4).includes(node) &&\n ![\"sync\", \"suspend\", \"promise\", \"tryPromise\"].some(name => isEffectMemberCallNamed(parent, name)) && !isAnyObjectMemberCallNamed(parent, \"map\")) return;\n }\n\n if (hasScopedReleaseEvidence(node)) {\n return;\n }\n\n const nextOwnedBindings = isFunctionLike(node) ? new Set([...ownedBindings, ...matchingFinalizerBindingNames(node)]) : ownedBindings;\n\n const declaration = (node as Node).type === \"VariableDeclarator\" ? node as Node : undefined;\n const declarationName = declaration && isIdentifier(declaration.id) ? declaration.id.name : undefined;\n const declarationIsOwned = declarationName !== undefined && nextOwnedBindings.has(declarationName);\n\n if (resourceAcquisitionCall(node) && !owned) {\n matches.push(node);\n return;\n }\n\n for (const [key, child] of Object.entries(node)) {\n if (key === \"parent\") {\n continue;\n }\n\n collectUnscopedResourceAcquisitions(\n child,\n matches,\n seen,\n nextOwnedBindings,\n owned || declarationIsOwned,\n version,\n );\n }\n}\n\nfunction findUnscopedResourceAcquisition(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n const matches: unknown[] = [];\n collectUnscopedResourceAcquisitions(node, matches, seen);\n return matches[0];\n}\n\nfunction findUnscopedResourceAcquisitions(node: unknown, version: EffectVersion = 3): unknown[] {\n const matches: unknown[] = [];\n collectUnscopedResourceAcquisitions(node, matches, undefined, undefined, false, version);\n return matches;\n}\n\nconst concurrentEffectCalls = new Set([\"all\", \"forEach\", \"fork\", \"race\", \"raceAll\"]);\n\nfunction containsConcurrentOperation(node: unknown, seen = new WeakSet<object>()): boolean {\n if (containsEffectMemberCallInSet(node, concurrentEffectCalls)) {\n return true;\n }\n\n if (isMemberCall(node, \"Queue\", \"take\")) {\n return true;\n }\n\n if (Array.isArray(node)) {\n return node.some((child) => containsConcurrentOperation(child, seen));\n }\n\n if (!isObjectValue(node)) {\n return false;\n }\n\n if (seen.has(node)) {\n return false;\n }\n seen.add(node);\n\n return Object.entries(node).some(([key, child]) => (\n key !== \"parent\" && containsConcurrentOperation(child, seen)\n ));\n}\n\nconst effect4ConcurrentCalls = new Set([\"all\", \"forEach\", \"forkChild\", \"forkDetach\", \"forkScoped\", \"forkIn\", \"race\", \"raceAll\", \"raceFirst\", \"raceAllFirst\"]);\n\nfunction containsEffect4ConcurrentOperation(node: unknown, permit = false): boolean {\n return !!findOwnCallbackNode(node, child => {\n if (isMemberCall(child, \"Queue\", \"take\") || isMemberCall(child, \"PubSub\", \"take\") ||\n [...effect4ConcurrentCalls].some(name => isEffectMemberCallNamed(child, name) || isEffectMemberExpressionNamed(child, name)) ||\n permit && ([\"sleep\", \"promise\", \"tryPromise\"].some(name => isEffectMemberCallNamed(child, name)) || isMemberCall(child, \"Deferred\", \"await\"))) return true;\n const generator = getEffectGeneratorArgument(child, \"gen\", 4) ?? getEffectGeneratorArgument(child, \"fn\", 4);\n if (generator && containsEffect4ConcurrentOperation(generator.body, permit)) return true;\n return effectLogicCallbacks(child, 4).some(callback => containsEffect4ConcurrentOperation(callbackBody(callback), permit));\n });\n}\n\nfunction isUninterruptibleConcurrentRegion(node: unknown, version: EffectVersion = 3): boolean {\n if (version === 4) {\n const work = isEffectMemberCallNamed(node, \"uninterruptible\") ? firstArgument(node as Node & { arguments: unknown[] }) :\n isPipeCall(node) && isEffectMemberExpressionNamed(((node as Node).arguments as unknown[]).at(-1), \"uninterruptible\") ? pipeSource(node as Node) : undefined;\n return work !== undefined && containsEffect4ConcurrentOperation(work);\n }\n return (\n isEffectMemberCallNamed(node, \"uninterruptible\") &&\n containsConcurrentOperation((node as Node & { arguments: unknown[] }).arguments[0])\n );\n}\n\nfunction isUnboundedQueueOrPubSub(node: unknown, version: EffectVersion = 3): boolean {\n if (isMemberCall(node, \"Queue\", \"unbounded\") || isMemberCall(node, \"PubSub\", \"unbounded\")) return true;\n if (version !== 4) return false;\n if (isMemberCall(node, \"PubSub\", \"makeAtomicUnbounded\")) return true;\n if (!isMemberCall(node, \"Queue\", \"make\")) return false;\n const options = firstArgument(node as Node & { arguments: unknown[] });\n if (!options || isIdentifier(options, \"undefined\")) return true;\n if (!isObjectExpression(options)) return false;\n if (((options as Node).properties as Node[]).some(entry => entry.type === \"SpreadElement\")) return false;\n const capacity = objectPropertyValue(options, \"capacity\");\n return !capacity ||\n isIdentifier(capacity, \"undefined\") || isIdentifier(capacity, \"Infinity\") ||\n (isObjectValue(capacity) && (capacity as Node).type === \"MemberExpression\" &&\n (capacity as Node).computed !== true && isIdentifier((capacity as Node).object, \"Number\") && isIdentifier((capacity as Node).property, \"POSITIVE_INFINITY\"));\n}\n\nfunction isMutableContainerInit(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const candidate = node as Node;\n return (\n candidate.type === \"ObjectExpression\" ||\n candidate.type === \"ArrayExpression\" ||\n (\n candidate.type === \"NewExpression\" &&\n (isIdentifier(candidate.callee, \"Map\") || isIdentifier(candidate.callee, \"Set\"))\n ) ||\n (\n candidate.type === \"CallExpression\" &&\n (isIdentifier(candidate.callee, \"Map\") || isIdentifier(candidate.callee, \"Set\"))\n )\n );\n}\n\nfunction mutableGlobalDeclarationNames(node: unknown): string[] {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return [];\n }\n\n const declaration = node as Node;\n const declarations = Array.isArray(declaration.declarations) ? declaration.declarations : [];\n if (declaration.kind === \"let\" || declaration.kind === \"var\") {\n return variableDeclarationIdentifierNames(node);\n }\n\n return declarations.flatMap((entry) => {\n if (!isObjectValue(entry)) {\n return [];\n }\n\n const id = (entry as Node).id;\n return isIdentifier(id) && isMutableContainerInit((entry as Node).init) ? [id.name] : [];\n });\n}\n\nfunction forkedFiberVariableName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclarator\") {\n return undefined;\n }\n\n const declarator = node as Node;\n return isIdentifier(declarator.id) && isEffectMemberCallNamed(declarator.init, \"fork\")\n ? declarator.id.name\n : undefined;\n}\n\nconst fiberObservationCalls = new Set([\"await\", \"interrupt\", \"join\"]);\n\nfunction observedFiberVariableName(node: unknown): string | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"CallExpression\") {\n return undefined;\n }\n\n const call = node as Node & { arguments?: unknown[] };\n const callee = call.callee;\n if (\n !isObjectValue(callee) ||\n (callee as Node).type !== \"MemberExpression\" ||\n (callee as Node).computed === true ||\n !isIdentifier((callee as Node).object, \"Fiber\") ||\n !isIdentifier((callee as Node).property) ||\n !fiberObservationCalls.has(((callee as Node).property as { name: string }).name) ||\n !Array.isArray(call.arguments)\n ) {\n return undefined;\n }\n\n const [fiber] = call.arguments;\n return isIdentifier(fiber) ? fiber.name : undefined;\n}\n\nfunction v4FiberObservedReference(reference: unknown): boolean {\n if (!isIdentifier(reference)) return false;\n const parent = reference.parent as Node | undefined;\n if (!parent) return false;\n if (parent.type === \"ReturnStatement\" && parent.argument === reference) return true;\n if (observedFiberVariableName(parent) === reference.name && firstArgument(parent as Node & { arguments: unknown[] }) === reference) return true;\n const pipe = parent.type === \"MemberExpression\" && parent.object === reference ? parent.parent : parent;\n return isPipeCall(pipe) && findNode((pipe as Node).arguments, candidate =>\n [...fiberObservationCalls].some(name => isMemberExpression(candidate, \"Fiber\", name))) !== undefined;\n}\n\nfunction isEffectAsVoidPipeArgument(node: unknown): boolean {\n return isMemberExpression(node, \"Effect\", \"asVoid\") || isMemberCall(node, \"Effect\", \"asVoid\");\n}\n\nfunction isEffectAllAsVoidPipe(node: unknown): node is Node & { callee: Node; arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n if (\n call.type !== \"CallExpression\" ||\n !Array.isArray(call.arguments) ||\n typeof call.callee !== \"object\" ||\n call.callee === null ||\n (call.callee as Node).type !== \"MemberExpression\" ||\n (call.callee as Node).computed === true ||\n !isIdentifier((call.callee as Node).property, \"pipe\")\n ) {\n return false;\n }\n\n return (\n isEffectMemberCallNamed((call.callee as Node).object, \"all\") &&\n call.arguments.some((argument) => isEffectAsVoidPipeArgument(argument))\n );\n}\n\nfunction pipeParts(node: unknown): unknown[] {\n if (!isObjectValue(node) || !isPipeCall(node)) {\n return [];\n }\n\n const call = node as Node & { arguments: unknown[] };\n if (isIdentifier(call.callee, \"pipe\")) {\n return call.arguments;\n }\n\n const callee = call.callee as Node;\n return [callee.object, ...call.arguments];\n}\n\nfunction isPipeStartingWithEffect(node: unknown): boolean {\n const [first] = pipeParts(node);\n return first !== undefined && containsEffectMemberCall(first);\n}\n\nfunction isEffectWrapperAliasExpression(node: unknown): boolean {\n if (isPipeStartingWithEffect(node)) {\n return true;\n }\n\n if (\n isObjectValue(node) &&\n (node as Node).type === \"ArrowFunctionExpression\"\n ) {\n const body = (node as Node).body;\n return isEffectMemberCall(body) || isPipeStartingWithEffect(body);\n }\n\n return false;\n}\n\nfunction hasEffectWrapperAliasReturn(node: unknown): boolean {\n return findReturnStatements(node).some((returnNode) => (\n isObjectValue(returnNode) &&\n (isEffectWrapperAliasExpression((returnNode as Node).argument) ||\n isEffectMemberCall((returnNode as Node).argument))\n ));\n}\n\nfunction isQualifiedTypeReference(node: unknown, leftName: string, rightName: string): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"TSTypeReference\") {\n return false;\n }\n\n const typeName = (node as Node).typeName;\n return (\n isObjectValue(typeName) &&\n (typeName as Node).type === \"TSQualifiedName\" &&\n isIdentifier((typeName as Node).left, leftName) &&\n isIdentifier((typeName as Node).right, rightName)\n );\n}\n\nfunction isIdentifierTypeReference(node: unknown, name: string): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"TSTypeReference\" &&\n isIdentifier((node as Node).typeName, name)\n );\n}\n\nfunction typeArguments(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const container = (node as Node).typeParameters ?? (node as Node).typeArguments;\n if (!isObjectValue(container)) {\n return [];\n }\n\n const params = (container as Node).params ?? (container as Node).arguments;\n return Array.isArray(params) ? params : [];\n}\n\nfunction isGenericErrorType(node: unknown): boolean {\n return isIdentifier(node, \"Error\") || isIdentifierTypeReference(node, \"Error\");\n}\n\nfunction returnTypeAnnotation(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const returnType = (node as Node).returnType;\n if (!isObjectValue(returnType)) {\n return undefined;\n }\n\n return (returnType as Node).typeAnnotation ?? returnType;\n}\n\nfunction hasExplicitEffectReturnType(node: unknown, declaredReturnType?: unknown): boolean {\n return (\n isQualifiedTypeReference(returnTypeAnnotation(node), \"Effect\", \"Effect\") ||\n isQualifiedTypeReference(declaredReturnType, \"Effect\", \"Effect\")\n );\n}\n\nfunction operationReturnExpressions(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const body = (node as Node).body;\n if (!isObjectValue(body)) {\n return [];\n }\n\n if ((body as Node).type !== \"BlockStatement\") {\n return [body];\n }\n\n const collectReturns = (current: unknown, seen = new WeakSet<object>()): unknown[] => {\n if (Array.isArray(current)) {\n return current.flatMap((child) => collectReturns(child, seen));\n }\n\n if (!isObjectValue(current) || seen.has(current)) {\n return [];\n }\n seen.add(current);\n\n const currentNode = current as Node;\n if (currentNode.type === \"ReturnStatement\") {\n return [currentNode.argument];\n }\n if (\n currentNode.type === \"ArrowFunctionExpression\" ||\n currentNode.type === \"FunctionExpression\" ||\n currentNode.type === \"FunctionDeclaration\"\n ) {\n return [];\n }\n\n return Object.entries(currentNode).flatMap(([key, child]) => (\n key === \"parent\" ? [] : collectReturns(child, seen)\n ));\n };\n\n return collectReturns(body);\n}\n\nfunction returnedEffectExpressions(node: unknown): unknown[] {\n return operationReturnExpressions(node).filter((expression) => (\n isEffectMemberCall(expression) || isPipeStartingWithEffect(expression)\n ));\n}\n\nfunction containsDirectEffectSpan(expression: unknown): boolean {\n return isEffectMemberCallNamed(expression, \"withSpan\") || (\n isPipeCall(expression) && pipeParts(expression).some((part) => isEffectMemberCallNamed(part, \"withSpan\"))\n );\n}\n\nfunction publicEffectOperationWithoutSpan(node: unknown, declaredReturnType?: unknown): unknown | undefined {\n if (!hasExplicitEffectReturnType(node, declaredReturnType)) {\n return undefined;\n }\n\n const expressions = returnedEffectExpressions(node);\n return expressions.length === 0 || expressions.some((expression) => !containsDirectEffectSpan(expression))\n ? node\n : undefined;\n}\n\ntype ExportedFunctionValue = {\n readonly functionNode: unknown;\n readonly declaredReturnType?: unknown;\n};\n\nfunction declaredFunctionReturnType(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const annotation = (node as Node).typeAnnotation;\n if (!isObjectValue(annotation)) {\n return undefined;\n }\n\n return returnTypeAnnotation((annotation as Node).typeAnnotation ?? annotation);\n}\n\nfunction exportedFunctionValues(node: unknown): ExportedFunctionValue[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const exportNode = node as Node;\n if (exportNode.type !== \"ExportNamedDeclaration\" && exportNode.type !== \"ExportDefaultDeclaration\") {\n return [];\n }\n\n const declaration = exportNode.declaration;\n if (!isObjectValue(declaration)) {\n return [];\n }\n\n if ((declaration as Node).type === \"FunctionDeclaration\") {\n return [{ functionNode: declaration }];\n }\n\n if ((declaration as Node).type !== \"VariableDeclaration\") {\n return [];\n }\n\n return (((declaration as Node).declarations as unknown[] | undefined) ?? []).flatMap((declarator) => {\n if (!isObjectValue(declarator)) {\n return [];\n }\n\n const init = (declarator as Node).init;\n return (\n isObjectValue(init) &&\n ((init as Node).type === \"ArrowFunctionExpression\" || (init as Node).type === \"FunctionExpression\")\n ) ? [{\n functionNode: init,\n declaredReturnType: declaredFunctionReturnType((declarator as Node).id),\n }] : [];\n });\n}\n\nfunction serviceMethodFunctions(options: unknown, version: EffectVersion = 3): unknown[] {\n if (version === 4) {\n const seen = new WeakSet<object>();\n const objects = (value: unknown): unknown[] => {\n if (!isObjectValue(value) || seen.has(value)) return [];\n seen.add(value);\n if (isObjectExpression(value)) return [value];\n if (isFunctionLike(value)) return operationReturnExpressions(value).flatMap(objects);\n const generator = getEffectGeneratorArgument(value, \"gen\", version) ?? getEffectGeneratorArgument(value, \"fn\", version);\n if (generator) return objects(generator);\n if (isEffectMemberCallNamed(value, \"succeed\") || isEffectMemberCallNamed(value, \"sync\") || isEffectMemberCallNamed(value, \"suspend\")) return objects(firstArgument(value as Node & { arguments: unknown[] }));\n if (isPipeCall(value)) {\n const callee = (value as Node).callee as Node;\n return objects(callee.type === \"MemberExpression\" ? callee.object : firstArgument(value as Node & { arguments: unknown[] }));\n }\n return [];\n };\n return objects(objectPropertyValue(options, \"make\")).flatMap(value => ((value as Node).properties as Node[]).filter(entry => entry.type === \"Property\" && isFunctionLike(entry.value)).map(entry => entry.value));\n }\n const implementation = objectPropertyValue(options, \"effect\") ?? objectPropertyValue(options, \"scoped\");\n const generator = getEffectGeneratorArgument(implementation, \"gen\");\n const returnedObject = generator\n ? operationReturnExpressions(generator).find(isObjectExpression)\n : isEffectMemberCallNamed(implementation, \"succeed\") && isObjectExpression(firstArgument(implementation))\n ? firstArgument(implementation)\n : undefined;\n\n if (!returnedObject) {\n return [];\n }\n\n const properties = (returnedObject as Node).properties;\n if (!Array.isArray(properties)) {\n return [];\n }\n\n return properties.flatMap((property) => {\n if (!isObjectValue(property) || (property as Node).type !== \"Property\") {\n return [];\n }\n\n const value = (property as Node).value;\n return (\n isObjectValue(value) &&\n ((value as Node).type === \"ArrowFunctionExpression\" || (value as Node).type === \"FunctionExpression\")\n ) ? [value] : [];\n });\n}\n\nfunction serviceEffectOperationWithoutSpan(node: unknown): unknown | undefined {\n const expressions = returnedEffectExpressions(node);\n return expressions.some((expression) => !containsDirectEffectSpan(expression)) ? node : undefined;\n}\n\nfunction genericEffectErrorReturnType(node: unknown): unknown | undefined {\n const target = effectErrorChannelTarget(node);\n return target && isGenericErrorType(target.errorChannel)\n ? target.annotation\n : undefined;\n}\n\ntype PublicEffectErrorTarget = {\n readonly annotation: unknown;\n readonly errorChannel: unknown;\n};\n\nfunction effectErrorChannelTarget(\n node: unknown,\n declaredReturnType?: unknown,\n): PublicEffectErrorTarget | undefined {\n const annotation = returnTypeAnnotation(node) ?? declaredReturnType;\n if (!isQualifiedTypeReference(annotation, \"Effect\", \"Effect\")) {\n return undefined;\n }\n\n const [, errorChannel] = typeArguments(annotation);\n return errorChannel === undefined ? undefined : { annotation, errorChannel };\n}\n\nfunction exportedEffectErrorTargets(node: unknown): PublicEffectErrorTarget[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const exportNode = node as Node;\n if (\n exportNode.type !== \"ExportNamedDeclaration\" &&\n exportNode.type !== \"ExportDefaultDeclaration\"\n ) {\n return [];\n }\n\n return exportedFunctionValues(exportNode).flatMap(({ functionNode, declaredReturnType }) => {\n const target = effectErrorChannelTarget(functionNode, declaredReturnType);\n return target ? [target] : [];\n });\n}\n\nfunction exportedGenericEffectErrorTarget(node: unknown): unknown | undefined {\n return exportedEffectErrorTargets(node).find((target) => (\n isGenericErrorType(target.errorChannel)\n ))?.annotation;\n}\n\ntype ErrorChannelShape = \"Error\" | \"unknown\" | \"string\" | \"number\" | \"boolean\";\n\nfunction unwrappedType(node: unknown): unknown {\n let current = node;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return current;\n seen.add(current);\n\n if ((current as Node).type !== \"TSParenthesizedType\") return current;\n current = (current as Node).typeAnnotation;\n }\n\n return current;\n}\n\nfunction errorChannelShape(node: unknown): ErrorChannelShape | undefined {\n const type = unwrappedType(node);\n if (isGenericErrorType(type)) return \"Error\";\n\n if (!isObjectValue(type)) return undefined;\n\n switch ((type as Node).type) {\n case \"TSUnknownKeyword\":\n return \"unknown\";\n case \"TSStringKeyword\":\n return \"string\";\n case \"TSNumberKeyword\":\n return \"number\";\n case \"TSBooleanKeyword\":\n return \"boolean\";\n default:\n return undefined;\n }\n}\n\nfunction mixedErrorChannelShapes(node: unknown): Set<ErrorChannelShape> {\n const type = unwrappedType(node);\n if (!isObjectValue(type) || (type as Node).type !== \"TSUnionType\") {\n return new Set();\n }\n\n const types = (type as Node).types;\n if (!Array.isArray(types)) return new Set();\n\n return new Set(types.flatMap((member) => {\n const shape = errorChannelShape(member);\n return shape ? [shape] : [];\n }));\n}\n\nfunction containsQualifiedTypeReference(\n node: unknown,\n leftName: string,\n rightName: string,\n seen = new WeakSet<object>(),\n): boolean {\n return findNode(node, (node) => isQualifiedTypeReference(node, leftName, rightName), seen) !== undefined;\n}\n\nfunction containsWrapGraphqlCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isIdentifierCall(child, \"wrapGraphqlCall\"), seen) !== undefined;\n}\n\nfunction isApplyResponseFlatMap(node: unknown, version: EffectVersion): boolean {\n return (\n (isEffectMemberCallNamed(node, \"flatMap\") || (version === 4 && isEffectMemberCallNamed(node, \"flatMapEager\"))) &&\n isIdentifier(firstArgument(node), \"applyResponse\")\n );\n}\n\nfunction containsApplyResponseFlatMap(node: unknown, version: EffectVersion, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isApplyResponseFlatMap(child, version), seen) !== undefined;\n}\n\nfunction findEffectCatchAll(node: unknown, version: EffectVersion, seen = new WeakSet<object>()): unknown | undefined {\n return findNode(node, child => isEffectMemberCall(child) && plainCatchOperators(version).has(((child.callee as Node).property as { name: string }).name), seen);\n}\n\nfunction getWrapGraphqlCatchAll(node: unknown, version: EffectVersion): unknown | undefined {\n const parts = pipeParts(node);\n if (parts.length === 0) {\n return undefined;\n }\n\n const catchAll = findEffectCatchAll(parts, version);\n if (!catchAll) {\n return undefined;\n }\n\n return containsWrapGraphqlCall(parts) || containsApplyResponseFlatMap(parts, version)\n ? catchAll\n : undefined;\n}\n\nconst atomOperationMethods = new Set([\"get\", \"set\", \"update\", \"modify\", \"refresh\"]);\n\nfunction callbackBody(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const callback = node as Node;\n if (callback.type !== \"ArrowFunctionExpression\" && callback.type !== \"FunctionExpression\") {\n return undefined;\n }\n\n return callback.body;\n}\n\nfunction isAtomOperationCall(node: unknown): node is Node & { arguments: unknown[] } {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n if (\n call.type !== \"CallExpression\" ||\n !Array.isArray(call.arguments) ||\n typeof call.callee !== \"object\" ||\n call.callee === null ||\n (call.callee as Node).type !== \"MemberExpression\" ||\n (call.callee as Node).computed === true\n ) {\n return false;\n }\n\n const callee = call.callee as Node;\n return (\n (isIdentifier(callee.object, \"Atom\") || isIdentifier(callee.object, \"atomRegistry\")) &&\n isIdentifier(callee.property) &&\n atomOperationMethods.has((callee.property as { name: string }).name)\n );\n}\n\nfunction findAtomOperationCall(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n return findNode(node, isAtomOperationCall, seen);\n}\n\nfunction findAtomOperationInsideEffectSync(node: unknown): unknown | undefined {\n if (!isEffectMemberCallNamed(node, \"sync\")) {\n return undefined;\n }\n\n const body = callbackBody(firstArgument(node));\n return body ? findAtomOperationCall(body) : undefined;\n}\n\nfunction isCollectionAtomIdentifier(node: unknown): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n\n return /(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(node.name);\n}\n\nfunction getCollectionAtomReadTarget(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const call = node as Node;\n if (call.type !== \"CallExpression\" || !Array.isArray(call.arguments)) {\n return undefined;\n }\n\n const isFamilyRead =\n isIdentifier(call.callee, \"get\") ||\n isMemberExpression(call.callee, \"Atom\", \"get\") ||\n isMemberExpression(call.callee, \"get\", \"get\");\n\n if (!isFamilyRead) {\n return undefined;\n }\n\n const [atom] = call.arguments;\n return isCollectionAtomIdentifier(atom) ? atom : undefined;\n}\n\nfunction findFamilyCollectionRead(node: unknown, seen = new WeakSet<object>()): unknown | undefined {\n return getCollectionAtomReadTarget(findNode(node, child => getCollectionAtomReadTarget(child) !== undefined, seen));\n}\n\nfunction isEffectProvideWithSingleArgument(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"provide\") && node.arguments.length === 1;\n}\n\nfunction findInlineRuntimeProvide(node: unknown): unknown | undefined {\n if (!isPipeCall(node)) {\n return undefined;\n }\n\n return pipeParts(node).find((part) => isEffectProvideWithSingleArgument(part));\n}\n\nfunction hasObjectSpread(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isObjectValue(child) && (child as Node).type === \"SpreadElement\", seen) !== undefined;\n}\n\nfunction isRefStateUpdateWithSpread(node: unknown): boolean {\n if (!isMemberCall(node, \"Ref\", \"update\") && !isMemberCall(node, \"Ref\", \"modify\")) {\n return false;\n }\n\n const callback = (node as Node & { arguments: unknown[] }).arguments[1];\n const body = callbackBody(callback);\n return hasObjectSpread(body);\n}\n\nfunction isEmptyObjectExpression(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"ObjectExpression\" &&\n Array.isArray((node as Node).properties) &&\n ((node as Node).properties as unknown[]).length === 0\n );\n}\n\nfunction containsObjectEntriesCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isMemberCall(child, \"Object\", \"entries\"), seen) !== undefined;\n}\n\nfunction isNakedObjectStateUpdate(node: unknown): boolean {\n if (isRefStateUpdateWithSpread(node)) {\n return true;\n }\n\n if (isMemberCall(node, \"Object\", \"assign\")) {\n const args = (node as Node & { arguments: unknown[] }).arguments;\n return args.length >= 3 && isEmptyObjectExpression(args[0]);\n }\n\n if (isMemberCall(node, \"Object\", \"fromEntries\")) {\n return containsObjectEntriesCall((node as Node & { arguments: unknown[] }).arguments[0]);\n }\n\n return isMemberCall(node, \"JSON\", \"stringify\") || isMemberCall(node, \"JSON\", \"parse\");\n}\n\nfunction isEffectSucceedVariableArgument(node: unknown): boolean {\n if (isIdentifier(node)) {\n return true;\n }\n\n return (\n isObjectValue(node) &&\n (node as Node).type === \"MemberExpression\"\n );\n}\n\nfunction isVariableAsAssertion(node: unknown, version: EffectVersion = 3): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return false;\n }\n\n return ((node as Node).declarations as unknown[] | undefined)?.some((declaration) => {\n if (!isObjectValue(declaration)) {\n return false;\n }\n\n const init = (declaration as Node).init;\n return (\n isObjectValue(init) &&\n (init as Node).type === \"TSAsExpression\" &&\n typeof (init as Node).typeAnnotation === \"object\" &&\n (init as Node).typeAnnotation !== null &&\n ((init as Node).typeAnnotation as Node).type !== \"TSConstKeyword\" &&\n !(version === 4 && ((init as Node).typeAnnotation as Node).type === \"TSTypeReference\" &&\n isIdentifier(((init as Node).typeAnnotation as Node).typeName, \"const\"))\n );\n }) ?? false;\n}\n\nfunction isTypeofBooleanCheck(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"BinaryExpression\") {\n return false;\n }\n\n const binary = node as Node;\n if (binary.operator !== \"===\") {\n return false;\n }\n\n const left = binary.left;\n const right = binary.right;\n return (\n isObjectValue(left) &&\n (left as Node).type === \"UnaryExpression\" &&\n (left as Node).operator === \"typeof\" &&\n isObjectValue(right) &&\n ((right as Node).type === \"Literal\" || (right as Node).type === \"StringLiteral\") &&\n (right as Node).value === \"boolean\"\n );\n}\n\nfunction isMatchOrElseNullCall(node: unknown): boolean {\n return isMatchBranchCall(node, \"orElse\") && isNullLiteral(arrowCallbackBody(node.arguments[0]));\n}\n\nfunction isStringLiteral(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n ((node as Node).type === \"Literal\" || (node as Node).type === \"StringLiteral\") &&\n typeof (node as Node).value === \"string\"\n );\n}\n\nfunction isUndefinedIdentifier(node: unknown): boolean {\n return isIdentifier(node, \"undefined\");\n}\n\nfunction isNullishRewrap(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"LogicalExpression\" &&\n (node as Node).operator === \"??\" &&\n (isNullLiteral((node as Node).right) || isUndefinedIdentifier((node as Node).right))\n );\n}\n\nfunction isOptionFromNullableNullishCoalesce(node: unknown, version: EffectVersion = 3): boolean {\n return (\n isMemberCall(node, \"Option\", version === 3 ? \"fromNullable\" : \"fromNullishOr\") &&\n isNullishRewrap((node as Node & { arguments: unknown[] }).arguments[0])\n );\n}\n\nfunction objectPropertyValue(node: unknown, keyName: string): unknown | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"ObjectExpression\") {\n return undefined;\n }\n\n for (const property of ((node as Node).properties as unknown[] | undefined) ?? []) {\n if (!isObjectValue(property)) {\n continue;\n }\n\n const key = (property as Node).key;\n if (isIdentifier(key, keyName)) {\n return (property as Node).value;\n }\n }\n\n return undefined;\n}\n\nfunction isBooleanTrueComparison(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"BinaryExpression\") {\n return false;\n }\n\n const binary = node as Node;\n return (\n binary.operator === \"===\" &&\n (isBooleanLiteral(binary.left, true) || isBooleanLiteral(binary.right, true))\n );\n}\n\nfunction isOptionBooleanNormalization(node: unknown): boolean {\n if (!isMemberCall(node, \"Option\", \"match\")) {\n return false;\n }\n\n const config = (node as Node & { arguments: unknown[] }).arguments[1];\n const onSome = objectPropertyValue(config, \"onSome\");\n const onNone = objectPropertyValue(config, \"onNone\");\n return (\n isBooleanTrueComparison(arrowCallbackBody(onSome)) &&\n isBooleanLiteral(arrowCallbackBody(onNone), false)\n );\n}\n\nfunction isStringSentinelConst(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"VariableDeclaration\") {\n return false;\n }\n\n return ((node as Node).declarations as unknown[] | undefined)?.some((declaration) => (\n isObjectValue(declaration) &&\n isStringLiteral((declaration as Node).init)\n )) ?? false;\n}\n\nfunction isBooleanLiteral(node: unknown, value: boolean): boolean {\n return (\n isObjectValue(node) &&\n ((node as Node).type === \"Literal\" || (node as Node).type === \"BooleanLiteral\") &&\n (node as Node).value === value\n );\n}\n\nfunction isEffectVoidMember(node: unknown): boolean {\n return isMemberExpression(node, \"Effect\", \"void\");\n}\n\nfunction isMatchBranchCall(node: unknown, propertyName?: \"when\" | \"orElse\"): node is Node & { arguments: unknown[] } {\n return isMemberCall(node, \"Match\", propertyName) && Array.isArray((node as Node).arguments);\n}\n\nfunction arrowCallbackBody(node: unknown): unknown | undefined {\n if (\n !isObjectValue(node) ||\n (node as Node).type !== \"ArrowFunctionExpression\"\n ) {\n return undefined;\n }\n\n return (node as Node).body;\n}\n\nfunction isVoidMatchBranch(node: unknown): boolean {\n if (!isMatchBranchCall(node)) {\n return false;\n }\n\n const [first, second] = node.arguments;\n if (isIdentifier((node.callee as Node).property, \"when\")) {\n return (\n (isBooleanLiteral(first, true) || isBooleanLiteral(first, false)) &&\n isEffectVoidMember(arrowCallbackBody(second))\n );\n }\n\n return (\n isIdentifier((node.callee as Node).property, \"orElse\") &&\n isEffectVoidMember(arrowCallbackBody(first))\n );\n}\n\nconst branchSequencingEffectCalls = [\"flatMap\", \"map\", \"andThen\", \"tap\", \"zipRight\"] as const;\n\nfunction isStreamMemberCall(node: unknown): boolean {\n return isMemberCall(node, \"Stream\");\n}\n\nfunction containsBranchSequencingCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => branchSequencingEffectCalls.some((propertyName) => isEffectMemberCallNamed(node, propertyName)) ||\n isPipeCall(node) ||\n isStreamMemberCall(node), seen) !== undefined;\n}\n\nfunction isSequencingBranchBody(node: unknown): boolean {\n return containsEffectMemberCall(node) && containsBranchSequencingCall(node);\n}\n\nfunction containsSequencingMatchBranch(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, child => isMatchBranchCall(child) && isSequencingBranchBody(isIdentifier((child.callee as Node).property, \"when\") ? arrowCallbackBody(child.arguments[1]) : arrowCallbackBody(child.arguments[0])), seen) !== undefined;\n}\n\nfunction containsMatchBranchCall(node: unknown, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isMatchBranchCall(node), seen) !== undefined;\n}\n\nfunction isOptionMatchCall(node: unknown): node is Node & { arguments: unknown[] } {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"CallExpression\" &&\n Array.isArray((node as Node).arguments) &&\n isMemberExpression((node as Node).callee, \"Option\", \"match\")\n );\n}\n\nfunction isExpressionBodiedArrowCall(node: unknown): boolean {\n const body = arrowCallbackBody(node);\n return (\n isObjectValue(body) &&\n (body as Node).type === \"CallExpression\"\n );\n}\n\nfunction findEffectGenCall(node: unknown): unknown | undefined {\n return findNode(node, (child) => isEffectMemberCallNamed(child, \"gen\"));\n}\n\nfunction isMatchValuePipeCall(node: unknown): boolean {\n if (!isPipeCall(node) || !isObjectValue(node)) {\n return false;\n }\n\n const call = node as Node;\n const callee = call.callee as Node;\n const object = callee.object;\n return (\n isObjectValue(object) &&\n (object as Node).type === \"CallExpression\" &&\n isMemberExpression((object as Node).callee, \"Match\", \"value\")\n );\n}\n\nfunction isObjectBranchCall(node: unknown, version: EffectVersion): boolean {\n return (\n isMatchValuePipeCall(node) ||\n (isObjectValue(node) &&\n (node as Node).type === \"CallExpression\" &&\n (isMemberExpression((node as Node).callee, \"Option\", \"match\") ||\n isMemberExpression((node as Node).callee, version === 3 ? \"Either\" : \"Result\", \"match\")))\n );\n}\n\nfunction containsObjectBranchCall(node: unknown, version: EffectVersion, seen = new WeakSet<object>()): boolean {\n return findNode(node, (node) => isObjectBranchCall(node, version), seen) !== undefined;\n}\n\nfunction objectPropertyValues(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const object = node as Node;\n if (object.type !== \"ObjectExpression\" || !Array.isArray(object.properties)) {\n return [];\n }\n\n return object.properties\n .map((property) => (\n isObjectValue(property) ? (property as Node).value : undefined\n ))\n .filter((value) => value !== undefined);\n}\n\nfunction isRawDomainIdAlias(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"TSTypeAliasDeclaration\") {\n return false;\n }\n\n const aliasName = (node as Node).id;\n const typeAnnotation = (node as Node).typeAnnotation as Node | undefined;\n return (\n isIdentifier(aliasName) &&\n /(?:Id|ID)$/.test(aliasName.name) &&\n (typeAnnotation?.type === \"TSStringKeyword\" || typeAnnotation?.type === \"TSNumberKeyword\")\n );\n}\n\nfunction isBooleanTypeAnnotation(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const annotation = node as Node;\n if (annotation.type === \"TSBooleanKeyword\") {\n return true;\n }\n\n return (\n annotation.type === \"TSTypeAnnotation\" &&\n typeof annotation.typeAnnotation === \"object\" &&\n annotation.typeAnnotation !== null &&\n (annotation.typeAnnotation as Node).type === \"TSBooleanKeyword\"\n );\n}\n\nfunction unwrapTypeAnnotation(node: unknown): Node | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const annotation = node as Node;\n if (\n annotation.type === \"TSTypeAnnotation\" &&\n typeof annotation.typeAnnotation === \"object\" &&\n annotation.typeAnnotation !== null\n ) {\n return annotation.typeAnnotation as Node;\n }\n\n return annotation;\n}\n\nfunction isStringOrNumberTypeAnnotation(node: unknown): boolean {\n const annotation = unwrapTypeAnnotation(node);\n return annotation?.type === \"TSStringKeyword\" || annotation?.type === \"TSNumberKeyword\";\n}\n\nfunction isAnyOrObjectTypeAnnotation(node: unknown): boolean {\n const annotation = unwrapTypeAnnotation(node);\n return annotation?.type === \"TSAnyKeyword\" || annotation?.type === \"TSObjectKeyword\";\n}\n\nfunction isDateTypeAnnotation(node: unknown): boolean {\n const annotation = unwrapTypeAnnotation(node);\n return (\n annotation?.type === \"TSTypeReference\" &&\n isIdentifier((annotation as Node).typeName, \"Date\")\n );\n}\n\nfunction primitiveDomainParameters(node: unknown): unknown[] {\n if (!isObjectValue(node) || !Array.isArray((node as Node).params)) {\n return [];\n }\n\n const domainNamePattern =\n /(?:id|amount|currency|account|user|order|customer|invoice|payment|price|total|quantity|transfer|fund|balance)/i;\n return ((node as Node).params as unknown[]).filter((param) => (\n isIdentifier(param) &&\n isStringOrNumberTypeAnnotation((param as Node).typeAnnotation) &&\n domainNamePattern.test(param.name)\n ));\n}\n\nfunction hasPrimitiveHeavyDomainParameters(node: unknown): boolean {\n return primitiveDomainParameters(node).length >= 3;\n}\n\nfunction isBooleanDomainFlagParameter(node: unknown): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n\n return (\n /^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(node.name) &&\n isBooleanTypeAnnotation((node as Node).typeAnnotation)\n );\n}\n\nfunction functionBooleanDomainFlagParameters(node: unknown): unknown[] {\n if (!isObjectValue(node) || !Array.isArray((node as Node).params)) {\n return [];\n }\n\n return ((node as Node).params as unknown[]).filter(isBooleanDomainFlagParameter);\n}\n\nfunction getPropertyName(node: unknown): string | undefined {\n if (isIdentifier(node)) {\n return node.name;\n }\n\n if (isObjectValue(node) && typeof (node as Node).value === \"string\") {\n return (node as Node).value as string;\n }\n\n return undefined;\n}\n\nfunction isRawTimeFieldName(name: string): boolean {\n return /(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(name);\n}\n\nfunction isRawTimeDomainField(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"TSPropertySignature\") {\n return false;\n }\n\n const property = node as Node;\n const propertyName = getPropertyName(property.key);\n const typeAnnotation = property.typeAnnotation;\n return (\n propertyName !== undefined &&\n isRawTimeFieldName(propertyName) &&\n (isStringOrNumberTypeAnnotation(typeAnnotation) || isDateTypeAnnotation(typeAnnotation))\n );\n}\n\nfunction typeMembers(node: unknown): unknown[] {\n if (!isObjectValue(node)) {\n return [];\n }\n\n const object = node as Node;\n if (\n object.type === \"TSInterfaceDeclaration\" &&\n typeof object.body === \"object\" &&\n object.body !== null &&\n Array.isArray((object.body as Node).body)\n ) {\n return (object.body as Node).body as unknown[];\n }\n\n if (object.type === \"TSTypeLiteral\" && Array.isArray(object.members)) {\n return object.members as unknown[];\n }\n\n return [];\n}\n\nfunction isErrorLikeTypeName(node: unknown): boolean {\n return isIdentifier(node) && /(?:Error|Failure|Fault)$/i.test(node.name);\n}\n\nfunction isTagOnlyTypeShape(node: unknown): boolean {\n const members = typeMembers(node);\n return members.length === 1 && getPropertyName((members[0] as Node).key) === \"_tag\";\n}\n\nfunction isEmptyTaggedErrorPayload(node: unknown): boolean {\n const superTypeArguments = isObjectValue(node)\n ? (node as Node).superTypeArguments\n : undefined;\n const superParameters = isObjectValue(superTypeArguments)\n ? ((superTypeArguments as Node).params ?? (superTypeArguments as Node).arguments)\n : undefined;\n const parameters = Array.isArray(superParameters) ? superParameters : typeArguments(node);\n if (parameters.length === 0) {\n return true;\n }\n\n const payload = parameters[0];\n return (\n isObjectValue(payload) &&\n ((payload as Node).type === \"TSObjectKeyword\" ||\n ((payload as Node).type === \"TSTypeLiteral\" && typeMembers(payload).length === 0))\n );\n}\n\nfunction emptyErrorTagNode(node: unknown): unknown | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const declaration = node as Node;\n if (\n (declaration.type === \"TSTypeAliasDeclaration\" || declaration.type === \"TSInterfaceDeclaration\") &&\n isErrorLikeTypeName(declaration.id) &&\n isTagOnlyTypeShape(\n declaration.type === \"TSTypeAliasDeclaration\" ? declaration.typeAnnotation : declaration,\n )\n ) {\n return node;\n }\n\n if (\n declaration.type === \"ClassDeclaration\" &&\n isMemberCall(declaration.superClass, \"Data\", \"TaggedError\") &&\n isEmptyTaggedErrorPayload(declaration)\n ) {\n return node;\n }\n\n return undefined;\n}\n\nfunction rawTimeDomainFields(node: unknown): unknown[] {\n return typeMembers(node).filter(isRawTimeDomainField);\n}\n\nfunction isOverloadedOptionsParameter(node: unknown): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n\n return (\n /^(?:opts|options|config)$/i.test(node.name) &&\n isAnyOrObjectTypeAnnotation((node as Node).typeAnnotation)\n );\n}\n\nfunction overloadedOptionsParameters(node: unknown): unknown[] {\n if (!isObjectValue(node) || !Array.isArray((node as Node).params)) {\n return [];\n }\n\n return ((node as Node).params as unknown[]).filter(isOverloadedOptionsParameter);\n}\n\nconst comparisonOperators = new Set([\"==\", \"===\", \"!=\", \"!==\", \">\", \">=\", \"<\", \"<=\"]);\n\nfunction comparisonCount(node: unknown, seen = new WeakSet<object>()): number {\n if (Array.isArray(node)) {\n return node.reduce((count, child) => count + comparisonCount(child, seen), 0);\n }\n\n if (!isObjectValue(node)) {\n return 0;\n }\n\n if (seen.has(node)) {\n return 0;\n }\n seen.add(node);\n\n const expression = node as Node;\n if (expression.type === \"BinaryExpression\" && comparisonOperators.has(String(expression.operator))) {\n return 1;\n }\n\n if (expression.type !== \"LogicalExpression\") {\n return 0;\n }\n\n return comparisonCount(expression.left, seen) + comparisonCount(expression.right, seen);\n}\n\nfunction isDomainLogicConditional(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"LogicalExpression\" &&\n comparisonCount(node) >= 3\n );\n}\n\nfunction stateFlagMember(node: unknown): { objectName: string; propertyName: string } | undefined {\n if (!isObjectValue(node) || (node as Node).type !== \"MemberExpression\") {\n return undefined;\n }\n\n const member = node as Node;\n if (member.computed === true || !isIdentifier(member.object) || !isIdentifier(member.property)) {\n return undefined;\n }\n\n const propertyName = member.property.name;\n if (!/(?:cancelled|canceled|shipped|approved|rejected|pending|active|inactive|enabled|disabled|locked|archived|deleted|submitted|processing|failed|complete|completed)$/i.test(propertyName)) {\n return undefined;\n }\n\n return {\n objectName: member.object.name,\n propertyName,\n };\n}\n\nfunction collectStateFlagMembers(\n node: unknown,\n members = new Map<string, Set<string>>(),\n seen = new WeakSet<object>(),\n): Map<string, Set<string>> {\n const member = stateFlagMember(node);\n if (member) {\n const properties = members.get(member.objectName) ?? new Set<string>();\n properties.add(member.propertyName);\n members.set(member.objectName, properties);\n return members;\n }\n\n if (Array.isArray(node)) {\n for (const child of node) {\n collectStateFlagMembers(child, members, seen);\n }\n return members;\n }\n\n if (!isObjectValue(node)) {\n return members;\n }\n\n if (seen.has(node)) {\n return members;\n }\n seen.add(node);\n\n const expression = node as Node;\n if (expression.type !== \"LogicalExpression\") {\n return members;\n }\n\n collectStateFlagMembers(expression.left, members, seen);\n collectStateFlagMembers(expression.right, members, seen);\n return members;\n}\n\nfunction isImplicitStateMachineObject(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"LogicalExpression\") {\n return false;\n }\n\n return Array.from(collectStateFlagMembers(node).values()).some((properties) => properties.size >= 2);\n}\n\nfunction isAdhocEffectFail(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"fail\") && isStringLiteral(firstArgument(node));\n}\n\nfunction isErrorLikeIdentifier(node: unknown): boolean {\n return isIdentifier(node) && /(?:error|err|cause|failure|reason)/i.test(node.name);\n}\n\nfunction isErrorMessageReference(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"MemberExpression\") {\n return false;\n }\n\n const member = node as Node;\n return (\n member.computed !== true &&\n isIdentifier(member.property, \"message\") &&\n isErrorLikeIdentifier(member.object)\n );\n}\n\nfunction isStringifiedErrorMessage(node: unknown): boolean {\n if (isErrorMessageReference(node)) return true;\n if (!isObjectValue(node)) return false;\n\n const expression = node as Node;\n if (expression.type === \"BinaryExpression\" && expression.operator === \"+\") {\n return isStringifiedErrorMessage(expression.left) || isStringifiedErrorMessage(expression.right);\n }\n\n return expression.type === \"TemplateLiteral\" && Array.isArray(expression.expressions) && (\n expression.expressions as unknown[]\n ).some((child) => isStringifiedErrorMessage(child));\n}\n\nfunction isEffectFailFromErrorMessage(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"fail\") && isStringifiedErrorMessage(firstArgument(node));\n}\n\nfunction isGenericErrorConstruction(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"NewExpression\" &&\n isIdentifier((node as Node).callee, \"Error\")\n );\n}\n\nfunction isEffectFailWithGenericError(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"fail\") && isGenericErrorConstruction(firstArgument(node));\n}\n\nfunction errorHandlerCallbacks(node: unknown, operators: ReadonlySet<string>): unknown[] {\n if (!isEffectMemberCall(node)) return [];\n\n const property = ((node as Node).callee as Node).property;\n if (!isIdentifier(property) || !operators.has(property.name)) return [];\n\n return (node as Node & { arguments: unknown[] }).arguments.filter(isFunctionLike);\n}\n\nfunction plainCatchOperators(version: EffectVersion): ReadonlySet<string> {\n return version === 3 ? catchAllOperators : catchOperators;\n}\n\nfunction handlerReturnStatements(node: unknown, seen = new WeakSet<object>()): unknown[] {\n if (Array.isArray(node)) return node.flatMap((child) => handlerReturnStatements(child, seen));\n if (!isObjectValue(node) || seen.has(node) || isFunctionLike(node)) return [];\n seen.add(node);\n if ((node as Node).type === \"ReturnStatement\") return [node];\n return Object.entries(node).flatMap(([key, child]) => key === \"parent\" ? [] : handlerReturnStatements(child, seen));\n}\n\nfunction catchAllGenericRethrow(node: unknown, version: EffectVersion): unknown | undefined {\n for (const callback of errorHandlerCallbacks(node, plainCatchOperators(version))) {\n const body = callbackBody(callback);\n if (isEffectFailWithGenericError(body)) return body;\n\n for (const returnNode of handlerReturnStatements(body)) {\n if (isEffectFailWithGenericError((returnNode as Node).argument)) {\n return (returnNode as Node).argument;\n }\n }\n }\n\n return undefined;\n}\n\nconst modeledErrorOperators = new Set([\n \"catchSome\",\n \"catchTag\",\n \"catchTags\",\n \"fail\",\n \"mapBoth\",\n \"mapError\",\n]);\n\nfunction isModeledErrorOperation(node: unknown): boolean {\n if (!isEffectMemberCall(node)) return false;\n\n const property = ((node as Node).callee as Node).property;\n return isIdentifier(property) && modeledErrorOperators.has(property.name);\n}\n\nconst legacyLogOnlyOperators = new Set([\"catchAll\", \"tapError\"]);\n\nfunction logOnlyErrorHandler(node: unknown, version: EffectVersion): unknown | undefined {\n const callbacks = version === 3\n ? errorHandlerCallbacks(node, legacyLogOnlyOperators)\n : effectLogicCallbacks(node, version).filter(() =>\n /^catch/.test(String((((node as Node).callee as Node).property as Node).name)));\n for (const callback of callbacks) {\n const body = callbackBody(callback);\n const search = version === 3 ? findNode : findOwnCallbackNode;\n const log = search(body, isEffectLogCall);\n if (!log) continue;\n\n const modeled = search(body, (child) => isModeledErrorOperation(child) ||\n (version === 4 && (isEffectMemberCallNamed(child, \"failCause\") || isEffectMemberCallNamed(child, \"die\"))));\n if (!modeled) return log;\n }\n\n return undefined;\n}\n\nconst catchAllOperators = new Set([\"catchAll\"]);\nconst catchOperators = new Set([\"catch\", \"catchEager\"]);\nconst expectedDomainStateNames = new Set([\"NotFound\", \"Missing\", \"Empty\", \"None\"]);\n\nfunction isFallbackRecoveryValue(node: unknown): boolean {\n return (\n isNullLiteral(node) ||\n isUndefinedIdentifier(node) ||\n (isIdentifier(node) && /(?:fallback|default)/i.test(node.name))\n );\n}\n\nfunction isFallbackRecoveryEffect(node: unknown): boolean {\n return isEffectMemberCallNamed(node, \"succeed\") && isFallbackRecoveryValue(firstArgument(node));\n}\n\nfunction earlyCatchAllFallback(node: unknown, version: EffectVersion): unknown | undefined {\n for (const callback of errorHandlerCallbacks(node, plainCatchOperators(version))) {\n const body = callbackBody(callback);\n if (isFallbackRecoveryEffect(body)) return body;\n\n for (const returnNode of handlerReturnStatements(body)) {\n if (isFallbackRecoveryEffect((returnNode as Node).argument)) {\n return (returnNode as Node).argument;\n }\n }\n }\n\n return undefined;\n}\n\nfunction isExpectedDomainStateFailure(node: unknown): boolean {\n if (!isEffectMemberCallNamed(node, \"fail\")) return false;\n\n const argument = firstArgument(node);\n return isStringLiteral(argument) && expectedDomainStateNames.has(String((argument as Node).value));\n}\n\nfunction isDomainErrorConstruction(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"NewExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n return isIdentifier(callee) && /(?:Error|Exception)$/.test(callee.name);\n}\n\nfunction isDomainExceptionThrow(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"ThrowStatement\") {\n return false;\n }\n\n return isDomainErrorConstruction((node as Node).argument);\n}\n\nfunction findDomainExceptionInEffectLogic(node: unknown, version: EffectVersion): unknown | undefined {\n return findEffectLogicNode(node, version, isDomainExceptionThrow);\n}\n\nfunction isThrowNewStringError(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"ThrowStatement\") {\n return false;\n }\n\n const argument = (node as Node).argument;\n return (\n isObjectValue(argument) &&\n (argument as Node).type === \"NewExpression\" &&\n isIdentifier((argument as Node).callee, \"Error\") &&\n Array.isArray((argument as Node).arguments) &&\n isStringLiteral(((argument as Node).arguments as unknown[])[0])\n );\n}\n\nfunction hasRawDomainIdParameter(node: unknown): boolean {\n if (!isObjectValue(node) || !Array.isArray((node as Node).params)) {\n return false;\n }\n\n return ((node as Node).params as unknown[]).some((param) => (\n isIdentifier(param) &&\n /(?:^id$|Id$|ID$)/.test(param.name) &&\n isStringOrNumberTypeAnnotation((param as Node).typeAnnotation)\n ));\n}\n\nfunction isContextEncodedDomainFunction(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"FunctionDeclaration\") {\n return false;\n }\n\n const id = (node as Node).id;\n return (\n isIdentifier(id) &&\n /(?:Admin|Public|Internal|External|Private|Backoffice|Panel)/.test(id.name) &&\n hasRawDomainIdParameter(node)\n );\n}\n\nfunction isStringLiteralComparison(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"BinaryExpression\") {\n return false;\n }\n\n const binary = node as Node;\n return (\n [\"==\", \"===\", \"!=\", \"!==\"].includes(String(binary.operator)) &&\n (isStringLiteral(binary.left) || isStringLiteral(binary.right)) &&\n !isTypeofBooleanCheck(binary)\n );\n}\n\nfunction report(context: OxlintContext, node: unknown, message: string) {\n context.report({ message, node: node as ESTree.Node });\n}\n\nfunction isNullLiteral(node: unknown): boolean {\n if (!isObjectValue(node)) {\n return false;\n }\n\n const literal = node as Node;\n return (\n literal.type === \"NullLiteral\" ||\n (literal.type === \"Literal\" && literal.value === null)\n );\n}\n\nfunction getImportSource(node: unknown): string | undefined {\n if (!isObjectValue(node)) {\n return undefined;\n }\n\n const source = (node as Node).source;\n if (typeof source === \"string\") {\n return source;\n }\n\n if (isObjectValue(source)) {\n const value = (source as Node).value;\n if (typeof value === \"string\") {\n return value;\n }\n }\n\n return undefined;\n}\n\nconst defaultBoundaryPaths = [\n \"bin/**\", \"scripts/**\", \"cli/**\", \"**/main.ts\",\n \"app/api/**/route.ts\", \"server/**\", \"*.test.ts\", \"*.spec.ts\",\n] as const;\n\nconst defaultTestPaths = [\"**/*.test.*\", \"**/*.spec.*\", \"**/__tests__/**\"] as const;\n\nconst defaultConfigPaths = [\"**/config/**\", \"**/*Config.ts\", \"**/*ConfigLayer.ts\"] as const;\n\nconst boundaryPathOptionsSchema = [{\n type: \"object\",\n properties: {\n boundaryPaths: { type: \"array\", items: { type: \"string\" } },\n },\n additionalProperties: false,\n}] as const;\n\nconst processEnvPathOptionsSchema = [{\n type: \"object\",\n properties: {\n boundaryPaths: { type: \"array\", items: { type: \"string\" } },\n configPaths: { type: \"array\", items: { type: \"string\" } },\n },\n additionalProperties: false,\n}] as const;\n\nfunction rulePathOptions(context: OxlintContext): Record<string, unknown> {\n const firstOption = context.options[0];\n return isObjectValue(firstOption)\n ? firstOption as Record<string, unknown>\n : {};\n}\n\nfunction stringArrayOption(options: Record<string, unknown>, name: string): readonly string[] | undefined {\n const value = options[name];\n return Array.isArray(value) && value.every((item) => typeof item === \"string\")\n ? value\n : undefined;\n}\n\nfunction normalisePath(path: string): string {\n return path.replace(/\\\\/g, \"/\").replace(/^\\.\\/+/, \"\").replace(/\\/{2,}/g, \"/\").replace(/\\/$/, \"\");\n}\n\nfunction globSegmentToRegExp(segment: string): string {\n return segment.replace(/[|\\\\{}()[\\]^$+?.]/g, \"\\\\$&\").replace(/\\*/g, \"[^/]*\");\n}\n\nfunction globToRegExp(pattern: string): RegExp {\n const normalisedPattern = normalisePath(pattern);\n if (normalisedPattern === \"**\") {\n return /^.*$/;\n }\n\n const segments = normalisedPattern.split(\"/\");\n const startsWithGlobstar = segments[0] === \"**\";\n const firstSegment = startsWithGlobstar ? 1 : 0;\n let expression = startsWithGlobstar ? \"^(?:.*/)?\" : \"(?:^|.*/)\";\n\n for (let index = firstSegment; index < segments.length; index += 1) {\n const segment = segments[index];\n const isLastSegment = index === segments.length - 1;\n\n if (segment === \"**\") {\n expression += isLastSegment ? \"(?:/.*)?\" : \"(?:/[^/]+)*\";\n continue;\n }\n\n if (index > firstSegment) {\n expression += \"/\";\n }\n expression += globSegmentToRegExp(segment);\n }\n\n return new RegExp(`${expression}$`);\n}\n\nfunction pathMatchesPattern(filename: string, pattern: string): boolean {\n return globToRegExp(pattern).test(normalisePath(filename));\n}\n\nfunction boundaryPathsFor(context: OxlintContext): readonly string[] {\n return stringArrayOption(rulePathOptions(context), \"boundaryPaths\") ?? defaultBoundaryPaths;\n}\n\nfunction isBoundaryPath(context: OxlintContext): boolean {\n return boundaryPathsFor(context).some((pattern) => pathMatchesPattern(context.filename, pattern));\n}\n\nfunction isTestPath(context: OxlintContext): boolean {\n return defaultTestPaths.some((pattern) => pathMatchesPattern(context.filename, pattern));\n}\n\nfunction configPathsFor(context: OxlintContext): readonly string[] {\n return stringArrayOption(rulePathOptions(context), \"configPaths\") ?? defaultConfigPaths;\n}\n\nfunction isConfigPath(context: OxlintContext): boolean {\n return configPathsFor(context).some((pattern) => pathMatchesPattern(context.filename, pattern));\n}\n\nfunction isEffectEcosystemImport(source: string): boolean {\n return (\n source === \"effect\" ||\n source.startsWith(\"effect/\") ||\n source === \"@effect-atom/atom-react\"\n );\n}\n\nfunction directTestCallback(node: unknown): Node | undefined {\n if (\n !isIdentifierCall(node, \"it\") &&\n !isIdentifierCall(node, \"test\") &&\n !isIdentifierCall(node, \"specify\") &&\n !isIdentifierCall(node, \"bench\")\n ) {\n return undefined;\n }\n\n const arguments_ = (node as Node & { arguments?: unknown[] }).arguments;\n const callback = arguments_?.at(-1);\n return isFunctionLike(callback) ? callback as Node : undefined;\n}\n\nfunction isPromiseRunExecution(node: unknown, version: EffectVersion): boolean {\n return isEffectMemberCallNamed(node, \"runPromise\") || (version === 4 &&\n isObjectValue(node) &&\n isEffectMemberCallNamed((node as Node).callee, \"runPromiseWith\") &&\n effectRunExecution(node, version)?.program !== undefined);\n}\n\nfunction discardedRunPromiseInTestCallback(callback: Node, version: EffectVersion = 3): Node | undefined {\n const body = callback.body;\n if (isPromiseRunExecution(body, version)) {\n return undefined;\n }\n\n if (\n !isObjectValue(body) ||\n (body as Node).type !== \"BlockStatement\" ||\n !Array.isArray((body as Node).body)\n ) {\n return undefined;\n }\n\n for (const statement of (body as Node & { body: unknown[] }).body) {\n if (\n isObjectValue(statement) &&\n (statement as Node).type === \"ExpressionStatement\" &&\n isPromiseRunExecution((statement as Node).expression, version)\n ) {\n return (statement as Node).expression as Node;\n }\n }\n\n return undefined;\n}\n\nfunction nodesInDirectTestCallback(\n callback: Node,\n predicate: (node: Node) => boolean,\n): Node[] {\n const matches: Node[] = [];\n const seen = new WeakSet<object>();\n\n function visit(node: unknown, isRoot = false): void {\n if (Array.isArray(node)) {\n for (const child of node) {\n visit(child);\n }\n return;\n }\n\n if (!isObjectValue(node) || seen.has(node)) {\n return;\n }\n seen.add(node);\n\n const candidate = node as Node;\n if (!isRoot && isFunctionLike(candidate)) {\n return;\n }\n if (predicate(candidate)) {\n matches.push(candidate);\n }\n\n for (const [key, child] of Object.entries(candidate)) {\n if (key !== \"parent\") {\n visit(child);\n }\n }\n }\n\n visit(callback, true);\n return matches;\n}\n\nfunction isEffectRunPromiseRejectsMember(node: unknown, version: EffectVersion = 3): node is Node {\n if (\n !isObjectValue(node) ||\n (node as Node).type !== \"MemberExpression\" ||\n (node as Node).computed === true ||\n !isIdentifier((node as Node).property, \"rejects\")\n ) {\n return false;\n }\n\n const expectation = (node as Node).object;\n if (!isIdentifierCall(expectation, \"expect\")) {\n return false;\n }\n\n const arguments_ = (expectation as Node).arguments;\n if (!Array.isArray(arguments_)) {\n return false;\n }\n\n const argument = arguments_[0];\n return isPromiseRunExecution(argument, version);\n}\n\nfunction isServiceDefaultReference(node: unknown): boolean {\n return (\n isObjectValue(node) &&\n (node as Node).type === \"MemberExpression\" &&\n (node as Node).computed !== true &&\n isIdentifier((node as Node).property, \"Default\")\n );\n}\n\nfunction isManualTestLayer(node: unknown): boolean {\n return isMemberCall(node, \"Layer\", \"succeed\") || isMemberCall(node, \"Layer\", \"effect\");\n}\n\nfunction manualLayersNextToServiceDefault(node: unknown): Node[] {\n if (!isMemberCall(node, \"Layer\", \"provide\")) {\n return [];\n }\n\n const arguments_ = (node as Node).arguments;\n if (!Array.isArray(arguments_) || !arguments_.some(isServiceDefaultReference)) {\n return [];\n }\n\n return arguments_.filter(isManualTestLayer) as Node[];\n}\n\nfunction importsEffectSchema(node: unknown): boolean {\n const source = getImportSource(node);\n if (source === \"effect/Schema\") {\n return true;\n }\n\n if (source !== \"effect\" || !isObjectValue(node)) {\n return false;\n }\n\n const specifiers = (node as Node).specifiers;\n return Array.isArray(specifiers) && specifiers.some((specifier) => {\n if (!isObjectValue(specifier)) {\n return false;\n }\n\n const item = specifier as Node;\n return item.type === \"ImportSpecifier\" && isIdentifier(item.imported, \"Schema\");\n });\n}\n\nfunction createEffectGatedStatementRule(\n visitorName: \"IfStatement\" | \"SwitchStatement\" | \"ConditionalExpression\",\n message: string | ((version: EffectVersion) => string),\n) {\n return defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n [visitorName](node: any) {\n if (hasEffectEcosystemImport) {\n report(context, node, typeof message === \"string\" ? message : message(effectVersionFor(context.options)));\n }\n },\n };\n },\n });\n}\n\nconst reactStateHooks = new Set([\n \"useState\",\n \"useReducer\",\n \"useContext\",\n \"useCallback\",\n \"useEffect\",\n \"useSyncExternalStore\",\n]);\n\nconst noReactState = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n CallExpression(node: any) {\n const callee = node.callee;\n const hookName = isIdentifier(callee)\n ? callee.name\n : isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n isIdentifier((callee as Node).property)\n ? ((callee as Node).property as { name: string }).name\n : undefined;\n\n if (hookName && reactStateHooks.has(hookName)) {\n report(\n context,\n callee,\n version === 3\n ? \"Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.\"\n : \"Rule: avoid React state hooks. Why: they bypass externally owned reactive state. Fix: pass explicit state as props or use a compatible reactive adapter at the UI boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noIfStatement = createEffectGatedStatementRule(\n \"IfStatement\",\n \"Rule: avoid imperative if branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type or Effect combinators instead.\",\n);\n\nconst noSwitchStatement = createEffectGatedStatementRule(\n \"SwitchStatement\",\n \"Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead.\",\n);\n\nconst noTernary = createEffectGatedStatementRule(\n \"ConditionalExpression\",\n (version) => `Rule: avoid ternary expressions. Why: they hide control flow inside expressions. Fix: use Option.match/${version === 3 ? \"Either\" : \"Result\"}.match/Match.value or data combinators, then run one Effect pipeline.`,\n);\n\nconst noReturnNull = createVersionedEffectCallbackRule(\n (node: any) => isNullLiteral(node.argument) ? node : undefined,\n () => \"Rule: avoid returning null. Why: null is a sentinel that forces defensive guards. Fix: use Option.none for absence or Effect.fail for errors.\",\n false,\n false,\n [\"ReturnStatement\"],\n);\n\nconst noOptionAs = createVersionedEffectCallbackRule(\n (node: any) => isMemberExpression(node.callee, \"Option\", \"as\") ? node : undefined,\n () => \"Rule: avoid Option.as. Why: it hides selection and encourages placeholder flows. Fix: use Option.map or Option.match and return the value explicitly.\",\n);\n\nconst noEffectNever = createVersionedEffectCallbackRule(\n (node) => isMemberExpression(node, \"Effect\", \"never\") ? node : undefined,\n () => \"Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.\",\n false,\n false,\n [\"MemberExpression\"],\n);\n\nconst noArrowLadder = createVersionedEffectCallbackRule(\n (node) => isArrowIifeCall(node) ? findArrowIifeCall(node.callee.body) : undefined,\n (version) => \"Rule: avoid nested IIFEs. Why: they hide sequencing and push wrapper hacks. Fix: bind a named context with const and keep one flat pipeline with a single Match/Option decision.\",\n);\n\nconst noBranchInObject = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n ObjectExpression(node: any) {\n if (objectPropertyValues(node).some((value) => containsObjectBranchCall(value, version))) {\n report(\n context,\n node,\n `Rule: avoid Match/Option/${version === 3 ? \"Either\" : \"Result\"} inside object literals. Why: it hides the decision and invites workaround scaffolding. Fix: compute the value first (context), then build the object from named values with one flat decision.`,\n );\n }\n },\n };\n },\n});\n\nconst noIifeWrapper = createVersionedEffectCallbackRule(\n (node) => isInlineFunctionIifeCall(node) ? node : undefined,\n () => \"Rule: avoid immediate invocation of inline functions. Why: it hides decisions and sequencing. Fix: bind a named context with const and keep one Match/Option decision in a flat pipeline.\",\n);\n\nconst noReturnInArrow = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n CallExpression(node: any) {\n for (const returnNode of directArrowCallbackReturns(node, version)) {\n report(\n context,\n returnNode,\n \"Rule: avoid block-bodied arrow callbacks with returns. Why: they hide local control flow. Fix: use expression-only callbacks and move the logic into a single pipeline (pipe/Match/Option/A.map).\",\n );\n }\n },\n };\n },\n});\n\nconst noReturnInCallback = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n for (const returnNode of directFunctionCallbackReturns(node)) {\n report(\n context,\n returnNode,\n \"Rule: avoid returns inside inline callbacks. Why: they hide control flow. Prefer expression-only callbacks, but leaf-level Effect branches with local bindings may use returns when needed.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectFnGenerator = createVersionedEffectCallbackRule(\n (node, version) => isEffectGeneratorCall(node, \"fn\", version) ? node : undefined,\n () => \"Rule: avoid Effect.fn generator wrappers under this opt-in style policy. Fix: disable this rule for traced operations, or use Effect.gen.\",\n);\n\nconst noEffectSyncConsole = createVersionedEffectCallbackRule(\n (node) => isEffectMemberCallNamed(node, \"sync\") && containsConsoleCall(firstArgument(node)) ? node : undefined,\n () => \"Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call.\",\n);\n\nfunction createCollectedEffectRule(\n find: (node: unknown, version: EffectVersion) => unknown[],\n message: string,\n visitorNames: string[],\n) {\n return defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let imported = false;\n const candidates: object[] = [];\n const seen = new WeakSet<object>();\n const collect = (node: unknown) => {\n for (const target of find(node, version)) {\n if (!isObjectValue(target) || seen.has(target)) continue;\n seen.add(target);\n candidates.push(target);\n }\n };\n return {\n ImportDeclaration(node: unknown) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) imported = true;\n },\n ...Object.fromEntries(visitorNames.map(name => [name, collect])),\n \"Program:exit\"() {\n if (imported) for (const target of candidates) report(context, target, message);\n },\n };\n },\n });\n}\n\nconst observabilityVisitors = [\"CallExpression\", \"ClassDeclaration\", \"ClassExpression\"];\nconst noConsoleInEffectFlow = createCollectedEffectRule(\n consoleCallsInEffectFlow,\n \"Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.\",\n observabilityVisitors,\n);\n\nconst noEffectLogWithoutStructuredContext = createCollectedEffectRule(\n (node, version) => {\n const options = serviceConstructionOptions(node, version);\n const implementation = options && serviceConstructionImplementation(options, version);\n return [...errorHandlerBodies(node, version), ...(implementation ? [implementation] : [])].flatMap(contextlessErrorLogs);\n },\n \"Rule: add structured context to Effect.logError or Effect.logWarning. Why: static failure messages cannot be correlated. Fix: include an error or context object, or use Effect.annotateLogs(...).\",\n observabilityVisitors,\n);\n\nconst requireSpanOnPublicServiceMethod = createCollectedEffectRule(\n (node, version) => {\n const options = serviceConstructionOptions(node, version);\n return [\n ...exportedFunctionValues(node).map(operation => publicEffectOperationWithoutSpan(operation.functionNode, operation.declaredReturnType)),\n ...(options ? serviceMethodFunctions(options, version).map(serviceEffectOperationWithoutSpan) : []),\n ].filter(candidate => candidate !== undefined);\n },\n \"Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).\",\n [...observabilityVisitors, \"ExportNamedDeclaration\", \"ExportDefaultDeclaration\"],\n);\n\nconst noRunpromiseInNonAsyncTestBody = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n const candidates: Node[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (!isTestPath(context)) {\n return;\n }\n\n const callback = directTestCallback(node);\n const candidate = callback && discardedRunPromiseInTestCallback(callback, version);\n if (candidate) {\n candidates.push(candidate);\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const candidate of candidates) {\n report(\n context,\n candidate,\n \"Rule: do not discard Effect.runPromise in a test body. Why: the test can finish before the Effect result is observed. Fix: await or return Effect.runPromise so the test framework observes completion.\",\n );\n }\n },\n };\n },\n});\n\nconst requireEffectFlipForErrorTest = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n const candidates: Node[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (!isTestPath(context)) {\n return;\n }\n\n const callback = directTestCallback(node);\n if (callback) {\n candidates.push(...nodesInDirectTestCallback(callback, candidate => isEffectRunPromiseRejectsMember(candidate, version)));\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const candidate of candidates) {\n report(\n context,\n candidate,\n \"Rule: prefer Effect.flip for expected typed Effect failures in tests. Why: it turns the expected failure into a successful error value for structural assertions. Fix: flip the Effect, then assert the error _tag, message, and fields.\",\n );\n }\n },\n };\n },\n});\n\nconst noTestMockLayerWhenDefaultAvailable = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const candidates: Node[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (isTestPath(context)) {\n candidates.push(...manualLayersNextToServiceDefault(node));\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const candidate of candidates) {\n report(\n context,\n candidate,\n \"Rule: avoid a manual test layer beside an explicit service Default layer. Why: the test is already opting into the service's real default composition and the sibling mock can hide that contract. Fix: use the Default layer with its required infrastructure, or remove Default when a replacement is intentional.\",\n );\n }\n },\n };\n },\n});\n\nconst noNestedEffectGen = createVersionedEffectCallbackRule(\n (node, version) => { const generator = getEffectGeneratorArgument(node, \"gen\", version); return generator ? version === 3 ? findEffectGenCall(generator.body) : findOwnCallbackNode(generator.body, (child) => isEffectMemberCallNamed(child, \"gen\")) : undefined; },\n (version) => \"Rule: avoid nested Effect.gen. Why: nested generators hide sequencing. Fix: flatten to a single Effect.gen per method or a single flat pipeline.\",\n);\n\nconst noYieldWithoutStarInEffectGen = createVersionedEffectCallbackRule(\n findYieldWithoutStarInEffectGen,\n (version) => version === 3\n ? \"Rule: use yield* inside Effect.gen. Why: plain yield returns an Effect value without delegating to the Effect interpreter. Fix: replace `yield Effect.x` with `yield* Effect.x`.\"\n : \"Rule: use yield* inside Effect.gen. Why: delegation preserves the yielded Effect's result typing and keeps workflow style consistent. Fix: replace `yield Effect.x` with `yield* Effect.x`.\",\n);\n\nconst noPipedYieldInGen = createVersionedEffectCallbackRule(\n repeatedPipedYieldInEffectGen,\n (version) => \"Rule: avoid repeated piped yields inside Effect.gen. Why: decorated effects hidden inside generator steps obscure the workflow. Fix: extract decorated effects first, then yield the named workflow steps.\",\n);\n\nconst noGenForMapping = createVersionedEffectCallbackRule(\n genForMappingNode,\n (version) => \"Rule: avoid Effect.gen for simple mapping. Why: tiny generators hide pure transformations behind workflow syntax. Fix: map the yielded effect with Effect.map or a named pure transformation.\",\n);\n\nconst preferGenForWorkflow = createVersionedEffectCallbackRule(\n workflowSequencingPipeline,\n (version) => \"Rule: prefer Effect.gen for workflow sequencing. Why: long flatMap/andThen/tap pipelines read like imperative workflow. Fix: move the sequential story into one Effect.gen and keep pipe for behavior decoration.\",\n);\n\nconst noLargeAnonymousFlow = createVersionedEffectCallbackRule(\n (node) => isLargeFlowCall(node) ? node : undefined,\n (version) => \"Rule: avoid large anonymous flow expressions. Why: long pure transformation chains need a domain name. Fix: extract a named flow or split the transformation into named pure steps.\",\n);\n\nconst noEffectInFlow = createVersionedEffectCallbackRule(\n effectfulFlowArgument,\n (version) => \"Rule: avoid Effect work inside flow. Why: flow should stay a reusable pure transformation boundary. Fix: keep Effect sequencing, logging, retries, and dependency access in Effect pipelines.\",\n);\n\nconst preferNamedFlow = createVersionedEffectCallbackRule(\n inlineNonTrivialFlowArgument,\n (version) => \"Rule: prefer named flow transformations. Why: non-trivial pure transformations passed inline are hard to reuse and review. Fix: extract the flow to a named const.\",\n);\n\nconst preferFlowForPurePipeline = createVersionedEffectCallbackRule(\n preferFlowForPurePipelineNode,\n (version) => \"Rule: prefer flow for a deep pure call pipeline. Why: nested transformation towers hide the data pipeline and make reuse difficult. Fix: name the pure steps and compose them with flow, or keep the pipeline short.\",\n);\n\nconst noBusinessLogicInPipe = createVersionedEffectCallbackRule(\n businessLogicInPipeCallback,\n (version) => \"Rule: keep business workflow logic out of Effect.pipe callbacks. Why: branching, service lookup, and multi-step effects are hard to read as decoration. Fix: move the workflow into Effect.gen and reserve pipe for behavior around the completed effect.\",\n);\n\nconst preferPipeForBehavior = createVersionedEffectCallbackRule(\n staticBehaviorCall,\n () => \"Rule: prefer .pipe() for behavior decoration. Why: retry, timeout, spans, logging, recovery, DI, and value transforms decorate an existing effect. Fix: write `program.pipe(Effect.retry(policy))` instead of `Effect.retry(program, policy)`.\",\n);\nconst preferDecoratedEffectBeforeGen = createVersionedEffectCallbackRule(\n repeatedDecoratedYieldInEffectGen,\n () => \"Rule: extract decorated effects before Effect.gen. Why: repeated retry/timeout/span/logging decorators inside generator yields bury behavior policy in workflow steps. Fix: name the decorated effects first, then yield the workflow story.\",\n);\nconst noWorkflowInBehaviorPipe = createVersionedEffectCallbackRule(\n workflowInBehaviorPipe,\n () => \"Rule: avoid workflow sequencing inside behavior pipes. Why: behavior pipes should answer how an effect behaves, not hide the workflow story. Fix: move multi-step sequencing into Effect.gen and keep retry/timeout/spans/logging as decorators around named effects.\",\n);\nconst noMixedPillarFunction = createVersionedEffectCallbackRule(\n mixedPillarFunctionNode,\n (version) => \"Rule: avoid mixing Effect style pillars in one function. Why: workflow, pure transformation, behavior decoration, and Layer wiring each need a clear boundary. Fix: extract named concepts for each pillar and compose them at the call site.\",\n false,\n false,\n [\"FunctionDeclaration\",\"FunctionExpression\",\"ArrowFunctionExpression\"],\n);\n\nconst noCleverEffectExpression = createVersionedEffectCallbackRule(\n cleverEffectExpressionNode,\n (version) => \"Rule: avoid clever Effect expressions. Why: deeply nested expressions that combine style pillars hide the domain story. Fix: extract named workflow, pure transformation, and behavior steps.\",\n);\n\nconst preferExtractedConcept = createVersionedEffectCallbackRule(\n oversizedAnonymousConceptNode,\n (version) => \"Rule: prefer extracting named concepts from oversized anonymous callbacks. Why: multi-step inline callbacks hide domain intent. Fix: name the transformation, policy, or workflow step before passing it into Effect.\",\n);\n\nconst preferEffectService = createVersionedEffectCallbackRule(\n (node, version) => isContextTagCall(node) || (version === 4 && isEffectMemberCallNamed(node, \"Service\")) ? node : undefined,\n (version) => version === 3\n ? \"Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.\"\n : \"Rule: prefer Context.Service. Fix: migrate legacy Context.Tag, Context.GenericTag or Effect.Service definitions to Context.Service; construct implementations with make and explicit Layer wiring where needed.\",\n);\n\nconst noLayerProvideInServiceDefinition = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ClassDeclaration(node: any) {\n if (version === 4) return;\n const options = effectServiceClassOptions(node);\n if (hasEffectEcosystemImport && options && containsLayerProvideCall(options)) {\n report(\n context,\n options,\n \"Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.\",\n );\n }\n },\n CallExpression(node: any) {\n if (version === 3 || !hasEffectEcosystemImport) return;\n const options = effectServiceOptionsObject(node, version);\n const make = options && objectPropertyValue(options, \"make\");\n if (make && containsLayerProvideCall(make)) {\n report(context, options, \"Rule: do not assemble layers inside Context.Service make. Fix: keep make focused on constructing the implementation and compose Layer.provide at app/test boundaries.\");\n }\n },\n };\n },\n});\n\nconst requireServiceAccessors = defineRule({\n create(context: OxlintContext) {\n if (effectVersionFor(context.options) === 4) return {};\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ClassDeclaration(node: any) {\n const options = effectServiceClassOptions(node);\n if (hasEffectEcosystemImport && options && !hasAccessorsTrue(options)) {\n report(\n context,\n options,\n \"Rule: set accessors: true. Fix: add it to Effect.Service options.\",\n );\n }\n },\n };\n },\n});\n\nconst requireServiceDependencies = defineRule({\n create(context: OxlintContext) {\n if (effectVersionFor(context.options) === 4) return {};\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ClassDeclaration(node: any) {\n const options = effectServiceClassOptions(node);\n const dependency = options ? serviceDependencyWithoutDeclaration(options) : undefined;\n if (hasEffectEcosystemImport && dependency) {\n report(\n context,\n dependency,\n \"Rule: declare service dependencies.\",\n );\n }\n },\n };\n },\n});\n\nconst noNamespaceEffectImport = defineRule({\n create(context: OxlintContext) {\n return {\n ImportDeclaration(node: any) {\n const namespaceImport = namespaceEffectImport(node);\n if (namespaceImport) {\n report(\n context,\n namespaceImport,\n \"Rule: avoid namespace imports from Effect packages.\",\n );\n }\n },\n };\n },\n});\n\nconst noManualServiceObjectExport = createVersionedEffectCallbackRule(\n manualServiceObjectExport,\n (version) => \"Rule: avoid exported manual service objects.\",\n false,\n false,\n [\"ExportNamedDeclaration\"],\n);\n\nconst preferLayerPipe = createVersionedEffectCallbackRule(\n layerProvideCallTower,\n (version) => \"Rule: prefer Layer.pipe for nested layer provisioning.\",\n);\n\nconst noInlineLayerProvideInProgram = createVersionedEffectCallbackRule(\n inlineLayerProvideInProgram,\n (version) => \"Rule: avoid inline layer provisioning inside programs.\",\n);\n\nconst preferLayerMergeallForInfrastructure = createVersionedEffectCallbackRule(\n layerMergeChain,\n (version) => \"Rule: prefer Layer.mergeAll for infrastructure layer groups.\",\n);\n\nconst noServiceLayerScatter = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n let scatteredLayerCount = 0;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclaration(node: any) {\n const target = hasEffectEcosystemImport ? scatteredLayerProvideDeclaration(node) : undefined;\n if (!target) {\n return;\n }\n\n scatteredLayerCount += 1;\n if (scatteredLayerCount >= 3) {\n report(\n context,\n target,\n \"Rule: group service layers by concern.\",\n );\n }\n },\n };\n },\n});\n\nconst noLayerMergeInRequestHandler = createVersionedEffectCallbackRule(\n layerCompositionInRequestHandler,\n (version) => \"Rule: avoid Layer composition inside request handlers.\",\n false,\n false,\n [\"FunctionDeclaration\"],\n);\n\nconst noServiceMethodReturningPromise = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ClassDeclaration(node: any) {\n if (version === 4) return;\n const options = effectServiceClassOptions(node);\n const method = options ? promiseReturningServiceMethod(options) : undefined;\n if (hasEffectEcosystemImport && method) {\n report(\n context,\n method,\n \"Rule: return Effect from service methods.\",\n );\n }\n },\n CallExpression(node: any) {\n if (version === 3 || !hasEffectEcosystemImport) return;\n const options = effectServiceOptionsObject(node, version);\n const method = options && promiseReturningServiceMethod(options, version);\n if (method) report(context, method, \"Rule: return Effect from service methods. Fix: expose an Effect-returning Context.Service method and keep Promise interop inside an Effect adapter.\");\n },\n };\n },\n});\n\nconst noMatchVoidBranch = createVersionedEffectCallbackRule(\n (node) => isVoidMatchBranch(node) ? node : undefined,\n (version) => \"Rule: avoid void Match branches. Why: they hide guard-style control flow. Fix: remove the no-op branch or select a value and run one Effect pipeline outside the Match.\",\n);\n\nconst noMatchEffectBranch = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (isMatchValuePipeCall(node) && containsSequencingMatchBranch(node.arguments)) {\n report(\n context,\n node,\n \"Rule: avoid multi-step sequencing inside Match branches. Why: it hides control flow. Fix: select a value in Match, then run one Effect pipeline outside. Avoid data-encoded conditionals (Option.toArray/forEach) that only rewrap the branch.\",\n );\n }\n\n if (isOptionMatchCall(node) && isSequencingBranchBody(node.arguments)) {\n report(\n context,\n node,\n \"Rule: avoid multi-step sequencing inside Option.match branches. Why: it hides control flow. Prefer selecting a value in Option.match, then run one Effect pipeline outside. Leaf-level flows with local bindings may keep Option.match but should stay linear.\",\n );\n }\n },\n };\n },\n});\n\nconst warnEffectSyncWrapper = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n const callback = firstArgument(node);\n const body = arrowCallbackBody(callback);\n if (\n hasEffectEcosystemImport &&\n isEffectMemberCallNamed(node, \"sync\") &&\n isExpressionBodiedArrowCall(callback) &&\n !isConsoleCall(body)\n ) {\n report(\n context,\n node,\n \"Rule: avoid Effect.sync around side effects. Why: it hides intent. Fix: use Effect.log* or an explicit pipeline step for the side effect.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectSideEffectWrapper = defineRule({\n create(context: OxlintContext) {\n const sequencing = effectVersionFor(context.options) === 3 ? \"zipRight\" : \"andThen\";\n return {\n CallExpression(node: any) {\n if (isEffectMemberCallNamed(node, \"as\") && containsWrapperSideEffect(firstArgument(node))) {\n report(\n context,\n node,\n \"Rule: avoid Effect.as for side effects. Why: it hides side effects and turns them into placeholders. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.\",\n );\n }\n\n if (\n isEffectMemberCallNamed(node, sequencing) &&\n containsWrapperSideEffect(firstArgument(node))\n ) {\n report(\n context,\n node,\n `Rule: avoid Effect.${sequencing} for side effects. Why: it hides side effects and discards values. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`,\n );\n }\n },\n };\n },\n});\n\nconst noEffectAllStepSequencing = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (\n isEffectMemberCallNamed(node, \"all\") &&\n containsAllStepSideEffect(node.arguments[0]) &&\n hasConcurrencyOne(node.arguments[1])\n ) {\n report(\n context,\n node,\n \"Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.\",\n );\n }\n\n if (\n isEffectAllAsVoidPipe(node) &&\n containsAllStepSideEffect(firstArgument((node.callee as Node).object as Node & {\n arguments: unknown[];\n }))\n ) {\n report(\n context,\n node,\n \"Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.\",\n );\n }\n },\n };\n },\n});\n\nfunction createVersionedEffectCallbackRule(\n find: (node: unknown, version: EffectVersion, context: OxlintContext) => unknown,\n message: (version: EffectVersion) => string,\n multiple = false,\n boundary = false,\n visitorNames = [\"CallExpression\"],\n) {\n return defineRule({\n ...(boundary ? { meta: { schema: boundaryPathOptionsSchema } } : {}),\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let imported = false;\n const reported = multiple ? new WeakSet<object>() : undefined;\n const visit = (node: unknown) => {\n const target = imported && (!boundary || !isBoundaryPath(context)) ? find(node, version, context) : undefined;\n if (!target) return;\n for (const entry of multiple ? target as object[] : [target]) {\n if (reported?.has(entry as object)) continue;\n reported?.add(entry as object);\n report(context, entry, message(version));\n }\n };\n return {\n ImportDeclaration(node: unknown) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) imported = true;\n },\n ...Object.fromEntries(visitorNames.map(name => [name, visit])),\n };\n },\n });\n}\n\nconst noAsyncEffectCombinatorCallback = createVersionedEffectCallbackRule(\n findAsyncEffectCombinatorCallback,\n () => \"Rule: avoid async callbacks in Effect combinators. Why: async callbacks return Promises and bypass Effect failure, interruption, and tracing semantics. Fix: adapt with Effect.tryPromise, compose with gen/flatMap, and keep map pure.\",\n);\nconst noThrowInEffectLogic = createVersionedEffectCallbackRule(\n (node, version) => findEffectStatement(node, version, \"ThrowStatement\"),\n (version) => `Rule: avoid throw inside Effect logic. Why: thrown exceptions ${version === 3 ? \"bypass typed Effect error channels and interruption semantics\" : \"are not typed domain failures\"}. Fix: yield* Effect.fail(taggedError) in gen, or return it from flatMap; keep map pure.`,\n);\nconst noOrDieOutsideBoundary = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n const target = findEffectOrDieOutsideBoundary(node, version);\n if (target) {\n report(\n context,\n target,\n `Rule: avoid Effect.orDie outside runtime boundaries. Why: converting typed failures into defects hides recoverable domain errors. Fix: keep typed errors in domain logic and reserve ${version === 3 ? \"orDie/orDieWith\" : \"orDie\"} for explicit application boundaries.`,\n );\n }\n },\n };\n },\n});\n\nconst noSwallowedCatchAll = createVersionedEffectCallbackRule(\n getSwallowedCatchAllHandler,\n (version) => `Rule: avoid swallowing errors in ${version === 3 ? \"catchAll\" : \"catch/catchEager\"}. Why: succeed/void recovery can hide failures without telemetry or typed recovery. Fix: log, re-fail with a structured error, or recover through an explicit domain branch.`,\n);\n\nconst noEmptyErrorTag = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n TSTypeAliasDeclaration(node: any) {\n if (hasEffectEcosystemImport && emptyErrorTagNode(node)) {\n report(\n context,\n node,\n \"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.\",\n );\n }\n },\n TSInterfaceDeclaration(node: any) {\n if (hasEffectEcosystemImport && emptyErrorTagNode(node)) {\n report(\n context,\n node,\n \"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.\",\n );\n }\n },\n ClassDeclaration(node: any) {\n if (hasEffectEcosystemImport && emptyErrorTagNode(node)) {\n report(\n context,\n node,\n \"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.\",\n );\n }\n },\n };\n },\n});\n\nconst noEarlyCatchallNull = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (hasEffectEcosystemImport && !isBoundaryPath(context)) {\n const target = earlyCatchAllFallback(node, version);\n if (target) {\n report(\n context,\n target,\n \"Rule: avoid catching errors too early. Why: null, undefined, or fallback recovery inside domain logic forces higher layers to handle an untyped absence. Fix: let the typed error propagate and recover at a meaningful boundary with catchTag or an explicit Option result.\",\n );\n }\n }\n },\n };\n },\n});\n\nconst noExpectedStateAsError = createVersionedEffectCallbackRule(\n (node) => isExpectedDomainStateFailure(node) ? node : undefined,\n (version) => `Rule: model expected domain states as data. Why: failing with NotFound, Missing, Empty, or None overloads the error channel and encourages broad ${version === 3 ? \"catchAll\" : \"catch\"} recovery. Fix: return Option, ${version === 3 ? \"Either\" : \"Result\"}, or a tagged result for expected state and reserve Effect.fail for exceptional failures.`,\n);\nconst noExceptionDomainError = createVersionedEffectCallbackRule(\n findDomainExceptionInEffectLogic,\n () => \"Rule: do not use exceptions for domain errors. Why: throw new *Error inside Effect logic bypasses typed failure channels, supervision, and structured recovery. Fix: return Effect.fail with a Data.TaggedError or structured domain error.\",\n);\nconst noEffectFailErrorMessage = createVersionedEffectCallbackRule(\n (node) => isEffectFailFromErrorMessage(node) ? node : undefined,\n () => \"Rule: preserve structured errors instead of strings. Why: converting error.message to a string loses the original tag, cause, and context. Fix: fail with the error or map it to a structured Data.TaggedError.\",\n);\n\nconst noCatchallGenericRethrow = createVersionedEffectCallbackRule(\n catchAllGenericRethrow,\n (version) => `Rule: do not rethrow generic Error from ${version === 3 ? \"catchAll\" : \"catch\"}. Why: ${version === 3 ? \"catchAll\" : \"catch\"} should preserve or model the original failure instead of erasing its domain type. Fix: use mapError, catchTag, or Effect.fail with a structured tagged error and cause.`,\n);\n\nconst noLogOnlyErrorHandling = createVersionedEffectCallbackRule(\n logOnlyErrorHandler,\n () => \"Rule: do not stop at logging an Effect error. Why: logs alone do not preserve a typed failure or define recovery ownership. Fix: map or re-fail with a structured domain error after adding observability.\",\n);\nconst noEffectIgnore = createVersionedEffectCallbackRule(\n findEffectIgnore,\n () => \"Rule: avoid Effect.ignore. Why: ignoring failable effects hides failure ownership. Fix: handle the error with typed recovery, log and re-fail, or isolate the ignore at an explicit boundary with a documented reason.\",\n);\n\nconst noTryCatchInEffectLogic = createVersionedEffectCallbackRule(\n (node, version) => findEffectStatement(node, version, \"TryStatement\"),\n (version) => `Rule: avoid try/catch inside Effect logic. Why: it bypasses typed error channels and can miss interruption/cause semantics. Fix: use Effect.try, Effect.${version === 3 ? \"catchAll\" : \"catch\"}, Effect.catchTag, or typed error combinators.`,\n);\nconst noPromiseApiInEffectLogic = createVersionedEffectCallbackRule(\n findPromiseApiInEffectLogic,\n () => \"Rule: avoid Promise APIs inside Effect logic. Why: Promise APIs bypass Effect scheduling, typed errors, cancellation, and tracing. Fix: use Effect.all, Effect.tryPromise, or move Promise interop to a boundary adapter.\",\n);\nconst noTryCatch = defineRule({\n create(context: OxlintContext) {\n return {\n TryStatement(node: any) {\n report(\n context,\n node,\n \"Rule: avoid try/catch in Effect files. Why: it bypasses Effect error channels and reintroduces imperative control flow. Fix: model failures in Effect and handle them with typed errors and Effect combinators.\",\n );\n },\n };\n },\n});\n\nconst noEffectWrapperAlias = defineRule({\n create(context: OxlintContext) {\n return {\n VariableDeclaration(node: any) {\n for (const declaration of node.declarations ?? []) {\n if (isEffectWrapperAliasExpression(declaration.init)) {\n report(\n context,\n node,\n \"Rule: avoid Effect wrapper aliases (`const x = ...Effect...`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.\",\n );\n }\n }\n },\n FunctionDeclaration(node: any) {\n if (hasEffectWrapperAliasReturn(node.body)) {\n report(\n context,\n node,\n \"Rule: avoid Effect wrapper aliases (`function x(...) { return Effect... }`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.\",\n );\n }\n },\n };\n },\n});\n\nconst noManualEffectChannels = defineRule({\n create(context: OxlintContext) {\n return {\n TSTypeReference(node: any) {\n if (\n isQualifiedTypeReference(node, \"Effect\", \"Effect\") ||\n isQualifiedTypeReference(node, \"Layer\", \"Layer\")\n ) {\n report(\n context,\n node,\n \"Rule: avoid manual Effect channel tuples under this opt-in inference-only policy. Explicit Effect/Layer types are valid contracts; disable this rule to retain them.\",\n );\n }\n },\n };\n },\n});\n\nconst noWrapgraphqlCatchall = createVersionedEffectCallbackRule(\n getWrapGraphqlCatchAll,\n (version) => `Rule: avoid ${version === 3 ? \"catchAll\" : \"catch/catchEager\"} after wrapGraphqlCall/applyResponse. Why: the envelope already surfaces structured errors. Fix: handle errors in the response mapping instead of ${version === 3 ? \"catchAll\" : \"catch/catchEager\"}.`,\n);\n\nconst noRenderSideEffects = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ExpressionStatement(node: any) {\n if (\n hasEffectEcosystemImport &&\n isMatchValuePipeCall(node.expression) &&\n containsMatchBranchCall((node.expression as Node).arguments)\n ) {\n report(\n context,\n node.expression,\n \"Rule: avoid Match.value(...).pipe(...) as a statement. Why: it runs side effects during render. Fix: move the side effect into an Effect runtime action or event handler, and keep Match as a pure expression.\",\n );\n }\n },\n };\n },\n});\n\nconst noAtomRegistryEffectSync = createVersionedEffectCallbackRule(\n findAtomOperationInsideEffectSync,\n () => \"Rule: do not wrap Atom/atomRegistry ops in Effect.sync. Why: it hides side effects and breaks atom flow. Fix: call Atom.get/Atom.set/Atom.update/Atom.modify/Atom.refresh directly.\",\n);\n\nconst noFamilyCollectionRead = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (!isMemberCall(node, \"Atom\", \"family\")) {\n return;\n }\n\n const collectionAtom = findFamilyCollectionRead(node.arguments);\n if (collectionAtom) {\n report(\n context,\n collectionAtom,\n \"Keyed projection atom reads collection atom. Why: Atom.family should project from keyed/source atoms, not broad collection state. Fix: pass the keyed atom into the family or create a keyed source atom before reading.\",\n );\n }\n },\n };\n },\n});\n\nconst noInlineRuntimeProvide = createVersionedEffectCallbackRule(\n findInlineRuntimeProvide,\n (version) => `Rule: do not inline runtime provisioning inside local helper Effect code. Why: \\`yield* SomeRuntime.pipe(Effect.provide(SomeRuntimeLive))\\` and equivalent inline provide chains hide dependency assembly instead of owning it at ${version === 3 ? \"an Effect.Service\" : \"a Context.Service\"} boundary or one exported Effect boundary. Fix: declare the live dependency on the owning service or provide it once at the exported boundary, then \\`yield*\\` the runtime or service directly inside the body.`,\n);\n\nconst noNakedObjectStateUpdate = defineRule({\n create(context: OxlintContext) {\n const constructors = effectVersionFor(context.options) === 3 ? \"Schema.make` or field `.make\" : \"schema .make\";\n return {\n CallExpression(node: any) {\n if (isNakedObjectStateUpdate(node)) {\n report(\n context,\n node,\n `Rule: avoid naked JS state patching/rebuild and raw JSON shortcuts in Effect transitions. Why: spread/Object.assign/fromEntries and inline JSON parse/stringify hide state intent and bypass explicit model contracts. Fix: use \\`effect/Record\\` combinators (\\`Record.set\\` / \\`Record.modify\\` / \\`Record.remove\\`) inside \\`Struct.evolve\\`, rebuild with schema constructors (\\`${constructors}\\`), and keep serialization at boundaries with schema encode/decode flows. Use \\`linting.md\\` guidance when available.`,\n );\n }\n },\n };\n },\n});\n\nconst noEffectSucceedVariable = createVersionedEffectCallbackRule(\n (node) => isEffectMemberCallNamed(node, \"succeed\") && isEffectSucceedVariableArgument(firstArgument(node)) ? node : undefined,\n () => \"Rule: avoid Effect.succeed(variable) as a branch placeholder. Why: it hides a decision and turns data into pseudo-control flow. Fix: select a plain value (Option/Match) and then run one Effect pipeline after the decision; if you already read the state, return it as a value. Avoid Option.toArray/forEach hacks that just re-encode the branch.\",\n);\n\nconst noEffectTypeAlias = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n TSTypeAliasDeclaration(node: any) {\n if (\n hasEffectEcosystemImport &&\n containsQualifiedTypeReference(node.typeAnnotation, \"Effect\", \"Effect\")\n ) {\n report(\n context,\n node.typeAnnotation,\n \"Rule: avoid Effect.Effect type aliases under this opt-in style policy. Explicit aliases are valid; disable this rule to retain public contracts.\",\n );\n }\n },\n };\n },\n});\n\nconst noPublicGenericEffectError = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ExportNamedDeclaration(node: any) {\n const target = hasEffectEcosystemImport ? exportedGenericEffectErrorTarget(node) : undefined;\n if (target) {\n report(\n context,\n target,\n \"Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.\",\n );\n }\n },\n ExportDefaultDeclaration(node: any) {\n const target = hasEffectEcosystemImport ? exportedGenericEffectErrorTarget(node) : undefined;\n if (target) {\n report(\n context,\n target,\n \"Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.\",\n );\n }\n },\n };\n },\n});\n\nfunction createPublicEffectErrorChannelRule(\n context: OxlintContext,\n matches: (target: PublicEffectErrorTarget) => boolean,\n message: string,\n) {\n let hasEffectEcosystemImport = false;\n\n const visitExport = (node: any) => {\n if (!hasEffectEcosystemImport) return;\n\n for (const target of exportedEffectErrorTargets(node)) {\n if (matches(target)) {\n report(context, target.annotation, message);\n }\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ExportNamedDeclaration: visitExport,\n ExportDefaultDeclaration: visitExport,\n };\n}\n\nconst noErrorAsPublicEffectError = defineRule({\n create(context: OxlintContext) {\n return createPublicEffectErrorChannelRule(\n context,\n ({ errorChannel }) => isGenericErrorType(errorChannel),\n \"Rule: model public errors as tagged Effect failures, not generic Error. Why: Error hides recovery semantics and domain context. Fix: return a domain-specific Data.TaggedError or tagged error union.\",\n );\n },\n});\n\nconst noUnknownPublicErrorChannel = defineRule({\n create(context: OxlintContext) {\n return createPublicEffectErrorChannelRule(\n context,\n ({ errorChannel }) => errorChannelShape(errorChannel) === \"unknown\",\n \"Rule: do not expose unknown as a public Effect error channel. Why: callers cannot recover by tag or type. Fix: return a tagged domain error union with operation-specific context.\",\n );\n },\n});\n\nconst noMixedEffectErrorShapes = defineRule({\n create(context: OxlintContext) {\n return createPublicEffectErrorChannelRule(\n context,\n ({ errorChannel }) => mixedErrorChannelShapes(errorChannel).size > 1,\n \"Rule: keep the public Effect error channel structurally consistent. Why: mixing Error, primitives, and unknown makes recovery ambiguous. Fix: map failures to one tagged error union.\",\n );\n },\n});\n\nconst noModelOverlayCast = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclaration(node: any) {\n if (hasEffectEcosystemImport && isVariableAsAssertion(node, version)) {\n report(\n context,\n node,\n \"Rule: avoid `as` assertions on decoded model flow. Why: assertions hide schema drift and allow untyped overlays. Fix: decode with the correct schema type and read fields directly.\",\n );\n }\n },\n };\n },\n});\n\nconst noUnknownBooleanCoercionHelper = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n let hasMatchOrElseNull = false;\n const booleanChecks: unknown[] = [];\n const reported = new WeakSet<object>();\n\n const reportBooleanCheck = (node: unknown) => {\n if (!isObjectValue(node) || reported.has(node)) {\n return;\n }\n\n reported.add(node);\n report(\n context,\n node,\n \"Rule: avoid local unknown-to-boolean coercion helpers in services. Why: runtime coercion belongs at schema boundary, not in service flow. Fix: decode boolean optionality in schema and read typed booleans in the Effect pipeline.\",\n );\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n BinaryExpression(node: any) {\n if (!hasEffectEcosystemImport || !isTypeofBooleanCheck(node)) {\n return;\n }\n\n if (hasMatchOrElseNull) {\n reportBooleanCheck(node);\n } else {\n booleanChecks.push(node);\n }\n },\n CallExpression(node: any) {\n if (!hasEffectEcosystemImport || !isMatchOrElseNullCall(node)) {\n return;\n }\n\n hasMatchOrElseNull = true;\n for (const check of booleanChecks) {\n reportBooleanCheck(check);\n }\n },\n };\n },\n});\n\nconst noFromnullableNullishCoalesce = createVersionedEffectCallbackRule(\n (node, version) => isOptionFromNullableNullishCoalesce(node, version) ? node : undefined,\n (version) => `Rule: avoid nullish re-wrap inside Option.${version === 3 ? \"fromNullable\" : \"fromNullishOr\"}. Why: \\`x ?? null\\` and \\`x ?? undefined\\` add noise and hide source shape. Fix: pass the source directly to Option.${version === 3 ? \"fromNullable\" : \"fromNullishOr\"}.`,\n);\n\nconst noOptionBooleanNormalization = createVersionedEffectCallbackRule(\n (node) => isOptionBooleanNormalization(node) ? node : undefined,\n (version) => \"Rule: avoid repeated Option boolean normalization (`onSome: value === true, onNone: false`). Why: it scatters coercion rules across services. Fix: normalize once at schema boundary and read booleans directly.\",\n);\n\nconst noStringSentinelReturn = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n CallExpression(node: any) {\n if (isEffectMemberCallNamed(node, \"succeed\") && isStringLiteral(firstArgument(node))) {\n report(\n context,\n node,\n `Rule: avoid returning string tokens. Why: it encodes control flow and forces defensive branching. Fix: return domain values (Option/${version === 3 ? \"Either\" : \"Result\"}/tagged unions) or real Effect results instead.`,\n );\n }\n },\n };\n },\n});\n\nconst noStringSentinelConst = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n VariableDeclaration(node: any) {\n if (isStringSentinelConst(node)) {\n report(\n context,\n node,\n `Rule: avoid string status constants. Why: they encode control flow and force defensive branching. Fix: use tagged unions, Option/${version === 3 ? \"Either\" : \"Result\"}, or meaningful domain values instead of string tokens.`,\n );\n }\n },\n };\n },\n});\n\nconst noRawDomainIdAlias = createVersionedEffectCallbackRule(\n (node) => isRawDomainIdAlias(node) ? node : undefined,\n (version) => \"Rule: avoid raw primitive domain ID aliases. Why: `type UserId = string` does not protect boundaries from swapped IDs. Fix: use Schema branded IDs or a domain constructor that validates and brands the value.\",\n false,\n false,\n [\"TSTypeAliasDeclaration\"],\n);\n\nconst noBooleanDomainFlag = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n const checkFunctionParameters = (node: unknown) => {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const param of functionBooleanDomainFlagParameters(node)) {\n report(\n context,\n param,\n \"Rule: avoid boolean behavior flags in domain operations. Why: flags like `shouldNotify` hide use cases and create implicit branching. Fix: model intent with a command/tagged union or split the operation into explicit functions.\",\n );\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n FunctionDeclaration: checkFunctionParameters,\n FunctionExpression: checkFunctionParameters,\n ArrowFunctionExpression: checkFunctionParameters,\n };\n },\n});\n\nconst noMagicDomainString = createVersionedEffectCallbackRule(\n (node) => isStringLiteralComparison(node) ? node : undefined,\n (version) => \"Rule: avoid magic domain string comparisons. Why: comparing domain state to raw strings scatters status vocabulary and misses exhaustiveness. Fix: use a tagged union, Schema literal union, or Match over a named domain status.\",\n false,\n false,\n [\"BinaryExpression\"],\n);\n\nconst noRawDomainPrimitiveParams = createVersionedEffectCallbackRule(\n (node) => hasPrimitiveHeavyDomainParameters(node) ? node : undefined,\n (version) => \"Rule: avoid primitive-heavy domain parameters. Why: clusters of raw string/number domain values are easy to swap and have no invariant boundary. Fix: introduce branded types or a command/schema object with named validated fields.\",\n false,\n false,\n [\"FunctionDeclaration\",\"FunctionExpression\",\"ArrowFunctionExpression\"],\n);\n\nconst noRawTimeDomainField = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n const checkTypeMembers = (node: unknown) => {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const field of rawTimeDomainFields(node)) {\n report(\n context,\n field,\n \"Rule: avoid raw time fields in domain models. Why: number and Date fields hide units, clock ownership, and duration semantics. Fix: model durations with Effect Duration and keep raw timestamps at decode/encode boundaries.\",\n );\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n TSInterfaceDeclaration: checkTypeMembers,\n TSTypeLiteral: checkTypeMembers,\n };\n },\n});\n\nconst nodeFsImportSources = new Set([\"fs\", \"node:fs\", \"fs/promises\", \"node:fs/promises\"]);\n\nconst nodeBuiltinImportSources = new Set([\n \"assert\", \"assert/strict\", \"async_hooks\", \"buffer\", \"child_process\", \"cluster\", \"console\",\n \"constants\", \"crypto\", \"dgram\", \"diagnostics_channel\", \"dns\", \"dns/promises\", \"domain\",\n \"events\", \"fs\", \"fs/promises\", \"http\", \"http2\", \"https\", \"inspector\", \"inspector/promises\",\n \"module\", \"net\", \"os\", \"path\", \"path/posix\", \"path/win32\", \"perf_hooks\", \"process\",\n \"punycode\", \"querystring\", \"readline\", \"readline/promises\", \"repl\", \"stream\",\n \"stream/consumers\", \"stream/promises\", \"stream/web\", \"string_decoder\", \"sys\", \"timers\",\n \"timers/promises\", \"tls\", \"trace_events\", \"tty\", \"url\", \"util\", \"util/types\", \"v8\", \"vm\",\n \"wasi\", \"worker_threads\", \"zlib\",\n]);\n\nfunction isNodeBuiltinImport(source: string): boolean {\n return source.startsWith(\"node:\") || nodeBuiltinImportSources.has(source);\n}\n\nfunction isMemberExpressionNode(node: unknown): node is Node {\n return (\n isObjectValue(node) &&\n ((node as Node).type === \"MemberExpression\" || (node as Node).type === \"OptionalMemberExpression\")\n );\n}\n\nfunction isNamedMemberProperty(member: Node, name: string): boolean {\n return (\n (member.computed !== true && isIdentifier(member.property, name)) ||\n (member.computed === true && isStringLiteral(member.property) && (member.property as Node).value === name)\n );\n}\n\nfunction isProcessEnvMember(node: unknown): boolean {\n return (\n isMemberExpressionNode(node) &&\n isIdentifier(node.object, \"process\") &&\n isNamedMemberProperty(node, \"env\")\n );\n}\n\nfunction isProcessEnvRead(node: unknown): boolean {\n if (!isMemberExpressionNode(node)) return false;\n if (isProcessEnvMember(node.object)) return true;\n if (!isProcessEnvMember(node)) return false;\n\n const parent = node.parent;\n return !isMemberExpressionNode(parent) || parent.object !== node;\n}\n\nfunction isProcessEnvWriteTarget(node: unknown): boolean {\n if (!isMemberExpressionNode(node) || typeof node.parent !== \"object\" || node.parent === null) {\n return false;\n }\n\n const parent = node.parent as Node;\n return parent.type === \"AssignmentExpression\" && parent.left === node;\n}\n\nconst noNodePlatformInSharedCode = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isNodeBuiltinImport(source) && !isBoundaryPath(context)) {\n report(\n context,\n node,\n \"Rule: avoid Node platform imports in shared code. Why: reusable modules must not require a Node runtime. Fix: move the import behind a configured application boundary or an Effect platform service.\",\n );\n }\n },\n };\n },\n});\n\nconst noProcessEnvDirectRead = defineRule({\n meta: { schema: processEnvPathOptionsSchema },\n create(context: OxlintContext) {\n return {\n MemberExpression(node: any) {\n if (\n isProcessEnvRead(node) &&\n !isProcessEnvWriteTarget(node) &&\n !isBoundaryPath(context) &&\n !isConfigPath(context)\n ) {\n report(\n context,\n node,\n \"Rule: avoid direct process.env reads outside configuration boundaries. Why: ambient configuration leaks runtime coupling into domain code. Fix: decode environment values in a configured Config service or Layer and depend on that service.\",\n );\n }\n },\n };\n },\n});\n\nfunction getNodeFsRequireSource(node: unknown): string | undefined {\n if (\n !isObjectValue(node) ||\n (node as Node).type !== \"CallExpression\" ||\n !isIdentifier((node as Node).callee, \"require\")\n ) {\n return undefined;\n }\n\n const argument = ((node as Node).arguments as unknown[] | undefined)?.[0];\n if (!isStringLiteral(argument)) return undefined;\n\n const source = (argument as Node).value as string;\n return nodeFsImportSources.has(source) ? source : undefined;\n}\n\nconst noNodeFsInEffectCode = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n let functionDepth = 0;\n const nodeFsReferences: Array<{ node: unknown; source: string }> = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n if (source && nodeFsImportSources.has(source)) {\n nodeFsReferences.push({ node, source });\n }\n },\n FunctionDeclaration() {\n functionDepth += 1;\n },\n \"FunctionDeclaration:exit\"() {\n functionDepth -= 1;\n },\n FunctionExpression() {\n functionDepth += 1;\n },\n \"FunctionExpression:exit\"() {\n functionDepth -= 1;\n },\n ArrowFunctionExpression() {\n functionDepth += 1;\n },\n \"ArrowFunctionExpression:exit\"() {\n functionDepth -= 1;\n },\n CallExpression(node: any) {\n if (functionDepth !== 0) return;\n const source = getNodeFsRequireSource(node);\n if (source) nodeFsReferences.push({ node, source });\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) return;\n for (const { node, source } of nodeFsReferences) {\n report(context, node, `Rule: avoid Node fs imports or require calls in Effect code (${source}). Why: direct Node filesystem APIs make reusable Effect modules platform-specific. Fix: move filesystem work behind an Effect platform service at the application boundary.`);\n }\n },\n };\n },\n});\n\nconst noHiddenEffectExecution = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n const runCalls: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n },\n CallExpression(node: any) {\n if (isEffectRunCall(node, version)) runCalls.push(node);\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || isBoundaryPath(context)) return;\n for (const node of runCalls) {\n report(\n context,\n (node as Node).callee,\n \"Rule: avoid hidden Effect execution. Why: Effect.run* fixes runtime ownership inside reusable code. Fix: return the Effect and execute it from a configured application, CLI, worker, route, or test boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst boundaryEffectHandlingMethods = new Set([\n \"try\",\n \"tryPromise\",\n \"mapError\",\n \"catchAll\",\n \"catchTag\",\n \"catchTags\",\n]);\n\nfunction containsBoundaryEffectHandling(\n node: unknown,\n version: EffectVersion,\n): boolean {\n return findNode(node, candidate => {\n if (isEffectRunCall(candidate, version)) return true;\n if (!isEffectMemberCall(candidate)) return false;\n const property = ((candidate as Node).callee as Node).property;\n if (!isIdentifier(property)) return false;\n return version === 3 ? boundaryEffectHandlingMethods.has(property.name)\n : (property.name !== \"catchAll\" && boundaryEffectHandlingMethods.has(property.name)) ||\n (effect4RecoveryOperatorNames as readonly string[]).includes(property.name) || property.name === \"catchNoSuchElement\";\n }) !== undefined;\n}\n\nconst noBoundaryTryCatchWithoutEffectMap = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n TryStatement(node: any) {\n if (!node.handler || !isBoundaryPath(context) || containsBoundaryEffectHandling(node, version)) {\n return;\n }\n\n report(\n context,\n node,\n version === 3\n ? \"Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, catchAll, or execute a mapped Effect program.\"\n : \"Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, Effect.catch, or execute a mapped Effect program.\",\n );\n },\n };\n },\n});\n\nconst noJsonParseWithoutSchema = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n let hasEffectSchemaImport = false;\n const jsonParseCalls: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n if (importsEffectSchema(node)) hasEffectSchemaImport = true;\n },\n CallExpression(node: any) {\n if (isMemberExpression(node.callee, \"JSON\", \"parse\")) {\n jsonParseCalls.push(node);\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || hasEffectSchemaImport) return;\n for (const node of jsonParseCalls) {\n report(\n context,\n node,\n version === 3\n ? \"Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: decode unknown input with Schema.decodeUnknown at the boundary.\"\n : \"Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: use Schema.fromJsonString with Schema.decodeUnknownEffect at the boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noDateNowInEffect = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n const collectedDateCalls = new WeakSet<object>();\n const dateNowCalls: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n },\n CallExpression(node: any) {\n if (!isEffectConstructionBoundary(node, version)) return;\n\n for (const dateNowCall of findNodes(node.arguments, isDateNowCall)) {\n if (collectedDateCalls.has(dateNowCall as object)) continue;\n collectedDateCalls.add(dateNowCall as object);\n dateNowCalls.push(dateNowCall);\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) return;\n for (const dateNowCall of dateNowCalls) {\n report(\n context,\n dateNowCall,\n \"Rule: avoid Date.now inside Effect logic. Why: direct wall-clock reads make programs nondeterministic and difficult to test. Fix: obtain time through Effect Clock or DateTime at the boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noNewDateInDomainLogic = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const dateConstructions: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) hasEffectEcosystemImport = true;\n },\n NewExpression(node: any) {\n if (isIdentifier(node.callee, \"Date\")) dateConstructions.push(node);\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || isBoundaryPath(context)) return;\n for (const node of dateConstructions) {\n report(\n context,\n node,\n \"Rule: avoid new Date in Effect domain logic. Why: direct wall-clock construction makes domain behaviour nondeterministic and difficult to test. Fix: obtain time through Effect Clock or model time at the boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noOverloadedOptionsObject = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n const checkFunctionParameters = (node: unknown) => {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n for (const param of overloadedOptionsParameters(node)) {\n report(\n context,\n param,\n \"Rule: avoid overloaded options objects. Why: `opts`, `options`, and `config` typed as any/object hide required fields and validation. Fix: accept unknown at the boundary and decode with Schema, or use a named typed command/config model.\",\n );\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n FunctionDeclaration: checkFunctionParameters,\n FunctionExpression: checkFunctionParameters,\n ArrowFunctionExpression: checkFunctionParameters,\n };\n },\n});\n\nconst noDomainLogicInConditional = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n LogicalExpression(node: any) {\n if (hasEffectEcosystemImport && isDomainLogicConditional(node)) {\n report(\n context,\n node,\n \"Rule: avoid embedding domain logic in conditionals. Why: multi-clause business rules become hard to test, reuse, and audit. Fix: extract a named domain predicate or validation Effect and call that from the branch.\",\n );\n }\n },\n };\n },\n});\n\nconst noImplicitStateMachineObject = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n LogicalExpression(node: any) {\n if (hasEffectEcosystemImport && isImplicitStateMachineObject(node)) {\n report(\n context,\n node,\n \"Rule: avoid implicit state machines made from boolean flags. Why: multiple flags on one domain object allow impossible states. Fix: model the lifecycle as a tagged union or Data.TaggedEnum.\",\n );\n }\n },\n };\n },\n});\n\nconst noAdhocDomainError = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (hasEffectEcosystemImport && isAdhocEffectFail(node)) {\n report(\n context,\n node,\n \"Rule: avoid ad hoc domain errors. Why: string failures hide recovery semantics and observability. Fix: use Data.TaggedError or a structured domain error union.\",\n );\n }\n },\n ThrowStatement(node: any) {\n if (hasEffectEcosystemImport && isThrowNewStringError(node)) {\n report(\n context,\n node,\n \"Rule: avoid ad hoc domain errors. Why: thrown string Error values bypass typed Effect error channels. Fix: return Effect.fail with a structured tagged domain error.\",\n );\n }\n },\n };\n },\n});\n\nconst noDomainMeaningByFolderOnly = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n FunctionDeclaration(node: any) {\n if (hasEffectEcosystemImport && isContextEncodedDomainFunction(node)) {\n report(\n context,\n node,\n \"Rule: avoid domain meaning by folder or context naming alone. Why: admin/public/internal meaning should be represented in types or services, not inferred from helper names. Fix: encode context with branded IDs, commands, policies, or service boundaries.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectAs = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (isMemberExpression(node.callee, \"Effect\", \"as\")) {\n report(\n context,\n node.callee,\n \"Rule: avoid Effect.as wrappers. Why: they can hide meaningful sequencing or value flow. Fix: return the intended value directly or use explicit Effect.map/andThen.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectDo = defineRule({\n create(context: OxlintContext) {\n return {\n MemberExpression(node: any) {\n if (isMemberExpression(node, \"Effect\", \"Do\")) {\n report(\n context,\n node,\n \"Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.\",\n );\n }\n },\n };\n },\n});\n\nfunction createForbiddenMemberCallRule(objectName: string, propertyName: string, message: string, legacyOnly = false) {\n return defineRule({\n create(context: OxlintContext) {\n if (legacyOnly && effectVersionFor(context.options) === 4) return {};\n return {\n CallExpression(node: any) {\n if (isMemberExpression(node.callee, objectName, propertyName)) {\n report(context, node.callee, message);\n }\n },\n };\n },\n });\n}\n\nconst noEffectBind = createForbiddenMemberCallRule(\n \"Effect\",\n \"bind\",\n \"Rule: avoid Effect.bind. Why: it obscures linear data flow behind builder-style binding. Fix: use Effect.gen or a direct pipe with flatMap/map.\",\n);\n\nconst noRuntimeRunFork = createForbiddenMemberCallRule(\n \"Runtime\",\n \"runFork\",\n \"Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.\",\n true,\n);\n\nconst noRunEffectOutsideBoundary = defineRule({\n meta: { schema: boundaryPathOptionsSchema },\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n if (hasEffectEcosystemImport && !isBoundaryPath(context) && isEffectRunCall(node, version)) {\n report(\n context,\n node.callee,\n \"Rule: avoid running Effects outside runtime boundaries. Why: direct Effect.run* calls scatter execution ownership. Fix: return Effects from domain logic and run them at the app, CLI, worker, route, or test boundary.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectAsync = createForbiddenMemberCallRule(\n \"Effect\",\n \"async\",\n \"Rule: avoid Effect.async. Why: manual callback bridges are easy to leak or resume incorrectly. Fix: use scoped Effect APIs or a dedicated platform adapter.\",\n true,\n);\n\nconst noNestedEffectCall = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (hasDeepNestedEffectFirstArgument(node)) {\n report(\n context,\n node,\n \"Rule: avoid deeply nested Effect calls (Effect.xx(Effect.yy(Effect.zz(...)))). Why: they hide sequencing and spread flow. Fix: build values first, then run one flat Effect pipeline.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectLadder = defineRule({\n create(context: OxlintContext) {\n return {\n VariableDeclaration(node: any) {\n for (const declaration of node.declarations ?? []) {\n if (hasDeepNestedEffectFirstArgument(declaration.init)) {\n report(\n context,\n declaration.init,\n \"Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.\",\n );\n }\n }\n },\n ReturnStatement(node: any) {\n if (hasDeepNestedEffectFirstArgument(node.argument)) {\n report(\n context,\n node.argument,\n \"Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.\",\n );\n }\n },\n };\n },\n});\n\nconst noFlatMapLadder = defineRule({\n create(context: OxlintContext) {\n const version = effectVersionFor(context.options);\n return {\n VariableDeclaration(node: any) {\n for (const declaration of node.declarations ?? []) {\n const message = getFlatMapLadderMessage(declaration.init, version);\n if (message) {\n report(context, declaration.init, message);\n }\n }\n },\n ReturnStatement(node: any) {\n const message = getFlatMapLadderMessage(node.argument, version);\n if (message) {\n report(context, node.argument, message);\n }\n },\n };\n },\n});\n\nconst noPipeLadder = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (isPipeCall(node) && containsPipeCall(node.arguments)) {\n report(\n context,\n node,\n \"Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.\",\n );\n }\n },\n };\n },\n});\n\nconst noCallTower = defineRule({\n create(context: OxlintContext) {\n return {\n CallExpression(node: any) {\n if (hasNestedEffectCallArgument(node)) {\n report(\n context,\n node,\n \"Rule: avoid nested Effect call towers (Effect.fn(Effect.fn(...))). Why: it hides sequencing. Fix: build the inner Effect first, then use pipe/Effect.flatMap/Effect.andThen for a single flat pipeline.\",\n );\n }\n },\n };\n },\n});\n\nconst noEffectOrElseLadder = defineRule({\n create(context: OxlintContext) {\n if (effectVersionFor(context.options) === 4) return {};\n return {\n CallExpression(node: any) {\n if (hasOrElseSequencingFirstArgument(node)) {\n report(\n context,\n node,\n \"Rule: avoid Effect.orElse around sequencing chains. Why: it hides error handling and splits the flow. Fix: move error handling to a single terminal decision after the pipeline.\",\n );\n }\n },\n };\n },\n});\n\nconst noUnboundedEffectAll = createVersionedEffectCallbackRule(\n (node, _version, context) => isUnboundedEffectAll(node, context) ? node : undefined,\n () => \"Rule: avoid unbounded Effect.all concurrency. Fix: use a finite concurrency budget or omit the option for sequential execution.\",\n);\n\nconst noFireAndForgetFork = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ExpressionStatement(node: any) {\n const version = effectVersionFor(context.options);\n const fork = hasEffectEcosystemImport ? discardedFork(node.expression, version) : undefined;\n if (fork) {\n report(\n context,\n fork,\n version === 3\n ? \"Rule: avoid fire-and-forget Effect.fork. Why: detached fibers hide failure, interruption, and ownership. Fix: bind the fiber and join/await/interrupt it, or use Effect.forkScoped / Effect.forkIn with an explicit scope.\"\n : \"Rule: avoid discarded Effect.forkChild / Effect.forkDetach constructions or handles. Why: a bare construction is lazy and starts no work; yielding then discarding the fiber loses explicit observation. Child fibers follow parent lifetime, detached fibers do not. Fix: retain and join/await/interrupt the fiber, or use forkScoped / forkIn with explicit scope ownership.\",\n );\n }\n },\n };\n },\n});\n\nconst noForkInLoop = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n const checkLoop = (node: unknown) => {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n const version = effectVersionFor(context.options);\n const fork = version === 3 ? containsEffectForkCall((node as Node).body)\n : findOwnCallbackNode((node as Node).body, child => v4ForkConstruction(child) !== undefined);\n if (fork) {\n report(\n context,\n version === 4 ? v4ForkConstruction(fork) : fork,\n version === 3\n ? \"Rule: avoid Effect.fork inside loops. Why: loop-spawned fibers create unbounded concurrency and unclear ownership. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit or a scoped supervisor.\"\n : \"Rule: avoid Effect.forkChild / Effect.forkDetach inside loops. Why: per-item forks lack a collection-wide concurrency budget even when handles are retained. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit; preserve observation and lifetime ownership.\",\n );\n }\n };\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n ForStatement: checkLoop,\n ForInStatement: checkLoop,\n ForOfStatement: checkLoop,\n WhileStatement: checkLoop,\n DoWhileStatement: checkLoop,\n };\n },\n});\n\nconst noRaceWithoutCleanup = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n CallExpression(node: any) {\n const version = effectVersionFor(context.options);\n if (hasEffectEcosystemImport && isEffectRaceWithoutCleanup(node, version)) {\n report(\n context,\n node,\n version === 3\n ? \"Rule: avoid Effect.race without loser cleanup. Why: racing effects without ensuring/scoped cleanup can leak losing work or resources. Fix: wrap raced effects with Effect.ensuring/acquireRelease or use a scoped race boundary.\"\n : \"Rule: require visible cleanup ownership around Effect races. Why: race operators interrupt losers, but resource release still needs a finalizer or scope. Fix: expose ensuring/acquireRelease or a scoped race boundary; race/raceAll select success, raceFirst/raceAllFirst select first completion.\",\n );\n }\n },\n };\n },\n});\n\nconst noUnobservedFiber = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const forkedFibers = new Map<string, unknown>();\n const observedFibers = new Set<string>();\n const v4Bindings = new Set<any>();\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclarator(node: any) {\n if (effectVersionFor(context.options) === 4) {\n if (isIdentifier(node.id) && node.init?.type === \"YieldExpression\" && v4ForkConstruction(node.init.argument)) v4Bindings.add(node);\n return;\n }\n const name = forkedFiberVariableName(node);\n if (name) {\n forkedFibers.set(name, node);\n }\n },\n CallExpression(node: any) {\n if (effectVersionFor(context.options) === 4) return;\n const name = observedFiberVariableName(node);\n if (name) {\n observedFibers.add(name);\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n if (effectVersionFor(context.options) === 4) {\n for (const node of v4Bindings) {\n const variables = context.sourceCode?.getDeclaredVariables(node) ?? [];\n if (!variables.some(variable => variable.references.some(reference => v4FiberObservedReference(reference.identifier)))) {\n report(context, node, \"Rule: avoid unobserved forked fibers. Why: yielded child/detached handles need explicit observation or ownership transfer. Fix: join/await/interrupt the same lexical binding, return it to its owner, or use scoped fork APIs. This checks reference syntax, not whether observation executes.\");\n }\n }\n return;\n }\n\n for (const [name, node] of forkedFibers) {\n if (!observedFibers.has(name)) {\n report(\n context,\n node,\n \"Rule: avoid unobserved forked fibers. Why: forked fiber failures and interruption should be observed. Fix: pass the fiber to Fiber.join, Fiber.await, Fiber.interrupt, or use scoped fork APIs.\",\n );\n }\n }\n },\n };\n },\n});\n\nconst noUnboundedConcurrentRetry = createVersionedEffectCallbackRule(\n (node, _version, context) => isUnboundedConcurrentRetry(node, context) ? node : undefined,\n () => \"Rule: avoid unbounded concurrent retry policies. Fix: use finite collection concurrency and bound retry/backoff separately.\",\n);\nconst noBlockingCallInEffect = createVersionedEffectCallbackRule(\n findBlockingSyncCallInEffectLogic,\n version => `Rule: avoid blocking sync calls inside Effect logic. Why: synchronous I/O or CPU work blocks the executing JavaScript thread; wrapping it in a Promise does not offload it. Fix: use genuinely asynchronous platform APIs via Effect.${version === 4 ? \"callback\" : \"async\"}/tryPromise, or a dedicated worker for blocking work. Sync suffix recognition is a heuristic.`,\n);\n\nconst noPromiseConcurrencyInEffect = createVersionedEffectCallbackRule(\n findPromiseConcurrencyInEffectLogic,\n version => `Rule: avoid Promise concurrency APIs inside Effect logic. Why: raw Promise aggregation does not own interruption of its underlying operations. Fix: use bounded Effect.all/forEach, Effect.${version === 4 ? \"result\" : \"either\"} for settled outcomes, raceFirst for first completion or race for first success, with signal-aware boundary adapters. Preserve application error semantics explicitly.`,\n);\n\nconst noSharedMutableStateAcrossFibers = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const mutableNames = new Set<string>();\n const declarations: any[] = [];\n const workNodes: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclaration(node: any) {\n if (node.kind !== \"let\" && node.kind !== \"var\") {\n return;\n }\n\n if (effectVersionFor(context.options) === 4) {\n declarations.push(node);\n return;\n }\n\n for (const name of variableDeclarationIdentifierNames(node)) {\n mutableNames.add(name);\n }\n },\n CallExpression(node: any) {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n if (effectVersionFor(context.options) === 4) {\n const work = v4SharedStateWork(node);\n if (work) workNodes.push(work);\n return;\n }\n\n const workNode = concurrentEffectWorkNode(node);\n if (!workNode) {\n return;\n }\n\n const mutationNode = findSharedMutableStateMutation(workNode, mutableNames);\n if (mutationNode) {\n report(\n context,\n mutationNode,\n \"Rule: avoid mutating shared state across fibers. Why: outer let/var state mutated from forked or parallel work creates nondeterministic races. Fix: model shared state with Ref/SynchronizedRef/Queue or aggregate immutable results with bounded Effect.all/forEach.\",\n );\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || effectVersionFor(context.options) !== 4) return;\n const variables = declarations.flatMap(node => context.sourceCode.getDeclaredVariables(node));\n for (const work of workNodes) {\n const mutation = lexicalWorkMutation(work, variables);\n if (mutation) report(context, mutation, \"Rule: avoid mutating shared state across fibers. Why: outer let/var writes in child/detached or collection work couple workers through mutable state. Fix: use Ref updates or aggregate immutable results. This checks lexical inline work, not execution or a proven data race; collections default to sequential execution.\");\n }\n },\n };\n },\n});\n\nconst noTimeoutWithNoninterruptiblePromise = createVersionedEffectCallbackRule(\n noninterruptiblePromiseTimeoutNode,\n () => \"Rule: avoid timeout around noninterruptible Promise effects. Why: Effect timeout interrupts the wrapper, but the underlying operation stops only if it observes cancellation. Fix: accept and forward AbortSignal in the adapter to an API that honours it. Parameter presence is a syntax heuristic, not proof of cancellation.\",\n);\nconst noUninterruptibleConcurrentRegion = createVersionedEffectCallbackRule(\n (node, version) => isUninterruptibleConcurrentRegion(node, version) ? node : undefined,\n () => \"Rule: avoid uninterruptible concurrent regions. Why: broad masking around collection, fork, race or waiting work can defer cancellation and shutdown. Fix: keep only a short critical section masked and explicitly restore interruption for long-running work. Scoping alone does not restore interruptibility; syntax does not prove the mask is actually executed.\",\n);\nconst noUnboundedQueueOrPubSub = createVersionedEffectCallbackRule(\n (node, version) => isUnboundedQueueOrPubSub(node, version) ? node : undefined,\n () => \"Rule: avoid unbounded Queue or PubSub constructors. Why: unbounded buffers hide backpressure and can fail under load. Fix: use Queue.bounded / PubSub.bounded with an explicit capacity at the owning boundary.\",\n);\n\nconst noGlobalMutableConcurrencyState = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const globalMutableNames = new Set<string>();\n const declarations: any[] = [];\n const workNodes: unknown[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n VariableDeclaration(node: any) {\n if (effectVersionFor(context.options) === 4) { declarations.push(node); return; }\n for (const name of mutableGlobalDeclarationNames(node)) {\n globalMutableNames.add(name);\n }\n },\n CallExpression(node: any) {\n if (!hasEffectEcosystemImport) {\n return;\n }\n\n if (effectVersionFor(context.options) === 4) {\n const work = v4SharedStateWork(node);\n if (work) workNodes.push(work);\n return;\n }\n const workNode = concurrentEffectWorkNode(node);\n if (!workNode) {\n return;\n }\n\n const mutationNode = findSharedMutableStateMutation(workNode, globalMutableNames);\n if (mutationNode) {\n report(\n context,\n mutationNode,\n \"Rule: avoid global mutable concurrency state. Why: module-scope mutable state touched from concurrent Effect work behaves like shared mutable global state. Fix: move ownership into Ref/SynchronizedRef/Queue/Layer state or pass immutable values through bounded effects.\",\n );\n }\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || effectVersionFor(context.options) !== 4) return;\n const variables = declarations.flatMap(node => context.sourceCode.getDeclaredVariables(node).filter(variable =>\n (variable.scope.type === \"module\" || variable.scope.type === \"global\") && mutableGlobalDeclarationNames(node).includes(variable.name)));\n for (const work of workNodes) {\n const mutation = lexicalWorkMutation(work, variables);\n if (mutation) report(context, mutation, \"Rule: avoid global mutable concurrency state. Why: module-owned let/var or mutable containers couple inline workers. Fix: own Ref or immutable results in a service/layer. Lexical syntax does not prove execution or a data race; default collections are sequential.\");\n }\n },\n };\n },\n});\n\nconst noManualDeferredCoordination = defineRule({\n create(context: OxlintContext) {\n let hasEffectEcosystemImport = false;\n const deferredScopes = [new Set<string>()];\n const reported = new WeakSet<object>();\n const bindings: any[] = [];\n\n return {\n ImportDeclaration(node: any) {\n const source = getImportSource(node);\n if (source && isEffectEcosystemImport(source)) {\n hasEffectEcosystemImport = true;\n }\n },\n FunctionDeclaration() {\n deferredScopes.push(new Set());\n },\n \"FunctionDeclaration:exit\"() {\n deferredScopes.pop();\n },\n FunctionExpression() {\n deferredScopes.push(new Set());\n },\n \"FunctionExpression:exit\"() {\n deferredScopes.pop();\n },\n ArrowFunctionExpression() {\n deferredScopes.push(new Set());\n },\n \"ArrowFunctionExpression:exit\"() {\n deferredScopes.pop();\n },\n VariableDeclarator(node: any) {\n if (effectVersionFor(context.options) === 4) {\n const init = node.init?.type === \"YieldExpression\" ? node.init.argument : node.init;\n if (isIdentifier(node.id) && (isMemberCall(init, \"Deferred\", \"make\") || isMemberCall(init, \"Deferred\", \"makeUnsafe\"))) bindings.push(node);\n return;\n }\n const name = deferredBindingName(node);\n if (name) {\n deferredScopes.at(-1)?.add(name);\n }\n },\n CallExpression(node: any) {\n if (effectVersionFor(context.options) === 4) return;\n if (!hasEffectEcosystemImport || !isDeferredAwaitCall(node)) {\n return;\n }\n\n const binding = firstArgument(node);\n if (!isIdentifier(binding) || !deferredScopes.at(-1)?.has(binding.name)) {\n return;\n }\n\n if (isDeferredAwaitProtected(node, binding.name) || reported.has(node)) {\n return;\n }\n\n reported.add(node);\n report(\n context,\n node,\n \"Rule: avoid unbounded manual Deferred coordination. Why: a local latch can wait forever and make shutdown or failure ownership implicit. Fix: bound the await with a timeout/race, keep it interruptible, or tie completion and cleanup to a scope finalizer.\",\n );\n },\n \"Program:exit\"() {\n if (!hasEffectEcosystemImport || effectVersionFor(context.options) !== 4) return;\n for (const binding of bindings) for (const variable of context.sourceCode.getDeclaredVariables(binding)) for (const reference of variable.references) {\n const call = (reference.identifier as unknown as Node).parent;\n if (isDeferredAwaitCall(call) && firstArgument(call) === reference.identifier && !isDeferredAwaitProtected(call, variable.name, 4, variable.references)) {\n report(context, call, \"Rule: avoid unbounded manual Deferred coordination. Why: a local latch needs visible completion or cancellation ownership. Fix: use a timeout/race or an interruptible owner with a same-binding finalizer. Scope/interruptibility/finalizer markers alone do not prove eventual completion.\");\n }\n }\n },\n };\n },\n});\n\nconst noAcquireWithoutScopedRelease = createVersionedEffectCallbackRule(\n (node, version) => {\n const work = concurrentWorkArguments(node, version);\n return work ? findUnscopedResourceAcquisitions(work, version) : undefined;\n },\n version => `Rule: avoid resource acquisition without scoped release. Why: acquiring a client, connection, file, or handle inside concurrent work can outlive failures and interruption. Fix: ${version === 3 ? \"wrap acquisition in acquireRelease/acquireUseRelease, use Effect.scoped, or register a matching finalizer.\" : \"own release; a scope marker is insufficient.\"}`,\n true,\n);\n\nconst noYieldWithHeldSemaphorePermit = createVersionedEffectCallbackRule(\n (node, version) => {\n const work = heldSemaphoreWork(node, version);\n return work && (version === 4 ? containsEffect4ConcurrentOperation(work, true) : containsHighRiskSuspension(work)) ? node : undefined;\n },\n () => \"Rule: avoid suspension while holding a semaphore permit. Why: unrelated waits hold capacity needed by other work. Fix: narrow coordination critical sections when semantics allow. Async work may intentionally be permit-bound; moving it outside changes concurrency limits. This strict policy is not leak detection.\",\n);\n\nconst noYieldWithHeldMutableRef = createVersionedEffectCallbackRule(\n (node, version) => {\n const callback = synchronizedRefModifierWork(node, version);\n return callback && (version === 3 ? containsHighRiskSuspension(callback) : containsEffect4ConcurrentOperation(callbackBody(callback) ?? callback, true)) ? node : undefined;\n },\n version => `Rule: avoid suspension while holding synchronized reference coordination. Why: effectful SynchronizedRef modifiers hold internal coordination while the callback sleeps, awaits, or starts concurrent work. Fix: ${version === 3 ? \"compute the effect outside the modifier and commit a short synchronous state transition.\" : \"move independent work outside; retain atomicity.\"}`,\n);\n\nconst preventDynamicImports = defineRule({\n create(context: OxlintContext) {\n return {\n ImportExpression(node: any) {\n report(\n context,\n node,\n \"Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.\",\n );\n },\n };\n },\n});\n\nconst noUnscopedBackgroundFiber = createVersionedEffectCallbackRule(\n (node, version) => {\n if (version === 3) return isEffectMemberCallNamed(node, \"forkDaemon\") && !containsEffectMemberCallNamed(firstArgument(node), \"supervised\") ? node : undefined;\n const operator = isPipeCall(node) ? ((node as Node).arguments as unknown[]).at(-1) : (node as Node)?.callee;\n if (isEffectMemberCallNamed(node, \"forkDetach\")) {\n const input = firstArgument(node);\n return input && !isIdentifier(input, \"undefined\") && !isObjectExpression(input) ? node : undefined;\n }\n return isEffectMemberCallNamed(operator, \"forkDetach\") || isEffectMemberExpressionNamed(operator, \"forkDetach\") ? node : undefined;\n },\n version => `Rule: avoid unscoped background fibers. Why: Effect.${version === 3 ? \"forkDaemon\" : \"forkDetach\"} detaches work from the caller's scope and can outlive failures and shutdown. Fix: use forkScoped/forkIn ${version === 3 ? \"or make supervisor ownership explicit in the child effect.\" : \"or child ownership; join is not lifetime ownership.\"}`,\n);\n\nfunction resourceReleaseCallbackArguments(node: unknown, version: EffectVersion = 3): readonly unknown[] {\n if (!isObjectValue(node) || !Array.isArray((node as Node).arguments)) {\n return [];\n }\n\n const arguments_ = (node as Node & { arguments: unknown[] }).arguments;\n const offset = isEffectMemberCallNamed(node, \"acquireUseRelease\") ? 2\n : isResourceAcquireReleaseCall(node, version) ? 1\n : isEffectMemberCallNamed(node, \"addFinalizer\") ? 0\n : isMemberCall(node, \"Scope\", \"addFinalizer\") || isMemberCall(node, \"Scope\", \"addFinalizerExit\") ? 1\n : -1;\n return offset < 0 ? [] : arguments_.slice(offset, version === 4 || offset === 0 ? offset + 1 : undefined);\n}\n\nfunction resourceAncestor(node: unknown, matches: (node: Node) => boolean): Node | undefined {\n let current = isObjectValue(node) ? (node as Node).parent : undefined;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return undefined;\n seen.add(current);\n if (matches(current as Node)) return current as Node;\n current = (current as Node).parent;\n }\n\n return undefined;\n}\n\nfunction hasReleaseOwnership(node: unknown, version: EffectVersion = 3): boolean {\n return resourceAncestor(node, current => (version === 4 || isFunctionLike(current)) &&\n resourceReleaseCallbackArguments(current.parent, version).some(argument => argument === current)) !== undefined;\n}\n\nfunction createResourceLifetimeRule(\n matches: (node: unknown, version: EffectVersion) => boolean,\n message: (version: EffectVersion) => string,\n) {\n return createVersionedEffectCallbackRule((node, version) => matches(node, version) ? node : undefined, message, false, true);\n}\n\nconst noManualResourceClose = createResourceLifetimeRule(\n (node, version) => isResourceCleanupCall(node) && !hasReleaseOwnership(node, version),\n () => \"Rule: avoid manual resource cleanup. Why: direct close/dispose calls can bypass Effect scope ownership. Fix: acquire the resource with Effect.acquireRelease or register cleanup with a Scope finalizer.\",\n);\n\nfunction isScopeMakeCall(node: unknown): node is Node & { arguments: unknown[] } {\n return isMemberCall(node, \"Scope\", \"make\") && Array.isArray((node as Node).arguments);\n}\n\nfunction isScopeCloseFor(node: unknown, bindingName: string): boolean {\n return isMemberCall(node, \"Scope\", \"close\") && isIdentifier(firstArgument(node as Node & { arguments: unknown[] }), bindingName);\n}\n\nconst lexicalScopeNodeTypes = new Set([\n \"BlockStatement\",\n \"CatchClause\",\n \"ForInStatement\",\n \"ForOfStatement\",\n \"ForStatement\",\n \"Program\",\n \"SwitchStatement\",\n]);\n\nfunction lexicalScopeNode(node: unknown): Node | undefined {\n return resourceAncestor(node, current => lexicalScopeNodeTypes.has(current.type ?? \"\") || isFunctionLike(current));\n}\n\nfunction isWithinLexicalScope(node: unknown, scope: Node): boolean {\n let current = node;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return false;\n seen.add(current);\n\n if (current === scope) return true;\n current = (current as Node).parent;\n }\n\n return false;\n}\n\nfunction lexicalScopeDepth(scope: Node): number {\n let depth = 0;\n let current: unknown = scope;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return depth;\n seen.add(current);\n depth += 1;\n current = (current as Node).parent;\n }\n\n return depth;\n}\n\nfunction patternBindingIdentifiers(pattern: unknown): Node[] {\n if (isIdentifier(pattern)) return [pattern];\n if (!isObjectValue(pattern)) return [];\n\n const node = pattern as Node;\n switch (node.type) {\n case \"ArrayPattern\":\n return Array.isArray(node.elements)\n ? node.elements.flatMap((element) => patternBindingIdentifiers(element))\n : [];\n case \"AssignmentPattern\":\n return patternBindingIdentifiers(node.left);\n case \"ObjectPattern\":\n return Array.isArray(node.properties)\n ? node.properties.flatMap((property) => {\n if (!isObjectValue(property)) return [];\n\n const propertyNode = property as Node;\n if (propertyNode.type === \"Property\") {\n return patternBindingIdentifiers(propertyNode.value);\n }\n if (propertyNode.type === \"RestElement\") {\n return patternBindingIdentifiers(propertyNode.argument);\n }\n return [];\n })\n : [];\n case \"RestElement\":\n return patternBindingIdentifiers(node.argument);\n case \"TSParameterProperty\":\n return patternBindingIdentifiers(node.parameter);\n default:\n return [];\n }\n}\n\nfunction lexicalBindingsInFunction(functionNode: Node): Node[] {\n return findNodes(functionNode.body, (candidate) => (\n isObjectValue(candidate) &&\n lexicalBindingIdentifiers(candidate as Node).length > 0 &&\n enclosingFunction(candidate) === functionNode\n )) as Node[];\n}\n\nfunction lexicalBindingIdentifiers(binding: Node): Node[] {\n if (binding.type === \"VariableDeclarator\") {\n return patternBindingIdentifiers(binding.id);\n }\n\n if (binding.type === \"CatchClause\") {\n return patternBindingIdentifiers(binding.param);\n }\n\n return (\n (binding.type === \"ClassDeclaration\" || binding.type === \"FunctionDeclaration\") &&\n isIdentifier(binding.id)\n )\n ? [binding.id]\n : [];\n}\n\nfunction lexicalBindingScope(binding: Node): Node | undefined {\n return binding.type === \"CatchClause\"\n ? lexicalScopeNode(binding.param)\n : lexicalScopeNode(binding);\n}\n\nfunction variableBindingForReference(reference: unknown, functionNode: Node): Node | undefined {\n if (!isIdentifier(reference)) return undefined;\n\n let best: Node | undefined;\n let bestDepth = -1;\n\n for (const binding of lexicalBindingsInFunction(functionNode)) {\n if (!lexicalBindingIdentifiers(binding).some((identifier) => (\n isIdentifier(identifier, reference.name)\n ))) continue;\n\n const scope = lexicalBindingScope(binding);\n if (scope === undefined || !isWithinLexicalScope(reference, scope)) continue;\n\n const depth = lexicalScopeDepth(scope);\n if (depth > bestDepth) {\n best = binding;\n bestDepth = depth;\n }\n }\n\n return best;\n}\n\nfunction directScopeMakeInitializer(init: unknown, scopeMake: unknown): boolean {\n if (init === scopeMake) return true;\n\n return (\n isObjectValue(init) &&\n (init as Node).type === \"YieldExpression\" &&\n (init as Node).delegate === true &&\n (init as Node).argument === scopeMake\n );\n}\n\nfunction enclosingFunction(node: unknown): Node | undefined {\n return resourceAncestor(node, isFunctionLike);\n}\n\nfunction scopeMakeBindingDeclaration(node: unknown): Node | undefined {\n let current = isObjectValue(node) ? (node as Node).parent : undefined;\n const seen = new WeakSet<object>();\n\n while (isObjectValue(current)) {\n if (seen.has(current)) return undefined;\n seen.add(current);\n\n if (\n (current as Node).type === \"VariableDeclarator\" &&\n isIdentifier((current as Node).id) &&\n directScopeMakeInitializer((current as Node).init, node)\n ) {\n return current as Node;\n }\n\n if (isFunctionLike(current)) return undefined;\n current = (current as Node).parent;\n }\n\n return undefined;\n}\n\nfunction hasMatchingScopeClose(node: unknown): boolean {\n const declaration = scopeMakeBindingDeclaration(node);\n const functionNode = enclosingFunction(node);\n if (declaration === undefined || functionNode === undefined) return false;\n\n const bindingName = ((declaration.id as Node & { name: string }).name);\n\n return findNodes(\n functionNode.body,\n (candidate) => (\n isScopeCloseFor(candidate, bindingName) &&\n enclosingFunction(candidate) === functionNode &&\n variableBindingForReference(\n firstArgument(candidate as Node & { arguments: unknown[] }),\n functionNode,\n ) === declaration\n ),\n ).length > 0;\n}\n\nfunction scopeCloseUsesCallbackParameter(\n node: unknown,\n parameter: Node & { name: string },\n callback: Node,\n): boolean {\n const reference = firstArgument(node as Node & { arguments: unknown[] });\n if (!isIdentifier(reference, parameter.name)) return false;\n\n return (\n variableBindingForReference(reference, callback) === undefined &&\n Array.isArray(callback.params) &&\n (callback.params as unknown[]).some((candidate) => candidate === parameter)\n );\n}\n\nfunction hasMatchingScopeReleaseCallback(node: Node & { arguments: unknown[] }): boolean {\n const arguments_ = (node as Node & { arguments: unknown[] }).arguments;\n const callbacks = isEffectMemberCallNamed(node, \"acquireUseRelease\")\n ? arguments_.slice(2)\n : arguments_.slice(1);\n\n return callbacks.some((callback) => {\n if (!isFunctionLike(callback)) return false;\n const parameter = ((callback as Node).params as unknown[] | undefined)?.[0];\n if (!isIdentifier(parameter)) return false;\n\n return findNodes(\n (callback as Node).body,\n (candidate) => (\n isScopeCloseFor(candidate, parameter.name) &&\n enclosingFunction(candidate) === callback &&\n scopeCloseUsesCallbackParameter(candidate, parameter, callback as Node)\n ),\n ).length > 0;\n });\n}\n\nfunction hasScopeOwner(node: unknown, version: EffectVersion = 3): boolean {\n return resourceAncestor(node, current => (\n version === 3 && (isEffectMemberCallNamed(current, \"scoped\") || isMemberCall(current, \"Layer\", \"scoped\"))\n ) || (\n isResourceAcquireReleaseCall(current, version) && firstArgument(current) === node && hasMatchingScopeReleaseCallback(current)\n )) !== undefined || hasMatchingScopeClose(node);\n}\n\nconst noUnboundScope = createResourceLifetimeRule(\n (node, version) => isScopeMakeCall(node) && !hasScopeOwner(node, version),\n version => `Rule: bind Scope.make to an owned lifecycle. Why: an unbound Scope can leak resources and finalizers. Fix: ${version === 3 ? \"use Effect.scoped/Layer.scoped, close the scope explicitly, or acquire it with a matching release callback.\" : \"use Effect.scope or acquire it with a matching Scope.close release callback. Effect.scoped alone does not own a separate scope.\"}`,\n);\n\nconst noResourceSucceedEscape = createResourceLifetimeRule(\n node => isEffectMemberCallNamed(node, \"succeed\") && isResourceLikeExpression(firstArgument(node)),\n () => \"Rule: do not let live resources escape through Effect.succeed. Why: ordinary success values do not express resource lifetime ownership. Fix: keep the resource inside Effect.acquireRelease, Scope, or a service layer.\",\n);\n\nfunction isResourceLikeConstruction(node: unknown): boolean {\n if (!isObjectValue(node) || (node as Node).type !== \"NewExpression\") {\n return false;\n }\n\n const callee = (node as Node).callee;\n let name: string | undefined;\n if (isIdentifier(callee)) {\n name = callee.name;\n } else if (\n isObjectValue(callee) &&\n (callee as Node).type === \"MemberExpression\" &&\n (callee as Node).computed !== true &&\n isIdentifier((callee as Node).property)\n ) {\n name = ((callee as Node).property as Node & { name: string }).name;\n }\n\n return name !== undefined && isResourceLikeName(name);\n}\n\nfunction isResourceLifecycleCandidate(node: unknown): boolean {\n return resourceAcquisitionCall(node) || isResourceLikeConstruction(node);\n}\n\nfunction isResourceAcquireReleaseCall(node: unknown, version: EffectVersion = 3): node is Node & { arguments: unknown[] } {\n return (\n isEffectMemberCallNamed(node, \"acquireRelease\") ||\n (version === 3 && isEffectMemberCallNamed(node, \"acquireReleaseInterruptible\")) ||\n isEffectMemberCallNamed(node, \"acquireUseRelease\")\n );\n}\n\nfunction hasResourceLifecycleOwner(node: unknown, version: EffectVersion = 3): boolean {\n if (hasReleaseOwnership(node, version)) {\n return true;\n }\n\n return resourceAncestor(node, current => (\n isResourceAcquireReleaseCall(current, version) ||\n isEffectMemberCallNamed(current, \"scoped\") ||\n (version === 3 && isMemberCall(current, \"Layer\", \"scoped\")) ||\n isEffectScopedPipeCall(current)\n )) !== undefined;\n}\n\nfunction resourceLexicalScope(node: unknown): Node | undefined {\n return resourceAncestor(node, current => isFunctionLike(current) || current.type === \"Program\");\n}\n\nfunction unownedResourcesInScope(scope: Node, version: EffectVersion = 3): unknown[] {\n return findNodes(scope, (candidate) => (\n isResourceLifecycleCandidate(candidate) &&\n resourceLexicalScope(candidate) === scope &&\n !hasResourceLifecycleOwner(candidate, version)\n ));\n}\n\nfunction nestedAcquireReleaseNode(node: unknown, version: EffectVersion = 3): unknown | undefined {\n if (!isResourceAcquireReleaseCall(node, version)) {\n return undefined;\n }\n\n return findNodes(node, candidate => isResourceAcquireReleaseCall(candidate, version)).length >= 3 ? node : undefined;\n}\n\nfunction requestLifecycleFunctionName(node: unknown): string | undefined {\n if (!isObjectValue(node) || !isFunctionLike(node)) {\n return undefined;\n }\n\n const functionNode = node as Node;\n if (isIdentifier(functionNode.id)) {\n return functionNode.id.name;\n }\n\n const parent = functionNode.parent;\n if (!isObjectValue(parent)) {\n return undefined;\n }\n\n if ((parent as Node).type === \"VariableDeclarator\" && isIdentifier((parent as Node).id)) {\n return ((parent as Node).id as Node & { name: string }).name;\n }\n\n if (\n (parent as Node).type === \"Property\" &&\n isIdentifier((parent as Node).key)\n ) {\n return ((parent as Node).key as Node & { name: string }).name;\n }\n\n return undefined;\n}\n\nfunction isRequestLifecycleFunction(node: unknown): boolean {\n const name = requestLifecycleFunctionName(node);\n return name !== undefined && /(?:handler|route|request|endpoint|controller)$/i.test(name);\n}\n\nfunction requestResourceOwner(node: unknown, version: EffectVersion): Node | undefined {\n if (version === 3) return enclosingFunction(node);\n return resourceAncestor(node, current => {\n if (!isFunctionLike(current)) return false;\n const parent = current.parent;\n return getEffectGeneratorArgument(parent, \"gen\", 4) !== current &&\n getEffectGeneratorArgument(parent, \"fn\", 4) !== current &&\n !effectLogicCallbacks(parent, 4).includes(current) &&\n ![\"sync\", \"suspend\", \"promise\", \"tryPromise\"].some(name => isEffectMemberCallNamed(parent, name) && parent.arguments.includes(current));\n });\n}\n\nfunction requestScopedResourceNodes(node: unknown, version: EffectVersion = 3): unknown[] {\n if (!isRequestLifecycleFunction(node) || !isObjectValue(node)) {\n return [];\n }\n\n const functionNode = node as Node;\n return findNodes(functionNode.body, (candidate) => (\n isResourceLifecycleCandidate(candidate) && requestResourceOwner(candidate, version) === functionNode\n ));\n}\n\nfunction openResourceInRunScope(node: unknown, version: EffectVersion = 3): unknown | undefined {\n const scope = resourceLexicalScope(node);\n if (scope === undefined) {\n return undefined;\n }\n\n return unownedResourcesInScope(scope, version)[0];\n}\n\nfunction programInitializerForReference(reference: unknown, version: EffectVersion = 3, context?: OxlintContext): unknown | undefined {\n if (!isIdentifier(reference)) {\n return undefined;\n }\n\n if (version === 4) {\n const root = resourceAncestor(reference, node => node.type === \"Program\");\n if (!root || !context?.sourceCode) return undefined;\n const declaration = findNodes(root, node => isObjectValue(node) && (node as Node).type === \"VariableDeclarator\")\n .find(node => context.sourceCode.getDeclaredVariables(node as ESTree.VariableDeclarator).some(variable => variable.references.some(entry => Object.is(entry.identifier, reference))));\n return (declaration as Node | undefined)?.init;\n }\n\n const functionScope = enclosingFunction(reference);\n const scopes = functionScope === undefined ? [] : [functionScope];\n let current = isObjectValue(reference)\n ? (reference as Node).parent\n : undefined;\n const seen = new WeakSet<object>();\n while (isObjectValue(current)) {\n if (seen.has(current)) {\n break;\n }\n seen.add(current);\n if ((current as Node).type === \"Program\") {\n scopes.push(current as Node);\n break;\n }\n current = (current as Node).parent;\n }\n\n for (const scope of scopes) {\n const declaration = findNode(scope, (candidate) => (\n isObjectValue(candidate) &&\n (candidate as Node).type === \"VariableDeclarator\" &&\n isIdentifier((candidate as Node).id, reference.name) &&\n (candidate as Node).init !== undefined\n ));\n if (declaration) {\n return (declaration as Node).init;\n }\n }\n\n return undefined;\n}\n\nfunction effectRunMissingLayerProvision(node: unknown, version: EffectVersion, context: OxlintContext): boolean {\n const execution = effectRunExecution(node, version);\n if (!execution) {\n return false;\n }\n\n const argument = execution.program;\n const search = (program: unknown, predicate: (node: unknown) => boolean) => version === 3\n ? findNode(program, predicate)\n : findNode(program, node => predicate(node) && requestResourceOwner(node, 4) === enclosingFunction(program));\n const program = search(argument, isYieldedServiceDependency) !== undefined\n ? argument\n : programInitializerForReference(argument, version, context) ?? argument;\n\n return (\n search(program, isYieldedServiceDependency) !== undefined &&\n search(program, isEffectOrLayerProvideCall) === undefined\n );\n}\n\nconst noResourceWithoutAcquireRelease = createResourceLifetimeRule(\n (node, version) => resourceAcquisitionCall(node) && !hasResourceLifecycleOwner(node, version),\n version => `Rule: acquire resources with an Effect release owner. Why: open/connect/create calls can leak across failure and interruption when they are ordinary calls. Fix: use Effect.acquireRelease, Effect.acquireUseRelease, ${version === 3 ? \"Effect.scoped, \" : \"\"}or a matching finalizer.`,\n);\n\nconst noRequestScopedLongLivedResource = createVersionedEffectCallbackRule(\n requestScopedResourceNodes,\n () => \"Rule: do not acquire long-lived resources inside request-scoped handlers. Why: per-request clients and pools multiply connections and make shutdown ownership ambiguous. Fix: provide the resource through a Layer or a longer-lived service boundary.\",\n true, true, [\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"],\n);\n\nconst noGlobalResourceSingleton = createVersionedEffectCallbackRule(\n node => enclosingFunction(node) === undefined && isResourceLikeConstruction(node) ? node : undefined,\n version => `Rule: do not create global resource singletons in Effect modules. Why: module-level clients and pools bypass Layer ownership and make tests and shutdown order implicit. Fix: construct the resource in a Layer${version === 3 ? \" or Effect.Service\" : \" using Context.Service\"} and provide it at the application boundary.`,\n false, true, [\"NewExpression\"],\n);\n\nconst noRunWithOpenResource = createVersionedEffectCallbackRule(\n (node, version) => isEffectRunCall(node, version) && openResourceInRunScope(node, version) !== undefined ? node : undefined,\n () => \"Rule: do not run an Effect while an unowned resource is open in the same scope. Why: runtime execution can finish without closing the resource. Fix: move acquisition into acquireRelease/scoped ownership and run only the managed effect.\",\n);\n\nconst noNestedAcquireRelease = createVersionedEffectCallbackRule(\n nestedAcquireReleaseNode,\n () => \"Rule: avoid deeply nested resource acquisition. Why: nested release stacks are difficult to audit and compose. Fix: build a named Layer or combine independent resources into one managed acquisition boundary.\",\n);\n\nconst noMissingLayerProvisionAtRun = createVersionedEffectCallbackRule(\n (node, version, context) => effectRunMissingLayerProvision(node, version, context) ? node : undefined,\n version => version === 3\n ? \"Rule: provide service layers before running an Effect that retrieves services. Why: an unprovided tag fails at runtime and hides the dependency contract at the boundary. Fix: compose the required Layer and use Effect.provide or Layer.provide before Effect.run*.\"\n : \"Rule: make service layer provision visible before running. Why: a context argument or Service-shaped yield does not prove Layer ownership. Fix: provide the required Layer before Effect.run*. This is syntax policy, not dependency type checking.\",\n);\n\nconst rules = {\n \"no-react-state\": noReactState,\n \"no-if-statement\": noIfStatement,\n \"no-switch-statement\": noSwitchStatement,\n \"no-ternary\": noTernary,\n \"no-return-null\": noReturnNull,\n \"no-option-as\": noOptionAs,\n \"no-effect-never\": noEffectNever,\n \"no-arrow-ladder\": noArrowLadder,\n \"no-branch-in-object\": noBranchInObject,\n \"no-iife-wrapper\": noIifeWrapper,\n \"no-return-in-arrow\": noReturnInArrow,\n \"no-return-in-callback\": noReturnInCallback,\n \"no-effect-fn-generator\": noEffectFnGenerator,\n \"no-effect-sync-console\": noEffectSyncConsole,\n \"no-console-in-effect-flow\": noConsoleInEffectFlow,\n \"no-effect-log-without-structured-context\": noEffectLogWithoutStructuredContext,\n \"require-span-on-public-service-method\": requireSpanOnPublicServiceMethod,\n \"no-runpromise-in-non-async-test-body\": noRunpromiseInNonAsyncTestBody,\n \"require-effect-flip-for-error-test\": requireEffectFlipForErrorTest,\n \"no-test-mock-layer-when-default-available\": noTestMockLayerWhenDefaultAvailable,\n \"no-nested-effect-gen\": noNestedEffectGen,\n \"no-yield-without-star-in-effect-gen\": noYieldWithoutStarInEffectGen,\n \"no-piped-yield-in-gen\": noPipedYieldInGen,\n \"no-gen-for-mapping\": noGenForMapping,\n \"prefer-gen-for-workflow\": preferGenForWorkflow,\n \"no-business-logic-in-pipe\": noBusinessLogicInPipe,\n \"no-large-anonymous-flow\": noLargeAnonymousFlow,\n \"no-effect-in-flow\": noEffectInFlow,\n \"prefer-named-flow\": preferNamedFlow,\n \"prefer-flow-for-pure-pipeline\": preferFlowForPurePipeline,\n \"prefer-pipe-for-behavior\": preferPipeForBehavior,\n \"prefer-decorated-effect-before-gen\": preferDecoratedEffectBeforeGen,\n \"no-workflow-in-behavior-pipe\": noWorkflowInBehaviorPipe,\n \"no-mixed-pillar-function\": noMixedPillarFunction,\n \"no-clever-effect-expression\": noCleverEffectExpression,\n \"prefer-extracted-concept\": preferExtractedConcept,\n \"prefer-effect-service\": preferEffectService,\n \"no-layer-provide-in-service-definition\": noLayerProvideInServiceDefinition,\n \"require-service-accessors\": requireServiceAccessors,\n \"require-service-dependencies\": requireServiceDependencies,\n \"no-namespace-effect-import\": noNamespaceEffectImport,\n \"no-manual-service-object-export\": noManualServiceObjectExport,\n \"no-layer-merge-in-request-handler\": noLayerMergeInRequestHandler,\n \"no-service-method-returning-promise\": noServiceMethodReturningPromise,\n \"prefer-layer-pipe\": preferLayerPipe,\n \"no-inline-layer-provide-in-program\": noInlineLayerProvideInProgram,\n \"prefer-layer-mergeall-for-infrastructure\": preferLayerMergeallForInfrastructure,\n \"no-service-layer-scatter\": noServiceLayerScatter,\n \"no-match-void-branch\": noMatchVoidBranch,\n \"no-json-parse-without-schema\": noJsonParseWithoutSchema,\n \"no-date-now-in-effect\": noDateNowInEffect,\n \"no-new-date-in-domain-logic\": noNewDateInDomainLogic,\n \"no-match-effect-branch\": noMatchEffectBranch,\n \"warn-effect-sync-wrapper\": warnEffectSyncWrapper,\n \"no-effect-side-effect-wrapper\": noEffectSideEffectWrapper,\n \"no-effect-all-step-sequencing\": noEffectAllStepSequencing,\n \"no-async-effect-combinator-callback\": noAsyncEffectCombinatorCallback,\n \"no-throw-in-effect-logic\": noThrowInEffectLogic,\n \"no-or-die-outside-boundary\": noOrDieOutsideBoundary,\n \"no-swallowed-catch-all\": noSwallowedCatchAll,\n \"no-effect-ignore\": noEffectIgnore,\n \"no-try-catch-in-effect-logic\": noTryCatchInEffectLogic,\n \"no-promise-api-in-effect-logic\": noPromiseApiInEffectLogic,\n \"no-try-catch\": noTryCatch,\n \"no-effect-wrapper-alias\": noEffectWrapperAlias,\n \"no-manual-effect-channels\": noManualEffectChannels,\n \"no-wrapgraphql-catchall\": noWrapgraphqlCatchall,\n \"no-render-side-effects\": noRenderSideEffects,\n \"no-atom-registry-effect-sync\": noAtomRegistryEffectSync,\n \"no-family-collection-read\": noFamilyCollectionRead,\n \"no-inline-runtime-provide\": noInlineRuntimeProvide,\n \"no-naked-object-state-update\": noNakedObjectStateUpdate,\n \"no-effect-succeed-variable\": noEffectSucceedVariable,\n \"no-effect-type-alias\": noEffectTypeAlias,\n \"no-public-generic-effect-error\": noPublicGenericEffectError,\n \"no-early-catchall-null\": noEarlyCatchallNull,\n \"no-empty-error-tag\": noEmptyErrorTag,\n \"no-expected-state-as-error\": noExpectedStateAsError,\n \"no-exception-domain-error\": noExceptionDomainError,\n \"no-effect-fail-error-message\": noEffectFailErrorMessage,\n \"no-catchall-generic-rethrow\": noCatchallGenericRethrow,\n \"no-log-only-error-handling\": noLogOnlyErrorHandling,\n \"no-error-as-public-effect-error\": noErrorAsPublicEffectError,\n \"no-unknown-public-error-channel\": noUnknownPublicErrorChannel,\n \"no-mixed-effect-error-shapes\": noMixedEffectErrorShapes,\n \"no-model-overlay-cast\": noModelOverlayCast,\n \"no-unknown-boolean-coercion-helper\": noUnknownBooleanCoercionHelper,\n \"no-fromnullable-nullish-coalesce\": noFromnullableNullishCoalesce,\n \"no-option-boolean-normalization\": noOptionBooleanNormalization,\n \"no-string-sentinel-return\": noStringSentinelReturn,\n \"no-string-sentinel-const\": noStringSentinelConst,\n \"no-raw-domain-id-alias\": noRawDomainIdAlias,\n \"no-boolean-domain-flag\": noBooleanDomainFlag,\n \"no-magic-domain-string\": noMagicDomainString,\n \"no-raw-domain-primitive-params\": noRawDomainPrimitiveParams,\n \"no-raw-time-domain-field\": noRawTimeDomainField,\n \"no-hidden-effect-execution\": noHiddenEffectExecution,\n \"no-boundary-try-catch-without-effect-map\": noBoundaryTryCatchWithoutEffectMap,\n \"no-node-fs-in-effect-code\": noNodeFsInEffectCode,\n \"no-node-platform-in-shared-code\": noNodePlatformInSharedCode,\n \"no-process-env-direct-read\": noProcessEnvDirectRead,\n \"no-overloaded-options-object\": noOverloadedOptionsObject,\n \"no-domain-logic-in-conditional\": noDomainLogicInConditional,\n \"no-implicit-state-machine-object\": noImplicitStateMachineObject,\n \"no-adhoc-domain-error\": noAdhocDomainError,\n \"no-domain-meaning-by-folder-only\": noDomainMeaningByFolderOnly,\n \"no-effect-as\": noEffectAs,\n \"no-effect-do\": noEffectDo,\n \"no-effect-bind\": noEffectBind,\n \"no-runtime-runfork\": noRuntimeRunFork,\n \"no-run-effect-outside-boundary\": noRunEffectOutsideBoundary,\n \"no-effect-async\": noEffectAsync,\n \"prevent-dynamic-imports\": preventDynamicImports,\n \"no-nested-effect-call\": noNestedEffectCall,\n \"no-effect-ladder\": noEffectLadder,\n \"no-flatmap-ladder\": noFlatMapLadder,\n \"no-pipe-ladder\": noPipeLadder,\n \"no-call-tower\": noCallTower,\n \"no-effect-orElse-ladder\": noEffectOrElseLadder,\n \"no-unbounded-effect-all\": noUnboundedEffectAll,\n \"no-fire-and-forget-fork\": noFireAndForgetFork,\n \"no-fork-in-loop\": noForkInLoop,\n \"no-race-without-cleanup\": noRaceWithoutCleanup,\n \"no-unobserved-fiber\": noUnobservedFiber,\n \"no-unbounded-concurrent-retry\": noUnboundedConcurrentRetry,\n \"no-blocking-call-in-effect\": noBlockingCallInEffect,\n \"no-promise-concurrency-in-effect\": noPromiseConcurrencyInEffect,\n \"no-shared-mutable-state-across-fibers\": noSharedMutableStateAcrossFibers,\n \"no-timeout-with-noninterruptible-promise\": noTimeoutWithNoninterruptiblePromise,\n \"no-uninterruptible-concurrent-region\": noUninterruptibleConcurrentRegion,\n \"no-unbounded-queue-or-pubsub\": noUnboundedQueueOrPubSub,\n \"no-global-mutable-concurrency-state\": noGlobalMutableConcurrencyState,\n \"no-manual-deferred-coordination\": noManualDeferredCoordination,\n \"no-acquire-without-scoped-release\": noAcquireWithoutScopedRelease,\n \"no-manual-resource-close\": noManualResourceClose,\n \"no-unbound-scope\": noUnboundScope,\n \"no-resource-succeed-escape\": noResourceSucceedEscape,\n \"no-resource-without-acquire-release\": noResourceWithoutAcquireRelease,\n \"no-request-scoped-long-lived-resource\": noRequestScopedLongLivedResource,\n \"no-global-resource-singleton\": noGlobalResourceSingleton,\n \"no-run-with-open-resource\": noRunWithOpenResource,\n \"no-nested-acquire-release\": noNestedAcquireRelease,\n \"no-missing-layer-provision-at-run\": noMissingLayerProvisionAtRun,\n \"no-yield-with-held-semaphore-permit\": noYieldWithHeldSemaphorePermit,\n \"no-yield-with-held-mutable-ref\": noYieldWithHeldMutableRef,\n \"no-unscoped-background-fiber\": noUnscopedBackgroundFiber,\n};\n\nfor (const ruleName of versionSensitiveRules) {\n const rule = rules[ruleName];\n rule.meta = {\n ...rule.meta,\n schema: withEffectVersionSchema(Array.isArray(rule.meta?.schema) ? rule.meta.schema : []) as RuleOptionsSchema,\n };\n}\n\ntype RuleName = keyof typeof rules;\n\nconst strictTestingObservabilityAndQaRuleNames = [\n \"no-runpromise-in-non-async-test-body\",\n \"require-effect-flip-for-error-test\",\n \"no-test-mock-layer-when-default-available\",\n] as const satisfies readonly RuleName[];\n\ntype StrictTestingObservabilityAndQaRuleName =\n typeof strictTestingObservabilityAndQaRuleNames[number];\n\nconst strictConcurrencySafetyRuleNames = [\n \"no-manual-deferred-coordination\",\n \"no-yield-with-held-semaphore-permit\",\n \"no-yield-with-held-mutable-ref\",\n \"no-unscoped-background-fiber\",\n] as const satisfies readonly RuleName[];\n\nconst strictErrorModelingRuleNames = [\n \"no-early-catchall-null\",\n \"no-empty-error-tag\",\n] as const satisfies readonly RuleName[];\n\nconst strictEffectFlowRuleNames = [\n \"no-business-logic-in-pipe\",\n] as const satisfies readonly RuleName[];\n\nconst strictPureTransformationRuleNames = [\n \"prefer-flow-for-pure-pipeline\",\n] as const satisfies readonly RuleName[];\n\nconst strictResourceLifetimeRuleNames = [\n \"no-request-scoped-long-lived-resource\",\n \"no-global-resource-singleton\",\n \"no-nested-acquire-release\",\n \"no-missing-layer-provision-at-run\",\n] as const satisfies readonly RuleName[];\n\nconst strictEffectCompositionRuleNames = [\n \"no-effect-fn-generator\",\n \"no-manual-effect-channels\",\n \"no-effect-type-alias\",\n] as const satisfies readonly RuleName[];\n\ntype StrictRuleName = StrictTestingObservabilityAndQaRuleName |\n typeof strictConcurrencySafetyRuleNames[number] |\n typeof strictErrorModelingRuleNames[number] |\n typeof strictEffectFlowRuleNames[number] |\n typeof strictPureTransformationRuleNames[number] |\n typeof strictResourceLifetimeRuleNames[number] |\n typeof strictEffectCompositionRuleNames[number];\n\nexport type EffectRuleOptions = {\n effectVersion?: EffectVersion;\n boundaryPaths?: readonly string[];\n configPaths?: readonly string[];\n};\nexport type EffectRuleEntry = \"error\" | [\"error\", EffectRuleOptions];\n\ntype ApplicableRuleName<N extends RuleName, V extends EffectVersion> =\n V extends 4 ? Exclude<N, typeof legacyOnlyRules[number]> : N;\ntype VersionedRuleEntry<N extends RuleName, V extends EffectVersion> =\n N extends typeof versionSensitiveRules[number] ? [\"error\", { effectVersion: V }] : \"error\";\n\nfunction rulesFromNames<const T extends readonly RuleName[], const V extends EffectVersion>(ruleNames: T, version: V) {\n return Object.fromEntries(\n ruleNames.filter((ruleName) => version === 3 || !(legacyOnlyRules as readonly string[]).includes(ruleName))\n .map((ruleName) => [`linteffect/${ruleName}`, (versionSensitiveRules as readonly string[]).includes(ruleName)\n ? [\"error\", { effectVersion: version }] : \"error\"]),\n ) as { [N in ApplicableRuleName<T[number], V> as `linteffect/${N}`]: VersionedRuleEntry<N, V> };\n}\n\nfunction presetFor<const T extends Record<`linteffect/${string}`, EffectRuleEntry>>(groupRules: T) {\n return {\n jsPlugins,\n rules: groupRules,\n } as const;\n}\n\nexport const jsPlugins = [\n {\n name: \"linteffect\",\n specifier: \"@opsydyn/oxlint-effect\",\n },\n] as const;\n\nfunction createVersionedConfigurations<const V extends EffectVersion>(version: V) {\n const reactAndRuntimeBoundariesRules = rulesFromNames([\n \"no-react-state\",\n \"no-runtime-runfork\",\n \"no-run-effect-outside-boundary\",\n \"no-or-die-outside-boundary\",\n \"prevent-dynamic-imports\",\n \"no-render-side-effects\",\n \"no-inline-runtime-provide\",\n ] as const, version);\n\n const effectCompositionRules = rulesFromNames([\n \"no-effect-as\",\n \"no-effect-do\",\n \"no-effect-bind\",\n \"no-effect-async\",\n \"no-effect-ignore\",\n \"no-effect-never\",\n \"no-effect-fn-generator\",\n \"no-nested-effect-gen\",\n \"no-yield-without-star-in-effect-gen\",\n \"no-async-effect-combinator-callback\",\n \"no-throw-in-effect-logic\",\n \"no-try-catch-in-effect-logic\",\n \"no-promise-api-in-effect-logic\",\n \"no-swallowed-catch-all\",\n \"no-manual-effect-channels\",\n \"no-effect-type-alias\",\n \"no-public-generic-effect-error\",\n ] as const, version);\n\n const concurrencySafetyRules = rulesFromNames([\n \"no-unbounded-effect-all\",\n \"no-fire-and-forget-fork\",\n \"no-fork-in-loop\",\n \"no-race-without-cleanup\",\n \"no-unobserved-fiber\",\n \"no-unbounded-concurrent-retry\",\n \"no-blocking-call-in-effect\",\n \"no-promise-concurrency-in-effect\",\n \"no-shared-mutable-state-across-fibers\",\n \"no-timeout-with-noninterruptible-promise\",\n \"no-uninterruptible-concurrent-region\",\n \"no-unbounded-queue-or-pubsub\",\n \"no-global-mutable-concurrency-state\",\n ...strictConcurrencySafetyRuleNames,\n \"no-acquire-without-scoped-release\",\n ] as const, version);\n\n const resourceLifetimeRules = rulesFromNames([\n \"no-manual-resource-close\",\n \"no-unbound-scope\",\n \"no-resource-succeed-escape\",\n \"no-resource-without-acquire-release\",\n ...strictResourceLifetimeRuleNames,\n \"no-run-with-open-resource\",\n ] as const, version);\n\n const pipelineShapeAndSequencingRules = rulesFromNames([\n \"no-nested-effect-call\",\n \"no-effect-ladder\",\n \"no-flatmap-ladder\",\n \"no-pipe-ladder\",\n \"no-call-tower\",\n \"no-effect-orElse-ladder\",\n \"no-effect-wrapper-alias\",\n \"warn-effect-sync-wrapper\",\n \"no-effect-side-effect-wrapper\",\n \"no-effect-all-step-sequencing\",\n \"no-effect-succeed-variable\",\n ] as const, version);\n\n const branchingAndLocalControlFlowRules = rulesFromNames([\n \"no-if-statement\",\n \"no-switch-statement\",\n \"no-ternary\",\n \"no-try-catch\",\n \"no-arrow-ladder\",\n \"no-iife-wrapper\",\n \"no-return-in-arrow\",\n \"no-return-in-callback\",\n \"no-return-null\",\n \"no-branch-in-object\",\n ] as const, version);\n\n const optionMatchAndDataNormalizationRules = rulesFromNames([\n \"no-option-as\",\n \"no-match-void-branch\",\n \"no-match-effect-branch\",\n \"no-model-overlay-cast\",\n \"no-unknown-boolean-coercion-helper\",\n \"no-fromnullable-nullish-coalesce\",\n \"no-option-boolean-normalization\",\n \"no-string-sentinel-return\",\n \"no-string-sentinel-const\",\n ] as const, version);\n\n const atomStateAndPlatformBoundariesRules = rulesFromNames([\n \"no-effect-sync-console\",\n \"no-atom-registry-effect-sync\",\n \"no-family-collection-read\",\n \"no-naked-object-state-update\",\n \"no-wrapgraphql-catchall\",\n ] as const, version);\n\n const domainModelingRules = rulesFromNames([\n \"no-raw-domain-id-alias\",\n \"no-boolean-domain-flag\",\n \"no-magic-domain-string\",\n \"no-raw-domain-primitive-params\",\n \"no-raw-time-domain-field\",\n \"no-overloaded-options-object\",\n \"no-domain-logic-in-conditional\",\n \"no-implicit-state-machine-object\",\n \"no-adhoc-domain-error\",\n \"no-domain-meaning-by-folder-only\",\n \"no-new-date-in-domain-logic\",\n ] as const, version);\n\n const dddErrorModelingRuleNames = [\n \"no-error-as-public-effect-error\",\n \"no-unknown-public-error-channel\",\n \"no-mixed-effect-error-shapes\",\n \"no-expected-state-as-error\",\n ] as const;\n type DddErrorModelingRuleName = typeof dddErrorModelingRuleNames[number];\n\n const errorModelingRuleNames = [\n ...dddErrorModelingRuleNames,\n \"no-early-catchall-null\",\n \"no-empty-error-tag\",\n \"no-exception-domain-error\",\n \"no-effect-fail-error-message\",\n \"no-catchall-generic-rethrow\",\n \"no-log-only-error-handling\",\n ] as const;\n\n const errorModelingRules = rulesFromNames(errorModelingRuleNames, version);\n\n const dddRules = {\n ...domainModelingRules,\n ...errorModelingRules,\n } as const;\n\n const effectFlowRules = rulesFromNames([\n \"no-piped-yield-in-gen\",\n \"no-gen-for-mapping\",\n \"prefer-gen-for-workflow\",\n ...strictEffectFlowRuleNames,\n ] as const, version);\n\n const pureTransformationRules = rulesFromNames([\n \"no-large-anonymous-flow\",\n \"no-effect-in-flow\",\n \"prefer-named-flow\",\n ...strictPureTransformationRuleNames,\n ] as const, version);\n\n const behaviorDecorationRules = rulesFromNames([\n \"prefer-pipe-for-behavior\",\n \"prefer-decorated-effect-before-gen\",\n \"no-workflow-in-behavior-pipe\",\n ] as const, version);\n\n const styleSeparationRules = rulesFromNames([\n \"no-mixed-pillar-function\",\n \"no-clever-effect-expression\",\n \"prefer-extracted-concept\",\n ] as const, version);\n\n const serviceAndLayerArchitectureRules = rulesFromNames([\n \"prefer-effect-service\",\n \"no-layer-provide-in-service-definition\",\n \"require-service-accessors\",\n \"require-service-dependencies\",\n \"no-namespace-effect-import\",\n \"no-manual-service-object-export\",\n \"no-layer-merge-in-request-handler\",\n \"no-service-method-returning-promise\",\n \"prefer-layer-pipe\",\n \"no-inline-layer-provide-in-program\",\n \"prefer-layer-mergeall-for-infrastructure\",\n \"no-service-layer-scatter\",\n ] as const, version);\n\n const platformAndBoundaryHygieneRules = rulesFromNames([\n \"no-hidden-effect-execution\",\n \"no-boundary-try-catch-without-effect-map\",\n \"no-node-fs-in-effect-code\",\n \"no-json-parse-without-schema\",\n \"no-date-now-in-effect\",\n \"no-node-platform-in-shared-code\",\n \"no-process-env-direct-read\",\n ] as const, version);\n\n const testingObservabilityAndQaRules = rulesFromNames([\n \"no-console-in-effect-flow\",\n \"no-effect-log-without-structured-context\",\n \"require-span-on-public-service-method\",\n ...strictTestingObservabilityAndQaRuleNames,\n ] as const, version);\n\n const allRules = rulesFromNames(Object.keys(rules) as RuleName[], version);\n const recommendedExcludedRuleNames = [\n ...strictTestingObservabilityAndQaRuleNames,\n ...strictConcurrencySafetyRuleNames,\n ...strictErrorModelingRuleNames,\n ...strictEffectFlowRuleNames,\n ...strictPureTransformationRuleNames,\n ...strictResourceLifetimeRuleNames,\n ...strictEffectCompositionRuleNames,\n ...dddErrorModelingRuleNames,\n \"no-resource-succeed-escape\",\n ] as readonly RuleName[];\n const recommendedRuleNames = (Object.keys(rules) as RuleName[]).filter(\n (ruleName): ruleName is Exclude<\n RuleName,\n StrictRuleName | DddErrorModelingRuleName | \"no-resource-succeed-escape\"\n > => (\n !recommendedExcludedRuleNames.includes(ruleName)\n ),\n );\n const recommendedRules = rulesFromNames(recommendedRuleNames, version);\n\n const ruleGroups = {\n reactAndRuntimeBoundaries: reactAndRuntimeBoundariesRules,\n effectComposition: effectCompositionRules,\n concurrencySafety: concurrencySafetyRules,\n resourceLifetime: resourceLifetimeRules,\n pipelineShapeAndSequencing: pipelineShapeAndSequencingRules,\n branchingAndLocalControlFlow: branchingAndLocalControlFlowRules,\n optionMatchAndDataNormalization: optionMatchAndDataNormalizationRules,\n atomStateAndPlatformBoundaries: atomStateAndPlatformBoundariesRules,\n domainModeling: domainModelingRules,\n errorModeling: errorModelingRules,\n ddd: dddRules,\n effectFlow: effectFlowRules,\n pureTransformation: pureTransformationRules,\n behaviorDecoration: behaviorDecorationRules,\n styleSeparation: styleSeparationRules,\n serviceAndLayerArchitecture: serviceAndLayerArchitectureRules,\n platformAndBoundaryHygiene: platformAndBoundaryHygieneRules,\n testingObservabilityAndQa: testingObservabilityAndQaRules,\n } as const;\n\n const recommended = presetFor(recommendedRules);\n const typeAware = {\n options: {\n typeAware: true,\n },\n jsPlugins,\n rules: recommended.rules,\n } as const;\n const reactAndRuntimeBoundaries = presetFor(reactAndRuntimeBoundariesRules);\n const effectComposition = presetFor(effectCompositionRules);\n const concurrencySafety = presetFor(concurrencySafetyRules);\n const resourceLifetime = presetFor(resourceLifetimeRules);\n const pipelineShapeAndSequencing = presetFor(pipelineShapeAndSequencingRules);\n const branchingAndLocalControlFlow = presetFor(branchingAndLocalControlFlowRules);\n const optionMatchAndDataNormalization = presetFor(optionMatchAndDataNormalizationRules);\n const atomStateAndPlatformBoundaries = presetFor(atomStateAndPlatformBoundariesRules);\n const domainModeling = presetFor(domainModelingRules);\n const errorModeling = presetFor(errorModelingRules);\n const ddd = presetFor(dddRules);\n const effectFlow = presetFor(effectFlowRules);\n const pureTransformation = presetFor(pureTransformationRules);\n const behaviorDecoration = presetFor(behaviorDecorationRules);\n const styleSeparation = presetFor(styleSeparationRules);\n const serviceAndLayerArchitecture = presetFor(serviceAndLayerArchitectureRules);\n const platformAndBoundaryHygiene = presetFor(platformAndBoundaryHygieneRules);\n const testingObservabilityAndQa = presetFor(testingObservabilityAndQaRules);\n\n const presets = {\n recommended,\n typeAware,\n reactAndRuntimeBoundaries,\n effectComposition,\n concurrencySafety,\n resourceLifetime,\n pipelineShapeAndSequencing,\n branchingAndLocalControlFlow,\n optionMatchAndDataNormalization,\n atomStateAndPlatformBoundaries,\n domainModeling,\n errorModeling,\n ddd,\n effectFlow,\n pureTransformation,\n behaviorDecoration,\n styleSeparation,\n serviceAndLayerArchitecture,\n platformAndBoundaryHygiene,\n testingObservabilityAndQa,\n } as const;\n\n return {\n jsPlugins,\n reactAndRuntimeBoundariesRules,\n effectCompositionRules,\n concurrencySafetyRules,\n resourceLifetimeRules,\n pipelineShapeAndSequencingRules,\n branchingAndLocalControlFlowRules,\n optionMatchAndDataNormalizationRules,\n atomStateAndPlatformBoundariesRules,\n domainModelingRules,\n errorModelingRules,\n dddRules,\n effectFlowRules,\n pureTransformationRules,\n behaviorDecorationRules,\n styleSeparationRules,\n serviceAndLayerArchitectureRules,\n platformAndBoundaryHygieneRules,\n testingObservabilityAndQaRules,\n allRules,\n recommendedRules,\n ruleGroups,\n recommended,\n typeAware,\n reactAndRuntimeBoundaries,\n effectComposition,\n concurrencySafety,\n resourceLifetime,\n pipelineShapeAndSequencing,\n branchingAndLocalControlFlow,\n optionMatchAndDataNormalization,\n atomStateAndPlatformBoundaries,\n domainModeling,\n errorModeling,\n ddd,\n effectFlow,\n pureTransformation,\n behaviorDecoration,\n styleSeparation,\n serviceAndLayerArchitecture,\n platformAndBoundaryHygiene,\n testingObservabilityAndQa,\n presets,\n } as const;\n}\n\nexport const {\n reactAndRuntimeBoundariesRules,\n effectCompositionRules,\n concurrencySafetyRules,\n resourceLifetimeRules,\n pipelineShapeAndSequencingRules,\n branchingAndLocalControlFlowRules,\n optionMatchAndDataNormalizationRules,\n atomStateAndPlatformBoundariesRules,\n domainModelingRules,\n errorModelingRules,\n dddRules,\n effectFlowRules,\n pureTransformationRules,\n behaviorDecorationRules,\n styleSeparationRules,\n serviceAndLayerArchitectureRules,\n platformAndBoundaryHygieneRules,\n testingObservabilityAndQaRules,\n allRules,\n recommendedRules,\n ruleGroups,\n recommended,\n typeAware,\n reactAndRuntimeBoundaries,\n effectComposition,\n concurrencySafety,\n resourceLifetime,\n pipelineShapeAndSequencing,\n branchingAndLocalControlFlow,\n optionMatchAndDataNormalization,\n atomStateAndPlatformBoundaries,\n domainModeling,\n errorModeling,\n ddd,\n effectFlow,\n pureTransformation,\n behaviorDecoration,\n styleSeparation,\n serviceAndLayerArchitecture,\n platformAndBoundaryHygiene,\n testingObservabilityAndQa,\n presets,\n} = createVersionedConfigurations(4);\n\n/** Legacy Effect 3 presets; default exports target Effect 4. */\nexport const effect3 = createVersionedConfigurations(3);\n\nexport default definePlugin({\n meta: {\n name: \"linteffect\",\n },\n rules,\n});\n"],"mappings":"AAEA,SAAgB,EAAiB,GAC/B,MAAM,EAAQ,EAAQ,GACtB,GAAqB,iBAAV,GAAgC,OAAV,IAAmB,OAAO,OAAO,EAAO,iBAAkB,OAAO,EAClG,MAAM,EAAS,EAAkC,cACjD,GAAc,IAAV,GAAyB,IAAV,EAAa,OAAO,EACvC,MAAM,IAAI,MAAM,+BAClB,CAEA,SAAgB,EAAwB,GACtC,MAAM,EAAQ,EAAO,GACrB,MAAO,CAAC,CACN,KAAM,SACN,sBAAsB,KACnB,EACH,WAAY,IAAK,GAAO,WAAY,cAAe,CAAE,KAAM,UAAW,KAAM,CAAC,EAAG,SAC5E,EAAO,MAAM,GACrB,CCNA,SAAS,EAAc,GACrB,MAAwB,iBAAV,GAAgC,OAAV,CACtC,CAEA,SAAS,EAAa,EAAe,GACnC,OACE,EAAc,IACU,eAAvB,EAAc,MACgB,iBAAvB,EAAc,YACZ,IAAT,GAAuB,EAAc,OAAS,EAEnD,CAEA,SAAS,EAAmB,EAAe,EAAoB,GAC7D,IAAK,EAAc,GACjB,OAAO,EAGT,MAAM,EAAS,EACf,MACkB,qBAAhB,EAAO,OACa,IAApB,EAAO,UACP,EAAa,EAAO,OAAQ,IAC5B,EAAa,EAAO,SAAU,EAElC,CAEA,SAAS,EAAmB,GAC1B,OAAO,GAAa,EA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GAAU,GACvC,EAA+B,GAAU,GACzC,EAAkC,GAAU,GAC5C,EAAiC,GAAU,GAC3C,EAAiB,GAAU,GAC3B,EAAgB,GAAU,GAC1B,EAAM,GAAU,GAChB,EAAa,GAAU,GACvB,EAAqB,GAAU,GAC/B,EAAqB,GAAU,GAC/B,EAAkB,GAAU,GAC5B,EAA8B,GAAU,GACxC,EAA6B,GAAU,GACvC,EAA4B,GAAU,GAyB5C,MAAO,CACL,aACA,iCACA,yBACA,yBACA,wBACA,kCACA,oCACA,uCACA,sCACA,sBACA,qBACA,WACA,kBACA,0BACA,0BACA,uBACA,mCACA,kCACA,iCACA,WACA,mBACA,aACA,cACA,YACA,4BACA,oBACA,oBACA,mBACA,6BACA,+BACA,kCACA,iCACA,iBACA,gBACA,MACA,aACA,qBACA,qBACA,kBACA,8BACA,6BACA,4BACA,QAAA,CAjEA,cACA,YACA,4BACA,oBACA,oBACA,mBACA,6BACA,+BACA,kCACA,iCACA,iBACA,gBACA,MACA,aACA,qBACA,qBACA,kBACA,8BACA,6BACA,6BAgDJ,kEDx+PA,MAAa,GAAwB,CACnC,iBACA,qBACA,6BACA,4BACA,4BACA,2CACA,wCACA,uCACA,qCACA,4CACA,2BACA,qCACA,+BACA,2BACA,8BACA,wBACA,yCACA,4BACA,+BACA,kCACA,oCACA,sCACA,oBACA,qCACA,2CACA,2BACA,+BACA,wBACA,gCACA,sCACA,2BACA,yBACA,+BACA,iCACA,0BACA,+BACA,yBACA,4BACA,6BACA,8BACA,6BACA,mCACA,wBACA,4BACA,2BACA,0BACA,4BACA,oBACA,gCACA,aACA,qBACA,sBACA,6BACA,2CACA,iCACA,kBACA,yBACA,uBACA,sCACA,0BACA,0BACA,kBACA,0BACA,sBACA,6BACA,mCACA,wCACA,2CACA,uCACA,+BACA,sCACA,kCACA,oCACA,2BACA,mBACA,6BACA,sCACA,wCACA,+BACA,4BACA,4BACA,oCACA,sCACA,iCACA,gCAGW,GAAkB,CAC7B,qBACA,4BACA,+BACA,kB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