@shivaedev/quality 0.61.0 → 0.62.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 (84) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +25 -5
  3. package/dist/adapters/agentLinkFindings.d.ts +7 -0
  4. package/dist/adapters/agentLinkFindings.d.ts.map +1 -0
  5. package/dist/adapters/agentLinkFindings.js +18 -0
  6. package/dist/adapters/agentLinkFindings.js.map +1 -0
  7. package/dist/adapters/asciiFindings.d.ts +10 -0
  8. package/dist/adapters/asciiFindings.d.ts.map +1 -0
  9. package/dist/adapters/asciiFindings.js +31 -0
  10. package/dist/adapters/asciiFindings.js.map +1 -0
  11. package/dist/adapters/catalogEntries.d.ts +14 -0
  12. package/dist/adapters/catalogEntries.d.ts.map +1 -0
  13. package/dist/adapters/catalogEntries.js +58 -0
  14. package/dist/adapters/catalogEntries.js.map +1 -0
  15. package/dist/adapters/catalogWorkspace.d.ts +7 -0
  16. package/dist/adapters/catalogWorkspace.d.ts.map +1 -0
  17. package/dist/adapters/catalogWorkspace.js +18 -0
  18. package/dist/adapters/catalogWorkspace.js.map +1 -0
  19. package/dist/adapters/queueReadoutFindings.d.ts.map +1 -1
  20. package/dist/adapters/queueReadoutFindings.js +5 -2
  21. package/dist/adapters/queueReadoutFindings.js.map +1 -1
  22. package/dist/adapters/queueTestingOrigin.js +1 -1
  23. package/dist/adapters/queueTestingOrigin.js.map +1 -1
  24. package/dist/adapters/repositoryPathFindings.d.ts +4 -0
  25. package/dist/adapters/repositoryPathFindings.d.ts.map +1 -0
  26. package/dist/adapters/repositoryPathFindings.js +60 -0
  27. package/dist/adapters/repositoryPathFindings.js.map +1 -0
  28. package/dist/adapters/serviceFolderFindings.d.ts +3 -0
  29. package/dist/adapters/serviceFolderFindings.d.ts.map +1 -0
  30. package/dist/adapters/serviceFolderFindings.js +65 -0
  31. package/dist/adapters/serviceFolderFindings.js.map +1 -0
  32. package/dist/inventory/walk.js +1 -1
  33. package/dist/inventory/walk.js.map +1 -1
  34. package/dist/rules/builtIn.d.ts +3 -1
  35. package/dist/rules/builtIn.d.ts.map +1 -1
  36. package/dist/rules/builtIn.js +10 -0
  37. package/dist/rules/builtIn.js.map +1 -1
  38. package/dist/rules/docs/agentLinks.d.ts +2 -0
  39. package/dist/rules/docs/agentLinks.d.ts.map +1 -0
  40. package/dist/rules/docs/agentLinks.js +8 -0
  41. package/dist/rules/docs/agentLinks.js.map +1 -0
  42. package/dist/rules/docs/repositoryPaths.d.ts +2 -0
  43. package/dist/rules/docs/repositoryPaths.d.ts.map +1 -0
  44. package/dist/rules/docs/repositoryPaths.js +8 -0
  45. package/dist/rules/docs/repositoryPaths.js.map +1 -0
  46. package/dist/rules/effect/serviceFolders.d.ts +2 -0
  47. package/dist/rules/effect/serviceFolders.d.ts.map +1 -0
  48. package/dist/rules/effect/serviceFolders.js +9 -0
  49. package/dist/rules/effect/serviceFolders.js.map +1 -0
  50. package/dist/rules/files/ascii.d.ts +4 -0
  51. package/dist/rules/files/ascii.d.ts.map +1 -0
  52. package/dist/rules/files/ascii.js +13 -0
  53. package/dist/rules/files/ascii.js.map +1 -0
  54. package/dist/rules/files/folderNames.d.ts.map +1 -1
  55. package/dist/rules/files/folderNames.js +7 -4
  56. package/dist/rules/files/folderNames.js.map +1 -1
  57. package/dist/rules/manifestsDependencyPins.d.ts +2 -0
  58. package/dist/rules/manifestsDependencyPins.d.ts.map +1 -0
  59. package/dist/rules/manifestsDependencyPins.js +50 -0
  60. package/dist/rules/manifestsDependencyPins.js.map +1 -0
  61. package/dist/rules/stories/queueReadouts.js +1 -1
  62. package/dist/rules/stories/queueReadouts.js.map +1 -1
  63. package/dist/testing/adapters/hookRepository.d.ts.map +1 -1
  64. package/dist/testing/adapters/hookRepository.js +1 -1
  65. package/dist/testing/adapters/hookRepository.js.map +1 -1
  66. package/package.json +14 -14
  67. package/src/adapters/agentLinkFindings.ts +23 -0
  68. package/src/adapters/asciiFindings.ts +39 -0
  69. package/src/adapters/catalogEntries.ts +81 -0
  70. package/src/adapters/catalogWorkspace.ts +19 -0
  71. package/src/adapters/queueReadoutFindings.ts +5 -2
  72. package/src/adapters/queueTestingOrigin.ts +1 -1
  73. package/src/adapters/repositoryPathFindings.ts +68 -0
  74. package/src/adapters/serviceFolderFindings.ts +75 -0
  75. package/src/inventory/walk.ts +1 -1
  76. package/src/rules/builtIn.ts +10 -0
  77. package/src/rules/docs/agentLinks.ts +8 -0
  78. package/src/rules/docs/repositoryPaths.ts +9 -0
  79. package/src/rules/effect/serviceFolders.ts +10 -0
  80. package/src/rules/files/ascii.ts +14 -0
  81. package/src/rules/files/folderNames.ts +7 -4
  82. package/src/rules/manifestsDependencyPins.ts +66 -0
  83. package/src/rules/stories/queueReadouts.ts +1 -1
  84. package/src/testing/adapters/hookRepository.ts +5 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.62.0 - 2026-11-04
