universal-physics-tensor 11.0.0 → 12.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 (287) hide show
  1. package/README.md +36 -34
  2. package/data/applied-cases.json +1892 -0
  3. package/data/applied-cases.schema.json +194 -0
  4. package/data/atlas/atlas.json +21 -21
  5. package/data/atlas/atlas.jsonld +1 -1
  6. package/data/atlas/diffusion.json +5 -5
  7. package/data/atlas/oscillators.json +7 -7
  8. package/data/atlas/waves.json +11 -11
  9. package/data/bridge-catalog.json +20 -4
  10. package/data/units.json +6 -25
  11. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  12. package/dist/atlas/benchmark/stats.js +6 -20
  13. package/dist/atlas/benchmark/stats.js.map +1 -1
  14. package/dist/atlas/physjs-entries.generated.d.ts +13 -4
  15. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  16. package/dist/atlas/physjs-entries.generated.js +15 -4
  17. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  18. package/dist/atlas/physjs-reviewed.js +2 -2
  19. package/dist/atlas/physjs-reviewed.js.map +1 -1
  20. package/dist/cases/catalog-checks.d.ts +10 -0
  21. package/dist/cases/catalog-checks.d.ts.map +1 -0
  22. package/dist/cases/catalog-checks.js +241 -0
  23. package/dist/cases/catalog-checks.js.map +1 -0
  24. package/dist/cases/catalog.d.ts +83 -0
  25. package/dist/cases/catalog.d.ts.map +1 -0
  26. package/dist/cases/catalog.js +118 -0
  27. package/dist/cases/catalog.js.map +1 -0
  28. package/dist/cases/engine.d.ts +13 -0
  29. package/dist/cases/engine.d.ts.map +1 -0
  30. package/dist/cases/engine.js +179 -0
  31. package/dist/cases/engine.js.map +1 -0
  32. package/dist/cases/index.d.ts.map +1 -1
  33. package/dist/cases/index.js +5 -7
  34. package/dist/cases/index.js.map +1 -1
  35. package/dist/cases/methods.d.ts +215 -0
  36. package/dist/cases/methods.d.ts.map +1 -0
  37. package/dist/cases/methods.js +743 -0
  38. package/dist/cases/methods.js.map +1 -0
  39. package/dist/cases/types.d.ts +12 -0
  40. package/dist/cases/types.d.ts.map +1 -1
  41. package/dist/cases/types.js.map +1 -1
  42. package/dist/cli/args.d.ts +2 -0
  43. package/dist/cli/args.d.ts.map +1 -1
  44. package/dist/cli/args.js.map +1 -1
  45. package/dist/cli/command.d.ts +3 -0
  46. package/dist/cli/command.d.ts.map +1 -1
  47. package/dist/cli/command.js.map +1 -1
  48. package/dist/cli/commands/_discovery-opts.d.ts +1 -0
  49. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  50. package/dist/cli/commands/_discovery-opts.js +1 -0
  51. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  52. package/dist/cli/commands/discover.d.ts.map +1 -1
  53. package/dist/cli/commands/discover.js +116 -71
  54. package/dist/cli/commands/discover.js.map +1 -1
  55. package/dist/cli/commands/evaluate.js +2 -2
  56. package/dist/cli/commands/evaluate.js.map +1 -1
  57. package/dist/cli/commands/explain.d.ts.map +1 -1
  58. package/dist/cli/commands/explain.js +22 -2
  59. package/dist/cli/commands/explain.js.map +1 -1
  60. package/dist/cli/commands/ground.d.ts.map +1 -1
  61. package/dist/cli/commands/ground.js +6 -1
  62. package/dist/cli/commands/ground.js.map +1 -1
  63. package/dist/cli/commands/map.d.ts.map +1 -1
  64. package/dist/cli/commands/map.js +9 -6
  65. package/dist/cli/commands/map.js.map +1 -1
  66. package/dist/cli/determination.d.ts +1 -0
  67. package/dist/cli/determination.d.ts.map +1 -1
  68. package/dist/cli/determination.js.map +1 -1
  69. package/dist/cli/flag-help.d.ts +1 -0
  70. package/dist/cli/flag-help.d.ts.map +1 -1
  71. package/dist/cli/flag-help.js +1 -0
  72. package/dist/cli/flag-help.js.map +1 -1
  73. package/dist/cli/graphs.d.ts +2 -0
  74. package/dist/cli/graphs.d.ts.map +1 -1
  75. package/dist/cli/graphs.js +1 -0
  76. package/dist/cli/graphs.js.map +1 -1
  77. package/dist/cli/main.d.ts +1 -0
  78. package/dist/cli/main.d.ts.map +1 -1
  79. package/dist/cli/main.js +1 -0
  80. package/dist/cli/main.js.map +1 -1
  81. package/dist/cli/output.d.ts +8 -0
  82. package/dist/cli/output.d.ts.map +1 -1
  83. package/dist/cli/output.js +8 -0
  84. package/dist/cli/output.js.map +1 -1
  85. package/dist/cli/statuses.d.ts.map +1 -1
  86. package/dist/cli/statuses.js +12 -2
  87. package/dist/cli/statuses.js.map +1 -1
  88. package/dist/cli/version.d.ts +1 -0
  89. package/dist/cli/version.d.ts.map +1 -1
  90. package/dist/cli/version.js +1 -0
  91. package/dist/cli/version.js.map +1 -1
  92. package/dist/cli-api.d.ts +2 -0
  93. package/dist/cli-api.d.ts.map +1 -1
  94. package/dist/cli-api.js +2 -0
  95. package/dist/cli-api.js.map +1 -1
  96. package/dist/composition/canonical-graph.d.ts +2 -2
  97. package/dist/composition/canonical-graph.js +2 -2
  98. package/dist/composition/canonical-graph.js.map +1 -1
  99. package/dist/composition/consequence.d.ts +15 -5
  100. package/dist/composition/consequence.d.ts.map +1 -1
  101. package/dist/composition/consequence.js +6 -4
  102. package/dist/composition/consequence.js.map +1 -1
  103. package/dist/composition/discovery.d.ts +78 -14
  104. package/dist/composition/discovery.d.ts.map +1 -1
  105. package/dist/composition/discovery.js +73 -23
  106. package/dist/composition/discovery.js.map +1 -1
  107. package/dist/composition/expr-eval.d.ts +1 -1
  108. package/dist/composition/expr-eval.d.ts.map +1 -1
  109. package/dist/composition/expr-eval.js +4 -4
  110. package/dist/composition/expr-eval.js.map +1 -1
  111. package/dist/composition/expr-simplify.d.ts +10 -14
  112. package/dist/composition/expr-simplify.d.ts.map +1 -1
  113. package/dist/composition/expr-simplify.js +49 -52
  114. package/dist/composition/expr-simplify.js.map +1 -1
  115. package/dist/composition/grounding.d.ts.map +1 -1
  116. package/dist/composition/grounding.js +19 -7
  117. package/dist/composition/grounding.js.map +1 -1
  118. package/dist/composition/mathts-quiet.d.ts +4 -6
  119. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  120. package/dist/composition/mathts-quiet.js +4 -14
  121. package/dist/composition/mathts-quiet.js.map +1 -1
  122. package/dist/composition/own-equation-magnitude.d.ts +95 -0
  123. package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
  124. package/dist/composition/own-equation-magnitude.js +270 -0
  125. package/dist/composition/own-equation-magnitude.js.map +1 -0
  126. package/dist/composition/probe/backend-protocol.d.ts +3 -0
  127. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  128. package/dist/composition/probe/backend-protocol.js.map +1 -1
  129. package/dist/composition/probe/candidate-store.d.ts +1 -0
  130. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  131. package/dist/composition/probe/candidate-store.js +1 -0
  132. package/dist/composition/probe/candidate-store.js.map +1 -1
  133. package/dist/composition/probe/corpus.d.ts +4 -2
  134. package/dist/composition/probe/corpus.d.ts.map +1 -1
  135. package/dist/composition/probe/corpus.js +3 -3
  136. package/dist/composition/probe/corpus.js.map +1 -1
  137. package/dist/composition/probe/dataset.d.ts +1 -0
  138. package/dist/composition/probe/dataset.d.ts.map +1 -1
  139. package/dist/composition/probe/dataset.js.map +1 -1
  140. package/dist/composition/probe/experiment-design.d.ts +2 -0
  141. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  142. package/dist/composition/probe/experiment-design.js.map +1 -1
  143. package/dist/composition/probe/falsify.d.ts +2 -0
  144. package/dist/composition/probe/falsify.d.ts.map +1 -1
  145. package/dist/composition/probe/falsify.js.map +1 -1
  146. package/dist/composition/probe/fit.d.ts +1 -0
  147. package/dist/composition/probe/fit.d.ts.map +1 -1
  148. package/dist/composition/probe/fit.js.map +1 -1
  149. package/dist/composition/probe/generator.d.ts +3 -0
  150. package/dist/composition/probe/generator.d.ts.map +1 -1
  151. package/dist/composition/probe/generator.js +5 -6
  152. package/dist/composition/probe/generator.js.map +1 -1
  153. package/dist/composition/probe/limits.d.ts +1 -0
  154. package/dist/composition/probe/limits.d.ts.map +1 -1
  155. package/dist/composition/probe/limits.js.map +1 -1
  156. package/dist/composition/probe/pipeline.d.ts +5 -0
  157. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  158. package/dist/composition/probe/pipeline.js +64 -21
  159. package/dist/composition/probe/pipeline.js.map +1 -1
  160. package/dist/composition/probe/power-law.d.ts.map +1 -1
  161. package/dist/composition/probe/power-law.js +3 -7
  162. package/dist/composition/probe/power-law.js.map +1 -1
  163. package/dist/composition/probe/problem.d.ts +1 -0
  164. package/dist/composition/probe/problem.d.ts.map +1 -1
  165. package/dist/composition/probe/problem.js.map +1 -1
  166. package/dist/composition/probe/residual.d.ts +1 -0
  167. package/dist/composition/probe/residual.d.ts.map +1 -1
  168. package/dist/composition/probe/residual.js +1 -0
  169. package/dist/composition/probe/residual.js.map +1 -1
  170. package/dist/composition/probe/run-manifest.d.ts +1 -0
  171. package/dist/composition/probe/run-manifest.d.ts.map +1 -1
  172. package/dist/composition/probe/run-manifest.js.map +1 -1
  173. package/dist/composition/probe/scalar-search.d.ts +50 -0
  174. package/dist/composition/probe/scalar-search.d.ts.map +1 -0
  175. package/dist/composition/probe/scalar-search.js +169 -0
  176. package/dist/composition/probe/scalar-search.js.map +1 -0
  177. package/dist/composition/probe/scoring.d.ts +1 -0
  178. package/dist/composition/probe/scoring.d.ts.map +1 -1
  179. package/dist/composition/probe/scoring.js.map +1 -1
  180. package/dist/composition/probe/study.d.ts +2 -2
  181. package/dist/composition/probe/study.d.ts.map +1 -1
  182. package/dist/composition/probe/study.js +6 -10
  183. package/dist/composition/probe/study.js.map +1 -1
  184. package/dist/composition/probe/t-tail.d.ts +3 -4
  185. package/dist/composition/probe/t-tail.d.ts.map +1 -1
  186. package/dist/composition/probe/t-tail.js +7 -10
  187. package/dist/composition/probe/t-tail.js.map +1 -1
  188. package/dist/composition/proposed-bridges.d.ts +11 -2
  189. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  190. package/dist/composition/proposed-bridges.js +7 -5
  191. package/dist/composition/proposed-bridges.js.map +1 -1
  192. package/dist/composition/rational-exponent.d.ts +2 -2
  193. package/dist/composition/rational-exponent.d.ts.map +1 -1
  194. package/dist/composition/rational-exponent.js +4 -4
  195. package/dist/composition/rational-exponent.js.map +1 -1
  196. package/dist/composition/representative-values.d.ts.map +1 -1
  197. package/dist/composition/representative-values.js +6 -0
  198. package/dist/composition/representative-values.js.map +1 -1
  199. package/dist/composition/retrodiction.d.ts +15 -0
  200. package/dist/composition/retrodiction.d.ts.map +1 -1
  201. package/dist/composition/retrodiction.js +10 -3
  202. package/dist/composition/retrodiction.js.map +1 -1
  203. package/dist/composition/user-equation.d.ts +1 -0
  204. package/dist/composition/user-equation.d.ts.map +1 -1
  205. package/dist/composition/user-equation.js +1 -0
  206. package/dist/composition/user-equation.js.map +1 -1
  207. package/dist/core/constants.d.ts +12 -11
  208. package/dist/core/constants.d.ts.map +1 -1
  209. package/dist/core/constants.js +24 -21
  210. package/dist/core/constants.js.map +1 -1
  211. package/dist/diff/bridge-ast-gradient.d.ts +27 -23
  212. package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
  213. package/dist/diff/bridge-ast-gradient.js +75 -173
  214. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  215. package/dist/dimensional/ast-types.d.ts +15 -0
  216. package/dist/dimensional/ast-types.d.ts.map +1 -1
  217. package/dist/dimensional/ast-types.js.map +1 -1
  218. package/dist/dimensional/curvature-composite.d.ts +1 -1
  219. package/dist/dimensional/curvature-composite.js.map +1 -1
  220. package/dist/dimensional/exact-scale.d.ts +41 -11
  221. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  222. package/dist/dimensional/exact-scale.js +115 -123
  223. package/dist/dimensional/exact-scale.js.map +1 -1
  224. package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
  225. package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
  226. package/dist/dimensional/mathts-unit-delegation.js +187 -0
  227. package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
  228. package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
  229. package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
  230. package/dist/dimensional/mathts-unit-wrapper.js +190 -0
  231. package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
  232. package/dist/dimensional/scalar-lowering.d.ts +21 -0
  233. package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
  234. package/dist/dimensional/scalar-lowering.js +45 -0
  235. package/dist/dimensional/scalar-lowering.js.map +1 -0
  236. package/dist/dimensional/unit-data.d.ts +5 -1
  237. package/dist/dimensional/unit-data.d.ts.map +1 -1
  238. package/dist/dimensional/unit-data.js +28 -4
  239. package/dist/dimensional/unit-data.js.map +1 -1
  240. package/dist/dimensional/units.d.ts +2 -0
  241. package/dist/dimensional/units.d.ts.map +1 -1
  242. package/dist/dimensional/units.js +59 -3
  243. package/dist/dimensional/units.js.map +1 -1
  244. package/dist/dimensional/validator.d.ts +2 -0
  245. package/dist/dimensional/validator.d.ts.map +1 -1
  246. package/dist/dimensional/validator.js.map +1 -1
  247. package/dist/index.js.map +1 -1
  248. package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
  249. package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
  250. package/dist/numerical/connection-lowering-helpers.js +11 -15
  251. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  252. package/dist/numerical/pderiv.d.ts.map +1 -1
  253. package/dist/numerical/pderiv.js +2 -6
  254. package/dist/numerical/pderiv.js.map +1 -1
  255. package/dist/numerical/quadrature.js +3 -3
  256. package/dist/numerical/quadrature.js.map +1 -1
  257. package/dist/numerical/statistics.js +1 -1
  258. package/dist/numerical/statistics.js.map +1 -1
  259. package/dist/numerical/strides.d.ts +3 -2
  260. package/dist/numerical/strides.d.ts.map +1 -1
  261. package/dist/numerical/strides.js +3 -10
  262. package/dist/numerical/strides.js.map +1 -1
  263. package/package.json +9 -12
  264. package/dist/cases/brownian-sphere.d.ts +0 -68
  265. package/dist/cases/brownian-sphere.d.ts.map +0 -1
  266. package/dist/cases/brownian-sphere.js +0 -355
  267. package/dist/cases/brownian-sphere.js.map +0 -1
  268. package/dist/cases/damped-resonator.d.ts +0 -23
  269. package/dist/cases/damped-resonator.d.ts.map +0 -1
  270. package/dist/cases/damped-resonator.js +0 -221
  271. package/dist/cases/damped-resonator.js.map +0 -1
  272. package/dist/cases/kepler-rv.d.ts +0 -13
  273. package/dist/cases/kepler-rv.d.ts.map +0 -1
  274. package/dist/cases/kepler-rv.js +0 -173
  275. package/dist/cases/kepler-rv.js.map +0 -1
  276. package/dist/cases/lumped-cooling.d.ts +0 -51
  277. package/dist/cases/lumped-cooling.d.ts.map +0 -1
  278. package/dist/cases/lumped-cooling.js +0 -259
  279. package/dist/cases/lumped-cooling.js.map +0 -1
  280. package/dist/cases/resistor-noise.d.ts +0 -14
  281. package/dist/cases/resistor-noise.d.ts.map +0 -1
  282. package/dist/cases/resistor-noise.js +0 -215
  283. package/dist/cases/resistor-noise.js.map +0 -1
  284. package/dist/cases/skin-depth.d.ts +0 -17
  285. package/dist/cases/skin-depth.d.ts.map +0 -1
  286. package/dist/cases/skin-depth.js +0 -170
  287. package/dist/cases/skin-depth.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/dimensional/validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,GAAG,EACH,QAAQ,EACR,MAAM,EACN,MAAM,EACN,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gCAAgC,GACjC,MAAM,aAAa,CAAC;AA4BrB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,GAC5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ACpE,gBAAgB,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,iBAAiB;gBACtE,2DAA2D;SAC9D,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,EAAE,EAAE,gBAAgB,CAAC,UAAU,CAAC,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI;QACtE,iBAAiB,EAAE,MAAM,EAAE,uDAAuD;QAClF,sEAAsE;QACtE,iCAAiC;QACjC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Validator: walks an ExprNode tree and infers / checks SI dimensions.\n *\n * Honest-claude scope notes:\n * - Tensor index structure IS tracked: tensor-symbol / tensor-product\n * nodes carry free-index (upper/lower) signatures, contraction is\n * enforced, and `validateEquation` now checks valence homogeneity\n * across '=' (so the spec's Bridge Eq 17 rank mismatch — a tensor\n * equated to a scalar — is caught even when the SI dimensions agree).\n * - Transcendental nodes (exp, ln, log, trig): the argument must be\n * dimensionless. A dimensioned argument is an error-severity violation;\n * a tensor argument throws `TensorInScalarOpError`.\n *\n * @module dimensional/validator\n */\n\nimport {\n Dimension,\n DIMENSIONLESS,\n} from './types.js';\nimport {\n multiply,\n divide,\n power,\n add,\n subtract,\n equals,\n format,\n DimensionMismatchError,\n} from './algebra.js';\nimport {\n TensorInScalarOpError,\n FreeIndexMismatchError,\n TensorProductChildInferenceError,\n} from './errors.js';\n// All AST node types + ExprNode + TranscendentalFn now live in the leaf\n// `ast-types.ts` (consolidated to break the validator↔tensor / validator↔\n// curvature type-only cycles). The per-kind VALIDATION FUNCTIONS still live in\n// their modules and are value-imported below (one-way edges — those modules no\n// longer import validator).\nimport type {\n ExprNode,\n TranscendentalFn,\n TensorSymbolNode,\n TensorProductNode,\n MetricTensorNode,\n KroneckerDeltaNode,\n TensorPartialDerivativeNode,\n CovariantDerivativeNode,\n RiemannTensorNode,\n RicciTensorNode,\n EinsteinTensorNode,\n BianchiResidualNode,\n KillingVectorNode,\n ConservedChargeNode,\n StressEnergyTensorNode,\n CosmologicalConstantNode,\n EinsteinFieldEquationNode,\n WeylTensorNode,\n KretschmannScalarNode,\n} from './ast-types.js';\nimport type { ChildValidationResult } from './tensor.js';\nimport { validateTensorSymbol, computeContraction } from './tensor.js';\nimport type { PartialDerivativeChildResult } from './metric-validators.js';\nimport {\n validateMetricTensor,\n validateKroneckerDelta,\n validatePartialDerivative,\n checkInverseMetricStructure,\n} from './metric-validators.js';\nimport { validateCovariantDerivative } from './connection-validators.js';\n// v0.6.1 Phase 2: 11-arm curvature/GR-object dispatch consolidated into\n// the validator-registry module. The individual `validateX` functions\n// are still imported by validator-registry.ts (which the registry\n// indexes); validator.ts now only needs the dispatcher helpers.\nimport {\n lookupValidatorEntry,\n dispatchValidator,\n shouldPropagateFreeIndices,\n} from './validator-registry.js';\n\n// `ExprNode`, `TranscendentalFn`, and every node/index type now live in the\n// leaf `ast-types.ts`. They are re-exported here so the ~100 consumers that\n// import `{ ExprNode, … }` from `./validator.js` are unchanged.\nexport type {\n ExprNode,\n TranscendentalFn,\n TensorSymbolNode,\n TensorProductNode,\n TensorIndex,\n Variance,\n Role,\n MetricTensorNode,\n KroneckerDeltaNode,\n TensorPartialDerivativeNode,\n CovariantIndex,\n UpperIndex,\n CovariantDerivativeNode,\n RiemannTensorNode,\n RicciTensorNode,\n EinsteinTensorNode,\n BianchiResidualNode,\n KillingVectorNode,\n ConservedChargeNode,\n StressEnergyTensorNode,\n CosmologicalConstantNode,\n EinsteinFieldEquationNode,\n WeylTensorNode,\n KretschmannScalarNode,\n} from './ast-types.js';\n\nexport interface Violation {\n /** Tree path, e.g. \"args[1].args[0]\". Empty string for the root. */\n location: string;\n expected: Dimension;\n actual: Dimension;\n note: string;\n /** v0.3.5: absent ⇒ 'error'. 'warning'-severity violations do not fail\n * validation (ValidationResult.ok stays true) but are still reported. */\n severity?: 'error' | 'warning';\n}\n\nexport interface ValidationResult {\n ok: boolean;\n inferredDimension: Dimension | null;\n /** Map of free (uncontracted) index labels to their upper/lower counts.\n * Empty for scalar expressions. Populated by tensor-symbol /\n * tensor-product validation (Tasks 5 and 6). */\n freeIndices: Map<string, { upper: number; lower: number }>;\n violations: Violation[];\n}\n\ninterface InferContext {\n path: string;\n violations: Violation[];\n /** Free-indices accumulator for the root expression. Tensor-aware node\n * cases (tensor-symbol, tensor-product) populate this; scalar cases\n * leave it alone. validate() reads it after walking to construct the\n * ValidationResult.freeIndices map. Shared by reference across the\n * recursion so sibling subtrees can contribute. */\n freeIndices: Map<string, { upper: number; lower: number }>;\n}\n\nfunction joinPath(path: string, segment: string): string {\n return path === '' ? segment : `${path}.${segment}`;\n}\n\n/**\n * Structural equality for freeIndices maps. Two maps are equal iff they\n * contain the same label set and each label's `{upper, lower}` counts\n * match. Used by `op '+'` / `'-'` (Task 7 / Part-VII §VII.5) to enforce\n * that all operands of a tensor sum share the same free-index signature.\n */\nfunction freeIndicesEqual(\n a: Map<string, { upper: number; lower: number }>,\n b: Map<string, { upper: number; lower: number }>,\n): boolean {\n if (a.size !== b.size) return false;\n for (const [label, counts] of a) {\n const other = b.get(label);\n if (!other) return false;\n if (other.upper !== counts.upper || other.lower !== counts.lower) return false;\n }\n return true;\n}\n\n/**\n * Human-readable summary of a freeIndices map for use in error messages.\n * Empty map renders as `{}` so a tensor-vs-scalar mismatch is visually\n * obvious in the thrown FreeIndexMismatchError text.\n */\nfunction formatFreeIndices(m: Map<string, { upper: number; lower: number }>): string {\n if (m.size === 0) return '{}';\n const parts: string[] = [];\n for (const [label, counts] of m) {\n parts.push(`${label}:{upper:${counts.upper},lower:${counts.lower}}`);\n }\n return `{${parts.join(', ')}}`;\n}\n\n/**\n * Merge every `{label → counts}` entry from `source` into `target`,\n * overwriting any existing entry for the same label. One helper for the\n * `for (const [label, counts] of …) target.set(label, counts)` loop that\n * the `infer()` switch arms each used to carry.\n *\n * The semantics are an \"overwrite-style\" merge — child results are\n * authoritative when their labels collide with the parent context.\n * (This matches the original inline-loop behaviour. There is NO\n * accumulating `.upper +=` variant anywhere in `validator.ts`.)\n *\n * @internal\n */\nfunction mergeFreeIndices(\n target: Map<string, { upper: number; lower: number }>,\n source: Map<string, { upper: number; lower: number }>,\n): void {\n for (const [label, counts] of source) {\n target.set(label, counts);\n }\n}\n\n/**\n * Infer an arg's dimension and capture its LOCAL freeIndices map. Used by\n * `op '+'` / `'-'` (to compare maps across args) and by `op '*'` / `'/'` /\n * `'^'` (to reject any tensor-valued operand). The arg's freeIndices are\n * NOT merged into `ctx.freeIndices` here — the caller decides whether to\n * merge (op '+' merges after equality check) or discard (op '*' rejects).\n *\n * Violations from the arg's subtree are forwarded to `ctx.violations`, so\n * error reports stay coherent with the rest of the walker.\n */\nfunction inferArgLocal(\n node: ExprNode,\n ctx: InferContext,\n segment: string,\n): { dim: Dimension | null; freeIndices: Map<string, { upper: number; lower: number }> } {\n const localFI = new Map<string, { upper: number; lower: number }>();\n const localCtx: InferContext = {\n path: joinPath(ctx.path, segment),\n violations: ctx.violations,\n freeIndices: localFI,\n };\n const dim = infer(node, localCtx);\n return { dim, freeIndices: localFI };\n}\n\n/**\n * Resolve a child node for `computeContraction` — returns a LOCAL\n * `{dim, freeIndices}` result with no shared mutable state. This is the\n * cycle-breaker and nested-safety primitive: it lets tensor-product\n * recursion avoid touching `ctx.freeIndices` for any subtree.\n *\n * - tensor-symbol → forwards to `validateTensorSymbol` (returns a local Map).\n * - tensor-product → recurses into `computeContraction` with this same\n * resolver, threading violations + path through `parentCtx` so error\n * reports stay informative.\n * - all other kinds → invoke `infer()` against a throwaway context so the\n * dimension is computed but no free-indices state leaks; non-tensor\n * nodes contribute an empty freeIndices map.\n *\n * Violations from non-tensor children DO get appended to `parentCtx.violations`\n * (via the throwaway ctx's violations array, which we then splice in). This\n * keeps error reporting equivalent to the inline-recursion shape used by\n * the scalar `op` / `integral` / `derivative` cases.\n */\nfunction resolveChildForContraction(\n node: ExprNode,\n parentCtx: InferContext,\n): ChildValidationResult {\n if (node.kind === 'tensor-symbol') {\n return validateTensorSymbol(node);\n }\n if (node.kind === 'metric-tensor') {\n return validateMetricTensor(node);\n }\n if (node.kind === 'kronecker-delta') {\n return validateKroneckerDelta(node);\n }\n if (node.kind === 'tensor-product') {\n return computeContraction(node.args, (grandchild) =>\n resolveChildForContraction(grandchild, parentCtx),\n );\n }\n // Non-tensor child: use `infer()` for dimension only. Use a throwaway\n // freeIndices map (discarded) but forward violations to the parent so\n // error reports remain coherent.\n const probe: InferContext = {\n path: parentCtx.path,\n violations: parentCtx.violations,\n freeIndices: new Map(),\n };\n const dim = infer(node, probe);\n if (dim === null) {\n // Surface as an error rather than silently producing a malformed\n // ContractionResult. The probe already recorded the violation in\n // parentCtx.violations, so the message here is the second signal.\n // Subclass of UPTError (§14.7) so downstream consumers can\n // discriminate UPT-source errors uniformly with `instanceof UPTError`.\n throw new TensorProductChildInferenceError(\n 'tensor-product: a non-tensor operand failed dimension inference; ' +\n 'see ValidationResult.violations for the underlying cause.',\n );\n }\n return { dim, freeIndices: probe.freeIndices };\n}\n\n/**\n * Resolve a child of a tensor-partial-derivative to its local\n * {dim, freeIndices, role?} carrier. Same shape as\n * `resolveChildForContraction` but returns role-aware result so the\n * pderiv validator can pass through `of.role` (Design §13 Q1).\n */\nfunction resolveChildForPartialDerivative(\n typed: ExprNode,\n parentCtx: InferContext,\n): PartialDerivativeChildResult {\n if (typed.kind === 'tensor-symbol') {\n const result = validateTensorSymbol(typed);\n return { dim: result.dim, freeIndices: result.freeIndices, role: typed.role };\n }\n if (typed.kind === 'metric-tensor') {\n const result = validateMetricTensor(typed);\n return { dim: result.dim, freeIndices: result.freeIndices };\n }\n if (typed.kind === 'kronecker-delta') {\n const result = validateKroneckerDelta(typed);\n return { dim: result.dim, freeIndices: result.freeIndices };\n }\n if (typed.kind === 'tensor-partial-derivative') {\n const result = validatePartialDerivative(typed, (grandchild) =>\n resolveChildForPartialDerivative(grandchild, parentCtx),\n );\n return result;\n }\n // For scalars / op / integral / derivative / tensor-product nodes, use\n // inferArgLocal for dim + freeIndices, no role.\n const probe = inferArgLocal(typed, parentCtx, '<pderiv-child>');\n if (probe.dim === null) {\n throw new TensorProductChildInferenceError(\n 'tensor-partial-derivative child failed dimension inference; ' +\n 'see ValidationResult.violations for cause.',\n );\n }\n return { dim: probe.dim, freeIndices: probe.freeIndices };\n}\n\n/**\n * Recursive dimension inference. On any sub-expression error we record a\n * violation, return `null`, and let parent ops propagate the null up.\n */\n/** A decimal literal: an optional sign, digits with an optional fraction, an optional exponent. */\nconst DECIMAL_LITERAL = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?$/;\n/** The scalar operators an `op` node may carry; anything else is a violation, not a sum. */\nconst SCALAR_OPS: ReadonlySet<string> = new Set(['^', '*', '/', '+', '-']);\n/** The `TranscendentalFn` union, as a runtime set for a node built from JSON. */\nconst TRANSCENDENTAL_FNS: ReadonlySet<string> = new Set(['exp', 'ln', 'log2', 'log10', 'sin', 'cos', 'tan', 'sinh', 'cosh', 'tanh']);\n\n/**\n * A literal exponent: a symbol whose name is a decimal literal and whose\n * dimension is dimensionless. The name is the number; the dimension says it\n * is a number and not a quantity that happens to be spelled with digits.\n */\nfunction isLiteralExponent(node: { readonly name: string; readonly dim: Dimension }): boolean {\n return DECIMAL_LITERAL.test(node.name) && equals(node.dim, DIMENSIONLESS);\n}\n\nfunction infer(node: ExprNode, ctx: InferContext): Dimension | null {\n switch (node.kind) {\n case 'symbol':\n return node.dim;\n\n case 'op': {\n if (!SCALAR_OPS.has(node.op)) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `unknown operator '${String(node.op)}'; the operators are ^ * / + -`,\n });\n return null;\n }\n if (node.op === '^') {\n // a^n — base is an arbitrary expression. A numeric-literal exponent\n // works on any base (power(baseDim, n)). A non-literal (input-dependent)\n // exponent is supported ONLY on a DIMENSIONLESS base (v0.13), where the\n // result is dimensionless regardless of the exponent's value.\n if (node.args.length !== 2) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `^ requires exactly 2 args (base, exponent), got ${node.args.length}`,\n });\n return null;\n }\n const [baseNode, expNode] = node.args;\n // Per Part-VII §VII.5: '^' is a scalar operator. Capture the base's\n // local freeIndices and reject if non-empty (tensor base).\n const baseProbe = inferArgLocal(baseNode, ctx, 'args[0]');\n const baseDim = baseProbe.dim;\n if (baseDim === null) return null;\n if (baseProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('^');\n }\n // Classify the exponent. A numeric-literal symbol supports a\n // DIMENSIONFUL base (e.g. c^3, r_s = …/c^2). A literal is a decimal\n // literal (`2`, `-1`, `0.5`, `1e-3`) carried by a DIMENSIONLESS\n // symbol: `''`, `' '` and `'0x2'` are not literals, and a `2` that\n // carries a dimension is a dimensioned exponent, which no base takes.\n if (expNode !== undefined && expNode.kind === 'symbol' && isLiteralExponent(expNode)) {\n const n = Number(expNode.name);\n // `1e400` reads as Infinity and `1e-400` as 0: neither is the exponent written.\n if (!Number.isFinite(n) || (n === 0 && !/^[+-]?0*\\.?0*(?:[eE][+-]?\\d+)?$/.test(expNode.name))) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `exponent '${expNode.name}' is not representable as a finite number`,\n });\n return null;\n }\n return power(baseDim, n);\n }\n\n // Non-literal (input-dependent) exponent. SOUND only when the base is\n // DIMENSIONLESS: dimensionless^(dimensionless) = dimensionless, so the\n // result dimension is statically inferable without the exponent's\n // value. (v0.13 — symbolic exponents; e.g. Hertz-Millis (T/T₀)^(−1/z).)\n if (equals(baseDim, DIMENSIONLESS)) {\n if (!expNode) return null; // arity already guarded; defensive\n const expProbe = inferArgLocal(expNode, ctx, 'args[1]');\n if (expProbe.dim === null) return null; // exponent failed — short-circuit\n if (expProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('^'); // tensor exponent\n }\n if (!equals(expProbe.dim, DIMENSIONLESS)) {\n ctx.violations.push({\n location: joinPath(ctx.path, 'args[1]'),\n expected: DIMENSIONLESS,\n actual: expProbe.dim,\n note: '^ exponent must be dimensionless',\n });\n return null;\n }\n return DIMENSIONLESS;\n }\n\n // Dimensionful base + non-literal exponent: not statically inferable —\n // a numeric literal is required. Throwaway-probe the exponent so the\n // violation's `actual` carries its inferred dim (informative; a\n // downstream consumer keying on `equals(expected,actual)` sees the\n // mismatch). Preserves the pinned violation shape.\n let actualDim: Dimension = DIMENSIONLESS;\n if (expNode) {\n const probeCtx: InferContext = { path: joinPath(ctx.path, 'args[1]'), violations: [], freeIndices: new Map() };\n const probed = infer(expNode, probeCtx);\n if (probed !== null && okFromViolations(probeCtx.violations)) {\n actualDim = probed;\n }\n }\n ctx.violations.push({\n location: joinPath(ctx.path, 'args[1]'),\n expected: DIMENSIONLESS,\n actual: actualDim,\n note: '^ exponent must be a numeric literal symbol unless the base is dimensionless',\n });\n return null;\n }\n\n if (node.op === '*' || node.op === '/') {\n if (node.args.length === 0) return DIMENSIONLESS;\n // Per Part-VII §VII.5: '*' / '/' are scalar-only operators. Any\n // arg with non-empty freeIndices is rejected with\n // TensorInScalarOpError; users must use 'tensor-product' for\n // tensor multiplication. Scalar-only operand lists retain the\n // existing dim-accumulation behavior.\n let acc: Dimension | null = null;\n for (let i = 0; i < node.args.length; i++) {\n const probe = inferArgLocal(node.args[i], ctx, `args[${i}]`);\n const childDim = probe.dim;\n if (childDim === null) return null;\n if (probe.freeIndices.size > 0) {\n throw new TensorInScalarOpError(node.op);\n }\n if (i === 0) acc = childDim;\n else if (node.op === '*') acc = multiply(acc!, childDim);\n else acc = divide(acc!, childDim);\n }\n return acc;\n }\n\n // '+' or '-' — all operands must share a common dimension AND\n // (per Part-VII §VII.5) the same freeIndices signature. Mismatched\n // free-index maps raise FreeIndexMismatchError; this catches both\n // tensor + scalar (one map non-empty, one empty) and tensor + tensor\n // with differing variance / labels / counts.\n if (node.args.length === 0) return DIMENSIONLESS;\n let acc: Dimension | null = null;\n let firstFI: Map<string, { upper: number; lower: number }> | null = null;\n for (let i = 0; i < node.args.length; i++) {\n // A literal zero is the additive identity and carries no dimension of\n // its own. Numbers are dimensionless symbols in this grammar, so\n // without this `x = 0`, written `x - 0`, could never validate.\n if (isDimensionlessZeroLiteral(node.args[i])) continue;\n const probe = inferArgLocal(node.args[i], ctx, `args[${i}]`);\n const childDim = probe.dim;\n if (childDim === null) return null;\n if (acc === null) {\n acc = childDim;\n firstFI = probe.freeIndices;\n } else {\n if (!freeIndicesEqual(firstFI!, probe.freeIndices)) {\n throw new FreeIndexMismatchError(\n `op '${node.op}' args have mismatched freeIndices: ` +\n `args[0] has ${formatFreeIndices(firstFI!)} but ` +\n `args[${i}] has ${formatFreeIndices(probe.freeIndices)}. ` +\n `All operands of a tensor sum must share the same free-index signature.`,\n );\n }\n try {\n acc = node.op === '+' ? add(acc!, childDim) : subtract(acc!, childDim);\n } catch (err) {\n if (err instanceof DimensionMismatchError) {\n ctx.violations.push({\n location: joinPath(ctx.path, `args[${i}]`),\n expected: acc!,\n actual: childDim,\n note: `Cannot ${node.op === '+' ? 'add' : 'subtract'} ${format(childDim)} with running ${format(acc!)} (dimension mismatch).`,\n });\n return null;\n }\n throw err;\n }\n }\n }\n // Propagate the (shared) freeIndices signature to the parent ctx so\n // a tensor-sum can flow into another tensor-aware operator above.\n if (firstFI !== null) {\n mergeFreeIndices(ctx.freeIndices, firstFI);\n }\n return acc ?? DIMENSIONLESS;\n }\n\n case 'integral': {\n // ∫ f dx — result has dim(f) * dim(x).\n // Guard against malformed nodes loaded from JSON / hand-built test\n // fixtures that omit `integrand` or `over` (TypeScript requires them\n // but `as unknown as ExprNode` casts can bypass the check).\n if (!node.integrand || !node.over) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `integral requires both 'integrand' and 'over' fields`,\n });\n return null;\n }\n // v0.3.1 audit fix: shallow `{ ...ctx, path }` shared ctx.freeIndices\n // (a Map, copied by reference), so a tensor-valued integrand silently\n // leaked its free indices into the parent accumulator. Use\n // inferArgLocal() to give each child a fresh local freeIndices Map.\n // v0.3.0 has no tensor-integral semantics; the operator is dimensional\n // scalar and child free-indices stay local.\n const fProbe = inferArgLocal(node.integrand, ctx, 'integrand');\n const xProbe = inferArgLocal(node.over, ctx, 'over');\n if (fProbe.dim === null || xProbe.dim === null) return null;\n // Definite integral: the bounds are points on the integration axis, so\n // each must carry the integration variable's dimension.\n for (const [bound, label] of [\n [node.lower, 'lower'] as const,\n [node.upper, 'upper'] as const,\n ]) {\n if (!bound) continue;\n const bProbe = inferArgLocal(bound, ctx, label);\n if (bProbe.dim === null) return null;\n if (!equals(bProbe.dim, xProbe.dim)) {\n ctx.violations.push({\n location: joinPath(ctx.path, label),\n expected: xProbe.dim,\n actual: bProbe.dim,\n note: `integral ${label} bound must match the integration variable's dimension`,\n });\n return null;\n }\n }\n return multiply(fProbe.dim, xProbe.dim);\n }\n\n case 'derivative': {\n // d f / d x — result has dim(f) / dim(x).\n // Same shape guard as `integral` above.\n if (!node.of || !node.wrt) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `derivative requires both 'of' and 'wrt' fields`,\n });\n return null;\n }\n // v0.3.1 audit fix: same shallow-spread ctx.freeIndices leak as the\n // integral case above. Use inferArgLocal() so a tensor-valued `of`\n // doesn't bleed its free indices into the parent. v0.3.0 has no\n // tensor-derivative semantics (tensor-partial-derivative is the\n // dedicated node for that); this `derivative` node stays dimensional\n // scalar.\n const fProbe = inferArgLocal(node.of, ctx, 'of');\n const xProbe = inferArgLocal(node.wrt, ctx, 'wrt');\n if (fProbe.dim === null || xProbe.dim === null) return null;\n return divide(fProbe.dim, xProbe.dim);\n }\n\n case 'dirac-delta': {\n // δ(x) — Dirac-delta correlator primitive (v0.14). Since ∫δ(x)dx=1 is\n // dimensionless, [δ(x)] = [x]⁻¹ = power(dim(arg), -1). A dimensionless\n // arg gives a dimensionless δ (power of DIMENSIONLESS is DIMENSIONLESS).\n // Scalar operator: a tensor-valued arg is rejected by inferArgLocal via\n // TensorInScalarOpError; free indices stay local (not merged to parent).\n if (!node.arg) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `dirac-delta requires an 'arg' field`,\n });\n return null;\n }\n const argProbe = inferArgLocal(node.arg, ctx, 'arg');\n if (argProbe.dim === null) return null;\n if (argProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('dirac-delta');\n }\n return power(argProbe.dim, -1);\n }\n\n case 'variational-derivative': {\n // δF/δφ — functional derivative primitive (v0.14). From the defining\n // relation δF = ∫ (δF/δφ) δφ dμ we get [F] = [δF/δφ]·[φ]·[μ], so\n // [δF/δφ] = [F]/([φ]·[μ]) = divide(divide([F],[φ]),[μ]). `over` carries\n // the integration-measure dimension [dμ] whose one integration the\n // variational derivative undoes (the dual of `integral`, which MULTIPLIES\n // by [over]). Scalar operator: tensor children rejected by inferArgLocal.\n if (!node.functional || !node.field || !node.over) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `variational-derivative requires 'functional', 'field', and 'over' fields`,\n });\n return null;\n }\n const fnProbe = inferArgLocal(node.functional, ctx, 'functional');\n const phiProbe = inferArgLocal(node.field, ctx, 'field');\n const muProbe = inferArgLocal(node.over, ctx, 'over');\n if (fnProbe.dim === null || phiProbe.dim === null || muProbe.dim === null) {\n return null;\n }\n if (\n fnProbe.freeIndices.size > 0 ||\n phiProbe.freeIndices.size > 0 ||\n muProbe.freeIndices.size > 0\n ) {\n throw new TensorInScalarOpError('variational-derivative');\n }\n return divide(divide(fnProbe.dim, phiProbe.dim), muProbe.dim);\n }\n\n case 'transcendental': {\n if (!TRANSCENDENTAL_FNS.has(node.fn)) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `unknown transcendental function '${String(node.fn)}'; the functions are ${[...TRANSCENDENTAL_FNS].join(', ')}`,\n });\n return null;\n }\n // exp/ln/logₙ/sin/cos/tan/sinh/cosh/tanh of a DIMENSIONLESS argument is\n // DIMENSIONLESS (the function's Taylor series only sums across like\n // dimensions when its argument is dimensionless). A dimensionful argument\n // is a dimension violation; a tensor-valued argument is rejected (scalar\n // operator), mirroring dirac-delta.\n if (!node.arg) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `transcendental '${node.fn}' requires an 'arg' field`,\n });\n return null;\n }\n const argProbe = inferArgLocal(node.arg, ctx, 'arg');\n if (argProbe.dim === null) return null;\n if (argProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('transcendental');\n }\n if (!equals(argProbe.dim, DIMENSIONLESS)) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: argProbe.dim,\n note: `transcendental '${node.fn}' requires a dimensionless argument`,\n });\n return null;\n }\n return DIMENSIONLESS;\n }\n\n case 'abs': {\n // |x| is dimension-PRESERVING: [|x|] = [x]. Scalar operator (a tensor arg\n // is rejected, mirroring dirac-delta / transcendental).\n if (!node.arg) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `abs requires an 'arg' field`,\n });\n return null;\n }\n const argProbe = inferArgLocal(node.arg, ctx, 'arg');\n if (argProbe.dim === null) return null;\n if (argProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('abs');\n }\n return argProbe.dim;\n }\n\n case 'tensor-symbol': {\n // Real validation per Part-VII §VII.4. Builds the free-indices map\n // from declared indices and merges into the context accumulator so\n // the root validate() call sees them in its ValidationResult.\n const { dim, freeIndices } = validateTensorSymbol(node);\n mergeFreeIndices(ctx.freeIndices, freeIndices);\n return dim;\n }\n\n case 'tensor-product': {\n // Task 6 — Einstein contraction. We delegate the algebra to the\n // pure `computeContraction(args, validateChild)` helper in tensor.ts\n // and inject `validateChild` to break the module cycle that would\n // otherwise arise from tensor.ts importing the validator.\n //\n // CRITICAL: every nested call uses *local* freeIndices maps; we never\n // mutate ctx.freeIndices from inside the recursion. Only the outer-\n // most tensor-product case merges its final residual map into the\n // shared ctx.freeIndices accumulator. This is what makes\n // (A·B)·C-style nested products correct: the inner product's dummy\n // indices stay scoped to the inner call.\n // Errors from the contraction (IndexLabelCollisionError,\n // VarianceMismatchError) are part of the public surface and propagate\n // so callers / tests can catch by type.\n const result = computeContraction(node.args, (child) =>\n resolveChildForContraction(child, ctx),\n );\n mergeFreeIndices(ctx.freeIndices, result.freeIndices);\n return result.dim;\n }\n\n case 'metric-tensor': {\n const { dim, freeIndices } = validateMetricTensor(node);\n mergeFreeIndices(ctx.freeIndices, freeIndices);\n return dim;\n }\n\n case 'kronecker-delta': {\n const { dim, freeIndices } = validateKroneckerDelta(node);\n mergeFreeIndices(ctx.freeIndices, freeIndices);\n return dim;\n }\n\n case 'tensor-partial-derivative': {\n const result = validatePartialDerivative(node, (child) =>\n resolveChildForPartialDerivative(child, ctx),\n );\n mergeFreeIndices(ctx.freeIndices, result.freeIndices);\n return result.dim;\n }\n\n case 'covariant-derivative': {\n // Same child kinds as a partial derivative, so it reuses that resolver.\n const result = validateCovariantDerivative(node, (child) =>\n resolveChildForPartialDerivative(child, ctx),\n );\n mergeFreeIndices(ctx.freeIndices, result.freeIndices);\n return result.dim;\n }\n\n // v0.6.1 Phase 2 Proposal 1 — the 11 curvature/GR-object arms\n // (riemann-tensor, ricci-tensor, einstein-tensor, bianchi-residual,\n // killing-vector, conserved-charge, stress-energy, cosmological-\n // constant, einstein-equation, weyl-tensor, kretschmann-scalar)\n // dispatch through a registry. The registry's discriminated-union\n // entry encodes three patterns (A/B/C) that capture the per-arm\n // callback-shape + freeIndices-propagate asymmetry; see\n // `validator-registry.ts` for the per-kind classification.\n case 'riemann-tensor':\n case 'ricci-tensor':\n case 'einstein-tensor':\n case 'bianchi-residual':\n case 'killing-vector':\n case 'conserved-charge':\n case 'stress-energy':\n case 'cosmological-constant':\n case 'einstein-equation':\n case 'weyl-tensor':\n case 'kretschmann-scalar': {\n const entry = lookupValidatorEntry(node.kind);\n if (!entry) {\n // Defensive: should be unreachable given the `case` labels\n // above match the registry's `RegistryKind` exactly.\n throw new Error(`validator: no registry entry for ${node.kind}`);\n }\n const result = dispatchValidator(entry, node);\n if (shouldPropagateFreeIndices(entry)) {\n mergeFreeIndices(ctx.freeIndices, result.freeIndices);\n }\n return result.dim;\n }\n\n default: {\n // Exhaustiveness guard: if a future ExprNode arm is added but not\n // handled here, this branch records a shape violation rather than\n // silently returning `undefined` (which validate() would coerce to\n // `ok: true, inferredDimension: undefined` — see silent-failure F1).\n const _exhaustive: never = node;\n void _exhaustive;\n const kind = (node as { kind?: unknown })?.kind;\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `Validator: unknown ExprNode.kind ${JSON.stringify(kind)}`,\n });\n return null;\n }\n }\n}\n\n/**\n * A violation set passes iff it contains no error-severity violation.\n * Violations with `severity` absent default to 'error' (v0.3.5 §4).\n */\nfunction okFromViolations(violations: ReadonlyArray<Violation>): boolean {\n return !violations.some((v) => (v.severity ?? 'error') === 'error');\n}\n\n/**\n * A symbol whose name is a numeric literal equal to zero and whose dimension\n * is dimensionless. In a sum it is the additive identity and is skipped.\n * A \"0\" that carries a dimension is an ordinary term.\n */\nfunction isDimensionlessZeroLiteral(node: ExprNode | undefined): boolean {\n if (node === undefined || node.kind !== 'symbol' || node.name.trim() === '') return false;\n // A decimal literal zero only: `0x0`, `0b0` and a blank are not the written identity.\n if (!DECIMAL_LITERAL.test(node.name) || Number(node.name) !== 0) return false;\n const d = node.dim;\n return d.L === 0 && d.M === 0 && d.T === 0 && d.I === 0 && d.Theta === 0 && d.N === 0 && d.J === 0;\n}\n\n/**\n * Validate a single scalar/tensor `ExprNode`: infer its dimension and collect\n * any consistency violations. `ok` is true iff a dimension was inferred and no\n * error-severity violations were raised. The hot path for the whole suite.\n */\nexport function validate(expr: ExprNode): ValidationResult {\n const ctx: InferContext = { path: '', violations: [], freeIndices: new Map() };\n const dim = infer(expr, ctx);\n return {\n ok: okFromViolations(ctx.violations) && dim !== null,\n inferredDimension: dim,\n freeIndices: ctx.freeIndices,\n violations: ctx.violations,\n };\n}\n\n/**\n * Opt-in symbolic InverseMetricInconsistencyWarning check. Given a\n * lower/upper metric pair, returns a deduplicated (at most one) warning-\n * severity Violation set. v0.3.5 §7. (Deliberately not folded into\n * validate() — that is the hot path for the whole test suite.)\n */\nexport function validateInverseMetricPair(\n gLower: MetricTensorNode,\n gUpper: MetricTensorNode,\n): Violation[] {\n const note = checkInverseMetricStructure(gLower, gUpper);\n if (note === null) return [];\n return [{\n location: `${gLower.name}/${gUpper.name}`,\n expected: gLower.dim,\n actual: gUpper.dim,\n note,\n severity: 'warning',\n }];\n}\n\n/**\n * Validate an equation `lhs = rhs`: both sides must infer a dimension, the two\n * dimensions must match, and free-index valence must agree (so a tensor = scalar\n * is caught even when units match). Returns the combined `ValidationResult`.\n */\nexport function validateEquation(lhs: ExprNode, rhs: ExprNode): ValidationResult {\n const lhsCtx: InferContext = { path: 'lhs', violations: [], freeIndices: new Map() };\n const rhsCtx: InferContext = { path: 'rhs', violations: [], freeIndices: new Map() };\n const lhsDim = infer(lhs, lhsCtx);\n const rhsDim = infer(rhs, rhsCtx);\n const violations = [...lhsCtx.violations, ...rhsCtx.violations];\n\n if (lhsDim !== null && rhsDim !== null && !equals(lhsDim, rhsDim)) {\n violations.push({\n location: '<equation>',\n expected: lhsDim,\n actual: rhsDim,\n note: `LHS has ${format(lhsDim)} but RHS has ${format(rhsDim)} — equation is not dimensionally homogeneous.`,\n });\n }\n\n // Equation-level valence (free-index) homogeneity. Both sides of an\n // equation must carry the same free-index signature: a rank-2 tensor\n // cannot equal a scalar, nor A^mu equal B_mu, even when the SI dimensions\n // agree. Only checked when both sides inferred a dimension (a side that\n // already failed inference has reported its own violation). Scalar\n // equations have empty maps on both sides ⇒ no effect.\n if (\n lhsDim !== null &&\n rhsDim !== null &&\n !freeIndicesEqual(lhsCtx.freeIndices, rhsCtx.freeIndices)\n ) {\n violations.push({\n location: '<equation>',\n expected: lhsDim,\n actual: rhsDim,\n note:\n `LHS free indices ${formatFreeIndices(lhsCtx.freeIndices)} but RHS ` +\n `free indices ${formatFreeIndices(rhsCtx.freeIndices)} — equation is ` +\n `not valence-homogeneous (index/rank mismatch across '=').`,\n });\n }\n\n return {\n ok: okFromViolations(violations) && lhsDim !== null && rhsDim !== null,\n inferredDimension: lhsDim, // by convention, LHS dimension is the canonical answer\n // By convention LHS free-indices map is the canonical answer (mirrors\n // inferredDimension's LHS bias).\n freeIndices: lhsCtx.freeIndices,\n violations,\n };\n}\n"]}
1
+ {"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/dimensional/validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,GAAG,EACH,QAAQ,EACR,MAAM,EACN,MAAM,EACN,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gCAAgC,GACjC,MAAM,aAAa,CAAC;AA4BrB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,wEAAwE;AACxE,sEAAsE;AACtE,kEAAkE;AAClE,gEAAgE;AAChE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AAkEjC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EAAE,MAAM,EAAE,uDAAuD;QAClF,sEAAsE;QACtE,iCAAiC;QACjC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Validator: walks an ExprNode tree and infers / checks SI dimensions.\n *\n * Honest-claude scope notes:\n * - Tensor index structure IS tracked: tensor-symbol / tensor-product\n * nodes carry free-index (upper/lower) signatures, contraction is\n * enforced, and `validateEquation` now checks valence homogeneity\n * across '=' (so the spec's Bridge Eq 17 rank mismatch — a tensor\n * equated to a scalar — is caught even when the SI dimensions agree).\n * - Transcendental nodes (exp, ln, log, trig): the argument must be\n * dimensionless. A dimensioned argument is an error-severity violation;\n * a tensor argument throws `TensorInScalarOpError`.\n *\n * @module dimensional/validator\n */\n\nimport {\n Dimension,\n DIMENSIONLESS,\n} from './types.js';\nimport {\n multiply,\n divide,\n power,\n add,\n subtract,\n equals,\n format,\n DimensionMismatchError,\n} from './algebra.js';\nimport {\n TensorInScalarOpError,\n FreeIndexMismatchError,\n TensorProductChildInferenceError,\n} from './errors.js';\n// All AST node types + ExprNode + TranscendentalFn now live in the leaf\n// `ast-types.ts` (consolidated to break the validator↔tensor / validator↔\n// curvature type-only cycles). The per-kind VALIDATION FUNCTIONS still live in\n// their modules and are value-imported below (one-way edges — those modules no\n// longer import validator).\nimport type {\n ExprNode,\n TranscendentalFn,\n TensorSymbolNode,\n TensorProductNode,\n MetricTensorNode,\n KroneckerDeltaNode,\n TensorPartialDerivativeNode,\n CovariantDerivativeNode,\n RiemannTensorNode,\n RicciTensorNode,\n EinsteinTensorNode,\n BianchiResidualNode,\n KillingVectorNode,\n ConservedChargeNode,\n StressEnergyTensorNode,\n CosmologicalConstantNode,\n EinsteinFieldEquationNode,\n WeylTensorNode,\n KretschmannScalarNode,\n} from './ast-types.js';\nimport type { ChildValidationResult } from './tensor.js';\nimport { validateTensorSymbol, computeContraction } from './tensor.js';\nimport type { PartialDerivativeChildResult } from './metric-validators.js';\nimport {\n validateMetricTensor,\n validateKroneckerDelta,\n validatePartialDerivative,\n checkInverseMetricStructure,\n} from './metric-validators.js';\nimport { validateCovariantDerivative } from './connection-validators.js';\n// v0.6.1 Phase 2: 11-arm curvature/GR-object dispatch consolidated into\n// the validator-registry module. The individual `validateX` functions\n// are still imported by validator-registry.ts (which the registry\n// indexes); validator.ts now only needs the dispatcher helpers.\nimport {\n lookupValidatorEntry,\n dispatchValidator,\n shouldPropagateFreeIndices,\n} from './validator-registry.js';\n\n// `ExprNode`, `TranscendentalFn`, and every node/index type now live in the\n// leaf `ast-types.ts`. They are re-exported here so the ~100 consumers that\n// import `{ ExprNode, … }` from `./validator.js` are unchanged.\nexport type {\n ExprNode,\n TranscendentalFn,\n TensorSymbolNode,\n TensorProductNode,\n TensorIndex,\n Variance,\n Role,\n MetricTensorNode,\n KroneckerDeltaNode,\n TensorPartialDerivativeNode,\n CovariantIndex,\n UpperIndex,\n CovariantDerivativeNode,\n RiemannTensorNode,\n RicciTensorNode,\n EinsteinTensorNode,\n BianchiResidualNode,\n KillingVectorNode,\n ConservedChargeNode,\n StressEnergyTensorNode,\n CosmologicalConstantNode,\n EinsteinFieldEquationNode,\n WeylTensorNode,\n KretschmannScalarNode,\n} from './ast-types.js';\n\n/** One dimensional violation that validation found in an expression. */\nexport interface Violation {\n /** Tree path, e.g. \"args[1].args[0]\". Empty string for the root. */\n location: string;\n expected: Dimension;\n actual: Dimension;\n note: string;\n /** v0.3.5: absent ⇒ 'error'. 'warning'-severity violations do not fail\n * validation (ValidationResult.ok stays true) but are still reported. */\n severity?: 'error' | 'warning';\n}\n\n/** The result of validating one expression: its verdict, dimension, free indices and violations. */\nexport interface ValidationResult {\n ok: boolean;\n inferredDimension: Dimension | null;\n /** Map of free (uncontracted) index labels to their upper/lower counts.\n * Empty for scalar expressions. Populated by tensor-symbol /\n * tensor-product validation (Tasks 5 and 6). */\n freeIndices: Map<string, { upper: number; lower: number }>;\n violations: Violation[];\n}\n\ninterface InferContext {\n path: string;\n violations: Violation[];\n /** Free-indices accumulator for the root expression. Tensor-aware node\n * cases (tensor-symbol, tensor-product) populate this; scalar cases\n * leave it alone. validate() reads it after walking to construct the\n * ValidationResult.freeIndices map. Shared by reference across the\n * recursion so sibling subtrees can contribute. */\n freeIndices: Map<string, { upper: number; lower: number }>;\n}\n\nfunction joinPath(path: string, segment: string): string {\n return path === '' ? segment : `${path}.${segment}`;\n}\n\n/**\n * Structural equality for freeIndices maps. Two maps are equal iff they\n * contain the same label set and each label's `{upper, lower}` counts\n * match. Used by `op '+'` / `'-'` (Task 7 / Part-VII §VII.5) to enforce\n * that all operands of a tensor sum share the same free-index signature.\n */\nfunction freeIndicesEqual(\n a: Map<string, { upper: number; lower: number }>,\n b: Map<string, { upper: number; lower: number }>,\n): boolean {\n if (a.size !== b.size) return false;\n for (const [label, counts] of a) {\n const other = b.get(label);\n if (!other) return false;\n if (other.upper !== counts.upper || other.lower !== counts.lower) return false;\n }\n return true;\n}\n\n/**\n * Human-readable summary of a freeIndices map for use in error messages.\n * Empty map renders as `{}` so a tensor-vs-scalar mismatch is visually\n * obvious in the thrown FreeIndexMismatchError text.\n */\nfunction formatFreeIndices(m: Map<string, { upper: number; lower: number }>): string {\n if (m.size === 0) return '{}';\n const parts: string[] = [];\n for (const [label, counts] of m) {\n parts.push(`${label}:{upper:${counts.upper},lower:${counts.lower}}`);\n }\n return `{${parts.join(', ')}}`;\n}\n\n/**\n * Merge every `{label → counts}` entry from `source` into `target`,\n * overwriting any existing entry for the same label. One helper for the\n * `for (const [label, counts] of …) target.set(label, counts)` loop that\n * the `infer()` switch arms each used to carry.\n *\n * The semantics are an \"overwrite-style\" merge — child results are\n * authoritative when their labels collide with the parent context.\n * (This matches the original inline-loop behaviour. There is NO\n * accumulating `.upper +=` variant anywhere in `validator.ts`.)\n *\n * @internal\n */\nfunction mergeFreeIndices(\n target: Map<string, { upper: number; lower: number }>,\n source: Map<string, { upper: number; lower: number }>,\n): void {\n for (const [label, counts] of source) {\n target.set(label, counts);\n }\n}\n\n/**\n * Infer an arg's dimension and capture its LOCAL freeIndices map. Used by\n * `op '+'` / `'-'` (to compare maps across args) and by `op '*'` / `'/'` /\n * `'^'` (to reject any tensor-valued operand). The arg's freeIndices are\n * NOT merged into `ctx.freeIndices` here — the caller decides whether to\n * merge (op '+' merges after equality check) or discard (op '*' rejects).\n *\n * Violations from the arg's subtree are forwarded to `ctx.violations`, so\n * error reports stay coherent with the rest of the walker.\n */\nfunction inferArgLocal(\n node: ExprNode,\n ctx: InferContext,\n segment: string,\n): { dim: Dimension | null; freeIndices: Map<string, { upper: number; lower: number }> } {\n const localFI = new Map<string, { upper: number; lower: number }>();\n const localCtx: InferContext = {\n path: joinPath(ctx.path, segment),\n violations: ctx.violations,\n freeIndices: localFI,\n };\n const dim = infer(node, localCtx);\n return { dim, freeIndices: localFI };\n}\n\n/**\n * Resolve a child node for `computeContraction` — returns a LOCAL\n * `{dim, freeIndices}` result with no shared mutable state. This is the\n * cycle-breaker and nested-safety primitive: it lets tensor-product\n * recursion avoid touching `ctx.freeIndices` for any subtree.\n *\n * - tensor-symbol → forwards to `validateTensorSymbol` (returns a local Map).\n * - tensor-product → recurses into `computeContraction` with this same\n * resolver, threading violations + path through `parentCtx` so error\n * reports stay informative.\n * - all other kinds → invoke `infer()` against a throwaway context so the\n * dimension is computed but no free-indices state leaks; non-tensor\n * nodes contribute an empty freeIndices map.\n *\n * Violations from non-tensor children DO get appended to `parentCtx.violations`\n * (via the throwaway ctx's violations array, which we then splice in). This\n * keeps error reporting equivalent to the inline-recursion shape used by\n * the scalar `op` / `integral` / `derivative` cases.\n */\nfunction resolveChildForContraction(\n node: ExprNode,\n parentCtx: InferContext,\n): ChildValidationResult {\n if (node.kind === 'tensor-symbol') {\n return validateTensorSymbol(node);\n }\n if (node.kind === 'metric-tensor') {\n return validateMetricTensor(node);\n }\n if (node.kind === 'kronecker-delta') {\n return validateKroneckerDelta(node);\n }\n if (node.kind === 'tensor-product') {\n return computeContraction(node.args, (grandchild) =>\n resolveChildForContraction(grandchild, parentCtx),\n );\n }\n // Non-tensor child: use `infer()` for dimension only. Use a throwaway\n // freeIndices map (discarded) but forward violations to the parent so\n // error reports remain coherent.\n const probe: InferContext = {\n path: parentCtx.path,\n violations: parentCtx.violations,\n freeIndices: new Map(),\n };\n const dim = infer(node, probe);\n if (dim === null) {\n // Surface as an error rather than silently producing a malformed\n // ContractionResult. The probe already recorded the violation in\n // parentCtx.violations, so the message here is the second signal.\n // Subclass of UPTError (§14.7) so downstream consumers can\n // discriminate UPT-source errors uniformly with `instanceof UPTError`.\n throw new TensorProductChildInferenceError(\n 'tensor-product: a non-tensor operand failed dimension inference; ' +\n 'see ValidationResult.violations for the underlying cause.',\n );\n }\n return { dim, freeIndices: probe.freeIndices };\n}\n\n/**\n * Resolve a child of a tensor-partial-derivative to its local\n * {dim, freeIndices, role?} carrier. Same shape as\n * `resolveChildForContraction` but returns role-aware result so the\n * pderiv validator can pass through `of.role` (Design §13 Q1).\n */\nfunction resolveChildForPartialDerivative(\n typed: ExprNode,\n parentCtx: InferContext,\n): PartialDerivativeChildResult {\n if (typed.kind === 'tensor-symbol') {\n const result = validateTensorSymbol(typed);\n return { dim: result.dim, freeIndices: result.freeIndices, role: typed.role };\n }\n if (typed.kind === 'metric-tensor') {\n const result = validateMetricTensor(typed);\n return { dim: result.dim, freeIndices: result.freeIndices };\n }\n if (typed.kind === 'kronecker-delta') {\n const result = validateKroneckerDelta(typed);\n return { dim: result.dim, freeIndices: result.freeIndices };\n }\n if (typed.kind === 'tensor-partial-derivative') {\n const result = validatePartialDerivative(typed, (grandchild) =>\n resolveChildForPartialDerivative(grandchild, parentCtx),\n );\n return result;\n }\n // For scalars / op / integral / derivative / tensor-product nodes, use\n // inferArgLocal for dim + freeIndices, no role.\n const probe = inferArgLocal(typed, parentCtx, '<pderiv-child>');\n if (probe.dim === null) {\n throw new TensorProductChildInferenceError(\n 'tensor-partial-derivative child failed dimension inference; ' +\n 'see ValidationResult.violations for cause.',\n );\n }\n return { dim: probe.dim, freeIndices: probe.freeIndices };\n}\n\n/**\n * Recursive dimension inference. On any sub-expression error we record a\n * violation, return `null`, and let parent ops propagate the null up.\n */\n/** A decimal literal: an optional sign, digits with an optional fraction, an optional exponent. */\nconst DECIMAL_LITERAL = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?$/;\n/** The scalar operators an `op` node may carry; anything else is a violation, not a sum. */\nconst SCALAR_OPS: ReadonlySet<string> = new Set(['^', '*', '/', '+', '-']);\n/** The `TranscendentalFn` union, as a runtime set for a node built from JSON. */\nconst TRANSCENDENTAL_FNS: ReadonlySet<string> = new Set(['exp', 'ln', 'log2', 'log10', 'sin', 'cos', 'tan', 'sinh', 'cosh', 'tanh']);\n\n/**\n * A literal exponent: a symbol whose name is a decimal literal and whose\n * dimension is dimensionless. The name is the number; the dimension says it\n * is a number and not a quantity that happens to be spelled with digits.\n */\nfunction isLiteralExponent(node: { readonly name: string; readonly dim: Dimension }): boolean {\n return DECIMAL_LITERAL.test(node.name) && equals(node.dim, DIMENSIONLESS);\n}\n\nfunction infer(node: ExprNode, ctx: InferContext): Dimension | null {\n switch (node.kind) {\n case 'symbol':\n return node.dim;\n\n case 'op': {\n if (!SCALAR_OPS.has(node.op)) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `unknown operator '${String(node.op)}'; the operators are ^ * / + -`,\n });\n return null;\n }\n if (node.op === '^') {\n // a^n — base is an arbitrary expression. A numeric-literal exponent\n // works on any base (power(baseDim, n)). A non-literal (input-dependent)\n // exponent is supported ONLY on a DIMENSIONLESS base (v0.13), where the\n // result is dimensionless regardless of the exponent's value.\n if (node.args.length !== 2) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `^ requires exactly 2 args (base, exponent), got ${node.args.length}`,\n });\n return null;\n }\n const [baseNode, expNode] = node.args;\n // Per Part-VII §VII.5: '^' is a scalar operator. Capture the base's\n // local freeIndices and reject if non-empty (tensor base).\n const baseProbe = inferArgLocal(baseNode, ctx, 'args[0]');\n const baseDim = baseProbe.dim;\n if (baseDim === null) return null;\n if (baseProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('^');\n }\n // Classify the exponent. A numeric-literal symbol supports a\n // DIMENSIONFUL base (e.g. c^3, r_s = …/c^2). A literal is a decimal\n // literal (`2`, `-1`, `0.5`, `1e-3`) carried by a DIMENSIONLESS\n // symbol: `''`, `' '` and `'0x2'` are not literals, and a `2` that\n // carries a dimension is a dimensioned exponent, which no base takes.\n if (expNode !== undefined && expNode.kind === 'symbol' && isLiteralExponent(expNode)) {\n const n = Number(expNode.name);\n // `1e400` reads as Infinity and `1e-400` as 0: neither is the exponent written.\n if (!Number.isFinite(n) || (n === 0 && !/^[+-]?0*\\.?0*(?:[eE][+-]?\\d+)?$/.test(expNode.name))) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `exponent '${expNode.name}' is not representable as a finite number`,\n });\n return null;\n }\n return power(baseDim, n);\n }\n\n // Non-literal (input-dependent) exponent. SOUND only when the base is\n // DIMENSIONLESS: dimensionless^(dimensionless) = dimensionless, so the\n // result dimension is statically inferable without the exponent's\n // value. (v0.13 — symbolic exponents; e.g. Hertz-Millis (T/T₀)^(−1/z).)\n if (equals(baseDim, DIMENSIONLESS)) {\n if (!expNode) return null; // arity already guarded; defensive\n const expProbe = inferArgLocal(expNode, ctx, 'args[1]');\n if (expProbe.dim === null) return null; // exponent failed — short-circuit\n if (expProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('^'); // tensor exponent\n }\n if (!equals(expProbe.dim, DIMENSIONLESS)) {\n ctx.violations.push({\n location: joinPath(ctx.path, 'args[1]'),\n expected: DIMENSIONLESS,\n actual: expProbe.dim,\n note: '^ exponent must be dimensionless',\n });\n return null;\n }\n return DIMENSIONLESS;\n }\n\n // Dimensionful base + non-literal exponent: not statically inferable —\n // a numeric literal is required. Throwaway-probe the exponent so the\n // violation's `actual` carries its inferred dim (informative; a\n // downstream consumer keying on `equals(expected,actual)` sees the\n // mismatch). Preserves the pinned violation shape.\n let actualDim: Dimension = DIMENSIONLESS;\n if (expNode) {\n const probeCtx: InferContext = { path: joinPath(ctx.path, 'args[1]'), violations: [], freeIndices: new Map() };\n const probed = infer(expNode, probeCtx);\n if (probed !== null && okFromViolations(probeCtx.violations)) {\n actualDim = probed;\n }\n }\n ctx.violations.push({\n location: joinPath(ctx.path, 'args[1]'),\n expected: DIMENSIONLESS,\n actual: actualDim,\n note: '^ exponent must be a numeric literal symbol unless the base is dimensionless',\n });\n return null;\n }\n\n if (node.op === '*' || node.op === '/') {\n if (node.args.length === 0) return DIMENSIONLESS;\n // Per Part-VII §VII.5: '*' / '/' are scalar-only operators. Any\n // arg with non-empty freeIndices is rejected with\n // TensorInScalarOpError; users must use 'tensor-product' for\n // tensor multiplication. Scalar-only operand lists retain the\n // existing dim-accumulation behavior.\n let acc: Dimension | null = null;\n for (let i = 0; i < node.args.length; i++) {\n const probe = inferArgLocal(node.args[i], ctx, `args[${i}]`);\n const childDim = probe.dim;\n if (childDim === null) return null;\n if (probe.freeIndices.size > 0) {\n throw new TensorInScalarOpError(node.op);\n }\n if (i === 0) acc = childDim;\n else if (node.op === '*') acc = multiply(acc!, childDim);\n else acc = divide(acc!, childDim);\n }\n return acc;\n }\n\n // '+' or '-' — all operands must share a common dimension AND\n // (per Part-VII §VII.5) the same freeIndices signature. Mismatched\n // free-index maps raise FreeIndexMismatchError; this catches both\n // tensor + scalar (one map non-empty, one empty) and tensor + tensor\n // with differing variance / labels / counts.\n if (node.args.length === 0) return DIMENSIONLESS;\n let acc: Dimension | null = null;\n let firstFI: Map<string, { upper: number; lower: number }> | null = null;\n for (let i = 0; i < node.args.length; i++) {\n // A literal zero is the additive identity and carries no dimension of\n // its own. Numbers are dimensionless symbols in this grammar, so\n // without this `x = 0`, written `x - 0`, could never validate.\n if (isDimensionlessZeroLiteral(node.args[i])) continue;\n const probe = inferArgLocal(node.args[i], ctx, `args[${i}]`);\n const childDim = probe.dim;\n if (childDim === null) return null;\n if (acc === null) {\n acc = childDim;\n firstFI = probe.freeIndices;\n } else {\n if (!freeIndicesEqual(firstFI!, probe.freeIndices)) {\n throw new FreeIndexMismatchError(\n `op '${node.op}' args have mismatched freeIndices: ` +\n `args[0] has ${formatFreeIndices(firstFI!)} but ` +\n `args[${i}] has ${formatFreeIndices(probe.freeIndices)}. ` +\n `All operands of a tensor sum must share the same free-index signature.`,\n );\n }\n try {\n acc = node.op === '+' ? add(acc!, childDim) : subtract(acc!, childDim);\n } catch (err) {\n if (err instanceof DimensionMismatchError) {\n ctx.violations.push({\n location: joinPath(ctx.path, `args[${i}]`),\n expected: acc!,\n actual: childDim,\n note: `Cannot ${node.op === '+' ? 'add' : 'subtract'} ${format(childDim)} with running ${format(acc!)} (dimension mismatch).`,\n });\n return null;\n }\n throw err;\n }\n }\n }\n // Propagate the (shared) freeIndices signature to the parent ctx so\n // a tensor-sum can flow into another tensor-aware operator above.\n if (firstFI !== null) {\n mergeFreeIndices(ctx.freeIndices, firstFI);\n }\n return acc ?? DIMENSIONLESS;\n }\n\n case 'integral': {\n // ∫ f dx — result has dim(f) * dim(x).\n // Guard against malformed nodes loaded from JSON / hand-built test\n // fixtures that omit `integrand` or `over` (TypeScript requires them\n // but `as unknown as ExprNode` casts can bypass the check).\n if (!node.integrand || !node.over) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `integral requires both 'integrand' and 'over' fields`,\n });\n return null;\n }\n // v0.3.1 audit fix: shallow `{ ...ctx, path }` shared ctx.freeIndices\n // (a Map, copied by reference), so a tensor-valued integrand silently\n // leaked its free indices into the parent accumulator. Use\n // inferArgLocal() to give each child a fresh local freeIndices Map.\n // v0.3.0 has no tensor-integral semantics; the operator is dimensional\n // scalar and child free-indices stay local.\n const fProbe = inferArgLocal(node.integrand, ctx, 'integrand');\n const xProbe = inferArgLocal(node.over, ctx, 'over');\n if (fProbe.dim === null || xProbe.dim === null) return null;\n // Definite integral: the bounds are points on the integration axis, so\n // each must carry the integration variable's dimension.\n for (const [bound, label] of [\n [node.lower, 'lower'] as const,\n [node.upper, 'upper'] as const,\n ]) {\n if (!bound) continue;\n const bProbe = inferArgLocal(bound, ctx, label);\n if (bProbe.dim === null) return null;\n if (!equals(bProbe.dim, xProbe.dim)) {\n ctx.violations.push({\n location: joinPath(ctx.path, label),\n expected: xProbe.dim,\n actual: bProbe.dim,\n note: `integral ${label} bound must match the integration variable's dimension`,\n });\n return null;\n }\n }\n return multiply(fProbe.dim, xProbe.dim);\n }\n\n case 'derivative': {\n // d f / d x — result has dim(f) / dim(x).\n // Same shape guard as `integral` above.\n if (!node.of || !node.wrt) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `derivative requires both 'of' and 'wrt' fields`,\n });\n return null;\n }\n // v0.3.1 audit fix: same shallow-spread ctx.freeIndices leak as the\n // integral case above. Use inferArgLocal() so a tensor-valued `of`\n // doesn't bleed its free indices into the parent. v0.3.0 has no\n // tensor-derivative semantics (tensor-partial-derivative is the\n // dedicated node for that); this `derivative` node stays dimensional\n // scalar.\n const fProbe = inferArgLocal(node.of, ctx, 'of');\n const xProbe = inferArgLocal(node.wrt, ctx, 'wrt');\n if (fProbe.dim === null || xProbe.dim === null) return null;\n return divide(fProbe.dim, xProbe.dim);\n }\n\n case 'dirac-delta': {\n // δ(x) — Dirac-delta correlator primitive (v0.14). Since ∫δ(x)dx=1 is\n // dimensionless, [δ(x)] = [x]⁻¹ = power(dim(arg), -1). A dimensionless\n // arg gives a dimensionless δ (power of DIMENSIONLESS is DIMENSIONLESS).\n // Scalar operator: a tensor-valued arg is rejected by inferArgLocal via\n // TensorInScalarOpError; free indices stay local (not merged to parent).\n if (!node.arg) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `dirac-delta requires an 'arg' field`,\n });\n return null;\n }\n const argProbe = inferArgLocal(node.arg, ctx, 'arg');\n if (argProbe.dim === null) return null;\n if (argProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('dirac-delta');\n }\n return power(argProbe.dim, -1);\n }\n\n case 'variational-derivative': {\n // δF/δφ — functional derivative primitive (v0.14). From the defining\n // relation δF = ∫ (δF/δφ) δφ dμ we get [F] = [δF/δφ]·[φ]·[μ], so\n // [δF/δφ] = [F]/([φ]·[μ]) = divide(divide([F],[φ]),[μ]). `over` carries\n // the integration-measure dimension [dμ] whose one integration the\n // variational derivative undoes (the dual of `integral`, which MULTIPLIES\n // by [over]). Scalar operator: tensor children rejected by inferArgLocal.\n if (!node.functional || !node.field || !node.over) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `variational-derivative requires 'functional', 'field', and 'over' fields`,\n });\n return null;\n }\n const fnProbe = inferArgLocal(node.functional, ctx, 'functional');\n const phiProbe = inferArgLocal(node.field, ctx, 'field');\n const muProbe = inferArgLocal(node.over, ctx, 'over');\n if (fnProbe.dim === null || phiProbe.dim === null || muProbe.dim === null) {\n return null;\n }\n if (\n fnProbe.freeIndices.size > 0 ||\n phiProbe.freeIndices.size > 0 ||\n muProbe.freeIndices.size > 0\n ) {\n throw new TensorInScalarOpError('variational-derivative');\n }\n return divide(divide(fnProbe.dim, phiProbe.dim), muProbe.dim);\n }\n\n case 'transcendental': {\n if (!TRANSCENDENTAL_FNS.has(node.fn)) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `unknown transcendental function '${String(node.fn)}'; the functions are ${[...TRANSCENDENTAL_FNS].join(', ')}`,\n });\n return null;\n }\n // exp/ln/logₙ/sin/cos/tan/sinh/cosh/tanh of a DIMENSIONLESS argument is\n // DIMENSIONLESS (the function's Taylor series only sums across like\n // dimensions when its argument is dimensionless). A dimensionful argument\n // is a dimension violation; a tensor-valued argument is rejected (scalar\n // operator), mirroring dirac-delta.\n if (!node.arg) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `transcendental '${node.fn}' requires an 'arg' field`,\n });\n return null;\n }\n const argProbe = inferArgLocal(node.arg, ctx, 'arg');\n if (argProbe.dim === null) return null;\n if (argProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('transcendental');\n }\n if (!equals(argProbe.dim, DIMENSIONLESS)) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: argProbe.dim,\n note: `transcendental '${node.fn}' requires a dimensionless argument`,\n });\n return null;\n }\n return DIMENSIONLESS;\n }\n\n case 'abs': {\n // |x| is dimension-PRESERVING: [|x|] = [x]. Scalar operator (a tensor arg\n // is rejected, mirroring dirac-delta / transcendental).\n if (!node.arg) {\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `abs requires an 'arg' field`,\n });\n return null;\n }\n const argProbe = inferArgLocal(node.arg, ctx, 'arg');\n if (argProbe.dim === null) return null;\n if (argProbe.freeIndices.size > 0) {\n throw new TensorInScalarOpError('abs');\n }\n return argProbe.dim;\n }\n\n case 'tensor-symbol': {\n // Real validation per Part-VII §VII.4. Builds the free-indices map\n // from declared indices and merges into the context accumulator so\n // the root validate() call sees them in its ValidationResult.\n const { dim, freeIndices } = validateTensorSymbol(node);\n mergeFreeIndices(ctx.freeIndices, freeIndices);\n return dim;\n }\n\n case 'tensor-product': {\n // Task 6 — Einstein contraction. We delegate the algebra to the\n // pure `computeContraction(args, validateChild)` helper in tensor.ts\n // and inject `validateChild` to break the module cycle that would\n // otherwise arise from tensor.ts importing the validator.\n //\n // CRITICAL: every nested call uses *local* freeIndices maps; we never\n // mutate ctx.freeIndices from inside the recursion. Only the outer-\n // most tensor-product case merges its final residual map into the\n // shared ctx.freeIndices accumulator. This is what makes\n // (A·B)·C-style nested products correct: the inner product's dummy\n // indices stay scoped to the inner call.\n // Errors from the contraction (IndexLabelCollisionError,\n // VarianceMismatchError) are part of the public surface and propagate\n // so callers / tests can catch by type.\n const result = computeContraction(node.args, (child) =>\n resolveChildForContraction(child, ctx),\n );\n mergeFreeIndices(ctx.freeIndices, result.freeIndices);\n return result.dim;\n }\n\n case 'metric-tensor': {\n const { dim, freeIndices } = validateMetricTensor(node);\n mergeFreeIndices(ctx.freeIndices, freeIndices);\n return dim;\n }\n\n case 'kronecker-delta': {\n const { dim, freeIndices } = validateKroneckerDelta(node);\n mergeFreeIndices(ctx.freeIndices, freeIndices);\n return dim;\n }\n\n case 'tensor-partial-derivative': {\n const result = validatePartialDerivative(node, (child) =>\n resolveChildForPartialDerivative(child, ctx),\n );\n mergeFreeIndices(ctx.freeIndices, result.freeIndices);\n return result.dim;\n }\n\n case 'covariant-derivative': {\n // Same child kinds as a partial derivative, so it reuses that resolver.\n const result = validateCovariantDerivative(node, (child) =>\n resolveChildForPartialDerivative(child, ctx),\n );\n mergeFreeIndices(ctx.freeIndices, result.freeIndices);\n return result.dim;\n }\n\n // v0.6.1 Phase 2 Proposal 1 — the 11 curvature/GR-object arms\n // (riemann-tensor, ricci-tensor, einstein-tensor, bianchi-residual,\n // killing-vector, conserved-charge, stress-energy, cosmological-\n // constant, einstein-equation, weyl-tensor, kretschmann-scalar)\n // dispatch through a registry. The registry's discriminated-union\n // entry encodes three patterns (A/B/C) that capture the per-arm\n // callback-shape + freeIndices-propagate asymmetry; see\n // `validator-registry.ts` for the per-kind classification.\n case 'riemann-tensor':\n case 'ricci-tensor':\n case 'einstein-tensor':\n case 'bianchi-residual':\n case 'killing-vector':\n case 'conserved-charge':\n case 'stress-energy':\n case 'cosmological-constant':\n case 'einstein-equation':\n case 'weyl-tensor':\n case 'kretschmann-scalar': {\n const entry = lookupValidatorEntry(node.kind);\n if (!entry) {\n // Defensive: should be unreachable given the `case` labels\n // above match the registry's `RegistryKind` exactly.\n throw new Error(`validator: no registry entry for ${node.kind}`);\n }\n const result = dispatchValidator(entry, node);\n if (shouldPropagateFreeIndices(entry)) {\n mergeFreeIndices(ctx.freeIndices, result.freeIndices);\n }\n return result.dim;\n }\n\n default: {\n // Exhaustiveness guard: if a future ExprNode arm is added but not\n // handled here, this branch records a shape violation rather than\n // silently returning `undefined` (which validate() would coerce to\n // `ok: true, inferredDimension: undefined` — see silent-failure F1).\n const _exhaustive: never = node;\n void _exhaustive;\n const kind = (node as { kind?: unknown })?.kind;\n ctx.violations.push({\n location: ctx.path,\n expected: DIMENSIONLESS,\n actual: DIMENSIONLESS,\n note: `Validator: unknown ExprNode.kind ${JSON.stringify(kind)}`,\n });\n return null;\n }\n }\n}\n\n/**\n * A violation set passes iff it contains no error-severity violation.\n * Violations with `severity` absent default to 'error' (v0.3.5 §4).\n */\nfunction okFromViolations(violations: ReadonlyArray<Violation>): boolean {\n return !violations.some((v) => (v.severity ?? 'error') === 'error');\n}\n\n/**\n * A symbol whose name is a numeric literal equal to zero and whose dimension\n * is dimensionless. In a sum it is the additive identity and is skipped.\n * A \"0\" that carries a dimension is an ordinary term.\n */\nfunction isDimensionlessZeroLiteral(node: ExprNode | undefined): boolean {\n if (node === undefined || node.kind !== 'symbol' || node.name.trim() === '') return false;\n // A decimal literal zero only: `0x0`, `0b0` and a blank are not the written identity.\n if (!DECIMAL_LITERAL.test(node.name) || Number(node.name) !== 0) return false;\n const d = node.dim;\n return d.L === 0 && d.M === 0 && d.T === 0 && d.I === 0 && d.Theta === 0 && d.N === 0 && d.J === 0;\n}\n\n/**\n * Validate a single scalar/tensor `ExprNode`: infer its dimension and collect\n * any consistency violations. `ok` is true iff a dimension was inferred and no\n * error-severity violations were raised. The hot path for the whole suite.\n */\nexport function validate(expr: ExprNode): ValidationResult {\n const ctx: InferContext = { path: '', violations: [], freeIndices: new Map() };\n const dim = infer(expr, ctx);\n return {\n ok: okFromViolations(ctx.violations) && dim !== null,\n inferredDimension: dim,\n freeIndices: ctx.freeIndices,\n violations: ctx.violations,\n };\n}\n\n/**\n * Opt-in symbolic InverseMetricInconsistencyWarning check. Given a\n * lower/upper metric pair, returns a deduplicated (at most one) warning-\n * severity Violation set. v0.3.5 §7. (Deliberately not folded into\n * validate() — that is the hot path for the whole test suite.)\n */\nexport function validateInverseMetricPair(\n gLower: MetricTensorNode,\n gUpper: MetricTensorNode,\n): Violation[] {\n const note = checkInverseMetricStructure(gLower, gUpper);\n if (note === null) return [];\n return [{\n location: `${gLower.name}/${gUpper.name}`,\n expected: gLower.dim,\n actual: gUpper.dim,\n note,\n severity: 'warning',\n }];\n}\n\n/**\n * Validate an equation `lhs = rhs`: both sides must infer a dimension, the two\n * dimensions must match, and free-index valence must agree (so a tensor = scalar\n * is caught even when units match). Returns the combined `ValidationResult`.\n */\nexport function validateEquation(lhs: ExprNode, rhs: ExprNode): ValidationResult {\n const lhsCtx: InferContext = { path: 'lhs', violations: [], freeIndices: new Map() };\n const rhsCtx: InferContext = { path: 'rhs', violations: [], freeIndices: new Map() };\n const lhsDim = infer(lhs, lhsCtx);\n const rhsDim = infer(rhs, rhsCtx);\n const violations = [...lhsCtx.violations, ...rhsCtx.violations];\n\n if (lhsDim !== null && rhsDim !== null && !equals(lhsDim, rhsDim)) {\n violations.push({\n location: '<equation>',\n expected: lhsDim,\n actual: rhsDim,\n note: `LHS has ${format(lhsDim)} but RHS has ${format(rhsDim)} — equation is not dimensionally homogeneous.`,\n });\n }\n\n // Equation-level valence (free-index) homogeneity. Both sides of an\n // equation must carry the same free-index signature: a rank-2 tensor\n // cannot equal a scalar, nor A^mu equal B_mu, even when the SI dimensions\n // agree. Only checked when both sides inferred a dimension (a side that\n // already failed inference has reported its own violation). Scalar\n // equations have empty maps on both sides ⇒ no effect.\n if (\n lhsDim !== null &&\n rhsDim !== null &&\n !freeIndicesEqual(lhsCtx.freeIndices, rhsCtx.freeIndices)\n ) {\n violations.push({\n location: '<equation>',\n expected: lhsDim,\n actual: rhsDim,\n note:\n `LHS free indices ${formatFreeIndices(lhsCtx.freeIndices)} but RHS ` +\n `free indices ${formatFreeIndices(rhsCtx.freeIndices)} — equation is ` +\n `not valence-homogeneous (index/rank mismatch across '=').`,\n });\n }\n\n return {\n ok: okFromViolations(violations) && lhsDim !== null && rhsDim !== null,\n inferredDimension: lhsDim, // by convention, LHS dimension is the canonical answer\n // By convention LHS free-indices map is the canonical answer (mirrors\n // inferredDimension's LHS bias).\n freeIndices: lhsCtx.freeIndices,\n violations,\n };\n}\n"]}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,qEAAqE;AACrE,2EAA2E;AAC3E,6EAA6E;AAC7E,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK;AACL,iEAAiE;AACjE,QAAQ;AACR,kDAAkD;AAClD,SAAS;AACT,sDAAsD;AACtD,MAAM;AACN,4DAA4D;AAC5D,SAAS,GACV,MAAM,qBAAqB,CAAC;AAY7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAcpD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AAWtC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACL,aAAa,EACb,8BAA8B,EA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B,GAClB,MAAM,6BAA6B,CAAC;AAGrC,6EAA6E;AAC7E,4EAA4E;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,+EAA+E;AAC/E,yEAAyE;AACzE,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * Universal Physics Tensor Framework\n *\n * Computational framework for exploring unified physics through tensor formalism\n *\n * @packageDocumentation\n */\n\nexport { UniversalTensor } from './core/tensor.js';\n// v0.5.1 — canonical flat CODATA 2022 / SI-defined constants (PC-1).\n// Single source of truth across numerical, dimensional, and bridge layers.\n// See src/core/constants.ts and docs/planning/v0.5.1-Implementation-Plan.md.\nexport {\n C_SI,\n G_SI,\n H_SI,\n HBAR_SI,\n K_B_SI,\n E_SI,\n ALPHA,\n M_P_SI,\n L_P_SI,\n T_P_SI,\n H0_SI,\n // v0.8.0 punch-list — promoted from the calibration-edges module\n M_SUN_SI,\n // IAU 2015 nominal solar GM. Not G_SI * M_SUN_SI.\n GM_SUN_SI,\n // v0.11 — electron mass (namespacing criterion-3 pin)\n M_E_SI,\n // canonical registry — Wien displacement constant (CE-wien)\n B_WIEN_SI,\n} from './core/constants.js';\nexport type {\n TensorConfig,\n TensorIndices,\n PhysicalLaw,\n BridgeEquation,\n EmergentPhenomenon,\n PhysicalScale,\n Force,\n Symmetry,\n InformationMeasure,\n} from './core/types.js';\nexport { PhysicalConstants } from './core/types.js';\n\n// v0.7 Proposal 3 — Typed `Cell` discriminated union (storage-layer\n// surface). `PhysicalLaw` / `BridgeEquation` / `EmergentPhenomenon`\n// above remain the legacy surface (consumers haven't migrated yet);\n// the new `Cell` union is the preferred forward-looking shape.\nexport type {\n Cell,\n CellBase,\n CellConfidence,\n LawCell,\n BridgeCell,\n EmergenceCell,\n} from './core/cell.js';\nexport { compose } from './core/tensor.js';\n\n// v0.7 Proposal 2 — Sparse semantic catalog (flux rules + adapter).\n// Per Decision #9, only the consumer-facing types are re-exported;\n// FluxRule / FluxRuleKind / FluxRuleResult stay @internal.\nexport type {\n FluxDiagnostic,\n FluxReport,\n} from './core/flux-rules.js';\nexport { FluxViolationError } from './core/flux-rules.js';\nexport type {\n CatalogEntryStatus,\n CatalogIngestionReport,\n} from './bridges/catalog-adapter.js';\nexport {\n catalogToCells,\n scanCatalog,\n ingestCatalog,\n ingestionReportToFluxReport,\n CatalogIngestionError,\n} from './bridges/catalog-adapter.js';\n\n// v0.7 Proposal 1 — Intelligent Index layer (UniversalIndex + Axes\n// + LabeledTensor wrapper). Per Decision #10, 10 public symbols.\n// MergedLabels<L,R> and canonicalLabelOrder stay @internal.\nexport type {\n AxisName,\n UniversalIndex,\n UniversalIndexId,\n MakeIndexOptions,\n} from './core/universal-index.js';\nexport { makeIndex } from './core/universal-index.js';\nexport type { AxesRegistry } from './core/axes-registry.js';\nexport { Axes } from './core/axes-registry.js';\nexport {\n LabeledTensor,\n LabeledTensorConstructionError,\n AxisMismatchError,\n IdentityConflictError,\n IndexNameMismatchError,\n RankPreservationError,\n AxisOrderError,\n AxisMergeError,\n AxisSplitError,\n} from './core/labeled-tensor.js';\n\n// v0.8 Proposal 5 — RegimeType extension system: the mechanism, with the 18\n// v0.6-shipped values pre-registered. No further built-in regime is added\n// (owner ruling of 2026-10-09, NOTES.md); a new regime is registered through\n// this mechanism by its caller.\nexport type {\n RegimeProvenance,\n RegimeValueBase,\n RegimeSpec,\n} from './core/regime-registry.js';\nexport {\n defineRegime,\n defineScale,\n defineForce,\n defineSymmetry,\n defineInformation,\n defineDimension,\n defineTopology,\n lookupRegime,\n listRegimesByAxis,\n provenanceFor,\n attachRegimesToCell,\n getCellRegimes,\n RegimeCollisionError,\n} from './core/regime-registry.js';\n// Phase 4 wiring side-effect: installs the regime-consistency rule.\nimport './core/regime-rule-install.js';\n// Phase 2 side-effect: pre-registers the 18 built-in regimes.\nimport './core/regimes-builtins.js';\n\n// v0.9 Proposal 8 — Bridge Parameter Differentiation (P8 Decision #1: lives\n// in src/diff/, doesn't touch src/bridges/). `bridgeGradientNumerical` is\n// central finite differences over a spec, engine-free. Engine AD of a spec\n// is unreachable by construction (`evaluate` returns a number, which carries\n// no tape); the exact AD path is `bridgeGradientAST` over the symbolic RHS.\nexport type { BridgeDiffSpec, BridgeNumericalGradientResult } from './diff/bridge-gradient.js';\nexport { bridgeGradientNumerical } from './diff/bridge-gradient.js';\n// Exact bridge gradients via reverse-mode AD over the symbolic RHS AST\n// (traced lowering through mathts-autograd; faithful encodings only).\nexport type { ASTGradientResult } from './diff/bridge-ast-gradient.js';\nexport {\n bridgeGradientAST,\n bridgeGradientASTById,\n astDifferentiableBridgeIds,\n} from './diff/bridge-ast-gradient.js';\n/** Differentiable relations: Shapiro delay, perihelion advance, Hawking temperature, and the decoherence rate. */\nexport {\n SHAPIRO_DELAY_DIFF,\n PERIHELION_ADVANCE_DIFF,\n HAWKING_TEMPERATURE_DIFF,\n DECOHERENCE_RATE_DIFF,\n DIFFERENTIABLE_RELATIONS,\n} from './diff/bridge-specs.js';\n\n// The catalog rows of `data/bridge-catalog.json`, in id order.\n// `BridgeEquationEntry` is a different shape from the runtime `BridgeEquation`\n// interface above: the entry is the catalog's record of an equation (status,\n// known issues, references, dependencies), while `BridgeEquation` describes a\n// runtime bridge between two tensor regimes.\nexport { BRIDGE_EQUATIONS } from './bridges/index.js';\n/** Request a caller-table confrontation. The catalog status does not change. */\nexport {\n requestCallerTableConfrontation,\n} from './bridges/caller-table.js';\n/** Types of a caller-table request and of its refusal or hit. */\nexport type {\n MeasuredCouplingRow,\n RunningProcedureRecord,\n RunningProcedure,\n CallerTableRequest,\n CallerTableRefusal,\n CallerTableHit,\n CallerTableResult,\n} from './bridges/caller-table.js';\nexport type {\n BridgeEquationEntry,\n BridgeEquationStatus,\n BridgeIssueSeverity,\n BridgeIssueFixable,\n KnownIssue,\n} from './bridges/index.js';\n\n/**\n * Constants that stay on the package root, and `CarrierSignError`.\n * Per-bridge evaluate functions are not on this root.\n */\nexport {\n VON_KLITZING_SI,\n JOSEPHSON_CONSTANT_SI,\n LORENZ_NUMBER_SI,\n BCS_GAP_RATIO,\n LANE_EMDEN_OMEGA3,\n THOMSON_CROSS_SECTION_SI,\n M_PROTON_SI,\n CarrierSignError,\n} from './bridges/index.js';\n/**\n * One evaluation of a catalog id or a canonical id.\n * A sourced number is `kind: 'value'`. An unset coefficient is `kind: 'unset'`.\n * @public\n */\nexport { evaluateRelation, CoefficientUnsetError } from './composition/index.js';\n/** The input errors {@link evaluateRelation} throws before any domain check; a domain failure is `DomainViolationError`. */\nexport {\n DuplicateInputError,\n InputTypeError,\n MissingInputError,\n NonFiniteInputError,\n UnknownInputError,\n} from './composition/index.js';\n/** A caller input that names a registered constant (`G`, `k_B`, `m_p`, …) is refused on every evaluation path. */\nexport { ConstantInputError } from './bridges/index.js';\n/** The result of {@link evaluateRelation}. A value carries a public `Dimension`. */\nexport type { Evaluation, ExtraOutput } from './composition/index.js';\n\nexport type { EvaluatorSpec, EvaluatorParameter, ParameterAlternate, GeometryRole } from './bridges/evaluators.js';\n/** An extra output an `EvaluatorSpec` returns beside its `value`. */\nexport type { CatalogEvaluatorOutput } from './bridges/catalog-types.js';\n/** The input contract an evaluator's `run` checks before the domain, and what a caller asks `run` for. */\nexport type { ContractAlternate, EvaluationWant, InputContract, InputSlot } from './bridges/input-contract.js';\n/** Build an input contract; throws when one spelling or alternate would bind two slots. */\nexport { inputContract } from './bridges/input-contract.js';\n\n// v0.4.0 connection layer — Christoffel formula builder and covariant derivative\n// AST node type. `christoffel` is public because bridge modules and downstream\n// callers compose Γ trees directly; `CovariantDerivativeNode` is the structural\n// type for the new ∇_μ AST kind.\nexport { christoffel } from './dimensional/connection.js';\n// CovariantDerivativeNode is re-exported from validator.ts (which holds the union);\n// importing from there avoids creating a separate source-of-truth.\nexport type { CovariantDerivativeNode } from './dimensional/validator.js';\n\n// v0.5.0 curvature layer — Ricci tensor helper (Task 7). `ricci(R)` wraps a\n// RiemannTensorNode and produces the contracted R_μν = R^λ_{λμν} as a\n// composite ExprNode (own validator + lowering arms).\nexport { ricci } from './dimensional/curvature.js';\nexport type { RicciTensorNode } from './dimensional/validator.js';\n\n// v0.5.0 curvature layer — Einstein tensor helper (Task 8). `einstein(R, g,\n// gInverse)` wraps a RiemannTensorNode + metric pair and produces the\n// composite G_μν = R_μν − ½ R g_μν as an ExprNode (own validator +\n// lowering arms — no AST rewrite). The matter-coupled field-equation node\n// `G_μν = κ T_μν` exists (`EinsteinFieldEquationNode`, validated in\n// dimensional/validator.ts); its numerical lowering is still deferred: the\n// lowering layer refuses a deferred node kind with `NumericalBackendError`\n// and names the evaluator to use instead (numerical/lowering.ts).\nexport { einstein } from './dimensional/curvature.js';\nexport type { EinsteinTensorNode } from './dimensional/validator.js';\n\n// v0.5.0 curvature layer — Bianchi residual helper (Task 9). `bianchiResidual(R)`\n// returns {residual, evaluate, evaluateMax} for the cyclic second-Bianchi-identity\n// check ∇_{[λ} R_{μν]ρσ} = 0. The evaluator lives in numerical so curvature.ts\n// does not import it. Closes Phase 1 — Foundations.\nexport { bianchiResidual } from './numerical/bianchi-residual.js';\nexport type { BianchiResidualNode } from './dimensional/validator.js';\n\n// v0.6.0 Phase 1 — Killing-vector machinery (Task 1.3).\n// `verifyKillingEquation` checks the Killing equation ∇_μ ξ_ν + ∇_ν ξ_μ = 0\n// numerically at a point using a hybrid impl (exact Christoffels + analytic\n// metric derivatives). `evaluateConservedCharge` evaluates Q = ξ^μ p_μ along\n// a geodesic. `ChristoffelAccess` is the layout-agnostic Christoffel accessor\n// type that insulates consumers from the Phase 2 BR-2 flat-layout migration.\nexport {\n verifyKillingEquation,\n checkKillingEquation,\n evaluateConservedCharge,\n} from './numerical/killing.js';\nexport type {\n KillingEquationOptions,\n KillingEquationCheck,\n ChristoffelAccess,\n} from './numerical/killing.js';\n\n// v0.4.0 geodesic integrator (RK4 solver — headline feature of v0.4.0)\nexport {\n integrateGeodesic,\n type GeodesicIntegratorInputs,\n type GeodesicIntegratorResult,\n} from './numerical/geodesic-integrator.js';\n\n// v0.14 G-9 increment 2 — geometrized-units boundary adapters. Convert a scalar\n// between SI and geometrized (G = c = 1) units, driven by its `Dimension`\n// exponent vector (factor G^M·c^(T−2M)). For consumers running the GR pipeline\n// in geometrized units; the default-pipeline migration is a later increment.\nexport {\n toGeometrized,\n fromGeometrized,\n geometrizedFactor,\n NonGeometrizableDimensionError,\n} from './numerical/geometrized.js';\n\n// v0.7.1 M-1 — Surface restoration: five v0.7 dimensional primitives were\n// @public-tagged during the BE-X re-encoding sprint but absent from this\n// manifest. Re-exported here per Phase 1 Task 1.2 (Decision #2 guard).\n// Mirrors the v0.6.0 EinsteinFieldEquationNode / KretschmannScalarNode /\n// RicciTensorNode pattern — predicate-node types + validators are @public.\nexport type {\n TracableTensorNode,\n TensorTraceNode,\n TensorTraceValidationResult,\n TensorTraceOptions,\n} from './dimensional/tensor-trace.js';\nexport { validateTensorTrace } from './dimensional/tensor-trace.js';\n\nexport type {\n FriedmannVariant,\n FriedmannEquationNode,\n FriedmannEquationValidationResult,\n} from './dimensional/friedmann-equation.js';\nexport { validateFriedmannEquation } from './dimensional/friedmann-equation.js';\n\nexport type {\n RGCouplingNode,\n BetaFunctionNode,\n BetaFunctionValidationResult,\n} from './dimensional/rg-flow.js';\nexport { rgCoupling, validateRGCoupling, validateBetaFunction } from './dimensional/rg-flow.js';\n\nexport type {\n ArrowOfTime,\n GaugeFieldNode,\n TimeSymmetryPredicateNode,\n TimeSymmetryPredicateValidationResult,\n} from './dimensional/gauge-field.js';\nexport { validateGaugeField, validateTimeSymmetryPredicate } from './dimensional/gauge-field.js';\n\nexport type {\n ScalarFieldNode,\n KleinGordonEquationNode,\n KleinGordonEquationValidationResult,\n} from './dimensional/klein-gordon-equation.js';\nexport { validateKleinGordonEquation } from './dimensional/klein-gordon-equation.js';\n\n// Dimensional analyzer (Tier 4) — SI dimension propagation through bridge\n// equations expressed as ExprNode trees. See src/dimensional/README.md.\n// Every symbol re-exported in this block is `@public` — the consumer-facing\n// dimensional/metric surface (stabilised in v0.3.0).\nexport type { Dimension } from './dimensional/types.js';\n/** The one unit reader: parse a unit, convert a value exactly, and the typed errors it throws. */\nexport {\n AmbiguousUnitError,\n convertValue,\n parseUnit,\n UnitError,\n UnitRefusedError,\n UnknownUnitError,\n} from './dimensional/units.js';\n/** A parsed unit, a converted value, and how a temperature is read. */\nexport type { AffineTemperature, ConvertedValue, ParsedUnit, TemperatureReading } from './dimensional/units.js';\nexport {\n DIMENSIONLESS,\n LENGTH,\n AREA,\n TIME,\n FREQUENCY,\n MASS,\n VELOCITY,\n ACCELERATION,\n FORCE,\n ENERGY,\n POWER,\n ACTION,\n TEMPERATURE,\n ENTROPY,\n CHARGE,\n} from './dimensional/types.js';\nexport {\n multiply,\n divide,\n power,\n add,\n subtract,\n equals,\n format,\n DimensionMismatchError,\n} from './dimensional/algebra.js';\nexport type { ExprNode, TranscendentalFn, ValidationResult, Violation } from './dimensional/validator.js';\nexport { validate, validateEquation, validateInverseMetricPair } from './dimensional/validator.js';\nexport { inferDimensionForBridge } from './dimensional/bridge-check.js';\n\n// v0.6.0 Phase 2 Task 2.4 — Einstein-equation numerical evaluator.\n// `evaluateEinsteinEquationResidual` computes the scale-normalized max residual\n// |G_μν + Λ g_μν − κ T_μν| / |g_μν| at a coordinate point. Accepts metric\n// closures + stress-energy closure; returns a dimensionless relative residual.\n// For Schwarzschild vacuum (T=0, Λ=0) the residual is the FD truncation floor\n// (~1e-10 relative at 4th-order stencil accuracy).\nexport {\n evaluateEinsteinEquationResidual,\n} from './numerical/einstein-equation.js';\nexport type {\n EinsteinEquationResidualInput,\n MetricClosure,\n Vec4,\n} from './numerical/einstein-equation.js';\n\n// v0.6.0 Phase 2 Task 2.3 — EinsteinFieldEquationNode predicate AST + validator.\n// Represents G_μν + Λ g_μν = (8πG/c⁴) T_μν as a structurally-validated AST node.\n// Validator checks: free-index agreement, per-component dim equality [L⁻²],\n// and symmetry agreement (Decision #3 + #11).\nexport { validateEinsteinFieldEquation } from './dimensional/einstein-equation.js';\nexport type {\n EinsteinFieldEquationNode,\n EinsteinFieldEquationValidationResult,\n} from './dimensional/einstein-equation.js';\n\n// v0.6.0 Phase 3 Task 3.5 — KretschmannScalarNode AST + validator.\n// K = R_{ρσμν} R^{ρσμν} is the canonical curvature invariant; scalar (rank-0),\n// dim [L⁻⁴]. Diverges at genuine singularities; finite at coordinate ones.\nexport type {\n KretschmannScalarNode,\n KretschmannScalarValidationResult,\n} from './dimensional/curvature-invariants.js';\nexport { validateKretschmannScalar } from './dimensional/curvature-invariants.js';\n\n// v0.6.0 Phase 3 Task 3.6 — Kretschmann scalar numerical contraction.\n// O(4⁸) = 65536 multiplications per call — diagnostic/sample-point use only.\nexport { computeKretschmann } from './numerical/kretschmann.js';\n\n// Numerical-contraction backend (v0.3.5+). See docs/planning/v0.3.5-Design.md\n// and docs/planning/v0.4.0-Implementation-Plan.md (v0.4.0 additions below).\n// Every symbol below is `@public` — the consumer-facing (TensorJS) surface.\n// `MathTSEngine` is intentionally NOT re-exported here. It is reachable only\n// via the `universal-physics-tensor/numerical/mathts-engine` subpath. The\n// MathTS packages are required dependencies.\n/** Numerical evaluation, the covariant eikonal integrator, the GL4 geodesic integrator, and the perihelion finder. */\nexport {\n evaluateNumerical,\n evaluateNumericalRaw,\n evaluateMetricInverse,\n getActiveEngine,\n setActiveEngine,\n NumericalBackendError,\n // v0.4.0 additions to the numerical surface\n DuplicateCoordinateWarning,\n EngineCapabilityError,\n hasAutogradSupport,\n evaluateCovariantEikonalNumerical,\n // v0.5.0 GL4 symplectic integrator\n integrateGeodesicGL4,\n // v0.5.0 perihelion finder (Task 4)\n findPerihelion,\n} from './numerical/index.js';\n/** Types for numerical evaluation, gradients, the GL4 integrator, the perihelion finder, and the covariant eikonal. */\nexport type {\n NumericalResult,\n NumericalRawResult,\n EvaluateOptions,\n NumericalInputs,\n TensorEngine,\n EngineTensor,\n EinsumSpec,\n NestedArray,\n GridField,\n // v0.4.0 type additions\n ForwardGradResult,\n ReverseGradResult,\n // v0.5.0 GL4 type additions\n GL4State,\n GL4Snapshot,\n GL4Options,\n // v0.5.0 perihelion-finder type additions (Task 4)\n PerihelionResult,\n FindPerihelionOptions,\n CovariantEikonalInputs,\n CovariantEikonalResult,\n} from './numerical/index.js';\n\n// ---------------------------------------------------------------------------\n// v0.8.0 — Composition graph (graph-lite Quantity/BridgeEdge/composeEdges\n// beside the catalog; see docs/planning/v0.8.0-Design.md). The operator is\n// `composeEdges`, NOT `compose` — `compose` is the v0.7 Cell factory above.\n// ---------------------------------------------------------------------------\nexport {\n composeEdges,\n consistencyRatio,\n evaluateEdge,\n minConfidence,\n regimesDiffer,\n QUANTITY_IDENTIFICATIONS,\n CompositionDimensionError,\n CompositionJunctionError,\n DomainViolationError,\n // Calibration edges (pre-registered CT-1/CT-1b/CT-2/CT-3 targets)\n M_SUN_KG,\n} from './composition/index.js';\nexport type {\n BridgeEdge,\n ComposeOptions,\n EdgeConfidence,\n Quantity,\n QuantityIdentification,\n RegimeAttributes,\n ValidityDomain,\n} from './composition/index.js';\n/** A validity domain built from one condition text: the predicate, the description and the refusal all read it. */\nexport { validityDomain } from './composition/index.js';\n/** A failed validity condition and the inputs it read, as `DomainViolationError.violations` lists them. */\nexport type { DomainInput, DomainViolation } from './composition/index.js';\n\n// v0.8.0 — Bridge-membership criterion + negative catalog (G-2 / P-4)\nexport { adjudicateBridgeEntry, adjudicateCatalog } from './bridges/membership.js';\nexport { REJECTED_BRIDGE_ADJUDICATIONS, REJECTED_BRIDGE_IDS } from './bridges/rejected.js';\nexport type { BridgeVerdict, CatalogAdjudicationReport } from './bridges/membership.js';\nexport type { RejectedBridgeAdjudication } from './bridges/rejected.js';\n\n// v0.8.0 — GW170817 → BE-36 real-data confrontation (G-3)\n\n// v0.28+ — Mercury perihelion → BE-52 real-data confrontation (established bridge)\n\n// v0.10.0 — Phase-D enumeration + uncertainty propagation (T3/T4)\nexport {\n enumerateCompositions,\n REGISTERED_COMPOSITION_IDS,\n propagateUncertainty,\n} from './composition/index.js';\nexport type {\n CompositionCandidate,\n EnumerationReport,\n UncertaintyResult,\n} from './composition/index.js';\n\n// Identifiability classifier (structural over/exactly/under-determined\n// over the composition graph — Consequence 1 of the bridge-inference\n// epistemics note)\n/** The forward closure, the per-target classifier, the sweep, and the log-space rank over the monomial edges. */\nexport {\n classifyIdentifiability,\n classifyAll,\n forwardClosure,\n identifiabilityByRank,\n} from './composition/index.js';\n/** The classifier's verdict, result and option types, and the rank instrument's report. */\nexport type {\n IdentifiabilityVerdict,\n IdentifiabilityResult,\n IdentifiabilityOptions,\n RankIdentifiability,\n} from './composition/index.js';\n\n// Retrodiction harness (the framework's own falsification benchmark —\n// Consequence 2 of the bridge-inference epistemics note)\nexport { retrodict, retrodictNode } from './composition/index.js';\n/** The retrodiction harness's result, prediction, refusal, report and option types. */\nexport type {\n RetrodictionOutcome,\n RetrodictionPrediction,\n RetrodictionResult,\n RetrodictionRefusal,\n RetrodictionReport,\n RetrodictionOptions,\n} from './composition/index.js';\n\n// Unified \"explain this quantity\" entry point over the three inference\n// primitives (identifiability + retrodiction + Buckingham-π)\nexport { explainQuantity } from './composition/index.js';\nexport type {\n DerivationExplanation,\n ExplainOptions,\n QuantityExplanation,\n} from './composition/index.js';\n\n// v0.12 — symbolic bridge composition (the Observable contract). Composes\n// bridges' symbolic ExprNode forms (not just numeric closures), dimensionally\n// validated and numerically evaluable.\nexport { composeSymbolic, SymbolicCompositionError, SymbolicEvalError } from './composition/index.js';\nexport type { Observable, ComposeSymbolicOptions } from './composition/index.js';\n\n// Physics-map visualization — render the bipartite, clustered hypergraph\n// (quantities = nodes, equations = junctions) as Mermaid / Graphviz-DOT source.\nexport { buildVizModel, edgeToJunction } from './composition/index.js';\nexport type {\n VizStatus,\n VizJunction,\n VizCluster,\n VizOptions,\n VizModel,\n VizFilterStats,\n} from './composition/index.js';\n// SVG rendering via the optional @viz-js/viz peer (separate module so the\n// graph-viz model stays pure/synchronous/dependency-free).\nexport { renderDotToSvg, SvgRendererUnavailableError } from './composition/index.js';\n\n// User-equation injection — parse a free-form \"TARGET = EXPR\" and place it into\n// the map as a connected 'user' junction (with a \"did you mean?\" hint).\nexport {\n parseUserEquation,\n suggestQuantities,\n suggestByDimension,\n equationLanding,\n analyzeUserEquation,\n UserEquationError,\n} from './composition/index.js';\n/** The catalog or parameter name a spelling means. One owner for a target and an input. */\nexport { resolveQuantityName } from './composition/index.js';\nexport type { UserEquation, EquationLanding, EquationAnalysis, EquationHint } from './composition/index.js';\n\n// Phase 1 — string → dimensional ExprNode parser + single-unknown dimensional\n// inference (the front-end to the physics AST).\nexport { parsePhysics } from './numerical/formula-registry.js';\nexport { FormulaDimensionError } from './numerical/formula-dimension.js';\nexport type { ParsedPhysics } from './numerical/formula-dimension.js';\nexport { inferUnknownDimension, substituteSymbolDim } from './dimensional/dimension-inference.js';\n// Dimension-adjacency review surface (name-divergent but same-dimension quantities).\nexport { dimensionAdjacency } from './composition/index.js';\nexport type { DimensionAdjacency } from './composition/index.js';\n\n\n// Buckingham-π enumerator (the principled primitive for the exactly-\n// determined case — build target 1 of the bridge-inference epistemics\n// note; FORM only, never the dimensionless constant)\nexport {\n buckinghamPi,\n dimensionallyDetermines,\n RationalizationError,\n} from './dimensional/buckingham.js';\nexport type {\n DimensionalVariable,\n PiGroup,\n BuckinghamVerdict,\n BuckinghamResult,\n DimensionalDeterminationResult,\n} from './dimensional/buckingham.js';\n\n// v0.11 — namespacing gate (Option D: name-collision rule + dispositions)\nexport {\n CompositionAliasError,\n SOURCE_ALIAS_DISPOSITIONS,\n} from './composition/compose-surface.js';\nexport type {\n AliasDisposition,\n DispositionRequired,\n} from './composition/compose-surface.js';\n\n// v0.11 — Klein-Gordon dispersion evaluator (G-7 closure, plane-wave sector)\nexport {\n evaluateKGDispersionResidual,\n verifyKleinGordonPlaneWave,\n} from './numerical/klein-gordon.js';\nexport type {\n KGDispersionResidualInput,\n KGPlaneWaveVerifyInput,\n KGPlaneWaveVerifyResult,\n} from './numerical/klein-gordon.js';\n\n// v0.11 — BE-23 Planckian-dissipation data confrontation (2nd real-data check)\n\n// The composition graph is the relation projection of the catalog.\nexport { CATALOG_GRAPH } from './composition/index.js';\n\n// The standard-physics counterpart: the canonical L-layer projected into the\n// composition-graph edge vocabulary, so the discovery/analysis funnel can run\n// on textbook physics ALONE (bridges excluded). See `composition/canonical-graph`.\nexport {\n CANONICAL_GRAPH,\n canonicalToEdges,\n CANONICAL_CONSTANTS,\n} from './composition/index.js';\n\n// ── Canonical-equation registry (the L-layer ground truth) ──────────────────\n// Textbook physics equations bridges are validated against. Multi-fidelity\n// (L0 dimensional / L1 scalar-AST / L2 field-equation) with epistemic-honesty\n// and provenance fields. See docs/planning/Canonical-Equation-Registry-A-*.\nexport {\n CANONICAL_EQUATIONS,\n CANONICAL_BY_ID,\n canonicalById,\n canonicalByDomain,\n partneredBridgeIds,\n bridgesWithoutCanonicalPartner,\n} from './canonical/registry.js';\nexport {\n canonicalToLaw,\n seedCanonicalLaws,\n CANONICAL_TENSOR_CONFIG,\n} from './canonical/seed-l-layer.js';\nexport type {\n CanonicalEquation,\n CanonicalDomain,\n EpistemicStatus,\n CanonicalForms,\n FieldEquationNode,\n} from './canonical/canonical-equation.js';\n// Sub-project B — bridge↔canonical linkage (validate vs standard physics).\n// `normalForm` is the structural hash up to dimensionless factors;\n// `classifyLinkage`/`scanLinkages` recover/contain bridges against canonicals\n// with the F4 circularity guard (`restates-canonical` vs genuine `recovers`).\nexport { normalForm, structurallyEqual } from './canonical/normal-form.js';\nexport { classifyLinkage, scanLinkages } from './canonical/linkage.js';\nexport type { LinkageResult, RecoveryOutcome } from './canonical/linkage.js';\n\n// Adjudication ledger — human verdicts on discovery-funnel identification\n// hypotheses (review memory the funnel must not re-surface as fresh).\n// Precedent: SOURCE_ALIAS_DISPOSITIONS/AliasDisposition above is the repo's\n// other reviewable judgment registry, and is index-exported the same way.\nexport {\n candidateId,\n ADJUDICATIONS,\n adjudicationFor,\n annotateAdjudications,\n} from './composition/adjudication.js';\nexport type { AnnotatedCandidate } from './composition/adjudication.js';\n/** The adjudication ledger's verdict and record types, exported from their owner, the catalog file's types. */\nexport type { AdjudicationVerdict, CatalogAdjudication } from './bridges/catalog-types.js';\n\n// Consequence propagation — the machine pre-classifier for the human\n// adjudication ledger. Annotates discovery candidates with the\n// entailed/novel-consequence/inconclusive signal; never mutates the\n// catalog/graph, never re-orders or re-scores.\nexport { annotateConsequences, classifyProposal } from './composition/consequence.js';\nexport type {\n ConsequenceAnnotatedCandidate,\n ConsequenceSignal,\n ConsequenceEvidence,\n} from './composition/consequence.js';\n\n// Epistemic-grounding ledger (PI-instrument Phase 1). A pure, derived view over\n// a candidate's falsifier results: which gates passed vs abstained, plus the\n// honest no-mechanism/no-data ceiling. Annotation-only; changes no verdict.\nexport { describeGrounding } from './composition/grounding.js';\nexport type { CandidateGrounding } from './composition/grounding.js';\n\n// Discovery funnel — vet link-candidate identifications against the inference\n// suite (Direction 2). rankDiscoveries is the entry point; VettedCandidate is\n// the output type. Required to feed annotateAdjudications from the public API.\nexport { rankDiscoveries } from './composition/discovery.js';\nexport type { VettedCandidate } from './composition/discovery.js';\n\n// v0.33.0 — `upt confront` real-data confrontation subsystem: typed\n// observations + a normalized ConfrontationOutcome (discriminated on `kind`)\n// wrap the per-bridge confrontation modules (be-23/36/37/48/52) behind one\n// registry, plus deciding-measurement elasticity for value-kind entries.\nexport {\n residualInSigma,\n combineInQuadrature,\n consistencyComparison,\n} from './bridges/observations/types.js';\nexport type {\n ConsistencyComparison,\n ObservationProvenance,\n SigmaComponent,\n ObservationKind,\n ConfrontationOutcome,\n ConfrontationDataHandling,\n ConfrontationPreprocessing,\n ConfrontationIndependence,\n SourceRef,\n SourceRefs,\n} from './bridges/observations/types.js';\n\n// BE-53 — one-loop coefficient, and a confrontation only when the caller supplies both inputs.\nexport { oneLoopCoefficientStatement } from './bridges/coefficient-statement.js';\nexport type { OneLoopCoefficientStatement, OneLoopCoefficientSign } from './bridges/coefficient-statement.js';\n\n// The confrontation registry: every committed confrontation of\n// `data/bridge-catalog.json`, the single lookup surface for `upt confront`.\nexport {\n CONFRONTATIONS,\n listConfrontations,\n runConfrontation,\n // Rigor hierarchy of the evidence spine (2026-07-05) — stringent/moderate/loose.\n CONFRONTATION_RIGOR,\n confrontationRigor,\n rigorDistribution,\n} from './bridges/confrontations.js';\nexport type { ConfrontationEntry, RigorTier } from './bridges/confrontations.js';\n\n// Deciding-measurement elasticity — which input a value-kind confrontation's\n// prediction depends on most strongly (central-difference log-sensitivity).\nexport { decidingMeasurement } from './bridges/sensitivity.js';\nexport type { Elasticity } from './bridges/sensitivity.js';\n\n// The PUBLIC atlas surface as a namespace (Atlas API review, Tier 1). The full\n// @internal surface stays on the universal-physics-tensor/atlas subpath.\nexport * as atlas from './atlas/public.js';\n\n// ---------------------------------------------------------------------------\n// Closure under type references (tests/api/root-public-closure.test.ts).\n// Every type a root export names is itself importable from the root or from\n// a package.json subpath; the names below were reachable only through the\n// public declarations that mention them.\n// ---------------------------------------------------------------------------\n/** The base class of every error this package throws. */\nexport type { UPTError } from './dimensional/errors.js';\n/** Which constants a natural-unit evaluation sets to one. */\nexport type { UnitMode } from './dimensional/natural-units.js';\n/** The tensor and curvature node family of the dimensional AST. */\nexport type {\n Variance,\n Role,\n TensorIndex,\n UpperIndex,\n CovariantIndex,\n TensorSymbolNode,\n TensorProductNode,\n MetricTensorNode,\n KroneckerDeltaNode,\n TensorPartialDerivativeNode,\n RiemannTensorNode,\n WeylTensorNode,\n KillingVectorNode,\n ConservedChargeNode,\n StressEnergyTensorNode,\n CosmologicalConstantNode,\n} from './dimensional/ast-types.js';\n/** The generic shape the curvature node types instantiate, and its kind union (referenced by the exported node types). */\nexport type { CurvatureCompositeNode, CurvatureKind } from './dimensional/curvature-composite.js';\n/** The kind of a flux rule. */\nexport type { FluxRuleKind } from './core/flux-rules.js';\n/** The per-axis value tables of the core axis registry. */\nexport type { ScaleAxes, ForceAxes, SymmetryAxes, InformationAxes } from './core/axes-registry.js';\n/** The convenience form a regime registration accepts for an axis. */\nexport type { AxisConvenience } from './core/regime-registry.js';\n/** The named inputs of the four bridge differentiation specs. */\nexport type { ShapiroInput, PerihelionInput, HawkingInput, DecoherenceInput } from './diff/bridge-specs.js';\n/** The contraction and free-axis records an einsum plan is made of. */\nexport type { EinsumContraction, EinsumFreeAxis } from './numerical/tensor-engine.js';\n/** The callbacks a Killing-equation check takes: the vector field, the metric and the connection. */\nexport type { KillingFn, KillingMetricFn, ChristoffelAtFn } from './numerical/killing.js';\n/** A relation's input contract and the sign and unit conventions it states. */\nexport type { RelationContract, Conventions } from './relations/types.js';\n/** The classification axes of the composition registry. */\nexport type {\n ScaleAxis,\n ForceAxis,\n InformationAxis,\n SymmetryAxis,\n TopologyAxis,\n StatisticsAxis,\n} from './composition/axes.js';\n/** Options of the chain enumerator. */\nexport type { EnumerationOptions } from './composition/enumerate.js';\n/** Options of the uncertainty propagation. */\nexport type { UncertaintyOptions } from './composition/uncertainty.js';\n/** Options of a user-equation analysis and the short form of a binding. */\nexport type { AnalyzeUserEquationOptions, ShortBinding } from './composition/user-equation.js';\n/** A constant as the canonical graph declares it. */\nexport type { ConstantDef } from './composition/canonical-graph.js';\n/** An identity consequence the surfacer proposes; never written to the catalog. */\nexport type { ProposedBridge } from './composition/proposed-bridges.js';\n/** Options of the discovery funnel. */\nexport type { DiscoveryOptions } from './composition/discovery.js';\n/** A representative value of a quantity with its source. */\nexport type { RepresentativeValue } from './composition/representative-values.js';\n/** A canonical prefactor, scalar or per dimensionless group, with its source. */\nexport type { SourcedPrefactor, SourcedGroupPrefactor } from './canonical/canonical-equation.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,qEAAqE;AACrE,2EAA2E;AAC3E,6EAA6E;AAC7E,OAAO,EACL,IAAI,EACJ,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C/D,oEAAoE;AACpE,+CAA+C;AAC/C,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAOtF,gFAAgF;AAChF,6EAA6E;AAC7E,4EAA4E;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,oEAAoE;AACpE,6EAA6E;AAC7E,2EAA2E;AAC3E,yEAAyE;AACzE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAczC,+FAA+F;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAGjF,+DAA+D;AAC/D,4EAA4E;AAC5E,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB;AAChB,iFAAiF;AACjF,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AAGrC,6EAA6E;AAC7E,4EAA4E;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,+EAA+E;AAC/E,yEAAyE;AACzE,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * Universal Physics Tensor Framework\n *\n * Computational framework for exploring unified physics through tensor formalism\n *\n * @packageDocumentation\n */\n\nexport { UniversalTensor } from './core/tensor.js';\n// v0.5.1 — canonical flat CODATA 2022 / SI-defined constants (PC-1).\n// Single source of truth across numerical, dimensional, and bridge layers.\n// See src/core/constants.ts and docs/planning/v0.5.1-Implementation-Plan.md.\nexport {\n C_SI,\n G_SI,\n H_SI,\n HBAR_SI,\n K_B_SI,\n E_SI,\n ALPHA,\n M_P_SI,\n L_P_SI,\n T_P_SI,\n H0_SI,\n // v0.8.0 punch-list — promoted from the calibration-edges module\n M_SUN_SI,\n // IAU 2015 nominal solar GM. Not G_SI * M_SUN_SI.\n GM_SUN_SI,\n // v0.11 — electron mass (namespacing criterion-3 pin)\n M_E_SI,\n // canonical registry — Wien displacement constant (CE-wien)\n B_WIEN_SI,\n} from './core/constants.js';\nexport type {\n TensorConfig,\n TensorIndices,\n PhysicalLaw,\n BridgeEquation,\n EmergentPhenomenon,\n PhysicalScale,\n Force,\n Symmetry,\n InformationMeasure,\n} from './core/types.js';\nexport { PhysicalConstants } from './core/types.js';\n\n// v0.7 Proposal 3 — Typed `Cell` discriminated union (storage-layer\n// surface). `PhysicalLaw` / `BridgeEquation` / `EmergentPhenomenon`\n// above remain the legacy surface (consumers haven't migrated yet);\n// the new `Cell` union is the preferred forward-looking shape.\nexport type {\n Cell,\n CellBase,\n CellConfidence,\n LawCell,\n BridgeCell,\n EmergenceCell,\n} from './core/cell.js';\nexport { compose } from './core/tensor.js';\n\n// v0.7 Proposal 2 — Sparse semantic catalog (flux rules + adapter).\n// Per Decision #9, only the consumer-facing types are re-exported;\n// FluxRule / FluxRuleKind / FluxRuleResult stay @internal.\nexport type {\n FluxDiagnostic,\n FluxReport,\n} from './core/flux-rules.js';\nexport { FluxViolationError } from './core/flux-rules.js';\nexport type {\n CatalogEntryStatus,\n CatalogIngestionReport,\n} from './bridges/catalog-adapter.js';\nexport {\n catalogToCells,\n scanCatalog,\n ingestCatalog,\n ingestionReportToFluxReport,\n CatalogIngestionError,\n} from './bridges/catalog-adapter.js';\n\n// v0.7 Proposal 1 — Intelligent Index layer (UniversalIndex + Axes\n// + LabeledTensor wrapper). Per Decision #10, 10 public symbols.\n// MergedLabels<L,R> and canonicalLabelOrder stay @internal.\nexport type {\n AxisName,\n UniversalIndex,\n UniversalIndexId,\n MakeIndexOptions,\n} from './core/universal-index.js';\nexport { makeIndex } from './core/universal-index.js';\nexport type { AxesRegistry } from './core/axes-registry.js';\nexport { Axes } from './core/axes-registry.js';\nexport {\n LabeledTensor,\n LabeledTensorConstructionError,\n AxisMismatchError,\n IdentityConflictError,\n IndexNameMismatchError,\n RankPreservationError,\n AxisOrderError,\n AxisMergeError,\n AxisSplitError,\n} from './core/labeled-tensor.js';\n\n// v0.8 Proposal 5 — RegimeType extension system: the mechanism, with the 18\n// v0.6-shipped values pre-registered. No further built-in regime is added\n// (owner ruling of 2026-10-09, NOTES.md); a new regime is registered through\n// this mechanism by its caller.\nexport type {\n RegimeProvenance,\n RegimeValueBase,\n RegimeSpec,\n} from './core/regime-registry.js';\nexport {\n defineRegime,\n defineScale,\n defineForce,\n defineSymmetry,\n defineInformation,\n defineDimension,\n defineTopology,\n lookupRegime,\n listRegimesByAxis,\n provenanceFor,\n attachRegimesToCell,\n getCellRegimes,\n RegimeCollisionError,\n} from './core/regime-registry.js';\n// Phase 4 wiring side-effect: installs the regime-consistency rule.\nimport './core/regime-rule-install.js';\n// Phase 2 side-effect: pre-registers the 18 built-in regimes.\nimport './core/regimes-builtins.js';\n\n// v0.9 Proposal 8 — Bridge Parameter Differentiation (P8 Decision #1: lives\n// in src/diff/, doesn't touch src/bridges/). `bridgeGradientNumerical` is\n// central finite differences over a spec, engine-free. Engine AD of a spec\n// is unreachable by construction (`evaluate` returns a number, which carries\n// no tape); the exact AD path is `bridgeGradientAST` over the symbolic RHS.\nexport type { BridgeDiffSpec, BridgeNumericalGradientResult } from './diff/bridge-gradient.js';\nexport { bridgeGradientNumerical } from './diff/bridge-gradient.js';\n// Exact bridge gradients over the symbolic RHS AST, through MathTS\n// compileScalarGradient (faithful encodings only).\nexport type { ASTGradientResult } from './diff/bridge-ast-gradient.js';\nexport {\n bridgeGradientAST,\n bridgeGradientASTById,\n astDifferentiableBridgeIds,\n} from './diff/bridge-ast-gradient.js';\n/** Differentiable relations: Shapiro delay, perihelion advance, Hawking temperature, and the decoherence rate. */\nexport {\n SHAPIRO_DELAY_DIFF,\n PERIHELION_ADVANCE_DIFF,\n HAWKING_TEMPERATURE_DIFF,\n DECOHERENCE_RATE_DIFF,\n DIFFERENTIABLE_RELATIONS,\n} from './diff/bridge-specs.js';\n\n// The catalog rows of `data/bridge-catalog.json`, in id order.\n// `BridgeEquationEntry` is a different shape from the runtime `BridgeEquation`\n// interface above: the entry is the catalog's record of an equation (status,\n// known issues, references, dependencies), while `BridgeEquation` describes a\n// runtime bridge between two tensor regimes.\nexport { BRIDGE_EQUATIONS } from './bridges/index.js';\n/** Request a caller-table confrontation. The catalog status does not change. */\nexport {\n requestCallerTableConfrontation,\n} from './bridges/caller-table.js';\n/** Types of a caller-table request and of its refusal or hit. */\nexport type {\n MeasuredCouplingRow,\n RunningProcedureRecord,\n RunningProcedure,\n CallerTableRequest,\n CallerTableRefusal,\n CallerTableHit,\n CallerTableResult,\n} from './bridges/caller-table.js';\nexport type {\n BridgeEquationEntry,\n BridgeEquationStatus,\n BridgeIssueSeverity,\n BridgeIssueFixable,\n KnownIssue,\n} from './bridges/index.js';\n\n/**\n * Constants that stay on the package root, and `CarrierSignError`.\n * Per-bridge evaluate functions are not on this root.\n */\nexport {\n VON_KLITZING_SI,\n JOSEPHSON_CONSTANT_SI,\n LORENZ_NUMBER_SI,\n BCS_GAP_RATIO,\n LANE_EMDEN_OMEGA3,\n THOMSON_CROSS_SECTION_SI,\n M_PROTON_SI,\n CarrierSignError,\n} from './bridges/index.js';\n/**\n * One evaluation of a catalog id or a canonical id.\n * A sourced number is `kind: 'value'`. An unset coefficient is `kind: 'unset'`.\n * @public\n */\nexport { evaluateRelation, CoefficientUnsetError } from './composition/index.js';\n/** The input errors {@link evaluateRelation} throws before any domain check; a domain failure is `DomainViolationError`. */\nexport {\n DuplicateInputError,\n InputTypeError,\n MissingInputError,\n NonFiniteInputError,\n UnknownInputError,\n} from './composition/index.js';\n/** A caller input that names a registered constant (`G`, `k_B`, `m_p`, …) is refused on every evaluation path. */\nexport { ConstantInputError } from './bridges/index.js';\n/** The result of {@link evaluateRelation}. A value carries a public `Dimension`. */\nexport type { Evaluation, ExtraOutput } from './composition/index.js';\n\nexport type { EvaluatorSpec, EvaluatorParameter, ParameterAlternate, GeometryRole } from './bridges/evaluators.js';\n/** An extra output an `EvaluatorSpec` returns beside its `value`. */\nexport type { CatalogEvaluatorOutput } from './bridges/catalog-types.js';\n/** The input contract an evaluator's `run` checks before the domain, and what a caller asks `run` for. */\nexport type { ContractAlternate, EvaluationWant, InputContract, InputSlot } from './bridges/input-contract.js';\n/** Build an input contract; throws when one spelling or alternate would bind two slots. */\nexport { inputContract } from './bridges/input-contract.js';\n\n// v0.4.0 connection layer — Christoffel formula builder and covariant derivative\n// AST node type. `christoffel` is public because bridge modules and downstream\n// callers compose Γ trees directly; `CovariantDerivativeNode` is the structural\n// type for the new ∇_μ AST kind.\nexport { christoffel } from './dimensional/connection.js';\n// CovariantDerivativeNode is re-exported from validator.ts (which holds the union);\n// importing from there avoids creating a separate source-of-truth.\nexport type { CovariantDerivativeNode } from './dimensional/validator.js';\n\n// v0.5.0 curvature layer — Ricci tensor helper (Task 7). `ricci(R)` wraps a\n// RiemannTensorNode and produces the contracted R_μν = R^λ_{λμν} as a\n// composite ExprNode (own validator + lowering arms).\nexport { ricci } from './dimensional/curvature.js';\nexport type { RicciTensorNode } from './dimensional/validator.js';\n\n// v0.5.0 curvature layer — Einstein tensor helper (Task 8). `einstein(R, g,\n// gInverse)` wraps a RiemannTensorNode + metric pair and produces the\n// composite G_μν = R_μν − ½ R g_μν as an ExprNode (own validator +\n// lowering arms — no AST rewrite). The matter-coupled field-equation node\n// `G_μν = κ T_μν` exists (`EinsteinFieldEquationNode`, validated in\n// dimensional/validator.ts); its numerical lowering is still deferred: the\n// lowering layer refuses a deferred node kind with `NumericalBackendError`\n// and names the evaluator to use instead (numerical/lowering.ts).\nexport { einstein } from './dimensional/curvature.js';\nexport type { EinsteinTensorNode } from './dimensional/validator.js';\n\n// v0.5.0 curvature layer — Bianchi residual helper (Task 9). `bianchiResidual(R)`\n// returns {residual, evaluate, evaluateMax} for the cyclic second-Bianchi-identity\n// check ∇_{[λ} R_{μν]ρσ} = 0. The evaluator lives in numerical so curvature.ts\n// does not import it. Closes Phase 1 — Foundations.\nexport { bianchiResidual } from './numerical/bianchi-residual.js';\nexport type { BianchiResidualNode } from './dimensional/validator.js';\n\n// v0.6.0 Phase 1 — Killing-vector machinery (Task 1.3).\n// `verifyKillingEquation` checks the Killing equation ∇_μ ξ_ν + ∇_ν ξ_μ = 0\n// numerically at a point using a hybrid impl (exact Christoffels + analytic\n// metric derivatives). `evaluateConservedCharge` evaluates Q = ξ^μ p_μ along\n// a geodesic. `ChristoffelAccess` is the layout-agnostic Christoffel accessor\n// type that insulates consumers from the Phase 2 BR-2 flat-layout migration.\nexport {\n verifyKillingEquation,\n checkKillingEquation,\n evaluateConservedCharge,\n} from './numerical/killing.js';\nexport type {\n KillingEquationOptions,\n KillingEquationCheck,\n ChristoffelAccess,\n} from './numerical/killing.js';\n\n// v0.4.0 geodesic integrator (RK4 solver — headline feature of v0.4.0)\nexport {\n integrateGeodesic,\n type GeodesicIntegratorInputs,\n type GeodesicIntegratorResult,\n} from './numerical/geodesic-integrator.js';\n\n// v0.14 G-9 increment 2 — geometrized-units boundary adapters. Convert a scalar\n// between SI and geometrized (G = c = 1) units, driven by its `Dimension`\n// exponent vector (factor G^M·c^(T−2M)). For consumers running the GR pipeline\n// in geometrized units; the default-pipeline migration is a later increment.\nexport {\n toGeometrized,\n fromGeometrized,\n geometrizedFactor,\n NonGeometrizableDimensionError,\n} from './numerical/geometrized.js';\n\n// v0.7.1 M-1 — Surface restoration: five v0.7 dimensional primitives were\n// @public-tagged during the BE-X re-encoding sprint but absent from this\n// manifest. Re-exported here per Phase 1 Task 1.2 (Decision #2 guard).\n// Mirrors the v0.6.0 EinsteinFieldEquationNode / KretschmannScalarNode /\n// RicciTensorNode pattern — predicate-node types + validators are @public.\nexport type {\n TracableTensorNode,\n TensorTraceNode,\n TensorTraceValidationResult,\n TensorTraceOptions,\n} from './dimensional/tensor-trace.js';\nexport { validateTensorTrace } from './dimensional/tensor-trace.js';\n\nexport type {\n FriedmannVariant,\n FriedmannEquationNode,\n FriedmannEquationValidationResult,\n} from './dimensional/friedmann-equation.js';\nexport { validateFriedmannEquation } from './dimensional/friedmann-equation.js';\n\nexport type {\n RGCouplingNode,\n BetaFunctionNode,\n BetaFunctionValidationResult,\n} from './dimensional/rg-flow.js';\nexport { rgCoupling, validateRGCoupling, validateBetaFunction } from './dimensional/rg-flow.js';\n\nexport type {\n ArrowOfTime,\n GaugeFieldNode,\n TimeSymmetryPredicateNode,\n TimeSymmetryPredicateValidationResult,\n} from './dimensional/gauge-field.js';\nexport { validateGaugeField, validateTimeSymmetryPredicate } from './dimensional/gauge-field.js';\n\nexport type {\n ScalarFieldNode,\n KleinGordonEquationNode,\n KleinGordonEquationValidationResult,\n} from './dimensional/klein-gordon-equation.js';\nexport { validateKleinGordonEquation } from './dimensional/klein-gordon-equation.js';\n\n// Dimensional analyzer (Tier 4) — SI dimension propagation through bridge\n// equations expressed as ExprNode trees. See src/dimensional/README.md.\n// Every symbol re-exported in this block is `@public` — the consumer-facing\n// dimensional/metric surface (stabilised in v0.3.0).\nexport type { Dimension } from './dimensional/types.js';\n/** The one unit reader: parse a unit, convert a value exactly, and the typed errors it throws. */\nexport {\n AmbiguousUnitError,\n convertValue,\n parseUnit,\n UnitError,\n UnitRefusedError,\n UnknownUnitError,\n} from './dimensional/units.js';\n/** A parsed unit, a converted value, and how a temperature is read. */\nexport type { AffineTemperature, ConvertedValue, ParsedUnit, TemperatureReading } from './dimensional/units.js';\nexport {\n DIMENSIONLESS,\n LENGTH,\n AREA,\n TIME,\n FREQUENCY,\n MASS,\n VELOCITY,\n ACCELERATION,\n FORCE,\n ENERGY,\n POWER,\n ACTION,\n TEMPERATURE,\n ENTROPY,\n CHARGE,\n} from './dimensional/types.js';\nexport {\n multiply,\n divide,\n power,\n add,\n subtract,\n equals,\n format,\n DimensionMismatchError,\n} from './dimensional/algebra.js';\nexport type { ExprNode, TranscendentalFn, ValidationResult, Violation } from './dimensional/validator.js';\nexport { validate, validateEquation, validateInverseMetricPair } from './dimensional/validator.js';\nexport { inferDimensionForBridge } from './dimensional/bridge-check.js';\n\n// v0.6.0 Phase 2 Task 2.4 — Einstein-equation numerical evaluator.\n// `evaluateEinsteinEquationResidual` computes the scale-normalized max residual\n// |G_μν + Λ g_μν − κ T_μν| / |g_μν| at a coordinate point. Accepts metric\n// closures + stress-energy closure; returns a dimensionless relative residual.\n// For Schwarzschild vacuum (T=0, Λ=0) the residual is the FD truncation floor\n// (~1e-10 relative at 4th-order stencil accuracy).\nexport {\n evaluateEinsteinEquationResidual,\n} from './numerical/einstein-equation.js';\nexport type {\n EinsteinEquationResidualInput,\n MetricClosure,\n Vec4,\n} from './numerical/einstein-equation.js';\n\n// v0.6.0 Phase 2 Task 2.3 — EinsteinFieldEquationNode predicate AST + validator.\n// Represents G_μν + Λ g_μν = (8πG/c⁴) T_μν as a structurally-validated AST node.\n// Validator checks: free-index agreement, per-component dim equality [L⁻²],\n// and symmetry agreement (Decision #3 + #11).\nexport { validateEinsteinFieldEquation } from './dimensional/einstein-equation.js';\nexport type {\n EinsteinFieldEquationNode,\n EinsteinFieldEquationValidationResult,\n} from './dimensional/einstein-equation.js';\n\n// v0.6.0 Phase 3 Task 3.5 — KretschmannScalarNode AST + validator.\n// K = R_{ρσμν} R^{ρσμν} is the canonical curvature invariant; scalar (rank-0),\n// dim [L⁻⁴]. Diverges at genuine singularities; finite at coordinate ones.\nexport type {\n KretschmannScalarNode,\n KretschmannScalarValidationResult,\n} from './dimensional/curvature-invariants.js';\nexport { validateKretschmannScalar } from './dimensional/curvature-invariants.js';\n\n// v0.6.0 Phase 3 Task 3.6 — Kretschmann scalar numerical contraction.\n// O(4⁸) = 65536 multiplications per call — diagnostic/sample-point use only.\nexport { computeKretschmann } from './numerical/kretschmann.js';\n\n// Numerical-contraction backend (v0.3.5+). See docs/planning/v0.3.5-Design.md\n// and docs/planning/v0.4.0-Implementation-Plan.md (v0.4.0 additions below).\n// Every symbol below is `@public` — the consumer-facing (TensorJS) surface.\n// `MathTSEngine` is intentionally NOT re-exported here. It is reachable only\n// via the `universal-physics-tensor/numerical/mathts-engine` subpath. The\n// MathTS packages are required dependencies.\n/** Numerical evaluation, the covariant eikonal integrator, the GL4 geodesic integrator, and the perihelion finder. */\nexport {\n evaluateNumerical,\n evaluateNumericalRaw,\n evaluateMetricInverse,\n getActiveEngine,\n setActiveEngine,\n NumericalBackendError,\n // v0.4.0 additions to the numerical surface\n DuplicateCoordinateWarning,\n EngineCapabilityError,\n hasAutogradSupport,\n evaluateCovariantEikonalNumerical,\n // v0.5.0 GL4 symplectic integrator\n integrateGeodesicGL4,\n // v0.5.0 perihelion finder (Task 4)\n findPerihelion,\n} from './numerical/index.js';\n/** Types for numerical evaluation, gradients, the GL4 integrator, the perihelion finder, and the covariant eikonal. */\nexport type {\n NumericalResult,\n NumericalRawResult,\n EvaluateOptions,\n NumericalInputs,\n TensorEngine,\n EngineTensor,\n EinsumSpec,\n NestedArray,\n GridField,\n // v0.4.0 type additions\n ForwardGradResult,\n ReverseGradResult,\n // v0.5.0 GL4 type additions\n GL4State,\n GL4Snapshot,\n GL4Options,\n // v0.5.0 perihelion-finder type additions (Task 4)\n PerihelionResult,\n FindPerihelionOptions,\n CovariantEikonalInputs,\n CovariantEikonalResult,\n} from './numerical/index.js';\n\n// ---------------------------------------------------------------------------\n// v0.8.0 — Composition graph (graph-lite Quantity/BridgeEdge/composeEdges\n// beside the catalog; see docs/planning/v0.8.0-Design.md). The operator is\n// `composeEdges`, NOT `compose` — `compose` is the v0.7 Cell factory above.\n// ---------------------------------------------------------------------------\nexport {\n composeEdges,\n consistencyRatio,\n evaluateEdge,\n minConfidence,\n regimesDiffer,\n QUANTITY_IDENTIFICATIONS,\n CompositionDimensionError,\n CompositionJunctionError,\n DomainViolationError,\n // Calibration edges (pre-registered CT-1/CT-1b/CT-2/CT-3 targets)\n M_SUN_KG,\n} from './composition/index.js';\nexport type {\n BridgeEdge,\n ComposeOptions,\n EdgeConfidence,\n Quantity,\n QuantityIdentification,\n RegimeAttributes,\n ValidityDomain,\n} from './composition/index.js';\n/** A validity domain built from one condition text: the predicate, the description and the refusal all read it. */\nexport { validityDomain } from './composition/index.js';\n/** A failed validity condition and the inputs it read, as `DomainViolationError.violations` lists them. */\nexport type { DomainInput, DomainViolation } from './composition/index.js';\n\n// v0.8.0 — Bridge-membership criterion + negative catalog (G-2 / P-4)\nexport { adjudicateBridgeEntry, adjudicateCatalog } from './bridges/membership.js';\nexport { REJECTED_BRIDGE_ADJUDICATIONS, REJECTED_BRIDGE_IDS } from './bridges/rejected.js';\nexport type { BridgeVerdict, CatalogAdjudicationReport } from './bridges/membership.js';\nexport type { RejectedBridgeAdjudication } from './bridges/rejected.js';\n\n// v0.8.0 — GW170817 → BE-36 real-data confrontation (G-3)\n\n// v0.28+ — Mercury perihelion → BE-52 real-data confrontation (established bridge)\n\n// v0.10.0 — Phase-D enumeration + uncertainty propagation (T3/T4)\nexport {\n enumerateCompositions,\n REGISTERED_COMPOSITION_IDS,\n propagateUncertainty,\n} from './composition/index.js';\nexport type {\n CompositionCandidate,\n EnumerationReport,\n UncertaintyResult,\n} from './composition/index.js';\n\n// Identifiability classifier (structural over/exactly/under-determined\n// over the composition graph — Consequence 1 of the bridge-inference\n// epistemics note)\n/** The forward closure, the per-target classifier, the sweep, and the log-space rank over the monomial edges. */\nexport {\n classifyIdentifiability,\n classifyAll,\n forwardClosure,\n identifiabilityByRank,\n} from './composition/index.js';\n/** The classifier's verdict, result and option types, and the rank instrument's report. */\nexport type {\n IdentifiabilityVerdict,\n IdentifiabilityResult,\n IdentifiabilityOptions,\n RankIdentifiability,\n} from './composition/index.js';\n\n// Retrodiction harness (the framework's own falsification benchmark —\n// Consequence 2 of the bridge-inference epistemics note)\nexport { retrodict, retrodictNode } from './composition/index.js';\n/** The retrodiction harness's result, prediction, refusal, report and option types. */\nexport type {\n RetrodictionOutcome,\n RetrodictionPrediction,\n RetrodictionResult,\n RetrodictionRefusal,\n RetrodictionReport,\n RetrodictionOptions,\n} from './composition/index.js';\n\n// Unified \"explain this quantity\" entry point over the three inference\n// primitives (identifiability + retrodiction + Buckingham-π)\nexport { explainQuantity } from './composition/index.js';\nexport type {\n DerivationExplanation,\n ExplainOptions,\n QuantityExplanation,\n} from './composition/index.js';\n\n// v0.12 — symbolic bridge composition (the Observable contract). Composes\n// bridges' symbolic ExprNode forms (not just numeric closures), dimensionally\n// validated and numerically evaluable.\nexport { composeSymbolic, SymbolicCompositionError, SymbolicEvalError } from './composition/index.js';\nexport type { Observable, ComposeSymbolicOptions } from './composition/index.js';\n\n// Physics-map visualization — render the bipartite, clustered hypergraph\n// (quantities = nodes, equations = junctions) as Mermaid / Graphviz-DOT source.\nexport { buildVizModel, edgeToJunction } from './composition/index.js';\nexport type {\n VizStatus,\n VizJunction,\n VizCluster,\n VizOptions,\n VizModel,\n VizFilterStats,\n} from './composition/index.js';\n// SVG rendering via the optional @viz-js/viz peer (separate module so the\n// graph-viz model stays pure/synchronous/dependency-free).\nexport { renderDotToSvg, SvgRendererUnavailableError } from './composition/index.js';\n\n// User-equation injection — parse a free-form \"TARGET = EXPR\" and place it into\n// the map as a connected 'user' junction (with a \"did you mean?\" hint).\nexport {\n parseUserEquation,\n suggestQuantities,\n suggestByDimension,\n equationLanding,\n analyzeUserEquation,\n UserEquationError,\n} from './composition/index.js';\n/** The catalog or parameter name a spelling means. One owner for a target and an input. */\nexport { resolveQuantityName } from './composition/index.js';\nexport type { UserEquation, EquationLanding, EquationAnalysis, EquationHint } from './composition/index.js';\n\n// Phase 1 — string → dimensional ExprNode parser + single-unknown dimensional\n// inference (the front-end to the physics AST).\nexport { parsePhysics } from './numerical/formula-registry.js';\nexport { FormulaDimensionError } from './numerical/formula-dimension.js';\nexport type { ParsedPhysics } from './numerical/formula-dimension.js';\nexport { inferUnknownDimension, substituteSymbolDim } from './dimensional/dimension-inference.js';\n// Dimension-adjacency review surface (name-divergent but same-dimension quantities).\nexport { dimensionAdjacency } from './composition/index.js';\nexport type { DimensionAdjacency } from './composition/index.js';\n\n\n// Buckingham-π enumerator (the principled primitive for the exactly-\n// determined case — build target 1 of the bridge-inference epistemics\n// note; FORM only, never the dimensionless constant)\nexport {\n buckinghamPi,\n dimensionallyDetermines,\n RationalizationError,\n} from './dimensional/buckingham.js';\nexport type {\n DimensionalVariable,\n PiGroup,\n BuckinghamVerdict,\n BuckinghamResult,\n DimensionalDeterminationResult,\n} from './dimensional/buckingham.js';\n\n// v0.11 — namespacing gate (Option D: name-collision rule + dispositions)\nexport {\n CompositionAliasError,\n SOURCE_ALIAS_DISPOSITIONS,\n} from './composition/compose-surface.js';\nexport type {\n AliasDisposition,\n DispositionRequired,\n} from './composition/compose-surface.js';\n\n// v0.11 — Klein-Gordon dispersion evaluator (G-7 closure, plane-wave sector)\nexport {\n evaluateKGDispersionResidual,\n verifyKleinGordonPlaneWave,\n} from './numerical/klein-gordon.js';\nexport type {\n KGDispersionResidualInput,\n KGPlaneWaveVerifyInput,\n KGPlaneWaveVerifyResult,\n} from './numerical/klein-gordon.js';\n\n// v0.11 — BE-23 Planckian-dissipation data confrontation (2nd real-data check)\n\n// The composition graph is the relation projection of the catalog.\nexport { CATALOG_GRAPH } from './composition/index.js';\n\n// The standard-physics counterpart: the canonical L-layer projected into the\n// composition-graph edge vocabulary, so the discovery/analysis funnel can run\n// on textbook physics ALONE (bridges excluded). See `composition/canonical-graph`.\nexport {\n CANONICAL_GRAPH,\n canonicalToEdges,\n CANONICAL_CONSTANTS,\n} from './composition/index.js';\n\n// ── Canonical-equation registry (the L-layer ground truth) ──────────────────\n// Textbook physics equations bridges are validated against. Multi-fidelity\n// (L0 dimensional / L1 scalar-AST / L2 field-equation) with epistemic-honesty\n// and provenance fields. See docs/planning/Canonical-Equation-Registry-A-*.\nexport {\n CANONICAL_EQUATIONS,\n CANONICAL_BY_ID,\n canonicalById,\n canonicalByDomain,\n partneredBridgeIds,\n bridgesWithoutCanonicalPartner,\n} from './canonical/registry.js';\nexport {\n canonicalToLaw,\n seedCanonicalLaws,\n CANONICAL_TENSOR_CONFIG,\n} from './canonical/seed-l-layer.js';\nexport type {\n CanonicalEquation,\n CanonicalDomain,\n EpistemicStatus,\n CanonicalForms,\n FieldEquationNode,\n} from './canonical/canonical-equation.js';\n// Sub-project B — bridge↔canonical linkage (validate vs standard physics).\n// `normalForm` is the structural hash up to dimensionless factors;\n// `classifyLinkage`/`scanLinkages` recover/contain bridges against canonicals\n// with the F4 circularity guard (`restates-canonical` vs genuine `recovers`).\nexport { normalForm, structurallyEqual } from './canonical/normal-form.js';\nexport { classifyLinkage, scanLinkages } from './canonical/linkage.js';\nexport type { LinkageResult, RecoveryOutcome } from './canonical/linkage.js';\n\n// Adjudication ledger — human verdicts on discovery-funnel identification\n// hypotheses (review memory the funnel must not re-surface as fresh).\n// Precedent: SOURCE_ALIAS_DISPOSITIONS/AliasDisposition above is the repo's\n// other reviewable judgment registry, and is index-exported the same way.\nexport {\n candidateId,\n ADJUDICATIONS,\n adjudicationFor,\n annotateAdjudications,\n} from './composition/adjudication.js';\nexport type { AnnotatedCandidate } from './composition/adjudication.js';\n/** The adjudication ledger's verdict and record types, exported from their owner, the catalog file's types. */\nexport type { AdjudicationVerdict, CatalogAdjudication } from './bridges/catalog-types.js';\n\n// Consequence propagation — the machine pre-classifier for the human\n// adjudication ledger. Annotates discovery candidates with the\n// entailed/novel-consequence/inconclusive signal; never mutates the\n// catalog/graph, never re-orders or re-scores.\nexport { annotateConsequences, classifyProposal } from './composition/consequence.js';\nexport type {\n ConsequenceAnnotatedCandidate,\n ConsequenceSignal,\n ConsequenceEvidence,\n} from './composition/consequence.js';\n\n// Epistemic-grounding ledger (PI-instrument Phase 1). A pure, derived view over\n// a candidate's falsifier results: which gates passed vs abstained, plus the\n// honest no-mechanism/no-data ceiling. Annotation-only; changes no verdict.\nexport { describeGrounding } from './composition/grounding.js';\nexport type { CandidateGrounding } from './composition/grounding.js';\n\n// Discovery funnel — vet link-candidate identifications against the inference\n// suite (Direction 2). rankDiscoveries is the entry point; VettedCandidate is\n// the output type. Required to feed annotateAdjudications from the public API.\nexport { rankDiscoveries } from './composition/discovery.js';\nexport type { VettedCandidate } from './composition/discovery.js';\n\n// v0.33.0 — `upt confront` real-data confrontation subsystem: typed\n// observations + a normalized ConfrontationOutcome (discriminated on `kind`)\n// wrap the per-bridge confrontation modules (be-23/36/37/48/52) behind one\n// registry, plus deciding-measurement elasticity for value-kind entries.\nexport {\n residualInSigma,\n combineInQuadrature,\n consistencyComparison,\n} from './bridges/observations/types.js';\nexport type {\n ConsistencyComparison,\n ObservationProvenance,\n SigmaComponent,\n ObservationKind,\n ConfrontationOutcome,\n ConfrontationDataHandling,\n ConfrontationPreprocessing,\n ConfrontationIndependence,\n SourceRef,\n SourceRefs,\n} from './bridges/observations/types.js';\n\n// BE-53 — one-loop coefficient, and a confrontation only when the caller supplies both inputs.\nexport { oneLoopCoefficientStatement } from './bridges/coefficient-statement.js';\nexport type { OneLoopCoefficientStatement, OneLoopCoefficientSign } from './bridges/coefficient-statement.js';\n\n// The confrontation registry: every committed confrontation of\n// `data/bridge-catalog.json`, the single lookup surface for `upt confront`.\nexport {\n CONFRONTATIONS,\n listConfrontations,\n runConfrontation,\n // Rigor hierarchy of the evidence spine (2026-07-05) — stringent/moderate/loose.\n CONFRONTATION_RIGOR,\n confrontationRigor,\n rigorDistribution,\n} from './bridges/confrontations.js';\nexport type { ConfrontationEntry, RigorTier } from './bridges/confrontations.js';\n\n// Deciding-measurement elasticity — which input a value-kind confrontation's\n// prediction depends on most strongly (central-difference log-sensitivity).\nexport { decidingMeasurement } from './bridges/sensitivity.js';\nexport type { Elasticity } from './bridges/sensitivity.js';\n\n// The PUBLIC atlas surface as a namespace (Atlas API review, Tier 1). The full\n// @internal surface stays on the universal-physics-tensor/atlas subpath.\nexport * as atlas from './atlas/public.js';\n\n// ---------------------------------------------------------------------------\n// Closure under type references (tests/api/root-public-closure.test.ts).\n// Every type a root export names is itself importable from the root or from\n// a package.json subpath; the names below were reachable only through the\n// public declarations that mention them.\n// ---------------------------------------------------------------------------\n/** The base class of every error this package throws. */\nexport type { UPTError } from './dimensional/errors.js';\n/** Which constants a natural-unit evaluation sets to one. */\nexport type { UnitMode } from './dimensional/natural-units.js';\n/** The tensor and curvature node family of the dimensional AST. */\nexport type {\n Variance,\n Role,\n TensorIndex,\n UpperIndex,\n CovariantIndex,\n TensorSymbolNode,\n TensorProductNode,\n MetricTensorNode,\n KroneckerDeltaNode,\n TensorPartialDerivativeNode,\n RiemannTensorNode,\n WeylTensorNode,\n KillingVectorNode,\n ConservedChargeNode,\n StressEnergyTensorNode,\n CosmologicalConstantNode,\n} from './dimensional/ast-types.js';\n/** The generic shape the curvature node types instantiate, and its kind union (referenced by the exported node types). */\nexport type { CurvatureCompositeNode, CurvatureKind } from './dimensional/curvature-composite.js';\n/** The kind of a flux rule. */\nexport type { FluxRuleKind } from './core/flux-rules.js';\n/** The per-axis value tables of the core axis registry. */\nexport type { ScaleAxes, ForceAxes, SymmetryAxes, InformationAxes } from './core/axes-registry.js';\n/** The convenience form a regime registration accepts for an axis. */\nexport type { AxisConvenience } from './core/regime-registry.js';\n/** The named inputs of the four bridge differentiation specs. */\nexport type { ShapiroInput, PerihelionInput, HawkingInput, DecoherenceInput } from './diff/bridge-specs.js';\n/** The contraction and free-axis records an einsum plan is made of. */\nexport type { EinsumContraction, EinsumFreeAxis } from './numerical/tensor-engine.js';\n/** The callbacks a Killing-equation check takes: the vector field, the metric and the connection. */\nexport type { KillingFn, KillingMetricFn, ChristoffelAtFn } from './numerical/killing.js';\n/** A relation's input contract and the sign and unit conventions it states. */\nexport type { RelationContract, Conventions } from './relations/types.js';\n/** The classification axes of the composition registry. */\nexport type {\n ScaleAxis,\n ForceAxis,\n InformationAxis,\n SymmetryAxis,\n TopologyAxis,\n StatisticsAxis,\n} from './composition/axes.js';\n/** Options of the chain enumerator. */\nexport type { EnumerationOptions } from './composition/enumerate.js';\n/** Options of the uncertainty propagation. */\nexport type { UncertaintyOptions } from './composition/uncertainty.js';\n/** Options of a user-equation analysis and the short form of a binding. */\nexport type { AnalyzeUserEquationOptions, ShortBinding } from './composition/user-equation.js';\n/** A constant as the canonical graph declares it. */\nexport type { ConstantDef } from './composition/canonical-graph.js';\n/** An identity consequence the surfacer proposes; never written to the catalog. */\nexport type { ProposedBridge } from './composition/proposed-bridges.js';\n/** Options of the discovery funnel. */\nexport type { DiscoveryOptions } from './composition/discovery.js';\n/** A representative value of a quantity with its source. */\nexport type { RepresentativeValue } from './composition/representative-values.js';\n/** A canonical prefactor, scalar or per dimensionless group, with its source. */\nexport type { SourcedPrefactor, SourcedGroupPrefactor } from './canonical/canonical-equation.js';\n"]}
@@ -31,8 +31,10 @@ export declare function zeroTensorLike(t: EngineTensor, engine: TensorEngine): E
31
31
  */
32
32
  export declare function zeroTensor(shape: ReadonlyArray<number>, engine: TensorEngine): EngineTensor;
33
33
  /**
34
- * Convert a flat number[] to a properly-nested NestedArray matching `shape`.
34
+ * Convert a flat number[] to a properly-nested NestedArray matching `shape`,
35
+ * in row-major order, through MathTS `new Tensor(shape, data).toNested()`.
35
36
  * Exported for use in lowering.ts where the engine requires nested structure.
37
+ * @throws NumericalBackendError when the data length is not the product of the shape.
36
38
  */
37
39
  export declare function flatToNested(flat: number[], shape: ReadonlyArray<number>): NestedArray;
38
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"connection-lowering-helpers.d.ts","sourceRoot":"","sources":["../../src/numerical/connection-lowering-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAQ9C;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CA+CrD;AAyBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,YAAY,EA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AU,EAC7B,CAAC,EAAE,MAAM,EACT,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,GAC9D,MAAM,EAAE,CAsBV"}
1
+ {"version":3,"file":"connection-lowering-helpers.d.ts","sourceRoot":"","sources":["../../src/numerical/connection-lowering-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAQ9C;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CA+CrD;AAyBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY,CAGlF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY,CAE3F;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,WAAW,CAMtF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY,CAO9F;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,YAAY,EACf,CAAC,EAAE,YAAY,EACf,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EACZ,MAAM,EAAE,YAAY,GACnB,YAAY,CAQd;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,EAAE,EACtB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,EAAE,EACxC,C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