@hailstails/hone 2.0.0-pre.2 → 2.0.0-pre.4

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 (201) hide show
  1. package/ADOPTING.md +7 -7
  2. package/CHANGELOG.md +76 -0
  3. package/MIGRATING.md +15 -6
  4. package/README.md +12 -13
  5. package/chunks/chunk-3CWFUD5B.js +38 -0
  6. package/chunks/chunk-5AKHEW6V.js +15 -0
  7. package/chunks/chunk-75XWZYNN.js +64 -0
  8. package/chunks/chunk-7FVSZ2VL.js +1304 -0
  9. package/chunks/chunk-A3RL4O5V.js +146 -0
  10. package/chunks/chunk-BIDD2YWP.js +398 -0
  11. package/chunks/{chunk-GNOMK7CR.js → chunk-BKQ3K766.js} +489 -52
  12. package/chunks/{chunk-NRIQD3PI.js → chunk-BRANVR7K.js} +3 -5
  13. package/chunks/chunk-COQMPHWZ.js +37 -0
  14. package/chunks/{chunk-L7BGRC6D.js → chunk-CXM5KBZX.js} +1 -1
  15. package/chunks/chunk-D6645WPB.js +6 -0
  16. package/chunks/chunk-DJMF6JIM.js +42 -0
  17. package/chunks/{chunk-OKLYWD2Z.js → chunk-E4D5WDRX.js} +27 -20
  18. package/chunks/chunk-EBX57Z3V.js +8 -0
  19. package/chunks/chunk-FHVNKG5Q.js +19 -0
  20. package/chunks/chunk-FPIP7JEC.js +191 -0
  21. package/chunks/{chunk-QP5TLOBY.js → chunk-HVZVKZPW.js} +12 -9
  22. package/chunks/chunk-LD766VWU.js +57 -0
  23. package/chunks/chunk-LEFM7OPS.js +41 -0
  24. package/chunks/chunk-LNMDMRGQ.js +51 -0
  25. package/chunks/{chunk-RGSHTPLA.js → chunk-MBEDAFVC.js} +3 -11
  26. package/chunks/chunk-OO5KV7KN.js +17 -0
  27. package/chunks/{chunk-ASUN4AVC.js → chunk-PVSC4SE3.js} +71 -5
  28. package/chunks/chunk-SKDQ3QJD.js +75 -0
  29. package/chunks/chunk-W5OIAUDW.js +18 -0
  30. package/chunks/chunk-X73RZUPO.js +63 -0
  31. package/chunks/chunk-XE2KKWYH.js +45 -0
  32. package/chunks/chunk-YGMO5Z6U.js +432 -0
  33. package/chunks/chunk-YONPKP3C.js +15 -0
  34. package/docs/adding-a-discipline-or-mechanism.md +1 -1
  35. package/docs/extending.md +7 -388
  36. package/package.json +7 -6
  37. package/rules/README.md +2 -2
  38. package/rules/typescript/checks.md +236 -18
  39. package/rules/typescript/symptoms/ambient-randomness/random-call.md +10 -0
  40. package/rules/typescript/symptoms/answer-set-in-a-hook/hook-answer.md +10 -0
  41. package/rules/typescript/symptoms/assertion-outside-a-test/assertion-site.md +10 -0
  42. package/rules/typescript/symptoms/assertion-outside-a-test.md +25 -0
  43. package/rules/typescript/symptoms/built-unit-called-in-place/call-of-a-call.md +10 -0
  44. package/rules/typescript/symptoms/built-unit-called-in-place.md +25 -0
  45. package/rules/typescript/symptoms/code-or-prose-read-as-text/raw-read.md +10 -0
  46. package/rules/typescript/symptoms/code-or-prose-read-as-text.md +31 -0
  47. package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +1 -1
  48. package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +1 -1
  49. package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +2 -2
  50. package/rules/typescript/symptoms/export-from-a-test-file/test-file-export.md +10 -0
  51. package/rules/typescript/symptoms/export-from-a-test-file.md +33 -0
  52. package/rules/typescript/symptoms/failure-shaped-as-success/empty-catch.md +10 -0
  53. package/rules/typescript/symptoms/floating-version/version-selector.md +10 -0
  54. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +1 -1
  55. package/rules/typescript/symptoms/many-spellings-of-one-concept/test-call-aliases.md +10 -0
  56. package/rules/typescript/symptoms/many-spellings-of-one-concept.md +3 -2
  57. package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +4 -4
  58. package/rules/typescript/symptoms/no-lock-file/committed-lock-file.md +12 -0
  59. package/rules/typescript/symptoms/process-global-used-in-place/debugger-statement.md +10 -0
  60. package/rules/typescript/symptoms/process-global-used-in-place/direct-global-use.md +14 -0
  61. package/rules/typescript/symptoms/process-global-used-in-place.md +1 -1
  62. package/rules/typescript/symptoms/prose-in-code/comment-prose.md +12 -0
  63. package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +3 -6
  64. package/rules/typescript/symptoms/test-switched-off.md +1 -1
  65. package/rules/typescript/symptoms/throw-between-our-units/throw-statement.md +10 -0
  66. package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +1 -1
  67. package/rules/typescript/symptoms/tool-fetched-at-run-time/fetch-command.md +10 -0
  68. package/rules/typescript/symptoms/type-declared-in-a-test/test-type-declaration.md +10 -0
  69. package/rules/typescript/symptoms/type-declared-in-a-test.md +33 -0
  70. package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +2 -2
  71. package/rules/typescript/symptoms/wide-input/unread-parameter.md +10 -0
  72. package/rules/typescript/symptoms/wide-input.md +3 -2
  73. package/rules/typescript/symptoms.md +183 -121
  74. package/src/application/conformance/conformance-testing-types.d.ts +13 -16
  75. package/src/domain/language-layer/authored-item-types.d.ts +50 -0
  76. package/src/domain/language-layer/catalogue-name.d.ts +5 -0
  77. package/src/domain/language-layer/check-address-text.d.ts +12 -0
  78. package/src/domain/rule-set/authored-rule-set-types.d.ts +31 -32
  79. package/src/domain/rule-set/clause-address-types.d.ts +4 -3
  80. package/src/domain/rule-set/rule-set-name-of.d.ts +10 -0
  81. package/src/domain/runner/check-binding.d.ts +18 -0
  82. package/src/domain/runner/check-observations.d.ts +39 -0
  83. package/src/domain/runner/conformance-types.d.ts +8 -2
  84. package/src/domain/settings/test-files.d.ts +7 -0
  85. package/src/eslint-plugin.js +16 -12
  86. package/src/hone.js +10493 -10410
  87. package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +0 -6
  88. package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +0 -6
  89. package/src/infrastructure/engines/eslint/runner/pieces/eslint-piece-settings-types.d.ts +2 -0
  90. package/src/infrastructure/engines/eslint/runner/runner.js +953 -1189
  91. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/README.md +0 -3
  92. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js +33 -21
  93. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +11 -4
  94. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +28 -0
  95. package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +0 -2
  96. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/eslint-plugin.js +94 -0
  97. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/piece.json +11 -0
  98. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/unread-parameter.examples.json +48 -0
  99. package/src/infrastructure/engines/walker/ambient-randomness/random-call/ambient-randomness.js +109 -0
  100. package/src/infrastructure/engines/walker/ambient-randomness/random-call/piece.json +9 -0
  101. package/src/infrastructure/engines/walker/ambient-randomness/random-call/random-call.examples.json +48 -0
  102. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answer.examples.json +42 -0
  103. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answers.js +72 -0
  104. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/piece.json +9 -0
  105. package/src/infrastructure/engines/walker/assertion-outside-a-test/assertion-site/assertion-site.examples.json +30 -0
  106. package/src/infrastructure/engines/walker/assertion-outside-a-test/assertion-site/assertion-site.js +123 -0
  107. package/src/infrastructure/engines/walker/assertion-outside-a-test/assertion-site/piece.json +9 -0
  108. package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-syntax.js +3 -3
  109. package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-signatures.js +7 -5
  110. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +213 -126
  111. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.examples.json +24 -0
  112. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.js +34 -0
  113. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/piece.json +9 -0
  114. package/src/infrastructure/engines/walker/claimed-type/cast-to-any/any-cast.js +6 -4
  115. package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/cast-expressions.js +6 -4
  116. package/src/infrastructure/engines/walker/code-or-prose-read-as-text/raw-read/piece.json +9 -0
  117. package/src/infrastructure/engines/walker/code-or-prose-read-as-text/raw-read/raw-read.examples.json +30 -0
  118. package/src/infrastructure/engines/walker/code-or-prose-read-as-text/raw-read/raw-read.js +166 -0
  119. package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +0 -10
  120. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +4 -4
  121. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +8 -6
  122. package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +0 -10
  123. package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/dependency-isolation.js +9 -14
  124. package/src/infrastructure/engines/walker/drawer-path/drawer-names/categorical-paths.js +4 -4
  125. package/src/infrastructure/engines/walker/export-from-a-test-file/test-file-export/piece.json +9 -0
  126. package/src/infrastructure/engines/walker/export-from-a-test-file/test-file-export/test-file-export.examples.json +30 -0
  127. package/src/infrastructure/engines/walker/export-from-a-test-file/test-file-export/test-file-export.js +31 -0
  128. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.examples.json +18 -0
  129. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.js +32 -0
  130. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/piece.json +9 -0
  131. package/src/infrastructure/engines/walker/floating-version/version-selector/piece.json +9 -0
  132. package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.examples.json +54 -0
  133. package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.js +75 -0
  134. package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/hermetic-git-spawns.js +8 -17
  135. package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loops.js +8 -6
  136. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/piece.json +9 -0
  137. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.examples.json +36 -0
  138. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.js +67 -0
  139. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +34 -0
  140. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mocking.js +64 -16
  141. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +5 -1
  142. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.examples.json +24 -0
  143. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.js +41 -0
  144. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/piece.json +9 -0
  145. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +18 -16
  146. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +1 -1
  147. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.examples.json +18 -0
  148. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.js +17 -0
  149. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/piece.json +9 -0
  150. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/direct-global-use.examples.json +63 -0
  151. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/piece.json +13 -0
  152. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/process-global-used-in-place.js +126 -0
  153. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/comment-prose.examples.json +42 -0
  154. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/piece.json +16 -0
  155. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/prose-in-code.js +90 -0
  156. package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +0 -10
  157. package/src/infrastructure/engines/walker/runner/pieces/walker-piece.d.ts +7 -5
  158. package/src/infrastructure/engines/walker/runner/runner.js +266 -77
  159. package/src/infrastructure/engines/walker/runner/toolchain/typescript-parse.d.ts +3 -0
  160. package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.js +12 -7
  161. package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +0 -10
  162. package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +0 -10
  163. package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +0 -10
  164. package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +0 -10
  165. package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +0 -10
  166. package/src/infrastructure/engines/walker/strictness-weakened/strict/compiler-overrides.js +30 -52
  167. package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +0 -10
  168. package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +0 -10
  169. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/piece.json +9 -0
  170. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throw-statement.examples.json +36 -0
  171. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throws-in-production.js +12 -0
  172. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +6 -6
  173. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throws-in-tests.js +5 -44
  174. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +0 -10
  175. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.examples.json +42 -0
  176. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.js +152 -0
  177. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/piece.json +9 -0
  178. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/piece.json +9 -0
  179. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.examples.json +24 -0
  180. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.js +27 -0
  181. package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.js +8 -6
  182. package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/export-test-sibling.js +16 -10
  183. package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/comments-directives.js +18 -64
  184. package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.js +7 -5
  185. package/src/rule-set.d.ts +2 -1
  186. package/src/testing.d.ts +2 -4
  187. package/src/testing.js +104 -317
  188. package/src/{audit.d.ts → walker.d.ts} +13 -8
  189. package/src/walker.js +28 -0
  190. package/chunks/chunk-5HRMJ4O2.js +0 -608
  191. package/chunks/chunk-IX2VZTBO.js +0 -887
  192. package/chunks/chunk-K2W3D3NB.js +0 -17
  193. package/chunks/chunk-M6SOGWT7.js +0 -82
  194. package/chunks/chunk-MWLBA4B3.js +0 -849
  195. package/chunks/chunk-R75QELTA.js +0 -481
  196. package/chunks/chunk-RANAKCTW.js +0 -31
  197. package/chunks/chunk-TNY2PASL.js +0 -38
  198. package/chunks/chunk-UJONWHA4.js +0 -22
  199. package/docs/output-contract.md +0 -1155
  200. package/src/audit.js +0 -18
  201. package/src/domain/runner/runner-module-types.d.ts +0 -15
