@nielspeter/eess-ts 0.2.0 → 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 +87 -34
  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 -14
  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,382 @@
1
+ import { TerminalBuilder } from './terminal-builder.js';
2
+ import { diagnoseGlob, syntacticFault, FAULT_ADVICE, ON_DISK_ADVICE } from './glob-diagnosis.js';
3
+ import { globSitesOf, isDeadSite } from './glob-evaluator.js';
4
+ import { pathUniverse } from './path-universe.js';
5
+ import { diskSet } from './disk-set.js';
6
+ import { isDeadGlobTree } from './glob-evaluator.js';
7
+ import { emptyProjectAdvice, loadedNothing } from './empty-project-advice.js';
8
+ import { isFaultPosition } from '@nielspeter/eess';
9
+ /**
10
+ * Report what each rule cannot enforce, without evaluating their conditions.
11
+ *
12
+ * It DOES materialize each rule's selection, as of plan 0096 — "this rule
13
+ * examined nothing" is a fact about the selection. The docstring said "without
14
+ * running any of them" and that stopped being true; it is the IDE-hover contract
15
+ * for an exported function, so it is corrected here and not only in `docs/`.
16
+ *
17
+ * As of plan 0102, one family's `inertAdvice?()` goes further than selection:
18
+ * `inconsistentSiblings` walks every sibling body's AST to answer it (the same
19
+ * work `check()` does), so for that one family this IS evaluating the
20
+ * condition, not just counting what would be handed to it (review: architect).
21
+ * Still no `Condition.evaluate()` call — the boundary this docstring's
22
+ * predecessor drew — but "without evaluating" is no longer exactly right for
23
+ * every family, and is corrected here rather than left for the next reader to
24
+ * discover by profiling `doctor`.
25
+ *
26
+ * The in-process half of `doctor`. It exists because rules written inside
27
+ * vitest are a co-equal documented path (`docs/running-in-tests.md`), and a
28
+ * CLI-only diagnostic would leave half the users unable to measure before R3
29
+ * flips anything — which is the one job R2a has.
30
+ *
31
+ * Reports **identities, never totals**: which glob, in which rule, at which
32
+ * position. A count is a snapshot, and under ADR-009 rule 4 a snapshot is the
33
+ * thing that rots. Callers who want a number can take `.length`.
34
+ */
35
+ export function diagnose(rules, project) {
36
+ const findings = [];
37
+ /**
38
+ * Projects already reported empty, by OBJECT not by path.
39
+ *
40
+ * The path is not an identity: `workspace([...])` sets `tsConfigPath` to the
41
+ * alphabetically first of N configs (`project.ts`), so a `workspace()` and a
42
+ * `project()` naming that same config collided — and the loser was dropped
43
+ * silently, contributing no finding at all. A false green inside the fix for
44
+ * a false green. `project()` and `workspace()` are both memoized, so object
45
+ * identity IS project identity, and it is what `pathUniverse` and `diskSet`
46
+ * already key on.
47
+ */
48
+ const emptyProjects = new WeakSet();
49
+ for (const rule of rules) {
50
+ const name = ruleName(rule);
51
+ // PER RULE, not once for the whole array. Taking the first project any
52
+ // rule could name and diagnosing everything against it is wrong in both
53
+ // directions: a rule file with two `project()` calls gets half its globs
54
+ // checked against the wrong universe — the documented monorepo hazard,
55
+ // committed by the diagnostic itself — and a file whose rules cannot name
56
+ // a project at all got silence.
57
+ // The rule's own project WINS over the parameter. Backwards, the parameter
58
+ // silently re-checks every rule against one universe — which is the
59
+ // documented monorepo hazard the paragraph above complains about, and the
60
+ // `project-unknown` advice used to recommend it. The parameter is a
61
+ // fallback for rules that cannot name a project, which is the only case it
62
+ // was ever needed for.
63
+ const target = rule.getProject?.() ?? project;
64
+ // Where this rule's findings begin, so the tail can ask whether anything
65
+ // else already explained an empty examination (plan 0096's precedence
66
+ // ruling). The gate has the same shape at `terminal-builder.ts` — each fault
67
+ // REPLACES what follows — and `diagnose()` must mirror it or the preview
68
+ // disagrees with the thing it previews.
69
+ //
70
+ // ABOVE the `no-condition` push, deliberately. It sat below on the first
71
+ // pass, so the tail could never see a missing assertion and measured
72
+ // ['no-condition','zero-subjects'] on three shapes — while the comment on
73
+ // the tail claimed a missing assertion already named a cause. The code
74
+ // contradicted its own comment.
75
+ const before = findings.length;
76
+ // A rule with a selector and no condition asserts nothing about what it
77
+ // selected. Reported here so that R3b's gate can see proposal 019 at all:
78
+ // a doctor that reported only glob faults would pass while 019's blast
79
+ // radius was completely unknown — this plan's own question, asked of its
80
+ // own gate.
81
+ if (hasNoCondition(rule)) {
82
+ findings.push({
83
+ kind: 'no-condition',
84
+ rule: name,
85
+ // The builder's own per-state remedy when it offers one — the same
86
+ // string the runtime prints — falling back to the generic form for a
87
+ // DiagnosableRule that predates the hook. The old fixed text here said
88
+ // "add a .should() clause", which is the wrong remedy for the main
89
+ // shape (the .should() is present; the condition is not).
90
+ // The builder's own per-state remedy. No literal fallback string here:
91
+ // an earlier revision hard-coded the generic text a second time, and a
92
+ // review measured either copy being rewritten with nothing failing —
93
+ // two strings in the mechanism whose stated purpose is one string, one
94
+ // place. A DiagnosableRule that predates the hook gets the base
95
+ // method's text, from the one place that owns it.
96
+ advice: rule.assertionAdvice?.() ?? TerminalBuilder.prototype.assertionAdvice.call(rule),
97
+ });
98
+ }
99
+ const trees = rule.globs?.() ?? [];
100
+ // Silence here would be a false green in the tool built to remove false
101
+ // greens: a rule that declares globs and cannot say which project to check
102
+ // them against used to be skipped, so a rule file made entirely of such
103
+ // rules reported a clean bill of health and exited 0 with every one of its
104
+ // globs unchecked. Say so instead.
105
+ //
106
+ // This comment used to name `crossLayer()` and `resolvers()` as the
107
+ // builders that could not name their project — and by the time it was read
108
+ // again, `48e3391` had given both a `getProject()`, so it named as examples
109
+ // the two shapes the fix had repaired. `tests/core/diagnose.test.ts` pins
110
+ // the truth in both directions: one test drives this branch, and a second
111
+ // asserts a `crossLayer` rule does NOT reach it. Hence no roster and no
112
+ // count here — a builder reaches this branch exactly when it implements no
113
+ // `getProject()` and no project was passed in, which is checked on the
114
+ // line below rather than remembered in prose.
115
+ if (!target) {
116
+ if (trees.length > 0) {
117
+ findings.push({
118
+ kind: 'project-unknown',
119
+ rule: name,
120
+ advice: 'this rule declares globs but cannot say which project it was built against, so they were not checked. A builder constructed directly rather than through its entry point has no project to report',
121
+ });
122
+ // ...but the syntactic faults do not need a project, so they are still
123
+ // reported here rather than held back for a run that may never happen.
124
+ findings.push(...syntacticFindings(name, trees));
125
+ }
126
+ // Evidence is a fact about the FAMILY, not about whether we could name its
127
+ // project — so this branch reports it too. Under the SAME gate as the tail:
128
+ // pushed unconditionally it produced ['project-unknown','dead-glob',
129
+ // 'zero-subjects'], the very shape this plan condemns, on the one path the
130
+ // ruling had not been extended to.
131
+ if (findings.length === before) {
132
+ const noProjectEvidence = zeroSubjectsFinding(rule, name);
133
+ if (noProjectEvidence !== undefined)
134
+ findings.push(noProjectEvidence);
135
+ }
136
+ continue;
137
+ }
138
+ // Bug 0031. When the project loaded nothing, EVERY glob is dead and none
139
+ // of them is the reason. Diagnosing them one by one produced six findings
140
+ // whose advice said "a path segment is misspelled" about correctly spelled
141
+ // globs, measured against a real adopting codebase whose root tsconfig is
142
+ // `"files": []` plus project references.
143
+ //
144
+ // The rule is not new here: `slice-rule-builder.ts` already states it —
145
+ // "blaming the glob would send the caller to the wrong file entirely" —
146
+ // and `check` printed the right cause in the same run this printed the
147
+ // wrong one.
148
+ //
149
+ // Once per PROJECT, not per rule and not per glob: the identity of this
150
+ // fault is the tsconfig, so that is what ADR-009 rule 4 asks be named.
151
+ // Deduped by path rather than by object because the path is what the
152
+ // message prints, and printing one sentence twice is the thing being
153
+ // fixed.
154
+ if (loadedNothing(target)) {
155
+ if (!emptyProjects.has(target)) {
156
+ emptyProjects.add(target);
157
+ findings.push({
158
+ kind: 'project-empty',
159
+ rule: name,
160
+ // One owner, shared with the builder's failing-check message. The
161
+ // clause "Reported once for this project" used to be here and was
162
+ // FALSE on the primary surface: `doctor` calls `diagnose()` once per
163
+ // rule file, so two files against one empty tsconfig printed the
164
+ // sentence claiming it was printed once, twice. Measured by review.
165
+ advice: emptyProjectAdvice(target),
166
+ });
167
+ }
168
+ // The syntactic faults survive an empty project: they are properties of
169
+ // the glob text, not of what loaded, so withholding them buys the reader
170
+ // a second failing round trip.
171
+ findings.push(...syntacticFindings(name, trees));
172
+ // Skip the rest of the glob walk. Not an optimisation — reporting those
173
+ // globs is the bug, because every one would carry a cause that is false.
174
+ continue;
175
+ }
176
+ const universe = pathUniverse(target);
177
+ for (const tree of trees) {
178
+ // Only diagnose sites inside a tree that is actually dead. A live tree
179
+ // may still contain a dead site — `or(dead, live)` is a working rule —
180
+ // and reporting the dead one there is the false red the tree exists to
181
+ // prevent.
182
+ if (!isDeadGlobTree(tree, universe))
183
+ continue;
184
+ for (const site of globSitesOf(tree)) {
185
+ // An exclusion matching zero is remedy-optional (proposal 006) and
186
+ // never a fault, and a positive condition glob is indistinguishable
187
+ // from an armed tripwire that has not fired. Reporting either asserts
188
+ // a remedy for a non-fault — and `position` used to be copied into the
189
+ // finding and never read, so both fired.
190
+ if (!isFaultPosition(site.position))
191
+ continue;
192
+ if (!isDeadSite(site, universe))
193
+ continue;
194
+ findings.push(describe(site, name, universe, target));
195
+ }
196
+ }
197
+ // LAST, and only if nothing else spoke for this rule. A dead glob, a missing
198
+ // assertion or an empty project each already names a cause with its own
199
+ // remedy; adding "your narrowing removed everything" beside one of them
200
+ // prints the derived symptom above the root cause, with advice that is false
201
+ // on that path. The first attempt emitted this first and unconditionally,
202
+ // which measured as ['zero-subjects','dead-glob'] for a single typo and
203
+ // broke the invariant bug 0040 is filed for — that `diagnose()` and the gate
204
+ // agree about a dead discovery glob.
205
+ if (findings.length === before) {
206
+ const evidence = zeroSubjectsFinding(rule, name);
207
+ if (evidence !== undefined)
208
+ findings.push(evidence);
209
+ }
210
+ // A DISTINCT branch, not folded into the zeroSubjectsFinding guard above:
211
+ // inertAdvice() only returns non-empty when examinedUnits() > 0 (plan
212
+ // 0102's own guard requires `matching > 0`), so the two are structurally
213
+ // mutually exclusive and this never doubles up with the zero-subjects
214
+ // finding above. Unconditional (not gated on `findings.length === before`)
215
+ // because the emptiness precedence above governs a different axis
216
+ // (evidence present vs. absent); this axis is evidence present vs.
217
+ // adequate, and nothing else in this loop speaks to it.
218
+ const inert = inertFinding(rule, name);
219
+ if (inert !== undefined)
220
+ findings.push(inert);
221
+ // Also unconditional, and naturally exclusive from the two branches above:
222
+ // `deferredWarningAdvice()` only fires when `.violations()` returns at
223
+ // least one `error`-severity result, which cannot happen when examined
224
+ // units is zero (zero-subjects) or the family's own adequacy predicate says
225
+ // this rule can never produce a finding (inert) — both of those states mean
226
+ // no violations at all, so `breaching.length` is `0` and this stays silent.
227
+ const deferred = deferredWarningFinding(rule, name);
228
+ if (deferred !== undefined)
229
+ findings.push(deferred);
230
+ }
231
+ return findings;
232
+ }
233
+ /**
234
+ * A rule that examined nothing, when nothing else explained why — plan 0096.
235
+ *
236
+ * Returns `undefined` unless the family answers `examinedUnits()` and answered
237
+ * zero. Two callers, on purpose: the project-unknown branch (a family with no
238
+ * project still has evidence — `crossProject` and `schemaFromSDL` have no
239
+ * `ArchProject` at all, and the first attempt gated this on one and gave those
240
+ * two families no preview whatsoever) and the tail of the normal path.
241
+ *
242
+ * NOT called from the project-empty branch. That fault is the instrument, it
243
+ * already has its own finding, and reporting both would print one fault twice
244
+ * — and prefigure 0098's precedence backwards, where an empty project outranks
245
+ * every declaration because a declaration asserts a fact about a loaded corpus.
246
+ */
247
+ function zeroSubjectsFinding(rule, name) {
248
+ if (rule.examinedUnits === undefined)
249
+ return undefined;
250
+ if (rule.examinedUnits() !== 0)
251
+ return undefined;
252
+ // The author said empty is the point. Reporting anyway would make the advice
253
+ // below a remedy the reader has already applied — ADR-009 rule 2's loop — and
254
+ // would over-report against 0098's floor, which honours the same mint. That
255
+ // the mint exists at all is why 0097 shipped first; this is its first reader.
256
+ if (rule.declaresEmpty?.() === true)
257
+ return undefined;
258
+ // `.notExist()` examines zero BECAUSE that is what it asserts — the gate has
259
+ // exempted this since 0.34.0 and the preview must agree, or `doctor` reports a
260
+ // working rule as broken. Plan 0098: the rule-builder family is the first to
261
+ // report evidence, so this is the first release in which the two could differ.
262
+ if (rule.assertsCardinality?.() === true)
263
+ return undefined;
264
+ return {
265
+ kind: 'zero-subjects',
266
+ rule: name,
267
+ // ONE cause, because precedence has already removed the others: this fires
268
+ // only when no dead glob, missing assertion or empty project explained the
269
+ // emptiness first. So the remedy can name that cause without the hedging
270
+ // ADR-009 rule 2 forbids — and it must not say "your filters", because the
271
+ // commonest trigger is a default the author never wrote (`minLines` is 5).
272
+ // VERBATIM from the rule when it can speak, so this preview and the gate
273
+ // cannot drift. The fallback is for a foreign dialect that predates the seam;
274
+ // it deliberately no longer promises "a later release makes this fail" — that
275
+ // release is this one.
276
+ // NO fallback literal. It was a six-line copy of the producer's sentence —
277
+ // dead for every real builder (every `TerminalBuilder` has the method), never
278
+ // referenced by a test, and already diverging: no unit noun, no file count,
279
+ // no narrowing hint. The seam exists because "two texts for one state is the
280
+ // plan-0070 drift shape"; a fallback is that second text, one level down, in
281
+ // the commit that added the seam.
282
+ //
283
+ // A duck-typed `DiagnosableRule` that cannot answer simply has no advice to
284
+ // report, which is honest — better than core inventing a sentence for a
285
+ // family whose units and remedies it does not know.
286
+ advice: rule.zeroSubjectsAdvice?.() ??
287
+ 'this rule examined 0 units, so it enforces nothing as written today.',
288
+ };
289
+ }
290
+ /**
291
+ * A rule whose evidence is non-empty but which is structurally unable to ever
292
+ * produce a finding as configured — plan 0102, bug 0077(A).
293
+ *
294
+ * Mirrors `zeroSubjectsFinding`'s shape: returns `undefined` unless the family
295
+ * answers `inertAdvice()` and answers non-empty. No fallback literal, for the
296
+ * same reason `zeroSubjectsFinding` has none — a family that cannot answer has
297
+ * no advice to report, which is honest; core does not invent a sentence for an
298
+ * adequacy predicate it does not own.
299
+ */
300
+ function inertFinding(rule, name) {
301
+ const advice = rule.inertAdvice?.();
302
+ if (advice === undefined || advice === '')
303
+ return undefined;
304
+ return { kind: 'inert', rule: name, advice };
305
+ }
306
+ /** A deferred warning whose accepted list no longer covers everything it finds — plan 0090. */
307
+ function deferredWarningFinding(rule, name) {
308
+ const advice = rule.deferredWarningAdvice?.();
309
+ if (advice === undefined || advice === '')
310
+ return undefined;
311
+ return { kind: 'deferred-warning', rule: name, advice };
312
+ }
313
+ /**
314
+ * The faults that need no project at all, reported on the branches that have none.
315
+ *
316
+ * `syntacticFault` takes `(glob, kind, base)` — no universe, no project — and
317
+ * is split out for exactly that reason. `'./src/**'` is dead in every possible
318
+ * project; loading the tsconfig will not fix it. Both early exits below (the
319
+ * project is unknown, the project is empty) used to swallow these, so the
320
+ * reader corrected their config, re-ran, and only then learned the glob was
321
+ * also malformed — a second round trip for a fault already decided.
322
+ *
323
+ * Reported by review. Applies to the pre-existing `project-unknown` branch too,
324
+ * which had the same hole.
325
+ */
326
+ function syntacticFindings(rule, trees) {
327
+ const findings = [];
328
+ for (const tree of trees) {
329
+ for (const site of globSitesOf(tree)) {
330
+ // Same position filter as the main path: an exclusion or condition glob
331
+ // matching nothing is not a fault, and that does not change because the
332
+ // fault is syntactic.
333
+ if (!isFaultPosition(site.position))
334
+ continue;
335
+ const fault = syntacticFault(site.glob, site.kind, site.base);
336
+ if (fault === undefined)
337
+ continue;
338
+ findings.push({
339
+ kind: 'dead-glob',
340
+ rule,
341
+ origin: site.origin,
342
+ glob: site.glob,
343
+ position: site.position,
344
+ fault,
345
+ advice: FAULT_ADVICE[fault],
346
+ });
347
+ }
348
+ }
349
+ return findings;
350
+ }
351
+ function describe(site, rule, universe, project) {
352
+ // The disk set is reached only from here, so a project with no dead globs
353
+ // never walks the filesystem.
354
+ const diagnosis = diagnoseGlob(site, universe, diskSet(project));
355
+ const onDiskAdvice = diagnosis.onDisk ? ON_DISK_ADVICE[diagnosis.onDisk] : '';
356
+ return {
357
+ kind: 'dead-glob',
358
+ rule,
359
+ origin: site.origin,
360
+ glob: site.glob,
361
+ position: site.position,
362
+ fault: diagnosis.fault,
363
+ onDisk: diagnosis.onDisk,
364
+ advice: onDiskAdvice === '' ? FAULT_ADVICE[diagnosis.fault] : onDiskAdvice,
365
+ };
366
+ }
367
+ function ruleName(rule) {
368
+ const described = rule.describeRule?.();
369
+ // `||` throughout, never `??`: `describeRule()` returns `rule: ''` for a bare
370
+ // entry point (no predicates, no conditions), and `'' ` is not nullish — so
371
+ // `?? 'unnamed rule'` made the fallback dead code and `doctor` printed an
372
+ // empty rule name for precisely the shape this diagnostic is about. Caught by
373
+ // sabotage, not by reading. The gate derives the same name in
374
+ // `TerminalBuilder.collectWithAssertionGuard`; both must be non-empty, and
375
+ // both are asserted so.
376
+ return described?.id || described?.rule || 'unnamed rule';
377
+ }
378
+ /** Whether the rule reached a terminal with no condition attached. */
379
+ function hasNoCondition(rule) {
380
+ return rule.assertsSomething?.() === false;
381
+ }
382
+ //# sourceMappingURL=diagnose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/core/diagnose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAKvD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAChG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAG7E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAkNlD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAiC,EACjC,OAAqB;IAErB,MAAM,QAAQ,GAAwB,EAAE,CAAA;IACxC;;;;;;;;;;OAUG;IACH,MAAM,aAAa,GAAG,IAAI,OAAO,EAAe,CAAA;IAEhD,KAAK,MAAM,IAAI,IAAI,KAAK,E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C;AAED,SAAS,QAAQ,CAAC,IAAqB;IACrC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,CAAA;IACvC,8EAA8E;IAC9E,4EAA4E;IAC5E,0EAA0E;IAC1E,8EAA8E;IAC9E,8DAA8D;IAC9D,2EAA2E;IAC3E,wBAAwB;IACxB,OAAO,SAAS,EAAE,EAAE,IAAI,SAAS,EAAE,IAAI,IAAI,cAAc,CAAA;AAC3D,CAAC;AAED,sEAAsE;AACtE,SAAS,cAAc,CAAC,IAAqB;IAC3C,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,KAAK,KAAK,CAAA;AAC5C,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { ArchProject } from './project.js';
2
+ /**
3
+ * What the filesystem says about a glob that the compiler's file set does not.
4
+ *
5
+ * Only populated for `no-match` — the other faults are syntactic and the disk
6
+ * has nothing to add. `not-determined` is the honest answer above the walk's
7
+ * entry budget, or where the walk refused to look.
8
+ *
9
+ * Declared here rather than in `glob-diagnosis.ts` because this is the module
10
+ * that produces it: the other way round made the two files import each other.
11
+ * Both edges were `import type` and therefore erased at runtime — but our own
12
+ * `arch/no-cycles` rule slices by directory, so it could not see a cycle
13
+ * INSIDE `core/`, and a per-file slicing in a test found it immediately. A
14
+ * cycle nothing can see is the shape this whole plan is about.
15
+ */
16
+ export type OnDisk = 'holds-typescript' | 'no-typescript' | 'absent' | 'not-determined';
17
+ /**
18
+ * What the filesystem knows that the compiler's file set does not.
19
+ *
20
+ * The second derivation ADR-009 rule 5 asks for: filesystem contents versus
21
+ * compiler membership. It is what distinguishes "your glob is misspelled" from
22
+ * "your glob is fine and your tsconfig scope excludes it" — the cheapest wrong
23
+ * action an agent can take, and the majority case in a real monorepo.
24
+ */
25
+ export interface DiskSet {
26
+ /** Classify a glob by what exists on disk under the paths it matches. */
27
+ classify(glob: string): OnDisk;
28
+ }
29
+ /**
30
+ * The project's disk set, walked at most once and only when asked.
31
+ *
32
+ * Lazy on purpose. This is only ever reached from `diagnoseGlob`, which is
33
+ * only ever reached from an already-firing fault, so a project with no faults
34
+ * never touches the filesystem. An eager version would charge every `check()`
35
+ * a recursive walk to answer a question no fault asked.
36
+ */
37
+ export declare function diskSet(project: ArchProject): DiskSet;
38
+ /**
39
+ * The walk, with the budget injectable.
40
+ *
41
+ * Exported for tests only. The degrade path is the difference between "not
42
+ * determined" and a *partial, wrong* classification — a false "contains no
43
+ * TypeScript" in the one message whose whole defence is that it states only
44
+ * facts — and with the budget a module constant it could only ever have been
45
+ * reached by accident on a repository nobody has.
46
+ */
47
+ export declare function buildDiskSet(project: ArchProject, budgetLimit?: number): DiskSet;
48
+ //# sourceMappingURL=disk-set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disk-set.d.ts","sourceRoot":"","sources":["../../src/core/disk-set.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAkD/C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,MAAM,GAAG,kBAAkB,GAAG,eAAe,GAAG,QAAQ,GAAG,gBAAgB,CAAA;AAEvF;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAC/B;AAID;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAMrD;AAED;;;;;;;;GAQG;AAEH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,WAAW,SAAe,GAAG,OAAO,CAEtF"}