@hailstails/hone 1.5.0 → 2.0.0-pre.2

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 (608) hide show
  1. package/ADOPTING.md +104 -199
  2. package/CHANGELOG.md +138 -0
  3. package/MIGRATING.md +92 -47
  4. package/README.md +95 -244
  5. package/chunks/chunk-5HRMJ4O2.js +608 -0
  6. package/chunks/chunk-5U4JMWNV.js +9 -0
  7. package/chunks/{chunk-2O46EB4E.js → chunk-ASUN4AVC.js} +25 -12
  8. package/chunks/chunk-DGOLOS5A.js +9 -0
  9. package/chunks/{chunk-HJA4CX7C.js → chunk-FBZBSDED.js} +1 -1
  10. package/chunks/{chunk-Y2KPZDDV.js → chunk-GNOMK7CR.js} +201 -98
  11. package/chunks/chunk-IX2VZTBO.js +887 -0
  12. package/chunks/{chunk-QWA6OVLC.js → chunk-K2W3D3NB.js} +8 -2
  13. package/chunks/chunk-L7BGRC6D.js +22 -0
  14. package/chunks/chunk-M6SOGWT7.js +82 -0
  15. package/chunks/chunk-MWLBA4B3.js +849 -0
  16. package/chunks/chunk-NRIQD3PI.js +38 -0
  17. package/chunks/chunk-OKLYWD2Z.js +823 -0
  18. package/chunks/{chunk-3HFJHJDO.js → chunk-QP5TLOBY.js} +17 -8
  19. package/chunks/chunk-R75QELTA.js +481 -0
  20. package/chunks/chunk-RANAKCTW.js +31 -0
  21. package/chunks/{chunk-NA5L6PUE.js → chunk-RANIXNWY.js} +1 -2
  22. package/chunks/chunk-RFR3ITBS.js +9 -0
  23. package/chunks/{chunk-Z4UBS7WI.js → chunk-RGSHTPLA.js} +26 -7
  24. package/chunks/{chunk-T32FOWZA.js → chunk-TNY2PASL.js} +14 -18
  25. package/chunks/{chunk-Y4SMWOD2.js → chunk-UJONWHA4.js} +2 -2
  26. package/chunks/{chunk-WF3PPYRR.js → chunk-VYBO2Q65.js} +4 -2
  27. package/chunks/chunk-Z6JHBNDS.js +15 -0
  28. package/chunks/eslint-10-boundary-A4JIQ734.js +14 -0
  29. package/chunks/eslint-9-boundary-CL5DDBHX.js +34 -0
  30. package/docs/adding-a-discipline-or-mechanism.md +21 -19
  31. package/docs/extending.md +5 -5
  32. package/docs/output-contract.md +700 -14
  33. package/docs/why-chain-contract.md +6 -6
  34. package/methods/README.md +2 -2
  35. package/methods/assessment-template.md +1 -1
  36. package/methods/lenses/clean-architecture.md +19 -54
  37. package/methods/lenses/decomposition.md +7 -7
  38. package/methods/lenses/defended-on-intent.md +4 -4
  39. package/methods/lenses/di-discipline.md +8 -8
  40. package/methods/lenses/errors-as-data.md +6 -6
  41. package/methods/lenses/function-first.md +9 -9
  42. package/methods/lenses/naming.md +6 -6
  43. package/methods/lenses/test-discipline.md +8 -8
  44. package/methods/lenses/type-soundness.md +6 -6
  45. package/methods/lenses/zod-boundary.md +9 -9
  46. package/package.json +30 -28
  47. package/rules/README.md +268 -4
  48. package/rules/SPIRIT.md +1 -1
  49. package/rules/cases/a-value-is-one-of-several-kinds-or-states.md +20 -0
  50. package/rules/cases/an-adopter-is-not-handed-our-risk.md +17 -0
  51. package/rules/cases/an-operation-can-fail.md +20 -0
  52. package/rules/cases/builds-the-real-implementations.md +25 -0
  53. package/rules/cases/causes-an-effect.md +26 -0
  54. package/rules/cases/checks-a-value-that-may-be-one-of-several-outcomes.md +20 -0
  55. package/rules/cases/checks-conditions-before-its-work.md +20 -0
  56. package/rules/cases/coordinates-other-units.md +20 -0
  57. package/rules/cases/does-one-job.md +23 -0
  58. package/rules/cases/explains-something-in-prose.md +20 -0
  59. package/rules/cases/gives-a-value-its-type.md +26 -0
  60. package/rules/cases/gives-each-unit-its-test.md +20 -0
  61. package/rules/cases/keeps-state-or-settings-across-calls.md +20 -0
  62. package/rules/cases/makes-a-new-value-from-what-it-has.md +17 -0
  63. package/rules/cases/names-something.md +20 -0
  64. package/rules/cases/needs-the-current-time-a-random-value-a-new-id-or-an-outside-ordering.md +26 -0
  65. package/rules/cases/puts-code-in-a-file-or-folder.md +20 -0
  66. package/rules/cases/reads-data-from-outside.md +23 -0
  67. package/rules/cases/reuses-behaviour-from-another-unit-or-type.md +20 -0
  68. package/rules/cases/sends-data-out-of-the-program.md +20 -0
  69. package/rules/cases/sets-how-strictly-the-checker-works.md +14 -0
  70. package/rules/cases/ships-code-for-others.md +17 -0
  71. package/rules/cases/states-what-the-unit-gives-back-for-one-case-or-several.md +20 -0
  72. package/rules/cases/takes-an-outside-dependency.md +38 -0
  73. package/rules/cases/tests-across-units-or-against-a-real-system.md +20 -0
  74. package/rules/cases/uses-a-system-or-service-outside-the-program.md +29 -0
  75. package/rules/cases/uses-what-a-collaborator-gives-back.md +20 -0
  76. package/rules/cases/writes-basic-logic.md +17 -0
  77. package/rules/cases.md +36 -59
  78. package/rules/numbers.md +121 -121
  79. package/rules/principles/external-behaviour-sits-at-a-boundary.md +12 -0
  80. package/rules/principles/no-hidden-effects.md +17 -0
  81. package/rules/principles/no-leak-across-a-boundary.md +19 -0
  82. package/rules/principles/one-place-decides.md +12 -0
  83. package/rules/principles/our-code-reads-in-the-common-language.md +12 -0
  84. package/rules/principles/outside-risk-is-carried-on-purpose.md +13 -0
  85. package/rules/principles/tests-are-ours.md +12 -0
  86. package/rules/principles/the-type-checker-proves-it.md +12 -0
  87. package/rules/principles.md +50 -46
  88. package/rules/record-kinds/authorised-location.md +26 -0
  89. package/rules/record-kinds/boundary-record.md +9 -0
  90. package/rules/record-kinds/debt.md +23 -0
  91. package/rules/record-kinds/dependency-record.md +9 -0
  92. package/rules/record-kinds/deviation.md +9 -0
  93. package/rules/records.md +17 -30
  94. package/rules/rules/declared-not-asserted.md +16 -0
  95. package/rules/rules/doer-or-orchestrator.md +16 -0
  96. package/rules/rules/failures-are-values.md +15 -0
  97. package/rules/rules/fixed-versions.md +11 -0
  98. package/rules/rules/guard-first.md +14 -0
  99. package/rules/rules/handed-what-it-uses.md +16 -0
  100. package/rules/rules/kinds-are-named.md +16 -0
  101. package/rules/rules/one-reason-per-module.md +18 -0
  102. package/rules/rules/one-word-everywhere.md +19 -0
  103. package/rules/rules/outside-dependencies-justified.md +14 -0
  104. package/rules/rules/outside-dependencies-stay-at-boundaries.md +18 -0
  105. package/rules/rules/ports-declared-inside.md +22 -0
  106. package/rules/rules/shipped-risk-declared.md +11 -0
  107. package/rules/rules/straight-through-tests.md +15 -0
  108. package/rules/rules/tested-where-its-owned.md +20 -0
  109. package/rules/rules/tools-live-in-the-repo.md +11 -0
  110. package/rules/rules/upstream-stays-untouched.md +11 -0
  111. package/rules/rules/written-out-answers.md +17 -0
  112. package/rules/rules.md +117 -81
  113. package/rules/typescript/checks.md +1668 -202
  114. package/rules/typescript/recipes/adapter-per-outside-party.md +18 -0
  115. package/rules/typescript/recipes/assert-to-narrow.md +18 -0
  116. package/rules/typescript/recipes/bounded-context-generic.md +19 -0
  117. package/rules/typescript/recipes/closure-factory.md +20 -0
  118. package/rules/typescript/recipes/companion-test-file.md +18 -0
  119. package/rules/typescript/recipes/composed-orchestrator.md +18 -0
  120. package/rules/typescript/recipes/composition-root.md +18 -0
  121. package/rules/typescript/recipes/copy-never-write-in.md +18 -0
  122. package/rules/typescript/recipes/declared-not-bundled.md +17 -0
  123. package/rules/typescript/recipes/dependency-record.md +20 -0
  124. package/rules/typescript/recipes/domain-vocabulary-list.md +18 -0
  125. package/rules/typescript/recipes/entity-module.md +20 -0
  126. package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +18 -0
  127. package/rules/typescript/recipes/extension-outside-the-vendored-code.md +18 -0
  128. package/rules/typescript/recipes/failure-asserted-as-a-value.md +18 -0
  129. package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +20 -0
  130. package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +18 -0
  131. package/rules/typescript/recipes/functional-iteration.md +18 -0
  132. package/rules/typescript/recipes/guard-clauses.md +18 -0
  133. package/rules/typescript/recipes/integration-test-owns-its-scratch.md +18 -0
  134. package/rules/typescript/recipes/integration-test-suffix.md +18 -0
  135. package/rules/typescript/recipes/iteach-over-typed-rows.md +18 -0
  136. package/rules/typescript/recipes/map-out-at-the-adapter.md +18 -0
  137. package/rules/typescript/recipes/meaning-in-names-not-comments.md +22 -0
  138. package/rules/typescript/recipes/named-exported-type.md +18 -0
  139. package/rules/typescript/recipes/narrow-ports.md +18 -0
  140. package/rules/typescript/recipes/one-argument-object.md +19 -0
  141. package/rules/typescript/recipes/port-in-the-domain.md +19 -0
  142. package/rules/typescript/recipes/ports-in-the-argument.md +18 -0
  143. package/rules/typescript/recipes/repo-scripts-only.md +18 -0
  144. package/rules/typescript/recipes/result-union.md +22 -0
  145. package/rules/typescript/recipes/screaming-folders.md +20 -0
  146. package/rules/typescript/recipes/shared-strict-base-config.md +20 -0
  147. package/rules/typescript/recipes/stub-with-vifn.md +20 -0
  148. package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +18 -0
  149. package/rules/typescript/recipes/whole-words.md +18 -0
  150. package/rules/typescript/recipes/whole-written-out-expectation.md +18 -0
  151. package/rules/typescript/recipes/world-values-through-a-port.md +18 -0
  152. package/rules/typescript/recipes/zod-at-the-producers-adapter.md +19 -0
  153. package/rules/typescript/recipes.md +247 -218
  154. package/rules/typescript/symptoms/absence-standing-for-a-state.md +36 -0
  155. package/rules/typescript/symptoms/adapter-built-outside-the-root.md +30 -0
  156. package/rules/typescript/symptoms/ambient-randomness.md +36 -0
  157. package/rules/typescript/symptoms/answer-set-in-a-hook.md +45 -0
  158. package/rules/typescript/symptoms/authored-class-or-this/class-keyword.md +30 -0
  159. package/rules/typescript/symptoms/authored-class-or-this/static-members-only.md +18 -0
  160. package/rules/typescript/symptoms/authored-class-or-this.md +49 -0
  161. package/rules/typescript/symptoms/behaviour-tested-away-from-its-owner.md +44 -0
  162. package/rules/typescript/symptoms/boolean-in-a-signature/boolean-annotation.md +30 -0
  163. package/rules/typescript/symptoms/boolean-in-a-signature.md +43 -0
  164. package/rules/typescript/symptoms/branch-in-a-test/test-body.md +213 -0
  165. package/rules/typescript/symptoms/branch-in-a-test.md +48 -0
  166. package/rules/typescript/symptoms/bundled-dependency.md +28 -0
  167. package/rules/typescript/symptoms/catch-all-failure-kind.md +37 -0
  168. package/rules/typescript/symptoms/change-spread-across-modules.md +27 -0
  169. package/rules/typescript/symptoms/claimed-type/cast-to-any.md +29 -0
  170. package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +34 -0
  171. package/rules/typescript/symptoms/claimed-type/unlisted-cast-site.md +34 -0
  172. package/rules/typescript/symptoms/claimed-type.md +56 -0
  173. package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +144 -0
  174. package/rules/typescript/symptoms/computed-value-in-a-test.md +36 -0
  175. package/rules/typescript/symptoms/coverage-gate.md +27 -0
  176. package/rules/typescript/symptoms/date-used-directly/clock-sources.md +31 -0
  177. package/rules/typescript/symptoms/date-used-directly.md +46 -0
  178. package/rules/typescript/symptoms/default-for-a-required-value.md +45 -0
  179. package/rules/typescript/symptoms/default-on-a-closed-union/default-arm.md +32 -0
  180. package/rules/typescript/symptoms/default-on-a-closed-union.md +32 -0
  181. package/rules/typescript/symptoms/dependency-without-a-record.md +33 -0
  182. package/rules/typescript/symptoms/doer-calling-our-own-unit.md +36 -0
  183. package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +32 -0
  184. package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +31 -0
  185. package/rules/typescript/symptoms/double-with-a-body.md +55 -0
  186. package/rules/typescript/symptoms/drawer-path/drawer-names.md +28 -0
  187. package/rules/typescript/symptoms/drawer-path.md +32 -0
  188. package/rules/typescript/symptoms/duplicate-decision.md +36 -0
  189. package/rules/typescript/symptoms/edit-inside-vendored-code.md +33 -0
  190. package/rules/typescript/symptoms/failure-shaped-as-success.md +28 -0
  191. package/rules/typescript/symptoms/floating-version.md +27 -0
  192. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +30 -0
  193. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess.md +33 -0
  194. package/rules/typescript/symptoms/inner-layer-imports-outer.md +33 -0
  195. package/rules/typescript/symptoms/integration-heavy-suite.md +29 -0
  196. package/rules/typescript/symptoms/large-input-for-a-few-fields.md +37 -0
  197. package/rules/typescript/symptoms/library-class-built-in-place.md +42 -0
  198. package/rules/typescript/symptoms/long-function/function-length.md +47 -0
  199. package/rules/typescript/symptoms/long-function.md +75 -0
  200. package/rules/typescript/symptoms/loop-keyword/loop-statement.md +34 -0
  201. package/rules/typescript/symptoms/loop-keyword.md +49 -0
  202. package/rules/typescript/symptoms/machine-touched-in-a-unit-test.md +40 -0
  203. package/rules/typescript/symptoms/many-spellings-of-one-concept.md +29 -0
  204. package/rules/typescript/symptoms/module-level-state.md +30 -0
  205. package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +29 -0
  206. package/rules/typescript/symptoms/module-or-global-patched.md +38 -0
  207. package/rules/typescript/symptoms/name-off-its-casing/filename-case.md +16 -0
  208. package/rules/typescript/symptoms/name-off-its-casing/naming-convention.md +20 -0
  209. package/rules/typescript/symptoms/name-off-its-casing.md +31 -0
  210. package/rules/typescript/symptoms/no-lock-file.md +27 -0
  211. package/rules/typescript/symptoms/orchestrator-that-computes.md +27 -0
  212. package/rules/typescript/symptoms/outside-dependency-vocabulary-for-basic-logic.md +33 -0
  213. package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +44 -0
  214. package/rules/typescript/symptoms/outside-import-past-a-boundary.md +45 -0
  215. package/rules/typescript/symptoms/outside-type-in-a-signature.md +37 -0
  216. package/rules/typescript/symptoms/own-type-guard.md +36 -0
  217. package/rules/typescript/symptoms/port-named-for-a-mechanism.md +34 -0
  218. package/rules/typescript/symptoms/port-outside-the-domain.md +28 -0
  219. package/rules/typescript/symptoms/positional-parameters/parameter-count.md +30 -0
  220. package/rules/typescript/symptoms/positional-parameters.md +43 -0
  221. package/rules/typescript/symptoms/process-global-used-in-place.md +53 -0
  222. package/rules/typescript/symptoms/prose-in-code.md +27 -0
  223. package/rules/typescript/symptoms/rebinding/parameter-reassignment.md +18 -0
  224. package/rules/typescript/symptoms/rebinding/test-body.md +32 -0
  225. package/rules/typescript/symptoms/rebinding.md +36 -0
  226. package/rules/typescript/symptoms/schema-past-its-adapter.md +41 -0
  227. package/rules/typescript/symptoms/shorthand-name/identifier-names.md +29 -0
  228. package/rules/typescript/symptoms/shorthand-name.md +32 -0
  229. package/rules/typescript/symptoms/strictness-weakened/exact-optional-property-types.md +51 -0
  230. package/rules/typescript/symptoms/strictness-weakened/no-fallthrough-cases-in-switch.md +51 -0
  231. package/rules/typescript/symptoms/strictness-weakened/no-implicit-override.md +51 -0
  232. package/rules/typescript/symptoms/strictness-weakened/no-property-access-from-index-signature.md +51 -0
  233. package/rules/{CD-3/CHECKS.md → typescript/symptoms/strictness-weakened/no-unchecked-indexed-access.md} +23 -40
  234. package/rules/typescript/symptoms/strictness-weakened/strict.md +51 -0
  235. package/rules/typescript/symptoms/strictness-weakened/use-unknown-in-catch-variables.md +51 -0
  236. package/rules/typescript/symptoms/strictness-weakened.md +32 -0
  237. package/rules/typescript/symptoms/tangled-function/cognitive-complexity.md +42 -0
  238. package/rules/typescript/symptoms/tangled-function.md +75 -0
  239. package/rules/typescript/symptoms/test-of-the-type-checker.md +24 -0
  240. package/rules/typescript/symptoms/test-switched-off/focused-tests.md +15 -0
  241. package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +15 -0
  242. package/rules/typescript/symptoms/test-switched-off.md +25 -0
  243. package/rules/typescript/symptoms/text-past-its-reader/test-body.md +30 -0
  244. package/rules/typescript/symptoms/text-past-its-reader.md +71 -0
  245. package/rules/typescript/symptoms/throw-between-our-units.md +46 -0
  246. package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +32 -0
  247. package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +39 -0
  248. package/rules/typescript/symptoms/throw-or-catch-in-a-test.md +35 -0
  249. package/rules/typescript/symptoms/thrown-non-error/throw-only-error.md +15 -0
  250. package/rules/typescript/symptoms/thrown-non-error.md +27 -0
  251. package/rules/typescript/symptoms/tool-fetched-at-run-time.md +27 -0
  252. package/rules/typescript/symptoms/tuple-as-data.md +29 -0
  253. package/rules/typescript/symptoms/type-derived-from-code/factory-return-types.md +29 -0
  254. package/rules/typescript/symptoms/type-derived-from-code.md +41 -0
  255. package/rules/typescript/symptoms/types-only-file.md +36 -0
  256. package/rules/typescript/symptoms/unasserted-call.md +29 -0
  257. package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +28 -0
  258. package/rules/typescript/symptoms/unit-without-a-running-test.md +28 -0
  259. package/rules/{CD-5/CHECKS.md → typescript/symptoms/untracked-escape/directive-pointers.md} +12 -25
  260. package/rules/typescript/symptoms/untracked-escape.md +32 -0
  261. package/rules/typescript/symptoms/untyped-value/explicit-any.md +14 -0
  262. package/rules/typescript/symptoms/untyped-value/implicit-any-let.md +14 -0
  263. package/rules/typescript/symptoms/untyped-value.md +36 -0
  264. package/rules/typescript/symptoms/wide-input.md +37 -0
  265. package/rules/typescript/symptoms/wide-port.md +32 -0
  266. package/rules/typescript/symptoms/work-inside-a-condition/else-after-an-exit.md +40 -0
  267. package/rules/typescript/symptoms/work-inside-a-condition.md +41 -0
  268. package/rules/typescript/symptoms/write-into-a-parameter/parameter-mutation.md +33 -0
  269. package/rules/typescript/symptoms/write-into-a-parameter.md +34 -0
  270. package/rules/typescript/symptoms.md +623 -414
  271. package/{core → src/application}/conformance/conformance-testing-types.d.ts +16 -6
  272. package/src/audit.d.ts +20 -0
  273. package/{api → src}/audit.js +6 -5
  274. package/{core/rule-set-reader → src/domain/rule-set}/authored-rule-set-types.d.ts +2 -2
  275. package/{core/values → src/domain/rule-set}/edition-types.d.ts +3 -3
  276. package/{core/values → src/domain/rule-set}/identifier-types.d.ts +2 -2
  277. package/{core/conformance → src/domain/runner}/conformance-types.d.ts +1 -1
  278. package/{core/mechanism-port → src/domain/runner}/piece-failure-types.d.ts +1 -1
  279. package/{core/mechanism-port → src/domain/runner}/runner-module-types.d.ts +4 -4
  280. package/src/domain/runner/runner-result-types.d.ts +88 -0
  281. package/src/eslint-plugin.d.ts +16 -0
  282. package/src/eslint-plugin.js +72 -0
  283. package/src/hone.js +13563 -0
  284. package/src/infrastructure/disciplines-file/version-one-names.json +634 -0
  285. package/src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/class-keyword.examples.json +84 -0
  286. package/{mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js → src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/eslint-plugin.js} +9 -10
  287. package/src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/piece.json +12 -0
  288. package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +24 -0
  289. package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/static-members-only.examples.json +36 -0
  290. package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/eslint-plugin.js +16 -0
  291. package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/non-null-assertions.examples.json +48 -0
  292. package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/piece.json +22 -0
  293. package/src/infrastructure/engines/eslint/long-function/function-length/function-length.examples.json +42 -0
  294. package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +16 -0
  295. package/{mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js → src/infrastructure/engines/eslint/name-off-its-casing/filename-case/eslint-plugin.js} +5 -4
  296. package/src/infrastructure/engines/eslint/name-off-its-casing/filename-case/filename-case.examples.json +60 -0
  297. package/src/infrastructure/engines/eslint/name-off-its-casing/filename-case/piece.json +11 -0
  298. package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/eslint-plugin.js +16 -0
  299. package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/naming-convention.examples.json +78 -0
  300. package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/piece.json +214 -0
  301. package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/eslint-plugin.js +16 -0
  302. package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/parameter-count.examples.json +30 -0
  303. package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/piece.json +18 -0
  304. package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/eslint-plugin.js +16 -0
  305. package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/parameter-reassignment.examples.json +30 -0
  306. package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/piece.json +17 -0
  307. package/{mechanisms → src/infrastructure/engines}/eslint/runner/README.md +5 -5
  308. package/{mechanisms/eslint/runner → src/infrastructure/engines/eslint/runner/pieces}/eslint-piece-settings-types.d.ts +1 -1
  309. package/{mechanisms → src/infrastructure/engines}/eslint/runner/runner.js +2186 -1372
  310. package/{mechanisms/eslint/CD-41 → src/infrastructure/engines/eslint/tangled-function/cognitive-complexity}/README.md +1 -1
  311. package/src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/cognitive-complexity.examples.json +48 -0
  312. package/{mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js → src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/eslint-plugin.js} +58 -14
  313. package/src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/piece.json +12 -0
  314. package/{mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js → src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js} +5 -4
  315. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/focused-tests.examples.json +60 -0
  316. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/piece.json +12 -0
  317. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +16 -0
  318. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +54 -0
  319. package/{mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js → src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/eslint-plugin.js} +5 -4
  320. package/src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/piece.json +12 -0
  321. package/src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/throw-only-error.examples.json +54 -0
  322. package/{mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js → src/infrastructure/engines/eslint/untyped-value/explicit-any/eslint-plugin.js} +14 -9
  323. package/src/infrastructure/engines/eslint/untyped-value/explicit-any/explicit-any.examples.json +36 -0
  324. package/src/infrastructure/engines/eslint/untyped-value/explicit-any/piece.json +12 -0
  325. package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/implicit-any-let.examples.json +48 -0
  326. package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +16 -0
  327. package/src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/else-after-an-exit.examples.json +36 -0
  328. package/{mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js → src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/eslint-plugin.js} +29 -13
  329. package/src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/piece.json +12 -0
  330. package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-keyword.examples.json +84 -0
  331. package/{mechanisms/audit/CD-14 → src/infrastructure/engines/walker/authored-class-or-this/class-keyword}/class-syntax.js +6 -3
  332. package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/piece.json +10 -0
  333. package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-annotation.examples.json +42 -0
  334. package/{mechanisms/audit/CD-43 → src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation}/boolean-signatures.js +14 -6
  335. package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/piece.json +9 -0
  336. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/piece.json +95 -0
  337. package/{mechanisms/audit/CD-27 → src/infrastructure/engines/walker/branch-in-a-test/test-body}/test-body-logic.js +183 -54
  338. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body.examples.json +280 -0
  339. package/{mechanisms/audit/CD-1 → src/infrastructure/engines/walker/claimed-type/cast-to-any}/any-cast.js +7 -4
  340. package/src/infrastructure/engines/walker/claimed-type/cast-to-any/cast-to-any.examples.json +48 -0
  341. package/src/infrastructure/engines/walker/claimed-type/cast-to-any/piece.json +9 -0
  342. package/{mechanisms/audit/CD-2 → src/infrastructure/engines/walker/claimed-type/unlisted-cast-site}/cast-expressions.js +13 -6
  343. package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/piece.json +14 -0
  344. package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/unlisted-cast-site.examples.json +54 -0
  345. package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +18 -0
  346. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.examples.json +30 -0
  347. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +36 -0
  348. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/piece.json +9 -0
  349. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/default-arm.examples.json +36 -0
  350. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/piece.json +9 -0
  351. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +54 -0
  352. package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +18 -0
  353. package/{mechanisms/audit/CD-25 → src/infrastructure/engines/walker/double-with-a-body/stub-implementation}/dependency-isolation.js +8 -4
  354. package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/piece.json +9 -0
  355. package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/stub-implementation.examples.json +36 -0
  356. package/{mechanisms/audit/CD-7 → src/infrastructure/engines/walker/drawer-path/drawer-names}/categorical-paths.js +23 -8
  357. package/src/infrastructure/engines/walker/drawer-path/drawer-names/drawer-names.examples.json +42 -0
  358. package/src/infrastructure/engines/walker/drawer-path/drawer-names/piece.json +9 -0
  359. package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/git-spawn-environment.examples.json +36 -0
  360. package/{mechanisms/audit/CD-47 → src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment}/hermetic-git-spawns.js +13 -4
  361. package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/piece.json +9 -0
  362. package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loop-statement.examples.json +48 -0
  363. package/{mechanisms/audit/CD-15 → src/infrastructure/engines/walker/loop-keyword/loop-statement}/loops.js +12 -4
  364. package/src/infrastructure/engines/walker/loop-keyword/loop-statement/piece.json +9 -0
  365. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +36 -0
  366. package/{mechanisms/audit/CD-26 → src/infrastructure/engines/walker/module-or-global-patched/module-mock-call}/module-mocking.js +8 -4
  367. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +9 -0
  368. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +133 -0
  369. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-or-require.examples.json +42 -0
  370. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +14 -0
  371. package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +18 -0
  372. package/{mechanisms/audit/runner → src/infrastructure/engines/walker/runner/pieces}/walker-piece.d.ts +8 -14
  373. package/{mechanisms/audit → src/infrastructure/engines/walker}/runner/runner.js +191 -120
  374. package/{mechanisms/audit/runner → src/infrastructure/engines/walker/runner/toolchain}/typescript-parse.d.ts +1 -0
  375. package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.examples.json +42 -0
  376. package/{mechanisms/audit/CD-6 → src/infrastructure/engines/walker/shorthand-name/identifier-names}/identifier-names.js +32 -15
  377. package/src/infrastructure/engines/walker/shorthand-name/identifier-names/piece.json +9 -0
  378. package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/exact-optional-property-types.examples.json +71 -0
  379. package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +17 -0
  380. package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/no-fallthrough-cases-in-switch.examples.json +71 -0
  381. package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +17 -0
  382. package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/no-implicit-override.examples.json +71 -0
  383. package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +17 -0
  384. package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/no-property-access-from-index-signature.examples.json +71 -0
  385. package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +17 -0
  386. package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/no-unchecked-indexed-access.examples.json +71 -0
  387. package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +17 -0
  388. package/{mechanisms/audit/CD-3 → src/infrastructure/engines/walker/strictness-weakened/strict}/compiler-overrides.js +102 -38
  389. package/src/infrastructure/engines/walker/strictness-weakened/strict/piece.json +13 -0
  390. package/src/infrastructure/engines/walker/strictness-weakened/strict/strict.examples.json +64 -0
  391. package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +17 -0
  392. package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/use-unknown-in-catch-variables.examples.json +71 -0
  393. package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +18 -0
  394. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/piece.json +9 -0
  395. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +36 -0
  396. package/{mechanisms/audit/CD-10 → src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement}/throws-in-tests.js +6 -3
  397. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +18 -0
  398. package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.examples.json +36 -0
  399. package/{mechanisms/audit/CD-7a → src/infrastructure/engines/walker/type-derived-from-code/factory-return-types}/factory-return-types.js +5 -3
  400. package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/piece.json +9 -0
  401. package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/companion-test-file.examples.json +36 -0
  402. package/{mechanisms/audit/CD-23 → src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file}/export-test-sibling.js +7 -4
  403. package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/piece.json +9 -0
  404. package/{mechanisms/audit/CD-5 → src/infrastructure/engines/walker/untracked-escape/directive-pointers}/comments-directives.js +40 -19
  405. package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/directive-pointers.examples.json +96 -0
  406. package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/piece.json +16 -0
  407. package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.examples.json +42 -0
  408. package/{mechanisms/audit/CD-44 → src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation}/parameter-mutation.js +22 -7
  409. package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/piece.json +9 -0
  410. package/src/rule-set.d.ts +4 -0
  411. package/src/testing.d.ts +7 -0
  412. package/src/testing.js +524 -0
  413. package/api/audit.d.ts +0 -20
  414. package/api/rule-set.d.ts +0 -4
  415. package/api/testing.d.ts +0 -5
  416. package/api/testing.js +0 -238
  417. package/chunks/chunk-335ITLPO.js +0 -7
  418. package/chunks/chunk-5U4VTFD5.js +0 -1949
  419. package/chunks/chunk-E6VR3VRV.js +0 -268
  420. package/chunks/chunk-FR4FASVM.js +0 -108
  421. package/chunks/chunk-LDQUT742.js +0 -15
  422. package/chunks/chunk-MXSIQPCV.js +0 -13
  423. package/chunks/chunk-RWQ4UNKY.js +0 -24
  424. package/core/check/tool-command.js +0 -2909
  425. package/core/mechanism-port/runner-result-types.d.ts +0 -19
  426. package/mechanisms/audit/CD-1/piece.json +0 -13
  427. package/mechanisms/audit/CD-10/piece.json +0 -13
  428. package/mechanisms/audit/CD-14/piece.json +0 -13
  429. package/mechanisms/audit/CD-15/piece.json +0 -13
  430. package/mechanisms/audit/CD-17/clock-sources.js +0 -28
  431. package/mechanisms/audit/CD-17/piece.json +0 -13
  432. package/mechanisms/audit/CD-19/import-boundaries.js +0 -99
  433. package/mechanisms/audit/CD-19/piece.json +0 -18
  434. package/mechanisms/audit/CD-2/piece.json +0 -18
  435. package/mechanisms/audit/CD-23/piece.json +0 -13
  436. package/mechanisms/audit/CD-25/piece.json +0 -13
  437. package/mechanisms/audit/CD-26/piece.json +0 -13
  438. package/mechanisms/audit/CD-27/piece.json +0 -17
  439. package/mechanisms/audit/CD-3/piece.json +0 -77
  440. package/mechanisms/audit/CD-43/piece.json +0 -13
  441. package/mechanisms/audit/CD-44/piece.json +0 -13
  442. package/mechanisms/audit/CD-47/piece.json +0 -13
  443. package/mechanisms/audit/CD-5/piece.json +0 -20
  444. package/mechanisms/audit/CD-6/piece.json +0 -13
  445. package/mechanisms/audit/CD-7/piece.json +0 -13
  446. package/mechanisms/audit/CD-7a/piece.json +0 -13
  447. package/mechanisms/audit/CD-8/piece.json +0 -13
  448. package/mechanisms/audit/CD-8/switch-defaults.js +0 -42
  449. package/mechanisms/eslint/CD-1/piece.json +0 -23
  450. package/mechanisms/eslint/CD-10/piece.json +0 -15
  451. package/mechanisms/eslint/CD-14/piece.json +0 -31
  452. package/mechanisms/eslint/CD-2/cd2/cd2.eslint-plugin.js +0 -15
  453. package/mechanisms/eslint/CD-2/piece.json +0 -25
  454. package/mechanisms/eslint/CD-27/piece.json +0 -23
  455. package/mechanisms/eslint/CD-40/cd40/cd40.eslint-plugin.js +0 -15
  456. package/mechanisms/eslint/CD-40/piece.json +0 -21
  457. package/mechanisms/eslint/CD-41/piece.json +0 -23
  458. package/mechanisms/eslint/CD-42/piece.json +0 -15
  459. package/mechanisms/eslint/CD-44/cd44/cd44.eslint-plugin.js +0 -15
  460. package/mechanisms/eslint/CD-44/piece.json +0 -20
  461. package/mechanisms/eslint/CD-6/cd6/cd6.eslint-plugin.js +0 -15
  462. package/mechanisms/eslint/CD-6/piece.json +0 -217
  463. package/mechanisms/eslint/CD-7/piece.json +0 -15
  464. package/rules/CD-1/CHECKS.md +0 -41
  465. package/rules/CD-1/README.md +0 -15
  466. package/rules/CD-1/discipline.json +0 -195
  467. package/rules/CD-10/CHECKS.md +0 -51
  468. package/rules/CD-10/README.md +0 -15
  469. package/rules/CD-10/discipline.json +0 -133
  470. package/rules/CD-11/CHECKS.md +0 -15
  471. package/rules/CD-11/README.md +0 -15
  472. package/rules/CD-11/discipline.json +0 -12
  473. package/rules/CD-12/CHECKS.md +0 -15
  474. package/rules/CD-12/README.md +0 -15
  475. package/rules/CD-12/discipline.json +0 -12
  476. package/rules/CD-13/CHECKS.md +0 -15
  477. package/rules/CD-13/README.md +0 -15
  478. package/rules/CD-13/discipline.json +0 -12
  479. package/rules/CD-14/CHECKS.md +0 -51
  480. package/rules/CD-14/README.md +0 -15
  481. package/rules/CD-14/discipline.json +0 -173
  482. package/rules/CD-15/CHECKS.md +0 -44
  483. package/rules/CD-15/README.md +0 -15
  484. package/rules/CD-15/discipline.json +0 -73
  485. package/rules/CD-16/CHECKS.md +0 -9
  486. package/rules/CD-16/README.md +0 -15
  487. package/rules/CD-17/CHECKS.md +0 -39
  488. package/rules/CD-17/README.md +0 -15
  489. package/rules/CD-17/discipline.json +0 -51
  490. package/rules/CD-18/CHECKS.md +0 -15
  491. package/rules/CD-18/README.md +0 -15
  492. package/rules/CD-18/discipline.json +0 -12
  493. package/rules/CD-19/CHECKS.md +0 -51
  494. package/rules/CD-19/README.md +0 -15
  495. package/rules/CD-19/discipline.json +0 -63
  496. package/rules/CD-2/CHECKS.md +0 -60
  497. package/rules/CD-2/README.md +0 -15
  498. package/rules/CD-2/discipline.json +0 -151
  499. package/rules/CD-20/CHECKS.md +0 -9
  500. package/rules/CD-20/README.md +0 -15
  501. package/rules/CD-21/CHECKS.md +0 -15
  502. package/rules/CD-21/README.md +0 -15
  503. package/rules/CD-21/discipline.json +0 -12
  504. package/rules/CD-22/CHECKS.md +0 -15
  505. package/rules/CD-22/README.md +0 -15
  506. package/rules/CD-22/discipline.json +0 -12
  507. package/rules/CD-23/CHECKS.md +0 -37
  508. package/rules/CD-23/README.md +0 -15
  509. package/rules/CD-23/discipline.json +0 -57
  510. package/rules/CD-24/CHECKS.md +0 -9
  511. package/rules/CD-24/README.md +0 -15
  512. package/rules/CD-25/CHECKS.md +0 -40
  513. package/rules/CD-25/README.md +0 -15
  514. package/rules/CD-25/discipline.json +0 -57
  515. package/rules/CD-26/CHECKS.md +0 -38
  516. package/rules/CD-26/README.md +0 -15
  517. package/rules/CD-26/discipline.json +0 -57
  518. package/rules/CD-27/CHECKS.md +0 -460
  519. package/rules/CD-27/README.md +0 -15
  520. package/rules/CD-27/discipline.json +0 -437
  521. package/rules/CD-28/CHECKS.md +0 -15
  522. package/rules/CD-28/README.md +0 -15
  523. package/rules/CD-28/discipline.json +0 -12
  524. package/rules/CD-29/CHECKS.md +0 -15
  525. package/rules/CD-29/README.md +0 -15
  526. package/rules/CD-29/discipline.json +0 -12
  527. package/rules/CD-3/README.md +0 -15
  528. package/rules/CD-3/discipline.json +0 -641
  529. package/rules/CD-30/CHECKS.md +0 -15
  530. package/rules/CD-30/README.md +0 -15
  531. package/rules/CD-30/discipline.json +0 -12
  532. package/rules/CD-31/CHECKS.md +0 -15
  533. package/rules/CD-31/README.md +0 -15
  534. package/rules/CD-31/discipline.json +0 -12
  535. package/rules/CD-32/CHECKS.md +0 -15
  536. package/rules/CD-32/README.md +0 -26
  537. package/rules/CD-32/discipline.json +0 -12
  538. package/rules/CD-33/CHECKS.md +0 -15
  539. package/rules/CD-33/README.md +0 -26
  540. package/rules/CD-33/discipline.json +0 -12
  541. package/rules/CD-34/CHECKS.md +0 -15
  542. package/rules/CD-34/README.md +0 -25
  543. package/rules/CD-34/discipline.json +0 -12
  544. package/rules/CD-39/CHECKS.md +0 -15
  545. package/rules/CD-39/README.md +0 -26
  546. package/rules/CD-39/discipline.json +0 -12
  547. package/rules/CD-4/CHECKS.md +0 -15
  548. package/rules/CD-4/README.md +0 -15
  549. package/rules/CD-4/discipline.json +0 -12
  550. package/rules/CD-40/CHECKS.md +0 -41
  551. package/rules/CD-40/README.md +0 -15
  552. package/rules/CD-40/discipline.json +0 -58
  553. package/rules/CD-41/CHECKS.md +0 -66
  554. package/rules/CD-41/README.md +0 -15
  555. package/rules/CD-41/discipline.json +0 -138
  556. package/rules/CD-42/CHECKS.md +0 -49
  557. package/rules/CD-42/README.md +0 -15
  558. package/rules/CD-42/discipline.json +0 -61
  559. package/rules/CD-43/CHECKS.md +0 -39
  560. package/rules/CD-43/README.md +0 -15
  561. package/rules/CD-43/discipline.json +0 -65
  562. package/rules/CD-44/CHECKS.md +0 -50
  563. package/rules/CD-44/README.md +0 -15
  564. package/rules/CD-44/discipline.json +0 -111
  565. package/rules/CD-45/CHECKS.md +0 -15
  566. package/rules/CD-45/README.md +0 -15
  567. package/rules/CD-45/discipline.json +0 -12
  568. package/rules/CD-46/CHECKS.md +0 -9
  569. package/rules/CD-46/README.md +0 -27
  570. package/rules/CD-47/CHECKS.md +0 -39
  571. package/rules/CD-47/README.md +0 -15
  572. package/rules/CD-47/discipline.json +0 -57
  573. package/rules/CD-5/README.md +0 -15
  574. package/rules/CD-5/discipline.json +0 -131
  575. package/rules/CD-6/CHECKS.md +0 -53
  576. package/rules/CD-6/README.md +0 -15
  577. package/rules/CD-6/discipline.json +0 -165
  578. package/rules/CD-7/CHECKS.md +0 -48
  579. package/rules/CD-7/README.md +0 -15
  580. package/rules/CD-7/discipline.json +0 -142
  581. package/rules/CD-7a/CHECKS.md +0 -40
  582. package/rules/CD-7a/README.md +0 -15
  583. package/rules/CD-7a/discipline.json +0 -57
  584. package/rules/CD-8/CHECKS.md +0 -44
  585. package/rules/CD-8/README.md +0 -15
  586. package/rules/CD-8/discipline.json +0 -57
  587. package/rules/CD-9/CHECKS.md +0 -15
  588. package/rules/CD-9/README.md +0 -15
  589. package/rules/CD-9/discipline.json +0 -12
  590. package/rules/typescript/symptoms.json +0 -1005
  591. /package/{core/values → src/domain/finding}/anchor.d.ts +0 -0
  592. /package/{core/values → src/domain/repository}/branded.d.ts +0 -0
  593. /package/{core/values → src/domain/repository}/repo-path-types.d.ts +0 -0
  594. /package/{core/values → src/domain}/result.d.ts +0 -0
  595. /package/{core/values → src/domain/rule-set}/clause-address-types.d.ts +0 -0
  596. /package/{core/values → src/domain/settings/json-values}/json-value.d.ts +0 -0
  597. /package/{mechanisms/eslint/CD-14 → src/infrastructure/engines/eslint/authored-class-or-this/class-keyword}/README.md +0 -0
  598. /package/{mechanisms/eslint/CD-2 → src/infrastructure/engines/eslint/claimed-type/non-null-assertions}/README.md +0 -0
  599. /package/{mechanisms/eslint/CD-7 → src/infrastructure/engines/eslint/name-off-its-casing/filename-case}/README.md +0 -0
  600. /package/{mechanisms/eslint/CD-6 → src/infrastructure/engines/eslint/name-off-its-casing/naming-convention}/README.md +0 -0
  601. /package/{mechanisms/eslint/CD-40 → src/infrastructure/engines/eslint/positional-parameters/parameter-count}/README.md +0 -0
  602. /package/{mechanisms/eslint/CD-44 → src/infrastructure/engines/eslint/rebinding/parameter-reassignment}/README.md +0 -0
  603. /package/{mechanisms/eslint/CD-27 → src/infrastructure/engines/eslint/test-switched-off/focused-tests}/README.md +0 -0
  604. /package/{mechanisms/eslint/CD-10 → src/infrastructure/engines/eslint/thrown-non-error/throw-only-error}/README.md +0 -0
  605. /package/{mechanisms/eslint/CD-1 → src/infrastructure/engines/eslint/untyped-value/explicit-any}/README.md +0 -0
  606. /package/{mechanisms/eslint/CD-42 → src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit}/README.md +0 -0
  607. /package/{mechanisms/audit → src/infrastructure/engines/walker}/runner/README.md +0 -0
  608. /package/{api → src}/rule-set.js +0 -0
