@cplieger/deadset-ts 8.0.0-dev.2 → 8.0.0-dev.21

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 (431) hide show
  1. package/README.md +3 -1
  2. package/THIRD_PARTY_NOTICES.md +27 -0
  3. package/dist/bin/mapper-connection.js +2 -1
  4. package/dist/bin/node-host.js +24 -5
  5. package/dist/src/alias-chain.js +35 -9
  6. package/dist/src/amd.js +81 -0
  7. package/dist/src/analysis.js +274 -496
  8. package/dist/src/augmentations.js +64 -3
  9. package/dist/src/automatic-types.js +10 -29
  10. package/dist/src/bindings.js +382 -0
  11. package/dist/src/commands/held.js +499 -0
  12. package/dist/src/commands/read.js +161 -0
  13. package/dist/src/commands/shell.js +169 -0
  14. package/dist/src/commands/tools.js +1847 -0
  15. package/dist/src/component-files.js +3 -2
  16. package/dist/src/component-layer.js +4 -2
  17. package/dist/src/config.js +6 -82
  18. package/dist/src/conformance-record.js +2 -2
  19. package/dist/src/consumers.js +10 -38
  20. package/dist/src/contextual-uses.js +57 -26
  21. package/dist/src/contract/config.generated.js +561 -0
  22. package/dist/src/contract/contract.generated.js +1370 -0
  23. package/dist/src/contract/report.generated.js +866 -0
  24. package/dist/src/dependencies.js +165 -122
  25. package/dist/src/destructuring.js +1 -19
  26. package/dist/src/edges.js +38 -122
  27. package/dist/src/element-access.js +181 -168
  28. package/dist/src/entries/build-scripts.js +222 -0
  29. package/dist/src/{configuration-files.js → entries/configuration-files.js} +52 -256
  30. package/dist/src/{convention-rows.js → entries/convention-rows.js} +170 -30
  31. package/dist/src/entries/conventions.js +740 -0
  32. package/dist/src/{html-entries.js → entries/html-entries.js} +12 -42
  33. package/dist/src/{mdx-entries.js → entries/mdx-entries.js} +5 -28
  34. package/dist/src/entries/run-directories.js +77 -0
  35. package/dist/src/entries/sources.js +144 -0
  36. package/dist/src/entries/static-module.js +670 -0
  37. package/dist/src/entries/test-runners.js +650 -0
  38. package/dist/src/entries/workflow-steps.js +345 -0
  39. package/dist/src/exemptions/argument-places.js +131 -0
  40. package/dist/src/exemptions/calls.js +338 -0
  41. package/dist/src/exemptions/classes.js +13 -0
  42. package/dist/src/{decorator.js → exemptions/decorator.js} +19 -30
  43. package/dist/src/exemptions/detectors.js +48 -0
  44. package/dist/src/{enum-group.js → exemptions/enum-group.js} +9 -16
  45. package/dist/src/{erased-stores.js → exemptions/erased-stores.js} +7 -11
  46. package/dist/src/{framework-lifecycle.js → exemptions/framework-lifecycle.js} +76 -54
  47. package/dist/src/exemptions/generated-file.js +241 -0
  48. package/dist/src/{injection-container.js → exemptions/injection-container.js} +20 -26
  49. package/dist/src/exemptions/installed-globals.js +173 -0
  50. package/dist/src/{interface-satisfaction.js → exemptions/interface-satisfaction.js} +52 -121
  51. package/dist/src/exemptions/lifecycle.js +150 -0
  52. package/dist/src/{reflective-lookup.js → exemptions/reflective-lookup.js} +3 -3
  53. package/dist/src/exemptions/serialization-contract.js +1276 -0
  54. package/dist/src/exemptions/sites.js +182 -0
  55. package/dist/src/{template-field.js → exemptions/template-field.js} +13 -23
  56. package/dist/src/{value-reach.js → exemptions/value-reach.js} +14 -7
  57. package/dist/src/exposure.js +400 -0
  58. package/dist/src/extensions.js +37 -0
  59. package/dist/src/facts.js +38 -0
  60. package/dist/src/failure.js +36 -0
  61. package/dist/src/file-facts.js +3 -26
  62. package/dist/src/findings/completion.js +109 -56
  63. package/dist/src/findings/dependencies-and-module-machinery.js +4 -5
  64. package/dist/src/findings/emitters.js +27 -41
  65. package/dist/src/{implementations.js → findings/implementations.js} +3 -3
  66. package/dist/src/{in-operands.js → findings/in-operands.js} +3 -2
  67. package/dist/src/findings/interfaces.js +4 -5
  68. package/dist/src/findings/intra-function.js +16 -13
  69. package/dist/src/findings/non-code-artifacts.js +17 -12
  70. package/dist/src/findings/reads-and-writes.js +86 -27
  71. package/dist/src/findings/self-check.js +44 -30
  72. package/dist/src/findings/unused-declarations.js +29 -45
  73. package/dist/src/findings/visibility-narrowing.js +23 -31
  74. package/dist/src/findings-pass.js +13 -21
  75. package/dist/src/fs/document.js +52 -0
  76. package/dist/src/fs/manifest.js +67 -0
  77. package/dist/src/fs/tree.js +88 -0
  78. package/dist/src/git-ignore.js +39 -26
  79. package/dist/src/import-bindings.js +73 -28
  80. package/dist/src/index/sites.js +557 -0
  81. package/dist/src/index/values.js +124 -0
  82. package/dist/src/index.js +2 -2
  83. package/dist/src/indexed-access.js +523 -478
  84. package/dist/src/intra-function-parts.js +63 -43
  85. package/dist/src/inventory/commonjs.js +507 -0
  86. package/dist/src/inventory/enumerate.js +167 -0
  87. package/dist/src/inventory/syntax.js +236 -0
  88. package/dist/src/inventory.js +323 -724
  89. package/dist/src/javascript-file.js +48 -0
  90. package/dist/src/json-document.js +198 -67
  91. package/dist/src/keyof-comparisons.js +126 -107
  92. package/dist/src/kinds.js +3 -366
  93. package/dist/src/{components.js → liveness/components.js} +2 -3
  94. package/dist/src/{graph.js → liveness/graph.js} +52 -28
  95. package/dist/src/liveness/matrix.js +99 -0
  96. package/dist/src/liveness/sweep.js +558 -0
  97. package/dist/src/load/classify.js +289 -0
  98. package/dist/src/load/diagnostics.js +87 -0
  99. package/dist/src/load/discover.js +285 -0
  100. package/dist/src/{emit-map.js → load/emit-map.js} +1 -1
  101. package/dist/src/load/expected-module.js +136 -0
  102. package/dist/src/load/load.js +27 -0
  103. package/dist/src/load/module-lookup.js +37 -0
  104. package/dist/src/load/package-scope.js +56 -0
  105. package/dist/src/load/plan.js +313 -0
  106. package/dist/src/load/specifiers.js +113 -0
  107. package/dist/src/load/synthesize.js +152 -0
  108. package/dist/src/load/test-globals.js +207 -0
  109. package/dist/src/load/test-joins.js +82 -0
  110. package/dist/src/{workspace-manifests.js → load/workspace-manifests.js} +4 -4
  111. package/dist/src/{workspace-programs.js → load/workspace-programs.js} +89 -66
  112. package/dist/src/{workspace-resolution.js → load/workspace-resolution.js} +24 -66
  113. package/dist/src/{workspace-run.js → load/workspace-run.js} +7 -7
  114. package/dist/src/{workspace.js → load/workspace.js} +62 -124
  115. package/dist/src/module-declarations.js +70 -85
  116. package/dist/src/overrides.js +134 -112
  117. package/dist/src/partial.js +2 -1
  118. package/dist/src/paths.js +82 -16
  119. package/dist/src/platform-calls.js +78 -0
  120. package/dist/src/platform-symbols.js +134 -0
  121. package/dist/src/position.js +43 -1
  122. package/dist/src/print.js +11 -79
  123. package/dist/src/product.js +13 -0
  124. package/dist/src/query.js +95 -0
  125. package/dist/src/ref.js +12 -20
  126. package/dist/src/references/read-rule.js +1 -0
  127. package/dist/src/references/read-rules.js +48 -0
  128. package/dist/src/references/sink.js +237 -0
  129. package/dist/src/references/sources.js +450 -0
  130. package/dist/src/references.js +117 -1074
  131. package/dist/src/report-schema.js +51 -0
  132. package/dist/src/report.js +57 -41
  133. package/dist/src/reporters/annotations.js +15 -8
  134. package/dist/src/reporters/sarif.js +16 -10
  135. package/dist/src/reporters/template.js +4 -19
  136. package/dist/src/resolve.js +246 -730
  137. package/dist/src/{configured-declarations.js → roots/configured-declarations.js} +22 -24
  138. package/dist/src/{entry-point-gaps.js → roots/entry-point-gaps.js} +6 -15
  139. package/dist/src/roots/manifest.js +216 -0
  140. package/dist/src/roots/published-reach.js +412 -0
  141. package/dist/src/roots/root-set.js +487 -0
  142. package/dist/src/roots/unseen-loads.js +236 -0
  143. package/dist/src/run.js +66 -77
  144. package/dist/src/schema.js +320 -343
  145. package/dist/src/scope.js +38 -115
  146. package/dist/src/session.js +37 -29
  147. package/dist/src/source-files.js +6 -10
  148. package/dist/src/stores.js +4 -2
  149. package/dist/src/suppress-file.js +25 -28
  150. package/dist/src/suppress-inline.js +36 -83
  151. package/dist/src/suppress.js +50 -71
  152. package/dist/src/symbol-keys.js +92 -88
  153. package/dist/src/tests/file-class.js +76 -0
  154. package/dist/src/{outside-tests.js → tests/outside.js} +7 -7
  155. package/dist/src/{test-support.js → tests/support.js} +5 -12
  156. package/dist/src/text/compare.js +26 -0
  157. package/dist/src/text/glob.js +194 -0
  158. package/dist/src/text/named-files.js +298 -0
  159. package/dist/src/text/yaml.js +684 -0
  160. package/dist/src/type-errors.js +11 -232
  161. package/dist/src/type-parameter-reads.js +178 -139
  162. package/dist/src/unimplemented-callees.js +262 -242
  163. package/dist/src/unwrap.js +23 -0
  164. package/dist/src/usage.js +10 -0
  165. package/dist/src/vendor/unbash/ansi-c.js +132 -0
  166. package/dist/src/vendor/unbash/arithmetic-parts.js +37 -0
  167. package/dist/src/vendor/unbash/arithmetic.js +591 -0
  168. package/dist/src/vendor/unbash/assignment.js +131 -0
  169. package/dist/src/vendor/unbash/chars.js +48 -0
  170. package/dist/src/vendor/unbash/command.js +41 -0
  171. package/dist/src/vendor/unbash/expansion.js +80 -0
  172. package/dist/src/vendor/unbash/glob.js +268 -0
  173. package/dist/src/vendor/unbash/heredoc.js +27 -0
  174. package/dist/src/vendor/unbash/internal-types.js +1 -0
  175. package/dist/src/vendor/unbash/lexer.js +4274 -0
  176. package/dist/src/vendor/unbash/limits.js +3 -0
  177. package/dist/src/vendor/unbash/parser.js +1366 -0
  178. package/dist/src/vendor/unbash/parts.js +57 -0
  179. package/dist/src/vendor/unbash/substitution-context.js +8 -0
  180. package/dist/src/vendor/unbash/traversal.js +212 -0
  181. package/dist/src/vendor/unbash/types.js +1 -0
  182. package/dist/src/vendor/unbash/word-value.js +61 -0
  183. package/dist/src/vendor/unbash/word.js +40 -0
  184. package/dist/src/verbs/analyze.js +194 -127
  185. package/dist/src/verbs/describe.js +13 -18
  186. package/dist/src/verbs/explain.js +85 -139
  187. package/dist/src/verbs/print-config.js +2 -1
  188. package/dist/src/verbs/print-projects.js +6 -4
  189. package/dist/src/verbs/print-retained.js +30 -6
  190. package/dist/src/verbs/print-roots.js +4 -2
  191. package/dist/src/verbs/verb.js +1 -5
  192. package/dist/src/verbs/version.js +14 -3
  193. package/jsr.json +2 -1
  194. package/package.json +14 -8
  195. package/src/alias-chain.ts +40 -11
  196. package/src/amd.ts +130 -0
  197. package/src/analysis.ts +426 -733
  198. package/src/augmentations.ts +93 -4
  199. package/src/automatic-types.ts +12 -30
  200. package/src/bindings.ts +460 -0
  201. package/src/commands/held.ts +632 -0
  202. package/src/commands/read.ts +242 -0
  203. package/src/commands/shell.ts +228 -0
  204. package/src/commands/tools.ts +2382 -0
  205. package/src/component-files.ts +4 -2
  206. package/src/component-layer.ts +4 -2
  207. package/src/config.ts +31 -302
  208. package/src/conformance-record.ts +2 -2
  209. package/src/consumers.ts +16 -66
  210. package/src/contextual-uses.ts +66 -34
  211. package/src/contract/config.generated.ts +821 -0
  212. package/src/contract/contract.generated.ts +1453 -0
  213. package/src/contract/report.generated.ts +1241 -0
  214. package/src/dependencies.ts +223 -128
  215. package/src/destructuring.ts +1 -31
  216. package/src/edges.ts +41 -140
  217. package/src/element-access.ts +190 -187
  218. package/src/entries/build-scripts.ts +292 -0
  219. package/src/{configuration-files.ts → entries/configuration-files.ts} +68 -278
  220. package/src/{convention-rows.ts → entries/convention-rows.ts} +227 -31
  221. package/src/{conventions.ts → entries/conventions.ts} +367 -583
  222. package/src/{html-entries.ts → entries/html-entries.ts} +22 -48
  223. package/src/{mdx-entries.ts → entries/mdx-entries.ts} +7 -30
  224. package/src/entries/run-directories.ts +108 -0
  225. package/src/entries/sources.ts +266 -0
  226. package/src/entries/static-module.ts +858 -0
  227. package/src/entries/test-runners.ts +835 -0
  228. package/src/entries/workflow-steps.ts +432 -0
  229. package/src/exemptions/argument-places.ts +198 -0
  230. package/src/exemptions/calls.ts +483 -0
  231. package/src/exemptions/classes.ts +49 -0
  232. package/src/exemptions/decorator.ts +56 -0
  233. package/src/exemptions/detectors.ts +75 -0
  234. package/src/{enum-group.ts → exemptions/enum-group.ts} +10 -19
  235. package/src/{erased-stores.ts → exemptions/erased-stores.ts} +7 -14
  236. package/src/{framework-lifecycle.ts → exemptions/framework-lifecycle.ts} +85 -66
  237. package/src/exemptions/generated-file.ts +318 -0
  238. package/src/{injection-container.ts → exemptions/injection-container.ts} +29 -34
  239. package/src/exemptions/installed-globals.ts +255 -0
  240. package/src/{interface-satisfaction.ts → exemptions/interface-satisfaction.ts} +69 -160
  241. package/src/exemptions/lifecycle.ts +286 -0
  242. package/src/{reflective-lookup.ts → exemptions/reflective-lookup.ts} +5 -5
  243. package/src/exemptions/serialization-contract.ts +1729 -0
  244. package/src/exemptions/sites.ts +293 -0
  245. package/src/{template-field.ts → exemptions/template-field.ts} +22 -32
  246. package/src/{value-reach.ts → exemptions/value-reach.ts} +16 -8
  247. package/src/exposure.ts +492 -0
  248. package/src/extensions.ts +45 -0
  249. package/src/facts.ts +46 -0
  250. package/src/failure.ts +63 -0
  251. package/src/file-facts.ts +15 -25
  252. package/src/finding.ts +10 -10
  253. package/src/findings/boundary.ts +11 -0
  254. package/src/findings/completion.ts +133 -64
  255. package/src/findings/dependencies-and-module-machinery.ts +4 -7
  256. package/src/findings/emitter.ts +9 -10
  257. package/src/findings/emitters.ts +38 -52
  258. package/src/{implementations.ts → findings/implementations.ts} +4 -4
  259. package/src/{in-operands.ts → findings/in-operands.ts} +4 -3
  260. package/src/findings/interfaces.ts +7 -9
  261. package/src/findings/intra-function.ts +16 -14
  262. package/src/findings/non-code-artifacts.ts +24 -15
  263. package/src/findings/reads-and-writes.ts +118 -41
  264. package/src/findings/self-check.ts +51 -38
  265. package/src/findings/unused-declarations.ts +31 -49
  266. package/src/findings/visibility-narrowing.ts +36 -40
  267. package/src/findings-pass.ts +15 -31
  268. package/src/fs/document.ts +70 -0
  269. package/src/fs/manifest.ts +96 -0
  270. package/src/fs/tree.ts +110 -0
  271. package/src/git-ignore.ts +50 -26
  272. package/src/host.ts +12 -5
  273. package/src/import-bindings.ts +98 -29
  274. package/src/index/sites.ts +781 -0
  275. package/src/index/values.ts +170 -0
  276. package/src/index.ts +2 -2
  277. package/src/indexed-access.ts +570 -527
  278. package/src/intra-function-parts.ts +73 -44
  279. package/src/inventory/commonjs.ts +696 -0
  280. package/src/inventory/enumerate.ts +203 -0
  281. package/src/inventory/syntax.ts +311 -0
  282. package/src/inventory.ts +442 -895
  283. package/src/javascript-file.ts +54 -0
  284. package/src/json-document.ts +241 -76
  285. package/src/keyof-comparisons.ts +133 -122
  286. package/src/kinds.ts +5 -413
  287. package/src/{components.ts → liveness/components.ts} +4 -6
  288. package/src/{graph.ts → liveness/graph.ts} +100 -35
  289. package/src/liveness/matrix.ts +162 -0
  290. package/src/liveness/sweep.ts +855 -0
  291. package/src/load/classify.ts +433 -0
  292. package/src/load/diagnostics.ts +154 -0
  293. package/src/load/discover.ts +471 -0
  294. package/src/{emit-map.ts → load/emit-map.ts} +1 -1
  295. package/src/load/expected-module.ts +194 -0
  296. package/src/load/load.ts +73 -0
  297. package/src/load/module-lookup.ts +50 -0
  298. package/src/load/package-scope.ts +74 -0
  299. package/src/load/plan.ts +513 -0
  300. package/src/load/specifiers.ts +171 -0
  301. package/src/load/synthesize.ts +230 -0
  302. package/src/load/test-globals.ts +251 -0
  303. package/src/load/test-joins.ts +98 -0
  304. package/src/{workspace-manifests.ts → load/workspace-manifests.ts} +5 -5
  305. package/src/{workspace-programs.ts → load/workspace-programs.ts} +128 -85
  306. package/src/{workspace-resolution.ts → load/workspace-resolution.ts} +41 -77
  307. package/src/{workspace-run.ts → load/workspace-run.ts} +18 -16
  308. package/src/{workspace.ts → load/workspace.ts} +90 -134
  309. package/src/module-declarations.ts +74 -98
  310. package/src/overrides.ts +162 -134
  311. package/src/partial.ts +3 -2
  312. package/src/paths.ts +92 -16
  313. package/src/platform-calls.ts +119 -0
  314. package/src/platform-symbols.ts +189 -0
  315. package/src/position.ts +44 -1
  316. package/src/print.ts +12 -92
  317. package/src/product.ts +18 -0
  318. package/src/query.ts +201 -10
  319. package/src/ref.ts +12 -20
  320. package/src/references/read-rule.ts +60 -0
  321. package/src/references/read-rules.ts +55 -0
  322. package/src/references/sink.ts +314 -0
  323. package/src/references/sources.ts +632 -0
  324. package/src/references.ts +187 -1450
  325. package/src/report-schema.ts +68 -0
  326. package/src/report.ts +103 -226
  327. package/src/reporters/annotations.ts +22 -11
  328. package/src/reporters/json.ts +1 -1
  329. package/src/reporters/reporter.ts +2 -4
  330. package/src/reporters/reporters.ts +1 -1
  331. package/src/reporters/sarif.ts +29 -16
  332. package/src/reporters/template.ts +4 -20
  333. package/src/reporters/text.ts +3 -3
  334. package/src/resolve.ts +284 -1115
  335. package/src/{configured-declarations.ts → roots/configured-declarations.ts} +26 -29
  336. package/src/{entry-point-gaps.ts → roots/entry-point-gaps.ts} +7 -16
  337. package/src/roots/manifest.ts +303 -0
  338. package/src/roots/published-reach.ts +486 -0
  339. package/src/{roots.ts → roots/root-set.ts} +286 -469
  340. package/src/roots/unseen-loads.ts +345 -0
  341. package/src/run.ts +75 -91
  342. package/src/schema.ts +391 -388
  343. package/src/scope.ts +46 -138
  344. package/src/session.ts +87 -55
  345. package/src/source-files.ts +6 -11
  346. package/src/stores.ts +15 -3
  347. package/src/suppress-file.ts +24 -33
  348. package/src/suppress-inline.ts +55 -91
  349. package/src/suppress.ts +78 -79
  350. package/src/symbol-keys.ts +104 -107
  351. package/src/tests/file-class.ts +135 -0
  352. package/src/{outside-tests.ts → tests/outside.ts} +16 -10
  353. package/src/{test-support.ts → tests/support.ts} +15 -21
  354. package/src/text/compare.ts +27 -0
  355. package/src/text/glob.ts +210 -0
  356. package/src/text/named-files.ts +388 -0
  357. package/src/text/yaml.ts +747 -0
  358. package/src/type-errors.ts +18 -288
  359. package/src/type-parameter-reads.ts +187 -158
  360. package/src/unimplemented-callees.ts +297 -280
  361. package/src/unwrap.ts +34 -0
  362. package/src/usage.ts +10 -0
  363. package/src/vendor/unbash/LICENSE +15 -0
  364. package/src/vendor/unbash/VENDORED.md +16 -0
  365. package/src/vendor/unbash/ansi-c.ts +132 -0
  366. package/src/vendor/unbash/arithmetic-parts.ts +53 -0
  367. package/src/vendor/unbash/arithmetic.ts +641 -0
  368. package/src/vendor/unbash/assignment.ts +163 -0
  369. package/src/vendor/unbash/chars.ts +48 -0
  370. package/src/vendor/unbash/command.ts +47 -0
  371. package/src/vendor/unbash/expansion.ts +144 -0
  372. package/src/vendor/unbash/glob.ts +284 -0
  373. package/src/vendor/unbash/heredoc.ts +34 -0
  374. package/src/vendor/unbash/internal-types.ts +94 -0
  375. package/src/vendor/unbash/lexer.ts +4352 -0
  376. package/src/vendor/unbash/limits.ts +3 -0
  377. package/src/vendor/unbash/parser.ts +1612 -0
  378. package/src/vendor/unbash/parts.ts +96 -0
  379. package/src/vendor/unbash/substitution-context.ts +20 -0
  380. package/src/vendor/unbash/traversal.ts +182 -0
  381. package/src/vendor/unbash/types.ts +660 -0
  382. package/src/vendor/unbash/word-value.ts +64 -0
  383. package/src/vendor/unbash/word.ts +50 -0
  384. package/src/verbs/analyze.ts +255 -164
  385. package/src/verbs/describe.ts +19 -17
  386. package/src/verbs/explain.ts +93 -169
  387. package/src/verbs/print-config.ts +2 -1
  388. package/src/verbs/print-projects.ts +6 -4
  389. package/src/verbs/print-retained.ts +36 -6
  390. package/src/verbs/print-roots.ts +4 -2
  391. package/src/verbs/verb.ts +2 -8
  392. package/src/verbs/version.ts +15 -3
  393. package/dist/src/base-url.js +0 -18
  394. package/dist/src/calls.js +0 -155
  395. package/dist/src/conventions.js +0 -937
  396. package/dist/src/discover.js +0 -468
  397. package/dist/src/entry-points.js +0 -529
  398. package/dist/src/exempt-classes.js +0 -75
  399. package/dist/src/exempt.js +0 -209
  400. package/dist/src/generated-file.js +0 -95
  401. package/dist/src/glob.js +0 -65
  402. package/dist/src/manifest.js +0 -165
  403. package/dist/src/matrix.js +0 -246
  404. package/dist/src/pnpm-workspace.js +0 -120
  405. package/dist/src/roots.js +0 -672
  406. package/dist/src/serialization-contract.js +0 -611
  407. package/dist/src/setup-failure.js +0 -23
  408. package/dist/src/sweep.js +0 -224
  409. package/dist/src/test-joins.js +0 -101
  410. package/dist/src/value-flow.js +0 -74
  411. package/dist/src/version.js +0 -7
  412. package/dist/src/workflow-steps.js +0 -185
  413. package/src/base-url.ts +0 -24
  414. package/src/calls.ts +0 -225
  415. package/src/decorator.ts +0 -78
  416. package/src/discover.ts +0 -653
  417. package/src/entry-points.ts +0 -687
  418. package/src/exempt-classes.ts +0 -123
  419. package/src/exempt.ts +0 -323
  420. package/src/generated-file.ts +0 -111
  421. package/src/glob.ts +0 -67
  422. package/src/manifest.ts +0 -234
  423. package/src/matrix.ts +0 -423
  424. package/src/pnpm-workspace.ts +0 -135
  425. package/src/serialization-contract.ts +0 -849
  426. package/src/setup-failure.ts +0 -39
  427. package/src/sweep.ts +0 -347
  428. package/src/test-joins.ts +0 -120
  429. package/src/value-flow.ts +0 -104
  430. package/src/version.ts +0 -7
  431. package/src/workflow-steps.ts +0 -216