4
+
5
+ ### Added
6
+
7
+ - Require exact external dependency pins and pnpm catalog references when catalogs are declared, including exact catalog entries.
8
+ - Check repository paths in Markdown backticks and require CLAUDE.md links to the sibling AGENTS.md.
9
+ - Check services/<name>/service.ts for a single exported defineService declaration.
10
+ - Check selected text files for non-ASCII bytes with files/ascii options.files.
11
+
12
+ ### Fixed
13
+
14
+ - Accept nested package folders when their path below the workspace package root joins with hyphens to the unscoped package name, such as `packages/glass/client` for `@antumbra/glass-client`. Folder-name findings explain both accepted forms.
15
+
16
+ ## 0.61.1 - 2026-11-04
17
+
18
+ ### Changed
19
+
20
+ - Require Effect 4.0.7 and its matching companion packages. Install the 4.0.7 Effect stack together.
21
+
22
+ ### Fixed
23
+
24
+ - Recognize the test-kits controller import and its jobs stories when checking story assertions against queue storage; applications and other kits remain checked.
25
+
3
26
  ## 0.61.0 - 2026-11-04
4
27
 
5
28
  ### Added
package/README.md CHANGED
@@ -68,6 +68,26 @@ Seed a `quality.config.ts` that registers the custom rule to test the whole gate
68
68
 
69
69
  For an existing kit, compose the lower-level helpers through its local test-support facade: `seedTree` and `removeSeededTrees` from `@shivaedev/quality/testing/adapters/tree.ts` manage fixture files; `scanned` and `findingsIn` from `@shivaedev/quality/testing/adapters/imports.ts` collect inventory and run a configured rule; `runQuality` from `@shivaedev/quality/testing/adapters/cli.ts` runs commands in process. Yield `runQuality(root, "lint")` as an Effect in the kit so it uses the story's controlled clock. These helpers use the same engine as the rule story kit.
70
70
 
71
+ ### Dependency pins and repository hygiene
72
+
73
+ `manifests/dependency-pins` checks dependencies, development dependencies, optional dependencies and peers in every inventoried package manifest. External dependencies use exact versions, including npm aliases. Workspace, file and link dependencies stay local. Quality finds the nearest `pnpm-workspace.yaml` at or above its config folder. When that workspace declares a default or named catalog, external dependencies use `catalog:` or `catalog:<name>`, and the referenced catalog must contain that dependency. Catalog entries themselves use exact versions. Write catalogs as indented block mappings; inline mappings and YAML aliases receive findings instead of escaping the check.
74
+
75
+ `files/ascii` is opt-in by file selection. It checks the bytes of selected text files, including a UTF-8 BOM, and reports each line containing non-ASCII bytes. Other files are left alone. Supply repository-relative glob patterns:
76
+
77
+ ```ts
78
+ export default defineConfig({
79
+ rules: {
80
+ "files/ascii": { options: { files: ["docs/**/*.txt"] } },
81
+ },
82
+ });
83
+ ```
84
+
85
+ `docs/repository-paths` checks paths in backticks in Markdown prose. Explicit `./` and `../` paths resolve from the document; `./` may also name a path from the repository root, as in a command run there. Other paths with a file extension or trailing slash are checked when their first folder belongs to the repository inventory; they may resolve from the repository root or the document’s folder. Prefix an extensionless repository file with `./` or `../` to distinguish it from a rule id or other identifier. Line suffixes and heading fragments are removed before checking existence. Commands, URLs, package specifiers, installed `node_modules` paths, globs, placeholders, fenced examples and released changelogs are left alone. Use a placeholder such as `<app>/src/main.ts` when describing a consumer's example rather than a path in this repository.
86
+
87
+ `docs/agent-links` requires each inventoried `CLAUDE.md`, including dangling links, to be a symlink to an existing `AGENTS.md` file beside it. Keep the instructions in that sibling file.
88
+
89
+ `effect/service-folders` checks folders directly beneath a `services/` grouping. Each has a `service.ts` with exactly one named exported const initialized by a direct `defineService` call. Type exports may stay; other runtime exports belong in focused files. The existing `effect/service-definition-assembly` check enforces the operation inventory. Files named `service.ts` outside this grouping keep their existing rules.
90
+
71
91
  ### Folders that are not Effect code