package/ADOPTING.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This page takes a TypeScript repository from nothing to a checked, passing run. Do the steps in order. Every command is run from the root of the repository being checked, which this page calls `<repo>`. Nothing here needs AIDLC or any agent harness. A repository that adopted the disciplines through the older standalone copy route follows [MIGRATING.md](MIGRATING.md), which uses these steps.
4
4
 
5
- Hone reads `disciplines.json` in `<repo>`, runs the selected disciplines' checks over every git-tracked file, applies the exceptions recorded in `discipline-exceptions.json`, or split by rule in the `discipline-exceptions` folder, and prints one report ending in `verdict: pass` or `verdict: fail`.
5
+ Hone reads `hone.config.json` in `<repo>`, runs the listed checks over every git-tracked file, answers what they find by the records in `hone-records`, and prints one report ending in `verdict: pass` or `verdict: fail`. A repository that already runs version 1, with `disciplines.json`, runs `hone upgrade` once instead of writing these files by hand, as [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 says, then follows this page from step 5.
6
6
 
7
7
  ## 1. Check the prerequisites
8
8
 
@@ -10,15 +10,15 @@ Hone reads `disciplines.json` in `<repo>`, runs the selected disciplines' checks
10
10
  node --version
11
11
  ```
12
12
 
13
- It must print `v22.18.0` or a later 22.x, or `v24.0.0` or later. A rule set of your own may write its piece modules as `.ts` files, which Hone runs with Node's built-in type stripping, so they are limited to what [Node's TypeScript support](https://nodejs.org/docs/latest-v22.x/api/typescript.html) allows: only syntax that can be erased, so no enums, no namespaces that hold values and no parameter properties; relative imports that spell the `.ts` extension; and `import type` (or `type` on each name) for anything that is only a type. Node does not strip types from files under `node_modules`, so a rule set installed as a package must ship `.js`. Also needed: git 2.24 or later and npm. `<repo>` must be a git repository, and the files to check must be committed or staged: untracked files are not checked.
13
+ It must be in the `engines.node` range that `npm view @hailstails/hone engines` prints. A rule set of your own may write its piece modules as `.ts` files, which Hone runs with Node's built-in type stripping, so they are limited to what [Node's TypeScript support](https://nodejs.org/docs/latest-v22.x/api/typescript.html) allows; Node does not strip types under `node_modules`, so a rule set installed as a package must ship `.js`. Also needed: git and npm. `<repo>` must be a git repository, and the files to check must be committed or staged: untracked files are not checked.
14
14
 
15
15
  ## 2. Install the Hone package
16
16
 
17
- Hone ships as one npm package tarball of built JavaScript, so it needs no TypeScript support from Node. It has three dependencies of its own, `zod`, `jsonc-parser` and `@eslint/plugin-kit`, each declared as a caret range starting at the version Hone is tested on, which the package manager installs from the registry. Your repository's lockfile, and any override you set, decides which release inside each range is installed, so you can take a patched release of one of them without waiting for a new Hone.
17
+ Hone ships as one npm package of built JavaScript, so it needs no TypeScript support from Node. Its own dependencies are declared as caret ranges, so your repository's lockfile, and any override you set, decides which release inside each range is installed.
18
18
 
19
19
  **The npm package is named `@hailstails/hone`.** The unscoped name `hone` on npm belongs to an unrelated package: never run `npm install hone`. The package `@hailstails/hone` installs one command, `hone`. Its tarball is named `hailstails-hone-<version>.tgz`, the file name `npm pack` gives a scoped package. Its first pre-release was released under the old name `honed`; [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone) says how to move from it.
20
20
 
21
- Hone follows semantic versioning: only a major release removes or renames a clause address, config key or flag, or changes what one means ([README.md](README.md#compatibility)).
21
+ Hone follows semantic versioning: only a major release removes or renames a check address, config key or flag, or changes what one means ([README.md](README.md#compatibility)).
22
22
 
23
23
  The main route is the npm registry. Stable releases are published under the dist-tag `latest`, which names the newest stable release approved on npm; `npm view @hailstails/hone dist-tags.latest` prints its version. Pre-releases are published under `next`. Install that version exactly, with `<version>` in place:
24
24
 
@@ -32,7 +32,7 @@ With pnpm, add it as a development dependency, using `-Dw` in place of `-D` at t
32
32
  pnpm add -D --save-exact @hailstails/hone@<version>
33
33
  ```
34
34
 
35
- Pin the exact version. A major release can remove or rename a clause address, config key or flag, and an install by tag can record a range in `package.json`, such as `^` and the version, which a later install without the lockfile, or an update, moves to a newer release that nobody chose. With an exact pin, the version changes only when you change it (step 10). Check the name before you run it: `@hailstails/hone`, never the unscoped `hone`. With Yarn, add `@hailstails/hone@<version>` exactly with its own `add -D` command at the workspace root. `latest` can trail the newest GitHub release for a while; [README.md](README.md#developing-hone) says how a version reaches npm.
35
+ Pin the exact version. A major release can remove or rename a check address, config key or flag, and an install by tag can record a range in `package.json`, such as `^` and the version, which a later install without the lockfile, or an update, moves to a newer release that nobody chose. With an exact pin, the version changes only when you change it (step 10). Check the name before you run it: `@hailstails/hone`, never the unscoped `hone`. With Yarn, add `@hailstails/hone@<version>` exactly with its own `add -D` command at the workspace root. `latest` can trail the newest GitHub release for a while; [README.md](README.md#developing-hone) says how a version reaches npm.
36
36
 
37
37
  The alternative is a tarball, copied into the repository so every teammate and CI runner installs the same Hone without the registry. Its three dependencies still come from the registry, or the mirror your package manager uses, at releases inside the ranges the tarball's `package.json` declares, and the repository's lockfile records which. This page writes its location as `<hone-tarball>`: a path such as `vendor/hailstails-hone/hailstails-hone-<version>.tgz`, or an `https://` URL your team serves it from. Download the tarball attached to the latest [GitHub release](https://github.com/HailsTails/hone/releases), or build it from a pinned commit as below.
38
38
 
@@ -44,7 +44,7 @@ git -C /tmp/hone-source checkout <pinned-sha>
44
44
  cd /tmp/hone-source && corepack pnpm install --frozen-lockfile && corepack pnpm run pack-package && cd -
45
45
  ```
46
46
 
47
- The last command prints `pack package: wrote <path>/artefacts/hailstails-hone-<version>.tgz`. Copy the downloaded or built tarball into `<repo>/vendor/hailstails-hone/` and commit it with a message naming the release tag or the pinned SHA. The commands in this guide are POSIX shell; on Windows run them in Git Bash.
47
+ The last command writes the tarball under `artefacts/`. Copy the downloaded or built tarball into `<repo>/vendor/hailstails-hone/` and commit it with a message naming the release tag or the pinned SHA. The commands in this guide are POSIX shell; on Windows run them in Git Bash.
48
48
 
49
49
  Install it as a development dependency of the repository root, beside the toolchain:
50
50
 
@@ -71,18 +71,9 @@ Add the two commands to the root `package.json` scripts:
71
71
 
72
72
  Options for one run go after the script name. npm needs `--` before them, as in `npm run --silent hone:check -- --base-revision origin/main`. pnpm takes them straight after the script name, as in `pnpm run --silent hone:check --base-revision origin/main`. This guide shows both wherever a command takes options.
73
73
 
74
- `hone` is the package's one command, with two subcommands: `hone check` runs the check and `hone project` writes the ESLint projection. `hone` with no subcommand, or with any other, exits `2` with one `load failure: arguments-invalid` line that names the commands and points at `hone --help`, which prints the usage.
74
+ `hone --help` lists the commands, and `hone <command> --help` gives each one's options and exit codes.
75
75
 
76
- Hone runs on the toolchain the repository already uses, which the package declares as peer dependencies: `typescript` is a required peer, because every `audit` clause needs it, and the ESLint packages are optional peers, needed only for `eslint` clauses. npm 7 and later install a missing required peer on their own, and some other package managers only warn about one, so declare `typescript` yourself at the repository root, at the version the repository already uses, rather than let the package manager choose or skip it. Keep the versions you have; Hone supports these ranges:
77
-
78
- | Package | Needed for | Range |
79
- | --- | --- | --- |
80
- | `typescript` | any `audit` clause | `>=4.8.4 <7.0.0` |
81
- | `eslint` | any `eslint` clause | `^9.28.0 \|\| ^10.0.0` |
82
- | `@typescript-eslint/parser` | any `eslint` clause | `^8.56.0` |
83
- | `@typescript-eslint/eslint-plugin` | any `eslint` clause | `^8.56.0` |
84
-
85
- A repository that already has them in range needs nothing more. A package that is missing or out of range is named when the check runs; add it at a version inside its range and inside the range your other tooling accepts, without moving ESLint or TypeScript to another major for Hone's sake.
76
+ Hone runs on the toolchain the repository already uses, which the package declares as `peerDependencies`: `typescript` is required, because every check on the `walker` engine needs it, and the ESLint packages are optional, needed only for checks on the `eslint` engine. The supported ranges are those in the installed package's `package.json`. Declare `typescript` yourself at the repository root, at the version the repository already uses, rather than let the package manager choose or skip it. A package that is missing or out of range is named when the check runs; add it at a version inside its range, without moving ESLint or TypeScript to another major for Hone's sake.
86
77
 
87
78
  Hone finds these by Node's resolution upward from where the package is installed, so in a monorepo they must resolve from the repository root: declare them in the root `package.json` (with pnpm, `pnpm add -Dw` at the versions the packages already use), even where packages also declare their own. Yarn Plug'n'Play is not supported, because Hone resolves the toolchain through `node_modules`.
88
79
 
@@ -90,85 +81,62 @@ Commit `package.json`, the lockfile and the tarball if it is a file in the repos
90
81
 
91
82
  ## 3. Read what each discipline means
92
83
 
93
- [rules/numbers.md](rules/numbers.md#every-numbered-discipline) lists every discipline, and [rules/README.md](rules/README.md) explains how the named pages read. Rules are referred to by name; a number is only a clause address. Each numbered discipline has two pages. `rules/<ID>/README.md` gives its verdict, the named rules, recipes and symptoms to read, and its review lens. `rules/<ID>/CHECKS.md` holds the mechanics: the Clauses table, exactly what each check flags, a violation and its fix, and how to record an exception. Read the named pages first; [the spirit of the rules](rules/SPIRIT.md) explains the approach for the whole set. A discipline's clause addresses are in its CHECKS.md Clauses table, for example `CD-14#class-syntax`, with the mechanism that checks each clause. A clause whose mechanism is `review` is a judgement clause: it is applied in review, not by a check, with the review lens the rule page names (step 9).
84
+ [rules/numbers.md](rules/numbers.md#every-numbered-discipline) lists every discipline, and [rules/README.md](rules/README.md) explains how the named pages read. Rules are referred to by name; a number is only a clause address. Each check has its own page under its symptom, `rules/typescript/symptoms/<symptom>/<check>.md`: exactly what it flags, its settings, a violation and its fix. Read the named pages first; [the spirit of the rules](rules/SPIRIT.md) explains the approach for the whole set. Each check is listed in `hone.config.json` by its address, `<symptom>#<check>`, such as `authored-class-or-this#class-keyword`; [the checks page](rules/typescript/checks.md) lists every one. A clause whose mechanism is `review` is a judgement clause: it has no check and is applied in review, with the review lens its rule item names (step 9).
94
85
 
95
- A check covers only what its CHECKS.md says it flags. Read the whole rule, not only the Clauses table: where a rule asks for more than its check can see, CHECKS.md says which part is left to review, and the rule's review lens covers that part.
86
+ A check covers only what its page says it flags. Read the whole rule, not only the check: where a rule asks for more than its check can see, the check page says which part is left to review, and the rule's review lens covers that part.
96
87
 
97
- Where to start: for an API, boundary validation (CD-4, CD-45), result-shaped failures (CD-9, CD-10, CD-11) and inward dependency direction (CD-12, CD-13) are useful next selections, most of them judgement rules. For React, first select the type and test disciplines that apply to component code; do not apply server ports or process-lifecycle rules to browser code.
88
+ Where to start: for an API, [No leak across a boundary](rules/principles.md#no-leak-across-a-boundary) with its recipe [Zod at the producer's adapter](rules/typescript/recipes.md#zod-at-the-producers-adapter), [Failures are values](rules/rules.md#failures-are-values) and [Ports declared inside](rules/rules.md#ports-declared-inside) are useful next, most of them applied in review. For React, first select the type and test disciplines that apply to component code; do not apply server ports or process-lifecycle rules to browser code.
98
89
 
99
- ## 4. Write disciplines.json
90
+ ## 4. Write hone.config.json
100
91
 
101
- Create `<repo>/disciplines.json`. Map every clause you adopt to the mechanism that checks it:
92
+ Create `<repo>/hone.config.json`. List every check you adopt with the engine that runs it. This example lists `loop-keyword#loop-statement`, `date-used-directly#clock-sources` and `unit-without-a-running-test#companion-test-file`:
102
93
 
103
94
  ```json
104
95
  {
105
- "version": 1,
96
+ "version": 2,
106
97
  "ruleSets": {},
107
- "clauses": {
108
- "CD-15#loops": "audit",
109
- "CD-17#clock-sources": "audit",
110
- "CD-23#export-test-sibling": "audit"
98
+ "checks": {
99
+ "loop-keyword#loop-statement": "walker",
100
+ "date-used-directly#clock-sources": "walker",
101
+ "unit-without-a-running-test#companion-test-file": "walker"
111
102
  }
112
103
  }
113
104
  ```
114
105
 
115
- - `clauses` keys are clause addresses from the rules' CHECKS.md pages; the value is a mechanism the clause's CHECKS.md lists, `audit` or `eslint`, `"not-run"` or `"not-adopted"`.
116
- - Selecting one clause of a discipline adopts the whole discipline: any of its other mechanical clauses you leave out are reported as `uncovered` and fail the run. CD-3 has seven clauses; select all seven or none.
117
- - A discipline may span mechanisms; adopt every mechanical clause through the mechanism that has it, or the discipline reports the rest uncovered. CD-14, for example, checks `class-syntax` through `audit` or `eslint` but `static-only-class` only through `eslint`, so adopting CD-14 means adopting the ESLint mechanism for at least that clause; see [README.md](README.md#adopting-the-eslint-mechanism). If ESLint cannot work in this repository, list such a clause as `"not-run"`, as below.
118
- - A clause's value in `clauses` is one of three:
119
- - a mechanism id, such as `audit`: the check runs and its findings fail the run;
120
- - `"not-run"`: the clause is adopted, but its mechanism is not run; the report lists it under `notRun` as `adopted, mechanism not run: enforced by review`;
121
- - `"not-adopted"`: the clause is not adopted; the report lists it under `notAdopted`.
122
- - A `"not-run"` or `"not-adopted"` clause is never run and never projected, not even as `"off"`, and its mechanism is not loaded unless another clause uses it, so a repository that lists every ESLint clause this way needs no ESLint installed. Both leave the run a whole assessment. Neither takes an exception record: one on such a clause is invalid as `clause-not-run` or `clause-not-adopted`.
123
- - When a clause's check cannot simply run clean, [the spirit of the rules](rules/SPIRIT.md#not-adopted-not-run-carved-out-escaped) names three declared states. Choose one deliberately, with reasons:
124
- - Not adopted: the rule does not apply to this codebase; a tech lead declares that, in the open. Set the clause to `"not-adopted"`.
125
- - Adopted, mechanism not run: the rule binds, but its check is not a true measure of the rule's intent here, or cannot work here for a technical reason. The check is set aside; the intent is still owed, through review. Set the clause to `"not-run"`. CD-6's ESLint-only `naming-convention` in a repository without ESLint is the usual case: `"CD-6#identifier-names": "audit", "CD-6#naming-convention": "not-run"`.
126
- - Clause-wide carve-out: the rule binds and its check is sound, but the codebase has debt it cannot address right now. Keep the clause's mechanism, so the clause still runs, and record the debt against it as a `clause-wide-carve-out` with its why-chain and an owner who will pay it down (step 7).
127
- - `exclude` lists folders or exact files that no mechanism checks, as repository paths with forward slashes; an entry containing `*` is refused, because globs are not supported. A folder entry excludes everything under it. It is the only way to narrow what Hone checks: there is no include list, and every tracked file outside `exclude` is checked, including any folder added later. Use it for generated or third-party code, and, to check only part of a repository, list every other folder. `node_modules`, `dist`, `build`, `coverage`, `.git` and a top-level `vendor` folder are skipped already.
128
- - `clauseSettings` gives a clause the settings its CHECKS.md lists under Settings, keyed by clause address. CD-19, for example, flags only imports of the packages you list in its `confinedPackages`; CD-5's `trackerPatterns` narrows tracked references to your tracker's format. See [README.md](README.md#disciplinesjson).
129
- - `checkEditions` stays out, or `"pinned"`, unless you want stricter checks as soon as they ship. When Hone tightens a check, the stricter check arrives as a new edition of its clause, listed on the clause's CHECKS.md, and becomes the default only in a major release. `"latest"` runs the newest edition of every selected clause, so a minor upgrade can add findings. To take one clause's newer edition only, give it `"edition"` in `clauseSettings`, for example `"CD-27#test-body-logic": { "edition": "2" }`. The report lists the edition each such clause ran under `editions`.
106
+ - `checks` keys are check addresses, `<symptom>#<check>`, listed on [the checks page](rules/typescript/checks.md); the value is an engine the check lists, `walker` or `eslint`, `"not-run"` or `"not-adopted"`. A check of a rule set of your own is written `<ruleSet>/<symptom>#<check>`.
107
+ - Listing a check adopts it. Only a listed check runs. A check of a symptom that a listed check sees, listed nowhere, is offered under `available` and never fails the run. The symptom [Strictness weakened](rules/typescript/symptoms.md#strictness-weakened) has seven checks, one per compiler flag; list the ones you want. Checks that are one rule today run together: listing one of the six test-body checks without the others stops the run with `checks-run-together` naming them.
108
+ - A symptom may span engines; list each of its checks on an engine that has it, or mark it. `authored-class-or-this#class-keyword` runs on `walker` or `eslint` but `authored-class-or-this#static-members-only` only on `eslint`, so adopting that symptom means adopting the ESLint engine for at least that check; see [README.md](README.md#adopting-the-eslint-mechanism). If ESLint cannot work in this repository, list such a check as `"not-run"`, as below.
109
+ - A check's value in `checks` is one of three:
110
+ - an engine id, such as `walker`: the check runs and its findings fail the run;
111
+ - `"not-run"`: the check is adopted, but its engine is not run; the report lists it under `not-run`;
112
+ - `"not-adopted"`: the check is not adopted; the report lists it under `not-adopted`.
113
+ - A `"not-run"` or `"not-adopted"` check is never run and never projected, not even as `"off"`, and its engine is not loaded unless another check uses it, so a repository that lists every ESLint check this way needs no ESLint installed. Both leave the run a whole assessment.
114
+ - When a check cannot simply run clean, [the spirit of the rules](rules/SPIRIT.md#not-adopted-not-run-carved-out-escaped) names three declared states. Choose one deliberately, with reasons:
115
+ - Not adopted: the rule does not apply to this codebase; a tech lead declares that, in the open. Set the check to `"not-adopted"`.
116
+ - Adopted, engine not run: the rule binds, but its check is not a true measure of the rule's intent here, or cannot work here for a technical reason. The check is set aside; the intent is still owed, through review. Set the check to `"not-run"`. The ESLint-only checks of `name-off-its-casing` in a repository without ESLint are the usual case: `"name-off-its-casing#naming-convention": "not-run", "name-off-its-casing#filename-case": "not-run"`.
117
+ - Debt: the rule binds and its check is sound, but the codebase has debt it cannot address right now. Keep the check's engine, so it still runs, and record the debt file by file as debt records, which `hone record-debt` writes for you (step 7a).
118
+ - `exclude` lists folders or exact files that no engine checks, as repository paths with forward slashes; an entry containing `*` is refused, because globs are not supported. A folder entry excludes everything under it. It is the only way to narrow what Hone checks: there is no include list, and every tracked file outside `exclude` is checked, including any folder added later. Use it for generated or third-party code, and, to check only part of a repository, list every other folder. The ESLint engine lints every tracked TypeScript file outside `exclude`, including any the repository's own ESLint config ignores: an ignore in that config does not narrow what Hone checks, and each selected check lists such a file under `unrecorded` until the ignore is removed or the file is listed in `exclude`.
119
+ - `checkSettings` gives a check the settings its check page lists, keyed by check address. See [README.md](README.md#honeconfigjson).
120
+ - `checkEditions` stays out, or `"pinned"`, unless you want stricter checks as soon as they ship. When Hone tightens a check, the stricter check arrives as a new edition, listed on the check's page, and becomes the default only in a major release. `"latest"` runs the newest edition of every listed check, so a minor upgrade can add findings. To take one check's newer edition only, give it `"edition"` in its `checkSettings` entry.
130
121
  - `ruleSets` stays `{}` unless you write disciplines of your own; see [docs/extending.md](docs/extending.md).
131
122
 
132
- Every clause address Hone ships:
133
-
134
- ```text
135
- audit:
136
- CD-1#any-cast CD-2#cast-expressions CD-5#comments-directives
137
- CD-6#identifier-names CD-7#categorical-paths CD-7a#factory-return-types
138
- CD-8#switch-defaults CD-10#throws-in-tests CD-14#class-syntax
139
- CD-15#loops CD-17#clock-sources CD-19#import-boundaries
140
- CD-23#export-test-sibling CD-25#dependency-isolation
141
- CD-26#module-mocking CD-27#test-body-logic CD-43#boolean-signatures
142
- CD-44#parameter-mutation CD-47#hermetic-git-spawns
143
- CD-3#strict CD-3#no-unchecked-indexed-access CD-3#exact-optional-property-types
144
- CD-3#no-implicit-override CD-3#no-fallthrough-cases-in-switch
145
- CD-3#no-property-access-from-index-signature CD-3#use-unknown-in-catch-variables
146
-
147
- eslint:
148
- CD-1#explicit-any CD-1#implicit-any-let CD-2#non-null-assertions
149
- CD-6#naming-convention CD-7#filename-case CD-10#throw-only-error
150
- CD-14#class-syntax CD-14#static-only-class CD-27#focused-tests
151
- CD-27#skipped-tests CD-40#parameter-count CD-41#cognitive-complexity
152
- CD-41#function-length CD-42#useless-else CD-44#parameter-reassignment
153
- ```
154
-
155
- CD-1, CD-2, CD-6, CD-7, CD-10, CD-14, CD-27 and CD-44 have clauses under both mechanisms, and CD-40, CD-41 and CD-42 only under `eslint`, so adopting any of them needs the ESLint mechanism.
123
+ Adopting a symptom with a check whose only engine is `eslint` needs the ESLint engine, or that check listed as `"not-run"`.
156
124
 
157
125
  Starting with a few disciplines and adding more once the run passes is easier than fixing everything at once.
158
126
 
159
- ### 4a. Set up ESLint for `eslint` clauses
127
+ ### 4a. Set up ESLint for `eslint` checks
160
128
 
161
- Skip this if every selected clause is `audit`. Otherwise, after writing `disciplines.json`, write the ESLint projection:
129
+ Skip this if every listed check runs on the `walker`. Otherwise, after writing `hone.config.json`, write the ESLint projection:
162
130
 
163
131
  ```bash
164
132
  npm run --silent hone:project
165
133
  ```
166
134
 
167
- It prints `disciplines.eslint.mjs written`. Spread its default export last in the repository's flat config. The projection sets rules only, so the config must also parse TypeScript, with the `@typescript-eslint/parser` that step 2 installs; without it the repository's own `eslint` run fails on the first type annotation while Hone's check still passes. A repository with no ESLint config yet can start from this `eslint.config.mjs`:
135
+ It writes `hone.eslint.mjs` and `hone.eslint.d.mts`, which types it for a TypeScript config. Spread its default export last in the repository's flat config. The projection sets rules only, so the config must also parse TypeScript, with the `@typescript-eslint/parser` that step 2 installs; without it the repository's own `eslint` run fails on the first type annotation while Hone's check still passes. A repository with no ESLint config yet can start from this `eslint.config.mjs`:
168
136
 
169
137
  ```js
170
138
  import typescriptParser from "@typescript-eslint/parser";
171
- import projection from "./disciplines.eslint.mjs";
139
+ import projection from "./hone.eslint.mjs";
172
140
 
173
141
  export default [
174
142
  { files: ["**/*.{ts,tsx,mts,cts}"], languageOptions: { parser: typescriptParser } },
@@ -178,10 +146,10 @@ export default [
178
146
 
179
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`.
180
148
 
181
- In a monorepo where ESLint resolves each file from its nearest config, `hone:project` also writes a `disciplines.eslint.mjs` slice beside each package's tracked `eslint.config.*`, holding only that package's exceptions 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 `disciplines.json` gets no slice: its ESLint configuration is not managed from this repository, and nested Hone configurations are not supported yet ([#72](https://github.com/HailsTails/hone/issues/72)); when that leaves a carve-out recorded there out of effect, the check names the folder on its `mechanism-not-run eslint not-included` line. 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. 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:
182
150
 
183
151
  ```js
184
- import projection from "./disciplines.eslint.mjs";
152
+ import projection from "./hone.eslint.mjs";
185
153
 
186
154
  export default [
187
155
  { files: ["**/*.{ts,tsx,mts,cts}"] },
@@ -189,29 +157,29 @@ export default [
189
157
  ];
190
158
  ```
191
159
 
192
- A package whose `eslint.config.*` is generated and not tracked needs its folder listed so Hone writes its slice, and the slice spread where the tool takes extra configuration. Each listed folder must be one git tracks files under, spelled exactly as git spells it, or the check stops with `config-root-untracked`. sku 16.6.1 is such a tool: its `packages/sku/src/utils/configureApp.ts` writes `eslint.config.mjs` into the project on every sku command and adds it to `.gitignore`, and that config applies the `dangerouslySetESLintConfig` function that `packages/sku/src/types/types.ts` declares as taking and returning `Linter.Config[]`. For sku, list the package in `disciplines.json` and spread the slice in `sku.config.ts`:
160
+ A package whose `eslint.config.*` is generated and not tracked needs its folder listed so Hone writes its slice, and the slice spread where the tool takes extra configuration. Each listed folder must be one git tracks files under, spelled exactly as git spells it, or the check stops. sku is such a tool: it writes an ignored `eslint.config.mjs` on every command and applies `dangerouslySetESLintConfig` to it. For sku, list the package in `hone.config.json` and spread the slice in `sku.config.ts`:
193
161
 
194
162
  ```json
195
163
  { "eslintConfigRoots": ["packages/web"] }
196
164
  ```
197
165
 
198
166
  ```ts
199
- import projection from "./disciplines.eslint.mjs";
167
+ import projection from "./hone.eslint.mjs";
200
168
 
201
169
  export default {
202
170
  dangerouslySetESLintConfig: (skuEslintConfig) => [...skuEslintConfig, ...projection],
203
171
  };
204
172
  ```
205
173
 
206
- The check names a slice that is missing, out of date, or not applied to that package's files, and names a listed folder whose `eslint.config.*` is not on disk as `unconfigured`: until the tool has written it, nothing loads the slice, so run the tool's configure step (for sku, any sku command or `sku configure`) before the check. A package that spreads nothing at all shows its files under `unrecorded` as `config-override` while it has no file exception of its own; once a file under check there has one, the package is also reported `not-applied`. Hone sees which slice a package config spreads only through its effect: a package config that spreads the root projection by mistake is reported `not-applied` once a file under check in that package has a file exception the root projection cannot carry. Until then the check says nothing, because for a package with no file exceptions of its own the root projection and the slice switch on the same rules, and clause-wide carve-outs reach the package either way. To confirm the spread before adding an exception, run ESLint from the package folder on a file the check flags and see the same finding. [README.md](README.md#package-slices) has the details. Hone detects which config the team's ESLint run applies from the installed `eslint` version and the lint scripts; see [README.md](README.md#runtime). Detection is wrong when a task runner (turbo, nx, `pnpm -r`) starts ESLint 9 inside each package, because each package then uses its own config, and when ESLint 9 gets the lookup flag outside the scripts. In those repositories set the lookup in `disciplines.json`:
174
+ Run the tool's configure step (for sku, any sku command or `sku configure`) before the check, or nothing loads the slice. A package that spreads the root projection instead of its slice is reported only once a record answers a file in it, so silence is not proof the spread is right: run ESLint from the package folder on a file the check flags and see the same finding. [README.md](README.md#package-slices) has the details. Hone detects which config the team's ESLint run applies from the installed `eslint` version and the lint scripts; see [README.md](README.md#runtime). Detection is wrong when a task runner (turbo, nx, `pnpm -r`) starts ESLint 9 inside each package, because each package then uses its own config, and when ESLint 9 gets the lookup flag outside the scripts. In those repositories set the lookup in `hone.config.json`:
207
175
 
208
176
  ```json
209
177
  { "eslintConfigLookup": "nearest-to-file" }
210
178
  ```
211
179
 
212
- Use `"nearest-to-file"` when ESLint runs per package, with ESLint 10, or with ESLint 9 and `--flag v10_config_lookup_from_file` (on 9.28 and 9.29, `--flag unstable_config_lookup_from_file`). Use `"repository-root"` for one ESLint 9 run from the repository root, whose root `eslint.config.*` then applies to every file. To confirm the setting, lint a package file the way the team does (for example `pnpm exec eslint packages/a/src/x.ts` from where the lint script runs) and check that it reports the same finding the Hone check lists for that file.
180
+ Use `"nearest-to-file"` when ESLint runs per package, with ESLint 10, or with ESLint 9 and `--flag v10_config_lookup_from_file`. Use `"repository-root"` for one ESLint 9 run from the repository root, whose root `eslint.config.*` then applies to every file. To confirm the setting, lint a package file the way the team does (for example `pnpm exec eslint packages/a/src/x.ts` from where the lint script runs) and check that it reports the same finding the Hone check lists for that file.
213
181
 
214
- Commit the projection, every slice and the configs. Hone's check reads this configuration and fails if the projection or a slice is missing, not in effect, or out of date, so re-run `hone:project` whenever `disciplines.json` or `discipline-exceptions.json` changes or Hone is updated. The projection imports each piece from the package by name, for example `@hailstails/hone/mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js`, so the repository's ESLint must resolve `@hailstails/hone` from the repository root. Hone's own ESLint run uses the repository's root `eslint` from step 2, the same copy the projection's pieces load; its verdict is the same on 9.x and 10.x. [README.md](README.md#adopting-the-eslint-mechanism) has the details.
182
+ Commit the projection, every slice and the configs. Hone's check reads this configuration and fails if the projection or a slice is missing, not in effect, or out of date, so re-run `hone:project` whenever `hone.config.json` or `hone-records` changes or Hone is updated. The repository's ESLint must resolve `@hailstails/hone` from the repository root. [README.md](README.md#adopting-the-eslint-mechanism) has the details.
215
183
 
216
184
  ## 5. Run the check
217
185
 
@@ -219,19 +187,13 @@ Commit the projection, every slice and the configs. Hone's check reads this conf
219
187
  npm run --silent hone:check
220
188
  ```
221
189
 
222
- | Exit code | Meaning |
223
- | --- | --- |
224
- | `0` | `verdict: pass` |
225
- | `1` | `verdict: fail`: the report says why |
226
- | `2` | an input could not be loaded or a check crashed; the output is one line starting `load failure:` or names the failing piece |
227
-
228
- `npm run` passes the exit code through. `sh: hone: not found` or `'hone' is not recognized` means step 2's install is missing; run `npm install`. A `load failure: runner-failed <mechanism> toolchain-unavailable <package> ...` line names every toolchain package that is missing from the repository root or outside its range; install a version of each in the range it prints. For a `typescript` that is not installed, the line says the install is incomplete, since a supported install always has its required peer: add `typescript` to the root's `devDependencies` and reinstall. A `toolchain-shadowed <package> resolved from ...` line means a copy of that package sits inside Hone's own install folder, which the line names: delete that `node_modules` folder and reinstall.
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.
229
191
 
230
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.
231
193
 
232
194
  A known limit: `hone check` runs its own ESLint pass over the governed files, even when the repository's own lint has just run. A hook that runs both pays for lint twice. Reusing the repository's lint run is planned after 1.0.
233
195
 
234
- A first adoption assesses decay at push only, so that a hotfix in a carved file is not blocked in CI while the check is new: set `"assessment": { "forfeiture": "elsewhere" }` in `disciplines.json`. CI and the pre-push hook then run different commands. The pre-push hook assesses decay for its run:
196
+ A first adoption assesses forfeiture at push only, so that a hotfix in a file that holds debt is not blocked in CI while the check is new: set `"forfeiture": "elsewhere"` in `hone.config.json`. CI and the pre-push hook then run different commands. The pre-push hook assesses forfeiture for its run:
235
197
 
236
198
  ```bash
237
199
  npm run --silent hone:check -- --forfeiture this-run --base-revision origin/main
@@ -243,15 +205,15 @@ With pnpm:
243
205
  pnpm run --silent hone:check --forfeiture this-run --base-revision origin/main
244
206
  ```
245
207
 
246
- A run that leaves decay to another run ends `verdict: pass (partial assessment)` or `verdict: fail (partial assessment)`, not `verdict: pass` or `verdict: fail`. A hook or gate that matches `verdict: pass` or `verdict: fail` at the end of the line reads neither, and may report the run as unverified. Act on the exit code, or match all four verdict lines that [docs/output-contract.md](docs/output-contract.md#the-report) lists.
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.
247
209
 
248
- CI leaves decay to the hook. A repository with no imported records and no legacy-chain records runs the check with no base revision:
210
+ CI leaves forfeiture to the hook, and with `elsewhere` in effect it can run the check with no base revision:
249
211
 
250
212
  ```bash
251
213
  npm run --silent hone:check
252
214
  ```
253
215
 
254
- A repository with imported records (`provenance`) or legacy-chain records still needs a base revision in CI, because those records are checked against it; without one the report lists `import-unmeasured` or `legacy-chain-unmeasured` and the run fails. Pass the pull request's base commit with `elsewhere` in effect: the base is then used for those records only, and nothing is forfeited. CI needs that one commit fetched, for example `git fetch --depth=1 origin <base-commit>`, not the full history:
216
+ Records carried over by `hone upgrade` follow the same setting. A run given no base leaves them to the run that has one, and says so. A run given a base judges them against it, whatever `forfeiture` says. So keep at least one run that has a base, the pre-push hook above, or they are never judged. If CI should judge them too, pass the pull request's base commit; the base is then used for those records only, and no debt is forfeited. CI needs that one commit fetched, for example `git fetch --depth=1 origin <base-commit>`, not the full history:
255
217
 
256
218
  ```bash
257
219
  npm run --silent hone:check -- --base-revision <base-commit>
@@ -263,11 +225,11 @@ With pnpm:
263
225
  pnpm run --silent hone:check --base-revision <base-commit>
264
226
  ```
265
227
 
266
- A team that assesses decay in CI leaves `assessment` unset and runs `npm run --silent hone:check -- --base-revision origin/main` there, or `pnpm run --silent hone:check --base-revision origin/main`; the check then needs that revision and the history back to where the branch left it, for example `fetch-depth: 0` with `actions/checkout`.
228
+ A team that assesses forfeiture in CI leaves `forfeiture` unset and runs `npm run --silent hone:check -- --base-revision origin/main` there, or `pnpm run --silent hone:check --base-revision origin/main`; the check then needs that revision and the history back to where the branch left it, for example `fetch-depth: 0` with `actions/checkout`.
267
229
 
268
- The trade: a push that bypasses the hook, for example with `git push --no-verify`, leaves no later gate, so carve-out debt can stop decaying unnoticed. Every run that leaves decay to another run says so in its report (step 6). With `eslint` clauses, the repository's own `eslint` run also reports them in the editor, from the projection.
230
+ The trade: a push that bypasses the hook, for example with `git push --no-verify`, leaves no later gate, so debt can stop being forfeited unnoticed. Every run that leaves forfeiture to another run says so in its report (step 6). With `eslint` checks, the repository's own `eslint` run also reports them in the editor, from the projection.
269
231
 
270
- Tell any coding agent working in the repository, in its project instructions: "Read the rule pages under `node_modules/@hailstails/hone/rules/` for the disciplines in `disciplines.json` before editing. When a check fails, read the section for the failing clause in `disciplines.assessment.md` and, in node_modules/@hailstails/hone/rules/typescript/symptoms.md, the "May indicate" and "Breach usually sits" lines of each symptom the clause's rule page names, before changing anything; do not add an exception, exclusion or setting to make it pass. Before handing off, run the repository's validation command, report its exit code and findings, and apply the judgement rules listed in `disciplines.assessment.md` with their review lenses." Copying the rule pages does not make an agent read them; the instruction does. Step 5a writes `disciplines.assessment.md`.
232
+ Tell any coding agent working in the repository, in its project instructions: "Read the rule pages under `node_modules/@hailstails/hone/rules/` for the checks listed in `hone.config.json` before editing. When a check fails, read the `symptoms` section of the report and the section for the failing check in `disciplines.assessment.md`, and, in node_modules/@hailstails/hone/rules/typescript/symptoms.md, the "May indicate" and "Breach usually sits" lines of each symptom the check names, before changing anything; do not add a record, exclusion or setting to make it pass. Before handing off, run the repository's validation command, report its exit code and findings, and apply the judgement rules listed in `disciplines.assessment.md` with their review lenses." Copying the rule pages does not make an agent read them; the instruction does. Step 5a writes `disciplines.assessment.md`; Hone itself does not read or name it.
271
233
 
272
234
  ### 5a. Write the assessment
273
235
 
@@ -281,82 +243,69 @@ Start from the template the package ships:
281
243
  cp node_modules/@hailstails/hone/methods/assessment-template.md disciplines.assessment.md
282
244
  ```
283
245
 
284
- Fill the top sections: the rules adopted, the clauses not adopted because the rule does not apply here, the clauses adopted with their mechanism not run because the check is not a true measure here or cannot work here, and the judgement rules adopted (step 9). Step 4 says how each is declared in `disciplines.json`; the assessment says why.
246
+ Fill the top sections: the rules adopted, the checks not adopted because the rule does not apply here, the checks adopted with their engine not run because the check is not a true measure here or cannot work here, and the judgement rules adopted (step 9). Step 4 says how each is declared in `hone.config.json`; the assessment says why. The template names each by clause address; name each by its check address instead.
285
247
 
286
- Then write one section per high-count clause. Hone has no threshold for this. A clause is high-count when its findings will not all be fixed in the change that adopts it: three findings in one file you fix today need no section; three findings in three folders you will not reach this week do.
248
+ Then write one section per high-count check. Hone has no threshold for this. A check is high-count when its findings will not all be fixed in the change that adopts it: three findings in one file you fix today need no section; three findings in three folders you will not reach this week do.
287
249
 
288
250
  The assessment is usually drafted by a coding agent. Give it this instruction as it is:
289
251
 
290
252
  ```text
291
253
  Draft disciplines.assessment.md from node_modules/@hailstails/hone/methods/assessment-template.md, using the latest hone:check report.
292
254
 
293
- For each clause in the report's findings section whose findings will not all be fixed in this change:
255
+ For each check in the report's findings section whose findings will not all be fixed in this change:
294
256
  1. Measure. Count its findings and group them by folder, by the value, library or dependency involved, and by the shape of the code.
295
257
  2. Read the code at several sites in each group, not only the report lines.
296
- 3. Read the clause's rule page, node_modules/@hailstails/hone/rules/<ID>/README.md, and, in node_modules/@hailstails/hone/rules/typescript/symptoms.md, each symptom it names, closely.
258
+ 3. Read the check's rule page, node_modules/@hailstails/hone/rules/<ID>/README.md, and, in node_modules/@hailstails/hone/rules/typescript/symptoms.md, each symptom the check names, closely, then the `symptoms` section of the report.
297
259
  4. Match each group against the symptom's "May indicate" and "Breach usually sits" lines. Name the cause exactly as the symptoms page names it. If no listed cause fits, say so and describe what the sites show; do not pick the closest.
298
- 5. Write the clause's section from the template: the cause, the count and example sites as file:line, the forward goal in this codebase's terms, and the steps that change the code toward it, starting with the step that unlocks the others.
260
+ 5. Write the check's section from the template, headed by its check address: the cause, the count and example sites as file:line, the forward goal in this codebase's terms, and the steps that change the code toward it, starting with the step that unlocks the others.
299
261
 
300
- Exclusions, exceptions, settings and not adopting a clause are never a cause, a goal or a step. The Debt line says how existing debt is held while the steps are taken; write it last, after the rest of the section. A section that gives only counts, or whose steps are about recording exceptions, is not done.
262
+ Exclusions, records, settings and not adopting a check are never a cause, a goal or a step. The Debt line says how existing debt is held while the steps are taken; write it last, after the rest of the section. A section that gives only counts, or whose steps are about recording exceptions, is not done.
301
263
 
302
- Stop when every such clause has a section. Report the sections for review before changing code or recording exceptions.
264
+ Stop when every such check has a section. Report the sections for review before changing code or recording anything.
303
265
  ```
304
266
 
305
- Review the draft as you would a design: the causes and the goals are the decisions in it. Commit it beside `disciplines.json`. Every failing check then ends with a `readFirst` line per failing clause that names its section before the rule page's Spirit (step 6); a clause the file does not assess is pointed at the Spirit alone. Record exceptions (step 7) only after the assessment, and note each in the clause's Debt line. Keep the file current: when steps land or a count changes, update the section; when a clause has no findings left, delete its section.
267
+ Review the draft as you would a design: the causes and the goals are the decisions in it. Commit it beside `hone.config.json`. Hone does not read it, so point reviewers and agents at it, as step 5's instruction does. Record debt (step 7) only after the assessment, and note each record in the check's Debt line. Keep the file current: when steps land or a count changes, update the section; when a check has no findings left, delete its section.
306
268
 
307
- A finished section reads like this:
269
+ A finished section reads like this, for the check `claimed-type#unlisted-cast-site`:
308
270
 
309
271
  ```markdown
310
- ## CD-2#cast-expressions
272
+ ## claimed-type#unlisted-cast-site
311
273
 
312
274
  - **Cause here:** Parsing skipped at a boundary. Database rows are cast to domain types where they are read.
313
275
  - **Sites:** 118 at 3f1c2ab, in src/orders/ and src/billing/. For example src/orders/order-reader.ts:41, src/billing/invoice-reader.ts:17.
314
276
  - **Forward goal:** rows are parsed once in the storage port, and services receive typed orders and invoices.
315
277
  - **Steps:** 1. A schema per table read, in the storage port. 2. The port returns parsed types. 3. Delete the casts, one folder at a time.
316
- - **Debt:** held by the orders team; file carve-outs in discipline-exceptions.json, paid off as each file is touched.
278
+ - **Debt:** held by the orders team; debt records in hone-records/debt/claimed-type.json, paid off as each file is touched.
317
279
  ```
318
280
 
319
281
  ## 6. Read the report
320
282
 
321
- The report prints only the sections that have entries, each with its count, then the verdict. A finding line is:
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.
322
284
 
323
- ```text
324
- <clause> <mechanism> <file>:<line>:<column> <snippet>
325
- CD-15#loops audit src/basket.ts:15:0 for (const line of this.lines) {
326
- ```
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.
327
286
 
328
- [docs/output-contract.md](docs/output-contract.md) lists every line the report can print, exactly as printed, and which parts are stable. Lines are 1-based and columns 0-based. The run passes only when every section except `excluded`, `notAdopted`, `notRun`, `editions`, `exempted`, `assessment` and `readFirst` is empty. The sections are:
287
+ ## 7. Record what a check cannot be made to accept
329
288
 
330
- | Section | Meaning and what to do |
331
- | --- | --- |
332
- | `excluded` | the `exclude` entries from `disciplines.json` that were left out of the run; informational, check it is what you meant |
333
- | `notAdopted` | the clauses `disciplines.json` lists as `"not-adopted"`; informational, they were neither run nor projected |
334
- | `notRun` | the clauses `disciplines.json` lists as `"not-run"`, each as `<clause> adopted, mechanism not run: enforced by review`; informational, they were neither run nor projected, and the rule is still owed through review |
335
- | `editions` | each clause whose check has more than one edition, with the edition that ran and the latest, as `<clause> <mechanism> edition <edition> of <latest>`; informational, see `checkEditions` in [step 4](#4-write-disciplinesjson) |
336
- | `findings` | violations: fix the code, or record an exception (step 7) |
337
- | `exempted` | findings an exception covers; informational |
338
- | `unrecorded` | a native exception no record holds, as `<clause> <mechanism> <kind> <detail>`: remove it, or record it where step 7 allows. An inline disable, `<clause> eslint inline-disable <file>:<line> <comment>`, and a TypeScript directive, `CD-2#cast-expressions audit inline-disable <file>:<line> <comment>`, are held only by an `authorised-location` or `file-carve-out` on that clause and file. An `eslint-disable` naming no rule escapes every selected clause, needs a record for each, and its lines end ` names no rule and escapes every selected clause: naming the rule is the cheap fix`. A lint-script option, `<clause> eslint command-line-option <package.json> <script> <option> weakens the script's whole run, so no record can cover it: remove it from the script`, cannot be recorded. Where another command comes before `eslint` in its script, as in `tsc && eslint -c eslint.config.mjs .`, the line instead reads `<clause> eslint command-line-option <package.json> <script> <option>: <command> is not the first command of its script, so Hone cannot tell what the option does to the files under check; give <command> a script of its own, such as "<invocation>"`: move that command to a script of its own. Where something before `eslint` in its own command is neither a package runner nor a `NAME=value` setting, as `env` in `env --chdir=src eslint --ignore-pattern dist .` or `-y` in `npx -y eslint --ignore-pattern dist .`, it reads `<clause> eslint command-line-option <package.json> <script> <option>: "<wrapper>" comes before <command> and is neither a package runner nor a NAME=value setting, so Hone cannot tell what the option does to the files under check; put only package runners and NAME=value settings before <command>`. `cross-env` followed only by `NAME=value` settings counts as a setting |
339
- | `uncovered` | a mechanical clause of an adopted discipline is not listed: add it to `disciplines.json` with a mechanism, `"not-run"` or `"not-adopted"` |
340
- | `stale` | an exception that no longer exempts anything. A `file-carve-out` whose debt is paid is removed by the `hone prune-debt` command the last `readFirst` line names; run it, then `npm run --silent hone:project`. Delete every other stale record by hand, including a `file-carve-out` on a file its mechanism did not measure, then run `hone:project` again ([README.md](README.md#pruning-paid-debt)). Right after a move from an older route, first check that its settings were carried over ([MIGRATING.md](MIGRATING.md#2a-carry-over-the-old-routes-settings) step 2a) |
341
- | `forfeited` | a file carve-out whose file changed since `--base-revision`: fix the file and delete the carve-out |
342
- | `invalidRecords` | an exception entry that cannot be accepted, with the reason, for example `clause-not-run` or `clause-not-adopted` for an entry on a clause listed as `"not-run"` or `"not-adopted"`: correct or delete it |
343
- | `doublyHeld` | a file both authorised and carved out for one clause: keep one |
344
- | `unmeasured` | something could not be measured; each line says what, why and what Hone needs, for example `forfeiture-unmeasured no-base-revision: no --base-revision was given, so file carve-outs cannot be checked for decay; pass --base-revision with the branch's base, such as origin/main, or leave decay to another run with "assessment": { "forfeiture": "elsewhere" } in disciplines.json or --forfeiture elsewhere` |
345
- | `projectionProblems` | a projection or package slice that differs from what `hone project` writes now, is not written, is not applied, or has no configuration to load it, each with what to do, for example `eslint out-of-date: disciplines.eslint.mjs differs from what hone project writes now; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every disciplines.eslint.mjs it writes` |
346
- | `assessment` | a concern this run left to another run, for example `forfeiture elsewhere: 37 file carve-outs not checked for decay in this run`; informational, and the verdict line then reads `verdict: pass (partial assessment)` or `verdict: fail (partial assessment)` |
347
- | `readFirst` | printed last, one line per clause with findings: where to read before changing code, the clause's section in `disciplines.assessment.md` (step 5a) and then the Spirit section of its rule page, for example `CD-15#loops: read the "## CD-15#loops" section of disciplines.assessment.md, then node_modules/@hailstails/hone/rules/CD-15/README.md#spirit`; before the file is written, one note line comes first, counted in the section, and each clause line names its rule page only, as in the walkthrough below; guidance, it never fails the run |
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:
348
290
 
349
- To print less, set `"reportOutput"` in `disciplines.json` for the repository, or pass `--report-output <output>` for one run, which wins over the file. `full` is the default and prints the report above; `failures-only` leaves out `excluded`, `notAdopted`, `notRun`, `editions`, `exempted` and `assessment`, and keeps `readFirst`; `counts` prints only each section's heading and count, adding `informational` after `excluded`, `notAdopted`, `notRun`, `editions`, `exempted` and `assessment` and `guidance` after `readFirst` so every other line names a section that failed the run; `verdict-only` prints only the verdict line. Every output ends in the verdict line, and the exit code is the same whichever output you choose. An unknown value fails the run with exit `2`, as `arguments-invalid` for the option or `file-malformed` for the file.
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`:
350
294
 
351
- ## 7. Record exceptions
295
+ ```json
296
+ {
297
+ "version": 2,
298
+ "records": [
299
+ { "module": "src/clock.ts", "outsideParty": "runtime:clock", "ports": ["Clock"] }
300
+ ]
301
+ }
302
+ ```
352
303
 
353
- 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 clause, ask what each group points at using the "May indicate" and "Breach usually sits" lines of each symptom on [the symptoms page](rules/typescript/symptoms.md) and the clause's section in `disciplines.assessment.md` (step 5a), then decide. Fix the cause where you can; exceptions are not the first move. Where a file legitimately needs what a clause forbids, record it in `<repo>/discipline-exceptions.json`:
304
+ - **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`.
354
305
 
355
- - `authorised-location`: the clause does not apply to this one file, for example the single adapter that reads the real clock.
356
- - `file-carve-out`: known debt in one 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 already in a file is debt of this kind on the clause it escapes; a new one in a file with no record is `unrecorded`.
357
- - `clause-wide-carve-out`: debt across the whole clause. The rule binds and its check is sound, and the codebase cannot address the debt right now. Its why-chain records why, and the debt has an owner who will pay it down. The check still runs, and a clause-wide carve-out that exempts no finding is `stale`, so record one only while the clause still has findings. Leaving the clause out of `clauses` is not an alternative: it leaves the clause `uncovered`. If the check is not a true measure of the rule here, or cannot work here, list the clause as `"not-run"` instead; if the rule does not apply, list it as `"not-adopted"` (step 4).
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).
358
307
 
359
- A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note to future developers. Every other entry needs a `reason`, and an `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` shaped like this, with exactly five steps in `whys`:
308
+ An authorised location needs its `case`, its `owes` and a `whyChain` shaped like this, with exactly five steps in `whys`; debt needs none:
360
309
 
361
310
  ```json
362
311
  "whyChain": {
@@ -368,27 +317,25 @@ A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `
368
317
  { "why": "...", "because": "...", "evidence": "..." }
369
318
  ],
370
319
  "rootCause": "...",
371
- "rootCheck": "...",
320
+ "rootEvidence": "...",
372
321
  "readback": "...",
373
322
  "owner": "..."
374
323
  }
375
324
  ```
376
325
 
377
- The chain runs cause to cause: each why asks why the answer before it is true, each answer cites evidence that can be checked again, the root names the fifth answer's cause and is checked against today, and the readback runs back from the root to the symptom with "therefore". [The why-chain contract](docs/why-chain-contract.md) has a worked example, the checks Hone runs, and what review still judges. A chain that breaks a check is refused as an `invalidRecords` entry. `file` is an exact repository path.
378
-
379
- Debt or authorisations already recorded by an earlier system, for example the old standalone route's `.constitution-carve-outs/`, can be imported with `provenance` instead of a `whyChain`, as [MIGRATING.md](MIGRATING.md#3-convert-the-old-records-into-exceptions) step 3 shows. Imported entries are checked against `--base-revision`: by default, any entry you write or change yourself needs the full `whyChain`.
326
+ The chain runs cause to cause: each why asks why the answer before it is true, each answer cites evidence that can be checked again, the root names the fifth answer's cause and is checked against today, and the readback runs back from the root to the symptom with "therefore". [The why-chain contract](docs/why-chain-contract.md) has a worked example, the checks Hone runs, and what review still judges. A chain that breaks a check is refused. `file` is an exact repository path.
380
327
 
381
- The records live in `discipline-exceptions.json` by default. To keep one file for each rule and kind instead, so the name of a changed file says which rule and which kind a change touches, move to the split layout with `hone split-records`, as [MIGRATING.md](MIGRATING.md#16-moving-to-the-split-layout) section 16 shows; [README.md](README.md#the-split-layout) describes the layout. Everything that reads or writes records works the same in either.
328
+ Records an earlier version wrote are moved by `hone upgrade` and kept word for word under `carried`, as [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 says. They are checked against `--base-revision`: any record you write or change yourself needs its full form.
382
329
 
383
- Existing debt needs no chain and no reason: a `file-carve-out` names only its clause and file, and step 7a writes those records for you. Add a `reason` if you want to leave future developers a note on what the debt signals. A run with any file carve-out still needs `--base-revision`, or it reports `forfeiture-unmeasured` and fails. `"fileExceptionWhyChains": "optional"` in `disciplines.json` lets an `authorised-location` give only its `reason` too, but a reason-only `authorised-location` will be refused in the next major release. A `clause-wide-carve-out` still needs its `whyChain`, and a `whyChain` or `provenance` you give anyway is still checked. [README.md](README.md#discipline-exceptionsjson) has the details.
330
+ Existing debt needs no chain and no case: a debt record names only its symptom and file, and step 7a writes those records for you. Add a `note` if you want to leave future developers a note on what the debt signals. A run with any debt still needs `--base-revision`, or it reports `forfeiture-unmeasured` and fails, unless forfeiture is left to another run (step 5). [README.md](README.md#hone-records) has the details.
384
331
 
385
332
  ### 7a. Record the debt you inherit
386
333
 
387
- A repository with existing code usually has more findings than the change that adopts Hone can fix. `hone record-debt` writes a `file-carve-out` for each clause and file the check finds broken, 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.
334
+ 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.
388
335
 
389
- 1. **Decide the permanent exceptions first.** List each file or folder that breaks a clause 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 their own reason, written by a person, so keep them out of the generated records with `--leave`.
390
- 2. **Leave `disciplines.json` as it is, and put every check on this release.** The records the command writes are file carve-outs, which are debt and need no `whyChain` and no `reason`, so it needs no setting. The same command records debt a later change uncovers, such as a newly selected clause or a newer edition: run it again against the branch's base. A Hone from before file carve-outs could leave out `reason` refuses such a record: the whole check stops with `load failure: file-malformed <records file> … at exceptions[<index>].reason` and exits `2`. So before the command writes any record, update the Hone that every pre-push hook, CI job and other machine runs to this release or later, as [ADOPTING.md](#10-update-and-remove) step 10 says, or that check stops.
391
- 3. **Finish every source file this change edits.** Decay 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. In each file this change edits, fix every finding of each clause, 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 `new-file`.
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`.
337
+ 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
+ 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`.
392
339
  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:
393
340
 
394
341
  ```bash
@@ -396,17 +343,17 @@ A repository with existing code usually has more findings than the change that a
396
343
  node_modules/.bin/hone record-debt --repo . --base-revision origin/main --leave src/clock.ts --leave src/adapters
397
344
  ```
398
345
 
399
- It prints one line per clause and file. `recorded` lines are records it added to the exception records. `left` lines are files under a `--leave` path: write their `authorised-location` records now, each with its own reason. `new-file` lines are files the base revision does not hold, so nothing in them was inherited: fix them, or record them yourself with a reason of your own. `already-recorded`, `refused` and `nested-configuration` lines say why nothing was written; [README.md](README.md#recording-inherited-debt) has the details.
400
- 5. **Re-project and check against the same base.** With any `eslint` clause, 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 decay whatever `assessment.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. The generated records leave only what point 4 did not record, such as `config-override` or lint-script options under `unrecorded`, which step 6 says how to clear.
401
- 6. **Review the diff.** Nothing takes effect until you commit it. Each generated record says it is inherited debt that nobody has reviewed, and the reviewer of the adopting change reads them as that. Note them in each clause's Debt line in `disciplines.assessment.md`.
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.
347
+ 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
+ 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`.
402
349
 
403
- The records are the same as any other `file-carve-out`: each is forfeited once its file changes, which is how the debt is paid down. A file with no earlier revision gets no record, because it has no debt to inherit. The command is for adoption, but it does not refuse to run again: forfeiture already stops it turning new findings into carve-outs, since a record written for a file just changed is forfeited by the next check that assesses decay. That holds only where decay is assessed. With `"assessment": { "forfeiture": "elsewhere" }` (step 5), it is assessed only by the run that the repository leaves it to, such as the pre-push hook, so a push that bypasses that run lets such a record through until a later run assesses it.
350
+ The records are the same as any other debt record: each is forfeited once its file changes, which is how the debt is paid down. A file with no earlier revision gets no record, because it has no debt to inherit. The command is for adoption, but it does not refuse to run again: forfeiture already stops it turning new findings into debt, since a record written for a file just changed is forfeited by the next check that assesses forfeiture. That holds only where forfeiture is assessed. With `"forfeiture": "elsewhere"` (step 5), it is assessed only by the run that the repository leaves it to, such as the pre-push hook, so a push that bypasses that run lets such a record through until a later run assesses it.
404
351
 
405
- Running it again only adds records for pairs that have none; it never removes or rewrites one. A record whose debt is paid is reported `stale`, or `forfeited` with no finding left on its file that only debt answers. `hone prune-debt` removes it when its file no longer exists or its mechanism measured its clause on that file, every finding still there is answered by an `authorised-location` in force, and no native suppression, such as an inline disable or a config override, recorded or not, sits on its clause and file. An imported `authorised-location`, or one with a legacy why-chain, answers nothing on a run whose records at the base revision could not be read. Otherwise delete it by hand ([README.md](README.md#pruning-paid-debt)).
352
+ Running it again only adds records for symptoms, checks and files that have none; it never removes or rewrites one. Debt that is paid is listed `paid`, or `stale` when nothing it holds is found, and `forfeited` once its file is touched. `hone prune-debt` removes it, as [README.md](README.md#pruning-paid-debt) says; any other record that has gone stale you delete by hand.
406
353
 
407
354
  ## 8. Prove one failure and correction
408
355
 
409
- Before relying on the check, prove that it fails on a real violation in your repository and passes once it is fixed. With CD-17 selected, create `src/discipline-probe.ts` (any path the check covers) containing exactly:
356
+ Before relying on the check, prove that it fails on a real violation in your repository and passes once it is fixed. With `date-used-directly#clock-sources` listed, create `src/discipline-probe.ts` (any path the check covers) containing exactly:
410
357
 
411
358
  ```ts
412
359
  const probeStartedAt = Date.now();
@@ -419,72 +366,30 @@ git add src/discipline-probe.ts
419
366
  npm run --silent hone:check
420
367
  ```
421
368
 
422
- It must exit `1` with the line `CD-17#clock-sources audit src/discipline-probe.ts:1:0 const probeStartedAt = Date.now();` among its findings. Change the same file to `const probeStartedAt = 0;`, stage it, and run the check again: that finding must be gone. Then remove the probe with `git rm -f src/discipline-probe.ts`. A run that never showed the finding proves nothing: check that the file was staged and is not under an `exclude` entry. For another discipline, take a flag case from its `rules/<ID>/discipline.json`.
369
+ It must exit `1` with a `date-used-directly#clock-sources` finding at `src/discipline-probe.ts:1`. Change the same file to `const probeStartedAt = 0;`, stage it, and run the check again: that finding must be gone. Then remove the probe with `git rm -f src/discipline-probe.ts`. A run that never showed the finding proves nothing: check that the file was staged and is not under an `exclude` entry. For another check, take a flagged form from its check page.
423
370
 
424
371
  ## 9. Apply the judgement rules
425
372
 
426
- A judgement clause cannot be selected in `disciplines.json`, and no check reports it. List the judgement rules the repository adopts in the Judgement rules section of `disciplines.assessment.md` (step 5a), so reviewers and agents know to apply them.
373
+ A judgement clause cannot be listed in `hone.config.json`, and no check reports it. List the judgement rules the repository adopts in the Judgement rules section of `disciplines.assessment.md` (step 5a), so reviewers and agents know to apply them.
427
374
 
428
- Each rule page names its review lens, a method under [methods/lenses/](methods/README.md) for reading code against that kind of rule. To review a change, by a human reviewer or a coding agent:
375
+ Each rule item names its review lenses in its `lenses` fact, each a method under [methods/lenses/](methods/README.md) for reading code against that kind of rule. To review a change, by a human reviewer or a coding agent:
429
376
 
430
377
  1. The reviewer is not the change's author. An agent reviewing a change reads files only; it does not edit them.
431
378
  2. Pin the tree under review to a commit and review that.
432
- 3. Run each lens on its own, one concern at a time, without seeing the other lenses' findings. Follow the lens file: load the rule pages that name it, inspect the change as it says, and report findings in its output shape, citing the clause address. A lens covers mechanical rules too, beyond what their checks flag.
379
+ 3. Run each lens on its own, one concern at a time, without seeing the other lenses' findings. Follow the lens file: load the rule items that name it, inspect the change as it says, and report findings in its output shape, citing the clause address. A lens covers mechanical rules too, beyond what their checks flag.
433
380
  4. Run [defended-on-intent](methods/lenses/defended-on-intent.md) last, over the rule text and the other lenses' findings, to catch changes that meet a rule's letter but defeat its intent.
434
381
  5. Fix each finding. A deliberate departure from a judgement rule is recorded where the review decision is kept, with a `whyChain` in the same shape as step 7.
435
382
 
436
- To use an agent, give it the lens file, the rule pages it names, the change and the pinned commit, and ask it to follow the lens exactly. A single reviewer covering every concern at once misses what separate lenses catch.
383
+ To use an agent, give it the lens file, the rule items that name it, the change and the pinned commit, and ask it to follow the lens exactly. A single reviewer covering every concern at once misses what separate lenses catch.
437
384
 
438
385
  ## 10. Update and remove
439
386
 
440
- To update, on a branch, read [the changelog](https://github.com/HailsTails/hone/blob/main/CHANGELOG.md) for each version since yours, then install the new version exactly as step 2 does, with `npm install --save-dev --save-exact @hailstails/hone@<version>` or `pnpm add -D --save-exact @hailstails/hone@<version>`. Compare the installed rule pages under `node_modules/@hailstails/hone/rules/` with the old ones, re-run `hone:project` if any clause is `eslint`, run the check, and commit `package.json` and the lockfile with a message naming the new version. With a tarball, replace it with the newer one and install that instead. Rule text can change between versions, so read the changed pages. Before updating to a pin that has the causal why-chain contract, follow [MIGRATING.md section 8](MIGRATING.md#8-moving-to-causal-why-chains): pass `--base-revision` first, or the update's check reports `legacy-chain-unmeasured`.
387
+ To update, on a branch, read [the changelog](https://github.com/HailsTails/hone/blob/main/CHANGELOG.md) for each version since yours, then install the new version exactly as step 2 does, with `npm install --save-dev --save-exact @hailstails/hone@<version>` or `pnpm add -D --save-exact @hailstails/hone@<version>`. Compare the installed rule pages under `node_modules/@hailstails/hone/rules/` with the old ones, re-run `hone:project` if any check is on `eslint`, run the check, and commit `package.json` and the lockfile with a message naming the new version. With a tarball, replace it with the newer one and install that instead. Rule text can change between versions, so read the changed pages. Version 2 reads different files from version 1: a repository on version 1 runs `hone upgrade` once after installing version 2, as [MIGRATING.md section 20](MIGRATING.md#20-moving-from-version-1-to-version-2) says, before it runs the check.
441
388
 
442
- To remove, run `npm uninstall @hailstails/hone`, delete the two `hone:` scripts, any vendored tarball, `disciplines.json`, `discipline-exceptions.json`, `disciplines.assessment.md` and, with `eslint` clauses, `disciplines.eslint.mjs` and its spread in the flat config, and take the check out of the validation script.
443
-
444
- ## Worked example
445
-
446
- In the Hone source repository, `tests/test-fixtures/walkthrough/` is a small repository before and after its fix, selecting CD-2, CD-15, CD-17 and CD-23 through the audit, with CD-2's ESLint-only `non-null-assertions` clause listed as `"not-run"`, because the repository has no ESLint, and a `generated/` folder excluded. `tests/walkthrough.integration.test.ts` pins both reports exactly, apart from where the rule pages are (see below).
447
-
448
- Before, `npm run --silent hone:check` prints, and exits `1`:
449
-
450
- ```text
451
- excluded (1)
452
- generated
453
- notRun (1)
454
- CD-2#non-null-assertions adopted, mechanism not run: enforced by review
455
- findings (5)
456
- CD-17#clock-sources audit src/basket.ts:7:0 private openedAt = Date.now();
457
- CD-2#cast-expressions audit src/basket.ts:10:20 entry as Line); } total(): string { let pence = 0; for (const line …
458
- CD-15#loops audit src/basket.ts:15:0 for (const line of this.lines) {
459
- CD-17#clock-sources audit src/basket.ts:22:0 return Date.now() - this.openedAt;
460
- CD-23#export-test-sibling audit src/utils/format.ts:1:0 missing co-located *.test.ts(x) sibling
461
- readFirst (5)
462
- Start from each rule's Spirit below. disciplines.assessment.md, where this repository records its own causes, forward goal and steps for a clause, is not written yet; node_modules/@hailstails/hone/ADOPTING.md#5a-write-the-assessment says how to write it.
463
- CD-17#clock-sources: read node_modules/@hailstails/hone/rules/CD-17/README.md#spirit
464
- CD-2#cast-expressions: read node_modules/@hailstails/hone/rules/CD-2/README.md#spirit
465
- CD-15#loops: read node_modules/@hailstails/hone/rules/CD-15/README.md#spirit
466
- CD-23#export-test-sibling: read node_modules/@hailstails/hone/rules/CD-23/README.md#spirit
467
- verdict: fail
468
- ```
469
-
470
- The test runs against the source repository rather than an install, so the report it pins names the rule pages and the adoption guide from there: `../../../../rules/CD-17/README.md` and `../../../../ADOPTING.md` where an installed package prints `node_modules/@hailstails/hone/rules/CD-17/README.md` and `node_modules/@hailstails/hone/ADOPTING.md`.
471
-
472
- The fix replaces the `Basket` class with functions over a readonly `Basket` value, sums with `reduce`, takes the time from an injected `Clock`, types the input instead of casting it, moves `src/utils/format.ts` to `src/format.ts` with a `src/format.test.ts` sibling, and records `src/clock.ts`, the one adapter that reads `Date.now()`, as an authorised location. After, the same command prints, and exits `0`:
473
-
474
- ```text
475
- excluded (1)
476
- generated
477
- notRun (1)
478
- CD-2#non-null-assertions adopted, mechanism not run: enforced by review
479
- exempted (1)
480
- CD-17#clock-sources audit src/clock.ts:3:0 export const createSystemClock = (): Clock => ({ now: () => Date.now() }); exempted by authorised-location
481
- verdict: pass
482
- ```
389
+ To remove, run `npm uninstall @hailstails/hone`, delete the two `hone:` scripts, any vendored tarball, `hone.config.json`, `hone-records`, `disciplines.assessment.md` and, with `eslint` checks, `hone.eslint.mjs`, `hone.eslint.d.mts`, every package slice and their spread in the flat config, and take the check out of the validation script.
483
390
 
484
391
  ## Known gaps
485
392
 
486
- - The worked example uses only the audit mechanism. The ESLint consumer in `tests/test-fixtures/consumer-proof/eslint/` is the tested ESLint setup.
487
- - Each check flags exactly what its CHECKS.md says and no more. Where a rule asks for more than its check can see, the page says which part is left to review.
488
- - A snippet is the text the check reports; some checks report a fixed-width window that runs across lines, as CD-2 does above. No snippet is longer than 200 characters: a longer one is cut and ends in `…`. An ESLint finding on a line longer than that, such as a bundled or minified file, shows the line from the finding's column.
393
+ - Each check flags exactly what its page says and no more. Where a rule asks for more than its check can see, the page says which part is left to review.
489
394
  - A broken nested `eslint.config.*` in a folder the root config ignores, such as fixtures under `ignores: ["fixtures/**"]`, does not stop the check: those files are reported as `ignore` native exceptions, as the team's own `eslint .` never loads that config. One pattern shape is taken for a folder ignore although it is not one: an ignore matching every entry directly inside the folder, such as `gen/*`, where the team's ESLint still enters `gen` and fails on its broken config.
490
395
  - The disciplines' IDs and rule text come from one team's code-discipline set. Selecting a subset is supported; editing a shipped rule is not. Write your own rule set for different rules, following [docs/extending.md](docs/extending.md).