@@ -8,50 +8,51 @@
8
8
  import { isStringLiteralLikeNode } from "@typescript/native/ast";
9
9
  import { lineOf, readComponent } from "./component-files.js";
10
10
  import { kindOf } from "./config.js";
11
- import { consumerLoads, consumerReferences, moduleIdentity, } from "./consumers.js";
12
- import { configuredDeclarations, configuredRef, declarationsNamed, } from "./configured-declarations.js";
13
- import { decorator } from "./decorator.js";
11
+ import { consumerReferences } from "./consumers.js";
12
+ import { configuredDeclarations, configuredRef, declarationsNamed, } from "./roots/configured-declarations.js";
14
13
  import { configurationNeeds, dependenciesOf, projectNeeds } from "./dependencies.js";
14
+ import { carriersOf, NO_CARRIERS } from "./exposure.js";
15
15
  import { deprecatedDeclarations } from "./deprecation.js";
16
- import { discoverProjects, DiscoveryError, isGuess, MISSING_GLOBAL_TYPE, projectErrors, renderDiagnostic, targetRelative, withBaseUrlPaths, } from "./discover.js";
17
- import { conventionFailuresFor, generatedFiles, readConventions, } from "./conventions.js";
16
+ import { moduleIdentity } from "./load/discover.js";
17
+ import { loadRun } from "./load/load.js";
18
+ import { readSources } from "./entries/sources.js";
19
+ import { readWorkflows } from "./entries/workflow-steps.js";
18
20
  import { readEdgeSides } from "./edges.js";
