@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,237 @@
1
+ /**
2
+ * The divergence report, rendered for a client's instance
3
+ * (`specs/107-override-report-and-ladder/contracts/divergence-report.md`;
4
+ * `specs/110-instance-repository/contracts/instance-tree.md` §2.2, §2.6).
5
+ *
6
+ * ## Why an instance renders one at all
7
+ *
8
+ * `endora new instance` writes `apps/<deployment>/divergence.ts` and
9
+ * `apps/<deployment>/modules/.gitkeep`, so the tree a client customises in
10
+ * exists from the first minute — and until T138a nothing could describe it. The
11
+ * renderer was `backend/scripts/generate-divergence.ts`, over this repository's
12
+ * module layout, its platform sources and a port→owner map built from module
13
+ * **sources**, none of which an instance has. D-30 asks that *"every override is
14
+ * visible in a generated artefact"*, and for every tree but this one that was
15
+ * a sentence with no implementation behind it.
16
+ *
17
+ * ## The population is the parameter; the derivation is one program (R3.5)
18
+ *
19
+ * Nine kinds, each from one seam of `ModuleContext`, over the deployment's own
20
+ * overlay tree. **That population is identical in the two hosts** — an overlay
21
+ * module is a client's own source in either tree — so every kind an instance
22
+ * records is the kind this repository records, derived by the same
23
+ * `deriveDivergence`.
24
+ *
25
+ * ## What is genuinely narrower, and where the artefact says so
26
+ *
27
+ * Attribution, in one place. This repository's owner map has three sources —
28
+ * module sources, a composition root's bridging table, and installed packages —
29
+ * and an instance has the third alone: every module is an installed package and
30
+ * `composeApp` is the platform's, so a name the platform registers on a module's
31
+ * behalf is reported as a composition root's rather than as that module's. That
32
+ * is true of the instance and is simply less specific than ours, and it is
33
+ * written into the report's own `boundary.notRecorded`
34
+ * (`lib/divergence-artefacts.ts`' `INSTANCE_BOUNDARY_NOTES`) rather than left for
35
+ * a client to discover by reading a report with a silent hole in it.
36
+ *
37
+ * Two differences in the artefact **set** rather than in what a report records,
38
+ * both of them deliberate:
39
+ *
40
+ * - **markdown and JSON, never a typed TS module.** The `.ts` rendering's two
41
+ * readers here are a program and `overlay:check`'s byte-comparison; an
42
+ * instance has no check estate (`instance-tree.md` §2.5) and the emitted
43
+ * module imports `DivergenceReport` by a **relative** path, which
44
+ * `backend/src/overlay/types.ts` carries and an instance has no equivalent
45
+ * of. A bare specifier there would be the one generated artefact whose import
46
+ * depends on the client's dependency graph, which is the state that file's own
47
+ * header exists to refuse. JSON is the machine shape with no import at all.
48
+ * - **no bare-core rendering.** This repository renders one because `DEPLOYMENT`
49
+ * is legitimately unset here; an instance is scaffolded with exactly one
50
+ * deployment and every build composes it, so a bare-core report would describe
51
+ * a build the client never makes.
52
+ *
53
+ * ## It is committed, unlike the other three artefacts this command writes
54
+ *
55
+ * §1 of the report contract is the predicate: *an artefact is committed when its
56
+ * content is a fact about the tree, and resolved at runtime when it is a fact
57
+ * about the process*. A deployment's overlay modules and what they decorate are
58
+ * facts about the client's own tree, visible in the merge request that creates
59
+ * them — which is the whole reason the report is worth having. So this pair is
60
+ * not `.gitignore`d and the header does not tell a reader not to commit it.
61
+ */
62
+ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
63
+ import { join, relative, sep } from 'node:path';
64
+ import { instanceComposition, INSTANCE_BOUNDARY_NOTES, overlaySourcesUnder, overlayTreeSpellsASeamCall, readDivergenceDeclaration, renderDivergenceArtefacts, unreadableCompositionReason, withOverlayRegistrationOwners, EMPTY_DECLARATION, } from '../lib/divergence-artefacts.js';
65
+ import { divergenceRefusal, selfContradictingSubjects } from '../lib/divergence.js';
66
+ import { scanInstalledPlatformPackage, } from '../lib/module-packages.js';
67
+ /** Raised when this half has an input it could not read — the caller's exit 2. */
68
+ export class DivergenceHostError extends Error {
69
+ name = 'DivergenceHostError';
70
+ }
71
+ /** The "do not edit" header an instance's rendered report carries. */
72
+ export const INSTANCE_DIVERGENCE_MARKDOWN_HEADER = [
73
+ '<!-- AUTO-GENERATED by `endora generate` — DO NOT EDIT. -->',
74
+ '<!-- It is derived from this deployment’s own `modules/` tree and its `divergence.ts`, -->',
75
+ '<!-- so it is a fact about your repository: commit it, and read the diff. -->',
76
+ ];
77
+ /** Sorted directory names directly under a root; `[]` when there is none. */
78
+ function directoriesUnder(root) {
79
+ if (!existsSync(root))
80
+ return [];
81
+ try {
82
+ return readdirSync(root, { withFileTypes: true })
83
+ .filter((entry) => entry.isDirectory() && !entry.name.startsWith('.'))
84
+ .map((entry) => entry.name)
85
+ .sort();
86
+ }
87
+ catch {
88
+ return [];
89
+ }
90
+ }
91
+ /** Every deployment in an instance — one directory under `<root>/apps/`. */
92
+ export function instanceDeployments(root) {
93
+ return directoriesUnder(join(root, 'apps'));
94
+ }
95
+ /**
96
+ * The deployment's declaration file on disk, or `null`.
97
+ *
98
+ * `.ts` before `.js`, which is the opposite of the platform's own resolution
99
+ * order and is right for this reader: the platform resolves what it is about to
100
+ * **execute**, where a stray source beside a build is the wrong answer, and this
101
+ * reads what the client **wrote**.
102
+ */
103
+ function declarationPathFor(root, deployment) {
104
+ for (const extension of ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs']) {
105
+ const candidate = join(root, 'apps', deployment, `divergence.${extension}`);
106
+ try {
107
+ if (statSync(candidate).isFile())
108
+ return candidate;
109
+ }
110
+ catch {
111
+ continue;
112
+ }
113
+ }
114
+ return null;
115
+ }
116
+ /**
117
+ * Render one report per deployment this instance holds.
118
+ *
119
+ * A tree with no `apps/` directory at all is the empty list rather than a
120
+ * refusal: an instance scaffolded and not yet customised is a supported state,
121
+ * and the caller names it as an omission the way it names an absent admin
122
+ * member.
123
+ */
124
+ export function renderInstanceDivergence(input) {
125
+ const deployments = instanceDeployments(input.root);
126
+ if (deployments.length === 0)
127
+ return [];
128
+ const platform = scanInstalledPlatformPackage(input.root);
129
+ if (platform === null) {
130
+ throw new DivergenceHostError(`no installed package in ${join(input.root, 'node_modules')} declares ` +
131
+ '`endora.type: "platform"`, so the composition this deployment diverges *from* cannot ' +
132
+ 'be read: no container name has an owner, no endpoint has a route, and ' +
133
+ "`ModuleContext`'s own members — the list every seam is classified against — are " +
134
+ 'unknown. A report derived from that would record every decoration as owned by nobody ' +
135
+ 'and classify no seam at all. Run `pnpm install` first.');
136
+ }
137
+ const scan = instanceComposition({ packages: input.packages, platform });
138
+ const unreadable = unreadableCompositionReason(scan);
139
+ if (unreadable !== null)
140
+ throw new DivergenceHostError(unreadable);
141
+ if (scan.environment.seams.length === 0) {
142
+ throw new DivergenceHostError(`${platform.name} publishes no file declaring the \`ModuleContext\` interface beside its ` +
143
+ '`./kernel` entry point, so there is nothing to classify this deployment’s seams ' +
144
+ 'against. Every seam would be recorded with no rung and the `unclassified-seam` ' +
145
+ 'finding could never fire, which is a finding about this run dressed as a clean tree.');
146
+ }
147
+ // Every committed report on disk, read from the directories rather than from
148
+ // the deployments the walk found: refusal 1's whole subject is the state in
149
+ // which those two disagree. In an instance it cannot fire — a client's report
150
+ // lives at `apps/<d>/divergence.generated.md`, inside the directory
151
+ // `instanceDeployments` counts, so an artefact implies its deployment — and
152
+ // the input is supplied truthfully anyway rather than stubbed, because a
153
+ // layout change is exactly the thing that would make a stub wrong in silence.
154
+ const committedDeploymentArtefacts = deployments.filter((deployment) => existsSync(join(input.root, 'apps', deployment, 'divergence.generated.md')));
155
+ return deployments.map((deployment) => {
156
+ const overlayRoot = join(input.root, 'apps', deployment, 'modules');
157
+ const overlayModules = directoriesUnder(overlayRoot);
158
+ const sources = overlaySourcesUnder(overlayRoot, overlayModules, input.root);
159
+ // FR-005/FR-006/FR-007 — the deployment's own registrations, merged per
160
+ // deployment because the overlay set is per deployment while the scan is not.
161
+ const environment = withOverlayRegistrationOwners(scan.environment, sources);
162
+ const declarationPath = declarationPathFor(input.root, deployment);
163
+ const reading = declarationPath === null
164
+ ? { declaration: EMPTY_DECLARATION, unresolved: [] }
165
+ : readDivergenceDeclaration(readFileSync(declarationPath, 'utf8'), declarationPath);
166
+ const base = join(input.root, 'apps', deployment, 'divergence.generated');
167
+ const { result, renderings } = renderDivergenceArtefacts({
168
+ deployment,
169
+ overlayRoot: relative(input.root, overlayRoot).split(sep).join('/'),
170
+ overlayModules,
171
+ sources,
172
+ routes: environment.routes,
173
+ owners: environment.owners,
174
+ rootSupplied: environment.rootSupplied,
175
+ declaration: reading.declaration,
176
+ seams: environment.seams,
177
+ hostNotRecorded: INSTANCE_BOUNDARY_NOTES,
178
+ // The file this run really read, relative to the client's own root. A
179
+ // finding's job is to send somebody to a file, and the default is this
180
+ // repository's `backend/src/apps/<d>/divergence.ts`, which no instance has.
181
+ declarationPath: declarationPath === null
182
+ ? join('apps', deployment, 'divergence.ts')
183
+ : relative(input.root, declarationPath).split(sep).join('/'),
184
+ }, [
185
+ {
186
+ rendering: 'markdown',
187
+ outputPath: `${base}.md`,
188
+ header: INSTANCE_DIVERGENCE_MARKDOWN_HEADER,
189
+ label: `the divergence report for \`${deployment}\``,
190
+ },
191
+ {
192
+ rendering: 'json',
193
+ outputPath: `${base}.json`,
194
+ label: `the divergence report for \`${deployment}\`, as data`,
195
+ },
196
+ ]);
197
+ // FR-008 — the refusals, evaluated here because `divergenceRefusal` lives in
198
+ // the shared library and had exactly one caller: `backend/scripts/check-divergence.ts`,
199
+ // which an instance does not have. Every input it needs is in hand, so an
200
+ // instance was the one host that could print a vacuous pass with nothing to
201
+ // stop it — the state refusal 3 exists for, reached by a client writing
202
+ // JavaScript. A refusal is an input this run could not read, which is
203
+ // `DivergenceHostError`'s class and the caller's exit 2, never exit 1.
204
+ const refusal = divergenceRefusal({
205
+ deployments,
206
+ committedDeploymentArtefacts,
207
+ sites: result.sites.length,
208
+ overlaySpellsASeamCall: overlayTreeSpellsASeamCall(sources),
209
+ ownersResolved: environment.owners.size,
210
+ // The platform's declared `ModuleContext` members. The rung table itself
211
+ // is a constant this package ships, so the input that can genuinely be
212
+ // zero in an instance is the member list — and a zero is already refused
213
+ // above, with a message naming the platform package. Passing the real
214
+ // number keeps the predicate answering over what this run read rather
215
+ // than over a stub that cannot go wrong.
216
+ seamsClassified: environment.seams.length,
217
+ selfContradictingSubjects: selfContradictingSubjects(result),
218
+ });
219
+ if (refusal !== null) {
220
+ throw new DivergenceHostError(`the divergence report for \`${deployment}\` was refused rather than rendered ` +
221
+ `[${refusal.kind}]: ${refusal.message}`);
222
+ }
223
+ return {
224
+ deployment,
225
+ renderings,
226
+ overlayModules,
227
+ entries: result.report.entries.length,
228
+ findings: result.findings.map((finding) => ({
229
+ kind: finding.kind,
230
+ where: finding.where,
231
+ detail: finding.detail,
232
+ })),
233
+ unresolvedDeclaration: reading.unresolved,
234
+ };
235
+ });
236
+ }
237
+ //# sourceMappingURL=divergence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divergence.js","sourceRoot":"","sources":["../../src/generate/divergence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,iBAAiB,GAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EACL,4BAA4B,GAE7B,MAAM,2BAA2B,CAAC;AAEnC,kFAAkF;AAClF,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC1B,IAAI,GAAG,qBAAqB,CAAC;CAChD;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,6DAA6D;IAC7D,4FAA4F;IAC5F,+EAA+E;CAChF,CAAC;AAEF,6EAA6E;AAC7E,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,CAAC,UAAU,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;YACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC1C,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC,CAAC;YACH,qBAAqB,EAAE,OAAO,CAAC,UAAU;SAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { type DocsCollection } from '../lib/docs-artefacts.js';
2
+ import { type SkippedInstalledPackage } from '../lib/module-packages.js';
3
+ import { type InstanceDivergence } from './divergence.js';
4
+ /** A refusal the operator can act on — exit 1. */
5
+ export declare class GenerateInputError extends Error {
6
+ readonly name = "GenerateInputError";
7
+ }
8
+ /** An input this run could not read — exit 2. */
9
+ export declare class GenerateHostError extends Error {
10
+ readonly name = "GenerateHostError";
11
+ }
12
+ export interface GenerateOptions {
13
+ /** Where the run was invoked. The instance root is found upwards from here. */
14
+ readonly cwd?: string | undefined;
15
+ /** Report what would be written, and write nothing. */
16
+ readonly dryRun?: boolean | undefined;
17
+ }
18
+ /** One artefact this run rendered. */
19
+ export interface GeneratedArtefact {
20
+ /** Absolute. */
21
+ readonly path: string;
22
+ readonly content: string;
23
+ /** What it is, for the line the command prints. */
24
+ readonly label: string;
25
+ }
26
+ export interface GenerateResult {
27
+ /** The workspace root this run rendered for. */
28
+ readonly root: string;
29
+ readonly artefacts: readonly GeneratedArtefact[];
30
+ /** How many installed module packages the population held. */
31
+ readonly modules: number;
32
+ /** R8.2 — every candidate the discovery excluded, with its reason. */
33
+ readonly excluded: readonly SkippedInstalledPackage[];
34
+ /**
35
+ * A member this instance does not have, and therefore an artefact family this
36
+ * run did not render — named rather than silently skipped.
37
+ *
38
+ * `instance-tree.md` §2.4's own reasoning: *"a client who does not know they
39
+ * have no operator interface spends their first hour looking for one"*. The
40
+ * same holds for a documentation site, and the member is legitimately absent
41
+ * — `endora new instance` omits either one when the packages it is mounted on
42
+ * do not resolve.
43
+ */
44
+ readonly omitted: readonly string[];
45
+ /** What the documentation copy step did, or `null` when there is no site. */
46
+ readonly collected: DocsCollection | null;
47
+ /**
48
+ * Reference pages this run removed because no installed module renders them
49
+ * any more — the category's half of {@link GenerateResult.collected}.
50
+ */
51
+ readonly swept: readonly string[];
52
+ /**
53
+ * One divergence report per deployment this instance holds
54
+ * (`specs/107-override-report-and-ladder/contracts/divergence-report.md`).
55
+ *
56
+ * **Unlike the other three families these are committed**, and the predicate
57
+ * that decides it is §1's: an artefact is committed when its content is a fact
58
+ * about the tree. Which packages a client installed is a fact about the
59
+ * install; what their own overlay modules decorate is a fact about their
60
+ * repository, and it is only worth having because it turns up in the merge
61
+ * request that creates it.
62
+ */
63
+ readonly divergence: readonly InstanceDivergence[];
64
+ readonly dryRun: boolean;
65
+ }
66
+ /**
67
+ * The instance root: the nearest directory above `from` holding a
68
+ * `pnpm-workspace.yaml`.
69
+ *
70
+ * Upwards, so the command works from the admin member as well as from the root
71
+ * — `pnpm -C admin run generate` runs it with the member as its working
72
+ * directory, and a client typing it in the directory they are editing is the
73
+ * ordinary case.
74
+ */
75
+ export declare function findInstanceRoot(from: string): string | null;
76
+ /**
77
+ * Render the instance's build artefacts, and write them unless this is a dry
78
+ * run.
79
+ *
80
+ * Every artefact is rendered **before** any is written, in `new instance`'s own
81
+ * discipline (R5.2): a half-written pair is a bundle that names modules the
82
+ * stylesheet did not scan, which is the silent failure
83
+ * `admin-stylesheet-composition.md` exists to remove.
84
+ */
85
+ export declare function runGenerate(options?: GenerateOptions): Promise<GenerateResult>;
86
+ /** The lines the command prints, in order. Exported so a proof reads them. */
87
+ export declare function generateReport(result: GenerateResult): readonly string[];
88
+ /** Is this instance's admin registry the same as the one on disk? */
89
+ export declare function artefactIsCurrent(artefact: GeneratedArtefact): boolean;
90
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {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