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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/ADOPTING.md +9 -20
  2. package/CHANGELOG.md +104 -0
  3. package/MIGRATING.md +18 -9
  4. package/README.md +15 -17
  5. package/chunks/chunk-3CWFUD5B.js +38 -0
  6. package/chunks/chunk-4AJQHZ7I.js +191 -0
  7. package/chunks/chunk-5AKHEW6V.js +15 -0
  8. package/chunks/{chunk-L7BGRC6D.js → chunk-6LTJRJOE.js} +1 -1
  9. package/chunks/chunk-75XWZYNN.js +64 -0
  10. package/chunks/{chunk-ASUN4AVC.js → chunk-BISP2JOL.js} +73 -9
  11. package/chunks/chunk-COQMPHWZ.js +37 -0
  12. package/chunks/chunk-D6645WPB.js +6 -0
  13. package/chunks/chunk-DJMF6JIM.js +42 -0
  14. package/chunks/chunk-EBX57Z3V.js +8 -0
  15. package/chunks/chunk-EFUWHLZK.js +426 -0
  16. package/chunks/chunk-FHVNKG5Q.js +19 -0
  17. package/chunks/{chunk-NRIQD3PI.js → chunk-FRE5IA3C.js} +3 -5
  18. package/chunks/{chunk-OKLYWD2Z.js → chunk-GMLT3MHO.js} +262 -257
  19. package/chunks/{chunk-QP5TLOBY.js → chunk-HVZVKZPW.js} +12 -9
  20. package/chunks/chunk-LEFM7OPS.js +41 -0
  21. package/chunks/chunk-LNMDMRGQ.js +51 -0
  22. package/chunks/chunk-M4VSJ27S.js +139 -0
  23. package/chunks/{chunk-RGSHTPLA.js → chunk-MBEDAFVC.js} +3 -11
  24. package/chunks/chunk-ND3EOGDK.js +2350 -0
  25. package/chunks/chunk-ONDBACCR.js +14332 -0
  26. package/chunks/chunk-OO5KV7KN.js +17 -0
  27. package/chunks/chunk-SKDQ3QJD.js +75 -0
  28. package/chunks/chunk-U6W65ZOF.js +86 -0
  29. package/chunks/chunk-W5OIAUDW.js +18 -0
  30. package/chunks/{chunk-GNOMK7CR.js → chunk-WPEOCLTP.js} +495 -52
  31. package/chunks/chunk-X73RZUPO.js +63 -0
  32. package/chunks/chunk-XE2KKWYH.js +45 -0
  33. package/chunks/chunk-XNIXPQQ5.js +179 -0
  34. package/chunks/chunk-YONPKP3C.js +15 -0
  35. package/docs/adding-a-discipline-or-mechanism.md +1 -1
  36. package/docs/extending.md +7 -388
  37. package/methods/lenses/function-first.md +2 -2
  38. package/package.json +7 -6
  39. package/rules/README.md +7 -5
  40. package/rules/SPIRIT.md +1 -1
  41. package/rules/numbers.md +4 -4
  42. package/rules/principles/no-leak-across-a-boundary.md +1 -1
  43. package/rules/principles.md +1 -1
  44. package/rules/record-kinds/authorised-location.md +1 -1
  45. package/rules/records.md +11 -19
  46. package/rules/rules.md +5 -5
  47. package/rules/sources.md +6 -7
  48. package/rules/typescript/checks.md +280 -394
  49. package/rules/typescript/recipes/adapter-per-outside-party.md +10 -5
  50. package/rules/typescript/recipes/assert-to-narrow.md +114 -4
  51. package/rules/typescript/recipes/closure-factory.md +5 -5
  52. package/rules/typescript/recipes/companion-test-file.md +5 -3
  53. package/rules/typescript/recipes/composed-orchestrator.md +6 -4
  54. package/rules/typescript/recipes/composition-root.md +5 -3
  55. package/rules/typescript/recipes/{bounded-context-generic.md → constrained-context-generic.md} +6 -4
  56. package/rules/typescript/recipes/copy-never-write-in.md +6 -4
  57. package/rules/typescript/recipes/declared-not-bundled.md +5 -3
  58. package/rules/typescript/recipes/dependency-record.md +5 -3
  59. package/rules/typescript/recipes/domain-vocabulary-list.md +5 -3
  60. package/rules/typescript/recipes/entity-module.md +8 -5
  61. package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +5 -3
  62. package/rules/typescript/recipes/extension-outside-the-vendored-code.md +5 -3
  63. package/rules/typescript/recipes/failure-asserted-as-a-value.md +44 -4
  64. package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +8 -5
  65. package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +5 -3
  66. package/rules/typescript/recipes/functional-iteration.md +8 -3
  67. package/rules/typescript/recipes/guard-clauses.md +5 -3
  68. package/rules/typescript/recipes/integration-test-owns-its-scratch.md +5 -3
  69. package/rules/typescript/recipes/integration-test-suffix.md +5 -3
  70. package/rules/typescript/recipes/it-each-over-typed-rows.md +117 -0
  71. package/rules/typescript/recipes/map-out-at-the-adapter.md +36 -4
  72. package/rules/typescript/recipes/meaning-in-names-not-comments.md +5 -5
  73. package/rules/typescript/recipes/named-exported-type.md +5 -3
  74. package/rules/typescript/recipes/narrow-ports.md +5 -3
  75. package/rules/typescript/recipes/one-argument-object.md +8 -3
  76. package/rules/typescript/recipes/{port-in-the-domain.md → port-in-a-module-of-its-own.md} +7 -5
  77. package/rules/typescript/recipes/ports-in-the-argument.md +5 -3
  78. package/rules/typescript/recipes/repo-scripts-only.md +5 -3
  79. package/rules/typescript/recipes/result-union.md +5 -5
  80. package/rules/typescript/recipes/screaming-folders.md +5 -5
  81. package/rules/typescript/recipes/shared-strict-base-config.md +5 -5
  82. package/rules/typescript/recipes/stub-with-vi-fn.md +130 -0
  83. package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +5 -3
  84. package/rules/typescript/recipes/whole-words.md +5 -3
  85. package/rules/typescript/recipes/whole-written-out-expectation.md +284 -4
  86. package/rules/typescript/recipes/world-values-through-a-port.md +5 -3
  87. package/rules/typescript/recipes/zod-at-the-producers-adapter.md +8 -3
  88. package/rules/typescript/recipes.md +567 -21
  89. package/rules/typescript/symptoms/ambient-randomness/random-call.md +10 -0
  90. package/rules/typescript/symptoms/ambient-randomness.md +1 -1
  91. package/rules/typescript/symptoms/answer-set-in-a-hook/hook-answer.md +10 -0
  92. package/rules/typescript/symptoms/answer-set-in-a-hook.md +1 -1
  93. package/rules/typescript/symptoms/assertion-outside-a-test-body/assertion-site.md +10 -0
  94. package/rules/typescript/symptoms/assertion-outside-a-test-body.md +25 -0
  95. package/rules/typescript/symptoms/branch-in-a-test/test-body.md +10 -184
  96. package/rules/typescript/symptoms/branch-in-a-test.md +11 -1
  97. package/rules/typescript/symptoms/built-unit-called-in-place/call-of-a-call.md +10 -0
  98. package/rules/typescript/symptoms/built-unit-called-in-place.md +25 -0
  99. package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +1 -1
  100. package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test/raw-read.md +10 -0
  101. package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test.md +31 -0
  102. package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +26 -117
  103. package/rules/typescript/symptoms/computed-value-in-a-test.md +1 -1
  104. package/rules/typescript/symptoms/date-used-directly.md +1 -1
  105. package/rules/typescript/symptoms/default-for-a-required-value.md +1 -1
  106. package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +2 -19
  107. package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +2 -2
  108. package/rules/typescript/symptoms/double-with-a-body.md +1 -1
  109. package/rules/typescript/symptoms/export-from-a-test/test-file-export.md +10 -0
  110. package/rules/typescript/symptoms/export-from-a-test.md +33 -0
  111. package/rules/typescript/symptoms/failure-shaped-as-success/empty-catch.md +10 -0
  112. package/rules/typescript/symptoms/failure-shaped-as-success.md +1 -1
  113. package/rules/typescript/symptoms/floating-version/version-selector.md +10 -0
  114. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +2 -2
  115. package/rules/typescript/symptoms/inner-layer-imports-outer.md +1 -1
  116. package/rules/typescript/symptoms/library-class-built-in-place.md +1 -1
  117. package/rules/typescript/symptoms/loop-keyword/loop-statement.md +1 -1
  118. package/rules/typescript/symptoms/many-spellings-of-one-concept/test-call-aliases.md +10 -0
  119. package/rules/typescript/symptoms/many-spellings-of-one-concept.md +3 -2
  120. package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +4 -4
  121. package/rules/typescript/symptoms/no-lock-file/committed-lock-file.md +12 -0
  122. package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +1 -0
  123. package/rules/typescript/symptoms/outside-import-past-a-boundary.md +5 -4
  124. package/rules/typescript/symptoms/outside-type-in-a-signature.md +2 -2
  125. package/rules/typescript/symptoms/{port-outside-the-domain.md → port-beside-its-adapter.md} +2 -2
  126. package/rules/typescript/symptoms/port-named-for-a-mechanism.md +1 -1
  127. package/rules/typescript/symptoms/process-global-used-in-place/debugger-statement.md +10 -0
  128. package/rules/typescript/symptoms/process-global-used-in-place/direct-global-use.md +14 -0
  129. package/rules/typescript/symptoms/process-global-used-in-place.md +2 -2
  130. package/rules/typescript/symptoms/prose-in-code/comment-prose.md +12 -0
  131. package/rules/typescript/symptoms/rebinding/test-body.md +1 -18
  132. package/rules/typescript/symptoms/rebinding.md +11 -1
  133. package/rules/typescript/symptoms/schema-past-its-adapter.md +2 -2
  134. package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +3 -6
  135. package/rules/typescript/symptoms/test-switched-off.md +1 -1
  136. package/rules/typescript/symptoms/text-past-its-reader/test-body.md +2 -17
  137. package/rules/typescript/symptoms/text-past-its-reader.md +1 -1
  138. package/rules/typescript/symptoms/throw-between-our-units/throw-statement.md +10 -0
  139. package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +1 -1
  140. package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +1 -25
  141. package/rules/typescript/symptoms/tool-fetched-at-run-time/fetch-command.md +10 -0
  142. package/rules/typescript/symptoms/type-declared-in-a-test/test-type-declaration.md +10 -0
  143. package/rules/typescript/symptoms/type-declared-in-a-test.md +33 -0
  144. package/rules/typescript/symptoms/unasserted-call.md +1 -1
  145. package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +2 -2
  146. package/rules/typescript/symptoms/wide-input/unread-parameter.md +10 -0
  147. package/rules/typescript/symptoms/wide-input.md +3 -2
  148. package/rules/typescript/symptoms.md +210 -148
  149. package/src/application/conformance/conformance-testing-types.d.ts +13 -16
  150. package/src/domain/language-layer/authored-item-types.d.ts +66 -0
  151. package/src/domain/language-layer/catalogue-name.d.ts +5 -0
  152. package/src/domain/language-layer/check-address-text.d.ts +12 -0
  153. package/src/domain/rule-set/authored-rule-set-types.d.ts +31 -32
  154. package/src/domain/rule-set/clause-address-types.d.ts +4 -3
  155. package/src/domain/rule-set/rule-set-name-of.d.ts +10 -0
  156. package/src/domain/runner/check-binding.d.ts +18 -0
  157. package/src/domain/runner/check-observations.d.ts +39 -0
  158. package/src/domain/runner/conformance-types.d.ts +8 -2
  159. package/src/domain/runner/runner-result-types.d.ts +1 -2
  160. package/src/domain/settings/test-files.d.ts +7 -0
  161. package/src/eslint-plugin.js +45 -39
  162. package/src/hone.js +16 -13716
  163. package/src/infrastructure/disciplines-file/version-one-names.json +4 -5
  164. package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +0 -6
  165. package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +0 -6
  166. package/src/infrastructure/engines/eslint/runner/pieces/eslint-piece-settings-types.d.ts +2 -0
  167. package/src/infrastructure/engines/eslint/runner/runner.js +1001 -1234
  168. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/README.md +0 -3
  169. package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js +33 -21
  170. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +11 -4
  171. package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +28 -0
  172. package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +0 -2
  173. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/eslint-plugin.js +94 -0
  174. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/piece.json +11 -0
  175. package/src/infrastructure/engines/eslint/wide-input/unread-parameter/unread-parameter.examples.json +48 -0
  176. package/src/infrastructure/engines/walker/ambient-randomness/random-call/ambient-randomness.js +109 -0
  177. package/src/infrastructure/engines/walker/ambient-randomness/random-call/piece.json +9 -0
  178. package/src/infrastructure/engines/walker/ambient-randomness/random-call/random-call.examples.json +48 -0
  179. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answer.examples.json +42 -0
  180. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answers.js +72 -0
  181. package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/piece.json +9 -0
  182. package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.examples.json +30 -0
  183. package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.js +123 -0
  184. package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/piece.json +9 -0
  185. package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-syntax.js +3 -3
  186. package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-signatures.js +7 -5
  187. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +192 -147
  188. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.examples.json +24 -0
  189. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.js +34 -0
  190. package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/piece.json +9 -0
  191. package/src/infrastructure/engines/walker/claimed-type/cast-to-any/any-cast.js +6 -4
  192. package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/cast-expressions.js +6 -4
  193. package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/piece.json +9 -0
  194. package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.examples.json +30 -0
  195. package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.js +166 -0
  196. package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +0 -10
  197. package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +4 -4
  198. package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +8 -6
  199. package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +0 -10
  200. package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/dependency-isolation.js +9 -14
  201. package/src/infrastructure/engines/walker/drawer-path/drawer-names/categorical-paths.js +4 -4
  202. package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/piece.json +9 -0
  203. package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.examples.json +30 -0
  204. package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.js +31 -0
  205. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.examples.json +18 -0
  206. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.js +32 -0
  207. package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/piece.json +9 -0
  208. package/src/infrastructure/engines/walker/floating-version/version-selector/piece.json +9 -0
  209. package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.examples.json +54 -0
  210. package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.js +75 -0
  211. package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/hermetic-git-spawns.js +8 -17
  212. package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loops.js +8 -6
  213. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/piece.json +9 -0
  214. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.examples.json +36 -0
  215. package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.js +67 -0
  216. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +34 -0
  217. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mocking.js +64 -16
  218. package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +5 -1
  219. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.examples.json +24 -0
  220. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.js +41 -0
  221. package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/piece.json +9 -0
  222. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +18 -16
  223. package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +1 -1
  224. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.examples.json +18 -0
  225. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.js +17 -0
  226. package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/piece.json +9 -0
  227. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/direct-global-use.examples.json +63 -0
  228. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/piece.json +13 -0
  229. package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/process-global-used-in-place.js +126 -0
  230. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/comment-prose.examples.json +42 -0
  231. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/piece.json +16 -0
  232. package/src/infrastructure/engines/walker/prose-in-code/comment-prose/prose-in-code.js +90 -0
  233. package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +0 -10
  234. package/src/infrastructure/engines/walker/runner/pieces/walker-piece.d.ts +7 -5
  235. package/src/infrastructure/engines/walker/runner/runner.js +268 -79
  236. package/src/infrastructure/engines/walker/runner/toolchain/typescript-parse.d.ts +3 -0
  237. package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.js +12 -7
  238. package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +0 -10
  239. package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +0 -10
  240. package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +0 -10
  241. package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +0 -10
  242. package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +0 -10
  243. package/src/infrastructure/engines/walker/strictness-weakened/strict/compiler-overrides.js +30 -52
  244. package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +0 -10
  245. package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +0 -10
  246. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/piece.json +9 -0
  247. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throw-statement.examples.json +36 -0
  248. package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throws-in-production.js +12 -0
  249. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +6 -6
  250. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throws-in-tests.js +5 -44
  251. package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +0 -10
  252. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.examples.json +42 -0
  253. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.js +152 -0
  254. package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/piece.json +9 -0
  255. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/piece.json +9 -0
  256. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.examples.json +36 -0
  257. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.js +141 -0
  258. package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.js +8 -6
  259. package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/export-test-sibling.js +16 -10
  260. package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/comments-directives.js +18 -64
  261. package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.js +7 -5
  262. package/src/measure-engines.process.js +80 -0
  263. package/src/rule-set.d.ts +2 -1
  264. package/src/testing.d.ts +2 -4
  265. package/src/testing.js +173 -314
  266. package/src/{audit.d.ts → walker.d.ts} +13 -8
  267. package/src/walker.js +28 -0
  268. package/chunks/chunk-5HRMJ4O2.js +0 -608
  269. package/chunks/chunk-IX2VZTBO.js +0 -887
  270. package/chunks/chunk-K2W3D3NB.js +0 -17
  271. package/chunks/chunk-M6SOGWT7.js +0 -82
  272. package/chunks/chunk-Q62Y25WS.js +0 -843
  273. package/chunks/chunk-R75QELTA.js +0 -481
  274. package/chunks/chunk-RANAKCTW.js +0 -31
  275. package/chunks/chunk-TNY2PASL.js +0 -38
  276. package/chunks/chunk-UJONWHA4.js +0 -22
  277. package/docs/output-contract.md +0 -1155
  278. package/rules/record-kinds/boundary-record.md +0 -9
  279. package/rules/typescript/recipes/iteach-over-typed-rows.md +0 -18
  280. package/rules/typescript/recipes/stub-with-vifn.md +0 -20
  281. package/src/audit.js +0 -18
  282. package/src/domain/runner/runner-module-types.d.ts +0 -15