19
- import { enumGroup } from "./enum-group.js";
20
- import { generatedFile, generatedFilesOf } from "./generated-file.js";
21
- import { inOperandNames } from "./in-operands.js";
21
+ import { bindingsOf, distinctBindings } from "./bindings.js";
22
+ import { generatedFilesOf } from "./exemptions/generated-file.js";
23
+ import { inOperandNames } from "./findings/in-operands.js";
22
24
  import { sourceFilesOf } from "./source-files.js";
23
- import { evidenceRecords, heldRecords, disabledClasses, exemptionsOf, holdingWhile, isUnansweredRecord, retainedIn, } from "./exempt.js";
25
+ import { DETECTORS, detection } from "./exemptions/detectors.js";
26
+ import { exemptionsOf, settle } from "./exemptions/lifecycle.js";
24
27
  import { heldByInclusion, sourcePaths, sourceTree } from "./file-facts.js";
25
- import { globExpression } from "./glob.js";
26
28
  import { findingsPass, recordedFindings, rowKey } from "./findings-pass.js";
27
29
  import { unmatchedRootFindings } from "./findings/self-check.js";
28
- import { frameworkLifecycle } from "./framework-lifecycle.js";
29
- import { implementations, mergeImplementations } from "./implementations.js";
30
- import { injectionContainer } from "./injection-container.js";
31
- import { interfaceSatisfaction, settledSatisfaction } from "./interface-satisfaction.js";
30
+ import { implementations, mergeImplementations } from "./findings/implementations.js";
32
31
  import { intraFunctionFacts, projectParts } from "./intra-function-parts.js";
33
- import { inventory } from "./inventory.js";
34
- import { packageEntries, readManifest } from "./manifest.js";
35
- import { liveFilesAt, matrixOf, referenceKey, sweepMatrix, } from "./matrix.js";
36
- import { dirnamePath, extensionOf, joinPath, normalizePath, relativePath, resolvePath, } from "./paths.js";
32
+ import {} from "./inventory.js";
33
+ import { inventory } from "./inventory/enumerate.js";
34
+ import { readManifest } from "./roots/manifest.js";
35
+ import { matrixOf, referenceKey } from "./liveness/matrix.js";
36
+ import { ancestors, dirnamePath, extensionOf, joinPath, relativePath, resolvePath, } from "./paths.js";
37
37
  import { byPosition, isComponentFile } from "./position.js";
38
- import { LANGUAGE } from "./report.js";
39
- import { SetupError, setupLine } from "./setup-failure.js";
40
- import { pathsOf, readErrors, skippedRoots, skippedUnits, } from "./type-errors.js";
41
- import { reflectiveLookup } from "./reflective-lookup.js";
42
- import { references, testFileRulesOf } from "./references.js";
43
- import { roots, unmatchedEverywhere, } from "./roots.js";
44
- import { serializationContract } from "./serialization-contract.js";
45
- import { outsideTestReferences, testFilesAt } from "./outside-tests.js";
46
- import { joinedTestFiles, withJoinedTests } from "./test-joins.js";
47
- import { supportReferences, testSupportFiles } from "./test-support.js";
48
- import { diagnosticsOf, ownedAs, runSession, } from "./session.js";
38
+ import { skippedUnits } from "./type-errors.js";
39
+ import { references } from "./references.js";
40
+ import { rootSet, unmatchedEverywhere, } from "./roots/root-set.js";
41
+ import { decodedMembers } from "./exemptions/serialization-contract.js";
42
+ import { outsideTestReferences, testFilesAt } from "./tests/outside.js";
43
+ import { formedForNode } from "./load/synthesize.js";
44
+ import { GLOBALS_RUNNER, namesTestGlobals } from "./load/test-globals.js";
45
+ import { targetTestFile, testFilePaths, testFileRulesOf, withheldBy, } from "./tests/file-class.js";
46
+ import { testSupportFiles } from "./tests/support.js";
49
47
  import { accessorsOf, storesOf } from "./stores.js";
