@endora-commerce/cli 0.100.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 (356) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/dist/bin/endora.d.ts +28 -0
  4. package/dist/bin/endora.d.ts.map +1 -0
  5. package/dist/bin/endora.js +926 -0
  6. package/dist/bin/endora.js.map +1 -0
  7. package/dist/check/estate.d.ts +189 -0
  8. package/dist/check/estate.d.ts.map +1 -0
  9. package/dist/check/estate.js +1037 -0
  10. package/dist/check/estate.js.map +1 -0
  11. package/dist/check/hosts.d.ts +25 -0
  12. package/dist/check/hosts.d.ts.map +1 -0
  13. package/dist/check/hosts.js +1347 -0
  14. package/dist/check/hosts.js.map +1 -0
  15. package/dist/check/index.d.ts +60 -0
  16. package/dist/check/index.d.ts.map +1 -0
  17. package/dist/check/index.js +111 -0
  18. package/dist/check/index.js.map +1 -0
  19. package/dist/check/layout.d.ts +136 -0
  20. package/dist/check/layout.d.ts.map +1 -0
  21. package/dist/check/layout.js +262 -0
  22. package/dist/check/layout.js.map +1 -0
  23. package/dist/check/ledger.d.ts +98 -0
  24. package/dist/check/ledger.d.ts.map +1 -0
  25. package/dist/check/ledger.js +173 -0
  26. package/dist/check/ledger.js.map +1 -0
  27. package/dist/check/peer-owners.d.ts +116 -0
  28. package/dist/check/peer-owners.d.ts.map +1 -0
  29. package/dist/check/peer-owners.js +225 -0
  30. package/dist/check/peer-owners.js.map +1 -0
  31. package/dist/check/report.d.ts +33 -0
  32. package/dist/check/report.d.ts.map +1 -0
  33. package/dist/check/report.js +107 -0
  34. package/dist/check/report.js.map +1 -0
  35. package/dist/check/run.d.ts +147 -0
  36. package/dist/check/run.d.ts.map +1 -0
  37. package/dist/check/run.js +111 -0
  38. package/dist/check/run.js.map +1 -0
  39. package/dist/checks.d.ts +17 -0
  40. package/dist/checks.d.ts.map +1 -0
  41. package/dist/checks.js +17 -0
  42. package/dist/checks.js.map +1 -0
  43. package/dist/dev/index.d.ts +83 -0
  44. package/dist/dev/index.d.ts.map +1 -0
  45. package/dist/dev/index.js +298 -0
  46. package/dist/dev/index.js.map +1 -0
  47. package/dist/generate/divergence.d.ts +38 -0
  48. package/dist/generate/divergence.d.ts.map +1 -0
  49. package/dist/generate/divergence.js +237 -0
  50. package/dist/generate/divergence.js.map +1 -0
  51. package/dist/generate/index.d.ts +90 -0
  52. package/dist/generate/index.d.ts.map +1 -0
  53. package/dist/generate/index.js +369 -0
  54. package/dist/generate/index.js.map +1 -0
  55. package/dist/index.d.ts +23 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +35 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/inputs/declaration.d.ts +18 -0
  60. package/dist/inputs/declaration.d.ts.map +1 -0
  61. package/dist/inputs/declaration.js +64 -0
  62. package/dist/inputs/declaration.js.map +1 -0
  63. package/dist/inputs/env-file.d.ts +73 -0
  64. package/dist/inputs/env-file.d.ts.map +1 -0
  65. package/dist/inputs/env-file.js +134 -0
  66. package/dist/inputs/env-file.js.map +1 -0
  67. package/dist/inputs/prompt.d.ts +21 -0
  68. package/dist/inputs/prompt.d.ts.map +1 -0
  69. package/dist/inputs/prompt.js +59 -0
  70. package/dist/inputs/prompt.js.map +1 -0
  71. package/dist/inputs/resolve.d.ts +163 -0
  72. package/dist/inputs/resolve.d.ts.map +1 -0
  73. package/dist/inputs/resolve.js +290 -0
  74. package/dist/inputs/resolve.js.map +1 -0
  75. package/dist/install/host.d.ts +27 -0
  76. package/dist/install/host.d.ts.map +1 -0
  77. package/dist/install/host.js +90 -0
  78. package/dist/install/host.js.map +1 -0
  79. package/dist/install/index.d.ts +173 -0
  80. package/dist/install/index.d.ts.map +1 -0
  81. package/dist/install/index.js +793 -0
  82. package/dist/install/index.js.map +1 -0
  83. package/dist/install/wizard.d.ts +144 -0
  84. package/dist/install/wizard.d.ts.map +1 -0
  85. package/dist/install/wizard.js +362 -0
  86. package/dist/install/wizard.js.map +1 -0
  87. package/dist/lib/admin-artefacts.d.ts +70 -0
  88. package/dist/lib/admin-artefacts.d.ts.map +1 -0
  89. package/dist/lib/admin-artefacts.js +354 -0
  90. package/dist/lib/admin-artefacts.js.map +1 -0
  91. package/dist/lib/admin-surfaces.d.ts +298 -0
  92. package/dist/lib/admin-surfaces.d.ts.map +1 -0
  93. package/dist/lib/admin-surfaces.js +669 -0
  94. package/dist/lib/admin-surfaces.js.map +1 -0
  95. package/dist/lib/delegated-composer.d.ts +85 -0
  96. package/dist/lib/delegated-composer.d.ts.map +1 -0
  97. package/dist/lib/delegated-composer.js +241 -0
  98. package/dist/lib/delegated-composer.js.map +1 -0
  99. package/dist/lib/divergence-artefacts.d.ts +305 -0
  100. package/dist/lib/divergence-artefacts.d.ts.map +1 -0
  101. package/dist/lib/divergence-artefacts.js +828 -0
  102. package/dist/lib/divergence-artefacts.js.map +1 -0
  103. package/dist/lib/divergence.d.ts +337 -0
  104. package/dist/lib/divergence.d.ts.map +1 -0
  105. package/dist/lib/divergence.js +1005 -0
  106. package/dist/lib/divergence.js.map +1 -0
  107. package/dist/lib/docs-artefacts.d.ts +395 -0
  108. package/dist/lib/docs-artefacts.d.ts.map +1 -0
  109. package/dist/lib/docs-artefacts.js +781 -0
  110. package/dist/lib/docs-artefacts.js.map +1 -0
  111. package/dist/lib/emitted-exports.d.ts +21 -0
  112. package/dist/lib/emitted-exports.d.ts.map +1 -0
  113. package/dist/lib/emitted-exports.js +96 -0
  114. package/dist/lib/emitted-exports.js.map +1 -0
  115. package/dist/lib/emitted-freshness.d.ts +112 -0
  116. package/dist/lib/emitted-freshness.d.ts.map +1 -0
  117. package/dist/lib/emitted-freshness.js +288 -0
  118. package/dist/lib/emitted-freshness.js.map +1 -0
  119. package/dist/lib/entity-index-artefact.d.ts +95 -0
  120. package/dist/lib/entity-index-artefact.d.ts.map +1 -0
  121. package/dist/lib/entity-index-artefact.js +210 -0
  122. package/dist/lib/entity-index-artefact.js.map +1 -0
  123. package/dist/lib/instance-build-inputs.d.ts +108 -0
  124. package/dist/lib/instance-build-inputs.d.ts.map +1 -0
  125. package/dist/lib/instance-build-inputs.js +165 -0
  126. package/dist/lib/instance-build-inputs.js.map +1 -0
  127. package/dist/lib/module-docs.d.ts +473 -0
  128. package/dist/lib/module-docs.d.ts.map +1 -0
  129. package/dist/lib/module-docs.js +711 -0
  130. package/dist/lib/module-docs.js.map +1 -0
  131. package/dist/lib/module-package-subpaths.d.ts +56 -0
  132. package/dist/lib/module-package-subpaths.d.ts.map +1 -0
  133. package/dist/lib/module-package-subpaths.js +223 -0
  134. package/dist/lib/module-package-subpaths.js.map +1 -0
  135. package/dist/lib/module-packages.d.ts +200 -0
  136. package/dist/lib/module-packages.d.ts.map +1 -0
  137. package/dist/lib/module-packages.js +580 -0
  138. package/dist/lib/module-packages.js.map +1 -0
  139. package/dist/lib/module-population.d.ts +129 -0
  140. package/dist/lib/module-population.d.ts.map +1 -0
  141. package/dist/lib/module-population.js +172 -0
  142. package/dist/lib/module-population.js.map +1 -0
  143. package/dist/lib/module-roots.d.ts +337 -0
  144. package/dist/lib/module-roots.d.ts.map +1 -0
  145. package/dist/lib/module-roots.js +586 -0
  146. package/dist/lib/module-roots.js.map +1 -0
  147. package/dist/lib/nested-checkouts.d.ts +33 -0
  148. package/dist/lib/nested-checkouts.d.ts.map +1 -0
  149. package/dist/lib/nested-checkouts.js +160 -0
  150. package/dist/lib/nested-checkouts.js.map +1 -0
  151. package/dist/lib/platform-root.d.ts +43 -0
  152. package/dist/lib/platform-root.d.ts.map +1 -0
  153. package/dist/lib/platform-root.js +134 -0
  154. package/dist/lib/platform-root.js.map +1 -0
  155. package/dist/lib/platform-surface.d.ts +235 -0
  156. package/dist/lib/platform-surface.d.ts.map +1 -0
  157. package/dist/lib/platform-surface.js +393 -0
  158. package/dist/lib/platform-surface.js.map +1 -0
  159. package/dist/lib/port-registrations.d.ts +223 -0
  160. package/dist/lib/port-registrations.d.ts.map +1 -0
  161. package/dist/lib/port-registrations.js +532 -0
  162. package/dist/lib/port-registrations.js.map +1 -0
  163. package/dist/lib/read-size.d.ts +154 -0
  164. package/dist/lib/read-size.d.ts.map +1 -0
  165. package/dist/lib/read-size.js +182 -0
  166. package/dist/lib/read-size.js.map +1 -0
  167. package/dist/lib/registration-owners.d.ts +79 -0
  168. package/dist/lib/registration-owners.d.ts.map +1 -0
  169. package/dist/lib/registration-owners.js +77 -0
  170. package/dist/lib/registration-owners.js.map +1 -0
  171. package/dist/lib/release-index.d.ts +53 -0
  172. package/dist/lib/release-index.d.ts.map +1 -0
  173. package/dist/lib/release-index.js +162 -0
  174. package/dist/lib/release-index.js.map +1 -0
  175. package/dist/lib/repeating-timers.d.ts +79 -0
  176. package/dist/lib/repeating-timers.d.ts.map +1 -0
  177. package/dist/lib/repeating-timers.js +189 -0
  178. package/dist/lib/repeating-timers.js.map +1 -0
  179. package/dist/lib/source-text.d.ts +34 -0
  180. package/dist/lib/source-text.d.ts.map +1 -0
  181. package/dist/lib/source-text.js +80 -0
  182. package/dist/lib/source-text.js.map +1 -0
  183. package/dist/lib/specifiers.d.ts +20 -0
  184. package/dist/lib/specifiers.d.ts.map +1 -0
  185. package/dist/lib/specifiers.js +130 -0
  186. package/dist/lib/specifiers.js.map +1 -0
  187. package/dist/lib/sql-tables.d.ts +166 -0
  188. package/dist/lib/sql-tables.d.ts.map +1 -0
  189. package/dist/lib/sql-tables.js +464 -0
  190. package/dist/lib/sql-tables.js.map +1 -0
  191. package/dist/lib/switchable-modules.d.ts +54 -0
  192. package/dist/lib/switchable-modules.d.ts.map +1 -0
  193. package/dist/lib/switchable-modules.js +104 -0
  194. package/dist/lib/switchable-modules.js.map +1 -0
  195. package/dist/lib/tailwind-sources.d.ts +136 -0
  196. package/dist/lib/tailwind-sources.d.ts.map +1 -0
  197. package/dist/lib/tailwind-sources.js +307 -0
  198. package/dist/lib/tailwind-sources.js.map +1 -0
  199. package/dist/lib/ui-layer.d.ts +54 -0
  200. package/dist/lib/ui-layer.d.ts.map +1 -0
  201. package/dist/lib/ui-layer.js +57 -0
  202. package/dist/lib/ui-layer.js.map +1 -0
  203. package/dist/lib/workspace-packages.d.ts +186 -0
  204. package/dist/lib/workspace-packages.d.ts.map +1 -0
  205. package/dist/lib/workspace-packages.js +351 -0
  206. package/dist/lib/workspace-packages.js.map +1 -0
  207. package/dist/new-instance/deploy.d.ts +211 -0
  208. package/dist/new-instance/deploy.d.ts.map +1 -0
  209. package/dist/new-instance/deploy.js +1381 -0
  210. package/dist/new-instance/deploy.js.map +1 -0
  211. package/dist/new-instance/docs-toolchain.d.ts +66 -0
  212. package/dist/new-instance/docs-toolchain.d.ts.map +1 -0
  213. package/dist/new-instance/docs-toolchain.js +69 -0
  214. package/dist/new-instance/docs-toolchain.js.map +1 -0
  215. package/dist/new-instance/host.d.ts +124 -0
  216. package/dist/new-instance/host.d.ts.map +1 -0
  217. package/dist/new-instance/host.js +276 -0
  218. package/dist/new-instance/host.js.map +1 -0
  219. package/dist/new-instance/index.d.ts +118 -0
  220. package/dist/new-instance/index.d.ts.map +1 -0
  221. package/dist/new-instance/index.js +567 -0
  222. package/dist/new-instance/index.js.map +1 -0
  223. package/dist/new-instance/modules.d.ts +188 -0
  224. package/dist/new-instance/modules.d.ts.map +1 -0
  225. package/dist/new-instance/modules.js +392 -0
  226. package/dist/new-instance/modules.js.map +1 -0
  227. package/dist/new-instance/template.d.ts +505 -0
  228. package/dist/new-instance/template.d.ts.map +1 -0
  229. package/dist/new-instance/template.js +1886 -0
  230. package/dist/new-instance/template.js.map +1 -0
  231. package/dist/new-module/emit.d.ts +67 -0
  232. package/dist/new-module/emit.d.ts.map +1 -0
  233. package/dist/new-module/emit.js +1393 -0
  234. package/dist/new-module/emit.js.map +1 -0
  235. package/dist/new-module/host.d.ts +67 -0
  236. package/dist/new-module/host.d.ts.map +1 -0
  237. package/dist/new-module/host.js +224 -0
  238. package/dist/new-module/host.js.map +1 -0
  239. package/dist/new-module/index.d.ts +32 -0
  240. package/dist/new-module/index.d.ts.map +1 -0
  241. package/dist/new-module/index.js +193 -0
  242. package/dist/new-module/index.js.map +1 -0
  243. package/dist/new-module/spec.d.ts +188 -0
  244. package/dist/new-module/spec.d.ts.map +1 -0
  245. package/dist/new-module/spec.js +404 -0
  246. package/dist/new-module/spec.js.map +1 -0
  247. package/dist/new-module/text.d.ts +15 -0
  248. package/dist/new-module/text.d.ts.map +1 -0
  249. package/dist/new-module/text.js +22 -0
  250. package/dist/new-module/text.js.map +1 -0
  251. package/dist/new-storefront/dockerfile.d.ts +20 -0
  252. package/dist/new-storefront/dockerfile.d.ts.map +1 -0
  253. package/dist/new-storefront/dockerfile.js +131 -0
  254. package/dist/new-storefront/dockerfile.js.map +1 -0
  255. package/dist/new-storefront/gitignore.d.ts +23 -0
  256. package/dist/new-storefront/gitignore.d.ts.map +1 -0
  257. package/dist/new-storefront/gitignore.js +39 -0
  258. package/dist/new-storefront/gitignore.js.map +1 -0
  259. package/dist/new-storefront/index.d.ts +93 -0
  260. package/dist/new-storefront/index.d.ts.map +1 -0
  261. package/dist/new-storefront/index.js +329 -0
  262. package/dist/new-storefront/index.js.map +1 -0
  263. package/dist/new-storefront/npmrc.d.ts +98 -0
  264. package/dist/new-storefront/npmrc.d.ts.map +1 -0
  265. package/dist/new-storefront/npmrc.js +217 -0
  266. package/dist/new-storefront/npmrc.js.map +1 -0
  267. package/dist/new-storefront/reference.d.ts +189 -0
  268. package/dist/new-storefront/reference.d.ts.map +1 -0
  269. package/dist/new-storefront/reference.js +430 -0
  270. package/dist/new-storefront/reference.js.map +1 -0
  271. package/dist/new-storefront/rewrite.d.ts +171 -0
  272. package/dist/new-storefront/rewrite.d.ts.map +1 -0
  273. package/dist/new-storefront/rewrite.js +701 -0
  274. package/dist/new-storefront/rewrite.js.map +1 -0
  275. package/dist/release-index.json +284 -0
  276. package/dist/rules/action-route-permissions.d.ts +141 -0
  277. package/dist/rules/action-route-permissions.d.ts.map +1 -0
  278. package/dist/rules/action-route-permissions.js +556 -0
  279. package/dist/rules/action-route-permissions.js.map +1 -0
  280. package/dist/rules/bundle-pairing.d.ts +74 -0
  281. package/dist/rules/bundle-pairing.d.ts.map +1 -0
  282. package/dist/rules/bundle-pairing.js +281 -0
  283. package/dist/rules/bundle-pairing.js.map +1 -0
  284. package/dist/rules/channel-resolution.d.ts +17 -0
  285. package/dist/rules/channel-resolution.d.ts.map +1 -0
  286. package/dist/rules/channel-resolution.js +382 -0
  287. package/dist/rules/channel-resolution.js.map +1 -0
  288. package/dist/rules/command-coverage.d.ts +210 -0
  289. package/dist/rules/command-coverage.d.ts.map +1 -0
  290. package/dist/rules/command-coverage.js +714 -0
  291. package/dist/rules/command-coverage.js.map +1 -0
  292. package/dist/rules/container-imports.d.ts +60 -0
  293. package/dist/rules/container-imports.d.ts.map +1 -0
  294. package/dist/rules/container-imports.js +158 -0
  295. package/dist/rules/container-imports.js.map +1 -0
  296. package/dist/rules/default-language-prose.d.ts +212 -0
  297. package/dist/rules/default-language-prose.d.ts.map +1 -0
  298. package/dist/rules/default-language-prose.js +710 -0
  299. package/dist/rules/default-language-prose.js.map +1 -0
  300. package/dist/rules/diacritic-folds.d.ts +238 -0
  301. package/dist/rules/diacritic-folds.d.ts.map +1 -0
  302. package/dist/rules/diacritic-folds.js +681 -0
  303. package/dist/rules/diacritic-folds.js.map +1 -0
  304. package/dist/rules/entity-tenant-classification.d.ts +171 -0
  305. package/dist/rules/entity-tenant-classification.d.ts.map +1 -0
  306. package/dist/rules/entity-tenant-classification.js +323 -0
  307. package/dist/rules/entity-tenant-classification.js.map +1 -0
  308. package/dist/rules/entry-presence.d.ts +142 -0
  309. package/dist/rules/entry-presence.d.ts.map +1 -0
  310. package/dist/rules/entry-presence.js +339 -0
  311. package/dist/rules/entry-presence.js.map +1 -0
  312. package/dist/rules/entry-scope.d.ts +91 -0
  313. package/dist/rules/entry-scope.d.ts.map +1 -0
  314. package/dist/rules/entry-scope.js +404 -0
  315. package/dist/rules/entry-scope.js.map +1 -0
  316. package/dist/rules/env-inputs.d.ts +222 -0
  317. package/dist/rules/env-inputs.d.ts.map +1 -0
  318. package/dist/rules/env-inputs.js +951 -0
  319. package/dist/rules/env-inputs.js.map +1 -0
  320. package/dist/rules/kernel-boundary.d.ts +37 -0
  321. package/dist/rules/kernel-boundary.d.ts.map +1 -0
  322. package/dist/rules/kernel-boundary.js +195 -0
  323. package/dist/rules/kernel-boundary.js.map +1 -0
  324. package/dist/rules/nul-bytes.d.ts +233 -0
  325. package/dist/rules/nul-bytes.d.ts.map +1 -0
  326. package/dist/rules/nul-bytes.js +332 -0
  327. package/dist/rules/nul-bytes.js.map +1 -0
  328. package/dist/rules/platform-surface.d.ts +479 -0
  329. package/dist/rules/platform-surface.d.ts.map +1 -0
  330. package/dist/rules/platform-surface.js +749 -0
  331. package/dist/rules/platform-surface.js.map +1 -0
  332. package/dist/rules/port-catches.d.ts +225 -0
  333. package/dist/rules/port-catches.d.ts.map +1 -0
  334. package/dist/rules/port-catches.js +1374 -0
  335. package/dist/rules/port-catches.js.map +1 -0
  336. package/dist/rules/port-shape.d.ts +213 -0
  337. package/dist/rules/port-shape.d.ts.map +1 -0
  338. package/dist/rules/port-shape.js +670 -0
  339. package/dist/rules/port-shape.js.map +1 -0
  340. package/dist/rules/queue-names.d.ts +108 -0
  341. package/dist/rules/queue-names.d.ts.map +1 -0
  342. package/dist/rules/queue-names.js +395 -0
  343. package/dist/rules/queue-names.js.map +1 -0
  344. package/dist/rules/singleton-identity.d.ts +205 -0
  345. package/dist/rules/singleton-identity.d.ts.map +1 -0
  346. package/dist/rules/singleton-identity.js +830 -0
  347. package/dist/rules/singleton-identity.js.map +1 -0
  348. package/dist/rules/subscribe-seam.d.ts +121 -0
  349. package/dist/rules/subscribe-seam.d.ts.map +1 -0
  350. package/dist/rules/subscribe-seam.js +594 -0
  351. package/dist/rules/subscribe-seam.js.map +1 -0
  352. package/dist/rules/transaction-context.d.ts +40 -0
  353. package/dist/rules/transaction-context.d.ts.map +1 -0
  354. package/dist/rules/transaction-context.js +294 -0
  355. package/dist/rules/transaction-context.js.map +1 -0
  356. package/package.json +59 -0