@@ -0,0 +1,141 @@
1
+ import {
2
+ syntaxNodeCheck
3
+ } from "../../../../../../chunks/chunk-LEFM7OPS.js";
4
+ import "../../../../../../chunks/chunk-5AKHEW6V.js";
5
+ import {
6
+ testFileEligibility
7
+ } from "../../../../../../chunks/chunk-COQMPHWZ.js";
8
+ import "../../../../../../chunks/chunk-DGOLOS5A.js";
9
+
10
+ // src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.ts
11
+ var ROW_TABLE_RECEIVERS = /* @__PURE__ */ new Set(["it", "describe"]);
12
+ var ROW_TABLE_METHOD = "each";
13
+ var READONLY_ARRAY = "ReadonlyArray";
14
+ var enclosingAugmentation = ({
15
+ syntaxApi,
16
+ node
17
+ }) => {
18
+ const container = node.parent;
19
+ if (syntaxApi.isSourceFile(container)) return void 0;
20
+ if (syntaxApi.isModuleDeclaration(container) && (syntaxApi.isStringLiteral(container.name) || (container.flags & syntaxApi.NodeFlags.GlobalAugmentation) !== 0))
21
+ return container;
22
+ return enclosingAugmentation({ syntaxApi, node: container });
23
+ };
24
+ var importedNamesOf = (request) => {
25
+ const { syntaxApi, sourceFile } = request;
26
+ return new Set(
27
+ sourceFile.statements.flatMap((statement) => {
28
+ if (!syntaxApi.isImportDeclaration(statement) || statement.importClause === void 0)
29
+ return [];
30
+ const { name, namedBindings } = statement.importClause;
31
+ const named = namedBindings === void 0 || syntaxApi.isNamespaceImport(namedBindings) ? [] : namedBindings.elements.map((element) => element.name.text);
32
+ return name === void 0 ? named : [name.text, ...named];
33
+ })
34
+ );
35
+ };
36
+ var wholeRowPart = (parts) => parts.length > 0 && parts.every((part) => part === "fits-a-row") ? "fits-a-row" : "breaks-a-row";
37
+ var primitiveKeywordPart = ({ syntaxApi, node }) => {
38
+ const { SyntaxKind } = syntaxApi;
39
+ return [
40
+ SyntaxKind.StringKeyword,
41
+ SyntaxKind.NumberKeyword,
42
+ SyntaxKind.BooleanKeyword,
43
+ SyntaxKind.BigIntKeyword,
44
+ SyntaxKind.SymbolKeyword,
45
+ SyntaxKind.UndefinedKeyword
46
+ ].includes(node.kind) || syntaxApi.isLiteralTypeNode(node) && node.literal.kind === SyntaxKind.NullKeyword ? "fits-a-row" : "breaks-a-row";
47
+ };
48
+ var importedTypeReferencePart = (request) => {
49
+ const { syntaxApi, importedNames, node } = request;
50
+ return syntaxApi.isTypeReferenceNode(node) && syntaxApi.isIdentifier(node.typeName) && importedNames.has(node.typeName.text) && (node.typeArguments ?? []).every(
51
+ (argument) => rowMemberPart({ ...request, node: argument }) === "fits-a-row"
52
+ ) ? "fits-a-row" : "breaks-a-row";
53
+ };
54
+ var readonlyListPart = (request) => {
55
+ const { syntaxApi, node } = request;
56
+ if (syntaxApi.isTypeOperatorNode(node))
57
+ return node.operator === syntaxApi.SyntaxKind.ReadonlyKeyword && syntaxApi.isArrayTypeNode(node.type) ? importedTypeReferencePart({ ...request, node: node.type.elementType }) : "breaks-a-row";
58
+ if (!syntaxApi.isTypeReferenceNode(node) || !syntaxApi.isIdentifier(node.typeName) || node.typeName.text !== READONLY_ARRAY)
59
+ return "breaks-a-row";
60
+ const [element, ...others] = node.typeArguments ?? [];
61
+ return element !== void 0 && others.length === 0 ? importedTypeReferencePart({ ...request, node: element }) : "breaks-a-row";
62
+ };
63
+ var rowMemberPart = (request) => [importedTypeReferencePart, readonlyListPart, primitiveKeywordPart].some(
64
+ (partOf) => partOf(request) === "fits-a-row"
65
+ ) ? "fits-a-row" : "breaks-a-row";
66
+ var objectMemberPart = (request) => {
67
+ const { syntaxApi, node } = request;
68
+ return syntaxApi.isPropertySignature(node) && node.type !== void 0 && node.questionToken === void 0 ? rowMemberPart({ ...request, node: node.type }) : "breaks-a-row";
69
+ };
70
+ var tupleElementPart = (request) => {
71
+ const { syntaxApi, node } = request;
72
+ if (!syntaxApi.isNamedTupleMember(node)) return rowMemberPart(request);
73
+ return node.dotDotDotToken === void 0 && node.questionToken === void 0 ? rowMemberPart({ ...request, node: node.type }) : "breaks-a-row";
74
+ };
75
+ var tupleRowPart = (request) => {
76
+ const { syntaxApi, node } = request;
77
+ return syntaxApi.isTupleTypeNode(node) ? wholeRowPart(node.elements.map((element) => tupleElementPart({ ...request, node: element }))) : "breaks-a-row";
78
+ };
79
+ var rowShapePart = (request) => {
80
+ const { syntaxApi, node } = request;
81
+ if (syntaxApi.isTypeOperatorNode(node))
82
+ return node.operator === syntaxApi.SyntaxKind.ReadonlyKeyword ? tupleRowPart({ ...request, node: node.type }) : "breaks-a-row";
83
+ if (syntaxApi.isTypeLiteralNode(node))
84
+ return wholeRowPart(
85
+ node.members.map((member) => objectMemberPart({ ...request, node: member }))
86
+ );
87
+ return tupleRowPart(request);
88
+ };
89
+ var rowUseOf = (request) => {
90
+ const { syntaxApi, identifier } = request;
91
+ const reference = identifier.parent;
92
+ if (!syntaxApi.isTypeReferenceNode(reference) || reference.typeArguments !== void 0)
93
+ return "other-use";
94
+ const call = reference.parent;
95
+ return syntaxApi.isCallExpression(call) && call.typeArguments?.length === 1 && call.typeArguments.includes(reference) && syntaxApi.isPropertyAccessExpression(call.expression) && syntaxApi.isIdentifier(call.expression.expression) && ROW_TABLE_RECEIVERS.has(call.expression.expression.text) && call.expression.name.text === ROW_TABLE_METHOD ? "row-table-argument" : "other-use";
96
+ };
97
+ var useIn = (request) => {
98
+ const { syntaxApi, declared, use } = request;
99
+ return syntaxApi.forEachChild(
100
+ request.node,
101
+ (child) => syntaxApi.isIdentifier(child) && child !== declared && child.text === declared.text && rowUseOf({ syntaxApi, identifier: child }) === use ? use : useIn({ ...request, node: child })
102
+ );
103
+ };
104
+ var rowVerdictOf = (request) => {
105
+ const { syntaxApi, sourceFile, node } = request;
106
+ if (!syntaxApi.isTypeAliasDeclaration(node) || node.parent !== sourceFile || node.typeParameters !== void 0 || node.modifiers?.some((modifier) => modifier.kind === syntaxApi.SyntaxKind.ExportKeyword) === true || rowShapePart({ syntaxApi, importedNames: request.readImportedNames(), node: node.type }) === "breaks-a-row")
107
+ return "flagged";
108
+ const uses = { syntaxApi, node: sourceFile, declared: node.name };
109
+ return useIn({ ...uses, use: "other-use" }) === void 0 && useIn({ ...uses, use: "row-table-argument" }) !== void 0 ? "spared" : "flagged";
110
+ };
111
+ var check = {
112
+ prepare: (request) => {
113
+ const importedNames = /* @__PURE__ */ new WeakMap();
114
+ const importedNamesIn = (visit) => {
115
+ const known = importedNames.get(visit.sourceFile);
116
+ if (known !== void 0) return known;
117
+ const names = importedNamesOf(visit);
118
+ importedNames.set(visit.sourceFile, names);
119
+ return names;
120
+ };
121
+ return syntaxNodeCheck({
122
+ eligibility: testFileEligibility,
123
+ found: ({ syntaxApi, node, sourceFile }) => {
124
+ if (!syntaxApi.isTypeAliasDeclaration(node) && !syntaxApi.isInterfaceDeclaration(node) && !syntaxApi.isEnumDeclaration(node))
125
+ return void 0;
126
+ if (enclosingAugmentation({ syntaxApi, node }) !== void 0) return void 0;
127
+ const verdict = rowVerdictOf({
128
+ syntaxApi,
129
+ sourceFile,
130
+ node,
131
+ readImportedNames: () => importedNamesIn({ syntaxApi, sourceFile })
132
+ });
133
+ if (verdict === "spared") return void 0;
134
+ return { at: node, snippet: node.name.getText(sourceFile) };
135
+ }
136
+ }).prepare(request);
137
+ }
138
+ };
139
+ export {
140
+ check
141
+ };
@@ -1,6 +1,9 @@
1
+ import {
2
+ compactSourceSnippetOf
3
+ } from "../../../../../../chunks/chunk-5AKHEW6V.js";
1
4
  import {
2
5
  folderScope
3
- } from "../../../../../../chunks/chunk-K2W3D3NB.js";
6
+ } from "../../../../../../chunks/chunk-COQMPHWZ.js";
4
7
  import "../../../../../../chunks/chunk-DGOLOS5A.js";
