universal-physics-tensor 0.45.2 → 0.47.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 (548) hide show
  1. package/README.md +85 -66
  2. package/bin/upt.mjs +22 -22
  3. package/dist/atlas/applicability.d.ts +108 -0
  4. package/dist/atlas/applicability.d.ts.map +1 -0
  5. package/dist/atlas/applicability.js +301 -0
  6. package/dist/atlas/applicability.js.map +1 -0
  7. package/dist/atlas/association.d.ts +92 -0
  8. package/dist/atlas/association.d.ts.map +1 -0
  9. package/dist/atlas/association.js +112 -0
  10. package/dist/atlas/association.js.map +1 -0
  11. package/dist/atlas/benchmark/backend-shapes.d.ts +47 -0
  12. package/dist/atlas/benchmark/backend-shapes.d.ts.map +1 -0
  13. package/dist/atlas/benchmark/backend-shapes.js +58 -0
  14. package/dist/atlas/benchmark/backend-shapes.js.map +1 -0
  15. package/dist/atlas/benchmark/baselines.d.ts +64 -0
  16. package/dist/atlas/benchmark/baselines.d.ts.map +1 -0
  17. package/dist/atlas/benchmark/baselines.js +112 -0
  18. package/dist/atlas/benchmark/baselines.js.map +1 -0
  19. package/dist/atlas/benchmark/leakage.d.ts +56 -0
  20. package/dist/atlas/benchmark/leakage.d.ts.map +1 -0
  21. package/dist/atlas/benchmark/leakage.js +100 -0
  22. package/dist/atlas/benchmark/leakage.js.map +1 -0
  23. package/dist/atlas/benchmark/loader.d.ts +56 -0
  24. package/dist/atlas/benchmark/loader.d.ts.map +1 -0
  25. package/dist/atlas/benchmark/loader.js +104 -0
  26. package/dist/atlas/benchmark/loader.js.map +1 -0
  27. package/dist/atlas/benchmark/run-atlas.d.ts +72 -0
  28. package/dist/atlas/benchmark/run-atlas.d.ts.map +1 -0
  29. package/dist/atlas/benchmark/run-atlas.js +210 -0
  30. package/dist/atlas/benchmark/run-atlas.js.map +1 -0
  31. package/dist/atlas/benchmark/stats.d.ts +90 -0
  32. package/dist/atlas/benchmark/stats.d.ts.map +1 -0
  33. package/dist/atlas/benchmark/stats.js +159 -0
  34. package/dist/atlas/benchmark/stats.js.map +1 -0
  35. package/dist/atlas/benchmark/study.d.ts +120 -0
  36. package/dist/atlas/benchmark/study.d.ts.map +1 -0
  37. package/dist/atlas/benchmark/study.js +192 -0
  38. package/dist/atlas/benchmark/study.js.map +1 -0
  39. package/dist/atlas/benchmark/types.d.ts +79 -0
  40. package/dist/atlas/benchmark/types.d.ts.map +1 -0
  41. package/dist/atlas/benchmark/types.js +46 -0
  42. package/dist/atlas/benchmark/types.js.map +1 -0
  43. package/dist/atlas/composition-table.d.ts +55 -0
  44. package/dist/atlas/composition-table.d.ts.map +1 -0
  45. package/dist/atlas/composition-table.js +133 -0
  46. package/dist/atlas/composition-table.js.map +1 -0
  47. package/dist/atlas/conventions.d.ts +63 -0
  48. package/dist/atlas/conventions.d.ts.map +1 -0
  49. package/dist/atlas/conventions.js +93 -0
  50. package/dist/atlas/conventions.js.map +1 -0
  51. package/dist/atlas/coverage.d.ts +93 -0
  52. package/dist/atlas/coverage.d.ts.map +1 -0
  53. package/dist/atlas/coverage.js +69 -0
  54. package/dist/atlas/coverage.js.map +1 -0
  55. package/dist/atlas/derivation.d.ts +137 -0
  56. package/dist/atlas/derivation.d.ts.map +1 -0
  57. package/dist/atlas/derivation.js +190 -0
  58. package/dist/atlas/derivation.js.map +1 -0
  59. package/dist/atlas/derive-evidence.d.ts +218 -0
  60. package/dist/atlas/derive-evidence.d.ts.map +1 -0
  61. package/dist/atlas/derive-evidence.js +225 -0
  62. package/dist/atlas/derive-evidence.js.map +1 -0
  63. package/dist/atlas/diffusion/bridges-closure.d.ts +63 -0
  64. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -0
  65. package/dist/atlas/diffusion/bridges-closure.js +350 -0
  66. package/dist/atlas/diffusion/bridges-closure.js.map +1 -0
  67. package/dist/atlas/diffusion/bridges.d.ts +36 -0
  68. package/dist/atlas/diffusion/bridges.d.ts.map +1 -0
  69. package/dist/atlas/diffusion/bridges.js +226 -0
  70. package/dist/atlas/diffusion/bridges.js.map +1 -0
  71. package/dist/atlas/diffusion/dimensions.d.ts +21 -0
  72. package/dist/atlas/diffusion/dimensions.d.ts.map +1 -0
  73. package/dist/atlas/diffusion/dimensions.js +21 -0
  74. package/dist/atlas/diffusion/dimensions.js.map +1 -0
  75. package/dist/atlas/diffusion/index.d.ts +16 -0
  76. package/dist/atlas/diffusion/index.d.ts.map +1 -0
  77. package/dist/atlas/diffusion/index.js +23 -0
  78. package/dist/atlas/diffusion/index.js.map +1 -0
  79. package/dist/atlas/diffusion/models.d.ts +24 -0
  80. package/dist/atlas/diffusion/models.d.ts.map +1 -0
  81. package/dist/atlas/diffusion/models.js +139 -0
  82. package/dist/atlas/diffusion/models.js.map +1 -0
  83. package/dist/atlas/diffusion/numerics.d.ts +181 -0
  84. package/dist/atlas/diffusion/numerics.d.ts.map +1 -0
  85. package/dist/atlas/diffusion/numerics.js +251 -0
  86. package/dist/atlas/diffusion/numerics.js.map +1 -0
  87. package/dist/atlas/error-algebra.d.ts +52 -0
  88. package/dist/atlas/error-algebra.d.ts.map +1 -0
  89. package/dist/atlas/error-algebra.js +55 -0
  90. package/dist/atlas/error-algebra.js.map +1 -0
  91. package/dist/atlas/export.d.ts +48 -0
  92. package/dist/atlas/export.d.ts.map +1 -0
  93. package/dist/atlas/export.js +106 -0
  94. package/dist/atlas/export.js.map +1 -0
  95. package/dist/atlas/families.d.ts +14 -0
  96. package/dist/atlas/families.d.ts.map +1 -0
  97. package/dist/atlas/families.js +20 -0
  98. package/dist/atlas/families.js.map +1 -0
  99. package/dist/atlas/index.d.ts +90 -0
  100. package/dist/atlas/index.d.ts.map +1 -0
  101. package/dist/atlas/index.js +69 -0
  102. package/dist/atlas/index.js.map +1 -0
  103. package/dist/atlas/link-prediction.d.ts +71 -0
  104. package/dist/atlas/link-prediction.d.ts.map +1 -0
  105. package/dist/atlas/link-prediction.js +128 -0
  106. package/dist/atlas/link-prediction.js.map +1 -0
  107. package/dist/atlas/model.d.ts +70 -0
  108. package/dist/atlas/model.d.ts.map +1 -0
  109. package/dist/atlas/model.js +26 -0
  110. package/dist/atlas/model.js.map +1 -0
  111. package/dist/atlas/oscillators/bridges-coarse.d.ts +71 -0
  112. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -0
  113. package/dist/atlas/oscillators/bridges-coarse.js +146 -0
  114. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -0
  115. package/dist/atlas/oscillators/bridges-exact.d.ts +70 -0
  116. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -0
  117. package/dist/atlas/oscillators/bridges-exact.js +230 -0
  118. package/dist/atlas/oscillators/bridges-exact.js.map +1 -0
  119. package/dist/atlas/oscillators/bridges-limits.d.ts +118 -0
  120. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -0
  121. package/dist/atlas/oscillators/bridges-limits.js +345 -0
  122. package/dist/atlas/oscillators/bridges-limits.js.map +1 -0
  123. package/dist/atlas/oscillators/dimensions.d.ts +34 -0
  124. package/dist/atlas/oscillators/dimensions.d.ts.map +1 -0
  125. package/dist/atlas/oscillators/dimensions.js +34 -0
  126. package/dist/atlas/oscillators/dimensions.js.map +1 -0
  127. package/dist/atlas/oscillators/index.d.ts +38 -0
  128. package/dist/atlas/oscillators/index.d.ts.map +1 -0
  129. package/dist/atlas/oscillators/index.js +37 -0
  130. package/dist/atlas/oscillators/index.js.map +1 -0
  131. package/dist/atlas/oscillators/models.d.ts +25 -0
  132. package/dist/atlas/oscillators/models.d.ts.map +1 -0
  133. package/dist/atlas/oscillators/models.js +160 -0
  134. package/dist/atlas/oscillators/models.js.map +1 -0
  135. package/dist/atlas/oscillators/rejections.d.ts +21 -0
  136. package/dist/atlas/oscillators/rejections.d.ts.map +1 -0
  137. package/dist/atlas/oscillators/rejections.js +54 -0
  138. package/dist/atlas/oscillators/rejections.js.map +1 -0
  139. package/dist/atlas/path-bound.d.ts +143 -0
  140. package/dist/atlas/path-bound.d.ts.map +1 -0
  141. package/dist/atlas/path-bound.js +268 -0
  142. package/dist/atlas/path-bound.js.map +1 -0
  143. package/dist/atlas/poster/associations.d.ts +66 -0
  144. package/dist/atlas/poster/associations.d.ts.map +1 -0
  145. package/dist/atlas/poster/associations.js +90 -0
  146. package/dist/atlas/poster/associations.js.map +1 -0
  147. package/dist/atlas/poster/derivations.d.ts +156 -0
  148. package/dist/atlas/poster/derivations.d.ts.map +1 -0
  149. package/dist/atlas/poster/derivations.js +430 -0
  150. package/dist/atlas/poster/derivations.js.map +1 -0
  151. package/dist/atlas/poster/statements.d.ts +198 -0
  152. package/dist/atlas/poster/statements.d.ts.map +1 -0
  153. package/dist/atlas/poster/statements.js +365 -0
  154. package/dist/atlas/poster/statements.js.map +1 -0
  155. package/dist/atlas/public.d.ts +26 -0
  156. package/dist/atlas/public.d.ts.map +1 -0
  157. package/dist/atlas/public.js +21 -0
  158. package/dist/atlas/public.js.map +1 -0
  159. package/dist/atlas/regime.d.ts +171 -0
  160. package/dist/atlas/regime.d.ts.map +1 -0
  161. package/dist/atlas/regime.js +309 -0
  162. package/dist/atlas/regime.js.map +1 -0
  163. package/dist/atlas/serialize.d.ts +50 -0
  164. package/dist/atlas/serialize.d.ts.map +1 -0
  165. package/dist/atlas/serialize.js +180 -0
  166. package/dist/atlas/serialize.js.map +1 -0
  167. package/dist/atlas/statement.d.ts +165 -0
  168. package/dist/atlas/statement.d.ts.map +1 -0
  169. package/dist/atlas/statement.js +176 -0
  170. package/dist/atlas/statement.js.map +1 -0
  171. package/dist/atlas/types.d.ts +325 -0
  172. package/dist/atlas/types.d.ts.map +1 -0
  173. package/dist/atlas/types.js +61 -0
  174. package/dist/atlas/types.js.map +1 -0
  175. package/dist/atlas/waves/bridges-closure.d.ts +39 -0
  176. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -0
  177. package/dist/atlas/waves/bridges-closure.js +226 -0
  178. package/dist/atlas/waves/bridges-closure.js.map +1 -0
  179. package/dist/atlas/waves/bridges.d.ts +49 -0
  180. package/dist/atlas/waves/bridges.d.ts.map +1 -0
  181. package/dist/atlas/waves/bridges.js +266 -0
  182. package/dist/atlas/waves/bridges.js.map +1 -0
  183. package/dist/atlas/waves/index.d.ts +16 -0
  184. package/dist/atlas/waves/index.d.ts.map +1 -0
  185. package/dist/atlas/waves/index.js +23 -0
  186. package/dist/atlas/waves/index.js.map +1 -0
  187. package/dist/atlas/waves/models.d.ts +29 -0
  188. package/dist/atlas/waves/models.d.ts.map +1 -0
  189. package/dist/atlas/waves/models.js +127 -0
  190. package/dist/atlas/waves/models.js.map +1 -0
  191. package/dist/atlas/waves/numerics.d.ts +149 -0
  192. package/dist/atlas/waves/numerics.d.ts.map +1 -0
  193. package/dist/atlas/waves/numerics.js +218 -0
  194. package/dist/atlas/waves/numerics.js.map +1 -0
  195. package/dist/atlas/witness-artifact.d.ts +65 -0
  196. package/dist/atlas/witness-artifact.d.ts.map +1 -0
  197. package/dist/atlas/witness-artifact.js +78 -0
  198. package/dist/atlas/witness-artifact.js.map +1 -0
  199. package/dist/atlas/witness-numeric.d.ts +81 -0
  200. package/dist/atlas/witness-numeric.d.ts.map +1 -0
  201. package/dist/atlas/witness-numeric.js +105 -0
  202. package/dist/atlas/witness-numeric.js.map +1 -0
  203. package/dist/atlas/witness-result.d.ts +77 -0
  204. package/dist/atlas/witness-result.d.ts.map +1 -0
  205. package/dist/atlas/witness-result.js +39 -0
  206. package/dist/atlas/witness-result.js.map +1 -0
  207. package/dist/atlas/witness-specs.d.ts +110 -0
  208. package/dist/atlas/witness-specs.d.ts.map +1 -0
  209. package/dist/atlas/witness-specs.js +372 -0
  210. package/dist/atlas/witness-specs.js.map +1 -0
  211. package/dist/atlas/witness-symbolic.d.ts +79 -0
  212. package/dist/atlas/witness-symbolic.d.ts.map +1 -0
  213. package/dist/atlas/witness-symbolic.js +140 -0
  214. package/dist/atlas/witness-symbolic.js.map +1 -0
  215. package/dist/atlas/witnesses/quantum-support.d.ts +50 -0
  216. package/dist/atlas/witnesses/quantum-support.d.ts.map +1 -0
  217. package/dist/atlas/witnesses/quantum-support.js +48 -0
  218. package/dist/atlas/witnesses/quantum-support.js.map +1 -0
  219. package/dist/bridges/be11-decoherence-confrontation.js.map +1 -1
  220. package/dist/bridges/be21-kss-confrontation.js.map +1 -1
  221. package/dist/bridges/be23-planckian-confrontation.js.map +1 -1
  222. package/dist/bridges/be35-bootstrap-confrontation.js.map +1 -1
  223. package/dist/bridges/be36-gw170817-confrontation.js.map +1 -1
  224. package/dist/bridges/be37-cassini-confrontation.js.map +1 -1
  225. package/dist/bridges/be48-collapse-confrontation.js.map +1 -1
  226. package/dist/bridges/be51-lensing-confrontation.d.ts.map +1 -1
  227. package/dist/bridges/be51-lensing-confrontation.js +5 -3
  228. package/dist/bridges/be51-lensing-confrontation.js.map +1 -1
  229. package/dist/bridges/be52-mercury-confrontation.d.ts.map +1 -1
  230. package/dist/bridges/be52-mercury-confrontation.js +4 -1
  231. package/dist/bridges/be52-mercury-confrontation.js.map +1 -1
  232. package/dist/bridges/be55-quantum-hall-confrontation.js.map +1 -1
  233. package/dist/bridges/be56-casimir-confrontation.js.map +1 -1
  234. package/dist/bridges/be58-johnson-nyquist-confrontation.js.map +1 -1
  235. package/dist/bridges/be59-ac-josephson-confrontation.js.map +1 -1
  236. package/dist/bridges/be60-fractional-qh-confrontation.js.map +1 -1
  237. package/dist/bridges/be61-wiedemann-franz-confrontation.js.map +1 -1
  238. package/dist/bridges/be62-bcs-gap-confrontation.js.map +1 -1
  239. package/dist/bridges/be63-chandrasekhar-mass-confrontation.js.map +1 -1
  240. package/dist/bridges/be64-eddington-luminosity-confrontation.js.map +1 -1
  241. package/dist/bridges/be65-jeans-mass-confrontation.js.map +1 -1
  242. package/dist/bridges/bridge-equations.d.ts +2 -2
  243. package/dist/bridges/bridge-equations.d.ts.map +1 -1
  244. package/dist/bridges/bridge-equations.js +2 -2
  245. package/dist/bridges/bridge-equations.js.map +1 -1
  246. package/dist/bridges/catalog-adapter.d.ts.map +1 -1
  247. package/dist/bridges/catalog-adapter.js.map +1 -1
  248. package/dist/bridges/confrontations.d.ts.map +1 -1
  249. package/dist/bridges/confrontations.js +7 -0
  250. package/dist/bridges/confrontations.js.map +1 -1
  251. package/dist/bridges/equations/_be-helpers.d.ts +2 -2
  252. package/dist/bridges/equations/_be-helpers.js +2 -2
  253. package/dist/bridges/equations/be-20-vacuum-energy.js.map +1 -1
  254. package/dist/bridges/equations/be-35-conformal-bootstrap.d.ts +59 -72
  255. package/dist/bridges/equations/be-35-conformal-bootstrap.d.ts.map +1 -1
  256. package/dist/bridges/equations/be-35-conformal-bootstrap.js +66 -98
  257. package/dist/bridges/equations/be-35-conformal-bootstrap.js.map +1 -1
  258. package/dist/bridges/equations/be-48-grw-localization.d.ts +9 -8
  259. package/dist/bridges/equations/be-48-grw-localization.d.ts.map +1 -1
  260. package/dist/bridges/equations/be-48-grw-localization.js +9 -8
  261. package/dist/bridges/equations/be-48-grw-localization.js.map +1 -1
  262. package/dist/bridges/gravitational-lensing.d.ts +10 -0
  263. package/dist/bridges/gravitational-lensing.d.ts.map +1 -1
  264. package/dist/bridges/gravitational-lensing.js.map +1 -1
  265. package/dist/bridges/index.d.ts +125 -7
  266. package/dist/bridges/index.d.ts.map +1 -1
  267. package/dist/bridges/index.js +483 -20
  268. package/dist/bridges/index.js.map +1 -1
  269. package/dist/bridges/observations/types.d.ts +14 -0
  270. package/dist/bridges/observations/types.d.ts.map +1 -1
  271. package/dist/bridges/observations/types.js.map +1 -1
  272. package/dist/bridges/perihelion-precession.d.ts +10 -0
  273. package/dist/bridges/perihelion-precession.d.ts.map +1 -1
  274. package/dist/bridges/perihelion-precession.js.map +1 -1
  275. package/dist/bridges/rhs-registry.js +2 -2
  276. package/dist/canonical/canonical-equation.d.ts +15 -0
  277. package/dist/canonical/canonical-equation.d.ts.map +1 -1
  278. package/dist/canonical/entries/_l1-build.d.ts +1 -1
  279. package/dist/canonical/entries/_l1-build.d.ts.map +1 -1
  280. package/dist/canonical/entries/atomic.d.ts.map +1 -1
  281. package/dist/canonical/entries/atomic.js +23 -0
  282. package/dist/canonical/entries/atomic.js.map +1 -1
  283. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  284. package/dist/canonical/entries/nonmonomial.js +93 -0
  285. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  286. package/dist/canonical/normal-form.js.map +1 -1
  287. package/dist/canonical/residual.d.ts +28 -0
  288. package/dist/canonical/residual.d.ts.map +1 -0
  289. package/dist/canonical/residual.js +31 -0
  290. package/dist/canonical/residual.js.map +1 -0
  291. package/dist/cli/command.d.ts +8 -0
  292. package/dist/cli/command.d.ts.map +1 -1
  293. package/dist/cli/command.js +10 -0
  294. package/dist/cli/command.js.map +1 -1
  295. package/dist/cli/commands/atlas.d.ts +3 -0
  296. package/dist/cli/commands/atlas.d.ts.map +1 -0
  297. package/dist/cli/commands/atlas.js +158 -0
  298. package/dist/cli/commands/atlas.js.map +1 -0
  299. package/dist/cli/commands/audit.js +3 -3
  300. package/dist/cli/commands/candidates.js +3 -3
  301. package/dist/cli/commands/canonical.js +3 -3
  302. package/dist/cli/commands/confront.d.ts.map +1 -1
  303. package/dist/cli/commands/confront.js +8 -1
  304. package/dist/cli/commands/confront.js.map +1 -1
  305. package/dist/cli/commands/connectors.js +7 -7
  306. package/dist/cli/commands/coverage.js +3 -3
  307. package/dist/cli/commands/derive.d.ts.map +1 -1
  308. package/dist/cli/commands/derive.js +40 -9
  309. package/dist/cli/commands/derive.js.map +1 -1
  310. package/dist/cli/commands/discover.d.ts.map +1 -1
  311. package/dist/cli/commands/discover.js +46 -27
  312. package/dist/cli/commands/discover.js.map +1 -1
  313. package/dist/cli/commands/evaluate.d.ts.map +1 -1
  314. package/dist/cli/commands/evaluate.js +2 -1
  315. package/dist/cli/commands/evaluate.js.map +1 -1
  316. package/dist/cli/commands/explain.d.ts.map +1 -1
  317. package/dist/cli/commands/explain.js +19 -6
  318. package/dist/cli/commands/explain.js.map +1 -1
  319. package/dist/cli/commands/index.d.ts +3 -0
  320. package/dist/cli/commands/index.d.ts.map +1 -1
  321. package/dist/cli/commands/index.js +3 -0
  322. package/dist/cli/commands/index.js.map +1 -1
  323. package/dist/cli/commands/map.d.ts.map +1 -1
  324. package/dist/cli/commands/map.js +187 -36
  325. package/dist/cli/commands/map.js.map +1 -1
  326. package/dist/cli/commands/path.d.ts +3 -0
  327. package/dist/cli/commands/path.d.ts.map +1 -0
  328. package/dist/cli/commands/path.js +228 -0
  329. package/dist/cli/commands/path.js.map +1 -0
  330. package/dist/cli/commands/predict.js +4 -4
  331. package/dist/cli/commands/priority.js +2 -2
  332. package/dist/cli/commands/probe.d.ts.map +1 -1
  333. package/dist/cli/commands/probe.js +59 -2
  334. package/dist/cli/commands/probe.js.map +1 -1
  335. package/dist/cli/commands/recover.d.ts.map +1 -1
  336. package/dist/cli/commands/recover.js +25 -6
  337. package/dist/cli/commands/recover.js.map +1 -1
  338. package/dist/cli/commands/regime.d.ts +41 -0
  339. package/dist/cli/commands/regime.d.ts.map +1 -0
  340. package/dist/cli/commands/regime.js +243 -0
  341. package/dist/cli/commands/regime.js.map +1 -0
  342. package/dist/cli/commands/symbolic.js +5 -5
  343. package/dist/cli/errors.d.ts +13 -1
  344. package/dist/cli/errors.d.ts.map +1 -1
  345. package/dist/cli/errors.js +13 -1
  346. package/dist/cli/errors.js.map +1 -1
  347. package/dist/cli/graphs.d.ts.map +1 -1
  348. package/dist/cli/graphs.js +5 -1
  349. package/dist/cli/graphs.js.map +1 -1
  350. package/dist/cli/main.d.ts.map +1 -1
  351. package/dist/cli/main.js +29 -2
  352. package/dist/cli/main.js.map +1 -1
  353. package/dist/cli/output.d.ts +6 -1
  354. package/dist/cli/output.d.ts.map +1 -1
  355. package/dist/cli/output.js.map +1 -1
  356. package/dist/cli/version.js.map +1 -1
  357. package/dist/cli-api.d.ts +21 -1
  358. package/dist/cli-api.d.ts.map +1 -1
  359. package/dist/cli-api.js +23 -1
  360. package/dist/cli-api.js.map +1 -1
  361. package/dist/composition/axis-audit.js.map +1 -1
  362. package/dist/composition/bridge-prediction.d.ts.map +1 -1
  363. package/dist/composition/bridge-prediction.js +0 -0
  364. package/dist/composition/bridge-prediction.js.map +1 -1
  365. package/dist/composition/canonical-compare.d.ts +65 -0
  366. package/dist/composition/canonical-compare.d.ts.map +1 -0
  367. package/dist/composition/canonical-compare.js +237 -0
  368. package/dist/composition/canonical-compare.js.map +1 -0
  369. package/dist/composition/canonical-graph.d.ts +2 -2
  370. package/dist/composition/canonical-graph.js +2 -2
  371. package/dist/composition/canonical-graph.js.map +1 -1
  372. package/dist/composition/canonical-prefactors.d.ts +32 -0
  373. package/dist/composition/canonical-prefactors.d.ts.map +1 -0
  374. package/dist/composition/canonical-prefactors.js +80 -0
  375. package/dist/composition/canonical-prefactors.js.map +1 -0
  376. package/dist/composition/compose-symbolic.d.ts.map +1 -1
  377. package/dist/composition/compose-symbolic.js.map +1 -1
  378. package/dist/composition/compose.d.ts.map +1 -1
  379. package/dist/composition/compose.js +80 -1
  380. package/dist/composition/compose.js.map +1 -1
  381. package/dist/composition/consequence.js.map +1 -1
  382. package/dist/composition/discovery.d.ts +20 -3
  383. package/dist/composition/discovery.d.ts.map +1 -1
  384. package/dist/composition/discovery.js +30 -4
  385. package/dist/composition/discovery.js.map +1 -1
  386. package/dist/composition/edge.d.ts +64 -0
  387. package/dist/composition/edge.d.ts.map +1 -1
  388. package/dist/composition/edge.js +29 -0
  389. package/dist/composition/edge.js.map +1 -1
  390. package/dist/composition/edges/calibration.d.ts.map +1 -1
  391. package/dist/composition/edges/calibration.js +46 -0
  392. package/dist/composition/edges/calibration.js.map +1 -1
  393. package/dist/composition/edges/catalog-quantum.d.ts.map +1 -1
  394. package/dist/composition/edges/catalog-quantum.js +9 -0
  395. package/dist/composition/edges/catalog-quantum.js.map +1 -1
  396. package/dist/composition/edges/catalog-tranche.d.ts.map +1 -1
  397. package/dist/composition/edges/catalog-tranche.js +18 -0
  398. package/dist/composition/edges/catalog-tranche.js.map +1 -1
  399. package/dist/composition/enumerate.js.map +1 -1
  400. package/dist/composition/explain.d.ts +9 -1
  401. package/dist/composition/explain.d.ts.map +1 -1
  402. package/dist/composition/explain.js +34 -8
  403. package/dist/composition/explain.js.map +1 -1
  404. package/dist/composition/expr-eval.d.ts.map +1 -1
  405. package/dist/composition/expr-eval.js.map +1 -1
  406. package/dist/composition/expr-simplify.d.ts +13 -0
  407. package/dist/composition/expr-simplify.d.ts.map +1 -1
  408. package/dist/composition/expr-simplify.js +25 -0
  409. package/dist/composition/expr-simplify.js.map +1 -1
  410. package/dist/composition/expr-subst.js.map +1 -1
  411. package/dist/composition/graph-viz-svg.d.ts.map +1 -1
  412. package/dist/composition/graph-viz.d.ts +118 -1
  413. package/dist/composition/graph-viz.d.ts.map +1 -1
  414. package/dist/composition/graph-viz.js +189 -6
  415. package/dist/composition/graph-viz.js.map +1 -1
  416. package/dist/composition/grounding.d.ts.map +1 -1
  417. package/dist/composition/grounding.js +6 -1
  418. package/dist/composition/grounding.js.map +1 -1
  419. package/dist/composition/identifiability.js.map +1 -1
  420. package/dist/composition/index.d.ts +4 -2
  421. package/dist/composition/index.d.ts.map +1 -1
  422. package/dist/composition/index.js +2 -1
  423. package/dist/composition/index.js.map +1 -1
  424. package/dist/composition/poster-source.d.ts +153 -0
  425. package/dist/composition/poster-source.d.ts.map +1 -0
  426. package/dist/composition/poster-source.js +183 -0
  427. package/dist/composition/poster-source.js.map +1 -0
  428. package/dist/composition/probe/backend-protocol.d.ts +34 -1
  429. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  430. package/dist/composition/probe/backend-protocol.js +9 -2
  431. package/dist/composition/probe/backend-protocol.js.map +1 -1
  432. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  433. package/dist/composition/probe/corpus.d.ts +12 -0
  434. package/dist/composition/probe/corpus.d.ts.map +1 -1
  435. package/dist/composition/probe/corpus.js +100 -0
  436. package/dist/composition/probe/corpus.js.map +1 -1
  437. package/dist/composition/probe/generator.d.ts +14 -0
  438. package/dist/composition/probe/generator.d.ts.map +1 -1
  439. package/dist/composition/probe/generator.js +24 -2
  440. package/dist/composition/probe/generator.js.map +1 -1
  441. package/dist/composition/probe/limits.js.map +1 -1
  442. package/dist/composition/probe/pipeline.d.ts +5 -0
  443. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  444. package/dist/composition/probe/pipeline.js +20 -3
  445. package/dist/composition/probe/pipeline.js.map +1 -1
  446. package/dist/composition/probe/problem.js.map +1 -1
  447. package/dist/composition/probe/report.d.ts.map +1 -1
  448. package/dist/composition/probe/report.js +2 -0
  449. package/dist/composition/probe/report.js.map +1 -1
  450. package/dist/composition/probe/residual.d.ts.map +1 -1
  451. package/dist/composition/probe/residual.js.map +1 -1
  452. package/dist/composition/probe/search-budget.js.map +1 -1
  453. package/dist/composition/proposed-bridges.d.ts +2 -2
  454. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  455. package/dist/composition/proposed-bridges.js +1 -1
  456. package/dist/composition/proposed-bridges.js.map +1 -1
  457. package/dist/composition/retrodiction.js.map +1 -1
  458. package/dist/composition/uncertainty.d.ts +52 -2
  459. package/dist/composition/uncertainty.d.ts.map +1 -1
  460. package/dist/composition/uncertainty.js +38 -2
  461. package/dist/composition/uncertainty.js.map +1 -1
  462. package/dist/composition/user-equation.d.ts.map +1 -1
  463. package/dist/core/constants.d.ts +13 -0
  464. package/dist/core/constants.d.ts.map +1 -1
  465. package/dist/core/constants.js +13 -0
  466. package/dist/core/constants.js.map +1 -1
  467. package/dist/core/flux-rules.d.ts.map +1 -1
  468. package/dist/core/flux-rules.js.map +1 -1
  469. package/dist/core/labeled-tensor.d.ts.map +1 -1
  470. package/dist/core/regime-registry.d.ts.map +1 -1
  471. package/dist/core/regime-rule-install.js.map +1 -1
  472. package/dist/core/tensor.d.ts.map +1 -1
  473. package/dist/core/tensor.js.map +1 -1
  474. package/dist/core/types.d.ts.map +1 -1
  475. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  476. package/dist/diff/bridge-gradient.d.ts +1 -1
  477. package/dist/diff/bridge-gradient.js +1 -1
  478. package/dist/dimensional/ast-types.d.ts +31 -1
  479. package/dist/dimensional/ast-types.d.ts.map +1 -1
  480. package/dist/dimensional/bridge-check.d.ts +1 -1
  481. package/dist/dimensional/bridge-check.js +1 -1
  482. package/dist/dimensional/buckingham.d.ts.map +1 -1
  483. package/dist/dimensional/connection.d.ts +2 -0
  484. package/dist/dimensional/connection.d.ts.map +1 -1
  485. package/dist/dimensional/connection.js +2 -0
  486. package/dist/dimensional/connection.js.map +1 -1
  487. package/dist/dimensional/curvature-composite.d.ts +5 -3
  488. package/dist/dimensional/curvature-composite.d.ts.map +1 -1
  489. package/dist/dimensional/curvature-composite.js +1 -0
  490. package/dist/dimensional/curvature-composite.js.map +1 -1
  491. package/dist/dimensional/curvature-invariants.d.ts +2 -0
  492. package/dist/dimensional/curvature-invariants.d.ts.map +1 -1
  493. package/dist/dimensional/curvature-invariants.js +2 -0
  494. package/dist/dimensional/curvature-invariants.js.map +1 -1
  495. package/dist/dimensional/dimension-spec.d.ts.map +1 -1
  496. package/dist/dimensional/einstein-equation.d.ts +3 -3
  497. package/dist/dimensional/einstein-equation.js +3 -3
  498. package/dist/dimensional/errors.d.ts.map +1 -1
  499. package/dist/dimensional/metric.d.ts +5 -2
  500. package/dist/dimensional/metric.d.ts.map +1 -1
  501. package/dist/dimensional/metric.js +5 -2
  502. package/dist/dimensional/metric.js.map +1 -1
  503. package/dist/dimensional/tensor-trace.js.map +1 -1
  504. package/dist/dimensional/validator-registry.js.map +1 -1
  505. package/dist/dimensional/validator.d.ts +3 -2
  506. package/dist/dimensional/validator.d.ts.map +1 -1
  507. package/dist/dimensional/validator.js +23 -4
  508. package/dist/dimensional/validator.js.map +1 -1
  509. package/dist/index.d.ts +4 -3
  510. package/dist/index.d.ts.map +1 -1
  511. package/dist/index.js +4 -1
  512. package/dist/index.js.map +1 -1
  513. package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -1
  514. package/dist/numerical/curvature-lowering-helpers.js +104 -0
  515. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  516. package/dist/numerical/errors.d.ts.map +1 -1
  517. package/dist/numerical/errors.js.map +1 -1
  518. package/dist/numerical/float64-engine.d.ts.map +1 -1
  519. package/dist/numerical/float64-engine.js +51 -24
  520. package/dist/numerical/float64-engine.js.map +1 -1
  521. package/dist/numerical/formula-dimension.d.ts.map +1 -1
  522. package/dist/numerical/formula-dimension.js.map +1 -1
  523. package/dist/numerical/formula.d.ts.map +1 -1
  524. package/dist/numerical/formula.js.map +1 -1
  525. package/dist/numerical/geometrized.d.ts.map +1 -1
  526. package/dist/numerical/gl4-integrator.d.ts +3 -3
  527. package/dist/numerical/gl4-integrator.js +3 -3
  528. package/dist/numerical/killing.d.ts +47 -5
  529. package/dist/numerical/killing.d.ts.map +1 -1
  530. package/dist/numerical/killing.js +41 -3
  531. package/dist/numerical/killing.js.map +1 -1
  532. package/dist/numerical/klein-gordon.d.ts +2 -2
  533. package/dist/numerical/klein-gordon.js +2 -2
  534. package/dist/numerical/lowering.d.ts +2 -2
  535. package/dist/numerical/lowering.d.ts.map +1 -1
  536. package/dist/numerical/lowering.js +5 -3
  537. package/dist/numerical/lowering.js.map +1 -1
  538. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  539. package/dist/numerical/mathts-engine.js.map +1 -1
  540. package/dist/numerical/metric-inverse.js.map +1 -1
  541. package/dist/numerical/perihelion-finder.d.ts +15 -13
  542. package/dist/numerical/perihelion-finder.d.ts.map +1 -1
  543. package/dist/numerical/perihelion-finder.js +15 -13
  544. package/dist/numerical/perihelion-finder.js.map +1 -1
  545. package/dist/numerical/weyl-lowering.d.ts.map +1 -1
  546. package/dist/numerical/weyl-lowering.js +90 -40
  547. package/dist/numerical/weyl-lowering.js.map +1 -1
  548. package/package.json +163 -104
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Atlas Phase 3 — `Statement`, `Context`, and the CHECKED context union.
3
+ *
4
+ * A `Statement` is a claim IN A CONTEXT, not a string. Design note
5
+ * `docs/planning/Atlas-Phase-3-Design.md` §1: two statements that render
6
+ * identically can be claims about different things when their gauge, frame or
7
+ * assumption set differs, and the poster index will place exactly such pairs
8
+ * next to each other. `context` is therefore the reason this type exists at
9
+ * all rather than reusing `CanonicalEquation`.
10
+ *
11
+ * ## `ast?` is optional ON PURPOSE
12
+ *
13
+ * The poster's hidden supporting nodes — the action principle, Noether, the
14
+ * full Maxwell set, the Lorentz group, the central limit theorem — are
15
+ * valuable because they are NAMED and LINKED, not because they are evaluable.
16
+ * Requiring an `ast` would force either a fabricated encoding or their
17
+ * exclusion, and both are worse than an honest `sourceExpression` with no
18
+ * `ast` (design note §1). Do not make it required.
19
+ *
20
+ * ## The union is CHECKED, never computed
21
+ *
22
+ * {@link contextUnion} does not MERGE contexts. It asks whether a union
23
+ * EXISTS, and returns an explicit refusal when it does not. Two refusals
24
+ * matter, and neither is an error condition:
25
+ *
26
+ * 1. **Convention conflict** — delegated to `checkConventions`, whose contract
27
+ * is that `undefined` means UNKNOWN and is never a mismatch. An absent
28
+ * declaration must not read as agreement, so the asymmetry is preserved
29
+ * here rather than re-derived.
30
+ * 2. **Contradictory assumptions** — Blueprint v2 §5.2 step 2: incompatible
31
+ * assumptions are NEVER POOLED. A derivation whose premises assume mutually
32
+ * exclusive conditions has no context union, therefore no composite.
33
+ *
34
+ * The result is a DISCRIMINATED UNION, mirroring `boundPath`'s no-claim
35
+ * (`./path-bound.ts`): a caller cannot read `.context` off a refusal, because
36
+ * a refusal has no `.context`. That is the whole point — the refusal is
37
+ * enforced by the type, so no caller can read a conclusion off a union that
38
+ * was never formed.
39
+ *
40
+ * Pure: no I/O, no registry reads.
41
+ *
42
+ * @module atlas/statement
43
+ */
44
+ import type { Conventions } from './types.js';
45
+ import type { ModelId } from './model.js';
46
+ import type { ExprNode } from '../dimensional/ast-types.js';
47
+ /** A {@link Statement} id — `'statement-noether'`, … . @internal */
48
+ export type StatementId = string;
49
+ /**
50
+ * The context a claim is made in: what it quantifies over, which choices it
51
+ * fixes, and what it assumes.
52
+ *
53
+ * Every field but `assumptions` and `excludes` is optional, and the SAME
54
+ * asymmetry `checkConventions` documents applies to each: a context that
55
+ * declares no `gauge` has not chosen the Lorenz gauge, it has not said.
56
+ * Absence is unknown, never disagreement.
57
+ *
58
+ * `assumptions` and `excludes` are required (possibly empty) because they are
59
+ * the pair that decides poolability, and an optional one would let a caller
60
+ * omit the field that makes a refusal possible.
61
+ *
62
+ * @internal
63
+ */
64
+ export interface Context {
65
+ /** Canonical quantity types the claim ranges over — `['energy', 'time']`. */
66
+ readonly quantityTypes?: readonly string[];
67
+ /** `'Lorenz'`, `'Coulomb'` — a fixed gauge choice, when the claim depends on one. */
68
+ readonly gauge?: string;
69
+ /** `'comoving'`, `'lab'` — a fixed frame choice, when the claim depends on one. */
70
+ readonly frame?: string;
71
+ /** Sign and unit choices. Compared by `checkConventions`. */
72
+ readonly conventions?: Conventions;
73
+ /** Stated assumptions — `'isolated system'`, `'weak field'`. */
74
+ readonly assumptions: readonly string[];
75
+ /**
76
+ * Assumption strings this context is INCOMPATIBLE with.
77
+ *
78
+ * Declared per context rather than inferred, because no rule in this repo
79
+ * can decide that `'weak field'` and `'strong field'` exclude each other
80
+ * from the strings alone. A guess here would manufacture refusals out of
81
+ * vocabulary rather than physics.
82
+ *
83
+ * Matching is exact string equality against another context's
84
+ * `assumptions`, and it is SYMMETRIC in effect: it is enough for one side
85
+ * to declare the exclusion.
86
+ */
87
+ readonly excludes: readonly string[];
88
+ }
89
+ /**
90
+ * A claim in a context.
91
+ *
92
+ * @internal
93
+ */
94
+ export interface Statement {
95
+ /** `'statement-noether'`, `'statement-l1-maxwell'`, … */
96
+ readonly id: StatementId;
97
+ /** The load-bearing field — see the module note. */
98
+ readonly context: Context;
99
+ readonly model: ModelId;
100
+ /** OPTIONAL BY DESIGN — see the module note. Absent ⇒ named-and-linked only. */
101
+ readonly ast?: ExprNode;
102
+ /** `'dS = 0'` — the source form, always present even when `ast` is not. */
103
+ readonly sourceExpression: string;
104
+ /** Rendered form for the poster index. */
105
+ readonly display: string;
106
+ }
107
+ /** Why a set of contexts has NO union. @internal */
108
+ export type NoUnionReason =
109
+ /** Two contexts DECLARE different values for a convention key. */
110
+ 'convention-conflict'
111
+ /** One context excludes an assumption another one states. */
112
+ | 'contradictory-assumptions'
113
+ /** Two contexts DECLARE different gauges or frames. */
114
+ | 'choice-conflict';
115
+ /** The contexts DO pool, and this is the pooled context. @internal */
116
+ export interface ContextUnionFormed {
117
+ readonly kind: 'union';
118
+ readonly context: Context;
119
+ }
120
+ /** The contexts do NOT pool, and this is why. @internal */
121
+ export interface ContextUnionRefused {
122
+ readonly kind: 'no-union';
123
+ readonly reason: NoUnionReason;
124
+ /** Human-readable specifics: which key, which assumption. */
125
+ readonly detail: string;
126
+ }
127
+ /**
128
+ * The result of {@link contextUnion}: a pooled context, or an explicit refusal.
129
+ *
130
+ * @internal
131
+ */
132
+ export type ContextUnionResult = ContextUnionFormed | ContextUnionRefused;
133
+ /**
134
+ * The union of `contexts`, or an explicit refusal.
135
+ *
136
+ * Three gates, in this order; the FIRST refusal found is the one reported.
137
+ *
138
+ * 1. **Conventions.** Every PAIR is compared with `checkConventions`. Pairwise
139
+ * rather than folded, because folding would compare each context against a
140
+ * running merge and a merge has already lost which side declared what —
141
+ * the exact information the `undefined`-is-unknown rule needs.
142
+ * 2. **Assumptions.** A context's `excludes` entry matching any context's
143
+ * stated `assumption` refuses the pool. Blueprint v2 §5.2 step 2.
144
+ * 3. **Gauge / frame.** Two DECLARED and different values refuse; one declared
145
+ * and one absent does not, mirroring gate 1's asymmetry.
146
+ *
147
+ * An empty list has no union: a union over nothing would be a context
148
+ * asserted about no claim, the same reason `boundPath` throws on an empty
149
+ * path. It is a `RangeError`, not a refusal, because it is a caller bug rather
150
+ * than a physical incompatibility.
151
+ *
152
+ * @throws RangeError when `contexts` is empty.
153
+ * @internal
154
+ */
155
+ export declare function contextUnion(contexts: readonly Context[]): ContextUnionResult;
156
+ /**
157
+ * The context union of a set of STATEMENTS, by id, resolved through `registry`.
158
+ *
159
+ * @throws RangeError if an id does not resolve. An unresolved id silently
160
+ * dropped would narrow the union and could turn a refusal into a pool —
161
+ * precisely the direction that manufactures a false claim.
162
+ * @internal
163
+ */
164
+ export declare function statementContextUnion(ids: readonly StatementId[], registry: ReadonlyMap<StatementId, Statement>): ContextUnionResult;
165
+ //# sourceMappingURL=statement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statement.d.ts","sourceRoot":"","sources":["../../src/atlas/statement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5D,oEAAoE;AACpE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,OAAO;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,gEAAgE;IAChE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,yDAAyD;IACzD,QA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Statement` is a claim IN A CONTEXT, not a string. Design note
5
+ * `docs/planning/Atlas-Phase-3-Design.md` §1: two statements that render
6
+ * identically can be claims about different things when their gauge, frame or
7
+ * assumption set differs, and the poster index will place exactly such pairs
8
+ * next to each other. `context` is therefore the reason this type exists at
9
+ * all rather than reusing `CanonicalEquation`.
10
+ *
11
+ * ## `ast?` is optional ON PURPOSE
12
+ *
13
+ * The poster's hidden supporting nodes — the action principle, Noether, the
14
+ * full Maxwell set, the Lorentz group, the central limit theorem — are
15
+ * valuable because they are NAMED and LINKED, not because they are evaluable.
16
+ * Requiring an `ast` would force either a fabricated encoding or their
17
+ * exclusion, and both are worse than an honest `sourceExpression` with no
18
+ * `ast` (design note §1). Do not make it required.
19
+ *
20
+ * ## The union is CHECKED, never computed
21
+ *
22
+ * {@link contextUnion} does not MERGE contexts. It asks whether a union
23
+ * EXISTS, and returns an explicit refusal when it does not. Two refusals
24
+ * matter, and neither is an error condition:
25
+ *
26
+ * 1. **Convention conflict** — delegated to `checkConventions`, whose contract
27
+ * is that `undefined` means UNKNOWN and is never a mismatch. An absent
28
+ * declaration must not read as agreement, so the asymmetry is preserved
29
+ * here rather than re-derived.
30
+ * 2. **Contradictory assumptions** — Blueprint v2 §5.2 step 2: incompatible
31
+ * assumptions are NEVER POOLED. A derivation whose premises assume mutually
32
+ * exclusive conditions has no context union, therefore no composite.
33
+ *
34
+ * The result is a DISCRIMINATED UNION, mirroring `boundPath`'s no-claim
35
+ * (`./path-bound.ts`): a caller cannot read `.context` off a refusal, because
36
+ * a refusal has no `.context`. That is the whole point — the refusal is
37
+ * enforced by the type, so no caller can read a conclusion off a union that
38
+ * was never formed.
39
+ *
40
+ * Pure: no I/O, no registry reads.
41
+ *
42
+ * @module atlas/statement
43
+ */
44
+ import { checkConventions } from './conventions.js';
45
+ /** Distinct declared values of one optional choice field, across contexts. */
46
+ function declaredChoices(contexts, key) {
47
+ const seen = new Set();
48
+ for (const c of contexts) {
49
+ const v = c[key];
50
+ if (v !== undefined)
51
+ seen.add(v);
52
+ }
53
+ return [...seen];
54
+ }
55
+ /**
56
+ * The union of `contexts`, or an explicit refusal.
57
+ *
58
+ * Three gates, in this order; the FIRST refusal found is the one reported.
59
+ *
60
+ * 1. **Conventions.** Every PAIR is compared with `checkConventions`. Pairwise
61
+ * rather than folded, because folding would compare each context against a
62
+ * running merge and a merge has already lost which side declared what —
63
+ * the exact information the `undefined`-is-unknown rule needs.
64
+ * 2. **Assumptions.** A context's `excludes` entry matching any context's
65
+ * stated `assumption` refuses the pool. Blueprint v2 §5.2 step 2.
66
+ * 3. **Gauge / frame.** Two DECLARED and different values refuse; one declared
67
+ * and one absent does not, mirroring gate 1's asymmetry.
68
+ *
69
+ * An empty list has no union: a union over nothing would be a context
70
+ * asserted about no claim, the same reason `boundPath` throws on an empty
71
+ * path. It is a `RangeError`, not a refusal, because it is a caller bug rather
72
+ * than a physical incompatibility.
73
+ *
74
+ * @throws RangeError when `contexts` is empty.
75
+ * @internal
76
+ */
77
+ export function contextUnion(contexts) {
78
+ if (contexts.length === 0) {
79
+ throw new RangeError('contextUnion: no contexts; a union over nothing states nothing');
80
+ }
81
+ // ── Gate 1: no DECLARED convention pair may disagree ──────────────────────
82
+ for (let i = 0; i < contexts.length; i++) {
83
+ for (let j = i + 1; j < contexts.length; j++) {
84
+ const clash = checkConventions(contexts[i].conventions, contexts[j].conventions);
85
+ if (clash.length > 0) {
86
+ return {
87
+ kind: 'no-union',
88
+ reason: 'convention-conflict',
89
+ detail: `contexts ${i} and ${j} declare different values for ` +
90
+ `${clash.map((k) => `'${k}'`).join(', ')}; they do not pool`,
91
+ };
92
+ }
93
+ }
94
+ }
95
+ // ── Gate 2: incompatible assumptions are NEVER pooled ─────────────────────
96
+ const stated = new Map();
97
+ for (let i = 0; i < contexts.length; i++) {
98
+ for (const a of contexts[i].assumptions) {
99
+ if (!stated.has(a))
100
+ stated.set(a, i);
101
+ }
102
+ }
103
+ for (let i = 0; i < contexts.length; i++) {
104
+ for (const x of contexts[i].excludes) {
105
+ const at = stated.get(x);
106
+ if (at !== undefined) {
107
+ return {
108
+ kind: 'no-union',
109
+ reason: 'contradictory-assumptions',
110
+ detail: `context ${i} excludes '${x}', which context ${at} assumes; ` +
111
+ 'incompatible assumptions are never pooled',
112
+ };
113
+ }
114
+ }
115
+ }
116
+ // ── Gate 3: a declared gauge or frame may not be contradicted ─────────────
117
+ for (const key of ['gauge', 'frame']) {
118
+ const values = declaredChoices(contexts, key);
119
+ if (values.length > 1) {
120
+ return {
121
+ kind: 'no-union',
122
+ reason: 'choice-conflict',
123
+ detail: `the contexts declare ${values.length} different ${key}s ` +
124
+ `(${values.map((v) => `'${v}'`).join(', ')}); they do not pool`,
125
+ };
126
+ }
127
+ }
128
+ // ── The pool ──────────────────────────────────────────────────────────────
129
+ // Conventions merge by KEY rather than by object, so a context silent on a
130
+ // key inherits another's declaration instead of erasing it. Gate 1 has
131
+ // already proved no two declarations disagree, so the order of assignment
132
+ // cannot change the result.
133
+ const conventions = {};
134
+ for (const c of contexts) {
135
+ for (const [k, v] of Object.entries(c.conventions ?? {})) {
136
+ if (v !== undefined)
137
+ conventions[k] = v;
138
+ }
139
+ }
140
+ const quantityTypes = [...new Set(contexts.flatMap((c) => c.quantityTypes ?? []))];
141
+ const gauge = declaredChoices(contexts, 'gauge')[0];
142
+ const frame = declaredChoices(contexts, 'frame')[0];
143
+ return {
144
+ kind: 'union',
145
+ context: {
146
+ ...(quantityTypes.length > 0 ? { quantityTypes } : {}),
147
+ ...(gauge !== undefined ? { gauge } : {}),
148
+ ...(frame !== undefined ? { frame } : {}),
149
+ ...(Object.keys(conventions).length > 0
150
+ ? { conventions: conventions }
151
+ : {}),
152
+ assumptions: [...stated.keys()],
153
+ excludes: [...new Set(contexts.flatMap((c) => c.excludes))],
154
+ },
155
+ };
156
+ }
157
+ /**
158
+ * The context union of a set of STATEMENTS, by id, resolved through `registry`.
159
+ *
160
+ * @throws RangeError if an id does not resolve. An unresolved id silently
161
+ * dropped would narrow the union and could turn a refusal into a pool —
162
+ * precisely the direction that manufactures a false claim.
163
+ * @internal
164
+ */
165
+ export function statementContextUnion(ids, registry) {
166
+ const contexts = [];
167
+ for (const id of ids) {
168
+ const s = registry.get(id);
169
+ if (s === undefined) {
170
+ throw new RangeError(`statementContextUnion: unknown statement '${id}'`);
171
+ }
172
+ contexts.push(s.context);
173
+ }
174
+ return contextUnion(contexts);
175
+ }
176
+ //# sourceMappingURL=statement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statement.js","sourceRoot":"","sources":["../../src/atlas/statement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmGpD,8EAA8E;AAC9E,SAAS,eAAe,CACtB,QAA4B,EAC5B,GAAsB;IAEtB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,KAAK,SAAS;YAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,YAAY,CAAC,QAA4B;IACvD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,UAAU,CAAC,gEAAgE,CAAC,CAAC;IACzF,CAAC;IAED,6EAA6E;IAC7E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,C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