72
92
 
73
93
  Declare deliberately non-Effect subsystems, such as a game engine or simulation, once in `quality.config.ts`:
@@ -90,7 +110,7 @@ The declaration describes code, not imports: an Effect module importing a non-Ef
90
110
 
91
111
  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.
92
112
 
93
- `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.
113
+ `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 `examples/starter/src/client/main.tsx`. These entry-point conventions accept runners only; the other boundary checks still apply.
94
114
 
95
115
  Within Effect code, 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. Adapter code still follows `effect/service-parameters` and the ambient time, randomness, console and environment bans.
96
116
 
@@ -104,7 +124,7 @@ When an upgrade expands these checks, inspect the new findings, repair the small
104
124
 
105
125
  ### Package service ids
106
126
 
107
- `effect/service-ids` checks literal ids passed to `Context.Service`, `Context.Reference`, `defineService` and RPC middleware `Service` or `Tag` constructors in workspace packages under `packages/`. Each id must start with the owning package manifest's `name`, including a trailing slash. The workspace declarations identify package folders, and the deepest matching folder owns a source file. For example, `packages/group/domain/package.json` named `@antumbra/domain` uses `@antumbra/domain/Store`. Prefix a reported id with its owning package and update any references to that id.
127
+ `effect/service-ids` checks literal ids passed to `Context.Service`, `Context.Reference`, `defineService` and RPC middleware `Service` or `Tag` constructors in workspace packages under `packages/`. Each id must start with the owning package manifest's `name`, including a trailing slash. The workspace declarations identify package folders, and the deepest matching folder owns a source file. For example, `packages/<group>/<domain>/package.json` named `@antumbra/domain` uses `@antumbra/domain/Store`. Prefix a reported id with its owning package and update any references to that id.
108
128
 
109
129
  Import and local aliases, string literals and templates without substitutions are checked, including in adapters and tests. Computed ids, files without a named workspace owner and files outside `packages/` are left alone. This rule refuses config exceptions and inline suppressions.
110
130
 
@@ -255,7 +275,7 @@ const uiBoundary = fence("ui-never-imports-server")
255
275
  export default [uiBoundary];
256
276
  ```
257
277
 
258
- 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.
278
+ 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.
259
279
 
260
280
  The import rules resolve every literal specifier with the nearest `tsconfig.json`, or the project it references that includes the file. They preserve the compiler's resolution settings, inherited path aliases and package export conditions, including NodeNext's import and require branches. `imports/resolvable` reports config syntax errors, invalid options and unreadable extended or referenced configs as findings on the config file; repair those before relying on import findings. Without a tsconfig, Quality uses bundler resolution with the `@shivaedev/source` condition. The run stops 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:
261
281
 
@@ -297,7 +317,7 @@ Settle on the engine's own signal through a kit verb. A deadline bounds a failur
297
317
 
298
318
  `tests/positive-refusals` reports `.not.toBe` and `.not.toEqual` on a readout or field whose name ends in `outcome` (case insensitive), including locally stored readout aliases. In the same story, positively assert a concrete domain reason or public response on that same outcome with `toBe`, `toEqual`, `toMatchObject` or an `outcomes` row. For example, pair `expect(yield* submitOutcome()).not.toBe("saved")` with `expect(yield* submitOutcome()).toBe("unauthorized")`, or replace the negative check with the positive one. Another story, another outcome, an empty object or a boolean does not supply that evidence. The rule uses the same story-file scope and prerequisite exemptions as `tests/domain-outcomes`; it checks visible assertion syntax, while review establishes that a readout preserves unexpected failures.
299
319
 
300
- `tests/queue-readouts` reports access to jobs-testing's `jobs` and `snapshot` readouts in tests and `test-support/`, including wrappers that return counts or job states. An enqueued job does not prove the work ran: assert the application's visible result instead. Worker controls and waits remain available. The check recognizes receivers named `jobsTesting`, controllers constructed with `makePgBossTesting` or annotated with the imported `PgBossTesting` type, local and imported aliases, destructuring and literal bracket access. It does not evaluate dynamic property names or arbitrary controller factories. The package named `@shivaedev/jobs` is exempt, at the repository root or wherever it lives in the workspace; nested application packages remain checked. This rule refuses config exceptions and inline suppressions.
320
+ `tests/queue-readouts` reports access to jobs-testing's `jobs` and `snapshot` readouts in tests and `test-support/`, including wrappers that return counts or job states. An enqueued job does not prove the work ran: assert the application's visible result instead. Worker controls and waits remain available. The check recognizes receivers named `jobsTesting`, controllers constructed with `makePgBossTesting` or annotated with the imported `PgBossTesting` type, local and imported aliases, destructuring and literal bracket access. It does not evaluate dynamic property names or arbitrary controller factories. The package named `@shivaedev/jobs` is exempt, at the repository root or wherever it lives in the workspace; test-kits also owns readout evidence under its `src/jobs/` and `src/test-support/jobs/` folders. Other test-kits domains and nested application packages remain checked. This rule refuses config exceptions and inline suppressions.
301
321
 
302
322
  `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.
