universal-physics-tensor 0.23.0 → 0.25.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 +31 -11
- package/bin/upt.mjs +186 -22
- package/dist/bridges/equations/_be-helpers.d.ts +1 -66
- package/dist/bridges/equations/_be-helpers.d.ts.map +1 -1
- package/dist/bridges/equations/_be-helpers.js +7 -83
- package/dist/bridges/equations/_be-helpers.js.map +1 -1
- package/dist/canonical/entries/l1-gravity-thermo.js +6 -6
- package/dist/canonical/entries/l1-gravity-thermo.js.map +1 -1
- package/dist/canonical/entries/l1-quantum-em.js +1 -1
- package/dist/canonical/entries/l1-quantum-em.js.map +1 -1
- package/dist/canonical/entries/relativity.js +3 -3
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/registry.d.ts +7 -0
- package/dist/canonical/registry.d.ts.map +1 -1
- package/dist/canonical/registry.js +9 -0
- package/dist/canonical/registry.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +77 -0
- package/dist/composition/canonical-graph.d.ts.map +1 -0
- package/dist/composition/canonical-graph.js +155 -0
- package/dist/composition/canonical-graph.js.map +1 -0
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +14 -0
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/edges/calibration.d.ts.map +1 -1
- package/dist/composition/edges/calibration.js +53 -0
- package/dist/composition/edges/calibration.js.map +1 -1
- package/dist/composition/edges/catalog-full.d.ts.map +1 -1
- package/dist/composition/edges/catalog-full.js +33 -1
- package/dist/composition/edges/catalog-full.js.map +1 -1
- package/dist/composition/graph-viz-svg.d.ts +31 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -0
- package/dist/composition/graph-viz-svg.js +45 -0
- package/dist/composition/graph-viz-svg.js.map +1 -0
- package/dist/composition/graph-viz.d.ts +100 -0
- package/dist/composition/graph-viz.d.ts.map +1 -0
- package/dist/composition/graph-viz.js +254 -0
- package/dist/composition/graph-viz.js.map +1 -0
- package/dist/composition/index.d.ts +4 -0
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +3 -0
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +218 -0
- package/dist/composition/proposed-bridges.d.ts.map +1 -0
- package/dist/composition/proposed-bridges.js +499 -0
- package/dist/composition/proposed-bridges.js.map +1 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +9 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/symbolic-constants.d.ts.map +1 -1
- package/dist/composition/symbolic-constants.js +1 -0
- package/dist/composition/symbolic-constants.js.map +1 -1
- package/dist/core/cell.d.ts +1 -23
- package/dist/core/cell.d.ts.map +1 -1
- package/dist/core/cell.js +0 -31
- package/dist/core/cell.js.map +1 -1
- package/dist/core/tensor.d.ts +27 -1
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +35 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/numerical/grid-field.d.ts +7 -17
- package/dist/numerical/grid-field.d.ts.map +1 -1
- package/dist/numerical/input-validation.d.ts +56 -0
- package/dist/numerical/input-validation.d.ts.map +1 -0
- package/dist/numerical/input-validation.js +75 -0
- package/dist/numerical/input-validation.js.map +1 -0
- package/dist/numerical/klein-gordon.js +1 -1
- package/dist/numerical/klein-gordon.js.map +1 -1
- package/dist/numerical/types.d.ts +18 -1
- package/dist/numerical/types.d.ts.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -60,9 +60,14 @@ npm run upt -- priority # triage speculative
|
|
|
60
60
|
npm run upt -- audit # derive the bridges by dimensions
|
|
61
61
|
npm run upt -- predict # empty regime cells as link hypotheses
|
|
62
62
|
npm run upt -- discover # vet link candidates (merge/unlock/consistency)
|
|
63
|
+
npm run upt -- discover --source=canonical # run the funnel on standard physics ALONE (no bridges)
|
|
64
|
+
npm run upt -- discover --derive # surface machine-derived identity consequences (--max-orders / --anchor flags available)
|
|
63
65
|
npm run upt -- connectors # which isolated bridges can connect to the core
|
|
64
66
|
npm run upt -- coverage # audit each bridge's empirical grounding
|
|
67
|
+
npm run upt -- canonical # the standard-physics L-layer registry (answer key)
|
|
68
|
+
npm run upt -- recover # validate bridges against standard physics
|
|
65
69
|
npm run upt -- symbolic --simplify # compose + fold bridges' SYMBOLIC forms (MathTS simplify)
|
|
70
|
+
npm run upt -- map --source=both --format=mermaid # VISUAL map of the graph (Mermaid; also --format=dot|svg, --proposed, --out=PATH)
|
|
66
71
|
# ...and YOUR OWN equations:
|
|
67
72
|
npm run upt -- eval "hbar*c^3/(8*pi*G*M*k_B)" hbar=1.054571817e-34 c=299792458 G=6.6743e-11 M=1.989e30 k_B=1.380649e-23
|
|
68
73
|
npm run upt -- derive period:time length:length gravity:acceleration --formula "2*pi*sqrt(length/gravity)"
|
|
@@ -79,6 +84,11 @@ and a built-in, dependency-free parser otherwise — transparently, via a
|
|
|
79
84
|
`FormulaParser` registry (add `--debug` to see which is active). UPT keeps
|
|
80
85
|
**zero hard dependencies**; the MathTS packages are optional.
|
|
81
86
|
|
|
87
|
+
See [`cli/README.md`](cli/README.md) for the full CLI reference — every command
|
|
88
|
+
and alias, the `--source=catalog|canonical|both` flag, input syntax, exit codes,
|
|
89
|
+
and troubleshooting. [`docs/architecture/PHYSICS_MAP.md`](docs/architecture/PHYSICS_MAP.md)
|
|
90
|
+
shows the rendered map (`upt map --format=mermaid|dot|svg`).
|
|
91
|
+
|
|
82
92
|
## Installation
|
|
83
93
|
|
|
84
94
|
```bash
|
|
@@ -209,7 +219,7 @@ for how the documents evolved.
|
|
|
209
219
|
- **[Part IV: Validation & Implications](docs/specification/Part-IV.md)** - Experimental pathways, philosophical implications, applications
|
|
210
220
|
- **[Part V: Advanced Mathematics & Protocols](docs/specification/Part-V.md)** - Category theory extensions, validation protocols, algorithmic analysis
|
|
211
221
|
- **[Part VI: Deployment & Governance](docs/specification/Part-VI.md)** - Implementation strategies, applications, governance frameworks
|
|
212
|
-
- **Supplements** - [Part VII: Tensor Algebra](docs/specification/Part-VII-Tensor-Algebra.md) · [Part VIII: Metric Layer](docs/specification/Part-VIII-Metric-Layer.md) · [Part IX: Composition](docs/specification/Part-IX-Composition.md) · [Part X: Curvature & Field Equations](docs/specification/Part-X-Curvature-and-Field-Equations.md)
|
|
222
|
+
- **Supplements** - [Part VII: Tensor Algebra](docs/specification/Part-VII-Tensor-Algebra.md) · [Part VIII: Metric Layer](docs/specification/Part-VIII-Metric-Layer.md) · [Part IX: Composition](docs/specification/Part-IX-Composition.md) · [Part X: Curvature & Field Equations](docs/specification/Part-X-Curvature-and-Field-Equations.md) · [Part XI: Proposed Equations](docs/specification/Part-XI-Proposed-Equations.md) (non-normative; machine-derived identity consequences, unadjudicated)
|
|
213
223
|
|
|
214
224
|
### Planning & Development
|
|
215
225
|
- **[Development Plan](docs/planning/Development-Plan.md)** - Phased implementation roadmap
|
|
@@ -236,34 +246,44 @@ delivered a measured **5-6× RK4 geodesic-integrator speedup** (see [CHANGELOG](
|
|
|
236
246
|
|
|
237
247
|
## Development Status
|
|
238
248
|
|
|
239
|
-
**Current version:** v0.
|
|
249
|
+
**Current version:** v0.25.0 on npm
|
|
240
250
|
([`universal-physics-tensor`](https://www.npmjs.com/package/universal-physics-tensor),
|
|
241
|
-
published 2026-06-
|
|
251
|
+
published 2026-06-19) — building on the **v0.8.0 → v0.23.0** rollup arc (composition
|
|
242
252
|
graph + GW170817 / BE-23 data confrontations + catalog adjudication, Part-IX
|
|
243
253
|
Phase C/D, the full catalog→graph migration, the bridge-inference +
|
|
244
254
|
symbolic-composition tooling, the G-9 geometrized-units adapters, the
|
|
245
255
|
distributional/variational grammar primitives, the AST bridge-gradient path, and
|
|
246
|
-
the **canonical-equation L-layer** with bridge↔canonical linkage).
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
256
|
+
the **canonical-equation L-layer** with bridge↔canonical linkage). v0.24.0 added
|
|
257
|
+
the **identity-consequence surfacer** (`upt discover --derive` → machine-derived
|
|
258
|
+
candidate relations, held out of the catalog pending §XXVII-B review; see
|
|
259
|
+
[Part-XI](docs/specification/Part-XI-Proposed-Equations.md)), **canonical-only
|
|
260
|
+
discovery** (`--source=catalog|canonical|both`), canonical-graph quality fixes
|
|
261
|
+
(magnitude-gate sourcing, variable-name unification, the declared
|
|
262
|
+
compton↔de-Broglie link), and architecture refactors (the `tensor↔cell` runtime
|
|
263
|
+
cycle removed; the `numerical→bridges` upward dependency dropped). v0.25.0 adds
|
|
264
|
+
**physics-map visualization** — `upt map --format=mermaid|dot|svg` renders the
|
|
265
|
+
graph (quantities = nodes, equations = junctions) from live data; SVG via the
|
|
266
|
+
optional `@viz-js/viz` peer (see
|
|
267
|
+
[`docs/architecture/PHYSICS_MAP.md`](docs/architecture/PHYSICS_MAP.md)).
|
|
250
268
|
|
|
251
269
|
| Metric | Value |
|
|
252
270
|
|---|---|
|
|
253
271
|
| Bridge catalog | **44** (IDs 11-54) — 8 established · 33 speculative · 3 highly-speculative · 0 invalid; membership-adjudicated **36 bridges · 5 not-a-bridge · 3 contested**; **41-edge composition graph** (full migration, 131 centralized quantity nodes) with a bridge-inference suite — **identifiability classifier**, **retrodiction harness**, **Buckingham-π enumerator**, unified by an **`explainQuantity`** entry point, plus (v0.12) the candidate-vetting **discovery loop**, regime-prediction map, empirical-coverage audit, and **symbolic composition** (the Observable contract + MathTS simplification) |
|
|
254
|
-
| Test suite | **
|
|
272
|
+
| Test suite | **2874** passing (4 skipped, 1 todo; incl. property-based algebra tests) across 280 files — gated by CI |
|
|
255
273
|
| `tsc --noEmit` | clean (src + strict `tsc -p tsconfig.tests.json`) |
|
|
256
274
|
| GR validation anchors | BE-52 Mercury perihelion relErr 1.8×10⁻⁷ · BE-37 Shapiro delay relErr ~2×10⁻⁸ |
|
|
257
275
|
| First derived relation | E_min(M) = ℏc³ln2/(8πGM) from BE-42 ∘ BE-16, relErr ≤ 10⁻¹² (pre-registered CT-1) |
|
|
258
276
|
| First data confrontation | GW170817 → BE-36: recomputed bounds +6.5×10⁻¹⁶ / −3.1×10⁻¹⁵ vs published +7×10⁻¹⁶ / −3×10⁻¹⁵ |
|
|
259
|
-
| Core capability | Dimensional AST validator (23 node kinds; valence-homogeneity + symbolic-exponent grammar, v0.13; distributional/variational primitives, v0.14) · curvature + Einstein-field-equation layers · GL4 symplectic geodesic integrator · composition graph (`composeEdges` + symbolic `composeSymbolic`) · geometrized-units adapters (G-9 increment 1, v0.13) · canonical-equation **L-layer** + bridge↔canonical linkage / F4 guard (v0.22) |
|
|
277
|
+
| Core capability | Dimensional AST validator (23 node kinds; valence-homogeneity + symbolic-exponent grammar, v0.13; distributional/variational primitives, v0.14) · curvature + Einstein-field-equation layers · GL4 symplectic geodesic integrator · composition graph (`composeEdges` + symbolic `composeSymbolic`) · geometrized-units adapters (G-9 increment 1, v0.13) · canonical-equation **L-layer** + bridge↔canonical linkage / F4 guard (v0.22) · **identity-consequence surfacer** (`upt discover --derive`, v0.24) · **physics-map visualization** (`upt map --format=mermaid\|dot\|svg`) |
|
|
260
278
|
|
|
261
279
|
Release history lives in the **[CHANGELOG](CHANGELOG.md)** — from the v0.1.0
|
|
262
280
|
catalog-closure milestone (40/40 AST encodings via the Wave A→Z encoding arc,
|
|
263
281
|
with cross-LLM validation of the highest-stakes reformulations) through the
|
|
264
282
|
GR-foundations releases (v0.4.x–v0.6.0), the v0.7.x intelligent-index / gradient
|
|
265
|
-
series, the v0.8–v0.11 composition + catalog→graph arc,
|
|
266
|
-
inference / symbolic-composition / units work
|
|
283
|
+
series, the v0.8–v0.11 composition + catalog→graph arc, the v0.12–v0.13
|
|
284
|
+
inference / symbolic-composition / units work, and the v0.14–v0.23
|
|
285
|
+
distributional/variational grammar, AST bridge-gradient path, canonical-equation
|
|
286
|
+
L-layer, bridge↔canonical linkage, and identity-consequence surfacer arc. The formal
|
|
267
287
|
spec's own revision ledger is at
|
|
268
288
|
[docs/specification/CHANGELOG.md](docs/specification/CHANGELOG.md).
|
|
269
289
|
|
package/bin/upt.mjs
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
15
15
|
import { dirname, join } from 'node:path';
|
|
16
|
+
import { writeFileSync } from 'node:fs';
|
|
16
17
|
|
|
17
18
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
18
19
|
// Return a file:// URL, not a bare path: Node's ESM dynamic import() rejects
|
|
@@ -20,7 +21,7 @@ const here = dirname(fileURLToPath(import.meta.url));
|
|
|
20
21
|
const dist = (...p) => pathToFileURL(join(here, '..', 'dist', ...p)).href;
|
|
21
22
|
|
|
22
23
|
let api, analysis, formulaReg, dimSpecMod, prediction, discovery, coverage, simplifyMod;
|
|
23
|
-
let canonicalReg, linkageMod;
|
|
24
|
+
let canonicalReg, linkageMod, proposedMod;
|
|
24
25
|
try {
|
|
25
26
|
api = await import(dist('index.js'));
|
|
26
27
|
analysis = await import(dist('composition', 'bridge-analysis.js'));
|
|
@@ -32,14 +33,16 @@ try {
|
|
|
32
33
|
simplifyMod = await import(dist('composition', 'expr-simplify.js'));
|
|
33
34
|
canonicalReg = await import(dist('canonical', 'registry.js'));
|
|
34
35
|
linkageMod = await import(dist('canonical', 'linkage.js'));
|
|
36
|
+
proposedMod = await import(dist('composition', 'proposed-bridges.js'));
|
|
35
37
|
} catch (err) {
|
|
36
38
|
console.error('Could not load the built package. Run `npm run build` first.');
|
|
37
39
|
console.error(String(err.message || err));
|
|
38
40
|
process.exit(1);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
const { explainQuantity, CATALOG_GRAPH, M_SUN_KG, composeSymbolic,
|
|
42
|
-
be42Edge, be16Edge, lawSchwarzschildRadius, be42ViaRsEdge, format
|
|
43
|
+
const { explainQuantity, CATALOG_GRAPH, CANONICAL_GRAPH, M_SUN_KG, composeSymbolic,
|
|
44
|
+
be42Edge, be16Edge, lawSchwarzschildRadius, be42ViaRsEdge, format,
|
|
45
|
+
buildVizModel, renderDotToSvg } = api;
|
|
43
46
|
const { bridgePriority, attemptDerivation, dimensionalFreedom, dimensionallyDetermines, buckinghamPi, linkageMap, proposeLinkCandidates, proposeOrphanConnectors } = { ...analysis, ...api };
|
|
44
47
|
const { getFormulaParser, getFormulaParserKind, getFormulaDimensionChecker } = formulaReg;
|
|
45
48
|
const { parseDimensionSpec } = dimSpecMod;
|
|
@@ -49,9 +52,31 @@ const { auditCoverage } = coverage;
|
|
|
49
52
|
const { simplifyObservable } = simplifyMod;
|
|
50
53
|
const { CANONICAL_EQUATIONS, bridgesWithoutCanonicalPartner } = canonicalReg;
|
|
51
54
|
const { scanLinkages } = linkageMod;
|
|
55
|
+
const { deriveProposedBridges } = proposedMod;
|
|
52
56
|
|
|
53
57
|
const GRAPH = CATALOG_GRAPH;
|
|
54
58
|
|
|
59
|
+
// `--source=catalog|canonical|both` selects which graph the analysis commands
|
|
60
|
+
// (`discover` / `candidates` / `map`) run over. `catalog` (default) is the
|
|
61
|
+
// 44-bridge catalog; `canonical` is the standard-physics L-layer ALONE, with
|
|
62
|
+
// the speculative bridges excluded; `both` is the bridges plus the canonical
|
|
63
|
+
// established-physics backbone.
|
|
64
|
+
function resolveGraph(args) {
|
|
65
|
+
const flag = (args || []).find((a) => a.startsWith('--source='));
|
|
66
|
+
const src = flag ? flag.slice('--source='.length) : 'catalog';
|
|
67
|
+
switch (src) {
|
|
68
|
+
case 'catalog':
|
|
69
|
+
return { graph: CATALOG_GRAPH, label: 'catalog (44-bridge)' };
|
|
70
|
+
case 'canonical':
|
|
71
|
+
return { graph: CANONICAL_GRAPH, label: 'canonical (standard-physics L-layer, bridges excluded)' };
|
|
72
|
+
case 'both':
|
|
73
|
+
return { graph: [...CATALOG_GRAPH, ...CANONICAL_GRAPH], label: 'catalog + canonical' };
|
|
74
|
+
default:
|
|
75
|
+
console.error(`upt: unknown --source='${src}' (expected: catalog | canonical | both)`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
55
80
|
// ── help ────────────────────────────────────────────────────────────────
|
|
56
81
|
function help() {
|
|
57
82
|
console.log(`upt — Universal Physics Tensor bridge-inference CLI
|
|
@@ -72,12 +97,20 @@ Usage:
|
|
|
72
97
|
re-derive as a recognized monomial (with the prefactor recovered),
|
|
73
98
|
which are decoys, which are dimensionally open.
|
|
74
99
|
|
|
75
|
-
upt map
|
|
100
|
+
upt map [--source=catalog|canonical|both] [--format=text|mermaid|dot|svg]
|
|
101
|
+
[--proposed] [--out=PATH]
|
|
76
102
|
Map how the equations LINK: connected components (clusters) of the
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
graph by shared quantities, the anchored core, the link hubs, and
|
|
104
|
+
the isolated tail.
|
|
105
|
+
--format=mermaid|dot|svg emits the VISUAL map (quantities = nodes,
|
|
106
|
+
equations = junctions colored by status, one subgraph per component).
|
|
107
|
+
text (default) is the unchanged linkage printout. svg renders the dot
|
|
108
|
+
layout via the optional @viz-js/viz peer (npm i @viz-js/viz; or pipe
|
|
109
|
+
dot through "dot -Tsvg"). --proposed overlays the unadjudicated
|
|
110
|
+
identity-consequence relations (gray dashed). --out writes to a file
|
|
111
|
+
(default stdout).
|
|
112
|
+
|
|
113
|
+
upt candidates [--source=catalog|canonical|both]
|
|
81
114
|
Propose candidate cross-cluster links (quantities of the same
|
|
82
115
|
dimension in different clusters) for PHYSICIST REVIEW — a
|
|
83
116
|
coincidence-heavy surface, not discovered bridges.
|
|
@@ -88,11 +121,22 @@ Usage:
|
|
|
88
121
|
(triadic closure). Makes the namesake tensor operational. Review
|
|
89
122
|
surface, not discovered bridges.
|
|
90
123
|
|
|
91
|
-
upt discover
|
|
124
|
+
upt discover [--source=catalog|canonical|both]
|
|
92
125
|
VET the link candidates through the inference suite: hypothesise
|
|
93
126
|
each identification a≡b and test whether it merges disconnected
|
|
94
127
|
physics, unlocks quantities, and stays numerically consistent.
|
|
95
128
|
Ranks promising / inert / contradictory.
|
|
129
|
+
--source=canonical runs the funnel on the standard-physics L-layer
|
|
130
|
+
ALONE (bridges excluded) — new candidates from established physics,
|
|
131
|
+
and a self-consistency check (expect 0 contradictory).
|
|
132
|
+
--derive emits, for each 'promising' identification, the ONE algebraic
|
|
133
|
+
relation it implies (monomial elimination) as an UNADJUDICATED, math-only
|
|
134
|
+
proposal — NOT a bridge (Part-VI §XXVII-B). Pairs with --source=canonical.
|
|
135
|
+
--max-orders=N tunes the magnitude-clash threshold (default 3); looser N
|
|
136
|
+
keeps more candidates 'promising', tighter N falsifies more as clashes.
|
|
137
|
+
--anchor=k=v[,k2=v2] overrides the numeric anchor (default mass=M_sun)
|
|
138
|
+
for the consistency/closure check. Both reshape the candidate pool that
|
|
139
|
+
--derive consumes.
|
|
96
140
|
|
|
97
141
|
upt connectors
|
|
98
142
|
Of the 20 ISOLATED bridges, which could connect to the anchored
|
|
@@ -327,11 +371,68 @@ async function derive(args) {
|
|
|
327
371
|
}
|
|
328
372
|
|
|
329
373
|
// ── map (how the equations link) ──────────────────────────────────────────
|
|
330
|
-
|
|
331
|
-
|
|
374
|
+
// Convert the derived identity-consequence proposals into viz junctions
|
|
375
|
+
// (gray-dashed, status 'proposed'). The library never imports proposed-bridges;
|
|
376
|
+
// the CLI does the conversion, keeping the epistemic firewall intact.
|
|
377
|
+
function proposedJunctions(graph, args) {
|
|
378
|
+
const ranked = rankDiscoveries(graph, parseDiscoveryOpts(args));
|
|
379
|
+
return deriveProposedBridges(ranked).map((p) => ({
|
|
380
|
+
id: p.id,
|
|
381
|
+
label: p.id,
|
|
382
|
+
status: 'proposed',
|
|
383
|
+
sources: (p.governing || []).map((g) => g.name),
|
|
384
|
+
target: p.target.name,
|
|
385
|
+
}));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
async function mapCmd(args) {
|
|
389
|
+
const { graph, label } = resolveGraph(args);
|
|
390
|
+
|
|
391
|
+
// --format=mermaid|dot|svg emits the visual map; default (text) is unchanged.
|
|
392
|
+
const a = args || [];
|
|
393
|
+
const fmtFlag = a.find((x) => x.startsWith('--format='));
|
|
394
|
+
const fmt = fmtFlag ? fmtFlag.slice('--format='.length) : 'text';
|
|
395
|
+
if (fmt === 'mermaid' || fmt === 'dot' || fmt === 'svg') {
|
|
396
|
+
const extraJunctions = a.includes('--proposed') ? proposedJunctions(graph, args) : [];
|
|
397
|
+
const model = buildVizModel(graph, {
|
|
398
|
+
title: `UPT physics map — ${label}`,
|
|
399
|
+
extraJunctions,
|
|
400
|
+
});
|
|
401
|
+
// svg is the dot layout rendered by the optional @viz-js/viz peer.
|
|
402
|
+
let src;
|
|
403
|
+
if (fmt === 'svg') {
|
|
404
|
+
try {
|
|
405
|
+
src = await renderDotToSvg(model.toDot());
|
|
406
|
+
} catch (err) {
|
|
407
|
+
console.error(err && err.message ? err.message : String(err));
|
|
408
|
+
process.exit(1);
|
|
409
|
+
}
|
|
410
|
+
} else {
|
|
411
|
+
src = fmt === 'mermaid' ? model.toMermaid() : model.toDot();
|
|
412
|
+
}
|
|
413
|
+
const outFlag = a.find((x) => x.startsWith('--out='));
|
|
414
|
+
if (outFlag) {
|
|
415
|
+
const path = outFlag.slice('--out='.length);
|
|
416
|
+
if (!path) {
|
|
417
|
+
console.error('upt: --out= requires a non-empty PATH');
|
|
418
|
+
process.exit(1);
|
|
419
|
+
}
|
|
420
|
+
writeFileSync(path, src);
|
|
421
|
+
console.error(`upt: wrote ${fmt} (${model.junctions.length} junctions, ${model.clusters.length} clusters) to ${path}`);
|
|
422
|
+
} else {
|
|
423
|
+
process.stdout.write(src);
|
|
424
|
+
}
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
if (fmt !== 'text') {
|
|
428
|
+
console.error(`upt: unknown --format='${fmt}' (expected: text | mermaid | dot | svg)`);
|
|
429
|
+
process.exit(1);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const m = linkageMap(graph);
|
|
332
433
|
const mix = (s) => Object.entries(s).map(([k, v]) => `${v} ${k}`).join(', ');
|
|
333
|
-
console.log(
|
|
334
|
-
console.log(`(${m.componentCount} components over ${
|
|
434
|
+
console.log(`\nLinkage map — how the equations connect via shared quantities [source: ${label}]`);
|
|
435
|
+
console.log(`(${m.componentCount} components over ${graph.length} edges; ${m.compositions} compose into chains)\n`);
|
|
335
436
|
for (const c of m.clusters.filter((x) => x.size > 1)) {
|
|
336
437
|
console.log(` ● cluster of ${c.size}${c.anchored ? ' [ANCHORED to known physics]' : ''}`);
|
|
337
438
|
console.log(` edges: ${c.edges.join(', ')}`);
|
|
@@ -344,11 +445,12 @@ function mapCmd() {
|
|
|
344
445
|
}
|
|
345
446
|
|
|
346
447
|
// ── candidates (map-proposed links for review) ────────────────────────────
|
|
347
|
-
function candidatesCmd() {
|
|
348
|
-
const
|
|
448
|
+
function candidatesCmd(args) {
|
|
449
|
+
const { graph, label } = resolveGraph(args);
|
|
450
|
+
const cands = proposeLinkCandidates(graph);
|
|
349
451
|
const core = cands.filter((c) => c.touchesCore);
|
|
350
452
|
const ck = cands.filter((c) => c.touchesCore && c.sameKind);
|
|
351
|
-
console.log(
|
|
453
|
+
console.log(`\nLink candidates — cross-cluster quantities sharing a dimension [source: ${label}]`);
|
|
352
454
|
console.log('⚠ a coincidence-heavy REVIEW SURFACE, NOT discovered bridges. Same dimension is a');
|
|
353
455
|
console.log(' weak signal; each needs a physicist to accept or (far more often) reject.\n');
|
|
354
456
|
console.log(` funnel: ${cands.length} total → ${core.length} touch the anchored core → ${ck.length} also same-kind\n`);
|
|
@@ -387,12 +489,45 @@ function predictCmd() {
|
|
|
387
489
|
}
|
|
388
490
|
|
|
389
491
|
// ── discover (vet link candidates through the inference suite) ─────────────
|
|
390
|
-
|
|
391
|
-
|
|
492
|
+
// Parse the discovery knobs (DiscoveryOptions) from CLI flags:
|
|
493
|
+
// --max-orders=N magnitude-clash threshold (default 3)
|
|
494
|
+
// --anchor=k=v[,k2=v2] numeric anchor for the consistency/closure check
|
|
495
|
+
// (default mass=M_sun); repeatable
|
|
496
|
+
function parseDiscoveryOpts(args) {
|
|
497
|
+
const a = args || [];
|
|
498
|
+
const opts = {};
|
|
499
|
+
const mo = a.find((x) => x.startsWith('--max-orders='));
|
|
500
|
+
if (mo) {
|
|
501
|
+
const n = Number(mo.slice('--max-orders='.length));
|
|
502
|
+
if (Number.isFinite(n)) opts.maxOrdersOfMagnitude = n;
|
|
503
|
+
}
|
|
504
|
+
const gt = {};
|
|
505
|
+
for (const x of a.filter((x) => x.startsWith('--anchor='))) {
|
|
506
|
+
for (const pair of x.slice('--anchor='.length).split(',')) {
|
|
507
|
+
const [k, v] = pair.split('=');
|
|
508
|
+
const val = Number(v);
|
|
509
|
+
if (k && Number.isFinite(val)) gt[k] = val;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (Object.keys(gt).length) opts.groundTruth = gt;
|
|
513
|
+
return opts;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
function discoverCmd(args) {
|
|
517
|
+
const { graph, label } = resolveGraph(args);
|
|
518
|
+
const opts = parseDiscoveryOpts(args);
|
|
519
|
+
const ranked = rankDiscoveries(graph, opts);
|
|
520
|
+
if (Object.keys(opts).length) {
|
|
521
|
+
const bits = [];
|
|
522
|
+
if (opts.maxOrdersOfMagnitude !== undefined) bits.push(`max-orders=${opts.maxOrdersOfMagnitude}`);
|
|
523
|
+
if (opts.groundTruth) bits.push(`anchor={${Object.entries(opts.groundTruth).map(([k, v]) => `${k}=${v}`).join(', ')}}`);
|
|
524
|
+
console.log(` [discovery options: ${bits.join('; ')}]`);
|
|
525
|
+
}
|
|
526
|
+
if ((args || []).includes('--derive')) return deriveCmd(ranked, label);
|
|
392
527
|
const by = (v) => ranked.filter((r) => r.verdict === v);
|
|
393
528
|
const promising = by('promising'), inert = by('inert'), contra = by('contradictory');
|
|
394
529
|
const clash = by('magnitude-clash');
|
|
395
|
-
console.log(
|
|
530
|
+
console.log(`\nDiscovery — link candidates VETTED through the inference suite [source: ${label}]`);
|
|
396
531
|
console.log('⚠ a REVIEW SURFACE: `promising` means "worth a physicist\'s minute", not "true".');
|
|
397
532
|
console.log(' Each candidate hypothesises an identification a≡b and tests its consequences.\n');
|
|
398
533
|
console.log(` funnel: ${ranked.length} candidates → ${promising.length} promising ` +
|
|
@@ -430,6 +565,35 @@ function discoverCmd() {
|
|
|
430
565
|
console.log('\n (magnitude gate abstains where a representative value is unknown; weak priors on dimension.)');
|
|
431
566
|
}
|
|
432
567
|
|
|
568
|
+
// ── discover --derive (identity-consequence proposals) ────────────────────
|
|
569
|
+
function deriveCmd(ranked, label) {
|
|
570
|
+
const proposals = deriveProposedBridges(ranked);
|
|
571
|
+
console.log(`\nDerived identity-consequence PROPOSALS — UNADJUDICATED, math-only [source: ${label}]`);
|
|
572
|
+
console.log('⚠ Each is the ALGEBRAIC CONSEQUENCE of an unadjudicated identification — NOT a new');
|
|
573
|
+
console.log(' relation and NOT a bridge. No mechanism asserted. Promotion to the catalog needs');
|
|
574
|
+
console.log(' adversarial + literature review (Part-VI §XXVII-B). The enumerator proposes; humans dispose.\n');
|
|
575
|
+
if (!proposals.length) {
|
|
576
|
+
console.log(' no admissible proposal (need two fully-quantitative, monomial canonical targets).');
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
for (const p of proposals) {
|
|
580
|
+
let approx = '';
|
|
581
|
+
try {
|
|
582
|
+
const vals = Object.fromEntries((p.governing || []).map((g) => [g.name, 300]));
|
|
583
|
+
const at = (p.governing || []).map((g) => `${g.name}=300`).join(', ');
|
|
584
|
+
approx = ` ≈ ${p.evaluate(vals).toExponential(2)}${at ? ` (${at})` : ''}`;
|
|
585
|
+
} catch { approx = ''; }
|
|
586
|
+
console.log(` ${p.id}`);
|
|
587
|
+
console.log(` ${p.formulaLatex} ${p.dimensionalSignature}${approx}`);
|
|
588
|
+
console.log(` from: ${p.derivedFrom.identification.a} ≟ ${p.derivedFrom.identification.b}` +
|
|
589
|
+
` (${p.derivedFrom.sourceEquationIds[0]} = ${p.derivedFrom.sourceEquationIds[1]}); solved for ${p.derivedFrom.solvedFor}`);
|
|
590
|
+
if (p.alsoDerivableFrom && p.alsoDerivableFrom.length) {
|
|
591
|
+
console.log(` also derivable from: ${p.alsoDerivableFrom.join('; ')}`);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
console.log('');
|
|
595
|
+
}
|
|
596
|
+
|
|
433
597
|
// ── coverage (empirical-spine audit) ──────────────────────────────────────
|
|
434
598
|
function coverageCmd() {
|
|
435
599
|
const r = auditCoverage();
|
|
@@ -564,10 +728,10 @@ switch (cmd) {
|
|
|
564
728
|
case 'explain': explain(rest[0], rest.slice(1)); break;
|
|
565
729
|
case 'priority': case 'prioritize': case 'triage': priority(); break;
|
|
566
730
|
case 'audit': audit(); break;
|
|
567
|
-
case 'map': case 'linkage': mapCmd(); break;
|
|
568
|
-
case 'candidates': case 'propose': candidatesCmd(); break;
|
|
731
|
+
case 'map': case 'linkage': await mapCmd(rest); break;
|
|
732
|
+
case 'candidates': case 'propose': candidatesCmd(rest); break;
|
|
569
733
|
case 'predict': case 'predictions': predictCmd(); break;
|
|
570
|
-
case 'discover': case 'discovery': discoverCmd(); break;
|
|
734
|
+
case 'discover': case 'discovery': discoverCmd(rest); break;
|
|
571
735
|
case 'connectors': case 'orphans': connectorsCmd(); break;
|
|
572
736
|
case 'coverage': case 'grounding': coverageCmd(); break;
|
|
573
737
|
case 'canonical': case 'laws': canonicalCmd(); break;
|
|
@@ -26,71 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import type { ExprNode, DimensionValidationReport } from '../../dimensional/validator.js';
|
|
28
28
|
import type { Dimension } from '../../dimensional/types.js';
|
|
29
|
-
|
|
30
|
-
* Declarative spec for a single field of an evaluator's `input` record.
|
|
31
|
-
*
|
|
32
|
-
* The default behaviour (no `min`/`max`) only verifies finiteness
|
|
33
|
-
* (`Number.isFinite`). The bound predicates compose with `Number.isFinite`
|
|
34
|
-
* so the resulting error always reads "finite ⟨adj⟩ number" — drop-in
|
|
35
|
-
* compatible with the existing BE-NN per-evaluator message format
|
|
36
|
-
* `"<evaluator>: <field> must be a finite <adjective> number, got <v>"`.
|
|
37
|
-
*
|
|
38
|
-
* The intentional simplicity: no closed-form domain constraints (e.g.,
|
|
39
|
-
* `R_near ≤ R_far`). Anything beyond per-field range checks stays inline
|
|
40
|
-
* in the evaluator (honesty policy — see commit message).
|
|
41
|
-
*
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
interface FieldSpec {
|
|
45
|
-
/** Field name on the `input` record (e.g., `'M_kg'`). */
|
|
46
|
-
readonly name: string;
|
|
47
|
-
/** Inclusive lower bound (default `-Infinity`). */
|
|
48
|
-
readonly min?: number;
|
|
49
|
-
/** Inclusive upper bound (default `Infinity`). */
|
|
50
|
-
readonly max?: number;
|
|
51
|
-
/** Strict `>` instead of `≥` at the lower bound. */
|
|
52
|
-
readonly excludeMin?: boolean;
|
|
53
|
-
/** Strict `<` instead of `≤` at the upper bound. */
|
|
54
|
-
readonly excludeMax?: boolean;
|
|
55
|
-
/** Explicit override — when `min === 0` and you want to permit zero. */
|
|
56
|
-
readonly allowZero?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Optional domain-specific noun phrase (e.g., 'probability', 'angle').
|
|
59
|
-
* When set, replaces the auto-generated "in range [a, b]" prose:
|
|
60
|
-
* "<evaluator>: <field> must be a finite <description> number, got <v>"
|
|
61
|
-
*
|
|
62
|
-
* v0.7.1 Phase 4 Task 4.4 — Eve E4 fix. Restores the pre-extraction
|
|
63
|
-
* BE-25-iit-phi "probability" domain noun without reverting the
|
|
64
|
-
* helper-based migration.
|
|
65
|
-
*
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
readonly description?: string;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Validate every field of `input` named by `fieldSpecs`. Throws a
|
|
72
|
-
* `RangeError` on the first violation with a message that contains
|
|
73
|
-
* the keywords (`"finite"`, plus `"positive"` / `"non-negative"` /
|
|
74
|
-
* `"in range"`) the existing per-BE-NN tests pattern-match against.
|
|
75
|
-
*
|
|
76
|
-
* The error message format matches the pre-extraction convention:
|
|
77
|
-
*
|
|
78
|
-
* `<evaluatorName>: <fieldName> must be a finite <range> number, got <value>`
|
|
79
|
-
*
|
|
80
|
-
* Sample existing prose this preserves:
|
|
81
|
-
*
|
|
82
|
-
* `evaluateShapiroDelay: M_kg must be a finite positive number, got -1`
|
|
83
|
-
* `evaluateLandauerEnergy: temperature_K must be a finite non-negative number, got -1`
|
|
84
|
-
* `evaluateQuantumBounce: Lambda_Tinv2 must be finite, got NaN`
|
|
85
|
-
*
|
|
86
|
-
* @param input - The evaluator's input record.
|
|
87
|
-
* @param fieldSpecs - The per-field range specs to enforce.
|
|
88
|
-
* @param evaluatorName - The calling function's name (e.g.,
|
|
89
|
-
* `'evaluateShapiroDelay'`), used as the error-message prefix.
|
|
90
|
-
*
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
|
-
export declare function validateFiniteInputs<T extends object>(input: T, fieldSpecs: ReadonlyArray<FieldSpec>, evaluatorName: string): void;
|
|
29
|
+
export { validateFiniteInputs, type FieldSpec } from '../../numerical/input-validation.js';
|
|
94
30
|
/**
|
|
95
31
|
* Run `validateEquation(lhs, rhs)` + `validate(lhs)` + `validate(rhs)`
|
|
96
32
|
* and pack the result into the canonical `DimensionValidationReport`
|
|
@@ -142,5 +78,4 @@ export declare function validateBEDimensions(lhs: ExprNode, rhs: ExprNode, _equa
|
|
|
142
78
|
* @internal
|
|
143
79
|
*/
|
|
144
80
|
export declare function sym(name: string, dim: Dimension): ExprNode;
|
|
145
|
-
export {};
|
|
146
81
|
//# sourceMappingURL=_be-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_be-helpers.d.ts","sourceRoot":"","sources":["../../../src/bridges/equations/_be-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"_be-helpers.d.ts","sourceRoot":"","sources":["../../../src/bridges/equations/_be-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAQ5D,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAM3F;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,QAAQ,EACb,cAAc,EAAE,MAAM,GACrB,yBAAyB,CAS3B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,QAAQ,CAE1D"}
|
|
@@ -25,89 +25,13 @@
|
|
|
25
25
|
* @module bridges/equations/_be-helpers
|
|
26
26
|
*/
|
|
27
27
|
import { validate, validateEquation } from '../../dimensional/validator.js';
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* - unbounded → "" (just "finite")
|
|
36
|
-
*/
|
|
37
|
-
function describeRange(spec) {
|
|
38
|
-
// Caller-supplied domain noun (e.g., 'probability') takes priority
|
|
39
|
-
// over the auto-generated range prose. Yields:
|
|
40
|
-
// "<evaluator>: <field> must be a finite <description> number, got <v>"
|
|
41
|
-
// E.g., for BE-25 IIT p_cond / p_marg:
|
|
42
|
-
// "evaluateIntrinsicInformation: p_cond must be a finite probability number, got -0.1"
|
|
43
|
-
if (spec.description !== undefined)
|
|
44
|
-
return `${spec.description} `;
|
|
45
|
-
const hasMin = spec.min !== undefined;
|
|
46
|
-
const hasMax = spec.max !== undefined;
|
|
47
|
-
const lowOpen = !!spec.excludeMin;
|
|
48
|
-
const highOpen = !!spec.excludeMax;
|
|
49
|
-
// The two ubiquitous zero-pinned shapes — keep these phrasings exactly
|
|
50
|
-
// as the existing 42 BE-NN evaluators emit them.
|
|
51
|
-
if (hasMin && !hasMax && spec.min === 0 && !spec.allowZero) {
|
|
52
|
-
if (lowOpen)
|
|
53
|
-
return 'positive '; // "finite positive number"
|
|
54
|
-
return 'non-negative '; // "finite non-negative number"
|
|
55
|
-
}
|
|
56
|
-
if (!hasMin && !hasMax)
|
|
57
|
-
return ''; // "finite number"
|
|
58
|
-
const lo = hasMin ? spec.min : -Infinity;
|
|
59
|
-
const hi = hasMax ? spec.max : Infinity;
|
|
60
|
-
const lb = lowOpen ? '(' : '[';
|
|
61
|
-
const rb = highOpen ? ')' : ']';
|
|
62
|
-
return `in range ${lb}${lo}, ${hi}${rb} `;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Validate every field of `input` named by `fieldSpecs`. Throws a
|
|
66
|
-
* `RangeError` on the first violation with a message that contains
|
|
67
|
-
* the keywords (`"finite"`, plus `"positive"` / `"non-negative"` /
|
|
68
|
-
* `"in range"`) the existing per-BE-NN tests pattern-match against.
|
|
69
|
-
*
|
|
70
|
-
* The error message format matches the pre-extraction convention:
|
|
71
|
-
*
|
|
72
|
-
* `<evaluatorName>: <fieldName> must be a finite <range> number, got <value>`
|
|
73
|
-
*
|
|
74
|
-
* Sample existing prose this preserves:
|
|
75
|
-
*
|
|
76
|
-
* `evaluateShapiroDelay: M_kg must be a finite positive number, got -1`
|
|
77
|
-
* `evaluateLandauerEnergy: temperature_K must be a finite non-negative number, got -1`
|
|
78
|
-
* `evaluateQuantumBounce: Lambda_Tinv2 must be finite, got NaN`
|
|
79
|
-
*
|
|
80
|
-
* @param input - The evaluator's input record.
|
|
81
|
-
* @param fieldSpecs - The per-field range specs to enforce.
|
|
82
|
-
* @param evaluatorName - The calling function's name (e.g.,
|
|
83
|
-
* `'evaluateShapiroDelay'`), used as the error-message prefix.
|
|
84
|
-
*
|
|
85
|
-
* @internal
|
|
86
|
-
*/
|
|
87
|
-
export function validateFiniteInputs(input, fieldSpecs, evaluatorName) {
|
|
88
|
-
for (const spec of fieldSpecs) {
|
|
89
|
-
const raw = input[spec.name];
|
|
90
|
-
const value = raw;
|
|
91
|
-
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
92
|
-
const range = describeRange(spec);
|
|
93
|
-
throw new RangeError(`${evaluatorName}: ${spec.name} must be a finite ${range}number, got ${String(value)}`);
|
|
94
|
-
}
|
|
95
|
-
if (spec.min !== undefined) {
|
|
96
|
-
const violatesMin = spec.excludeMin ? value <= spec.min : value < spec.min;
|
|
97
|
-
if (violatesMin) {
|
|
98
|
-
const range = describeRange(spec);
|
|
99
|
-
throw new RangeError(`${evaluatorName}: ${spec.name} must be a finite ${range}number, got ${value}`);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (spec.max !== undefined) {
|
|
103
|
-
const violatesMax = spec.excludeMax ? value >= spec.max : value > spec.max;
|
|
104
|
-
if (violatesMax) {
|
|
105
|
-
const range = describeRange(spec);
|
|
106
|
-
throw new RangeError(`${evaluatorName}: ${spec.name} must be a finite ${range}number, got ${value}`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// Helper 1 — Runtime input validation (S-1)
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// `validateFiniteInputs` (+ `FieldSpec`) moved to the dependency-free leaf
|
|
32
|
+
// `numerical/input-validation.ts` so the numerical layer no longer imports
|
|
33
|
+
// upward from `bridges`. Re-exported here so every BE-NN evaluator is unchanged.
|
|
34
|
+
export { validateFiniteInputs } from '../../numerical/input-validation.js';
|
|
111
35
|
// ---------------------------------------------------------------------------
|
|
112
36
|
// Helper 2 — Per-bridge dimensional self-check (S-2)
|
|
113
37
|
// ---------------------------------------------------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_be-helpers.js","sourceRoot":"","sources":["../../../src/bridges/equations/_be-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"_be-helpers.js","sourceRoot":"","sources":["../../../src/bridges/equations/_be-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAG5E,8EAA8E;AAC9E,4CAA4C;AAC5C,8EAA8E;AAC9E,2EAA2E;AAC3E,2EAA2E;AAC3E,iFAAiF;AACjF,OAAO,EAAE,oBAAoB,EAAkB,MAAM,qCAAqC,CAAC;AAE3F,8EAA8E;AAC9E,qDAAqD;AACrD,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAa,EACb,GAAa,EACb,cAAsB;IAEtB,MAAM,EAAE,GAAG,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC3B,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO;QACL,EAAE,EAAE,EAAE,CAAC,EAAE;QACT,MAAM,EAAE,IAAI,CAAC,iBAAiB;QAC9B,MAAM,EAAE,IAAI,CAAC,iBAAiB;KAC/B,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,uDAAuD;AACvD,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,GAAc;IAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -19,7 +19,7 @@ const BH_GOV = [
|
|
|
19
19
|
const LANDAUER_TARGET = { name: 'erasure-energy', dim: ENERGY };
|
|
20
20
|
const LANDAUER_GOV = [
|
|
21
21
|
{ name: 'k_B', dim: ENTROPY },
|
|
22
|
-
{ name: '
|
|
22
|
+
{ name: 'temperature', dim: TEMPERATURE },
|
|
23
23
|
];
|
|
24
24
|
// ── Jarzynski equality ΔF = −k_B T ln⟨exp(−W/k_B T)⟩ (the dimensionless ──
|
|
25
25
|
// log of the work-ensemble average is the leading factor; dimensionally
|
|
@@ -28,27 +28,27 @@ const LANDAUER_GOV = [
|
|
|
28
28
|
const JARZYNSKI_TARGET = { name: 'free-energy-difference', dim: ENERGY };
|
|
29
29
|
const JARZYNSKI_GOV = [
|
|
30
30
|
{ name: 'k_B', dim: ENTROPY },
|
|
31
|
-
{ name: '
|
|
31
|
+
{ name: 'temperature', dim: TEMPERATURE },
|
|
32
32
|
];
|
|
33
33
|
// ── Newton's law of gravitation F = G m₁ m₂ / r² (free mass-ratio group) ──
|
|
34
34
|
const NEWTON_TARGET = { name: 'gravitational-force', dim: FORCE };
|
|
35
35
|
const NEWTON_GOV = [
|
|
36
36
|
{ name: 'G', dim: GRAV },
|
|
37
|
-
{ name: '
|
|
38
|
-
{ name: '
|
|
37
|
+
{ name: 'mass', dim: MASS },
|
|
38
|
+
{ name: 'secondary-mass', dim: MASS },
|
|
39
39
|
{ name: 'r', dim: LENGTH },
|
|
40
40
|
];
|
|
41
41
|
// ── Stefan–Boltzmann law j = σ T⁴ (radiative FLUX) ────────────────────────
|
|
42
42
|
const SB_TARGET = { name: 'radiative-flux', dim: SB_FLUX };
|
|
43
43
|
const SB_GOV = [
|
|
44
44
|
{ name: 'sigma_sb', dim: SIGMA_SB },
|
|
45
|
-
{ name: '
|
|
45
|
+
{ name: 'temperature', dim: TEMPERATURE },
|
|
46
46
|
];
|
|
47
47
|
// ── Ideal gas law P = N k_B T / V (N is a dimensionless count) ────────────
|
|
48
48
|
const GAS_TARGET = { name: 'pressure', dim: PRESSURE };
|
|
49
49
|
const GAS_GOV = [
|
|
50
50
|
{ name: 'k_B', dim: ENTROPY },
|
|
51
|
-
{ name: '
|
|
51
|
+
{ name: 'temperature', dim: TEMPERATURE },
|
|
52
52
|
{ name: 'V', dim: VOLUME },
|
|
53
53
|
];
|
|
54
54
|
export const L1_GRAVITY_THERMO = [
|