@nielspeter/eess-ts 0.2.1 → 0.4.0

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 (433) hide show
  1. package/README.md +61 -35
  2. package/dist/builders/call-rule-builder.d.ts +66 -26
  3. package/dist/builders/call-rule-builder.d.ts.map +1 -1
  4. package/dist/builders/call-rule-builder.js +73 -31
  5. package/dist/builders/call-rule-builder.js.map +1 -1
  6. package/dist/builders/class-rule-builder.d.ts +125 -26
  7. package/dist/builders/class-rule-builder.d.ts.map +1 -1
  8. package/dist/builders/class-rule-builder.js +134 -30
  9. package/dist/builders/class-rule-builder.js.map +1 -1
  10. package/dist/builders/correspondence-builder.d.ts +287 -0
  11. package/dist/builders/correspondence-builder.d.ts.map +1 -0
  12. package/dist/builders/correspondence-builder.js +393 -0
  13. package/dist/builders/correspondence-builder.js.map +1 -0
  14. package/dist/builders/correspondence-findings.d.ts +104 -0
  15. package/dist/builders/correspondence-findings.d.ts.map +1 -0
  16. package/dist/builders/correspondence-findings.js +301 -0
  17. package/dist/builders/correspondence-findings.js.map +1 -0
  18. package/dist/builders/cross-layer-builder.d.ts +99 -16
  19. package/dist/builders/cross-layer-builder.d.ts.map +1 -1
  20. package/dist/builders/cross-layer-builder.js +181 -35
  21. package/dist/builders/cross-layer-builder.js.map +1 -1
  22. package/dist/builders/function-rule-builder.d.ts +144 -25
  23. package/dist/builders/function-rule-builder.d.ts.map +1 -1
  24. package/dist/builders/function-rule-builder.js +173 -26
  25. package/dist/builders/function-rule-builder.js.map +1 -1
  26. package/dist/builders/jsx-rule-builder.d.ts +70 -14
  27. package/dist/builders/jsx-rule-builder.d.ts.map +1 -1
  28. package/dist/builders/jsx-rule-builder.js +73 -14
  29. package/dist/builders/jsx-rule-builder.js.map +1 -1
  30. package/dist/builders/module-rule-builder.d.ts +2 -2
  31. package/dist/builders/module-rule-builder.d.ts.map +1 -1
  32. package/dist/builders/module-rule-builder.js +12 -3
  33. package/dist/builders/module-rule-builder.js.map +1 -1
  34. package/dist/builders/scoped-function-rule-builder.d.ts +11 -0
  35. package/dist/builders/scoped-function-rule-builder.d.ts.map +1 -1
  36. package/dist/builders/scoped-function-rule-builder.js +12 -0
  37. package/dist/builders/scoped-function-rule-builder.js.map +1 -1
  38. package/dist/builders/slice-discovery-message.d.ts +36 -0
  39. package/dist/builders/slice-discovery-message.d.ts.map +1 -0
  40. package/dist/builders/slice-discovery-message.js +181 -0
  41. package/dist/builders/slice-discovery-message.js.map +1 -0
  42. package/dist/builders/slice-rule-builder.d.ts +151 -12
  43. package/dist/builders/slice-rule-builder.d.ts.map +1 -1
  44. package/dist/builders/slice-rule-builder.js +242 -35
  45. package/dist/builders/slice-rule-builder.js.map +1 -1
  46. package/dist/builders/type-rule-builder.d.ts +95 -24
  47. package/dist/builders/type-rule-builder.d.ts.map +1 -1
  48. package/dist/builders/type-rule-builder.js +105 -29
  49. package/dist/builders/type-rule-builder.js.map +1 -1
  50. package/dist/{helpers → builders}/within.d.ts +2 -2
  51. package/dist/builders/within.d.ts.map +1 -0
  52. package/dist/{helpers → builders}/within.js +1 -1
  53. package/dist/builders/within.js.map +1 -0
  54. package/dist/cli/commands/baseline.d.ts +3 -2
  55. package/dist/cli/commands/baseline.d.ts.map +1 -1
  56. package/dist/cli/commands/baseline.js +68 -6
  57. package/dist/cli/commands/baseline.js.map +1 -1
  58. package/dist/cli/commands/check.d.ts +7 -2
  59. package/dist/cli/commands/check.d.ts.map +1 -1
  60. package/dist/cli/commands/check.js +241 -45
  61. package/dist/cli/commands/check.js.map +1 -1
  62. package/dist/cli/commands/doctor.d.ts +29 -0
  63. package/dist/cli/commands/doctor.d.ts.map +1 -0
  64. package/dist/cli/commands/doctor.js +224 -0
  65. package/dist/cli/commands/doctor.js.map +1 -0
  66. package/dist/cli/commands/explain.d.ts +2 -1
  67. package/dist/cli/commands/explain.d.ts.map +1 -1
  68. package/dist/cli/commands/explain.js +19 -10
  69. package/dist/cli/commands/explain.js.map +1 -1
  70. package/dist/cli/commands/init.d.ts +9 -3
  71. package/dist/cli/commands/init.d.ts.map +1 -1
  72. package/dist/cli/commands/init.js +162 -137
  73. package/dist/cli/commands/init.js.map +1 -1
  74. package/dist/cli/import-rule-module.d.ts +29 -0
  75. package/dist/cli/import-rule-module.d.ts.map +1 -0
  76. package/dist/cli/import-rule-module.js +60 -0
  77. package/dist/cli/import-rule-module.js.map +1 -0
  78. package/dist/cli/index.d.ts +2 -2
  79. package/dist/cli/index.d.ts.map +1 -1
  80. package/dist/cli/index.js +98 -33
  81. package/dist/cli/index.js.map +1 -1
  82. package/dist/cli/load-rules.d.ts +6 -11
  83. package/dist/cli/load-rules.d.ts.map +1 -1
  84. package/dist/cli/load-rules.js +21 -29
  85. package/dist/cli/load-rules.js.map +1 -1
  86. package/dist/cli/resolve-config.d.ts.map +1 -1
  87. package/dist/cli/resolve-config.js +24 -24
  88. package/dist/cli/resolve-config.js.map +1 -1
  89. package/dist/cli/rule-file-findings.d.ts +178 -0
  90. package/dist/cli/rule-file-findings.d.ts.map +1 -0
  91. package/dist/cli/rule-file-findings.js +293 -0
  92. package/dist/cli/rule-file-findings.js.map +1 -0
  93. package/dist/cli/watch.d.ts +20 -7
  94. package/dist/cli/watch.d.ts.map +1 -1
  95. package/dist/cli/watch.js +39 -14
  96. package/dist/cli/watch.js.map +1 -1
  97. package/dist/conditions/body-analysis-function.d.ts.map +1 -1
  98. package/dist/conditions/body-analysis-function.js +16 -7
  99. package/dist/conditions/body-analysis-function.js.map +1 -1
  100. package/dist/conditions/body-analysis-module.d.ts.map +1 -1
  101. package/dist/conditions/body-analysis-module.js +14 -9
  102. package/dist/conditions/body-analysis-module.js.map +1 -1
  103. package/dist/conditions/body-analysis.d.ts.map +1 -1
  104. package/dist/conditions/body-analysis.js +16 -7
  105. package/dist/conditions/body-analysis.js.map +1 -1
  106. package/dist/conditions/call.d.ts.map +1 -1
  107. package/dist/conditions/call.js +38 -17
  108. package/dist/conditions/call.js.map +1 -1
  109. package/dist/conditions/catch-analysis.d.ts +2 -1
  110. package/dist/conditions/catch-analysis.d.ts.map +1 -1
  111. package/dist/conditions/catch-analysis.js.map +1 -1
  112. package/dist/conditions/cross-layer.d.ts +2 -10
  113. package/dist/conditions/cross-layer.d.ts.map +1 -1
  114. package/dist/conditions/cross-layer.js +227 -23
  115. package/dist/conditions/cross-layer.js.map +1 -1
  116. package/dist/conditions/dependency.d.ts +35 -6
  117. package/dist/conditions/dependency.d.ts.map +1 -1
  118. package/dist/conditions/dependency.js +299 -45
  119. package/dist/conditions/dependency.js.map +1 -1
  120. package/dist/conditions/exports.d.ts.map +1 -1
  121. package/dist/conditions/exports.js +10 -0
  122. package/dist/conditions/exports.js.map +1 -1
  123. package/dist/conditions/function.d.ts.map +1 -1
  124. package/dist/conditions/function.js +19 -5
  125. package/dist/conditions/function.js.map +1 -1
  126. package/dist/conditions/helpers.d.ts +2 -1
  127. package/dist/conditions/helpers.d.ts.map +1 -1
  128. package/dist/conditions/helpers.js +4 -1
  129. package/dist/conditions/helpers.js.map +1 -1
  130. package/dist/conditions/jsx.d.ts.map +1 -1
  131. package/dist/conditions/jsx.js +7 -2
  132. package/dist/conditions/jsx.js.map +1 -1
  133. package/dist/conditions/match-identity.d.ts +43 -0
  134. package/dist/conditions/match-identity.d.ts.map +1 -0
  135. package/dist/conditions/match-identity.js +43 -0
  136. package/dist/conditions/match-identity.js.map +1 -0
  137. package/dist/conditions/members.d.ts.map +1 -1
  138. package/dist/conditions/members.js +17 -4
  139. package/dist/conditions/members.js.map +1 -1
  140. package/dist/conditions/reverse-dependency.d.ts +18 -5
  141. package/dist/conditions/reverse-dependency.d.ts.map +1 -1
  142. package/dist/conditions/reverse-dependency.js +109 -92
  143. package/dist/conditions/reverse-dependency.js.map +1 -1
  144. package/dist/conditions/slice.d.ts +86 -2
  145. package/dist/conditions/slice.d.ts.map +1 -1
  146. package/dist/conditions/slice.js +234 -53
  147. package/dist/conditions/slice.js.map +1 -1
  148. package/dist/conditions/structural.d.ts.map +1 -1
  149. package/dist/conditions/structural.js +16 -4
  150. package/dist/conditions/structural.js.map +1 -1
  151. package/dist/core/check-all.d.ts +19 -0
  152. package/dist/core/check-all.d.ts.map +1 -0
  153. package/dist/core/check-all.js +96 -0
  154. package/dist/core/check-all.js.map +1 -0
  155. package/dist/core/combinators.d.ts +48 -0
  156. package/dist/core/combinators.d.ts.map +1 -0
  157. package/dist/core/combinators.js +56 -0
  158. package/dist/core/combinators.js.map +1 -0
  159. package/dist/core/descendant-cache.d.ts +36 -0
  160. package/dist/core/descendant-cache.d.ts.map +1 -0
  161. package/dist/core/descendant-cache.js +119 -0
  162. package/dist/core/descendant-cache.js.map +1 -0
  163. package/dist/core/diagnose.d.ts +234 -0
  164. package/dist/core/diagnose.d.ts.map +1 -0
  165. package/dist/core/diagnose.js +382 -0
  166. package/dist/core/diagnose.js.map +1 -0
  167. package/dist/core/disk-set.d.ts +48 -0
  168. package/dist/core/disk-set.d.ts.map +1 -0
  169. package/dist/core/disk-set.js +218 -0
  170. package/dist/core/disk-set.js.map +1 -0
  171. package/dist/core/element-cache.d.ts +75 -0
  172. package/dist/core/element-cache.d.ts.map +1 -0
  173. package/dist/core/element-cache.js +32 -0
  174. package/dist/core/element-cache.js.map +1 -0
  175. package/dist/core/empty-project-advice.d.ts +75 -0
  176. package/dist/core/empty-project-advice.d.ts.map +1 -0
  177. package/dist/core/empty-project-advice.js +61 -0
  178. package/dist/core/empty-project-advice.js.map +1 -0
  179. package/dist/core/exclusion-comments.d.ts +54 -0
  180. package/dist/core/exclusion-comments.d.ts.map +1 -0
  181. package/dist/core/exclusion-comments.js +310 -0
  182. package/dist/core/exclusion-comments.js.map +1 -0
  183. package/dist/core/execute-rule.d.ts +150 -0
  184. package/dist/core/execute-rule.d.ts.map +1 -0
  185. package/dist/core/execute-rule.js +580 -0
  186. package/dist/core/execute-rule.js.map +1 -0
  187. package/dist/core/glob-diagnosis.d.ts +78 -0
  188. package/dist/core/glob-diagnosis.d.ts.map +1 -0
  189. package/dist/core/glob-diagnosis.js +134 -0
  190. package/dist/core/glob-diagnosis.js.map +1 -0
  191. package/dist/core/glob-evaluator.d.ts +48 -0
  192. package/dist/core/glob-evaluator.d.ts.map +1 -0
  193. package/dist/core/glob-evaluator.js +89 -0
  194. package/dist/core/glob-evaluator.js.map +1 -0
  195. package/dist/core/import-candidates.d.ts +60 -0
  196. package/dist/core/import-candidates.d.ts.map +1 -0
  197. package/dist/core/import-candidates.js +93 -0
  198. package/dist/core/import-candidates.js.map +1 -0
  199. package/dist/core/import-options.d.ts +55 -2
  200. package/dist/core/import-options.d.ts.map +1 -1
  201. package/dist/core/import-options.js +64 -0
  202. package/dist/core/import-options.js.map +1 -1
  203. package/dist/core/line-index.d.ts +3 -0
  204. package/dist/core/line-index.d.ts.map +1 -0
  205. package/dist/core/line-index.js +229 -0
  206. package/dist/core/line-index.js.map +1 -0
  207. package/dist/core/metric-violation.d.ts +86 -0
  208. package/dist/core/metric-violation.d.ts.map +1 -0
  209. package/dist/core/metric-violation.js +132 -0
  210. package/dist/core/metric-violation.js.map +1 -0
  211. package/dist/core/module-edges.d.ts +361 -0
  212. package/dist/core/module-edges.d.ts.map +1 -0
  213. package/dist/core/module-edges.js +592 -0
  214. package/dist/core/module-edges.js.map +1 -0
  215. package/dist/core/object-literal-functions.d.ts +42 -0
  216. package/dist/core/object-literal-functions.d.ts.map +1 -0
  217. package/dist/core/object-literal-functions.js +75 -0
  218. package/dist/core/object-literal-functions.js.map +1 -0
  219. package/dist/core/orphan-exclusions.d.ts +44 -0
  220. package/dist/core/orphan-exclusions.d.ts.map +1 -0
  221. package/dist/core/orphan-exclusions.js +214 -0
  222. package/dist/core/orphan-exclusions.js.map +1 -0
  223. package/dist/core/pair-condition.d.ts +32 -3
  224. package/dist/core/pair-condition.d.ts.map +1 -1
  225. package/dist/core/path-universe.d.ts +54 -0
  226. package/dist/core/path-universe.d.ts.map +1 -0
  227. package/dist/core/path-universe.js +65 -0
  228. package/dist/core/path-universe.js.map +1 -0
  229. package/dist/core/per-root-compiler-options.d.ts +20 -0
  230. package/dist/core/per-root-compiler-options.d.ts.map +1 -0
  231. package/dist/core/per-root-compiler-options.js +57 -0
  232. package/dist/core/per-root-compiler-options.js.map +1 -0
  233. package/dist/core/project-relative.d.ts +98 -0
  234. package/dist/core/project-relative.d.ts.map +1 -0
  235. package/dist/core/project-relative.js +185 -0
  236. package/dist/core/project-relative.js.map +1 -0
  237. package/dist/core/project.d.ts +7 -1
  238. package/dist/core/project.d.ts.map +1 -1
  239. package/dist/core/project.js +24 -0
  240. package/dist/core/project.js.map +1 -1
  241. package/dist/core/rule-builder.d.ts +282 -0
  242. package/dist/core/rule-builder.d.ts.map +1 -0
  243. package/dist/core/rule-builder.js +445 -0
  244. package/dist/core/rule-builder.js.map +1 -0
  245. package/dist/core/rule-declaration.d.ts +32 -0
  246. package/dist/core/rule-declaration.d.ts.map +1 -0
  247. package/dist/core/rule-declaration.js +126 -0
  248. package/dist/core/rule-declaration.js.map +1 -0
  249. package/dist/core/terminal-builder.d.ts +625 -0
  250. package/dist/core/terminal-builder.d.ts.map +1 -0
  251. package/dist/core/terminal-builder.js +787 -0
  252. package/dist/core/terminal-builder.js.map +1 -0
  253. package/dist/core/terminal-execution.d.ts +23 -0
  254. package/dist/core/terminal-execution.d.ts.map +1 -0
  255. package/dist/core/terminal-execution.js +71 -0
  256. package/dist/core/terminal-execution.js.map +1 -0
  257. package/dist/core/vacuity-diagnosis.d.ts +103 -0
  258. package/dist/core/vacuity-diagnosis.d.ts.map +1 -0
  259. package/dist/core/vacuity-diagnosis.js +415 -0
  260. package/dist/core/vacuity-diagnosis.js.map +1 -0
  261. package/dist/core/violation.d.ts +16 -11
  262. package/dist/core/violation.d.ts.map +1 -1
  263. package/dist/core/violation.js +33 -13
  264. package/dist/core/violation.js.map +1 -1
  265. package/dist/graphql/index.js +1 -1
  266. package/dist/graphql/index.js.map +1 -1
  267. package/dist/graphql/resolver-rule-builder.d.ts +98 -23
  268. package/dist/graphql/resolver-rule-builder.d.ts.map +1 -1
  269. package/dist/graphql/resolver-rule-builder.js +151 -21
  270. package/dist/graphql/resolver-rule-builder.js.map +1 -1
  271. package/dist/graphql/schema-loader.d.ts +21 -0
  272. package/dist/graphql/schema-loader.d.ts.map +1 -1
  273. package/dist/graphql/schema-loader.js +81 -12
  274. package/dist/graphql/schema-loader.js.map +1 -1
  275. package/dist/graphql/schema-rule-builder.d.ts +57 -20
  276. package/dist/graphql/schema-rule-builder.d.ts.map +1 -1
  277. package/dist/graphql/schema-rule-builder.js +101 -25
  278. package/dist/graphql/schema-rule-builder.js.map +1 -1
  279. package/dist/helpers/baseline-diagnostics.d.ts +45 -0
  280. package/dist/helpers/baseline-diagnostics.d.ts.map +1 -0
  281. package/dist/helpers/baseline-diagnostics.js +168 -0
  282. package/dist/helpers/baseline-diagnostics.js.map +1 -0
  283. package/dist/helpers/baseline-generator.d.ts +19 -0
  284. package/dist/helpers/baseline-generator.d.ts.map +1 -0
  285. package/dist/helpers/baseline-generator.js +18 -0
  286. package/dist/helpers/baseline-generator.js.map +1 -0
  287. package/dist/helpers/baseline.d.ts +336 -0
  288. package/dist/helpers/baseline.d.ts.map +1 -0
  289. package/dist/helpers/baseline.js +664 -0
  290. package/dist/helpers/baseline.js.map +1 -0
  291. package/dist/helpers/body-traversal.d.ts +27 -2
  292. package/dist/helpers/body-traversal.d.ts.map +1 -1
  293. package/dist/helpers/body-traversal.js +122 -16
  294. package/dist/helpers/body-traversal.js.map +1 -1
  295. package/dist/helpers/callback-extractor.d.ts.map +1 -1
  296. package/dist/helpers/callback-extractor.js +48 -47
  297. package/dist/helpers/callback-extractor.js.map +1 -1
  298. package/dist/helpers/complexity.d.ts +13 -5
  299. package/dist/helpers/complexity.d.ts.map +1 -1
  300. package/dist/helpers/complexity.js +15 -6
  301. package/dist/helpers/complexity.js.map +1 -1
  302. package/dist/helpers/diff-aware.d.ts +44 -0
  303. package/dist/helpers/diff-aware.d.ts.map +1 -0
  304. package/dist/helpers/diff-aware.js +84 -0
  305. package/dist/helpers/diff-aware.js.map +1 -0
  306. package/dist/helpers/matchers.d.ts +68 -7
  307. package/dist/helpers/matchers.d.ts.map +1 -1
  308. package/dist/helpers/matchers.js +114 -20
  309. package/dist/helpers/matchers.js.map +1 -1
  310. package/dist/helpers/slice-graph.d.ts +100 -8
  311. package/dist/helpers/slice-graph.d.ts.map +1 -1
  312. package/dist/helpers/slice-graph.js +126 -34
  313. package/dist/helpers/slice-graph.js.map +1 -1
  314. package/dist/helpers/tarjan.d.ts +0 -14
  315. package/dist/helpers/tarjan.d.ts.map +1 -1
  316. package/dist/helpers/tarjan.js +29 -16
  317. package/dist/helpers/tarjan.js.map +1 -1
  318. package/dist/index.d.ts +56 -17
  319. package/dist/index.d.ts.map +1 -1
  320. package/dist/index.js +57 -13
  321. package/dist/index.js.map +1 -1
  322. package/dist/models/arch-call.d.ts +3 -2
  323. package/dist/models/arch-call.d.ts.map +1 -1
  324. package/dist/models/arch-call.js.map +1 -1
  325. package/dist/models/arch-function.d.ts +28 -6
  326. package/dist/models/arch-function.d.ts.map +1 -1
  327. package/dist/models/arch-function.js +106 -3
  328. package/dist/models/arch-function.js.map +1 -1
  329. package/dist/models/arch-jsx-element.js +2 -2
  330. package/dist/models/arch-jsx-element.js.map +1 -1
  331. package/dist/models/slice.d.ts +33 -9
  332. package/dist/models/slice.d.ts.map +1 -1
  333. package/dist/models/slice.js +129 -19
  334. package/dist/models/slice.js.map +1 -1
  335. package/dist/predicates/call.d.ts.map +1 -1
  336. package/dist/predicates/call.js +5 -0
  337. package/dist/predicates/call.js.map +1 -1
  338. package/dist/predicates/identity.d.ts +21 -0
  339. package/dist/predicates/identity.d.ts.map +1 -1
  340. package/dist/predicates/identity.js +75 -3
  341. package/dist/predicates/identity.js.map +1 -1
  342. package/dist/predicates/index.d.ts +1 -1
  343. package/dist/predicates/index.d.ts.map +1 -1
  344. package/dist/predicates/index.js +1 -1
  345. package/dist/predicates/index.js.map +1 -1
  346. package/dist/predicates/metrics.d.ts +4 -2
  347. package/dist/predicates/metrics.d.ts.map +1 -1
  348. package/dist/predicates/metrics.js +4 -2
  349. package/dist/predicates/metrics.js.map +1 -1
  350. package/dist/predicates/module.d.ts +4 -12
  351. package/dist/predicates/module.d.ts.map +1 -1
  352. package/dist/predicates/module.js +57 -37
  353. package/dist/predicates/module.js.map +1 -1
  354. package/dist/presets/agent-guardrails.d.ts +22 -15
  355. package/dist/presets/agent-guardrails.d.ts.map +1 -1
  356. package/dist/presets/agent-guardrails.js +124 -19
  357. package/dist/presets/agent-guardrails.js.map +1 -1
  358. package/dist/presets/boundaries.d.ts +45 -2
  359. package/dist/presets/boundaries.d.ts.map +1 -1
  360. package/dist/presets/boundaries.js +132 -23
  361. package/dist/presets/boundaries.js.map +1 -1
  362. package/dist/presets/data-layer.d.ts +22 -2
  363. package/dist/presets/data-layer.d.ts.map +1 -1
  364. package/dist/presets/data-layer.js +58 -16
  365. package/dist/presets/data-layer.js.map +1 -1
  366. package/dist/presets/index.d.ts +7 -5
  367. package/dist/presets/index.d.ts.map +1 -1
  368. package/dist/presets/index.js +9 -3
  369. package/dist/presets/index.js.map +1 -1
  370. package/dist/presets/layered.d.ts +46 -2
  371. package/dist/presets/layered.d.ts.map +1 -1
  372. package/dist/presets/layered.js +66 -29
  373. package/dist/presets/layered.js.map +1 -1
  374. package/dist/presets/recommended.d.ts +80 -9
  375. package/dist/presets/recommended.d.ts.map +1 -1
  376. package/dist/presets/recommended.js +25 -23
  377. package/dist/presets/recommended.js.map +1 -1
  378. package/dist/presets/shared.d.ts +270 -2
  379. package/dist/presets/shared.d.ts.map +1 -1
  380. package/dist/presets/shared.js +338 -4
  381. package/dist/presets/shared.js.map +1 -1
  382. package/dist/rules/code-quality.d.ts.map +1 -1
  383. package/dist/rules/code-quality.js +15 -6
  384. package/dist/rules/code-quality.js.map +1 -1
  385. package/dist/rules/hygiene.d.ts +1 -1
  386. package/dist/rules/hygiene.js +1 -1
  387. package/dist/rules/metrics-function.d.ts +2 -1
  388. package/dist/rules/metrics-function.d.ts.map +1 -1
  389. package/dist/rules/metrics-function.js +33 -6
  390. package/dist/rules/metrics-function.js.map +1 -1
  391. package/dist/rules/metrics.d.ts +2 -1
  392. package/dist/rules/metrics.d.ts.map +1 -1
  393. package/dist/rules/metrics.js +39 -9
  394. package/dist/rules/metrics.js.map +1 -1
  395. package/dist/smells/duplicate-bodies.d.ts +58 -5
  396. package/dist/smells/duplicate-bodies.d.ts.map +1 -1
  397. package/dist/smells/duplicate-bodies.js +137 -56
  398. package/dist/smells/duplicate-bodies.js.map +1 -1
  399. package/dist/smells/fingerprint.d.ts +8 -1
  400. package/dist/smells/fingerprint.d.ts.map +1 -1
  401. package/dist/smells/fingerprint.js +21 -3
  402. package/dist/smells/fingerprint.js.map +1 -1
  403. package/dist/smells/inconsistent-siblings.d.ts +128 -7
  404. package/dist/smells/inconsistent-siblings.d.ts.map +1 -1
  405. package/dist/smells/inconsistent-siblings.js +288 -86
  406. package/dist/smells/inconsistent-siblings.js.map +1 -1
  407. package/dist/smells/sibling-files.d.ts +47 -0
  408. package/dist/smells/sibling-files.d.ts.map +1 -0
  409. package/dist/smells/sibling-files.js +104 -0
  410. package/dist/smells/sibling-files.js.map +1 -0
  411. package/dist/smells/similar-pairs.d.ts +27 -0
  412. package/dist/smells/similar-pairs.d.ts.map +1 -0
  413. package/dist/smells/similar-pairs.js +52 -0
  414. package/dist/smells/similar-pairs.js.map +1 -0
  415. package/dist/smells/smell-builder.d.ts +57 -12
  416. package/dist/smells/smell-builder.d.ts.map +1 -1
  417. package/dist/smells/smell-builder.js +111 -14
  418. package/dist/smells/smell-builder.js.map +1 -1
  419. package/dist/tsconfig/index.d.ts +19 -0
  420. package/dist/tsconfig/index.d.ts.map +1 -0
  421. package/dist/tsconfig/index.js +20 -0
  422. package/dist/tsconfig/index.js.map +1 -0
  423. package/dist/tsconfig/tsconfig-builder.d.ts +42 -9
  424. package/dist/tsconfig/tsconfig-builder.d.ts.map +1 -1
  425. package/dist/tsconfig/tsconfig-builder.js +64 -16
  426. package/dist/tsconfig/tsconfig-builder.js.map +1 -1
  427. package/package.json +3 -2
  428. package/dist/core/module-dependencies.d.ts +0 -28
  429. package/dist/core/module-dependencies.d.ts.map +0 -1
  430. package/dist/core/module-dependencies.js +0 -35
  431. package/dist/core/module-dependencies.js.map +0 -1
  432. package/dist/helpers/within.d.ts.map +0 -1
  433. package/dist/helpers/within.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-builder.js","sourceRoot":"","sources":["../../src/core/terminal-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEnF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAGtF,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAOzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,aAAa,GACjB,gFAAgF;IAChF,uFAAuF,CAAA;AAoBzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAS,oBAAoB,CAAC,UAAoC;IAChE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAA;QACxC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAA;QAC9B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC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AG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,0EAA0E;YAChG,qCAAqC,CACtC,CAAA;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,kBAAkB;QAChB,OAAO,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IAC3C,CAAC;IAES,qBAAqB,CAAC,OAAgC;QAC9D,OAAO,uBAAuB,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ import type { ArchViolation } from '@nielspeter/eess';