303
323
 
@@ -379,7 +399,7 @@ For adoption, run `quality baseline write --rule code/unused --file src/legacy.t
379
399
  - **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.
380
400
  - **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.
381
401
  - **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`.
382
- - **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports that leave their folder (except a module’s client or server `registration.ts` or `registration.tsx` importing its own `./admin/` subtree), production imports of test code, runtime folders and fences, as described above.
402
+ - **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports that leave their folder (except a module’s client or server `registration.ts` or `registration.tsx` importing its own `<module>/admin/` subtree), production imports of test code, runtime folders and fences, as described above.
383
403
  - **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. Inside a module’s `client/admin/` or `server/admin/` subtree, file names may repeat words from above `admin/`: `src/modules/inbox/client/admin/inboxRoutes.ts` may export `inboxRoutes`. Names must still match their exports and omit words repeated by folders within the admin subtree. 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.
384
404
  - **Change keys:** `boundaries/imported-change-keys` reports literal collection and bucket names in Reactivity invalidations and mutations, SQL `invalidateOnCommit`, and the `changes` key encoders. Import the owning declaration and use its name, list, item or bucket key. Literal record IDs and bucket values are accepted, as are names at their collection declaration.
385
405
  - **SQL transactions:** `effect/sql-transact` reports native `sql.withTransaction` calls around repository writes, `transact` or `invalidateOnCommit`. Begin the outer transaction with `transact(effect, { onSqlError })` so changed keys follow its commit. The rule resolves native SQL and repository declarations and follows direct calls, pipes, local aliases and source helpers. Native read-only and raw SQL transactions and unrelated transaction methods remain supported.
