universal-physics-tensor 8.0.0 → 10.0.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 (916) hide show
  1. package/README.md +26 -21
  2. package/data/atlas/atlas.json +75 -64
  3. package/data/atlas/atlas.jsonld +1 -1
  4. package/data/atlas/diffusion.json +23 -22
  5. package/data/atlas/oscillators.json +21 -16
  6. package/data/atlas/waves.json +33 -28
  7. package/data/bridge-catalog.json +1356 -1791
  8. package/data/bridge-catalog.schema.json +789 -46
  9. package/data/quantities.json +280 -234
  10. package/data/quantities.schema.json +52 -0
  11. package/data/schemas/atlas-record.v0.json +184 -46
  12. package/data/units.json +1178 -0
  13. package/data/units.schema.json +124 -0
  14. package/dist/atlas/applicability.d.ts.map +1 -1
  15. package/dist/atlas/applicability.js +14 -3
  16. package/dist/atlas/applicability.js.map +1 -1
  17. package/dist/atlas/association.d.ts +1 -1
  18. package/dist/atlas/association.js.map +1 -1
  19. package/dist/atlas/benchmark/backend-shapes.d.ts.map +1 -1
  20. package/dist/atlas/benchmark/backend-shapes.js +5 -1
  21. package/dist/atlas/benchmark/backend-shapes.js.map +1 -1
  22. package/dist/atlas/benchmark/baselines.d.ts.map +1 -1
  23. package/dist/atlas/benchmark/baselines.js +8 -0
  24. package/dist/atlas/benchmark/baselines.js.map +1 -1
  25. package/dist/atlas/benchmark/hybrid-retrieval.d.ts +3 -2
  26. package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
  27. package/dist/atlas/benchmark/hybrid-retrieval.js +16 -12
  28. package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
  29. package/dist/atlas/benchmark/leakage.js.map +1 -1
  30. package/dist/atlas/benchmark/loader.js.map +1 -1
  31. package/dist/atlas/benchmark/run-atlas.d.ts.map +1 -1
  32. package/dist/atlas/benchmark/run-atlas.js +14 -2
  33. package/dist/atlas/benchmark/run-atlas.js.map +1 -1
  34. package/dist/atlas/benchmark/stats.d.ts +1 -1
  35. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  36. package/dist/atlas/benchmark/stats.js +1 -1
  37. package/dist/atlas/benchmark/stats.js.map +1 -1
  38. package/dist/atlas/benchmark/study.js.map +1 -1
  39. package/dist/atlas/benchmark/types.js.map +1 -1
  40. package/dist/atlas/bridge-record.d.ts +4 -4
  41. package/dist/atlas/bridge-record.d.ts.map +1 -1
  42. package/dist/atlas/bridge-record.js +6 -6
  43. package/dist/atlas/bridge-record.js.map +1 -1
  44. package/dist/atlas/catalog-formal-ref.js.map +1 -1
  45. package/dist/atlas/chain-pipeline.d.ts +0 -11
  46. package/dist/atlas/chain-pipeline.d.ts.map +1 -1
  47. package/dist/atlas/chain-pipeline.js +5 -16
  48. package/dist/atlas/chain-pipeline.js.map +1 -1
  49. package/dist/atlas/composition-table.js.map +1 -1
  50. package/dist/atlas/conventions.js.map +1 -1
  51. package/dist/atlas/coverage.d.ts +2 -2
  52. package/dist/atlas/coverage.js.map +1 -1
  53. package/dist/atlas/derivation.js.map +1 -1
  54. package/dist/atlas/derive-evidence.d.ts +6 -4
  55. package/dist/atlas/derive-evidence.d.ts.map +1 -1
  56. package/dist/atlas/derive-evidence.js +7 -2
  57. package/dist/atlas/derive-evidence.js.map +1 -1
  58. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
  59. package/dist/atlas/diffusion/bridges-closure.js +0 -5
  60. package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
  61. package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
  62. package/dist/atlas/diffusion/bridges.js +0 -3
  63. package/dist/atlas/diffusion/bridges.js.map +1 -1
  64. package/dist/atlas/diffusion/dimensions.js.map +1 -1
  65. package/dist/atlas/diffusion/index.d.ts +1 -1
  66. package/dist/atlas/diffusion/index.d.ts.map +1 -1
  67. package/dist/atlas/diffusion/index.js.map +1 -1
  68. package/dist/atlas/diffusion/models.js.map +1 -1
  69. package/dist/atlas/diffusion/numerics.js.map +1 -1
  70. package/dist/atlas/error-algebra.d.ts +6 -0
  71. package/dist/atlas/error-algebra.d.ts.map +1 -1
  72. package/dist/atlas/error-algebra.js +26 -0
  73. package/dist/atlas/error-algebra.js.map +1 -1
  74. package/dist/atlas/export.d.ts +18 -2
  75. package/dist/atlas/export.d.ts.map +1 -1
  76. package/dist/atlas/export.js +9 -3
  77. package/dist/atlas/export.js.map +1 -1
  78. package/dist/atlas/families.d.ts +19 -2
  79. package/dist/atlas/families.d.ts.map +1 -1
  80. package/dist/atlas/families.js +26 -3
  81. package/dist/atlas/families.js.map +1 -1
  82. package/dist/atlas/family.d.ts +27 -0
  83. package/dist/atlas/family.d.ts.map +1 -0
  84. package/dist/atlas/family.js +12 -0
  85. package/dist/atlas/family.js.map +1 -0
  86. package/dist/atlas/index.d.ts +3 -2
  87. package/dist/atlas/index.d.ts.map +1 -1
  88. package/dist/atlas/index.js +2 -1
  89. package/dist/atlas/index.js.map +1 -1
  90. package/dist/atlas/link-prediction.d.ts +1 -1
  91. package/dist/atlas/link-prediction.d.ts.map +1 -1
  92. package/dist/atlas/link-prediction.js.map +1 -1
  93. package/dist/atlas/model.js.map +1 -1
  94. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
  95. package/dist/atlas/oscillators/bridges-coarse.js +0 -1
  96. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
  97. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
  98. package/dist/atlas/oscillators/bridges-exact.js +0 -3
  99. package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
  100. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
  101. package/dist/atlas/oscillators/bridges-limits.js +0 -2
  102. package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
  103. package/dist/atlas/oscillators/dimensions.js.map +1 -1
  104. package/dist/atlas/oscillators/index.d.ts +1 -16
  105. package/dist/atlas/oscillators/index.d.ts.map +1 -1
  106. package/dist/atlas/oscillators/index.js.map +1 -1
  107. package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
  108. package/dist/atlas/oscillators/models.js.map +1 -1
  109. package/dist/atlas/oscillators/norm-transport-witness.js.map +1 -1
  110. package/dist/atlas/oscillators/norm-transport.js.map +1 -1
  111. package/dist/atlas/oscillators/norms.js.map +1 -1
  112. package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
  113. package/dist/atlas/oscillators/phase-carriage.js.map +1 -1
  114. package/dist/atlas/oscillators/phase-translation.js.map +1 -1
  115. package/dist/atlas/oscillators/position-translation.js.map +1 -1
  116. package/dist/atlas/oscillators/rejections.js.map +1 -1
  117. package/dist/atlas/path-bound.js.map +1 -1
  118. package/dist/atlas/physjs-entries.generated.d.ts +1601 -220
  119. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  120. package/dist/atlas/physjs-entries.generated.js +1854 -345
  121. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  122. package/dist/atlas/physjs-ref.d.ts +151 -117
  123. package/dist/atlas/physjs-ref.d.ts.map +1 -1
  124. package/dist/atlas/physjs-ref.js +244 -211
  125. package/dist/atlas/physjs-ref.js.map +1 -1
  126. package/dist/atlas/physjs-reviewed.d.ts +31 -0
  127. package/dist/atlas/physjs-reviewed.d.ts.map +1 -0
  128. package/dist/atlas/physjs-reviewed.js +194 -0
  129. package/dist/atlas/physjs-reviewed.js.map +1 -0
  130. package/dist/atlas/poster/associations.js.map +1 -1
  131. package/dist/atlas/poster/derivations.js.map +1 -1
  132. package/dist/atlas/poster/statements.js.map +1 -1
  133. package/dist/atlas/proof-target.d.ts +16 -8
  134. package/dist/atlas/proof-target.d.ts.map +1 -1
  135. package/dist/atlas/proof-target.js +34 -31
  136. package/dist/atlas/proof-target.js.map +1 -1
  137. package/dist/atlas/public.d.ts +2 -1
  138. package/dist/atlas/public.d.ts.map +1 -1
  139. package/dist/atlas/public.js +2 -1
  140. package/dist/atlas/public.js.map +1 -1
  141. package/dist/atlas/regime.js.map +1 -1
  142. package/dist/atlas/serialize.d.ts +18 -12
  143. package/dist/atlas/serialize.d.ts.map +1 -1
  144. package/dist/atlas/serialize.js +28 -18
  145. package/dist/atlas/serialize.js.map +1 -1
  146. package/dist/atlas/statement.js.map +1 -1
  147. package/dist/atlas/translation-registry.js.map +1 -1
  148. package/dist/atlas/translation.js.map +1 -1
  149. package/dist/atlas/types.d.ts +9 -2
  150. package/dist/atlas/types.d.ts.map +1 -1
  151. package/dist/atlas/types.js +1 -1
  152. package/dist/atlas/types.js.map +1 -1
  153. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
  154. package/dist/atlas/waves/bridges-closure.js +0 -3
  155. package/dist/atlas/waves/bridges-closure.js.map +1 -1
  156. package/dist/atlas/waves/bridges.d.ts.map +1 -1
  157. package/dist/atlas/waves/bridges.js +0 -4
  158. package/dist/atlas/waves/bridges.js.map +1 -1
  159. package/dist/atlas/waves/index.d.ts +1 -1
  160. package/dist/atlas/waves/index.d.ts.map +1 -1
  161. package/dist/atlas/waves/index.js.map +1 -1
  162. package/dist/atlas/waves/models.js.map +1 -1
  163. package/dist/atlas/waves/numerics.js.map +1 -1
  164. package/dist/atlas/witness-artifact.js.map +1 -1
  165. package/dist/atlas/witness-dominance.d.ts +4 -3
  166. package/dist/atlas/witness-dominance.d.ts.map +1 -1
  167. package/dist/atlas/witness-dominance.js +15 -5
  168. package/dist/atlas/witness-dominance.js.map +1 -1
  169. package/dist/atlas/witness-numeric.d.ts +8 -4
  170. package/dist/atlas/witness-numeric.d.ts.map +1 -1
  171. package/dist/atlas/witness-numeric.js +27 -2
  172. package/dist/atlas/witness-numeric.js.map +1 -1
  173. package/dist/atlas/witness-result.d.ts +7 -1
  174. package/dist/atlas/witness-result.d.ts.map +1 -1
  175. package/dist/atlas/witness-result.js.map +1 -1
  176. package/dist/atlas/witness-specs.js.map +1 -1
  177. package/dist/atlas/witness-symbolic.js.map +1 -1
  178. package/dist/atlas/witnesses/quantum-support.js.map +1 -1
  179. package/dist/bridges/caller-table.d.ts +1 -1
  180. package/dist/bridges/caller-table.d.ts.map +1 -1
  181. package/dist/bridges/caller-table.js.map +1 -1
  182. package/dist/bridges/carrier-sign.d.ts.map +1 -1
  183. package/dist/bridges/carrier-sign.js +8 -3
  184. package/dist/bridges/carrier-sign.js.map +1 -1
  185. package/dist/bridges/catalog-adapter.d.ts +12 -3
  186. package/dist/bridges/catalog-adapter.d.ts.map +1 -1
  187. package/dist/bridges/catalog-adapter.js +22 -14
  188. package/dist/bridges/catalog-adapter.js.map +1 -1
  189. package/dist/bridges/catalog-load.d.ts +19 -2
  190. package/dist/bridges/catalog-load.d.ts.map +1 -1
  191. package/dist/bridges/catalog-load.js +233 -14
  192. package/dist/bridges/catalog-load.js.map +1 -1
  193. package/dist/bridges/catalog-types.d.ts +96 -27
  194. package/dist/bridges/catalog-types.d.ts.map +1 -1
  195. package/dist/bridges/catalog-types.js.map +1 -1
  196. package/dist/bridges/coefficient-statement.js +1 -5
  197. package/dist/bridges/coefficient-statement.js.map +1 -1
  198. package/dist/bridges/confrontation-coverage.js.map +1 -1
  199. package/dist/bridges/confrontations.d.ts +1 -1
  200. package/dist/bridges/confrontations.d.ts.map +1 -1
  201. package/dist/bridges/confrontations.js +1 -1
  202. package/dist/bridges/confrontations.js.map +1 -1
  203. package/dist/bridges/evaluation-errors.d.ts +89 -0
  204. package/dist/bridges/evaluation-errors.d.ts.map +1 -0
  205. package/dist/bridges/evaluation-errors.js +136 -0
  206. package/dist/bridges/evaluation-errors.js.map +1 -0
  207. package/dist/bridges/evaluator-inputs.d.ts +5 -3
  208. package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
  209. package/dist/bridges/evaluator-inputs.js +24 -24
  210. package/dist/bridges/evaluator-inputs.js.map +1 -1
  211. package/dist/bridges/evaluators.d.ts +48 -8
  212. package/dist/bridges/evaluators.d.ts.map +1 -1
  213. package/dist/bridges/evaluators.js +173 -38
  214. package/dist/bridges/evaluators.js.map +1 -1
  215. package/dist/bridges/expr-parse.d.ts +38 -7
  216. package/dist/bridges/expr-parse.d.ts.map +1 -1
  217. package/dist/bridges/expr-parse.js +129 -156
  218. package/dist/bridges/expr-parse.js.map +1 -1
  219. package/dist/bridges/holds.d.ts +16 -8
  220. package/dist/bridges/holds.d.ts.map +1 -1
  221. package/dist/bridges/holds.js +130 -236
  222. package/dist/bridges/holds.js.map +1 -1
  223. package/dist/bridges/index.d.ts +15 -14
  224. package/dist/bridges/index.d.ts.map +1 -1
  225. package/dist/bridges/index.js +14 -15
  226. package/dist/bridges/index.js.map +1 -1
  227. package/dist/bridges/input-contract.d.ts +65 -0
  228. package/dist/bridges/input-contract.d.ts.map +1 -0
  229. package/dist/bridges/input-contract.js +97 -0
  230. package/dist/bridges/input-contract.js.map +1 -0
  231. package/dist/bridges/membership.d.ts +5 -3
  232. package/dist/bridges/membership.d.ts.map +1 -1
  233. package/dist/bridges/membership.js +5 -6
  234. package/dist/bridges/membership.js.map +1 -1
  235. package/dist/bridges/notices.d.ts +11 -0
  236. package/dist/bridges/notices.d.ts.map +1 -0
  237. package/dist/bridges/notices.js +22 -0
  238. package/dist/bridges/notices.js.map +1 -0
  239. package/dist/bridges/observations/types.js.map +1 -1
  240. package/dist/bridges/rejected.d.ts +11 -17
  241. package/dist/bridges/rejected.d.ts.map +1 -1
  242. package/dist/bridges/rejected.js +13 -68
  243. package/dist/bridges/rejected.js.map +1 -1
  244. package/dist/bridges/relation-eval.d.ts +5 -6
  245. package/dist/bridges/relation-eval.d.ts.map +1 -1
  246. package/dist/bridges/relation-eval.js +9 -38
  247. package/dist/bridges/relation-eval.js.map +1 -1
  248. package/dist/bridges/rhs-registry.js.map +1 -1
  249. package/dist/bridges/sensitivity.d.ts +11 -3
  250. package/dist/bridges/sensitivity.d.ts.map +1 -1
  251. package/dist/bridges/sensitivity.js +24 -10
  252. package/dist/bridges/sensitivity.js.map +1 -1
  253. package/dist/bridges/tensor-index.js.map +1 -1
  254. package/dist/bridges/types.d.ts +1 -7
  255. package/dist/bridges/types.d.ts.map +1 -1
  256. package/dist/bridges/types.js +1 -4
  257. package/dist/bridges/types.js.map +1 -1
  258. package/dist/canonical/canonical-equation.d.ts +31 -0
  259. package/dist/canonical/canonical-equation.d.ts.map +1 -1
  260. package/dist/canonical/canonical-equation.js.map +1 -1
  261. package/dist/canonical/dimensional-fields.js.map +1 -1
  262. package/dist/canonical/entries/_l1-build.js.map +1 -1
  263. package/dist/canonical/entries/atomic.d.ts.map +1 -1
  264. package/dist/canonical/entries/atomic.js +11 -1
  265. package/dist/canonical/entries/atomic.js.map +1 -1
  266. package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
  267. package/dist/canonical/entries/condensed-matter.js +7 -4
  268. package/dist/canonical/entries/condensed-matter.js.map +1 -1
  269. package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
  270. package/dist/canonical/entries/dimensional-classics.js +50 -2
  271. package/dist/canonical/entries/dimensional-classics.js.map +1 -1
  272. package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
  273. package/dist/canonical/entries/electromagnetism.js +32 -2
  274. package/dist/canonical/entries/electromagnetism.js.map +1 -1
  275. package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
  276. package/dist/canonical/entries/fluids-waves.js +34 -0
  277. package/dist/canonical/entries/fluids-waves.js.map +1 -1
  278. package/dist/canonical/entries/mechanics.d.ts.map +1 -1
  279. package/dist/canonical/entries/mechanics.js +24 -0
  280. package/dist/canonical/entries/mechanics.js.map +1 -1
  281. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  282. package/dist/canonical/entries/nonmonomial.js +42 -24
  283. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  284. package/dist/canonical/entries/relativity.d.ts.map +1 -1
  285. package/dist/canonical/entries/relativity.js +6 -0
  286. package/dist/canonical/entries/relativity.js.map +1 -1
  287. package/dist/canonical/entries/statistical-mechanics.d.ts.map +1 -1
  288. package/dist/canonical/entries/statistical-mechanics.js +24 -5
  289. package/dist/canonical/entries/statistical-mechanics.js.map +1 -1
  290. package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
  291. package/dist/canonical/entries/thermo-nuclear-cosmo.js +15 -0
  292. package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
  293. package/dist/canonical/linkage.d.ts +29 -4
  294. package/dist/canonical/linkage.d.ts.map +1 -1
  295. package/dist/canonical/linkage.js +31 -29
  296. package/dist/canonical/linkage.js.map +1 -1
  297. package/dist/canonical/normal-form.d.ts +0 -8
  298. package/dist/canonical/normal-form.d.ts.map +1 -1
  299. package/dist/canonical/normal-form.js +17 -12
  300. package/dist/canonical/normal-form.js.map +1 -1
  301. package/dist/canonical/registry.js.map +1 -1
  302. package/dist/canonical/residual.js.map +1 -1
  303. package/dist/canonical/seed-l-layer.d.ts +7 -1
  304. package/dist/canonical/seed-l-layer.d.ts.map +1 -1
  305. package/dist/canonical/seed-l-layer.js +7 -1
  306. package/dist/canonical/seed-l-layer.js.map +1 -1
  307. package/dist/canonical/structural.d.ts +21 -0
  308. package/dist/canonical/structural.d.ts.map +1 -1
  309. package/dist/canonical/structural.js +24 -4
  310. package/dist/canonical/structural.js.map +1 -1
  311. package/dist/cases/brownian-sphere.js +4 -4
  312. package/dist/cases/brownian-sphere.js.map +1 -1
  313. package/dist/cases/damped-resonator.js +2 -2
  314. package/dist/cases/damped-resonator.js.map +1 -1
  315. package/dist/cases/index.d.ts +9 -2
  316. package/dist/cases/index.d.ts.map +1 -1
  317. package/dist/cases/index.js +26 -7
  318. package/dist/cases/index.js.map +1 -1
  319. package/dist/cases/kepler-rv.js +6 -6
  320. package/dist/cases/kepler-rv.js.map +1 -1
  321. package/dist/cases/lumped-cooling.js +1 -1
  322. package/dist/cases/lumped-cooling.js.map +1 -1
  323. package/dist/cases/quadrature.js.map +1 -1
  324. package/dist/cases/resistor-noise.js +3 -3
  325. package/dist/cases/resistor-noise.js.map +1 -1
  326. package/dist/cases/skin-depth.js.map +1 -1
  327. package/dist/cases/types.js.map +1 -1
  328. package/dist/cli/args.d.ts +7 -2
  329. package/dist/cli/args.d.ts.map +1 -1
  330. package/dist/cli/args.js +18 -2
  331. package/dist/cli/args.js.map +1 -1
  332. package/dist/cli/bindings.d.ts +13 -0
  333. package/dist/cli/bindings.d.ts.map +1 -0
  334. package/dist/cli/bindings.js +32 -0
  335. package/dist/cli/bindings.js.map +1 -0
  336. package/dist/cli/closed-form-range.js.map +1 -1
  337. package/dist/cli/command.js.map +1 -1
  338. package/dist/cli/commands/_atlas-map.d.ts +3 -3
  339. package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
  340. package/dist/cli/commands/_atlas-map.js +43 -18
  341. package/dist/cli/commands/_atlas-map.js.map +1 -1
  342. package/dist/cli/commands/_atlas-route.js.map +1 -1
  343. package/dist/cli/commands/_discovery-opts.d.ts +2 -1
  344. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  345. package/dist/cli/commands/_discovery-opts.js +48 -18
  346. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  347. package/dist/cli/commands/atlas.d.ts.map +1 -1
  348. package/dist/cli/commands/atlas.js +7 -12
  349. package/dist/cli/commands/atlas.js.map +1 -1
  350. package/dist/cli/commands/audit.d.ts.map +1 -1
  351. package/dist/cli/commands/audit.js +13 -21
  352. package/dist/cli/commands/audit.js.map +1 -1
  353. package/dist/cli/commands/axes.js.map +1 -1
  354. package/dist/cli/commands/candidates.d.ts.map +1 -1
  355. package/dist/cli/commands/candidates.js +16 -8
  356. package/dist/cli/commands/candidates.js.map +1 -1
  357. package/dist/cli/commands/canonical.js.map +1 -1
  358. package/dist/cli/commands/chain.js +1 -1
  359. package/dist/cli/commands/chain.js.map +1 -1
  360. package/dist/cli/commands/confront.d.ts.map +1 -1
  361. package/dist/cli/commands/confront.js +22 -14
  362. package/dist/cli/commands/confront.js.map +1 -1
  363. package/dist/cli/commands/connectors.d.ts.map +1 -1
  364. package/dist/cli/commands/connectors.js +8 -9
  365. package/dist/cli/commands/connectors.js.map +1 -1
  366. package/dist/cli/commands/coverage.js.map +1 -1
  367. package/dist/cli/commands/derive.d.ts.map +1 -1
  368. package/dist/cli/commands/derive.js +50 -26
  369. package/dist/cli/commands/derive.js.map +1 -1
  370. package/dist/cli/commands/discover.d.ts.map +1 -1
  371. package/dist/cli/commands/discover.js +18 -13
  372. package/dist/cli/commands/discover.js.map +1 -1
  373. package/dist/cli/commands/eval.d.ts.map +1 -1
  374. package/dist/cli/commands/eval.js +29 -26
  375. package/dist/cli/commands/eval.js.map +1 -1
  376. package/dist/cli/commands/evaluate.d.ts +1 -35
  377. package/dist/cli/commands/evaluate.d.ts.map +1 -1
  378. package/dist/cli/commands/evaluate.js +99 -208
  379. package/dist/cli/commands/evaluate.js.map +1 -1
  380. package/dist/cli/commands/explain.d.ts.map +1 -1
  381. package/dist/cli/commands/explain.js +57 -45
  382. package/dist/cli/commands/explain.js.map +1 -1
  383. package/dist/cli/commands/frontier.js.map +1 -1
  384. package/dist/cli/commands/ground.d.ts.map +1 -1
  385. package/dist/cli/commands/ground.js +41 -11
  386. package/dist/cli/commands/ground.js.map +1 -1
  387. package/dist/cli/commands/index.js.map +1 -1
  388. package/dist/cli/commands/map.d.ts.map +1 -1
  389. package/dist/cli/commands/map.js +84 -92
  390. package/dist/cli/commands/map.js.map +1 -1
  391. package/dist/cli/commands/metric.d.ts.map +1 -1
  392. package/dist/cli/commands/metric.js +53 -15
  393. package/dist/cli/commands/metric.js.map +1 -1
  394. package/dist/cli/commands/path.js +4 -4
  395. package/dist/cli/commands/path.js.map +1 -1
  396. package/dist/cli/commands/predict.js.map +1 -1
  397. package/dist/cli/commands/priority.js.map +1 -1
  398. package/dist/cli/commands/probe.d.ts.map +1 -1
  399. package/dist/cli/commands/probe.js +50 -26
  400. package/dist/cli/commands/probe.js.map +1 -1
  401. package/dist/cli/commands/recover.js +1 -1
  402. package/dist/cli/commands/recover.js.map +1 -1
  403. package/dist/cli/commands/regime.d.ts +5 -4
  404. package/dist/cli/commands/regime.d.ts.map +1 -1
  405. package/dist/cli/commands/regime.js +25 -27
  406. package/dist/cli/commands/regime.js.map +1 -1
  407. package/dist/cli/commands/retrieve.d.ts.map +1 -1
  408. package/dist/cli/commands/retrieve.js +22 -14
  409. package/dist/cli/commands/retrieve.js.map +1 -1
  410. package/dist/cli/commands/search.d.ts.map +1 -1
  411. package/dist/cli/commands/search.js +8 -4
  412. package/dist/cli/commands/search.js.map +1 -1
  413. package/dist/cli/commands/symbolic.d.ts.map +1 -1
  414. package/dist/cli/commands/symbolic.js +14 -7
  415. package/dist/cli/commands/symbolic.js.map +1 -1
  416. package/dist/cli/commands/testplan.js +4 -4
  417. package/dist/cli/commands/testplan.js.map +1 -1
  418. package/dist/cli/conventions.d.ts +6 -7
  419. package/dist/cli/conventions.d.ts.map +1 -1
  420. package/dist/cli/conventions.js +19 -28
  421. package/dist/cli/conventions.js.map +1 -1
  422. package/dist/cli/determination.js.map +1 -1
  423. package/dist/cli/errors.js.map +1 -1
  424. package/dist/cli/euler-guard.d.ts +13 -2
  425. package/dist/cli/euler-guard.d.ts.map +1 -1
  426. package/dist/cli/euler-guard.js +17 -3
  427. package/dist/cli/euler-guard.js.map +1 -1
  428. package/dist/cli/eval-numbers.d.ts +4 -9
  429. package/dist/cli/eval-numbers.d.ts.map +1 -1
  430. package/dist/cli/eval-numbers.js +11 -41
  431. package/dist/cli/eval-numbers.js.map +1 -1
  432. package/dist/cli/expr-print.d.ts +29 -2
  433. package/dist/cli/expr-print.d.ts.map +1 -1
  434. package/dist/cli/expr-print.js +46 -2
  435. package/dist/cli/expr-print.js.map +1 -1
  436. package/dist/cli/flag-help.js.map +1 -1
  437. package/dist/cli/graphs.js.map +1 -1
  438. package/dist/cli/library-defaults.d.ts +19 -0
  439. package/dist/cli/library-defaults.d.ts.map +1 -0
  440. package/dist/cli/library-defaults.js +22 -0
  441. package/dist/cli/library-defaults.js.map +1 -0
  442. package/dist/cli/main.js +7 -3
  443. package/dist/cli/main.js.map +1 -1
  444. package/dist/cli/map-evidence.js.map +1 -1
  445. package/dist/cli/output.d.ts +3 -6
  446. package/dist/cli/output.d.ts.map +1 -1
  447. package/dist/cli/output.js.map +1 -1
  448. package/dist/cli/published-url.d.ts +2 -0
  449. package/dist/cli/published-url.d.ts.map +1 -1
  450. package/dist/cli/published-url.js +5 -0
  451. package/dist/cli/published-url.js.map +1 -1
  452. package/dist/cli/record-reach.d.ts +6 -0
  453. package/dist/cli/record-reach.d.ts.map +1 -1
  454. package/dist/cli/record-reach.js +16 -10
  455. package/dist/cli/record-reach.js.map +1 -1
  456. package/dist/cli/record-tables.d.ts +2 -1
  457. package/dist/cli/record-tables.d.ts.map +1 -1
  458. package/dist/cli/record-tables.js +8 -3
  459. package/dist/cli/record-tables.js.map +1 -1
  460. package/dist/cli/record.d.ts.map +1 -1
  461. package/dist/cli/record.js +31 -12
  462. package/dist/cli/record.js.map +1 -1
  463. package/dist/cli/search-index.d.ts +5 -0
  464. package/dist/cli/search-index.d.ts.map +1 -1
  465. package/dist/cli/search-index.js +12 -1
  466. package/dist/cli/search-index.js.map +1 -1
  467. package/dist/cli/statuses.js.map +1 -1
  468. package/dist/cli/top-level-help.js.map +1 -1
  469. package/dist/cli/version.js.map +1 -1
  470. package/dist/cli-api.d.ts +57 -18
  471. package/dist/cli-api.d.ts.map +1 -1
  472. package/dist/cli-api.js +49 -21
  473. package/dist/cli-api.js.map +1 -1
  474. package/dist/composition/adjudication.d.ts +8 -30
  475. package/dist/composition/adjudication.d.ts.map +1 -1
  476. package/dist/composition/adjudication.js +15 -67
  477. package/dist/composition/adjudication.js.map +1 -1
  478. package/dist/composition/aliases.d.ts +1 -1
  479. package/dist/composition/aliases.d.ts.map +1 -1
  480. package/dist/composition/aliases.js +10 -20
  481. package/dist/composition/aliases.js.map +1 -1
  482. package/dist/composition/audit-coverage.d.ts +2 -0
  483. package/dist/composition/audit-coverage.d.ts.map +1 -1
  484. package/dist/composition/audit-coverage.js.map +1 -1
  485. package/dist/composition/axes.d.ts +12 -0
  486. package/dist/composition/axes.d.ts.map +1 -1
  487. package/dist/composition/axes.js +18 -6
  488. package/dist/composition/axes.js.map +1 -1
  489. package/dist/composition/axis-audit.js.map +1 -1
  490. package/dist/composition/bridge-analysis.d.ts +0 -14
  491. package/dist/composition/bridge-analysis.d.ts.map +1 -1
  492. package/dist/composition/bridge-analysis.js +66 -57
  493. package/dist/composition/bridge-analysis.js.map +1 -1
  494. package/dist/composition/bridge-prediction.d.ts +5 -1
  495. package/dist/composition/bridge-prediction.d.ts.map +1 -1
  496. package/dist/composition/bridge-prediction.js +12 -16
  497. package/dist/composition/bridge-prediction.js.map +1 -1
  498. package/dist/composition/buckingham-filter.js.map +1 -1
  499. package/dist/composition/canonical-compare.d.ts.map +1 -1
  500. package/dist/composition/canonical-compare.js +12 -2
  501. package/dist/composition/canonical-compare.js.map +1 -1
  502. package/dist/composition/canonical-graph.d.ts +15 -18
  503. package/dist/composition/canonical-graph.d.ts.map +1 -1
  504. package/dist/composition/canonical-graph.js +59 -85
  505. package/dist/composition/canonical-graph.js.map +1 -1
  506. package/dist/composition/canonical-json.js.map +1 -1
  507. package/dist/composition/canonical-prefactors.d.ts +10 -29
  508. package/dist/composition/canonical-prefactors.d.ts.map +1 -1
  509. package/dist/composition/canonical-prefactors.js +15 -202
  510. package/dist/composition/canonical-prefactors.js.map +1 -1
  511. package/dist/composition/catalog-graph.d.ts.map +1 -1
  512. package/dist/composition/catalog-graph.js +6 -20
  513. package/dist/composition/catalog-graph.js.map +1 -1
  514. package/dist/composition/chain-candidate.d.ts +2 -0
  515. package/dist/composition/chain-candidate.d.ts.map +1 -1
  516. package/dist/composition/chain-candidate.js +2 -0
  517. package/dist/composition/chain-candidate.js.map +1 -1
  518. package/dist/composition/chain-match.js.map +1 -1
  519. package/dist/composition/chain-regime.js.map +1 -1
  520. package/dist/composition/chain-result.js.map +1 -1
  521. package/dist/composition/compose-surface.js.map +1 -1
  522. package/dist/composition/compose-symbolic.js.map +1 -1
  523. package/dist/composition/compose.d.ts.map +1 -1
  524. package/dist/composition/compose.js +154 -36
  525. package/dist/composition/compose.js.map +1 -1
  526. package/dist/composition/composition-recovery.js.map +1 -1
  527. package/dist/composition/consequence.d.ts.map +1 -1
  528. package/dist/composition/consequence.js +15 -6
  529. package/dist/composition/consequence.js.map +1 -1
  530. package/dist/composition/consistency.js.map +1 -1
  531. package/dist/composition/descriptor.d.ts +1 -1
  532. package/dist/composition/descriptor.d.ts.map +1 -1
  533. package/dist/composition/descriptor.js.map +1 -1
  534. package/dist/composition/dimension-adjacency.js.map +1 -1
  535. package/dist/composition/discovery.d.ts +67 -7
  536. package/dist/composition/discovery.d.ts.map +1 -1
  537. package/dist/composition/discovery.js +83 -23
  538. package/dist/composition/discovery.js.map +1 -1
  539. package/dist/composition/edge.d.ts +19 -22
  540. package/dist/composition/edge.d.ts.map +1 -1
  541. package/dist/composition/edge.js +25 -28
  542. package/dist/composition/edge.js.map +1 -1
  543. package/dist/composition/enumerate.d.ts +2 -2
  544. package/dist/composition/enumerate.d.ts.map +1 -1
  545. package/dist/composition/enumerate.js.map +1 -1
  546. package/dist/composition/evaluate-relation.d.ts +29 -5
  547. package/dist/composition/evaluate-relation.d.ts.map +1 -1
  548. package/dist/composition/evaluate-relation.js +100 -72
  549. package/dist/composition/evaluate-relation.js.map +1 -1
  550. package/dist/composition/explain.d.ts +14 -4
  551. package/dist/composition/explain.d.ts.map +1 -1
  552. package/dist/composition/explain.js +53 -19
  553. package/dist/composition/explain.js.map +1 -1
  554. package/dist/composition/expr-eval.d.ts.map +1 -1
  555. package/dist/composition/expr-eval.js +2 -1
  556. package/dist/composition/expr-eval.js.map +1 -1
  557. package/dist/composition/expr-simplify.d.ts.map +1 -1
  558. package/dist/composition/expr-simplify.js +9 -39
  559. package/dist/composition/expr-simplify.js.map +1 -1
  560. package/dist/composition/expr-subst.js.map +1 -1
  561. package/dist/composition/formula-shape.d.ts +9 -0
  562. package/dist/composition/formula-shape.d.ts.map +1 -1
  563. package/dist/composition/formula-shape.js +54 -0
  564. package/dist/composition/formula-shape.js.map +1 -1
  565. package/dist/composition/frontier-account.d.ts +3 -2
  566. package/dist/composition/frontier-account.d.ts.map +1 -1
  567. package/dist/composition/frontier-account.js +7 -3
  568. package/dist/composition/frontier-account.js.map +1 -1
  569. package/dist/composition/graph-viz-svg.js.map +1 -1
  570. package/dist/composition/graph-viz.js.map +1 -1
  571. package/dist/composition/grounding.js.map +1 -1
  572. package/dist/composition/identifiability.js.map +1 -1
  573. package/dist/composition/index.d.ts +9 -5
  574. package/dist/composition/index.d.ts.map +1 -1
  575. package/dist/composition/index.js +7 -4
  576. package/dist/composition/index.js.map +1 -1
  577. package/dist/composition/mathts-quiet.d.ts +28 -0
  578. package/dist/composition/mathts-quiet.d.ts.map +1 -0
  579. package/dist/composition/mathts-quiet.js +56 -0
  580. package/dist/composition/mathts-quiet.js.map +1 -0
  581. package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
  582. package/dist/composition/mathts-scalar-symbols.js +18 -34
  583. package/dist/composition/mathts-scalar-symbols.js.map +1 -1
  584. package/dist/composition/not-composable-seeds.d.ts +3 -1
  585. package/dist/composition/not-composable-seeds.d.ts.map +1 -1
  586. package/dist/composition/not-composable-seeds.js +2 -0
  587. package/dist/composition/not-composable-seeds.js.map +1 -1
  588. package/dist/composition/probe/backend-protocol.js.map +1 -1
  589. package/dist/composition/probe/candidate-store.js.map +1 -1
  590. package/dist/composition/probe/corpus.js.map +1 -1
  591. package/dist/composition/probe/dataset.js.map +1 -1
  592. package/dist/composition/probe/experiment-design.js.map +1 -1
  593. package/dist/composition/probe/expression-gaps.js.map +1 -1
  594. package/dist/composition/probe/falsify.d.ts +14 -3
  595. package/dist/composition/probe/falsify.d.ts.map +1 -1
  596. package/dist/composition/probe/falsify.js +14 -27
  597. package/dist/composition/probe/falsify.js.map +1 -1
  598. package/dist/composition/probe/fingerprint.js.map +1 -1
  599. package/dist/composition/probe/fit.d.ts +1 -1
  600. package/dist/composition/probe/fit.d.ts.map +1 -1
  601. package/dist/composition/probe/fit.js +2 -1
  602. package/dist/composition/probe/fit.js.map +1 -1
  603. package/dist/composition/probe/frontier.js.map +1 -1
  604. package/dist/composition/probe/generator.js.map +1 -1
  605. package/dist/composition/probe/index.d.ts +4 -2
  606. package/dist/composition/probe/index.d.ts.map +1 -1
  607. package/dist/composition/probe/index.js +4 -2
  608. package/dist/composition/probe/index.js.map +1 -1
  609. package/dist/composition/probe/limits.js.map +1 -1
  610. package/dist/composition/probe/metadata.js.map +1 -1
  611. package/dist/composition/probe/pipeline.d.ts +5 -0
  612. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  613. package/dist/composition/probe/pipeline.js +13 -6
  614. package/dist/composition/probe/pipeline.js.map +1 -1
  615. package/dist/composition/probe/problem.d.ts +8 -0
  616. package/dist/composition/probe/problem.d.ts.map +1 -1
  617. package/dist/composition/probe/problem.js +78 -12
  618. package/dist/composition/probe/problem.js.map +1 -1
  619. package/dist/composition/probe/report.js.map +1 -1
  620. package/dist/composition/probe/residual.js.map +1 -1
  621. package/dist/composition/probe/run-manifest.js +2 -2
  622. package/dist/composition/probe/run-manifest.js.map +1 -1
  623. package/dist/composition/probe/scoring.d.ts +2 -1
  624. package/dist/composition/probe/scoring.d.ts.map +1 -1
  625. package/dist/composition/probe/scoring.js +21 -7
  626. package/dist/composition/probe/scoring.js.map +1 -1
  627. package/dist/composition/probe/search-budget.js.map +1 -1
  628. package/dist/composition/probe/serialize.js.map +1 -1
  629. package/dist/composition/probe/structure.js.map +1 -1
  630. package/dist/composition/probe/study.d.ts +4 -3
  631. package/dist/composition/probe/study.d.ts.map +1 -1
  632. package/dist/composition/probe/study.js +5 -3
  633. package/dist/composition/probe/study.js.map +1 -1
  634. package/dist/composition/probe/types.d.ts +3 -1
  635. package/dist/composition/probe/types.d.ts.map +1 -1
  636. package/dist/composition/probe/types.js +2 -0
  637. package/dist/composition/probe/types.js.map +1 -1
  638. package/dist/composition/proposed-bridges.d.ts +11 -4
  639. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  640. package/dist/composition/proposed-bridges.js +14 -6
  641. package/dist/composition/proposed-bridges.js.map +1 -1
  642. package/dist/composition/quantities.d.ts +0 -4
  643. package/dist/composition/quantities.d.ts.map +1 -1
  644. package/dist/composition/quantities.js +5 -5
  645. package/dist/composition/quantities.js.map +1 -1
  646. package/dist/composition/quantity.d.ts +18 -2
  647. package/dist/composition/quantity.d.ts.map +1 -1
  648. package/dist/composition/quantity.js +35 -6
  649. package/dist/composition/quantity.js.map +1 -1
  650. package/dist/composition/representative-values.js.map +1 -1
  651. package/dist/composition/retrodiction.d.ts +18 -0
  652. package/dist/composition/retrodiction.d.ts.map +1 -1
  653. package/dist/composition/retrodiction.js +37 -7
  654. package/dist/composition/retrodiction.js.map +1 -1
  655. package/dist/composition/uncertainty.js.map +1 -1
  656. package/dist/composition/user-equation.d.ts +11 -7
  657. package/dist/composition/user-equation.d.ts.map +1 -1
  658. package/dist/composition/user-equation.js +24 -26
  659. package/dist/composition/user-equation.js.map +1 -1
  660. package/dist/core/axes-registry.d.ts +8 -5
  661. package/dist/core/axes-registry.d.ts.map +1 -1
  662. package/dist/core/axes-registry.js.map +1 -1
  663. package/dist/core/cell.js.map +1 -1
  664. package/dist/core/constants.d.ts +35 -12
  665. package/dist/core/constants.d.ts.map +1 -1
  666. package/dist/core/constants.js +46 -15
  667. package/dist/core/constants.js.map +1 -1
  668. package/dist/core/data-file.d.ts +27 -0
  669. package/dist/core/data-file.d.ts.map +1 -0
  670. package/dist/core/data-file.js +48 -0
  671. package/dist/core/data-file.js.map +1 -0
  672. package/dist/core/flux-rules.js +1 -1
  673. package/dist/core/flux-rules.js.map +1 -1
  674. package/dist/core/json-schema.d.ts +27 -0
  675. package/dist/core/json-schema.d.ts.map +1 -0
  676. package/dist/core/json-schema.js +177 -0
  677. package/dist/core/json-schema.js.map +1 -0
  678. package/dist/core/labeled-tensor.d.ts +6 -1
  679. package/dist/core/labeled-tensor.d.ts.map +1 -1
  680. package/dist/core/labeled-tensor.js +18 -8
  681. package/dist/core/labeled-tensor.js.map +1 -1
  682. package/dist/core/regime-registry.d.ts +6 -2
  683. package/dist/core/regime-registry.d.ts.map +1 -1
  684. package/dist/core/regime-registry.js.map +1 -1
  685. package/dist/core/regime-rule-install.js.map +1 -1
  686. package/dist/core/regimes-builtins.js.map +1 -1
  687. package/dist/core/tensor.d.ts +7 -4
  688. package/dist/core/tensor.d.ts.map +1 -1
  689. package/dist/core/tensor.js +40 -8
  690. package/dist/core/tensor.js.map +1 -1
  691. package/dist/core/types.d.ts +3 -2
  692. package/dist/core/types.d.ts.map +1 -1
  693. package/dist/core/types.js +16 -14
  694. package/dist/core/types.js.map +1 -1
  695. package/dist/core/universal-index.js.map +1 -1
  696. package/dist/diff/bridge-ast-gradient.d.ts +4 -5
  697. package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
  698. package/dist/diff/bridge-ast-gradient.js +16 -23
  699. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  700. package/dist/diff/bridge-gradient.d.ts +24 -80
  701. package/dist/diff/bridge-gradient.d.ts.map +1 -1
  702. package/dist/diff/bridge-gradient.js +21 -98
  703. package/dist/diff/bridge-gradient.js.map +1 -1
  704. package/dist/diff/bridge-specs.d.ts +18 -6
  705. package/dist/diff/bridge-specs.d.ts.map +1 -1
  706. package/dist/diff/bridge-specs.js +17 -5
  707. package/dist/diff/bridge-specs.js.map +1 -1
  708. package/dist/dimensional/algebra.js.map +1 -1
  709. package/dist/dimensional/ast-builders.d.ts +5 -4
  710. package/dist/dimensional/ast-builders.d.ts.map +1 -1
  711. package/dist/dimensional/ast-builders.js +6 -5
  712. package/dist/dimensional/ast-builders.js.map +1 -1
  713. package/dist/dimensional/ast-types.js.map +1 -1
  714. package/dist/dimensional/bridge-check.d.ts.map +1 -1
  715. package/dist/dimensional/bridge-check.js +3 -5
  716. package/dist/dimensional/bridge-check.js.map +1 -1
  717. package/dist/dimensional/buckingham.js.map +1 -1
  718. package/dist/dimensional/connection-validators.d.ts +2 -1
  719. package/dist/dimensional/connection-validators.d.ts.map +1 -1
  720. package/dist/dimensional/connection-validators.js.map +1 -1
  721. package/dist/dimensional/connection.js.map +1 -1
  722. package/dist/dimensional/constant-rows.d.ts +54 -0
  723. package/dist/dimensional/constant-rows.d.ts.map +1 -0
  724. package/dist/dimensional/constant-rows.js +115 -0
  725. package/dist/dimensional/constant-rows.js.map +1 -0
  726. package/dist/dimensional/constants.d.ts +7 -17
  727. package/dist/dimensional/constants.d.ts.map +1 -1
  728. package/dist/dimensional/constants.js +12 -21
  729. package/dist/dimensional/constants.js.map +1 -1
  730. package/dist/dimensional/curvature-composite.js.map +1 -1
  731. package/dist/dimensional/curvature-invariants.js.map +1 -1
  732. package/dist/dimensional/curvature.js.map +1 -1
  733. package/dist/dimensional/dimension-inference.js.map +1 -1
  734. package/dist/dimensional/dimension-spec.d.ts +21 -6
  735. package/dist/dimensional/dimension-spec.d.ts.map +1 -1
  736. package/dist/dimensional/dimension-spec.js +150 -160
  737. package/dist/dimensional/dimension-spec.js.map +1 -1
  738. package/dist/dimensional/einstein-equation.js.map +1 -1
  739. package/dist/dimensional/errors.d.ts +3 -1
  740. package/dist/dimensional/errors.d.ts.map +1 -1
  741. package/dist/dimensional/errors.js +2 -2
  742. package/dist/dimensional/errors.js.map +1 -1
  743. package/dist/dimensional/exact-scale.d.ts +79 -0
  744. package/dist/dimensional/exact-scale.d.ts.map +1 -0
  745. package/dist/dimensional/exact-scale.js +222 -0
  746. package/dist/dimensional/exact-scale.js.map +1 -0
  747. package/dist/dimensional/field-equation-helpers.js.map +1 -1
  748. package/dist/dimensional/formula-names.d.ts +13 -12
  749. package/dist/dimensional/formula-names.d.ts.map +1 -1
  750. package/dist/dimensional/formula-names.js +28 -51
  751. package/dist/dimensional/formula-names.js.map +1 -1
  752. package/dist/dimensional/fresh-label.js.map +1 -1
  753. package/dist/dimensional/friedmann-equation.d.ts +3 -3
  754. package/dist/dimensional/friedmann-equation.js +3 -3
  755. package/dist/dimensional/friedmann-equation.js.map +1 -1
  756. package/dist/dimensional/gauge-field.d.ts +2 -3
  757. package/dist/dimensional/gauge-field.d.ts.map +1 -1
  758. package/dist/dimensional/gauge-field.js +0 -1
  759. package/dist/dimensional/gauge-field.js.map +1 -1
  760. package/dist/dimensional/hyphen-names.d.ts.map +1 -1
  761. package/dist/dimensional/hyphen-names.js +8 -0
  762. package/dist/dimensional/hyphen-names.js.map +1 -1
  763. package/dist/dimensional/killing-validators.js.map +1 -1
  764. package/dist/dimensional/klein-gordon-equation.js.map +1 -1
  765. package/dist/dimensional/metric-validators.d.ts +2 -1
  766. package/dist/dimensional/metric-validators.d.ts.map +1 -1
  767. package/dist/dimensional/metric-validators.js.map +1 -1
  768. package/dist/dimensional/metric.js.map +1 -1
  769. package/dist/dimensional/natural-units.js.map +1 -1
  770. package/dist/dimensional/quantity-registry.d.ts +23 -1
  771. package/dist/dimensional/quantity-registry.d.ts.map +1 -1
  772. package/dist/dimensional/quantity-registry.js +55 -18
  773. package/dist/dimensional/quantity-registry.js.map +1 -1
  774. package/dist/dimensional/rg-flow.js.map +1 -1
  775. package/dist/dimensional/stress-energy-validators.js.map +1 -1
  776. package/dist/dimensional/symbolic-constants.d.ts +63 -19
  777. package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
  778. package/dist/dimensional/symbolic-constants.js +114 -92
  779. package/dist/dimensional/symbolic-constants.js.map +1 -1
  780. package/dist/dimensional/tensor-trace.js.map +1 -1
  781. package/dist/dimensional/tensor.js.map +1 -1
  782. package/dist/dimensional/types.js.map +1 -1
  783. package/dist/dimensional/unit-convention.d.ts +0 -2
  784. package/dist/dimensional/unit-convention.d.ts.map +1 -1
  785. package/dist/dimensional/unit-convention.js +2 -2
  786. package/dist/dimensional/unit-convention.js.map +1 -1
  787. package/dist/dimensional/unit-data.d.ts +70 -0
  788. package/dist/dimensional/unit-data.d.ts.map +1 -0
  789. package/dist/dimensional/unit-data.js +139 -0
  790. package/dist/dimensional/unit-data.js.map +1 -0
  791. package/dist/dimensional/units.d.ts +87 -24
  792. package/dist/dimensional/units.d.ts.map +1 -1
  793. package/dist/dimensional/units.js +290 -295
  794. package/dist/dimensional/units.js.map +1 -1
  795. package/dist/dimensional/validator-registry.js.map +1 -1
  796. package/dist/dimensional/validator.d.ts +0 -16
  797. package/dist/dimensional/validator.d.ts.map +1 -1
  798. package/dist/dimensional/validator.js +65 -29
  799. package/dist/dimensional/validator.js.map +1 -1
  800. package/dist/dimensional/weyl-validators.js.map +1 -1
  801. package/dist/index.d.ts +65 -18
  802. package/dist/index.d.ts.map +1 -1
  803. package/dist/index.js +19 -24
  804. package/dist/index.js.map +1 -1
  805. package/dist/numerical/bianchi-residual.js.map +1 -1
  806. package/dist/numerical/binding-value.d.ts +32 -7
  807. package/dist/numerical/binding-value.d.ts.map +1 -1
  808. package/dist/numerical/binding-value.js +218 -209
  809. package/dist/numerical/binding-value.js.map +1 -1
  810. package/dist/numerical/christoffel-flat.js.map +1 -1
  811. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  812. package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
  813. package/dist/numerical/covariant-eikonal.js +2 -2
  814. package/dist/numerical/covariant-eikonal.js.map +1 -1
  815. package/dist/numerical/curvature-lowering-helpers.d.ts +20 -0
  816. package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -1
  817. package/dist/numerical/curvature-lowering-helpers.js +6 -3
  818. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  819. package/dist/numerical/derivative-lowering.js.map +1 -1
  820. package/dist/numerical/einstein-equation.js.map +1 -1
  821. package/dist/numerical/engine-registry.js.map +1 -1
  822. package/dist/numerical/errors.d.ts +7 -3
  823. package/dist/numerical/errors.d.ts.map +1 -1
  824. package/dist/numerical/errors.js +5 -5
  825. package/dist/numerical/errors.js.map +1 -1
  826. package/dist/numerical/evaluator-uncertainty.d.ts +34 -0
  827. package/dist/numerical/evaluator-uncertainty.d.ts.map +1 -0
  828. package/dist/numerical/evaluator-uncertainty.js +134 -0
  829. package/dist/numerical/evaluator-uncertainty.js.map +1 -0
  830. package/dist/numerical/formula-contract.d.ts +67 -7
  831. package/dist/numerical/formula-contract.d.ts.map +1 -1
  832. package/dist/numerical/formula-contract.js +68 -42
  833. package/dist/numerical/formula-contract.js.map +1 -1
  834. package/dist/numerical/formula-dimension.d.ts +17 -7
  835. package/dist/numerical/formula-dimension.d.ts.map +1 -1
  836. package/dist/numerical/formula-dimension.js +120 -44
  837. package/dist/numerical/formula-dimension.js.map +1 -1
  838. package/dist/numerical/formula-mathts.d.ts.map +1 -1
  839. package/dist/numerical/formula-mathts.js +10 -3
  840. package/dist/numerical/formula-mathts.js.map +1 -1
  841. package/dist/numerical/formula-registry.d.ts +13 -3
  842. package/dist/numerical/formula-registry.d.ts.map +1 -1
  843. package/dist/numerical/formula-registry.js +7 -2
  844. package/dist/numerical/formula-registry.js.map +1 -1
  845. package/dist/numerical/geodesic-integrator.js.map +1 -1
  846. package/dist/numerical/geometrized.js.map +1 -1
  847. package/dist/numerical/gl4-integrator.d.ts +28 -27
  848. package/dist/numerical/gl4-integrator.d.ts.map +1 -1
  849. package/dist/numerical/gl4-integrator.js +44 -45
  850. package/dist/numerical/gl4-integrator.js.map +1 -1
  851. package/dist/numerical/grid-field.js.map +1 -1
  852. package/dist/numerical/index.js.map +1 -1
  853. package/dist/numerical/input-validation.d.ts +3 -6
  854. package/dist/numerical/input-validation.d.ts.map +1 -1
  855. package/dist/numerical/input-validation.js +4 -8
  856. package/dist/numerical/input-validation.js.map +1 -1
  857. package/dist/numerical/killing.d.ts +8 -5
  858. package/dist/numerical/killing.d.ts.map +1 -1
  859. package/dist/numerical/killing.js.map +1 -1
  860. package/dist/numerical/klein-gordon.js.map +1 -1
  861. package/dist/numerical/kretschmann.js.map +1 -1
  862. package/dist/numerical/lowering-utils.js.map +1 -1
  863. package/dist/numerical/lowering.d.ts.map +1 -1
  864. package/dist/numerical/lowering.js +7 -17
  865. package/dist/numerical/lowering.js.map +1 -1
  866. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  867. package/dist/numerical/mathts-engine.js +11 -6
  868. package/dist/numerical/mathts-engine.js.map +1 -1
  869. package/dist/numerical/metric-inverse.js.map +1 -1
  870. package/dist/numerical/null-ic.js.map +1 -1
  871. package/dist/numerical/null-ray-integrator.js +4 -4
  872. package/dist/numerical/null-ray-integrator.js.map +1 -1
  873. package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
  874. package/dist/numerical/pderiv.d.ts.map +1 -1
  875. package/dist/numerical/pderiv.js +9 -2
  876. package/dist/numerical/pderiv.js.map +1 -1
  877. package/dist/numerical/perihelion-finder.js.map +1 -1
  878. package/dist/numerical/quadrature.d.ts +5 -2
  879. package/dist/numerical/quadrature.d.ts.map +1 -1
  880. package/dist/numerical/quadrature.js +20 -3
  881. package/dist/numerical/quadrature.js.map +1 -1
  882. package/dist/numerical/spacetime-metrics.d.ts +17 -19
  883. package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
  884. package/dist/numerical/spacetime-metrics.js +158 -250
  885. package/dist/numerical/spacetime-metrics.js.map +1 -1
  886. package/dist/numerical/strides.js.map +1 -1
  887. package/dist/numerical/tensor-engine.d.ts +9 -5
  888. package/dist/numerical/tensor-engine.d.ts.map +1 -1
  889. package/dist/numerical/tensor-engine.js.map +1 -1
  890. package/dist/numerical/types.js.map +1 -1
  891. package/dist/numerical/weyl-lowering.js.map +1 -1
  892. package/dist/relations/category.js.map +1 -1
  893. package/dist/relations/composition-table.d.ts +4 -4
  894. package/dist/relations/composition-table.js +4 -4
  895. package/dist/relations/composition-table.js.map +1 -1
  896. package/dist/relations/conventions.js.map +1 -1
  897. package/dist/relations/domain-regimes.js.map +1 -1
  898. package/dist/relations/regime-registration.js.map +1 -1
  899. package/dist/relations/regime-vocabularies.js.map +1 -1
  900. package/dist/relations/regime.d.ts +18 -8
  901. package/dist/relations/regime.d.ts.map +1 -1
  902. package/dist/relations/regime.js +26 -14
  903. package/dist/relations/regime.js.map +1 -1
  904. package/dist/relations/types.d.ts +26 -6
  905. package/dist/relations/types.d.ts.map +1 -1
  906. package/dist/relations/types.js +15 -3
  907. package/dist/relations/types.js.map +1 -1
  908. package/package.json +10 -14
  909. package/dist/bridges/registry.d.ts +0 -60
  910. package/dist/bridges/registry.d.ts.map +0 -1
  911. package/dist/bridges/registry.js +0 -87
  912. package/dist/bridges/registry.js.map +0 -1
  913. package/dist/cli/poster-source.d.ts +0 -154
  914. package/dist/cli/poster-source.d.ts.map +0 -1
  915. package/dist/cli/poster-source.js +0 -184
  916. package/dist/cli/poster-source.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"chain-candidate.js","sourceRoot":"","sources":["../../src/composition/chain-candidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA0BH,SAAS,UAAU,CAAC,IAAwB;IAC1C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,cAAc;YACjB,OAAO,CAAC,CAAC;QACX,KAAK,aAAa;YAChB,OAAO,CAAC,CAAC;QACX,KAAK,iBAAiB;YACpB,OAAO,CAAC,CAAC;QACX,KAAK,eAAe;YAClB,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAuB,EAAE,KAAwB;IACnF,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAW,CAAC;QAC5B,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAW,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC,CAAC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AAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAW,CAAC;QAC5B,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAW,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAqC;IACxE,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACxD,IAAI,OAAO,KAAK,CAAC;YAAE,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,OAAO,mBAAmB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * A chain candidate and the order the pipeline reads candidates in.\n *\n * Confirmation of a catalog id, then a restatement, then a unique\n * monomial, then a named PhysJS.Dimensional shape that leaves a\n * function or an exponent unfixed. A shorter chain comes before a\n * longer one. Equal lengths compare the ordered edge ids from the\n * left. Nothing here is written into the catalog.\n *\n * @internal\n * @module composition/chain-candidate\n */\n\n/** The four classes the order distinguishes. */\nexport type ChainCandidateKind =\n | 'confirmation'\n | 'restatement'\n | 'unique-monomial'\n | 'unfixed-shape';\n\n/**\n * One survivor of a chain of proved edges.\n *\n * `kind` and `edgeIds` are the order. `catalogId`, `canonicalId`,\n * `restatesBridge`, `theorem`, and `id` are carried data and are not\n * compared.\n */\nexport interface ChainCandidate {\n readonly kind: ChainCandidateKind;\n readonly edgeIds: readonly string[];\n readonly catalogId?: number;\n readonly canonicalId?: string;\n readonly restatesBridge?: string;\n readonly theorem?: string;\n readonly id?: string;\n}\n\nfunction classIndex(kind: ChainCandidateKind): number {\n switch (kind) {\n case 'confirmation':\n return 0;\n case 'restatement':\n return 1;\n case 'unique-monomial':\n return 2;\n case 'unfixed-shape':\n return 3;\n }\n}\n\n/**\n * Shorter chain first, then lexicographic edge ids.\n *\n * The regime-mismatch list uses this same comparison. It is not a class\n * inside {@link orderChainCandidates}.\n */\nexport function compareChainEdgeIds(left: readonly string[], right: readonly string[]): -1 | 0 | 1 {\n if (left.length !== right.length) return left.length < right.length ? -1 : 1;\n for (let i = 0; i < left.length; i++) {\n const a = left[i] as string;\n const b = right[i] as string;\n if (a < b) return -1;\n if (a > b) return 1;\n }\n return 0;\n}\n\n/**\n * Total order of chain candidates. Returns a new array of the same\n * objects. The input array is left as it was.\n *\n * @internal\n */\nexport function orderChainCandidates(candidates: readonly ChainCandidate[]): ChainCandidate[] {\n return [...candidates].sort((a, b) => {\n const byClass = classIndex(a.kind) - classIndex(b.kind);\n if (byClass !== 0) return byClass < 0 ? -1 : 1;\n return compareChainEdgeIds(a.edgeIds, b.edgeIds);\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chain-match.js","sourceRoot":"","sources":["../../src/composition/chain-match.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,iBAAiB,GAElB,MAAM,4BAA4B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,OAA0B;IACnE,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC"}
1
+ {"version":3,"file":"chain-match.js","sourceRoot":"","sources":["../../src/composition/chain-match.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,iBAAiB,GAElB,MAAM,4BAA4B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,OAA0B;IACnE,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/**\n * Pipeline match for a chain of proved edges.\n *\n * Calls {@link classifyStructure}. A confirmation reports the catalog id.\n * A restatement reports the pre-declared canonical equation. Anything else\n * is a provisional `chain-` id. This function writes no catalog row, no\n * formal-reference overlay entry, and no evidence tag.\n *\n * @module composition/chain-match\n */\nimport type { ExprNode } from '../dimensional/validator.js';\nimport {\n classifyStructure,\n type ChainClassification,\n} from '../canonical/structural.js';\n\n/**\n * Classify one composed chain. `edgeIds` stay in chain order.\n *\n * @internal\n */\nexport function matchChain(expr: ExprNode, edgeIds: readonly string[]): ChainClassification {\n return classifyStructure(expr, edgeIds);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chain-regime.js","sourceRoot":"","sources":["../../src/composition/chain-regime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,oBAAoB,GAErB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAIxD,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAAoC,CAAC;AAUzE,SAAS,UAAU,CAAC,IAAgB;IAClC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACzC,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;IACnE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,S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,GAAG,QAAQ,CAAC,UAAgD,CAAC;IAChF,MAAM,aAAa,GAAG,QAAQ,CAAC,UAAgD,CAAC;IAChF,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,IAAI,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;YAChE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,MAAM,KAAK,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,IACE,KAAK,CAAC,MAAM,KAAK,SAAS;QAC1B,MAAM,CAAC,MAAM,KAAK,SAAS;QAC3B,aAAa,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,UAAU,EACzD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;QAC9B,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Regime gate for a chain that meets on a quantity name.\n *\n * The domain is the §VI.6.1 component of the catalog category of `beId`,\n * derived by `tensorIndexComponent`. Scale and force are the gated axes\n * on the two junction ports. A recorded `Regime` on both edges is\n * compared with `regimeOverlap`. Silence on a facet is not a mismatch.\n * The rule is `docs/planning/Regime-Aware-Join-Gate-Design.md`.\n *\n * This module does not write the catalog and does not call `deriveEvidence`.\n *\n * @module composition/chain-regime\n */\n\nimport { BRIDGE_EQUATIONS } from '../bridges/index.js';\nimport {\n tensorIndexComponent,\n type TensorIndexComponent,\n} from '../bridges/tensor-index.js';\nimport { regimeOverlap } from '../relations/regime.js';\nimport { GATE_AXES } from './axes.js';\nimport { QUANTITY_IDENTIFICATIONS } from './compose.js';\nimport type { BridgeEdge } from './edge.js';\nimport type { Quantity } from './quantity.js';\n\n/** The class a regime-incompatible join is recorded as. @internal */\nexport const REGIME_MISMATCH_KIND = 'rejected: regime mismatch' as const;\n\n/** A join the regime gate refused. Not a stub and not a catalog write. @internal */\nexport interface ChainRegimeMismatch {\n readonly kind: typeof REGIME_MISMATCH_KIND;\n readonly edgeIds: readonly [string, string];\n readonly quantity: string;\n readonly reasons: readonly string[];\n}\n\nfunction edgeDomain(edge: BridgeEdge): TensorIndexComponent | undefined {\n if (edge.beId === null) return undefined;\n const entry = BRIDGE_EQUATIONS.find((row) => row.id === edge.beId);\n if (entry === undefined) return undefined;\n const component = tensorIndexComponent(entry.category);\n if (component === 'unassigned') return undefined;\n return component;\n}\n\nfunction junctionPorts(\n first: BridgeEdge,\n second: BridgeEdge,\n): { quantity: string; producer: Quantity; consumer: Quantity } {\n const named = second.sources.find((src) => src.name === first.target.name);\n if (named !== undefined) {\n return { quantity: first.target.name, producer: first.target, consumer: named };\n }\n for (const ident of QUANTITY_IDENTIFICATIONS) {\n if (ident.from !== first.target.name) continue;\n const src = second.sources.find((candidate) => candidate.name === ident.to);\n if (src !== undefined) {\n return { quantity: first.target.name, producer: first.target, consumer: src };\n }\n }\n throw new Error(`chain regime gate: ${first.id} -> ${second.id} has no junction`);\n}\n\n/**\n * The regime mismatch of a pair, or `undefined` when every facet abstains\n * or agrees.\n *\n * Reasons, in order: a domain clash, then each clashing `GATE_AXES` axis,\n * then `regime: disjoint`. The producer value is written first.\n *\n * @internal\n */\nexport function joinRegimeMismatch(\n first: BridgeEdge,\n second: BridgeEdge,\n): ChainRegimeMismatch | undefined {\n const { quantity, producer, consumer } = junctionPorts(first, second);\n const reasons: string[] = [];\n const producerDomain = edgeDomain(first);\n const consumerDomain = edgeDomain(second);\n if (\n producerDomain !== undefined &&\n consumerDomain !== undefined &&\n producerDomain !== consumerDomain\n ) {\n reasons.push(`domain: ${producerDomain} ≠ ${consumerDomain}`);\n }\n const producerAttrs = producer.attributes as Record<string, string | undefined>;\n const consumerAttrs = consumer.attributes as Record<string, string | undefined>;\n for (const axis of GATE_AXES) {\n const left = producerAttrs[axis];\n const right = consumerAttrs[axis];\n if (left !== undefined && right !== undefined && left !== right) {\n reasons.push(`${axis}: ${left} ≠ ${right}`);\n }\n }\n if (\n first.regime !== undefined &&\n second.regime !== undefined &&\n regimeOverlap(first.regime, second.regime) === 'disjoint'\n ) {\n reasons.push('regime: disjoint');\n }\n if (reasons.length === 0) return undefined;\n return {\n kind: REGIME_MISMATCH_KIND,\n edgeIds: [first.id, second.id],\n quantity,\n reasons,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chain-result.js","sourceRoot":"","sources":["../../src/composition/chain-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,mBAAmB,EAA2B,MAAM,sBAAsB,CAAC;AAuBpF;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,MAAmB;IAC/C,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,KAAK,cAAc;QAAE,OAAO,cAAc,CAAC;IACzE,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,KAAK,aAAa;QAAE,OAAO,aAAa,CAAC;IACvE,OAAO,MAAM,CAAC,OAAO,KAAK,kCAAkC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,CAAC;AACrG,CAAC;AAED,SAAS,UAAU,CAAC,IAAwB;IAC1C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,cAAc;YACjB,OAAO,CAAC,CAAC;QACX,KAAK,aAAa;YAChB,OAAO,CAAC,CAAC;QACX,KAAK,iBAAiB;YACpB,OAAO,CAAC,CAAC;QACX,KAAK,eAAe;YAClB,OAAO,CAAC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CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA+B;IAC/D,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,IAAI,OAAO,KAAK,CAAC;YAAE,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,OAAO,mBAAmB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * One internal chain record.\n *\n * The classifier kind, the order key, the filter theorem, a regime\n * mismatch, and the edge ids live on this value. {@link chainOrderKey}\n * and the pipeline's renderer are functions of it. A confirmation and a\n * restatement do not become a rejection.\n *\n * @module composition/chain-result\n */\n\nimport type { ChainClassification } from '../canonical/structural.js';\nimport type { CompositionResult } from '../relations/composition-table.js';\nimport type { BuckinghamFilterRecord } from './buckingham-filter.js';\nimport { compareChainEdgeIds, type ChainCandidateKind } from './chain-candidate.js';\nimport type { ChainRegimeMismatch } from './chain-regime.js';\n\n/**\n * The pipeline's one chain value.\n *\n * `classification` is the structural result. `theorem` is the Buckingham\n * filter's named shape, or null when the filter named none. `mismatch`\n * is set only for a provisional chain the regime gate refused.\n * `categoryComposition` is the category claim for the two steps. It is\n * unset when the edges have no stored category object ids. A recorded\n * `no-composite-claim` does not change the order key.\n *\n * @internal\n */\nexport interface ChainRecord {\n readonly edgeIds: readonly string[];\n readonly classification: ChainClassification;\n readonly theorem: BuckinghamFilterRecord['theorem'];\n readonly mismatch: ChainRegimeMismatch | undefined;\n readonly categoryComposition: CompositionResult | undefined;\n}\n\n/**\n * The four-class order key of `record`.\n *\n * A confirmation stays a confirmation. A restatement stays a restatement.\n * A provisional chain whose filter theorem is `monomial_form` is a unique\n * monomial. Every other provisional chain is an unfixed shape. A mismatch\n * does not change the key.\n *\n * @internal\n */\nexport function chainOrderKey(record: ChainRecord): ChainCandidateKind {\n if (record.classification.kind === 'confirmation') return 'confirmation';\n if (record.classification.kind === 'restatement') return 'restatement';\n return record.theorem === 'PhysJS.Dimensional.monomial_form' ? 'unique-monomial' : 'unfixed-shape';\n}\n\nfunction classIndex(kind: ChainCandidateKind): number {\n switch (kind) {\n case 'confirmation':\n return 0;\n case 'restatement':\n return 1;\n case 'unique-monomial':\n return 2;\n case 'unfixed-shape':\n return 3;\n }\n}\n\n/**\n * Total order of chain records by {@link chainOrderKey}, then by edge ids.\n *\n * Returns a new array. The input array is left as it was. A rejection is\n * not a class in this order.\n *\n * @internal\n */\nexport function orderChainRecords(records: readonly ChainRecord[]): ChainRecord[] {\n return [...records].sort((a, b) => {\n const byClass = classIndex(chainOrderKey(a)) - classIndex(chainOrderKey(b));\n if (byClass !== 0) return byClass < 0 ? -1 : 1;\n return compareChainEdgeIds(a.edgeIds, b.edgeIds);\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compose-surface.js","sourceRoot":"","sources":["../../src/composition/compose-surface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"compose-surface.js","sourceRoot":"","sources":["../../src/composition/compose-surface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["/**\n * v0.11 surface barrel for the namespacing-gate symbols (keeps\n * src/index.ts one-import-per-area while the implementations live in\n * compose.ts / edge.ts / enumerate.ts).\n *\n * @module composition/compose-surface\n */\nexport { CompositionAliasError } from './edge.js';\nexport { SOURCE_ALIAS_DISPOSITIONS } from './compose.js';\nexport type { AliasDisposition } from './compose.js';\nexport type { DispositionRequired } from './enumerate.js';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compose-symbolic.js","sourceRoot":"","sources":["../../src/composition/compose-symbolic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAKvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AA4BrE;oEACoE;AACpE,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AAQD;;;wDAGwD;AACxD,SAAS,gBAAgB,CACvB,KAAiB,EACjB,MAAkB,EAClB,eAAkD;IAElD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjC,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,IAAI;YAAE,OAAO,GAAG,CAAC,IAAI,CAAC;IACtD,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,IAAI;YAAE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AAK,CAAC,EAAE,OAAO,MAAM,CAAC,EAAE,aAAa;YAClE,IAAI,YAAY,kCAAkC,MAAM,CAAC,EAAE,KAAK;YAChE,sDAAsD,KAAK,CAAC,EAAE,GAAG,CACpE,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC;QAC1C,MAAM,IAAI,wBAAwB,CAChC,6BAA6B,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,EAAE,UAAU;YAC7D,2BAA2B,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,iBAAiB,GAAG,CAC3E,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,wBAAwB,CAChC,6BAA6B,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,EAAE,iBAAiB;YACpE,GAAG,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM;YAC9D,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAClC,CAAC;IACJ,CAAC;IAED,OAAO,cAAc,CACnB,MAAM,CAAC,MAAM,CAAC,IAAI,EAClB,MAAM,CAAC,MAAM,CAAC,MAAM,EACpB,MAAM,CAAC,MAAM,CAAC,GAAG,EACjB,IAAI,CACL,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Symbolic bridge composition (v0.12 — the Observable contract).\n *\n * Resolves the Part-IX §4 \"Observable contract\" deferral with a fourth\n * option the spec did not enumerate: an OPTIONAL `symbolic` ExprNode on a\n * bridge edge (leaves = source-quantity names + the `CONSTANTS` registry),\n * composed by AST SUBSTITUTION. `composeSymbolic(first, second)` substitutes\n * `first`'s symbolic form into the junction leaf of `second`'s, producing a\n * new ExprNode that is dimensionally validated and numerically evaluable —\n * not the black-box numeric closure `composeEdges` chains.\n *\n * Non-breaking (the field is optional), no per-pair adapters, and it retains\n * dimensional type-safety. Edges without a `symbolic` form fall back to\n * numeric `composeEdges` (unchanged).\n *\n * @module composition/compose-symbolic\n */\n\nimport { equals, format } from '../dimensional/algebra.js';\nimport { validate } from '../dimensional/validator.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport type { BridgeEdge } from './edge.js';\nimport type { QuantityIdentification } from './compose.js';\nimport { QUANTITY_IDENTIFICATIONS } from './compose.js';\nimport { substitute } from './expr-subst.js';\nimport { evalExpr, SymbolicEvalError } from './expr-eval.js';\nimport { CONSTANTS } from '../dimensional/symbolic-constants.js';\nimport { scalarSymbolsFromMathTs } from './mathts-scalar-symbols.js';\n\n/**\n * A composed quantity carrying its SYMBOLIC form and an executable\n * evaluator — the shared return contract Part-IX §4 said was missing.\n *\n * @public\n */\nexport interface Observable {\n /** Target quantity name (from `second.target`). */\n readonly name: string;\n /** Display symbol. */\n readonly symbol: string;\n /** Dimensionally-validated SI dimension. */\n readonly dim: Dimension;\n /** The composed (substituted) AST. */\n readonly expr: ExprNode;\n /** Free leaf symbols = the required inputs (constants/literals excluded). */\n readonly leaves: readonly string[];\n /**\n * Numerically evaluate the composed form. STRICT input (Eve EVE-1): every\n * `leaves` key must be supplied and no extra key is accepted. PURE symbolic\n * value — NOT domain-checked (unlike `composeEdges`, which throws\n * `DomainViolationError`); use `composeEdges` for domain-checked values.\n */\n evaluate(values: Readonly<Record<string, number>>): number;\n}\n\n/** Symbolic composition is undefined (no junction / missing `symbolic` /\n * zero-occurrence substitution / dimensional mismatch). @public */\nexport class SymbolicCompositionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'SymbolicCompositionError';\n }\n}\n\n/** Options for {@link composeSymbolic}. @public */\nexport interface ComposeSymbolicOptions {\n /** Extra identifications consulted after the registered ones. */\n readonly identifications?: readonly QuantityIdentification[];\n}\n\n/** Find the junction source of `second` matching `first.target` (by name or\n * identification). Returns the source whose NAME is the substitution leaf —\n * `junction.name` is correct in BOTH the name-match and identification cases\n * (Eve EVE-4), avoiding the always-`ident.to` trap. */\nfunction findJunctionName(\n first: BridgeEdge,\n second: BridgeEdge,\n identifications: readonly QuantityIdentification[],\n): string {\n for (const src of second.sources) {\n if (src.name === first.target.name) return src.name;\n }\n for (const ident of identifications) {\n if (ident.from !== first.target.name) continue;\n for (const src of second.sources) {\n if (src.name === ident.to) return src.name;\n }\n }\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: target ` +\n `'${first.target.name}' matches none of [${second.sources\n .map((s) => `'${s.name}'`)\n .join(', ')}] by name or registered identification.`,\n );\n}\n\n/** Free leaves = symbols that are neither registered constants nor numeric\n * literals (those are not inputs). The names are the MathTS symbol filter. */\nfunction freeLeaves(expr: ExprNode): string[] {\n return scalarSymbolsFromMathTs(expr)\n .map((leaf) => leaf.name)\n .filter((n) => !(n in CONSTANTS) && !Number.isFinite(Number(n)))\n .sort();\n}\n\n/**\n * Build an {@link Observable} from a composed/simplified expression: computes\n * the free `leaves` and a STRICT `evaluate` closure over THIS `expr` + leaves.\n * Shared by `composeSymbolic` and `simplifyObservable` so a simplified\n * Observable gets a fresh closure (never the stale unsimplified one).\n *\n * @internal\n */\nexport function makeObservable(\n name: string,\n symbol: string,\n dim: Dimension,\n expr: ExprNode,\n): Observable {\n const leaves = freeLeaves(expr);\n return {\n name,\n symbol,\n dim,\n expr,\n leaves,\n evaluate(values) {\n for (const leaf of leaves) {\n if (!Object.prototype.hasOwnProperty.call(values, leaf)) {\n throw new SymbolicEvalError(\n `Observable(${name}).evaluate: missing required input '${leaf}' ` +\n `(leaves: ${leaves.join(', ')}).`,\n );\n }\n }\n for (const key of Object.keys(values)) {\n if (!leaves.includes(key)) {\n throw new SymbolicEvalError(\n `Observable(${name}).evaluate: unexpected input '${key}' (this ` +\n `Observable's inputs are exactly: ${leaves.join(', ') || '(none)'}).`,\n );\n }\n }\n return evalExpr(expr, values);\n },\n };\n}\n\n/**\n * Compose two bridges SYMBOLICALLY: substitute `first`'s `symbolic` form into\n * the junction leaf of `second`'s, validate the composed AST's dimension, and\n * return an {@link Observable}. Both operands must carry a `symbolic` form\n * (else throws — fall back to `composeEdges` for numeric-only composition).\n *\n * @public\n */\nexport function composeSymbolic(\n first: BridgeEdge,\n second: BridgeEdge,\n opts: ComposeSymbolicOptions = {},\n): Observable {\n const identifications = [\n ...QUANTITY_IDENTIFICATIONS,\n ...(opts.identifications ?? []),\n ];\n\n if (!first.symbolic || !second.symbolic) {\n const missing = !first.symbolic ? first.id : second.id;\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: edge ` +\n `'${missing}' has no symbolic form (numeric-only edge — use ` +\n `composeEdges).`,\n );\n }\n\n const junctionName = findJunctionName(first, second, identifications);\n const { expr, count } = substitute(\n second.symbolic,\n junctionName,\n first.symbolic,\n );\n\n if (count === 0) {\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: junction ` +\n `'${junctionName}' does not appear as a leaf of ${second.id}'s ` +\n `symbolic form — substitution would silently ignore ${first.id}.`,\n );\n }\n\n const v = validate(expr);\n if (!v.ok || v.inferredDimension === null) {\n throw new SymbolicCompositionError(\n `Composed symbolic form of ${first.id} -> ${second.id} failed ` +\n `dimensional validation: ${v.violations[0]?.note ?? 'not homogeneous'}.`,\n );\n }\n if (!equals(v.inferredDimension, second.target.dim)) {\n throw new SymbolicCompositionError(\n `Composed symbolic form of ${first.id} -> ${second.id} has dimension ` +\n `${format(v.inferredDimension)} but ${second.target.name} is ` +\n `${format(second.target.dim)}.`,\n );\n }\n\n return makeObservable(\n second.target.name,\n second.target.symbol,\n second.target.dim,\n expr,\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":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Z,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACvD,MAAM,GAAE,SAAS,sBAAsB,EAA6B,GACnE,gBAAgB,CAuBlB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG;QAAE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAC9C,MAAM,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC,CAU5C,CAAC;AAQF;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAAE,cAAc,EACjB,CAAC,EAAE,cAAc,GAChB,cAAc,CAEhB;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAChD;AAiCD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAElF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,EAClB,IAAI,GAAE,cAAmB,GACxB,UAAU,CAwNZ"}
@@ -30,13 +30,20 @@
30
30
  * @module composition/compose
31
31
  */
32
32
  import { equals, format } from '../dimensional/algebra.js';
33
+ import { validate } from '../dimensional/validator.js';
34
+ import { regimeAttributesOf } from './quantity.js';
35
+ import { AXES } from './axes.js';
33
36
  import { conventionFactor } from '../dimensional/unit-convention.js';
34
- import { CompositionAliasError, CompositionDimensionError, CompositionJunctionError, DomainViolationError, UndefinedCompositionError, } from './edge.js';
37
+ import { assertCoefficientSet, CompositionAliasError, CompositionDimensionError, CompositionJunctionError, UndefinedCompositionError, } from './edge.js';
38
+ import { DomainViolationError } from '../bridges/evaluation-errors.js';
39
+ import { substitute } from './expr-subst.js';
40
+ import { monomialExponents } from './formula-shape.js';
35
41
  // Atlas Phase 1 overlay. The composition table is a leaf module (pure, no
36
42
  // registry reads, no import from `src/composition/`), so this does not close a
37
43
  // cycle — same rule as the type-only atlas import in `./edge.ts`.
38
44
  import { composeRelation, NO_COMPOSITE_CLAIM } from '../relations/composition-table.js';
39
45
  import { checkConventions } from '../relations/conventions.js';
46
+ import { intersectRegimes } from '../relations/regime.js';
40
47
  /**
41
48
  * The `RelationContract` a composed edge carries, given the composite TYPE the
42
49
  * table returned and the two operand contracts.
@@ -144,20 +151,18 @@ export function effectiveAttributes(name, attributesByName, idents = QUANTITY_ID
144
151
  if (folded)
145
152
  contributors.push(folded);
146
153
  }
147
- // One-value-agrees, zero-or-conflicting-values-abstain, per axis. Written
148
- // out per axis (rather than generically over `keyof RegimeAttributes`) so
149
- // each axis's value type stays concrete — no cross-axis union widening.
150
- const scales = new Set(contributors.map((c) => c.scale).filter((v) => v !== undefined));
151
- const forces = new Set(contributors.map((c) => c.force).filter((v) => v !== undefined));
152
- const infos = new Set(contributors.map((c) => c.information).filter((v) => v !== undefined));
153
- const result = {};
154
- if (scales.size === 1)
155
- result.scale = [...scales][0];
156
- if (forces.size === 1)
157
- result.force = [...forces][0];
158
- if (infos.size === 1)
159
- result.information = [...infos][0];
160
- return result;
154
+ // One-value-agrees, zero-or-conflicting-values-abstain, per REGISTRY axis.
155
+ // The fold reads `AXES`, so an axis the registry carries is folded here: a
156
+ // hand list once named scale, force and information only, and the
157
+ // discrimination audit then measured symmetry, topology and statistics as
158
+ // `checked: 0` whatever the data said (9.0.0 audit §4 C2).
159
+ const folded = {};
160
+ for (const { name } of AXES) {
161
+ const values = new Set(contributors.map((c) => c[name]).filter((v) => v !== undefined));
162
+ if (values.size === 1)
163
+ folded[name] = [...values][0];
164
+ }
165
+ return regimeAttributesOf(folded, `effectiveAttributes(${name})`);
161
166
  }
162
167
  /**
163
168
  * Registered alias dispositions, keyed by composed id
@@ -167,18 +172,14 @@ export function effectiveAttributes(name, attributesByName, idents = QUANTITY_ID
167
172
  * @public
168
173
  */
169
174
  export const SOURCE_ALIAS_DISPOSITIONS = {
170
- // ST-2 (stress test, pre-registered v0.10.0 plan §T2): the photon
171
- // grazes AT r_s of the SAME mass that bends it — one M is both the
172
- // lensing mass and the r_s source. Deliberate, physical sharing.
173
- 'law-schwarzschild-radius>>be-51': [
174
- {
175
- name: 'mass',
176
- treatAs: 'shared',
177
- rationale: 'One gravitating mass M is simultaneously the lens (BE-51) and ' +
178
- 'the source of the Schwarzschild radius the photon grazes — ' +
179
- 'the sharing IS the stress-test physics (ST-2).',
180
- },
181
- ],
175
+ // Empty. The one entry this table held, `law-schwarzschild-radius>>be-51`
176
+ // ("ST-2": one M is both the lens and the r_s source), keyed a composition
177
+ // no call can reach: the law's target `schwarzschild-radius` matches none
178
+ // of be-51's sources (`mass`, `impact-parameter`) by name or registered
179
+ // identification, so `composeEdges` throws `CompositionJunctionError`
180
+ // before the alias gate runs. The judgment was never applied. Retracted in
181
+ // the 9.0.0 audit (§4 C8); `tests/composition/compose.test.ts` now requires
182
+ // every key here to reach the gate.
182
183
  };
183
184
  const CONFIDENCE_RANK = {
184
185
  established: 2,
@@ -195,17 +196,17 @@ export function minConfidence(a, b) {
195
196
  return CONFIDENCE_RANK[a] <= CONFIDENCE_RANK[b] ? a : b;
196
197
  }
197
198
  function findJunction(first, second, identifications) {
198
- for (const src of second.sources) {
199
+ for (const [index, src] of second.sources.entries()) {
199
200
  if (src.name === first.target.name) {
200
- return { junction: src, viaIdentification: null };
201
+ return { junction: src, index, viaIdentification: null };
201
202
  }
202
203
  }
203
204
  for (const ident of identifications) {
204
205
  if (ident.from !== first.target.name)
205
206
  continue;
206
- for (const src of second.sources) {
207
+ for (const [index, src] of second.sources.entries()) {
207
208
  if (src.name === ident.to) {
208
- return { junction: src, viaIdentification: ident };
209
+ return { junction: src, index, viaIdentification: ident };
209
210
  }
210
211
  }
211
212
  }
@@ -242,7 +243,7 @@ export function composeEdges(first, second, opts = {}) {
242
243
  ...QUANTITY_IDENTIFICATIONS,
243
244
  ...(opts.identifications ?? []),
244
245
  ];
245
- const { junction, viaIdentification } = findJunction(first, second, identifications);
246
+ const { junction, index: junctionIndex, viaIdentification } = findJunction(first, second, identifications);
246
247
  if (!junctionDimensionsMatch(first.target.dim, junction.dim)) {
247
248
  throw new CompositionDimensionError(`Cannot compose ${first.id} -> ${second.id}: junction dimension ` +
248
249
  `mismatch — ${first.target.name} is ${format(first.target.dim)} ` +
@@ -251,7 +252,10 @@ export function composeEdges(first, second, opts = {}) {
251
252
  const junctionScale = viaIdentification === null
252
253
  ? 1
253
254
  : conventionFactor(first.target.name, junction.name);
254
- const remainingSources = second.sources.filter((s) => s !== junction);
255
+ // The pipe fills ONE slot of `second.sources`, the one `findJunction`
256
+ // returned. Removal by object identity would also drop a second slot that
257
+ // holds the same `Quantity` object, which a `shared` disposition produces.
258
+ const remainingSources = second.sources.filter((_, i) => i !== junctionIndex);
255
259
  // v0.11 Option D (namespacing gate): pure name-collision rule across
256
260
  // operands. Intra-operand duplicates (e.g. ['mass','mass'] inherited
257
261
  // from a prior 'shared' disposition) are exempt by construction —
@@ -325,9 +329,8 @@ export function composeEdges(first, second, opts = {}) {
325
329
  // ── Atlas Phase 1 (S1.2b): the relation overlay, and NOTHING else. ────────
326
330
  // Entered only when BOTH operands carry a `relation`. An operand with no
327
331
  // relation skips this block, and the composed edge then has no `relation`
328
- // key. Nine edges in `CATALOG_GRAPH` do carry one: `be-11-master` and
329
- // `be-11-zurek` (`coarse-graining`), and `be-21`, `be-37`, `be-48`,
330
- // `be-51`, `be-52`, `be-55`, and `be-59` (`derivation`). Those nine stay.
332
+ // key. The catalog edges that carry one are the catalog's `relation` rows
333
+ // (`tests/composition/relation-refusal.test.ts` lists them); they stay.
331
334
  // When both operands carry a relation, a silent table cell throws
332
335
  // `UndefinedCompositionError`. The approximation cell throws the same
333
336
  // error, because an edge relation carries no norm transport and this
@@ -389,12 +392,17 @@ export function composeEdges(first, second, opts = {}) {
389
392
  throw new DomainViolationError(`${id}: inputs violate composed validity domain ` +
390
393
  `(${composedDomain.description})`);
391
394
  }
395
+ // Each operand's unset-coefficient gate is the one `evaluateEdge`
396
+ // applies to a primitive edge; an operand's monomial times an absent 1
397
+ // must not reach the caller as a number through the pipe.
398
+ assertCoefficientSet(first, inputs);
392
399
  const intermediate = first.evaluate(inputs);
393
400
  const pipedInputs = buildSecondInputs(inputs, intermediate);
394
401
  if (!second.domain.predicate(pipedInputs)) {
395
402
  throw new DomainViolationError(`${id}: inputs violate composed validity domain ` +
396
403
  `(${composedDomain.description})`);
397
404
  }
405
+ assertCoefficientSet(second, pipedInputs);
398
406
  return second.evaluate(pipedInputs);
399
407
  },
400
408
  citation: `${first.citation} | ${second.citation}`,
@@ -405,6 +413,116 @@ export function composeEdges(first, second, opts = {}) {
405
413
  ? { aliasDispositionsUsed: dispositionsUsed }
406
414
  : {}),
407
415
  ...relationOverlay,
416
+ ...carriedClaims(first, second, junction, junctionScale, finalRemaining, renameMap),
408
417
  };
409
418
  }
419
+ /**
420
+ * The claims a composed edge carries from its operands (9.0.0 audit §4 C5).
421
+ * A composed edge that dropped them answered differently from its operands:
422
+ * the regime gate abstained on every chain longer than two, an unset
423
+ * coefficient became a number, an even input lost its magnitude reading,
424
+ * a count became a Buckingham governor, and an alias key stopped working.
425
+ *
426
+ * - `regime`: the one an operand states; two of one family intersect
427
+ * (`intersectRegimes`, which also refuses conflicting group definitions);
428
+ * two of different families refuse with `UndefinedCompositionError`, since
429
+ * this layer does not state where a cross-family chain applies.
430
+ * - `coefficientUnset`: either operand's. `evaluateEdge` then refuses the
431
+ * composite; a bound group lifts a primitive entry only, because the group
432
+ * row is keyed by the entry id, so a composite with an unset operand is
433
+ * refused by `evaluateEdge` whatever is bound (its own `evaluate` applies
434
+ * each operand's gate and does lift the operand whose group is bound).
435
+ * - `evenInputs`, `aliases`: the first operand's, plus the second's for its
436
+ * remaining sources under their composed names. The piped junction is not
437
+ * an input and is dropped. An alias key that two quantities would share is
438
+ * carried for neither.
439
+ * - `formulaFactors`: the second operand's for its remaining sources, exact.
440
+ * The first operand's counts enter through the pipe with their exponent
441
+ * times the junction's exponent in the second's monomial, so they are
442
+ * carried only when `second.symbolic` is a monomial that states it.
443
+ * - `symbolic`: the second's form with the junction leaf replaced by the
444
+ * first's, when both exist, the junction carries no convention factor, no
445
+ * source was renamed, the leaf occurs, and the result validates to the
446
+ * target dimension. Otherwise absent, as on a numeric-only edge.
447
+ */
448
+ function carriedClaims(first, second, junction, junctionScale, finalRemaining, renameMap) {
449
+ const out = {};
450
+ if (first.regime !== undefined && second.regime !== undefined) {
451
+ if (first.regime.family !== second.regime.family) {
452
+ throw new UndefinedCompositionError(`Cannot compose ${first.id} -> ${second.id}: the regimes are of different ` +
453
+ `families ('${first.regime.family}', '${second.regime.family}'), and this ` +
454
+ `layer does not state where a cross-family chain applies.`);
455
+ }
456
+ try {
457
+ out.regime = intersectRegimes(first.regime, second.regime);
458
+ }
459
+ catch (e) {
460
+ // Conflicting definitions of one group name: the composite has no regime this
461
+ // layer can state, the same refusal as a cross-family chain.
462
+ throw new UndefinedCompositionError(`Cannot compose ${first.id} -> ${second.id}: ${e.message}`);
463
+ }
464
+ }
465
+ else if (first.regime !== undefined || second.regime !== undefined) {
466
+ out.regime = first.regime ?? second.regime;
467
+ }
468
+ if (first.coefficientUnset === true || second.coefficientUnset === true)
469
+ out.coefficientUnset = true;
470
+ // Operand-internal name → the name the composite exposes it under.
471
+ const composedName = new Map(Object.entries(renameMap).map(([renamed, original]) => [original, renamed]));
472
+ const exposed = (name) => composedName.get(name) ?? name;
473
+ const remainingNames = new Set(finalRemaining.map((s) => s.name));
474
+ const secondRemaining = (name) => name !== junction.name && remainingNames.has(exposed(name));
475
+ const even = [
476
+ ...(first.evenInputs ?? []),
477
+ ...(second.evenInputs ?? []).filter(secondRemaining).map(exposed),
478
+ ];
479
+ if (even.length > 0)
480
+ out.evenInputs = even;
481
+ const factors = {};
482
+ const junctionExponent = monomialExponents(second.symbolic)?.get(junction.name);
483
+ if (first.formulaFactors !== undefined && junctionExponent !== undefined) {
484
+ for (const [name, exp] of Object.entries(first.formulaFactors))
485
+ factors[name] = exp * junctionExponent;
486
+ }
487
+ for (const [name, exp] of Object.entries(second.formulaFactors ?? {})) {
488
+ if (secondRemaining(name))
489
+ factors[exposed(name)] = exp;
490
+ }
491
+ if (Object.keys(factors).length > 0)
492
+ out.formulaFactors = factors;
493
+ const aliasOwner = new Map();
494
+ const shared = new Set();
495
+ const aliases = {};
496
+ const addAliases = (quantity, keys) => {
497
+ for (const key of keys) {
498
+ const owner = aliasOwner.get(key);
499
+ if (owner !== undefined && owner !== quantity)
500
+ shared.add(key);
501
+ aliasOwner.set(key, quantity);
502
+ (aliases[quantity] ??= []).push(key);
503
+ }
504
+ };
505
+ for (const [quantity, keys] of Object.entries(first.aliases ?? {}))
506
+ addAliases(quantity, keys);
507
+ for (const [quantity, keys] of Object.entries(second.aliases ?? {})) {
508
+ if (secondRemaining(quantity))
509
+ addAliases(exposed(quantity), keys);
510
+ }
511
+ const kept = Object.fromEntries(Object.entries(aliases)
512
+ .map(([quantity, keys]) => [quantity, keys.filter((k) => !shared.has(k))])
513
+ .filter(([, keys]) => keys.length > 0));
514
+ if (Object.keys(kept).length > 0)
515
+ out.aliases = kept;
516
+ if (first.symbolic !== undefined &&
517
+ second.symbolic !== undefined &&
518
+ junctionScale === 1 &&
519
+ Object.keys(renameMap).length === 0) {
520
+ const { expr, count } = substitute(second.symbolic, junction.name, first.symbolic);
521
+ const v = count > 0 ? validate(expr) : undefined;
522
+ if (v !== undefined && v.ok && v.inferredDimension !== null && equals(v.inferredDimension, second.target.dim)) {
523
+ out.symbolic = expr;
524
+ }
525
+ }
526
+ return out;
527
+ }
410
528
  //# sourceMappingURL=compose.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/composition/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,0EAA0E;AAC1E,+EAA+E;AAC/E,kEAAkE;AAClE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,gBAAgB,CACvB,IAA4C,EAC5C,KAAuB,EACvB,MAAwB;IAExB,MAAM,cAAc,GAAG,GAAG,KAAK,CAAC,cAAc,SAAS,MAAM,CAAC,cAAc,EAAE,CAAC;IAC/E,IAAI,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACjC,2EAA2E;QAC3E,6CAA6C;QAC7C,MAAM,EAAE,GAAI,KAAkE,CAAC,OAAO,CAAC;QACvF,MAAM,EAAE,GAAI,MAAmE,CAAC,OAAO,CAAC;QACxF,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAC/D,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;AAClC,CAAC;AAgBD;;;;;GA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cesContent":["/**\n * Composition graph — the composition operator (v0.8.0 T2/T4, per\n * docs/planning/v0.8.0-Design.md §3 + r2 deltas).\n *\n * `composeEdges(first, second)` pipes `first`'s output quantity into a\n * matching source of `second`, producing a NEW `BridgeEdge` (design\n * D-2 — composition closes over the edge type, so chains nest\n * arbitrarily). Defined iff:\n *\n * 1. `first.target` matches one of `second.sources` — by canonical\n * name, or via an explicit {@link QuantityIdentification} (the\n * reviewable physics judgments, e.g. \"the Hawking temperature IS\n * the temperature in Landauer's bound\");\n * 2. the junction dimensions are EXACTLY equal (the dimension-functor\n * check — ℤ⁷ integer-vector equality via the dimensional\n * calculus's `equals`);\n * 3. domains conjoin THROUGH the pipe (design D-5): the composed\n * domain checks `first`'s domain on the outer inputs and\n * `second`'s domain on the piped intermediate value. This\n * evaluates `first.evaluate` inside the predicate — acceptable\n * for scalar closed forms.\n *\n * Confidence demotes: `min(first, second)` on\n * established > speculative > highly-speculative. Composition never\n * launders credibility (improvement-plan confidence algebra).\n *\n * Operator is named `composeEdges` (NOT `compose`) — `compose` is the\n * public v0.7 Cell factory in `src/core/cell.ts` (Adam A-1).\n *\n * @module composition/compose\n */\n\nimport { equals, format } from '../dimensional/algebra.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { validate } from '../dimensional/validator.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport type { BridgeEdge, EdgeConfidence } from './edge.js';\nimport type { Quantity, RegimeAttributes } from './quantity.js';\nimport { regimeAttributesOf } from './quantity.js';\nimport { AXES } from './axes.js';\nimport { conventionFactor } from '../dimensional/unit-convention.js';\nimport {\n assertCoefficientSet,\n CompositionAliasError,\n CompositionDimensionError,\n CompositionJunctionError,\n UndefinedCompositionError,\n} from './edge.js';\nimport { DomainViolationError } from '../bridges/evaluation-errors.js';\nimport { substitute } from './expr-subst.js';\nimport { monomialExponents } from './formula-shape.js';\n// Atlas Phase 1 overlay. The composition table is a leaf module (pure, no\n// registry reads, no import from `src/composition/`), so this does not close a\n// cycle — same rule as the type-only atlas import in `./edge.ts`.\nimport { composeRelation, NO_COMPOSITE_CLAIM } from '../relations/composition-table.js';\nimport { checkConventions } from '../relations/conventions.js';\nimport { intersectRegimes } from '../relations/regime.js';\nimport type { Conventions, Regime, RelationContract, RelationType } from '../relations/types.js';\n\n/**\n * The `RelationContract` a composed edge carries, given the composite TYPE the\n * table returned and the two operand contracts.\n *\n * Only four types can be returned by the table (`derivation`,\n * `exact-equivalence`, `restriction`, `coarse-graining`); the other four appear\n * only as operands. `exact-equivalence` is produced by exactly one cell —\n * `exact-equivalence ∘ exact-equivalence` — so both operands are guaranteed to\n * carry the `inverse` its contract requires, and the composed inverse undoes\n * the second map first.\n *\n * NOT composed here: an `ApproximationBound`. `coarse-graining ∘\n * coarse-graining` accumulates error through `composeBounds`\n * (`src/atlas/error-algebra.ts`), which the implementation plan wires in as a\n * SEPARATE task behind this same guard. Until then the composite states its\n * type and no bound — it does not restate either operand's bound, which would\n * be a narrower error claim than the chain supports.\n *\n * @internal\n */\nfunction composedContract(\n type: Exclude<RelationType, 'approximation'>,\n first: RelationContract,\n second: RelationContract,\n): RelationContract {\n const transformation = `${first.transformation} then ${second.transformation}`;\n if (type === 'exact-equivalence') {\n // Guarded by the table: only exact ∘ exact yields exact, and that contract\n // makes `inverse` REQUIRED on both operands.\n const fi = (first as Extract<RelationContract, { type: 'exact-equivalence' }>).inverse;\n const si = (second as Extract<RelationContract, { type: 'exact-equivalence' }>).inverse;\n return { type, transformation, inverse: `${si} then ${fi}` };\n }\n return { type, transformation };\n}\n\n/**\n * A reviewable quantity-identification judgment: the assertion that\n * the quantity named `from` (an edge's target) IS the quantity named\n * `to` (another edge's source), with the physics rationale on record.\n *\n * @public\n */\nexport interface QuantityIdentification {\n readonly from: string;\n readonly to: string;\n readonly rationale: string;\n readonly citation?: string;\n}\n\n/**\n * Registered identifications (v0.8.0 CT-1). Each entry is a physics\n * judgment intended for review — see CONTRIBUTING.md.\n *\n * @public\n */\nexport const QUANTITY_IDENTIFICATIONS: readonly QuantityIdentification[] = [\n {\n from: 'hawking-temperature',\n to: 'temperature',\n rationale:\n 'The Hawking temperature of a black-hole horizon is a genuine ' +\n 'thermodynamic temperature — the temperature appearing in ' +\n \"Landauer's bound for erasure at the horizon. This is the \" +\n 'standard identification underlying black-hole thermodynamics ' +\n '(the horizon radiates as a black body at T_H).',\n citation: 'Hawking 1975 CMP 43:199; Bekenstein 1973 PRD 7:2333',\n },\n {\n from: 'de-broglie-wavelength',\n to: 'compton-wavelength',\n rationale:\n 'The de Broglie wavelength λ = h/p and the Compton wavelength ' +\n 'λ_C = h/(mc) are the SAME matter-wavelength quantity of a massive ' +\n 'particle; the Compton wavelength is its value in the relativistic ' +\n 'limit p = mc (v → c). They are equal only in that limit, but at the ' +\n 'composition graph’s quantity-KIND resolution they name one node. ' +\n 'Folded ONTO compton-wavelength (not the reverse) because that node is ' +\n 'anchor-determinable (ℏ/mc from a mass) and carries the sourced atomic ' +\n 'scale the magnitude gate needs; de-broglie’s own form needs a ' +\n 'momentum the single-mass anchor does not supply.',\n citation: 'de Broglie 1924; Compton 1923 Phys. Rev. 21:483',\n },\n {\n from: 'thermal-de-broglie-wavelength',\n to: 'thermal-wavelength',\n rationale:\n 'The catalog names the thermal de Broglie wavelength ' +\n 'λ_T = √(2πℏ²/(m k_B T)) `thermal-de-broglie-wavelength` (BE-11 Zurek ' +\n 'decoherence, BE-12 Caldeira–Leggett coherence length), while the ' +\n 'canonical L-layer law `CE-thermal-de-broglie` names the SAME physical ' +\n 'quantity `thermal-wavelength`. They are one node. Folded ONTO the ' +\n 'canonical `thermal-wavelength` (anchor-determinable: √(2πℏ²/(m k_B T)) ' +\n 'from a mass + temperature), reconnecting BE-11 — an ESTABLISHED bridge — ' +\n 'to standard physics (surfaced by the bridges-vs-canonical map; the link ' +\n 'was hidden purely by the name divergence).',\n citation: 'de Broglie 1924; standard statistical mechanics (λ_T)',\n },\n];\n\n/**\n * Effective regime attributes for a candidate NAME, resolved through the\n * `QUANTITY_IDENTIFICATIONS` fold — the SINGLE shared implementation every\n * attribute consumer must use (Eve r3 #2 mandate; the discovery-hardening\n * Phase-2 axis-compatibility gate is the first). `attributesByName` is the\n * REGISTRY-only source (never canonical per-equation stamps — Option-A,\n * audit adjudication F1): callers supply it (production: every centralized\n * `Quantity.attributes`; tests: an injected fixture map), this function only\n * does the fold resolution.\n *\n * Candidate names are already fold-canonicalized (the `to` side of an\n * identification); this additionally pulls in every `from` contributor that\n * folds ONTO `name` and, per axis, unions their stated value with `name`'s\n * own. Where contributors DISAGREE on an axis, the axis counts as UNSTATED\n * (conflict → abstain) rather than picking a side — the fold-conflict rule.\n *\n * @internal\n */\nexport function effectiveAttributes(\n name: string,\n attributesByName: ReadonlyMap<string, RegimeAttributes>,\n idents: readonly QuantityIdentification[] = QUANTITY_IDENTIFICATIONS,\n): RegimeAttributes {\n const contributors: RegimeAttributes[] = [];\n const own = attributesByName.get(name);\n if (own) contributors.push(own);\n for (const id of idents) {\n if (id.to !== name) continue;\n const folded = attributesByName.get(id.from);\n if (folded) contributors.push(folded);\n }\n\n // One-value-agrees, zero-or-conflicting-values-abstain, per REGISTRY axis.\n // The fold reads `AXES`, so an axis the registry carries is folded here: a\n // hand list once named scale, force and information only, and the\n // discrimination audit then measured symmetry, topology and statistics as\n // `checked: 0` whatever the data said (9.0.0 audit §4 C2).\n const folded: Record<string, string> = {};\n for (const { name } of AXES) {\n const values = new Set(\n contributors.map((c) => (c as Readonly<Record<string, string | undefined>>)[name]).filter((v) => v !== undefined),\n );\n if (values.size === 1) folded[name] = [...values][0]!;\n }\n return regimeAttributesOf(folded, `effectiveAttributes(${name})`);\n}\n\n/**\n * A recorded aliasing judgment for one duplicate source name in a\n * composition (v0.11 Option D). `'shared'` = one input deliberately\n * feeds both slots (e.g. ST-2: one M is both the lens and the r_s\n * source). `renameSecond` = split the collision: the SECOND operand's\n * quantity is renamed, and the composed evaluator remaps the renamed\n * input key back to the operand's internal name (vet A-4 — without the\n * remap the rename is a no-op).\n *\n * @public\n */\nexport interface AliasDisposition {\n readonly name: string;\n readonly treatAs: 'shared' | { readonly renameSecond: string };\n readonly rationale: string;\n readonly citation?: string;\n}\n\n/**\n * Registered alias dispositions, keyed by composed id\n * (`first.id>>second.id`) — judgments live in reviewable registry\n * data, mirroring {@link QUANTITY_IDENTIFICATIONS} (vet A-6.2).\n *\n * @public\n */\nexport const SOURCE_ALIAS_DISPOSITIONS: Readonly<\n Record<string, readonly AliasDisposition[]>\n> = {\n // Empty. The one entry this table held, `law-schwarzschild-radius>>be-51`\n // (\"ST-2\": one M is both the lens and the r_s source), keyed a composition\n // no call can reach: the law's target `schwarzschild-radius` matches none\n // of be-51's sources (`mass`, `impact-parameter`) by name or registered\n // identification, so `composeEdges` throws `CompositionJunctionError`\n // before the alias gate runs. The judgment was never applied. Retracted in\n // the 9.0.0 audit (§4 C8); `tests/composition/compose.test.ts` now requires\n // every key here to reach the gate.\n};\n\nconst CONFIDENCE_RANK: Record<EdgeConfidence, number> = {\n established: 2,\n speculative: 1,\n 'highly-speculative': 0,\n};\n\n/**\n * Confidence demotion: the min of the two grades on the ordering\n * established > speculative > highly-speculative.\n *\n * @public\n */\nexport function minConfidence(\n a: EdgeConfidence,\n b: EdgeConfidence,\n): EdgeConfidence {\n return CONFIDENCE_RANK[a] <= CONFIDENCE_RANK[b] ? a : b;\n}\n\n/** Options for {@link composeEdges}. @public */\nexport interface ComposeOptions {\n /** Extra identifications, consulted after the registered ones. */\n readonly identifications?: readonly QuantityIdentification[];\n /**\n * Alias dispositions for duplicate source names (v0.11 Option D);\n * consulted after {@link SOURCE_ALIAS_DISPOSITIONS} entries for the\n * composed id.\n */\n readonly aliases?: readonly AliasDisposition[];\n}\n\nfunction findJunction(\n first: BridgeEdge,\n second: BridgeEdge,\n identifications: readonly QuantityIdentification[],\n): {\n junction: BridgeEdge['sources'][number];\n /** Position in `second.sources`: the slot the pipe fills. One slot, even when the same object sits twice. */\n index: number;\n viaIdentification: QuantityIdentification | null;\n} {\n for (const [index, src] of second.sources.entries()) {\n if (src.name === first.target.name) {\n return { junction: src, index, viaIdentification: null };\n }\n }\n for (const ident of identifications) {\n if (ident.from !== first.target.name) continue;\n for (const [index, src] of second.sources.entries()) {\n if (src.name === ident.to) {\n return { junction: src, index, viaIdentification: ident };\n }\n }\n }\n throw new CompositionJunctionError(\n `Cannot compose ${first.id} -> ${second.id}: target quantity ` +\n `'${first.target.name}' matches none of [${second.sources\n .map((s) => `'${s.name}'`)\n .join(', ')}] by name or registered identification`,\n );\n}\n\n/**\n * The two sides of a composition pipe have the same dimension.\n *\n * This is the check `composeEdges` already applied: `equals` on the seven\n * SI bases, including that function's exponent tolerance. A mismatch is\n * still {@link CompositionDimensionError}.\n *\n * @internal\n */\nexport function junctionDimensionsMatch(left: Dimension, right: Dimension): boolean {\n return equals(left, right);\n}\n\n/**\n * Compose two edges into a new edge (sequential composition through a\n * shared quantity). See module docs for the definedness conditions.\n *\n * The composed edge's `sources` are `first.sources` followed by\n * `second`'s remaining (non-junction) sources; `kind` is `'law'` only\n * when both operands are laws; `beId` is null (a derived relation has\n * no single catalog row).\n *\n * @public\n */\nexport function composeEdges(\n first: BridgeEdge,\n second: BridgeEdge,\n opts: ComposeOptions = {},\n): BridgeEdge {\n const identifications = [\n ...QUANTITY_IDENTIFICATIONS,\n ...(opts.identifications ?? []),\n ];\n const { junction, index: junctionIndex, viaIdentification } = findJunction(\n first,\n second,\n identifications,\n );\n\n if (!junctionDimensionsMatch(first.target.dim, junction.dim)) {\n throw new CompositionDimensionError(\n `Cannot compose ${first.id} -> ${second.id}: junction dimension ` +\n `mismatch — ${first.target.name} is ${format(first.target.dim)} ` +\n `but ${junction.name} is ${format(junction.dim)}`,\n );\n }\n const junctionScale =\n viaIdentification === null\n ? 1\n : conventionFactor(first.target.name, junction.name);\n\n // The pipe fills ONE slot of `second.sources`, the one `findJunction`\n // returned. Removal by object identity would also drop a second slot that\n // holds the same `Quantity` object, which a `shared` disposition produces.\n const remainingSources = second.sources.filter((_, i) => i !== junctionIndex);\n\n // v0.11 Option D (namespacing gate): pure name-collision rule across\n // operands. Intra-operand duplicates (e.g. ['mass','mass'] inherited\n // from a prior 'shared' disposition) are exempt by construction —\n // only names present in BOTH first.sources and second's remaining\n // sources are collisions, and each needs a recorded disposition.\n const firstNames = new Set(first.sources.map((s) => s.name));\n const collisionNames = [\n ...new Set(\n remainingSources\n .filter((s) => firstNames.has(s.name))\n .map((s) => s.name),\n ),\n ];\n const composedId = `${first.id}>>${second.id}`;\n const dispositions: AliasDisposition[] = [\n ...(SOURCE_ALIAS_DISPOSITIONS[composedId] ?? []),\n ...(opts.aliases ?? []),\n ];\n const renameMap: Record<string, string> = {}; // renamed key -> operand-internal name\n const dispositionsUsed: AliasDisposition[] = [];\n let finalRemaining: Quantity[] = [...remainingSources];\n for (const name of collisionNames) {\n const d = dispositions.find((x) => x.name === name);\n if (!d) {\n throw new CompositionAliasError(\n `Cannot compose ${composedId}: source quantity '${name}' appears ` +\n `in BOTH operands (first: [${[...firstNames].join(', ')}]; ` +\n `second remaining: [${remainingSources\n .map((s) => s.name)\n .join(', ')}]). Same name does not imply same physical ` +\n `quantity — record an AliasDisposition ('shared' or ` +\n `{renameSecond}) in SOURCE_ALIAS_DISPOSITIONS or opts.aliases.`,\n );\n }\n dispositionsUsed.push(d);\n if (d.treatAs === 'shared') continue; // one input key feeds both slots\n const renamed = d.treatAs.renameSecond;\n if (\n firstNames.has(renamed) ||\n second.sources.some((s) => s.name === renamed)\n ) {\n throw new CompositionAliasError(\n `Cannot compose ${composedId}: renameSecond target '${renamed}' ` +\n `collides with an existing source name of an operand (vet A-4).`,\n );\n }\n finalRemaining = finalRemaining.map((s) =>\n s.name === name ? { ...s, name: renamed, symbol: s.symbol } : s,\n );\n renameMap[renamed] = name;\n }\n\n /** Build the second operand's input map: remap renamed keys back to\n * the operand-internal names (shadowing the first operand's value\n * for that name — vet A-4's required remap), then pipe the junction. */\n const buildSecondInputs = (\n inputs: Record<string, number>,\n intermediate: number,\n ): Record<string, number> => {\n const si: Record<string, number> = { ...inputs };\n for (const [renamed, original] of Object.entries(renameMap)) {\n si[original] = inputs[renamed];\n delete si[renamed];\n }\n si[junction.name] = intermediate * junctionScale;\n return si;\n };\n\n const composedDomain = {\n description:\n `(${first.domain.description}) AND, on the piped ` +\n `${junction.name}, (${second.domain.description})`,\n // Standalone domain queries evaluate `first` to obtain the piped\n // intermediate (design D-5; acceptable for scalar closed forms).\n // The composed `evaluate` below does NOT call this predicate — it\n // computes the intermediate once and checks both domains inline\n // (v0.8.0 punch-list: removed the double evaluation of `first`).\n predicate: (inputs: Record<string, number>): boolean => {\n if (!first.domain.predicate(inputs)) return false;\n const intermediate = first.evaluate(inputs);\n return second.domain.predicate(buildSecondInputs(inputs, intermediate));\n },\n };\n\n const id = `${first.id}>>${second.id}`;\n\n // ── Atlas Phase 1 (S1.2b): the relation overlay, and NOTHING else. ────────\n // Entered only when BOTH operands carry a `relation`. An operand with no\n // relation skips this block, and the composed edge then has no `relation`\n // key. The catalog edges that carry one are the catalog's `relation` rows\n // (`tests/composition/relation-refusal.test.ts` lists them); they stay.\n // When both operands carry a relation, a silent table cell throws\n // `UndefinedCompositionError`. The approximation cell throws the same\n // error, because an edge relation carries no norm transport and this\n // layer does not invent a bound. `enumerateCompositionsWithRefusals`\n // records that throw on its own list. A dimension or junction failure\n // is a different error and is not that list.\n let relationOverlay: Pick<\n BridgeEdge,\n 'relation' | 'relationDerivedFrom' | 'conventions'\n > = {};\n if (first.relation !== undefined && second.relation !== undefined) {\n const composite = composeRelation(first.relation.type, second.relation.type);\n if (composite === NO_COMPOSITE_CLAIM) {\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the composition table ` +\n `asserts no composite relation for '${first.relation.type}' ` +\n `(${first.id}) followed by '${second.relation.type}' ` +\n `(${second.id}). This is silence, not refutation — see ` +\n `docs/planning/Atlas-Phase-1-Design.md §2.2.`,\n );\n }\n if (composite === 'approximation') {\n // Reachable since the table's one widening: approximation then\n // exact-equivalence (docs/planning/ADR-transported-norm-composition.md).\n // An `approximation` contract REQUIRES an `ApproximationBound`, and the\n // composed bound exists only when the exact map declares a norm\n // transport. A `RelationContract` on an edge carries none, so this layer\n // cannot compose the bound and must refuse rather than fabricate one.\n // The atlas route layer (`boundPath`) is where a declared transport is\n // applied.\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the composition table ` +\n `returned 'approximation', which requires a composed ` +\n `ApproximationBound; an edge relation declares no norm transport, ` +\n `so no bound is composed here (the atlas boundPath applies declared transports).`,\n );\n }\n // Conventions carry forward only when the operands do not CONTRADICT each\n // other. `checkConventions` treats an undeclared key as unknown, so a\n // silent operand never blocks the carry-forward; a genuine disagreement\n // does, and then the composite declares no conventions at all rather than\n // picking one operand's choice over the other's. One rule, not a per-key\n // filter: a chain built across a sign disagreement has no single first-law\n // convention to state, and stating one would be a claim about the chain\n // that neither operand supports.\n const merged: Conventions =\n checkConventions(first.conventions, second.conventions).length === 0\n ? { ...first.conventions, ...second.conventions }\n : {};\n relationOverlay = {\n relation: composedContract(composite, first.relation, second.relation),\n relationDerivedFrom: [first.id, second.id],\n ...(Object.keys(merged).length > 0 ? { conventions: merged } : {}),\n };\n }\n\n return {\n id,\n beId: null,\n kind: first.kind === 'law' && second.kind === 'law' ? 'law' : 'bridge',\n label: `${first.label} ∘ ${second.label}`,\n sources: [...first.sources, ...finalRemaining],\n target: second.target,\n confidence: minConfidence(first.confidence, second.confidence),\n domain: composedDomain,\n evaluate: (inputs) => {\n if (!first.domain.predicate(inputs)) {\n throw new DomainViolationError(\n `${id}: inputs violate composed validity domain ` +\n `(${composedDomain.description})`,\n );\n }\n // Each operand's unset-coefficient gate is the one `evaluateEdge`\n // applies to a primitive edge; an operand's monomial times an absent 1\n // must not reach the caller as a number through the pipe.\n assertCoefficientSet(first, inputs);\n const intermediate = first.evaluate(inputs);\n const pipedInputs = buildSecondInputs(inputs, intermediate);\n if (!second.domain.predicate(pipedInputs)) {\n throw new DomainViolationError(\n `${id}: inputs violate composed validity domain ` +\n `(${composedDomain.description})`,\n );\n }\n assertCoefficientSet(second, pipedInputs);\n return second.evaluate(pipedInputs);\n },\n citation: `${first.citation} | ${second.citation}`,\n ...(viaIdentification !== null\n ? { identificationUsed: viaIdentification }\n : {}),\n ...(dispositionsUsed.length > 0\n ? { aliasDispositionsUsed: dispositionsUsed }\n : {}),\n ...relationOverlay,\n ...carriedClaims(first, second, junction, junctionScale, finalRemaining, renameMap),\n };\n}\n\n/**\n * The claims a composed edge carries from its operands (9.0.0 audit §4 C5).\n * A composed edge that dropped them answered differently from its operands:\n * the regime gate abstained on every chain longer than two, an unset\n * coefficient became a number, an even input lost its magnitude reading,\n * a count became a Buckingham governor, and an alias key stopped working.\n *\n * - `regime`: the one an operand states; two of one family intersect\n * (`intersectRegimes`, which also refuses conflicting group definitions);\n * two of different families refuse with `UndefinedCompositionError`, since\n * this layer does not state where a cross-family chain applies.\n * - `coefficientUnset`: either operand's. `evaluateEdge` then refuses the\n * composite; a bound group lifts a primitive entry only, because the group\n * row is keyed by the entry id, so a composite with an unset operand is\n * refused by `evaluateEdge` whatever is bound (its own `evaluate` applies\n * each operand's gate and does lift the operand whose group is bound).\n * - `evenInputs`, `aliases`: the first operand's, plus the second's for its\n * remaining sources under their composed names. The piped junction is not\n * an input and is dropped. An alias key that two quantities would share is\n * carried for neither.\n * - `formulaFactors`: the second operand's for its remaining sources, exact.\n * The first operand's counts enter through the pipe with their exponent\n * times the junction's exponent in the second's monomial, so they are\n * carried only when `second.symbolic` is a monomial that states it.\n * - `symbolic`: the second's form with the junction leaf replaced by the\n * first's, when both exist, the junction carries no convention factor, no\n * source was renamed, the leaf occurs, and the result validates to the\n * target dimension. Otherwise absent, as on a numeric-only edge.\n */\nfunction carriedClaims(\n first: BridgeEdge,\n second: BridgeEdge,\n junction: Quantity,\n junctionScale: number,\n finalRemaining: readonly Quantity[],\n renameMap: Readonly<Record<string, string>>,\n): Pick<BridgeEdge, 'regime' | 'coefficientUnset' | 'evenInputs' | 'formulaFactors' | 'aliases' | 'symbolic'> {\n const out: {\n regime?: Regime;\n coefficientUnset?: boolean;\n evenInputs?: readonly string[];\n formulaFactors?: Readonly<Record<string, number>>;\n aliases?: Readonly<Record<string, readonly string[]>>;\n symbolic?: ExprNode;\n } = {};\n\n if (first.regime !== undefined && second.regime !== undefined) {\n if (first.regime.family !== second.regime.family) {\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the regimes are of different ` +\n `families ('${first.regime.family}', '${second.regime.family}'), and this ` +\n `layer does not state where a cross-family chain applies.`,\n );\n }\n try {\n out.regime = intersectRegimes(first.regime, second.regime);\n } catch (e) {\n // Conflicting definitions of one group name: the composite has no regime this\n // layer can state, the same refusal as a cross-family chain.\n throw new UndefinedCompositionError(`Cannot compose ${first.id} -> ${second.id}: ${(e as Error).message}`);\n }\n } else if (first.regime !== undefined || second.regime !== undefined) {\n out.regime = first.regime ?? second.regime;\n }\n\n if (first.coefficientUnset === true || second.coefficientUnset === true) out.coefficientUnset = true;\n\n // Operand-internal name → the name the composite exposes it under.\n const composedName = new Map(Object.entries(renameMap).map(([renamed, original]) => [original, renamed]));\n const exposed = (name: string): string => composedName.get(name) ?? name;\n const remainingNames = new Set(finalRemaining.map((s) => s.name));\n const secondRemaining = (name: string): boolean => name !== junction.name && remainingNames.has(exposed(name));\n\n const even = [\n ...(first.evenInputs ?? []),\n ...(second.evenInputs ?? []).filter(secondRemaining).map(exposed),\n ];\n if (even.length > 0) out.evenInputs = even;\n\n const factors: Record<string, number> = {};\n const junctionExponent = monomialExponents(second.symbolic)?.get(junction.name);\n if (first.formulaFactors !== undefined && junctionExponent !== undefined) {\n for (const [name, exp] of Object.entries(first.formulaFactors)) factors[name] = exp * junctionExponent;\n }\n for (const [name, exp] of Object.entries(second.formulaFactors ?? {})) {\n if (secondRemaining(name)) factors[exposed(name)] = exp;\n }\n if (Object.keys(factors).length > 0) out.formulaFactors = factors;\n\n const aliasOwner = new Map<string, string>();\n const shared = new Set<string>();\n const aliases: Record<string, string[]> = {};\n const addAliases = (quantity: string, keys: readonly string[]): void => {\n for (const key of keys) {\n const owner = aliasOwner.get(key);\n if (owner !== undefined && owner !== quantity) shared.add(key);\n aliasOwner.set(key, quantity);\n (aliases[quantity] ??= []).push(key);\n }\n };\n for (const [quantity, keys] of Object.entries(first.aliases ?? {})) addAliases(quantity, keys);\n for (const [quantity, keys] of Object.entries(second.aliases ?? {})) {\n if (secondRemaining(quantity)) addAliases(exposed(quantity), keys);\n }\n const kept = Object.fromEntries(\n Object.entries(aliases)\n .map(([quantity, keys]) => [quantity, keys.filter((k) => !shared.has(k))] as const)\n .filter(([, keys]) => keys.length > 0),\n );\n if (Object.keys(kept).length > 0) out.aliases = kept;\n\n if (\n first.symbolic !== undefined &&\n second.symbolic !== undefined &&\n junctionScale === 1 &&\n Object.keys(renameMap).length === 0\n ) {\n const { expr, count } = substitute(second.symbolic, junction.name, first.symbolic);\n const v = count > 0 ? validate(expr) : undefined;\n if (v !== undefined && v.ok && v.inferredDimension !== null && equals(v.inferredDimension, second.target.dim)) {\n out.symbolic = expr;\n }\n }\n\n return out;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"composition-recovery.js","sourceRoot":"","sources":["../../src/composition/composition-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAyBlF,SAAS,OAAO,CAAC,IAA6B;IAC5C,OAAO,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;;;GAQG;AAC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;YAAE,OAAO,MAAM,CAAC;QAChC,OAAO,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC","sourcesContent":["/**\n * Composition-derived recovery.\n *\n * Single-bridge linkage asks whether one bridge RHS is a canonical equation.\n * This asks the same question of a chain of two edges that both carry a\n * symbolic form. The comparison is `normalForm`: the same relation up to a\n * dimensionless factor. Dimensionful cancellation is not applied, so an\n * unsimplified chain is not rewritten into a simpler formula.\n *\n * A chain is never `restates-canonical`. That label is the F4 guard on one\n * bridge the registry already names. A chain is a derivation, and a\n * structural match is `recovers`.\n *\n * @module composition/composition-recovery\n * @internal\n */\n\nimport { CANONICAL_EQUATIONS } from '../canonical/registry.js';\nimport { normalForm } from '../canonical/normal-form.js';\nimport { CATALOG_GRAPH } from './catalog-graph.js';\nimport { composeSymbolic, SymbolicCompositionError } from './compose-symbolic.js';\nimport type { BridgeEdge } from './edge.js';\n\n/** One ordered pair of edges that composed. @internal */\nexport interface CompositionRecoveryPair {\n readonly firstId: string;\n readonly secondId: string;\n}\n\n/**\n * A chain whose normal form equals a canonical scalar AST.\n * `classification` is always `recovers`.\n * @internal\n */\nexport interface CompositionRecoveryHit extends CompositionRecoveryPair {\n readonly canonicalId: string;\n readonly classification: 'recovers';\n}\n\n/** The chains that were searched, and the ones that matched. @internal */\nexport interface CompositionRecoveryScan {\n readonly pairs: readonly CompositionRecoveryPair[];\n readonly hits: readonly CompositionRecoveryHit[];\n}\n\nfunction pairKey(pair: CompositionRecoveryPair): string {\n return `${pair.firstId}\\0${pair.secondId}`;\n}\n\n/**\n * Search two-edge symbolic chains against the canonical registry.\n *\n * The default edge list is the catalog graph. A caller may pass a shorter\n * list; the canonical side stays the registry. Pairs that cannot compose\n * are not examined. Order is by edge id, then canonical id.\n *\n * @internal\n */\nexport function scanCompositionRecovery(\n edges: readonly BridgeEdge[] = CATALOG_GRAPH,\n): CompositionRecoveryScan {\n const symbolic = edges.filter((edge) => edge.symbolic !== undefined);\n const canons = CANONICAL_EQUATIONS.filter((ce) => ce.scalarAst !== undefined).map((ce) => ({\n id: ce.id,\n normal: normalForm(ce.scalarAst!),\n }));\n\n const pairs: CompositionRecoveryPair[] = [];\n const hits: CompositionRecoveryHit[] = [];\n\n for (const first of symbolic) {\n for (const second of symbolic) {\n if (first.id === second.id) continue;\n let expr;\n try {\n expr = composeSymbolic(first, second).expr;\n } catch (error) {\n if (error instanceof SymbolicCompositionError) continue;\n throw error;\n }\n pairs.push({ firstId: first.id, secondId: second.id });\n const form = normalForm(expr);\n for (const canon of canons) {\n if (form !== canon.normal) continue;\n hits.push({\n firstId: first.id,\n secondId: second.id,\n canonicalId: canon.id,\n classification: 'recovers',\n });\n }\n }\n }\n\n pairs.sort((a, b) => (pairKey(a) < pairKey(b) ? -1 : pairKey(a) > pairKey(b) ? 1 : 0));\n hits.sort((a, b) => {\n const byPair = pairKey(a) < pairKey(b) ? -1 : pairKey(a) > pairKey(b) ? 1 : 0;\n if (byPair !== 0) return byPair;\n return a.canonicalId < b.canonicalId ? -1 : a.canonicalId > b.canonicalId ? 1 : 0;\n });\n return { pairs, hits };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"consequence.d.ts","sourceRoot":"","sources":["../../src/composition/consequence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,cAAc;AACd,MAAM,MAAM,iBAA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