@opsydyn/oxlint-effect 1.1.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +432 -79
  2. package/dist/index.d.mts +6586 -289
  3. package/dist/index.mjs +1 -1
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +8 -5
  6. package/skills/oxlint-effect/SKILL.md +120 -0
  7. package/skills/oxlint-effect/assets/contracts.ts +39 -0
  8. package/skills/oxlint-effect/assets/domain-context.bad.ts +18 -0
  9. package/skills/oxlint-effect/assets/domain-context.good.ts +32 -0
  10. package/skills/oxlint-effect/assets/domain-decisions.bad.ts +26 -0
  11. package/skills/oxlint-effect/assets/domain-decisions.good.ts +71 -0
  12. package/skills/oxlint-effect/assets/domain-shapes.bad.ts +22 -0
  13. package/skills/oxlint-effect/assets/domain-shapes.good.ts +39 -0
  14. package/skills/oxlint-effect/assets/domain.bad.ts +16 -0
  15. package/skills/oxlint-effect/assets/domain.good.ts +32 -0
  16. package/skills/oxlint-effect/assets/effect4/contracts.ts +39 -0
  17. package/skills/oxlint-effect/assets/effect4/domain-context.bad.ts +18 -0
  18. package/skills/oxlint-effect/assets/effect4/domain-context.good.ts +32 -0
  19. package/skills/oxlint-effect/assets/effect4/domain-decisions.bad.ts +26 -0
  20. package/skills/oxlint-effect/assets/effect4/domain-decisions.good.ts +71 -0
  21. package/skills/oxlint-effect/assets/effect4/domain-shapes.bad.ts +22 -0
  22. package/skills/oxlint-effect/assets/effect4/domain-shapes.good.ts +39 -0
  23. package/skills/oxlint-effect/assets/effect4/domain.bad.ts +16 -0
  24. package/skills/oxlint-effect/assets/effect4/domain.good.ts +32 -0
  25. package/skills/oxlint-effect/assets/effect4/error-preservation.bad.ts +21 -0
  26. package/skills/oxlint-effect/assets/effect4/error-preservation.good.ts +18 -0
  27. package/skills/oxlint-effect/assets/effect4/expected-state.bad.ts +28 -0
  28. package/skills/oxlint-effect/assets/effect4/expected-state.good.ts +19 -0
  29. package/skills/oxlint-effect/assets/effect4/public-errors.bad.ts +20 -0
  30. package/skills/oxlint-effect/assets/effect4/public-errors.good.ts +33 -0
  31. package/skills/oxlint-effect/assets/error-preservation.bad.ts +21 -0
  32. package/skills/oxlint-effect/assets/error-preservation.good.ts +18 -0
  33. package/skills/oxlint-effect/assets/expected-state.bad.ts +28 -0
  34. package/skills/oxlint-effect/assets/expected-state.good.ts +19 -0
  35. package/skills/oxlint-effect/assets/public-errors.bad.ts +20 -0
  36. package/skills/oxlint-effect/assets/public-errors.good.ts +33 -0
  37. package/skills/oxlint-effect/references/configuration.md +118 -0
  38. package/skills/oxlint-effect/references/domain-context.md +84 -0
  39. package/skills/oxlint-effect/references/domain-decisions.md +93 -0
  40. package/skills/oxlint-effect/references/domain-modeling.md +140 -0
  41. package/skills/oxlint-effect/references/error-preservation.md +76 -0
  42. package/skills/oxlint-effect/references/expected-state.md +78 -0
  43. package/skills/oxlint-effect/references/public-errors.md +80 -0
  44. package/skills/oxlint-effect/references/versioned-rules.md +309 -0
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
- # linteffect Oxlint plugin
1
+ # @opsydyn/oxlint-effect
2
2
 
3
3
  Oxlint plugin rules for Effect TypeScript code-shape constraints.
4
4
 
5
- ## Install
5
+ ## Quick Start
6
+
7
+ Requires Node.js 22 or newer. Version 2.x targets **Effect 4** by default.
6
8
 
7
9
  ```bash
8
10
  bun add -d oxlint @opsydyn/oxlint-effect
9
11
  ```
10
12
 
11
- ## Configure
13
+ With npm, use `npm install -D oxlint @opsydyn/oxlint-effect` instead.
14
+
15
+ Create `oxlint.config.ts` at your project root:
12
16
 
13
17
  ```ts
14
18
  import { defineConfig } from "oxlint";
@@ -21,9 +25,160 @@ export default defineConfig({
21
25
  });
22
26
  ```
23
27
 