@@ -0,0 +1,7 @@
1
+ import { Effect, FileSystem } from "effect";
2
+ import type { RuleInputs } from "#rule.ts";
3
+ export declare const agentLinkFindings: (args_0: RuleInputs) => Effect.Effect<{
4
+ file: string;
5
+ message: string;
6
+ }[], import("#inventory/filesystem.ts").FilesystemFailure | import("effect/PlatformError").PlatformError, FileSystem.FileSystem>;
7
+ //# sourceMappingURL=agentLinkFindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentLinkFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/agentLinkFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,iBAAiB;;;gIAiB5B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { dirname, join, resolve } from "node:path";
2
+ import { Effect, FileSystem } from "effect";
3
+ import { orWhenAbsent } from "#inventory/filesystem.ts";
4
+ export const agentLinkFindings = Effect.fn("Quality.agentLinkFindings")(function* ({ files, root }) {
5
+ const fs = yield* FileSystem.FileSystem;
6
+ const findings = yield* Effect.forEach(files.filter((file) => file === "CLAUDE.md" || file.endsWith("/CLAUDE.md")), (file) => Effect.gen(function* () {
7
+ const path = join(root, file);
8
+ const info = yield* fs.lstat(path);
9
+ const target = info.type === "SymbolicLink" ? yield* fs.readLink(path) : undefined;
10
+ const agents = join(dirname(path), "AGENTS.md");
11
+ const sibling = yield* orWhenAbsent(agents, fs.stat(agents), undefined);
12
+ return target !== undefined && resolve(dirname(path), target) === agents && sibling?.type === "File"
13
+ ? []
14
+ : [{ file, message: "Replace CLAUDE.md with a symlink to the AGENTS.md file beside it, and keep the instructions in AGENTS.md." }];
15
+ }));
16
+ return findings.flat();
17
+ });
18
+ //# sourceMappingURL=agentLinkFindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentLinkFindings.js","sourceRoot":"","sources":["../../src/adapters/agentLinkFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAc;IAC7G,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CACrC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAC3E,CAAC,IAAI,EAAE,EAAE,CACR,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACnF,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,YAAY,CAAmC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;QAC1G,OAAO,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,EAAE,IAAI,KAAK,MAAM;YACnG,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,2GAA2G,EAAE,CAAC,CAAC;IACrI,CAAC,CAAC,CACH,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Effect, FileSystem } from "effect";
2
+ import type { RuleContext } from "#rule.ts";
3
+ export declare const asciiFindings: (args_0: RuleContext<{
4
+ readonly files: readonly string[];
5
+ }>) => Effect.Effect<{
6
+ file: string;
7
+ line: number;
8
+ message: string;
9
+ }[], import("effect/PlatformError").PlatformError, FileSystem.FileSystem>;
10
+ //# sourceMappingURL=asciiFindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asciiFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/asciiFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAgB5C,eAAO,MAAM,aAAa;oBAIO,SAAS,MAAM,EAAE;;;;;yEAehD,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { join } from "node:path";
2
+ import { Effect, FileSystem } from "effect";
3
+ import { globMatcher } from "#imports/globMatcher.ts";
4
+ function nonAsciiLines(bytes) {
5
+ const lines = new Set();
6
+ let line = 1;
7
+ for (const byte of bytes) {
8
+ if (byte > 127) {
9
+ lines.add(line);
10
+ }
11
+ if (byte === 10) {
12
+ line += 1;
13
+ }
14
+ }
15
+ return [...lines];
16
+ }
17
+ export const asciiFindings = Effect.fn("Quality.asciiFindings")(function* ({ files, options, root, }) {
18
+ const fs = yield* FileSystem.FileSystem;
19
+ const patterns = options.files.map(globMatcher);
20
+ const selected = files.filter((file) => patterns.some((matches) => matches(file)));
21
+ const findings = yield* Effect.forEach(selected, (file) => Effect.gen(function* () {
22
+ const bytes = yield* fs.readFile(join(root, file));
23
+ return nonAsciiLines(bytes).map((line) => ({
24
+ file,
25
+ line,
26
+ message: "This file is ASCII-only. Replace non-ASCII characters with ASCII text or escapes.",
27
+ }));
28
+ }));
29
+ return findings.flat();
30
+ });
31
+ //# sourceMappingURL=asciiFindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asciiFindings.js","sourceRoot":"","sources":["../../src/adapters/asciiFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,SAAS,aAAa,CAAC,KAAiB;IACvC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,IAAI,IAAI,GAAG,GAAG,EAAE,CAAC;YAChB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,CAAC;QACX,CAAC;IACF,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,QAAQ,CAAC,EAAE,EAC1E,KAAK,EACL,OAAO,EACP,IAAI,GACgD;IACpD,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnF,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CACzD,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACnD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1C,IAAI;YACJ,IAAI;YACJ,OAAO,EAAE,mFAAmF;SAC5F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CACF,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Finding } from "#rule.ts";
2
+ interface CatalogEntry {
3
+ readonly catalog: string;
4
+ readonly line: number;
5
+ readonly name: string;
6
+ readonly version: string;
7
+ }
8
+ export declare function catalogEntries(text: string): {
9
+ entries: CatalogEntry[];
10
+ findings: Finding[];
11
+ present: boolean;
12
+ };
13
+ export {};
14
+ //# sourceMappingURL=catalogEntries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogEntries.d.ts","sourceRoot":"","sources":["../../src/adapters/catalogEntries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,YAAY;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAyDD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM;IAejC,OAAO;IAAgB,QAAQ;IAAiB,OAAO;EAChE"}
@@ -0,0 +1,58 @@
1
+ const HEADING = /^(?:catalog|["']catalog["'])\s*:\s*(?<default>.*)$|^(?:catalogs|["']catalogs["'])\s*:\s*(?<named>.*)$/u;
2
+ const MEMBER = /^(?<indent> +)(?:"(?<double>[^"]+)"|'(?<single>[^']+)'|(?<plain>[^\s:][^:]*)):\s*(?<value>.*)$/u;
3
+ function scalar(text) {
4
+ return text
5
+ .replace(/(?:^|\s+)#.*$/u, "")
6
+ .trim()
7
+ .replace(/^["']|["']$/gu, "");
8
+ }
9
+ function finding(scan, line, message) {
10
+ scan.findings.push({ file: "pnpm-workspace.yaml", line, message });
11
+ }
12
+ function heading(scan, fields, line) {
13
+ scan.active = true;
14
+ scan.present = true;
15
+ scan.named = fields.named !== undefined;
16
+ scan.catalog = "";
17
+ scan.catalogIndent = 0;
18
+ if (scalar(fields.named ?? fields.default ?? "") !== "") {
19
+ finding(scan, line, "Write catalogs as indented block mappings so every dependency pin can be checked.");
20
+ }
21
+ }
22
+ function member(scan, text, line) {
23
+ const fields = MEMBER.exec(text)?.groups;
24
+ const name = fields?.double ?? fields?.single ?? fields?.plain;
25
+ if (fields === undefined || name === undefined) {
26
+ finding(scan, line, "Write this catalog entry as a name and an exact version in an indented block mapping.");
27
+ return;
28
+ }
29
+ const indent = fields.indent?.length ?? 0;
30
+ const value = scalar(fields.value ?? "");
31
+ if (scan.named && (scan.catalogIndent === 0 || indent <= scan.catalogIndent)) {
32
+ scan.catalog = name;
33
+ scan.catalogIndent = indent;
34
+ if (value !== "") {
35
+ finding(scan, line, "Write this named catalog as an indented block mapping of exact dependency pins.");
36
+ }
37
+ return;
38
+ }
39
+ scan.entries.push({ catalog: scan.catalog, line, name: name.trim(), version: value });
40
+ }
41
+ export function catalogEntries(text) {
42
+ const scan = { active: false, catalog: "", catalogIndent: 0, entries: [], findings: [], named: false, present: false };
43
+ for (const [index, line] of text.split("\n").entries()) {
44
+ const fields = HEADING.exec(line)?.groups;
45
+ if (fields !== undefined) {
46
+ heading(scan, fields, index + 1);
47
+ continue;
48
+ }
49
+ if (/^[^\s#]/u.test(line)) {
50
+ scan.active = false;
51
+ }
52
+ if (scan.active && !/^\s*(?:#.*)?$/u.test(line)) {
53
+ member(scan, line, index + 1);
54
+ }
55
+ }
56
+ return { entries: scan.entries, findings: scan.findings, present: scan.present };
57
+ }
58
+ //# sourceMappingURL=catalogEntries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogEntries.js","sourceRoot":"","sources":["../../src/adapters/catalogEntries.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAO,GAAG,wGAAwG,CAAC;AACzH,MAAM,MAAM,GAAG,iGAAiG,CAAC;AAEjH,SAAS,MAAM,CAAC,IAAY;IAC3B,OAAO,IAAI;SACT,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;SAC7B,IAAI,EAAE;SACN,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,OAAO,CAAC,IAAiB,EAAE,IAAY,EAAE,OAAe;IAChE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,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,CAAC,CAAC,CAAC;QAC/B,CAAC;IACF,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;AAClF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Effect } from "effect";
2
+ import type { RuleInputs } from "#rule.ts";
3
+ export declare const catalogWorkspace: (args_0: Pick<RuleInputs, "readText" | "root">) => Effect.Effect<{
4
+ file: string;
5
+ text: string;
6
+ }, never, never>;
7
+ //# sourceMappingURL=catalogWorkspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogWorkspace.d.ts","sourceRoot":"","sources":["../../src/adapters/catalogWorkspace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,gBAAgB;;;gBAc3B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { dirname, join, relative, sep } from "node:path";
2
+ import { Effect } from "effect";
3
+ export const catalogWorkspace = Effect.fn("Manifests.catalogWorkspace")(function* ({ readText, root }) {
4
+ let directory = root;
5
+ for (;;) {
6
+ const file = relative(root, join(directory, "pnpm-workspace.yaml")).split(sep).join("/");
7
+ const text = yield* Effect.promise(() => readText(file));
8
+ if (text !== undefined) {
9
+ return { file, text };
10
+ }
11
+ const parent = dirname(directory);
12
+ if (parent === directory) {
13
+ return { file: "pnpm-workspace.yaml", text: "" };
14
+ }
15
+ directory = parent;
16
+ }
17
+ });
18
+ //# sourceMappingURL=catalogWorkspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogWorkspace.js","sourceRoot":"","sources":["../../src/adapters/catalogWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE,CAAC,4BAA4B,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAyC;IAC3I,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,SAAS,CAAC;QACT,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzF,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACvB,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAClC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAClD,CAAC;QACD,SAAS,GAAG,MAAM,CAAC;IACpB,CAAC;AACF,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"queueReadoutFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/queueReadoutFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,eAAO,MAAM,oBAAoB;;;;uEAqB/B,CAAC"}
1
+ {"version":3,"file":"queueReadoutFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/queueReadoutFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,eAAO,MAAM,oBAAoB;;;;uEAwB/B,CAAC"}
@@ -15,8 +15,11 @@ export const queueReadoutFindings = Effect.fn("Stories.queueReadoutFindings")(fu
15
15
  const program = storyProgram(inputs, graph);
16
16
  const origin = queueTestingOrigin(program.getTypeChecker());
17
17
  return inputs.sources.flatMap((file) => {
18
- const owner = packageOf(graph.packages, file.path)?.name ?? root?.name;
19
- if (!isTestCode(file.path) || owner === "@shivaedev/jobs") {
18
+ const workspace = packageOf(graph.packages, file.path);
19
+ const owner = workspace?.name ?? root?.name;
20
+ const local = workspace === undefined ? file.path : file.path.slice(workspace.directory.length + 1);
21
+ const controller = owner === "@shivaedev/test-kits" && (local.startsWith("src/jobs/") || local.startsWith("src/test-support/jobs/"));
22
+ if (!isTestCode(file.path) || owner === "@shivaedev/jobs" || controller) {
20
23
  return [];
21
24
  }
22
25
  const source = program.getSourceFile(join(inputs.root, file.path));
@@ -1 +1 @@
1
- {"version":3,"file":"queueReadoutFindings.js","sourceRoot":"","sources":["../../src/adapters/queueReadoutFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,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ACX,CAAC;QACD,OAAO,UAAU,CAChB,MAAM,EACN,CAAC,IAAI,EAAE,EAAE,CACR,CAAC,CAAC,EAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;eACxG,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAC7D,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACtI,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import ts from "typescript";
2
2
  import { importFrom } from "#rules/stories/importOrigin.ts";
3
3
  import { memberName, unwrapped } from "#rules/stories/syntax.ts";
4
- const TESTING_MODULE = "@shivaedev/jobs/server/testing.ts";
4
+ const TESTING_MODULE = "@shivaedev/test-kits/jobs/testing.ts";
5
5
  function importedOrigin(node) {
6
6
  if (importFrom(node) !== TESTING_MODULE) {
7
7
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"queueTestingOrigin.js","sourceRoot":"","sources":["../../src/adapters/queueTestingOrigin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAIjE,MAAM,cAAc,GAAG,mCAAmC,CAAC;AAE3D,SAAS,cAAc,CAAC,IAAa;IACpC,IAA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AAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YACvD,OAAO,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,SAAS,KAAK,CAAC,IAAa;QAC3B,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3C,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5B,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACxB,OAAO,MAAM,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Effect, FileSystem } from "effect";
2
+ import type { Finding, RuleInputs } from "#rule.ts";
3
+ export declare const repositoryPathFindings: (args_0: RuleInputs) => Effect.Effect<Finding[], import("effect/PlatformError").PlatformError, FileSystem.FileSystem>;
4
+ //# sourceMappingURL=repositoryPathFindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repositoryPathFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/repositoryPathFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAG5C,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AA0CpD,eAAO,MAAM,sBAAsB,uHAqBjC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { join, posix } from "node:path";
2
+ import { Effect, FileSystem } from "effect";
3
+ import { isDocument } from "#docs/isDocument.ts";
4
+ import { codeSpans, markdownLines } from "#docs/markdownLines.ts";
5
+ function pathIn(span) {
6
+ if (!(span.includes("/") && (span.startsWith(".") || span.endsWith("/") || /\.[a-z0-9]+(?::\d+(?::\d+)?|#.*)?$/iu.test(span)))
7
+ || /[\s*?<>${}\\]/u.test(span)
8
+ || /^(?:\/|@|~|[\w+.-]+:)/u.test(span)
9
+ || /(?:^|\/)node_modules(?:\/|$)/u.test(span)) {
10
+ return;
11
+ }
12
+ return span.replace(/(?::\d+(?::\d+)?|#.*)$/u, "").replace(/\/+$/u, "");
13
+ }
14
+ function references(text) {
15
+ return markdownLines(text)
16
+ .filter((line) => line.kind === "prose")
17
+ .flatMap((line) => codeSpans(line.text).flatMap((span) => {
18
+ const path = pathIn(span);
19
+ return path === undefined ? [] : [{ line: line.number, path, span }];
20
+ }));
21
+ }
22
+ const missingPath = Effect.fn("Docs.missingPath")(function* (root, file, path) {
23
+ const fs = yield* FileSystem.FileSystem;
24
+ const explicit = path.startsWith("./") || path.startsWith("../");
25
+ const local = posix.join(posix.dirname(file), path);
26
+ const target = explicit ? local : posix.normalize(path);
27
+ if (target === ".." || target.startsWith("../")) {
28
+ return true;
29
+ }
30
+ if (yield* fs.exists(join(root, target))) {
31
+ return false;
32
+ }
33
+ if (path.startsWith("./") && (yield* fs.exists(join(root, path)))) {
34
+ return false;
35
+ }
36
+ return explicit || !(yield* fs.exists(join(root, local)));
37
+ });
38
+ export const repositoryPathFindings = Effect.fn("Docs.repositoryPathFindings")(function* ({ files, readText, root }) {
39
+ const roots = new Set(files.map((file) => file.split("/")[0]));
40
+ const findings = [];
41
+ for (const file of files.filter((path) => isDocument(path) && posix.basename(path) !== "CLAUDE.md")) {
42
+ const text = yield* Effect.promise(() => readText(file));
43
+ for (const reference of references(text ?? "")) {
44
+ const { path, span, line } = reference;
45
+ if (!(path.startsWith("./") || path.startsWith("../") || roots.has(path.split("/")[0]))) {
46
+ continue;
47
+ }
48
+ if (yield* missingPath(root, file, path)) {
49
+ findings.push({
50
+ file,
51
+ line,
52
+ message: `Repository path "${span}" does not resolve to an existing path inside the repository. Use its current path, relative to this document (./ or ../) or the repository root.`,
53
+ subject: span,
54
+ });
55
+ }
56
+ }
57
+ }
58
+ return findings;
59
+ });
60
+ //# sourceMappingURL=repositoryPathFindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repositoryPathFindings.js","sourceRoot":"","sources":["../../src/adapters/repositoryPathFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGlE,SAAS,MAAM,CAAC,IAAY;IAC3B,IACC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,sCAAsC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;WACvH,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;WAC3B,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;WACnC,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,EAC5C,CAAC;QACF,OAAO;IACR,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC/B,OAAO,aAAa,CAAC,IAAI,CAAC;SACxB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAA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C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzF,SAAS;YACV,CAAC;YACD,IAAI,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;gBAC1C,QAAQ,CAAC,IAAI,CAAC;oBACb,IAAI;oBACJ,IAAI;oBACJ,OAAO,EAAE,oBAAoB,IAAI,mJAAmJ;oBACpL,OAAO,EAAE,IAAI;iBACb,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Finding, RuleInputs } from "#rule.ts";
2
+ export declare function serviceFolderFindings({ files, sources }: RuleInputs): readonly Finding[];
3
+ //# sourceMappingURL=serviceFolderFindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceFolderFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/serviceFolderFindings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAc,MAAM,UAAU,CAAC;AAiDhE,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,SAAS,OAAO,EAAE,CAqBxF"}
@@ -0,0 +1,65 @@
1
+ import { posix } from "node:path";
2
+ import ts from "typescript";
3
+ import { serviceAssemblyImports } from "#adapters/serviceAssemblyImports.ts";
4
+ import { directServiceDefinitions, unwrapExpression } from "#adapters/serviceAssemblySyntax.ts";
5
+ import { parse } from "#rules/parse.ts";
6
+ function exported(statement) {
7
+ return ts.canHaveModifiers(statement) && (ts.getModifiers(statement)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ?? false);
8
+ }
9
+ function runtimeReexport(node) {
10
+ if (!ts.isExportDeclaration(node) || node.isTypeOnly) {
11
+ return false;
12
+ }
13
+ const clause = node.exportClause;
14
+ return clause === undefined || !ts.isNamedExports(clause) || clause.elements.length === 0 || clause.elements.some((item) => !item.isTypeOnly);
15
+ }
16
+ function serviceShape(file) {
17
+ const source = parse(file);
18
+ if (source === undefined) {
19
+ return [];
20
+ }
21
+ const definitions = directServiceDefinitions(source, serviceAssemblyImports(source).definitions);
22
+ const runtime = source.statements.filter((candidate) => exported(candidate) && !ts.isInterfaceDeclaration(candidate) && !ts.isTypeAliasDeclaration(candidate));
23
+ const [statement] = runtime;
24
+ const declaration = statement !== undefined && ts.isVariableStatement(statement) ? statement.declarationList.declarations[0] : undefined;
25
+ const valid = runtime.length === 1
26
+ && definitions.length === 1
27
+ && statement !== undefined
28
+ && ts.isVariableStatement(statement)
29
+ && (statement.declarationList.flags & ts.NodeFlags.Const) !== 0
30
+ && statement.declarationList.declarations.length === 1
31
+ && declaration?.initializer !== undefined
32
+ && ts.isIdentifier(declaration.name)
33
+ && definitions[0] === unwrapExpression(declaration.initializer)
34
+ && !source.statements.some((node) => ts.isExportAssignment(node) || runtimeReexport(node));
35
+ return valid
36
+ ? []
37
+ : [
38
+ {
39
+ file: file.path,
40
+ line: 1,
41
+ message: "Export exactly one named const initialized by a direct defineService call from service.ts. Move other runtime exports to their own files; type exports may stay.",
42
+ },
43
+ ];
44
+ }
45
+ export function serviceFolderFindings({ files, sources }) {
46
+ const folders = new Set(files.flatMap((file) => {
47
+ const match = /^(?<folder>(?:.*\/)?services\/[^/]+)\//u.exec(file)?.groups?.folder;
48
+ return match === undefined ? [] : [match];
49
+ }));
50
+ const findings = [];
51
+ for (const folder of folders) {
52
+ const service = `${folder}/service.ts`;
53
+ if (!files.includes(service)) {
54
+ findings.push({
55
+ file: folder,
56
+ message: "Give this service folder a service.ts that exports its defineService declaration. Keep operations in focused sibling files.",
57
+ });
58
+ }
59
+ }
60
+ return [
61
+ ...findings,
62
+ ...sources.filter((file) => posix.basename(file.path) === "service.ts" && folders.has(posix.dirname(file.path))).flatMap(serviceShape),
63
+ ];
64
+ }
65
+ //# sourceMappingURL=serviceFolderFindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceFolderFindings.js","sourceRoot":"","sources":["../../src/adapters/serviceFolderFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,SAAS,QAAQ,CAAC,SAAuB;IACxC,OAAO,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,CAAC;AACnJ,CAAC;AAED,SAAS,eAAe,CAAC,IAAa;IACrC,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACtD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;IACjC,OAAO,MAAM,KAAK,SAAS,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC/I,CAAC;AAED,SAAS,YAAY,CAAC,IAAgB;IACrC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,IA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 const walkDirectory = Effect.fnUntraced(function* (dir, inherited, tracked) {
44
44
  });
45
45
  const walkEntry = Effect.fnUntraced(function* (path, scope, tracked) {
46
46
  const fs = yield* FileSystem.FileSystem;
47
- const info = yield* orWhenAbsent(path, fs.stat(path), undefined);
47
+ const info = yield* orWhenAbsent(path, path.endsWith("/CLAUDE.md") ? fs.lstat(path) : fs.stat(path), undefined);
48
48
  if (info === undefined) {
49
49
  return [];
50
50
  }