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":"quantity-registry.d.ts","sourceRoot":"","sources":["../../src/dimensional/quantity-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,uDAAuD;AACvD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnD,wDAAwD;AACxD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE7C,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AA0BD,wDAAwD;AACxD,wBAAgB,kBAAkB,IAAI,SAAS,cAAc,EAAE,CAE9D;AAED,6EAA6E;AA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ACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAY1G;AAID,wDAAwD;AACxD,wBAAgB,kBAAkB,IAAI,SAAS,cAAc,EAAE,CAE9D;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEvE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAQ1E"}
@@ -1,36 +1,73 @@
1
1
  /**
2
2
  * The quantity registry. Canonical id, aliases, dimension, and whether an
3
3
  * affine temperature is an absolute point or an interval. Synonym groups and
4
- * the temperature role are projections of this table.
4
+ * the temperature role are projections of this table. The aliases of a
5
+ * quantity that is also a registered constant come from the constant registry.
5
6
  *
6
7
  * @module dimensional/quantity-registry
7
8
  */
8
- import { readFileSync } from 'node:fs';
9
- import { dirname, join } from 'node:path';
10
- import { fileURLToPath } from 'node:url';
11
- const foldName = (s) => s.replace(/_/g, '-');
12
- function loadQuantities() {
13
- const path = join(dirname(fileURLToPath(import.meta.url)), '../../data/quantities.json');
14
- const parsed = JSON.parse(readFileSync(path, 'utf8'));
15
- return parsed.quantities;
9
+ import { checkedDataFile } from '../core/data-file.js';
10
+ import { CONSTANT_REGISTRY } from './symbolic-constants.js';
11
+ /** `_` written as `-`: the one fold every spelling comparison uses. */
12
+ export const foldName = (s) => s.replace(/_/g, '-');
13
+ const isAffineTemperature = (dimension) => dimension.Theta === 1 && dimension.L === 0 && dimension.M === 0 && dimension.T === 0 && dimension.I === 0 && dimension.N === 0 && dimension.J === 0;
14
+ /**
15
+ * The rows of a quantity file. A constant that is also a quantity (`k_B` is
16
+ * `boltzmann-constant`) gives that row its spellings as aliases: the
17
+ * constant registry owns them and the file does not repeat them. A `kind` is
18
+ * the role of an affine temperature, so a row whose dimension is not Θ¹ may
19
+ * not carry one: there it decides nothing and misleads a reader.
20
+ * @internal
21
+ */
22
+ export function readQuantityFile(parsed) {
23
+ for (const row of parsed.quantities) {
24
+ if (row.kind !== undefined && !isAffineTemperature(row.dimension)) {
25
+ throw new Error(`data/quantities.json: ${row.id}: kind ${row.kind} on a quantity that is not an affine temperature`);
26
+ }
27
+ }
28
+ const ids = new Set(parsed.quantities.map((row) => row.id));
29
+ const derived = new Map();
30
+ for (const constant of CONSTANT_REGISTRY) {
31
+ if (constant.quantity === undefined)
32
+ continue;
33
+ if (!ids.has(constant.quantity)) {
34
+ throw new Error(`constant '${constant.name}' names quantity '${constant.quantity}', which data/quantities.json does not have`);
35
+ }
36
+ derived.set(constant.quantity, [...(derived.get(constant.quantity) ?? []), constant.name, ...constant.spellings]);
37
+ }
38
+ return parsed.quantities.map((row) => {
39
+ const known = new Set([row.id, ...(row.aliases ?? [])].map(foldName));
40
+ const spellings = (derived.get(row.id) ?? []).filter((spelling) => !known.has(foldName(spelling)));
41
+ return spellings.length === 0 ? row : { ...row, aliases: [...(row.aliases ?? []), ...spellings] };
42
+ });
16
43
  }
17
- const QUANTITIES = loadQuantities();
18
- const BY_KEY = new Map();
19
- for (const row of QUANTITIES) {
20
- BY_KEY.set(row.id, row);
21
- BY_KEY.set(foldName(row.id), row);
22
- for (const alias of row.aliases ?? []) {
23
- BY_KEY.set(alias, row);
24
- BY_KEY.set(foldName(alias), row);
44
+ const QUANTITIES = readQuantityFile(checkedDataFile('quantities.json'));
45
+ /**
46
+ * Folded spelling → row, over every id and alias. Two rows that one folded
47
+ * spelling names throw: the later row would silently shadow the earlier.
48
+ * @internal
49
+ */
50
+ export function quantitySpellingIndex(rows) {
51
+ const index = new Map();
52
+ for (const row of rows) {
53
+ for (const spelling of new Set([row.id, ...(row.aliases ?? [])].map(foldName))) {
54
+ const other = index.get(spelling);
55
+ if (other !== undefined) {
56
+ throw new Error(`data/quantities.json: '${spelling}' spells both '${other.id}' and '${row.id}' (\`_\` and \`-\` are one character)`);
57
+ }
58
+ index.set(spelling, row);
59
+ }
25
60
  }
61
+ return index;
26
62
  }
63
+ const BY_KEY = quantitySpellingIndex(QUANTITIES);
27
64
  /** Every quantity record, graph nodes and spellings. */
28
65
  export function allQuantityRecords() {
29
66
  return QUANTITIES;
30
67
  }
31
68
  /** The record `name` spells, comparing `_` and `-` as the same character. */
32
69
  export function quantityRecord(name) {
33
- return BY_KEY.get(name) ?? BY_KEY.get(foldName(name));
70
+ return BY_KEY.get(foldName(name));
34
71
  }
35
72
  /**
36
73
  * Synonym groups projected from declared aliases. The canonical id is first.
@@ -1 +1 @@
1
- {"version":3,"file":"quantity-registry.js","sourceRoot":"","sources":["../../src/dimensional/quantity-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyBzC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAE7D,SAAS,cAAc;IACrB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,4BAA4B,CAAC,CAAC;IACzF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAiB,CAAC;IACtE,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC;AAEpC,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;AACjD,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC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AE,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;YAC/E,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAClC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,kBAAkB,KAAK,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,uCAAuC,CAAC,CAAC;YACvI,CAAC;YACD,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,MAAM,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAEjD,wDAAwD;AACxD,MAAM,UAAU,kBAAkB;IAChC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * The quantity registry. Canonical id, aliases, dimension, and whether an\n * affine temperature is an absolute point or an interval. Synonym groups and\n * the temperature role are projections of this table. The aliases of a\n * quantity that is also a registered constant come from the constant registry.\n *\n * @module dimensional/quantity-registry\n */\n\nimport { checkedDataFile } from '../core/data-file.js';\nimport type { Dimension } from './types.js';\nimport { CONSTANT_REGISTRY } from './symbolic-constants.js';\n\n/** Declared role of an affine temperature quantity. */\nexport type QuantityKind = 'absolute' | 'interval';\n\n/** A carrier that enters a same-sign transport rule. */\nexport type SignRole = 'charge' | 'mobility';\n\n/** One quantity. `graphNode` is false for a spelling that is not a graph node. */\nexport interface QuantityRecord {\n readonly id: string;\n readonly symbol: string;\n readonly dimension: Dimension;\n readonly attributes: Readonly<Record<string, string>>;\n readonly kind?: QuantityKind;\n readonly aliases?: readonly string[];\n readonly signRole?: SignRole;\n readonly graphNode: boolean;\n}\n\n/** The shape of `data/quantities.json`. @internal */\nexport interface QuantityFile {\n readonly quantities: readonly QuantityRecord[];\n}\n\n/** `_` written as `-`: the one fold every spelling comparison uses. */\nexport const foldName = (s: string): string => s.replace(/_/g, '-');\n\nconst isAffineTemperature = (dimension: Dimension): boolean =>\n dimension.Theta === 1 && dimension.L === 0 && dimension.M === 0 && dimension.T === 0 && dimension.I === 0 && dimension.N === 0 && dimension.J === 0;\n\n/**\n * The rows of a quantity file. A constant that is also a quantity (`k_B` is\n * `boltzmann-constant`) gives that row its spellings as aliases: the\n * constant registry owns them and the file does not repeat them. A `kind` is\n * the role of an affine temperature, so a row whose dimension is not Θ¹ may\n * not carry one: there it decides nothing and misleads a reader.\n * @internal\n */\nexport function readQuantityFile(parsed: QuantityFile): readonly QuantityRecord[] {\n for (const row of parsed.quantities) {\n if (row.kind !== undefined && !isAffineTemperature(row.dimension)) {\n throw new Error(`data/quantities.json: ${row.id}: kind ${row.kind} on a quantity that is not an affine temperature`);\n }\n }\n const ids = new Set(parsed.quantities.map((row) => row.id));\n const derived = new Map<string, string[]>();\n for (const constant of CONSTANT_REGISTRY) {\n if (constant.quantity === undefined) continue;\n if (!ids.has(constant.quantity)) {\n throw new Error(`constant '${constant.name}' names quantity '${constant.quantity}', which data/quantities.json does not have`);\n }\n derived.set(constant.quantity, [...(derived.get(constant.quantity) ?? []), constant.name, ...constant.spellings]);\n }\n return parsed.quantities.map((row) => {\n const known = new Set([row.id, ...(row.aliases ?? [])].map(foldName));\n const spellings = (derived.get(row.id) ?? []).filter((spelling) => !known.has(foldName(spelling)));\n return spellings.length === 0 ? row : { ...row, aliases: [...(row.aliases ?? []), ...spellings] };\n });\n}\n\nconst QUANTITIES = readQuantityFile(checkedDataFile('quantities.json') as QuantityFile);\n\n/**\n * Folded spelling → row, over every id and alias. Two rows that one folded\n * spelling names throw: the later row would silently shadow the earlier.\n * @internal\n */\nexport function quantitySpellingIndex(rows: readonly QuantityRecord[]): ReadonlyMap<string, QuantityRecord> {\n const index = new Map<string, QuantityRecord>();\n for (const row of rows) {\n for (const spelling of new Set([row.id, ...(row.aliases ?? [])].map(foldName))) {\n const other = index.get(spelling);\n if (other !== undefined) {\n throw new Error(`data/quantities.json: '${spelling}' spells both '${other.id}' and '${row.id}' (\\`_\\` and \\`-\\` are one character)`);\n }\n index.set(spelling, row);\n }\n }\n return index;\n}\n\nconst BY_KEY = quantitySpellingIndex(QUANTITIES);\n\n/** Every quantity record, graph nodes and spellings. */\nexport function allQuantityRecords(): readonly QuantityRecord[] {\n return QUANTITIES;\n}\n\n/** The record `name` spells, comparing `_` and `-` as the same character. */\nexport function quantityRecord(name: string): QuantityRecord | undefined {\n return BY_KEY.get(foldName(name));\n}\n\n/**\n * Synonym groups projected from declared aliases. The canonical id is first.\n * A quantity with no alias is not a group.\n */\nexport function synonymGroupsFromRegistry(): readonly (readonly string[])[] {\n const groups: string[][] = [];\n for (const row of QUANTITIES) {\n const aliases = row.aliases ?? [];\n if (aliases.length === 0) continue;\n groups.push([row.id, ...aliases]);\n }\n return groups;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"rg-flow.js","sourceRoot":"","sources":["../../src/dimensional/rg-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;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C,EAAE,EAAE,CAAC;YAChD,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CACb,gCAAgC,CAAC,cAAc;oBAC7C,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,yBAAyB,CAAC,IAAI,CAC3D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AAC9D,CAAC","sourcesContent":["/**\n * Renormalization-group (RG) flow primitives — `RGCouplingNode` +\n * `BetaFunctionNode` (v0.7 BE-X re-encoding sprint).\n *\n * Encodes the structure of a Wilsonian / functional-RG flow on the\n * space of *dimensionless* couplings. The motivating physics context\n * is the asymptotic-safety program for quantum gravity (Reuter 1998\n * *Phys. Rev. D* 57:971, arXiv:hep-th/9605030; Niedermaier-Reuter 2006\n * *Living Rev. Relativity* 9:5 for the canonical review), in which RG\n * flow on the space of dimensionless couplings `g_n = G_n(k)·k^{d_n}`\n * is governed by polynomial β-functions\n *\n * β_n(g_1, g_2, …) ≡ k ∂_k g_n\n *\n * and a viable UV-complete theory is signalled by the existence of a\n * non-Gaussian fixed point `(g_1*, g_2*, …)` at which every β_n\n * vanishes simultaneously. The structural distinction made here:\n *\n * - `RGCouplingNode` represents a single dimensionless coupling\n * (`g`, `λ`, …) — a labelled handle, dim hardcoded to\n * DIMENSIONLESS for type-system symmetry with other AST nodes.\n * - `BetaFunctionNode` represents one β-function of a multi-coupling\n * flow: it carries the FULL coupling vector (the flow direction),\n * a `target` selector picking out which coupling's β-function this\n * node represents, the polynomial expression in those couplings,\n * and an optional UV / IR fixed-point pin.\n *\n * The polynomial expression is a standard `ExprNode` built from\n * dimensionless symbols + the existing `op (+ * / ^ -)` primitives;\n * `validateBetaFunction` delegates dimensional checking to the existing\n * `validate()` from `validator.ts` and verifies the result reduces to\n * DIMENSIONLESS.\n *\n * These primitives are NOT (yet) added to the `ExprNode` union — they\n * live as a standalone predicate-level structure that callers compose\n * adjacent to the existing AST. BE-39's polynomial RHS continues to be\n * encoded as plain `op`-trees for catalog round-trip; the structural\n * `BetaFunctionNode` wrapper supplies the higher-level RG-flow\n * semantics on top.\n *\n * @module dimensional/rg-flow\n */\n\nimport type { ExprNode } from './validator.js';\nimport { validate } from './validator.js';\nimport type { Dimension } from './types.js';\nimport { DIMENSIONLESS } from './types.js';\nimport { validateComponentDimension } from './field-equation-helpers.js';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// RGCouplingNode\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * AST node for a single dimensionless RG coupling (e.g. `g`, `λ`).\n *\n * By RG-discipline every coupling appearing in a β-function expression\n * is dimensionless: physical dimensionful couplings `G_n` are made\n * dimensionless via the RG scale `k` (e.g. `g = G·k²`, `λ = Λ/k²`).\n * The `dim` field is therefore hardcoded to `DIMENSIONLESS`; it is\n * exposed for type-system symmetry with `{ kind: 'symbol' }` so a\n * future ExprNode-union integration is mechanical.\n *\n * @public\n */\nexport interface RGCouplingNode {\n readonly kind: 'rg-coupling';\n /** Coupling name, e.g. `'g'`, `'lambda'`. Non-empty. */\n readonly name: string;\n /** Always `DIMENSIONLESS` — RG-discipline invariant. */\n readonly dim: Dimension;\n}\n\n/**\n * Construct an `RGCouplingNode` with the dimensionless invariant\n * pre-applied. Convenience helper — callers may also build the node\n * literal directly.\n *\n * @public\n */\nexport function rgCoupling(name: string): RGCouplingNode {\n return { kind: 'rg-coupling', name, dim: DIMENSIONLESS };\n}\n\n/**\n * Validate an `RGCouplingNode`.\n *\n * Predicates:\n * 1. `name` is a non-empty string (dimension validators reject empty\n * labels because they make error messages unintelligible).\n * 2. `dim` is `DIMENSIONLESS` (RG-discipline invariant; physical\n * dimension is absorbed into the running scale `k`).\n *\n * Throws an `Error` with `\"name\"` / `\"dimension\"` in the message on\n * failure.\n *\n * @public\n */\nexport function validateRGCoupling(node: RGCouplingNode): void {\n if (typeof node.name !== 'string' || node.name.length === 0) {\n throw new Error(\n `RGCouplingNode: invalid name — must be a non-empty string ` +\n `(got ${JSON.stringify(node.name)}).`,\n );\n }\n validateComponentDimension(\n 'RGCouplingNode',\n `coupling '${node.name}'`,\n node.dim,\n DIMENSIONLESS,\n `must be DIMENSIONLESS by RG-discipline. Physical dimension should be absorbed into the running scale k.`,\n );\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// BetaFunctionNode\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * AST node for a single β-function in a multi-coupling RG flow.\n *\n * Fields:\n * - `couplings` — the full coupling vector `(g_1, g_2, …)`; this is\n * the flow direction. Every coupling must appear here, even those\n * that do not enter the polynomialExpansion of this specific\n * β-function (so that the cross-coupling dependency structure is\n * captured at the type level).\n * - `target` — the coupling whose β-function this node represents.\n * MUST be one of `couplings` (by name).\n * - `polynomialExpansion` — the explicit β(couplings) expression as\n * a standard `ExprNode`. Must reduce to `DIMENSIONLESS` via the\n * existing `validate()`.\n * - `fixedPoint` — optional UV / IR fixed-point pin, one numeric\n * value per coupling in the same order as `couplings`. When\n * present, `fixedPoint.length === couplings.length` is enforced.\n *\n * The polynomial form follows Reuter 1998 + the Niedermaier-Reuter 2006\n * review: each β_n is a polynomial in the dimensionless couplings,\n * truncated at some power dictated by the chosen truncation scheme\n * (e.g. canonical Einstein-Hilbert truncation for gravity).\n *\n * @public\n */\nexport interface BetaFunctionNode {\n readonly kind: 'beta-function';\n readonly couplings: ReadonlyArray<RGCouplingNode>;\n readonly target: RGCouplingNode;\n readonly polynomialExpansion: ExprNode;\n readonly fixedPoint?: ReadonlyArray<number>;\n}\n\n/**\n * Result of validating a `BetaFunctionNode`.\n *\n * `dim` is always `DIMENSIONLESS` (a β-function of dimensionless\n * couplings is itself dimensionless: `β = k ∂_k g` with both `g` and\n * `k ∂_k log(k)` dimensionless). `targetName` is the validated target\n * coupling label, useful for downstream RG-flow assembly.\n *\n * @public\n */\nexport interface BetaFunctionValidationResult {\n readonly dim: Dimension;\n readonly targetName: string;\n}\n\n/**\n * Validate a `BetaFunctionNode`.\n *\n * Predicates:\n *\n * 1. **Coupling list non-empty**: `couplings.length >= 1`. A flow\n * with no couplings has no β-function to define.\n * 2. **Every coupling is well-formed**: each entry passes\n * `validateRGCoupling`. Names must be unique.\n * 3. **Target ∈ couplings**: `target.name` appears in\n * `couplings.map(c => c.name)`. Throws an Error scoped\n * `'BetaFunctionNode: target …'` on miss.\n * 4. **Polynomial dimensionless**: `validate(polynomialExpansion)`\n * succeeds and yields `DIMENSIONLESS`. Anything else throws with\n * `'dimension'` in the message.\n * 5. **Fixed-point length match** (if `fixedPoint` is set):\n * `fixedPoint.length === couplings.length`. Each value must be\n * finite. Throws scoped `'BetaFunctionNode: fixedPoint …'` on\n * mismatch.\n *\n * @public\n */\nexport function validateBetaFunction(\n node: BetaFunctionNode,\n): BetaFunctionValidationResult {\n // ── Predicate 1: coupling list non-empty ───────────────────────────────────\n if (node.couplings.length === 0) {\n throw new Error(\n `BetaFunctionNode: coupling list is empty — an RG flow requires ` +\n `at least one coupling. Define the flow direction in 'couplings'.`,\n );\n }\n\n // ── Predicate 2: every coupling is well-formed; names unique ──────────────\n const seen = new Set<string>();\n for (const c of node.couplings) {\n validateRGCoupling(c);\n if (seen.has(c.name)) {\n throw new Error(\n `BetaFunctionNode: duplicate coupling name '${c.name}' in ` +\n `couplings list. Each RGCouplingNode must have a unique name.`,\n );\n }\n seen.add(c.name);\n }\n\n // ── Predicate 3: target is one of the couplings ───────────────────────────\n validateRGCoupling(node.target);\n if (!seen.has(node.target.name)) {\n throw new Error(\n `BetaFunctionNode: target coupling '${node.target.name}' is not in ` +\n `the couplings list [${[...seen].join(', ')}]. The target must be ` +\n `one of the flow-direction couplings.`,\n );\n }\n\n // ── Predicate 4: polynomialExpansion validates to DIMENSIONLESS ───────────\n const polyResult = validate(node.polynomialExpansion);\n if (!polyResult.ok || polyResult.inferredDimension === null) {\n const noteSummary = polyResult.violations\n .map((v) => v.note)\n .join('; ');\n throw new Error(\n `BetaFunctionNode: polynomialExpansion failed dimension inference ` +\n `for target '${node.target.name}' — ${noteSummary || 'no detail available'}.`,\n );\n }\n validateComponentDimension(\n 'BetaFunctionNode',\n `polynomialExpansion for target '${node.target.name}'`,\n polyResult.inferredDimension,\n DIMENSIONLESS,\n `must be DIMENSIONLESS (β-function of dimensionless couplings).`,\n );\n\n // ── Predicate 5: fixed-point length agrees with couplings count ───────────\n if (node.fixedPoint !== undefined) {\n if (node.fixedPoint.length !== node.couplings.length) {\n throw new Error(\n `BetaFunctionNode: fixedPoint length mismatch — got ` +\n `${node.fixedPoint.length} value(s) but couplings list has ` +\n `${node.couplings.length}. Provide one fixed-point coordinate ` +\n `per coupling in the same order as 'couplings'.`,\n );\n }\n for (let i = 0; i < node.fixedPoint.length; i++) {\n const v = node.fixedPoint[i];\n if (!Number.isFinite(v)) {\n throw new Error(\n `BetaFunctionNode: fixedPoint[${i}] (coupling ` +\n `'${node.couplings[i].name}') is not finite (got ${v}).`,\n );\n }\n }\n }\n\n return { dim: DIMENSIONLESS, targetName: node.target.name };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stress-energy-validators.js","sourceRoot":"","sources":["../../src/dimensional/stress-energy-validators.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA2BH;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACxC,IAA4B;IAE5B,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,qDAAqD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAC3E,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI,GAAG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ourcesContent":["/**\n * Stress-energy tensor and cosmological constant AST nodes (v0.6.0 Phase 2).\n *\n * Locked to lower-lower variance (Decision #2). Symmetry locked as\n * explicit field (Decision #12). Antisymmetric T_μν⁺ (Belinfante-Rosenfeld)\n * deferred to v0.7.0+.\n *\n * @module dimensional/stress-energy-validators\n */\n\nimport type { Dimension } from './types.js';\nimport type {\n CovariantIndex,\n StressEnergyTensorNode,\n CosmologicalConstantNode,\n} from './ast-types.js';\n\n// Node types now live in the leaf `ast-types.ts`; re-exported for compat.\nexport type { StressEnergyTensorNode, CosmologicalConstantNode } from './ast-types.js';\n\n/**\n * AST node for the stress-energy tensor T_μν. Rank-2 lower-lower locked\n * (Decision #2). Symmetric (Decision #12).\n *\n * componentDim is the SI dimension of a single component: [M·L⁻¹·T⁻²]\n * (energy density = Pa = kg·m⁻¹·s⁻²).\n *\n * @public\n */\n// v0.6.1: dropped export — internal-only validation-result shape.\ninterface StressEnergyValidationResult {\n readonly dim: Dimension;\n readonly freeIndices: Map<string, { upper: number; lower: number }>;\n}\n\n/**\n * Validate a `stress-energy` node.\n *\n * Throws:\n * - Error if rank ≠ 2 (T_μν is a rank-2 tensor by definition).\n * - Error if any index variance ≠ 'lower' (lower-lower locked per Decision #2).\n *\n * Returns `{dim: componentDim, freeIndices: {idx0: {lower:1}, idx1: {lower:1}}}`.\n */\nexport function validateStressEnergyTensor(\n node: StressEnergyTensorNode,\n): StressEnergyValidationResult {\n if (node.indices.length !== 2) {\n throw new Error(\n `StressEnergyTensorNode: expected rank-2, got rank-${node.indices.length}`,\n );\n }\n for (const idx of node.indices) {\n if (idx.variance !== 'lower') {\n throw new Error(\n `StressEnergyTensorNode: only lower-lower variance supported in v0.6.0 (got '${idx.variance}')`,\n );\n }\n }\n const freeIndices = new Map<string, { upper: number; lower: number }>();\n freeIndices.set(node.indices[0].label, { upper: 0, lower: 1 });\n freeIndices.set(node.indices[1].label, { upper: 0, lower: 1 });\n return { dim: node.componentDim, freeIndices };\n}\n\n// v0.6.1: dropped export — internal-only validation-result shape.\ninterface CosmologicalConstantValidationResult {\n readonly dim: Dimension;\n readonly freeIndices: Map<string, { upper: number; lower: number }>;\n}\n\n/**\n * Validate a `cosmological-constant` node.\n *\n * Throws:\n * - Error if dim ≠ [L⁻²] (check L === -2 && M === 0 && T === 0).\n *\n * Returns `{dim, freeIndices: empty}` (scalar — no free indices).\n */\nexport function validateCosmologicalConstant(\n node: CosmologicalConstantNode,\n): CosmologicalConstantValidationResult {\n if (node.dim.L !== -2 || node.dim.M !== 0 || node.dim.T !== 0) {\n throw new Error(\n `CosmologicalConstantNode: expected dim [L⁻²], got ${JSON.stringify(node.dim)}`,\n );\n }\n return { dim: node.dim, freeIndices: new Map() };\n}\n"]}
@@ -1,42 +1,89 @@
1
1
  /**
2
- * Symbolic-composition constant registry (v0.12 symbolic composition).
2
+ * The constant registry: one row per physical constant a formula may name.
3
3
  *
4
- * The physical constants and named numeric factors that a bridge's
5
- * `symbolic` ExprNode may reference as leaf symbols, with the SI value AND
6
- * the SI dimension. SI VALUES import from `core/constants.js` — the single
7
- * source the bridge evaluators also resolve to — so a symbolic form and its
8
- * numeric evaluator agree bit-for-bit (the drift guard binds this end-to-end;
9
- * Adam A-7 / Eve EVE-3).
4
+ * A row (written in `constant-rows.ts`) holds the formula name, its other
5
+ * exact-case spellings, the SI value (imported from `core/constants.js`, the
6
+ * one owner of every value), the SI unit in `parseUnit` syntax, the meaning
7
+ * and the source. The dimension is derived from the unit once, here; no second
8
+ * table states it. The rows sit in their own module because the unit table
9
+ * names constants by these spellings, and this module imports the unit parser. Every other
10
+ * constant table in the library ({@link CONSTANTS}, `FORMULA_NAMED`,
11
+ * `CONSTANT_SPELLINGS`, {@link CONSTANT_PROVENANCE}, `CANONICAL_CONSTANTS`,
12
+ * the `upt eval` scope, the binding scope, the gradient constants) is a
13
+ * projection of this array, so a spelling, a value and a dimension cannot
14
+ * disagree between two files. A constant that is also a quantity names its
15
+ * `data/quantities.json` row in `quantity`; the quantity registry derives that
16
+ * row's aliases from here, so the file states no constant spelling.
10
17
  *
11
- * Numeric-literal leaves (`'2'`, `'3'`) are NOT registered here — `evalExpr`
18
+ * `canonical` marks a universal constant a canonical equation's `governing`
19
+ * list may bake as a leaf. A row that is an overlay for `upt eval` and the
20
+ * dimensional assignment only (`m_p`, `N_A`, the GRW parameters) is not
21
+ * canonical, so the canonical graph does not bake it.
22
+ *
23
+ * Numeric-literal leaves (`'2'`, `'3'`) are NOT registered — `evalExpr`
12
24
  * resolves them via `Number(name)` and they are implicitly dimensionless.
13
- * Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (Adam A-1 —
14
- * `Number('8pi')` is `NaN`).
25
+ * Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (`Number('8pi')`
26
+ * is `NaN`).
15
27
  *
16
28
  * INTERNAL — not on the public surface.
17
29
  *
18
30
  * @module dimensional/symbolic-constants
19
31
  */
20
32
  import type { Dimension } from './types.js';
33
+ import { type ConstantRow } from './constant-rows.js';
34
+ /** One registered constant: its row, with the dimension derived from its unit. @internal */
35
+ export interface ConstantRecord extends ConstantRow {
36
+ readonly dim: Dimension;
37
+ }
38
+ /**
39
+ * Every registered constant, the rows of `constant-rows.ts` with each
40
+ * dimension derived once from its unit. Order is the order the tables print.
41
+ * @internal
42
+ */
43
+ export declare const CONSTANT_REGISTRY: readonly ConstantRecord[];
44
+ /** The registered constant `spelling` names, or undefined. @internal */
45
+ export declare function constantRecord(spelling: string): ConstantRecord | undefined;
46
+ /** A stated value for a registered constant disagrees with the registry. The equations use the registered value. @internal */
47
+ export declare class ConstantDisagreementError extends Error {
48
+ readonly key: string;
49
+ readonly constant: string;
50
+ readonly registered: number;
51
+ readonly given: number;
52
+ constructor(key: string, constant: string, registered: number, given: number);
53
+ }
54
+ /**
55
+ * The registered constant `key` names when `value` agrees with it within
56
+ * {@link CONSTANT_AGREEMENT}, or null when `key` names no constant. A value
57
+ * that disagrees throws {@link ConstantDisagreementError}: a constant is not
58
+ * a graph quantity, so a stated value is checked, never bound.
59
+ * @internal
60
+ */
61
+ export declare function constantAgreement(key: string, value: number): string | null;
62
+ /** The notes of the registered constants among `names`, each once, in registry order. @internal */
63
+ export declare function constantNotes(names: Iterable<string>): string[];
64
+ /** Every spelling → SI value, for a numeric scope. `pi` and `tau` are added. @internal */
65
+ export declare function constantScope(): Record<string, number>;
21
66
  /** A registered constant leaf: SI value + SI dimension. @internal */
22
- interface NamedConstantValue {
67
+ export interface NamedConstantValue {
23
68
  readonly value: number;
24
69
  readonly dim: Dimension;
25
70
  }
26
71
  /**
27
- * Constant leaves a `symbolic` ExprNode may reference. Keys are the leaf
28
- * symbol `name`s; values carry the SI magnitude and dimension. `ln2`/`8pi`/
29
- * `4pi` reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI`
30
- * exactly (same IEEE-754 primitives).
72
+ * Constant leaves a `symbolic` ExprNode may reference, keyed by formula name:
73
+ * the canonical rows of {@link CONSTANT_REGISTRY}. `ln2`/`8pi`/`4pi`
74
+ * reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI` exactly
75
+ * (same IEEE-754 primitives).
31
76
  */
32
77
  export declare const CONSTANTS: Readonly<Record<string, NamedConstantValue>>;
33
78
  /** What a registered constant is, its SI unit, and where its value comes from (audit I10). @internal */
34
79
  export interface ConstantProvenance {
35
80
  readonly meaning: string;
36
- /** The SI unit, in the syntax `parseUnit` reads; a test checks it against the registered dimension. */
81
+ /** The SI unit, in the syntax `parseUnit` reads; the registered dimension is derived from it. */
37
82
  readonly unit: string;
38
83
  readonly source: string;
39
84
  }
85
+ /** One row per {@link CONSTANT_REGISTRY} name. @internal */
86
+ export declare const CONSTANT_PROVENANCE: Readonly<Record<string, ConstantProvenance>>;
40
87
  /**
41
88
  * A spelled-out multiple of π written as one symbol (`pi`, `6pi`). `2pi`,
42
89
  * `4pi` and `8pi` are also registered in {@link CONSTANTS}; this covers the
@@ -47,7 +94,4 @@ export interface ConstantProvenance {
47
94
  * @internal
48
95
  */
49
96
  export declare function piMultipleValue(name: string): number | undefined;
50
- /** One row per {@link CONSTANTS} key; a test holds the two key sets equal. @internal */
51
- export declare const CONSTANT_PROVENANCE: Readonly<Record<string, ConstantProvenance>>;
52
- export {};
53
97
  //# sourceMappingURL=symbolic-constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"symbolic-constants.d.ts","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiC5C,qEAAqE;AACrE,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAuBlE,CAAC;AAEF,wGAAwG;AACxG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uGAAuG;IACvG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMhE;AAED,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CA6B5E,CAAC"}
1
+ {"version":3,"file":"symbolic-constants.d.ts","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC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jC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iGAAiG;IACjG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAK5E,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMhE"}
@@ -1,75 +1,128 @@
1
1
  /**
2
- * Symbolic-composition constant registry (v0.12 symbolic composition).
2
+ * The constant registry: one row per physical constant a formula may name.
3
3
  *
4
- * The physical constants and named numeric factors that a bridge's
5
- * `symbolic` ExprNode may reference as leaf symbols, with the SI value AND
6
- * the SI dimension. SI VALUES import from `core/constants.js` — the single
7
- * source the bridge evaluators also resolve to — so a symbolic form and its
8
- * numeric evaluator agree bit-for-bit (the drift guard binds this end-to-end;
9
- * Adam A-7 / Eve EVE-3).
4
+ * A row (written in `constant-rows.ts`) holds the formula name, its other
5
+ * exact-case spellings, the SI value (imported from `core/constants.js`, the
6
+ * one owner of every value), the SI unit in `parseUnit` syntax, the meaning
7
+ * and the source. The dimension is derived from the unit once, here; no second
8
+ * table states it. The rows sit in their own module because the unit table
9
+ * names constants by these spellings, and this module imports the unit parser. Every other
10
+ * constant table in the library ({@link CONSTANTS}, `FORMULA_NAMED`,
11
+ * `CONSTANT_SPELLINGS`, {@link CONSTANT_PROVENANCE}, `CANONICAL_CONSTANTS`,
12
+ * the `upt eval` scope, the binding scope, the gradient constants) is a
13
+ * projection of this array, so a spelling, a value and a dimension cannot
14
+ * disagree between two files. A constant that is also a quantity names its
15
+ * `data/quantities.json` row in `quantity`; the quantity registry derives that
16
+ * row's aliases from here, so the file states no constant spelling.
10
17
  *
11
- * Numeric-literal leaves (`'2'`, `'3'`) are NOT registered here — `evalExpr`
18
+ * `canonical` marks a universal constant a canonical equation's `governing`
19
+ * list may bake as a leaf. A row that is an overlay for `upt eval` and the
20
+ * dimensional assignment only (`m_p`, `N_A`, the GRW parameters) is not
21
+ * canonical, so the canonical graph does not bake it.
22
+ *
23
+ * Numeric-literal leaves (`'2'`, `'3'`) are NOT registered — `evalExpr`
12
24
  * resolves them via `Number(name)` and they are implicitly dimensionless.
13
- * Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (Adam A-1 —
14
- * `Number('8pi')` is `NaN`).
25
+ * Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (`Number('8pi')`
26
+ * is `NaN`).
15
27
  *
16
28
  * INTERNAL — not on the public surface.
17
29
  *
18
30
  * @module dimensional/symbolic-constants
19
31
  */
20
- import { ACTION, CHARGE, DIMENSIONLESS, MASS, VELOCITY, } from './types.js';
21
- import { C_SI, E_SI, G_SI, GM_SUN_SI, HBAR_SI, H_SI, K_B_SI, B_WIEN_SI, M_U_SI } from '../core/constants.js';
22
- const dim = (L = 0, M = 0, T = 0, Theta = 0) => ({
23
- L,
24
- M,
25
- T,
26
- I: 0,
27
- Theta,
28
- N: 0,
29
- J: 0,
30
- });
31
- /** Newton's constant G — [L³ M⁻¹ T⁻²]. */
32
- const GRAV = dim(3, -1, -2);
33
- /** Boltzmann constant k_B — [L² M T⁻² Θ⁻¹] (energy / temperature). */
34
- const BOLTZMANN = dim(2, 1, -2, -1);
35
- /** Vacuum permittivity ε₀ — [I² T⁴ M⁻¹ L⁻³] (F/m). Carries a current
36
- * dimension, so it cannot use the (L,M,T,Θ) `dim` helper. */
37
- const PERMITTIVITY = { L: -3, M: -1, T: 4, I: 2, Theta: 0, N: 0, J: 0 };
38
- /** Stefan–Boltzmann σ — [M T⁻³ Θ⁻⁴] (W m⁻² K⁻⁴). Derived:
39
- * σ = 2π⁵k_B⁴ / (15 c² h³). */
40
- const STEFAN_BOLTZMANN = dim(0, 1, -3, -4);
41
- /** Wien displacement constant b — [L·Θ] (m·K). */
42
- const WIEN = dim(1, 0, 0, 1);
32
+ import { parseUnit } from './units.js';
33
+ import { CONSTANT_ROWS, constantRow } from './constant-rows.js';
34
+ /**
35
+ * Every registered constant, the rows of `constant-rows.ts` with each
36
+ * dimension derived once from its unit. Order is the order the tables print.
37
+ * @internal
38
+ */
39
+ export const CONSTANT_REGISTRY = CONSTANT_ROWS.map((constant) => ({
40
+ ...constant,
41
+ dim: parseUnit(constant.unit).dim,
42
+ }));
43
+ const RECORD_OF_ROW = new Map(CONSTANT_ROWS.map((constant, i) => [constant, CONSTANT_REGISTRY[i]]));
44
+ /**
45
+ * Every spelling → its record; `constant-rows.ts` refuses a spelling written twice. A constant
46
+ * that is also a quantity (`quantity`, e.g. `k_B` → `boltzmann-constant`) is reachable by that
47
+ * quantity id too, so a user who writes the quantity's name states the constant, and the value
48
+ * is checked against the registry rather than bound.
49
+ */
50
+ const BY_SPELLING = new Map(CONSTANT_REGISTRY.flatMap((record) => [record.name, ...record.spellings, ...(record.quantity === undefined ? [] : [record.quantity])].map((spelling) => [spelling, record])));
51
+ /** The registered constant `spelling` names, or undefined. @internal */
52
+ export function constantRecord(spelling) {
53
+ const constant = constantRow(spelling);
54
+ return constant === undefined ? undefined : RECORD_OF_ROW.get(constant);
55
+ }
56
+ /**
57
+ * Relative tolerance within which a stated constant agrees with the registered
58
+ * value. Textbook roundings such as `b = 2.9e-3` pass.
59
+ * @internal
60
+ */
61
+ const CONSTANT_AGREEMENT = 5e-3;
62
+ /** A stated value for a registered constant disagrees with the registry. The equations use the registered value. @internal */
63
+ export class ConstantDisagreementError extends Error {
64
+ key;
65
+ constant;
66
+ registered;
67
+ given;
68
+ constructor(key, constant, registered, given) {
69
+ super(`'${key}' is the registered constant ${constant} = ${registered}; ` +
70
+ `${given} disagrees, and the equations use the registered value, so it cannot be rebound.`);
71
+ this.key = key;
72
+ this.constant = constant;
73
+ this.registered = registered;
74
+ this.given = given;
75
+ this.name = 'ConstantDisagreementError';
76
+ }
77
+ }
78
+ /**
79
+ * The registered constant `key` names when `value` agrees with it within
80
+ * {@link CONSTANT_AGREEMENT}, or null when `key` names no constant. A value
81
+ * that disagrees throws {@link ConstantDisagreementError}: a constant is not
82
+ * a graph quantity, so a stated value is checked, never bound.
83
+ * @internal
84
+ */
85
+ export function constantAgreement(key, value) {
86
+ const record = BY_SPELLING.get(key);
87
+ if (record === undefined)
88
+ return null;
89
+ if (Math.abs(value - record.value) > CONSTANT_AGREEMENT * Math.abs(record.value)) {
90
+ throw new ConstantDisagreementError(key, record.name, record.value, value);
91
+ }
92
+ return record.name;
93
+ }
94
+ /** The notes of the registered constants among `names`, each once, in registry order. @internal */
95
+ export function constantNotes(names) {
96
+ const seen = new Set();
97
+ for (const name of names) {
98
+ const record = BY_SPELLING.get(name);
99
+ if (record?.note !== undefined)
100
+ seen.add(record);
101
+ }
102
+ return CONSTANT_REGISTRY.filter((record) => seen.has(record)).map((record) => record.note);
103
+ }
104
+ /** Every spelling → SI value, for a numeric scope. `pi` and `tau` are added. @internal */
105
+ export function constantScope() {
106
+ const scope = { pi: Math.PI, tau: 2 * Math.PI };
107
+ for (const [spelling, record] of BY_SPELLING)
108
+ scope[spelling] = record.value;
109
+ return scope;
110
+ }
43
111
  /**
44
- * Constant leaves a `symbolic` ExprNode may reference. Keys are the leaf
45
- * symbol `name`s; values carry the SI magnitude and dimension. `ln2`/`8pi`/
46
- * `4pi` reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI`
47
- * exactly (same IEEE-754 primitives).
112
+ * Constant leaves a `symbolic` ExprNode may reference, keyed by formula name:
113
+ * the canonical rows of {@link CONSTANT_REGISTRY}. `ln2`/`8pi`/`4pi`
114
+ * reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI` exactly
115
+ * (same IEEE-754 primitives).
48
116
  */
49
- export const CONSTANTS = {
50
- hbar: { value: HBAR_SI, dim: ACTION },
51
- h: { value: H_SI, dim: ACTION },
52
- c: { value: C_SI, dim: VELOCITY },
53
- G: { value: G_SI, dim: GRAV },
54
- k_B: { value: K_B_SI, dim: BOLTZMANN },
55
- ln2: { value: Math.LN2, dim: DIMENSIONLESS },
56
- '8pi': { value: 8 * Math.PI, dim: DIMENSIONLESS },
57
- '4pi': { value: 4 * Math.PI, dim: DIMENSIONLESS },
58
- '2pi': { value: 2 * Math.PI, dim: DIMENSIONLESS },
59
- // Extension constants for the canonical-equation L1 entries (Coulomb, Bohr,
60
- // Stefan–Boltzmann). CODATA 2018 values.
61
- // ISO 80000 / CODATA: a bare e is the elementary charge. Eccentricity is
62
- // one_minus_e_sq. The canonical dimension guard still refuses to bake a
63
- // dimensionless governing name e.
64
- e: { value: E_SI, dim: CHARGE },
65
- epsilon_0: { value: 8.8541878128e-12, dim: PERMITTIVITY },
66
- sigma_sb: { value: 5.670374419e-8, dim: STEFAN_BOLTZMANN },
67
- b: { value: B_WIEN_SI, dim: WIEN },
68
- // IAU 2015 nominal solar parameter. M_sun in eval stays the rounded kilogram M_SUN_SI.
69
- GM_sun: { value: GM_SUN_SI, dim: dim(3, 0, -2) },
70
- Msun_iau: { value: GM_SUN_SI / G_SI, dim: dim(0, 1, 0) },
71
- m_u: { value: M_U_SI, dim: MASS },
72
- };
117
+ export const CONSTANTS = Object.fromEntries(CONSTANT_REGISTRY.filter((record) => record.canonical).map((record) => [
118
+ record.name,
119
+ { value: record.value, dim: record.dim },
120
+ ]));
121
+ /** One row per {@link CONSTANT_REGISTRY} name. @internal */
122
+ export const CONSTANT_PROVENANCE = Object.fromEntries(CONSTANT_REGISTRY.map((record) => [
123
+ record.name,
124
+ { meaning: record.meaning, unit: record.unit, source: record.source },
125
+ ]));
73
126
  /**
74
127
  * A spelled-out multiple of π written as one symbol (`pi`, `6pi`). `2pi`,
75
128
  * `4pi` and `8pi` are also registered in {@link CONSTANTS}; this covers the
@@ -88,35 +141,4 @@ export function piMultipleValue(name) {
88
141
  return undefined;
89
142
  return n * Math.PI;
90
143
  }
91
- /** One row per {@link CONSTANTS} key; a test holds the two key sets equal. @internal */
92
- export const CONSTANT_PROVENANCE = {
93
- hbar: { meaning: 'reduced Planck constant h/(2π)', unit: 'J*s', source: 'exact H_SI/(2π) (core/constants.ts HBAR_SI)' },
94
- h: { meaning: 'Planck constant', unit: 'J*s', source: 'exact SI, 2019 redefinition (core/constants.ts H_SI)' },
95
- c: { meaning: 'speed of light in vacuum', unit: 'm/s', source: 'exact SI (core/constants.ts C_SI)' },
96
- G: { meaning: 'Newtonian gravitational constant', unit: 'm^3/(kg*s^2)', source: 'CODATA 2018 (core/constants.ts G_SI)' },
97
- k_B: { meaning: 'Boltzmann constant', unit: 'J/K', source: 'exact SI, 2019 redefinition (core/constants.ts K_B_SI)' },
98
- ln2: { meaning: 'natural logarithm of 2', unit: '1', source: 'mathematical constant (Math.LN2)' },
99
- '8pi': { meaning: '8π', unit: '1', source: 'mathematical constant (8·Math.PI)' },
100
- '4pi': { meaning: '4π', unit: '1', source: 'mathematical constant (4·Math.PI)' },
101
- '2pi': { meaning: '2π', unit: '1', source: 'mathematical constant (2·Math.PI)' },
102
- e: { meaning: 'elementary charge', unit: 'C', source: 'exact SI, 2019 redefinition (core/constants.ts E_SI)' },
103
- epsilon_0: { meaning: 'vacuum permittivity', unit: 'F/m', source: 'CODATA 2018 (this table)' },
104
- sigma_sb: { meaning: 'Stefan–Boltzmann constant', unit: 'W/(m^2*K^4)', source: 'CODATA 2018 (this table)' },
105
- b: { meaning: 'Wien displacement constant', unit: 'm*K', source: 'CODATA 2018 (core/constants.ts B_WIEN_SI)' },
106
- GM_sun: {
107
- meaning: 'IAU nominal solar gravitational parameter (GM)☉',
108
- unit: 'm^3/s^2',
109
- source: 'IAU 2015 Resolution B3 (core/constants.ts GM_SUN_SI)',
110
- },
111
- Msun_iau: {
112
- meaning: 'IAU solar mass (GM)☉/G, the mass that reproduces GM_sun with G_SI',
113
- unit: 'kg',
114
- source: 'GM_SUN_SI/G_SI (core/constants.ts)',
115
- },
116
- m_u: {
117
- meaning: 'unified atomic mass unit (atomic mass constant)',
118
- unit: 'kg',
119
- source: 'CODATA 2018 (core/constants.ts M_U_SI)',
120
- },
121
- };
122
144
  //# sourceMappingURL=symbolic-constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"symbolic-constants.js","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,IAAI,EACJ,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE7G,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAa,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC,EAAE,CAAC;IACJ,KAAK;IACL,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;CACL,CAAC,CAAC;AAEH,0CAA0C;AAC1C,MAAM,IAAI,GAAc,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACvC,sEAAsE;AACtE,MAAM,SAAS,GAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/C;8DAC8D;AAC9D,MAAM,YAAY,GAAc,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EA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AW,CACjG,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAChC,MAAM,CAAC,IAAI;IACX,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;CACtE,CAAC,CACH,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACjC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACpD,OAAO,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AACrB,CAAC","sourcesContent":["/**\n * The constant registry: one row per physical constant a formula may name.\n *\n * A row (written in `constant-rows.ts`) holds the formula name, its other\n * exact-case spellings, the SI value (imported from `core/constants.js`, the\n * one owner of every value), the SI unit in `parseUnit` syntax, the meaning\n * and the source. The dimension is derived from the unit once, here; no second\n * table states it. The rows sit in their own module because the unit table\n * names constants by these spellings, and this module imports the unit parser. Every other\n * constant table in the library ({@link CONSTANTS}, `FORMULA_NAMED`,\n * `CONSTANT_SPELLINGS`, {@link CONSTANT_PROVENANCE}, `CANONICAL_CONSTANTS`,\n * the `upt eval` scope, the binding scope, the gradient constants) is a\n * projection of this array, so a spelling, a value and a dimension cannot\n * disagree between two files. A constant that is also a quantity names its\n * `data/quantities.json` row in `quantity`; the quantity registry derives that\n * row's aliases from here, so the file states no constant spelling.\n *\n * `canonical` marks a universal constant a canonical equation's `governing`\n * list may bake as a leaf. A row that is an overlay for `upt eval` and the\n * dimensional assignment only (`m_p`, `N_A`, the GRW parameters) is not\n * canonical, so the canonical graph does not bake it.\n *\n * Numeric-literal leaves (`'2'`, `'3'`) are NOT registered — `evalExpr`\n * resolves them via `Number(name)` and they are implicitly dimensionless.\n * Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (`Number('8pi')`\n * is `NaN`).\n *\n * INTERNAL — not on the public surface.\n *\n * @module dimensional/symbolic-constants\n */\n\nimport type { Dimension } from './types.js';\nimport { parseUnit } from './units.js';\nimport { CONSTANT_ROWS, constantRow, type ConstantRow } from './constant-rows.js';\n\n/** One registered constant: its row, with the dimension derived from its unit. @internal */\nexport interface ConstantRecord extends ConstantRow {\n readonly dim: Dimension;\n}\n\n/**\n * Every registered constant, the rows of `constant-rows.ts` with each\n * dimension derived once from its unit. Order is the order the tables print.\n * @internal\n */\nexport const CONSTANT_REGISTRY: readonly ConstantRecord[] = CONSTANT_ROWS.map((constant) => ({\n ...constant,\n dim: parseUnit(constant.unit).dim,\n}));\n\nconst RECORD_OF_ROW = new Map<ConstantRow, ConstantRecord>(CONSTANT_ROWS.map((constant, i) => [constant, CONSTANT_REGISTRY[i]!]));\n\n/**\n * Every spelling → its record; `constant-rows.ts` refuses a spelling written twice. A constant\n * that is also a quantity (`quantity`, e.g. `k_B` → `boltzmann-constant`) is reachable by that\n * quantity id too, so a user who writes the quantity's name states the constant, and the value\n * is checked against the registry rather than bound.\n */\nconst BY_SPELLING = new Map<string, ConstantRecord>(\n CONSTANT_REGISTRY.flatMap((record) =>\n [record.name, ...record.spellings, ...(record.quantity === undefined ? [] : [record.quantity])].map(\n (spelling) => [spelling, record] as const,\n ),\n ),\n);\n\n/** The registered constant `spelling` names, or undefined. @internal */\nexport function constantRecord(spelling: string): ConstantRecord | undefined {\n const constant = constantRow(spelling);\n return constant === undefined ? undefined : RECORD_OF_ROW.get(constant);\n}\n\n/**\n * Relative tolerance within which a stated constant agrees with the registered\n * value. Textbook roundings such as `b = 2.9e-3` pass.\n * @internal\n */\nconst CONSTANT_AGREEMENT = 5e-3;\n\n/** A stated value for a registered constant disagrees with the registry. The equations use the registered value. @internal */\nexport class ConstantDisagreementError extends Error {\n constructor(\n readonly key: string,\n readonly constant: string,\n readonly registered: number,\n readonly given: number,\n ) {\n super(\n `'${key}' is the registered constant ${constant} = ${registered}; ` +\n `${given} disagrees, and the equations use the registered value, so it cannot be rebound.`,\n );\n this.name = 'ConstantDisagreementError';\n }\n}\n\n/**\n * The registered constant `key` names when `value` agrees with it within\n * {@link CONSTANT_AGREEMENT}, or null when `key` names no constant. A value\n * that disagrees throws {@link ConstantDisagreementError}: a constant is not\n * a graph quantity, so a stated value is checked, never bound.\n * @internal\n */\nexport function constantAgreement(key: string, value: number): string | null {\n const record = BY_SPELLING.get(key);\n if (record === undefined) return null;\n if (Math.abs(value - record.value) > CONSTANT_AGREEMENT * Math.abs(record.value)) {\n throw new ConstantDisagreementError(key, record.name, record.value, value);\n }\n return record.name;\n}\n\n/** The notes of the registered constants among `names`, each once, in registry order. @internal */\nexport function constantNotes(names: Iterable<string>): string[] {\n const seen = new Set<ConstantRecord>();\n for (const name of names) {\n const record = BY_SPELLING.get(name);\n if (record?.note !== undefined) seen.add(record);\n }\n return CONSTANT_REGISTRY.filter((record) => seen.has(record)).map((record) => record.note!);\n}\n\n/** Every spelling → SI value, for a numeric scope. `pi` and `tau` are added. @internal */\nexport function constantScope(): Record<string, number> {\n const scope: Record<string, number> = { pi: Math.PI, tau: 2 * Math.PI };\n for (const [spelling, record] of BY_SPELLING) scope[spelling] = record.value;\n return scope;\n}\n\n/** A registered constant leaf: SI value + SI dimension. @internal */\nexport interface NamedConstantValue {\n readonly value: number;\n readonly dim: Dimension;\n}\n\n/**\n * Constant leaves a `symbolic` ExprNode may reference, keyed by formula name:\n * the canonical rows of {@link CONSTANT_REGISTRY}. `ln2`/`8pi`/`4pi`\n * reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI` exactly\n * (same IEEE-754 primitives).\n */\nexport const CONSTANTS: Readonly<Record<string, NamedConstantValue>> = Object.fromEntries(\n CONSTANT_REGISTRY.filter((record) => record.canonical).map((record) => [\n record.name,\n { value: record.value, dim: record.dim },\n ]),\n);\n\n/** What a registered constant is, its SI unit, and where its value comes from (audit I10). @internal */\nexport interface ConstantProvenance {\n readonly meaning: string;\n /** The SI unit, in the syntax `parseUnit` reads; the registered dimension is derived from it. */\n readonly unit: string;\n readonly source: string;\n}\n\n/** One row per {@link CONSTANT_REGISTRY} name. @internal */\nexport const CONSTANT_PROVENANCE: Readonly<Record<string, ConstantProvenance>> = Object.fromEntries(\n CONSTANT_REGISTRY.map((record) => [\n record.name,\n { meaning: record.meaning, unit: record.unit, source: record.source },\n ]),\n);\n\n/**\n * A spelled-out multiple of π written as one symbol (`pi`, `6pi`). `2pi`,\n * `4pi` and `8pi` are also registered in {@link CONSTANTS}; this covers the\n * multiples an encoder spelled out and did not register (`6pi` in\n * CE-perihelion-precession). The structural normal form already drops these.\n * The numeric evaluator has to resolve them too, or a comparison treats `6pi`\n * as a free symbol and never aligns the formula.\n * @internal\n */\nexport function piMultipleValue(name: string): number | undefined {\n const m = /^(\\d*)pi$/.exec(name);\n if (m === null) return undefined;\n const n = m[1] === '' ? 1 : Number(m[1]);\n if (!Number.isInteger(n) || n < 0) return undefined;\n return n * Math.PI;\n}\n"]}