50
48
  import { isPartKind } from "./suppress.js";
51
49
  import { bindRows, readBaseline, readIgnoreFile } from "./suppress-file.js";
52
50
  import { inlineDirectives, inlineSuppressions } from "./suppress-inline.js";
53
- import { readTemplates, templateField } from "./template-field.js";
54
- import { ownErrors, workspaceRun } from "./workspace-run.js";
51
+ import { sweep } from "./liveness/sweep.js";
52
+ import { bytewise } from "./text/compare.js";
53
+ import { holdsManifest, manifestAt } from "./fs/manifest.js";
54
+ import { runDirectories } from "./entries/run-directories.js";
55
+ import { globExpression } from "./text/glob.js";
55
56
  /** The setting whose source decides where a finding about a configured root sits. */
56
57
  const ROOTS_SETTING = "roots.patterns";
57
58
  /**
@@ -68,288 +69,91 @@ function documentOf(host, provenance, setting, targetRoot) {
68
69
  const document = resolvePath(host.workingDirectory(), origin.label);
69
70
  return relativePath(resolvePath(host.workingDirectory(), targetRoot), document) ?? "";
70
71
  }
71
- /** Two strings ordered bytewise. */
72
- function compare(a, b) {
73
- if (a === b) {
74
- return 0;
75
- }
76
- return a < b ? -1 : 1;
77
- }
78
72
  /**
79
- * The manifests the analysis reads, each once: the target's own, then every workspace
80
- * member's and every nested package's below the target root.
81
- */
82
- function conventionManifests(host, targetRoot, memberDirs, nestedDirs) {
83
- const found = new Map();
84
- if (host.kindOf(joinPath(targetRoot, "package.json")) === "file") {
85
- found.set(targetRoot, { dir: targetRoot, path: "package.json" });
86
- }
87
- for (const [dirs, nested] of [
88
- [memberDirs, false],
89
- [nestedDirs, true],
90
- ]) {
91
- for (const dir of dirs) {
92
- const below = relativePath(targetRoot, dir);
93
- if (below !== undefined && !found.has(dir)) {
94
- found.set(dir, { dir, path: `${below}/package.json`, nested });
95
- }
96
- }
97
- }
98
- return [...found.values()];
99
- }
100
- /**
101
- * The nested packages of a run: each directory below the target root, in no `node_modules`
102
- * directory and none of `known`, that holds a `package.json` and lies at or above one of
103
- * `files`, the program's source files and the compiler configuration files, in path order.
104
- */
105
- function nestedPackageDirs(host, targetRoot, files, known) {
106
- const seen = new Set();
107
- const found = [];
108
- for (const file of files) {
109
- for (let dir = dirnamePath(file); dir !== targetRoot && !seen.has(dir) && relativePath(targetRoot, dir) !== undefined; dir = dirnamePath(dir)) {
110
- seen.add(dir);
111
- const below = relativePath(targetRoot, dir) ?? "";
112
- if (!below.split("/").includes("node_modules") &&
113
- !known.has(dir) &&
114
- host.kindOf(joinPath(dir, "package.json")) === "file") {
115
- found.push(dir);
116
- }
117
- }
118
- }
119
- return found.sort(compare);
120
- }
121
- /**
122
- * Reads every project the scope discovers, and each declared consumer's, in one snapshot,
123
- * each checked for errors first. `stage` is handed a target project and enumerates and roots
124
- * it if it reads it; a consumer project is read for its references to the target. A type error
125
- * in an own file skips the unit holding it. A guess that does not load or meets a setup failure
126
- * is dropped into `notBuilt` (see {@link isGuess}); any other such project fails the run, as
127
- * does a run whose every guess was dropped.
73
+ * Reads every project the load phase analyzes through `stage`, which enumerates and roots one
74
+ * if it reads it, and each declared consumer's project for its references to the target,
75
+ * in the same snapshot. A type error in an own file skips the unit holding it.
128
76
  */