2
+ import type { RuleFacts } from './vacuity-diagnosis.js';
3
+ /** A rule, reduced to what running it needs. */
4
+ export interface RuleRun {
5
+ readonly facts: RuleFacts;
6
+ readonly expectsEmpty: boolean;
7
+ assertsSomething(): boolean;
8
+ ownsDiscoveryDiagnosis(): boolean;
9
+ collectViolations(): {
10
+ violations: ArchViolation[];
11
+ examined: number;
12
+ };
13
+ }
14
+ /**
15
+ * Run the rule, but let the gates speak first.
16
+ *
17
+ * Split from `TerminalBuilder` with the diagnoses it calls. The class kept the
18
+ * ORDER of the gates — assertion, then dead selector, then the evidence floor —
19
+ * tangled with the fluent surface that configures them; the order is the whole
20
+ * content of this function and now reads as such.
21
+ */
22
+ export declare function collectWithAssertionGuard(run: RuleRun): ArchViolation[];
23
+ //# sourceMappingURL=terminal-execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-execution.d.ts","sourceRoot":"","sources":["../../src/core/terminal-execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAQvD,gDAAgD;AAChD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,gBAAgB,IAAI,OAAO,CAAA;IAC3B,sBAAsB,IAAI,OAAO,CAAA;IACjC,iBAAiB,IAAI;QAAE,UAAU,EAAE,aAAa,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CACvE;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,EAAE,CA4DvE"}
@@ -0,0 +1,71 @@
1
+ import { assertionLessFinding, deadSelectorFindings, evidenceFloor, expiredDeclarationViolation, } from './vacuity-diagnosis.js';
2
+ /**
3
+ * Run the rule, but let the gates speak first.
4
+ *
5
+ * Split from `TerminalBuilder` with the diagnoses it calls. The class kept the
6
+ * ORDER of the gates — assertion, then dead selector, then the evidence floor —
7
+ * tangled with the fluent surface that configures them; the order is the whole
8
+ * content of this function and now reads as such.
9
+ */
10
+ export function collectWithAssertionGuard(run) {
11
+ if (run.assertsSomething()) {
12
+ // Plan 0074 (R3b). AFTER the assertion gate, deliberately: a rule with a
13
+ // dead glob AND no condition reports the missing assertion only, which is
14
+ // the right root cause — no selector makes an assertion-less rule capable
15
+ // of failing. The comment above already committed to that ordering; this
16
+ // is the branch that honours it.
17
+ //
18
+ // Gate-first for a dead SELECTOR, before `collectViolations()`: a rule whose
19
+ // selector cannot match will walk the whole AST to select nothing.
20
+ //
21
+ // But NOT gate-first for a dead **discovery** glob, and that asymmetry is
22
+ // plan 0080's whole design. Admitting discovery globs to the gate without
23
+ // it is destructive rather than additive: this early return means the gate
24
+ // REPLACES a builder's own finding rather than adding to it, and the slice
25
+ // builders already produce a better one (`emptyDiscoveryViolation`). Review
26
+ // measured the cost of getting this wrong — **15 slice tests, 13 of them
27
+ // the whole bug-0009 remedy corpus**, whose stated subject is that each
28
+ // branch's advice is true. Trading a rule 1 defect for a rule 2 defect.
29
+ //
30
+ // So the owner **declares itself** — `ownsDiscoveryDiagnosis()` — rather than
31
+ // the gate naming who to skip. An "except slice" list would be the same
32
+ // unchecked claim about who owns what that this file used to carry in a
33
+ // comment, and that comment being wrong is what plan 0080 exists to fix.
34
+ // The precedent is `assertsCardinality()` directly above: knowledge lives
35
+ // with the builder that has it.
36
+ //
37
+ // A first attempt derived it instead — run `collectViolations()` and prefer
38
+ // any `bypassFilters` finding it produced. That cannot work, and slice is
39
+ // the counterexample: for a **partially** empty `assignedFrom` it produces
40
+ // nothing *deliberately* (a slice with no files yet is legitimate, and that
41
+ // guard was withdrawn before release for firing on real projects). So
42
+ // "prefer what it produced" reads silence as "no opinion" when it is in
43
+ // fact the opinion.
44
+ const dead = deadSelectorFindings(run.facts);
45
+ if (dead.selector.length > 0)
46
+ return dead.selector;
47
+ if (dead.discovery.length > 0 && !run.ownsDiscoveryDiagnosis())
48
+ return dead.discovery;
49
+ // Plan 0099: the floor. 0098 produced this evidence and discarded it here;
50
+ // this is where discarding stops.
51
+ const { violations, examined } = run.collectViolations();
52
+ // ADR-010's floor: four branches that all answer one question — is a pass
53
+ // here CONSTRUCTED from evidence, or defaulted? See `evidenceFloor`.
54
+ const floor = evidenceFloor(run.facts, violations, examined);
55
+ if (floor !== undefined)
56
+ return floor;
57
+ // The expiry half, and it is the ROOT's alone — `rule-builder.ts` used to
58
+ // carry its own, so keeping both double-reported one fault.
59
+ //
60
+ // `_expectEmpty`, NOT `declaresEmpty()`: `.notExist()` over a non-empty
61
+ // selection is the condition doing its job, never an expired declaration,
62
+ // and on `CrossProjectBuilder` `declaresEmpty()` is an all-sides
63
+ // conjunction whose per-side expiry that class reports itself.
64
+ if (examined > 0 && run.expectsEmpty) {
65
+ return [expiredDeclarationViolation(run.facts, examined), ...violations];
66
+ }
67
+ return violations;
68
+ }
69
+ return assertionLessFinding(run.facts);
70
+ }
71
+ //# sourceMappingURL=terminal-execution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-execution.js","sourceRoot":"","sources":["../../src/core/terminal-execution.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,2BAA2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wEAAwE;QACxE,0EAA0E;QAC1E,iEAAiE;QACjE,+DAA+D;QAC/D,IAAI,QAAQ,GAAG,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;YACrC,OAAO,CAAC,2BAA2B,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,GAAG,UAAU,CAAC,CAAA;QAC1E,CAAC;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;IAED,OAAO,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AACxC,CAAC"}
@@ -0,0 +1,103 @@
1
+ import type { ArchViolation } from '@nielspeter/eess';
2
+ import type { ArchProject } from './project.js';
3
+ import type { GlobNode, RuleDescription } from '@nielspeter/eess';
4
+ /**
5
+ * What a rule can be asked about itself, without running it.
6
+ *
7
+ * Every diagnosis in this module is a function of these and nothing else — none
8
+ * of them evaluates the rule. That is what let them leave `TerminalBuilder`:
9
+ * they were never terminal behaviour, they were explanations OF it, and keeping
10
+ * them on the class is most of why it carried 372 code lines.
11
+ */
12
+ export declare const ASSERTION_DOCS = "https://github.com/nielspeter/eess/blob/main/docs/violation-reporting.md#a-rule-must-assert-something";
13
+ export interface RuleFacts {
14
+ /** The builder's own class, for naming the rule in a finding. */
15
+ readonly ruleClass: {
16
+ name: string;
17
+ };
18
+ describeRule(): RuleDescription;
19
+ assertionAdvice(): string;
20
+ emptyDeclarationAdvice(): string;
21
+ examinedUnitNoun(): string;
22
+ narrowingHint(): string | undefined;
23
+ getProject(): ArchProject | undefined;
24
+ globs(): readonly GlobNode[];
25
+ assertsCardinality(): boolean;
26
+ declaresEmpty(): boolean;
27
+ zeroSubjectsAdvice(): string;
28
+ zeroSubjectsViolation(project: ArchProject | undefined): ArchViolation;
29
+ }
30
+ /**
31
+ * The finding for a rule that states no assertion at all.
32
+ *
33
+ * Extracted from `collectWithAssertionGuard`, which was the assertion gate,
34
+ * the dead-selector gate, the evidence floor AND this constructor in one
35
+ * method — most of its branching was the reader having to hold all four.
36
+ */
37
+ export declare function assertionLessFinding(facts: RuleFacts): ArchViolation[];
38
+ /**
39
+ * ADR-010's floor: what to report when a family produced NOTHING from NOTHING.
40
+ *
41
+ * `undefined` means "no floor finding — carry on", which is not the same as
42
+ * an empty array (that is a deliberate pass, and `assertsCardinality()`
43
+ * returns one).
44
+ *
45
+ * A family that produced ANY finding passes through untouched. The floor
46
+ * fires only where a family produced nothing from nothing — bug 0066's shape.
47
+ * Each family's own empty-selection block stays as the better-attributed
48
+ * implementation; this is a floor beneath them, not a replacement.
49
+ *
50
+ * Precedence has already removed the other causes by the time this is reached:
51
+ * no dead selector glob, no missing assertion, no empty project, no cardinality
52
+ * assertion, no declaration. So the remedy names ONE cause without the hedging
53
+ * ADR-009 rule 2 forbids.
54
+ *
55
+ * Three defects in 0098's preview wording are fixed here, from its
56
+ * user-perspective review:
57
+ *
58
+ * - **It hedged where we hold the fact.** "including any default it applies
59
+ * that you did not write" was printed as a hypothetical while the rule knew
60
+ * the answer. We materialized the selection, so we know the project loaded N
61
+ * files and the selection produced 0 — print the numbers.
62
+ * - **"can never fail" overstated.** For a `crossLayer` rule whose pairs do not
63
+ * exist yet, or a folder empty in a young repository, the rule is correct and
64
+ * matches nothing *today*. "never" made a true statement false.
65
+ * - **The ranking was wrong for the people most likely to adopt early.** It
66
+ * called widening the fix and declaring "the exception… proves nothing". For
67
+ * a team whose second layer is not built yet, widening is *impossible* — the
68
+ * code does not exist — so the only available action was the one the message
69
+ * disparaged. Both are now offered as peers, and the declaration is described
70
+ * by what it does: it expires.
71
+ */
72
+ export declare function evidenceFloor(facts: RuleFacts, violations: ArchViolation[], examined: number): ArchViolation[] | undefined;
73
+ /**
74
+ * A declaration that has expired — plan 0099.
75
+ *
76
+ * The property that makes `.expectEmpty()` an assertion rather than
77
+ * `allowEmpty()`'s permission, which had no failing state and so stayed green
78
+ * forever. Here the number IS the finding: the author asserted zero and the
79
+ * answer is not zero.
80
+ *
81
+ * The remedy is DISTINCT from the message, because `format.ts` drops the `Fix:`
82
+ * line when the two are equal — a defect this producer's rule-builder ancestor
83
+ * shipped with, found in review of plan 0089.
84
+ */
85
+ export declare function expiredDeclarationViolation(facts: RuleFacts, examined: number): ArchViolation;
86
+ /**
87
+ * A dead glob's findings, **split by whether the builder might own the message**.
88
+ *
89
+ * `selector` and `discovery` are both faults (`isFaultPosition`), but the caller
90
+ * treats them differently: a dead selector short-circuits before the AST walk,
91
+ * while a dead discovery glob defers to whatever the builder produced. An
92
+ * `ArchViolation` carries no position, so the split happens here rather than
93
+ * being recovered by inspecting findings downstream.
94
+ */
95
+ export declare function deadSelectorFindings(facts: RuleFacts): {
96
+ selector: ArchViolation[];
97
+ discovery: ArchViolation[];
98
+ };
99
+ /** The value behind `TerminalBuilder.zeroSubjectsAdvice()`. */
100
+ export declare function zeroSubjectsAdviceOf(facts: RuleFacts): string;
101
+ /** The value behind `TerminalBuilder.zeroSubjectsViolation()`. */
102
+ export declare function zeroSubjectsViolationOf(facts: RuleFacts, project: ArchProject | undefined): ArchViolation;
103
+ //# sourceMappingURL=vacuity-diagnosis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vacuity-diagnosis.d.ts","sourceRoot":"","sources":["../../src/core/vacuity-diagnosis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAY,eAAe,EAAE,MAAM,kBAAkB,CAAA;AA2B3E;;;;;;;GAOG;AAKH,eAAO,MAAM,cAAc,0GAC8E,CAAA;AAEzG,MAAM,WAAW,SAAS;IACxB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACpC,YAAY,IAAI,eAAe,CAAA;IAC/B,eAAe,IAAI,MAAM,CAAA;IACzB,sBAAsB,IAAI,MAAM,CAAA;I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is.js';
3
+ import { globSitesOf, isDeadGlobTree, isDeadSite } from './glob-evaluator.js';
4
+ import { pathUniverse } from './path-universe.js';
5
+ import { diskSet } from './disk-set.js';
6
+ import { emptyProjectAdvice, loadedNothing } from './empty-project-advice.js';
7
+ /**
8
+ * The unit noun, singular when there is one of it — plan 0099.
9
+ *
10
+ * `n === 1` is the MOST likely expiry case: a declaration expires the day the
11
+ * first thing appears, so "it examined 1 subjects" is the sentence a reader is
12
+ * likeliest to meet. The zero-subjects sentence one method away already
13
+ * pluralises its file count correctly.
14
+ */
15
+ function singularise(noun, n) {
16
+ if (n !== 1)
17
+ return noun;
18
+ return noun.endsWith('ies') ? `${noun.slice(0, -3)}y` : noun.replace(/s$/, '');
19
+ }
20
+ /**
21
+ * What a rule can be asked about itself, without running it.
22
+ *
23
+ * Every diagnosis in this module is a function of these and nothing else — none
24
+ * of them evaluates the rule. That is what let them leave `TerminalBuilder`:
25
+ * they were never terminal behaviour, they were explanations OF it, and keeping
26
+ * them on the class is most of why it carried 372 code lines.
27
+ */
28
+ // Consumed by the test suite; the build tsconfig this gate reads excludes tests,
29
+ // so `src` is the only usage it can see. The directive sits LAST because a
30
+ // single-line waiver covers exactly the next line.
31
+ // eess-exclude eess/no-unused-exports: test-only consumer
32
+ export const ASSERTION_DOCS = 'https://github.com/nielspeter/eess/blob/main/docs/violation-reporting.md#a-rule-must-assert-something';
33
+ /**
34
+ * The finding for a rule that states no assertion at all.
35
+ *
36
+ * Extracted from `collectWithAssertionGuard`, which was the assertion gate,
37
+ * the dead-selector gate, the evidence floor AND this constructor in one
38
+ * method — most of its branching was the reader having to hold all four.
39
+ */
40
+ export function assertionLessFinding(facts) {
41
+ const described = facts.describeRule();
42
+ const name = described.id || described.rule || facts.ruleClass.name;
43
+ // ADR-009 rule 3: where there is deliberately no escape hatch, say so, and
44
+ // say what to do instead. Stated on the finding rather than inside
45
+ // `assertionAdvice()` so the seven per-shape remedies stay one sentence each
46
+ // and this stays one sentence in one place. Measured before it was added: a
47
+ // reader given only the remedy tries `.asSeverity('warn')`, `.excluding()`,
48
+ // the baseline and `--changed` — four CI cycles — because nothing told them
49
+ // those were refused.
50
+ const advice = `${facts.assertionAdvice()} ${UNSUPPRESSABLE}`;
51
+ return [
52
+ {
53
+ rule: name,
54
+ ruleId: described.id,
55
+ element: name,
56
+ file: '',
57
+ line: 0,
58
+ message: advice,
59
+ // Its own remedy, never the author's (bug 0021): their `suggestion`
60
+ // describes how to fix a violation of the rule, and this finding says
61
+ // the rule cannot produce one. Same for `docs` — the author's link is
62
+ // about their rule; this one is about the grammar the rule broke.
63
+ suggestion: advice,
64
+ docs: ASSERTION_DOCS,
65
+ bypassFilters: true,
66
+ // `ruleId` and `because` are deliberately NOT set here. `applyFilters`
67
+ // fills both from the rule's metadata for every finding that leaves
68
+ // them unset, and all three callers of this method go through it — so
69
+ // setting them here was two lines that read as load-bearing and were
70
+ // not: sabotage removed each with nothing failing. The remedy fields
71
+ // above are the opposite case, and must stay, because `applyFilters`
72
+ // deliberately refuses to supply those for a `bypassFilters` finding.
73
+ },
74
+ ];
75
+ }
76
+ /**
77
+ * Walk the glob trees and split the dead sites by position.
78
+ *
79
+ * Extracted from `deadSelectorFindings`, which is otherwise five guard clauses
80
+ * and this loop — the guards are the interesting part and the nesting was most
81
+ * of the branching.
82
+ */
83
+ function deadSitesIn(facts, trees, project) {
84
+ const universe = pathUniverse(project);
85
+ const selector = [];
86
+ const discovery = [];
87
+ for (const tree of trees) {
88
+ // Only inside a tree that is dead as a whole: `or(dead, live)` is a
89
+ // working rule, and reporting its dead branch is the false red the tree
90
+ // model exists to prevent.
91
+ if (!isDeadGlobTree(tree, universe))
92
+ continue;
93
+ for (const site of globSitesOf(tree)) {
94
+ // `isFaultPosition`, shared with `diagnose()` — the two used inverse
95
+ // hand-maintained lists and disagreed about exactly `discovery`, which
96
+ // is why `doctor` reported a dead layer glob and the build did not.
97
+ if (!isFaultPosition(site.position))
98
+ continue;
99
+ if (!isDeadSite(site, universe))
100
+ continue;
101
+ const finding = deadSelectorViolation(facts, site, universe, project);
102
+ if (site.position === 'discovery')
103
+ discovery.push(finding);
104
+ else
105
+ selector.push(finding);
106
+ }
107
+ }
108
+ return { selector, discovery };
109
+ }
110
+ /**
111
+ * The finding for one dead selector glob.
112
+ *
113
+ * Carries the SAME cause and advice `doctor` prints, from the same two
114
+ * tables — a reader who ran the pre-flight must not be told something
115
+ * different by the build that fails. Bugs 0031 and 0032 are why the tables
116
+ * are worth reusing rather than paraphrasing: both were cases where the
117
+ * cause stated was wrong for the input, and both were fixed in one place.
118
+ *
119
+ * `bypassFilters` makes it a configuration finding: `error` severity
120
+ * regardless of `.asSeverity('warn')`, refused by `.excluding()`, and
121
+ * skipped by diff and baseline (ADR-009 rule 1). A rule that can never have
122
+ * subjects is not a violation you triage; it is a rule that does not work.
123
+ */
124
+ function deadSelectorViolation(facts, site, universe, project) {
125
+ const described = facts.describeRule();
126
+ const name = described.id || described.rule || facts.ruleClass.name;
127
+ const diagnosis = diagnoseGlob(site, universe, diskSet(project));
128
+ const onDisk = diagnosis.onDisk === undefined ? '' : ON_DISK_ADVICE[diagnosis.onDisk];
129
+ const cause = onDisk === '' ? FAULT_ADVICE[diagnosis.fault] : onDisk;
130
+ // Position-aware in BOTH clauses, not just the noun (plan 0080).
131
+ //
132
+ // Admitting `discovery` globs made this sentence wrong twice over for them.
133
+ // The noun was the obvious half — a `smells.duplicateBodies().inFolder()` glob
134
+ // is not a "selector". The **consequence clause** was the part that actually
135
+ // lied: "it has no subjects and cannot fail" describes a rule that selects
136
+ // nothing, while a dead discovery glob means the rule discovered nothing to
137
+ // compare — there may be plenty of subjects. Review flagged that fixing the
138
+ // noun alone ships a grammatical sentence that is still false.
139
+ const isDiscovery = site.position === 'discovery';
140
+ const what = isDiscovery ? 'discovery glob' : 'selector';
141
+ const consequence = isDiscovery
142
+ ? 'so it discovers nothing to check and cannot fail'
143
+ : 'so it has no subjects and cannot fail';
144
+ const advice = `This rule's ${what} ${site.origin} can never match anything in this project, ` +
145
+ `${consequence} — ${cause}. ` +
146
+ `Correct the glob, or remove the rule. ${UNSUPPRESSABLE}`;
147
+ return {
148
+ rule: name,
149
+ ruleId: described.id,
150
+ element: site.glob,
151
+ file: '',
152
+ line: 0,
153
+ message: advice,
154
+ // Its own remedy, never the author's (bug 0021): their `suggestion` is
155
+ // for a violation of the rule, and this says the rule cannot produce one.
156
+ suggestion: advice,
157
+ bypassFilters: true,
158
+ };
159
+ }
160
+ /**
161
+ * ADR-010's floor: what to report when a family produced NOTHING from NOTHING.
162
+ *
163
+ * `undefined` means "no floor finding — carry on", which is not the same as
164
+ * an empty array (that is a deliberate pass, and `assertsCardinality()`
165
+ * returns one).
166
+ *
167
+ * A family that produced ANY finding passes through untouched. The floor
168
+ * fires only where a family produced nothing from nothing — bug 0066's shape.
169
+ * Each family's own empty-selection block stays as the better-attributed
170
+ * implementation; this is a floor beneath them, not a replacement.
171
+ *
172
+ * Precedence has already removed the other causes by the time this is reached:
173
+ * no dead selector glob, no missing assertion, no empty project, no cardinality
174
+ * assertion, no declaration. So the remedy names ONE cause without the hedging
175
+ * ADR-009 rule 2 forbids.
176
+ *
177
+ * Three defects in 0098's preview wording are fixed here, from its
178
+ * user-perspective review:
179
+ *
180
+ * - **It hedged where we hold the fact.** "including any default it applies
181
+ * that you did not write" was printed as a hypothetical while the rule knew
182
+ * the answer. We materialized the selection, so we know the project loaded N
183
+ * files and the selection produced 0 — print the numbers.
184
+ * - **"can never fail" overstated.** For a `crossLayer` rule whose pairs do not
185
+ * exist yet, or a folder empty in a young repository, the rule is correct and
186
+ * matches nothing *today*. "never" made a true statement false.
187
+ * - **The ranking was wrong for the people most likely to adopt early.** It
188
+ * called widening the fix and declaring "the exception… proves nothing". For
189
+ * a team whose second layer is not built yet, widening is *impossible* — the
190
+ * code does not exist — so the only available action was the one the message
191
+ * disparaged. Both are now offered as peers, and the declaration is described
192
+ * by what it does: it expires.
193
+ */
194
+ export function evidenceFloor(facts, violations, examined) {
195
+ if (violations.length !== 0 || examined !== 0)
196
+ return undefined;
197
+ // The instrument outranks the selection. A declaration asserts a fact
198
+ // about a LOADED corpus; over zero loaded files it asserts nothing, and
199
+ // the expiry that justifies `.expectEmpty()` can never engage — so on a
200
+ // solution-style tsconfig a one-line declaration would restore bug 0066's
201
+ // 401-findings-reported-clean permanently, through the sanctioned door.
202
+ // This supersedes the precedence bug 0066's root-cause note endorsed:
203
+ // that ordering is right at SELECTION level and wrong at INSTRUMENT level.
204
+ //
205
+ // `getProject()` may be undefined and that is honest, not a gap:
206
+ // `crossProject` discards its project by documented design, and an
207
+ // ADR-010 dialect over a non-TypeScript element type has none. The
208
+ // instrument check is skipped; the zero-subjects floor below still holds.
209
+ const project = facts.getProject();
210
+ if (project !== undefined && loadedNothing(project)) {
211
+ return [emptyProjectViolation(facts, project)];
212
+ }
213
+ // `.notExist()` and friends examine zero BECAUSE that is what they
214
+ // assert. Exempt since 0.34.0, and `diagnose()` exempts it too — the two
215
+ // must agree or `doctor` and `check` disagree about a working rule.
216
+ if (facts.assertsCardinality())
217
+ return violations;
218
+ // The author said empty is the point. `declaresEmpty()` — not
219
+ // `_expectEmpty` — because `CrossProjectBuilder` declares per side and
220
+ // overrides this; asking a fully-declared crossProject to declare would
221
+ // be ADR-009 rule 2's loop, and the base implementation cannot express it.
222
+ if (!facts.declaresEmpty())
223
+ return [facts.zeroSubjectsViolation(project)];
224
+ return undefined;
225
+ }
226
+ /**
227
+ * The finding for a project that loaded no source files.
228
+ *
229
+ * Deliberately **not** `deadSelectorViolation` with different text: that one
230
+ * names a glob as its `element`, and here no glob is at fault. The element is
231
+ * the rule, matching how `diagnose()` reports this state.
232
+ *
233
+ * Carries the same advice `doctor` prints, from the one owner
234
+ * (`empty-project-advice.ts`) — the parity `deadSelectorViolation`'s docstring
235
+ * claims for the whole gate, which was false for this input until bug 0048.
236
+ */
237
+ function emptyProjectViolation(facts, project) {
238
+ const described = facts.describeRule();
239
+ const name = described.id || described.rule || facts.ruleClass.name;
240
+ // `emptyProjectAdvice` deliberately returns a lowercase, period-less clause so
241
+ // each caller can frame it. Capitalised inline rather than via a shared helper:
242
+ // `slice-rule-builder.ts` has its own local `capitalize` and core has none, so
243
+ // importing across that boundary for one character would be the worse trade.
244
+ const shared = emptyProjectAdvice(project);
245
+ const advice = `${shared.charAt(0).toUpperCase()}${shared.slice(1)}. ${UNSUPPRESSABLE}`;
246
+ return {
247
+ rule: name,
248
+ ruleId: described.id,
249
+ element: name,
250
+ file: '',
251
+ line: 0,
252
+ message: advice,
253
+ // Its own remedy, never the author's (bug 0021).
254
+ suggestion: advice,
255
+ bypassFilters: true,
256
+ };
257
+ }
258
+ /**
259
+ * A declaration that has expired — plan 0099.
260
+ *
261
+ * The property that makes `.expectEmpty()` an assertion rather than
262
+ * `allowEmpty()`'s permission, which had no failing state and so stayed green
263
+ * forever. Here the number IS the finding: the author asserted zero and the
264
+ * answer is not zero.
265
+ *
266
+ * The remedy is DISTINCT from the message, because `format.ts` drops the `Fix:`
267
+ * line when the two are equal — a defect this producer's rule-builder ancestor
268
+ * shipped with, found in review of plan 0089.
269
+ */
270
+ export function expiredDeclarationViolation(facts, examined) {
271
+ const described = facts.describeRule();
272
+ const name = described.id || described.rule || facts.ruleClass.name;
273
+ const declaration = facts.emptyDeclarationAdvice();
274
+ const message = `${declaration} asserted this rule examines nothing, and it examined ${String(examined)} ${singularise(facts.examinedUnitNoun(), examined)}.`;
275
+ const suggestion = `Remove ${declaration} and let the rule enforce itself — the thing you were waiting for has ` +
276
+ `appeared, and the rule now has something to check. If instead the selection is wider than you ` +
277
+ `meant, narrow it and keep the declaration. ` +
278
+ `The rule's own violations are reported as separate findings under the same rule id. ` +
279
+ UNSUPPRESSABLE;
280
+ return {
281
+ rule: name,
282
+ ruleId: described.id,
283
+ // The DESCRIPTION, not the id — and this is the one place in this file
284
+ // where that differs on purpose.
285
+ //
286
+ // `dedupeConfigFindings` keys on `(file, ruleId ?? rule, element)`. With
287
+ // `file: ''` and the id in both remaining slots, every instance of a
288
+ // fanned-out preset id collapses to one and picks up `affectedNote`'s
289
+ // "this one option generated N rules that cannot enforce anything".
290
+ //
291
+ // For `zeroSubjectsViolation` that collapse is CORRECT: those N rules
292
+ // genuinely cannot enforce, and they are one edit. Here it is false — a
293
+ // rule whose declaration expired enforces fine, and its violations are
294
+ // reported alongside. Measured in review of plan 0089: 4 findings became 3,
295
+ // the survivor claiming two rules could not enforce while both their real
296
+ // violations sat below it. `RuleBuilder.describeRule()` returns the chain
297
+ // description, which differs per instance and keeps them distinct.
298
+ element: described.rule || name,
299
+ file: '',
300
+ line: 0,
301
+ message,
302
+ suggestion,
303
+ bypassFilters: true,
304
+ };
305
+ }
306
+ /**
307
+ * A dead glob's findings, **split by whether the builder might own the message**.
308
+ *
309
+ * `selector` and `discovery` are both faults (`isFaultPosition`), but the caller
310
+ * treats them differently: a dead selector short-circuits before the AST walk,
311
+ * while a dead discovery glob defers to whatever the builder produced. An
312
+ * `ArchViolation` carries no position, so the split happens here rather than
313
+ * being recovered by inspecting findings downstream.
314
+ */
315
+ export function deadSelectorFindings(facts) {
316
+ // Annotated: inferred, this is `{ selector: never[]; discovery: never[] }`,
317
+ // and it is returned from four early-exit paths. Nothing mutates it today —
318
+ // but a `push` onto a `never[]` is a type error whose message points at the
319
+ // literal rather than at the caller that meant to add a finding.
320
+ const empty = {
321
+ selector: [],
322
+ discovery: [],
323
+ };
324
+ const project = facts.getProject();
325
+ if (project === undefined)
326
+ return empty;
327
+ // A condition that asserts CARDINALITY is satisfied by having no subjects,
328
+ // so an unsatisfiable selector is this rule working rather than failing —
329
+ // the pre-emptive guard `.should().notExist()` expresses. Declared by the
330
+ // condition, never probed: evaluating any condition against `[]` returns no
331
+ // violations, so probing answers "satisfied" for all of them.
332
+ if (facts.assertsCardinality())
333
+ return empty;
334
+ const trees = facts.globs();
335
+ if (trees.length === 0)
336
+ return empty;
337
+ // The project loaded nothing, so no glob can match and none of them is at
338
+ // fault — [ts-archunit bug 0048](https://github.com/nielspeter/ts-archunit/blob/main/bugs/fixed/0048-the-dead-glob-gate-blames-the-glob-when-the-project-is-empty.md).
339
+ //
340
+ // Without this the gate reported every selector glob dead and told the
341
+ // reader to *"Correct the glob, or remove the rule"*, which is a remedy for
342
+ // a fault that is not theirs: measured on an empty tsconfig, the glob was
343
+ // correct and the tsconfig had loaded 0 files. `diagnose()` short-circuited
344
+ // here (bug 0031) and `SliceRuleBuilder` had its own branch; this gate had
345
+ // neither, so the wrong remedy sat on the path every `modules()`,
346
+ // `classes()`, `functions()` and `types()` rule takes.
347
+ //
348
+ // One finding for the project, not one per glob — the identity of this fault
349
+ // is the tsconfig, which is what ADR-009 rule 4 asks be named, and it is why
350
+ // `diagnose()` dedupes by project too.
351
+ if (loadedNothing(project))
352
+ return { selector: [emptyProjectViolation(facts, project)], discovery: [] };
353
+ return deadSitesIn(facts, trees, project);
354
+ }
355
+ /** The value behind `TerminalBuilder.zeroSubjectsAdvice()`. */
356
+ export function zeroSubjectsAdviceOf(facts) {
357
+ const project = facts.getProject();
358
+ const loaded = project === undefined ? undefined : project.getSourceFiles().length;
359
+ // The project file count is CONTEXT in parentheses, never a denominator: the
360
+ // rule did not examine files, and "0 of 616" reads as a glob problem when the
361
+ // glob may already match everything.
362
+ const context = loaded === undefined
363
+ ? ''
364
+ : ` (the project loaded ${String(loaded)} file${loaded === 1 ? '' : 's'})`;
365
+ const counted = `This rule examined 0 ${facts.examinedUnitNoun()}${context}`;
366
+ // Name the excluder when the family knows it; name the POSSIBILITY when it
367
+ // does not. Deleting the possibility was a measured regression: 0.58's
368
+ // preview said "including any default it applies that you did not write",
369
+ // this plan called that hedging, and the replacement printed numbers that
370
+ // disclose no cause — net information loss on the commonest real case.
371
+ // "removed them" asserts there was something to remove. On a corpus that
372
+ // never contained a single unit of this family's kind, nothing was removed
373
+ // and the true cause is upstream — `narrowingHint()`'s own docstring promises
374
+ // the caller "names the possibility rather than asserting a cause it cannot
375
+ // verify", and asserting removal breaks that promise.
376
+ const hint = facts.narrowingHint();
377
+ const cause = hint === undefined
378
+ ? ' Its own narrowing may have removed them — including any default it applies that you did not write.'
379
+ : ` ${hint}`;
380
+ return (`${counted}, so it enforces nothing as written today.${cause} ` +
381
+ `Either close the gap — widen the selector, or add the code it is waiting for — or declare ` +
382
+ `the empty state with ${facts.emptyDeclarationAdvice()} — a declaration is an assertion, not ` +
383
+ `a silencer: it fails the day something does match.`);
384
+ }
385
+ /** The value behind `TerminalBuilder.zeroSubjectsViolation()`. */
386
+ export function zeroSubjectsViolationOf(facts, project) {
387
+ // The precedence lives HERE, not only at the call site, because this
388
+ // producer's docstring declares "no empty project" as a precondition and an
389
+ // assumed precondition is one a second caller forgets.
390
+ //
391
+ // Measured: `rule-builder`'s `emptySelectionViolation` called this directly,
392
+ // and `deadSelectorFindings` only catches a rule that DECLARES a glob — so
393
+ // `functions(p).that().haveNameMatching(/x/)` over a zero-file project was
394
+ // told "widen it, or declare the empty state". Both remedies are impossible
395
+ // on that input, and the sentence stated the instrument-level fact and then
396
+ // gave selection-level advice contradicting it.
397
+ if (project !== undefined && loadedNothing(project)) {
398
+ return emptyProjectViolation(facts, project);
399
+ }
400
+ const described = facts.describeRule();
401
+ const name = described.id || described.rule || facts.ruleClass.name;
402
+ const advice = `${facts.zeroSubjectsAdvice()} ${UNSUPPRESSABLE} ${DECLARE_INSTEAD}`;
403
+ return {
404
+ rule: name,
405
+ ruleId: described.id,
406
+ element: name,
407
+ file: '',
408
+ line: 0,
409
+ message: advice,
410
+ // Its own remedy, never the author's (bug 0021).
411
+ suggestion: advice,
412
+ bypassFilters: true,
413
+ };
414
+ }
415
+ //# sourceMappingURL=vacuity-diagnosis.js.map