@hailstails/hone 1.4.0 → 2.0.0-pre.1

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 +239 -168
  2. package/CHANGELOG.md +141 -0
  3. package/MIGRATING.md +145 -45
  4. package/README.md +148 -182
  5. package/chunks/chunk-5HRMJ4O2.js +608 -0
  6. package/chunks/chunk-5U4JMWNV.js +9 -0
  7. package/chunks/{chunk-FEWCJU7H.js → chunk-ASUN4AVC.js} +31 -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 +23 -19
  31. package/docs/extending.md +6 -5
  32. package/docs/output-contract.md +713 -16
  33. package/docs/why-chain-contract.md +6 -6
  34. package/methods/README.md +2 -2
  35. package/methods/assessment-template.md +3 -3
  36. package/methods/lenses/clean-architecture.md +26 -62
  37. package/methods/lenses/decomposition.md +7 -7
  38. package/methods/lenses/defended-on-intent.md +6 -6
  39. package/methods/lenses/di-discipline.md +18 -21
  40. package/methods/lenses/errors-as-data.md +6 -6
  41. package/methods/lenses/function-first.md +25 -27
  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 +335 -54
  48. package/rules/SPIRIT.md +4 -4
  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 +71 -0
  78. package/rules/numbers.md +155 -0
  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 +93 -0
  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 +137 -0
  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 +185 -0
  113. package/rules/sources.md +142 -0
  114. package/rules/typescript/checks.md +1685 -0
  115. package/rules/typescript/recipes/adapter-per-outside-party.md +18 -0
  116. package/rules/typescript/recipes/assert-to-narrow.md +18 -0
  117. package/rules/typescript/recipes/bounded-context-generic.md +19 -0
  118. package/rules/typescript/recipes/closure-factory.md +20 -0
  119. package/rules/typescript/recipes/companion-test-file.md +18 -0
  120. package/rules/typescript/recipes/composed-orchestrator.md +18 -0
  121. package/rules/typescript/recipes/composition-root.md +18 -0
  122. package/rules/typescript/recipes/copy-never-write-in.md +18 -0
  123. package/rules/typescript/recipes/declared-not-bundled.md +17 -0
  124. package/rules/typescript/recipes/dependency-record.md +20 -0
  125. package/rules/typescript/recipes/domain-vocabulary-list.md +18 -0
  126. package/rules/typescript/recipes/entity-module.md +20 -0
  127. package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +18 -0
  128. package/rules/typescript/recipes/extension-outside-the-vendored-code.md +18 -0
  129. package/rules/typescript/recipes/failure-asserted-as-a-value.md +18 -0
  130. package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +20 -0
  131. package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +18 -0
  132. package/rules/typescript/recipes/functional-iteration.md +18 -0
  133. package/rules/typescript/recipes/guard-clauses.md +18 -0
  134. package/rules/typescript/recipes/integration-test-owns-its-scratch.md +18 -0
  135. package/rules/typescript/recipes/integration-test-suffix.md +18 -0
  136. package/rules/typescript/recipes/iteach-over-typed-rows.md +18 -0
  137. package/rules/typescript/recipes/map-out-at-the-adapter.md +18 -0
  138. package/rules/typescript/recipes/meaning-in-names-not-comments.md +22 -0
  139. package/rules/typescript/recipes/named-exported-type.md +18 -0
  140. package/rules/typescript/recipes/narrow-ports.md +18 -0
  141. package/rules/typescript/recipes/one-argument-object.md +19 -0
  142. package/rules/typescript/recipes/port-in-the-domain.md +19 -0
  143. package/rules/typescript/recipes/ports-in-the-argument.md +18 -0
  144. package/rules/typescript/recipes/repo-scripts-only.md +18 -0
  145. package/rules/typescript/recipes/result-union.md +22 -0
  146. package/rules/typescript/recipes/screaming-folders.md +20 -0
  147. package/rules/typescript/recipes/shared-strict-base-config.md +20 -0
  148. package/rules/typescript/recipes/stub-with-vifn.md +20 -0
  149. package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +18 -0
  150. package/rules/typescript/recipes/whole-words.md +18 -0
  151. package/rules/typescript/recipes/whole-written-out-expectation.md +18 -0
  152. package/rules/typescript/recipes/world-values-through-a-port.md +18 -0
  153. package/rules/typescript/recipes/zod-at-the-producers-adapter.md +19 -0
  154. package/rules/typescript/recipes.md +390 -0
  155. package/rules/typescript/symptoms/absence-standing-for-a-state.md +36 -0
  156. package/rules/typescript/symptoms/adapter-built-outside-the-root.md +30 -0
  157. package/rules/typescript/symptoms/ambient-randomness.md +36 -0
  158. package/rules/typescript/symptoms/answer-set-in-a-hook.md +45 -0
  159. package/rules/typescript/symptoms/authored-class-or-this/class-keyword.md +30 -0
  160. package/rules/typescript/symptoms/authored-class-or-this/static-members-only.md +18 -0
  161. package/rules/typescript/symptoms/authored-class-or-this.md +49 -0
  162. package/rules/typescript/symptoms/behaviour-tested-away-from-its-owner.md +44 -0
  163. package/rules/typescript/symptoms/boolean-in-a-signature/boolean-annotation.md +30 -0
  164. package/rules/typescript/symptoms/boolean-in-a-signature.md +43 -0
  165. package/rules/typescript/symptoms/branch-in-a-test/test-body.md +213 -0
  166. package/rules/typescript/symptoms/branch-in-a-test.md +48 -0
  167. package/rules/typescript/symptoms/bundled-dependency.md +28 -0
  168. package/rules/typescript/symptoms/catch-all-failure-kind.md +37 -0
  169. package/rules/typescript/symptoms/change-spread-across-modules.md +27 -0
  170. package/rules/typescript/symptoms/claimed-type/cast-to-any.md +29 -0
  171. package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +34 -0
  172. package/rules/typescript/symptoms/claimed-type/unlisted-cast-site.md +34 -0
  173. package/rules/typescript/symptoms/claimed-type.md +56 -0
  174. package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +144 -0
  175. package/rules/typescript/symptoms/computed-value-in-a-test.md +36 -0
  176. package/rules/typescript/symptoms/coverage-gate.md +27 -0
  177. package/rules/typescript/symptoms/date-used-directly/clock-sources.md +31 -0
  178. package/rules/typescript/symptoms/date-used-directly.md +46 -0
  179. package/rules/typescript/symptoms/default-for-a-required-value.md +45 -0
  180. package/rules/typescript/symptoms/default-on-a-closed-union/default-arm.md +32 -0
  181. package/rules/typescript/symptoms/default-on-a-closed-union.md +32 -0
  182. package/rules/typescript/symptoms/dependency-without-a-record.md +33 -0
  183. package/rules/typescript/symptoms/doer-calling-our-own-unit.md +36 -0
  184. package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +32 -0
  185. package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +31 -0
  186. package/rules/typescript/symptoms/double-with-a-body.md +55 -0
  187. package/rules/typescript/symptoms/drawer-path/drawer-names.md +28 -0
  188. package/rules/typescript/symptoms/drawer-path.md +32 -0
  189. package/rules/typescript/symptoms/duplicate-decision.md +36 -0
  190. package/rules/typescript/symptoms/edit-inside-vendored-code.md +33 -0
  191. package/rules/typescript/symptoms/failure-shaped-as-success.md +28 -0
  192. package/rules/typescript/symptoms/floating-version.md +27 -0
  193. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +30 -0
  194. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess.md +33 -0
  195. package/rules/typescript/symptoms/inner-layer-imports-outer.md +33 -0
  196. package/rules/typescript/symptoms/integration-heavy-suite.md +29 -0
  197. package/rules/typescript/symptoms/large-input-for-a-few-fields.md +37 -0
  198. package/rules/typescript/symptoms/library-class-built-in-place.md +42 -0
  199. package/rules/typescript/symptoms/long-function/function-length.md +47 -0
  200. package/rules/typescript/symptoms/long-function.md +75 -0
  201. package/rules/typescript/symptoms/loop-keyword/loop-statement.md +34 -0
  202. package/rules/typescript/symptoms/loop-keyword.md +49 -0
  203. package/rules/typescript/symptoms/machine-touched-in-a-unit-test.md +40 -0
  204. package/rules/typescript/symptoms/many-spellings-of-one-concept.md +29 -0
  205. package/rules/typescript/symptoms/module-level-state.md +30 -0
  206. package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +29 -0
  207. package/rules/typescript/symptoms/module-or-global-patched.md +38 -0
  208. package/rules/typescript/symptoms/name-off-its-casing/filename-case.md +16 -0
  209. package/rules/typescript/symptoms/name-off-its-casing/naming-convention.md +20 -0
  210. package/rules/typescript/symptoms/name-off-its-casing.md +31 -0
  211. package/rules/typescript/symptoms/no-lock-file.md +27 -0
  212. package/rules/typescript/symptoms/orchestrator-that-computes.md +27 -0
  213. package/rules/typescript/symptoms/outside-dependency-vocabulary-for-basic-logic.md +33 -0
  214. package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +44 -0
  215. package/rules/typescript/symptoms/outside-import-past-a-boundary.md +45 -0
  216. package/rules/typescript/symptoms/outside-type-in-a-signature.md +37 -0
  217. package/rules/typescript/symptoms/own-type-guard.md +36 -0
  218. package/rules/typescript/symptoms/port-named-for-a-mechanism.md +34 -0
  219. package/rules/typescript/symptoms/port-outside-the-domain.md +28 -0
  220. package/rules/typescript/symptoms/positional-parameters/parameter-count.md +30 -0
  221. package/rules/typescript/symptoms/positional-parameters.md +43 -0
  222. package/rules/typescript/symptoms/process-global-used-in-place.md +53 -0
  223. package/rules/typescript/symptoms/prose-in-code.md +27 -0
  224. package/rules/typescript/symptoms/rebinding/parameter-reassignment.md +18 -0
  225. package/rules/typescript/symptoms/rebinding/test-body.md +32 -0
  226. package/rules/typescript/symptoms/rebinding.md +36 -0
  227. package/rules/typescript/symptoms/schema-past-its-adapter.md +41 -0
  228. package/rules/typescript/symptoms/shorthand-name/identifier-names.md +29 -0
  229. package/rules/typescript/symptoms/shorthand-name.md +32 -0
  230. package/rules/typescript/symptoms/strictness-weakened/exact-optional-property-types.md +51 -0
  231. package/rules/typescript/symptoms/strictness-weakened/no-fallthrough-cases-in-switch.md +51 -0
  232. package/rules/typescript/symptoms/strictness-weakened/no-implicit-override.md +51 -0
  233. package/rules/typescript/symptoms/strictness-weakened/no-property-access-from-index-signature.md +51 -0
  234. package/rules/{CD-3/CHECKS.md → typescript/symptoms/strictness-weakened/no-unchecked-indexed-access.md} +23 -38
  235. package/rules/typescript/symptoms/strictness-weakened/strict.md +51 -0
  236. package/rules/typescript/symptoms/strictness-weakened/use-unknown-in-catch-variables.md +51 -0
  237. package/rules/typescript/symptoms/strictness-weakened.md +32 -0
  238. package/rules/typescript/symptoms/tangled-function/cognitive-complexity.md +42 -0
  239. package/rules/typescript/symptoms/tangled-function.md +75 -0
  240. package/rules/typescript/symptoms/test-of-the-type-checker.md +24 -0
  241. package/rules/typescript/symptoms/test-switched-off/focused-tests.md +15 -0
  242. package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +15 -0
  243. package/rules/typescript/symptoms/test-switched-off.md +25 -0
  244. package/rules/typescript/symptoms/text-past-its-reader/test-body.md +30 -0
  245. package/rules/typescript/symptoms/text-past-its-reader.md +71 -0
  246. package/rules/typescript/symptoms/throw-between-our-units.md +46 -0
  247. package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +32 -0
  248. package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +39 -0
  249. package/rules/typescript/symptoms/throw-or-catch-in-a-test.md +35 -0
  250. package/rules/typescript/symptoms/thrown-non-error/throw-only-error.md +15 -0
  251. package/rules/typescript/symptoms/thrown-non-error.md +27 -0
  252. package/rules/typescript/symptoms/tool-fetched-at-run-time.md +27 -0
  253. package/rules/typescript/symptoms/tuple-as-data.md +29 -0
  254. package/rules/typescript/symptoms/type-derived-from-code/factory-return-types.md +29 -0
  255. package/rules/typescript/symptoms/type-derived-from-code.md +41 -0
  256. package/rules/typescript/symptoms/types-only-file.md +36 -0
  257. package/rules/typescript/symptoms/unasserted-call.md +29 -0
  258. package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +28 -0
  259. package/rules/typescript/symptoms/unit-without-a-running-test.md +28 -0
  260. package/rules/{CD-5/CHECKS.md → typescript/symptoms/untracked-escape/directive-pointers.md} +12 -23
  261. package/rules/typescript/symptoms/untracked-escape.md +32 -0
  262. package/rules/typescript/symptoms/untyped-value/explicit-any.md +14 -0
  263. package/rules/typescript/symptoms/untyped-value/implicit-any-let.md +14 -0
  264. package/rules/typescript/symptoms/untyped-value.md +36 -0
  265. package/rules/typescript/symptoms/wide-input.md +37 -0
  266. package/rules/typescript/symptoms/wide-port.md +32 -0
  267. package/rules/typescript/symptoms/work-inside-a-condition/else-after-an-exit.md +40 -0
  268. package/rules/typescript/symptoms/work-inside-a-condition.md +41 -0
  269. package/rules/typescript/symptoms/write-into-a-parameter/parameter-mutation.md +33 -0
  270. package/rules/typescript/symptoms/write-into-a-parameter.md +34 -0
  271. package/rules/typescript/symptoms.md +821 -0
  272. package/{core → src/application}/conformance/conformance-testing-types.d.ts +16 -6
  273. package/src/audit.d.ts +20 -0
  274. package/{api → src}/audit.js +6 -5
  275. package/{core/rule-set-reader → src/domain/rule-set}/authored-rule-set-types.d.ts +2 -2
  276. package/{core/values → src/domain/rule-set}/edition-types.d.ts +3 -3
  277. package/{core/values → src/domain/rule-set}/identifier-types.d.ts +2 -2
  278. package/{core/conformance → src/domain/runner}/conformance-types.d.ts +1 -1
  279. package/{core/mechanism-port → src/domain/runner}/piece-failure-types.d.ts +1 -1
  280. package/{core/mechanism-port → src/domain/runner}/runner-module-types.d.ts +4 -4
  281. package/src/domain/runner/runner-result-types.d.ts +88 -0
  282. package/src/eslint-plugin.d.ts +16 -0
  283. package/src/eslint-plugin.js +72 -0
  284. package/src/hone.js +13385 -0
  285. package/src/infrastructure/disciplines-file/version-one-names.json +634 -0
  286. package/src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/class-keyword.examples.json +84 -0
  287. 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
  288. package/src/infrastructure/engines/eslint/authored-class-or-this/class-keyword/piece.json +12 -0
  289. package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +24 -0
  290. package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/static-members-only.examples.json +36 -0
  291. package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/eslint-plugin.js +16 -0
  292. package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/non-null-assertions.examples.json +48 -0
  293. package/src/infrastructure/engines/eslint/claimed-type/non-null-assertions/piece.json +22 -0
  294. package/src/infrastructure/engines/eslint/long-function/function-length/function-length.examples.json +42 -0
  295. package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +16 -0
  296. 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
  297. package/src/infrastructure/engines/eslint/name-off-its-casing/filename-case/filename-case.examples.json +60 -0
  298. package/src/infrastructure/engines/eslint/name-off-its-casing/filename-case/piece.json +11 -0
  299. package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/eslint-plugin.js +16 -0
  300. package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/naming-convention.examples.json +78 -0
  301. package/src/infrastructure/engines/eslint/name-off-its-casing/naming-convention/piece.json +214 -0
  302. package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/eslint-plugin.js +16 -0
  303. package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/parameter-count.examples.json +30 -0
  304. package/src/infrastructure/engines/eslint/positional-parameters/parameter-count/piece.json +18 -0
  305. package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/eslint-plugin.js +16 -0
  306. package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/parameter-reassignment.examples.json +30 -0
  307. package/src/infrastructure/engines/eslint/rebinding/parameter-reassignment/piece.json +17 -0
  308. package/{mechanisms → src/infrastructure/engines}/eslint/runner/README.md +5 -5
  309. package/{mechanisms/eslint/runner → src/infrastructure/engines/eslint/runner/pieces}/eslint-piece-settings-types.d.ts +1 -1
  310. package/{mechanisms → src/infrastructure/engines}/eslint/runner/runner.js +2189 -1371
  311. package/{mechanisms/eslint/CD-41 → src/infrastructure/engines/eslint/tangled-function/cognitive-complexity}/README.md +1 -1
  312. package/src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/cognitive-complexity.examples.json +48 -0
  313. package/{mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js → src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/eslint-plugin.js} +58 -14
  314. package/src/infrastructure/engines/eslint/tangled-function/cognitive-complexity/piece.json +12 -0
  315. package/{mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js → src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js} +5 -4
  316. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/focused-tests.examples.json +60 -0
  317. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/piece.json +12 -0
  318. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +16 -0
  319. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +54 -0
  320. 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
  321. package/src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/piece.json +12 -0
  322. package/src/infrastructure/engines/eslint/thrown-non-error/throw-only-error/throw-only-error.examples.json +54 -0
  323. package/{mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js → src/infrastructure/engines/eslint/untyped-value/explicit-any/eslint-plugin.js} +14 -9
  324. package/src/infrastructure/engines/eslint/untyped-value/explicit-any/explicit-any.examples.json +36 -0
  325. package/src/infrastructure/engines/eslint/untyped-value/explicit-any/piece.json +12 -0
  326. package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/implicit-any-let.examples.json +48 -0
  327. package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +16 -0
  328. package/src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/else-after-an-exit.examples.json +36 -0
  329. 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
  330. package/src/infrastructure/engines/eslint/work-inside-a-condition/else-after-an-exit/piece.json +12 -0
  331. package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-keyword.examples.json +84 -0
  332. package/{mechanisms/audit/CD-14 → src/infrastructure/engines/walker/authored-class-or-this/class-keyword}/class-syntax.js +6 -3
  333. package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/piece.json +10 -0
  334. package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-annotation.examples.json +42 -0
  335. package/{mechanisms/audit/CD-43 → src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation}/boolean-signatures.js +14 -6
  336. package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/piece.json +9 -0
  337. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/piece.json +95 -0
  338. package/{mechanisms/audit/CD-27 → src/infrastructure/engines/walker/branch-in-a-test/test-body}/test-body-logic.js +188 -56
  339. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body.examples.json +280 -0
  340. package/{mechanisms/audit/CD-1 → src/infrastructure/engines/walker/claimed-type/cast-to-any}/any-cast.js +7 -4
  341. package/src/infrastructure/engines/walker/claimed-type/cast-to-any/cast-to-any.examples.json +48 -0
  342. package/src/infrastructure/engines/walker/claimed-type/cast-to-any/piece.json +9 -0
  343. package/{mechanisms/audit/CD-2 → src/infrastructure/engines/walker/claimed-type/unlisted-cast-site}/cast-expressions.js +13 -6
  344. package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/piece.json +14 -0
  345. package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/unlisted-cast-site.examples.json +54 -0
  346. package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +18 -0
  347. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.examples.json +30 -0
  348. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +36 -0
  349. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/piece.json +9 -0
  350. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/default-arm.examples.json +36 -0
  351. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/piece.json +9 -0
  352. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +54 -0
  353. package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +18 -0
  354. package/{mechanisms/audit/CD-25 → src/infrastructure/engines/walker/double-with-a-body/stub-implementation}/dependency-isolation.js +8 -4
  355. package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/piece.json +9 -0
  356. package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/stub-implementation.examples.json +36 -0
  357. package/{mechanisms/audit/CD-7 → src/infrastructure/engines/walker/drawer-path/drawer-names}/categorical-paths.js +23 -8
  358. package/src/infrastructure/engines/walker/drawer-path/drawer-names/drawer-names.examples.json +42 -0
  359. package/src/infrastructure/engines/walker/drawer-path/drawer-names/piece.json +9 -0
  360. package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/git-spawn-environment.examples.json +36 -0
  361. package/{mechanisms/audit/CD-47 → src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment}/hermetic-git-spawns.js +13 -4
  362. package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/piece.json +9 -0
  363. package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loop-statement.examples.json +48 -0
  364. package/{mechanisms/audit/CD-15 → src/infrastructure/engines/walker/loop-keyword/loop-statement}/loops.js +12 -4
  365. package/src/infrastructure/engines/walker/loop-keyword/loop-statement/piece.json +9 -0
  366. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +36 -0
  367. package/{mechanisms/audit/CD-26 → src/infrastructure/engines/walker/module-or-global-patched/module-mock-call}/module-mocking.js +8 -4
  368. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +9 -0
  369. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +133 -0
  370. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-or-require.examples.json +42 -0
  371. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +14 -0
  372. package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +18 -0
  373. package/{mechanisms/audit/runner → src/infrastructure/engines/walker/runner/pieces}/walker-piece.d.ts +8 -14
  374. package/{mechanisms/audit → src/infrastructure/engines/walker}/runner/runner.js +194 -121
  375. package/{mechanisms/audit/runner → src/infrastructure/engines/walker/runner/toolchain}/typescript-parse.d.ts +1 -0
  376. package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.examples.json +42 -0
  377. package/{mechanisms/audit/CD-6 → src/infrastructure/engines/walker/shorthand-name/identifier-names}/identifier-names.js +32 -15
  378. package/src/infrastructure/engines/walker/shorthand-name/identifier-names/piece.json +9 -0
  379. package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/exact-optional-property-types.examples.json +71 -0
  380. package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +17 -0
  381. package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/no-fallthrough-cases-in-switch.examples.json +71 -0
  382. package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +17 -0
  383. package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/no-implicit-override.examples.json +71 -0
  384. package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +17 -0
  385. package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/no-property-access-from-index-signature.examples.json +71 -0
  386. package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +17 -0
  387. package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/no-unchecked-indexed-access.examples.json +71 -0
  388. package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +17 -0
  389. package/{mechanisms/audit/CD-3 → src/infrastructure/engines/walker/strictness-weakened/strict}/compiler-overrides.js +102 -38
  390. package/src/infrastructure/engines/walker/strictness-weakened/strict/piece.json +13 -0
  391. package/src/infrastructure/engines/walker/strictness-weakened/strict/strict.examples.json +64 -0
  392. package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +17 -0
  393. package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/use-unknown-in-catch-variables.examples.json +71 -0
  394. package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +18 -0
  395. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/piece.json +9 -0
  396. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +36 -0
  397. package/{mechanisms/audit/CD-10 → src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement}/throws-in-tests.js +6 -3
  398. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +18 -0
  399. package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.examples.json +36 -0
  400. package/{mechanisms/audit/CD-7a → src/infrastructure/engines/walker/type-derived-from-code/factory-return-types}/factory-return-types.js +5 -3
  401. package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/piece.json +9 -0
  402. package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/companion-test-file.examples.json +36 -0
  403. package/{mechanisms/audit/CD-23 → src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file}/export-test-sibling.js +7 -4
  404. package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/piece.json +9 -0
  405. package/{mechanisms/audit/CD-5 → src/infrastructure/engines/walker/untracked-escape/directive-pointers}/comments-directives.js +40 -19
  406. package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/directive-pointers.examples.json +96 -0
  407. package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/piece.json +16 -0
  408. package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.examples.json +42 -0
  409. package/{mechanisms/audit/CD-44 → src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation}/parameter-mutation.js +22 -7
  410. package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/piece.json +9 -0
  411. package/src/rule-set.d.ts +4 -0
  412. package/src/testing.d.ts +7 -0
  413. package/src/testing.js +524 -0
  414. package/api/audit.d.ts +0 -20
  415. package/api/rule-set.d.ts +0 -4
  416. package/api/testing.d.ts +0 -5
  417. package/api/testing.js +0 -238
  418. package/chunks/chunk-335ITLPO.js +0 -7
  419. package/chunks/chunk-6SM3HKWO.js +0 -1912
  420. package/chunks/chunk-E6VR3VRV.js +0 -268
  421. package/chunks/chunk-FR4FASVM.js +0 -108
  422. package/chunks/chunk-LDQUT742.js +0 -15
  423. package/chunks/chunk-MXSIQPCV.js +0 -13
  424. package/chunks/chunk-RWQ4UNKY.js +0 -24
  425. package/core/check/tool-command.js +0 -2586
  426. package/core/mechanism-port/runner-result-types.d.ts +0 -15
  427. package/mechanisms/audit/CD-1/piece.json +0 -13
  428. package/mechanisms/audit/CD-10/piece.json +0 -13
  429. package/mechanisms/audit/CD-14/piece.json +0 -13
  430. package/mechanisms/audit/CD-15/piece.json +0 -13
  431. package/mechanisms/audit/CD-17/clock-sources.js +0 -28
  432. package/mechanisms/audit/CD-17/piece.json +0 -13
  433. package/mechanisms/audit/CD-19/import-boundaries.js +0 -99
  434. package/mechanisms/audit/CD-19/piece.json +0 -18
  435. package/mechanisms/audit/CD-2/piece.json +0 -18
  436. package/mechanisms/audit/CD-23/piece.json +0 -13
  437. package/mechanisms/audit/CD-25/piece.json +0 -13
  438. package/mechanisms/audit/CD-26/piece.json +0 -13
  439. package/mechanisms/audit/CD-27/piece.json +0 -17
  440. package/mechanisms/audit/CD-3/piece.json +0 -77
  441. package/mechanisms/audit/CD-43/piece.json +0 -13
  442. package/mechanisms/audit/CD-44/piece.json +0 -13
  443. package/mechanisms/audit/CD-47/piece.json +0 -13
  444. package/mechanisms/audit/CD-5/piece.json +0 -20
  445. package/mechanisms/audit/CD-6/piece.json +0 -13
  446. package/mechanisms/audit/CD-7/piece.json +0 -13
  447. package/mechanisms/audit/CD-7a/piece.json +0 -13
  448. package/mechanisms/audit/CD-8/piece.json +0 -13
  449. package/mechanisms/audit/CD-8/switch-defaults.js +0 -42
  450. package/mechanisms/eslint/CD-1/piece.json +0 -23
  451. package/mechanisms/eslint/CD-10/piece.json +0 -15
  452. package/mechanisms/eslint/CD-14/piece.json +0 -31
  453. package/mechanisms/eslint/CD-2/cd2/cd2.eslint-plugin.js +0 -15
  454. package/mechanisms/eslint/CD-2/piece.json +0 -25
  455. package/mechanisms/eslint/CD-27/piece.json +0 -23
  456. package/mechanisms/eslint/CD-40/cd40/cd40.eslint-plugin.js +0 -15
  457. package/mechanisms/eslint/CD-40/piece.json +0 -21
  458. package/mechanisms/eslint/CD-41/piece.json +0 -23
  459. package/mechanisms/eslint/CD-42/piece.json +0 -15
  460. package/mechanisms/eslint/CD-44/cd44/cd44.eslint-plugin.js +0 -15
  461. package/mechanisms/eslint/CD-44/piece.json +0 -20
  462. package/mechanisms/eslint/CD-6/cd6/cd6.eslint-plugin.js +0 -15
  463. package/mechanisms/eslint/CD-6/piece.json +0 -217
  464. package/mechanisms/eslint/CD-7/piece.json +0 -15
  465. package/rules/CD-1/CHECKS.md +0 -39
  466. package/rules/CD-1/README.md +0 -28
  467. package/rules/CD-1/discipline.json +0 -195
  468. package/rules/CD-10/CHECKS.md +0 -49
  469. package/rules/CD-10/README.md +0 -27
  470. package/rules/CD-10/discipline.json +0 -133
  471. package/rules/CD-11/CHECKS.md +0 -13
  472. package/rules/CD-11/README.md +0 -25
  473. package/rules/CD-11/discipline.json +0 -12
  474. package/rules/CD-12/CHECKS.md +0 -13
  475. package/rules/CD-12/README.md +0 -25
  476. package/rules/CD-12/discipline.json +0 -12
  477. package/rules/CD-13/CHECKS.md +0 -13
  478. package/rules/CD-13/README.md +0 -25
  479. package/rules/CD-13/discipline.json +0 -12
  480. package/rules/CD-14/CHECKS.md +0 -49
  481. package/rules/CD-14/README.md +0 -28
  482. package/rules/CD-14/discipline.json +0 -173
  483. package/rules/CD-15/CHECKS.md +0 -42
  484. package/rules/CD-15/README.md +0 -30
  485. package/rules/CD-15/discipline.json +0 -73
  486. package/rules/CD-16/CHECKS.md +0 -7
  487. package/rules/CD-16/README.md +0 -15
  488. package/rules/CD-17/CHECKS.md +0 -37
  489. package/rules/CD-17/README.md +0 -28
  490. package/rules/CD-17/discipline.json +0 -51
  491. package/rules/CD-18/CHECKS.md +0 -13
  492. package/rules/CD-18/README.md +0 -25
  493. package/rules/CD-18/discipline.json +0 -12
  494. package/rules/CD-19/CHECKS.md +0 -49
  495. package/rules/CD-19/README.md +0 -29
  496. package/rules/CD-19/discipline.json +0 -63
  497. package/rules/CD-2/CHECKS.md +0 -58
  498. package/rules/CD-2/README.md +0 -30
  499. package/rules/CD-2/discipline.json +0 -151
  500. package/rules/CD-20/CHECKS.md +0 -7
  501. package/rules/CD-20/README.md +0 -15
  502. package/rules/CD-21/CHECKS.md +0 -13
  503. package/rules/CD-21/README.md +0 -24
  504. package/rules/CD-21/discipline.json +0 -12
  505. package/rules/CD-22/CHECKS.md +0 -13
  506. package/rules/CD-22/README.md +0 -24
  507. package/rules/CD-22/discipline.json +0 -12
  508. package/rules/CD-23/CHECKS.md +0 -35
  509. package/rules/CD-23/README.md +0 -26
  510. package/rules/CD-23/discipline.json +0 -57
  511. package/rules/CD-24/CHECKS.md +0 -7
  512. package/rules/CD-24/README.md +0 -15
  513. package/rules/CD-25/CHECKS.md +0 -38
  514. package/rules/CD-25/README.md +0 -31
  515. package/rules/CD-25/discipline.json +0 -57
  516. package/rules/CD-26/CHECKS.md +0 -36
  517. package/rules/CD-26/README.md +0 -29
  518. package/rules/CD-26/discipline.json +0 -57
  519. package/rules/CD-27/CHECKS.md +0 -451
  520. package/rules/CD-27/README.md +0 -29
  521. package/rules/CD-27/discipline.json +0 -437
  522. package/rules/CD-28/CHECKS.md +0 -13
  523. package/rules/CD-28/README.md +0 -25
  524. package/rules/CD-28/discipline.json +0 -12
  525. package/rules/CD-29/CHECKS.md +0 -13
  526. package/rules/CD-29/README.md +0 -23
  527. package/rules/CD-29/discipline.json +0 -12
  528. package/rules/CD-3/README.md +0 -26
  529. package/rules/CD-3/discipline.json +0 -641
  530. package/rules/CD-30/CHECKS.md +0 -13
  531. package/rules/CD-30/README.md +0 -24
  532. package/rules/CD-30/discipline.json +0 -12
  533. package/rules/CD-31/CHECKS.md +0 -13
  534. package/rules/CD-31/README.md +0 -23
  535. package/rules/CD-31/discipline.json +0 -12
  536. package/rules/CD-32/CHECKS.md +0 -13
  537. package/rules/CD-32/README.md +0 -24
  538. package/rules/CD-32/discipline.json +0 -12
  539. package/rules/CD-33/CHECKS.md +0 -13
  540. package/rules/CD-33/README.md +0 -24
  541. package/rules/CD-33/discipline.json +0 -12
  542. package/rules/CD-34/CHECKS.md +0 -13
  543. package/rules/CD-34/README.md +0 -23
  544. package/rules/CD-34/discipline.json +0 -12
  545. package/rules/CD-39/CHECKS.md +0 -13
  546. package/rules/CD-39/README.md +0 -24
  547. package/rules/CD-39/discipline.json +0 -12
  548. package/rules/CD-4/CHECKS.md +0 -13
  549. package/rules/CD-4/README.md +0 -26
  550. package/rules/CD-4/discipline.json +0 -12
  551. package/rules/CD-40/CHECKS.md +0 -39
  552. package/rules/CD-40/README.md +0 -29
  553. package/rules/CD-40/discipline.json +0 -58
  554. package/rules/CD-41/CHECKS.md +0 -64
  555. package/rules/CD-41/README.md +0 -31
  556. package/rules/CD-41/discipline.json +0 -138
  557. package/rules/CD-42/CHECKS.md +0 -47
  558. package/rules/CD-42/README.md +0 -25
  559. package/rules/CD-42/discipline.json +0 -61
  560. package/rules/CD-43/CHECKS.md +0 -37
  561. package/rules/CD-43/README.md +0 -27
  562. package/rules/CD-43/discipline.json +0 -65
  563. package/rules/CD-44/CHECKS.md +0 -48
  564. package/rules/CD-44/README.md +0 -26
  565. package/rules/CD-44/discipline.json +0 -111
  566. package/rules/CD-45/CHECKS.md +0 -13
  567. package/rules/CD-45/README.md +0 -25
  568. package/rules/CD-45/discipline.json +0 -12
  569. package/rules/CD-46/CHECKS.md +0 -7
  570. package/rules/CD-46/README.md +0 -25
  571. package/rules/CD-47/CHECKS.md +0 -37
  572. package/rules/CD-47/README.md +0 -31
  573. package/rules/CD-47/discipline.json +0 -57
  574. package/rules/CD-5/README.md +0 -28
  575. package/rules/CD-5/discipline.json +0 -131
  576. package/rules/CD-6/CHECKS.md +0 -51
  577. package/rules/CD-6/README.md +0 -28
  578. package/rules/CD-6/discipline.json +0 -165
  579. package/rules/CD-7/CHECKS.md +0 -46
  580. package/rules/CD-7/README.md +0 -29
  581. package/rules/CD-7/discipline.json +0 -142
  582. package/rules/CD-7a/CHECKS.md +0 -38
  583. package/rules/CD-7a/README.md +0 -26
  584. package/rules/CD-7a/discipline.json +0 -57
  585. package/rules/CD-8/CHECKS.md +0 -42
  586. package/rules/CD-8/README.md +0 -26
  587. package/rules/CD-8/discipline.json +0 -57
  588. package/rules/CD-9/CHECKS.md +0 -13
  589. package/rules/CD-9/README.md +0 -26
  590. package/rules/CD-9/discipline.json +0 -12
  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/CHANGELOG.md CHANGED
