@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
package/rules/records.md CHANGED
@@ -6,15 +6,15 @@ Today's record formats are listed [beside the kinds](#todays-formats-and-the-kin
6
6
 
7
7
  ## The kinds
8
8
 
9
- Five kinds cover everything. They are the model Hone's records take on with 2.0, which is not released yet: Deviation and Dependency record have no format today, and the others are written today in the formats [beside the kinds](#todays-formats-and-the-kinds), which say what each still lacks.
9
+ Four kinds cover everything. They are the model Hone's records take on with 2.0, which is not released yet: Deviation and Dependency record have no format today, and the others are written today in the formats [beside the kinds](#todays-formats-and-the-kinds), which say what each still lacks.
10
10
 
11
11
  ### Authorised location
12
12
 
13
13
  - **Answers:** A symptom whose correct use a case makes right at one place. Each symptom's correct uses are on [the symptoms page](typescript/symptoms.md).
14
- - **States:** The symptom; the site; the case that makes it correct here and the rule or principle that case owes; a why-chain whose root, if it changed, would remove the need; an owner. In the model it is never refused for what it claims: what it lacks is [noted](#what-is-noted-never-refused), and a note changes no verdict. A why that only restates the symptom is [refused](#what-is-refused).
14
+ - **States:** The symptom and check; the site; for Outside import past a boundary, the outside party; the case that makes it correct here and the rule or principle that case owes; a why-chain whose root, if it changed, would remove the need; an owner. It is refused on a symptom with no authorised-location correct use. Otherwise what it lacks is [noted](#what-is-noted-never-refused), and a note changes no verdict. A why that only restates the symptom is [refused](#what-is-refused).
15
15
  - **Scope:** One symptom at one site: a file, or a span within it.
16
16
  - **Stale or paid when:** Stale when the symptom is no longer at the site. A vendored edit is also re-tested when the vendored version moves. A person removes it.
17
- - **Industry name:** suppression with justification; a MISRA deviation permit. A suppression with a stated justification, as .NET and MISRA permits do.
17
+ - **Industry name:** suppression with justification, as .NET's `SuppressMessage` justification does.
18
18
 
19
19
  ### Deviation
20
20
 
@@ -22,24 +22,16 @@ Five kinds cover everything. They are the model Hone's records take on with 2.0,
22
22
  - **Must state:** The recipe by name; the reason it was chosen, as its recipe states it; why that reason does not hold at this site, with evidence; how the rule still holds.
23
23
  - **Scope:** One recipe at one site.
24
24
  - **Stale or paid when:** Stale when the symptom is gone. Review owes "the reason holds again".
25
- - **Industry name:** a MISRA deviation record. Aviation's alternative means of compliance, held to a stricter proof.
25
+ - **Industry name:** a deviation record: aviation's alternative means of compliance, held to a stricter proof.
26
26
 
27
27
  ### Debt
28
28
 
29
29
  - **Answers:** Any symptom at a site, a known breach not yet paid.
30
30
  - **Must state:** The symptom and the site. Nothing more: "All debt is debt. Reason doesn't matter."
31
31
  - **Scope:** One symptom in one file.
32
- - **Stale or paid when:** Forfeited once the file is touched, so the change pays it. Stale when the symptom is gone. Removed by the tool when the file is gone, or when its check measured the file and found the debt paid.
32
+ - **Stale or paid when:** Forfeited once the file is touched, so the change pays it. Moving a file without changing its content does not touch it. Stale when the symptom is gone. Removed by the tool when the file is gone, or when its check measured the file and found the debt paid.
33
33
  - **Industry name:** a baseline with a ratchet. Record-debt is the baseline, and forfeit-on-touch is the ratchet. A lint baseline, as in ESLint bulk suppressions, that ratchets down.
34
34
 
35
- ### Boundary record
36
-
37
- - **Answers:** The symptoms a boundary makes correct inside an adapter: Date used directly, Ambient randomness, Process global used in place, Outside import past a boundary, Library class built in place, Outside type in a signature, Text past its reader in the producer's adapter. With a **Conformist** statement, also Schema past its adapter and Outside type in a signature beyond the adapter.
38
- - **Must state:** The outside party, the port or ports it fulfils, and the module. For Conformist: the outside model adopted as ours, and why it is "a persisted concept that pushes into other boundaries as the definitive thing".
39
- - **Scope:** One module: a file or a folder.
40
- - **Stale or paid when:** Stale when the module no longer reaches that outside party. A person removes it.
41
- - **Industry name:** an architecture decision record (Nygard). Evans's anticorruption layer, recorded.
42
-
43
35
  ### Dependency record
44
36
 
45
37
  - **Answers:** Outside dependencies justified, and Dependency without a record.
@@ -55,7 +47,7 @@ Only the tool, and only debt, for findings the base revision already held ("reco
55
47
  ### Merged into the kinds, or not a kind
56
48
 
57
49
  - **Site-level record for one symptom:** merged. Every kind names a symptom, not a whole clause, so a record can say "this symptom, here".
58
- - **Conformist:** merged into Boundary record. It is a decision about one outside party's model crossing a boundary.
50
+ - **Conformist:** a Conformist statement is the root of an authorised location's why-chain.
59
51
  - **Drift record:** merged into Authorised location, on the symptom Edit inside vendored code. Its case: "justified as additional drift as impossible to apply as an extension instead". It states when it should be dropped.
60
52
  - **Inline suppression:** not a kind. It is where a record shows at the site. An inline disable or a tool directive is held only by a record of its symptom at that site.
61
53
  - **Tracked pointer:** not a record. It is an allowed annotation.
@@ -72,7 +64,7 @@ Only the tool, and only debt, for findings the base revision already held ("reco
72
64
 
73
65
  ## What is refused
74
66
 
75
- In the model, an authorised location is never refused for what it claims; what it lacks is [noted](#what-is-noted-never-refused). Its why-chain must still be a reason. A record file that cannot be read at all is refused, whatever it holds. Every other record must contain what its kind states. Anything less is refused, as follows.
67
+ An authorised location is refused on a symptom with no authorised-location correct use; otherwise what it lacks is [noted](#what-is-noted-never-refused). Its why-chain must still be a reason. A record file that cannot be read at all is refused, whatever it holds. Every other record must contain what its kind states. Anything less is refused, as follows.
76
68
 
77
69
  | Refused | Why | Does Hone refuse it from the form today? |
78
70
  |---|---|---|
@@ -83,15 +75,15 @@ In the model, an authorised location is never refused for what it claims; what i
83
75
  | Debt written by the tool for a file the base did not hold | today's `new-file` | Yes, as today. |
84
76
  | A record standing in for a design fix, where friction points at the design | "if we have such a complex test that needs exemption we have a code architecture problem" | No; review. A machine can show records clustering on one symptom or one cause. Only review rules on it. |
85
77
  | An option that weakens the whole run (`--rule`, `-c`) | today | Yes, as today: it cannot be recorded. |
78
+ | An authorised location on a symptom with no authorised-location correct use | No correct use, so nothing to authorise. | Yes, by `hone authorise` and the reader. One carried from version 1 is kept. |
86
79
 
87
80
  This is a list of what each record must contain. It is not a ladder of exceptions.
88
81
 
89
82
  ## What is noted, never refused
90
83
 
91
- An authorised location answers a check that is wrong at that place, so the form accepts it for any symptom: "while authorised location in spirit isn't supposed to be allowed. It's mechanically always allowed as our checks for symptoms is never assumed perfect." In the model, what it lacks is a note beside it. A note changes no verdict; review rules on it.
84
+ An authorised location answers a check that is wrong at that place, so the form accepts it for any symptom with an authorised-location correct use: "while authorised location in spirit isn't supposed to be allowed. It's mechanically always allowed as our checks for symptoms is never assumed perfect." In the model, what it lacks is a note beside it. A note changes no verdict; review rules on it.
92
85
 
93
86
  - **A case that is missing, or not in the [case list](cases.md).** A thought-through use names its case. Whether the case is true is left to review. Today's tool does not read a case name.
94
- - **A symptom that no case makes correct, such as a branch in a test.** "who the heck added an authorised location for an if in a test?" In spirit it is not allowed.
95
87
  ## The cost side
96
88
 
97
89
  **What holds today:**
@@ -116,7 +108,7 @@ Which kind answers each symptom is on [the symptoms page](typescript/symptoms.md
116
108
  | Method | Kind |
117
109
  |---|---|
118
110
  | A fake | Deviation from Stub with vi.fn |
119
- | A hermetic setup in an integration test | Not a record: it is the recipe |
111
+ | A fresh scratch in an integration test | Not a record: it is the recipe |
120
112
  | A real file, subprocess or temp directory in a unit test | Debt. It breaks Tested where it's owned, which is a rule, not a recipe. |
121
113
  | A stream drain | Authorised location |
122
114
  | A throw at the edge | Authorised location |
@@ -128,7 +120,7 @@ Records today are written in these formats. Each answers one of the kinds.
128
120
 
129
121
  | Today | Kind | What differs from the kind |
130
122
  |---|---|---|
131
- | `authorised-location` (clause, file, reason, whyChain) | Authorised location, or Boundary record for sites of Outside import past a boundary | Names a clause, not a symptom. The site is a file. It does not name the case and the rule owed. |
123
+ | `authorised-location` (clause, file, reason, whyChain) | Authorised location, one per outside party for Outside import past a boundary | Names a clause, not a symptom. The site is a file. It does not name the case, the rule owed or the outside party. |
132
124
  | `file-carve-out` (clause, file, optional reason) | Debt | Names a clause, not a symptom. One record on the test-logic clause covers up to four symptoms. |
133
125
  | `clause-wide-carve-out` | Not a record: the clause is not adopted | Today it is a record that keeps the clause running, with its why-chain; with 2.0 it becomes the check marked not adopted. |
134
126
  | `provenance` (imported) | The same kind, imported | Nothing. |
package/rules/rules.md CHANGED
@@ -23,7 +23,7 @@ The clock, random values, new ids and outside ordering are a case: the principle
23
23
  - **Review:** process signals, exit, kill and high-resolution timing arrive through an injected port
24
24
 
25
25
  - **Cases served:** Builds the real implementations; Causes an effect (writes, logs, sends, exits); Needs the current time, a random value, a new id or an outside ordering; Uses a system or service outside the program.
26
- - **Recipes:** [Composition root](typescript/recipes.md#composition-root), [Port in the domain](typescript/recipes.md#port-in-the-domain), [World values through a port](typescript/recipes.md#world-values-through-a-port).
26
+ - **Recipes:** [Composition root](typescript/recipes.md#composition-root), [Port in a module of its own](typescript/recipes.md#port-in-a-module-of-its-own), [World values through a port](typescript/recipes.md#world-values-through-a-port).
27
27
 
28
28
  ## One place decides
29
29
 
@@ -61,7 +61,7 @@ The clock, random values, new ids and outside ordering are a case: the principle
61
61
  Building every real implementation in one place at start-up is a case: Doer or orchestrator plus Ports declared inside give it. DRY is held here: "dry is true but it must be held with reasons to change not "same functional code right now"".
62
62
 
63
63
  - **Cases served:** Puts code in a file or folder; Reads data from outside (request, file, environment, stored row, response); Reuses behaviour from another unit or type; Sends data out of the program.
64
- - **Recipes:** [Screaming folders](typescript/recipes.md#screaming-folders).
64
+ - **Recipes:** [Entity module](typescript/recipes.md#entity-module), [Screaming folders](typescript/recipes.md#screaming-folders).
65
65
 
66
66
  ## Our code reads in the common language
67
67
 
@@ -75,7 +75,7 @@ One word everywhere keeps "no meaning rests on position". A unit whose signature
75
75
  Casing is a check under this rule. Writing basic logic in the language's own constructs is a case; the principle gives it.
76
76
 
77
77
  - **Cases served:** Explains something in prose; Names something.
78
- - **Recipes:** [Domain vocabulary list](typescript/recipes.md#domain-vocabulary-list), [Meaning in names, not comments](typescript/recipes.md#meaning-in-names-not-comments), [Whole words](typescript/recipes.md#whole-words).
78
+ - **Recipes:** [Domain vocabulary list](typescript/recipes.md#domain-vocabulary-list), [Meaning in names, not comments](typescript/recipes.md#meaning-in-names-not-comments), [One argument object](typescript/recipes.md#one-argument-object), [Whole words](typescript/recipes.md#whole-words).
79
79
 
80
80
  ## Outside risk is carried on purpose
81
81
 
@@ -163,7 +163,7 @@ Both halves answer one reason to change, which test owns a behaviour, so it stay
163
163
  - **Source:** King's parse, don't validate.
164
164
 
165
165
  - **Cases served:** Gives a value its type (declares it, or needs it narrower).
166
- - **Recipes:** [Bounded context generic](typescript/recipes.md#bounded-context-generic), [Fix the declaration, not the value](typescript/recipes.md#fix-the-declaration-not-the-value), [Named, exported type](typescript/recipes.md#named-exported-type), [Shared strict base config](typescript/recipes.md#shared-strict-base-config).
166
+ - **Recipes:** [Assert to narrow](typescript/recipes.md#assert-to-narrow), [Constrained context generic](typescript/recipes.md#constrained-context-generic), [Fix the declaration, not the value](typescript/recipes.md#fix-the-declaration-not-the-value), [Named, exported type](typescript/recipes.md#named-exported-type), [Shared strict base config](typescript/recipes.md#shared-strict-base-config), [Zod at the producer's adapter](typescript/recipes.md#zod-at-the-producers-adapter).
167
167
 
168
168
  ### Failures are values
169
169
 
@@ -172,7 +172,7 @@ Both halves answer one reason to change, which test owns a behaviour, so it stay
172
172
  - **Review:** expected operational failures are returned as a Result with a tagged error union, not thrown
173
173
 
174
174
  - **Cases served:** An operation can fail.
175
- - **Recipes:** [Result union](typescript/recipes.md#result-union).
175
+ - **Recipes:** [Failure mapping at the adapter](typescript/recipes.md#failure-mapping-at-the-adapter), [Result union](typescript/recipes.md#result-union).
176
176
 
177
177
  ### Kinds are named
178
178
 
package/rules/sources.md CHANGED
@@ -52,9 +52,9 @@ A CONFLICTS source sits beside an item's main source, never in place of it. Stri
52
52
 
53
53
  | Item | Source and its claim | Relation |
54
54
  |---|---|---|
55
- | [Stub with vi.fn](typescript/recipes.md#stub-with-vifn) | Meszaros, [Test Stub](http://xunitpatterns.com/Test%20Stub.html). Martin, [The Little Mocker (2014)](https://blog.cleancoder.com/uncle-bob/2014/05/14/TheLittleMocker.html). GOOS §4.6: "Mock objects are still stubs"; adding behaviour signals misplaced responsibility. | SAME |
55
+ | [Stub with vi.fn](typescript/recipes.md#stub-with-vi-fn) | Meszaros, [Test Stub](http://xunitpatterns.com/Test%20Stub.html). Martin, [The Little Mocker (2014)](https://blog.cleancoder.com/uncle-bob/2014/05/14/TheLittleMocker.html). GOOS §4.6: "Mock objects are still stubs"; adding behaviour signals misplaced responsibility. | SAME |
56
56
  | [Ports in the argument](typescript/recipes.md#ports-in-the-argument) | Fowler 2004, DI article (constructor injection); Seemann, [Pure DI (2014)](https://blog.ploeh.dk/2014/06/10/pure-di/). | NARROWER: one of Fowler's three injection forms |
57
- | [it.each over typed rows](typescript/recipes.md#iteach-over-typed-rows) | Meszaros, [Parameterized Test](http://xunitpatterns.com/Parameterized%20Test.html). | STRICTER: rows typed and hard-coded |
57
+ | [it.each over typed rows](typescript/recipes.md#it-each-over-typed-rows) | Meszaros, [Parameterized Test](http://xunitpatterns.com/Parameterized%20Test.html). | STRICTER: rows typed and hard-coded |
58
58
  | [Assert to narrow](typescript/recipes.md#assert-to-narrow) | Meszaros, [Guard Assertion](http://xunitpatterns.com/Guard%20Assertion.html): "Replace an if statement in a test with an assertion…" | SAME |
59
59
  | [Whole written-out expectation](typescript/recipes.md#whole-written-out-expectation) | Meszaros, Literal Value. | SAME |
60
60
  | [Failure asserted as a value](typescript/recipes.md#failure-asserted-as-a-value) | Follows from Failures are values. No test-pattern name found. | NO SOURCE |
@@ -71,7 +71,7 @@ A CONFLICTS source sits beside an item's main source, never in place of it. Stri
71
71
  | [Copy, never write in](typescript/recipes.md#copy-never-write-in) | Fowler, [ValueObject](https://martinfowler.com/bliki/ValueObject.html): value objects should be immutable. | SAME |
72
72
  | [Closure factory](typescript/recipes.md#closure-factory) | Crockford, [Private Members in JavaScript](https://www.crockford.com/javascript/private.html): privileged methods over closure state. | SAME (conflict: Evans's mutable entities) |
73
73
  | [Adapter per outside party](typescript/recipes.md#adapter-per-outside-party) | Cockburn, Hexagonal Architecture. | SAME |
74
- | [Port in the domain](typescript/recipes.md#port-in-the-domain) | Martin DIP 1996; Martin 2012: the output port sits in the inner circle, implemented outside. Evans 2013: ACL-backed repository. | SAME on ownership |
74
+ | [Port in a module of its own](typescript/recipes.md#port-in-a-module-of-its-own) | Martin DIP 1996; Martin 2012: the output port sits in the inner circle, implemented outside. Evans 2013: ACL-backed repository. | SAME on ownership |
75
75
  | [World values through a port](typescript/recipes.md#world-values-through-a-port) | Seemann, [Volatile Dependencies](https://learn.microsoft.com/en-us/archive/blogs/ploeh/volatile-dependencies): time and randomness are volatile and go behind an abstraction. | STRICTER: Seemann exempts stable dependencies; ours does not |
76
76
  | [Composition root](typescript/recipes.md#composition-root) | Seemann, [Composition Root (2011)](https://blog.ploeh.dk/2011/07/28/CompositionRoot/). | SAME |
77
77
  | [Zod at the producer's adapter](typescript/recipes.md#zod-at-the-producers-adapter) | King 2019; Evans 2013: "ideally the translator should just translate". | SAME |
@@ -80,7 +80,7 @@ A CONFLICTS source sits beside an item's main source, never in place of it. Stri
80
80
  | [Result union](typescript/recipes.md#result-union) | Wlaschin, Against ROP. | SAME |
81
81
  | [Named, exported type](typescript/recipes.md#named-exported-type) | No source found. | NO SOURCE |
82
82
  | [Fix the declaration, not the value](typescript/recipes.md#fix-the-declaration-not-the-value) | No source found; nearest is King 2019. | NO SOURCE |
83
- | [Bounded context generic](typescript/recipes.md#bounded-context-generic) | No source found. | NO SOURCE |
83
+ | [Constrained context generic](typescript/recipes.md#constrained-context-generic) | No source found. | NO SOURCE |
84
84
  | [Shared strict base config](typescript/recipes.md#shared-strict-base-config) | No source found; a tool feature, not a named practice. | NO SOURCE |
85
85
  | [Tagged union and exhaustive switch](typescript/recipes.md#tagged-union-and-exhaustive-switch) | TypeScript Handbook, [Narrowing: exhaustiveness checking](https://www.typescriptlang.org/docs/handbook/2/narrowing.html): a `default` branch assigns to `never`. | STRICTER: this recipe has no `default` branch |
86
86
  | [Domain vocabulary list](typescript/recipes.md#domain-vocabulary-list) | Fowler, UbiquitousLanguage. | SAME |
@@ -99,7 +99,7 @@ A CONFLICTS source sits beside an item's main source, never in place of it. Stri
99
99
  | [Authorised location](records.md#authorised-location) | Microsoft, [SuppressMessageAttribute.Justification](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.suppressmessageattribute.justification): "the justification for suppressing the code analysis message". | SAME |
100
100
  | [Deviation](records.md#deviation) | EASA, [FAQ 19026](https://www.easa.europa.eu/en/faq/19026): an alternative means of compliance must show it meets "the intent of the IR". | STRICTER: a deviation must show the recipe's reason fails at this site; meeting the rule another way is not enough |
101
101
  | [Debt](records.md#debt) | ESLint, [bulk suppressions](https://eslint.org/docs/latest/use/suppressions): existing violations "will not be reported", new ones are. Martin, [The Boy Scout Rule](https://github.com/97-things/97-things-every-programmer-should-know/blob/master/en/thing_08/README.md): leave it "a little bit better". | STRICTER: touching the file forfeits the whole file's debt |
102
- | [Boundary record](records.md#boundary-record) | Evans 2013: an ACL presents a clean interface in the downstream model; the ACL-backed repository. | SAME |
102
+ | [Authorised location for an outside party](records.md#authorised-location) | Evans 2013: an ACL presents a clean interface in the downstream model; the ACL-backed repository. | SAME |
103
103
  | [Dependency record](records.md#dependency-record) | Nygard 2011; NTIA SBOM. | SAME |
104
104
 
105
105
  ## The model
@@ -111,7 +111,7 @@ A CONFLICTS source sits beside an item's main source, never in place of it. Stri
111
111
  | Symptom | Fowler, [CodeSmell](https://martinfowler.com/bliki/CodeSmell.html): "a surface indication that usually corresponds to a deeper problem". | SAME |
112
112
  | Check | Thoughtworks Radar, [Architectural fitness function](https://www.thoughtworks.com/radar/techniques/architectural-fitness-function): "provides an objective integrity assessment of some architectural characteristics". | SAME |
113
113
  | Case | Fowler, [Writing Software Patterns](https://martinfowler.com/articles/writingPatterns.html): the Coplien form has "Problem, Context, Forces, and Solution". | SAME |
114
- | Record | Nygard 2011, ADR; MISRA deviation records. | SAME |
114
+ | Record | Nygard 2011, ADR. | SAME |
115
115
  | Cross-language rules with a language layer | [SEI CERT coding standards](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/front-matter/introduction/how-this-coding-standard-is-organized): per-language standards, each with noncompliant and compliant examples. | SAME (parallel) |
116
116
  | Two addresses per finding | No source found. | NO SOURCE |
117
117
  | The chain: symptom, case, why, reason to change | No source found. Pieces only: smell to deeper problem (Fowler); problem and context (pattern form). | NO SOURCE |
@@ -136,7 +136,6 @@ None of these is closed off.
136
136
  - **Open-Closed**: would extend Upstream stays untouched to our own modules.
137
137
  - **Liskov substitution**: would extend Ports declared inside, so any adapter honours the port's contract.
138
138
  - **Tell, Don't Ask** ([Fowler](https://martinfowler.com/bliki/TellDontAsk.html)): would extend Doer or orchestrator.
139
- - **The use-case ring**: would extend External behaviour sits at a boundary, adding a layer between the domain and the adapters.
140
139
  - **Walking skeleton** (GOOS): would extend Tests are ours, with an end-to-end slice first.
141
140
  - **Humble Object** ([Meszaros](http://xunitpatterns.com/Humble%20Object.html)): would extend Tested where it's owned, keeping the untestable shell thin.
142
141
  - **Domain events**: would extend No hidden effects, making a change an explicit value.