@hailstails/hone 2.0.0-pre.3 → 2.0.0-pre.5

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 (282) hide show
  1. package/ADOPTING.md +9 -20
  2. package/CHANGELOG.md +104 -0
  3. package/MIGRATING.md +18 -9
  4. package/README.md +15 -17
  5. package/chunks/chunk-3CWFUD5B.js +38 -0
  6. package/chunks/chunk-4AJQHZ7I.js +191 -0
  7. package/chunks/chunk-5AKHEW6V.js +15 -0
  8. package/chunks/{chunk-L7BGRC6D.js → chunk-6LTJRJOE.js} +1 -1
  9. package/chunks/chunk-75XWZYNN.js +64 -0
  10. package/chunks/{chunk-ASUN4AVC.js → chunk-BISP2JOL.js} +73 -9
  11. package/chunks/chunk-COQMPHWZ.js +37 -0
  12. package/chunks/chunk-D6645WPB.js +6 -0
  13. package/chunks/chunk-DJMF6JIM.js +42 -0
  14. package/chunks/chunk-EBX57Z3V.js +8 -0
  15. package/chunks/chunk-EFUWHLZK.js +426 -0
  16. package/chunks/chunk-FHVNKG5Q.js +19 -0
  17. package/chunks/{chunk-NRIQD3PI.js → chunk-FRE5IA3C.js} +3 -5
  18. package/chunks/{chunk-OKLYWD2Z.js → chunk-GMLT3MHO.js} +262 -257
  19. package/chunks/{chunk-QP5TLOBY.js → chunk-HVZVKZPW.js} +12 -9
  20. package/chunks/chunk-LEFM7OPS.js +41 -0
  21. package/chunks/chunk-LNMDMRGQ.js +51 -0
  22. package/chunks/chunk-M4VSJ27S.js +139 -0
  23. package/chunks/{chunk-RGSHTPLA.js → chunk-MBEDAFVC.js} +3 -11
  24. package/chunks/chunk-ND3EOGDK.js +2350 -0
  25. package/chunks/chunk-ONDBACCR.js +14332 -0
  26. package/chunks/chunk-OO5KV7KN.js +17 -0
  27. package/chunks/chunk-SKDQ3QJD.js +75 -0
  28. package/chunks/chunk-U6W65ZOF.js +86 -0
  29. package/chunks/chunk-W5OIAUDW.js +18 -0
  30. package/chunks/{chunk-GNOMK7CR.js → chunk-WPEOCLTP.js} +495 -52
  31. package/chunks/chunk-X73RZUPO.js +63 -0
  32. package/chunks/chunk-XE2KKWYH.js +45 -0
  33. package/chunks/chunk-XNIXPQQ5.js +179 -0
  34. package/chunks/chunk-YONPKP3C.js +15 -0
  35. package/docs/adding-a-discipline-or-mechanism.md +1 -1
  36. package/docs/extending.md +7 -388
  37. package/methods/lenses/function-first.md +2 -2
  38. package/package.json +7 -6
  39. package/rules/README.md +7 -5
  40. package/rules/SPIRIT.md +1 -1
  41. package/rules/numbers.md +4 -4
  42. package/rules/principles/no-leak-across-a-boundary.md +1 -1
  43. package/rules/principles.md +1 -1
  44. package/rules/record-kinds/authorised-location.md +1 -1
  45. package/rules/records.md +11 -19
  46. package/rules/rules.md +5 -5
  47. package/rules/sources.md +6 -7
  48. package/rules/typescript/checks.md +280 -394
  49. package/rules/typescript/recipes/adapter-per-outside-party.md +10 -5
  50. package/rules/typescript/recipes/assert-to-narrow.md +114 -4
  51. package/rules/typescript/recipes/closure-factory.md +5 -5
  52. package/rules/typescript/recipes/companion-test-file.md +5 -3
  53. package/rules/typescript/recipes/composed-orchestrator.md +6 -4
  54. package/rules/typescript/recipes/composition-root.md +5 -3
  55. package/rules/typescript/recipes/{bounded-context-generic.md → constrained-context-generic.md} +6 -4
  56. package/rules/typescript/recipes/copy-never-write-in.md +6 -4
  57. package/rules/typescript/recipes/declared-not-bundled.md +5 -3
  58. package/rules/typescript/recipes/dependency-record.md +5 -3
  59. package/rules/typescript/recipes/domain-vocabulary-list.md +5 -3
  60. package/rules/typescript/recipes/entity-module.md +8 -5
  61. package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +5 -3
  62. package/rules/typescript/recipes/extension-outside-the-vendored-code.md +5 -3
  63. package/rules/typescript/recipes/failure-asserted-as-a-value.md +44 -4
  64. package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +8 -5
  65. package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +5 -3
  66. package/rules/typescript/recipes/functional-iteration.md +8 -3
  67. package/rules/typescript/recipes/guard-clauses.md +5 -3
  68. package/rules/typescript/recipes/integration-test-owns-its-scratch.md +5 -3
  69. package/rules/typescript/recipes/integration-test-suffix.md +5 -3
  70. package/rules/typescript/recipes/it-each-over-typed-rows.md +117 -0
  71. package/rules/typescript/recipes/map-out-at-the-adapter.md +36 -4
  72. package/rules/typescript/recipes/meaning-in-names-not-comments.md +5 -5
  73. package/rules/typescript/recipes/named-exported-type.md +5 -3
  74. package/rules/typescript/recipes/narrow-ports.md +5 -3
  75. package/rules/typescript/recipes/one-argument-object.md +8 -3
  76. package/rules/typescript/recipes/{port-in-the-domain.md → port-in-a-module-of-its-own.md} +7 -5
  77. package/rules/typescript/recipes/ports-in-the-argument.md +5 -3
  78. package/rules/typescript/recipes/repo-scripts-only.md +5 -3
  79. package/rules/typescript/recipes/result-union.md +5 -5
  80. package/rules/typescript/recipes/screaming-folders.md +5 -5
  81. package/rules/typescript/recipes/shared-strict-base-config.md +5 -5
  82. package/rules/typescript/recipes/stub-with-vi-fn.md +130 -0
  83. package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +5 -3
  84. package/rules/typescript/recipes/whole-words.md +5 -3
  85. package/rules/typescript/recipes/whole-written-out-expectation.md +284 -4
  86. package/rules/typescript/recipes/world-values-through-a-port.md +5 -3
  87. package/rules/typescript/recipes/zod-at-the-producers-adapter.md +8 -3
  88. package/rules/typescript/recipes.md +567 -21
  89. package/rules/typescript/symptoms/ambient-randomness/random-call.md +10 -0
  90. package/rules/typescript/symptoms/ambient-randomness.md +1 -1
  91. package/rules/typescript/symptoms/answer-set-in-a-hook/hook-answer.md +10 -0
  92. package/rules/typescript/symptoms/answer-set-in-a-hook.md +1 -1
  93. package/rules/typescript/symptoms/assertion-outside-a-test-body/assertion-site.md +10 -0
  94. package/rules/typescript/symptoms/assertion-outside-a-test-body.md +25 -0
  95. package/rules/typescript/symptoms/branch-in-a-test/test-body.md +10 -184
  96. package/rules/typescript/symptoms/branch-in-a-test.md +11 -1
  97. package/rules/typescript/symptoms/built-unit-called-in-place/call-of-a-call.md +10 -0
  98. package/rules/typescript/symptoms/built-unit-called-in-place.md +25 -0
  99. package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +1 -1
  100. package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test/raw-read.md +10 -0
  101. package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test.md +31 -0
  102. package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +26 -117
  103. package/rules/typescript/symptoms/computed-value-in-a-test.md +1 -1
  104. package/rules/typescript/symptoms/date-used-directly.md +1 -1
  105. package/rules/typescript/symptoms/default-for-a-required-value.md +1 -1
  106. package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +2 -19
  107. package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +2 -2
  108. package/rules/typescript/symptoms/double-with-a-body.md +1 -1
  109. package/rules/typescript/symptoms/export-from-a-test/test-file-export.md +10 -0
  110. package/rules/typescript/symptoms/export-from-a-test.md +33 -0
  111. package/rules/typescript/symptoms/failure-shaped-as-success/empty-catch.md +10 -0
  112. package/rules/typescript/symptoms/failure-shaped-as-success.md +1 -1
  113. package/rules/typescript/symptoms/floating-version/version-selector.md +10 -0
  114. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +2 -2
  115. package/rules/typescript/symptoms/inner-layer-imports-outer.md +1 -1
  116. package/rules/typescript/symptoms/library-class-built-in-place.md +1 -1
  117. package/rules/typescript/symptoms/loop-keyword/loop-statement.md +1 -1
  118. package/rules/typescript/symptoms/many-spellings-of-one-concept/test-call-aliases.md +10 -0
  119. package/rules/typescript/symptoms/many-spellings-of-one-concept.md +3 -2
  120. package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +4 -4
  121. package/rules/typescript/symptoms/no-lock-file/committed-lock-file.md +12 -0
  122. package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +1 -0
  123. package/rules/typescript/symptoms/outside-import-past-a-boundary.md +5 -4
  124. package/rules/typescript/symptoms/outside-type-in-a-signature.md +2 -2
  125. package/rules/typescript/symptoms/{port-outside-the-domain.md → port-beside-its-adapter.md} +2 -2
  126. package/rules/typescript/symptoms/port-named-for-a-mechanism.md +1 -1
  127. package/rules/typescript/symptoms/process-global-used-in-place/debugger-statement.md +10 -0
  128. package/rules/typescript/symptoms/process-global-used-in-place/direct-global-use.md +14 -0
  129. package/rules/typescript/symptoms/process-global-used-in-place.md +2 -2
  130. package/rules/typescript/symptoms/prose-in-code/comment-prose.md +12 -0
  131. package/rules/typescript/symptoms/rebinding/test-body.md +1 -18
  132. package/rules/typescript/symptoms/rebinding.md +11 -1
  133. package/rules/typescript/symptoms/schema-past-its-adapter.md +2 -2
  134. package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +3 -6
  135. package/rules/typescript/symptoms/test-switched-off.md +1 -1
  136. package/rules/typescript/symptoms/text-past-its-reader/test-body.md +2 -17
  137. package/rules/typescript/symptoms/text-past-its-reader.md +1 -1
  138. package/rules/typescript/symptoms/throw-between-our-units/throw-statement.md +10 -0
  139. package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +1 -1
  140. package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +1 -25
  141. package/rules/typescript/symptoms/tool-fetched-at-run-time/fetch-command.md +10 -0
  142. package/rules/typescript/symptoms/type-declared-in-a-test/test-type-declaration.md +10 -0
  143. package/rules/typescript/symptoms/type-declared-in-a-test.md +33 -0
  144. package/rules/typescript/symptoms/unasserted-call.md +1 -1
  145. package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +2 -2
  146. package/rules/typescript/symptoms/wide-input/unread-parameter.md +10 -0
  147. package/rules/typescript/symptoms/wide-input.md +3 -2
  148. package/rules/typescript/symptoms.md +210 -148
  149. package/src/application/conformance/conformance-testing-types.d.ts +13 -16
  150. package/src/domain/language-layer/authored-item-types.d.ts +66 -0
  151. package/src/domain/language-layer/catalogue-name.d.ts +5 -0
  152. package/src/domain/language-layer/check-address-text.d.ts +12 -0
  153. package/src/domain/rule-set/authored-rule-set-types.d.ts +31 -32
  154. package/src/domain/rule-set/clause-address-types.d.ts +4 -3
  155. package/src/domain/rule-set/rule-set-name-of.d.ts +10 -0
  156. package/src/domain/runner/check-binding.d.ts +18 -0
  157. package/src/domain/runner/check-observations.d.ts +39 -0
  158. package/src/domain/runner/conformance-types.d.ts +8 -2
  159. package/src/domain/runner/runner-result-types.d.ts +1 -2
  160. package/src/domain/settings/test-files.d.ts +7 -0
  161. package/src/eslint-plugin.js +45 -39
  162. package/src/hone.js +16 -13716
  163. package/src/infrastructure/disciplines-file/version-one-names.json +4 -5
  164. package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +0 -6
  165. package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +0 -6
  166. package/src/infrastructure/engines/eslint/runner/pieces/eslint-piece-settings-types.d.ts +2 -0
  167. package/src/infrastructure/engines/eslint/runner/runner.js +1001 -1234
  168. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/README.md +0 -3
  169. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js +33 -21
  170. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +11 -4
  171. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +28 -0
  172. package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +0 -2
  173. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/eslint-plugin.js +94 -0
  174. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/piece.json +11 -0
  175. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/unread-parameter.examples.json +48 -0
  176. package/src/infrastructure/engines/walker/ambient-randomness/random-call/ambient-randomness.js +109 -0
  177. package/src/infrastructure/engines/walker/ambient-randomness/random-call/piece.json +9 -0
  178. package/src/infrastructure/engines/walker/ambient-randomness/random-call/random-call.examples.json +48 -0
  179. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answer.examples.json +42 -0
  180. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answers.js +72 -0
  181. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/piece.json +9 -0
  182. package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.examples.json +30 -0
  183. package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.js +123 -0
  184. package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/piece.json +9 -0
  185. package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-syntax.js +3 -3
  186. package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-signatures.js +7 -5
  187. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +192 -147
  188. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.examples.json +24 -0
  189. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.js +34 -0
  190. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/piece.json +9 -0
  191. package/src/infrastructure/engines/walker/claimed-type/cast-to-any/any-cast.js +6 -4
  192. package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/cast-expressions.js +6 -4
  193. package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/piece.json +9 -0
  194. package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.examples.json +30 -0
  195. package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.js +166 -0
  196. package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +0 -10
  197. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +4 -4
  198. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +8 -6
  199. package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +0 -10
  200. package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/dependency-isolation.js +9 -14
  201. package/src/infrastructure/engines/walker/drawer-path/drawer-names/categorical-paths.js +4 -4
  202. package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/piece.json +9 -0
  203. package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.examples.json +30 -0
  204. package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.js +31 -0
  205. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.examples.json +18 -0
  206. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.js +32 -0
  207. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/piece.json +9 -0
  208. package/src/infrastructure/engines/walker/floating-version/version-selector/piece.json +9 -0
  209. package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.examples.json +54 -0
  210. package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.js +75 -0
  211. package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/hermetic-git-spawns.js +8 -17
  212. package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loops.js +8 -6
  213. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/piece.json +9 -0
  214. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.examples.json +36 -0
  215. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.js +67 -0
  216. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +34 -0
  217. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mocking.js +64 -16
  218. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +5 -1
  219. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.examples.json +24 -0
  220. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.js +41 -0
  221. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/piece.json +9 -0
  222. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +18 -16
  223. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +1 -1
  224. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.examples.json +18 -0
  225. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.js +17 -0
  226. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/piece.json +9 -0
  227. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/direct-global-use.examples.json +63 -0
  228. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/piece.json +13 -0
  229. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/process-global-used-in-place.js +126 -0
  230. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/comment-prose.examples.json +42 -0
  231. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/piece.json +16 -0
  232. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/prose-in-code.js +90 -0
  233. package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +0 -10
  234. package/src/infrastructure/engines/walker/runner/pieces/walker-piece.d.ts +7 -5
  235. package/src/infrastructure/engines/walker/runner/runner.js +268 -79
  236. package/src/infrastructure/engines/walker/runner/toolchain/typescript-parse.d.ts +3 -0
  237. package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.js +12 -7
  238. package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +0 -10
  239. package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +0 -10
  240. package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +0 -10
  241. package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +0 -10
  242. package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +0 -10
  243. package/src/infrastructure/engines/walker/strictness-weakened/strict/compiler-overrides.js +30 -52
  244. package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +0 -10
  245. package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +0 -10
  246. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/piece.json +9 -0
  247. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throw-statement.examples.json +36 -0
  248. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throws-in-production.js +12 -0
  249. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +6 -6
  250. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throws-in-tests.js +5 -44
  251. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +0 -10
  252. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.examples.json +42 -0
  253. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.js +152 -0
  254. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/piece.json +9 -0
  255. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/piece.json +9 -0
  256. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.examples.json +36 -0
  257. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.js +141 -0
  258. package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.js +8 -6
  259. package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/export-test-sibling.js +16 -10
  260. package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/comments-directives.js +18 -64
  261. package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.js +7 -5
  262. package/src/measure-engines.process.js +80 -0
  263. package/src/rule-set.d.ts +2 -1
  264. package/src/testing.d.ts +2 -4
  265. package/src/testing.js +173 -314
  266. package/src/{audit.d.ts → walker.d.ts} +13 -8
  267. package/src/walker.js +28 -0
  268. package/chunks/chunk-5HRMJ4O2.js +0 -608
  269. package/chunks/chunk-IX2VZTBO.js +0 -887
  270. package/chunks/chunk-K2W3D3NB.js +0 -17
  271. package/chunks/chunk-M6SOGWT7.js +0 -82
  272. package/chunks/chunk-Q62Y25WS.js +0 -843
  273. package/chunks/chunk-R75QELTA.js +0 -481
  274. package/chunks/chunk-RANAKCTW.js +0 -31
  275. package/chunks/chunk-TNY2PASL.js +0 -38
  276. package/chunks/chunk-UJONWHA4.js +0 -22
  277. package/docs/output-contract.md +0 -1155
  278. package/rules/record-kinds/boundary-record.md +0 -9
  279. package/rules/typescript/recipes/iteach-over-typed-rows.md +0 -18
  280. package/rules/typescript/recipes/stub-with-vifn.md +0 -20
  281. package/src/audit.js +0 -18
  282. package/src/domain/runner/runner-module-types.d.ts +0 -15
