@shivaedev/quality 0.51.0 → 0.53.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.
Files changed (159) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +26 -13
  3. package/biome/declarations.json +0 -5
  4. package/biome/plugins/ambient-runtime.grit +1 -1
  5. package/biome/preset.json +1 -1
  6. package/dist/baseline/format.d.ts +1 -0
  7. package/dist/baseline/format.d.ts.map +1 -1
  8. package/dist/baseline/format.js +3 -2
  9. package/dist/baseline/format.js.map +1 -1
  10. package/dist/baseline/update.js +1 -1
  11. package/dist/baseline/update.js.map +1 -1
  12. package/dist/cli/lint.d.ts +2 -3
  13. package/dist/cli/lint.d.ts.map +1 -1
  14. package/dist/cli/lint.js +4 -2
  15. package/dist/cli/lint.js.map +1 -1
  16. package/dist/config/globs.d.ts +17 -0
  17. package/dist/config/globs.d.ts.map +1 -0
  18. package/dist/config/globs.js +18 -0
  19. package/dist/config/globs.js.map +1 -0
  20. package/dist/engine/runRules.d.ts +2 -1
  21. package/dist/engine/runRules.d.ts.map +1 -1
  22. package/dist/engine/runRules.js +4 -1
  23. package/dist/engine/runRules.js.map +1 -1
  24. package/dist/engine/session.d.ts +1 -1
  25. package/dist/engine/session.d.ts.map +1 -1
  26. package/dist/engine/session.js +9 -5
  27. package/dist/engine/session.js.map +1 -1
  28. package/dist/hooks/preCommit.d.ts +2 -1
  29. package/dist/hooks/preCommit.d.ts.map +1 -1
  30. package/dist/imports/fences/compilePolicy.d.ts.map +1 -1
  31. package/dist/imports/fences/compilePolicy.js +6 -2
  32. package/dist/imports/fences/compilePolicy.js.map +1 -1
  33. package/dist/inventory/shadcnAlias.js.map +1 -1
  34. package/dist/rule.d.ts +1 -0
  35. package/dist/rule.d.ts.map +1 -1
  36. package/dist/rule.js +7 -3
  37. package/dist/rule.js.map +1 -1
  38. package/dist/rules/builtIn.d.ts +36 -9
  39. package/dist/rules/builtIn.d.ts.map +1 -1
  40. package/dist/rules/effect/boundary.js +1 -1
  41. package/dist/rules/effect/boundary.js.map +1 -1
  42. package/dist/rules/effect/boundaryCalls.js +1 -1
  43. package/dist/rules/effect/boundaryCalls.js.map +1 -1
  44. package/dist/rules/effect/boundaryReference.js +1 -1
  45. package/dist/rules/effect/boundaryReference.js.map +1 -1
  46. package/dist/rules/files/folderNames.d.ts +8 -2
  47. package/dist/rules/files/folderNames.d.ts.map +1 -1
  48. package/dist/rules/files/folderNames.js +7 -5
  49. package/dist/rules/files/folderNames.js.map +1 -1
  50. package/dist/rules/files/namedAfterExport.d.ts +4 -1
  51. package/dist/rules/files/namedAfterExport.d.ts.map +1 -1
  52. package/dist/rules/files/namedAfterExport.js +6 -7
  53. package/dist/rules/files/namedAfterExport.js.map +1 -1
  54. package/dist/rules/files/otherNames.d.ts +8 -2
  55. package/dist/rules/files/otherNames.d.ts.map +1 -1
  56. package/dist/rules/files/otherNames.js +7 -5
  57. package/dist/rules/files/otherNames.js.map +1 -1
  58. package/dist/rules/noBarrel.js +1 -1
  59. package/dist/rules/noBarrel.js.map +1 -1
  60. package/dist/rules/secondNames.d.ts.map +1 -1
  61. package/dist/rules/secondNames.js +5 -1
  62. package/dist/rules/secondNames.js.map +1 -1
  63. package/dist/rules/stories/authSql.d.ts +4 -1
  64. package/dist/rules/stories/authSql.d.ts.map +1 -1
  65. package/dist/rules/stories/authSql.js +6 -3
  66. package/dist/rules/stories/authSql.js.map +1 -1
  67. package/dist/rules/stories/collectionOrigins.d.ts +5 -0
  68. package/dist/rules/stories/collectionOrigins.d.ts.map +1 -0
  69. package/dist/rules/stories/collectionOrigins.js +17 -0
  70. package/dist/rules/stories/collectionOrigins.js.map +1 -0
  71. package/dist/rules/stories/httpStatus.d.ts +4 -1
  72. package/dist/rules/stories/httpStatus.d.ts.map +1 -1
  73. package/dist/rules/stories/httpStatus.js +6 -3
  74. package/dist/rules/stories/httpStatus.js.map +1 -1
  75. package/dist/rules/stories/namedValues.d.ts.map +1 -1
  76. package/dist/rules/stories/namedValues.js +5 -5
  77. package/dist/rules/stories/namedValues.js.map +1 -1
  78. package/dist/rules/stories/noLimitImports.d.ts.map +1 -1
  79. package/dist/rules/stories/noLimitImports.js +4 -2
  80. package/dist/rules/stories/noLimitImports.js.map +1 -1
  81. package/dist/rules/stories/origins.d.ts +1 -2
  82. package/dist/rules/stories/origins.d.ts.map +1 -1
  83. package/dist/rules/stories/origins.js +12 -6
  84. package/dist/rules/stories/origins.js.map +1 -1
  85. package/dist/rules/stories/prerequisites.d.ts.map +1 -1
  86. package/dist/rules/stories/prerequisites.js +6 -24
  87. package/dist/rules/stories/prerequisites.js.map +1 -1
  88. package/dist/rules/stories/program.d.ts.map +1 -1
  89. package/dist/rules/stories/program.js +8 -1
  90. package/dist/rules/stories/program.js.map +1 -1
  91. package/dist/rules/stories/sources.d.ts.map +1 -1
  92. package/dist/rules/stories/sources.js +19 -7
  93. package/dist/rules/stories/sources.js.map +1 -1
  94. package/dist/rules/stories/specHelpers.d.ts.map +1 -1
  95. package/dist/rules/stories/specHelpers.js +4 -2
  96. package/dist/rules/stories/specHelpers.js.map +1 -1
  97. package/dist/rules/stories/specs.js +1 -1
  98. package/dist/rules/stories/specs.js.map +1 -1
  99. package/dist/rules/stories/syntax.d.ts +0 -1
  100. package/dist/rules/stories/syntax.d.ts.map +1 -1
  101. package/dist/rules/stories/syntax.js +0 -4
  102. package/dist/rules/stories/syntax.js.map +1 -1
  103. package/dist/rules/suppressions/hiddenCast.d.ts +4 -0
  104. package/dist/rules/suppressions/hiddenCast.d.ts.map +1 -0
  105. package/dist/rules/suppressions/hiddenCast.js +80 -0
  106. package/dist/rules/suppressions/hiddenCast.js.map +1 -0
  107. package/dist/rules/suppressions/noDoubleCast.d.ts.map +1 -1
  108. package/dist/rules/suppressions/noDoubleCast.js +55 -4
  109. package/dist/rules/suppressions/noDoubleCast.js.map +1 -1
  110. package/dist/rules/suppressions/readonlyWrite.d.ts +4 -0
  111. package/dist/rules/suppressions/readonlyWrite.d.ts.map +1 -0
  112. package/dist/rules/suppressions/readonlyWrite.js +113 -0
  113. package/dist/rules/suppressions/readonlyWrite.js.map +1 -0
  114. package/dist/rules/test-names/colocated.d.ts +4 -1
  115. package/dist/rules/test-names/colocated.d.ts.map +1 -1
  116. package/dist/rules/test-names/colocated.js +5 -3
  117. package/dist/rules/test-names/colocated.js.map +1 -1
  118. package/dist/rules/test-names/follow.d.ts +4 -1
  119. package/dist/rules/test-names/follow.d.ts.map +1 -1
  120. package/dist/rules/test-names/follow.js +5 -3
  121. package/dist/rules/test-names/follow.js.map +1 -1
  122. package/dist/unitIoGuard.config.js +2 -2
  123. package/dist/unitIoGuard.config.js.map +1 -1
  124. package/package.json +3 -2
  125. package/src/baseline/format.ts +4 -2
  126. package/src/baseline/update.ts +1 -1
  127. package/src/cli/lint.ts +33 -27
  128. package/src/config/globs.ts +31 -0
  129. package/src/engine/runRules.ts +7 -2
  130. package/src/engine/session.ts +10 -5
  131. package/src/imports/fences/compilePolicy.ts +10 -2
  132. package/src/inventory/shadcnAlias.ts +1 -1
  133. package/src/rule.ts +12 -2
  134. package/src/rules/effect/boundary.ts +1 -1
  135. package/src/rules/effect/boundaryCalls.ts +1 -1
  136. package/src/rules/effect/boundaryReference.ts +1 -1
  137. package/src/rules/files/folderNames.ts +7 -5
  138. package/src/rules/files/namedAfterExport.ts +6 -7
  139. package/src/rules/files/otherNames.ts +7 -5
  140. package/src/rules/noBarrel.ts +1 -1
  141. package/src/rules/secondNames.ts +7 -1
  142. package/src/rules/stories/authSql.ts +6 -3
  143. package/src/rules/stories/collectionOrigins.ts +20 -0
  144. package/src/rules/stories/httpStatus.ts +6 -3
  145. package/src/rules/stories/namedValues.ts +7 -5
  146. package/src/rules/stories/noLimitImports.ts +4 -2
  147. package/src/rules/stories/origins.ts +12 -8
  148. package/src/rules/stories/prerequisites.ts +6 -25
  149. package/src/rules/stories/program.ts +9 -1
  150. package/src/rules/stories/sources.ts +21 -9
  151. package/src/rules/stories/specHelpers.ts +4 -2
  152. package/src/rules/stories/specs.ts +1 -1
  153. package/src/rules/stories/syntax.ts +0 -5
  154. package/src/rules/suppressions/hiddenCast.ts +95 -0
  155. package/src/rules/suppressions/noDoubleCast.ts +61 -5
  156. package/src/rules/suppressions/readonlyWrite.ts +140 -0
  157. package/src/rules/test-names/colocated.ts +5 -3
  158. package/src/rules/test-names/follow.ts +5 -3
  159. package/src/unitIoGuard.config.ts +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.53.0 - 2026-11-01