24
- `recommended.jsPlugins` is exported as a readonly tuple. Spreading it creates
25
- the mutable array shape expected by Oxlint's `ExternalPluginEntry[]` config
26
- type.
28
+ Run against your source directory:
29
+
30
+ ```bash
31
+ bunx oxlint --config oxlint.config.ts src
32
+ ```
33
+
34
+ With npm, use `npx oxlint --config oxlint.config.ts src`.
35
+ `recommended.jsPlugins` is readonly; spreading it produces the mutable array
36
+ Oxlint expects. When adopting this in an existing config, preserve its plugins,
37
+ rules, ignores and overrides, and register `linteffect` only once.
38
+
39
+ Start with `recommended` for broad policy, or choose a focused group such as
40
+ `ddd` below. The [published 2.0.0 example](examples/npm-effect4-consumer/README.md)
41
+ installs from npm and checks annotated failures alongside clean repairs.
42
+
43
+ - [Effect 3 migration](#configure-legacy-effect-3)
44
+ - [Individual groups and composition](#configure-one-rule-group)
45
+ - [Type-aware opt-in](#configure-type-aware-linting)
46
+ - [Agent skill](#agent-skill)
47
+ - [Editor setup and missing diagnostics](#editor-setup-and-missing-diagnostics)
48
+ - [Rule catalogue](#rule-groups)
49
+
50
+ ## Effect Versions
51
+
52
+ Published `2.0.0` makes default exports Effect 4 policy and adds `effect3` for
53
+ legacy projects. All 146 registered rules and 18 groups are
54
+ locally qualified for their documented forms against the pinned majors:
55
+ 146 legacy Effect 3 cases and 141 current Effect 4 cases, with five legacy-only policies.
56
+ Published 1.x packages retain their original Effect 3 behaviour and do not
57
+ provide the new namespace. See the [compatibility roadmap](roadmap/14-effect4-compatibility/README.md)
58
+ and [per-rule audit](docs/effect-version-inventory.json) for detection scope.
59
+ The [2.0.0 release](https://github.com/opsydyn/oxlint-effect/releases/tag/v2.0.0)
60
+ includes migration notes. Older 1.x packages do not export `effect3`; upgrade
61
+ the plugin to 2.x to use the explicit legacy presets without upgrading Effect.
62
+
63
+ `bun run test:effect-versions` verifies pinned packed Effect 3.21.4 and 4.0.0
64
+ consumers, with exact warning counts, clean controls and config typechecks.
65
+ All Q01-Q52 now have behavioural evidence in the matching packed consumers.
66
+ The complete rule/group gate and unchanged 30 KB bundle-size gate pass locally.
67
+ Accepting a version option alone is not proof of adaptation. The rule/group
68
+ publication guard passes at 2.0.0; release and registry verification are recorded
69
+ in the [release checklist](docs/superpowers/reports/2026-10-01-effect4-release-preparation.md).
70
+
71
+ Additional group-by-group evidence is tracked in the
72
+ [wider qualification report](docs/superpowers/reports/2026-10-01-effect4-complete-qualification.md)
73
+ and both consumers' `qualification-cases.json`. Each case requires annotated bad
74
+ sources, passing clean controls and literal per-file diagnostic counts. Run
75
+ `bun scripts/verify-effect-version-consumers.ts --require-complete` after a build
76
+ to reject any unqualified applicable rule or group; it passes this qualified checkout.
77
+
78
+ The [Effect 4 qualification index](examples/effect4-consumer/src/qualification/README.md)
79
+ is the primary QA corpus. The [legacy index](examples/effect3-consumer/src/qualification/README.md)
80
+ and original reference app remain explicitly Effect 3. The packaged skill has
81
+ current [versioned guidance](skills/oxlint-effect/references/versioned-rules.md)
82
+ and paired Effect 4 assets, with legacy assets retained. This is lint/type/runtime
83
+ contract QA, not a launched application or browser/React adapter acceptance.
84
+
85
+ ### Configure Legacy Effect 3
86
+
87
+ Every group and its rules-only companion is available under `effect3` in the
88
+ published 2.x configuration. Default `ddd` targets Effect 4; legacy projects use:
89
+
90
+ ```ts
91
+ import { defineConfig } from "oxlint";
92
+ import { effect3 } from "@opsydyn/oxlint-effect";
93
+
94
+ export default defineConfig({
95
+ jsPlugins: [...effect3.ddd.jsPlugins],
96
+ rules: effect3.ddd.rules,
97
+ });
98
+ ```
99
+
100
+ For rules-only composition, use `effect3.domainModelingRules` and
101
+ `effect3.errorModelingRules`. The namespace also includes `recommended`,
102
+ `recommendedRules`, `allRules`, `ruleGroups`, `presets`, `typeAware` and `jsPlugins`.
103
+ No second plugin registration is needed. `effect3.typeAware` remains opt-in.
104
+
105
+ Version-sensitive rule entries are tuples with `effectVersion: 3 | 4`.
106
+ Manually enabling a sensitive rule without options selects 4. When customising
107
+ severity or paths, specify the major explicitly rather than discarding it:
108
+
109
+ ```ts
110
+ export default defineConfig({
111
+ jsPlugins: [...effect3.jsPlugins],
112
+ rules: {
113
+ ...effect3.dddRules,
114
+ "linteffect/no-early-catchall-null": [
115
+ "warn",
116
+ { effectVersion: 3, boundaryPaths: ["src/http/**", "test/**"] },
117
+ ],
118
+ },
119
+ });
120
+ ```
121
+
122
+ For Effect 4 manual policy, use `["error", { effectVersion: 4 }]`. Ordinary Oxlint
123
+ override/merge rules apply; there is no process-wide version detection.
124
+ Version-neutral rules keep severity-only entries and existing options.
125
+ `allRules` includes all rules applicable to the selected major, not every
126
+ registered rule. The five currently identified v3-only rules remain registered
127
+ and available in `effect3`: `require-service-accessors`,
128
+ `require-service-dependencies`, `no-effect-async`, `no-effect-orElse-ladder` and
129
+ `no-runtime-runfork` (current Runtime has no runFork export).
130
+ `no-fromnullable-nullish-coalesce` applies to both majors: it recognises current
131
+ `Option.fromNullishOr` and legacy `Option.fromNullable` under the same stable ID.
132
+ The audit may identify further restrictions.
133
+
134
+ ### Recovery And Runtime Across Majors
135
+
136
+ In 2.x, the plain-recovery rules recognise `Effect.catch`
137
+ for Effect 4 and `Effect.catchAll` under `effectVersion: 3`. IDs retain `catchall`
138
+ for configuration stability. Both direct and piped operators, expression
139
+ callbacks and block returns are covered. Original structured errors and explicit
140
+ tagged mappings remain clean; Cause, defect, filtered and reason handlers are
141
+ not treated as plain recovery. A legacy spelling under v4 is not a migration
142
+ warning.
143
+
144
+ `no-run-effect-outside-boundary` covers `runCallback`, `runFork`, `runPromise`,
145
+ `runPromiseExit`, `runSync` and `runSyncExit`. Effect 4 additionally covers their
146
+ six `With` forms at execution: `Effect.runPromiseWith(context)(program)`.
147
+ `Effect.runPromiseWith(context)` alone creates a runner and does not warn.
148
+ Stored runner aliases, renamed imports and computed properties are not covered.
149
+
150
+ The runner rule now honours `boundaryPaths` for both majors, correcting its old
151
+ behaviour of warning even at boundaries. It shares these conservative defaults
152
+ with early fallback recovery: `bin/**`, `scripts/**`, `cli/**`, `**/main.ts`,
153
+ `app/api/**/route.ts`, `server/**`, `*.test.ts`, `*.spec.ts`. Custom paths **replace**
154
+ defaults; `[]` exempts nothing. Keep `effectVersion` in custom option tuples:
155
+
156
+ ```ts
157
+ "linteffect/no-run-effect-outside-boundary": [
158
+ "warn",
159
+ { effectVersion: 3, boundaryPaths: ["src/http/**", "test/**"] },
160
+ ],
161
+ ```
162
+
163
+ Return an Effect from domain logic, preserve structured failures, and execute or
164
+ recover at your configured boundary. A context-supplied runner is not evidence
165
+ of missing Layer provision; syntax cannot prove context completeness.
166
+ See annotated [Effect 4 failures](examples/effect4-consumer/src/recovery-runtime/runners.ts),
167
+ [legacy recovery failures](examples/effect3-consumer/src/recovery-runtime/rethrow.ts)
168
+ and the [qualification report](docs/superpowers/reports/2026-10-01-effect4-recovery-runtime-qualification.md).
169
+
170
+ ### Editor Setup And Missing Diagnostics
171
+
172
+ Use the official Oxc extension (`oxc.oxc-vscode`) in VS Code and install Oxlint
173
+ locally in the workspace. See the [official editor setup](https://oxc.rs/docs/guide/usage/linter/editors).
174
+
175
+ If a warning is missing, first run the CLI against the same file with an explicit
176
+ config path. Check the selected group, rule overrides, ignores and configured
177
+ boundary paths. Custom Effect rules are syntax-only; an unrecognised import or
178
+ alias is not proof that the code is safe. If the CLI warns but the editor does
179
+ not, check the extension's workspace/config resolution and restart its language
180
+ server after dependency changes. Intentional `EXPECT`/`QA` examples must retain
181
+ their warnings; use the example's `qa` command rather than fixing the failures.
27
182
 
28
183
  ### Configure Type-Aware Linting
29
184
 
@@ -129,8 +284,7 @@ Named group presets:
129
284
  | `testingObservabilityAndQa` | Testing, Observability, and QA |
130
285
 
131
286
  Each preset also has a rule-only export with a `Rules` suffix. Use those when
132
- you want to compose multiple groups. `typeAware` is the only new mode in this
133
- slice; compose it with rule-only exports when a type-aware configuration needs
287
+ you want to compose multiple groups. Compose `typeAware` with rule-only exports when a type-aware configuration needs
134
288
  additional Effect policy:
135
289
 
136
290
  ```ts
@@ -166,6 +320,68 @@ export default defineConfig({
166
320
  });
167
321
  ```
168
322
 
323
+ ## Agent Skill
324
+
325
+ The companion `oxlint-effect` skill helps coding agents configure the npm
326
+ plugin, diagnose DDD warnings, and repair domain models when requested.
327
+
328
+ Effect 4 assets are primary; labelled Effect 3 assets are retained for legacy
329
+ consumers. The [versioned guide](./skills/oxlint-effect/references/versioned-rules.md)
330
+ selects matching APIs, failure examples and repairs for every group.
331
+
332
+ ```bash
333
+ npx skills add opsydyn/oxlint-effect --skill oxlint-effect
334
+ ```
335
+
336
+ Ask your agent to configure a selected group, explain a `linteffect` warning,
337
+ or repair a domain-modeling issue. The skill preserves existing configuration
338
+ and uses the installed package's APIs and rules. Type-aware linting is opt-in.
339
+ Intentional `EXPECT`/`QA` failures are retained as diagnostic controls.
340
+
341
+ The [skill](./skills/oxlint-effect/SKILL.md), its focused references, and
342
+ paired [Effect 4 failures](./skills/oxlint-effect/assets/effect4/domain.bad.ts) and
343
+ [repairs](./skills/oxlint-effect/assets/effect4/domain.good.ts) are also included in the
344
+ npm package under `skills/oxlint-effect`. Skill installation is separate from
345
+ npm installation; installing the plugin alone does not activate agent guidance.
346
+
347
+ The initial examples cover branded IDs, explicit notification modes, and
348
+ structured transfer errors. Additional paired [domain shape failures](./skills/oxlint-effect/assets/effect4/domain-shapes.bad.ts)
349
+ and [repairs](./skills/oxlint-effect/assets/effect4/domain-shapes.good.ts) cover typed
350
+ commands, epoch-millisecond time values, and schema-backed options. Their tests
351
+ check wire roundtrips, optional fields, invalid inputs, and rejected type misuse.
352
+ Paired [domain decision failures](./skills/oxlint-effect/assets/effect4/domain-decisions.bad.ts)
353
+ and [repairs](./skills/oxlint-effect/assets/effect4/domain-decisions.good.ts) cover status
354
+ variants, business predicates, and explicit lifecycle states. Their tests check
355
+ the original decision results, legacy flag roundtrips, and valid/invalid
356
+ transitions. The [decision guide](./skills/oxlint-effect/references/domain-decisions.md)
357
+ documents the example's boundary and lifecycle policies.
358
+ Paired [domain context failures](./skills/oxlint-effect/assets/effect4/domain-context.bad.ts)
359
+ and [repairs](./skills/oxlint-effect/assets/effect4/domain-context.good.ts) cover explicit
360
+ policy requirements, modelled time inputs, and meaningful error payloads. The
361
+ [context guide](./skills/oxlint-effect/references/domain-context.md) distinguishes
362
+ typed identity from authority and time conversion from clock reads.
363
+ Paired [public error failures](./skills/oxlint-effect/assets/effect4/public-errors.bad.ts)
364
+ and [repairs](./skills/oxlint-effect/assets/effect4/public-errors.good.ts) cover generic,
365
+ unknown, and mixed public error channels. The
366
+ [public error guide](./skills/oxlint-effect/references/public-errors.md) explains
367
+ cause preservation, selective recovery, caller migration and defect ownership.
368
+ Paired [error preservation failures](./skills/oxlint-effect/assets/effect4/error-preservation.bad.ts)
369
+ and [repairs](./skills/oxlint-effect/assets/effect4/error-preservation.good.ts) cover
370
+ message-only failures, generic rethrows and log-only handlers. The
371
+ [preservation guide](./skills/oxlint-effect/references/error-preservation.md)
372
+ explains recovery ownership; use the versioned guide for current `catch` versus
373
+ legacy `catchAll` APIs. Topic guides retain labelled legacy walkthroughs.
374
+ Paired [expected-state failures](./skills/oxlint-effect/assets/effect4/expected-state.bad.ts)
375
+ and [repairs](./skills/oxlint-effect/assets/effect4/expected-state.good.ts) cover ordinary
376
+ absence, broad null recovery and thrown expected rejection. Their
377
+ [guide](./skills/oxlint-effect/references/expected-state.md) explains the required
378
+ caller changes. The corpus now covers all 21 exported DDD rules with representative
379
+ annotated failures, full-DDD clean controls and tested contracts.
380
+ CI checks referenced rules and presets, relative
381
+ links, npm inclusion, TypeScript contracts, intentional diagnostics, and clean
382
+ DDD repairs. This validates the examples and package contract, not the quality
383
+ of every agent-generated repair.
384
+
169
385
  ## Rule Groups
170
386
 
171
387
  The recommended config enables the broadly applicable rules as errors. Strict
@@ -177,12 +393,12 @@ Effect flow, domain meaning, or runtime boundaries.
177
393
 
178
394
  | Rule | Catches | Why |
179
395
  | --- | --- | --- |
180
- | `linteffect/no-react-state` | React state hooks such as `useState`, `useReducer`, and `useEffect`. | Keeps React UI state in the atom/runtime model instead of bypassing it. |
181
- | `linteffect/no-runtime-runfork` | `Runtime.runFork(...)`. | Detached fibers hide ownership, interruption, and lifecycle boundaries. |
182
- | `linteffect/no-run-effect-outside-boundary` | Direct `Effect.runPromise`, `Effect.runSync`, `Effect.runFork`, and related `Effect.run*` calls. | Keeps Effect execution owned by app, CLI, worker, route, or test boundaries. |
183
- | `linteffect/no-or-die-outside-boundary` | `Effect.orDie(...)`, `Effect.orDieWith(...)`, and pipe arguments such as `Effect.orDie`. | Prevents recoverable typed failures from being converted to defects inside domain logic. |
396
+ | `linteffect/no-react-state` | Six bare/member React hook names; receiver/import ownership is not resolved. | Use externally owned props or a compatible adapter in v4; legacy advice names its Effect 3 atom-react adapter. SSR fixtures do not prove client integration. |
397
+ | `linteffect/no-runtime-runfork` | Legacy `Runtime.runFork(...)`, including factories. Excluded from current presets because the export is removed. | Return Effect from domain logic and let an explicit boundary own execution and observation. |
398
+ | `linteffect/no-run-effect-outside-boundary` | Six direct `Effect.run*` calls and, in v4, immediate curried `run*With(context)(program)` execution outside configured boundaries. | Keeps runtime ownership at recognised boundaries; context factory creation is clean. |
399
+ | `linteffect/no-or-die-outside-boundary` | `Effect.orDie` calls/pipe arguments and legacy-only `orDieWith`. This historical owner is path-unaware; use explicit boundary overrides. | Keep domain errors typed; reserve intentional defect conversion for an explicitly owned boundary. |
184
400
  | `linteffect/prevent-dynamic-imports` | Dynamic `import(...)`. | Static imports keep dependency boundaries visible. |
185
- | `linteffect/no-render-side-effects` | `Match.value(...).pipe(...)` used as a render-time statement. | Prevents side effects from running during render. |
401
+ | `linteffect/no-render-side-effects` | Import-gated `Match.value(...).pipe(...)` expression statements with branch operators, including ordinary pure statements. | Keep selection as a value and defer actual side effects to owned actions; syntax does not prove render context or purity. |
186
402
  | `linteffect/no-inline-runtime-provide` | Inline `Effect.provide(...)` inside local runtime/generator chains. | Keeps dependency assembly at service or application boundaries. |
187
403
 
188
404
  ### Effect Composition
@@ -195,14 +411,14 @@ Effect flow, domain meaning, or runtime boundaries.
195
411
  | `linteffect/no-effect-async` | `Effect.async(...)`. | Manual callback bridges are easy to leak or resume incorrectly. |
196
412
  | `linteffect/no-effect-ignore` | `Effect.ignore(...)` and pipe arguments such as `Effect.ignore`. | Makes ignored failures explicit at boundaries instead of burying failure ownership. |
197
413
  | `linteffect/no-effect-never` | `Effect.never`. | Infinite effects should have explicit lifecycle and teardown ownership. |
198
- | `linteffect/no-effect-fn-generator` | `Effect.fn(function* ...)`. | Avoids wrapper generators that obscure sequencing. |
199
- | `linteffect/no-nested-effect-gen` | `Effect.gen` nested inside another `Effect.gen`. | Keeps generator-based effects linear. |
200
- | `linteffect/no-yield-without-star-in-effect-gen` | Plain `yield` inside `Effect.gen`. | Requires `yield*` so generator steps delegate to the Effect interpreter. |
201
- | `linteffect/no-async-effect-combinator-callback` | `async` callbacks passed to common Effect combinators. | Prevents Promise-returning callbacks from bypassing Effect error, interruption, and tracing semantics. |
202
- | `linteffect/no-throw-in-effect-logic` | `throw` inside `Effect.gen` or common Effect combinator callbacks. | Keeps failures in typed Effect error channels. |
203
- | `linteffect/no-try-catch-in-effect-logic` | `try/catch` inside `Effect.gen` or common Effect combinator callbacks. | Uses Effect error combinators instead of local imperative recovery. |
204
- | `linteffect/no-promise-api-in-effect-logic` | `Promise.all`, `Promise.race`, `.then`, `.catch`, and related Promise APIs inside Effect logic. | Keeps scheduling, cancellation, tracing, and failures inside Effect. |
205
- | `linteffect/no-swallowed-catch-all` | `Effect.catchAll` handlers that recover with `Effect.succeed`, `Effect.void`, `Effect.asVoid`, or `Effect.ignore`. | Avoids hiding failures without telemetry, re-fail, or explicit typed recovery. |
414
+ | `linteffect/no-effect-fn-generator` | `Effect.fn(function* ...)`; v4 also covers named `Effect.fn("name")(function* ...)`. | Returns one explicit `Effect.gen` from a plain function; non-generator `Effect.fn` bodies stay clean. |
415
+ | `linteffect/no-nested-effect-gen` | `Effect.gen` nested inside another `Effect.gen`; v4 includes `{ self }` forms. | Keeps generator-based effects linear; v4 excludes separately defined nested functions. |
416
+ | `linteffect/no-yield-without-star-in-effect-gen` | Plain `yield` inside `Effect.gen`; v4 includes `{ self }` forms. | Uses `yield*` for resumed-value typing and consistent workflow style. Plain yield can execute in v4; the rule is a delegation-style policy, not an interpreter-failure claim. |
417
+ | `linteffect/no-async-effect-combinator-callback` | `async` callbacks passed to supported Effect combinators; v4 includes `mapEager`, `flatMapEager`, recovery families and handler maps. | Adapts Promise APIs with `Effect.tryPromise` in gen/flatMap; map callbacks stay pure. Some legacy overloads accept Promises; the rule still requires explicit ownership. |
418
+ | `linteffect/no-throw-in-effect-logic` | `throw` inside `Effect.gen` or supported callbacks; v4 includes eager mapping/sequencing, `{ self }` and recovery maps. | Delegates `yield* Effect.fail(taggedError)` in gen or returns it from flatMap. Returning an Effect from map or a generator succeeds with nested Effect data, not a typed failure. V4 excludes separately defined nested functions. |
419
+ | `linteffect/no-try-catch-in-effect-logic` | `try/catch` inside gen or supported callbacks; v4 includes eager mapping/sequencing, `{ self }` and recovery maps. | Adapts throwing APIs with `Effect.try` and recovers with `catch` (v4), `catchAll` (v3), or `catchTag`. |
420
+ | `linteffect/no-promise-api-in-effect-logic` | Static Promise APIs and visible chains inside Effect logic; v4 includes eager mapping/sequencing, self-bound gen and recovery maps. | Adapts Promise APIs at a boundary. V4 excludes `Effect.catch`/unrelated receivers and cannot resolve stored aliases; v3 retains broad chain-name recognition. |
421
+ | `linteffect/no-swallowed-catch-all` | Plain `catch`/`catchEager` expression/block recovery (v4), piped `catchAll` expressions (v3), returning succeed/void/ignore or visibly successful asVoid. | Retains failure or uses an explicit typed domain branch. V4 `asVoid(Effect.fail(error))` stays clean because it preserves failure; legacy asVoid policy is unchanged. |
206
422
  | `linteffect/no-manual-effect-channels` | Manual `Effect.Effect<...>` and `Layer.Layer<...>` channel types. | Lets Effect infer channels from real composition. |
207
423
  | `linteffect/no-effect-type-alias` | Type aliases around `Effect.Effect<...>`. | Keeps service surfaces concrete and discoverable. |
208
424
  | `linteffect/no-public-generic-effect-error` | Exported APIs returning `Effect.Effect<_, Error, _>`. | Public Effect APIs should expose tagged, recoverable domain errors instead of generic `Error`. |
@@ -229,34 +445,34 @@ Effect flow, domain meaning, or runtime boundaries.
229
445
 
230
446
  | Rule | Catches | Why |
231
447
  | --- | --- | --- |
232
- | `linteffect/prefer-pipe-for-behavior` | Static behavior decorators such as `Effect.retry(Effect.succeed(...), policy)`. | Retry, timeout, spans, logging, recovery, DI, and value transforms should read as behavior around an existing effect. |
233
- | `linteffect/prefer-decorated-effect-before-gen` | Two or more decorated `yield* service.pipe(Effect.retry(...))` / `yield* effect.pipe(Effect.withSpan(...))` steps inside one `Effect.gen`. | Generator bodies should tell the workflow story; behavior policy should be named before the workflow. |
234
- | `linteffect/no-workflow-in-behavior-pipe` | Pipes that mix behavior decorators with multiple workflow sequencing operators or embedded control flow. | `.pipe()` should answer how an effect behaves, not bury multi-step workflow that belongs in `Effect.gen`. |
448
+ | `linteffect/prefer-pipe-for-behavior` | Static decorators whose first argument is a visible Effect call or pipe. V4 includes recovery families/maps and timeoutOption/timeoutOrElse/catchNoSuchElement. | Decorates with `.pipe()`; stored Effect aliases are outside the detector's syntax-local scope. V3 retains catchAll/catchSome/timeoutFail. |
449
+ | `linteffect/prefer-decorated-effect-before-gen` | Two or more decorated yields inside one `Effect.gen`; v4 includes `{ self }` and recovery decoration. | Names decorated effects before the workflow. V4 excludes separately defined nested functions; one decorated yield stays below the threshold. |
450
+ | `linteffect/no-workflow-in-behavior-pipe` | Decorated pipes with multiple workflow operators or embedded control flow; v4 includes `flatMapEager`, while `zipRight` is legacy-only. | `.pipe()` should answer how an effect behaves, not bury multi-step workflow that belongs in `Effect.gen`. |
235
451
 
236
452
  ### Style Separation
237
453
 
238
454
  | Rule | Catches | Why |
239
455
  | --- | --- | --- |
240
- | `linteffect/no-mixed-pillar-function` | Functions that mix three or more style pillars: workflow, pure transformation, behavior decoration, and Layer construction. | Each function should have one obvious style so the domain story, policies, transformations, and wiring stay separately reviewable. |
241
- | `linteffect/no-clever-effect-expression` | Deep or wrapper-heavy expressions combining multiple style pillars, such as `pipe(Effect.map(Effect.gen(...), flow(...)), ((x) => x))`. | Dense expression towers hide intent and make Effect code harder to debug or refactor. |
242
- | `linteffect/prefer-extracted-concept` | Multi-statement anonymous callbacks passed into Effect combinators. | Inline callback bodies with several steps usually represent a named transformation, policy, or workflow concept. |
456
+ | `linteffect/no-mixed-pillar-function` | Function bodies containing three or more pillars: workflow, `flow` transformation, behaviour decoration and Layer construction. V4 includes its recovery operators and `flatMapEager`; legacy spellings remain under `effect3`. | Extract named workflows, transformations, policies and wiring. This syntax-local scan includes nested callbacks, not inferred named references. |
457
+ | `linteffect/no-clever-effect-expression` | Expressions with at least two pillars and call depth four or an inline function wrapper. Pillar recognition follows the selected Effect major. | Extract named steps; shallow multi-pillar and deep single-pillar expressions remain clean. |
458
+ | `linteffect/prefer-extracted-concept` | Anonymous block callbacks with at least three statements passed to calls in Effect-importing files, including ordinary JS calls. | Name the transformation, policy or workflow before passing it. Named callbacks, expression bodies and two-statement blocks remain clean; this is a syntax heuristic, not Effect type inference. |
243
459
 
244
460
  ### Service and Layer Architecture
245
461
 
246
462
  | Rule | Catches | Why |
247
463
  | --- | --- | --- |
248
- | `linteffect/prefer-effect-service` | `Context.Tag(...)` and `Context.GenericTag(...)` service definitions. | Modern `Effect.Service` gives services generated accessors, consistent default layers, and clearer dependency ownership. |
249
- | `linteffect/no-layer-provide-in-service-definition` | `Layer.provide(...)` nested inside an `Effect.Service` options object. | Service definitions should declare implementation and dependencies; layer assembly belongs at application, test, or composition boundaries. |
250
- | `linteffect/require-service-accessors` | `Effect.Service` classes whose options omit `accessors: true`. | Static accessors keep service APIs consistent and avoid hand-written dependency plumbing. |
251
- | `linteffect/require-service-dependencies` | `Effect.Service` implementations that `yield* SomeService` without a `dependencies` option. | Service dependency graphs should be declared where the service is defined. |
252
- | `linteffect/no-namespace-effect-import` | `import * as ... from "effect"` and other Effect package namespace imports. | Direct named imports keep the Effect surface explicit and easier to scan. |
253
- | `linteffect/no-manual-service-object-export` | Exported `*Service` object literals with function-valued members. | Public service APIs should use `Effect.Service` for accessors, default layers, and dependency ownership. |
254
- | `linteffect/no-layer-merge-in-request-handler` | `Layer.merge*` or `Layer.provide` inside request/route/handler functions. | Request handlers should run programs, not assemble the application dependency graph. |
255
- | `linteffect/no-service-method-returning-promise` | Methods returned from `Effect.Service` implementations that return `Promise`. | Service APIs should preserve Effect cancellation, tracing, typed failures, and dependency semantics. |
256
- | `linteffect/prefer-layer-pipe` | Nested `Layer.provide(...)` call towers. | Layer assembly should read as a left-to-right composition pipeline. |
257
- | `linteffect/no-inline-layer-provide-in-program` | `Effect.provide(...)` or `Layer.provide(...)` buried inside `Effect.gen` program bodies. | Programs should describe workflow; application layer provisioning belongs at composition boundaries. |
258
- | `linteffect/prefer-layer-mergeall-for-infrastructure` | Nested `Layer.merge(...)` chains. | Infrastructure groups should use `Layer.mergeAll(...)` so dependency groups stay visible. |
259
- | `linteffect/no-service-layer-scatter` | Three or more separate `*Layer`/`*Live` constants with inline `Layer.provide` or `Effect.provide`. | Service and infrastructure layers should be grouped by concern instead of scattered one constant at a time. |
464
+ | `linteffect/prefer-effect-service` | Legacy `Context.Tag`/`GenericTag` definitions; v4 also flags removed `Effect.Service` calls. | V4 repair: use `Context.Service` keys/classes, optional `make` and explicit layers. Bare v4 keys are valid. Legacy `effect3` repair remains `Effect.Service`. The historical rule ID is retained. |
465
+ | `linteffect/no-layer-provide-in-service-definition` | V4 `Layer.provide` assembly inside inline `Context.Service` `make`, including function builders and class expressions; legacy checks `Effect.Service` class options. | Keep construction focused and move layer assembly to named app/test composition boundaries. Ordinary `Layer.provide`, including piped boundary composition, remains clean. Named builder aliases are not resolved. |
466
+ | `linteffect/require-service-accessors` | Legacy `Effect.Service` class options omitting or disabling `accessors: true`. | Legacy-only: generated accessors keep v3 service APIs consistent. Omitted from v4 presets and a no-op under explicit v4 manual policy; never add this option to `Context.Service`. |
467
+ | `linteffect/require-service-dependencies` | Legacy `Effect.Service` effect/scoped builders delegating to a `*Service` identifier without a `dependencies` option. | Legacy-only: declare dependency layers or provide them explicitly. This is an option-presence/name heuristic, not graph verification; an empty array passes the syntax check. Omitted and inactive in v4, where dependencies use explicit Layer composition. |
468
+ | `linteffect/no-namespace-effect-import` | Namespace imports from `effect` and its subpaths, plus the recognised atom-react package. | Use named imports to keep the surface explicit. Root/subpath controls compile in both majors; local namespace imports stay clean. Atom ecosystem compatibility is audited separately. |
469
+ | `linteffect/no-manual-service-object-export` | Named variable exports of `*Service` object literals containing functions or a direct `Effect.fn` builder, including pure methods. | V4 repair: `Context.Service` with explicit layers; legacy repair: `Effect.Service`. Data-only objects, other names, private objects and separately exported aliases stay clean under this syntax-local policy. |
470
+ | `linteffect/no-layer-merge-in-request-handler` | `Layer.merge*` or `Layer.provide` inside function declarations whose names end in `Handler`, `Route` or `Request`. | Extract boundary layer assembly. The name/declaration heuristic does not infer framework callback ownership or follow named builders. |
471
+ | `linteffect/no-service-method-returning-promise` | V4 Promise annotations, async methods and visible Promise returns in literal shapes constructed by inline `Context.Service.make` using functions, `gen`, generator `fn`, `sync`, `succeed` or pipes. Legacy checks retain their annotation/Promise-API traversal. | Return Effect methods. V4 Promise adapters and unused nested callbacks stay clean; named builders, stored Promise aliases and other opaque construction forms are not inferred. |
472
+ | `linteffect/prefer-layer-pipe` | `Layer.provide` towers nested in the input argument; diagnostics point to the inner provide call. | Preserve dependency order using `.pipe(Layer.provide(...), ...)`. Single calls and nesting in the provider argument remain clean under this syntax-local policy. |
473
+ | `linteffect/no-inline-layer-provide-in-program` | Direct or piped `Effect.provide` / `Layer.provide` inside `Effect.gen`; v4 also recognises self-bound generators and generator `Effect.fn`, including named forms. | Move assembly outside workflow generators, retaining provider order. V4 inspects the generator's own scope; legacy traversal includes nested callbacks. Named provision aliases are not inferred. |
474
+ | `linteffect/prefer-layer-mergeall-for-infrastructure` | A `Layer.merge` call whose argument contains another `Layer.merge`. | Group independent layers with `Layer.mergeAll`; a single binary merge stays clean. This syntax heuristic does not prove dependency independence or authorise flattening dependent providers. |
475
+ | `linteffect/no-service-layer-scatter` | The third and each later variable declaration with a `*Layer`/`*Live` name and inline `Layer.provide` or `Effect.provide`, counted per file. | Group layers by concern; two matching declarations stay clean. Names are a heuristic, not type evidence; a multi-declarator declaration counts once, at its first matching declarator. |
260
476
 
261
477
  ### Platform and Boundary Hygiene
262
478
 
@@ -271,13 +487,48 @@ Effect flow, domain meaning, or runtime boundaries.
271
487
  | `linteffect/no-hidden-effect-execution` | Direct `Effect.run*` calls in Effect modules outside configured boundary paths. | Reusable code should return Effects and leave runtime execution ownership at an application boundary. |
272
488
  | `linteffect/no-boundary-try-catch-without-effect-map` | `try`/`catch` blocks in configured boundaries with no direct `Effect.try`, error mapping, recovery, or `Effect.run*` call. | Boundary failure handling should stay in Effect's typed error channel rather than becoming imperative control flow. |
273
489
 
490
+ The [paired platform/boundary examples](examples/effect4-consumer/src/qualification/platformAndBoundaryHygiene)
491
+ cover direct and contextual runners, native filesystem forms and typed service
492
+ repairs. V4 recognises actual `run*With(context)(program)` execution, not factory
493
+ creation, and current `Effect.catch`/Cause/reason recovery. Legacy `effect3`
494
+ retains `catchAll` handling and advice. Boundary catch policy has no Effect import
495
+ gate and checks visible marker presence, not whether handling executes; unused
496
+ callbacks can suppress it. Hidden execution requires an Effect ecosystem import;
497
+ aliased runners stay opaque. Filesystem policy has no boundary exemption and
498
+ retains its function-local `require` gap. V3 filesystem repairs use
499
+ `@effect/platform/FileSystem`; v4 uses `effect/FileSystem` (or the root export).
500
+ No-op FileSystem Layers demonstrate the service seam, not native cancellation.
501
+
502
+ The same examples cover JSON codecs, Clock and platform services. Legacy codecs
503
+ use `Schema.parseJson` with `Schema.decodeUnknown`; v4 uses
504
+ `Schema.fromJsonString` with `Schema.decodeUnknownEffect`. Schema import presence
505
+ (including aliases and type-only imports) suppresses raw-parse warnings, but does
506
+ not establish that decoding occurred. Current clock policy includes
507
+ `Effect.fnUntraced` and `fnUntracedEager`; legacy selection preserves its existing
508
+ gap. Unused nested callbacks can still warn, while named callbacks and clock
509
+ aliases remain opaque. TestClock repairs demonstrate deterministic time rather
510
+ than renaming wall-clock access. Shared-platform policy needs no Effect import,
511
+ reports type-only Node imports, and does not inspect `require`; configure genuine
512
+ application boundaries or depend on typed services.
513
+
514
+ Environment examples cover direct/computed/optional reads, whole-object access,
515
+ configuration paths and typed integer providers. V3 uses `Config.integer` with
516
+ `ConfigProvider.fromMap`; v4 uses `Config.Int` with
517
+ `ConfigProvider.fromUnknown`. Both `boundaryPaths` and `configPaths` replace
518
+ defaults, and empty arrays remove exemptions. This literal-name policy needs no
519
+ Effect import: a local object named `process` and `delete` can warn, while imported
520
+ aliases, destructured process objects and compound assignments retain gaps.
521
+ Runtime controls restore their private environment keys and show that injected
522
+ configuration remains stable when ambient state changes, rejecting missing or
523
+ malformed values through Effect.
524
+
274
525
  ### Testing, Observability, and QA
275
526
 
276
527
  | Rule | Catches | Why |
277
528
  | --- | --- | --- |
278
- | `linteffect/no-console-in-effect-flow` | `console.*` inside direct `Effect.gen`, `Effect.sync`, `Effect.try`, `Effect.tryPromise`, or `Effect.fn` callbacks, and `Effect.Service` implementations. | Logging through Effect preserves the runtime's observability context. |
279
- | `linteffect/no-effect-log-without-structured-context` | String-only `Effect.logError` and `Effect.logWarning` calls in direct error-handler callbacks or `Effect.Service` implementations. | Failure logs need an error, structured fields, or local `Effect.annotateLogs(...)` context for correlation. |
280
- | `linteffect/require-span-on-public-service-method` | Exported functions or function-valued variables with an explicit `Effect.Effect` return (on the function or variable declaration), plus `Effect.Service` methods directly returning an Effect, when any direct Effect return lacks `Effect.withSpan(...)`. | Public operations need visible trace boundaries. |
529
+ | `linteffect/no-console-in-effect-flow` | `console.*` in supported constructors and selected-major service implementations: legacy `Effect.Service`, current `Context.Service.make`. | Logging through Effect preserves the runtime's observability context. |
530
+ | `linteffect/no-effect-log-without-structured-context` | String-only `Effect.logError`/`logWarning` in selected-major recovery/observer callbacks and service implementations. | Failure logs need an error, structured fields, or local `Effect.annotateLogs(...)` context for correlation. |
531
+ | `linteffect/require-span-on-public-service-method` | Explicit `Effect.Effect`-returning exports and selected-major service methods with visible Effect returns lacking `Effect.withSpan(...)`. | Public operations need visible trace boundaries. |
281
532
  | `linteffect/no-runpromise-in-non-async-test-body` | Discarded direct `Effect.runPromise(...)` calls in `*.test.*`, `*.spec.*`, and `__tests__` files. | Tests must await or return runtime execution so the framework observes completion. |
282
533
  | `linteffect/require-effect-flip-for-error-test` | Direct `await expect(Effect.runPromise(effect)).rejects...` assertions in conventional test files. | An expected typed Effect failure is clearer when `Effect.flip` yields the error as a value for structural assertions. |
283
534
  | `linteffect/no-test-mock-layer-when-default-available` | A direct `Layer.succeed(...)` or `Layer.effect(...)` sibling of `SomeService.Default` in the same `Layer.provide(...)` call. | An explicit default composition and a sibling replacement layer can hide which service contract the test exercises. |
@@ -285,7 +536,21 @@ Effect flow, domain meaning, or runtime boundaries.
285
536
  These rules are deliberately syntax-only. They require an Effect ecosystem import;
286
537
  they do not resolve aliases, infer Effect return types, or follow values through
287
538
  variables. `require-span-on-public-service-method` accepts either data-first
288
- `Effect.withSpan(program, "operation")` or `.pipe(Effect.withSpan("operation"))`.
539
+ `Effect.withSpan(program, "operation")` or a visible Effect call followed by
540
+ `.pipe(Effect.withSpan("operation"))`. A pipe on an opaque receiver can still warn.
541
+
542
+ The [paired observability examples](examples/effect4-consumer/src/qualification/testingObservabilityAndQa)
543
+ qualify current class, functional and class-expression `Context.Service.make`
544
+ forms, untraced constructors and current catch/Cause/reason handlers, including
545
+ literal handler maps. Select `effect3.testingObservabilityAndQa` to retain legacy
546
+ `Effect.Service` and `catchAll` policy. Collection remains import-order independent
547
+ and deduplicates report nodes. These are local syntax checks: unused callbacks
548
+ can warn, empty context objects satisfy logging policy, and an unexecuted
549
+ annotation can suppress it. Inferred exports and stored Effects remain opaque;
550
+ `withSpan` syntax does not prove that tracing is enabled. Runtime contracts verify
551
+ logger routing/annotations and spans ending once on value, failure and interruption.
552
+ Legacy tracing proxies object failures; public `Cause.originalError` preserves
553
+ access to the original instance. Current fixtures retain direct failure identity.
289
554
 
290
555
  The three test-shape rules are strict opt-in checks: use
291
556
  `testingObservabilityAndQa` when a repository follows this test style; they are
@@ -342,24 +607,64 @@ export default defineConfig({
342
607
 
343
608
  | Rule | Catches | Why |
344
609
  | --- | --- | --- |
345
- | `linteffect/no-unbounded-effect-all` | `Effect.all(items.map(...))` without an explicit `concurrency` option. | Prevents load-dependent runaway parallelism and makes throughput ownership explicit. |
346
- | `linteffect/no-fire-and-forget-fork` | Bare `Effect.fork(...)` expression statements. | Detached fibers hide failure, interruption, and lifecycle ownership. |
347
- | `linteffect/no-fork-in-loop` | `Effect.fork(...)` inside `for`, `for...of`, `for...in`, `while`, or `do...while` loops. | Avoids loop-spawned unbounded fibers; use bounded `Effect.all` / `Effect.forEach` or scoped supervision. |
348
- | `linteffect/no-race-without-cleanup` | `Effect.race(...)` / `Effect.raceAll(...)` without `Effect.ensuring`, scoped, or acquire/release cleanup. | Racing effects need explicit loser cleanup so losing work and resources do not leak. |
349
- | `linteffect/no-unobserved-fiber` | `const fiber = Effect.fork(...)` when the fiber is never passed to `Fiber.join`, `Fiber.await`, or `Fiber.interrupt`. | Forked fibers should have observed failure and interruption ownership. |
350
- | `linteffect/no-unbounded-concurrent-retry` | `Effect.retry(...)` nested inside unbounded mapped `Effect.all(...)` or unbounded `Effect.forEach(...)`. | Prevents retry storms by requiring bounded concurrency or a queue/backoff policy. |
351
- | `linteffect/no-blocking-call-in-effect` | Sync `fs` / `crypto` / `zlib` calls inside `Effect.sync` or `Effect.gen`. | Blocking calls stall the runtime worker and should live behind async/platform boundaries. |
352
- | `linteffect/no-promise-concurrency-in-effect` | `Promise.all`, `Promise.allSettled`, `Promise.race`, or `Promise.any` inside Effect logic. | Keeps concurrency, interruption, tracing, and typed failures inside Effect. |
353
- | `linteffect/no-shared-mutable-state-across-fibers` | Outer `let` / `var` state mutated from `Effect.fork`, `Effect.all`, or `Effect.forEach` work. | Shared mutable state across fibers creates nondeterministic races; use Effect concurrency primitives. |
354
- | `linteffect/no-timeout-with-noninterruptible-promise` | `Effect.timeout(Effect.promise(...))` or `Effect.timeout(Effect.tryPromise(...))` without a signal-aware callback. | Timeout should interrupt the underlying async operation, not only the Effect wrapper. |
355
- | `linteffect/no-uninterruptible-concurrent-region` | `Effect.uninterruptible(...)` wrapping `fork`, `race`, `all`, `forEach`, or queue-taking work. | Broad uninterruptible concurrent regions block cancellation and can strand work during shutdown. |
356
- | `linteffect/no-unbounded-queue-or-pubsub` | `Queue.unbounded()` and `PubSub.unbounded()`. | Unbounded buffers hide backpressure and can fail under load; capacity should be owned explicitly. |
357
- | `linteffect/no-global-mutable-concurrency-state` | Module-level mutable state or mutable containers touched from concurrent Effect work. | Global mutable state under concurrency behaves like shared memory; move ownership into Effect primitives or layers. |
358
- | `linteffect/no-yield-with-held-semaphore-permit` | Direct semaphore `withPermit` / `withPermits` work whose effect contains sleep, await, Promise interop, queue waiting, or concurrent Effect work. | Strict-only protection against holding a permit while interruptible or concurrent work occupies the critical section. |
359
- | `linteffect/no-yield-with-held-mutable-ref` | Effectful `SynchronizedRef` modifiers (`modifyEffect`, `modifySomeEffect`, `updateEffect`, `updateAndGetEffect`) whose callback suspends or starts concurrent work. | Strict-only protection that keeps internal reference coordination short and synchronous. |
360
- | `linteffect/no-unscoped-background-fiber` | Direct `Effect.forkDaemon(...)` without a direct `Effect.supervised(...)` child-effect marker. | Strict-only protection that requires daemon work to expose supervision or use scoped ownership instead of silently outliving the caller. |
361
- | `linteffect/no-manual-deferred-coordination` | A local `Deferred.make(...)` / `Deferred.unsafeMake(...)` latch whose matching `Deferred.await(...)` has no timeout, race, interruption, scope, or finalizer protection. | Strict-only protection against unbounded waits and implicit completion ownership in ad hoc coordination. |
362
- | `linteffect/no-acquire-without-scoped-release` | Resource-like `open` / `connect` / `create` / `start` / `listen` / `subscribe` / `acquire` calls for client, connection, pool, database, file, socket, stream, server, subscription, or handle values inside concurrent Effect work without scoped release evidence. | Keeps resources acquired by concurrent work tied to `acquireRelease`, `acquireUseRelease`, `Effect.scoped`, or a matching finalizer. |
610
+ | `linteffect/no-unbounded-effect-all` | `Effect.all(items.map(...))` without an inline `concurrency` option. | Requires explicit scheduling policy; omission actually defaults to sequential execution. This option-presence heuristic does not validate bounds: even `"unbounded"` stays clean. Stored inputs and named options are not resolved. |
611
+ | `linteffect/no-fire-and-forget-fork` | V4: discarded direct/curried `forkChild` / `forkDetach` constructors, yielded handles and terminal pipe operators, including startup options. Legacy: bare `Effect.fork` statements only. | Bare construction is lazy, not a launched fiber. Retain and join/await/interrupt executed handles; children follow parent lifetime, detached fibers do not. `forkScoped` / `forkIn` are excluded; stored aliases and nonterminal pipes are not inferred. |
612
+ | `linteffect/no-fork-in-loop` | V4: `forkChild` / `forkDetach` in the own body of `for`, `for...of`, `for...in`, `while`, or `do...while`, including direct/curried/terminal-pipe startup forms. Legacy: broad nested `Effect.fork` traversal. | Retaining handles does not impose a collection budget; prefer bounded `Effect.all` / `Effect.forEach`. Scoped APIs remain excluded, which is not proof of bounded work. V4 skips nested function definitions. |
613
+ | `linteffect/no-race-without-cleanup` | V4: direct/curried/terminal-pipe `race`, `raceAll`, `raceFirst` and `raceAllFirst` without visible cleanup markers in arguments or local enclosing wrappers, including recognised generators and `acquireUseRelease` use callbacks. Legacy: `race` / `raceAll` arguments only. | Races already interrupt losers; owned resources still need finalizers/scopes. Markers do not prove every branch releases. Preserve first-success versus first-completion semantics; named task/cleanup aliases are not resolved. |
614
+ | `linteffect/no-unobserved-fiber` | V4: yielded `forkChild` / `forkDetach` handles without a same-binding `Fiber.join`, `await`, `interrupt`, reference pipe or direct return. Legacy: direct `Effect.fork` initializers matched by file-wide name. | V4 lexical references keep same-name/shadowed observations separate; lazy Effects and scoped APIs stay clean. Return transfers ownership, not a guarantee of later observation. Aliases/aggregate observers and arbitrary wrapped initializers are not inferred; reference presence does not prove execution. |
615
+ | `linteffect/no-unbounded-concurrent-retry` | Visible `Effect.retry` calls inside immediate mapped `Effect.all` / `Effect.forEach` arguments without an inline concurrency option. | Makes scheduling policy explicit; omission defaults to sequential work. Option presence does not validate concurrency or retry bounds, and even explicit `"unbounded"` stays clean. Bound both job concurrency and retry/backoff policy. |
616
+ | `linteffect/no-blocking-call-in-effect` | Identifier calls ending in `Sync`, or literal `fs` / `crypto` / `zlib` members ending in `Sync`, inside `Effect.sync` / `gen`; v4 also recognises self-bound `gen` and direct/named generator `fn`. | Sync suffixes are a heuristic, not import/performance analysis. Use genuinely asynchronous APIs via v4 `callback` (legacy `async`) / `tryPromise`, or a worker for blocking work. A Promise wrapper does not offload it. V4 skips nested function definitions; legacy traversal is broad. |
617
+ | `linteffect/no-promise-concurrency-in-effect` | Literal `Promise.all`, `allSettled`, `race`, or `any` inside `sync` / `gen` or recognised major-specific logic callbacks; v4 adds self-bound `gen` and direct/named generator `fn`. | Prefer bounded `Effect.all` / `forEach`, legacy `either` / v4 `result` for typed outcomes, `raceFirst` for first completion and `race` for first success. Underlying operations must observe cancellation signals. Defects/interruption and `AggregateError` require explicit semantics, not a mechanical swap. V4 skips nested definitions; aliases/computed calls are not inferred. |
618
+ | `linteffect/no-shared-mutable-state-across-fibers` | Outer `let` / `var` scalar writes or known collection mutations in inline direct `all` / `forEach` work; v4 also checks direct/curried/terminal-pipe child/detached forks, using lexical binding identity. Legacy checks `fork` with file-wide name sets. | Use atomic `Ref.update` or immutable result aggregation. Worker-local/shadow parameters stay clean in v4. Syntax is not execution/data-race proof: constructors are lazy and default collections sequential. Stored task bodies, const containers and property writes are not inferred; the separate global-state rule has its own scope. |
619
+ | `linteffect/no-timeout-with-noninterruptible-promise` | V4: direct/curried/terminal-pipe `timeout`, `timeoutOption` or `timeoutOrElse` around literal `promise` / `tryPromise` adapters without callback parameters. Legacy: direct `timeout`, always flags `promise`, flags `tryPromise` without parameters. | Timeout interrupts the wrapper; the operation must honour its forwarded AbortSignal. Parameter presence is not cancellation proof, and named inputs/nonterminal pipes are not resolved. Legacy's signal-aware `promise` warning is retained despite that API supporting cooperative cancellation. Timeout failure is v4 `TimeoutError`, legacy `TimeoutException`. |
620
+ | `linteffect/no-uninterruptible-concurrent-region` | V4: direct or terminal-pipe masking around inline collection, current child/detached/scoped/in forks, success/first-completion races or `Queue.take` / `PubSub.take`; traverses recognised gen/fn and logic callbacks, not ordinary nested definitions. Legacy: broad old fork/race/collection/Queue.take traversal. | Broad masking can defer cancellation until work finishes. Keep critical sections short and restore long-running work with `uninterruptibleMask`; restore reinstates ambient status, so use `interruptible` when overriding an already-masked caller is intended. Scoping alone does not restore interruption. Lazy syntax is not execution or child-mask proof; named bodies are not resolved. |
621
+ | `linteffect/no-unbounded-queue-or-pubsub` | Explicit `Queue.unbounded` / `PubSub.unbounded`; v4 also detects `Queue.make` with omitted/undefined options or inline missing/undefined/Infinity capacity, and `PubSub.makeAtomicUnbounded`. | Use bounded suspend/backpressure constructors with an owned capacity. Named/spread options and computed capacities are not evaluated; clean syntax is not capacity validation. Dropping/sliding changes delivery semantics. V4 PubSub subscriptions use `PubSub.take`, legacy subscriptions use `Queue.take`; scope subscriptions and shut down owned buffers. |
622
+ | `linteffect/no-global-mutable-concurrency-state` | V4: lexical module/global `let` / `var` writes or known mutable-container operations in inline collections and direct/curried/terminal-pipe child/detached forks. Legacy: file-wide names, including function-local declarations, and old fork syntax. | Own `Ref` state per execution/service or aggregate immutable results. V4 excludes local/shadow bindings; object-property writes and stored task bodies remain outside scope. Syntax is not execution/data-race proof; default collections are sequential. |
623
+ | `linteffect/no-yield-with-held-semaphore-permit` | V4: instance/namespace `Semaphore.withPermit` / `withPermits`, including curried/terminal pipes, around visible waits, Promise adapters or current concurrent work in recognised gen/fn bodies. Legacy: `Effect.Semaphore.withPermits` and direct/curried `TSemaphore` forms with broad traversal. | Strict-only coordination policy, not permit-leak detection. Narrow unrelated waits when semantics allow; async I/O may intentionally be permit-bound, and moving it outside changes concurrency limits. Named tasks, ordinary nested definitions in v4 and other acquisition APIs are not inferred. |
624
+ | `linteffect/no-yield-with-held-mutable-ref` | Four effectful modifier names: `modifyEffect`, `modifySomeEffect`, `updateEffect`, `updateAndGetEffect`. V4: literal `SynchronizedRef` / `SubscriptionRef` namespaces, direct/curried/terminal-pipe forms and visible waits/current concurrent work through recognised gen/fn callbacks. Legacy: namespace/instance forms with broad traversal. | Strict-only short critical-section policy. Move only independent work outside, retaining a synchronous state transition; splitting state-dependent I/O can lose atomicity. V4 skips ordinary unused helpers, named callback bodies and unrelated object methods. Other modifier names remain outside this rule. |
625
+ | `linteffect/no-unscoped-background-fiber` | V4: direct/curried/terminal-pipe `forkDetach`, including returned/joined handles and a scope inside the detached child. Empty/undefined/inline-options factories stay clean. Legacy: direct `forkDaemon` without a visible `supervised` marker in child work. | Strict-only scoped-lifetime policy: use `forkScoped` / `forkIn` or child ownership. Joining/returning observes or transfers a handle, not scoped teardown. Legacy supervision observes but does not itself interrupt; v4 removed `Effect.supervised`. Intentional detached ownership still warns; stored factory aliases/named options are not inferred. |
626
+ | `linteffect/no-manual-deferred-coordination` | V4: direct `Deferred.make` / `makeUnsafe` bindings and same-binding awaits, including captured closures. Recognises current timeout/race, interruptible/scoped and same-binding finalizer markers; supports direct/curried/terminal timeout/race forms. Legacy: function-local name matching with `make` / `unsafeMake` and old protection tables. | Strict-only completion/cancellation ownership policy. V4 distinguishes shadowed finalizer bindings and does not treat a timeout fallback callback as bounded source work. Scope, interruptibility or finalizer reference presence is not proof of execution or eventual completion; named latch aliases are not resolved. |
627
+ | `linteffect/no-acquire-without-scoped-release` | Resource-shaped acquisition names inside inline collection/fork/race work. V4 adds current child/detached/scoped/in forks, first-completion races, curried/terminal pipes and recognised gen/fn/logic/adapter/mapped callbacks; skips ordinary unused definitions. Legacy: old fork/race names and broad traversal. | Own actual release with `acquireRelease`, `acquireUseRelease` or registered finalizers. Existing scope and name-matched finalizer markers remain coarse exclusions, not cleanup proof: a bare scope does not release a raw resource. Naming is a heuristic; stored tasks, aliases and generic factory names are not resource-type inference. |
628
+
629
+ Scheduling/fork anti-patterns and repairs are typechecked in the
630
+ [Effect 4 corpus](examples/effect4-consumer/src/qualification/concurrencySafety/)
631
+ and [legacy Effect 3 corpus](examples/effect3-consumer/src/qualification/concurrencySafety/).
632
+ Their runtime contracts verify ordered values, original failure identity,
633
+ bounded scheduling/retries, parent/scoped interruption, explicit detached
634
+ cleanup and race-loser resource release. Q18 adds
635
+ [async/shared-state contracts](examples/effect4-consumer/src/qualification/concurrencySafety/async-state.contracts.ts)
636
+ for callback adapters, ordered outcomes, cooperative loser cancellation and a
637
+ deterministic lost-update counterexample repaired with `Ref.update`.
638
+ Q19's [cancellation/buffer contracts](examples/effect4-consumer/src/qualification/concurrencySafety/cancellation-buffers.contracts.ts)
639
+ advance TestClock rather than assert elapsed time, verify cooperative abort,
640
+ deferred interruption/exactly-once finalizers, and bounded FIFO/backpressure
641
+ with a live scoped PubSub subscriber. Unbounded PubSub's reported capacity is
642
+ `Number.MAX_SAFE_INTEGER`, not a memory-safety guarantee.
643
+ Q20's [ownership/coordination contracts](examples/effect4-consumer/src/qualification/concurrencySafety/ownership-coordination.contracts.ts)
644
+ prove a module-state lost update, per-execution `Ref.update` repair, Deferred
645
+ success/failure/interruption and timeout outcomes, and permit contention with
646
+ exactly-once release on success, failure and interruption. A scoped bare latch
647
+ is an explicit lint-clean limitation: external interruption still owns teardown.
648
+ Compiler-negative controls distinguish legacy `unsafeMake(FiberId)` and
649
+ `Effect.Semaphore.withPermits` from current `makeUnsafe()` and `Semaphore` APIs.
650
+ Legacy `TSemaphore` wraps Effect work, with work-first direct and semaphore-first
651
+ curried forms; it is not a current-v4 API.
652
+ Q21's [ref/lifetime/acquisition contracts](examples/effect4-consumer/src/qualification/concurrencySafety/ref-background-acquisition.contracts.ts)
653
+ verify lock contention, independent-delta repair, unchanged state on modifier
654
+ failure/interruption, detached work surviving caller completion, owned-child
655
+ teardown and resource finalization on all three exit paths. Resources are typed
656
+ stand-ins with counted release, not native filesystem/network qualification.
657
+ V4 `modifySomeEffect` returns `Effect<[result, Option<state>]>`; legacy takes a
658
+ fallback and `Option<Effect<[result, state]>>`. Both no-update branches preserve
659
+ state and result. Do not mechanically port the optional modifier's signature.
660
+ The allocated concurrency and resource-lifetime batches and cross-group
661
+ composition are locally qualified for the documented forms.
662
+ V4 fiber observation and shared-state checks use Oxlint's
663
+ lexical scope metadata, not TypeScript type inference; they do not require
664
+ `typeAware` or enable compiler diagnostics.
665
+ Qualification uses completion markers and a 60-second deadlock watchdog, not
666
+ timing-based behavioural assertions. Qualification remains scoped to the
667
+ documented calling forms and pinned package versions.
363
668
 
364
669
  ### Resource Lifetime
365
670
 
@@ -370,15 +675,63 @@ support the same `boundaryPaths` option as the other lifecycle rules.
370
675
 
371
676
  | Rule | Catches | Why |
372
677
  | --- | --- | --- |
373
- | `linteffect/no-manual-resource-close` | Resource-like `.close()`, `.destroy()`, `.dispose()`, or `.cleanup()` calls outside release or finalizer callbacks. | Keeps cleanup owned by Effect scopes instead of ad hoc imperative code. |
374
- | `linteffect/no-unbound-scope` | `Scope.make()` without `Effect.scoped`, `Layer.scoped`, explicit `Scope.close`, or a matching acquire/release callback. | Prevents scopes and their finalizers from being leaked. |
678
+ | `linteffect/no-manual-resource-close` | Resource-like `.close()`, `.destroy()`, `.dispose()`, or `.cleanup()` outside release/finalizer arguments. V4 includes effect-valued `Scope.addFinalizer`. | Encourages owned cleanup; callback presence is not execution proof. |
679
+ | `linteffect/no-unbound-scope` | `Scope.make()` without a same-function, same-binding `Scope.close`, or a matching acquire/release callback. Legacy policy also accepts `Effect.scoped`/`Layer.scoped` markers. | Exposes unowned manual scopes. V4 scoping alone does not close a separately created scope. |
375
680
  | `linteffect/no-resource-succeed-escape` | `Effect.succeed(resourceLike)` for client, connection, pool, file, socket, stream, server, subscription, or handle-shaped values. | Keeps live resource lifetimes inside scoped Effect ownership; this heuristic is focused-only rather than recommended. |
376
681
  | `linteffect/no-resource-without-acquire-release` | Runtime: resource-like `open` / `connect` / `create` / `start` / `listen` / `subscribe` / `acquire` calls without a release owner. | Makes resource ownership explicit across failure, interruption, and shutdown. |
377
- | `linteffect/no-request-scoped-long-lived-resource` | Strict: resource acquisition or construction inside request, route, endpoint, controller, or handler functions. | Keeps long-lived clients and pools in application Layers instead of multiplying them per request. |
378
- | `linteffect/no-global-resource-singleton` | Strict: module-level `new Client`, `new Pool`, `new Database`, and similar resource-like constructors. | Keeps construction, testing, and shutdown ownership in services and Layers. |
379
- | `linteffect/no-run-with-open-resource` | Runtime: `Effect.run*` in a lexical scope containing an unowned resource creation. | Prevents runtime execution from finishing while an imperative resource remains open. |
380
- | `linteffect/no-nested-acquire-release` | Strict: `Effect.acquireRelease` / `acquireUseRelease` nesting deeper than two levels. | Encourages named Layers and manageable release boundaries instead of opaque release stacks. |
381
- | `linteffect/no-missing-layer-provision-at-run` | Strict: `Effect.run*` on a program that yields a service tag without a local `Effect.provide` or `Layer.provide`. | Makes runtime dependency provisioning visible at the application boundary. |
682
+ | `linteffect/no-request-scoped-long-lived-resource` | Strict: resource acquisition/construction in named handlers; v4 follows inline gen/fn, mapping and sync/suspend/Promise callbacks. | Keeps long-lived pools in application Layers; intentionally request-owned resources can still warn. |
683
+ | `linteffect/no-global-resource-singleton` | Strict: resource-shaped module constructors, including blocks/static fields. | Keeps shutdown owned by Layers; v4 advice uses Context.Service, legacy advice retains Effect.Service. |
684
+ | `linteffect/no-run-with-open-resource` | Runtime: `Effect.run*` alongside an unowned resource creation in the same lexical function. | Flags possible unmanaged lifetime; does not prove execution order or whether a handle remains open. |
685
+ | `linteffect/no-nested-acquire-release` | Strict: three acquisition calls within one acquisition tree, including siblings. | Encourages named owners and manageable release boundaries; not a leak detector. |
686
+ | `linteffect/no-missing-layer-provision-at-run` | Strict: a visible Service-shaped yield without a visible `Effect.provide` or `Layer.provide`. | Encourages visible Layer ownership; not compiler-proven dependency completeness. |
687
+
688
+ Q22's cleanup, scope and success-value examples use pinned Effect 3.21.4/4.0.0
689
+ consumers. Behavioural qualification is recorded in the
690
+ [campaign report](docs/superpowers/reports/2026-10-01-effect4-complete-qualification.md#q22-cleanup-manual-scopes-and-resource-success-values);
691
+ Q22-Q24 batch closure and the unchanged 30 KB size gate now pass locally.
692
+
693
+ Prefer the supplied `Effect.scope` inside `Effect.scoped`, or acquire a manual
694
+ `Scope.make()` with `Effect.acquireUseRelease` and release it using
695
+ `Scope.close(scope, exit)`. Both majors register effect-valued finalizers with
696
+ `Scope.addFinalizer(scope, effect)`, and exit-aware callbacks with
697
+ `Scope.addFinalizerExit(scope, exit => effect)`. Current interruptible acquisition
698
+ uses `Effect.acquireRelease(acquire, release, { interruptible: true })`; legacy
699
+ `acquireReleaseInterruptible` instead passes only the exit to its release callback.
700
+ V4 acquire/release APIs in these examples are data-first only.
701
+
702
+ These checks are not resource escape analysis. Named callbacks, aliases and
703
+ computed properties remain opaque. The legacy detector retains warnings on valid
704
+ curried release callbacks and effect-valued `Scope.addFinalizer` cleanup. A visible
705
+ `Scope.close` can be lazy or unreachable; legacy scoped markers can leave a manual
706
+ scope open. `no-resource-succeed-escape` remains focused-only and can warn inside
707
+ owned use or on immutable `client.value`, while a generic alias can escape without
708
+ warning. Do not mechanically rename values to silence it. The repairs export data
709
+ after owned use; runtime controls demonstrate once-only release on success,
710
+ failure and interruption, repeated scope close, premature double cleanup and an
711
+ already-closed returned handle. Typed stand-ins do not qualify native I/O behaviour.
712
+
713
+ Q23 adds [paired acquisition/request/singleton examples](examples/effect4-consumer/src/qualification/resourceLifetime)
714
+ and application-layer lifetime contracts. V4 rejects removed
715
+ `Layer.scoped`/`acquireReleaseInterruptible` ownership markers. Request/global
716
+ rules accept `effectVersion` alongside `boundaryPaths`; select
717
+ `effect3.resourceLifetime` for legacy traversal and repair advice. Current request
718
+ analysis follows recognised inline callbacks but skips unused ordinary functions;
719
+ factory/constructor aliases and computed properties remain opaque. Raw acquisition
720
+ inside `Effect.scoped` retains a coarse clean marker but still needs real release.
721
+ One application Layer shares a pool across requests and finalizes it once;
722
+ separately providing that Layer per request is not that lifetime repair.
723
+
724
+ Q24 adds paired nesting/provision/runner examples in the same directory. Named
725
+ acquisition composition preserves reverse-order, once-only cleanup on success,
726
+ failure and interruption. Nesting counts descendant acquisitions, not depth alone.
727
+ V4 provision checks follow native binding identity and recognised inline workflows;
728
+ legacy first-name resolution and unused-function traversal are retained. A valid
729
+ `run*With` context can still warn under this strict visible-Layer policy, while an
730
+ unexecuted provide marker can suppress it. Service-like names are not type proof.
731
+ Open-resource checks have no `boundaryPaths` option and retain lexical
732
+ co-occurrence warnings even when acquisition happens after execution or is closed
733
+ manually. Opaque factories remain outside local analysis. Consult the examples
734
+ before applying a repair; renaming or adding a lazy marker does not own a resource.
382
735
 
383
736
  `Scope.global` remains a deferred candidate because the supported Effect API does
384
737
  not currently expose it; it is not part of the v1 export surface.
@@ -403,7 +756,7 @@ not currently expose it; it is not part of the v1 export surface.
403
756
 
404
757
  | Rule | Catches | Why |
405
758
  | --- | --- | --- |
406
- | `linteffect/no-if-statement` | Imperative `if` statements in Effect files. | Pushes branching toward typed Match/Option/Either decisions. |
759
+ | `linteffect/no-if-statement` | Imperative `if` statements in Effect-imported files, including ordinary logic. | Use Match/Option/Result decisions (legacy Either); this is a file-wide syntax policy. |
407
760
  | `linteffect/no-switch-statement` | Imperative `switch` statements in Effect files. | Encourages exhaustive domain matching. |
408
761
  | `linteffect/no-ternary` | Ternary expressions in Effect files. | Keeps decisions explicit and named. |
409
762
  | `linteffect/no-try-catch` | `try/catch`. | Keeps failures in typed Effect error channels. |
@@ -412,7 +765,7 @@ not currently expose it; it is not part of the v1 export surface.
412
765
  | `linteffect/no-return-in-arrow` | `return` inside block-bodied arrow callbacks. | Prefers expression callbacks for simple pipeline steps. |
413
766
  | `linteffect/no-return-in-callback` | `return` inside inline function callbacks. | Reduces hidden local control flow. |
414
767
  | `linteffect/no-return-null` | `return null` in Effect files. | Uses `Option.none` or typed failures instead of null sentinels. |
415
- | `linteffect/no-branch-in-object` | Match/Option/Either decisions inside object literals. | Computes decisions first, then builds data from named values. |
768
+ | `linteffect/no-branch-in-object` | Match/Option/Result decisions inside object values; legacy selects Either. | Compute decisions first, then build data; recursive object scanning includes nested/unused callbacks, not resolved binding ownership. |
416
769
 
417
770
  ### Option, Match, and Data Normalization
418
771
 
@@ -423,9 +776,9 @@ not currently expose it; it is not part of the v1 export surface.
423
776
  | `linteffect/no-match-effect-branch` | Multi-step sequencing inside Match or Option branches. | Selects data in Match/Option, then runs one Effect pipeline. |
424
777
  | `linteffect/no-model-overlay-cast` | `as` assertions on decoded model flow. | Avoids hiding schema drift with unchecked overlays. |
425
778
  | `linteffect/no-unknown-boolean-coercion-helper` | Local unknown-to-boolean checks paired with null fallback matching. | Moves boolean normalization to the schema boundary. |
426
- | `linteffect/no-fromnullable-nullish-coalesce` | `Option.fromNullable(value ?? null)` or `?? undefined`. | Passes nullable sources directly without rewrapping noise. |
779
+ | `linteffect/no-fromnullable-nullish-coalesce` | Current `Option.fromNullishOr(value ?? null)` or `?? undefined`; legacy `Option.fromNullable`. | Passes nullable sources directly without rewrapping noise. |
427
780
  | `linteffect/no-option-boolean-normalization` | Repeated `Option.match` boolean normalization. | Normalizes once at the boundary and reads typed booleans later. |
428
- | `linteffect/no-string-sentinel-return` | `Effect.succeed("token")` sentinel returns. | Uses domain values, Option/Either, or tagged unions for decisions. |
781
+ | `linteffect/no-string-sentinel-return` | `Effect.succeed("token")` sentinel returns. | Uses domain values, Option/Result (legacy Either), or tagged unions for decisions. |
429
782
  | `linteffect/no-string-sentinel-const` | String constants used as state/status tokens. | Avoids ad hoc string state machines. |
430
783
 
431
784
  ### Atom, State, and Platform Boundaries
@@ -435,8 +788,8 @@ not currently expose it; it is not part of the v1 export surface.
435
788
  | `linteffect/no-effect-sync-console` | `console.*` inside `Effect.sync`. | Uses `Effect.log*` or a real logging boundary. |
436
789
  | `linteffect/no-atom-registry-effect-sync` | Atom or atom registry operations wrapped in `Effect.sync`. | Keeps atom operations in the atom flow. |
437
790
  | `linteffect/no-family-collection-read` | `Atom.family` projections that read broad collection atoms. | Keeps keyed atoms keyed instead of coupling to whole collections. |
438
- | `linteffect/no-naked-object-state-update` | Raw object spreading, `Object.assign`, JSON rebuilds, and similar state shortcuts. | Preserves explicit model transitions and schema boundaries. |
439
- | `linteffect/no-wrapgraphql-catchall` | `Effect.catchAll` after `wrapGraphqlCall` or `applyResponse`. | Handles GraphQL envelope errors at the response mapping boundary. |
791
+ | `linteffect/no-naked-object-state-update` | Ref.update/modify callback spreads, three-argument empty-target Object.assign, fromEntries containing entries and every direct JSON parse/stringify; no import gate. | Use explicit Struct/Record transitions and data-schema .make plus own-major JSON codecs. Current Record.modify returns Option; preserve missing keys. Current Schema.make builds ASTs, not data. |
792
+ | `linteffect/no-wrapgraphql-catchall` | Recursive pipe scan combining wrapGraphqlCall/applyResponse with current catch/catchEager (legacy catchAll); v4 recognises eager response mapping. | Preserve structured errors at the response boundary. The name/pipe heuristic does not prove ordering or actual GraphQL ownership; data-first, alias and import-order gaps remain. |
440
793
 
441
794
  ### Domain Modeling
442
795
 
@@ -466,9 +819,9 @@ with existing projects.
466
819
  | `linteffect/no-unknown-public-error-channel` | Exported functions returning `Effect.Effect<_, unknown, _>`. | Callers cannot recover by tag or type from an `unknown` channel. |
467
820
  | `linteffect/no-mixed-effect-error-shapes` | Public error unions mixing `Error`, `unknown`, string, number, or boolean shapes. | A single tagged error union keeps recovery and observability predictable. |
468
821
  | `linteffect/no-effect-fail-error-message` | `Effect.fail(error.message)`, string concatenation, or templates that stringify an error. | Preserves the original error tag, cause, and context instead of collapsing it into a string. |
469
- | `linteffect/no-catchall-generic-rethrow` | `catchAll` handlers that create `new Error(...)` inside `Effect.fail(...)`. | Keeps recovery typed and prevents generic rethrows from erasing the original failure. |
470
- | `linteffect/no-log-only-error-handling` | `catchAll` or `tapError` handlers that only call `Effect.log*`. | Logging is observability, not failure ownership; map or re-fail after logging. |
471
- | `linteffect/no-early-catchall-null` | Non-boundary `catchAll` recovery with `Effect.succeed(null)`, `undefined`, or a fallback value. | Lets higher layers own recovery instead of leaking untyped absence from domain logic. |
472
- | `linteffect/no-expected-state-as-error` | `Effect.fail("NotFound")`, `"Missing"`, `"Empty"`, or `"None"`. | Models expected states as `Option`, `Either`, or tagged data instead of overloading failure. |
473
- | `linteffect/no-exception-domain-error` | `throw new *Error` inside Effect workflows. | Keeps domain failures in typed Effect channels with supervision and structured recovery. |
822
+ | `linteffect/no-catchall-generic-rethrow` | Plain `catch`/`catchEager` (v4) or `catchAll` (v3) handlers returning `Effect.fail(new Error(...))`. | Preserve the original error or explicitly map to a structured tagged error with its cause. |
823
+ | `linteffect/no-log-only-error-handling` | V4 catch/eager/Cause/defect/filter/tag/reason handlers and maps that log without modelling or retaining failure. Legacy v3 also reports `tapError`. | Re-fail typed errors, retain causes with `failCause`, or retain defects with `die`. V4 observers (`tapError`, `tapCause`, `tapDefect`) stay clean because they preserve failure. |
824
+ | `linteffect/no-early-catchall-null` | Non-boundary `catch`/`catchEager` (v4) or `catchAll` (v3) recovery with `Effect.succeed(null)`, `undefined`, or an identifier containing fallback/default. | Propagate typed failures or recover at a configured boundary instead of leaking untyped absence. |
825
+ | `linteffect/no-expected-state-as-error` | `Effect.fail("NotFound")`, `"Missing"`, `"Empty"`, or `"None"`. | Models expected states as `Option`, `Result` (v4), `Either` (v3), or tagged data instead of overloading failure. |
826
+ | `linteffect/no-exception-domain-error` | `throw new *Error` inside Effect generators and supported combinator callbacks. | Uses `Effect.fail` with a payload-bearing `Data.TaggedError`. V4 covers catch/eager/Cause/defect/filter/tag/reason handlers and handler maps; unrelated nested functions stay clean. |
474
827
  | `linteffect/no-empty-error-tag` | Strict: `_tag`-only error types and `Data.TaggedError` classes with empty payloads. | Requires enough structured context for recovery, diagnosis, and domain-level observability. |