@@ -0,0 +1,426 @@
1
+ import {
2
+ checkHitSchema,
3
+ checkMeasurementSchema,
4
+ checkNativeExceptionSchema,
5
+ hitSchema,
6
+ measuredSchema,
7
+ nativeExceptionKindSchema,
8
+ projectionWriteSchema,
9
+ reportedCheckSchema,
10
+ runnerFailureSchema,
11
+ runnerResultSchema
12
+ } from "./chunk-BISP2JOL.js";
13
+ import {
14
+ clauseAddressObjectSchema
15
+ } from "./chunk-FRE5IA3C.js";
16
+ import {
17
+ repoPathSchema,
18
+ runnerModuleSegmentsOf
19
+ } from "./chunk-WPEOCLTP.js";
20
+
21
+ // src/infrastructure/engines/protocol/runner-module/runner-module-at.ts
22
+ var runnerModuleAt = (location) => location.modules.load({
23
+ path: location.path.join({
24
+ segments: runnerModuleSegmentsOf({
25
+ installRoot: location.installRoot,
26
+ mechanism: location.mechanism,
27
+ moduleExtension: location.moduleExtension
28
+ })
29
+ })
30
+ });
31
+
32
+ // src/infrastructure/engines/protocol/engine-run/engine-run.ts
33
+ import { z as z4 } from "zod";
34
+
35
+ // src/domain/runner/runner-failure.ts
36
+ var runnerInvalidOutput = (request) => ({
37
+ outcome: "failed",
38
+ error: { kind: "runner-invalid-output", detail: request.detail }
39
+ });
40
+ var thrownMessage = (request) => request.thrown instanceof Error ? request.thrown.message : String(request.thrown);
41
+ var rejectedCall = (request) => runnerInvalidOutput({ detail: `the runner call threw or rejected: ${thrownMessage(request)}` });
42
+
43
+ // src/domain/runner/checked-observations.ts
44
+ var unrequestedFileDetail = (request) => {
45
+ const entry = request.entries.find(
46
+ ({ check, file }) => !request.checks.has(check) || !request.files.has(file)
47
+ );
48
+ return entry === void 0 ? void 0 : `${request.kind} names ${entry.check} in ${entry.file}, which the request did not hold`;
49
+ };
50
+ var checkedObservations = (request) => {
51
+ const { requested, report } = request;
52
+ const checks = new Set(requested.bindings.map(({ address }) => address));
53
+ const files = new Set(requested.files);
54
+ const unrequestedNative = report.nativeExceptions.find(({ check }) => !checks.has(check));
55
+ const detail = unrequestedFileDetail({ kind: "a hit", entries: report.hits, checks, files }) ?? unrequestedFileDetail({ kind: "a measured pair", entries: report.measured, checks, files }) ?? (unrequestedNative === void 0 ? void 0 : `a native exception names ${unrequestedNative.check}, which the request did not hold`);
56
+ return detail === void 0 ? { outcome: "ok", value: report } : runnerInvalidOutput({ detail });
57
+ };
58
+
59
+ // src/infrastructure/engines/protocol/checks/checks-runner-module-schema.ts
60
+ import { z as z3 } from "zod";
61
+
62
+ // src/infrastructure/engines/protocol/embedded/embedded-run-report-schema.ts
63
+ import { z } from "zod";
64
+ var namedCheck = { check: reportedCheckSchema.optional() };
65
+ var inlineLineSchema = z.number().int().min(1);
66
+ var inlineDisableSchema = z.object({
67
+ kind: z.literal("inline-disable"),
68
+ ...namedCheck,
69
+ clause: clauseAddressObjectSchema,
70
+ file: repoPathSchema,
71
+ line: inlineLineSchema,
72
+ text: z.string(),
73
+ reach: z.enum(["one-clause", "every-selected-clause"])
74
+ }).readonly();
75
+ var scriptOptionCauseSchema = z.discriminatedUnion("kind", [
76
+ z.object({ kind: z.literal("weakens-run") }).readonly(),
77
+ z.object({
78
+ kind: z.literal("after-another-command"),
79
+ command: z.string(),
80
+ invocation: z.string()
81
+ }).readonly(),
82
+ z.object({ kind: z.literal("wrapped"), command: z.string(), wrapper: z.string() }).readonly(),
83
+ z.object({ kind: z.literal("unreadable"), command: z.string() }).readonly()
84
+ ]);
85
+ var nativeExceptionSchema = z.discriminatedUnion("kind", [
86
+ z.object({
87
+ kind: z.literal("ignore"),
88
+ ...namedCheck,
89
+ clause: clauseAddressObjectSchema,
90
+ file: repoPathSchema
91
+ }).readonly(),
92
+ z.object({
93
+ kind: z.literal("config-override"),
94
+ ...namedCheck,
95
+ clause: clauseAddressObjectSchema,
96
+ file: repoPathSchema
97
+ }).readonly(),
98
+ z.object({
99
+ kind: z.literal("suppression-entry"),
100
+ ...namedCheck,
101
+ clause: clauseAddressObjectSchema,
102
+ file: repoPathSchema,
103
+ location: repoPathSchema
104
+ }).readonly(),
105
+ inlineDisableSchema,
106
+ z.object({
107
+ kind: z.literal("inline-rule-config"),
108
+ ...namedCheck,
109
+ clause: clauseAddressObjectSchema,
110
+ file: repoPathSchema,
111
+ line: inlineLineSchema,
112
+ text: z.string()
113
+ }).readonly(),
114
+ z.object({
115
+ kind: z.literal("command-line-option"),
116
+ ...namedCheck,
117
+ clause: clauseAddressObjectSchema,
118
+ location: repoPathSchema,
119
+ script: z.string(),
120
+ option: z.string(),
121
+ cause: scriptOptionCauseSchema
122
+ }).readonly()
123
+ ]);
124
+ var sliceProblemSchema = z.object({
125
+ slice: repoPathSchema,
126
+ state: z.enum([
127
+ "out-of-date",
128
+ "missing",
129
+ "not-applied",
130
+ "unconfigured",
131
+ "nested-configuration"
132
+ ])
133
+ }).readonly();
134
+ var unprojectedFolderSchema = z.object({
135
+ folder: repoPathSchema,
136
+ selectionFolder: repoPathSchema
137
+ }).readonly();
138
+ var embeddedRunReportSchema = z.object({
139
+ hits: z.array(hitSchema).readonly(),
140
+ nativeExceptions: z.array(nativeExceptionSchema).readonly(),
141
+ projection: z.enum(["current", "out-of-date", "missing", "not-included"]),
142
+ slices: z.array(sliceProblemSchema).readonly().default([]),
143
+ unprojectedFolders: z.array(unprojectedFolderSchema).readonly().default([]),
144
+ measured: measuredSchema
145
+ }).readonly();
146
+
147
+ // src/infrastructure/engines/protocol/runner-module/runner-module-schema.ts
148
+ import { z as z2 } from "zod";
149
+ var runnerCallSchema = z2.function({
150
+ input: [z2.unknown()],
151
+ output: z2.promise(z2.unknown())
152
+ });
153
+ var standaloneRunnerModuleSchema = z2.object({
154
+ exceptionPath: z2.literal("standalone"),
155
+ run: runnerCallSchema,
156
+ conform: runnerCallSchema
157
+ });
158
+ var embeddedRunnerModuleSchema = z2.object({
159
+ exceptionPath: z2.literal("embedded"),
160
+ projectedKinds: z2.array(nativeExceptionKindSchema),
161
+ run: runnerCallSchema,
162
+ conform: runnerCallSchema,
163
+ project: runnerCallSchema
164
+ });
165
+ var runnerModuleSchema = z2.discriminatedUnion("exceptionPath", [
166
+ standaloneRunnerModuleSchema,
167
+ embeddedRunnerModuleSchema
168
+ ]);
169
+
170
+ // src/infrastructure/engines/protocol/checks/checks-runner-module-schema.ts
171
+ var namedChecksRunnerModuleSchema = z3.object({
172
+ projectedKinds: z3.array(nativeExceptionKindSchema),
173
+ fileScope: z3.enum(["tracked", "typescript"]),
174
+ run: runnerCallSchema,
175
+ conform: runnerCallSchema,
176
+ project: runnerCallSchema
177
+ });
178
+ var misnamedDirectiveShape = {
179
+ ruleId: z3.string().min(1),
180
+ file: repoPathSchema,
181
+ line: z3.number().int().min(1),
182
+ text: z3.string()
183
+ };
184
+ var misnamedRuleIdSchema = z3.discriminatedUnion("kind", [
185
+ z3.strictObject({ kind: z3.literal("names-no-check"), ...misnamedDirectiveShape }).readonly(),
186
+ z3.strictObject({
187
+ kind: z3.literal("version-1-id"),
188
+ ...misnamedDirectiveShape,
189
+ replacedBy: z3.tuple([z3.string().min(1)], z3.string().min(1)).readonly()
190
+ }).readonly()
191
+ ]);
192
+ var checksSliceProblemSchema = z3.object({
193
+ slice: repoPathSchema,
194
+ state: z3.enum(["missing", "out-of-date", "unconfigured"])
195
+ }).readonly();
196
+ var namedChecksRunReportSchema = z3.strictObject({
197
+ slices: z3.array(checksSliceProblemSchema).readonly(),
198
+ nestedConfigurations: z3.array(repoPathSchema).readonly(),
199
+ unprojectedFolders: z3.array(unprojectedFolderSchema).readonly(),
200
+ misnamedRuleIds: z3.array(misnamedRuleIdSchema).readonly(),
201
+ hits: z3.array(checkHitSchema).readonly(),
202
+ nativeExceptions: z3.array(checkNativeExceptionSchema).readonly(),
203
+ measured: z3.array(checkMeasurementSchema).readonly(),
204
+ projection: z3.enum(["none", "current", "out-of-date", "missing", "not-included"])
205
+ }).readonly();
206
+ var namedChecksRunResultSchema = z3.discriminatedUnion("outcome", [
207
+ z3.strictObject({ outcome: z3.literal("ok"), value: namedChecksRunReportSchema }).readonly(),
208
+ z3.strictObject({
209
+ outcome: z3.literal("failed"),
210
+ error: runnerFailureSchema
211
+ }).readonly()
212
+ ]);
213
+ var measurementResultSchema = z3.discriminatedUnion("outcome", [
214
+ z3.strictObject({
215
+ outcome: z3.literal("ok"),
216
+ value: z3.strictObject({
217
+ report: namedChecksRunReportSchema,
218
+ unappliedSlices: z3.array(repoPathSchema).readonly()
219
+ }).readonly()
220
+ }).readonly(),
221
+ z3.strictObject({
222
+ outcome: z3.literal("failed"),
223
+ error: runnerFailureSchema
224
+ }).readonly()
225
+ ]);
226
+ var projectedFileSchema = z3.object({ file: repoPathSchema, text: z3.string() }).readonly();
227
+ var checksProjectResultSchema = z3.union([
228
+ z3.object({ outcome: z3.literal("ok"), value: z3.array(projectedFileSchema).readonly() }).readonly(),
229
+ z3.object({
230
+ outcome: z3.literal("failed"),
231
+ error: runnerFailureSchema
232
+ }).readonly()
233
+ ]);
234
+
235
+ // src/infrastructure/engines/protocol/engine-run/engine-run.ts
236
+ var invalid = (request) => ({
237
+ outcome: "failed",
238
+ error: { kind: "runner-invalid", mechanism: request.mechanism, detail: request.detail }
239
+ });
240
+ var runnerFailed = (request) => ({
241
+ outcome: "failed",
242
+ error: { kind: "runner-failed", mechanism: request.mechanism, failure: request.failure }
243
+ });
244
+ var returnedBy = (request) => Promise.resolve().then(request.call).catch((thrown) => ({ outcome: "failed", error: rejectedCall({ thrown }).error }));
245
+ var invalidChecksOutput = (request) => runnerFailed({
246
+ mechanism: request.mechanism,
247
+ failure: runnerInvalidOutput({ detail: z4.prettifyError(request.error) }).error
248
+ });
249
+ var NAMED_RUNNER_MODULE = z4.object({ namedChecksRunner: namedChecksRunnerModuleSchema });
250
+ var loadedNamedRunnerOver = (ports) => async (request) => {
251
+ const loaded = await ports.runnerModuleOf(request);
252
+ if (loaded.outcome === "failed")
253
+ return invalid({ mechanism: request.mechanism, detail: loaded.error.detail });
254
+ const parsed = NAMED_RUNNER_MODULE.safeParse(loaded.value);
255
+ return parsed.success ? { outcome: "ok", value: parsed.data.namedChecksRunner } : invalid({ mechanism: request.mechanism, detail: z4.prettifyError(parsed.error) });
256
+ };
257
+ var namedRequestOf = (call) => ({
258
+ ...call.request,
259
+ bindings: call.request.bindings.filter(({ engine }) => engine === call.mechanism)
260
+ });
261
+ var verifiedNamedRun = (request) => {
262
+ const { call, requested, report } = request;
263
+ const files = call.runner.fileScope === "tracked" ? requested.trackedPaths : requested.files;
264
+ const checked = checkedObservations({ requested: { ...requested, files }, report });
265
+ return checked.outcome === "failed" ? runnerFailed({ mechanism: call.mechanism, failure: checked.error }) : {
266
+ outcome: "ok",
267
+ value: {
268
+ ...checked.value,
269
+ mechanism: call.mechanism,
270
+ coverableKinds: call.runner.projectedKinds
271
+ }
272
+ };
273
+ };
274
+ var namedEngineRunOf = async (call) => {
275
+ const requested = namedRequestOf(call);
276
+ const parsed = namedChecksRunResultSchema.safeParse(
277
+ await returnedBy({ call: () => call.runner.run(requested) })
278
+ );
279
+ if (!parsed.success) {
280
+ return invalidChecksOutput({ mechanism: call.mechanism, error: parsed.error });
281
+ }
282
+ if (parsed.data.outcome === "failed") {
283
+ return runnerFailed({ mechanism: call.mechanism, failure: parsed.data.error });
284
+ }
285
+ return verifiedNamedRun({ call, requested, report: parsed.data.value });
286
+ };
287
+ var versionOneMeasurementModuleSchema = z4.object({
288
+ measureVersionOne: runnerCallSchema.optional()
289
+ });
290
+ var measureNamedRun = async (call) => {
291
+ const report = await namedEngineRunOf(call);
292
+ return report.outcome === "failed" ? report : { outcome: "ok", value: { report: report.value, unappliedSlices: [] } };
293
+ };
294
+ var measuredVersionOne = async (request) => {
295
+ const { call, location, projection } = request;
296
+ if (projection === void 0) return measureNamedRun(call);
297
+ const loaded = await request.runnerModuleOf(location);
298
+ if (loaded.outcome === "failed")
299
+ return invalid({ mechanism: call.mechanism, detail: loaded.error.detail });
300
+ const module = versionOneMeasurementModuleSchema.safeParse(loaded.value);
301
+ if (!module.success)
302
+ return invalid({ mechanism: call.mechanism, detail: z4.prettifyError(module.error) });
303
+ const measureVersionOne = module.data.measureVersionOne;
304
+ if (measureVersionOne === void 0) return measureNamedRun(call);
305
+ const requested = namedRequestOf(call);
306
+ const parsed = measurementResultSchema.safeParse(
307
+ await returnedBy({ call: () => measureVersionOne({ run: requested, projection }) })
308
+ );
309
+ if (!parsed.success)
310
+ return invalidChecksOutput({ mechanism: call.mechanism, error: parsed.error });
311
+ if (parsed.data.outcome === "failed") {
312
+ return runnerFailed({ mechanism: call.mechanism, failure: parsed.data.error });
313
+ }
314
+ const allowedSlices = new Set(projection.packageFiles);
315
+ const unrequested = parsed.data.value.unappliedSlices.find((slice) => !allowedSlices.has(slice));
316
+ if (unrequested !== void 0) {
317
+ return runnerFailed({
318
+ mechanism: call.mechanism,
319
+ failure: runnerInvalidOutput({
320
+ detail: `unrequested version one projection slice ${unrequested}`
321
+ }).error
322
+ });
323
+ }
324
+ const report = verifiedNamedRun({ call, requested, report: parsed.data.value.report });
325
+ return report.outcome === "failed" ? report : {
326
+ outcome: "ok",
327
+ value: { report: report.value, unappliedSlices: parsed.data.value.unappliedSlices }
328
+ };
329
+ };
330
+ var namedEngineProjectionOf = async (call) => {
331
+ const parsed = checksProjectResultSchema.safeParse(
332
+ await returnedBy({ call: () => call.runner.project(namedRequestOf(call)) })
333
+ );
334
+ if (!parsed.success) {
335
+ return invalidChecksOutput({ mechanism: call.mechanism, error: parsed.error });
336
+ }
337
+ return parsed.data.outcome === "failed" ? runnerFailed({ mechanism: call.mechanism, failure: parsed.data.error }) : parsed.data;
338
+ };
339
+ var measureVersionOneProjectionOver = (ports) => (measurement) => measuredVersionOne({ ...ports, ...measurement });
340
+
341
+ // src/infrastructure/engines/protocol/upgrade/load-version-one-projection.ts
342
+ import { z as z5 } from "zod";
343
+ var projectionMethodsSchema = z5.object({
344
+ inspect: runnerCallSchema,
345
+ prepare: runnerCallSchema
346
+ });
347
+ var projectionModuleSchema = z5.object({
348
+ versionOneProjectionOver: z5.function({
349
+ input: [z5.unknown()],
350
+ output: projectionMethodsSchema
351
+ })
352
+ });
353
+ var inspectionResult = z5.discriminatedUnion(
354
+ "outcome",
355
+ runnerResultSchema({
356
+ value: z5.object({
357
+ files: z5.array(
358
+ z5.object({
359
+ file: repoPathSchema,
360
+ state: z5.enum(["current", "missing", "out-of-date"])
361
+ })
362
+ ).readonly(),
363
+ ruleIds: z5.map(z5.string(), z5.string())
364
+ })
365
+ }).options
366
+ );
367
+ var preparationResult = runnerResultSchema({ value: z5.array(projectionWriteSchema).readonly() });
368
+ var methodsOf = async (request) => {
369
+ const { modules, installRoot, moduleExtension, path, fileText, fileRemoval } = request.options;
370
+ const loaded = await request.ports.runnerModuleOf({
371
+ modules,
372
+ installRoot,
373
+ moduleExtension,
374
+ path,
375
+ mechanism: "eslint"
376
+ });
377
+ if (loaded.outcome === "failed") return runnerInvalidOutput({ detail: loaded.error.detail });
378
+ const parsed = projectionModuleSchema.safeParse(loaded.value);
379
+ if (!parsed.success) return runnerInvalidOutput({ detail: z5.prettifyError(parsed.error) });
380
+ const platform = { path, fileText, fileRemoval, moduleExtension };
381
+ return { outcome: "ok", value: parsed.data.versionOneProjectionOver(platform) };
382
+ };
383
+ var projectionCall = async (request) => {
384
+ try {
385
+ const loaded = await request.methods();
386
+ if (loaded.outcome === "failed") return loaded;
387
+ const returned = await loaded.value[request.method](request.projection);
388
+ const parsed = request.output.safeParse(returned);
389
+ return parsed.success ? parsed.data : runnerInvalidOutput({ detail: z5.prettifyError(parsed.error) });
390
+ } catch (thrown) {
391
+ return rejectedCall({ thrown });
392
+ }
393
+ };
394
+ var versionOneProjectionPortOver = (ports) => (options) => {
395
+ let loaded;
396
+ const methods = () => loaded ??= methodsOf({ ports, options });
397
+ return {
398
+ inspect: (projection) => projectionCall({ methods, method: "inspect", projection, output: inspectionResult }),
399
+ prepare: (projection) => projectionCall({ methods, method: "prepare", projection, output: preparationResult })
400
+ };
401
+ };
402
+
403
+ // src/composition/runner-engines.ts
404
+ var runnerEnginesOver = (ports) => ({
405
+ namedEngine: {
406
+ load: loadedNamedRunnerOver(ports),
407
+ run: namedEngineRunOf,
408
+ project: namedEngineProjectionOf
409
+ },
410
+ versionOneProjectionOf: versionOneProjectionPortOver(ports),
411
+ measureVersionOne: measureVersionOneProjectionOver(ports)
412
+ });
413
+
414
+ // src/domain/settings/clause-settings/default-clause-settings.ts
415
+ var defaultClauseSettings = (request) => Object.fromEntries(
416
+ Object.entries(request.declarations).map(([key, declaration]) => [key, declaration.default])
417
+ );
418
+
419
+ export {
420
+ defaultClauseSettings,
421
+ namedChecksRunReportSchema,
422
+ runnerModuleAt,
423
+ runnerInvalidOutput,
424
+ rejectedCall,
425
+ runnerEnginesOver
426
+ };
@@ -0,0 +1,19 @@
1
+ // src/infrastructure/engines/protocol/toolchain/toolchain-bound-runner.ts
2
+ var builtOnce = (request) => request.toolchain.then(
3
+ (loaded) => loaded.outcome === "failed" ? loaded : { outcome: "ok", value: request.runnerOf(loaded.value) }
4
+ );
5
+ var withRunner = (request) => request.runner.then((built) => built.outcome === "failed" ? built : request.act(built.value));
6
+ var toolchainBoundNamedChecksRunner = (request) => {
7
+ const runner = builtOnce(request);
8
+ return {
9
+ fileScope: request.fileScope,
10
+ projectedKinds: request.projectedKinds,
11
+ run: (run) => runner.then((built) => built.outcome === "failed" ? built : built.value.run(run)),
12
+ conform: (conform) => withRunner({ runner, act: (built) => built.conform(conform) }),
13
+ project: (project) => runner.then((built) => built.outcome === "failed" ? built : built.value.project(project))
14
+ };
15
+ };
16
+
17
+ export {
18
+ toolchainBoundNamedChecksRunner
19
+ };
@@ -1,12 +1,10 @@
1
1
  import {
2
+ TOOL_RULE_SET,
3
+ clauseAddressPartsOf,
2
4
  clauseIdSchema,
3
5
  disciplineIdSchema,
4
6
  ruleSetNameSchema
5
- } from "./chunk-GNOMK7CR.js";
6
- import {
7
- TOOL_RULE_SET,
8
- clauseAddressPartsOf
9
- } from "./chunk-M6SOGWT7.js";
7
+ } from "./chunk-WPEOCLTP.js";
10
8
 
11
9
  // src/infrastructure/discipline-exceptions-folder/clause-address.ts
12
10
  import { z } from "zod";