4
+
5
+ ### Added
6
+
7
+ - Rules can validate inventory-dependent configuration through `defineRule`'s `validate` callback before checking files.
8
+
9
+ ### Changed
10
+
11
+ - Generated starters declare auth ownership with reasoned globs for Quality.
12
+
13
+ ### Fixed
14
+
15
+ - Accept a file named after its single exported constant in `files/named-after-export`, applying the existing export-name and folder-prefix checks.
16
+ - Run `quality lint`, including its Biome checks and pre-commit lint, under the shared heavy-process lock so concurrent local heavy commands wait their turn.
17
+ - Enable Biome's `noDelete` as an error while disabling its automatic fix so diagnostics remain visible without rewriting deletion behavior.
18
+ - Check story kits in all packages except test-story, test and types, including test-story's development dependencies. Apply story syntax rules to kit declarations in both `.test` and `.spec` files; keep unit and typecheck tests outside those rules.
19
+
20
+ ### Breaking
21
+
22
+ - Glob options (`toolOwned`, `content`, `edge`, `owners` and `suites`) require `{ glob, reason }` declarations. Replace each string with a declaration explaining its purpose, and remove patterns that match no current inventoried file. Stale declarations fail configuration.
23
+ - Lint and baseline commands refuse legacy exception registries. Run `quality exceptions migrate` (or `quality exceptions migrate --from <registry>`) to move entries into config exceptions.
24
+ - Remove `isSpec` from `@shivaedev/quality/rules/stories/syntax.ts`. Consumers selecting story files must use `storySources` from `@shivaedev/quality/rules/stories/sources.ts` and run its Effect with the rule inputs; story kit origins determine coverage instead of a `.spec` suffix.
25
+
26
+ ## 0.52.0 - 2026-10-31
27
+
28
+ ### Added
29
+
30
+ - Baseline entries accept an optional `reason`, preserved when debt is lowered or moved.
31
+
32
+ ### Fixed
33
+
34
+ - Accept runners in `entry.ts(x)` browser entry modules alongside `main.ts(x)`, including ambient runtime checks.
35
+ - Accept calls to throwing helpers defined in `adapters/`, keeping third-party control flow at the adapter boundary.
36
+ - Accept wrappers that supply type arguments to imported helpers in `structure/no-barrel`.
37
+ - Reject fence demonstrations that name files outside the checked tree, including deleted files, and identify the fence, example and missing path. Replace stale paths with existing checked files; use `external()` for external targets.
38
+
39
+ ### Breaking
40
+
41
+ - `authColumnDrift` decodes PostgreSQL catalog rows and can fail with `SchemaError`. Callers that restrict its error channel to `SqlError` must also handle `SchemaError`.
42
+ - `suppressions/no-double-cast` reports hidden casts outside adapters and test kits: annotated JSON parsing, unchecked reflection bindings, SQL row generics, unchecked identity overloads, Context retagging and writes to readonly or native lifecycle fields. Decode unknown data with `Schema.decodeUnknownEffect` or `SqlSchema`, check implementation return types, and preserve native Context and lifecycle types. Existing repositories can record retained findings during first adoption with a reason.
43
+
3
44
  ## 0.51.0 - 2026-10-31
4
45
 
5
46
  ### Added
package/README.md CHANGED
@@ -30,7 +30,7 @@ The work has three parts: connect the repository to the shared tools once; descr
30
30
 
31
31
  ### Rule lifecycle
32
32
 
33
- `defineRule` accepts synchronous, Promise and Effect checks. Promise checks receive an abort signal as `context.signal`; pass it to cancellable APIs. Effect checks compose filesystem and child-process work in the run's scope. Configured checks return Effects and preserve their service requirements; tool checks read `FileSystem` and `ChildProcessSpawner` from the environment.
33
+ `defineRule` accepts synchronous, Promise and Effect checks. Promise checks receive an abort signal as `context.signal`; pass it to cancellable APIs. Effect checks compose filesystem and child-process work in the run's scope. An optional `validate(context)` callback returns inventory-dependent configuration issues before `check`; those issues stop the run as invalid configuration. Configured checks return Effects and preserve their service requirements; tool checks read `FileSystem` and `ChildProcessSpawner` from the environment.
34
34
 