@@ -159,7 +159,8 @@
159
159
  - **Covered by a record:** correct use: a boundary record on the adapter for random values or new ids.
160
160
  - **Seen by:** syntax.
161
161
  - **Reports:** seen.
162
- - **Check today:** new.
162
+ - **Check today:** partial.
163
+ - **Checks:** [random-call](symptoms/ambient-randomness/random-call.md).
163
164
  - **Recipes:** [World values through a port](recipes.md#world-values-through-a-port).
164
165
 
165
166
  ### Date used directly
@@ -212,13 +213,14 @@
212
213
 
213
214
  ### Process global used in place
214
215
 
215
- - **Seen:** `process.env`, `process.argv`, `process.exit`, `process.on`, `console.*` or `globalThis` read outside an adapter.
216
+ - **Seen:** `process.env`, `process.argv`, `process.exit`, `process.on`, `console.*`, `globalThis`, `alert`, `confirm`, `prompt` or a `debugger` statement outside an adapter.
216
217
  - **May indicate:** Reads data from outside (request, file, environment, stored row, response) → No leak across a boundary; Causes an effect (writes, logs, sends, exits) → Ports declared inside; Builds the real implementations → Ports declared inside.
217
218
  - **Breach usually sits:** at a missing port, or at an adapter not built at the entry point.
218
219
  - **Covered by a record:** correct use: a boundary record on the adapter that wraps the process.
219
220
  - **Seen by:** syntax.
220
221
  - **Reports:** seen.
221
- - **Check today:** review.
222
+ - **Check today:** partial.
223
+ - **Checks:** [debugger-statement](symptoms/process-global-used-in-place/debugger-statement.md), [direct-global-use](symptoms/process-global-used-in-place/direct-global-use.md).
222
224
  - **Recipes:** [Adapter per outside party](recipes.md#adapter-per-outside-party); [Composition root](recipes.md#composition-root); [World values through a port](recipes.md#world-values-through-a-port).
223
225
 
224
226
  "Process env reader is just an external world being wrapped."
@@ -232,11 +234,22 @@
232
234
  - **Breach usually sits:** in a double or a value shared across tests at file or suite scope, or in state held in the unit's module.
233
235
  - **Seen by:** syntax.
234
236
  - **Reports:** seen.
235
- - **Check today:** new.
237
+ - **Check today:** partial.
238
+ - **Checks:** [hook-answer](symptoms/answer-set-in-a-hook/hook-answer.md).
236
239
  - **Recipes:** [Stub with vi.fn](recipes.md#stub-with-vifn).
237
240
 
238
241
  "Nothing wrong with a reset in after each. But something wrong with a remock in after each. Implies the suite knows the input needed for each test." Sharing alone is not the breach: "I have no issue with shared boilerplate or even mock builders when it doesn't hide minimal interfaces issues and doesn't hide assumptions or coupling between tests. But it often does when not done with care."
239
242
 
243
+ ### Assertion outside a test
244
+
245
+ - **Seen:** An assertion outside a function passed to an it or test call.
246
+ - **May indicate:** States what the unit gives back, for one case or several → Straight-through tests.
247
+ - **Breach usually sits:** in a suite body, hook, or helper that asserts outside the test case.
248
+ - **Seen by:** syntax.
249
+ - **Reports:** seen.
250
+ - **Check today:** partial.
251
+ - **Checks:** [assertion-site](symptoms/assertion-outside-a-test/assertion-site.md).
252
+
240
253
  ### Behaviour tested away from its owner
241
254
 
242
255
  - **Seen:** A unit test that asserts what a collaborator does, or an integration test that pins a rule a unit owns.
@@ -259,6 +272,17 @@
259
272
  - **Checks:** [test-body](symptoms/branch-in-a-test/test-body.md).
260
273
  - **Recipes:** [Assert to narrow](recipes.md#assert-to-narrow); [it.each over typed rows](recipes.md#iteach-over-typed-rows).
261
274
 
275
+ ### Code or prose read as text
276
+
277
+ - **Seen:** A test reads TypeScript or Markdown source through a file read, a raw import, or a raw glob.
278
+ - **May indicate:** States what the unit gives back, for one case or several → Tests are ours.
279
+ - **Breach usually sits:** in a test that checks the words in a file instead of the code behavior.
280
+ - **Covered by a record:** parsing source to verify its syntax or toolchain compatibility: an authorised location at the test that owns that proof.
281
+ - **Seen by:** syntax.
282
+ - **Reports:** seen.
283
+ - **Check today:** partial.
284
+ - **Checks:** [raw-read](symptoms/code-or-prose-read-as-text/raw-read.md).
285
+
262
286
  ### Computed value in a test
263
287
 
264
288
  - **Seen:** A test that builds or picks a value: array methods, `find`, `Math.*`, `Object.assign`, `Object.fromEntries`, `Array.from` or a spread over a list. Calls on the unit's own API are not included.
@@ -296,6 +320,16 @@
296
320
 
297
321
  "Exact returns can use mockreturn or mockresolve".
298
322
 
323
+ ### Export from a test file
324
+
325
+ - **Seen:** An export declaration, assignment or modifier in a test file, including a type export.
326
+ - **May indicate:** States what the unit gives back, for one case or several → Straight-through tests; Gives each unit its test → Tested where it's owned.
327
+ - **Breach usually sits:** in a test file that exposes code for another file to use.
328
+ - **Seen by:** syntax.
329
+ - **Reports:** seen.
330
+ - **Check today:** partial.
331
+ - **Checks:** [test-file-export](symptoms/export-from-a-test-file/test-file-export.md).
332
+
299
333
  ### Inherited environment in a subprocess
300
334
 
301
335
  - **Seen:** A process spawned in a test with no explicit environment, or one built from `process.env`.
@@ -365,7 +399,7 @@
365
399
 
366
400
  ### Test switched off
367
401
 
368
- - **Seen:** `.only`, `.skip`, `fit` or `xit`.
402
+ - **Seen:** `.only`, `.skip`, `fit`, `xit`, `.todo`, `.skipIf` or `.runIf`.
369
403
  - **May indicate:** Gives each unit its test → Tested where it's owned.
370
404
  - **Breach usually sits:** in the test file.
371
405
  - **Seen by:** syntax.
@@ -384,6 +418,16 @@
384
418
  - **Checks:** [throw-statement](symptoms/throw-or-catch-in-a-test/throw-statement.md), [try-block](symptoms/throw-or-catch-in-a-test/try-block.md).
385
419
  - **Recipes:** [Failure asserted as a value](recipes.md#failure-asserted-as-a-value).
386
420
 
421
+ ### Type declared in a test
422
+
423
+ - **Seen:** A type alias, interface or enum declared in a test file.
424
+ - **May indicate:** Puts code in a file or folder → One reason per module; Gives a value its type (declares it, or needs it narrower) → Declared, not asserted.
425
+ - **Breach usually sits:** in the unit whose contract the test repeats or cannot import.
426
+ - **Seen by:** syntax.
427
+ - **Reports:** seen.
428
+ - **Check today:** partial.
429
+ - **Checks:** [test-type-declaration](symptoms/type-declared-in-a-test/test-type-declaration.md).
430
+
387
431
  ### Unasserted call
388
432
 
389
433
  - **Seen:** A stub or spy passed to the unit whose calls the test never asserts.
@@ -465,119 +509,17 @@
465
509
  - **Checks:** [parameter-mutation](symptoms/write-into-a-parameter/parameter-mutation.md).
466
510
  - **Recipes:** [Copy, never write in](recipes.md#copy-never-write-in).
467
511
 
468
- ## Dependencies and versions
469
-
470
- ### Bundled dependency
471
-
472
- - **Seen:** Published build output that holds a dependency's code that the package manifest does not declare.
473
- - **May indicate:** Ships code for others → Shipped risk declared.
474
- - **Breach usually sits:** in the build config.
475
- - **Seen by:** files.
476
- - **Reports:** seen.
477
- - **How it is seen:** files (build output).
478
- - **Check today:** new.
479
- - **Recipes:** [Declared, not bundled](recipes.md#declared-not-bundled).
480
-
481
- ### Dependency without a record
482
-
483
- - **Seen:** A direct dependency, tools included, with no record of the native way weighed.
484
- - **May indicate:** Takes an outside dependency → Outside dependencies justified.
485
- - **Breach usually sits:** in the missing record.
486
- - **Covered by a record:** correct use: a dependency record naming the native way weighed and why it fell short.
487
- - **Seen by:** files.
488
- - **Reports:** seen.
489
- - **Check today:** new.
490
- - **Recipes:** [Dependency record](recipes.md#dependency-record).
491
-
492
- ### Edit inside vendored code
493
-
494
- - **Seen:** A change to a file inside a vendored folder.
495
- - **May indicate:** Takes an outside dependency → Upstream stays untouched.
496
- - **Breach usually sits:** in the change.
497
- - **Covered by a record:** drift, an edit impossible to apply as an extension: an authorised location stating when to drop it.
498
- - **Seen by:** history.
499
- - **Reports:** seen.
500
- - **Check today:** new.
501
- - **Recipes:** [Extension outside the vendored code](recipes.md#extension-outside-the-vendored-code).
502
-
503
- ### Floating version
504
-
505
- - **Seen:** A range (`^`, `~`, `*`, `x`) or a tag (`latest`, `lts`) for an outside dependency, a runtime or a CI action.
506
- - **May indicate:** Takes an outside dependency → Fixed versions.
507
- - **Breach usually sits:** in the manifest or workflow.
508
- - **Seen by:** files.
509
- - **Reports:** seen.
510
- - **Check today:** new.
511
- - **Recipes:** [Exact pins and a lock file](recipes.md#exact-pins-and-a-lock-file).
512
-
513
- ### No lock file
514
-
515
- - **Seen:** A repository with dependencies and no committed lock file.
516
- - **May indicate:** Takes an outside dependency → Fixed versions.
517
- - **Breach usually sits:** in the repository.
518
- - **Seen by:** files.
519
- - **Reports:** seen.
520
- - **Check today:** new.
521
- - **Recipes:** [Exact pins and a lock file](recipes.md#exact-pins-and-a-lock-file).
522
-
523
- ### Tool fetched at run time
524
-
525
- - **Seen:** `npx`, `dlx`, `bunx` or a download-and-run in a script, CI step or doc.
526
- - **May indicate:** Takes an outside dependency → Tools live in the repo.
527
- - **Breach usually sits:** in the script.
528
- - **Seen by:** files.
529
- - **Reports:** seen.
530
- - **Check today:** new.
531
- - **Recipes:** [Repo scripts only](recipes.md#repo-scripts-only).
532
-
533
- ## Failures
534
-
535
- ### Catch-all failure kind
536
-
537
- - **Seen:** A failure variant such as `unknown`, `other` or a bare message string, carrying no named cause.
538
- - **May indicate:** An operation can fail → Failures are values; A value is one of several kinds or states → Kinds are named.
539
- - **Breach usually sits:** in the adapter, which did not name the outside failure.
540
- - **Seen by:** types, person.
541
- - **Reports:** seen.
542
- - **Check today:** review.
543
- - **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter); [Result union](recipes.md#result-union).
544
-
545
- ### Failure shaped as success
546
-
547
- - **Seen:** A failed path that returns `null`, `false`, `[]`, `undefined` or a default, or a `catch` that returns one.
548
- - **May indicate:** An operation can fail → Failures are values.
549
- - **Breach usually sits:** in the unit's return type.
550
- - **Seen by:** person, syntax.
551
- - **How it is seen:** syntax for a `catch` that returns.
552
- - **Check today:** only review.
553
- - **Recipes:** [Result union](recipes.md#result-union).
554
-
555
- ### Throw between our units
556
-
557
- - **Seen:** `throw` outside an adapter whose caller's contract is exceptions.
558
- - **May indicate:** An operation can fail → Failures are values; Sends data out of the program → No leak across a boundary.
559
- - **Breach usually sits:** in the unit, or at a missing mapping in the adapter.
560
- - **Covered by a record:** correct use: an authorised location at an adapter whose caller's contract is exceptions.
561
- - **Seen by:** syntax, graph.
562
- - **Reports:** seen.
563
- - **How it is seen:** graph for adapters.
564
- - **Check today:** review.
565
- - **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter); [Result union](recipes.md#result-union).
566
-
567
- "Throwing in specific places allowed is just authorised locations as prose."
512
+ ## Names, prose and files
568
513
 
569
- ### Thrown non-error
514
+ ### Built unit called in place
570
515
 
571
- - **Seen:** `throw` of a literal, an object or a template.
572
- - **May indicate:** Sends data out of the program → No leak across a boundary.
573
- - **Breach usually sits:** at the throw site.
516
+ - **Seen:** A call whose callee is a call with an object literal argument.
517
+ - **May indicate:** Names something → One word everywhere.
518
+ - **Breach usually sits:** where a configured unit is called before it is named.
574
519
  - **Seen by:** syntax.
575
520
  - **Reports:** seen.
576
- - **Check today:** reuse.
577
- - **Checks:** [throw-only-error](symptoms/thrown-non-error/throw-only-error.md).
578
- - **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter).
579
-
580
- ## Names, prose and files
521
+ - **Check today:** partial.
522
+ - **Checks:** [call-of-a-call](symptoms/built-unit-called-in-place/call-of-a-call.md).
581
523
 
582
524
  ### Change spread across modules
583
525
 
@@ -613,13 +555,14 @@
613
555
 
614
556
  ### Many spellings of one concept
615
557
 
616
- - **Seen:** One domain concept named two or more ways across the code or the wire.
558
+ - **Seen:** One concept named two or more ways across the code or the wire.
617
559
  - **May indicate:** Names something → One word everywhere ("I don't want to propogate 3 duplicates").
618
560
  - **Breach usually sits:** in the vocabulary.
619
- - **Seen by:** person.
561
+ - **Seen by:** person, syntax.
620
562
  - **Reports:** seen.
621
563
  - **How it is seen:** the vocabulary list makes it checkable.
622
- - **Check today:** only review.
564
+ - **Check today:** partial.
565
+ - **Checks:** [test-call-aliases](symptoms/many-spellings-of-one-concept/test-call-aliases.md).
623
566
  - **Recipes:** [Domain vocabulary list](recipes.md#domain-vocabulary-list).
624
567
 
625
568
  ### Name off its casing
@@ -649,7 +592,8 @@
649
592
  - **Breach usually sits:** in a name or type that does not carry the meaning.
650
593
  - **Seen by:** syntax.
651
594
  - **Reports:** seen.
652
- - **Check today:** new.
595
+ - **Check today:** partial.
596
+ - **Checks:** [comment-prose](symptoms/prose-in-code/comment-prose.md).
653
597
  - **Recipes:** [Meaning in names, not comments](recipes.md#meaning-in-names-not-comments).
654
598
 
655
599
  ### Shorthand name
@@ -686,6 +630,123 @@
686
630
  - **Checks:** [directive-pointers](symptoms/untracked-escape/directive-pointers.md).
687
631
  - **Recipes:** [Meaning in names, not comments](recipes.md#meaning-in-names-not-comments).
688
632
 
633
+ ## Dependencies and versions
634
+
635
+ ### Bundled dependency
636
+
637
+ - **Seen:** Published build output that holds a dependency's code that the package manifest does not declare.
638
+ - **May indicate:** Ships code for others → Shipped risk declared.
639
+ - **Breach usually sits:** in the build config.
640
+ - **Seen by:** files.
641
+ - **Reports:** seen.
642
+ - **How it is seen:** files (build output).
643
+ - **Check today:** new.
644
+ - **Recipes:** [Declared, not bundled](recipes.md#declared-not-bundled).
645
+
646
+ ### Dependency without a record
647
+
648
+ - **Seen:** A direct dependency, tools included, with no record of the native way weighed.
649
+ - **May indicate:** Takes an outside dependency → Outside dependencies justified.
650
+ - **Breach usually sits:** in the missing record.
651
+ - **Covered by a record:** correct use: a dependency record naming the native way weighed and why it fell short.
652
+ - **Seen by:** files.
653
+ - **Reports:** seen.
654
+ - **Check today:** new.
655
+ - **Recipes:** [Dependency record](recipes.md#dependency-record).
656
+
657
+ ### Edit inside vendored code
658
+
659
+ - **Seen:** A change to a file inside a vendored folder.
660
+ - **May indicate:** Takes an outside dependency → Upstream stays untouched.
661
+ - **Breach usually sits:** in the change.
662
+ - **Covered by a record:** drift, an edit impossible to apply as an extension: an authorised location stating when to drop it.
663
+ - **Seen by:** history.
664
+ - **Reports:** seen.
665
+ - **Check today:** new.
666
+ - **Recipes:** [Extension outside the vendored code](recipes.md#extension-outside-the-vendored-code).
667
+
668
+ ### Floating version
669
+
670
+ - **Seen:** A range (`^`, `~`, `*`, `x`) or a tag (`latest`, `lts`) for an outside dependency, a runtime or a CI action.
671
+ - **May indicate:** Takes an outside dependency → Fixed versions.
672
+ - **Breach usually sits:** in the manifest or workflow.
673
+ - **Seen by:** files.
674
+ - **Reports:** seen.
675
+ - **Check today:** partial.
676
+ - **Checks:** [version-selector](symptoms/floating-version/version-selector.md).
677
+ - **Recipes:** [Exact pins and a lock file](recipes.md#exact-pins-and-a-lock-file).
678
+
679
+ ### No lock file
680
+
681
+ - **Seen:** A repository with dependencies and no committed lock file.
682
+ - **May indicate:** Takes an outside dependency → Fixed versions.
683
+ - **Breach usually sits:** in the repository.
684
+ - **Seen by:** files.
685
+ - **Reports:** seen.
686
+ - **Check today:** partial.
687
+ - **Checks:** [committed-lock-file](symptoms/no-lock-file/committed-lock-file.md).
688
+ - **Recipes:** [Exact pins and a lock file](recipes.md#exact-pins-and-a-lock-file).
689
+
690
+ ### Tool fetched at run time
691
+
692
+ - **Seen:** `npx`, `dlx`, `bunx` or a download-and-run in a script, CI step or doc.
693
+ - **May indicate:** Takes an outside dependency → Tools live in the repo.
694
+ - **Breach usually sits:** in the script.
695
+ - **Seen by:** files.
696
+ - **Reports:** seen.
697
+ - **Check today:** partial.
698
+ - **Checks:** [fetch-command](symptoms/tool-fetched-at-run-time/fetch-command.md).
699
+ - **Recipes:** [Repo scripts only](recipes.md#repo-scripts-only).
700
+
701
+ ## Failures
702
+
703
+ ### Catch-all failure kind
704
+
705
+ - **Seen:** A failure variant such as `unknown`, `other` or a bare message string, carrying no named cause.
706
+ - **May indicate:** An operation can fail → Failures are values; A value is one of several kinds or states → Kinds are named.
707
+ - **Breach usually sits:** in the adapter, which did not name the outside failure.
708
+ - **Seen by:** types, person.
709
+ - **Reports:** seen.
710
+ - **Check today:** review.
711
+ - **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter); [Result union](recipes.md#result-union).
712
+
713
+ ### Failure shaped as success
714
+
715
+ - **Seen:** A failed path that returns `null`, `false`, `[]`, `undefined` or a default, or a `catch` that returns one.
716
+ - **May indicate:** An operation can fail → Failures are values.
717
+ - **Breach usually sits:** in the unit's return type.
718
+ - **Seen by:** person, syntax.
719
+ - **How it is seen:** syntax for a `catch` that returns.
720
+ - **Check today:** partial.
721
+ - **Checks:** [empty-catch](symptoms/failure-shaped-as-success/empty-catch.md).
722
+ - **Recipes:** [Result union](recipes.md#result-union).
723
+
724
+ ### Throw between our units
725
+
726
+ - **Seen:** `throw` outside an adapter whose caller's contract is exceptions.
727
+ - **May indicate:** An operation can fail → Failures are values; Sends data out of the program → No leak across a boundary.
728
+ - **Breach usually sits:** in the unit, or at a missing mapping in the adapter.
729
+ - **Covered by a record:** correct use: an authorised location at an adapter whose caller's contract is exceptions.
730
+ - **Seen by:** syntax, graph.
731
+ - **Reports:** seen.
732
+ - **How it is seen:** graph for adapters.
733
+ - **Check today:** partial.
734
+ - **Checks:** [throw-statement](symptoms/throw-between-our-units/throw-statement.md).
735
+ - **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter); [Result union](recipes.md#result-union).
736
+
737
+ "Throwing in specific places allowed is just authorised locations as prose."
738
+
739
+ ### Thrown non-error
740
+
741
+ - **Seen:** `throw` of a literal, an object or a template.
742
+ - **May indicate:** Sends data out of the program → No leak across a boundary.
743
+ - **Breach usually sits:** at the throw site.
744
+ - **Seen by:** syntax.
745
+ - **Reports:** seen.
746
+ - **Check today:** reuse.
747
+ - **Checks:** [throw-only-error](symptoms/thrown-non-error/throw-only-error.md).
748
+ - **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter).
749
+
689
750
  ## Unit shape
690
751
 
691
752
  ### Doer calling our own unit
@@ -758,13 +819,14 @@
758
819
 
759
820
  ### Wide input
760
821
 
761
- - **Seen:** A parameter type holding fields the unit never reads.
822
+ - **Seen:** A parameter, or a field of one, the unit never reads.
762
823
  - **May indicate:** Does one job → Handed what it uses; Gives a value its type (declares it, or needs it narrower) → Handed what it uses.
763
824
  - **Breach usually sits:** in the unit's declared input.
764
- - **Seen by:** types.
825
+ - **Seen by:** types, syntax.
765
826
  - **Reports:** seen → breach.
766
827
  - **The breach a check could name:** the input's declaration.
767
- - **Check today:** new.
828
+ - **Check today:** partial.
829
+ - **Checks:** [unread-parameter](symptoms/wide-input/unread-parameter.md).
768
830
  - **Recipes:** [Entity module](recipes.md#entity-module); [One argument object](recipes.md#one-argument-object).
769
831
 
770
832
  ### Wide port
@@ -1,19 +1,22 @@
1
+ import type { CheckAddressText } from "../../domain/language-layer/check-address-text.js";
1
2
  import type { RepoPath } from "../../domain/repository/repo-path-types.js";
2
3
  import type { Result } from "../../domain/result.js";
4
+ import type { ToolRuleSet } from "../../domain/rule-set/clause-address-types.js";
3
5
  import type { Edition } from "../../domain/rule-set/edition-types.js";
4
6
  import type { EngineId } from "../../domain/rule-set/identifier-types.js";
5
- import type { ConformanceFailure } from "../../domain/runner/conformance-types.js";
6
- import type { RunnerClause } from "../../domain/runner/runner-module-types.js";
7
- export type { ConformanceFailure } from "../../domain/runner/conformance-types.js";
7
+ import type { CheckConformanceFailure } from "../../domain/runner/conformance-types.js";
8
+ export type { CheckConformanceFailure } from "../../domain/runner/conformance-types.js";
9
+ export type TeamRuleSetUnderTest = {
10
+ readonly name: string;
11
+ readonly root: string;
12
+ };
13
+ export type RuleSetUnderTest = ToolRuleSet | TeamRuleSetUnderTest;
8
14
  export type CheckRequest = {
9
- readonly check: string;
15
+ readonly ruleSet: RuleSetUnderTest;
16
+ readonly check: CheckAddressText;
10
17
  readonly engine: EngineId;
11
18
  };
12
- export type ClauseRequest = {
13
- readonly ruleSetRoot: string;
14
- readonly clause: string;
15
- };
16
- export type ConformanceSetupFailureKind = "address-invalid" | "file-invalid" | "rule-set-unloadable" | "clause-not-mechanical" | "runner-unloadable" | "runner-refused";
19
+ export type ConformanceSetupFailureKind = "address-invalid" | "check-missing" | "file-invalid" | "rule-set-invalid" | "rule-set-unloadable" | "runner-unloadable" | "runner-refused";
17
20
  export type ConformanceSetupFailure = {
18
21
  readonly kind: ConformanceSetupFailureKind;
19
22
  readonly detail: string;
@@ -27,13 +30,7 @@ export type CaseUnderTest = {
27
30
  export type CheckUnderTest = CheckRequest & {
28
31
  readonly examples: readonly CaseUnderTest[];
29
32
  };
30
- export type ClauseUnderTest = {
31
- readonly clause: RunnerClause;
32
- readonly cases: readonly CaseUnderTest[];
33
- };
34
- export type ClauseConformanceOf = (request: ClauseRequest) => Promise<Result<readonly ConformanceFailure[], ConformanceSetupFailure>>;
35
- export type ClauseUnderTestOf = (request: ClauseRequest) => Result<ClauseUnderTest, ConformanceSetupFailure>;
36
- export type CheckConformanceOf = (request: CheckRequest) => Promise<Result<readonly ConformanceFailure[], ConformanceSetupFailure>>;
33
+ export type CheckConformanceOf = (request: CheckRequest) => Promise<Result<readonly CheckConformanceFailure[], ConformanceSetupFailure>>;
37
34
  export type CheckUnderTestOf = (request: CheckRequest) => Result<CheckUnderTest, ConformanceSetupFailure>;
38
35
  export type RepoPathOf = (request: {
39
36
  readonly file: string;
@@ -0,0 +1,50 @@
1
+ export type Standing = "accepted" | "proposed";
2
+ export type RecordKindName = "authorised-location" | "deviation" | "debt" | "boundary-record" | "dependency-record";
3
+ export type SeenBy = "syntax" | "types" | "graph" | "app" | "files" | "history" | "person";
4
+ export type AuthoredPointed = {
5
+ readonly rule: string;
6
+ } | {
7
+ readonly principle: string;
8
+ };
9
+ export type CaseItem = {
10
+ readonly standing: Standing;
11
+ readonly owes: readonly AuthoredPointed[];
12
+ };
13
+ export type RecipeItem = {
14
+ readonly serves: AuthoredPointed;
15
+ readonly standing: Standing;
16
+ readonly reason: {
17
+ readonly text: string;
18
+ readonly standing: Standing;
19
+ };
20
+ };
21
+ export type RecordKindItem = {
22
+ readonly phrase: string;
23
+ };
24
+ export type SymptomItem = {
25
+ readonly group: string;
26
+ readonly seen: string;
27
+ readonly mayIndicate: readonly {
28
+ readonly case: string;
29
+ readonly situation?: string | undefined;
30
+ readonly quote?: string | undefined;
31
+ readonly points: readonly AuthoredPointed[];
32
+ }[];
33
+ readonly breachUsuallySits: string;
34
+ readonly seenBy: readonly SeenBy[];
35
+ readonly reports?: "seen" | "seen-to-breach" | undefined;
36
+ readonly recipes: readonly string[];
37
+ readonly correctUses: readonly {
38
+ readonly situation: string;
39
+ readonly kind: RecordKindName;
40
+ readonly at?: string | undefined;
41
+ }[];
42
+ readonly howItIsSeen?: string | undefined;
43
+ readonly breachACheckCouldName?: string | undefined;
44
+ readonly toNameTheBreach?: string | undefined;
45
+ };
46
+ export type CheckItem = {
47
+ readonly flagsBeyondTheSymptom?: string | undefined;
48
+ readonly misses?: string | undefined;
49
+ readonly settingsTracedTo?: string | undefined;
50
+ };
@@ -0,0 +1,5 @@
1
+ import type { Branded } from "../repository/branded.js";
2
+ import type { StaticRuleSetName } from "../rule-set/rule-set-name-of.js";
3
+ export type CatalogueName = Branded<string, "CatalogueName">;
4
+ type StaticCatalogueName<Text extends string> = Text extends `${string}--${string}` | `${string}-` ? never : StaticRuleSetName<Text>;
5
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type CatalogueName } from "./catalogue-name.js";
2
+ export type CheckNames = {
3
+ readonly symptom: CatalogueName;
4
+ readonly check: CatalogueName;
5
+ };
6
+ export type CheckAddressText = `${string}#${string}`;
7
+ export type AddressedCheck = {
8
+ readonly name: string;
9
+ readonly symptom: {
10
+ readonly name: string;
11
+ };
12
+ };
@@ -1,34 +1,17 @@
1
1
  import type { AnchorKind } from "../finding/anchor.js";
2
2
  import type { ReadonlyJsonValue } from "../settings/json-values/json-value.js";
3
3
  export type ClauseExceptions = "allowed" | "refused";
4
- export type AuthoredSourceCase = {
4
+ export type AuthoredExample = {
5
5
  readonly name: string;
6
6
  readonly fileName: string;
7
7
  readonly source: string;
8
8
  readonly expectedLines: readonly number[];
9
9
  readonly edition?: string | undefined;
10
+ readonly check?: string | undefined;
10
11
  };
11
- export type AuthoredClauseDefinition = {
12
- readonly kind: "mechanical";
13
- readonly id: string;
14
- readonly summary: string;
15
- readonly mechanisms: readonly string[];
16
- readonly anchor: AnchorKind;
17
- readonly exceptions?: ClauseExceptions;
18
- readonly cases: {
19
- readonly flag: readonly AuthoredSourceCase[];
20
- readonly allow: readonly AuthoredSourceCase[];
21
- };
22
- } | {
23
- readonly kind: "judgement";
24
- readonly id: string;
25
- readonly summary: string;
26
- readonly enforcedBy: "review";
27
- };
28
- export type AuthoredDisciplineFile = {
29
- readonly version: 1;
30
- readonly id: string;
31
- readonly clauses: readonly AuthoredClauseDefinition[];
12
+ export type AuthoredExamples = {
13
+ readonly flag: readonly AuthoredExample[];
14
+ readonly allow: readonly AuthoredExample[];
32
15
  };
33
16
  export type ClauseSettingDeclaration = {
34
17
  readonly default: ReadonlyJsonValue;
@@ -37,14 +20,30 @@ export type ClauseSettingDeclaration = {
37
20
  export type ClauseSettingDeclarations = {
38
21
  readonly [key: string]: ClauseSettingDeclaration;
39
22
  };
40
- export type AuthoredPieceFile = {
41
- readonly version: 1;
42
- readonly discipline: string;
43
- readonly mechanism: string;
44
- readonly clauses: readonly {
45
- readonly clause: string;
46
- readonly settings: unknown;
47
- readonly clauseSettings?: ClauseSettingDeclarations;
48
- readonly editions?: readonly string[] | undefined;
49
- }[];
23
+ export type PieceSettings = {
24
+ readonly [key: string]: ReadonlyJsonValue;
25
+ };
26
+ export type ImplementingCheck = {
27
+ readonly symptom: string;
28
+ readonly check: string;
29
+ };
30
+ export type AuthoredPieceDeclaration = {
31
+ readonly version: 2;
32
+ readonly exceptions?: ClauseExceptions;
33
+ readonly checkSettings?: ClauseSettingDeclarations;
34
+ readonly anchor: AnchorKind;
35
+ readonly settings: PieceSettings;
36
+ readonly forms?: {
37
+ readonly [form: string]: ImplementingCheck;
38
+ };
39
+ readonly editions?: readonly string[] | undefined;
40
+ } | {
41
+ readonly version: 2;
42
+ readonly exceptions?: ClauseExceptions;
43
+ readonly checkSettings?: ClauseSettingDeclarations;
44
+ readonly anchor?: AnchorKind | undefined;
45
+ readonly settings?: PieceSettings;
46
+ readonly implementation: ImplementingCheck;
47
+ readonly editions?: readonly string[] | undefined;
48
+ readonly examples?: "with-implementation" | undefined;
50
49
  };
@@ -1,9 +1,10 @@
1
1
  import type { ClauseId, DisciplineId, RuleSetName } from "./identifier-types.js";
2
2
  export type ToolRuleSet = "hone";
3
+ export type RuleSetIdentity = ToolRuleSet | {
4
+ readonly name: RuleSetName;
5
+ };
3
6
  export type ClauseAddress = {
4
- readonly ruleSet: ToolRuleSet | {
5
- readonly name: RuleSetName;
6
- };
7
+ readonly ruleSet: RuleSetIdentity;
7
8
  readonly discipline: DisciplineId;
8
9
  readonly clause: ClauseId;
9
10
  };
@@ -0,0 +1,10 @@
1
+ import type { RuleSetName } from "./identifier-types.js";
2
+ type LowercaseLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
3
+ type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
4
+ type OnlyNameCharacters<Text extends string> = Text extends "" ? Text : Text extends `${LowercaseLetter | Digit | "-"}${infer Rest}` ? OnlyNameCharacters<Rest> : never;
5
+ export type StaticRuleSetName<Text extends string> = string extends Text ? never : Text extends `${LowercaseLetter}${infer Rest}` ? [
6
+ OnlyNameCharacters<Rest>
7
+ ] extends [
8
+ never
9
+ ] ? never : Text : never;
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { AnchorKind } from "../finding/anchor.js";
2
+ import type { CheckAddressText } from "../language-layer/check-address-text.js";
3
+ import type { RuleSetIdentity } from "../rule-set/clause-address-types.js";
4
+ import type { Edition } from "../rule-set/edition-types.js";
5
+ import type { EngineId } from "../rule-set/identifier-types.js";
6
+ import type { ReadonlyJsonValue } from "../settings/json-values/json-value.js";
7
+ export type CheckSettingValues = Readonly<Record<string, ReadonlyJsonValue>>;
8
+ export type CheckBinding = {
9
+ readonly address: CheckAddressText;
10
+ readonly ruleSet: RuleSetIdentity;
11
+ readonly engine: EngineId;
12
+ readonly anchor: AnchorKind;
13
+ readonly pieceRoot: string;
14
+ readonly settings: unknown;
15
+ readonly forms?: Readonly<Record<string, CheckAddressText>>;
16
+ readonly checkSettings: CheckSettingValues;
17
+ readonly edition: Edition;
18
+ };