5
8
 
6
9
  // src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.ts
@@ -11,7 +14,7 @@ var sourceEligibility = (request) => {
11
14
  };
12
15
  var RETURN_TYPE_TYPEOF = /\bReturnType\s*<\s*typeof\b/;
13
16
  var check = {
14
- prepare: ({ clauses }) => ({
17
+ prepare: ({ bindings }) => ({
15
18
  outcome: "ok",
16
19
  value: {
17
20
  prepareFile: ({ file, readText }) => {
@@ -24,10 +27,9 @@ var check = {
24
27
  const trimmed = line.trim();
25
28
  if (trimmed.startsWith("//") || trimmed.startsWith("*") || trimmed.startsWith("/*") || !RETURN_TYPE_TYPEOF.test(line))
26
29
  return [];
27
- const collapsed = trimmed.replace(/\s+/g, " ");
28
- const snippet = collapsed.length > 80 ? `${collapsed.slice(0, 80)}\u2026` : collapsed;
29
- return clauses.map((clause) => ({
30
- clause: clause.address,
30
+ const snippet = compactSourceSnippetOf(trimmed);
31
+ return bindings.map((binding) => ({
32
+ check: binding.address,
31
33
  anchor: { line: index + 1, column: 0 },
32
34
  snippet
33
35
  }));
@@ -1,22 +1,28 @@
1
1
  import {
2
+ fileRoleOf,
2
3
  folderScope
3
- } from "../../../../../../chunks/chunk-K2W3D3NB.js";
4
+ } from "../../../../../../chunks/chunk-COQMPHWZ.js";
4
5
  import "../../../../../../chunks/chunk-DGOLOS5A.js";
5
6
 
6
7
  // src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/export-test-sibling.ts
7
8
  var productionFileEligibility = (request) => {
8
9
  const directories = request.file.split("/").slice(0, -1);
9
- if (!request.file.endsWith(".ts") && !request.file.endsWith(".tsx") || request.file.endsWith(".test.ts") || request.file.endsWith(".test.tsx") || request.file.endsWith(".d.ts") || directories.includes("__tests__") || folderScope({ file: request.file }) === "generated")
10
+ if (!request.file.endsWith(".ts") && !request.file.endsWith(".tsx") || fileRoleOf(request) === "test" || request.file.endsWith(".d.ts") || directories.includes("__tests__") || folderScope({ file: request.file }) === "generated")
10
11
  return "skipped";
11
12
  return "eligible";
12
13
  };
13
- var testSiblingOf = (request) => request.file.endsWith(".tsx") ? request.file.replace(/\.tsx$/, ".test.tsx") : request.file.replace(/\.ts$/, ".test.ts");
14
+ var EXTENSION = /\.tsx?$/;
15
+ var testSiblingsOf = (request) => request.testFiles.suffixes.map(
16
+ (suffix) => request.file.replace(EXTENSION, (extension) => `.${suffix}${extension}`)
17
+ );
18
+ var missingSiblingSnippet = (request) => `missing co-located *.${request.testFiles.suffixes[0]}.ts(x) sibling`;
14
19
  var check = {
15
- prepare: ({ clauses, repository, syntaxApi }) => ({
20
+ prepare: ({ bindings, repository, syntaxApi }) => ({
16
21
  outcome: "ok",
17
22
  value: {
18
23
  prepareFile: ({ file }) => {
19
- if (productionFileEligibility({ file }) === "skipped") {
24
+ const { testFiles } = repository;
25
+ if (productionFileEligibility({ file, testFiles }) === "skipped") {
20
26
  return { outcome: "ok", value: { kind: "skipped" } };
21
27
  }
22
28
  return {
@@ -36,13 +42,13 @@ var check = {
36
42
  return true;
37
43
  return syntaxApi.isExportDeclaration(statement) && !statement.isTypeOnly && statement.exportClause !== void 0 && syntaxApi.isNamedExports(statement.exportClause) && statement.exportClause.elements.some((specifier) => !specifier.isTypeOnly);
38
44
  });
39
- const sibling = testSiblingOf({ file });
40
- const hasSibling = repository.files.some((candidate) => candidate === sibling);
45
+ const siblings = testSiblingsOf({ file, testFiles });
46
+ const hasSibling = repository.files.some((candidate) => siblings.includes(candidate));
41
47
  return {
42
- finish: () => hasRuntimeExport && !hasSibling ? clauses.map((clause) => ({
43
- clause: clause.address,
48
+ finish: () => hasRuntimeExport && !hasSibling ? bindings.map((binding) => ({
49
+ check: binding.address,
44
50
  anchor: anchorAt({ position: 0 }),
45
- snippet: "missing co-located *.test.ts(x) sibling"
51
+ snippet: missingSiblingSnippet({ testFiles })
46
52
  })) : []
47
53
  };
48
54
  }
@@ -1,16 +1,16 @@
1
1
  import {
2
- stringListClauseSettings
3
- } from "../../../../../../chunks/chunk-UJONWHA4.js";
2
+ trackedChecksOf,
3
+ trackingAnywhere,
4
+ trackingAtStart
5
+ } from "../../../../../../chunks/chunk-X73RZUPO.js";
6
+ import "../../../../../../chunks/chunk-W5OIAUDW.js";
4
7
  import {
5
8
  folderScope
6
- } from "../../../../../../chunks/chunk-K2W3D3NB.js";
9
+ } from "../../../../../../chunks/chunk-COQMPHWZ.js";
7
10
  import {
8
11
  typeDirectiveReaderFor
9
- } from "../../../../../../chunks/chunk-RGSHTPLA.js";
10
- import {
11
- clauseAddressText,
12
- gatheredOutcomes
13
- } from "../../../../../../chunks/chunk-M6SOGWT7.js";
12
+ } from "../../../../../../chunks/chunk-MBEDAFVC.js";
13
+ import "../../../../../../chunks/chunk-YONPKP3C.js";
14
14
  import "../../../../../../chunks/chunk-DGOLOS5A.js";
15
15
 
16
16
  // src/infrastructure/engines/walker/untracked-escape/directive-pointers/comments-directives.ts
@@ -21,60 +21,18 @@ var sourceEligibility = (request) => {
21
21
  };
22
22
  var TODO_PATTERN = /\/\/\s*TODO\b/;
23
23
  var LINTER_DIRECTIVE_PATTERN = /^(?:\/\/|\/\*)\s*((?:biome-ignore(?:-all|-start|-end)?|(?:eslint|oxlint)-(?:disable(?:-line|-next-line)?|enable)|eslint(?=\s)))\b/;
24
- var TRACKED_REFERENCE_PATTERN = /\([^()\s]*\d[^()\s]*\)/g;
25
- var LEADING_TRACKED_REFERENCE_PATTERN = /^\s*(\([^()\s]*\d[^()\s]*\))/;
26
- var compiledTracker = (request) => {
27
- try {
28
- return { outcome: "ok", value: [new RegExp(request.source)] };
29
- } catch (thrown) {
30
- return {
31
- outcome: "failed",
32
- error: {
33
- kind: "piece-invalid",
34
- pieceRoot: request.clause.pieceRoot,
35
- detail: `the clauseSettings of ${clauseAddressText({ address: request.clause.address })} are malformed: trackerPatterns entry ${JSON.stringify(request.source)} is not a regular expression: ${thrown instanceof Error ? thrown.message : String(thrown)}`
36
- }
37
- };
38
- }
39
- };
40
- var trackedClauseOf = (request) => {
41
- const settings = stringListClauseSettings({ clause: request.clause, keys: ["trackerPatterns"] });
42
- if (settings.outcome === "failed") return settings;
43
- const trackers = gatheredOutcomes({
44
- outcomes: settings.value.trackerPatterns.map(
45
- (source) => compiledTracker({ clause: request.clause, source })
46
- )
47
- });
48
- if (trackers.outcome === "failed") return trackers;
49
- return { outcome: "ok", value: [{ clause: request.clause, trackers: trackers.value }] };
50
- };
51
- var trackedClausesOf = (request) => gatheredOutcomes({ outcomes: request.clauses.map((clause) => trackedClauseOf({ clause })) });
52
- var chosenReference = (request) => request.references.some(
53
- (reference) => request.tracked.trackers.some((tracker) => tracker.test(reference))
54
- ) ? "tracked" : "untracked";
55
- var trackingAnywhere = (request) => chosenReference({
56
- references: Array.from(request.text.matchAll(TRACKED_REFERENCE_PATTERN), (match) => match[0]),
57
- tracked: request.tracked
58
- });
59
- var trackingAtStart = (request) => {
60
- const reference = LEADING_TRACKED_REFERENCE_PATTERN.exec(request.text)?.[1];
61
- return chosenReference({
62
- references: reference === void 0 ? [] : [reference],
63
- tracked: request.tracked
64
- });
65
- };
66
24
  var textAfter = (request) => {
67
25
  const marker = request.pattern.exec(request.text);
68
26
  return marker === null ? void 0 : request.text.slice(marker.index + marker[0].length);
69
27
  };
70
- var untrackedClauses = (request) => request.trackedClauses.filter(
28
+ var untrackedChecks = (request) => request.trackedChecks.filter(
71
29
  (tracked) => request.tracking({ text: request.text, tracked }) === "untracked"
72
30
  );
73
31
  var hitsFor = (request) => {
74
32
  if (request.untracked.length === 0) return [];
75
33
  const anchor = request.anchorAt({ position: request.position });
76
34
  return request.untracked.map((tracked) => ({
77
- clause: tracked.clause.address,
35
+ check: tracked.binding.address,
78
36
  anchor,
79
37
  snippet: request.snippet
80
38
  }));
@@ -87,8 +45,8 @@ var taskHits = (request) => {
87
45
  const afterTodo = textAfter({ pattern: TODO_PATTERN, text: line });
88
46
  if (afterTodo === void 0) return [];
89
47
  return hitsFor({
90
- untracked: untrackedClauses({
91
- trackedClauses: request.trackedClauses,
48
+ untracked: untrackedChecks({
49
+ trackedChecks: request.trackedChecks,
92
50
  text: afterTodo,
93
51
  tracking: trackingAtStart
94
52
  }),
@@ -99,17 +57,13 @@ var taskHits = (request) => {
99
57
  });
100
58
  };
101
59
  var sourceObserversFor = (request) => {
102
- const { sourceFile, anchorAt, trackedClauses, syntaxApi } = request;
60
+ const { sourceFile, anchorAt, trackedChecks, syntaxApi } = request;
103
61
  const typeDirectiveOf = typeDirectiveReaderFor({ sourceFile, syntaxApi });
104
62
  const todoHits = taskHits(request);
105
63
  const directiveHits = [];
106
64
  const typeDirectiveHits = [];
107
65
  const commentHits = (comment) => hitsFor({
108
- untracked: untrackedClauses({
109
- trackedClauses,
110
- text: comment.text,
111
- tracking: trackingAnywhere
112
- }),
66
+ untracked: untrackedChecks({ trackedChecks, text: comment.text, tracking: trackingAnywhere }),
113
67
  anchorAt,
114
68
  position: comment.position,
115
69
  snippet: comment.whole.trim()
@@ -131,10 +85,10 @@ var sourceObserversFor = (request) => {
131
85
  };
132
86
  };
133
87
  var check = {
134
- prepare: ({ clauses, syntaxApi }) => {
135
- const settled = trackedClausesOf({ clauses });
88
+ prepare: ({ bindings, syntaxApi }) => {
89
+ const settled = trackedChecksOf({ bindings });
136
90
  if (settled.outcome === "failed") return settled;
137
- const trackedClauses = settled.value;
91
+ const trackedChecks = settled.value;
138
92
  return {
139
93
  outcome: "ok",
140
94
  value: {
@@ -146,7 +100,7 @@ var check = {
146
100
  outcome: "ok",
147
101
  value: {
148
102
  kind: "syntax",
149
- begin: ({ sourceFile, anchorAt }) => sourceObserversFor({ sourceFile, anchorAt, trackedClauses, syntaxApi })
103
+ begin: ({ sourceFile, anchorAt }) => sourceObserversFor({ sourceFile, anchorAt, trackedChecks, syntaxApi })
150
104
  }
151
105
  };
152
106
  },
@@ -1,6 +1,9 @@
1
+ import {
2
+ sourceSnippetAt
3
+ } from "../../../../../../chunks/chunk-5AKHEW6V.js";
1
4
  import {
2
5
  folderScope
3
- } from "../../../../../../chunks/chunk-K2W3D3NB.js";
6
+ } from "../../../../../../chunks/chunk-COQMPHWZ.js";
4
7
  import "../../../../../../chunks/chunk-DGOLOS5A.js";
5
8
 
6
9
  // src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.ts
@@ -52,7 +55,7 @@ var mutationRootOf = (request) => {
52
55
  return void 0;
53
56
  };
54
57
  var check = {
55
- prepare: ({ clauses, syntaxApi }) => ({
58
+ prepare: ({ bindings, syntaxApi }) => ({
56
59
  outcome: "ok",
57
60
  value: {
58
61
  prepareFile: ({ file }) => {
@@ -80,10 +83,9 @@ var check = {
80
83
  if (root === void 0 || !scopes.some((scope) => scope.has(root))) return;
81
84
  const position = node.getStart(sourceFile);
82
85
  const anchor = anchorAt({ position });
83
- const rawSnippet = sourceFile.text.slice(position, position + 80).replace(/\n/g, " ");
84
- const snippet = rawSnippet.length === 80 ? `${rawSnippet}\u2026` : rawSnippet;
86
+ const snippet = sourceSnippetAt({ source: sourceFile.text, position });
85
87
  hits.push(
86
- ...clauses.map((clause) => ({ clause: clause.address, anchor, snippet }))
88
+ ...bindings.map((binding) => ({ check: binding.address, anchor, snippet }))
87
89
  );
88
90
  },
89
91
  leave: ({ node }) => {
@@ -0,0 +1,80 @@
1
+ import {
2
+ INSTALLED_PORTS,
3
+ REPLY_PIPE_DESCRIPTOR,
4
+ createDefaultProcessPort,
5
+ measureEngines,
6
+ runEnginesMeasurement,
7
+ versionTwoStagesOver
8
+ } from "../chunks/chunk-ONDBACCR.js";
9
+ import "../chunks/chunk-ND3EOGDK.js";
10
+ import "../chunks/chunk-EFUWHLZK.js";
11
+ import "../chunks/chunk-XNIXPQQ5.js";
12
+ import "../chunks/chunk-M4VSJ27S.js";
13
+ import "../chunks/chunk-U6W65ZOF.js";
14
+ import "../chunks/chunk-4AJQHZ7I.js";
15
+ import "../chunks/chunk-BISP2JOL.js";
16
+ import "../chunks/chunk-FRE5IA3C.js";
17
+ import "../chunks/chunk-D6645WPB.js";
18
+ import "../chunks/chunk-Z6JHBNDS.js";
19
+ import {
20
+ moduleExtensionOf
21
+ } from "../chunks/chunk-WPEOCLTP.js";
22
+ import "../chunks/chunk-YONPKP3C.js";
23
+ import "../chunks/chunk-OO5KV7KN.js";
24
+ import "../chunks/chunk-RANIXNWY.js";
25
+ import "../chunks/chunk-DGOLOS5A.js";
26
+
27
+ // src/composition/engines-measurement.ts
28
+ var measureInProcess = async (request) => {
29
+ const { tree, ...locations } = request.measuring;
30
+ const stages = versionTwoStagesOver({
31
+ ports: INSTALLED_PORTS,
32
+ locations: {
33
+ ...locations,
34
+ moduleExtension: moduleExtensionOf({ moduleUrl: request.moduleUrl })
35
+ }
36
+ });
37
+ const measured = await measureEngines({
38
+ stages: { ...stages, tree: () => ({ outcome: "ok", value: tree }) }
39
+ });
40
+ return measured.outcome === "failed" ? measured : { outcome: "ok", value: measured.value.runs };
41
+ };
42
+ var runMeasurementProcess = (request) => runEnginesMeasurement({
43
+ process: request.process,
44
+ request: request.request,
45
+ reply: request.reply,
46
+ measure: (measuring) => measureInProcess({ moduleUrl: request.moduleUrl, measuring })
47
+ });
48
+
49
+ // src/infrastructure/node/process/reply-port.ts
50
+ import { writeFileSync } from "node:fs";
51
+ var createReplyPort = (options) => ({
52
+ write: (request) => {
53
+ options.replySurface.writeDescriptor({ descriptor: REPLY_PIPE_DESCRIPTOR, text: request.text });
54
+ }
55
+ });
56
+ var defaultReplySurface = {
57
+ writeDescriptor: (request) => {
58
+ writeFileSync(request.descriptor, request.text);
59
+ }
60
+ };
61
+ var createDefaultReplyPort = () => createReplyPort({ replySurface: defaultReplySurface });
62
+
63
+ // src/infrastructure/node/process/request-port.ts
64
+ import { readFileSync } from "node:fs";
65
+ var STANDARD_INPUT_DESCRIPTOR = 0;
66
+ var createRequestPort = (options) => ({
67
+ read: () => options.requestSurface.readDescriptor({ descriptor: STANDARD_INPUT_DESCRIPTOR })
68
+ });
69
+ var defaultRequestSurface = {
70
+ readDescriptor: (request) => readFileSync(request.descriptor, "utf8")
71
+ };
72
+ var createDefaultRequestPort = () => createRequestPort({ requestSurface: defaultRequestSurface });
73
+
74
+ // src/measure-engines.process.ts
75
+ await runMeasurementProcess({
76
+ process: createDefaultProcessPort({}),
77
+ request: createDefaultRequestPort(),
78
+ reply: createDefaultReplyPort(),
79
+ moduleUrl: import.meta.url
80
+ });
package/src/rule-set.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export type { AuthoredClauseDefinition as ClauseDefinition, AuthoredDisciplineFile as DisciplineFile, AuthoredPieceFile as PieceFile, AuthoredSourceCase as SourceCase, ClauseExceptions, ClauseSettingDeclaration, ClauseSettingDeclarations, } from "./domain/rule-set/authored-rule-set-types.js";
1
+ export type { AuthoredExample as Example, AuthoredExamples as Examples, AuthoredPieceDeclaration as PieceDeclaration, ClauseExceptions as CheckExceptions, ClauseSettingDeclaration as CheckSettingDeclaration, ClauseSettingDeclarations as CheckSettingDeclarations, ImplementingCheck, PieceSettings, } from "./domain/rule-set/authored-rule-set-types.js";
2
+ export type { AuthoredPointed as Pointed, CaseItem, CheckItem, RecipeItem, RecordKindItem, RecordKindName, SeenBy, Standing, SymptomItem, } from "./domain/language-layer/authored-item-types.js";
2
3
  export type { AnchorKind } from "./domain/finding/anchor.js";
3
4
  export type { JsonValue, ReadonlyJsonValue } from "./domain/settings/json-values/json-value.js";
4
5
  export type { EslintPieceSettings, RuleOptions, } from "./infrastructure/engines/eslint/runner/pieces/eslint-piece-settings-types.js";
package/src/testing.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import type { CheckConformanceOf, CheckUnderTestOf, ClauseConformanceOf, ClauseUnderTestOf, RepoPathOf } from "./application/conformance/conformance-testing-types.js";
2
- export type { CaseUnderTest, CheckRequest, CheckUnderTest, ClauseRequest, ClauseUnderTest, ConformanceFailure, ConformanceSetupFailure, ConformanceSetupFailureKind, } from "./application/conformance/conformance-testing-types.js";
3
- export declare const clauseConformanceOf: ClauseConformanceOf;
4
- export declare const clauseUnderTestOf: ClauseUnderTestOf;
1
+ import type { CheckConformanceOf, CheckUnderTestOf, RepoPathOf } from "./application/conformance/conformance-testing-types.js";
2
+ export type { CaseUnderTest, CheckRequest, CheckConformanceFailure, CheckUnderTest, ConformanceSetupFailure, ConformanceSetupFailureKind, RuleSetUnderTest, TeamRuleSetUnderTest, } from "./application/conformance/conformance-testing-types.js";
5
3
  export declare const repoPathOf: RepoPathOf;
6
4
  export declare const checkUnderTestOf: CheckUnderTestOf;
7
5
  export declare const checkConformanceOf: CheckConformanceOf;