35
35
  Interrupting a run stops its Biome and knip processes and removes their scoped temporary configs before it ends. A rule crash is a defect; the CLI prints the rule id and original stack. Expected setup failures retain their underlying cause without including it in enumerable error data.
36
36
 
@@ -38,13 +38,13 @@ Interrupting a run stops its Biome and knip processes and removes their scoped t
38
38
 
39
39
  `effect/boundary` checks every TypeScript or JavaScript source in Quality's inventory, including shipped code, tooling and specs. It reports async functions, methods and arrows, await (including `for await`), `new Promise(...)`, `.then(...)`, try statements and throw statements. Model the work with Effect, fail with a tagged error, and use `Effect.die` for defects. Effect's resource and finalizer primitives model cleanup.
40
40
 
41
- It also reports synchronous calls imported from `node:fs` and `node:child_process` (including aliases, namespace imports and string member keys), parameters typed as Promise or callbacks returning Promise, and each call to a helper whose body throws. A guard called 31 times contributes 31 call findings, in addition to its throw statement. `Effect.sync` reports a throwing body: explicit throws, throwing helpers, synchronous Node IO, `JSON.parse`, URI encoding/decoding, `BigInt` and synchronous Schema decoders/encoders. Use `FileSystem` and `ChildProcessSpawner` for IO, and `Effect.try` with a tagged error for fallible synchronous work.
41
+ It also reports synchronous calls imported from `node:fs` and `node:child_process` (including aliases, namespace imports and string member keys), parameters typed as Promise or callbacks returning Promise, and each call to a helper whose body throws, unless the helper is defined in an `adapters/` folder. Calls to adapters that bridge throwing third-party control flow, such as a router’s `redirect` or `notFound`, need no call-site exception. A guard called 31 times contributes 31 call findings, in addition to its throw statement. `Effect.sync` reports a throwing body: explicit throws, throwing helpers, synchronous Node IO, `JSON.parse`, URI encoding/decoding, `BigInt` and synchronous Schema decoders/encoders. Use `FileSystem` and `ChildProcessSpawner` for IO, and `Effect.try` with a tagged error for fallible synchronous work.
42
42
 
43
- `Effect.run*` references in core are reported even without Clock, Config or Random. Yield the computation so it uses the caller's runtime. Runners are accepted in `cli.ts`, `main.ts`, `*-cli.ts`, tool configs and tests, modules that call `runMain`, and modules with the `fileURLToPath(import.meta.url) === process.argv[1]` entry guard. These entry-point conventions accept runners only; the other boundary checks still apply.
43
+ `Effect.run*` references in core are reported even without Clock, Config or Random. Yield the computation so it uses the caller's runtime. Runners are accepted in `cli.ts`, `main.ts(x)`, `entry.ts(x)`, `*-cli.ts`, tool configs and tests, modules that call `runMain`, and modules with the `fileURLToPath(import.meta.url) === process.argv[1]` entry guard. Browser bootstraps use the `main` or `entry` filename convention; the starter uses `src/client/main.tsx`. These entry-point conventions accept runners only; the other boundary checks still apply.
44
44
 
45
45
  Only folders named `adapters/` or `test-support/`, at any depth, are exempt from this boundary rule. An `adapters/` folder bridges an outside library and hands the rest of the application Effect values. The name is fixed by convention, with no config or copied Biome plugin globs. Code that cannot be Effect belongs in that bridge or calls for a better Effect primitive. Adapter code still follows `effect/service-parameters` and the ambient time, randomness, console and environment bans.
46
46
 
47
- The `ambient-runtime` Biome plugin also reports `Effect.run*` calls whose computation contains `Clock`, `Config` or `Random`, `currentTimeMillisUnsafe`, crypto UUIDs and bytes, `performance.now`, process arguments, working directory and exit state, `globalThis.process.env`, timeouts and microtasks. Yield service computations in the caller's Effect so its environment controls them. These additional checks apply to core TypeScript code. They accept `cli.ts`, `main.ts`, `*-cli.ts`, modules that call `runMain`, use `NodeRuntime.runMain` or guard execution with `fileURLToPath(import.meta.url) === process.argv[1]`, tool configs, tests, `adapters/` and `test-support/`. The existing `Date.now()`, `new Date()`, `Math.random()`, console and direct `process.env` bans still apply there.
47
+ The `ambient-runtime` Biome plugin also reports `Effect.run*` calls whose computation contains `Clock`, `Config` or `Random`, `currentTimeMillisUnsafe`, crypto UUIDs and bytes, `performance.now`, process arguments, working directory and exit state, `globalThis.process.env`, timeouts and microtasks. Yield service computations in the caller's Effect so its environment controls them. These additional checks apply to core TypeScript code. They accept `cli.ts`, `main.ts(x)`, `entry.ts(x)`, `*-cli.ts`, modules that call `runMain`, use `NodeRuntime.runMain` or guard execution with `fileURLToPath(import.meta.url) === process.argv[1]`, tool configs, tests, `adapters/` and `test-support/`. The existing `Date.now()`, `new Date()`, `Math.random()`, console and direct `process.env` bans still apply there.
48
48
 
49
49
  `effect/service-parameters` reports parameters carrying a service in exported functions and public methods, including returned factories. It follows service classes and tags, non-empty Contexts and service implementation shapes through aliases, interfaces, generic constraints, inferred parameters and destructuring. Read services from Effect's environment instead. An Effect or Stream requiring a service is a computation and is accepted. Methods implementing a service and functions constructing Layers may take services as parameters. Only `test-support/` folders are exempt from this rule; `adapters/` folders are checked.
50
50
 
@@ -173,7 +173,7 @@ const uiBoundary = fence("ui-never-imports-server")
173
173
  export default [uiBoundary];
174
174
  ```
175
175
 
176
- This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root. Fences supplied through `rules["imports/fences"].options.fences` join the same policy. This adds a fact about the repository's architecture to the shared import check. It does not select a different set of Quality rules. Use real checked files and workspace package names in these chains. The illegal chain must cross this fence alone; the legal chain must cross none. `mayNotImport` checks direct imports; `mayNotReach` also follows repository imports transitively; `mayImportOnly(...subjects).of(unit)` permits only named modules or folders of a unit. Fences count type imports but never hold test files or files under `test-support/`. The default `imports/no-test-code` rule rejects production imports of either, including type imports and re-exports. Move shared code into a production module that tests can import.
176
+ This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root. Fences supplied through `rules["imports/fences"].options.fences` join the same policy. This adds a fact about the repository's architecture to the shared import check. It does not select a different set of Quality rules. Every file named in either chain must exist in the checked tree; a deleted file stops the run. Use `external()` for external targets. The chains demonstrate hypothetical imports between those files; they need not be actual imports. The illegal chain must cross this fence alone; the legal chain must cross none. `mayNotImport` checks direct imports; `mayNotReach` also follows repository imports transitively; `mayImportOnly(...subjects).of(unit)` permits only named modules or folders of a unit. A source exception such as `.from(folders("packages/ui/src").except(files("packages/ui/src/testClient.ts")))` admits that one file while its siblings remain fenced. Fences count type imports but never hold test files or files under `test-support/`. The default `imports/no-test-code` rule rejects production imports of either, including type imports and re-exports. Move shared code into a production module that tests can import.
177
177
 
178
178
  The import rules resolve every literal specifier the way the TypeScript compiler does, with the nearest `tsconfig.json`, and stop the run when the sources hold no module at all. A relative or `#` import of a file that a generator writes before the tests run resolves only inside a folder that `imports/resolvable` lists as `generated`; the folder, or every file an import names in it, must be ignored by git:
179
179
 
@@ -189,7 +189,7 @@ export default defineConfig({
189
189
 
190
190
  Keep story kits and fixtures in `src/test-support` and keep each spec specific to its story. [`@shivaedev/test-story`](https://github.com/ShivaeDev/platform/tree/main/packages/test-story#readme) explains how to build the kit, traits and verbs over a real engine.
191
191
 
192
- Quality's `tests/story-specs` rule reports a test file that declares tests without a kit's `it`, including plain Vitest `it` and `test` declarations mixed with stories. Typecheck tests are exempt, as are test-story itself and its transitive workspace dependencies, including development, optional and peer dependencies: requiring those packages to depend on test-story would create a cycle.
192
+ Quality's `tests/story-specs` rule reports a test file that declares tests without a kit's `it`, including plain Vitest `it` and `test` declarations mixed with stories. Typecheck tests are exempt, as are only the packages named `@shivaedev/test-story`, `@shivaedev/test` and `@shivaedev/types`, wherever they live in the workspace or at its root. Other dependencies of test-story, including development dependencies, remain checked.
193
193
 
194
194
  Quality's `tests/story-engine` rule reports a kit story with no traits whose body never references its verbs, its story or its test context. Drive the engine through one of the kit's verbs or traits, or, if the code under test is pure, move it to `<stem>.unit.test.ts`, which reaches no engine and mocks nothing. The rule follows the same kit origins and prerequisite exemptions as `tests/story-specs`; unit and typecheck files are exempt.
195
195
 
@@ -197,25 +197,35 @@ There is one other honest form. A pure function with no engine behind it gets a
197
197
 
198
198
  Every finding names both repairs: drive the engine through the package's story kit, or, when the code under test is pure, move the test to a `.unit` file. Never wrap a pure function in a story that ignores its kit.
199
199
 
200
- Every package tests its real engine through its own story kit, so setup and actions share the package's domain vocabulary. To repair a finding, build the kit with `storyKit` from `@shivaedev/test-story/server/storyKit.ts` in `src/test-support`, import it in the spec and replace plain registrations with `kit.it(name, traits, body)`. The rule follows imports, aliases and conditional registrars back to the kit; it checks declarations, while review and runtime tests establish whether the kit exercises the real engine.
200
+ Every package tests its real engine through its own story kit, so setup and actions share the package's domain vocabulary. To repair a finding, build the kit with `storyKit` from `@shivaedev/test-story/server/storyKit.ts` in `src/test-support`, import it in the spec and replace plain registrations with `kit.it(name, traits, body)`. The rule follows imports, aliases, conditional registrars and arrays of kits (including tuple loops) back to the kit; it checks declarations, while review and runtime tests establish whether the kit exercises the real engine.
201
201
 
202
202
  Quality's `tests/story-setup` rule reports top-level test functions named with the words `seed`, `make`, `build` or `setup`, and fixture-writing calls imported from Node's `fs` or `fs/promises`. It leaves source and `test-support/` files alone. This is a check for those syntax patterns; a passing test file still needs review of what it tests.
203
203
 
204
204
  Specs keep expectations visible. `tests/spec-helpers` moves all module-level helper functions out of specs and into the kit; `tests/no-expect-in-support` moves `expect` calls into the spec, except in test-support files that register tests at module top level and are not imported by any module, so nested Vitest runs can execute them as test files with real assertions. `tests/named-values` rejects numeric literals passed to `toBe` or `toHaveLength` in specs, except zero and process exit codes asserted on an `exitCode` subject: assert the observed items or use a domain name that comes from the story's inputs or the product. For HTTP statuses, import `* as HttpStatus` from `effect/http/HttpStatus` and use `HttpStatus.fromLiteral("NotFound")`; subjects named `status` or `code` do not exempt numeric assertions. A spec-local numeric const that only feeds these matchers is reported, including aliases for zero and codes. `tests/no-limit-imports` rejects importing `MAX_*` constants from a `limits` module into specs, so a story proves behavior instead of copying an implementation cap.
205
205
 
206
- Three more rules keep a spec readable as a story, as the [story-testing skill](https://github.com/ShivaeDev/platform/blob/main/packages/skills/skills/story-testing/SKILL.md) describes. They read every story file, whatever its suffix: any `.test` or `.spec` file outside `test-support` that is not a type or unit test, such as `orders.spec.ts`, `pane.dom.test.ts` or `orders.slow.test.ts`. The suffix says where a test sits under `tests/follow`, not whether it is a story, and `tests/story-specs` already holds every such file to the story kit. They exempt the same test-story prerequisites as `tests/story-specs`. `tests/domain-outcomes` reports each use of Effect's `Exit`, `Cause` or `Result` module, each `_tag` read or destructuring, and each object literal tagged `"Success"` or `"Failure"`: the kit's verb or readout returns the outcome in the domain's words, such as `"unauthorized"`, and a trait builds any failing input. A domain's own tagged value, such as `{ _tag: "Resync" }`, passes. `tests/grouped-outcomes` reports each run of two or more consecutive `expect(yield* …)` statements once, at its first statement: write the outcomes as rows of one `outcomes` call. `tests/wait-on-events` reports `Effect.sleep`, `setTimeout` and `setInterval`, calls to an imported `eventually`, Vitest's fake timers, `vi.waitFor`, and `TestClock.adjust` and `TestClock.setTime`: settle on the engine's own signal through a kit verb, and when time passing is the behaviour, advance the clock in a verb named for it.
206
+ Three more rules keep a spec readable as a story, as the [story-testing skill](https://github.com/ShivaeDev/platform/blob/main/packages/skills/skills/story-testing/SKILL.md) describes. Together with `tests/spec-helpers`, `tests/named-values` and `tests/no-limit-imports`, they read files whose test declarations trace to a story kit, whatever their suffix: a `.test` or `.spec` file outside `test-support` that is not a type or unit test, such as `orders.spec.ts`, `pane.dom.test.ts` or `orders.slow.test.ts`. The suffix says where a test sits under `tests/follow`, not whether it is a story, and `tests/story-specs` already holds every such file to the story kit. They exempt the same test-story prerequisites as `tests/story-specs`. `tests/domain-outcomes` reports each use of Effect's `Exit`, `Cause` or `Result` module, each `_tag` read or destructuring, and each object literal tagged `"Success"` or `"Failure"`: the kit's verb or readout returns the outcome in the domain's words, such as `"unauthorized"`, and a trait builds any failing input. A domain's own tagged value, such as `{ _tag: "Resync" }`, passes. `tests/grouped-outcomes` reports each run of two or more consecutive `expect(yield* …)` statements once, at its first statement: write the outcomes as rows of one `outcomes` call. `tests/wait-on-events` reports `Effect.sleep`, `setTimeout` and `setInterval`, calls to an imported `eventually`, Vitest's fake timers, `vi.waitFor`, and `TestClock.adjust` and `TestClock.setTime`: settle on the engine's own signal through a kit verb, and when time passing is the behaviour, advance the clock in a verb named for it.
207
207
 
208
208
  `boundaries/queue-sql` rejects SQL mentioning the private `pgboss.` schema. Apps use their queue definitions and let workers process jobs; there is no queue-purge API by design. `boundaries/auth-sql` rejects SQL accessing Better Auth's `user`, `account`, `session` and `verification` tables. App tables reference users by foreign key: migrations may reference only `user(id)` with `ON DELETE CASCADE` or `ON DELETE SET NULL`. Import `userReference` from `@shivaedev/identity/server/better-auth/userReference.ts` and interpolate `sql(userReference.table)` and `sql(userReference.column)` in the reference. Apps use identity for account data; `options.owners` names platform's own auth implementation and its migrations. These rules inspect SQL templates, literal query calls and query variables, and inventoried `.sql` files. They do not evaluate arbitrary runtime SQL construction.
209
209
 
210
210
  `boundaries/http-status` rejects comparisons with HTTP error status numbers, switch cases and literal status-list membership outside `options.edge`. Domain code handles typed errors; the named HTTP edge translates them into transport responses. Process exit codes remain ordinary domain values.
211
211
 
212
- Declare these architectural facts in the repository's quality config; paths and patterns are relative to that config's directory:
212
+ Glob options (`toolOwned`, `content`, `edge`, `owners` and `suites`) use `{ glob, reason }` declarations. Every declaration needs a nonblank reason and must match a current inventoried file; otherwise configuration fails. Remove declarations when their files disappear. Paths and patterns are relative to the config's directory. Naming and suite options use gitignore patterns; `edge` and `owners` use Node glob patterns.
213
+
214
+ Declare these architectural facts in the repository's quality config:
213
215
 
214
216
  ```ts
215
217
  export default defineConfig({
216
218
  rules: {
217
- "boundaries/auth-sql": { options: { owners: ["packages/identity/src/server/better-auth/**", "examples/starter/src/server/migrations/**"] } },
218
- "boundaries/http-status": { options: { edge: ["src/http/**"] } },
219
+ "boundaries/auth-sql": {
220
+ options: {
221
+ owners: [{ glob: "src/auth/**", reason: "This module implements the auth storage API." }],
222
+ },
223
+ },
224
+ "boundaries/http-status": {
225
+ options: {
226
+ edge: [{ glob: "src/http/**", reason: "These HTTP adapters translate transport statuses into domain errors." }],
227
+ },
228
+ },
219
229
  },
220
230
  });
221
231
  ```
@@ -270,12 +280,13 @@ For adoption, run `quality baseline write --rule code/unused --file src/legacy.t
270
280
  ### What the rules check
271
281
 
272
282
  `quality lint` prints each failing rule's guidance with its findings, so the finding is the reference for what to change. The built-in rules fall into these groups:
273
- - **Structure:** `structure/max-lines` allows 150 lines in a source file and 300 in test code, `nesting/max-depth` rejects lines indented eight tabs deep, and `structure/no-barrel` rejects `index` modules, exported value aliases (including `typeof` annotations and local const chains), facades of imports and functions that only forward their parameters unchanged to an import. Overloaded adapters keep their own meaning. The preset rejects bare type aliases of named or default imports as well as explicit type re-exports; each repair names the defining module. When `noExportedImports` suggests `export … from`, import the name where it is used instead. A module does one job.
283
+ - **Structure:** `structure/max-lines` allows 150 lines in a source file and 300 in test code, `nesting/max-depth` rejects lines indented eight tabs deep, and `structure/no-barrel` rejects `index` modules, exported value aliases (including `typeof` annotations and local const chains), facades of imports and functions that only forward their parameters unchanged to an import. Wrappers that supply explicit type arguments, such as `() => createColumnHelper<Feature>()`, and overloaded adapters keep their own meaning. The preset rejects bare type aliases of named or default imports as well as explicit type re-exports; each repair names the defining module. When `noExportedImports` suggests `export … from`, import the name where it is used instead. A module does one job.
274
284
  - **Comments:** the `comments/*` rules reject JSDoc, TODOs, banners, line and pull request references, environment pragmas and more than two comments per file. A comment says why, never what the code already says or what it used to be. A tool pragma such as `@jsxImportSource` counts as a comment until both `comments/no-jsdoc` and `comments/max-per-file` list its tag in their `allow` option.
275
285
  - **Documentation:** `docs/references` checks every Markdown file in the sources except `CHANGELOG.md`, whose released history keeps the links of its release. Relative links, reference definitions and `href`/`src` attributes reach an existing file or folder inside the repository, and a heading anchor matches one GitHub forms from the target's headings. A link to the repository's own GitHub tree, named by the root `package.json` `repository` field, is checked like a relative one unless it is pinned to a commit or a release tag. A published workspace package's README is shown on npm without the repository around it, so its links that leave the package use absolute URLs. Imports in TypeScript and JavaScript code blocks, workspace module paths such as `@scope/lib/repository.ts` written as inline code, `` `name` from `module` `` phrases and a package README's API rows resolve through the owning package's `exports` to an exported module, and every named import exists in that module unless it re-exports another. A linked document such as `CLAUDE.md` beside `AGENTS.md` is checked once, through its target. `docs/unversioned-installs` rejects a version after a package name in install commands, in shell code blocks and inline code; the package's own version ranges decide what installs, and a written version goes stale with the next release. A dist-tag such as `latest` passes.
286
+ - **Hidden casts:** `suppressions/no-double-cast` also checks code outside `adapters/` and `test-support/` for concrete annotations on `JSON.parse` results, unchecked `Reflect.get` bindings, SQL tagged-template row generics, identity overloads whose implementation returns `unknown`, context retagging through `Context.makeUnsafe(...mapUnsafe)`, and writes to readonly properties or native Scope state. Keep untrusted values as `unknown` and decode them with `Schema.decodeUnknownEffect`; decode SQL rows with `SqlSchema` rather than declaring their shape. Give an identity implementation its declared return type, preserve the Context service type, and use native constructors or lifecycle operations instead of changing native fields. Constructor initialization, mutable object writes and extensions that do not replace readonly fields are accepted. These checks read syntax and TypeScript declarations; they do not prove that arbitrary helper functions validate their input.
276
287
  - **Suppressions:** the `suppressions/*` rules reject inline lint and compiler directives, casts through `unknown`, `any` or `never`, Biome settings that weaken a check, recommended Biome rules the preset leaves below `error`, and `ignoreDeprecations`. None of them takes exceptions. A type test (`*.typecheck.test.ts`) may use `@ts-expect-error`; a test that must pass a rejected value at run time calls the API through `Reflect.apply`.
277
288
  - **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports that leave their folder, production imports of test code, runtime folders and fences, as described above.
278
- - **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. `files/named-after-export` keeps the export’s full name while the file name omits words already supplied by any folder above it. In `spaces/client/`, a component exporting `CreateSpace` lives in `Create.tsx`: `spaces/` supplies “Space” even across the intervening `client/` folder. Keep the export named `CreateSpace`; `CreateSpace.tsx` would repeat a folder name. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list extends the rule's defaults, so list only repository-specific additions; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
289
+ - **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. `files/named-after-export` accepts a file named after its single exported constant, such as `liveQueryWindow.ts` exporting `const liveQueryWindow`. It keeps the export’s full name while the file name omits words already supplied by any folder above it. In `spaces/client/`, a component exporting `CreateSpace` lives in `Create.tsx`: `spaces/` supplies “Space” even across the intervening `client/` folder. Keep the export named `CreateSpace`; `CreateSpace.tsx` would repeat a folder name. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list extends the rule's defaults, so list only repository-specific additions; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
279
290
  - **React:** `react/jsx-conditionals` reports `&&` and ternaries in the JSX children a component returns, including nested decisions and returned `.map` items. Decisions in a `const` above the return, JSX built inside library callbacks and conditional attributes are accepted. A ternary with two plain string or number literal branches, such as `{on ? "On" : "Off"}`, is accepted; branches that select JSX, components or computed values still need a decision before the JSX. This rule owns the check, so the shared Biome preset leaves `noLeakedRender` off.
280
291
  - **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<modifier>].test.ts` or `<behaviour>[.<modifier>].spec.ts` with at most one modifier of `dom`, `slow`, `typecheck` and `unit`; a unit test runs without the DOM, so `.unit.dom` is rejected. `tests/colocated` always treats `__tests__/` as a test folder. It treats `test/`, `tests/` and `spec/` as test folders only when their directly contained checked files are all tests or test support; a product folder with source beside its specs is an ordinary source folder. Declared `suites` keep their own layout. Shared test support belongs in `test-support/`, the sanctioned test-only folder. A test covering a whole module may sit at its root or directly beside its folder. The story rules above keep setup in the kit.
281
292
  - **Manifests:** `manifests/valid` decodes every repository `package.json` through one shared Schema before dependent rules run and reports each invalid manifest once with its file path. Read failures other than `NotFound` fail the scan. `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members with exports. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `source`, `types` and `default`. A subtree pattern such as `./server/*.ts` keeps that same subtree in its targets. An optional root entry and exact-path non-code assets such as JSON presets and `./package.json` are allowed. Every module remains importable; `null` export entries fail with a request to remove the block. A package without modules, such as a dependency shell, exports only exact assets and needs no wildcard. Import each module at its path under `src/`; named aliases, flattened paths, per-file module lists and additional wildcards fail. `manifests/application` keeps an application on its entry points, as described above.
@@ -434,6 +445,8 @@ quality hooks status
434
445
  quality hooks pre-commit [--config <file>]
435
446
  ```
436
447
 
448
+ Baseline JSON Lines entries may include a non-empty `reason` explaining retained debt. Lowering or moving an entry keeps its reason.
449
+
437
450
  `quality` alone runs lint. The commands above use the default error-level policy. `prune --against` follows renames since the target's merge base; without a target it tries `origin/HEAD`, `origin/main`, then `origin/master`, and prunes without following moves when no merge base is available. An explicit target with unavailable history fails; fetch the needed history before rerunning. `migrate` splits a single JSON Lines baseline into shards, or converts an earlier JSON baseline into sharded JSON Lines. Use `--from quality/baseline.jsonl` for an existing single-file baseline. It removes the source after writing the shards.
438
451
 
439
452
  | Exit code | Meaning |
@@ -32,11 +32,6 @@
32
32
  "reason": "A test defines the helper and harness components it renders, and no test module is hot-reloaded, so the rule's fast-refresh boundary does not apply.",
33
33
  "rule": "lint/style/useComponentExportOnlyModules"
34
34
  },
35
- {
36
- "includes": ["**"],
37
- "reason": "quality fix applies every Biome lint fix, and this rule's fix changed behavior or did not finish on real code, so the rule is off until it is reviewed.",
38
- "rule": "lint/performance/noDelete"
39
- },
40
35
  {
41
36
  "includes": ["**"],
42
37
  "reason": "An unused private member asks whether it is still needed or should be used; deleting it automatically skips that decision.",
@@ -75,7 +75,7 @@ or {
75
75
  $message = "Ambient scheduling is banned. Use Effect's sleep, scheduling and fibers in the current runtime; bridge callback APIs in adapters/."
76
76
  }
77
77
  } where {
78
- ! $filename <: r"(?:^|.*[/\\])(?:adapters|test-support)[/\\].*|(?:^|.*[/\\])(?:cli|main|.*-cli)\.[cm]?[jt]sx?$|.*\.(?:config|test|spec)\.[cm]?[jt]sx?$",
78
+ ! $filename <: r"(?:^|.*[/\\])(?:adapters|test-support)[/\\].*|(?:^|.*[/\\])(?:cli|main|entry|.*-cli)\.[cm]?[jt]sx?$|.*\.(?:config|test|spec)\.[cm]?[jt]sx?$",
79
79
  ! $program <: contains or {
80
80
  `NodeRuntime.runMain`,
81
81
  `runMain($...)`,
package/biome/preset.json CHANGED
@@ -342,7 +342,7 @@
342
342
  "performance": {
343
343
  "noAccumulatingSpread": "error",
344
344
  "noBarrelFile": "error",
345
- "noDelete": "off",
345
+ "noDelete": { "fix": "none", "level": "error" },
346
346
  "noDynamicNamespaceImportAccess": "error",
347
347
  "noReExportAll": "error",
348
348
  "noSyncScripts": "error",
@@ -2,6 +2,7 @@ import { type Decoded } from "#decoded.ts";
2
2
  export interface BaselineEntry {
3
3
  readonly count: number;
4
4
  readonly file: string;
5
+ readonly reason?: string;
5
6
  readonly rule: string;
6
7
  }
7
8
  export declare function byPathAndRule(left: BaselineEntry, right: BaselineEntry): number;
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/baseline/format.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,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MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAKhH;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC,CAkBxG;AAID,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAExD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAKxE"}
@@ -4,6 +4,7 @@ import { keyOf } from "#engine/violation.ts";
4
4
  const Line = Schema.Struct({
5
5
  count: Schema.Int.check(Schema.isGreaterThan(0)),
6
6
  path: Schema.NonEmptyString,
7
+ reason: Schema.optionalKey(Schema.NonEmptyString),
7
8
  rule: Schema.NonEmptyString,
8
9
  });
9
10
  const BaselineLine = Schema.fromJsonString(Line);
@@ -38,9 +39,9 @@ export async function decodeBaseline(raw) {
38
39
  }
39
40
  return issues.length === 0 ? { _tag: "Valid", value: entries } : { _tag: "Invalid", issues };
40
41
  }
41
- const LINE_KEYS = ["path", "rule", "count"];
42
+ const LINE_KEYS = ["path", "rule", "count", "reason"];
42
43
  export function encodeEntry(entry) {
43
- return JSON.stringify({ count: entry.count, path: entry.file, rule: entry.rule }, LINE_KEYS);
44
+ return JSON.stringify({ count: entry.count, path: entry.file, reason: entry.reason, rule: entry.rule }, LINE_KEYS);
44
45
  }
45
46
  export function encodeBaseline(entries) {
46
47
  return [...entries]
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/baseline/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAgB,UAAU,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1B,KA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AAO,IAAI,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC9F,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAEtD,MAAM,UAAU,WAAW,CAAC,KAAoB;IAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC;AACpH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAiC;IAC/D,OAAO,CAAC,GAAG,OAAO,CAAC;SACjB,IAAI,CAAC,aAAa,CAAC;SACnB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;SACzC,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC"}
@@ -55,7 +55,7 @@ export function prune(existing, violations, index, scope = { moves: new Map() })
55
55
  return [];
56
56
  }
57
57
  moved += Number(now.file !== before.file);
58
- return [{ after: { count: Math.min(before.count, now.count), file: now.file, rule: before.rule }, before }];
58
+ return [{ after: { ...before, count: Math.min(before.count, now.count), file: now.file }, before }];
59
59
  });
60
60
  return {
61
61
  entries: kept.map(({ after }) => after),
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/baseline/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAkC,MAAM,sBAAsB,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAcvC,SAAS,MAAM,CAAC,UAAgC;IAC/C,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAChH,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC;QACX,CAAC;QACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,EAAU,EAAE,KAAgB;IAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,EAAE,0CAA0C,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC;AAED,MAAM,UAAU,KAAK,CACpB,QAA8C,EAC9C,KAAwB,EACxB,UAAgC,EAChC,KAAgB,EAChB,KAA2B;IAE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AAC,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACrG,CAAC,CAAC,CAAC;IACH,OAAO;QACN,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC;QACvC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM;QAChF,KAAK;QACL,OAAO,EAAE,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM;KACtC,CAAC;AACH,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { Effect } from "effect";
2
- import { GateFailed, type SetupFailure } from "#failure.ts";
3
- import type { RuleServices } from "#rule.ts";
4
- export declare const lint: (cwd: string, config: string | undefined, staged?: any) => Effect.Effect<void, GateFailed | SetupFailure, RuleServices>;
2
+ import { GateFailed, SetupFailure } from "#failure.ts";
3
+ export declare const lint: (cwd: string, config: string | undefined, staged?: any) => Effect.Effect<void, GateFailed | SetupFailure, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem>;
5
4
  //# sourceMappingURL=lint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/cli/lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKzC,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,IAAI,yHAyBf,CAAC"}
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/cli/lint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIvD,eAAO,MAAM,IAAI,sNA6BhB,CAAC"}
package/dist/cli/lint.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import { relative } from "node:path";
2
+ import * as NodePath from "@effect/platform-node/NodePath";
2
3
  import { Console, Effect } from "effect";
4
+ import { withHeavyLock } from "@shivaedev/heavy-lock/withHeavyLock.ts";
3
5
  import { looseStagedEntries } from "#baseline/looseStagedEntries.ts";
4
6
  import { evaluate, passes } from "#engine/evaluate.ts";
5
7
  import { openSession } from "#engine/session.ts";
6
8
  import { keyOf } from "#engine/violation.ts";
7
- import { GateFailed } from "#failure.ts";
9
+ import { GateFailed, SetupFailure } from "#failure.ts";
8
10
  import { render } from "#report/render.ts";
9
11
  export const lint = Effect.fn("Cli.lint")(function* (cwd, config, staged = false) {
10
12
  const session = yield* openSession(cwd, config);
@@ -25,5 +27,5 @@ export const lint = Effect.fn("Cli.lint")(function* (cwd, config, staged = false
25
27
  if (!passes(outcome)) {
26
28
  return yield* new GateFailed();
27
29
  }
28
- });
30
+ }, (effect) => withHeavyLock(effect, { command: "quality lint" }).pipe(Effect.catchTag("HeavyLockError", (cause) => new SetupFailure({ cause, message: cause.message })), Effect.provide(NodePath.layer)));
29
31
  //# sourceMappingURL=lint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/cli/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,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,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM;QACzC,YAAY,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QACvF,QAAQ,EACP,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa;KACtI,CAAC,CACF,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC;IAChC,CAAC;AACF,CAAC,EACD,CAAC,MAAM,EAAE,EAAE,CACV,aAAa,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,IAAI,CACtD,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EACjG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC9B,CACF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Schema } from "effect";
2
+ declare const GlobDeclaration: Schema.Struct<{
3
+ readonly glob: Schema.NonEmptyString;
4
+ readonly reason: Schema.String;
5
+ }>;
6
+ export declare const GlobDeclarations: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Struct<{
7
+ readonly glob: Schema.NonEmptyString;
8
+ readonly reason: Schema.String;
9
+ }>>, never>;
10
+ type GlobOptions = Readonly<Record<string, readonly (typeof GlobDeclaration.Type)[]>>;
11
+ export declare function globPatterns(declarations: readonly (typeof GlobDeclaration.Type)[]): readonly string[];
12
+ export declare function validateGlobs({ files, options }: {
13
+ readonly files: readonly string[];
14
+ readonly options: GlobOptions;
15
+ }, matches?: (file: string, glob: string) => boolean): readonly string[];
16
+ export {};
17
+ //# sourceMappingURL=globs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globs.d.ts","sourceRoot":"","sources":["../../src/config/globs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGxC,QAAA,MAAM,eAAe;;;EAGnB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;WAAwF,CAAC;AAEtH,KAAK,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAEtF,wBAAgB,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,MAAM,EAAE,CAEtG;AAOD,wBAAgB,aAAa,CAC5B,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,EACxF,OAAO,GAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAA8B,GACrE,SAAS,MAAM,EAAE,CAMnB"}
@@ -0,0 +1,18 @@
1
+ import { Effect, Schema } from "effect";
2
+ import ignore from "ignore";
3
+ const GlobDeclaration = Schema.Struct({
4
+ glob: Schema.NonEmptyString,
5
+ reason: Schema.String.check(Schema.isPattern(/\S/u, { expected: "a reason for this glob" })),
6
+ });
7
+ export const GlobDeclarations = Schema.Array(GlobDeclaration).pipe(Schema.withDecodingDefaultKey(Effect.succeed([])));
8
+ export function globPatterns(declarations) {
9
+ return declarations.map(({ glob }) => glob);
10
+ }
11
+ function matchesIgnorePattern(file, glob) {
12
+ const result = ignore().add(glob).test(file);
13
+ return result.ignored || result.unignored;
14
+ }
15
+ export function validateGlobs({ files, options }, matches = matchesIgnorePattern) {
16
+ return Object.entries(options).flatMap(([option, declarations]) => declarations.flatMap(({ glob }, index) => files.some((file) => matches(file, glob)) ? [] : [`${option}.${index}.glob: "${glob}" matches no current file. Remove the stale glob.`]));
17
+ }
18
+ //# sourceMappingURL=globs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globs.js","sourceRoot":"","sources":["../../src/config/globs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,wBAAwB,EAAE,CAAC,CAAC;CAC5F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAItH,MAAM,UAAU,YAAY,CAAC,YAAsD;IAClF,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAY,EAAE,IAAY;IACvD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,SAAS,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,aAAa,CAC5B,EAAE,KAAK,EAAE,OAAO,EAAwE,EACxF,OAAO,GAA4C,oBAAoB;IAEvE,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,EAAE,CACjE,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CACxC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,WAAW,IAAI,mDAAmD,CAAC,CACvI,CACD,CAAC;AACH,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Effect } from "effect";
2
+ import { SetupFailure } from "#failure.ts";
2
3
  import type { RuleCheck, RuleInputs, RuleServices } from "#rule.ts";
3
4
  import type { ActiveLevel, Violation } from "./violation.ts";
4
5
  export interface ActiveRule {
@@ -9,5 +10,5 @@ export interface ActiveRule {
9
10
  readonly level: ActiveLevel;
10
11
  readonly registrable?: boolean;
11
12
  }
12
- export declare const runRules: (rules: readonly ActiveRule[], inputs: RuleInputs) => Effect.Effect<readonly Violation[], never, RuleServices>;
13
+ export declare const runRules: (rules: readonly ActiveRule[], inputs: RuleInputs) => Effect.Effect<readonly Violation[], SetupFailure, RuleServices>;
13
14
  //# sourceMappingURL=runRules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runRules.d.ts","sourceRoot":"","sources":["../../src/engine/runRules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAW,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAC/B;AAgDD,eAAO,MAAM,QAAQ,gHAsBnB,CAAC"}
1
+ {"version":3,"file":"runRules.d.ts","sourceRoot":"","sources":["../../src/engine/runRules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAW,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAC/B;AAoDD,eAAO,MAAM,QAAQ,uHAsBnB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { isAbsolute, relative } from "node:path";
2
2
  import { Effect } from "effect";
3
3
  import { ManifestFailure } from "#adapters/manifestInventory.ts";
4
+ import { SetupFailure } from "#failure.ts";
4
5
  import { posix } from "#inventory/ignoreScope.ts";
5
6
  function messageOf(cause) {
6
7
  return cause instanceof Error ? cause.message : String(cause);
@@ -33,7 +34,9 @@ function violationOf(rule, root, finding, exceptionFile) {
33
34
  };
34
35
  }
35
36
  function runRule(rule, inputs, exceptionFile) {
36
- return Effect.suspend(() => rule.check(inputs)).pipe(Effect.orDie, Effect.map((findings) => findings.map((finding) => violationOf(rule, inputs.root, finding, exceptionFile))), Effect.catchDefect((cause) => cause instanceof ManifestFailure
37
+ return Effect.suspend(() => rule.check(inputs)).pipe(Effect.catch((cause) => cause instanceof SetupFailure
38
+ ? Effect.fail(new SetupFailure({ cause, message: `rule ${rule.id} failed: ${cause.message}` }))
39
+ : Effect.die(cause)), Effect.map((findings) => findings.map((finding) => violationOf(rule, inputs.root, finding, exceptionFile))), Effect.catchDefect((cause) => cause instanceof ManifestFailure
37
40
  ? Effect.succeed([{ file: cause.path, level: "error", message: cause.message, rule: "manifests/valid" }])
38
41
  : Effect.die(new Error(`rule ${rule.id} failed: ${messageOf(cause)}`, { cause }))));
39
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"runRules.js","sourceRoot":"","sources":["../../src/engine/runRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAalD,SAAS,SAAS,CAAC,KAAc;IAChC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED,iGAAiG;AACjG,SAAS,cAAc,CAAC,IAAY,EAAE,IAAY;IACjD,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,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M,OAAO,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CACpC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC,EAC3C,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,IAAI,mBAAmB,CAAC,EACzE,EAAE,WAAW,EAAE,WAAW,EAAE,CAC5B,CAAC;IACF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QACxC,IAAI,OAAO,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC;QACb,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO,CAAC,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { Effect } from "effect";
2
2
  import { type ResolvedConfig } from "#config/load.ts";
3
- import { type RegistryEntry } from "#exceptions/registry.ts";
3
+ import type { RegistryEntry } from "#exceptions/registry.ts";
4
4
  import { SetupFailure } from "#failure.ts";
5
5
  import { type Inventory } from "#inventory/collect.ts";
6
6
  import type { RuleServices } from "#rule.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/engine/session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7E,OAAO,EAAE,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Ac,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAC1C;AAUD,eAAO,MAAM,IAAI,kHAef,CAAC;AAEH,eAAO,MAAM,WAAW,qGAgBtB,CAAC"}
@@ -3,8 +3,6 @@ import { Effect } from "effect";
3
3
  import { setManifestFiles } from "#adapters/manifestInventory.ts";
4
4
  import { manifestReader } from "#adapters/manifestReader.ts";
5
5
  import { loadConfig } from "#config/load.ts";
6
- import { validOrFail } from "#decoded.ts";
7
- import { decodeRegistry } from "#exceptions/registry.ts";
8
6
  import { registryEntries } from "#exceptions/registryEntries.ts";
9
7
  import { SetupFailure } from "#failure.ts";
10
8
  import { collectInventory } from "#inventory/collect.ts";
@@ -29,10 +27,16 @@ export const scan = Effect.fn("Engine.scan")(function* (config) {
29
27
  });
30
28
  export const openSession = Effect.fn("Engine.openSession")(function* (cwd, configPath) {
31
29
  const config = yield* loadConfig(cwd, configPath);
32
- const registryRaw = yield* readInput(config.root, config.registry);
33
- const registry = yield* validOrFail(config.registry, yield* Effect.promise(() => decodeRegistry(registryRaw)));
30
+ const selection = configPath === undefined ? "" : ` --config ${configPath}`;
31
+ for (const path of new Set([config.registry, "quality/registry.json"])) {
32
+ if ((yield* readInput(config.root, path)) !== undefined) {
33
+ return yield* new SetupFailure({
34
+ message: `${path} holds legacy exceptions. Run \`quality exceptions migrate${selection} --from ${path}\` to move them into ${config.file}.`,
35
+ });
36
+ }
37
+ }
34
38
  const baseline = yield* readBaseline(config);
35
39
  const { inventory, violations } = yield* scan(config);
36
- return { baseline, config, inventory, registry: [...registry, ...registryEntries(config.exceptions)], violations };
40
+ return { baseline, config, inventory, registry: registryEntries(config.exceptions), violations };
37
41
  });
38
42
  //# sourceMappingURL=session.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRo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AC3I,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;AAClG,CAAC,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Effect } from "effect";
2
+ import { ChildProcessSpawner } from "effect/process";
2
3
  import { GateFailed, SetupFailure } from "#failure.ts";
3
- export declare const preCommitHook: (cwd: string, path: string | undefined) => Effect.Effect<undefined, GateFailed | SetupFailure, import("../rule.ts").RuleServices>;
4
+ export declare const preCommitHook: (cwd: string, path: string | undefined) => Effect.Effect<undefined, GateFailed | SetupFailure, ChildProcessSpawner.ChildProcessSpawner | import("effect/FileSystem").FileSystem>;
4
5
  //# sourceMappingURL=preCommit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preCommit.d.ts","sourceRoot":"","sources":["../../src/hooks/preCommit.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAkCvD,eAAO,MAAM,aAAa,mIAoBxB,CAAC"}
1
+ {"version":3,"file":"preCommit.d.ts","sourceRoot":"","sources":["../../src/hooks/preCommit.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAgB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAKnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAkCvD,eAAO,MAAM,aAAa,kLAoBxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"compilePolicy.d.ts","sourceRoot":"","sources":["../../../src/imports/fences/compilePolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAiC,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAsB,KAAK,EAAE,MAAM,YAAY,CAAC;AAuD5D,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,SAAS,aAAa,EAAE,CAUpG"}
1
+ {"version":3,"file":"compilePolicy.d.ts","sourceRoot":"","sources":["../../../src/imports/fences/compilePolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAiC,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAsB,KAAK,EAAE,MAAM,YAAY,CAAC;AA+D5D,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,SAAS,aAAa,EAAE,CAUpG"}