@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/ADOPTING.md CHANGED
@@ -146,7 +146,7 @@ export default [
146
146
 
147
147
  To confirm it, run the repository's own `eslint` on one TypeScript file with a type annotation, for example `node_modules/.bin/eslint src/index.ts` with a file of your own; it must report findings or nothing, never `Parsing error`.
148
148
 
149
- In a monorepo where ESLint resolves each file from its nearest config, `hone:project` also writes a `hone.eslint.mjs` slice, with its `hone.eslint.d.mts` declaration of the type, beside each package's tracked `eslint.config.*`, holding only that package's records with paths relative to the package. Where one ESLint 9 run applies the root config to every file, package configs are never loaded and get no slice. A package config keeps its slice even in a folder the root config ignores, since a lint run from that package loads its own config without the root's ignores. A folder holding its own `hone.config.json` is a nested Hone configuration, which is not supported yet ([#72](https://github.com/HailsTails/hone/issues/72)): when the ESLint engine would check a file under it, `check` and `project` stop before anything is checked or written, and say to move the folder out and run it on its own with `--repo`. A run that lists only walker checks does not stop, and a folder with no such file gets no slice. The root config spreads the root projection last, and each package config spreads its own slice last, never the root one:
149
+ In a monorepo where ESLint resolves each file from its nearest config, `hone:project` also writes a `hone.eslint.mjs` slice, with its `hone.eslint.d.mts` declaration of the type, beside each package's tracked `eslint.config.*`, holding only that package's records with paths relative to the package. Where one ESLint 9 run applies the root config to every file, package configs are never loaded and get no slice. A package config keeps its slice even in a folder the root config ignores, since a lint run from that package loads its own config without the root's ignores. When a folder holds its own `hone.config.json`, `check` and `project` continue. Hone skips projection slices there and names the folder when it keeps the parent projection out of effect. The root config spreads the root projection last, and each package config spreads its own slice last, never the root one:
150
150
 
151
151
  ```js
152
152
  import projection from "./hone.eslint.mjs";
@@ -187,7 +187,7 @@ Commit the projection, every slice and the configs. Hone's check reads this conf
187
187
  npm run --silent hone:check
188
188
  ```
189
189
 
190
- It exits `0` on `verdict: pass`, `1` on `verdict: fail` and `2` when an input cannot be loaded; [docs/output-contract.md](docs/output-contract.md) has every exit code and line. `npm run` passes the exit code through. `sh: hone: not found` or `'hone' is not recognized` means step 2's install is missing. A load failure that names a toolchain package says what to install or delete.
190
+ It exits `0` on `verdict: pass`, `1` on `verdict: fail` and `2` when an input cannot be loaded. `npm run` passes the exit code through. `sh: hone: not found` or `'hone' is not recognized` means step 2's install is missing. A load failure that names a toolchain package says what to install or delete.
191
191
 
192
192
  Add the check to the repository's existing validation script, and run that script in CI and in any pre-push hook the repository already has, so the check runs wherever the other checks run.
193
193
 
@@ -205,7 +205,7 @@ With pnpm:
205
205
  pnpm run --silent hone:check --forfeiture this-run --base-revision origin/main
206
206
  ```
207
207
 
208
- A run that leaves forfeiture to another run marks its verdict line as a partial assessment. Act on the exit code, or match every verdict line [docs/output-contract.md](docs/output-contract.md#the-version-2-report) lists.
208
+ A run that leaves forfeiture to another run marks its verdict line as a partial assessment. Act on the exit code.
209
209
 
210
210
  CI leaves forfeiture to the hook, and with `elsewhere` in effect it can run the check with no base revision:
211
211
 
@@ -280,7 +280,7 @@ A finished section reads like this, for the check `claimed-type#unlisted-cast-si
280
280
 
281
281
  ## 6. Read the report
282
282
 
283
- The report prints only the sections that have entries, each with its count, then the verdict. A finding names the check, the engine, the place and the snippet, what the check may indicate and, where it has one, the fix. Each other line says what to do about it. [docs/output-contract.md](docs/output-contract.md#the-version-2-report) lists every section in the order it prints, which sections fail the run, and every line. The `symptoms` section, printed last, explains each symptom the findings name.
283
+ The report prints only the sections that have entries, each with its count, then the verdict. A finding names the check, the engine, the place and the snippet, what the check may indicate and, where it has one, the fix. Each other line says what to do about it. The `symptoms` section, printed last, explains each symptom the findings name.
284
284
 
285
285
  To print less, set `"reportOutput"` in `hone.config.json`, or pass `--report-output` for one run. The verdict and exit code are the same whichever output you choose.
286
286
 
@@ -288,22 +288,11 @@ To print less, set `"reportOutput"` in `hone.config.json`, or pass `--report-out
288
288
 
289
289
  Before recording anything, take the chain in [the spirit of the rules](rules/SPIRIT.md#when-the-check-is-red): measure the sites for each failing check, ask what each group points at using the `symptoms` section of the report, the "May indicate" and "Breach usually sits" lines of each symptom on [the symptoms page](rules/typescript/symptoms.md) and the check's section in `disciplines.assessment.md` (step 5a), then decide. Fix the cause where you can; a record is not the first move. Where a finding is correct in a place, or owed and cannot be fixed yet, answer it with a record in `<repo>/hone-records`, one file for each kind and symptom or recipe:
290
290
 
291
- - **Debt** is known debt in one file: `hone-records/debt/<symptom>.json` with the symptom's name as `answers`, or `<symptom>#<check>` to reach one check of it, and the `file`. It is forfeited, and fails the run, as soon as that file changes since `--base-revision`. An `eslint-disable` comment or a `@ts-expect-error`, `@ts-ignore` or `@ts-nocheck` directive in a file is held only by a record on its check and file: until one holds it, such a comment is `unrecorded` and fails the run. Step 7a writes that debt for the findings and for such comments.
292
- - **An authorised location** says the symptom is correct in that file, for example the single adapter that reads the real clock when the catalogue lists that case: `hone-records/authorised-locations/<symptom>.json`. `hone authorise` writes one from the arguments it is given, with the why-chain the person supplies.
293
- - **A boundary record** says a module is where an outside party is met, such as the clock adapter, in `hone-records/boundary-records.json`:
294
-
295
- ```json
296
- {
297
- "version": 2,
298
- "records": [
299
- { "module": "src/clock.ts", "outsideParty": "runtime:clock", "ports": ["Clock"] }
300
- ]
301
- }
302
- ```
303
-
291
+ - **Debt** is known debt in one file: `hone-records/debt/<symptom>.json` with the symptom's name as `answers`, or `<symptom>#<check>` to reach one check of it, and the `file`. It is forfeited, and fails the run, as soon as that file changes since `--base-revision`. An `eslint-disable` comment or a `@ts-expect-error`, `@ts-ignore` or `@ts-nocheck` directive in a file is held only by a record on its check and file: until one holds it, such a comment is `unrecorded` and fails the run; once held, it is listed under `held` with the record that holds it. Step 7a writes that debt for the findings and for such comments.
292
+ - **An authorised location** says a check's finding is correct in that file, such as `date-used-directly#clock-sources` in `src/clock.ts`, the single adapter that reads the real clock: `hone-records/authorised-locations/<symptom>.json`. `hone authorise` writes one from the arguments it is given, with the why-chain the person supplies. For Outside import past a boundary it also takes `--outside-party`, the package or `node:` module the adapter is for.
304
293
  - **A deviation** says why a file does not follow a recipe the catalogue gives, in `hone-records/deviations/<recipe>.json`. **A dependency record** says why a package is used where the platform's own way exists, in `hone-records/dependency-records.json`.
305
294
 
306
- Which kind answers a finding is in the `symptoms` section of the report: each symptom's note lists the situations that are correct uses of it and the record kind that expresses each. [README.md](README.md#hone-records) gives every kind's fields. A record that answers nothing is `stale` and fails the run, except a dependency record, which no check reads yet and so is never stale, so record only what a finding needs: debt while the check still finds it, a location or boundary where the symptom is correct. If the check is not a true measure of the rule here, or cannot work here, list it as `"not-run"` instead; if the rule does not apply, list it as `"not-adopted"` (step 4).
295
+ Which kind answers a finding is in the `symptoms` section of the report: each symptom's note lists the situations that are correct uses of it and the record kind that expresses each. [README.md](README.md#hone-records) gives every kind's fields. A record that answers nothing is `stale` and fails the run, except a dependency record, which no check reads yet and so is never stale, so record only what a finding needs: debt while the check still finds it, a location where the symptom is correct. If the check is not a true measure of the rule here, or cannot work here, list it as `"not-run"` instead; if the rule does not apply, list it as `"not-adopted"` (step 4).
307
296
 
308
297
  An authorised location needs its `case`, its `owes` and a `whyChain` shaped like this, with exactly five steps in `whys`; debt needs none:
309
298
 
@@ -333,7 +322,7 @@ Existing debt needs no chain and no case: a debt record names only its symptom a
333
322
 
334
323
  A repository with existing code usually has more findings than the change that adopts Hone can fix. `hone record-debt` writes a debt record for each symptom, check and file the check finds broken, and for each inline disable or TypeScript directive that hides one, so the first passing run does not wait on hundreds of records written by hand. Do this after the assessment (step 5a), and after fixing what you are going to fix in this change.
335
324
 
336
- 1. **Decide the permanent exceptions first.** List each file or folder that breaks a check on purpose and always will, such as the one adapter that reads the real clock. Those are not debt. They get an authorised location or a boundary record with their own reason, written by a person, so keep them out of the generated records with `--leave`.
325
+ 1. **Decide the permanent exceptions first.** List each file or folder that breaks a check on purpose and always will, such as the one adapter that reads the real clock. Those are not debt. They get an authorised location with its `whyChain`, written by a person, so keep them out of the generated records with `--leave`.
337
326
  2. **Leave `hone.config.json` as it is.** Debt needs no why-chain and no case, so the command needs no setting and never sets one. The same command records debt a later change uncovers, such as a newly listed check or a newer edition: run it again against the branch's base.
338
327
  3. **Finish every source file this change edits.** Forfeiture is assessed against the branch's base, the revision your pre-push hook and CI pass to the check (step 5), such as `origin/main`, not against the commit you run from. A file the adopting change edits has changed since that base, so a record for it is forfeited there, even after you commit the edit; the command writes none for such a file and says so. In each file this change edits, fix every finding of each check, or take the edit out of this change and make it later in a change that fixes the file. A file this change adds has no record to lose: point 4 reports it `touched`.
339
328
  4. **Run it once, with the branch's base as `--base-revision`**, one `--leave` for each path from point 1. Fetch the base first, so the revision is current:
@@ -343,7 +332,7 @@ A repository with existing code usually has more findings than the change that a
343
332
  node_modules/.bin/hone record-debt --repo . --base-revision origin/main --leave src/clock.ts --leave src/adapters
344
333
  ```
345
334
 
346
- It prints one line per finding and per native exception, saying what it recorded and, for each it did not, why and what to do instead. Files under a `--leave` path need their records written now, each with its own reason. Files this change created or changed need fixing, or a record with a reason of your own.
335
+ It prints one line per finding and per native exception, saying what it recorded and, for each it did not, why and what to do instead. Files under a `--leave` path need their authorised locations from point 1 written now. Files this change created or changed need fixing.
347
336
  5. **Re-project and check against the same base.** With any `eslint` check, run `npm run --silent hone:project`. Then run `npm run --silent hone:check -- --forfeiture this-run --base-revision origin/main` (with pnpm, `pnpm run --silent hone:check --forfeiture this-run --base-revision origin/main`). `--forfeiture this-run` makes this run assess forfeiture whatever `forfeiture` says, as the run that assesses it for your repository does: the pre-push hook with `"forfeiture": "elsewhere"` (step 5), or CI without it. A `forfeited` line names a file this change edits: go back to point 3 for it. A check against `HEAD` hides those lines, because nothing has changed since `HEAD`, and the hook or CI then fails where this run passed. What stays under `unrecorded` is what no record can hold; point 4's line for each says what to do.
348
337
  6. **Review the diff.** Nothing takes effect until you commit it. Each generated record is debt holding only its symptom, check and file: inherited debt that nobody has reviewed, and the reviewer of the adopting change reads it as that. Note them in each check's Debt line in `disciplines.assessment.md`.
349
338
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,110 @@
2
2
 
3
3
  Every release of Hone, newest first. `pnpm run release-pull-request` writes each new section from the commits merged to `main` since the previous release tag, whose subjects are the squash-merged pull request titles; README.md's Compatibility section says what each kind of release may change. The sections below were written by hand from the merged pull requests when the changelog started.
4
4
 
5
+ ## 2.0.0-pre.5
6
+
7
+ ### Breaking changes
8
+
9
+ - an authorised location binds what its symptom declares, and boundary records go (#477)
10
+ - hone upgrade runs the record tools and ends in a passing check (#478)
11
+ - hone upgrade carries no names from 2.0 prereleases (#483)
12
+ - findings reach recipe examples through symptom, case and rule (#484)
13
+
14
+ ### Features
15
+
16
+ - an engines stage measures in a child process, so a rewritten config takes effect (#464)
17
+ - a local speed baseline compares hone check CPU time against a pinned revision (#454)
18
+
19
+ ### Fixes
20
+
21
+ - self-check fails on findings and unrecorded native exceptions (#445)
22
+ - a moved file keeps its debt, and records follow renames (#447)
23
+ - type-declared-in-a-test spares a row typed only by imported types (#450)
24
+ - the child measurement replies on its own pipe, so adopter output can't break it (#476)
25
+
26
+ ### Other changes
27
+
28
+ - Hone's record tools run without asking (#442)
29
+ - record the applied agent definitions (#443)
30
+ - the upgrade proof decides its effects as data (#448)
31
+ - AGENTS.md holds the naming, test-layout and rules-over-checks rulings (#456)
32
+ - freeze the version 2 names (#449)
33
+ - the package plan finds every process entry by one convention (#463)
34
+ - leave Hone's own debt forfeiture to another run until 2.0 ships (#468)
35
+ - the ESLint integration tests prove only what real ESLint adds (#470)
36
+ - Hone's own check prints only what needs action (#471)
37
+ - records and checks refer to symptoms by address (#472)
38
+
39
+ ## 2.0.0-pre.4
40
+
41
+ ### Breaking changes
42
+
43
+ - speak the named model in the walker, rule-set and testing entries (#415)
44
+
45
+ ### Features
46
+
47
+ - detect process global access (#359)
48
+ - detect ambient random calls (#360)
49
+ - detect throws in production units (#361)
50
+ - detect prose in TypeScript comments (#362)
51
+ - detect global patches and stub answers in hooks (#363)
52
+ - detect floating versions and fetched tools (#364)
53
+ - ci: stable managed agents build, triage and review, invoked from issues and pull requests (#409)
54
+ - ci: review draft pull requests and hand review findings back to the builder (#428)
55
+ - ci: reviews run from main and post as rin-reviewer (#430)
56
+ - agents: triager weighs issues against ordinary use (#431)
57
+ - keep team records in their rule set's records folder (#390)
58
+ - record, prune and authorise on team rule set addresses (#408)
59
+ - hone upgrade converts a team rule set from its version 1 layout (#424)
60
+ - agent-detached label stops agent reviews and hand-backs on a pull request (#437)
61
+ - release: fold a stable release's pre-release changelog sections into one (#351) (#405)
62
+ - detect Vitest test call aliases (#385)
63
+ - detect debugger statements (#386)
64
+ - detect ambient browser dialogs in edition two (#388)
65
+ - detect conditional and todo tests in edition two (#389)
66
+ - detect exports from test files (#392)
67
+ - detect type declarations in test files (#393)
68
+ - detect empty error handlers (#394)
69
+ - detect built units called in place (#395)
70
+ - detect assertions outside test cases (#396)
71
+ - detect tests reading code or prose as text (#397)
72
+ - detect unread function parameters (#398)
73
+ - declare which files are tests with testFiles in hone.config.json (#434)
74
+ - the generated checks page shows each check's engines (#407)
75
+
76
+ ### Fixes
77
+
78
+ - record-debt refuses and names project when the projection is stale (#371)
79
+ - --repo refusal and help name hone.config.json, not disciplines.json (#370)
80
+ - upgrade proof counts the files it writes, mentions every version 1 file, and says what it compared (#373)
81
+ - ci: the agent job reads the session's list cost amount (#406)
82
+ - cap hook answer snippets at eighty characters (#401)
83
+ - detect Vitest environment stubs in edition two (#402)
84
+ - ci: the agent job streams session events through a file (#425)
85
+ - lead findings with their symptom and source (#378)
86
+ - explain the problem in walker test-body remedies (#381)
87
+ - report floating versions at their manifest declarations (#411)
88
+ - detect pnpx in workflow commands (#404)
89
+ - self-check: print the gate line as the run's only verdict (#419)
90
+ - treat workspace packages and subpath imports as own API in test-body logic (#427)
91
+ - share tracker reference parsing (#414)
92
+ - an answered finding line names the fix its finding line names (#426)
93
+ - records: record-debt new-file and left lines no longer ask for a reason of its own (#418)
94
+ - continue checks around nested Hone configurations (#384)
95
+
96
+ ### Other changes
97
+
98
+ - retire the output contract doc and the test that pins it to the code (#376)
99
+ - run and report version 2 checks by name (#358)
100
+ - Claude works an issue labelled claude or a comment mentioning @claude (#380)
101
+ - a Claude Managed Agent works an issue labelled claude (#400)
102
+ - record the applied agent definitions (#410)
103
+ - share TypeScript throw detection (#399)
104
+ - read team rule sets from the version 2 layout and refuse the version 1 layout by name (#383)
105
+ - share anchored walker snippets (#429)
106
+ - record the applied agent definitions (#432)
107
+ - assess debt forfeiture in Hone's own runs again (#438)
108
+
5
109
  ## 2.0.0-pre.3
6
110
 
7
111
  ### Fixes
package/MIGRATING.md CHANGED
@@ -228,10 +228,10 @@ To move:
228
228
  2. **Install the package** as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 says, including the two `hone:` scripts.
229
229
  3. **Repoint every command.** In scripts, CI and the pre-push hook, replace `node tools/discipline-core/core/check/check-command.ts --repo .` with `npm run --silent hone:check`, and `project-command.ts` with `npm run --silent hone:project`. Pass options after `--` with npm, as in `npm run --silent hone:check -- --base-revision origin/main`, and straight after the script name with pnpm, as in `pnpm run --silent hone:check --base-revision origin/main`. A hook or gate that reads the verdict line needs the warning in [ADOPTING.md](ADOPTING.md#5-run-the-check) step 5. Point agent instructions at `node_modules/@hailstails/hone/rules/`.
230
230
  4. **Repoint your own pieces and tests.** Nothing outside the package's public entries can be imported now:
231
- - A piece that imported types or `folderScope` from the copy, such as from `walker-piece.ts` or `source-scope.ts`, imports them from `@hailstails/hone/audit`.
232
- - A piece that read JSON with comments through the copy's `jsonc-parse.ts` calls TypeScript's own parser on the syntax API that `prepare` hands it: `syntaxApi.parseConfigFileTextToJson(file, text)` returns the parsed value as `config`, and sets `error` when it cannot parse the text. Do not import `jsonc-parser`: it is Hone's own dependency, not one the repository declares, so a strict package manager such as pnpm does not resolve it from a piece, and a piece imports only what [docs/extending.md](docs/extending.md#what-is-stable) lists.
231
+ - A piece that imported types or `folderScope` from the copy, such as from `walker-piece.ts` or `source-scope.ts`, imports them from `@hailstails/hone/walker`.
232
+ - A piece that read JSON with comments through the copy's `jsonc-parse.ts` calls TypeScript's own parser on the syntax API that `prepare` hands it: `syntaxApi.parseConfigFileTextToJson(file, text)` returns the parsed value as `config`, and sets `error` when it cannot parse the text. Do not import `jsonc-parser`: it is Hone's own dependency, not one the repository declares, so a strict package manager such as pnpm does not resolve it from a piece, and a piece imports only what [docs/extending.md](docs/extending.md) lists.
233
233
  - For a file it cannot parse, a piece returns `{ outcome: "failed", error: { kind: "file-unparseable", file, detail } }`. The check then stops with `load failure: runner-failed audit file-unparseable <file> <detail>` and exit `2`.
234
- - Case tests use `clauseConformanceOf` from `@hailstails/hone/testing`, as [docs/extending.md](docs/extending.md#test-a-piece) shows.
234
+ - Case tests use `checkConformanceOf` from `@hailstails/hone/testing`, naming the `ruleSet`, as [docs/extending.md](docs/extending.md) shows.
235
235
  - A test that called the copy's check or governance functions directly, such as `runCheck` or `applyGovernance`, has no entry to call: run the `hone check` command against a repository the test sets up, and assert on its report and exit code.
236
236
  5. **Remove the copy.** Delete `tools/discipline-core/`, its line in `.gitignore`, and its entry in `disciplines.json`'s `exclude`.
237
237
  6. **Re-project** if any clause is `eslint`: run `npm run --silent hone:project`. The projection now imports each piece by package name instead of by a path into `tools/discipline-core/`, so it changes once; commit it.
@@ -390,20 +390,20 @@ Nothing must be migrated. Selections, exception records and findings still use t
390
390
  1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 says, and run the check. A record whose debt is paid on a file that still exists now brings the `prune-debt` line to the end of `readFirst`.
391
391
  2. **Run the command it names,** then `npm run --silent hone:project` when any clause is `eslint`, and commit what they change.
392
392
  3. **Runners written outside Hone** may return `measured`, a list of `{ clause, file }` pairs, beside what they return now; [the mechanism guide](docs/adding-a-discipline-or-mechanism.md) says what a pair means. A runner that returns none has measured nothing, and its records on files that still exist stay for a person, as before.
393
- 4. **Audit pieces written outside Hone** must answer `skipped` from `prepareFile` for a file they do not judge. Any other answer now says the piece's clauses were measured on that file, so `prune-debt` may remove a record on it; [the audit piece guide](docs/extending.md#an-audit-piece) says so.
393
+ 4. **Audit pieces written outside Hone** must answer `skipped` from `prepareFile` for a file they do not judge. Any other answer now says the piece's clauses were measured on that file, so `prune-debt` may remove a record on it; [the audit piece guide](docs/extending.md) says so.
394
394
 
395
395
  ## 20. Moving from version 1 to version 2
396
396
 
397
- Version 2 keeps its settings in `hone.config.json`, its records in the `hone-records` folder and its native configuration in `hone.<engine>.mjs`, where version 1 kept them in `disciplines.json`, the exception records and `disciplines.<mechanism>.mjs`. `hone upgrade` moves a repository from one to the other in one run, and refuses, changing nothing, when it cannot show that version 2 reports what version 1 reported.
397
+ Version 2 keeps its settings in `hone.config.json`, its records in the `hone-records` folder and its native configuration in `hone.<engine>.mjs`, where version 1 kept them in `disciplines.json`, the exception records and `disciplines.<mechanism>.mjs`. `hone upgrade` moves a repository from one to the other in one run, and refuses, changing nothing, when version 2's check does not pass on the result. Version 2 is a major release, so its findings may differ from version 1's: the upgrade records the differences as debt.
398
398
 
399
- 1. **Install version 2 on a branch, with a clean working tree,** the way [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 installs a release, and **commit the install**, which changes the pin and the lock, so the working tree is clean before the upgrade. Then stop: run neither `hone:project` nor the check before the upgrade. With version 2 installed both still run version 1's code on a version 1 repository, because `disciplines.json` is what chooses the version, and version 1's `project` rewrites any `disciplines.eslint.mjs` it finds out of date, which leaves uncommitted changes under the upgrade; the upgrade runs version 1's check and `project` itself and refuses when `project` rewrites a file it had already measured. Whatever you run before the upgrade prints version 1's wording, such as `file carve-outs cannot be checked for decay`, so the version 2 lines quoted from step 4 on apply after the upgrade. The working tree is the only rollback: a refusal after files were written puts them back, and names any it could not put back, so you can restore them from version control.
399
+ 1. **Before installing version 2, get your 1.x check passing.** The upgrade records as debt whatever version 2 then finds. **Then install version 2 on a branch, with a clean working tree,** the way [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 installs a release, and **commit the install**, which changes the pin and the lock, so the working tree is clean before the upgrade. Run neither `hone:project` nor the check before the upgrade: on a version 1 repository version 2's commands stop with `upgrade-needed`. The upgrade runs version 1's `project` itself, and refuses when that rewrites a file it had already measured. The working tree is the only rollback: a refusal after files were written puts them back, and names any it could not put back, so you can restore them from version control.
400
400
  2. **Run it:**
401
401
 
402
402
  ```bash
403
403
  node_modules/.bin/hone upgrade --repo .
404
404
  ```
405
405
 
406
- It runs version 1 over your repository, plans the version 2 files, writes them, runs version 2 and compares the two runs. A version 1 `reportOutput` of `failures-only` is written as `actionable`, its version 2 name, and `--report-output failures-only` is refused on a version 2 repository. Only when they agree does it remove the version 1 files. If they do not, it changes nothing. Each refusal states whether anything was changed, and lists any file it could not put back; [the output contract](docs/output-contract.md#hone-upgrade) lists every refusal.
406
+ It writes the version 2 files, removes the records it carried that answer nothing, runs `record-debt`, `prune-debt` and `project`, then runs version 2's check. A version 1 `reportOutput` of `failures-only` is written as `actionable`, its version 2 name, and `--report-output failures-only` is refused on a version 2 repository. Only when version 2's check passes does it remove the version 1 files. If it fails, the upgrade puts everything back and prints the failing lines. Each refusal states whether anything was changed, and lists any file it could not put back.
407
407
  3. **Commit** what the upgrade wrote and removed, as its own commit after the install: the version 2 files together with the removal of the version 1 files, `git add .`, then your commit. That includes each `hone.eslint.d.mts`, which the check compares with what `hone project` writes and reports under `projection-problems` when it is missing or out of date.
408
408
 
409
409
  After the upgrade, `hone split-records` does not run on version 2 files, and the records stay in `hone-records`. Before it, version 1's `hone authorise` stops and sends you here.
@@ -411,11 +411,11 @@ Version 2 keeps its settings in `hone.config.json`, its records in the `hone-rec
411
411
 
412
412
  ### What the upgrade prints
413
413
 
414
- It exits `0` on success, listing each file it wrote, rewrote or removed: commit them all. It exits `1` on a refusal, and each refusal line says what to do: do it, then run the upgrade again. A refusal says whether anything was changed, and lists any file it could not put back. A line that asks you to report a fault at the issues page is the tool's fault, not your repository's: send the output. It exits `3` when version 2 is in place but some version 1 files could not be removed: delete the files it lists by hand, then commit. [docs/output-contract.md](docs/output-contract.md) lists every line.
414
+ It exits `0` on success, listing each file it wrote, rewrote or removed: commit them all. It exits `1` on a refusal, and each refusal line says what to do: do it, then run the upgrade again. A refusal says whether anything was changed, and lists any file it could not put back. A line that asks you to report a fault at the issues page is the tool's fault, not your repository's: send the output. It exits `3` when version 2 is in place but some version 1 files could not be removed: delete the files it lists by hand, then commit.
415
415
 
416
416
  ### Your records, and what the check judges
417
417
 
418
- A file carve-out that version 1 held with a `provenance`, as `hone record-debt` writes, or with a `whyChain`, and every authorised location move to `hone-records` word for word, under a `carried` key. These are the carried records. A location is filed at the check or checks that the findings it answers sit at, so one for a clause bound to the audit mechanism lands under the symptom those findings belong to, such as `hone-records/authorised-locations/claimed-type.json`, not under its clause. A file carve-out with neither moves as a debt record with the `reason` as its `note`, and so does one that held up an inline disable or a TypeScript directive and exempted no finding, once for each check the suppression reaches.
418
+ A file carve-out that version 1 held with a `provenance`, as `hone record-debt` writes, or with a `whyChain`, and every authorised location move to `hone-records` word for word, under a `carried` key. These are the carried records. A location is filed at the check or checks that the findings it answers sit at, so one for a clause bound to the audit mechanism lands under the symptom those findings belong to, such as `hone-records/authorised-locations/claimed-type.json`, not under its clause. A `CD-19` location becomes one record for each package in its `confinedPackages`, plus one for `node:` modules, as version 1 confined them, and the upgrade removes the ones that answer nothing. A file carve-out with neither moves as a debt record with the `reason` as its `note`, and so does one that held up an inline disable or a TypeScript directive and exempted no finding, once for each check the suppression reaches.
419
419
 
420
420
  The check lists the carried records under `carried`, one line each, `<records file> records[<index>] <standing>`, followed by `lacks` and the keys it lacks when the record lacks any. A carried authorised location lacks `case`, `owes` and `whyChain`, which version 1 did not hold, and its line says so. With a base revision, it judges each one: it is `established` when the base revision held that record unchanged, whether as a version 1 entry or as a version 2 record, so a base from before the upgrade works. A carried record changed since the base is refused as `carried-changed-since-base`, so leave carried records as they are. Without a base revision the standing is `unjudged`: under `"forfeiture": "this-run"`, the default, the run fails with `import-unmeasured no-base-revision`, so every run needs `--base-revision`, local runs and hooks included; under `"forfeiture": "elsewhere"` it prints `carried standing elsewhere` and leaves them to the run that has a base. Version 2 names each finding by its check, such as `authored-class-or-this#class-keyword`, where version 1 named it by its clause, such as `CD-14#class-syntax`.
421
421
 
@@ -436,3 +436,12 @@ A repository with package slices, one `disciplines.eslint.mjs` in each package f
436
436
  After version 1's run, the upgrade runs version 1's own `project` once, to learn which slices exist. A slice that no config root owns any more is removed by it. A refusal after that lists it under `version 1's own project removed these files, and the upgrade does not put them back; restore them from version control:`, since the upgrade did not write it.
437
437
 
438
438
  Each refusal an ESLint repository meets names the config or projection and what to do, as every other refusal does.
439
+
440
+ ### A team rule set
441
+
442
+ A team rule set still in version 1's layout, `rules/<ID>/discipline.json` beside `mechanisms/`, is converted by the same run. Before it, do these by hand, in a commit of their own:
443
+
444
+ 1. **Name and define what version 2 needs.** Names and definitions are your team's judgement, so the upgrade asks for them rather than writing its own: write `version-two-names.json` at the rule set's root. `clauses` gives each mechanical clause a check of its own, not one of Hone's, and a title, such as `"ACME-1#console-calls": { "check": "direct-console#console-calls", "title": "Console calls" }`. `symptoms`, `cases`, `principles` and `rules` define each symptom those checks see, and what each symptom points at, with the same facts as their items in [docs/extending.md](docs/extending.md); a symptom's `seen` is taken from its clauses' summaries. Anything missing refuses the upgrade, and the refusal lists every entry to add.
445
+ 2. **Update the pieces to version 2's piece API,** which [docs/extending.md](docs/extending.md) describes: a walker piece reads `bindings` and reports at `binding.address` where it read clauses, it imports from `@hailstails/hone/walker`, and its tests use `@hailstails/hone/testing`. The upgrade runs the pieces in version 2's check, so they must run under version 2 first.
446
+
447
+ The upgrade writes the definitions, symptoms and checks under the rule set's `rules/` folder and each clause's cases as its check's examples, moves each piece's folder to `engines/<engine>/<symptom>/<check>/`, and removes the version 1 files and the names file. An authorised location on a moved piece becomes debt, for you to re-authorise at its new path. A folder that several clauses share is split: each clause's module and its test go to that clause's check, and the other files go once to the check of the clause first by name. Each moved file's relative imports, `require` calls and test-double module paths are rewritten for where it now sits. The upgrade refuses a folder whose one module serves several clauses, and an import or module path written as an expression rather than a string; give each clause a module of its own, or write the path as a string, first. The rule set takes Hone's record kinds, and its records land under `hone-records/<rule set>/`. An upgrade that stopped part way leaves version 1 discipline files beside version 2 items, and a second `hone upgrade` refuses that rule set until they are removed or it is restored.
package/README.md CHANGED
@@ -21,14 +21,12 @@ Two engines ship: `walker`, a standalone TypeScript syntax walker, and `eslint`,
21
21
 
22
22
  To adopt Hone in another repository, follow [ADOPTING.md](ADOPTING.md) step by step. A repository already using the older standalone route, or a copy of Hone's source, follows [MIGRATING.md](MIGRATING.md) instead.
23
23
 
24
- A team adds its own disciplines as a rule set in its own repository, with ESLint and audit pieces, following [docs/extending.md](docs/extending.md). Adding a discipline or a mechanism to Hone itself, and the full list of ESLint native channels, are covered in [docs/adding-a-discipline-or-mechanism.md](docs/adding-a-discipline-or-mechanism.md).
24
+ A team adds its own symptoms and checks as a rule set in its own repository, with ESLint and walker pieces, following [docs/extending.md](docs/extending.md). Adding a symptom, check or engine to Hone itself, and the full list of ESLint native channels, are covered in [docs/adding-a-discipline-or-mechanism.md](docs/adding-a-discipline-or-mechanism.md).
25
25
 
26
26
  ## Commands
27
27
 
28
28
  The package ships one command, `hone`. `check` and `project` run through a `package.json` script as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) shows; `record-debt` runs once, when a repository adopts Hone; `prune-debt` runs when the check names it, to remove the records of debt that is paid; `authorise` writes one authorised location; `upgrade` runs once, to move a version 1 repository to version 2, as [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 shows. `hone --help` lists the commands, and `hone <command> --help` gives each one's options and exit codes.
29
29
 
30
- [docs/output-contract.md](docs/output-contract.md) lists every line `hone` prints, the exit codes, the report's sections and which parts are stable for hooks, CI and agents to rely on.
31
-
32
30
  `hone check` loads the repository's `hone.config.json`, the symptom catalogue and the records in `hone-records`; works out which files changed since `--base-revision`; runs each engine its listed checks name once over the repository's tracked files; answers each finding by the records; and prints one report ending in its verdict. The verdict and exit code always come from the whole report, whatever `--report-output` or `reportOutput` print.
33
31
 
34
32
  Without `--base-revision`, Hone cannot tell which files were touched, so debt cannot be forfeited and records carried from version 1 cannot be compared with the base; the report says so and the run fails. `--forfeiture elsewhere`, or `"forfeiture": "elsewhere"` in `hone.config.json`, leaves debt forfeiture to another run, such as a pre-push hook given a base revision; that run's report says what it left, and its verdict is a partial assessment.
@@ -41,10 +39,10 @@ Without `--base-revision`, Hone cannot tell which files were touched, so debt ca
41
39
 
42
40
  Give it the base that the run assessing forfeiture is given, such as `origin/main` for a branch: a record for a file changed since that base is forfeited by that run, so the command writes none for such a file and says so, and a check against a later revision, such as `HEAD`, would not show it.
43
41
 
44
- It never writes anything that needs an owner's reason: no authorised location, no boundary record, no deviation, no dependency record and no setting. It prints one line per finding and per native exception under `unrecorded`, and writes nothing for:
42
+ It never writes anything that needs an owner's reason: no authorised location, no deviation, no dependency record and no setting. It prints one line per finding and per native exception under `unrecorded`, and writes nothing for:
45
43
 
46
44
  - a symptom and file that already hold debt;
47
- - a file under a `--leave` path. `--leave` takes an exact file or folder, as `exclude` does, and may be given once for each path. It names the deliberate, permanent exceptions, which a person records as an authorised location with its own reason;
45
+ - a file under a `--leave` path. `--leave` takes an exact file or folder, as `exclude` does, and may be given once for each path. It names the deliberate, permanent exceptions, which a person records as an authorised location with a why chain;
48
46
  - a file this change created or changed, when the run assesses forfeiture, since a finding there is the change's own breach: fix it there. With `forfeiture` set to `elsewhere` the check forfeits nothing, so the command writes debt on such a file like any other;
49
47
  - a finding the catalogue gives no symptom or check to record against, such as one of a team rule set's clauses;
50
48
  - a native exception no debt record can hold. A `config-override` is never recorded, since debt holds what is owed and an override on a clean file owes nothing: a file under it that breaks the check gets its debt from the finding, because Hone's own run does not read the override, so remove the override or narrow it. An `ignore` and a `suppression-entry` hide nothing from Hone's run, which has already recorded what it finds in the file, so remove them; a generated or vendored file under an `ignore` can instead be listed in `exclude`, which Hone's run then honours too, so no `ignore` line is printed for it. An inline rule configuration changes what the rule checks: remove the comment. A lint-script option gets the advice for why Hone could not judge it, the same as its `unrecorded` line.
@@ -90,7 +88,7 @@ import hone from "./hone.eslint.mjs";
90
88
  export default [{ files: ["**/*.{ts,tsx,mts,cts}"] }, ...hone];
91
89
  ```
92
90
 
93
- A package with no `eslint.config.*` of its own is linted by the nearest config above it, so its records stay in that config's slice. A file is governed by the deepest config root that contains it. A folder holding its own `hone.config.json` is a nested Hone configuration, which is not supported yet ([#72](https://github.com/HailsTails/hone/issues/72)): when the ESLint engine would check a file under it, `check` and `project` stop before anything is checked or written, while a run that lists only walker checks does not stop. A folder holding one and no file the run would check gets no slice, and nor does anything under it. Either fix works today: run the folder on its own with `--repo`, as the line says, or govern it from this repository by removing its `hone.config.json` and keeping its records here, after which `hone project` writes its slice.
91
+ A package with no `eslint.config.*` of its own is linted by the nearest config above it, so its records stay in that config's slice. A file is governed by the deepest config root that contains it. When a folder holds its own `hone.config.json`, `check` and `project` continue. Hone skips projection slices in that folder and names it when it keeps the parent projection out of effect.
94
92
 
95
93
  A config root keeps its slice even where a config above it ignores its folder: a lint run from that folder loads its own config and never reads the ignores above it, so `hone project` writes the same slices from the same inputs every time. A repository with only a root config gets exactly the projection it had before.
96
94
 
@@ -127,6 +125,7 @@ At the repository root. It lists the checks the repository runs and the engine t
127
125
  - `checkEditions`, optional, is `"pinned"` (the default) or `"latest"`. A check that has been tightened has more than one edition, listed on its check page. `"pinned"` runs each check's default edition, which changes only in a major release; `"latest"` runs the newest edition the installed Hone has for every listed check, so a minor release can add findings. `"edition"` in a check's `checkSettings` holds that one check to the edition it names over either. The report lists the edition each such check ran under `editions`.
128
126
  - `checkSettings`, optional, maps a listed check address to an object of that check's settings, for a check whose page lists settings. Each key must be one the check's piece declares, and its value must be the same JSON kind as the declared default and, where the piece lists choices, one of them; the value replaces the default. Anything else makes `hone.config.json` malformed, naming the check, the key and what is accepted.
129
127
  - `exclude`, optional, lists repository folders or exact files that no engine checks. A folder entry covers everything under it. Globs are refused: an entry containing `*` makes `hone.config.json` malformed. The report lists the active entries under `excluded`. Exclude Hone's own install when it is vendored inside the repository.
128
+ - `testFiles`, optional, says which files are tests: `{ "suffixes": ["test", "spec"], "folders": [] }` by default. A file is a test when the name part before its extension is one of `suffixes`, such as `order.spec.ts`, or when it sits under a folder named in `folders`, such as `__tests__`.
130
129
  - `generated` and `layers`, optional, are declared for checks that will read them; no check reads either yet, and the report says so under `settings-notes`.
131
130
 
132
131
  The keys version 1's `disciplines.json` used under other names are refused, each naming what replaces it: `clauses` is `checks`, `clauseSettings` is `checkSettings`, `assessment` is `forfeiture`, and `fileExceptionWhyChains` is gone, since every record shows its why-chain. [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 lists what moved.
@@ -136,9 +135,8 @@ The keys version 1's `disciplines.json` used under other names are refused, each
136
135
  A folder at the repository root; without it, no record answers any finding. It holds the records that answer findings, one file for each kind and symptom or recipe, each a document `{ "version": 2, "records": [...] }`. A file in the wrong folder or under a name that is not a catalogue name is refused, naming where each record belongs. Each record names what it reaches by the symptom's name, or by `<symptom>#<check>` to reach one check of it. [rules/records.md](rules/records.md) says what each kind is for.
137
136
 
138
137
  - **Debt** is in `hone-records/debt/<symptom>.json`: `answers`, `file` and an optional `note`, a note to future developers on what the debt signals, which nothing reads. It says a finding in one file is owed. It needs no case and no why-chain; forfeiture is what holds it: it is forfeited once its file is touched.
139
- - **An authorised location** is in `hone-records/authorised-locations/<symptom>.json`: `answers`, `file`, `case` and `owes`, naming the case the file is and the principle it owes, and a `whyChain`. It says the symptom is correct in that file. [`hone authorise`](#commands) writes one from the arguments it is given.
138
+ - **An authorised location** is in `hone-records/authorised-locations/<symptom>.json`: `answers` as `<symptom>#<check>`, `file`, `case` and `owes`, naming the case the file is and the principle it owes, and a `whyChain`. It says the check's finding is correct in that file. A symptom whose authorised-location correct use binds an outside party, such as Outside import past a boundary, also takes `outsideParty`: a package's name or a module such as `node:fs`, and the record answers only that party's imports. A symptom with no authorised-location correct use takes none. [`hone authorise`](#commands) writes one from the arguments it is given.
140
139
  - **A deviation** is in `hone-records/deviations/<recipe>.json`: `recipe`, `file`, `recipeReason`, `reasonFails`, `evidence` and `ruleHolds`. It says why a file does not follow a recipe the catalogue gives.
141
- - **A boundary record** is in `hone-records/boundary-records.json`: `module`, `outsideParty` (a runtime facility such as `runtime:clock`, or an outside module's specifier), the `ports` the module declares and an optional `conformist`. It says the module is where an outside party is met.
142
140
  - **A dependency record** is in `hone-records/dependency-records.json`: `dependency`, `nativeWay`, `whyNotEnough` and an optional `peerRisk`. It says why a package is used where the platform's own way exists.
143
141
 
144
142
  An authorised location's `whyChain` follows the [why-chain contract](docs/why-chain-contract.md), which gives its shape, what Hone refuses and what review still judges.
@@ -157,15 +155,15 @@ With the ESLint mechanism selected, a packaged install's projection imports one
157
155
 
158
156
  ## Public type entries
159
157
 
160
- The package has three public entries for TypeScript. `@hailstails/hone/rule-set` holds types only, so importing it adds no code to a build; import it with `import type`. `@hailstails/hone/audit` adds three values to its types, and `@hailstails/hone/testing` is for a team's own tests.
158
+ The package has three public entries for TypeScript. No other path in the package is a public TypeScript entry.
161
159
 
162
160
  | Entry | Status | What it is for |
163
161
  | --- | --- | --- |
164
- | `@hailstails/hone/rule-set` | Stable | The shapes of `discipline.json`, `piece.json` and an ESLint piece's `settings`, for a team writing its own rule set. Identifiers and paths are plain strings: Hone checks them when it reads the files. |
165
- | `@hailstails/hone/audit` | Experimental | The types for writing an audit walker piece, `WalkerPiece` and what it needs, including `PieceFailure`, the failures a piece may return. Clause addresses and file paths reach a piece from Hone, already checked, and a piece passes them back unchanged. Its three values are `folderScope`, which tells a piece whether a file sits in a generated folder; `isEdition`, which narrows a text such as `"2"` to an `Edition`; and `editionReaches`, which tells a piece whether the edition that runs covers something introduced in a given edition. It may change in a minor release. |
166
- | `@hailstails/hone/testing` | Experimental | Runs a team audit clause's `cases` through its piece with the installed audit runner (`clauseConformanceOf`), and hands a test the clause bound as `hone check` binds it (`clauseUnderTestOf`) and a checked file path (`repoPathOf`). Hone does not run these tests itself. It may change in a minor release. |
162
+ | `@hailstails/hone/rule-set` | Stable | Types only, for the files a team writes in its own rule set. |
163
+ | `@hailstails/hone/walker` | Experimental, may change in a minor release | Writing a walker piece. It names TypeScript's syntax types, so it needs the repository's `typescript` peer. |
164
+ | `@hailstails/hone/testing` | Experimental, may change in a minor release | Running a team's checks against their own examples in the team's tests. |
167
165
 
168
- Each resolves with `moduleResolution` `"nodenext"` or `"bundler"`. `install-proof` type-checks a team piece and rule set against them, and checks that a wrongly typed field fails: on TypeScript 4.8.4 from an ES module with `"nodenext"` (4.8 has no `"bundler"`), and on 6.0.3 from an ES module with both and from a CommonJS file. A CommonJS file (`.cts`, or `.ts` in a package that is not `"type": "module"`) can import these types on TypeScript 5.8 or later with `module` `"nodenext"`. With `module` `"node16"`, and on TypeScript 5.3 to 5.7, the import needs `with { "resolution-mode": "import" }`, and older versions reject it. These CommonJS figures were checked once by hand, on 5.8.2, 5.3.3 and 6.0.3 with `"node16"`; `install-proof` checks only the 6.0.3 CommonJS case with `"nodenext"`. `@hailstails/hone/audit` names TypeScript's own syntax types, so it needs the `typescript` the repository already installs as a peer. No other path in the package is a public TypeScript entry.
166
+ `install-proof` type-checks the `acme` team rule set against these entries, and checks that a wrongly typed field fails, on TypeScript 4.8.4 from an ES module with `moduleResolution` `"nodenext"`, and on 6.0.3 from an ES module with `"nodenext"` and `"bundler"` and from a CommonJS file with `"nodenext"`. It also runs acme's examples through `@hailstails/hone/testing`.
169
167
 
170
168
  ## Runtime
171
169
 
@@ -188,8 +186,8 @@ Hone's version numbers follow semantic versioning under these rules:
188
186
  - A new or tightened check ships off by default in a minor release and becomes a default only in a major release. A new check arrives as a new check of a symptom, which a repository adopts by listing it. A tightened check arrives as a new edition of the check, which runs only for a repository that sets `checkEditions` to `"latest"` or names the edition in the check's `checkSettings`; a major release makes it the default edition and may retire older ones.
189
187
  - A change to the ESLint config that `hone project` generates, which an adopter must regenerate, is a minor release, with a clear message telling the adopter to regenerate: its changelog entry says to run `hone project` and commit the result, and until then the check reports the projection `out-of-date`.
190
188
  - Renaming or removing a check address, a config key in `hone.config.json`, a records file or a key of a record, or a CLI flag, or changing what one means, is a major release. Adding one with a safe default is not.
191
- - A change to what [the output contract](docs/output-contract.md) says a tool can parse is a major release: the command and option names, the exit codes and streams, the report's sections, outputs and verdict lines, the load failure kinds, and each line's leading fields up to its first value that may hold a space. What it marks not stable, such as the help text, the wording of `arguments-invalid` and `readFirst` lines and the repair text after a load failure's values, may change in a minor release, and a minor release may add a section, a kind of line or an option.
192
- - A breaking change to a type in `@hailstails/hone/rule-set` is a major release. `@hailstails/hone/audit` is experimental: its types may change in a minor release until it is marked stable.
189
+ - A change that breaks a tool parsing hone's output is a major release: the command and option names, the exit codes, the report's section names and its verdict lines. A change to the help text or to the wording of a message is a minor release.
190
+ - A breaking change to a type in `@hailstails/hone/rule-set` is a major release. `@hailstails/hone/walker` and `@hailstails/hone/testing` are experimental: they may change in a minor release until they are marked stable.
193
191
  - A pre-release previews the release it is numbered towards and is published under the `next` dist-tag. A change no larger than the one a pre-release is numbered towards lands in that release's next pre-release; a larger one starts the line of the larger version it calls for. The changelog lists each change either way.
194
192
 
195
193
  `hone.config.json` and the records in `hone-records` follow the same rules. A new key with a safe default, where nothing changes for an adopter who does not set it, is not breaking and can arrive in a minor release. A new required key with no safe default is breaking, and so is a change that makes a file that loads today stop loading or mean something else; both wait for a major release.
@@ -242,7 +240,7 @@ This repository is self-contained: it holds its own configuration and its own lo
242
240
 
243
241
  Hone checks itself with its own `hone.config.json` and the records in `hone-records/`. The consumer folders `install-proof` copies out are excluded, since they are other repositories checked by their own Hone run.
244
242
 
245
- `self-check` prints Hone's full report on itself, then one `self-check:` line. It fails when the selection, the records or the projection are not sound, and not on findings, which it prints and counts. CI runs it on every change with the pull request's base, or the previous `main`, as the base revision.
243
+ `self-check` prints Hone's full report on itself, then one `self-check:` line. It fails when any failing section of the report holds an entry, findings and unrecorded native exceptions included. CI runs it on every change with the pull request's base, or the previous `main`, as the base revision.
246
244
 
247
245
  Continuous integration runs on every pull request, drafts included, and on every push to `main`, from `pnpm-lock.yaml` alone, in two jobs, both required checks. They run side by side on the oldest claimed Node. Linux runs `check`, `self-check` and `package-determinism`, packs as the release does, and proves the tarball installs on a newer Node. Windows packs and proves its own tarball. A third job fails when the two tarballs differ. macOS is not proven in CI. A separate workflow, `pull-request-title.yml`, runs `pull-request-title` on each pull request's title whenever the pull request is opened, edited, reopened, marked ready or pushed to.
248
246
 
@@ -259,7 +257,7 @@ To prepare a release, create a new branch at the tip of `main` and run `pnpm run
259
257
 
260
258
  The first stable release is made the same way. The `0.1.0` pre-release line holds breaking changes, so on the branch for that release `pnpm run release-pull-request stable` finishes the line with major version 1, minor and patch 0, and every release after it follows the rules above.
261
259
 
262
- It then writes a section for that version at the top of `CHANGELOG.md`, grouping the subjects under Breaking changes, Features, Fixes and Other changes, and sets `version` in `package.json`. It refuses, changing nothing, when no subject follows the latest tag, when a merge commit follows the latest tag or the tag it sizes from, when `package.json` is not at the tag's version, or when the changelog already has the new version. A subject that is not a Conventional Commits subject is named on standard error and counted as a patch under Other changes, or as a major under Breaking changes when its message has a breaking footer, so check its place before opening the pull request. If writing the second file fails, it restores the first. The script only edits those two files: it never commits, tags, pushes or publishes. Open the release pull request with the title `chore(release): <version>`. Merging it is the release: no tag is pushed by hand and nothing is run after the merge. `.github/CODEOWNERS` makes the owner, `@HailsTails`, the code owner of `package.json`, `CHANGELOG.md`, `.github/workflows/`, `.github/CODEOWNERS` itself, the `scripts/release-*` scripts, `scripts/published-manifest.ts`, which writes the published `package.json`, `core/values/tool-identity.ts`, which names the package and its repository, and `pnpm-workspace.yaml`, which holds the `minimumReleaseAge` the release job installs under, so a release pull request, or any change to how a release is made, needs her code-owner approval before it can merge. That also covers every change to `package.json`, dependency updates included, since the version a release is triggered by lives there.
260
+ It then writes a section for that version at the top of `CHANGELOG.md`, grouping the subjects under Breaking changes, Features, Fixes and Other changes, and sets `version` in `package.json`. A stable release folds every pre-release section above the newest stable section into its one section, keeping each entry's group, and leaves no pre-release heading. A folded entry is dropped when a later entry names the same pull request, `(#N)`; the new subjects are all kept. It refuses, changing nothing, when no subject follows the latest tag, when a merge commit follows the latest tag or the tag it sizes from, when `package.json` is not at the tag's version, when the changelog already has the new version, or when a section to fold has a group other than those four or a line that is neither a group heading nor an entry. A subject that is not a Conventional Commits subject is named on standard error and counted as a patch under Other changes, or as a major under Breaking changes when its message has a breaking footer, so check its place before opening the pull request. If writing the second file fails, it restores the first. The script only edits those two files: it never commits, tags, pushes or publishes. Open the release pull request with the title `chore(release): <version>`. Merging it is the release: no tag is pushed by hand and nothing is run after the merge. `.github/CODEOWNERS` makes the owner, `@HailsTails`, the code owner of `package.json`, `CHANGELOG.md`, `.github/workflows/`, `.github/CODEOWNERS` itself, the `scripts/release-*` scripts, `scripts/published-manifest.ts`, which writes the published `package.json`, `core/values/tool-identity.ts`, which names the package and its repository, and `pnpm-workspace.yaml`, which holds the `minimumReleaseAge` the release job installs under, so a release pull request, or any change to how a release is made, needs her code-owner approval before it can merge. That also covers every change to `package.json`, dependency updates included, since the version a release is triggered by lives there.
263
261
 
264
262
  `CHANGELOG.md` names versions, so it stays in the repository and out of the package; the shipped pages link to it on GitHub.
265
263
 
@@ -0,0 +1,38 @@
1
+ import {
2
+ withoutParentheses
3
+ } from "./chunk-EBX57Z3V.js";
4
+
5
+ // src/infrastructure/engines/walker/runner/pieces/syntax-callee-root.ts
6
+ var calleeRootOf = (request) => {
7
+ const { syntaxApi } = request;
8
+ const node = withoutParentheses(request);
9
+ if (syntaxApi.isIdentifier(node)) return node;
10
+ if (syntaxApi.isTaggedTemplateExpression(node))
11
+ return calleeRootOf({ syntaxApi, node: node.tag });
12
+ if (syntaxApi.isPropertyAccessExpression(node) || syntaxApi.isElementAccessExpression(node) || syntaxApi.isCallExpression(node) || syntaxApi.isNonNullExpression(node))
13
+ return calleeRootOf({ syntaxApi, node: node.expression });
14
+ return void 0;
15
+ };
16
+
17
+ // src/infrastructure/engines/walker/runner/pieces/vitest-import.ts
18
+ var valueImportFromVitest = ({ syntaxApi, node }) => {
19
+ if (syntaxApi.isImportDeclaration(node)) {
20
+ return syntaxApi.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === "vitest" && node.importClause?.isTypeOnly !== true;
21
+ }
22
+ if (node.parent === void 0 || syntaxApi.isSourceFile(node)) return false;
23
+ return valueImportFromVitest({ syntaxApi, node: node.parent });
24
+ };
25
+ var vitestImportedNameOf = (request) => {
26
+ const { syntaxApi, node } = request;
27
+ if (syntaxApi.isImportSpecifier(node))
28
+ return !node.isTypeOnly && valueImportFromVitest(request) ? (node.propertyName ?? node.name).text : void 0;
29
+ if (syntaxApi.isNamespaceImport(node)) return valueImportFromVitest(request) ? "*" : void 0;
30
+ if (syntaxApi.isImportClause(node))
31
+ return node.name !== void 0 && valueImportFromVitest(request) ? "default" : void 0;
32
+ return void 0;
33
+ };
34
+
35
+ export {
36
+ calleeRootOf,
37
+ vitestImportedNameOf
38
+ };