@@ -0,0 +1,532 @@
1
+ /**
2
+ * Container registrations and port resolutions, read out of TypeScript sources
3
+ * through the compiler API.
4
+ *
5
+ * `check:port-dependencies` and `check:port-shape` both have to answer the same
6
+ * three questions of a module's sources — *which names does it register*, *which
7
+ * ports does it provide* and *which names does it resolve* — and one of those two
8
+ * rules now has two hosts (`specs/101-endora-check/contracts/package-scope-layout.md`
9
+ * §6: `backend/scripts/check-port-shape.ts` over this repository, `endora check`
10
+ * over one module package). A predicate three callers share has to live where
11
+ * all three can reach it, which is the package.
12
+ *
13
+ * Everything here is **syntactic only**, deliberately. Whether a name is owned,
14
+ * whether an edge is declared and whether a capture is allowed are questions
15
+ * about a *composition*, and they stay with the checks that know what a
16
+ * composition is: this file says only what a source text spells.
17
+ *
18
+ * Attribution keys on `/src/apps/<deployment>/modules/<id>/`, then on
19
+ * `/src/modules/<id>/`, then on `lib/module-population.ts`' `moduleIdOf` — the
20
+ * same segment reader the population floor uses, with the `hostResident` map for
21
+ * a module whose sources the host owns. A file the walk reads and cannot name is
22
+ * a file every consumer here judges as nobody's and reports clean about, which
23
+ * is issue #215's failure one layer in.
24
+ */
25
+ import ts from 'typescript';
26
+ import { moduleIdOf, NO_HOST_RESIDENT_MODULES, } from './module-population.js';
27
+ /**
28
+ * Stand-in recorded when a `lazyPort` name is not a string literal. It is owned
29
+ * by nobody on purpose, so it surfaces as an `unowned-name` violation naming the
30
+ * file and line — the same way a genuinely unregistered name does.
31
+ */
32
+ export const NON_LITERAL_PORT_NAME = '<computed>';
33
+ /**
34
+ * The owning module id of a source file, over every root a module can live in.
35
+ *
36
+ * Three shapes, in order. The two anchored regexes answer for the application's
37
+ * own trees — a deployment overlay first, then the core module tree — and both
38
+ * key on `/src/`, so they say nothing about a module that has become a
39
+ * **package** (feature 080, T040a). The third is `lib/module-population.ts`'
40
+ * `moduleIdOf`, the same segment reader the population floor uses, and it is
41
+ * what makes a path like `packages/modules/blog/src/services/x.ts` attribute to
42
+ * `blog` instead of to nobody.
43
+ *
44
+ * That fallback is not cosmetic. Without it a package's files are read by the
45
+ * walk, satisfy the floor, and are then attributed to `null` — which for every
46
+ * consumer here means *not a module*, so the check judges none of them and
47
+ * reports clean. That is issue #215's failure one layer in, and it is why
48
+ * `resolveModuleLayout` refuses a package root whose location the segment
49
+ * reader cannot attribute rather than letting it through unnamed.
50
+ *
51
+ * The fourth answer is `hostResident`, the map the layout derives from the
52
+ * manifest index for a module whose sources the host owns and whose directory
53
+ * therefore carries no `modules/<id>/` segment (feature 080, T040b). It is
54
+ * threaded from `main` rather than left to default, for exactly the reason the
55
+ * third shape exists: a file the walk reads and cannot name is a file this
56
+ * check judges as nobody's and reports clean about.
57
+ */
58
+ export function moduleOf(file, hostResident = NO_HOST_RESIDENT_MODULES) {
59
+ const overlay = /\/src\/apps\/[^/]+\/modules\/([^/]+)\//.exec(file);
60
+ if (overlay)
61
+ return overlay[1] ?? null;
62
+ const core = /\/src\/modules\/([^/]+)\//.exec(file);
63
+ if (core)
64
+ return core[1] ?? null;
65
+ return moduleIdOf(file, hostResident);
66
+ }
67
+ /** `ctx.di.register` → `di.register`; used to match on the tail, not the receiver name. */
68
+ export function calleeTail(node) {
69
+ const expression = node.expression;
70
+ if (!ts.isPropertyAccessExpression(expression))
71
+ return '';
72
+ const inner = expression.expression;
73
+ const prefix = ts.isPropertyAccessExpression(inner) ? `${inner.name.text}.` : '';
74
+ return `${prefix}${expression.name.text}`;
75
+ }
76
+ /** Every registration name a module claims: `di.register` keys plus `di.providePort`. */
77
+ export function registeredNames(source, file) {
78
+ const sf = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, true);
79
+ const names = [];
80
+ const visit = (node) => {
81
+ if (ts.isCallExpression(node)) {
82
+ const tail = calleeTail(node);
83
+ const [first] = node.arguments;
84
+ if (tail === 'di.register' && first && ts.isObjectLiteralExpression(first)) {
85
+ for (const property of first.properties) {
86
+ if (property.name && ts.isIdentifier(property.name))
87
+ names.push(property.name.text);
88
+ else if (property.name && ts.isStringLiteral(property.name))
89
+ names.push(property.name.text);
90
+ }
91
+ }
92
+ if (tail === 'di.providePort' && first && ts.isStringLiteral(first)) {
93
+ names.push(first.text);
94
+ }
95
+ }
96
+ node.forEachChild(visit);
97
+ };
98
+ sf.forEachChild(visit);
99
+ return names;
100
+ }
101
+ /**
102
+ * The names a module registers as **gated ports** (`di.providePort`), which is
103
+ * the subset a composition root must never re-register.
104
+ *
105
+ * The distinction is the whole of the shadowing rule below. `di.register` is
106
+ * how a module declares a *contribution point* — a name it defaults, expecting
107
+ * a root that has something better to override it — so a root registering one
108
+ * of those is the design working. `di.providePort` wraps the resolver in the
109
+ * presence gate, and a root registration replaces the gate with a plain value.
110
+ */
111
+ export function providedPortNames(source, file) {
112
+ return providedPorts(source, file).map((port) => port.name);
113
+ }
114
+ /**
115
+ * Every gated registration a file makes, with its type argument.
116
+ *
117
+ * The single expression of "this call is a `providePort`" in the tree.
118
+ * `providedPortNames` above and `check-port-shape`'s container-name signal both
119
+ * come through here rather than each writing the predicate again: a check whose
120
+ * decision exists in two places can go half-missing without its red proof
121
+ * noticing, which is how `check:nul-bytes` kept printing `violations=0` with its
122
+ * rule mutated.
123
+ */
124
+ export function providedPorts(source, file) {
125
+ const sf = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, true);
126
+ const ports = [];
127
+ const visit = (node) => {
128
+ if (ts.isCallExpression(node) && calleeTail(node) === 'di.providePort') {
129
+ const [first] = node.arguments;
130
+ if (first && ts.isStringLiteral(first)) {
131
+ const [typeArgument] = node.typeArguments ?? [];
132
+ ports.push({
133
+ name: first.text,
134
+ typeName: typeArgument && ts.isTypeReferenceNode(typeArgument) &&
135
+ ts.isIdentifier(typeArgument.typeName)
136
+ ? typeArgument.typeName.text
137
+ : null,
138
+ line: sf.getLineAndCharacterOfPosition(node.getStart(sf)).line + 1,
139
+ });
140
+ }
141
+ }
142
+ node.forEachChild(visit);
143
+ };
144
+ sf.forEachChild(visit);
145
+ return ports;
146
+ }
147
+ function isFunctionLike(node) {
148
+ return (ts.isArrowFunction(node) ||
149
+ ts.isFunctionExpression(node) ||
150
+ ts.isFunctionDeclaration(node) ||
151
+ ts.isMethodDeclaration(node));
152
+ }
153
+ /** Is `node` the first argument of a `ctx.<seam>(…)` call? */
154
+ function isCallbackOf(seam, node) {
155
+ const parent = node.parent;
156
+ return (parent !== undefined &&
157
+ ts.isCallExpression(parent) &&
158
+ calleeTail(parent) === seam &&
159
+ parent.arguments[0] === node);
160
+ }
161
+ /**
162
+ * Where in the module's lifecycle this read happens — see {@link ResolutionSite}.
163
+ *
164
+ * `boot` is lexical and deliberately wide: `lazyPort` defers to the method
165
+ * call, and inside a boot hook that call is two lines down. All seven
166
+ * `emailDefaultsPort` contributors had exactly that shape, and every one of
167
+ * them would have failed the boot had the port stayed gated.
168
+ *
169
+ * `wiring` is narrow on purpose: only the `ctx.routes` callback's own body,
170
+ * because that is what runs during `buildServer`. Anything nested one function
171
+ * deeper — a route handler, an `onRequest` hook, a preHandler — runs per
172
+ * request, where a gate is exactly what should be asked.
173
+ */
174
+ export function siteAt(node) {
175
+ for (let current = node; current; current = current.parent) {
176
+ if (isCallbackOf('onBoot', current))
177
+ return 'boot';
178
+ }
179
+ let enclosing = node.parent;
180
+ while (enclosing && !isFunctionLike(enclosing))
181
+ enclosing = enclosing.parent;
182
+ if (enclosing && isCallbackOf('routes', enclosing))
183
+ return 'wiring';
184
+ return 'call';
185
+ }
186
+ /** Is this the container-cradle accessor, `ctx.cradle<C>()`? */
187
+ function isCradleCall(node) {
188
+ return ts.isCallExpression(node) && calleeTail(node).endsWith('cradle');
189
+ }
190
+ /** The expression a zero-argument function returns, if it returns exactly one. */
191
+ function soleReturnedExpression(fn) {
192
+ if (ts.isArrowFunction(fn) && !ts.isBlock(fn.body))
193
+ return fn.body;
194
+ if (!ts.isBlock(fn.body))
195
+ return null;
196
+ const [statement, ...rest] = fn.body.statements;
197
+ if (rest.length > 0 || statement === undefined || !ts.isReturnStatement(statement))
198
+ return null;
199
+ return statement.expression ?? null;
200
+ }
201
+ /**
202
+ * Every local name that stands for the container cradle, with the scope it is
203
+ * visible in.
204
+ *
205
+ * The check used to see two shapes only — a destructured factory parameter and
206
+ * `ctx.cradle<C>()` read inline — and a module that bound the cradle to a local
207
+ * first resolved everything it wanted unseen (issue #90). Nine modules had the
208
+ * object form and six the accessor form, and among them were gated ports read
209
+ * in a `ctx.routes` body: exactly what the wiring rule below exists to refuse.
210
+ */
211
+ function collectCradleAliases(sf) {
212
+ const aliases = new Map();
213
+ const add = (name, alias) => {
214
+ const existing = aliases.get(name);
215
+ if (existing)
216
+ existing.push(alias);
217
+ else
218
+ aliases.set(name, [alias]);
219
+ };
220
+ /** The block (or file) a `const` is visible in. */
221
+ const blockOf = (node) => {
222
+ for (let current = node.parent; current; current = current.parent) {
223
+ if (ts.isBlock(current) || ts.isSourceFile(current))
224
+ return current;
225
+ }
226
+ return sf;
227
+ };
228
+ const visit = (node) => {
229
+ if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {
230
+ const initializer = node.initializer;
231
+ const scope = blockOf(node);
232
+ if (isCradleCall(initializer)) {
233
+ add(node.name.text, { kind: 'object', scope });
234
+ }
235
+ else if ((ts.isArrowFunction(initializer) || ts.isFunctionExpression(initializer)) &&
236
+ initializer.parameters.length === 0) {
237
+ const returned = soleReturnedExpression(initializer);
238
+ if (returned !== null && isCradleCall(returned)) {
239
+ add(node.name.text, { kind: 'accessor', scope });
240
+ }
241
+ }
242
+ }
243
+ // A factory's first parameter *is* the cradle — that is how Awilix calls
244
+ // it — so a named one resolves exactly as a destructured one does. The
245
+ // destructured form was already read; this is the same seam written with a
246
+ // name, and `delivery_methods` and `payment_methods` use it.
247
+ if (ts.isCallExpression(node) && calleeTail(node).endsWith('asFunction')) {
248
+ const [factory] = node.arguments;
249
+ if (factory && (ts.isArrowFunction(factory) || ts.isFunctionExpression(factory))) {
250
+ const [parameter] = factory.parameters;
251
+ if (parameter && ts.isIdentifier(parameter.name)) {
252
+ add(parameter.name.text, { kind: 'object', scope: factory });
253
+ }
254
+ }
255
+ }
256
+ node.forEachChild(visit);
257
+ };
258
+ sf.forEachChild(visit);
259
+ return aliases;
260
+ }
261
+ /** Is `node` inside `scope` (or `scope` itself)? */
262
+ function isWithin(node, scope) {
263
+ for (let current = node; current; current = current.parent) {
264
+ if (current === scope)
265
+ return true;
266
+ }
267
+ return false;
268
+ }
269
+ /**
270
+ * Every registration name a module resolves.
271
+ *
272
+ * Three shapes, because those are the ones the kernel offers: the cradle
273
+ * parameter of a factory (`ctx.asFunction(({ a, b }: C) => …)`, destructured or
274
+ * named), the deferred surface (`ctx.cradle<C>()`) read by destructuring or by
275
+ * property access, and either of those bound to a local first — see
276
+ * {@link collectCradleAliases}.
277
+ *
278
+ * **Each shape is read both ways round.** The alias and the destructuring are
279
+ * independent axes, and the check used to see only five of their six
280
+ * combinations: `cradle().a` yes, `const { a } = ctx.cradle<C>()` yes,
281
+ * `const { a } = cradle()` no. That last one is what `catalog`'s
282
+ * asset-reference boot hook is written as, so its two reads were invisible
283
+ * until issue #127 — the eighth time this scanner's *reach*, rather than the
284
+ * rules under it, turned out to be the defect.
285
+ */
286
+ export function resolvedNames(source, file, hostResident = NO_HOST_RESIDENT_MODULES) {
287
+ const moduleId = moduleOf(file, hostResident);
288
+ if (moduleId === null)
289
+ return [];
290
+ const sf = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, true);
291
+ const found = [];
292
+ const cradleAliases = collectCradleAliases(sf);
293
+ const record = (name, node, kind, site = siteAt(node), via = 'cradle') => {
294
+ found.push({
295
+ moduleId,
296
+ name,
297
+ file,
298
+ line: sf.getLineAndCharacterOfPosition(node.getStart(sf)).line + 1,
299
+ kind,
300
+ site,
301
+ via,
302
+ });
303
+ };
304
+ const recordBindingPattern = (pattern, kind) => {
305
+ for (const element of pattern.elements) {
306
+ const property = element.propertyName ?? element.name;
307
+ if (ts.isIdentifier(property))
308
+ record(property.text, element, kind);
309
+ }
310
+ };
311
+ /**
312
+ * Is this `ctx.cradle()` call evaluated when the registration is built, or
313
+ * when somebody uses it?
314
+ *
315
+ * Walk out to the nearest enclosing function. If that function is the factory
316
+ * handed to `asFunction`, the call runs at construction — a capture. If any
317
+ * other function sits in between (a method, a route registrar, a subscriber
318
+ * handler, an arrow passed to a service), the call runs when that function
319
+ * does — a genuine deferral.
320
+ */
321
+ const readKindAt = (node) => {
322
+ let current = node.parent;
323
+ while (current) {
324
+ if (ts.isArrowFunction(current) ||
325
+ ts.isFunctionExpression(current) ||
326
+ ts.isFunctionDeclaration(current) ||
327
+ ts.isMethodDeclaration(current)) {
328
+ const owner = current.parent;
329
+ const isFactoryOfAsFunction = owner !== undefined &&
330
+ ts.isCallExpression(owner) &&
331
+ calleeTail(owner).endsWith('asFunction') &&
332
+ owner.arguments[0] === current;
333
+ return isFactoryOfAsFunction ? 'captured' : 'deferred';
334
+ }
335
+ current = current.parent;
336
+ }
337
+ return 'deferred';
338
+ };
339
+ /**
340
+ * The cradle a read is written against, if the receiver is a local alias
341
+ * visible here — `cradle.x` for an `object` alias, `cradle().x` for an
342
+ * `accessor` one. Innermost declaration wins, so a shadowed name is read in
343
+ * the scope that declared it.
344
+ */
345
+ const aliasReceiverOf = (receiver) => {
346
+ const named = ts.isIdentifier(receiver) && cradleAliases.has(receiver.text)
347
+ ? { name: receiver.text, wanted: 'object' }
348
+ : ts.isCallExpression(receiver) &&
349
+ receiver.arguments.length === 0 &&
350
+ ts.isIdentifier(receiver.expression) &&
351
+ cradleAliases.has(receiver.expression.text)
352
+ ? { name: receiver.expression.text, wanted: 'accessor' }
353
+ : null;
354
+ if (named === null)
355
+ return null;
356
+ const candidates = (cradleAliases.get(named.name) ?? []).filter((alias) => alias.kind === named.wanted && isWithin(receiver, alias.scope));
357
+ return candidates.at(-1) ?? null;
358
+ };
359
+ const visit = (node) => {
360
+ // A read off a local cradle alias. The alias itself resolves nothing — the
361
+ // cradle is a proxy — so the property access is the resolution, and its own
362
+ // position decides both the kind and the site.
363
+ if (ts.isPropertyAccessExpression(node) && aliasReceiverOf(node.expression) !== null) {
364
+ record(node.name.text, node, readKindAt(node));
365
+ }
366
+ else if (ts.isElementAccessExpression(node) && aliasReceiverOf(node.expression) !== null) {
367
+ // Same rule as `lazyPort`: a literal is a name this check can verify, and
368
+ // anything else must surface rather than pass.
369
+ const argument = node.argumentExpression;
370
+ const name = ts.isStringLiteralLike(argument) ? argument.text : NON_LITERAL_PORT_NAME;
371
+ record(name, node, readKindAt(node));
372
+ }
373
+ // The same alias, destructured instead of read a name at a time:
374
+ // `const { a, b } = cradle()` for an accessor alias, `const { a } = cradle`
375
+ // for an object one. The check saw each half — `cradle().a`, and
376
+ // `const { a } = ctx.cradle<C>()` written inline — and not the two combined,
377
+ // so `catalog`'s asset-reference boot hook resolved two names invisibly
378
+ // (issue #127). The destructuring *is* the resolution, exactly as the
379
+ // property access is, so its own position decides the kind and the site.
380
+ //
381
+ // Keyed on the alias table rather than on the shape, which is what keeps the
382
+ // widening from swallowing the tree: `const { rows } = await list()` is the
383
+ // commonest line in `src/` and resolves nothing. And the receiver must be
384
+ // the alias itself — `const { x } = cradle().service` destructures a
385
+ // *resolved value*, whose fields are not container names.
386
+ if (ts.isVariableDeclaration(node) &&
387
+ ts.isObjectBindingPattern(node.name) &&
388
+ node.initializer !== undefined &&
389
+ aliasReceiverOf(node.initializer) !== null) {
390
+ recordBindingPattern(node.name, readKindAt(node.initializer));
391
+ }
392
+ if (ts.isCallExpression(node)) {
393
+ const tail = calleeTail(node);
394
+ // A factory's cradle parameter.
395
+ if (tail.endsWith('asFunction')) {
396
+ const [factory] = node.arguments;
397
+ if (factory && (ts.isArrowFunction(factory) || ts.isFunctionExpression(factory))) {
398
+ const [parameter] = factory.parameters;
399
+ if (parameter && ts.isObjectBindingPattern(parameter.name)) {
400
+ recordBindingPattern(parameter.name, 'captured');
401
+ }
402
+ }
403
+ }
404
+ // The resolution surface — deferred *only* when the read happens inside a
405
+ // nested function. `ctx.cradle<C>().thing` written straight into a
406
+ // factory body looks deferred and is not: the body runs when Awilix first
407
+ // constructs the registration, so the read is every bit as eager as a
408
+ // destructured parameter. `addresses` had exactly that, and it survived
409
+ // until `dictionaries` turned the name it read into a port.
410
+ if (tail.endsWith('cradle')) {
411
+ const kind = readKindAt(node);
412
+ const parent = node.parent;
413
+ if (parent && ts.isPropertyAccessExpression(parent)) {
414
+ record(parent.name.text, parent, kind);
415
+ }
416
+ else if (parent &&
417
+ ts.isVariableDeclaration(parent) &&
418
+ ts.isObjectBindingPattern(parent.name)) {
419
+ recordBindingPattern(parent.name, kind);
420
+ }
421
+ }
422
+ // `lazyPort<T>(ctx, 'name')` — the shape the conversions were told to
423
+ // prefer, and the one this check could not see until feature 072 wave 3.
424
+ // Every read through it went unchecked: `pim_ergonode` resolved fourteen
425
+ // names this way, several registered by nobody, and the check reported a
426
+ // clean bill while the media pipeline produced no assets.
427
+ //
428
+ // Always `deferred`: the proxy resolves the name on each method call, not
429
+ // when it is constructed. That is the whole point of the helper, and it
430
+ // is why capturing one is safe where capturing a port is not.
431
+ //
432
+ // The same reasoning decides the **site**, and it is why a `lazyPort` is
433
+ // not read positionally like a cradle access. Building one in a
434
+ // `ctx.routes` body resolves nothing — that is the sanctioned fix for the
435
+ // wiring hazard, not an instance of it, so it is a `call`. Building one
436
+ // in a boot hook is different in kind: the whole hook body is pre-request,
437
+ // so the method call it defers to happens at boot too, usually on the next
438
+ // line. All seven `emailDefaultsPort` contributors were exactly that.
439
+ const calleeName = ts.isIdentifier(node.expression) ? node.expression.text : tail;
440
+ if (calleeName === 'lazyPort') {
441
+ const [, nameArgument] = node.arguments;
442
+ const lazySite = siteAt(node) === 'boot' ? 'boot' : 'call';
443
+ if (nameArgument !== undefined) {
444
+ if (ts.isStringLiteralLike(nameArgument)) {
445
+ record(nameArgument.text, nameArgument, 'deferred', lazySite, 'lazyPort');
446
+ }
447
+ else {
448
+ // A name this check cannot read statically must not pass silently.
449
+ // A generic `port(ctx, name)` helper written during T131 hid twelve
450
+ // resolutions behind a variable; the fix is to refuse the shape,
451
+ // not to guess at it.
452
+ record(NON_LITERAL_PORT_NAME, nameArgument, 'deferred', lazySite, 'lazyPort');
453
+ }
454
+ }
455
+ }
456
+ }
457
+ node.forEachChild(visit);
458
+ };
459
+ sf.forEachChild(visit);
460
+ return found;
461
+ }
462
+ /**
463
+ * Every registration name a **composition root** writes into the container.
464
+ *
465
+ * A different spelling from {@link registeredNames} and that is the whole reason
466
+ * it exists: a module writes `ctx.di.register({ … })`, and a root writes
467
+ * `registerValues(container, { … })`, `container.register({ … })` or
468
+ * `composedModules.contribute({ … })` — D-45's contribution window as a method
469
+ * (issue #52). Missing the third would drop nearly every name a root supplies.
470
+ *
471
+ * ## Why the CLI needs it
472
+ *
473
+ * `specs/110-instance-repository/` T138a. The divergence report's second host is
474
+ * a client's instance, where `composeApp` **is** the composition root and comes
475
+ * out of `node_modules`, and `registration-owners.ts`' `rootSuppliedNames` is
476
+ * what tells *"a root registers it"* from *"nobody registers it"*. Its own doc
477
+ * block says what happens without it, and it was measured happening: an overlay
478
+ * module decorating `commandBus` in a real scaffolded instance was reported
479
+ * `unowned-subject` — a finding about the run dressed as one about the tree —
480
+ * because the platform registers it in a root spelling this file did not read.
481
+ *
482
+ * ## It is a **second copy**, knowingly, and here is the whole of that decision
483
+ *
484
+ * `backend/scripts/check-port-dependencies.ts` exports a `rootRegisteredNames`
485
+ * this one is taken from, unchanged. Two derivations of one predicate is the
486
+ * shape this estate refuses, so the copy is **not** the end state: that file's
487
+ * should become an import of this one, which is a one-line change and is
488
+ * deliberately not made in the merge request that adds this, feature 117's
489
+ * Phase 6 holding that file open at the time. Until it is,
490
+ * `backend/test/unit/scripts/check-divergence.test.ts` holds the two to each
491
+ * other over the shapes a root really writes — a divergence between them is red
492
+ * rather than silent, which is what a duplicated predicate otherwise costs.
493
+ *
494
+ * Spread elements are ignored: a name that only exists inside a spread is not a
495
+ * name this analysis can reason about.
496
+ */
497
+ export function rootRegisteredNames(source, file) {
498
+ const sf = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, true);
499
+ const names = [];
500
+ const collect = (literal) => {
501
+ for (const property of literal.properties) {
502
+ if (!property.name)
503
+ continue;
504
+ if (ts.isIdentifier(property.name))
505
+ names.push(property.name.text);
506
+ else if (ts.isStringLiteral(property.name))
507
+ names.push(property.name.text);
508
+ }
509
+ };
510
+ const visit = (node) => {
511
+ if (ts.isCallExpression(node)) {
512
+ const callee = ts.isIdentifier(node.expression) ? node.expression.text : calleeTail(node);
513
+ if (callee === 'registerValues') {
514
+ const [, second] = node.arguments;
515
+ if (second && ts.isObjectLiteralExpression(second))
516
+ collect(second);
517
+ }
518
+ if (callee === 'container.register' ||
519
+ callee === 'register' ||
520
+ callee === 'contribute' ||
521
+ callee.endsWith('.contribute')) {
522
+ const [first] = node.arguments;
523
+ if (first && ts.isObjectLiteralExpression(first))
524
+ collect(first);
525
+ }
526
+ }
527
+ node.forEachChild(visit);
528
+ };
529
+ sf.forEachChild(visit);
530
+ return names;
531
+ }
532
+ //# sourceMappingURL=port-registrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"port-registrations.js","sourceRoot":"","sources":["../../src/lib/port-registrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EACL,UAAU,EACV,wBAAwB,GAEzB,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AA8DlD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAY,EACZ,eAAoC,wBAAwB;IAE5D,MAAM,OAAO,GAAG,wCAAwC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,IAAI,OAAO;Q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