universal-physics-tensor 0.5.0 → 0.7.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.
- package/README.md +66 -105
- package/dist/bridges/catalog-adapter.d.ts +116 -0
- package/dist/bridges/catalog-adapter.d.ts.map +1 -0
- package/dist/bridges/catalog-adapter.js +302 -0
- package/dist/bridges/catalog-adapter.js.map +1 -0
- package/dist/bridges/equations/_be-helpers.d.ts +145 -0
- package/dist/bridges/equations/_be-helpers.d.ts.map +1 -0
- package/dist/bridges/equations/_be-helpers.js +179 -0
- package/dist/bridges/equations/_be-helpers.js.map +1 -0
- package/dist/bridges/equations/be-11-decoherence-master.d.ts +1 -2
- package/dist/bridges/equations/be-11-decoherence-master.d.ts.map +1 -1
- package/dist/bridges/equations/be-11-decoherence-master.js +9 -20
- package/dist/bridges/equations/be-11-decoherence-master.js.map +1 -1
- package/dist/bridges/equations/be-12-coherence-length.d.ts +7 -1
- package/dist/bridges/equations/be-12-coherence-length.d.ts.map +1 -1
- package/dist/bridges/equations/be-12-coherence-length.js +8 -16
- package/dist/bridges/equations/be-12-coherence-length.js.map +1 -1
- package/dist/bridges/equations/be-13-einstein-trace.d.ts +51 -3
- package/dist/bridges/equations/be-13-einstein-trace.d.ts.map +1 -1
- package/dist/bridges/equations/be-13-einstein-trace.js +74 -17
- package/dist/bridges/equations/be-13-einstein-trace.js.map +1 -1
- package/dist/bridges/equations/be-14-ryu-takayanagi.d.ts +10 -4
- package/dist/bridges/equations/be-14-ryu-takayanagi.d.ts.map +1 -1
- package/dist/bridges/equations/be-14-ryu-takayanagi.js +6 -17
- package/dist/bridges/equations/be-14-ryu-takayanagi.js.map +1 -1
- package/dist/bridges/equations/be-15-emergence.d.ts +7 -1
- package/dist/bridges/equations/be-15-emergence.d.ts.map +1 -1
- package/dist/bridges/equations/be-15-emergence.js +12 -22
- package/dist/bridges/equations/be-15-emergence.js.map +1 -1
- package/dist/bridges/equations/be-16-landauer.d.ts +7 -1
- package/dist/bridges/equations/be-16-landauer.d.ts.map +1 -1
- package/dist/bridges/equations/be-16-landauer.js +5 -13
- package/dist/bridges/equations/be-16-landauer.js.map +1 -1
- package/dist/bridges/equations/be-17-einstein-cartan.d.ts +26 -13
- package/dist/bridges/equations/be-17-einstein-cartan.d.ts.map +1 -1
- package/dist/bridges/equations/be-17-einstein-cartan.js +28 -31
- package/dist/bridges/equations/be-17-einstein-cartan.js.map +1 -1
- package/dist/bridges/equations/be-18-higgs-mass.d.ts +7 -1
- package/dist/bridges/equations/be-18-higgs-mass.d.ts.map +1 -1
- package/dist/bridges/equations/be-18-higgs-mass.js +5 -16
- package/dist/bridges/equations/be-18-higgs-mass.js.map +1 -1
- package/dist/bridges/equations/be-19-quantum-bounce.d.ts +38 -3
- package/dist/bridges/equations/be-19-quantum-bounce.d.ts.map +1 -1
- package/dist/bridges/equations/be-19-quantum-bounce.js +69 -20
- package/dist/bridges/equations/be-19-quantum-bounce.js.map +1 -1
- package/dist/bridges/equations/be-20-vacuum-energy.d.ts +20 -1
- package/dist/bridges/equations/be-20-vacuum-energy.d.ts.map +1 -1
- package/dist/bridges/equations/be-20-vacuum-energy.js +36 -15
- package/dist/bridges/equations/be-20-vacuum-energy.js.map +1 -1
- package/dist/bridges/equations/be-21-kss-bound.d.ts +2 -0
- package/dist/bridges/equations/be-21-kss-bound.d.ts.map +1 -1
- package/dist/bridges/equations/be-21-kss-bound.js +4 -10
- package/dist/bridges/equations/be-21-kss-bound.js.map +1 -1
- package/dist/bridges/equations/be-22-topological-entanglement.d.ts +6 -9
- package/dist/bridges/equations/be-22-topological-entanglement.d.ts.map +1 -1
- package/dist/bridges/equations/be-22-topological-entanglement.js +9 -21
- package/dist/bridges/equations/be-22-topological-entanglement.js.map +1 -1
- package/dist/bridges/equations/be-23-syk-planckian.d.ts +7 -1
- package/dist/bridges/equations/be-23-syk-planckian.d.ts.map +1 -1
- package/dist/bridges/equations/be-23-syk-planckian.js +11 -25
- package/dist/bridges/equations/be-23-syk-planckian.js.map +1 -1
- package/dist/bridges/equations/be-24-foerster-fret.d.ts +7 -1
- package/dist/bridges/equations/be-24-foerster-fret.d.ts.map +1 -1
- package/dist/bridges/equations/be-24-foerster-fret.js +8 -16
- package/dist/bridges/equations/be-24-foerster-fret.js.map +1 -1
- package/dist/bridges/equations/be-25-iit-phi.d.ts +7 -1
- package/dist/bridges/equations/be-25-iit-phi.d.ts.map +1 -1
- package/dist/bridges/equations/be-25-iit-phi.js +12 -16
- package/dist/bridges/equations/be-25-iit-phi.js.map +1 -1
- package/dist/bridges/equations/be-25-orch-or.d.ts +6 -3
- package/dist/bridges/equations/be-25-orch-or.d.ts.map +1 -1
- package/dist/bridges/equations/be-25-orch-or.js +8 -17
- package/dist/bridges/equations/be-25-orch-or.js.map +1 -1
- package/dist/bridges/equations/be-26-dna-tunneling.d.ts +6 -3
- package/dist/bridges/equations/be-26-dna-tunneling.d.ts.map +1 -1
- package/dist/bridges/equations/be-26-dna-tunneling.js +11 -26
- package/dist/bridges/equations/be-26-dna-tunneling.js.map +1 -1
- package/dist/bridges/equations/be-27-effective-temperature.d.ts +7 -1
- package/dist/bridges/equations/be-27-effective-temperature.d.ts.map +1 -1
- package/dist/bridges/equations/be-27-effective-temperature.js +8 -16
- package/dist/bridges/equations/be-27-effective-temperature.js.map +1 -1
- package/dist/bridges/equations/be-28-onsager-entropy-production.d.ts +7 -1
- package/dist/bridges/equations/be-28-onsager-entropy-production.d.ts.map +1 -1
- package/dist/bridges/equations/be-28-onsager-entropy-production.js +9 -13
- package/dist/bridges/equations/be-28-onsager-entropy-production.js.map +1 -1
- package/dist/bridges/equations/be-29-jarzynski.d.ts +7 -1
- package/dist/bridges/equations/be-29-jarzynski.d.ts.map +1 -1
- package/dist/bridges/equations/be-29-jarzynski.js +8 -13
- package/dist/bridges/equations/be-29-jarzynski.js.map +1 -1
- package/dist/bridges/equations/be-30-flm-first-law.d.ts +11 -2
- package/dist/bridges/equations/be-30-flm-first-law.d.ts.map +1 -1
- package/dist/bridges/equations/be-30-flm-first-law.js +10 -21
- package/dist/bridges/equations/be-30-flm-first-law.js.map +1 -1
- package/dist/bridges/equations/be-31-causal-set-bd.d.ts +7 -1
- package/dist/bridges/equations/be-31-causal-set-bd.d.ts.map +1 -1
- package/dist/bridges/equations/be-31-causal-set-bd.js +11 -25
- package/dist/bridges/equations/be-31-causal-set-bd.js.map +1 -1
- package/dist/bridges/equations/be-32-quantum-reference-frame.d.ts +6 -9
- package/dist/bridges/equations/be-32-quantum-reference-frame.d.ts.map +1 -1
- package/dist/bridges/equations/be-32-quantum-reference-frame.js +8 -18
- package/dist/bridges/equations/be-32-quantum-reference-frame.js.map +1 -1
- package/dist/bridges/equations/be-33-hertz-millis.d.ts +53 -28
- package/dist/bridges/equations/be-33-hertz-millis.d.ts.map +1 -1
- package/dist/bridges/equations/be-33-hertz-millis.js +55 -51
- package/dist/bridges/equations/be-33-hertz-millis.js.map +1 -1
- package/dist/bridges/equations/be-34-kibble-zurek.d.ts +6 -3
- package/dist/bridges/equations/be-34-kibble-zurek.d.ts.map +1 -1
- package/dist/bridges/equations/be-34-kibble-zurek.js +15 -26
- package/dist/bridges/equations/be-34-kibble-zurek.js.map +1 -1
- package/dist/bridges/equations/be-35-conformal-bootstrap.d.ts +6 -9
- package/dist/bridges/equations/be-35-conformal-bootstrap.d.ts.map +1 -1
- package/dist/bridges/equations/be-35-conformal-bootstrap.js +9 -21
- package/dist/bridges/equations/be-35-conformal-bootstrap.js.map +1 -1
- package/dist/bridges/equations/be-36-gw-speed-bound.d.ts +7 -1
- package/dist/bridges/equations/be-36-gw-speed-bound.d.ts.map +1 -1
- package/dist/bridges/equations/be-36-gw-speed-bound.js +5 -13
- package/dist/bridges/equations/be-36-gw-speed-bound.js.map +1 -1
- package/dist/bridges/equations/be-37-shapiro-delay.d.ts +4 -2
- package/dist/bridges/equations/be-37-shapiro-delay.d.ts.map +1 -1
- package/dist/bridges/equations/be-37-shapiro-delay.js +22 -37
- package/dist/bridges/equations/be-37-shapiro-delay.js.map +1 -1
- package/dist/bridges/equations/be-38-mond.d.ts +7 -1
- package/dist/bridges/equations/be-38-mond.d.ts.map +1 -1
- package/dist/bridges/equations/be-38-mond.js +9 -19
- package/dist/bridges/equations/be-38-mond.js.map +1 -1
- package/dist/bridges/equations/be-39-asymptotic-safety.d.ts +66 -2
- package/dist/bridges/equations/be-39-asymptotic-safety.d.ts.map +1 -1
- package/dist/bridges/equations/be-39-asymptotic-safety.js +128 -20
- package/dist/bridges/equations/be-39-asymptotic-safety.js.map +1 -1
- package/dist/bridges/equations/be-40-composite-higgs.d.ts +7 -1
- package/dist/bridges/equations/be-40-composite-higgs.d.ts.map +1 -1
- package/dist/bridges/equations/be-40-composite-higgs.js +10 -22
- package/dist/bridges/equations/be-40-composite-higgs.js.map +1 -1
- package/dist/bridges/equations/be-41-swampland.d.ts +6 -3
- package/dist/bridges/equations/be-41-swampland.d.ts.map +1 -1
- package/dist/bridges/equations/be-41-swampland.js +11 -23
- package/dist/bridges/equations/be-41-swampland.js.map +1 -1
- package/dist/bridges/equations/be-42-hawking-temperature.d.ts +2 -0
- package/dist/bridges/equations/be-42-hawking-temperature.d.ts.map +1 -1
- package/dist/bridges/equations/be-42-hawking-temperature.js +5 -13
- package/dist/bridges/equations/be-42-hawking-temperature.js.map +1 -1
- package/dist/bridges/equations/be-43-er-epr.d.ts +7 -1
- package/dist/bridges/equations/be-43-er-epr.d.ts.map +1 -1
- package/dist/bridges/equations/be-43-er-epr.js +5 -13
- package/dist/bridges/equations/be-43-er-epr.js.map +1 -1
- package/dist/bridges/equations/be-44-soft-hair.d.ts +7 -1
- package/dist/bridges/equations/be-44-soft-hair.d.ts.map +1 -1
- package/dist/bridges/equations/be-44-soft-hair.js +5 -13
- package/dist/bridges/equations/be-44-soft-hair.js.map +1 -1
- package/dist/bridges/equations/be-45-tcc.d.ts +7 -1
- package/dist/bridges/equations/be-45-tcc.d.ts.map +1 -1
- package/dist/bridges/equations/be-45-tcc.js +10 -22
- package/dist/bridges/equations/be-45-tcc.js.map +1 -1
- package/dist/bridges/equations/be-46-multiverse-measure.d.ts +7 -1
- package/dist/bridges/equations/be-46-multiverse-measure.d.ts.map +1 -1
- package/dist/bridges/equations/be-46-multiverse-measure.js +9 -19
- package/dist/bridges/equations/be-46-multiverse-measure.js.map +1 -1
- package/dist/bridges/equations/be-47-bbn-dark-sector.d.ts +7 -1
- package/dist/bridges/equations/be-47-bbn-dark-sector.d.ts.map +1 -1
- package/dist/bridges/equations/be-47-bbn-dark-sector.js +14 -16
- package/dist/bridges/equations/be-47-bbn-dark-sector.js.map +1 -1
- package/dist/bridges/equations/be-48-grw-localization.d.ts +7 -1
- package/dist/bridges/equations/be-48-grw-localization.d.ts.map +1 -1
- package/dist/bridges/equations/be-48-grw-localization.js +15 -20
- package/dist/bridges/equations/be-48-grw-localization.js.map +1 -1
- package/dist/bridges/equations/be-49-quantum-darwinism.d.ts +7 -1
- package/dist/bridges/equations/be-49-quantum-darwinism.d.ts.map +1 -1
- package/dist/bridges/equations/be-49-quantum-darwinism.js +10 -22
- package/dist/bridges/equations/be-49-quantum-darwinism.js.map +1 -1
- package/dist/bridges/equations/be-50-wheeler-feynman.d.ts +42 -12
- package/dist/bridges/equations/be-50-wheeler-feynman.d.ts.map +1 -1
- package/dist/bridges/equations/be-50-wheeler-feynman.js +84 -20
- package/dist/bridges/equations/be-50-wheeler-feynman.js.map +1 -1
- package/dist/bridges/equations/be-53-yang-mills-beta.d.ts +158 -0
- package/dist/bridges/equations/be-53-yang-mills-beta.d.ts.map +1 -0
- package/dist/bridges/equations/be-53-yang-mills-beta.js +175 -0
- package/dist/bridges/equations/be-53-yang-mills-beta.js.map +1 -0
- package/dist/bridges/equations/be-54-randall-sundrum-brane.d.ts +117 -0
- package/dist/bridges/equations/be-54-randall-sundrum-brane.d.ts.map +1 -0
- package/dist/bridges/equations/be-54-randall-sundrum-brane.js +213 -0
- package/dist/bridges/equations/be-54-randall-sundrum-brane.js.map +1 -0
- package/dist/bridges/gravitational-lensing.d.ts +13 -2
- package/dist/bridges/gravitational-lensing.d.ts.map +1 -1
- package/dist/bridges/gravitational-lensing.js +17 -6
- package/dist/bridges/gravitational-lensing.js.map +1 -1
- package/dist/bridges/index.d.ts +40 -1
- package/dist/bridges/index.d.ts.map +1 -1
- package/dist/bridges/index.js +130 -48
- package/dist/bridges/index.js.map +1 -1
- package/dist/bridges/perihelion-precession-labeled.d.ts +46 -0
- package/dist/bridges/perihelion-precession-labeled.d.ts.map +1 -0
- package/dist/bridges/perihelion-precession-labeled.js +54 -0
- package/dist/bridges/perihelion-precession-labeled.js.map +1 -0
- package/dist/bridges/perihelion-precession.d.ts +18 -3
- package/dist/bridges/perihelion-precession.d.ts.map +1 -1
- package/dist/bridges/perihelion-precession.js +22 -8
- package/dist/bridges/perihelion-precession.js.map +1 -1
- package/dist/core/axes-registry.d.ts +67 -0
- package/dist/core/axes-registry.d.ts.map +1 -0
- package/dist/core/axes-registry.js +75 -0
- package/dist/core/axes-registry.js.map +1 -0
- package/dist/core/cell.d.ts +176 -0
- package/dist/core/cell.d.ts.map +1 -0
- package/dist/core/cell.js +166 -0
- package/dist/core/cell.js.map +1 -0
- package/dist/core/constants.d.ts +50 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +50 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/flux-rules.d.ts +176 -0
- package/dist/core/flux-rules.d.ts.map +1 -0
- package/dist/core/flux-rules.js +329 -0
- package/dist/core/flux-rules.js.map +1 -0
- package/dist/core/labeled-tensor.d.ts +143 -0
- package/dist/core/labeled-tensor.d.ts.map +1 -0
- package/dist/core/labeled-tensor.js +275 -0
- package/dist/core/labeled-tensor.js.map +1 -0
- package/dist/core/regime-registry.d.ts +169 -0
- package/dist/core/regime-registry.d.ts.map +1 -0
- package/dist/core/regime-registry.js +174 -0
- package/dist/core/regime-registry.js.map +1 -0
- package/dist/core/regime-rule-install.d.ts +26 -0
- package/dist/core/regime-rule-install.d.ts.map +1 -0
- package/dist/core/regime-rule-install.js +90 -0
- package/dist/core/regime-rule-install.js.map +1 -0
- package/dist/core/regimes-builtins.d.ts +22 -0
- package/dist/core/regimes-builtins.d.ts.map +1 -0
- package/dist/core/regimes-builtins.js +96 -0
- package/dist/core/regimes-builtins.js.map +1 -0
- package/dist/core/tensor.d.ts +112 -0
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +366 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +7 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/universal-index.d.ts +97 -0
- package/dist/core/universal-index.d.ts.map +1 -0
- package/dist/core/universal-index.js +70 -0
- package/dist/core/universal-index.js.map +1 -0
- package/dist/diff/bridge-gradient.d.ts +94 -0
- package/dist/diff/bridge-gradient.d.ts.map +1 -0
- package/dist/diff/bridge-gradient.js +83 -0
- package/dist/diff/bridge-gradient.js.map +1 -0
- package/dist/diff/bridge-specs.d.ts +68 -0
- package/dist/diff/bridge-specs.d.ts.map +1 -0
- package/dist/diff/bridge-specs.js +96 -0
- package/dist/diff/bridge-specs.js.map +1 -0
- package/dist/dimensional/bridge-check.d.ts.map +1 -1
- package/dist/dimensional/bridge-check.js +8 -0
- package/dist/dimensional/bridge-check.js.map +1 -1
- package/dist/dimensional/connection-validators.d.ts +13 -6
- package/dist/dimensional/connection-validators.d.ts.map +1 -1
- package/dist/dimensional/connection-validators.js +1 -1
- package/dist/dimensional/connection-validators.js.map +1 -1
- package/dist/dimensional/curvature-composite.d.ts +90 -0
- package/dist/dimensional/curvature-composite.d.ts.map +1 -0
- package/dist/dimensional/curvature-composite.js +57 -0
- package/dist/dimensional/curvature-composite.js.map +1 -0
- package/dist/dimensional/curvature-invariants.d.ts +90 -0
- package/dist/dimensional/curvature-invariants.d.ts.map +1 -0
- package/dist/dimensional/curvature-invariants.js +64 -0
- package/dist/dimensional/curvature-invariants.js.map +1 -0
- package/dist/dimensional/curvature.d.ts +82 -41
- package/dist/dimensional/curvature.d.ts.map +1 -1
- package/dist/dimensional/curvature.js +19 -11
- package/dist/dimensional/curvature.js.map +1 -1
- package/dist/dimensional/einstein-equation.d.ts +126 -0
- package/dist/dimensional/einstein-equation.d.ts.map +1 -0
- package/dist/dimensional/einstein-equation.js +122 -0
- package/dist/dimensional/einstein-equation.js.map +1 -0
- package/dist/dimensional/field-equation-helpers.d.ts +82 -0
- package/dist/dimensional/field-equation-helpers.d.ts.map +1 -0
- package/dist/dimensional/field-equation-helpers.js +123 -0
- package/dist/dimensional/field-equation-helpers.js.map +1 -0
- package/dist/dimensional/friedmann-equation.d.ts +148 -0
- package/dist/dimensional/friedmann-equation.d.ts.map +1 -0
- package/dist/dimensional/friedmann-equation.js +150 -0
- package/dist/dimensional/friedmann-equation.js.map +1 -0
- package/dist/dimensional/gauge-field.d.ts +182 -0
- package/dist/dimensional/gauge-field.d.ts.map +1 -0
- package/dist/dimensional/gauge-field.js +134 -0
- package/dist/dimensional/gauge-field.js.map +1 -0
- package/dist/dimensional/killing-validators.d.ts +94 -0
- package/dist/dimensional/killing-validators.d.ts.map +1 -0
- package/dist/dimensional/killing-validators.js +66 -0
- package/dist/dimensional/killing-validators.js.map +1 -0
- package/dist/dimensional/klein-gordon-equation.d.ts +113 -0
- package/dist/dimensional/klein-gordon-equation.d.ts.map +1 -0
- package/dist/dimensional/klein-gordon-equation.js +98 -0
- package/dist/dimensional/klein-gordon-equation.js.map +1 -0
- package/dist/dimensional/rg-flow.d.ts +156 -0
- package/dist/dimensional/rg-flow.d.ts.map +1 -0
- package/dist/dimensional/rg-flow.js +150 -0
- package/dist/dimensional/rg-flow.js.map +1 -0
- package/dist/dimensional/stress-energy-validators.d.ts +74 -0
- package/dist/dimensional/stress-energy-validators.d.ts.map +1 -0
- package/dist/dimensional/stress-energy-validators.js +47 -0
- package/dist/dimensional/stress-energy-validators.js.map +1 -0
- package/dist/dimensional/tensor-trace.d.ts +128 -0
- package/dist/dimensional/tensor-trace.d.ts.map +1 -0
- package/dist/dimensional/tensor-trace.js +95 -0
- package/dist/dimensional/tensor-trace.js.map +1 -0
- package/dist/dimensional/tensor.d.ts +6 -8
- package/dist/dimensional/tensor.d.ts.map +1 -1
- package/dist/dimensional/tensor.js +3 -1
- package/dist/dimensional/tensor.js.map +1 -1
- package/dist/dimensional/validator-registry.d.ts +90 -0
- package/dist/dimensional/validator-registry.d.ts.map +1 -0
- package/dist/dimensional/validator-registry.js +131 -0
- package/dist/dimensional/validator-registry.js.map +1 -0
- package/dist/dimensional/validator.d.ts +12 -2
- package/dist/dimensional/validator.d.ts.map +1 -1
- package/dist/dimensional/validator.js +60 -75
- package/dist/dimensional/validator.js.map +1 -1
- package/dist/dimensional/weyl-validators.d.ts +84 -0
- package/dist/dimensional/weyl-validators.d.ts.map +1 -0
- package/dist/dimensional/weyl-validators.js +84 -0
- package/dist/dimensional/weyl-validators.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/dist/numerical/be37-covariant-eikonal.d.ts +37 -2
- package/dist/numerical/be37-covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/be37-covariant-eikonal.js +51 -14
- package/dist/numerical/be37-covariant-eikonal.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts +49 -0
- package/dist/numerical/christoffel-flat.d.ts.map +1 -0
- package/dist/numerical/christoffel-flat.js +86 -0
- package/dist/numerical/christoffel-flat.js.map +1 -0
- package/dist/numerical/curvature-lowering-helpers.d.ts +76 -57
- package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +203 -64
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/derivative-lowering.d.ts +67 -0
- package/dist/numerical/derivative-lowering.d.ts.map +1 -0
- package/dist/numerical/derivative-lowering.js +243 -0
- package/dist/numerical/derivative-lowering.js.map +1 -0
- package/dist/numerical/einstein-equation.d.ts +106 -0
- package/dist/numerical/einstein-equation.d.ts.map +1 -0
- package/dist/numerical/einstein-equation.js +172 -0
- package/dist/numerical/einstein-equation.js.map +1 -0
- package/dist/numerical/engine-registry.js +4 -4
- package/dist/numerical/engine-registry.js.map +1 -1
- package/dist/numerical/geodesic-integrator.d.ts +7 -4
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +5 -1
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/gl4-integrator.d.ts +57 -9
- package/dist/numerical/gl4-integrator.d.ts.map +1 -1
- package/dist/numerical/gl4-integrator.js +63 -16
- package/dist/numerical/gl4-integrator.js.map +1 -1
- package/dist/numerical/killing.d.ts +157 -0
- package/dist/numerical/killing.d.ts.map +1 -0
- package/dist/numerical/killing.js +242 -0
- package/dist/numerical/killing.js.map +1 -0
- package/dist/numerical/kretschmann.d.ts +62 -0
- package/dist/numerical/kretschmann.d.ts.map +1 -0
- package/dist/numerical/kretschmann.js +88 -0
- package/dist/numerical/kretschmann.js.map +1 -0
- package/dist/numerical/lowering-utils.d.ts +47 -0
- package/dist/numerical/lowering-utils.d.ts.map +1 -0
- package/dist/numerical/lowering-utils.js +64 -0
- package/dist/numerical/lowering-utils.js.map +1 -0
- package/dist/numerical/lowering.d.ts +1 -29
- package/dist/numerical/lowering.d.ts.map +1 -1
- package/dist/numerical/lowering.js +226 -415
- package/dist/numerical/lowering.js.map +1 -1
- package/dist/numerical/mathts-engine.js +8 -8
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +28 -0
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ic.d.ts +40 -0
- package/dist/numerical/null-ic.d.ts.map +1 -0
- package/dist/numerical/null-ic.js +50 -0
- package/dist/numerical/null-ic.js.map +1 -0
- package/dist/numerical/null-ray-integrator.d.ts +3 -2
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +6 -3
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.d.ts +74 -0
- package/dist/numerical/painleve-gullstrand-metric.d.ts.map +1 -0
- package/dist/numerical/painleve-gullstrand-metric.js +121 -0
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -0
- package/dist/numerical/pderiv.d.ts +35 -3
- package/dist/numerical/pderiv.d.ts.map +1 -1
- package/dist/numerical/pderiv.js +47 -12
- package/dist/numerical/pderiv.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +57 -0
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +57 -0
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/tensor-engine.d.ts +2 -2
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/weyl-lowering.d.ts +60 -0
- package/dist/numerical/weyl-lowering.d.ts.map +1 -0
- package/dist/numerical/weyl-lowering.js +111 -0
- package/dist/numerical/weyl-lowering.js.map +1 -0
- package/package.json +9 -7
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed `Cell` discriminated union for `UniversalTensor`'s cell storage.
|
|
3
|
+
*
|
|
4
|
+
* Three variants — `LawCell`, `BridgeCell`, `EmergenceCell` — each
|
|
5
|
+
* carrying a `kind` discriminator that lets TypeScript narrow to the
|
|
6
|
+
* specific variant at every consumption site. Mirrors the v0.6.1
|
|
7
|
+
* validator-registry's discriminated-union pattern at
|
|
8
|
+
* `src/dimensional/validator-registry.ts`.
|
|
9
|
+
*
|
|
10
|
+
* Design doc: `docs/planning/v0.7-Proposal-3-Design.md`.
|
|
11
|
+
* Review findings: `docs/planning/v0.7-Proposal-3-Review-Findings.md`.
|
|
12
|
+
*
|
|
13
|
+
* Migration relationship to `src/core/types.ts`:
|
|
14
|
+
* - `PhysicalLaw` ↔ `LawCell` (field-shape faithful; `confidence`
|
|
15
|
+
* flips `number` → string-literal union)
|
|
16
|
+
* - `BridgeEquation` ↔ `BridgeCell` (same migration)
|
|
17
|
+
* - `EmergentPhenomenon` ↔ `EmergenceCell` (same migration)
|
|
18
|
+
*
|
|
19
|
+
* The old interfaces are NOT deleted and NOT `@deprecated`-tagged in
|
|
20
|
+
* this sprint (per Eve-R2 + the Phase 0 consumer-import census:
|
|
21
|
+
* 4 in-repo sites still use them). A future v0.7.x sprint migrates
|
|
22
|
+
* those consumers and then adds `@deprecated`.
|
|
23
|
+
*
|
|
24
|
+
* **No `confidenceToStatus` adapter is shipped** (per Eve-R3). The
|
|
25
|
+
* 42-bridge catalog has BOTH a numeric `confidence` AND a curated
|
|
26
|
+
* string `status` field, set independently; an adapter would
|
|
27
|
+
* produce labels that contradict the catalog curation
|
|
28
|
+
* (e.g. `status: 'established'` + `confidence: 0.7` → adapter
|
|
29
|
+
* returns `'speculative'`). Callers must pass the string explicitly
|
|
30
|
+
* at cell-construction sites.
|
|
31
|
+
*
|
|
32
|
+
* @module core/cell
|
|
33
|
+
*/
|
|
34
|
+
import type { PhysicalScale, Force, Symmetry, InformationMeasure, TensorIndices, TensorConfig, PhysicalLaw, BridgeEquation, EmergentPhenomenon } from './types.js';
|
|
35
|
+
import { UniversalTensor } from './tensor.js';
|
|
36
|
+
/**
|
|
37
|
+
* Epistemic confidence vocabulary for `Cell` variants. Matches the
|
|
38
|
+
* `'established' | 'speculative' | 'highly-speculative'` portion of
|
|
39
|
+
* `BridgeEquationStatus` from `src/bridges/index.ts:42-46`, minus
|
|
40
|
+
* `'invalid'` — cells in the tensor are by definition active; invalid
|
|
41
|
+
* catalog entries should not be added.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export type CellConfidence = 'established' | 'speculative' | 'highly-speculative';
|
|
46
|
+
/**
|
|
47
|
+
* Fields common to every `Cell` variant. Each variant extends this
|
|
48
|
+
* with a `kind` discriminator and variant-specific fields. The
|
|
49
|
+
* `equation` field carries LaTeX-formatted mathematical content
|
|
50
|
+
* (matching the existing `PhysicalLaw.equation` / `BridgeEquation.
|
|
51
|
+
* equation` convention).
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
export interface CellBase {
|
|
56
|
+
/** Unique identifier within the parent `UniversalTensor`. */
|
|
57
|
+
readonly id: string;
|
|
58
|
+
/** Epistemic confidence vocabulary (see `CellConfidence`). */
|
|
59
|
+
readonly confidence: CellConfidence;
|
|
60
|
+
/** Mathematical formulation (LaTeX). */
|
|
61
|
+
readonly equation: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Cell variant representing a known physical law. 1:1 field-shape
|
|
65
|
+
* correspondence with `PhysicalLaw` from `src/core/types.ts:88`,
|
|
66
|
+
* except `confidence` is the string vocabulary (not `number`) and
|
|
67
|
+
* the discriminator `kind: 'law'` is added.
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export interface LawCell extends CellBase {
|
|
72
|
+
readonly kind: 'law';
|
|
73
|
+
readonly name: string;
|
|
74
|
+
readonly scales: ReadonlyArray<PhysicalScale>;
|
|
75
|
+
readonly forces: ReadonlyArray<Force>;
|
|
76
|
+
readonly symmetries: ReadonlyArray<Symmetry>;
|
|
77
|
+
readonly informationMeasures?: ReadonlyArray<InformationMeasure>;
|
|
78
|
+
readonly dimensions?: ReadonlyArray<number>;
|
|
79
|
+
readonly topologies?: ReadonlyArray<number>;
|
|
80
|
+
readonly references?: ReadonlyArray<string>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Cell variant representing a bridge equation between regimes. 1:1
|
|
84
|
+
* field-shape correspondence with `BridgeEquation` from
|
|
85
|
+
* `src/core/types.ts:126`, except `confidence` is the string
|
|
86
|
+
* vocabulary and the discriminator `kind: 'bridge'` is added.
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export interface BridgeCell extends CellBase {
|
|
91
|
+
readonly kind: 'bridge';
|
|
92
|
+
readonly name: string;
|
|
93
|
+
readonly source: TensorIndices;
|
|
94
|
+
readonly target: TensorIndices;
|
|
95
|
+
readonly validated: boolean;
|
|
96
|
+
readonly description: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Cell variant representing an emergent phenomenon. 1:1 field-shape
|
|
100
|
+
* correspondence with `EmergentPhenomenon` from `src/core/types.ts:155`,
|
|
101
|
+
* except `confidence` is the string vocabulary and the discriminator
|
|
102
|
+
* `kind: 'emergence'` is added. Note: the old interface uses
|
|
103
|
+
* `description` for the mathematical content; `EmergenceCell` carries
|
|
104
|
+
* it as both `equation` (inherited from `CellBase`, mandatory) and
|
|
105
|
+
* `description` (kept for prose-context fidelity, optional).
|
|
106
|
+
*
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
export interface EmergenceCell extends CellBase {
|
|
110
|
+
readonly kind: 'emergence';
|
|
111
|
+
readonly name: string;
|
|
112
|
+
readonly order: number;
|
|
113
|
+
readonly indices: ReadonlyArray<TensorIndices>;
|
|
114
|
+
readonly description?: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The disjoint union of all `Cell` variants. Consumers narrow via
|
|
118
|
+
* `switch (cell.kind)` with an exhaustive `_exhaustive: never` arm.
|
|
119
|
+
*
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
export type Cell = LawCell | BridgeCell | EmergenceCell;
|
|
123
|
+
/**
|
|
124
|
+
* Factory: build a populated `UniversalTensor` from three typed cell
|
|
125
|
+
* arrays plus a `TensorConfig`.
|
|
126
|
+
*
|
|
127
|
+
* Makes the "'+' in Π = L + B + E is disjoint union, not algebraic"
|
|
128
|
+
* invariant concrete: the only way to construct a populated
|
|
129
|
+
* `UniversalTensor` from typed cells is to pass three typed arrays.
|
|
130
|
+
* There is no `add(c1: Cell, c2: Cell): Cell` because cells never
|
|
131
|
+
* compose at the cell level — composition happens at the tensor
|
|
132
|
+
* level (Proposals 2 and 6 territory).
|
|
133
|
+
*
|
|
134
|
+
* **Provenance note**: the proposals doc §4.2 line 299 sketches
|
|
135
|
+
* `compose(L, B, E): UniversalTensor` without a `config` argument.
|
|
136
|
+
* This signature closes a proposals-doc gap — `UniversalTensor`'s
|
|
137
|
+
* constructor requires `rank` / `scales` / `forces`, none of which
|
|
138
|
+
* can be inferred from the three cell arrays alone. `compose` is
|
|
139
|
+
* this sprint's invention, not a proposals-doc commitment.
|
|
140
|
+
*
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
export declare function compose(laws: ReadonlyArray<LawCell>, bridges: ReadonlyArray<BridgeCell>, emergences: ReadonlyArray<EmergenceCell>, config: TensorConfig): UniversalTensor;
|
|
144
|
+
/**
|
|
145
|
+
* Inverse of `statusToConfidenceNumber` at tensor.ts:48-58. Buckets a
|
|
146
|
+
* numeric confidence in [0,1] back to the string vocabulary. Used by
|
|
147
|
+
* the inverse adapters below.
|
|
148
|
+
*
|
|
149
|
+
* @internal
|
|
150
|
+
*/
|
|
151
|
+
export declare function numberToCellConfidence(n: number): CellConfidence;
|
|
152
|
+
/**
|
|
153
|
+
* Adapter: `PhysicalLaw` (legacy) → `LawCell`. Used by
|
|
154
|
+
* `UniversalTensor.populatedCells()`.
|
|
155
|
+
*
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
export declare function lawToCell(law: PhysicalLaw): LawCell;
|
|
159
|
+
/**
|
|
160
|
+
* Adapter: `BridgeEquation` (legacy) → `BridgeCell`. Used by
|
|
161
|
+
* `UniversalTensor.populatedCells()`.
|
|
162
|
+
*
|
|
163
|
+
* @internal
|
|
164
|
+
*/
|
|
165
|
+
export declare function bridgeToCell(b: BridgeEquation): BridgeCell;
|
|
166
|
+
/**
|
|
167
|
+
* Adapter: `EmergentPhenomenon` (legacy) → `EmergenceCell`. The
|
|
168
|
+
* legacy `description` field holds the mathematical content (LaTeX);
|
|
169
|
+
* we surface it as `equation` and leave `description` undefined
|
|
170
|
+
* unless the legacy entry had a "math\n\nprose" split (per the
|
|
171
|
+
* forward `cellToEmergence` adapter convention).
|
|
172
|
+
*
|
|
173
|
+
* @internal
|
|
174
|
+
*/
|
|
175
|
+
export declare function emergenceToCell(p: EmergentPhenomenon): EmergenceCell;
|
|
176
|
+
//# sourceMappingURL=cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../src/core/cell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,KAAK,EACL,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,cAAc,EACd,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,aAAa,GACb,oBAAoB,CAAC;AAEzB;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,8DAA8D;IAC9D,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IAEpC,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,OAAQ,SAAQ,QAAQ;IACvC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACtC,QAAQ,CAAC,UAA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MAAM,EAAE,YAAY,GACnB,eAAe,CAMjB;AAsBD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,GAAG,cAAc,CAIhE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAenD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,cAAc,GAAG,UAAU,CAY1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,kBAAkB,GAAG,aAAa,CAkBpE"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed `Cell` discriminated union for `UniversalTensor`'s cell storage.
|
|
3
|
+
*
|
|
4
|
+
* Three variants — `LawCell`, `BridgeCell`, `EmergenceCell` — each
|
|
5
|
+
* carrying a `kind` discriminator that lets TypeScript narrow to the
|
|
6
|
+
* specific variant at every consumption site. Mirrors the v0.6.1
|
|
7
|
+
* validator-registry's discriminated-union pattern at
|
|
8
|
+
* `src/dimensional/validator-registry.ts`.
|
|
9
|
+
*
|
|
10
|
+
* Design doc: `docs/planning/v0.7-Proposal-3-Design.md`.
|
|
11
|
+
* Review findings: `docs/planning/v0.7-Proposal-3-Review-Findings.md`.
|
|
12
|
+
*
|
|
13
|
+
* Migration relationship to `src/core/types.ts`:
|
|
14
|
+
* - `PhysicalLaw` ↔ `LawCell` (field-shape faithful; `confidence`
|
|
15
|
+
* flips `number` → string-literal union)
|
|
16
|
+
* - `BridgeEquation` ↔ `BridgeCell` (same migration)
|
|
17
|
+
* - `EmergentPhenomenon` ↔ `EmergenceCell` (same migration)
|
|
18
|
+
*
|
|
19
|
+
* The old interfaces are NOT deleted and NOT `@deprecated`-tagged in
|
|
20
|
+
* this sprint (per Eve-R2 + the Phase 0 consumer-import census:
|
|
21
|
+
* 4 in-repo sites still use them). A future v0.7.x sprint migrates
|
|
22
|
+
* those consumers and then adds `@deprecated`.
|
|
23
|
+
*
|
|
24
|
+
* **No `confidenceToStatus` adapter is shipped** (per Eve-R3). The
|
|
25
|
+
* 42-bridge catalog has BOTH a numeric `confidence` AND a curated
|
|
26
|
+
* string `status` field, set independently; an adapter would
|
|
27
|
+
* produce labels that contradict the catalog curation
|
|
28
|
+
* (e.g. `status: 'established'` + `confidence: 0.7` → adapter
|
|
29
|
+
* returns `'speculative'`). Callers must pass the string explicitly
|
|
30
|
+
* at cell-construction sites.
|
|
31
|
+
*
|
|
32
|
+
* @module core/cell
|
|
33
|
+
*/
|
|
34
|
+
import { UniversalTensor } from './tensor.js';
|
|
35
|
+
/**
|
|
36
|
+
* Factory: build a populated `UniversalTensor` from three typed cell
|
|
37
|
+
* arrays plus a `TensorConfig`.
|
|
38
|
+
*
|
|
39
|
+
* Makes the "'+' in Π = L + B + E is disjoint union, not algebraic"
|
|
40
|
+
* invariant concrete: the only way to construct a populated
|
|
41
|
+
* `UniversalTensor` from typed cells is to pass three typed arrays.
|
|
42
|
+
* There is no `add(c1: Cell, c2: Cell): Cell` because cells never
|
|
43
|
+
* compose at the cell level — composition happens at the tensor
|
|
44
|
+
* level (Proposals 2 and 6 territory).
|
|
45
|
+
*
|
|
46
|
+
* **Provenance note**: the proposals doc §4.2 line 299 sketches
|
|
47
|
+
* `compose(L, B, E): UniversalTensor` without a `config` argument.
|
|
48
|
+
* This signature closes a proposals-doc gap — `UniversalTensor`'s
|
|
49
|
+
* constructor requires `rank` / `scales` / `forces`, none of which
|
|
50
|
+
* can be inferred from the three cell arrays alone. `compose` is
|
|
51
|
+
* this sprint's invention, not a proposals-doc commitment.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
export function compose(laws, bridges, emergences, config) {
|
|
56
|
+
const tensor = new UniversalTensor(config);
|
|
57
|
+
for (const law of laws)
|
|
58
|
+
tensor.addCell(law);
|
|
59
|
+
for (const bridge of bridges)
|
|
60
|
+
tensor.addCell(bridge);
|
|
61
|
+
for (const emergence of emergences)
|
|
62
|
+
tensor.addCell(emergence);
|
|
63
|
+
return tensor;
|
|
64
|
+
}
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// Inverse adapters (legacy interface → Cell variant)
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Used by UniversalTensor.populatedCells() (Phase 2 Task 2.1) to resolve
|
|
69
|
+
// stored cell-IDs back to Cell objects. Counterparts to the forward
|
|
70
|
+
// adapters (cellToLaw / cellToBridge / cellToEmergence) at tensor.ts.
|
|
71
|
+
//
|
|
72
|
+
// The numeric `confidence: number` from the legacy interfaces is bucketed
|
|
73
|
+
// back into the string vocabulary via `numberToCellConfidence`. This is
|
|
74
|
+
// the lossy direction Eve-R3 flagged — but in THIS direction, the call
|
|
75
|
+
// site is "we have a legacy entry that was already in the tensor; bucket
|
|
76
|
+
// its numeric confidence into the closest string label". Per Decision #6
|
|
77
|
+
// fan-out semantics, this can only happen for entries that round-tripped
|
|
78
|
+
// through `addCell` (where the original string was authoritative) OR
|
|
79
|
+
// entries added via the legacy `addLaw`/`addBridge`/`addEmergence` paths
|
|
80
|
+
// (where the consumer chose a number directly). The bucketing matches
|
|
81
|
+
// the forward `statusToConfidenceNumber` in tensor.ts: 0.95→established,
|
|
82
|
+
// 0.6→speculative, 0.3→highly-speculative; thresholds chosen to make
|
|
83
|
+
// the standard round-trip exact.
|
|
84
|
+
/**
|
|
85
|
+
* Inverse of `statusToConfidenceNumber` at tensor.ts:48-58. Buckets a
|
|
86
|
+
* numeric confidence in [0,1] back to the string vocabulary. Used by
|
|
87
|
+
* the inverse adapters below.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export function numberToCellConfidence(n) {
|
|
92
|
+
if (n >= 0.8)
|
|
93
|
+
return 'established';
|
|
94
|
+
if (n >= 0.4)
|
|
95
|
+
return 'speculative';
|
|
96
|
+
return 'highly-speculative';
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Adapter: `PhysicalLaw` (legacy) → `LawCell`. Used by
|
|
100
|
+
* `UniversalTensor.populatedCells()`.
|
|
101
|
+
*
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
export function lawToCell(law) {
|
|
105
|
+
return {
|
|
106
|
+
kind: 'law',
|
|
107
|
+
id: law.id,
|
|
108
|
+
name: law.name,
|
|
109
|
+
equation: law.equation,
|
|
110
|
+
confidence: numberToCellConfidence(law.confidence),
|
|
111
|
+
scales: law.scales,
|
|
112
|
+
forces: law.forces,
|
|
113
|
+
symmetries: law.symmetries,
|
|
114
|
+
...(law.informationMeasures ? { informationMeasures: law.informationMeasures } : {}),
|
|
115
|
+
...(law.dimensions ? { dimensions: law.dimensions } : {}),
|
|
116
|
+
...(law.topologies ? { topologies: law.topologies } : {}),
|
|
117
|
+
...(law.references ? { references: law.references } : {}),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Adapter: `BridgeEquation` (legacy) → `BridgeCell`. Used by
|
|
122
|
+
* `UniversalTensor.populatedCells()`.
|
|
123
|
+
*
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
126
|
+
export function bridgeToCell(b) {
|
|
127
|
+
return {
|
|
128
|
+
kind: 'bridge',
|
|
129
|
+
id: b.id,
|
|
130
|
+
name: b.name,
|
|
131
|
+
equation: b.equation,
|
|
132
|
+
confidence: numberToCellConfidence(b.confidence),
|
|
133
|
+
source: b.source,
|
|
134
|
+
target: b.target,
|
|
135
|
+
validated: b.validated,
|
|
136
|
+
description: b.description,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Adapter: `EmergentPhenomenon` (legacy) → `EmergenceCell`. The
|
|
141
|
+
* legacy `description` field holds the mathematical content (LaTeX);
|
|
142
|
+
* we surface it as `equation` and leave `description` undefined
|
|
143
|
+
* unless the legacy entry had a "math\n\nprose" split (per the
|
|
144
|
+
* forward `cellToEmergence` adapter convention).
|
|
145
|
+
*
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
export function emergenceToCell(p) {
|
|
149
|
+
// Split convention: if description contains "\n\n", treat the part
|
|
150
|
+
// before as equation and after as prose; otherwise the whole field
|
|
151
|
+
// is the equation.
|
|
152
|
+
const splitIdx = p.description.indexOf('\n\n');
|
|
153
|
+
const equation = splitIdx === -1 ? p.description : p.description.slice(0, splitIdx);
|
|
154
|
+
const description = splitIdx === -1 ? undefined : p.description.slice(splitIdx + 2);
|
|
155
|
+
return {
|
|
156
|
+
kind: 'emergence',
|
|
157
|
+
id: p.id,
|
|
158
|
+
name: p.name,
|
|
159
|
+
equation,
|
|
160
|
+
confidence: numberToCellConfidence(p.confidence),
|
|
161
|
+
order: p.order,
|
|
162
|
+
indices: p.indices,
|
|
163
|
+
...(description ? { description } : {}),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=cell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../src/core/cell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAaH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAoG9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,OAAO,CACrB,IAA4B,EAC5B,OAAkC,EAClC,UAAwC,EACxC,MAAoB;IAEpB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3C,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,KAAK,MAAM,SAAS,IAAI,UAAU;QAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC9D,OAAO,MAAM,CA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BAAsB,CAAC,CAAC,CAAC,UAAU,CAAC;QAChD,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical CODATA 2018 + SI-defined physical constants for UPT (v0.5.1).
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for fundamental physical constants used across the
|
|
5
|
+
* numerical, dimensional, and bridge layers. Replaces the truncated local
|
|
6
|
+
* literals (`c_SI = 2.998e8`, etc.) that drifted across `src/numerical/`,
|
|
7
|
+
* `src/bridges/`, and `tests/fixtures/` — see audit `PC-1` in
|
|
8
|
+
* `docs/architecture/v0.5.1-audit.md`.
|
|
9
|
+
*
|
|
10
|
+
* Values use:
|
|
11
|
+
* • Exact-SI definitions (`C_SI`, `H_SI`, `K_B_SI`, `E_SI`) where the
|
|
12
|
+
* 2019 SI redefinition fixed their values exactly.
|
|
13
|
+
* • CODATA 2018 best estimates for measured constants (`G_SI`, `HBAR_SI`,
|
|
14
|
+
* `ALPHA`, Planck units).
|
|
15
|
+
* • Planck 2018 best estimate for `H0_SI`.
|
|
16
|
+
*
|
|
17
|
+
* The `PhysicalConstants` namespace in `src/core/types.ts` is retained for
|
|
18
|
+
* backwards-compat; new code should prefer these flat exports.
|
|
19
|
+
*
|
|
20
|
+
* @module core/constants
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
/** Speed of light in vacuum (m/s). Exact SI definition since 1983. */
|
|
24
|
+
export declare const C_SI = 299792458;
|
|
25
|
+
/** Newtonian gravitational constant (m³ kg⁻¹ s⁻²). CODATA 2018. */
|
|
26
|
+
export declare const G_SI = 6.6743e-11;
|
|
27
|
+
/** Planck constant (J·s). Exact SI definition since 2019. */
|
|
28
|
+
export declare const H_SI = 6.62607015e-34;
|
|
29
|
+
/** Reduced Planck constant h/(2π) (J·s). CODATA 2018. */
|
|
30
|
+
export declare const HBAR_SI = 1.054571817e-34;
|
|
31
|
+
/** Boltzmann constant (J/K). Exact SI definition since 2019. */
|
|
32
|
+
export declare const K_B_SI = 1.380649e-23;
|
|
33
|
+
/** Elementary charge (C). Exact SI definition since 2019. */
|
|
34
|
+
export declare const E_SI = 1.602176634e-19;
|
|
35
|
+
/** Fine-structure constant α (dimensionless). CODATA 2018. */
|
|
36
|
+
export declare const ALPHA = 0.0072973525693;
|
|
37
|
+
/** Planck mass √(ℏc/G) (kg). CODATA 2018. */
|
|
38
|
+
export declare const M_P_SI = 2.176434e-8;
|
|
39
|
+
/** Planck length √(ℏG/c³) (m). CODATA 2018. */
|
|
40
|
+
export declare const L_P_SI = 1.616255e-35;
|
|
41
|
+
/** Planck time √(ℏG/c⁵) (s). CODATA 2018. */
|
|
42
|
+
export declare const T_P_SI = 5.391247e-44;
|
|
43
|
+
/**
|
|
44
|
+
* Hubble parameter H₀ (s⁻¹).
|
|
45
|
+
*
|
|
46
|
+
* Planck 2018 TT,TE,EE+lowE+lensing best estimate: 67.4 km/s/Mpc, converted
|
|
47
|
+
* to SI using 1 Mpc = 3.0857×10²² m.
|
|
48
|
+
*/
|
|
49
|
+
export declare const H0_SI: number;
|
|
50
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,sEAAsE;AACtE,eAAO,MAAM,IAAI,YAAY,CAAC;AAE9B,mEAAmE;AACnE,eAAO,MAAM,IAAI,aAAc,CAAC;AAEhC,6DAA6D;AAC7D,eAAO,MAAM,IAAI,iBAAiB,CAAC;AAEnC,yDAAyD;AACzD,eAAO,MAAM,OAAO,kBAAkB,CAAC;AAEvC,gEAAgE;AAChE,eAAO,MAAM,MAAM,eAAe,CAAC;AAEnC,6DAA6D;AAC7D,eAAO,MAAM,IAAI,kBAAkB,CAAC;AAEpC,8DAA8D;AAC9D,eAAO,MAAM,KAAK,kBAAkB,CAAC;AAErC,6CAA6C;AAC7C,eAAO,MAAM,MAAM,cAAc,CAAC;AAElC,+CAA+C;AAC/C,eAAO,MAAM,MAAM,eAAe,CAAC;AAEnC,6CAA6C;AAC7C,eAAO,MAAM,MAAM,eAAe,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,QAAqB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical CODATA 2018 + SI-defined physical constants for UPT (v0.5.1).
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for fundamental physical constants used across the
|
|
5
|
+
* numerical, dimensional, and bridge layers. Replaces the truncated local
|
|
6
|
+
* literals (`c_SI = 2.998e8`, etc.) that drifted across `src/numerical/`,
|
|
7
|
+
* `src/bridges/`, and `tests/fixtures/` — see audit `PC-1` in
|
|
8
|
+
* `docs/architecture/v0.5.1-audit.md`.
|
|
9
|
+
*
|
|
10
|
+
* Values use:
|
|
11
|
+
* • Exact-SI definitions (`C_SI`, `H_SI`, `K_B_SI`, `E_SI`) where the
|
|
12
|
+
* 2019 SI redefinition fixed their values exactly.
|
|
13
|
+
* • CODATA 2018 best estimates for measured constants (`G_SI`, `HBAR_SI`,
|
|
14
|
+
* `ALPHA`, Planck units).
|
|
15
|
+
* • Planck 2018 best estimate for `H0_SI`.
|
|
16
|
+
*
|
|
17
|
+
* The `PhysicalConstants` namespace in `src/core/types.ts` is retained for
|
|
18
|
+
* backwards-compat; new code should prefer these flat exports.
|
|
19
|
+
*
|
|
20
|
+
* @module core/constants
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
/** Speed of light in vacuum (m/s). Exact SI definition since 1983. */
|
|
24
|
+
export const C_SI = 299792458;
|
|
25
|
+
/** Newtonian gravitational constant (m³ kg⁻¹ s⁻²). CODATA 2018. */
|
|
26
|
+
export const G_SI = 6.67430e-11;
|
|
27
|
+
/** Planck constant (J·s). Exact SI definition since 2019. */
|
|
28
|
+
export const H_SI = 6.62607015e-34;
|
|
29
|
+
/** Reduced Planck constant h/(2π) (J·s). CODATA 2018. */
|
|
30
|
+
export const HBAR_SI = 1.054571817e-34;
|
|
31
|
+
/** Boltzmann constant (J/K). Exact SI definition since 2019. */
|
|
32
|
+
export const K_B_SI = 1.380649e-23;
|
|
33
|
+
/** Elementary charge (C). Exact SI definition since 2019. */
|
|
34
|
+
export const E_SI = 1.602176634e-19;
|
|
35
|
+
/** Fine-structure constant α (dimensionless). CODATA 2018. */
|
|
36
|
+
export const ALPHA = 7.2973525693e-3;
|
|
37
|
+
/** Planck mass √(ℏc/G) (kg). CODATA 2018. */
|
|
38
|
+
export const M_P_SI = 2.176434e-8;
|
|
39
|
+
/** Planck length √(ℏG/c³) (m). CODATA 2018. */
|
|
40
|
+
export const L_P_SI = 1.616255e-35;
|
|
41
|
+
/** Planck time √(ℏG/c⁵) (s). CODATA 2018. */
|
|
42
|
+
export const T_P_SI = 5.391247e-44;
|
|
43
|
+
/**
|
|
44
|
+
* Hubble parameter H₀ (s⁻¹).
|
|
45
|
+
*
|
|
46
|
+
* Planck 2018 TT,TE,EE+lowE+lensing best estimate: 67.4 km/s/Mpc, converted
|
|
47
|
+
* to SI using 1 Mpc = 3.0857×10²² m.
|
|
48
|
+
*/
|
|
49
|
+
export const H0_SI = 67.4e3 / 3.0857e22;
|
|
50
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,sEAAsE;AACtE,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC;AAE9B,mEAAmE;AACnE,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;AAEhC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC;AAEnC,yDAAyD;AACzD,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAEvC,gEAAgE;AAChE,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AAEnC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC;AAEpC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC;AAErC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC;AAElC,+CAA+C;AAC/C,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AAEnC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flux-rule scaffolding for v0.7 Proposal 2 — Sparse Semantic Catalog.
|
|
3
|
+
*
|
|
4
|
+
* Defines:
|
|
5
|
+
* - `FluxRuleKind` discriminated tag (@internal)
|
|
6
|
+
* - `FluxRule`, `FluxRuleResult` registry shapes (@internal)
|
|
7
|
+
* - `FluxDiagnostic`, `FluxReport` consumer shapes (@public)
|
|
8
|
+
* - `FluxViolationError` (@public) thrown on ERROR-tier rule failures
|
|
9
|
+
* - Rule 2 (L/B/E coordinate matching) and Rule 3 (Causality) — pure
|
|
10
|
+
* functions over `Cell` / `BridgeCell`
|
|
11
|
+
* - `runRules(cell, rules)` dispatcher with `_exhaustive: never`
|
|
12
|
+
*
|
|
13
|
+
* Rule 1 (Dimensional Consistency) ships in Phase 3 alongside the
|
|
14
|
+
* catalog adapter — it operates on `BridgeEquationEntry`, not `Cell`,
|
|
15
|
+
* per Decision #3 (resolves Adam-V3).
|
|
16
|
+
*
|
|
17
|
+
* Design: docs/planning/v0.7-Proposal-2-Design.md (redraft commit
|
|
18
|
+
* 01632b5). Decisions #5, #6, #8 are load-bearing here.
|
|
19
|
+
*
|
|
20
|
+
* @module core/flux-rules
|
|
21
|
+
*/
|
|
22
|
+
import type { Cell } from './cell.js';
|
|
23
|
+
/**
|
|
24
|
+
* A single rule-evaluation outcome surfaced to consumers via
|
|
25
|
+
* `fluxDiagnostics()` or `FluxViolationError`. Severity follows the
|
|
26
|
+
* info/warning/error tiering pinned in the design.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export interface FluxDiagnostic {
|
|
31
|
+
readonly severity: 'info' | 'warning' | 'error';
|
|
32
|
+
readonly ruleName: FluxRuleKind;
|
|
33
|
+
readonly cellId: string;
|
|
34
|
+
readonly message: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Aggregated report returned by `runRules()` / consumer-facing
|
|
38
|
+
* `fluxDiagnostics()`. Per-tier counts are pre-computed for cheap
|
|
39
|
+
* consumer-side branching.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export interface FluxReport {
|
|
44
|
+
readonly diagnostics: ReadonlyArray<FluxDiagnostic>;
|
|
45
|
+
readonly errorCount: number;
|
|
46
|
+
readonly warningCount: number;
|
|
47
|
+
readonly infoCount: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Thrown from `UniversalTensor.addCell` (Phase 2) when a Rule 2
|
|
51
|
+
* (L/B/E coordinate-matching) violation fires. Rule 2 is ERROR-tier:
|
|
52
|
+
* a `BridgeCell` with `source === target`, a `LawCell` with empty
|
|
53
|
+
* `scales × forces`, or an `EmergenceCell` with `indices.length < 2`
|
|
54
|
+
* fail-atomic.
|
|
55
|
+
*
|
|
56
|
+
* Rule 3 (Causality) does NOT throw — it's WARNING-tier in v0.7 per
|
|
57
|
+
* the proposals doc §3.3.3 (promotion to ERROR deferred to v0.8).
|
|
58
|
+
*
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export declare class FluxViolationError extends Error {
|
|
62
|
+
readonly ruleName: FluxRuleKind;
|
|
63
|
+
readonly cellId: string;
|
|
64
|
+
constructor(ruleName: FluxRuleKind, cellId: string, message: string);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Discriminated tag for the in-tree flux rules. Adding a new rule
|
|
68
|
+
* kind forces a compile-time update to every `switch` over this
|
|
69
|
+
* union via the `_exhaustive: never` discipline.
|
|
70
|
+
*
|
|
71
|
+
* - v0.7 (P2): `'dimensional-consistency' | 'lbe-coordinate' | 'causality'`
|
|
72
|
+
* - v0.8 (P5): adds `'regime-consistency'` — fires from `addCell`
|
|
73
|
+
* when a cell's attached regimes contradict the cell's coordinate
|
|
74
|
+
* axes (e.g., a `LawCell` with `scales: ['classical']` attached
|
|
75
|
+
* to a `quantum` regime via `attachRegimesToCell`).
|
|
76
|
+
*
|
|
77
|
+
* @internal — coupled to the registry's dispatch shape; not part of
|
|
78
|
+
* the v0.7 public-API contract.
|
|
79
|
+
*/
|
|
80
|
+
export type FluxRuleKind = 'dimensional-consistency' | 'lbe-coordinate' | 'causality' | 'regime-consistency';
|
|
81
|
+
/**
|
|
82
|
+
* Result returned by a single rule's `check()` body. `ok: true` means
|
|
83
|
+
* the rule passed; `ok: false` means the rule violated. A diagnostic
|
|
84
|
+
* may be attached on either path (`'info'` diagnostics ride with
|
|
85
|
+
* `ok: true`; `'warning'` and `'error'` diagnostics ride with
|
|
86
|
+
* `ok: false`).
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export interface FluxRuleResult {
|
|
91
|
+
readonly ok: boolean;
|
|
92
|
+
readonly diagnostic?: FluxDiagnostic;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A registered rule. The `check()` body is a pure function over
|
|
96
|
+
* `Cell` (or a sub-variant if the rule only fires on one `kind`).
|
|
97
|
+
*
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
export interface FluxRule {
|
|
101
|
+
readonly kind: FluxRuleKind;
|
|
102
|
+
readonly check: (cell: Cell) => FluxRuleResult;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Pure dispatcher for Rule 2 over the `Cell` discriminated union.
|
|
106
|
+
* The three arms enforce the cell-shape invariants:
|
|
107
|
+
*
|
|
108
|
+
* - `LawCell` is diagonal: `scales × forces` cross-product must be
|
|
109
|
+
* non-empty.
|
|
110
|
+
* - `BridgeCell` is off-diagonal: `source !== target` by at least
|
|
111
|
+
* one axis (already enforced by the legacy `addBridge` —
|
|
112
|
+
* Rule 2 piggybacks for registry exhaustiveness).
|
|
113
|
+
* - `EmergenceCell` spans multi-coordinate: `indices.length >= 2`.
|
|
114
|
+
*
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
export declare function checkLBECoordinate(cell: Cell): FluxRuleResult;
|
|
118
|
+
/**
|
|
119
|
+
* Pure dispatcher for Rule 3 over the `Cell` discriminated union.
|
|
120
|
+
* Rule 3 only fires on `'bridge'`; the other arms always pass.
|
|
121
|
+
*
|
|
122
|
+
* Body for the bridge arm per Decision #5:
|
|
123
|
+
* 1. Read `src = cell.source.scale`, `dst = cell.target.scale`.
|
|
124
|
+
* 2. If either is `undefined`, emit `'info'` ("scale-unspecified
|
|
125
|
+
* skip"); the rule still passes (`ok: true`).
|
|
126
|
+
* 3. If `arrow = classifyArrow(src, dst) === 'reverse'`, emit a
|
|
127
|
+
* `'warning'` diagnostic recommending audit. Rule still passes
|
|
128
|
+
* (Rule 3 is WARNING tier in v0.7; promotion to ERROR deferred
|
|
129
|
+
* to v0.8).
|
|
130
|
+
* 4. Suppression via the private `causalityWhitelist` (empty in
|
|
131
|
+
* v0.7).
|
|
132
|
+
*
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
135
|
+
export declare function checkCausality(cell: Cell): FluxRuleResult;
|
|
136
|
+
/**
|
|
137
|
+
* Run a set of rules against a single `cell` and aggregate the
|
|
138
|
+
* diagnostics into a `FluxReport`. Pure function — no I/O, no
|
|
139
|
+
* shared-state mutation.
|
|
140
|
+
*
|
|
141
|
+
* The switch over `FluxRuleKind` is exhaustive via the
|
|
142
|
+
* `_exhaustive: never` default arm (Decision #8). Adding a new rule
|
|
143
|
+
* kind forces a compile-time update here AND at every consumer
|
|
144
|
+
* site that branches on `FluxRuleKind`.
|
|
145
|
+
*
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
export declare function runRules(cell: Cell, rules: ReadonlyArray<FluxRule>): FluxReport;
|
|
149
|
+
/**
|
|
150
|
+
* The two v0.7 in-tree rules registered for Phase 2 `addCell`
|
|
151
|
+
* dispatch. Rule 1 (Dimensional Consistency) is NOT here — it
|
|
152
|
+
* operates on `BridgeEquationEntry`, not `Cell`, and ships in
|
|
153
|
+
* Phase 3 alongside the catalog adapter.
|
|
154
|
+
*
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
export declare const V07_CELL_RULES: ReadonlyArray<FluxRule>;
|
|
158
|
+
type RegimeRuleBody = (cell: Cell) => FluxRuleResult;
|
|
159
|
+
/**
|
|
160
|
+
* Install P5's regime-consistency rule body. Called by
|
|
161
|
+
* `src/core/regime-rule-install.ts` at its module load. If P5's
|
|
162
|
+
* module is never imported, the regime check stays a no-op
|
|
163
|
+
* (returns `ok: true` silently).
|
|
164
|
+
*
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
export declare function installRegimeConsistencyRule(body: RegimeRuleBody): void;
|
|
168
|
+
/**
|
|
169
|
+
* Pure dispatcher for Rule 4 over `Cell`. Delegates to the body
|
|
170
|
+
* installed by P5 if present; otherwise a permissive no-op.
|
|
171
|
+
*
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
export declare function checkRegimeConsistency(cell: Cell): FluxRuleResult;
|
|
175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