129
77
  function readProjects(engine, host, scope, config, stage) {
130
78
  const targetRoot = scope.target.path;
131
- const discovered = discoverProjects(engine, host, scope, config.analysis.configurations);
132
- if (discovered.configFiles.length === 0 && discovered.notBuilt.length === 0) {
133
- throw new DiscoveryError(`${targetRoot} holds no compiler configuration, so the run holds no program`, []);
134
- }
135
- const ids = new Map(discovered.projects.map((project) => [project.configFile, project.id]));
136
- const loads = consumerLoads(engine, host, scope, discovered.configFiles);
137
- const consumerOf = new Map(loads.flatMap((load) => load.configFiles.map((configFile) => [configFile, load.consumer])));
138
79
  const absoluteRoot = resolvePath(host.workingDirectory(), targetRoot);
139
- const workspace = workspaceRun(engine, host, absoluteRoot, discovered.configFiles, readManifest(host, targetRoot));
80
+ const testPatterns = config.ts.test_files.map(globExpression);
140
81
  const parse = (fileName, text) => engine.parseSourceFile(fileName, text);
141
- const memberDirs = workspace?.memberDirs ?? [];
142
- // The nested packages are known only once every program is open, and every visit reads
143
- // the conventions and options they decide, so both are set in the session's first step.
144
- let nestedDirs = [];
145
- let conventions = readConventions(host, parse, [], config.ts.disabledConventions);
146
- let options;
147
- const readManifests = (opened) => {
148
- nestedDirs = nestedPackageDirs(host, normalizePath(absoluteRoot), opened
149
- .filter((one) => !consumerOf.has(one.configFile))
150
- .flatMap((one) => [one.configFile, ...one.fileNames()]), new Set(memberDirs));
151
- conventions = readConventions(host, parse, conventionManifests(host, absoluteRoot, memberDirs, nestedDirs), config.ts.disabledConventions);
152
- options = {
82
+ return loadRun(engine, host, scope, config, ({ plan, classified, runFiles }) => {
83
+ const { packages, conventions } = plan;
84
+ const workflows = readWorkflows(host, targetRoot);
85
+ const options = {
153
86
  host,
154
- manifest: workspace?.manifest ?? readManifest(host, targetRoot),
155
- otherPackages: [
156
- ...(workspace?.entries ?? []),
157
- ...packageEntries(host, normalizePath(absoluteRoot), nestedDirs),
158
- ],
159
- patterns: config.rootPatterns,
160
- entryFiles: config.ts.entryFiles,
161
- conventions,
162
- testFiles: config.ts.testFiles,
87
+ manifest: packages.manifest,
88
+ otherPackages: packages.entries,
89
+ patterns: config.roots.patterns,
90
+ entryFiles: config.ts.entry_files,
163
91
  parse,
164
- publishedAPI: config.targetKind !== "" && kindOf(config.targetKind, LANGUAGE) === "library",
165
- publishedMembers: new Set((workspace?.entries ?? []).filter((entry) => entry.published).map((entry) => entry.dir)),
166
- runFiles: new Set(opened.flatMap((one) => one.fileNames().map((name) => resolvePath(host.workingDirectory(), name)))),
92
+ publishedAPI: config.target.kind !== undefined && kindOf(config.target.kind) === "library",
93
+ publishedMembers: packages.published,
94
+ runFiles,
167
95
  };
168
- };
169
- const notBuilt = [...discovered.notBuilt];
170
- const dropped = (configFile, error) => {
171
- notBuilt.push({
172
- id: ids.get(configFile) ?? configFile,
173
- configFile,
174
- error: targetRelative(error, absoluteRoot),
175
- });
176
- };
177
- const failures = [];
178
- const unbuildable = [];
179
- const setupDropped = [];
180
- const librariesUnfound = [];
181
- const consumed = new Map();
182
- const heldFiles = new Set();
183
- let outsideTests = [];
184
- const setupMet = (configFile, met) => {
185
- const [first] = met;
186
- if (first !== undefined && isGuess(discovered, configFile)) {
187
- dropped(configFile, setupLine(first));
188
- setupDropped.push(...met);
189
- }
190
- else {
191
- unbuildable.push(...met);
192
- }
193
- };
194
- const testPatterns = config.ts.testFiles.map(globExpression);
195
- const joins = discovered.derived
196
- ? joinedTestFiles(engine, host, absoluteRoot, discovered.configFiles, testPatterns)
197
- : new Map();
198
- const programs = withBaseUrlPaths(engine, host, [...discovered.configFiles, ...consumerOf.keys()], workspace?.programs ?? new Map());
199
- const session = runSession(engine, [...discovered.configFiles, ...consumerOf.keys()], (opened) => {
200
- const consumer = consumerOf.get(opened.configFile);
201
- const setup = consumer === undefined ? workspace?.unbuildable(opened.configFile) : undefined;
202
- if (setup !== undefined) {
203
- setupMet(opened.configFile, [
204
- { setupClass: "workspace-member-without-source", detail: setup },
205
- ]);
206
- return undefined;
207
- }
208
- const referenceOnly = workspace === undefined || consumer !== undefined
209
- ? () => false
210
- : workspace.referenceOnly(opened.configFile, opened.rootFiles);
211
- const project = workspace === undefined || consumer !== undefined
212
- ? opened
213
- : ownedAs(opened, (file, fromExternalLibrary) => workspace.ownFile(file, fromExternalLibrary));
214
- const raw = projectErrors(diagnosticsOf(project));
215
- const errors = { load: raw.load, check: ownErrors(raw.check, referenceOnly) };
216
- const [unloaded] = errors.load;
217
- if (unloaded !== undefined &&
218
- consumer === undefined &&
219
- isGuess(discovered, project.configFile)) {
220
- dropped(project.configFile, renderDiagnostic(unloaded, (path) => relativePath(absoluteRoot, path) ?? path));
221
- return undefined;
222
- }
223
- if (errors.load.length > 0) {
224
- failures.push(...errors.load);
225
- return undefined;
226
- }
227
- const reading = readErrors(project, errors.check, {
228
- host,
229
- targetRoot: consumer === undefined
230
- ? absoluteRoot
231
- : resolvePath(host.workingDirectory(), consumer.path),
232
- paths: pathsOf(engine, project.configFile),
96
+ const heldFiles = new Set();
97
+ const answers = classified.analyzed.map(({ plan: planned, project, skips, referenceOnly }) => {
98
+ const read = () => {
99
+ const held = inventory(project, host, targetRoot);
100
+ const own = sourceFilesOf(project, targetRoot);
101
+ const sources = readSources({
102
+ host,
103
+ targetRoot,
104
+ files: own,
105
+ parse,
106
+ testFiles: config.ts.test_files,
107
+ conventions,
108
+ workflows,
109
+ });
110
+ const rooted = rootSet(project, held, targetRoot, { ...options, sources, skips });
111
+ const generated = generatedFilesOf(own, sources.generated);
112
+ return {
113
+ configuration: planned.id,
114
+ configFile: project.configFile,
115
+ held,
116
+ rooted,
117
+ typeErrorSkips: skips.map((one) => one.record),
118
+ skipped: skippedUnits(skips, absoluteRoot),
119
+ referenceOnly: project
120
+ .ownSourceFiles()
121
+ .filter((file) => referenceOnly(file.fileName))
122
+ .flatMap((file) => relativePath(absoluteRoot, file.fileName) ?? []),
123
+ generated,
124
+ bindings: bindingsOf(own.byPath, generated, new Map(held.symbols
125
+ .filter((one) => one.kind === "file")
126
+ .map((one) => [one.position.path, one.ref]))),
127
+ sources,
128
+ formedForNode: formedForNode(planned),
129
+ };
130
+ };
131
+ for (const file of project.ownSourceFiles()) {
132
+ heldFiles.add(relativePath(absoluteRoot, file.fileName) ?? file.fileName);
133
+ }
134
+ return stage(project, { configuration: planned.id, read });
233
135
  });
234
- if (consumer !== undefined && reading.missing.length > 0) {
235
- unbuildable.push(...reading.missing.map((one) => ({
236
- setupClass: "missing-consumer",
237
- detail: `the consumer ${consumer.path} does not build, its dependencies not installed: ${one.detail}`,
238
- })));
239
- return undefined;
240
- }
241
- if (reading.missing.length > 0) {
242
- setupMet(project.configFile, reading.missing);
243
- return undefined;
244
- }
245
- const unconventional = consumer === undefined
246
- ? conventionFailuresFor(conventions, project.configFile, project.ownSourceFiles().map((file) => file.fileName))
247
- : [];
248
- if (unconventional.length > 0) {
249
- setupMet(project.configFile, unconventional);
250
- return undefined;
251
- }
252
- if (consumer !== undefined) {
253
- for (const reference of consumerReferences(project, host, targetRoot, {
254
- id: consumer.id,
255
- root: consumer.path,
256
- }, config)) {
136
+ const consumed = new Map();
137
+ const consumerHeld = new Set();
138
+ for (const { project, consumer } of classified.consumed) {
139
+ const side = { id: consumer.id, root: consumer.path };
140
+ const read = consumerReferences(project, host, targetRoot, side, config, parse);
141
+ for (const reference of read.references) {
257
142
  consumed.set(referenceKey(reference), reference);
258
143
  }
259
- return undefined;
260
- }
261
- librariesUnfound.push(...raw.unfound.map((one) => ({
262
- configFile: project.configFile,
263
- error: renderDiagnostic(one, (path) => relativePath(absoluteRoot, path) ?? path),
264
- })));
265
- const missingGlobal = raw.unfound.find(({ diagnostic }) => diagnostic.code === MISSING_GLOBAL_TYPE);
266
- const skips = missingGlobal === undefined
267
- ? reading.skips
268
- : [
269
- ...reading.skips,
270
- ...project.ownSourceFiles().map((file) => ({
271
- record: {
272
- path: relativePath(absoluteRoot, file.fileName) ?? file.fileName,
273
- line: 1,
274
- message: missingGlobal.diagnostic.text,
275
- },
276
- file,
277
- unit: file,
278
- })),
279
- ];
280
- const configuration = ids.get(project.configFile) ?? project.configFile;
281
- const read = () => {
282
- const held = inventory(project, host, targetRoot);
283
- const found = roots(project, held, targetRoot, options);
284
- const kept = skippedRoots(project, held, skips);
285
- const rooted = kept.length === 0
286
- ? found
287
- : {
288
- ...found,
289
- liveUnderReachability: [
290
- ...found.liveUnderReachability,
291
- ...kept.map((id) => ({ id, kind: "type-error", source: "" })),
292
- ],
293
- };
294
- const own = sourceFilesOf(project, targetRoot);
295
- return {
296
- configuration,
297
- configFile: project.configFile,
298
- held,
299
- rooted,
300
- typeErrorSkips: skips.map((one) => one.record),
301
- skipped: skippedUnits(skips, absoluteRoot),
302
- referenceOnly: project
303
- .ownSourceFiles()
304
- .filter((file) => referenceOnly(file.fileName))
305
- .flatMap((file) => relativePath(absoluteRoot, file.fileName) ?? []),
306
- generated: generatedFilesOf(own, generatedFiles(conventions, own)),
307
- testFileNames: conventions.testFiles,
308
- };
309
- };
310
- for (const file of project.ownSourceFiles()) {
311
- heldFiles.add(relativePath(absoluteRoot, file.fileName) ?? file.fileName);
312
- }
313
- return stage(project, { configuration, read });
314
- }, discovered.derived ? "record" : "refuse", joins.size === 0 ? programs : withJoinedTests(engine, host, programs, joins), () => {
315
- outsideTests = testFilesAt(host, targetRoot, sourcePaths(host, targetRoot).filter((path) => !heldFiles.has(path) && testPatterns.some((pattern) => pattern.test(path))), parse);
316
- }, readManifests);
317
- for (const configFile of session.unopened) {
318
- if (consumerOf.has(configFile) || !isGuess(discovered, configFile)) {
319
- throw new DiscoveryError(`${configFile} opened no project`, []);
144
+ for (const id of read.held) {
145
+ consumerHeld.add(id);
146
+ }
320
147
  }
321
- dropped(configFile, "the compiler opened no project for the configuration");
322
- }
323
- if (unbuildable.length > 0) {
324
- throw new SetupError(unbuildable);
325
- }
326
- if (failures.length > 0) {
327
- throw new DiscoveryError(`${String(failures.length)} error(s), so no answer was produced`, failures);
328
- }
329
- const answers = session.projects.filter((answer) => answer !== undefined);
330
- const [first] = notBuilt;
331
- if (answers.length === 0 && setupDropped.length > 0) {
332
- throw new SetupError(setupDropped);
333
- }
334
- if (answers.length === 0 && first !== undefined) {
335
- throw new DiscoveryError(`no configuration discovery derived could be built; ${first.id}: ${first.error}`, []);
336
- }
337
- return {
338
- answers,
339
- consumers: {
340
- loaded: loads.map((load) => load.consumer),
148
+ const outsideTests = testFilesAt(host, targetRoot, sourcePaths(host, targetRoot).filter((path) => !heldFiles.has(path) && testPatterns.some((pattern) => pattern.test(path))), parse);
149
+ return {
150
+ answers,
341
151
  references: [...consumed.values()],
342
- },
343
- notBuilt,
344
- unanswered: session.unanswered,
345
- componentsUnread: workspace?.componentsUnread ?? [],
346
- librariesUnfound,
347
- conventionsApplied: conventions.applied,
348
- conventionUses: conventions.uses,
349
- memberDirs,
350
- nestedDirs,
351
- outsideTests,
352
- };
152
+ consumerHeld: [...consumerHeld],
153
+ outsideTests,
154
+ workflows,
155
+ };
156
+ });
353
157
  }
354
158
  /**
355
159
  * The projects the run the scope and the configuration describe analyzes, each read
@@ -358,7 +162,11 @@ function readProjects(engine, host, scope, config, stage) {
358
162
  */
359
163
  export function runProjects(engine, host, scope, config) {
360
164
  const read = readProjects(engine, host, scope, config, (_project, opened) => opened.configuration);
361
- return { configurations: read.answers, notBuilt: read.notBuilt, unanswered: read.unanswered };
165
+ return {
166
+ configurations: read.result.answers,
167
+ notBuilt: read.classified.notBuilt,
168
+ unanswered: read.unanswered,
169
+ };
362
170
  }
363
171
  /**
364
172
  * The root set of the run the scope and the configuration describe.
@@ -369,7 +177,7 @@ export function runProjects(engine, host, scope, config) {
369
177
  export function runRoots(engine, host, scope, config, provenance) {
370
178
  const targetRoot = scope.target.path;
371
179
  const read = readProjects(engine, host, scope, config, (_project, opened) => opened.read());
372
- const projects = read.answers;
180
+ const projects = read.result.answers;
373
181
  const configurations = [];
374
182
  const merged = new Map();
375
183
  for (const answer of projects) {
@@ -397,28 +205,25 @@ export function runRoots(engine, host, scope, config, provenance) {
397
205
  }
398
206
  }
399
207
  }
400
- const ordered = [...merged.values()].sort((a, b) => byPosition(a.position, b.position) || compare(a.kind, b.kind) || compare(a.source, b.source));
401
- const unmatched = unmatchedEverywhere(config.rootPatterns, projects.map((answer) => answer.rooted));
208
+ const ordered = [...merged.values()].sort((a, b) => byPosition(a.position, b.position) ||
209
+ bytewise(a.kind, b.kind) ||
210
+ bytewise(a.source, b.source));
211
+ const unmatched = unmatchedEverywhere(config.roots.patterns, projects.map((answer) => answer.rooted));
402
212
  return {
403
213
  configurations,
404
214
  roots: ordered,
405
215
  findings: unmatchedRootFindings(unmatched, documentOf(host, provenance, ROOTS_SETTING, targetRoot)),
406
- notBuilt: read.notBuilt,
216
+ notBuilt: read.classified.notBuilt,
407
217
  unanswered: read.unanswered,
408
218
  };
409
219
  }
410
- /** The exemption classes this analyzer detects, each by its detector; any other retains nothing. */
411
- export const DETECTORS = new Map([
412
- ["interface-satisfaction", interfaceSatisfaction],
413
- ["enum-group", enumGroup],
414
- ["generated-file", generatedFile],
415
- ["template-field", templateField],
416
- ["reflective-lookup", reflectiveLookup],
417
- ["decorator", decorator],
418
- ["injection-container", injectionContainer],
419
- ["framework-lifecycle", frameworkLifecycle],
420
- ["serialization-contract", serializationContract],
421
- ]);
220
+ /** The production mode a configuration sets: a consumer's test reference is classed as `analysis.consumer_tests` says. */
221
+ export function productionMode(config) {
222
+ return {
223
+ production: true,
224
+ consumerTestsProduction: config.analysis.consumer_tests === "production",
225
+ };
226
+ }
422
227
  /** The manifest section of a package test evidence counts, and the sections that keep one out of it. */
423
228
  const DEV_SECTION = "devDependencies";
424
229
  const OTHER_SECTIONS = ["dependencies", "peerDependencies", "optionalDependencies"];
@@ -435,18 +240,9 @@ function testEvidence(host, targetRoot, projects) {
435
240
  }
436
241
  }
437
242
  const manifests = new Map();
438
- const manifestAt = (dir) => {
243
+ const manifestIn = (dir) => {
439
244
  if (!manifests.has(dir)) {
440
- let value;
441
- try {
442
- value = JSON.parse(host.readFile(joinPath(dir, "package.json")));
443
- }
444
- catch {
445
- value = undefined;
446
- }
447
- manifests.set(dir, typeof value === "object" && value !== null && !Array.isArray(value)
448
- ? value
449
- : undefined);
245
+ manifests.set(dir, manifestAt(host, dir));
450
246
  }
451
247
  return manifests.get(dir);
452
248
  };
@@ -455,16 +251,14 @@ function testEvidence(host, targetRoot, projects) {
455
251
  return {
456
252
  imports,
457
253
  devDependency: (path, name) => {
458
- for (let dir = dirnamePath(joinPath(root, path));; dir = dirnamePath(dir)) {
459
- const manifest = manifestAt(dir);
254
+ for (const dir of ancestors(dirnamePath(joinPath(root, path)), root)) {
255
+ const manifest = manifestIn(dir);
460
256
  const other = OTHER_SECTIONS.some((one) => declares(manifest?.[one], name));
461
257
  if (declares(manifest?.[DEV_SECTION], name) || other) {
462
258
  return !other;
463
259
  }
464
- if (normalizePath(dir) === normalizePath(root) || dirnamePath(dir) === dir) {
465
- return false;
466
- }
467
260
  }
261
+ return false;
468
262
  },
469
263
  };
470
264
  }
@@ -476,79 +270,103 @@ function testEvidence(host, targetRoot, projects) {
476
270
  */
477
271
  function readRun(engine, host, scope, config, mode, detectors, extra) {
478
272
  const targetRoot = scope.target.path;
479
- const disabled = disabledClasses(config);
480
- const templates = disabled.has("template-field")
481
- ? { delimiters: config.analysis.templateDelimiters, files: [] }
482
- : readTemplates(host, targetRoot, config.analysis);
483
273
  const consumers = scope.consumers.map((consumer) => consumer.path);
274
+ const detect = detection(host, targetRoot, config, consumers, detectors);
275
+ const directories = runDirectories(host, targetRoot, (fileName, text) => engine.parseSourceFile(fileName, text));
484
276
  const read = readProjects(engine, host, scope, config, (project, opened) => {
485
277
  const projectRead = opened.read();
278
+ const testFile = targetTestFile(projectRead.sources.testFiles);
486
279
  const resolved = references(project, projectRead.held, targetRoot, {
487
- testFiles: config.ts.testFiles,
488
- testFileNames: projectRead.testFileNames,
280
+ testFile,
281
+ directories,
282
+ formedForNode: projectRead.formedForNode,
489
283
  });
490
- const evidence = evidenceRecords({
491
- project,
492
- held: projectRead.held,
493
- targetRoot,
494
- templates,
495
- ts: config.ts,
496
- consumers,
497
- ...(config.analysis.generatedFiles === "include"
498
- ? {}
499
- : { generated: projectRead.generated }),
500
- }, detectors, disabled);
284
+ const testFiles = testFilePaths(project, targetRoot, testFile);
285
+ const evidence = detect({ project, held: projectRead.held, generated: projectRead.generated });
501
286
  const components = project.ownSourceFiles().filter(isComponentFile);
287
+ const injected = project.program
288
+ .getSourceFileNames()
289
+ .some((name) => name.endsWith(`/node_modules/${GLOBALS_RUNNER}/globals.d.ts`));
502
290
  const pathOf = (file) => relativePath(targetRoot, file.fileName) ?? file.fileName;
503
291
  return {
504
292
  projectRead,
505
293
  references: resolved.references,
506
- testFiles: resolved.testFilePaths,
294
+ held: resolved.held,
295
+ possiblyLoaded: resolved.possiblyLoaded,
296
+ testFiles,
507
297
  evidence,
508
298
  componentFiles: components.map(pathOf),
509
299
  imports: new Map(project.ownSourceFiles().flatMap((file) => {
510
300
  const path = relativePath(targetRoot, file.fileName);
511
- return path === undefined
512
- ? []
513
- : [[path, file.imports.filter(isStringLiteralLikeNode).map((one) => one.text)]];
301
+ if (path === undefined) {
302
+ return [];
303
+ }
304
+ const specifiers = file.imports.filter(isStringLiteralLikeNode).map((one) => one.text);
305
+ // A file calling the globals a program declares is written for their runner.
306
+ return [
307
+ [
308
+ path,
309
+ injected && namesTestGlobals(project, file)
310
+ ? [...specifiers, GLOBALS_RUNNER]
311
+ : specifiers,
312
+ ],
313
+ ];
514
314
  })),
515
315
  componentWarnings: components.flatMap((file) => readComponent(file.originalText, extensionOf(file.fileName)).warnings.map((warning) => ({
516
316
  path: pathOf(file),
517
317
  line: lineOf(file.originalText, warning.offset),
518
318
  reason: warning.reason,
519
319
  }))),
520
- extra: extra(project, projectRead, resolved.references, resolved.testFilePaths),
320
+ decoded: decodedMembers(project, projectRead.held, productionFiles(project, targetRoot, testFiles), consumers),
321
+ extra: extra(project, projectRead, resolved.references, testFiles, resolved.unseenLoads.map((position) => ({
322
+ configuration: projectRead.configuration,
323
+ position,
324
+ }))),
521
325
  };
522
326
  });
523
- const outsidePaths = read.outsideTests.map((one) => one.path);
524
- const withOutside = read.answers.map((one) => ({
327
+ const outsidePaths = read.result.outsideTests.map((one) => one.path);
328
+ const withOutside = read.result.answers.map((one) => ({
525
329
  ...one,
526
330
  references: [
527
331
  ...one.references,
528
- ...outsideTestReferences(read.outsideTests, one.projectRead.held, targetRoot),
332
+ ...outsideTestReferences(read.result.outsideTests, one.projectRead.held, targetRoot),
529
333
  ],
530
334
  testFiles: [...one.testFiles, ...outsidePaths],
531
335
  }));
532
336
  // Test-support code is code only test code imports in any configuration of the run: a
533
337
  // configuration that holds no test file says nothing about what the tests import.
534
- const { support, testUsed } = testSupportFiles(withOutside.flatMap((one) => one.projectRead.held.symbols), withOutside.flatMap((one) => one.references), withOutside.flatMap((one) => one.projectRead.rooted.liveUnderReachability), withOutside.flatMap((one) => one.testFiles), testEvidence(host, targetRoot, withOutside));
535
- const settled = settledSatisfaction(withOutside.map((one) => ({ evidence: one.evidence, held: one.projectRead.held })), [...withOutside.flatMap((one) => one.references), ...read.consumers.references]);
338
+ const { support, testUsed } = testSupportFiles(withOutside.flatMap((one) => one.projectRead.held.symbols), withOutside.flatMap((one) => one.references),
339
+ // An outside declaration naming a global augmentation calls nothing of its file.
340
+ withOutside.flatMap((one) => one.projectRead.rooted.liveUnderReachability.filter((root) => root.kind !== "global-augmentation")), withOutside.flatMap((one) => one.testFiles), testEvidence(host, targetRoot, withOutside));
341
+ // A member a decode fills or a copy carries is written: a value decoded and sent again carries it on.
342
+ const written = new Set([
343
+ ...countedWrites([...withOutside.flatMap((one) => one.references), ...read.result.references], support, mode),
344
+ ...withOutside.flatMap((one) => [
345
+ ...one.decoded.filled,
346
+ ...one.decoded.parsed,
347
+ ...one.decoded.copied,
348
+ ]),
349
+ ]);
350
+ const settled = settle(withOutside.map((one) => ({
351
+ records: one.evidence,
352
+ held: one.projectRead.held,
353
+ testFiles: new Set([...one.testFiles, ...support]),
354
+ })), {
355
+ references: [...withOutside.flatMap((one) => one.references), ...read.result.references],
356
+ written,
357
+ mode,
358
+ });
536
359
  const answers = withOutside.map((one, index) => {
537
360
  const { projectRead } = one;
538
- const satisfied = settled[index];
539
- const detected = heldRecords(satisfied?.evidence ?? one.evidence, {
540
- mode,
541
- testFiles: new Set([...one.testFiles, ...support]),
542
- });
543
- const exempt = detected.records;
544
- const made = supportReferences([...one.references, ...(satisfied?.references ?? [])], support);
361
+ const exempt = settled[index]?.records ?? [];
362
+ const made = [...one.references, ...(settled[index]?.references ?? [])];
545
363
  const held = new Set(projectRead.held.symbols.map((symbol) => symbol.position.path));
546
- const supportFiles = [...support].filter((path) => held.has(path)).sort();
547
- const testUsedFiles = [...testUsed].filter((path) => held.has(path)).sort();
364
+ const supportFiles = [...support].filter((path) => held.has(path)).sort(bytewise);
365
+ const testUsedFiles = [...testUsed].filter((path) => held.has(path)).sort(bytewise);
548
366
  const configured = {
549
367
  configuration: projectRead.configuration,
550
368
  symbols: projectRead.held.symbols,
551
- references: [...made, ...evidenceReferences(projectRead.held.symbols, detected.inTestFiles)],
369
+ references: made,
552
370
  roots: projectRead.rooted.liveUnderReachability,
553
371
  testFiles: [...one.testFiles, ...supportFiles],
554
372
  ...(supportFiles.length === 0 ? {} : { supportFiles }),
@@ -568,20 +386,23 @@ function readRun(engine, host, scope, config, mode, detectors, extra) {
568
386
  unanswered: [
569
387
  ...projectRead.held.unanswered,
570
388
  ...projectRead.rooted.unanswered,
571
- ...made
572
- .filter((reference) => reference.resolution === "by-name")
573
- .map((reference) => reference.to),
574
- ...exempt.filter(isUnansweredRecord).map((record) => record.id),
389
+ ...made.filter((reference) => reference.guessed === true).map((reference) => reference.to),
390
+ ...one.held,
391
+ ...exempt.filter((record) => record.unanswered === true).map((record) => record.id),
392
+ ...one.decoded.unanswered,
575
393
  ],
394
+ filledOutside: one.decoded.filled,
395
+ possiblyLoaded: one.possiblyLoaded,
576
396
  typeErrorSkips: projectRead.typeErrorSkips,
577
397
  unmappedEntries: projectRead.rooted.unmappedEntries,
398
+ heldScripts: projectRead.rooted.heldScripts,
578
399
  skipped: projectRead.skipped,
579
400
  componentFiles: one.componentFiles,
580
401
  componentWarnings: one.componentWarnings,
581
402
  extra: one.extra,
582
403
  };
583
404
  });
584
- const consumed = read.consumers.references;
405
+ const consumed = read.result.references;
585
406
  const projects = answers.map((one) => consumed.length === 0
586
407
  ? one
587
408
  : {
@@ -597,70 +418,32 @@ function readRun(engine, host, scope, config, mode, detectors, extra) {
597
418
  unansweredHeld: [
598
419
  ...new Set([
599
420
  ...answers.flatMap((one) => one.unanswered),
600
- ...consumed.filter((one) => one.resolution === "by-name").map((one) => one.to),
421
+ ...consumed.filter((one) => one.guessed === true).map((one) => one.to),
422
+ ...read.result.consumerHeld,
601
423
  ]),
602
424
  ],
603
425
  projects,
604
- consumers: read.consumers.loaded,
605
- notBuilt: read.notBuilt,
426
+ consumers: read.plan.discovery.consumers,
427
+ declaresConsumers: scope.consumers.length > 0,
428
+ notBuilt: read.classified.notBuilt,
606
429
  unanswered: read.unanswered,
607
- componentsUnread: read.componentsUnread,
608
- librariesUnfound: read.librariesUnfound,
609
- conventionsApplied: read.conventionsApplied,
610
- conventionUses: read.conventionUses,
611
- memberDirs: read.memberDirs,
612
- nestedDirs: read.nestedDirs,
430
+ componentsUnread: read.plan.workspace?.componentsUnread ?? [],
431
+ librariesUnfound: read.classified.librariesUnfound,
432
+ unresolvedSpecifiers: read.classified.unresolvedSpecifiers,
433
+ unread: read.plan.unread,
434
+ conventionsApplied: read.plan.conventions.applied,
435
+ conventionUses: read.plan.conventions.uses,
436
+ memberDirs: read.plan.packages.members,
437
+ nestedDirs: read.plan.packages.nested,
438
+ workflows: read.result.workflows,
613
439
  };
614
440
  }
615
441
  /**
616
- * The run swept under one set of marks with the records that hold. A record a component
617
- * file's markup holds counts only while the file is live, and what it holds may be what
618
- * keeps the file live, so each file's markup joins only once a sweep without it finds the
619
- * file live, until a sweep finds no further file live.
620
- */
621
- function holdingSweep(read, input) {
622
- const paths = new Set(read.exempt.flatMap((record) => record.whileLive ?? []));
623
- let live = new Set();
624
- for (;;) {
625
- const swept = {
626
- ...input,
627
- exempt: holdingWhile(read.exempt, live),
628
- unanswered: read.unansweredHeld,
629
- };
630
- const result = sweepMatrix(read.matrix, swept);
631
- const next = new Set(liveFilesAt(read.matrix, result, paths).map((one) => one.position.path));
632
- if (next.size === live.size) {
633
- return { swept, result };
634
- }
635
- live = next;
636
- }
637
- }
638
- /**
639
- * The test references exemption evidence written in a test file makes: each is a read of
640
- * the declaration it would retain, made by the test file at the evidence's site.
442
+ * The declarations a write the mode counts stores into, a write a test-support file
443
+ * makes being a test's.
641
444
  */
642
- function evidenceReferences(symbols, inTestFiles) {
643
- if (inTestFiles.length === 0) {
644
- return [];
645
- }
646
- const files = new Map(symbols
647
- .filter((symbol) => symbol.kind === "file")
648
- .map((symbol) => [symbol.position.path, symbol.id]));
649
- return inTestFiles.flatMap((record) => {
650
- const from = files.get(record.site.path);
651
- return from === undefined
652
- ? []
653
- : [
654
- {
655
- from,
656
- to: record.id,
657
- position: record.site,
658
- use: "read",
659
- resolution: "syntax",
660
- test: true,
661
- },
662
- ];
663
- });
445
+ function countedWrites(references, support, mode) {
446
+ return new Set(references.flatMap((reference) => reference.use === "write" && !withheldBy(mode, reference, support) ? [reference.to] : []));
664
447
  }
665
448
  /**
666
449
  * The declarations every reference the mode counts stores into, a loaded consumer's
@@ -670,8 +453,9 @@ function writtenOnly(read, mode) {
670
453
  const written = new Set();
671
454
  const readSome = new Set();
672
455
  for (const { configured } of read.projects) {
456
+ const support = new Set(configured.supportFiles ?? []);
673
457
  for (const reference of configured.references) {
674
- if (mode.production && reference.test) {
458
+ if (withheldBy(mode, reference, support)) {
675
459
  continue;
676
460
  }
677
461
  if (reference.use === "write" && reference.consumer === undefined) {
@@ -684,55 +468,22 @@ function writtenOnly(read, mode) {
684
468
  }
685
469
  return new Set([...written].filter((id) => !readSome.has(id)));
686
470
  }
687
- /**
688
- * The sweep of a run read once, under one set of marks. Where a question went unanswered,
689
- * the run is swept once more without what that question could have kept live and without
690
- * the references that stood in for its answer, and every declaration that sweep judges
691
- * dead and this one judges live, or dead by another rule, is held by the gap too, as is
692
- * every declaration that makes such a reference.
693
- */
471
+ /** The sweep of a run read once, under one set of marks. */
694
472
  function sweptOf(read, input) {
695
- const { swept, result } = holdingSweep(read, input);
696
- const exempt = swept.exempt ?? [];
697
- const held = new Set(read.unansweredHeld);
698
- if (held.size > 0) {
699
- // What a declaration reads where the checker did not answer is unknown, so a rule
700
- // over what it reads, the test of dead code among them, cannot judge it.
701
- for (const { configured } of read.projects) {
702
- for (const reference of configured.references) {
703
- if (reference.resolution === "by-name") {
704
- held.add(reference.from);
705
- }
706
- }
707
- }
708
- const dead = new Map(result.candidates.map((candidate) => [candidate.id, candidate]));
709
- const answered = matrixOf(read.projects.map(({ configured }) => ({
710
- ...configured,
711
- references: configured.references.filter((one) => one.resolution !== "by-name"),
712
- })));
713
- const bare = {
714
- ...swept,
715
- exempt: exempt.filter((record) => !isUnansweredRecord(record)),
716
- unanswered: [],
717
- };
718
- for (const candidate of sweepMatrix(answered, bare).candidates) {
719
- const kept = dead.get(candidate.id);
720
- if (kept?.testOfDeadCode !== candidate.testOfDeadCode ||
721
- kept.relation !== candidate.relation) {
722
- held.add(candidate.id);
723
- }
724
- }
725
- }
473
+ const componentFiles = [...new Set(read.projects.flatMap((one) => one.componentFiles))].sort(bytewise);
726
474
  return {
727
475
  matrix: read.matrix,
728
- sweep: result,
729
- exempt,
730
- retained: retainedIn(read.matrix, swept, writtenOnly(read, input.mode)),
476
+ sweep: sweep(read.matrix, {
477
+ ...input,
478
+ exempt: read.exempt,
479
+ unanswered: read.unansweredHeld,
480
+ componentFiles,
481
+ unseenCallers: !read.declaresConsumers,
482
+ writeOnly: writtenOnly(read, input.mode),
483
+ }),
731
484
  notBuilt: read.notBuilt,
732
485
  unanswered: read.unanswered,
733
- heldByUnanswered: [...held],
734
486
  skipped: read.projects.flatMap((one) => one.skipped),
735
- componentFiles: [...new Set(read.projects.flatMap((one) => one.componentFiles))].sort(compare),
736
487
  };
737
488
  }
738
489
  /**
@@ -746,23 +497,32 @@ function sweptOf(read, input) {
746
497
  export function runSweep(engine, host, scope, config, input, detectors = DETECTORS) {
747
498
  return sweptOf(readRun(engine, host, scope, config, input.mode, detectors, () => undefined), input);
748
499
  }
500
+ /** The project's own files below the target root that are no test file. */
501
+ function productionFiles(project, targetRoot, testFiles) {
502
+ const tests = new Set(testFiles);
503
+ return [...sourceFilesOf(project, targetRoot).byPath].flatMap(([path, file]) => tests.has(path) ? [] : [file]);
504
+ }
749
505
  /** Reads a run's projects with every per-project fact an emitter reads. */
750
506
  export function readEmitterRun(engine, host, scope, config, mode, detectors) {
751
507
  const targetRoot = scope.target.path;
752
- const run = readRun(engine, host, scope, config, mode, detectors, (project, read, references, testFiles) => ({
508
+ const run = readRun(engine, host, scope, config, mode, detectors, (project, read, references, testFiles, unseenLoads) => ({
753
509
  deprecation: deprecatedDeclarations(project, read.held),
754
510
  accessors: accessorsOf(project, read.held),
755
- needs: projectNeeds(project, read.held, host, targetRoot, (fileName, text) => engine.parseSourceFile(fileName, text)),
511
+ needs: projectNeeds(project, read.held, host, targetRoot, (fileName, text) => engine.parseSourceFile(fileName, text), read.sources.configuration, read.sources.workflows),
756
512
  implementations: implementations(project, read.held),
757
513
  heldByInclusion: heldByInclusion(project, targetRoot),
758
- generated: [...read.generated.keys()],
514
+ generated: read.generated,
515
+ bindings: read.bindings,
759
516
  inOperands: inOperandNames(project, targetRoot, testFiles),
760
517
  rooted: read.rooted,
761
518
  directives: inlineDirectives(project, read.held, targetRoot).filter((directive) => !read.referenceOnly.includes(directive.site.path)),
762
519
  declarationsNamed: declarationsNamed(project, read.held, configuredDeclarations(config)),
763
520
  parts: projectParts(project, read.held, references, targetRoot),
521
+ unseenLoads,
522
+ // Only a closed world reports an unnecessary export, which is all the carriers decide.
523
+ carriers: config.consumers.complete ? carriersOf(project, read.held) : NO_CARRIERS,
764
524
  }));
765
- // Whether a declaration carries the marker decides its code, so one whose marker went
525
+ // Whether a declaration carries the marker decides its code, so one whose answer went
766
526
  // unread is reported by nothing.
767
527
  const unread = run.projects.flatMap((one) => one.extra.deprecation.unanswered);
768
528
  return unread.length === 0
@@ -805,16 +565,11 @@ function judgedMembers(host, targetRoot, read) {
805
565
  }
806
566
  /** The directory of the nearest `package.json` at or above a file, inside `root`, else `root`. */
807
567
  function nearestManifestDir(host, root, file) {
808
- for (let dir = dirnamePath(file); relativePath(root, dir) !== undefined; dir = dirnamePath(dir)) {
809
- if (host.kindOf(joinPath(dir, "package.json")) === "file") {
810
- return dir;
811
- }
812
- }
813
- return root;
568
+ return ancestors(dirnamePath(file), root).find((dir) => holdsManifest(host, dir)) ?? root;
814
569
  }
815
570
  /**
816
571
  * The input every emitter reads over one sweep of a read run: the facts beside the sweep
817
- * each kind family reads, every per-project one read in the same session as the sweep.
572
+ * each emitter reads, every per-project one read in the same session as the sweep.
818
573
  */
819
574
  export function emitterInputOver(host, scope, config, read, input, selfCheck) {
820
575
  const targetRoot = scope.target.path;
@@ -827,15 +582,20 @@ export function emitterInputOver(host, scope, config, read, input, selfCheck) {
827
582
  deprecated: new Set(projects.flatMap((one) => one.extra.deprecation.deprecated)),
828
583
  stores: storesOf(projects.map((one) => ({
829
584
  references: one.configured.references,
585
+ support: new Set(one.configured.supportFiles ?? []),
830
586
  accessors: one.extra.accessors,
831
- })), swept.exempt, input.mode),
832
- dependencies: dependenciesOf(host, targetRoot, [...projects.map((one) => one.extra.needs), configurationNeeds(read.conventionUses)], swept.sweep.candidates.map((candidate) => candidate.id), members.read, members.unbuilt, read.nestedDirs),
587
+ })), swept.sweep.exempt, input.mode),
588
+ dependencies: dependenciesOf(host, targetRoot, read.workflows, [...projects.map((one) => one.extra.needs), configurationNeeds(read.conventionUses)], swept.sweep.candidates.map((candidate) => candidate.id), members.read, members.unbuilt, read.nestedDirs),
833
589
  implementations: mergeImplementations(projects.map((one) => one.extra.implementations)),
834
590
  files: {
835
591
  tree: sourceTree(host, targetRoot),
836
592
  heldByInclusion: new Set(projects.flatMap((one) => one.extra.heldByInclusion)),
837
- generated: new Set(projects.flatMap((one) => one.extra.generated)),
593
+ generated: new Set(projects.flatMap((one) => [...one.extra.generated.keys()])),
838
594
  inOperands: new Set(projects.flatMap((one) => one.extra.inOperands)),
595
+ unseenLoads: projects.flatMap((one) => one.extra.unseenLoads),
596
+ unwrittenRuns: new Set(projects.flatMap((one) => one.heldScripts
597
+ .filter((held) => held.unwritten)
598
+ .map((held) => relativePath(resolvePath(host.workingDirectory(), targetRoot), held.dir) ?? "."))),
839
599
  },
840
600
  boundary: {
841
601
  consumers: {
@@ -844,9 +604,17 @@ export function emitterInputOver(host, scope, config, read, input, selfCheck) {
844
604
  },
845
605
  encapsulated: readManifest(host, targetRoot).declaresExports,
846
606
  edges: readEdgeSides(host, targetRoot),
607
+ filledOutside: new Set(projects.flatMap((one) => one.filledOutside)),
608
+ possiblyLoaded: new Set(projects.flatMap((one) => one.possiblyLoaded)),
609
+ carriers: {
610
+ named: new Map([
611
+ ...Map.groupBy(projects.flatMap((one) => [...one.extra.carriers.named]), ([id]) => id),
612
+ ].map(([id, entries]) => [id, [...new Set(entries.flatMap(([, named]) => named))]])),
613
+ unread: new Set(projects.flatMap((one) => [...one.extra.carriers.unread])),
614
+ },
847
615
  },
848
616
  selfCheck,
849
- intraFunction: intraFunctionFacts(projects.map((one) => one.extra.parts), projects.flatMap((one) => one.configured.references), new Set([...swept.exempt.map((one) => one.id), ...swept.heldByUnanswered])),
617
+ intraFunction: intraFunctionFacts(projects.map((one) => one.extra.parts), projects.flatMap((one) => one.configured.references), new Set([...swept.sweep.exempt.map((one) => one.id), ...swept.sweep.held])),
850
618
  };
851
619
  }
852
620
  /**
@@ -854,7 +622,7 @@ export function emitterInputOver(host, scope, config, read, input, selfCheck) {
854
622
  * directives, the ignore file's entries and the baseline's rows are bound before any
855
623
  * sweep, and the run is swept once under every bound record's mark and once under none,
856
624
  * so a record is decided against the finding its code would have produced. The
857
- * self-check family reports the refused suppressions and the roots that named nothing.
625
+ * configuration family reports the refused suppressions and the roots that named nothing.
858
626
  * Beside the inputs it answers the projects and test-file rules a report names.
859
627
  */
860
628
  function readAnalysis(engine, host, scope, config, provenance, mode, detectors) {
@@ -872,7 +640,7 @@ function readAnalysis(engine, host, scope, config, provenance, mode, detectors)
872
640
  id: one.configured.configuration,
873
641
  configFile: one.configFile,
874
642
  })),
875
- testFileRules: testFileRulesOf(config.ts.testFiles, read.projects.flatMap((one) => one.configured.testFiles), read.projects.flatMap((one) => one.configured.supportFiles ?? [])),
643
+ testFileRules: testFileRulesOf(config.ts.test_files, read.projects.flatMap((one) => one.configured.testFiles), read.projects.flatMap((one) => one.configured.supportFiles ?? [])),
876
644
  typeErrorSkips: read.projects.flatMap((one) => one.typeErrorSkips),
877
645
  componentWarnings: [
878
646
  ...new Map(read.projects
@@ -884,8 +652,14 @@ function readAnalysis(engine, host, scope, config, provenance, mode, detectors)
884
652
  unanswered: read.unanswered,
885
653
  componentsUnread: read.componentsUnread,
886
654
  librariesUnfound: read.librariesUnfound,
655
+ unresolvedSpecifiers: read.unresolvedSpecifiers,
656
+ unread: read.unread,
887
657
  conventionsApplied: read.conventionsApplied,
888
658
  unmappedEntries: unmappedEverywhere(read.projects),
659
+ heldScripts: read.projects.flatMap((one) => one.heldScripts.map((held) => ({ ...held, configFile: one.configFile }))),
660
+ unseenLoads: read.projects.flatMap((one) => one.extra.unseenLoads),
661
+ generated: new Map(read.projects.flatMap((one) => [...one.extra.generated])),
662
+ bindings: distinctBindings(read.projects.flatMap((one) => one.extra.bindings)),
889
663
  },
890
664
  configured: read.projects.map((one) => one.configured),
891
665
  symbols,
@@ -901,7 +675,7 @@ function inputsOver(host, scope, config, provenance, mode, read, documents) {
901
675
  };
902
676
  const facts = {
903
677
  refusals: suppressions.refusals,
904
- unmatchedRoots: unmatchedEverywhere(config.rootPatterns, read.projects.map((one) => one.extra.rooted)),
678
+ unmatchedRoots: unmatchedEverywhere(config.roots.patterns, read.projects.map((one) => one.extra.rooted)),
905
679
  rootsDocument: documentOf(host, provenance, ROOTS_SETTING, targetRoot),
906
680
  unmatchedDeclarations: configuredDeclarations(config)
907
681
  .filter((_, at) => !read.projects.some((one) => one.extra.declarationsNamed[at] === true))
@@ -937,7 +711,7 @@ function unmappedEverywhere(projects) {
937
711
  }
938
712
  /**
939
713
  * The analysis of the run the scope and the configuration describe: the run read with its
940
- * suppressions bound, every family's findings with the suppressions applied and the
714
+ * suppressions bound, every emitter's findings with the suppressions applied and the
941
715
  * declared edges evaluated, the projects and test-file rules the report names, and the sweep
942
716
  * an explanation reads.
943
717
  */
@@ -948,12 +722,16 @@ export function runAnalysis(engine, host, scope, config, provenance, mode, detec
948
722
  }
949
723
  /**
950
724
  * One count per configuration of the run in which the checker left a question unanswered:
951
- * the questions asked in its project, and the declarations of its own the run holds for them.
725
+ * the questions asked in its project, a formed program's manifest that does not parse or cannot
726
+ * be read and a package whose command strings name files the project holds each counted as one, and the
727
+ * declarations of its own the run holds for them.
952
728
  */
953
729
  export function unansweredCounts(analysis) {
954
- const held = new Set(analysis.swept.heldByUnanswered);
730
+ const held = new Set(analysis.swept.sweep.held);
955
731
  return analysis.run.projects.flatMap((project) => {
956
- const questions = analysis.run.unanswered.filter((one) => one.configFile === project.configFile).length;
732
+ const questions = analysis.run.unanswered.filter((one) => one.configFile === project.configFile).length +
733
+ analysis.run.unread.filter((one) => one.kind === "manifest" && one.configFile === project.configFile).length +
734
+ analysis.run.heldScripts.filter((one) => one.configFile === project.configFile && one.files.length > 0).length;
957
735
  if (questions === 0) {
958
736
  return [];
959
737
  }