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,93 @@
1
+ /**
2
+ * Atlas Phase 1 — convention comparison.
3
+ *
4
+ * `Conventions` (`src/atlas/types.ts`) records the sign and unit choices a
5
+ * record depends on. Two records that disagree on one of those choices are not
6
+ * directly comparable, and this module says WHICH keys disagree.
7
+ *
8
+ * **`undefined` is "unknown", never "mismatch", and that asymmetry is the
9
+ * whole design.** A record that declares nothing about the metric signature
10
+ * has not chosen `'+---'`; it has not said. Reporting the absence as a
11
+ * disagreement would manufacture conflicts out of missing data — and because
12
+ * almost every record in the repo declares nothing today, it would manufacture
13
+ * them at scale. The same reasoning that makes design note §3 require a
14
+ * NON-EMPTY `conventions` before `convention-checked` can be derived applies
15
+ * in the mirror here: absence earns neither a tag nor an accusation.
16
+ *
17
+ * A mismatch is therefore reported only when BOTH sides declare the key and
18
+ * the declared values differ.
19
+ *
20
+ * @module atlas/conventions
21
+ */
22
+ /**
23
+ * Every key of `Conventions`, as values. Written out rather than derived,
24
+ * because a type has no runtime extent; `tests/atlas/conventions.test.ts`
25
+ * pins this list against the interface so a new field cannot be added to
26
+ * `Conventions` and silently skipped by the comparison.
27
+ */
28
+ const CONVENTION_KEYS = [
29
+ 'heatWorkSign',
30
+ 'metricSignature',
31
+ 'fourierNormalization',
32
+ 'unitSystem',
33
+ 'capacitorChargeSign',
34
+ ];
35
+ /**
36
+ * The convention keys on which `a` and `b` DECLARE different values.
37
+ *
38
+ * Returns an empty list when they agree, when either side is absent, and when
39
+ * neither declares a key in common.
40
+ *
41
+ * ⚠ **An empty list is NOT a statement that the two are compatible** — it means
42
+ * no DECLARED pair disagrees. Eve (E1, 2026-09-21) flagged that this conflates
43
+ * the safe case with the dangerous one: record A declaring `metricSignature:
44
+ * '-+++'` while B simply never declared it returns `[]`, exactly like genuine
45
+ * agreement, and a caller printing nothing leads a reader to infer "checked, no
46
+ * conflict". Silence is not agreement. Use {@link unknownConventionKeys} to
47
+ * surface that case, and prefer reporting the two together.
48
+ *
49
+ * @param a - one record's conventions, or `undefined` when it declares none.
50
+ * @param b - the other record's conventions, or `undefined`.
51
+ * @returns the mismatched keys, in `Conventions` declaration order.
52
+ *
53
+ * @internal
54
+ */
55
+ export function checkConventions(a, b) {
56
+ if (a === undefined || b === undefined)
57
+ return [];
58
+ return CONVENTION_KEYS.filter((k) => {
59
+ const av = a[k];
60
+ const bv = b[k];
61
+ // Either side silent ⇒ unknown, not disagreement.
62
+ if (av === undefined || bv === undefined)
63
+ return false;
64
+ return av !== bv;
65
+ });
66
+ }
67
+ /**
68
+ * The convention keys where exactly ONE side declares a value — the cases
69
+ * {@link checkConventions} deliberately does not call mismatches.
70
+ *
71
+ * This exists because "no declared pair disagrees" and "these two are
72
+ * compatible" are different claims, and only the first is checkable from the
73
+ * data. A key listed here is a question, not a conflict: the records MIGHT use
74
+ * opposite sign conventions and one simply never said. Reporting it separately
75
+ * lets a reader distinguish *verified agreement* from *nobody wrote it down*,
76
+ * which is the distinction an empty mismatch list destroys.
77
+ *
78
+ * Both sides absent is NOT unknown — it is simply a key nobody uses, so it is
79
+ * omitted. Only an asymmetric declaration is reported.
80
+ *
81
+ * @internal
82
+ */
83
+ export function unknownConventionKeys(a, b) {
84
+ const av = a ?? {};
85
+ const bv = b ?? {};
86
+ return CONVENTION_KEYS.filter((k) => {
87
+ const x = av[k];
88
+ const y = bv[k];
89
+ // Exactly one declared: the asymmetric case. Neither declared ⇒ not a question.
90
+ return (x === undefined) !== (y === undefined);
91
+ });
92
+ }
93
+ //# sourceMappingURL=conventions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/atlas/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH;;;;;GAKG;AACH,MAAM,eAAe,GAA6B;IAChD,cAAc;IACd,iBAAiB;IACjB,sBAAsB;IACtB,YAAY;IACZ,qBAAqB;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,CAA0B,EAC1B,CAA0B;IAE1B,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAClD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QAClC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,kDAAkD;QAClD,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QACvD,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CACnC,CAA0B,EAC1B,CAA0B;IAE1B,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;IACnB,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QAClC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAChB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAChB,gFAAgF;QAChF,OAAO,CAAC,CAAC,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Atlas Phase 1, S1.3 — evidence coverage, counted BY TAG.
3
+ *
4
+ * Design note `docs/planning/Atlas-Phase-1-Design.md` §3: *"Any future commit
5
+ * that appears to raise a row's evidence without adding a witness is a bug,
6
+ * and the coverage report is what makes it visible: it reports counts BY TAG,
7
+ * so a jump is legible."*
8
+ *
9
+ * A single "how many records have evidence" total would hide exactly the
10
+ * movement this report exists to expose — one tag inflating while another
11
+ * drains reads as no change at all. So the report is per tag, every tag is
12
+ * present with an explicit zero, and `records` is reported beside the counts
13
+ * (the counts do not sum to it: a record carries several tags).
14
+ *
15
+ * Pure: no I/O, no catalog import, no caching — every function here takes
16
+ * what it counts as an argument, so it can never disagree with a registry.
17
+ *
18
+ * @module atlas/coverage
19
+ * @internal
20
+ */
21
+ import type { EvidenceTag } from './types.js';
22
+ export { ALL_EVIDENCE_TAGS } from './types.js';
23
+ /** Counts by tag over a set of records. @internal */
24
+ export interface EvidenceCoverage {
25
+ /** How many records were counted. */
26
+ readonly records: number;
27
+ /** One entry per `EvidenceTag`, zero included. Counts overlap by design. */
28
+ readonly byTag: Readonly<Record<EvidenceTag, number>>;
29
+ }
30
+ /**
31
+ * Count derived evidence sets by tag.
32
+ *
33
+ * @param evidenceSets - one derived set per record, e.g. the output of
34
+ * `deriveEvidence` mapped over a catalog. Deriving is the caller's job; this
35
+ * function never derives, so it cannot disagree with the derivation.
36
+ * @internal
37
+ */
38
+ export declare function summarizeEvidence(evidenceSets: Iterable<ReadonlySet<EvidenceTag>>): EvidenceCoverage;
39
+ /**
40
+ * How much of the catalog carries the Phase 1 overlay.
41
+ *
42
+ * `summarizeEvidence` above answers "what support do these records have";
43
+ * this answers the different question "how much has anyone LOOKED at". The two
44
+ * must not be conflated: a row can be `verified` (its derived tag set is
45
+ * non-empty, which a machine check produces) while nobody has recorded a
46
+ * `relation` for it at all.
47
+ *
48
+ * - `schema` — the denominator: the 55 catalog rows plus the canonical
49
+ * registry. The atlas families are NOT in it; they are reported separately,
50
+ * because a nine-model pilot would otherwise dilute a catalog-wide fraction.
51
+ * - `audited` — a HUMAN set `relation` or `conventions` on the record.
52
+ * - `verified` — a derived evidence tag set is non-empty. Passed IN, never
53
+ * derived here, for the same reason `summarizeEvidence` never derives.
54
+ * - `notYetAudited` — `schema − audited`, stated rather than left to arithmetic.
55
+ *
56
+ * @internal
57
+ */
58
+ export interface OverlayCoverage {
59
+ readonly schema: number;
60
+ readonly audited: number;
61
+ readonly verified: number;
62
+ readonly notYetAudited: number;
63
+ /** The atlas pilot, reported beside the catalog and never mixed into it. */
64
+ readonly atlas: {
65
+ readonly bridges: number;
66
+ readonly reviewed: number;
67
+ };
68
+ }
69
+ /** A record that may carry the Phase 1 overlay. Structural, so this module
70
+ * imports no registry and cannot become a second source of truth. @internal */
71
+ export interface OverlayBearing {
72
+ readonly relation?: unknown;
73
+ readonly conventions?: unknown;
74
+ }
75
+ /** An atlas bridge, reduced to the one field this report reads. @internal */
76
+ export interface ReviewStatusBearing {
77
+ readonly reviewStatus: 'proposed' | 'reviewed';
78
+ }
79
+ /**
80
+ * Count overlay coverage over the catalog rows and canonical entries.
81
+ *
82
+ * Every input is PASSED IN. The module stays pure and importless, so it can
83
+ * never disagree with the registries — the caller states which registries it
84
+ * counted, exactly as `summarizeEvidence` requires its caller to state which
85
+ * evidence sets it derived.
86
+ *
87
+ * @param schemaRecords - the catalog rows and canonical entries, concatenated.
88
+ * @param verifiedCount - how many of them have a non-empty derived tag set.
89
+ * @param atlasBridges - the atlas pilot's bridges, reported separately.
90
+ * @internal
91
+ */
92
+ export declare function overlayCoverage(schemaRecords: readonly OverlayBearing[], verifiedCount: number, atlasBridges: readonly ReviewStatusBearing[]): OverlayCoverage;
93
+ //# sourceMappingURL=coverage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../src/atlas/coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;CACvD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,GAC/C,gBAAgB,CAWlB;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE;AAED;+EAC+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,UAAU,GAAG,UAAU,CAAC;CAChD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,SAAS,cAAc,EAAE,EACxC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,SAAS,mBAAmB,EAAE,GAC3C,eAAe,CAcjB"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Atlas Phase 1, S1.3 — evidence coverage, counted BY TAG.
3
+ *
4
+ * Design note `docs/planning/Atlas-Phase-1-Design.md` §3: *"Any future commit
5
+ * that appears to raise a row's evidence without adding a witness is a bug,
6
+ * and the coverage report is what makes it visible: it reports counts BY TAG,
7
+ * so a jump is legible."*
8
+ *
9
+ * A single "how many records have evidence" total would hide exactly the
10
+ * movement this report exists to expose — one tag inflating while another
11
+ * drains reads as no change at all. So the report is per tag, every tag is
12
+ * present with an explicit zero, and `records` is reported beside the counts
13
+ * (the counts do not sum to it: a record carries several tags).
14
+ *
15
+ * Pure: no I/O, no catalog import, no caching — every function here takes
16
+ * what it counts as an argument, so it can never disagree with a registry.
17
+ *
18
+ * @module atlas/coverage
19
+ * @internal
20
+ */
21
+ import { ALL_EVIDENCE_TAGS } from './types.js';
22
+ // Moved to `types.ts`: the derived-tag literals may appear under `src/atlas/`
23
+ // only there and in `derive-evidence.ts`. Re-exported so callers are unchanged.
24
+ export { ALL_EVIDENCE_TAGS } from './types.js';
25
+ /**
26
+ * Count derived evidence sets by tag.
27
+ *
28
+ * @param evidenceSets - one derived set per record, e.g. the output of
29
+ * `deriveEvidence` mapped over a catalog. Deriving is the caller's job; this
30
+ * function never derives, so it cannot disagree with the derivation.
31
+ * @internal
32
+ */
33
+ export function summarizeEvidence(evidenceSets) {
34
+ const byTag = Object.fromEntries(ALL_EVIDENCE_TAGS.map((t) => [t, 0]));
35
+ let records = 0;
36
+ for (const set of evidenceSets) {
37
+ records += 1;
38
+ for (const tag of set)
39
+ byTag[tag] += 1;
40
+ }
41
+ return { records, byTag };
42
+ }
43
+ /**
44
+ * Count overlay coverage over the catalog rows and canonical entries.
45
+ *
46
+ * Every input is PASSED IN. The module stays pure and importless, so it can
47
+ * never disagree with the registries — the caller states which registries it
48
+ * counted, exactly as `summarizeEvidence` requires its caller to state which
49
+ * evidence sets it derived.
50
+ *
51
+ * @param schemaRecords - the catalog rows and canonical entries, concatenated.
52
+ * @param verifiedCount - how many of them have a non-empty derived tag set.
53
+ * @param atlasBridges - the atlas pilot's bridges, reported separately.
54
+ * @internal
55
+ */
56
+ export function overlayCoverage(schemaRecords, verifiedCount, atlasBridges) {
57
+ const audited = schemaRecords.filter((r) => r.relation !== undefined || r.conventions !== undefined).length;
58
+ return {
59
+ schema: schemaRecords.length,
60
+ audited,
61
+ verified: verifiedCount,
62
+ notYetAudited: schemaRecords.length - audited,
63
+ atlas: {
64
+ bridges: atlasBridges.length,
65
+ reviewed: atlasBridges.filter((b) => b.reviewStatus === 'reviewed').length,
66
+ },
67
+ };
68
+ }
69
+ //# sourceMappingURL=coverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../src/atlas/coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,8EAA8E;AAC9E,gFAAgF;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAU/C;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAgD;IAEhD,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAGpE,CAAC;IACF,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,CAAC;QACb,KAAK,MAAM,GAAG,IAAI,GAAG;YAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC;AA8CD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAC7B,aAAwC,EACxC,aAAqB,EACrB,YAA4C;IAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAClC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,WAAW,KAAK,SAAS,CAC/D,CAAC,MAAM,CAAC;IACT,OAAO;QACL,MAAM,EAAE,aAAa,CAAC,MAAM;QAC5B,OAAO;QACP,QAAQ,EAAE,aAAa;QACvB,aAAa,EAAE,aAAa,CAAC,MAAM,GAAG,OAAO;QAC7C,KAAK,EAAE;YACL,OAAO,EAAE,YAAY,CAAC,MAAM;YAC5B,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,UAAU,CAAC,CAAC,MAAM;SAC3E;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Atlas Phase 3 — `Derivation` (a hyperedge) and multicategory composition.
3
+ *
4
+ * A `Derivation` is many premises and one conclusion. Composing two of them is
5
+ * the operation design note `docs/planning/Atlas-Phase-3-Design.md` §0 names as
6
+ * the one that can silently produce a false claim, and it states the invariant
7
+ * this module exists to enforce:
8
+ *
9
+ * > A hyperedge composes only when EVERY premise edge is exact, and the
10
+ * > composite's premises are the union of the inputs' premises MINUS the
11
+ * > internal conclusions.
12
+ *
13
+ * Four gates enforce it, and each one is a reason to refuse:
14
+ *
15
+ * 1. **Consumption.** `second` must actually consume `first`'s conclusion. If
16
+ * it does not, the two are unrelated hyperedges and gluing them would
17
+ * assert a chain that was never drawn.
18
+ * 2. **Relation.** `composeRelation` decides, exactly as it does for a binary
19
+ * chain. **A hyperedge cannot launder a pair the binary table refuses**
20
+ * (§3): if the two relations land on one of the fifty-six
21
+ * `'no-composite-claim'` cells, the hyperedge carries no claim either. This
22
+ * is also where "only exact hyperedges compose" is enforced — the table's
23
+ * eight defined cells ARE that set, and re-deciding exactness here with a
24
+ * second rule would be a second place for it to rot.
25
+ * 3. **Context.** The union over every statement involved must EXIST.
26
+ * `statementContextUnion` returns a refusal rather than a merge when it
27
+ * does not, and that refusal propagates: no union, no composite.
28
+ * 4. **Premises.** The composite's premises are `first.premises ∪
29
+ * second.premises` minus the internal conclusions — here, `first.conclusion`.
30
+ *
31
+ * ## Why the primary API returns a union and does not throw
32
+ *
33
+ * The S3.1 brief says composition "throws". The design note (§2) says the
34
+ * refusal "is the correct output rather than an error", and requires the
35
+ * result type to make "these do not compose" expressible WITHOUT a number or a
36
+ * conclusion attached — mirroring `boundPath`'s no-claim. Both are served
37
+ * here: {@link composeDerivations} returns a discriminated union, and
38
+ * {@link composeDerivationsOrThrow} is a thin strict wrapper for callers that
39
+ * genuinely want a failure. The union is primary because it is the shape a
40
+ * caller cannot misread — a refusal has no `.derivation` to read.
41
+ *
42
+ * Pure: no I/O, no registry reads beyond the map a caller passes in.
43
+ *
44
+ * @module atlas/derivation
45
+ */
46
+ import type { ContextUnionResult, Statement, StatementId } from './statement.js';
47
+ import type { RelationType } from './types.js';
48
+ /** A `Derivation` id — `'d-noether-energy'`, … . @internal */
49
+ export type DerivationId = string;
50
+ /**
51
+ * Many premises, one conclusion.
52
+ *
53
+ * `contextUnion` is a FIELD rather than a method because it is checked once,
54
+ * at construction, and carried: a record whose premises do not pool is a
55
+ * record that states no claim, and that fact travels with it.
56
+ *
57
+ * @internal
58
+ */
59
+ export interface Derivation {
60
+ readonly id: DerivationId;
61
+ readonly relation: RelationType;
62
+ readonly premises: readonly StatementId[];
63
+ readonly conclusion: StatementId;
64
+ readonly sideConditions: readonly string[];
65
+ /** CHECKED, never merged. A `'no-union'` here means this record claims nothing. */
66
+ readonly contextUnion: ContextUnionResult;
67
+ }
68
+ /** A `Derivation` without its checked union — what {@link makeDerivation} takes. @internal */
69
+ export type DerivationSpec = Omit<Derivation, 'contextUnion'>;
70
+ /**
71
+ * Build a `Derivation`, checking the context union of its premises AND its
72
+ * conclusion.
73
+ *
74
+ * The conclusion is included deliberately: a conclusion stated in a context
75
+ * incompatible with its own premises is exactly the false claim §0 warns
76
+ * about, and leaving it out would let one through.
77
+ *
78
+ * @throws RangeError via `statementContextUnion` if an id does not resolve.
79
+ * @internal
80
+ */
81
+ export declare function makeDerivation(spec: DerivationSpec, registry: ReadonlyMap<StatementId, Statement>): Derivation;
82
+ /** Why two hyperedges do not compose. @internal */
83
+ export type NoCompositeReason =
84
+ /** `second` does not consume `first`'s conclusion. */
85
+ 'not-consumed'
86
+ /** The binary composition table refuses the pair of relations. */
87
+ | 'no-composite-claim'
88
+ /** The statements involved have no context union. */
89
+ | 'no-context-union'
90
+ /** One of the inputs already states no claim of its own. */
91
+ | 'input-states-no-claim';
92
+ /** The composite hyperedge. @internal */
93
+ export interface CompositeFormed {
94
+ readonly kind: 'composite';
95
+ readonly derivation: Derivation;
96
+ }
97
+ /** The two hyperedges do NOT compose, and this is why. @internal */
98
+ export interface CompositeRefused {
99
+ readonly kind: 'no-composite';
100
+ readonly reason: NoCompositeReason;
101
+ readonly detail: string;
102
+ }
103
+ /** The result of {@link composeDerivations}. @internal */
104
+ export type DerivationCompositionResult = CompositeFormed | CompositeRefused;
105
+ /** Thrown by {@link composeDerivationsOrThrow}. Carries the refusal verbatim. @internal */
106
+ export declare class DerivationCompositionError extends Error {
107
+ readonly reason: NoCompositeReason;
108
+ constructor(refusal: CompositeRefused);
109
+ }
110
+ /**
111
+ * Compose `first` then `second` into one hyperedge, or refuse and say why.
112
+ *
113
+ * `D1: {A, B} ⊢ C` composed with `D2: {C, E} ⊢ F` yields `{A, B, E} ⊢ F`:
114
+ * `C` is the internal conclusion and leaves the composite's premises.
115
+ *
116
+ * Premise ORDER is `first`'s surviving premises followed by `second`'s, each
117
+ * de-duplicated on first appearance. Stable rather than sorted, so a composite
118
+ * reads in the order the derivation was performed.
119
+ *
120
+ * @param id - the composite's id. Supplied by the caller rather than derived
121
+ * from the inputs, because a generated id would be a new identifier the
122
+ * registry does not know about.
123
+ * @internal
124
+ */
125
+ export declare function composeDerivations(id: DerivationId, first: Derivation, second: Derivation, registry: ReadonlyMap<StatementId, Statement>): DerivationCompositionResult;
126
+ /**
127
+ * {@link composeDerivations}, throwing on refusal.
128
+ *
129
+ * For callers that treat a refusal as a failure. Prefer the union-returning
130
+ * form: a thrown error is easy to catch and discard, and a discarded refusal
131
+ * is how a composite gets used anyway.
132
+ *
133
+ * @throws DerivationCompositionError on any refusal.
134
+ * @internal
135
+ */
136
+ export declare function composeDerivationsOrThrow(id: DerivationId, first: Derivation, second: Derivation, registry: ReadonlyMap<StatementId, Statement>): Derivation;
137
+ //# sourceMappingURL=derivation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivation.d.ts","sourceRoot":"","sources":["../../src/atlas/derivation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,8DAA8D;AAC9D,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,mFAAmF;IACnF,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;CAC3C;AAED,8FAA8F;AAC9F,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,GAC5C,UAAU,CAKZ;AAED,mDAAmD;AACnD,MAAM,MAAM,iBAAiB;AAC3B,sDAAsD;AACpD,cAAc;AAChB,kEAAkE;GAChE,oBAAoB;AACtB,qDAAqD;GACnD,kBAAkB;AACpB,4DAA4D;GAC1D,uBAAuB,CAAC;AAE5B,yCAAyC;AACzC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACjC;AAED,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,0DAA0D;AAC1D,MAAM,MAAM,2BAA2B,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAE7E,2FAA2F;AAC3F,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,YAAY,OAAO,EAAE,gBAAgB,EAIpC;CACF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,YAAY,EAChB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,GAC5C,2BAA2B,CA2F7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,YAAY,EAChB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,GAC5C,UAAU,CAIZ"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Atlas Phase 3 — `Derivation` (a hyperedge) and multicategory composition.
3
+ *
4
+ * A `Derivation` is many premises and one conclusion. Composing two of them is
5
+ * the operation design note `docs/planning/Atlas-Phase-3-Design.md` §0 names as
6
+ * the one that can silently produce a false claim, and it states the invariant
7
+ * this module exists to enforce:
8
+ *
9
+ * > A hyperedge composes only when EVERY premise edge is exact, and the
10
+ * > composite's premises are the union of the inputs' premises MINUS the
11
+ * > internal conclusions.
12
+ *
13
+ * Four gates enforce it, and each one is a reason to refuse:
14
+ *
15
+ * 1. **Consumption.** `second` must actually consume `first`'s conclusion. If
16
+ * it does not, the two are unrelated hyperedges and gluing them would
17
+ * assert a chain that was never drawn.
18
+ * 2. **Relation.** `composeRelation` decides, exactly as it does for a binary
19
+ * chain. **A hyperedge cannot launder a pair the binary table refuses**
20
+ * (§3): if the two relations land on one of the fifty-six
21
+ * `'no-composite-claim'` cells, the hyperedge carries no claim either. This
22
+ * is also where "only exact hyperedges compose" is enforced — the table's
23
+ * eight defined cells ARE that set, and re-deciding exactness here with a
24
+ * second rule would be a second place for it to rot.
25
+ * 3. **Context.** The union over every statement involved must EXIST.
26
+ * `statementContextUnion` returns a refusal rather than a merge when it
27
+ * does not, and that refusal propagates: no union, no composite.
28
+ * 4. **Premises.** The composite's premises are `first.premises ∪
29
+ * second.premises` minus the internal conclusions — here, `first.conclusion`.
30
+ *
31
+ * ## Why the primary API returns a union and does not throw
32
+ *
33
+ * The S3.1 brief says composition "throws". The design note (§2) says the
34
+ * refusal "is the correct output rather than an error", and requires the
35
+ * result type to make "these do not compose" expressible WITHOUT a number or a
36
+ * conclusion attached — mirroring `boundPath`'s no-claim. Both are served
37
+ * here: {@link composeDerivations} returns a discriminated union, and
38
+ * {@link composeDerivationsOrThrow} is a thin strict wrapper for callers that
39
+ * genuinely want a failure. The union is primary because it is the shape a
40
+ * caller cannot misread — a refusal has no `.derivation` to read.
41
+ *
42
+ * Pure: no I/O, no registry reads beyond the map a caller passes in.
43
+ *
44
+ * @module atlas/derivation
45
+ */
46
+ import { composeRelation, NO_COMPOSITE_CLAIM } from './composition-table.js';
47
+ import { statementContextUnion } from './statement.js';
48
+ /**
49
+ * Build a `Derivation`, checking the context union of its premises AND its
50
+ * conclusion.
51
+ *
52
+ * The conclusion is included deliberately: a conclusion stated in a context
53
+ * incompatible with its own premises is exactly the false claim §0 warns
54
+ * about, and leaving it out would let one through.
55
+ *
56
+ * @throws RangeError via `statementContextUnion` if an id does not resolve.
57
+ * @internal
58
+ */
59
+ export function makeDerivation(spec, registry) {
60
+ return {
61
+ ...spec,
62
+ contextUnion: statementContextUnion([...spec.premises, spec.conclusion], registry),
63
+ };
64
+ }
65
+ /** Thrown by {@link composeDerivationsOrThrow}. Carries the refusal verbatim. @internal */
66
+ export class DerivationCompositionError extends Error {
67
+ reason;
68
+ constructor(refusal) {
69
+ super(refusal.detail);
70
+ this.name = 'DerivationCompositionError';
71
+ this.reason = refusal.reason;
72
+ }
73
+ }
74
+ /**
75
+ * Compose `first` then `second` into one hyperedge, or refuse and say why.
76
+ *
77
+ * `D1: {A, B} ⊢ C` composed with `D2: {C, E} ⊢ F` yields `{A, B, E} ⊢ F`:
78
+ * `C` is the internal conclusion and leaves the composite's premises.
79
+ *
80
+ * Premise ORDER is `first`'s surviving premises followed by `second`'s, each
81
+ * de-duplicated on first appearance. Stable rather than sorted, so a composite
82
+ * reads in the order the derivation was performed.
83
+ *
84
+ * @param id - the composite's id. Supplied by the caller rather than derived
85
+ * from the inputs, because a generated id would be a new identifier the
86
+ * registry does not know about.
87
+ * @internal
88
+ */
89
+ export function composeDerivations(id, first, second, registry) {
90
+ // ── Gate 0: an input that claims nothing composes to nothing ──────────────
91
+ for (const [label, d] of [
92
+ ['first', first],
93
+ ['second', second],
94
+ ]) {
95
+ if (d.contextUnion.kind === 'no-union') {
96
+ return {
97
+ kind: 'no-composite',
98
+ reason: 'input-states-no-claim',
99
+ detail: `${label} derivation '${d.id}' has no context union ` +
100
+ `(${d.contextUnion.reason}: ${d.contextUnion.detail}), so it states no claim to compose`,
101
+ };
102
+ }
103
+ }
104
+ // ── Gate 1: `second` must consume `first`'s conclusion ────────────────────
105
+ if (!second.premises.includes(first.conclusion)) {
106
+ return {
107
+ kind: 'no-composite',
108
+ reason: 'not-consumed',
109
+ detail: `'${second.id}' does not take '${first.conclusion}' as a premise ` +
110
+ `(its premises are ${second.premises.map((p) => `'${p}'`).join(', ')}), ` +
111
+ `so '${first.id}' does not feed it`,
112
+ };
113
+ }
114
+ // ── Gate 2: the binary table governs, and a hyperedge cannot launder it ───
115
+ const relation = composeRelation(first.relation, second.relation);
116
+ if (relation === NO_COMPOSITE_CLAIM) {
117
+ return {
118
+ kind: 'no-composite',
119
+ reason: NO_COMPOSITE_CLAIM,
120
+ detail: `'${first.id}' (${first.relation}) then '${second.id}' (${second.relation}) ` +
121
+ 'composes to no relation; a hyperedge cannot assert what the binary table refuses',
122
+ };
123
+ }
124
+ // ── Gate 4 (computed before gate 3 so the union covers the right set) ─────
125
+ // The composite's premises: the union of the inputs' premises MINUS the
126
+ // internal conclusions. `first.conclusion` is the only internal one for a
127
+ // two-input composition; it is removed from BOTH sides, so a premise that
128
+ // `first` also happened to require does not survive as an input it no longer
129
+ // needs.
130
+ const internal = new Set([first.conclusion]);
131
+ const premises = [];
132
+ for (const p of [...first.premises, ...second.premises]) {
133
+ if (internal.has(p))
134
+ continue;
135
+ if (premises.includes(p))
136
+ continue;
137
+ premises.push(p);
138
+ }
139
+ // ── Gate 3: the pooled context must exist over EVERY statement involved ───
140
+ // Every statement, not just the surviving premises: the internal conclusion
141
+ // is what the two halves meet at, and an incompatibility there is exactly
142
+ // the one that would vanish from the composite's own field.
143
+ const involved = [
144
+ ...new Set([
145
+ ...first.premises,
146
+ first.conclusion,
147
+ ...second.premises,
148
+ second.conclusion,
149
+ ]),
150
+ ];
151
+ const union = statementContextUnion(involved, registry);
152
+ if (union.kind === 'no-union') {
153
+ return {
154
+ kind: 'no-composite',
155
+ reason: 'no-context-union',
156
+ detail: `'${first.id}' and '${second.id}' have no context union ` +
157
+ `(${union.reason}: ${union.detail})`,
158
+ };
159
+ }
160
+ return {
161
+ kind: 'composite',
162
+ derivation: {
163
+ id,
164
+ relation,
165
+ premises,
166
+ conclusion: second.conclusion,
167
+ sideConditions: [
168
+ ...new Set([...first.sideConditions, ...second.sideConditions]),
169
+ ],
170
+ contextUnion: union,
171
+ },
172
+ };
173
+ }
174
+ /**
175
+ * {@link composeDerivations}, throwing on refusal.
176
+ *
177
+ * For callers that treat a refusal as a failure. Prefer the union-returning
178
+ * form: a thrown error is easy to catch and discard, and a discarded refusal
179
+ * is how a composite gets used anyway.
180
+ *
181
+ * @throws DerivationCompositionError on any refusal.
182
+ * @internal
183
+ */
184
+ export function composeDerivationsOrThrow(id, first, second, registry) {
185
+ const result = composeDerivations(id, first, second, registry);
186
+ if (result.kind === 'no-composite')
187
+ throw new DerivationCompositionError(result);
188
+ return result.derivation;
189
+ }
190
+ //# sourceMappingURL=derivation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivation.js","sourceRoot":"","sources":["../../src/atlas/derivation.ts"],"names":[],"mappings":"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"}