@@ -2,6 +2,147 @@
2
2
 
3
3
  Every release of Hone, newest first. `pnpm run release-pull-request` writes each new section from the commits merged to `main` since the previous release tag, whose subjects are the squash-merged pull request titles; README.md's Compatibility section says what each kind of release may change. The sections below were written by hand from the merged pull requests when the changelog started.
4
4
 
5
+ ## 2.0.0-pre.1
6
+
7
+ ### Breaking changes
8
+
9
+ - Hone supports the latest release of each ESLint major (#230)
10
+ - move the repository into named layers (#318)
11
+
12
+ ### Features
13
+
14
+ - every check has one address in the catalogue (#206)
15
+ - a version 2 config reader gives the same reading as version 1 (#207)
16
+ - a records reader for the five kinds under hone-records (#211)
17
+ - which findings each record answers (#212)
18
+ - one ESLint plugin whose rule ids name the symptom and the check (#213)
19
+ - an import finding names the import that raised it (#217)
20
+ - a record may name one check, and doubly held debt is paid (#216)
21
+ - the lines a version 2 run prints, and their contract (#214)
22
+ - version 2 load failures and help text (#220)
23
+ - version 2 load failures narrow by type, and one chooser picks the run path (#221)
24
+ - a hit and a native exception may name their check (#222)
25
+ - a version 2 ESLint runner that reports by symptom and check (#224)
26
+ - hone check runs on the version 2 files behind one chooser (#225)
27
+ - version 2 records are written and removed by command (#228)
28
+ - record-debt, prune-debt and authorise run on a version 2 repository (#233)
29
+ - map version 1 settings and records to version 2 values (#240)
30
+ - write version 2 settings and rewrite the team config's projection import (#243)
31
+ - a carried record stands when the base held it as a version 1 entry (#241)
32
+ - read the head's version 1 entries as inputs to the upgrade mapping (#242)
33
+ - answer version 1 file carve-outs through the moved governance (#245)
34
+ - version 2 conformance runs through the checks runner's conform (#247)
35
+ - the version 1 engine pass hands the oracle its raw findings (#248)
36
+ - debt carried from a version 1 file carve-out stands when the base held that entry (#249)
37
+ - write the upgrade's files with rollback and remove version 1's files in order (#253)
38
+ - compare a version 1 report with a version 2 report for the upgrade proof (#252)
39
+ - the upgrade proof plans, writes, runs both versions, compares and rolls back (#255)
40
+ - version 2 hone project (#256)
41
+ - hone upgrade (#258)
42
+ - compile each ESLint major alone, behind its own boundary (#238)
43
+ - version 2 runs repositories with package-level lint configs (#261)
44
+ - version 2 runs repositories that declare eslintConfigRoots (#262)
45
+ - hone upgrade carries a repository's ESLint slices to version 2 (#264)
46
+ - a version 2 projection declares its type (#271)
47
+ - carried records follow the forfeiture setting when no base is given (#285)
48
+ - record-debt answers the native exceptions a debt record can hold (#292)
49
+ - an ESLint rule id is the check's address (#301)
50
+ - the ignore line names both routes, and an excluded file prints none (#302)
51
+ - version 2 prints its report sections in kebab-case (#303)
52
+ - version 2 calls the failures-only report output actionable (#304)
53
+ - scripts is a categorical folder name (#306)
54
+ - tests and values are categorical folder names (#307)
55
+ - register checks by name in version 2 (#338)
56
+ - hone upgrade prints its record lines and the proof's finding count (#342)
57
+ - hone upgrade turns a clause-wide carve-out into not-adopted checks (#348)
58
+
59
+ ### Fixes
60
+
61
+ - the vendor import scan no longer reads other tests' scratch output (#254)
62
+ - the confinement guards read imports from syntax, not text (#251)
63
+ - each cause version 2 cannot run yet prints a true line (#260)
64
+ - every version 2 finding names its check (#265)
65
+ - the upgrade keeps the verdict of a repository that selects some disciplines (#267)
66
+ - the upgrade writes an authorised location at the checks it answers (#266)
67
+ - the upgrade's proof measures against the tree it found (#268)
68
+ - the shipped ESLint plugin declaration keeps its default export (#275)
69
+ - an out-of-date projection is reported as out of date (#278)
70
+ - upgrade names directives that name no version 2 check (#280)
71
+ - a record is stale only where its checks were measured (#284)
72
+ - a folder with no settings file reports config-absent from every command (#297)
73
+ - hone --help prints version 2's help for a version 2 repository (#298)
74
+ - prune-debt drops a carve-out whose file the selection excludes (#322)
75
+ - record-debt inherits the debt of a file git sees renamed (#329)
76
+ - version-one-removal test compiles with D1's constructors (#336)
77
+
78
+ ### Other changes
79
+
80
+ - shipped pages address rules, cases, symptoms and checks by name (#215)
81
+ - every indication points only at what its case owes (#218)
82
+ - version 2 runner owns the logic it shares with version 1 (#229)
83
+ - command-line handling and the checked tree have one home both versions use (#231)
84
+ - the suite drops an unshipped proof and repeated cases (#232)
85
+ - the version 2 run owns mechanism dispatch and outcome printing (#234)
86
+ - version 2 settings own the selection types, edition pin and default check settings (#235)
87
+ - move the version 1 record and settings readers under core/upgrade (#236)
88
+ - split the disciplines.json reader from selection logic and pay its test's debt (#237)
89
+ - move version 1 answering and the embedded run under core/upgrade (#239)
90
+ - the runner loader and the projection request leave version 1's reach (#244)
91
+ - ESLint conformance logic in its own version 2 file (#246)
92
+ - version 1's check outcomes leave the version 2 command line (#250)
93
+ - the version 1 engine pass against real ESLint (#257)
94
+ - clear eight self-check findings in recently merged tests (#259)
95
+ - remove the not-ready causes version 2 no longer produces (#263)
96
+ - the ESLint major imports test no longer reads other tests' scratch files (#269)
97
+ - fixture lint configs are not read as projection slices (#276)
98
+ - a version 2 adopter's whole use on one repository (#274)
99
+ - how to move a repository to version 2 with hone upgrade (#277)
100
+ - the inline-directive fixtures are text, and their debt is paid (#279)
101
+ - typed configs compile against the projection on each ESLint major (#272)
102
+ - the adopter tests expect what main prints (#281)
103
+ - self-check gates a version 2 repository by its run report (#283)
104
+ - package slices and config roots in version 2 (#282)
105
+ - one core value names every projection output (#287)
106
+ - the README teaches version 2 (#288)
107
+ - the adopting guide teaches version 2 (#289)
108
+ - links point at the version 2 headings (#290)
109
+ - the adopting guide's worked example and check table are pinned to the code (#293)
110
+ - the upgrade page covers what hone upgrade prints and refuses (#294)
111
+ - the upgrade page answers what a first adopter had to guess (#300)
112
+ - three check-command tests pay their test-body debt (#295)
113
+ - version 2 owns its command ports (#296)
114
+ - version 2 record files are named for their kinds (#308)
115
+ - generated is a top-level settings key (#309)
116
+ - why-chain-causal tests the chain code on written-out values (#310)
117
+ - the why chain's root field is rootEvidence (#311)
118
+ - a record names what it answers in answers (#312)
119
+ - delete tests/ and write what each test needs into the test (#319)
120
+ - each layer imports only inward, held by one direction test (#320)
121
+ - disable the authorised locations, exclude fixtures and rebaseline all debt (#323)
122
+ - put each test in the layer whose behaviour it asserts (#331)
123
+ - agent rules every Hone session loads (#330)
124
+ - tests hold the layers, step 2: fakes over ports and tests beside their units (#332)
125
+ - each brand is built by its own constructor over a static declaration (#335)
126
+ - pack releases on Linux and run CI's jobs side by side (#334)
127
+ - rule content, one named file per item (#333)
128
+ - the entries' wiring is proven by what it does, not by its source text (#340)
129
+ - format with oxfmt and drop Biome (#341)
130
+ - Hone upgrades itself to version 2 (#349)
131
+
132
+ ## 1.5.0
133
+
134
+ ### Features
135
+
136
+ - add the TypeScript symptom catalogue and its typed reader (#199)
137
+ - prune-debt removes paid debt on a file that still exists (#203)
138
+ - a finding names its symptom (#202)
139
+
140
+ ### Other changes
141
+
142
+ - pages for principles, cases, rules, records and the TypeScript layer (#197)
143
+ - numbered rule pages point at the named pages (#201)
144
+ - the install-proof plan test holds no debt (#208)
145
+
5
146
  ## 1.4.0
6
147
 
7
148
  ### Features
package/MIGRATING.md CHANGED
@@ -18,34 +18,32 @@ Look for each of these and write down what you find:
18
18
  | Debt records | repository root | `.constitution-carve-outs/cd-<id>.json` |
19
19
  | Structural records | repository root | `.constitution-authorised-locations/cd-<id>.json` |
20
20
  | Hand-written linter rules | `biome.json`, `eslint.config.*`, `.oxlintrc.json` | `noExplicitAny`, `@typescript-eslint/no-explicit-any`, `typescript/no-explicit-any` |
21
- | Compiler flags | every `tsconfig*.json` | the seven CD-3 flags |
21
+ | Compiler flags | every `tsconfig*.json` | the seven strict flags behind [Strictness weakened](rules/typescript/symptoms.md#strictness-weakened) |
22
22
  | Scripts and hooks | `package.json` scripts, CI workflow, pre-push hook | `bun .cursor/tools/rin-harness-constitution-audit.ts`, `rin-harness-carve-out-decay.ts`, `rin-harness-hermetic-git-guard.ts` |
23
23
  | Agent instructions | `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/`, an adoption record | "read the selected discipline files before editing" |
24
24
 
25
- The chosen disciplines are the `cd-NNN-*.md` files that were copied (CD-1, CD-3 and CD-46 in the old quick start), plus any CD named in a record file.
25
+ The chosen disciplines are the `cd-NNN-*.md` files that were copied (the old quick start copied three: `any`, compiler strictness and debt decay), plus any old rule a record file names.
26
26
 
27
- A CD that a record file names but whose rule file was not copied (for example CD-15, when only CD-1, CD-3 and CD-46 were copied) is expected: select it in step 2 like the others. Stop and ask the human only if a named CD is one of CD-35 to CD-38.
27
+ An old rule that a record file names but whose rule file was not copied is expected: select it in step 2 like the others. Stop and ask the human only if [Every numbered discipline](rules/numbers.md#every-numbered-discipline) has no row for it.
28
28
 
29
- Old code often holds CD-1 `any` the old route never checked. Hone flags it in step 3; it is new debt, so fix it or record it only after the human approves (step 3), and any further `any` still fails.
29
+ Old code often holds `any` ([Untyped value](rules/typescript/symptoms.md#untyped-value)) the old route never checked. Hone flags it in step 3; it is new debt, so fix it or record it only after the human approves (step 3), and any further `any` still fails.
30
30
 
31
31
  ## 2. Install Hone and select the clauses
32
32
 
33
33
  Do [ADOPTING.md](ADOPTING.md) steps 1, 2 and 4 (and 4a for any `eslint` clause). A repository that used only Biome has no `eslint.config.*`. If it selects any clause through `eslint`, create `eslint.config.mjs` as step 4a shows before the first check, or the check stops with `runner-failed eslint team-config-unloadable`. If it lists every ESLint clause as `"not-run"` or `"not-adopted"`, it needs no ESLint config and no ESLint installed. Leave the old files in place until step 6.
34
34
 
35
- Map each chosen discipline to its clauses with this table. A discipline is adopted whole: select every mechanical clause it lists, or the check reports the rest as `uncovered`. Where the rule binds but a clause's mechanism cannot work in this repository, such as an ESLint-only clause with no ESLint installed, list that clause as `"not-run"`; where the rule does not apply at all, list it as `"not-adopted"`. [ADOPTING.md](ADOPTING.md#4-write-disciplinesjson) step 4 sets out the clause values and the three declared states.
35
+ Map each chosen discipline to its clauses with this table. A discipline is adopted whole: select every mechanical clause it lists, or the check reports the rest as `uncovered`. Where the rule binds but a clause's mechanism cannot work in this repository, such as an ESLint-only clause with no ESLint installed, list that clause as `"not-run"`; where the rule does not apply at all, list it as `"not-adopted"`. [ADOPTING.md](ADOPTING.md#4-write-honeconfigjson) step 4 sets out the clause values and the three declared states.
36
36
 
37
- | Old CD | Clauses to select in `disciplines.json` |
38
- | --- | --- |
39
- | CD-1 | `CD-1#any-cast` audit, `CD-1#explicit-any` eslint, `CD-1#implicit-any-let` eslint |
40
- | CD-3 | all seven `CD-3#...` clauses, audit; then move the flags out of `tsconfig.json` (step 4) |
41
- | CD-46 | nothing to select: it applies to every file carve-out once the check runs with `--base-revision` |
42
- | CD-16, CD-20, CD-24 | select their owners, CD-15, CD-19 and CD-23 |
43
- | CD-35, CD-36, CD-37, CD-38 | not in Hone; keep their current handling |
44
- | any other CD | every mechanical clause in `node_modules/@hailstails/hone/rules/<ID>/CHECKS.md`'s Clauses table, with a mechanism that table lists |
37
+ Find each old rule's number in [Every numbered discipline](rules/numbers.md#every-numbered-discipline), the one page that maps old numbers to names, and select every mechanical clause its row lists, each with a mechanism its check page lists. Four kinds of row need more:
38
+
39
+ - The compiler strictness discipline ([Strictness weakened](rules/typescript/symptoms.md#strictness-weakened)): select all seven of its clauses through `audit`, then move the flags out of `tsconfig.json` (step 4).
40
+ - The debt decay discipline (touching a carved-out file revokes its carve-out): nothing to select. [Forfeiture](rules/records.md#debt) applies to every file carve-out once the check runs with `--base-revision`.
41
+ - A row whose clauses say "see" another discipline: select that discipline's clauses.
42
+ - An old rule with no row: it is not in Hone; keep its current handling.
45
43
 
46
44
  Clauses whose mechanism is `review` are judgement clauses: do not put them in `disciplines.json`; list them in the agent instructions instead (step 6).
47
45
 
48
- Stop and ask the human if a chosen CD is one of CD-35 to CD-38, or if selecting a whole discipline adds clauses the old route never checked and the first run shows findings for them: they decide whether to fix those findings, carve them out (step 3, where `hone record-debt` can write the records), or not adopt that discipline yet.
46
+ Stop and ask the human if a chosen old rule has no row on that page, or if selecting a whole discipline adds clauses the old route never checked and the first run shows findings for them: they decide whether to fix those findings, carve them out (step 3, where `hone record-debt` can write the records), or not adopt that discipline yet.
49
47
 
50
48
  ### 2a. Carry over the old route's settings
51
49
 
@@ -53,12 +51,12 @@ Do this before step 3, and before you delete any record Hone lists as `stale`. T
53
51
 
54
52
  | Old route | Where to look | In Hone |
55
53
  | --- | --- | --- |
56
- | Packages confined to wrapping files | a list in the tool's code or its config. Rin's walker holds it as `BANNED_THIRD_PARTY_IMPORTS`: search its tools folder for that name, since an installed copy keeps it in `constitution-audit/audit-constitution.runtime.js`, and its `audit-constitution.ts` only re-exports that file | `confinedPackages` for `CD-19#import-boundaries` under `clauseSettings` in `disciplines.json`. Hone confines no package by default, so until you list them CD-19 flags only `node:` imports. A package covers its subpaths, as [rules/CD-19/CHECKS.md](rules/CD-19/CHECKS.md#what-the-check-flags) says, where the old walker matched each listed name exactly, so Hone can flag a subpath import the old list did not name. |
57
- | Scope | `constitution.include` and `constitution.exclude` in `harness.config.json` | `exclude` in `disciplines.json`, as [ADOPTING.md](ADOPTING.md#4-write-disciplinesjson) step 4 says. Hone has no include list and no globs: list each folder or file outside the old scope as an exact path. |
54
+ | Packages confined to wrapping files | a list in the tool's code or its config. Rin's walker holds it as `BANNED_THIRD_PARTY_IMPORTS`: search its tools folder for that name, since an installed copy keeps it in `constitution-audit/audit-constitution.runtime.js`, and its `audit-constitution.ts` only re-exports that file | `confinedPackages` for `CD-19#import-boundaries` under `clauseSettings` in `disciplines.json`. Hone confines no package by default, so until you list them `outside-import-past-a-boundary#import-or-require` flags only `node:` imports. `outside-import-past-a-boundary#import-or-require` is the check's name, given for reading: today's tool neither accepts nor prints a check's name, so write and expect the clause address; check names become typeable in 2.0. A package covers its subpaths, as its check page, `rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md`, says under Flags, where the old walker matched each listed name exactly, so Hone can flag a subpath import the old list did not name. |
55
+ | Scope | `constitution.include` and `constitution.exclude` in `harness.config.json` | `exclude` in `disciplines.json`, as [ADOPTING.md](ADOPTING.md#4-write-honeconfigjson) step 4 says. Hone has no include list and no globs: list each folder or file outside the old scope as an exact path. |
58
56
  | Rules relaxed by folder | `scriptGlobs`, `uiGlobs` or similar in `harness.config.json` | nothing. Hone has one selection for the whole repository. What those folders fail under the full rules is existing debt: fix it or record it in step 3. There is no old record to import it from, so once the human approves recording it, `hone record-debt` writes the records (step 3). Do not exclude the folders to hide it. |
59
57
  | Files the tool skipped in its own code | a list such as `SELF_AUDIT_EXCLUDED_FILENAMES` | an `exclude` entry or an exception record for each file. Stop and ask the human which, and why. |
60
58
 
61
- A `stale` record on `CD-19#import-boundaries` right after the move usually means the confined list was not carried over. Fix `confinedPackages` and run the check again before deleting anything.
59
+ A `stale` record on `CD-19#import-boundaries` (`outside-import-past-a-boundary#import-or-require`) right after the move usually means the confined list was not carried over. Fix `confinedPackages` and run the check again before deleting anything.
62
60
 
63
61
  ## 3. Convert the old records into exceptions
64
62
 
@@ -68,7 +66,7 @@ Do step 2a first. Then run the check once with no exceptions file, to see what H
68
66
  npm run --silent hone:check
69
67
  ```
70
68
 
71
- CD-3 findings on `tsconfig.json` are fixed in step 4, not recorded. Then write `discipline-exceptions.json` from the old records, using the format in [README.md](README.md#discipline-exceptionsjson):
69
+ Findings of the strict-flag checks ([Strictness weakened](rules/typescript/symptoms.md#strictness-weakened)) on `tsconfig.json` are fixed in step 4, not recorded. Then write `discipline-exceptions.json` from the old records, using the format in [README.md](README.md#hone-records):
72
70
 
73
71
  An old record file is a JSON array of entries, each listing one or more files:
74
72
 
@@ -82,12 +80,12 @@ An old record file is a JSON array of entries, each listing one or more files:
82
80
  ]
83
81
  ```
84
82
 
85
- - Each file in a `.constitution-carve-outs/cd-<id>.json` entry that Hone now flags becomes one `file-carve-out`: `clause` is the clause the finding names (for example `CD-15#loops`), `file` is the exact path. Two flagged files in one entry become two records with the same `source`.
83
+ - Each file in a `.constitution-carve-outs/cd-<id>.json` entry that Hone now flags becomes one `file-carve-out`: `clause` is the clause the finding names (for example `CD-15#loops` (`loop-keyword#loop-statement`)), `file` is the exact path. Two flagged files in one entry become two records with the same `source`.
86
84
  - Each file in a `.constitution-authorised-locations/cd-<id>.json` entry that Hone now flags becomes one `authorised-location`.
87
85
  - A listed file Hone does not flag gets no record: a record that exempts nothing is reported `stale` and fails the run. Before you drop one, check step 2a: a file Hone does not flag only because a setting was left behind still needs its record.
88
86
  - A finding in a file no old record lists is new debt: fix it, or record it only after the human approves.
89
87
 
90
- Each converted record is imported: give it `provenance` naming the old record instead of a `whyChain`, and keep the old `reason`:
88
+ Each converted record is imported: give it `provenance` naming the old record instead of a `whyChain`, and keep the old `reason`. This one holds debt on the clause of `loop-keyword#loop-statement`:
91
89
 
92
90
  ```json
93
91
  {
@@ -103,7 +101,7 @@ Each converted record is imported: give it `provenance` naming the old record in
103
101
  }
104
102
  ```
105
103
 
106
- `source` is the old file and the entry's position in its array, counting from `0`, so both files in the example above use `.constitution-carve-outs/cd-15.json#0`. An authorised location uses `{ "kind": "existing-authorisation", "source": ".constitution-authorised-locations/cd-<id>.json#<index>" }`. Hone accepts an imported record only while the `--base-revision` holds it unchanged or its `source` entry lists the record's file at that revision, so keep the old record files committed until step 6, and run every check in this migration with `--base-revision HEAD`. An imported record you later change needs a full `whyChain` that follows the [why-chain contract](docs/why-chain-contract.md), or, for a `file-carve-out`, no `provenance` at all: Hone refuses it as `import-unverified` otherwise. A `file-carve-out` is debt, so a record you write for new debt needs only its clause and file, with no `whyChain` and no `provenance`; a `reason` is an optional note. An `authorised-location` you write needs a `whyChain`; a repository whose `disciplines.json` sets `"fileExceptionWhyChains": "optional"` may give one only its `reason`, which will be refused in the next major release.
104
+ `source` is the old file and the entry's position in its array, counting from `0`, so both files in the example above use `.constitution-carve-outs/cd-15.json#0`. An authorised location uses `{ "kind": "existing-authorisation", "source": ".constitution-authorised-locations/cd-<id>.json#<index>" }`. Hone accepts an imported record only while the `--base-revision` holds it unchanged or its `source` entry lists the record's file at that revision, so keep the old record files committed until step 6, and run every check in this migration with `--base-revision HEAD`. An imported record you later change needs a full `whyChain` that follows the [why-chain contract](docs/why-chain-contract.md), or, for a `file-carve-out`, no `provenance` at all: Hone refuses it as `import-unverified` otherwise. A `file-carve-out` is debt, so a record you write for new debt needs only its clause and file, with no `whyChain` and no `provenance`; a `reason` is an optional note. An `authorised-location` you write needs a `whyChain`; a repository whose `disciplines.json` sets `"fileExceptionWhyChains": "optional"` may give one only its `reason`.
107
105
 
108
106
  An imported `file-carve-out` needs a `decision`: copy the old entry's. If the old entry has none, stop and ask the human who accepted the debt. An imported `authorised-location` needs no `decision`: copy the old entry's if it has one, otherwise give `kind` and `source` only. Never write a placeholder or a root cause that only says the check was failing: Hone refuses those as `invalidRecords`.
109
107
 
@@ -120,9 +118,9 @@ Give it the branch's base, `origin/main`, not `HEAD` as this migration's other c
120
118
  The ESLint projection from step 2 now carries every `eslint` clause. Remove only the rules the old route added for the disciplines; keep every other rule the repository uses:
121
119
 
122
120
  - `biome.json`: remove `suspicious.noExplicitAny` and `suspicious.noImplicitAnyLet`. If nothing else in the file was added for the trial, remove the file, the `@biomejs/biome` dev dependency the old quick start installed and the `package.json` script that ran `biome lint` (step 6 replaces it); otherwise keep it for its other rules.
123
- - `eslint.config.*`: remove `@typescript-eslint/no-explicit-any` (and any other rule the old route added for a CD), and spread the projection last as [ADOPTING.md](ADOPTING.md#4a-set-up-eslint-for-eslint-clauses) shows.
121
+ - `eslint.config.*`: remove `@typescript-eslint/no-explicit-any` (and any other rule the old route added for a CD), and spread the projection last as [ADOPTING.md](ADOPTING.md#4a-set-up-eslint-for-eslint-checks) shows.
124
122
  - `.oxlintrc.json`: remove `typescript/no-explicit-any`; remove the file if it held nothing else.
125
- - CD-3: Hone flags any of the seven strict flags written in a file named `tsconfig.json`, even when it is `true`, because the flags must be inherited, never set per project. Move them from every `tsconfig.json` into one shared base file with another name, for example `tsconfig.base.json`, and make each `tsconfig.json` extend it (`"extends": "./tsconfig.base.json"`). Keep every other compiler option where it is. Then run the repository's own typecheck, which must still pass.
123
+ - Compiler strictness ([Strictness weakened](rules/typescript/symptoms.md#strictness-weakened)): Hone flags any of the seven strict flags written in a file named `tsconfig.json`, even when it is `true`, because the flags must be inherited, never set per project. Move them from every `tsconfig.json` into one shared base file with another name, for example `tsconfig.base.json`, and make each `tsconfig.json` extend it (`"extends": "./tsconfig.base.json"`). Keep every other compiler option where it is. Then run the repository's own typecheck, which must still pass.
126
124
 
127
125
  Then re-run `hone:project` and the check. With any `file-carve-out` recorded, pass `--base-revision`: without it Hone cannot tell whether a carved file was touched, reports `forfeiture-unmeasured` and fails. Locally, `HEAD` measures what is already committed:
128
126
 
@@ -167,7 +165,7 @@ npm run --silent hone:check -- --base-revision HEAD
167
165
 
168
166
  With pnpm, run the check as `pnpm run --silent hone:check --base-revision HEAD`.
169
167
 
170
- It must print a `CD-15#loops audit` finding and a `CD-1#explicit-any eslint` finding, then `verdict: fail`, and exit `1`. Use a selected clause in place of either if the repository did not adopt CD-15 or CD-1. Then remove both files (`git rm -f src/discipline-probe-loop.ts src/discipline-probe-any.ts`) and run the check again: it must print `verdict: pass` and exit `0`.
168
+ It must print a `CD-15#loops audit` finding (`loop-keyword#loop-statement`) and a `CD-1#explicit-any eslint` finding (`untyped-value#explicit-any`), then `verdict: fail`, and exit `1`. Use a selected clause in place of either if the repository did not adopt it. Then remove both files (`git rm -f src/discipline-probe-loop.ts src/discipline-probe-any.ts`) and run the check again: it must print `verdict: pass` and exit `0`.
171
169
 
172
170
  To see debt decay, change one line in a carved file, stage it and run the check: the record moves to `forfeited` and the run fails. Restore the file afterwards (`git restore --staged --worktree <file>`). Records `hone record-debt` wrote decay the same way as converted ones.
173
171
 
@@ -193,22 +191,22 @@ Stop and ask the human if anything outside the old trial uses the copied tools o
193
191
  | What is installed | rule text only; checks were the repository's own linters, plus an optional copied tools tree | one package that runs every selected check |
194
192
  | Selection | whole CD files, read by an agent; a check ran only if wired by hand | clauses in `disciplines.json`; every mechanical clause of an adopted discipline must be selected |
195
193
  | First-adoption debt | inherited debt could be recorded without a why-chain | imported with `provenance` and no `whyChain`, accepted only while unchanged since `--base-revision`; a `file-carve-out` is debt and needs only its clause and file; a new or edited `authorised-location` or `clause-wide-carve-out` needs a causal five-step `whyChain` ([contract](docs/why-chain-contract.md)) |
196
- | CD-1 | no exemptions | exempted like every other discipline, so existing `any` debt can be recorded |
197
- | CD-3 flags | merged into the shared `compilerOptions`, wherever they were | set only in a base file not named `tsconfig.json`; any of the seven in a `tsconfig.json` is a finding |
194
+ | `any` ([Untyped value](rules/typescript/symptoms.md#untyped-value)) | no exemptions | exempted like every other discipline, so existing `any` debt can be recorded |
195
+ | Strict compiler flags | merged into the shared `compilerOptions`, wherever they were | set only in a base file not named `tsconfig.json`; any of the seven in a `tsconfig.json` is a finding |
198
196
  | Running with debt | the decay check needed a base ref | every run with a file carve-out needs `--base-revision`, unless it sets forfeiture `elsewhere`; every run with imported or legacy-chain records needs it either way |
199
- | Debt decay (CD-46) | optional `rin-harness-carve-out-decay.ts` run | built into every check run with `--base-revision` |
197
+ | Debt decay ([forfeiture](rules/records.md#debt)) | optional `rin-harness-carve-out-decay.ts` run | built into every check run with `--base-revision` |
200
198
  | Stale and unrecorded exceptions | not checked | fail the run, including linter ignores, `eslint-disable` comments and `@ts-expect-error`, `@ts-ignore` and `@ts-nocheck` directives with no record; an inline disable or directive is held by a file record on its clause and file, never by a clause-wide carve-out, and a lint-script option that weakens the run cannot be recorded at all |
201
199
  | Path matching | old tools matched records by path suffix | exact repository paths |
202
200
  | Linter | Biome, ESLint or oxlint for explicit `any` only | ESLint through the generated projection; Biome and oxlint are not Hone mechanisms |
203
- | CD-8 exhaustive switch | typed ESLint `switch-exhaustiveness-check` suggested | the audit's `switch-defaults` clause only; type-aware linting is not supported |
204
- | Judgement rules | read by an agent on request | each rule page names a review lens in `methods/lenses/`; ADOPTING step 9 is the procedure |
201
+ | Exhaustive switch ([Default on a closed union](rules/typescript/symptoms.md#default-on-a-closed-union)) | typed ESLint `switch-exhaustiveness-check` suggested | the audit's `switch-defaults` clause only; type-aware linting is not supported |
202
+ | Judgement rules | read by an agent on request | each rule item names its review lenses, methods in `methods/lenses/`; ADOPTING step 9 is the procedure |
205
203
 
206
204
  ## 8. Moving to causal why-chains
207
205
 
208
206
  An install from before the [why-chain contract](docs/why-chain-contract.md) holds chains with `whys`, `rootCause` and `owner` only. Hone still accepts such a chain while `--base-revision` holds its entry unchanged, but the first run without a base revision reports `legacy-chain-unmeasured` and fails. Do these steps in order:
209
207
 
210
208
  1. **Give every check a base revision, before you refresh Hone.** Add `--base-revision` to the check command in `package.json` scripts, CI and the pre-push hook: `origin/main` locally, the pull request's base commit in CI. On a push to the main branch, the base is the commit before the push. Make sure CI fetches enough history to reach the base: `actions/checkout` defaults to one commit, so set `fetch-depth: 0` or fetch the base explicitly. A rin consumer whose `constitution.engine` is `"hone"`, or `"discipline-core"` before the rename, sets `constitution.baseRevision` in `harness.config.json`. Rin's stage gate and `disciplines` sensor pass it on.
211
- 2. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) step 10 says, and run the check. Every chain that is unchanged since the base passes. If the run lists `legacy-chain-unmeasured`, step 1 is missing somewhere. Any `why-chain-refused` entry is a legacy chain that is new or edited since the base.
209
+ 2. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 says, and run the check. Every chain that is unchanged since the base passes. If the run lists `legacy-chain-unmeasured`, step 1 is missing somewhere. Any `why-chain-refused` entry is a legacy chain that is new or edited since the base.
212
210
  3. **Rewrite each chain when you next touch its entry.** An edited entry with a legacy chain is refused until the chain follows the contract. Write the chain from the symptom down: ask why the exception exists, then ask why that answer is true, four more times. Add the `rootCheck` you ran today and the `readback`.
213
211
  4. **Queue a rewrite of the rest.** Nothing ends the grace period: a legacy chain whose entry is never touched stays accepted. To make every chain causal, rewrite the remaining ones as tracked work. Rewriting a chain is an edit, so each rewritten chain must pass the contract in that change.
214
212
 
@@ -221,12 +219,12 @@ The copy is an older release, so the package checks more than it did. Read these
221
219
  - [Section 8](#8-moving-to-causal-why-chains), if any exception's `whyChain` has no `rootCheck` and no `readback`: give every check a base revision first.
222
220
  - [Section 10](#10-moving-from-the-discipline-core-names-to-hone) step 4: rule ids written by hand, such as in an `eslint-disable` comment, change from `discipline/...` to `hone/...`.
223
221
  - [Section 14](#14-moving-to-recorded-inline-exceptions): each `@ts-expect-error`, `@ts-ignore`, `@ts-nocheck` and `eslint-disable` is listed under `unrecorded` until it is removed or a file record holds it.
224
- - [Section 15](#15-adopting-cd-2non-null-assertions), if any CD-2 clause is selected: CD-2 has a new clause to list.
222
+ - [Section 15](#15-adopting-the-non-null-assertions-clause), if any clause of the cast discipline ([Claimed type](rules/typescript/symptoms.md#claimed-type)) is selected: it has a new clause to list.
225
223
  - [Step 2a](#2a-carry-over-the-old-routes-settings), if the repository also ran rin's walker or another tool with settings of its own.
226
224
 
227
225
  To move:
228
226
 
229
- 1. **Make sure the toolchain resolves from the repository root**, in the ranges [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 lists: TypeScript 4.8.4 up to 6.x, ESLint 9.28.0 or later on 9 or any 10, and typescript-eslint 8.56.0 or later on 8. Keep the versions the repository already uses.
227
+ 1. **Make sure the toolchain resolves from the repository root**, in the ranges [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 lists: TypeScript 4.8.4 up to 6.x, ESLint 9.39.5 or later on 9, or 10.15.0 or later on 10, and typescript-eslint 8.73.0 or later on 8. Keep the versions the repository already uses.
230
228
  2. **Install the package** as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 says, including the two `hone:` scripts.
231
229
  3. **Repoint every command.** In scripts, CI and the pre-push hook, replace `node tools/discipline-core/core/check/check-command.ts --repo .` with `npm run --silent hone:check`, and `project-command.ts` with `npm run --silent hone:project`. Pass options after `--` with npm, as in `npm run --silent hone:check -- --base-revision origin/main`, and straight after the script name with pnpm, as in `pnpm run --silent hone:check --base-revision origin/main`. A hook or gate that reads the verdict line needs the warning in [ADOPTING.md](ADOPTING.md#5-run-the-check) step 5. Point agent instructions at `node_modules/@hailstails/hone/rules/`.
232
230
  4. **Repoint your own pieces and tests.** Nothing outside the package's public entries can be imported now:
@@ -251,7 +249,7 @@ Before `0.1.0-pre.1` the tool was called discipline core, with provisional names
251
249
  | command `discipline-core-project --repo .` | `hone project --repo .` |
252
250
  | scripts `discipline:check`, `discipline:project` | scripts `hone:check`, `hone:project` |
253
251
  | source entries `core/check/check-command.ts`, `core/check/project-command.ts` | `core/check/tool-command.ts check`, `core/check/tool-command.ts project` |
254
- | ESLint rule ids `discipline/<rule>` (CD-14) | `hone/<rule>` |
252
+ | ESLint rule ids `discipline/<rule>` ([Authored class or this](rules/typescript/symptoms.md#authored-class-or-this)) | `hone/<rule>` |
255
253
  | ESLint rule ids `discipline-cd<N>/<rule>` | `hone-cd<N>/<rule>` |
256
254
  | reserved ESLint namespace `discipline-core` (projection block names, `discipline-core/inline-config`) | `hone-core` (`hone-core/piece/...`, `hone-core/inline-config`) |
257
255
  | rule pages under `node_modules/discipline-core/rules/` | `node_modules/@hailstails/hone/rules/` |
@@ -290,7 +288,7 @@ Earlier releases let a repository record a `clause-wide-carve-out` and set `"ass
290
288
 
291
289
  For each clause the setting skipped:
292
290
 
293
- 1. **Say what is true of it.** Set the clause to `"not-run"` when the rule binds but its check is not a true measure of the rule here, or cannot work here, such as CD-6's ESLint-only `naming-convention` with no ESLint installed: the report lists it under `notRun`, and the rule is owed through review. Set it to `"not-adopted"` when the rule does not apply to this codebase. If neither is true, and the clause is debt the codebase cannot pay right now, keep its mechanism and its carve-out, and let the check run; see [ADOPTING.md](ADOPTING.md#4-write-disciplinesjson) step 4.
291
+ 1. **Say what is true of it.** Set the clause to `"not-run"` when the rule binds but its check is not a true measure of the rule here, or cannot work here, such as the ESLint-only `CD-6#naming-convention` (`name-off-its-casing#naming-convention`) with no ESLint installed: the report lists it under `notRun`, and the rule is owed through review. Set it to `"not-adopted"` when the rule does not apply to this codebase. If neither is true, and the clause is debt the codebase cannot pay right now, keep its mechanism and its carve-out, and let the check run; see [ADOPTING.md](ADOPTING.md#4-write-honeconfigjson) step 4.
294
292
  2. **Delete its carve-out** from `discipline-exceptions.json` when the clause is now `"not-run"` or `"not-adopted"`: an entry on such a clause is invalid, as `clause-not-run` or `clause-not-adopted`, and fails the run.
295
293
  3. **Remove the setting and the flag.** Delete `waivedClauses` from `assessment` in `disciplines.json`, and `--waived-clauses` from scripts, CI and the pre-push hook.
296
294
  4. **Re-project** if any clause was `eslint`: run `npm run --silent hone:project`. The projection no longer carries the clause's rule or its `"off"` block; commit it.
@@ -300,7 +298,7 @@ For each clause the setting skipped:
300
298
 
301
299
  Earlier releases wrote one `disciplines.eslint.mjs` at the repository root, and every package config spread it. A package linted from its own folder resolves `files` against that folder, so the root projection's carve-outs never matched there. Hone now writes a slice per config root; see [README.md](README.md#package-slices).
302
300
 
303
- 1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) step 10 says, and run the check. Under the nearest-to-file lookup, each folder with a tracked `eslint.config.*` is a config root, and the check fails with `eslint missing <package>/disciplines.eslint.mjs` for each until its slice is written.
301
+ 1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 says, and run the check. Under the nearest-to-file lookup, each folder with a tracked `eslint.config.*` is a config root, and the check fails with `eslint missing <package>/disciplines.eslint.mjs` for each until its slice is written.
304
302
  2. **Project and commit.** Run `npm run --silent hone:project` and commit every `disciplines.eslint.mjs` it writes, the root one and each package's.
305
303
  3. **Spread each package's own slice.** In each package config, import `./disciplines.eslint.mjs` from that package's folder and spread it last, in place of the root projection. A package still spreading the root projection is reported `eslint not-applied <package>/disciplines.eslint.mjs` once a recorded file there is under check.
306
304
  4. **List generated configs.** A package whose `eslint.config.*` a tool generates and git ignores gets no slice until its folder is listed under `eslintConfigRoots` in `disciplines.json`. Each listed folder must be one git tracks files under, outside every `exclude` path, or the check stops with `config-root-untracked`.
@@ -311,33 +309,35 @@ Earlier releases wrote one `disciplines.eslint.mjs` at the repository root, and
311
309
 
312
310
  Earlier releases reported an `eslint-disable` comment naming a selected rule as an `inline-disable` no record could cover, and did not report TypeScript directives at all. Inline exceptions are now debt on the clause they escape, in their file, held by the file records you already write.
313
311
 
314
- 1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) step 10 says, and run the check. Each `@ts-expect-error`, `@ts-ignore` and `@ts-nocheck` in a `.ts` or `.tsx` file is listed under `unrecorded` as `CD-2#cast-expressions audit inline-disable <file>:<line> <comment>`, test files included, and each `eslint-disable` as before.
312
+ 1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 says, and run the check. Each `@ts-expect-error`, `@ts-ignore` and `@ts-nocheck` in a `.ts` or `.tsx` file is listed under `unrecorded` as `CD-2#cast-expressions audit inline-disable <file>:<line> <comment>` (`claimed-type#unlisted-cast-site`), test files included, and each `eslint-disable` as before.
315
313
  2. **Remove what you can.** A directive or disable that hides nothing is cheaper to delete than to record.
316
- 3. **Record the rest per clause and file.** Add a `file-carve-out` for debt, or an `authorised-location` where the clause truly does not apply to that file, on the clause the line names and that file. `hone record-debt` writes the debt records ([ADOPTING.md](ADOPTING.md#7a-record-the-debt-you-inherit) step 7a). One record holds every inline exception of that clause in the file. A `clause-wide-carve-out` does not hold them, and a tracked reference on the comment (CD-5) does not stand in for the record. Editing a carved file forfeits the carve-out, and each inline exception it held is listed again.
314
+ 3. **Record the rest per clause and file.** Add a `file-carve-out` for debt, or an `authorised-location` where the clause truly does not apply to that file, on the clause the line names and that file. `hone record-debt` writes the debt records ([ADOPTING.md](ADOPTING.md#7a-record-the-debt-you-inherit) step 7a). One record holds every inline exception of that clause in the file. A `clause-wide-carve-out` does not hold them, and a tracked reference on the comment (`untracked-escape#directive-pointers`) does not stand in for the record. Editing a carved file forfeits the carve-out, and each inline exception it held is listed again.
317
315
  4. **Name the rule in a bare disable.** An `eslint-disable` naming no rule escapes every selected ESLint clause and needs a record for each. Its lines end `names no rule and escapes every selected clause: naming the rule is the cheap fix`.
318
316
  5. **Fix lint-script options.** A `command-line-option` line that ends `weakens the script's whole run, so no record can cover it: remove it from the script` names an option to remove. One that ends `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>"` names a script such as `tsc && eslint -c eslint.config.mjs .`: move the quoted command to a script of its own, then run the check again. One that ends `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>` quotes the first token Hone does not read, such as `env` or a runner flag like `-y`: rewrite the command so only package runners and `NAME=value` settings, including `cross-env NAME=value`, come before `eslint`. `-c` naming the config ESLint already finds, and `--ignore-pattern` that ignores no checked file, are not reported once `eslint` runs plainly.
319
317
  6. **Stale records may clear.** A record that holds a native exception it can cover now counts as used. An `authorised-location` or `file-carve-out` that held only a `config-override`, and was listed `stale` while dropping it left the override unrecorded, is no longer stale.
320
318
  7. **Standalone runners** written outside Hone return `{ hits, nativeExceptions }` from `run`, where `nativeExceptions` holds only `inline-disable` entries with `reach`, in place of a bare list of hits. A runner still returning the list fails with `runner-invalid-output` naming that shape.
321
319
 
320
+ <a id="15-adopting-the-non-null-assertions-clause"></a>
321
+
322
322
  ## 15. Adopting `CD-2#non-null-assertions`
323
323
 
324
- CD-2 gained a clause, `CD-2#non-null-assertions`, checked through `eslint` only. It flags non-null assertions, `x!`, and definite assignment assertions, `let x!: T` and `field!: T`; see [rules/CD-2/CHECKS.md](rules/CD-2/CHECKS.md). A repository that selects any CD-2 clause has adopted CD-2, so after refreshing Hone its check fails with this line under `uncovered` until `disciplines.json` lists the new clause:
324
+ The cast discipline gained a clause, `CD-2#non-null-assertions` (`claimed-type#non-null-assertions`), checked through `eslint` only. It flags non-null assertions, `x!`, and definite assignment assertions, `let x!: T` and `field!: T`; see `rules/typescript/symptoms/claimed-type/non-null-assertions.md`. A repository that selects any of its clauses has adopted that discipline, so after refreshing Hone its check fails with this line under `uncovered` until `disciplines.json` lists the new clause:
325
325
 
326
326
  ```text
327
327
  CD-2#non-null-assertions
328
328
  ```
329
329
 
330
- Choose one state for it, as [ADOPTING.md](ADOPTING.md#4-write-disciplinesjson) step 4 sets out:
330
+ Choose one state for it, as [ADOPTING.md](ADOPTING.md#4-write-honeconfigjson) step 4 sets out:
331
331
 
332
- 1. **The repository runs the ESLint mechanism.** Add `"CD-2#non-null-assertions": "eslint"` to `clauses`, then run `npm run --silent hone:project` and commit `disciplines.eslint.mjs`, and each package slice it writes. Run the check. Each existing `!` is a finding; fix it, or hold it as debt with a `file-carve-out` per file, or a `clause-wide-carve-out` with an owner, after the human approves, and re-run `hone:project` so the projection carries the records. An `eslint-disable` naming no rule now escapes this clause too, and is listed under `unrecorded` for it until a file record on this clause holds it, as section 14 says; naming the rule it means is the cheap fix.
333
- 2. **The repository has no ESLint, or the rule binds but its check is not a true measure here.** Add `"CD-2#non-null-assertions": "not-run"`. The report lists it under `notRun`, and review owes the rule. Nothing is projected and ESLint is not loaded for it.
332
+ 1. **The repository runs the ESLint mechanism.** Add `"CD-2#non-null-assertions": "eslint"` (`claimed-type#non-null-assertions`) to `clauses`, then run `npm run --silent hone:project` and commit `disciplines.eslint.mjs`, and each package slice it writes. Run the check. Each existing `!` is a finding; fix it, or hold it as debt with a `file-carve-out` per file, or a `clause-wide-carve-out` with an owner, after the human approves, and re-run `hone:project` so the projection carries the records. An `eslint-disable` naming no rule now escapes this clause too, and is listed under `unrecorded` for it until a file record on this clause holds it, as section 14 says; naming the rule it means is the cheap fix.
333
+ 2. **The repository has no ESLint, or the rule binds but its check is not a true measure here.** Add `"CD-2#non-null-assertions": "not-run"` (`claimed-type#non-null-assertions`). The report lists it under `notRun`, and review owes the rule. Nothing is projected and ESLint is not loaded for it.
334
334
  3. **The rule does not apply to this codebase.** A tech lead says so in the open, and the clause is listed as `"not-adopted"`. The report lists it under `notAdopted`.
335
335
 
336
336
  Neither `"not-run"` nor `"not-adopted"` takes an exception record. Stop and ask the human before choosing `"not-adopted"`, or before recording carve-outs for existing `!` sites.
337
337
 
338
338
  ## 16. Moving to the split layout
339
339
 
340
- `discipline-exceptions.json` holds every record in one file. The split layout keeps the same records in the `discipline-exceptions` folder, one file for each record kind and discipline, as `.constitution-carve-outs/cd-<id>.json` and `.constitution-authorised-locations/cd-<id>.json` did: [README.md](README.md#the-split-layout) describes it. Moving is optional, and a repository that does nothing keeps the single file.
340
+ `discipline-exceptions.json` holds every record in one file. The split layout keeps the same records in the `discipline-exceptions` folder, one file for each record kind and discipline, as `.constitution-carve-outs/cd-<id>.json` and `.constitution-authorised-locations/cd-<id>.json` did. Moving is optional, and a repository that does nothing keeps the single file.
341
341
 
342
342
  1. **Start a branch from the base your hook and CI pass to the check**, such as `origin/main`, with no other change to the records in it. Fetch the base first, so it is current.
343
343
  2. **Split the records:**
@@ -356,10 +356,10 @@ From then on, `hone record-debt` adds each record to its discipline's file, and
356
356
 
357
357
  Earlier releases never listed an `eslint` file record as `stale`. The off-switch `hone project` writes for a record counted as a `config-override` that the record held, so a record kept its rule off after its file stopped breaking the clause, and a new violation there went unreported. A forfeited `eslint` record's off-switch was also listed under `unrecorded` as a `config-override`. The check no longer counts the projection's own off-switches as native exceptions, and the new `hone prune-debt` removes the records of files that no longer exist.
358
358
 
359
- 1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) step 10 says, and run the check against the branch's base. If none of your `eslint` debt is paid, nothing changes.
359
+ 1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 says, and run the check against the branch's base. If none of your `eslint` debt is paid, nothing changes.
360
360
  2. **If some is, the run fails.** Each paid record is listed under `stale` as `<clause> eslint file-carve-out <file>`.
361
- 3. **Delete each of those records by hand** when its file still exists, then run `npm run --silent hone:project`, which prints `disciplines.eslint.mjs written`. A stale `authorised-location` or `clause-wide-carve-out` is left for a person in the same way.
362
- 4. **Run `hone prune-debt` for records whose file is gone.** When a stale or forfeited record names a file that no longer exists, the report ends with one `readFirst` line naming the command to run, such as:
361
+ 3. **Delete each of those records by hand** when its file still exists, or let `hone prune-debt` remove it once you have also done [section 19](#19-pruning-paid-debt-on-files-that-still-exist), then run `npm run --silent hone:project`, which prints `disciplines.eslint.mjs written`. A stale `authorised-location` or `clause-wide-carve-out` is left for a person in the same way.
362
+ 4. **Run `hone prune-debt` for records whose file is gone.** When a stale or forfeited record names a file that no longer exists, or, after section 19, one whose clause was measured clean on its file, the report ends with one `readFirst` line naming the command to run, such as:
363
363
 
364
364
  ```text
365
365
  prune-debt: 3 file carve-outs under stale or forfeited still record debt that is paid; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js prune-debt --repo /work/shop --base-revision origin/main to remove what is paid, then run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit the exception records with every disciplines.eslint.mjs it writes
@@ -374,3 +374,103 @@ Earlier releases never listed an `eslint` file record as `stale`. The off-switch
374
374
 
375
375
  `hone prune-debt` prints `<clause> removed <file>` for each record it removed. Commit the exception records and `disciplines.eslint.mjs`, and each package slice `hone project` writes. The check passes.
376
376
  5. **Look for a team override that surfaces.** An off-switch your own config places after the projection, for a rule and file a removed record held, was hidden behind the record. It is now listed under `unrecorded` as a `config-override`; [ADOPTING.md](ADOPTING.md#6-read-the-report) step 6 says what to do with it.
377
+
378
+ ## 18. Rules by name
379
+
380
+ Rules, principles, cases, recipes and symptoms are now referred to by name, not by number. [rules/README.md](rules/README.md) explains how the named pages read.
381
+
382
+ Nothing must be migrated. Selections, exception records and findings still use the numbered clause addresses, such as `CD-14#class-syntax` (`authored-class-or-this#class-keyword`), and load and print as before. [Every CD](rules/numbers.md) gives each number's verdict and the named items it became; each check's mechanics are on its own page under its symptom.
383
+
384
+ [Every CD](rules/numbers.md) maps each number to its new names.
385
+
386
+ ## 19. Pruning paid debt on files that still exist
387
+
388
+ `hone prune-debt` used to remove a `file-carve-out` only when its file no longer existed. Each mechanism now reports which clause it measured on which file, and the command also removes a stale or forfeited `file-carve-out` whose clause its mechanism measured on its file, when no finding or native exception still holds it. A finding an `authorised-location` in force exempts no longer holds it, since that finding is answered; a finding only debt exempts, and any native exception on the pair, recorded or not, still do. A file the mechanism skipped, a file outside the checked set and a run that did not happen are not measured, so their records stay.
389
+
390
+ 1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 says, and run the check. A record whose debt is paid on a file that still exists now brings the `prune-debt` line to the end of `readFirst`.
391
+ 2. **Run the command it names,** then `npm run --silent hone:project` when any clause is `eslint`, and commit what they change.
392
+ 3. **Runners written outside Hone** may return `measured`, a list of `{ clause, file }` pairs, beside what they return now; [the mechanism guide](docs/adding-a-discipline-or-mechanism.md) says what a pair means. A runner that returns none has measured nothing, and its records on files that still exist stay for a person, as before.
393
+ 4. **Audit pieces written outside Hone** must answer `skipped` from `prepareFile` for a file they do not judge. Any other answer now says the piece's clauses were measured on that file, so `prune-debt` may remove a record on it; [the audit piece guide](docs/extending.md#an-audit-piece) says so.
394
+
395
+ ## 20. Moving from version 1 to version 2
396
+
397
+ Version 2 keeps its settings in `hone.config.json`, its records in the `hone-records` folder and its native configuration in `hone.<engine>.mjs`, where version 1 kept them in `disciplines.json`, the exception records and `disciplines.<mechanism>.mjs`. `hone upgrade` moves a repository from one to the other in one run, and refuses, changing nothing, when it cannot show that version 2 reports what version 1 reported.
398
+
399
+ 1. **Install version 2 on a branch, with a clean working tree,** the way [ADOPTING.md](ADOPTING.md#10-update-and-remove) section 10 installs a release, and **commit the install**, which changes the pin and the lock, so the working tree is clean before the upgrade. Then stop: run neither `hone:project` nor the check before the upgrade. With version 2 installed both still run version 1's code on a version 1 repository, because `disciplines.json` is what chooses the version, and version 1's `project` rewrites any `disciplines.eslint.mjs` it finds out of date, which leaves uncommitted changes under the upgrade; the upgrade runs version 1's check and `project` itself and refuses when `project` rewrites a file it had already measured. Whatever you run before the upgrade prints version 1's wording, such as `file carve-outs cannot be checked for decay`, so the version 2 lines quoted from step 4 on apply after the upgrade. The working tree is the only rollback: a refusal after files were written puts them back, and names any it could not put back, so you can restore them from version control.
400
+ 2. **Run it:**
401
+
402
+ ```bash
403
+ node_modules/.bin/hone upgrade --repo .
404
+ ```
405
+
406
+ It runs version 1 over your repository, plans the version 2 files, writes them, runs version 2 and compares the two runs. A version 1 `reportOutput` of `failures-only` is written as `actionable`, its version 2 name, and `--report-output failures-only` is refused on a version 2 repository. Only when they agree does it remove the version 1 files. If they do not, it changes nothing. A refusal prints `Nothing was changed.` except the two that [Refusals you may meet](#refusals-you-may-meet) marks, which come from version 1's own `project`, and except one that came after files were written and could not put them all back, which lists those files instead.
407
+ 3. **Commit** what the upgrade wrote and removed, as its own commit after the install: the version 2 files together with the removal of the version 1 files, `git add .`, then your commit. That includes each `hone.eslint.d.mts`, which the check compares with what `hone project` writes and reports under `projection-problems` when it is missing or out of date.
408
+
409
+ After the upgrade, `hone split-records` is not run on version 2 files: it prints `load failure: not-ready-yet split-records: this release runs split-records on version 1 files only, and this repository holds hone.config.json`, and the records stay in `hone-records`. Before it, version 1's `hone authorise` sends you here with `load failure: upgrade-needed disciplines.json: this is a version 1 file; run <upgrade command>, which rewrites every version 1 file as version 2, and commit what it writes`.
410
+ 4. **Run the check with a base revision in at least one run, in CI at least,** for example `npm run --silent hone:check -- --base-revision origin/main`, where the script passes everything after `--` to `hone check`. The report a version 1 reader knew reads a little differently: `exempted` is now `answered`, and `carried` is a section of its own, listing the records the upgrade carried over. The records carried over follow the `forfeiture` setting, as debt does. With the default, `this-run`, every run needs `--base-revision` while a carried record or any debt exists: without one the run prints `forfeiture-unmeasured no-base-revision` when debt exists, first, and `import-unmeasured no-base-revision` when carried records exist, and fails, a bare local check or a hook that passes no base included. With `"forfeiture": "elsewhere"` a run that is given no base leaves the carried records to the run that has one, prints `carried standing elsewhere` with how many, and passes as a partial assessment when nothing else fails. A run with debt also prints `forfeiture elsewhere: <n> debt records not checked for forfeiture in this run` under `assessment`, which is the same setting at work on debt. A run that is given a base judges the carried records against it, but still does not check debt for forfeiture: it still prints that `forfeiture elsewhere` line and still ends `verdict: pass (partial assessment)`, or `verdict: fail (partial assessment)` when something else fails. Some run must assess forfeiture, and the run that does is the one with `"forfeiture": "this-run"`, the default, or `--forfeiture this-run`, given a base. A base that is given and cannot be read still prints `import-unmeasured base-git-failed` and fails under either setting. If no run is ever given a base, carried records are never judged, so keep one run that has it. A second `hone upgrade` prints `already on version 2; nothing to upgrade` and exits `0`.
411
+
412
+ ### What the upgrade prints
413
+
414
+ On success it exits `0` and prints these lines, in this order:
415
+
416
+ - `upgraded to version 2`.
417
+ - `wrote <file>`: `hone.config.json`, each records file under `hone-records/`, each `hone.eslint.mjs` and each `hone.eslint.d.mts`, one for each projection folder, which types the projection beside it. Commit them all.
418
+ - `rewrote <file>`: each ESLint config of yours that imported a version 1 projection, now importing the version 2 one.
419
+ - `removed <path>`: each version 1 file and folder, which are `disciplines.json`, the `disciplines.eslint.mjs` files, and every file and folder of `discipline-exceptions.json` or `discipline-exceptions/`.
420
+
421
+ The paths are relative to `--repo`.
422
+
423
+ A refusal exits `1` and prints `upgrade refused:` and one or more lines saying what to do. Every refusal but the two below ends with `Nothing was changed.`. If a refusal came after files were written and one could not be put back, it prints `These files could not be put back; put them right by hand:` and lists each in place of that line: delete a file or folder the upgrade created, and restore a file it replaced from version control.
424
+
425
+ Exit `3` prints `upgrade incomplete:`. Version 2 is in place, and some version 1 files could not be removed. The output lists every version 1 file still present: delete them by hand, then commit. While `disciplines.json` is still beside `hone.config.json`, every `hone` command stops with `settings-in-both-versions`.
426
+
427
+ ### Refusals you may meet
428
+
429
+ Each line below is the tool's own, with `<...>` standing for what it names. Do what the line says, then run the upgrade again.
430
+
431
+ - `version 1's own run could not be made (<detail>). Run hone check and fix its load failure first.` The same action follows `version 1's run failed (<detail>).` and `version 1's files could not be read (<detail>).`
432
+ - `version 1 already reports <clauses> as uncovered. Select or mark each of them in disciplines.json, then run the upgrade again.`
433
+ - `the file carve-out for <clause> in <file> answers no finding. Remove it, or fix the file it names, then run the upgrade again.` An `answers only a suppression` line says the same.
434
+ - `<clause> in <file> is held by both a file carve-out and an authorised location. Remove one of them first, then run the upgrade again.`
435
+ - `<clause> has no version 2 check to run it, and version 2 does not carry the clauses of a version 1 team rule set. Remove it from disciplines.json to upgrade without it, or stay on version 1.`
436
+ - `<path> already exists. Move it aside, then run the upgrade again.` The same action, with a different cause, follows `<path> could not be read to be replaced (<detail>). Make it readable, then run the upgrade again.`, `<path> could not be created (<detail>). Fix what the detail names, then run the upgrade again.` and `<path> could not be written (<detail>). Fix what the detail names, then run the upgrade again.`
437
+ - Inline directives, which most repositories with recorded inline exceptions ([section 14](#14-moving-to-recorded-inline-exceptions)) meet on the first run. The upgrade runs version 2 over your source before it removes anything, and refuses, with every written file put back, when an `eslint-disable` comment names a rule id version 2 does not have. `these inline directives name a version 1 rule id, which version 2 names differently:` lists each as ` <file>:<line> <id>: write <version 2 id>`, with `each of <ids>` where one id became several, then says `Replace each version 1 id with the version 2 id shown, then run the upgrade again.` `these inline directives name a hone rule id that version 2 has no check under:` lists each as ` <file>:<line> <id>`, then says `Fix each one to name a check of version 2, or remove it, then run the upgrade again.`
438
+ - `the version 1 records are invalid; fix them first:` or `a version 1 record in <records file> is not JSON. Fix it first.`
439
+ - `version 1's own project failed (<detail>). Run hone project with your version 1 release, fix what it reports, then run the upgrade again.`, then `version 1's own project may have changed files before it failed; check version control for what it changed.` The tree may have changed, and this refusal does not say `Nothing was changed.`
440
+ - `version 1's own project rewrote <files>, which the upgrade had already measured. Commit what it wrote, then run the upgrade again.` Version 1's own `project` has changed those files, which stay changed: commit them, then run the upgrade again.
441
+ - `version 2 does not report what version 1 reported:`, then what differs, then `This is a fault in hone, not in your repository. Report it at <issues page>, with this output.` Send the output. Nothing was changed, unless a rollback partly failed, in which case the files it could not put back are listed in its place.
442
+ - A few lines are faults of the tool, and end by asking you to report them at the issues page, either `Report it at <issues page>.` or `This is a fault in hone, not in your repository. Report it at <issues page>, with this output.`, such as `version 2's run failed (<detail>).`, `a finding of <clause> in <file> names no check of version 2. Report it at <issues page>.`, `the carve-out for <clause> in <file> was given no answer.` and `the authorised location for <clause> in <file> was given no answer.`, and `<file> cannot be placed in the repository.` Send the line. The others that name a file, `<file> could not be read (<detail>). Make it readable, then run the upgrade again.`, and `the version 1 projection <projection> has no version 2 projection to take its place, since version 2 runs no lint config in <folder>. Remove it and its import in <config>, then run the upgrade again.`, say what to do.
443
+
444
+ ### Your records, and what the check judges
445
+
446
+ A file carve-out that version 1 held with a `provenance`, as `hone record-debt` writes, or with a `whyChain`, and every authorised location move to `hone-records` word for word, under a `carried` key. These are the carried records. A location is filed at the check or checks that the findings it answers sit at, so one for a clause bound to the audit mechanism lands under the symptom those findings belong to, such as `hone-records/authorised-locations/claimed-type.json`, not under its clause. A file carve-out with neither moves as a debt record with the `reason` as its `note`.
447
+
448
+ The check lists the carried records under `carried`, one line each, `<records file> records[<index>] <standing>`, followed by `lacks` and the keys it lacks when the record lacks any. A carried authorised location lacks `case`, `owes` and `whyChain`, which version 1 did not hold, and its line says so. With a base revision, it judges each one: it is `established` when the base revision held that record unchanged, whether as a version 1 entry or as a version 2 record, so a base from before the upgrade works. A carried record changed since the base is refused as `carried-changed-since-base`, so leave carried records as they are. Without a base revision the standing is `unjudged`: under `"forfeiture": "this-run"`, the default, the run fails with `import-unmeasured no-base-revision`, so every run needs `--base-revision`, local runs and hooks included; under `"forfeiture": "elsewhere"` it prints `carried standing elsewhere` and leaves them to the run that has a base. Version 2 names each finding by its check, such as `authored-class-or-this#class-keyword`, where version 1 named it by its clause, such as `CD-14#class-syntax`.
449
+
450
+ ### Update what names the old files
451
+
452
+ Anything of yours that names a file version 1 kept needs the version 2 name: scripts, CI path filters, pre-push and other hooks, `CODEOWNERS`, and editor or lint-staged settings. The upgrade rewrites only your ESLint config's import. Tests that assert the version 1 layout, such as one that requires `discipline-exceptions/` files to exist or runs the check over a `disciplines.json`, fail after the upgrade, as do prompts, knowledge pages and remedy text of yours that name `disciplines.json`, `discipline-exceptions` or `disciplines.eslint.mjs`, and links to the guide at a version 1 tag.
453
+
454
+ | Version 1 | Version 2 |
455
+ | --- | --- |
456
+ | `disciplines.json` | `hone.config.json` |
457
+ | `discipline-exceptions.json`, `discipline-exceptions/` | `hone-records/` |
458
+ | `disciplines.eslint.mjs` | `hone.eslint.mjs`, and beside it `hone.eslint.d.mts`, which version 1 had no file for |
459
+
460
+ ### ESLint slices and declared roots
461
+
462
+ A repository with package slices, one `disciplines.eslint.mjs` in each package folder that has its own ESLint config, gets one `hone.eslint.mjs` in each of the same folders. Every config that imported a version 1 projection now imports the one in its own folder, and a config that imported several has each import renamed. `eslintConfigRoots` and `eslintConfigLookup` move into `hone.config.json` as they are.
463
+
464
+ After version 1's run, the upgrade runs version 1's own `project` once, to learn which slices exist. A slice that no config root owns any more is removed by it. A refusal after that lists it under `version 1's own project removed these files, and the upgrade does not put them back; restore them from version control:`, since the upgrade did not write it.
465
+
466
+ The refusals an ESLint repository meets:
467
+
468
+ - `<config file> holds no static default import of <projection>. Change its import of it to the form import projection from "<specifier>", then run the upgrade again.` The same action follows `no file imports <projection> with a static default import.`
469
+ - `<config file> imports the version 1 projection <n> times. Import it once.`
470
+ - `<config file> names a version 1 projection outside the imports the upgrade rewrites, or imports one version 1 did not write. Remove the other mention or import, then run the upgrade again.`
471
+ - `the version 1 projection <projection> is <state>. Run hone project with your version 1 release, commit what it writes, then run the upgrade again.` For some states it says `Run hone check with your version 1 release, fix what it reports` in place of that.
472
+ - `the version 1 projection <projection> belongs to no config root and is out of date. Delete it or restore its config root, commit, then run the upgrade again.`
473
+ - `version 2 cannot run this repository yet (<line>). Do what it names, or stay on version 1 until version 2 runs it, then run the upgrade again.` `<line>` is a load failure, usually `load failure: not-ready-yet eslint-config-roots: …`, which a repository holding another `hone.config.json` folder meets.
474
+ - `version 2's projection could not be made (<line>). Fix what it names, then run the upgrade again.`
475
+ - `version 2 would project <file>, but version 1 has no projection in <folder>. With your version 1 release, run hone project and import what it writes in the lint config of <folder>, commit, then run the upgrade again.`
476
+ - `the version 1 projection <projection> has no version 2 projection to take its place, since version 2 runs no lint config in <folder>. Remove it and its import in <config file>, then run the upgrade again.`