universal-physics-tensor 10.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/bin/upt.mjs +13 -1
- package/data/atlas/atlas.json +25 -25
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +6 -6
- package/data/atlas/oscillators.json +7 -7
- package/data/atlas/waves.json +14 -14
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +371 -228
- package/data/bridge-catalog.schema.json +45 -7
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +21 -15
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/loader.js +2 -2
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +2 -2
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +15 -7
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +7 -8
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -12
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -39
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/models.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +106 -3
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -11
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -7
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -34
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +25 -24
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +25 -24
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +34 -31
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +55 -53
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +1 -1
- package/dist/atlas/physjs-reviewed.js +15 -15
- package/dist/atlas/physjs-reviewed.js.map +1 -1
- package/dist/atlas/poster/statements.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/regime.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +2 -6
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -48
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/models.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +30 -0
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +53 -0
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-specs.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +13 -8
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +26 -2
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +31 -1
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +20 -2
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +27 -12
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +11 -0
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +14 -5
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +35 -3
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +117 -23
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/notices.d.ts.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +4 -4
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +15 -16
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +3 -3
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/entries/atomic.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +4 -5
- package/dist/canonical/entries/condensed-matter.js.map +1 -1
- package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
- package/dist/canonical/entries/dimensional-classics.js +3 -4
- package/dist/canonical/entries/dimensional-classics.js.map +1 -1
- package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
- package/dist/canonical/entries/electromagnetism.js +4 -10
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +9 -17
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +25 -44
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +5 -11
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/structural.d.ts +21 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +40 -19
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/brownian-sphere.d.ts +3 -3
- package/dist/cases/brownian-sphere.d.ts.map +1 -1
- package/dist/cases/brownian-sphere.js +6 -5
- package/dist/cases/brownian-sphere.js.map +1 -1
- package/dist/cases/damped-resonator.d.ts.map +1 -1
- package/dist/cases/damped-resonator.js +6 -9
- package/dist/cases/damped-resonator.js.map +1 -1
- package/dist/cases/kepler-rv.d.ts +1 -1
- package/dist/cases/kepler-rv.d.ts.map +1 -1
- package/dist/cases/kepler-rv.js +3 -2
- package/dist/cases/kepler-rv.js.map +1 -1
- package/dist/cases/lumped-cooling.d.ts +8 -3
- package/dist/cases/lumped-cooling.d.ts.map +1 -1
- package/dist/cases/lumped-cooling.js +21 -23
- package/dist/cases/lumped-cooling.js.map +1 -1
- package/dist/cases/quadrature.d.ts +7 -9
- package/dist/cases/quadrature.d.ts.map +1 -1
- package/dist/cases/quadrature.js +28 -32
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/resistor-noise.js +4 -4
- package/dist/cases/resistor-noise.js.map +1 -1
- package/dist/cases/skin-depth.d.ts +0 -4
- package/dist/cases/skin-depth.d.ts.map +1 -1
- package/dist/cases/skin-depth.js +3 -7
- package/dist/cases/skin-depth.js.map +1 -1
- package/dist/cli/args.d.ts +23 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts.map +1 -1
- package/dist/cli/bindings.js +5 -4
- package/dist/cli/bindings.js.map +1 -1
- package/dist/cli/command.d.ts +8 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +0 -9
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +8 -18
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +8 -9
- package/dist/cli/commands/_discovery-opts.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts.map +1 -1
- package/dist/cli/commands/atlas.js +8 -5
- package/dist/cli/commands/atlas.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +8 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +8 -14
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +22 -22
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/discover.d.ts.map +1 -1
- package/dist/cli/commands/discover.js +6 -2
- package/dist/cli/commands/discover.js.map +1 -1
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +1 -0
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +65 -37
- package/dist/cli/commands/evaluate.js.map +1 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +2 -1
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +1 -0
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +75 -5
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/metric.d.ts.map +1 -1
- package/dist/cli/commands/metric.js +12 -9
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +25 -3
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +59 -16
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +1 -0
- package/dist/cli/commands/regime.js.map +1 -1
- package/dist/cli/commands/retrieve.d.ts.map +1 -1
- package/dist/cli/commands/retrieve.js +1 -0
- package/dist/cli/commands/retrieve.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.d.ts.map +1 -1
- package/dist/cli/commands/symbolic.js +19 -28
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +4 -2
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/expr-print.d.ts +0 -2
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +7 -31
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/main.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +18 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +20 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +15 -0
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/record-reach.js +2 -2
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +6 -5
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +9 -8
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +7 -6
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +0 -7
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/stored-results.d.ts +7 -0
- package/dist/cli/stored-results.d.ts.map +1 -0
- package/dist/cli/stored-results.js +23 -0
- package/dist/cli/stored-results.js.map +1 -0
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +7 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +34 -5
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +28 -4
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/axes.d.ts +0 -6
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +6 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +17 -0
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +102 -55
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +122 -24
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +1 -1
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +9 -36
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +2 -5
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +8 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +9 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +13 -5
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/discovery.d.ts +56 -0
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +114 -60
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +21 -2
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +23 -1
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +3 -12
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +7 -20
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +2 -11
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +16 -0
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +15 -20
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +23 -4
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +57 -17
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/graph-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +8 -4
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +3 -2
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +4 -3
- package/dist/composition/mathts-quiet.d.ts.map +1 -1
- package/dist/composition/mathts-quiet.js +4 -3
- package/dist/composition/mathts-quiet.js.map +1 -1
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +2 -1
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/probe/corpus.d.ts +4 -2
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +20 -9
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +17 -0
- package/dist/composition/probe/dataset.d.ts.map +1 -1
- package/dist/composition/probe/dataset.js +95 -50
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.d.ts +5 -1
- package/dist/composition/probe/experiment-design.d.ts.map +1 -1
- package/dist/composition/probe/experiment-design.js +44 -24
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +2 -0
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +6 -0
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +46 -22
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +27 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +53 -30
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +14 -0
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +6 -0
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +24 -1
- package/dist/composition/probe/limits.d.ts.map +1 -1
- package/dist/composition/probe/limits.js +53 -11
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +10 -4
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/power-law.d.ts +121 -0
- package/dist/composition/probe/power-law.d.ts.map +1 -0
- package/dist/composition/probe/power-law.js +255 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +7 -4
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +177 -49
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +6 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +9 -7
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/structure.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +31 -9
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +236 -181
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +17 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +32 -0
- package/dist/composition/probe/t-tail.js.map +1 -0
- package/dist/composition/probe/types.d.ts +3 -0
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +41 -10
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +100 -55
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantity-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +23 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +2 -1
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +2 -2
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/assignment.d.ts +19 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/assignment.js +19 -0
- package/dist/core/assignment.js.map +1 -0
- package/dist/core/compare.d.ts +32 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +46 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/constants.d.ts +30 -30
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +47 -30
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +2 -0
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +14 -13
- package/dist/core/json-schema.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +0 -8
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +24 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/diff/bridge-gradient.d.ts +19 -6
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +19 -11
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +3 -0
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +7 -0
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +11 -0
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/constant-rows.js +9 -9
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/dimension-inference.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/errors.d.ts +1 -1
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +1 -15
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +0 -17
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +8 -8
- package/dist/dimensional/exact-scale.js.map +1 -1
- package/dist/dimensional/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +2 -2
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +44 -19
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -1
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/symbolic-constants.d.ts +9 -0
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +13 -1
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/types.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-data.js +2 -2
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +34 -11
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +3 -2
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +0 -3
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +10 -24
- 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 +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +8 -10
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +12 -0
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +72 -56
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/tensor-engine.d.ts +21 -0
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/relations/regime.d.ts +10 -0
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +18 -1
- package/dist/relations/regime.js.map +1 -1
- package/package.json +7 -7
package/dist/cli/commands/map.js
CHANGED
|
@@ -19,6 +19,7 @@ import { resolveGraph, coreAnchor, coreLine, groundTruthAnchor, groundTruthLine
|
|
|
19
19
|
import { emitJson } from '../output.js';
|
|
20
20
|
import { publishedUrl } from '../published-url.js';
|
|
21
21
|
import { UsageError, CliError, EXIT_CHECK_FAILED } from '../errors.js';
|
|
22
|
+
import { integerFlag } from '../numeric-flag.js';
|
|
22
23
|
import { classifyDetermination } from '../determination.js';
|
|
23
24
|
import { parseDiscoveryOpts } from './_discovery-opts.js';
|
|
24
25
|
import * as atlasMap from './_atlas-map.js';
|
|
@@ -55,8 +56,15 @@ const FLAGS = [
|
|
|
55
56
|
{ name: '--bind-short', valueStyle: 'none', description: 'Bind a one-letter catalog name in --equation. Without it, those names are reported and not bound.' },
|
|
56
57
|
{ name: '--natural', valueStyle: 'none', description: 'Set ħ = c = 1 when a dimension difference is a power of those constants.' },
|
|
57
58
|
{ name: '--geometrized', valueStyle: 'none', description: 'With the natural-unit rules, also set G = 1.' },
|
|
59
|
+
{ name: '--communities', valueStyle: 'none', description: 'Also print the layout communities (Louvain, heuristic) of the largest component. A drawing aid, not physics.' },
|
|
60
|
+
{ name: '--cycles', valueStyle: 'none', description: 'Also print the derivation cycles: strongly connected components of the directed source→target quantity graph.' },
|
|
61
|
+
{ name: '--rank-hubs', valueStyle: 'none', description: 'Also rank quantities by betweenness centrality (normalised). Computed only when asked.' },
|
|
58
62
|
JSON_FLAG,
|
|
59
63
|
];
|
|
64
|
+
/** How many hubs `--rank-hubs` prints in text; `--json` carries every quantity. */
|
|
65
|
+
const HUBS_SHOWN = 10;
|
|
66
|
+
/** Flags that add a structure section to the text and --json forms, and mean nothing on a diagram. */
|
|
67
|
+
const STRUCTURE_FLAGS = ['communities', 'cycles', 'rank-hubs'];
|
|
60
68
|
const HELP = `upt map [--source=catalog|canonical|both] [--format=text|mermaid|dot|svg]
|
|
61
69
|
[--proposed [--anchor=k=v,...] [--max-orders=N]] [--out=PATH]
|
|
62
70
|
[--equation "TARGET = EXPR" [--equation-only] [--verbose] [--bind-short]
|
|
@@ -141,6 +149,14 @@ const HELP = `upt map [--source=catalog|canonical|both] [--format=text|mermaid|d
|
|
|
141
149
|
unresolved are counted apart.
|
|
142
150
|
Every atlas view states how many of the atlas's models and bridges it
|
|
143
151
|
shows, in text, --json and --format=mermaid|dot|svg.
|
|
152
|
+
--communities, --cycles and --rank-hubs each add one section to the
|
|
153
|
+
text report (and a key to --json); they do not apply to a diagram.
|
|
154
|
+
--communities lists the layout communities (Louvain, heuristic) of the
|
|
155
|
+
largest component: where a drawing may place quantities together, never
|
|
156
|
+
a physics claim. --cycles lists the derivation cycles (strongly
|
|
157
|
+
connected components of the directed source→target quantity graph),
|
|
158
|
+
where over-determination lives. --rank-hubs ranks quantities by
|
|
159
|
+
betweenness centrality (normalised; computed only when asked).
|
|
144
160
|
e.g. upt map --relation=derivation --source=both
|
|
145
161
|
upt map --around=temperature --depth=2 --source=catalog
|
|
146
162
|
upt map --route=model-pendulum,model-lc
|
|
@@ -346,8 +362,46 @@ function printEquationReport(api, model, user, out, comparisons = []) {
|
|
|
346
362
|
}
|
|
347
363
|
}
|
|
348
364
|
}
|
|
365
|
+
/** Compute only the sections asked for; `rankHubs` is the betweenness pass the default path never runs. */
|
|
366
|
+
async function structureSections(api, graph, flags) {
|
|
367
|
+
return {
|
|
368
|
+
...(flags.has('communities') ? { communities: api.communitiesOf(graph) } : {}),
|
|
369
|
+
...(flags.has('cycles') ? { cycles: api.derivationCycles(graph) } : {}),
|
|
370
|
+
...(flags.has('rank-hubs') ? { hubs: await api.rankHubs(graph) } : {}),
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
/** The text of the structure sections, in flag order; empty when none was asked for. A number goes through `formatQuantity`. */
|
|
374
|
+
function structureLines(s, formatQuantity) {
|
|
375
|
+
const lines = [];
|
|
376
|
+
if (s.communities !== undefined) {
|
|
377
|
+
const c = s.communities;
|
|
378
|
+
lines.push(` ${c.method} of the largest component (${c.componentSize} quantities) — a drawing aid, not physics:`);
|
|
379
|
+
if (c.communities.length === 0)
|
|
380
|
+
lines.push(' none (the graph has no component)');
|
|
381
|
+
c.communities.forEach((com, i) => lines.push(` ${i + 1}. (${com.size}) ${com.quantities.join(', ')}`));
|
|
382
|
+
lines.push('');
|
|
383
|
+
}
|
|
384
|
+
if (s.cycles !== undefined) {
|
|
385
|
+
const head = s.cycles.length === 0 ? 'none — the quantity graph is acyclic' : String(s.cycles.length);
|
|
386
|
+
lines.push(` derivation cycles (strongly connected components of source→target, where over-determination lives): ${head}`);
|
|
387
|
+
for (const cyc of s.cycles)
|
|
388
|
+
lines.push(` {${cyc.quantities.join(', ')}} closed by ${cyc.edges.join(', ')}`);
|
|
389
|
+
lines.push('');
|
|
390
|
+
}
|
|
391
|
+
if (s.hubs !== undefined) {
|
|
392
|
+
const shown = Math.min(HUBS_SHOWN, s.hubs.length);
|
|
393
|
+
lines.push(` hubs by betweenness centrality (normalised; top ${shown} of ${s.hubs.length} quantities; a cut quantity of the drawing, not a central law):`);
|
|
394
|
+
for (const h of s.hubs.slice(0, shown))
|
|
395
|
+
lines.push(` ${h.quantity.padEnd(40)} ${formatQuantity(h.betweenness, 3)} (degree ${h.degree})`);
|
|
396
|
+
lines.push('');
|
|
397
|
+
}
|
|
398
|
+
// Sections are separated by one blank line; the closing line of the report brings its own.
|
|
399
|
+
while (lines.length > 0 && lines[lines.length - 1] === '')
|
|
400
|
+
lines.pop();
|
|
401
|
+
return lines;
|
|
402
|
+
}
|
|
349
403
|
/** Flags that shape the equation graph, and so mean nothing on an atlas view. */
|
|
350
|
-
const GRAPH_ONLY_FLAGS = ['source', 'around', 'depth', 'equation', 'equation-only', 'proposed', 'max-orders', 'anchor'];
|
|
404
|
+
const GRAPH_ONLY_FLAGS = ['source', 'around', 'depth', 'equation', 'equation-only', 'proposed', 'max-orders', 'anchor', ...STRUCTURE_FLAGS];
|
|
351
405
|
/** Flags that only an atlas view reads. */
|
|
352
406
|
const ATLAS_ONLY_FLAGS = ['all-routes', 'max-routes', 'stored', 'run'];
|
|
353
407
|
async function runAtlasView(ctx, route, family, observable) {
|
|
@@ -371,8 +425,9 @@ async function runAtlasView(ctx, route, family, observable) {
|
|
|
371
425
|
const maxRaw = lastValue(args.flags, 'max-routes');
|
|
372
426
|
if (maxRaw !== undefined && !allRoutes)
|
|
373
427
|
throw new CliError('upt map: --max-routes needs --all-routes');
|
|
374
|
-
|
|
375
|
-
|
|
428
|
+
// The grammar first (`0x10` is usage, exit 2); the 1..ceiling range after (exit 1).
|
|
429
|
+
const maxRoutes = maxRaw === undefined ? atlasMap.DEFAULT_MAX_ROUTES : integerFlag('map', '--max-routes', maxRaw);
|
|
430
|
+
if (maxRoutes < 1 || maxRoutes > atlasMap.MAX_ROUTES_CEILING) {
|
|
376
431
|
throw new CliError(`upt map: --max-routes=${maxRaw} must be an integer from 1 to ${atlasMap.MAX_ROUTES_CEILING}`);
|
|
377
432
|
}
|
|
378
433
|
if (args.flags.has('stored') && args.flags.has('run')) {
|
|
@@ -512,8 +567,9 @@ async function runReport(ctx) {
|
|
|
512
567
|
let focus = null;
|
|
513
568
|
let fullGraph = wholeGraph;
|
|
514
569
|
if (around !== undefined) {
|
|
515
|
-
|
|
516
|
-
|
|
570
|
+
// The grammar first (`1e1` is usage, exit 2); the 1..MAX_DEPTH range after (exit 1).
|
|
571
|
+
const depth = depthRaw === undefined ? DEFAULT_DEPTH : integerFlag('map', '--depth', depthRaw);
|
|
572
|
+
if (depth < 1 || depth > MAX_DEPTH)
|
|
517
573
|
throw new CliError(`upt map: --depth=${depthRaw} must be an integer from 1 to ${MAX_DEPTH}`);
|
|
518
574
|
const known = new Set(wholeGraph.flatMap((e) => [...e.sources.map((q) => q.name), e.target.name]));
|
|
519
575
|
const name = api.resolveQuantityName(around, known);
|
|
@@ -555,6 +611,13 @@ async function runReport(ctx) {
|
|
|
555
611
|
if (isJson && fmt !== 'text') {
|
|
556
612
|
throw new UsageError('upt: pick one output form: --json or --format');
|
|
557
613
|
}
|
|
614
|
+
const structureAsked = STRUCTURE_FLAGS.filter((f) => args.flags.has(f));
|
|
615
|
+
if (structureAsked.length > 0 && fmt !== 'text') {
|
|
616
|
+
const named = structureAsked.map((f) => `--${f}`).join(', ');
|
|
617
|
+
throw new UsageError(`upt map: ${named} print${structureAsked.length === 1 ? 's' : ''} text or --json; ${structureAsked.length === 1 ? 'it does' : 'they do'} not apply to --format=${fmt}`);
|
|
618
|
+
}
|
|
619
|
+
// Computed only when asked, over the same filtered edge list the linkage map reads.
|
|
620
|
+
const structure = await structureSections(api, graph, args.flags);
|
|
558
621
|
// --equation injects a user-supplied "TARGET = EXPR" as a 'user' junction.
|
|
559
622
|
let user = null;
|
|
560
623
|
let comparisons = [];
|
|
@@ -633,6 +696,7 @@ async function runReport(ctx) {
|
|
|
633
696
|
...(edgeLegend !== null ? { filter: edgeStats } : {}),
|
|
634
697
|
...(focus !== null ? { focus } : {}),
|
|
635
698
|
...(user ? { landing, userEquation } : {}),
|
|
699
|
+
...structure,
|
|
636
700
|
},
|
|
637
701
|
}, write);
|
|
638
702
|
return exitCode;
|
|
@@ -734,6 +798,12 @@ async function runReport(ctx) {
|
|
|
734
798
|
}
|
|
735
799
|
out(` ○ isolated (${m.isolated.length}) — share no quantity with any other edge:`);
|
|
736
800
|
out(` ${m.isolated.length === 0 ? 'none' : m.isolated.join(', ')}`);
|
|
801
|
+
const structureText = structureLines(structure, api.formatQuantity);
|
|
802
|
+
if (structureText.length > 0) {
|
|
803
|
+
out('');
|
|
804
|
+
for (const line of structureText)
|
|
805
|
+
out(line);
|
|
806
|
+
}
|
|
737
807
|
out('\n (a structural map — shared-quantity connectivity, NOT a credibility signal)');
|
|
738
808
|
return exitCode;
|
|
739
809
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../../src/cli/commands/map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,eAAe,EAAiC,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC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,EAAE,0EAA0E;IACnF,OAAO,EAAE,yDAAyD;IAClE,KAAK,EAAE,SAAS;IAChB,GAAG;CACJ,CAAC;AAEF,eAAe,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * `upt map` — how the equations LINK: the text linkage map, the visual\n * (mermaid/dot/svg) physics map, and the `--equation` user-junction\n * injection. Transposed verbatim from bin/upt.mjs's `proposedJunctions()`/\n * `analyzeEquation()`/`printEquationReport()`/`mapCmd()` (lines 387-545),\n * plus `--json` and the `--json`/`--format` conflict guard.\n *\n * `parseEquationFlag` is REPLACED by the `either`-style `--equation` FlagSpec\n * (`args.ts` already extracts `--equation=...` or `--equation \"...\"` into\n * `flags.get('equation')`). `parseDiscoveryOpts` moved to `_discovery-opts.ts`\n * — the old CLI's `proposedJunctions` fed `map`'s raw args through it\n * (bin/upt.mjs line 392), so `--proposed` shares `discover`'s\n * `--max-orders`/`--anchor` validation here too.\n */\nimport { writeFileSync } from 'node:fs';\nimport type { FlagSpec, ParsedArgs } from '../args.js';\nimport { registerCommand, type Command, type CommandCtx } from '../command.js';\nimport { commandHelp, JSON_FLAG, sourceFlag } from '../flag-help.js';\nimport { resolveGraph, coreAnchor, coreLine, groundTruthAnchor, groundTruthLine, type AnchorScope } from '../graphs.js';\nimport { emitJson } from '../output.js';\nimport { publishedUrl } from '../published-url.js';\nimport { UsageError, CliError, EXIT_CHECK_FAILED } from '../errors.js';\nimport { classifyDetermination, type Determination } from '../determination.js';\nimport { parseDiscoveryOpts } from './_discovery-opts.js';\nimport * as atlasMap from './_atlas-map.js';\nimport type {\n BridgeEdge,\n CanonicalComparison,\n EquationAnalysis,\n EvidenceTag,\n RelationType,\n VizJunction,\n VizModel,\n} from '../../cli-api.js';\nimport { canonicalCheckFailed, conventionLines } from '../conventions.js';\nimport type { UnitMode } from '../../cli-api.js';\nimport { withCatalogEvidence } from '../map-evidence.js';\nimport { DISCOVER_MAX_ORDERS_DEFAULT } from '../library-defaults.js';\n\n/** `--around` reaches this many shared-quantity hops when `--depth` is not given, and at most this many when it is. */\nconst DEFAULT_DEPTH = 1;\nconst MAX_DEPTH = 10;\n\nconst FLAGS: FlagSpec[] = [\n sourceFlag('both', 'Which graph to draw: catalog, canonical, or both. This command defaults to both.'),\n { name: '--format', valueStyle: 'attached', description: 'Output form: text, mermaid, dot, or svg. svg needs the optional @viz-js/viz peer.', defaultValue: 'text' },\n { name: '--out', valueStyle: 'attached', description: 'Write the report to PATH instead of stdout.' },\n { name: '--max-orders', valueStyle: 'attached', description: 'Magnitude-clash threshold for the --proposed overlay.', defaultValue: DISCOVER_MAX_ORDERS_DEFAULT },\n { name: '--anchor', valueStyle: 'attached', repeatable: true, description: 'Override a numeric anchor as k=v for the --proposed overlay.', defaultValue: 'mass=M_sun' },\n { name: '--proposed', valueStyle: 'none', description: 'Overlay unadjudicated identity-consequence relations.' },\n { name: '--relation', valueStyle: 'attached', description: 'Keep atlas edges whose recorded relation is TYPE.' },\n { name: '--evidence', valueStyle: 'attached', description: 'Keep atlas edges whose derived evidence set contains TAG.' },\n { name: '--around', valueStyle: 'either', description: 'Keep edges within --depth shared-quantity hops of QUANTITY.' },\n { name: '--depth', valueStyle: 'attached', description: 'Hop count for --around.', defaultValue: String(DEFAULT_DEPTH) },\n { name: '--route', valueStyle: 'either', description: 'Map the atlas route FROM,TO instead of the equation graph.' },\n { name: '--all-routes', valueStyle: 'none', description: 'With --route, list every simple route, shortest first.' },\n { name: '--max-routes', valueStyle: 'attached', description: `Cap on --all-routes. The maximum accepted is ${atlasMap.MAX_ROUTES_CEILING}.`, defaultValue: String(atlasMap.DEFAULT_MAX_ROUTES) },\n { name: '--family', valueStyle: 'either', description: 'Map one atlas family by name.' },\n { name: '--observable', valueStyle: 'either', description: 'Map bridges whose recorded text names this observable.' },\n { name: '--stored', valueStyle: 'none', description: `Derive evidence from ${publishedUrl('data/atlas/witness-results.json')}. When the file is absent (a checkout or install without data/), the command names --run.` },\n { name: '--run', valueStyle: 'none', description: 'Run the shown bridges\\' in-process witnesses now. Exit 3 if one is refuted.' },\n // optionalValue: a bare trailing --equation stores '' so the empty-check in\n // run() owns the diagnostic (old-CLI fidelity: bin/upt.mjs did `a[i+1] ?? ''`\n // and let mapCmd emit `upt: --equation requires \"TARGET = EXPR\"`, exit 2).\n { name: '--equation', valueStyle: 'either', optionalValue: true, description: 'Inject TARGET = EXPR as a user node and report where it lands.' },\n { name: '--equation-only', valueStyle: 'none', description: 'Print only the equation verdict. Errors when --equation is missing.' },\n { name: '--verbose', valueStyle: 'none', description: 'With --equation, also print the linkage map.' },\n { name: '--bind-short', valueStyle: 'none', description: 'Bind a one-letter catalog name in --equation. Without it, those names are reported and not bound.' },\n { name: '--natural', valueStyle: 'none', description: 'Set ħ = c = 1 when a dimension difference is a power of those constants.' },\n { name: '--geometrized', valueStyle: 'none', description: 'With the natural-unit rules, also set G = 1.' },\n JSON_FLAG,\n];\n\nconst HELP = `upt map [--source=catalog|canonical|both] [--format=text|mermaid|dot|svg]\n [--proposed [--anchor=k=v,...] [--max-orders=N]] [--out=PATH]\n [--equation \"TARGET = EXPR\" [--equation-only] [--verbose] [--bind-short]\n [--natural] [--geometrized]] [--around=QUANTITY [--depth=N]]\n [--relation=TYPE] [--evidence=TAG] [--route=FROM,TO [--all-routes\n [--max-routes=N]]] [--family=NAME] [--observable=NAME] [--stored | --run]\n Map how the equations LINK: connected components (clusters) of the\n graph by shared quantities, the anchored core, the link hubs, and\n the isolated tail.\n --source defaults to 'both' (catalog + canonical) — a pure\n connectivity question gets the honest, all-known-physics answer by\n default; --source=catalog shows the bridge-catalog view alone.\n --out=PATH writes whatever form was asked for (text, --json or a\n visual format) to PATH instead of stdout; an empty PATH exits 1.\n --format=mermaid|dot|svg emits the VISUAL map (quantities = nodes,\n equations = junctions colored by status, one subgraph per component).\n text (default) is the unchanged linkage printout. svg renders the dot\n layout via the optional @viz-js/viz peer (npm i @viz-js/viz; or pipe\n dot through \"dot -Tsvg\"). --proposed overlays the unadjudicated\n identity-consequence relations (gray dashed); --anchor and --max-orders\n tune the discovery funnel that derives them, as in \\`upt discover\\`.\n --out writes to a file (default stdout).\n --equation \"TARGET = EXPR\" injects YOUR OWN equation as a violet 'user'\n node, dimensionally checks it, compares with the canonical registry, and\n reports nearest equations by shared-quantity overlap (not a full edge\n dump). Multi-word names may use underscores or catalog hyphens\n (planck_length / planck-length). Unknown names get a \"did you mean?\",\n and a registered constant of the inferred dimension (sigma → sigma_sb).\n A catalog target whose dimension depends on an unresolved name exits 3\n and does not quote that placeholder, unless a canonical comparison agreed.\n A one-letter catalog name (a, r, …) is reported and not bound; --bind-short\n binds it. The alias T → temperature still binds.\n An all-constant right-hand side (the Planck length) is compared at the\n SI constant values when its target is a catalog quantity.\n With --equation, the default is the verdict only. --verbose prints the\n linkage map after it. --equation-only is the same verdict and errors\n when --equation is missing (with --json: no \"linkage\" field).\n A bare e in the formula is the elementary charge. E is energy.\n Euler's number is exp(x), for example exp(1). The name euler is refused.\n --natural sets ħ = c = 1 for a dimension difference that is a power of\n those constants; --geometrized also allows powers of G. The SI default\n still refuses rest_energy = mass.\n --relation=TYPE keeps only edges whose recorded Atlas relation is that\n type; --evidence=TAG keeps only edges whose evidence set, DERIVED from\n the catalog row at read time, contains that tag.\n ⚠ Filtering changes what a missing overlay means: unfiltered, an edge\n with no overlay is KEPT; filtered, it is DROPPED, because nothing shows\n it satisfies the filter. Those drops are counted and printed separately\n from the edges that simply did not match — an unaudited graph must not\n render as a complete answer.\n --around=QUANTITY [--depth=N] keeps only the edges within N\n shared-quantity hops of QUANTITY (default ${DEFAULT_DEPTH}: the edges that use it),\n in every output form, and prints how many of the source's edges it\n kept: the others are omitted from the view, not absent from the graph.\n --route=FROM,TO and --family=NAME map the ATLAS instead: models and\n the recorded bridges between them, not shared quantities. --route\n shows the route \\`upt path\\` reports, each bridge's relation,\n assumptions, regime, bound and derived evidence, the composition\n step by step (and where the table yields no composite claim), and\n the equations each model records. --family shows one family's\n models, its bridges, the bridges from other families that touch it,\n and its rejections; --relation/--evidence filter its bridges, and a\n bridge whose tag depends on witness results is counted as undecided,\n not as a mismatch. A model's equations are only those its\n canonicalRefs record; nothing is inferred from shared quantities.\n --route=FROM,TO --all-routes lists every simple route (no model\n visited twice), shortest first, each with its composition and route\n claim, and counts the claims; --max-routes=N (default ${atlasMap.DEFAULT_MAX_ROUTES}, at most\n ${atlasMap.MAX_ROUTES_CEILING}) bounds the list, and a list cut short says so and says up to\n which bridge count it is complete.\n --observable=NAME maps the bridges whose RECORDED preserves text, or\n declared bound translation, names that observable (a whole-word text\n match, nothing inferred), lists apart those recording it as NOT\n preserved, and counts the bridges that record nothing about it;\n --relation/--evidence filter it as they filter a family.\n --stored derives evidence from the committed witness results\n (${publishedUrl('data/atlas/witness-results.json')}; it ships in data/),\n labelled with the last commit that touched it; --run runs the shown\n bridges' in-process registered witnesses now (exit 3 if any is\n refuted). Either resolves a tag once its witnesses have results; a\n witness with no result leaves it undecided, and checked, refuted and\n unresolved are counted apart.\n Every atlas view states how many of the atlas's models and bridges it\n shows, in text, --json and --format=mermaid|dot|svg.\n e.g. upt map --relation=derivation --source=both\n upt map --around=temperature --depth=2 --source=catalog\n upt map --route=model-pendulum,model-lc\n upt map --route=model-string,model-dalembert --all-routes --stored\n upt map --family=oscillators --evidence=formally-proved\n upt map --observable=frequency --run`;\n\n/**\n * The edges within `depth` shared-quantity hops of `quantity`: hop 1 is every\n * edge that has it as a source or target, and each further hop adds the edges\n * sharing a quantity with one already kept.\n * @internal\n */\nexport function neighbourhood(graph: readonly BridgeEdge[], quantity: string, depth: number): BridgeEdge[] {\n const names = (e: BridgeEdge): string[] => [...e.sources.map((q) => q.name), e.target.name];\n const reached = new Set([quantity]);\n const kept = new Set<BridgeEdge>();\n for (let hop = 0; hop < depth; hop++) {\n const frontier = graph.filter((e) => !kept.has(e) && names(e).some((n) => reached.has(n)));\n if (frontier.length === 0) break;\n for (const e of frontier) {\n kept.add(e);\n for (const n of names(e)) reached.add(n);\n }\n }\n return graph.filter((e) => kept.has(e));\n}\n\nconst RELATION_TYPES: readonly RelationType[] = [\n 'derivation',\n 'exact-equivalence',\n 'restriction',\n 'approximation',\n 'coarse-graining',\n 'analytic-continuation',\n 'structural-analogy',\n 'deformation-quantization',\n];\n\nconst EVIDENCE_TAGS: readonly EvidenceTag[] = [\n 'proposed',\n 'reviewed',\n 'dimension-checked',\n 'convention-checked',\n 'symbolically-checked',\n 'numerically-supported',\n 'formally-proved',\n 'formally-proved-property',\n 'formally-proved-cross-check',\n 'empirically-supported',\n 'contradicted',\n 'unresolved',\n];\n\n/** Last value of an `attached` flag, or undefined when the flag is absent. */\nfunction lastValue(flags: ParsedArgs['flags'], name: string): string | undefined {\n const v = flags.get(name);\n return v && v.length > 0 ? v[v.length - 1] : undefined;\n}\n\n/** Validate one filter value against its vocabulary. A bad value is a CliError\n * (exit 1); an unknown FLAG is the parser's UsageError (exit 2). */\nfunction parseFilter<T extends string>(\n raw: string | undefined,\n allowed: readonly T[],\n flag: string,\n): T | undefined {\n if (raw === undefined) return undefined;\n if (!allowed.includes(raw as T)) {\n throw new CliError(`upt: unknown ${flag}='${raw}' (expected: ${allowed.join(' | ')})`);\n }\n return raw as T;\n}\n\n// Convert the derived identity-consequence proposals into viz junctions\n// (gray-dashed, status 'proposed'). The library never imports proposed-bridges;\n// the CLI does the conversion, keeping the epistemic firewall intact.\nfunction proposedJunctions(\n api: CommandCtx['api'],\n graph: readonly BridgeEdge[],\n flags: ParsedArgs['flags']\n): VizJunction[] {\n const opts = parseDiscoveryOpts(api, flags);\n const ranked = api.rankDiscoveries(graph, opts);\n return api.deriveProposedBridges(ranked).map((p) => ({\n id: p.id,\n label: p.id,\n status: 'proposed' as const,\n sources: (p.governing || []).map((g) => g.name),\n target: p.target.name,\n }));\n}\n\n// Build the catalog quantity name→dimension map for the chosen graph, then run\n// the (testable) library analysis: parse + dimensional validation + \"did you\n// mean?\" hints. The library owns the physics (constants' dimensions, inference);\n// the CLI only formats.\nasync function analyzeEquation(\n api: CommandCtx['api'],\n equation: string,\n graph: readonly BridgeEdge[],\n options?: { readonly bindShortNames?: boolean; readonly units?: Exclude<UnitMode, 'si'> },\n): Promise<{ user: EquationAnalysis; comparisons: CanonicalComparison[] }> {\n const catalogDims = new Map<string, import('../../dimensional/types.js').Dimension>();\n for (const e of graph) {\n for (const q of [...e.sources, e.target]) catalogDims.set(q.name, q.dim);\n }\n const user = await api.analyzeUserEquation(equation, catalogDims, options);\n // Dimensions cannot see a prefactor: compare with the canonical equation the\n // user's one restates, when the registry holds one (persona finding L2).\n const comparisons = user.parseError\n ? []\n : await api.compareUserEquation(equation, catalogDims, {\n bindShortNames: options?.bindShortNames,\n ...(options?.units === undefined ? {} : { constantOverrides: api.naturalConstantOverrides(options.units) }),\n });\n return { user, comparisons };\n}\n\nfunction unresolvedNames(user: EquationAnalysis): string[] {\n const placeholderNames = [\n ...(user.placeholders ?? []),\n ...(user.shortBindings ?? []).filter((b) => b.bound === false).map((b) => b.name),\n ];\n return [...new Set([...(user.hints ?? []).map((h) => h.name), ...placeholderNames])];\n}\n\n/** The exit `upt derive` uses for the same question. */\nfunction equationDetermination(\n user: EquationAnalysis,\n comparisons: readonly CanonicalComparison[],\n): Determination {\n const unresolved = unresolvedNames(user);\n const asked = user.targetDimension != null;\n return classifyDetermination({\n asked,\n agrees: comparisons.some((c) => c.kind === 'agrees'),\n checkFailed:\n (user.consistent === false && unresolved.length === 0) || canonicalCheckFailed(comparisons),\n notUnique: false,\n unresolved,\n });\n}\n\nfunction tainted(user: EquationAnalysis): boolean {\n return unresolvedNames(user).length > 0;\n}\n\n// Print the dimensional verdict, where the equation landed, and any hints.\n// `out` is ctx.out (text mode → stdout) or ctx.err (visual → stderr).\nfunction printEquationReport(\n api: CommandCtx['api'],\n model: VizModel,\n user: EquationAnalysis,\n out: (line?: string) => void,\n comparisons: readonly CanonicalComparison[] = [],\n): void {\n out('');\n const unresolved = unresolvedNames(user);\n const verdict = equationDetermination(user, comparisons);\n if (user.consistent === true) {\n out(` ✓ dimensionally consistent: ${api.format(user.rhsDimension!)}`);\n } else if (verdict.report === 'not-established') {\n const names = unresolved.map((n) => `'${n}'`).join(', ');\n out(\n ` · NOT ESTABLISHED: ${names} ${unresolved.length > 1 ? 'have' : 'has'} no catalog dimension, ` +\n 'so the right-hand side dimension was not established and is not reported.',\n );\n } else if (verdict.report === 'established' && unresolved.length > 0) {\n // A canonical agreement ran. The placeholder dimension is not that result.\n } else if (user.consistent === false) {\n out(\n ` ⚠ dimensional MISMATCH: RHS is ${api.format(user.rhsDimension!)} but the target is ${api.format(\n user.targetDimension!\n )}`\n );\n } else if (user.rhsDimension && (user.placeholders ?? []).length > 0) {\n const names = user.placeholders.map((n) => `'${n}'`).join(', ');\n out(\n ` · UNKNOWN: ${names} ${user.placeholders.length === 1 ? 'was' : 'were'} taken as dimensionless. ` +\n 'That is not the dimension of the formula, and the target is not a bound catalog name, so nothing was checked',\n );\n } else if (user.rhsDimension) {\n out(` · RHS dimension: ${api.format(user.rhsDimension)} (target not in the catalog, so no comparison)`);\n }\n for (const line of api.describeKnownRelation(comparisons, user.junction.target, [...user.junction.sources])) {\n out(` ${line}`);\n }\n for (const line of conventionLines(comparisons.map((c) => c.id))) out(` ${line}`);\n if (user.naturalNote) out(` ${user.naturalNote}`);\n const L = api.equationLanding(model, 'user-equation');\n if (L.isolated) {\n out(' ⚠ your equation is ISOLATED — it shares no quantity with this graph.');\n } else {\n out(\n ` ● your equation joins ${L.anchored ? 'the ANCHORED cluster' : 'a cluster'} of ${L.clusterSize} via {${L.sharedQuantities.join(', ')}}`\n );\n // W3/I3: do not dump ~100 edge ids — that made shared length/temperature look\n // like a physics claim. Summarise nearest equations by shared-quantity overlap.\n for (const line of api.formatConnectedSummary(model, L)) out(line);\n }\n for (const h of user.hints ?? []) {\n if (!h.suggestions.length) {\n out(` ⚠ '${h.name}' did not match a catalog quantity (run \\`upt canonical\\` for the vocabulary).`);\n } else if (h.byDimension) {\n out(` ⚠ '${h.name}' is unknown — by its inferred dimension, did you mean: ${h.suggestions.join(', ')}?`);\n } else {\n out(` ⚠ '${h.name}' did not match a catalog quantity — did you mean: ${h.suggestions.join(', ')}?`);\n }\n // Persona finding L5: `sigma` for the Stefan–Boltzmann constant `sigma_sb`.\n if ((h.constants ?? []).length > 0) {\n const list = h.constants!.join(', ');\n out(\n ` '${h.name}' has the inferred dimension of the registered constant${h.constants!.length > 1 ? 's' : ''} ${list}; ` +\n 'write that name to use its SI value',\n );\n }\n }\n // Persona finding W6: a one-letter name binds to whatever the catalog calls that letter.\n for (const b of user.shortBindings ?? []) {\n const users = model.junctions\n .filter((j) => j.id !== 'user-equation' && (j.target === b.quantity || j.sources.includes(b.quantity)))\n .map((j) => j.id)\n .sort();\n const shown = users.slice(0, 3).join(', ') + (users.length > 3 ? `, +${users.length - 3} more` : '');\n const used = users.length > 0 ? ` (used by ${shown})` : '';\n if (b.bound === false) {\n out(\n ` · '${b.name}' matches the catalog quantity ${b.quantity} ${api.format(b.dim)}${used}, a one-letter name, and is not bound. ` +\n 'Pass --bind-short to bind it, or write the full name you meant',\n );\n } else {\n out(\n ` · '${b.name}' is bound to the catalog quantity ${b.quantity} ${api.format(b.dim)}, a one-letter name` +\n `${used}; if you meant another quantity, write its full name`,\n );\n }\n }\n}\n\n/** Flags that shape the equation graph, and so mean nothing on an atlas view. */\nconst GRAPH_ONLY_FLAGS = ['source', 'around', 'depth', 'equation', 'equation-only', 'proposed', 'max-orders', 'anchor'] as const;\n\n/** Flags that only an atlas view reads. */\nconst ATLAS_ONLY_FLAGS = ['all-routes', 'max-routes', 'stored', 'run'] as const;\n\nasync function runAtlasView(\n ctx: CommandCtx,\n route: string | undefined,\n family: string | undefined,\n observable: string | undefined,\n): Promise<number> {\n const { args, api, err, write } = ctx;\n const chosen = [route !== undefined, family !== undefined, observable !== undefined].filter(Boolean).length;\n if (chosen > 1) throw new CliError('upt map: pick one atlas view: --route, --family or --observable');\n const view = route !== undefined ? '--route' : family !== undefined ? '--family' : '--observable';\n const stray = GRAPH_ONLY_FLAGS.filter((f) => args.flags.has(f));\n if (stray.length > 0) {\n throw new CliError(\n `upt map: ${view} maps the atlas, not the equation graph; ${stray.map((f) => `--${f}`).join(', ')} do${stray.length === 1 ? 'es' : ''} not apply`,\n );\n }\n const relation = parseFilter(lastValue(args.flags, 'relation'), RELATION_TYPES, '--relation');\n const evidence = parseFilter(lastValue(args.flags, 'evidence'), EVIDENCE_TAGS, '--evidence');\n if (route !== undefined && (relation !== undefined || evidence !== undefined)) {\n throw new CliError('upt map: a route is composed whole, so --relation/--evidence do not filter it; filter a family view instead (--family=NAME)');\n }\n const allRoutes = args.flags.has('all-routes');\n if (allRoutes && route === undefined) throw new CliError('upt map: --all-routes needs --route=FROM,TO');\n const maxRaw = lastValue(args.flags, 'max-routes');\n if (maxRaw !== undefined && !allRoutes) throw new CliError('upt map: --max-routes needs --all-routes');\n const maxRoutes = maxRaw === undefined ? atlasMap.DEFAULT_MAX_ROUTES : Number(maxRaw);\n if (!Number.isInteger(maxRoutes) || maxRoutes < 1 || maxRoutes > atlasMap.MAX_ROUTES_CEILING) {\n throw new CliError(`upt map: --max-routes=${maxRaw} must be an integer from 1 to ${atlasMap.MAX_ROUTES_CEILING}`);\n }\n if (args.flags.has('stored') && args.flags.has('run')) {\n throw new CliError('upt map: pick one witness-results source: --stored (the committed artifact) or --run (run now)');\n }\n const fmt = lastValue(args.flags, 'format') ?? 'text';\n const isJson = args.flags.has('json');\n if (isJson && fmt !== 'text') throw new UsageError('upt: pick one output form: --json or --format');\n if (!['text', 'mermaid', 'dot', 'svg'].includes(fmt)) {\n throw new CliError(`upt: unknown --format='${fmt}' (expected: text | mermaid | dot | svg)`);\n }\n\n const filter = {\n ...(relation !== undefined ? { relation } : {}),\n ...(evidence !== undefined ? { evidence } : {}),\n };\n const endpoints = route === undefined ? null : atlasMap.parseRoute(route);\n const build = (results: atlasMap.WitnessResults | null): atlasMap.AtlasView =>\n endpoints !== null\n ? allRoutes\n ? atlasMap.buildRoutesView(api, ...endpoints, maxRoutes, results)\n : atlasMap.buildRouteView(api, ...endpoints, results)\n : family !== undefined\n ? atlasMap.buildFamilyView(api, family, filter, results)\n : atlasMap.buildObservableView(api, observable!, filter, results);\n let results: atlasMap.WitnessResults | null = null;\n if (args.flags.has('stored')) results = atlasMap.loadStoredResults();\n else if (args.flags.has('run')) {\n // Unfiltered first: a filter's verdict depends on the results, so every candidate bridge is run.\n const candidates =\n endpoints === null\n ? atlasMap.bridgeIdsOf(family !== undefined ? atlasMap.buildFamilyView(api, family, {}) : atlasMap.buildObservableView(api, observable!, {}))\n : atlasMap.bridgeIdsOf(build(null));\n results = await atlasMap.runResults(api, candidates);\n }\n const v = build(results);\n const exitCode = results?.mode === 'run' && results.rows.some((r) => r.status === 'refuted') ? EXIT_CHECK_FAILED : 0;\n\n if (isJson) {\n emitJson({ command: 'map', source: 'atlas', result: v }, write);\n return exitCode;\n }\n if (fmt === 'text') {\n const lines =\n v.view === 'route'\n ? atlasMap.routeText(v)\n : v.view === 'routes'\n ? atlasMap.routesText(v)\n : v.view === 'family'\n ? atlasMap.familyText(v)\n : atlasMap.observableText(v);\n for (const line of lines) ctx.out(line);\n return exitCode;\n }\n let src: string;\n if (fmt === 'svg') {\n try {\n src = await api.renderDotToSvg(atlasMap.toDot(v));\n } catch (e) {\n throw new CliError(e && (e as Error).message ? (e as Error).message : String(e));\n }\n } else {\n src = fmt === 'mermaid' ? atlasMap.toMermaid(v) : atlasMap.toDot(v);\n }\n const path = lastValue(args.flags, 'out');\n if (path !== undefined) {\n if (!path) throw new CliError('upt: --out= requires a non-empty PATH');\n try {\n writeFileSync(path, src);\n } catch (e) {\n throw new CliError(`upt map: ${(e as Error).message}`);\n }\n err(`upt: wrote ${fmt} to ${path}`);\n } else {\n write(src);\n }\n err(`upt: ${atlasMap.viewLegend(v)}`);\n return exitCode;\n}\n\n/**\n * `--out=PATH` holds for every output form. A visual form writes its diagram\n * source (handled by the branch that renders it); the text report and the\n * `--json` envelope are captured here and written whole, so stdout stays\n * empty and the file holds exactly what stdout would have carried. An empty\n * PATH exits 1 in every form.\n */\nasync function run(ctx: CommandCtx): Promise<number> {\n const path = lastValue(ctx.args.flags, 'out');\n const fmt = lastValue(ctx.args.flags, 'format') ?? 'text';\n if (path === undefined || fmt !== 'text') return runReport(ctx);\n if (!path) throw new CliError('upt: --out= requires a non-empty PATH');\n let captured = '';\n const code = await runReport({\n ...ctx,\n out: (line?: string) => {\n captured += (line ?? '') + '\\n';\n },\n write: (s: string) => {\n captured += s;\n },\n });\n try {\n writeFileSync(path, captured);\n } catch (e) {\n throw new CliError(`upt map: ${(e as Error).message}`);\n }\n ctx.err(`upt: wrote ${ctx.args.flags.has('json') ? 'json' : 'text'} to ${path}`);\n return code;\n}\n\nasync function runReport(ctx: CommandCtx): Promise<number> {\n const { args, api, out, err, write } = ctx;\n const route = lastValue(args.flags, 'route');\n const family = lastValue(args.flags, 'family');\n const observable = lastValue(args.flags, 'observable');\n if (route !== undefined || family !== undefined || observable !== undefined) return runAtlasView(ctx, route, family, observable);\n const atlasOnly = ATLAS_ONLY_FLAGS.filter((f) => args.flags.has(f));\n if (atlasOnly.length > 0) {\n throw new CliError(\n `upt map: ${atlasOnly.map((f) => `--${f}`).join(', ')} appl${atlasOnly.length === 1 ? 'ies' : 'y'} to an atlas view ` +\n '(--route, --family or --observable), not to the equation graph',\n );\n }\n // map asks a pure connectivity question, so it defaults to --source=both\n // (catalog + canonical) rather than graphs.ts's catalog fallback used by\n // the other --source commands (e.g. discover, which keeps catalog).\n const sourceFlags = args.flags.has('source') ? args.flags : new Map(args.flags).set('source', ['both']);\n const { graph: wholeGraph, label, source } = resolveGraph(api, sourceFlags);\n\n const around = lastValue(args.flags, 'around');\n const depthRaw = lastValue(args.flags, 'depth');\n if (depthRaw !== undefined && around === undefined) throw new CliError('upt map: --depth needs --around');\n let focus: { around: string; depth: number; kept: number; of: number } | null = null;\n let fullGraph = wholeGraph;\n if (around !== undefined) {\n const depth = depthRaw === undefined ? DEFAULT_DEPTH : Number(depthRaw);\n if (!Number.isInteger(depth) || depth < 1 || depth > MAX_DEPTH) throw new CliError(`upt map: --depth=${depthRaw} must be an integer from 1 to ${MAX_DEPTH}`);\n const known = new Set(wholeGraph.flatMap((e) => [...e.sources.map((q) => q.name), e.target.name]));\n const name = api.resolveQuantityName(around, known);\n if (name === null) {\n const near = api.suggestQuantities(around, known);\n throw new CliError(\n `upt map: '${around}' is not a quantity of the ${label} graph` + (near.length > 0 ? `; did you mean: ${near.join(', ')}?` : ''),\n );\n }\n fullGraph = neighbourhood(wholeGraph, name, depth);\n focus = { around: name, depth, kept: fullGraph.length, of: wholeGraph.length };\n }\n const focusLine =\n focus === null\n ? null\n : `focused: ${focus.kept} of ${focus.of} edges within ${focus.depth} hop(s) of '${focus.around}' [${label}]; ` +\n 'the rest are omitted from this view, not absent from the graph';\n // The two overlay filters. Parsed BEFORE anything else is computed so a bad\n // value costs nothing and always exits 1.\n const relation = parseFilter(lastValue(args.flags, 'relation'), RELATION_TYPES, '--relation');\n const evidence = parseFilter(lastValue(args.flags, 'evidence'), EVIDENCE_TAGS, '--evidence');\n const filterOpts = withCatalogEvidence({\n ...(relation !== undefined ? { relation } : {}),\n ...(evidence !== undefined ? { evidence } : {}),\n });\n // The TEXT and JSON paths filter the edge list here, because `linkageMap`\n // consumes edges. The VISUAL path hands `buildVizModel` the FULL graph with\n // the same options, so the model also judges the --proposed / --equation\n // overlay junctions, which are not edges and which `filterEdges` cannot see.\n // One predicate, two callers: they cannot disagree about what a filter\n // selects, only about how much they were asked to count.\n const { kept: graph, stats: edgeStats } = api.filterEdges(fullGraph, filterOpts);\n // Audit I3: what \"anchored\" means here, and the discovery ground truth when --proposed ran the funnel.\n const anchor: AnchorScope = {\n core: coreAnchor(graph),\n ...(args.flags.has('proposed') ? { groundTruth: groundTruthAnchor(api, parseDiscoveryOpts(api, args.flags)) } : {}),\n };\n const edgeLegend = api.formatFilterLegend(edgeStats);\n\n const fmtValues = args.flags.get('format');\n const fmt = fmtValues && fmtValues.length > 0 ? fmtValues[fmtValues.length - 1] : 'text';\n const isJson = args.flags.has('json');\n\n if (isJson && fmt !== 'text') {\n throw new UsageError('upt: pick one output form: --json or --format');\n }\n\n // --equation injects a user-supplied \"TARGET = EXPR\" as a 'user' junction.\n let user: EquationAnalysis | null = null;\n let comparisons: CanonicalComparison[] = [];\n const equationValues = args.flags.get('equation');\n const equation = equationValues && equationValues.length > 0 ? equationValues[equationValues.length - 1] : null;\n // Persona finding L7: the verdict alone, without the linkage map after it.\n const equationOnly = args.flags.has('equation-only');\n if (equationOnly && equation == null) throw new UsageError('upt map: --equation-only needs --equation \"TARGET = EXPR\"');\n if (equationOnly && fmt !== 'text') {\n throw new UsageError(`upt map: --equation-only prints the verdict as text or --json; it does not apply to --format=${fmt}`);\n }\n if (equation != null) {\n if (!equation.trim()) {\n throw new UsageError('upt: --equation requires \"TARGET = EXPR\"');\n }\n try {\n const units: Exclude<UnitMode, 'si'> | undefined = args.flags.has('geometrized')\n ? 'geometrized'\n : args.flags.has('natural')\n ? 'natural'\n : undefined;\n if (args.flags.has('geometrized') && args.flags.has('natural')) {\n throw new UsageError('upt map: pick one unit mode: --natural (ħ = c = 1) or --geometrized (ħ = c = G = 1)');\n }\n ({ user, comparisons } = await analyzeEquation(api, equation, graph, {\n bindShortNames: args.flags.has('bind-short'),\n ...(units === undefined ? {} : { units }),\n })); // throws UserEquationError on malformed structure\n } catch (e) {\n throw new UsageError('upt: ' + (e && (e as Error).message ? (e as Error).message : String(e)));\n }\n if (user.parseError) {\n throw new UsageError('upt: ' + user.parseError); // dimensionally malformed RHS\n }\n }\n\n // The same classification `upt derive` uses. A canonical agreement stays 0.\n // A catalog target that was not established exits 3. An unbound target stays 0.\n const exitCode = user === null ? 0 : equationDetermination(user, comparisons).exit;\n\n // Ranked from the UNFILTERED graph: the proposal set is a property of the\n // whole catalog, and the model then judges each overlay junction under the\n // same filter as every other junction. Computed once for every output form.\n const proposed: VizJunction[] | null = args.flags.has('proposed') ? proposedJunctions(api, wholeGraph, args.flags) : null;\n const overlay = (extra: VizJunction[]): VizJunction[] => [...(proposed ?? []), ...extra];\n\n if (isJson) {\n const linkage = api.linkageMap(graph);\n let landing: ReturnType<typeof api.equationLanding> | undefined;\n let userEquation: Record<string, unknown> | undefined;\n if (user) {\n const model = api.buildVizModel(fullGraph, {\n title: `UPT physics map — ${label}`,\n extraJunctions: overlay([user.junction]),\n ...filterOpts,\n });\n landing = api.equationLanding(model, 'user-equation');\n userEquation = {\n equation: user.junction.label,\n consistent: tainted(user) ? null : user.consistent,\n rhsDimension: tainted(user) ? null : user.rhsDimension,\n targetDimension: user.targetDimension,\n hints: user.hints,\n shortBindings: user.shortBindings,\n ...(user.placeholders.length === 0 ? {} : { placeholders: user.placeholders }),\n canonicalComparisons: comparisons,\n catalogEdges: api.matchingCatalogEdges(user.junction.target, [...user.junction.sources]),\n };\n }\n emitJson(\n {\n command: 'map',\n source,\n anchor,\n result: {\n ...(equation != null && (equationOnly || !args.flags.has('verbose')) ? {} : { linkage }),\n ...(proposed === null ? {} : { proposed: proposed.map((p) => ({ id: p.id, target: p.target, sources: p.sources })) }),\n ...(edgeLegend !== null ? { filter: edgeStats } : {}),\n ...(focus !== null ? { focus } : {}),\n ...(user ? { landing, userEquation } : {}),\n },\n },\n write\n );\n return exitCode;\n }\n\n if (fmt === 'mermaid' || fmt === 'dot' || fmt === 'svg') {\n const extraJunctions = overlay(user ? [user.junction] : []);\n const model = api.buildVizModel(fullGraph, {\n title: `UPT physics map — ${label}`,\n extraJunctions,\n ...filterOpts,\n });\n // svg is the dot layout rendered by the optional @viz-js/viz peer.\n let src: string;\n if (fmt === 'svg') {\n try {\n src = await api.renderDotToSvg(model.toDot());\n } catch (e) {\n throw new CliError(e && (e as Error).message ? (e as Error).message : String(e));\n }\n } else {\n src = fmt === 'mermaid' ? model.toMermaid() : model.toDot();\n }\n const outValues = args.flags.get('out');\n if (outValues && outValues.length > 0) {\n const path = outValues[outValues.length - 1];\n if (!path) {\n throw new CliError('upt: --out= requires a non-empty PATH');\n }\n try {\n writeFileSync(path, src);\n } catch (e) {\n throw new CliError(`upt map: ${(e as Error).message}`);\n }\n err(`upt: wrote ${fmt} (${model.junctions.length} junctions, ${model.clusters.length} clusters) to ${path}`);\n } else {\n write(src);\n }\n // Legend and landing report go to stderr so stdout/--out stays pure diagram\n // source. The diagram itself also carries the legend (see `buildVizModel`).\n if (focusLine !== null) err(`upt: ${focusLine}`);\n if (model.filterLegend !== null) err(`upt: ${model.filterLegend}`);\n if (user) printEquationReport(api, model, user, err, comparisons);\n return exitCode;\n }\n if (fmt !== 'text') {\n throw new CliError(`upt: unknown --format='${fmt}' (expected: text | mermaid | dot | svg)`);\n }\n\n // --equation: the verdict on the user's equation is the answer asked for, so it\n // comes BEFORE the linkage map, not after ~45 lines of it (persona finding N4).\n if (user) {\n const model = api.buildVizModel(fullGraph, {\n title: `UPT physics map — ${label}`,\n extraJunctions: overlay([user.junction]),\n ...filterOpts,\n });\n out(`\\nYour equation: ${user.junction.label}`);\n printEquationReport(api, model, user, out, comparisons);\n if (equationOnly || !args.flags.has('verbose')) return exitCode;\n }\n\n const m = api.linkageMap(graph);\n const mix = (s: Readonly<Record<string, number>>) =>\n Object.entries(s)\n .map(([k, v]) => `${v} ${k}`)\n .join(', ');\n out(`\\nLinkage map — how the equations connect via shared quantities [source: ${label}]`);\n out(`(${m.componentCount} components over ${graph.length} edges; ${m.compositions} compose into chains)`);\n out(` ${coreLine(anchor.core!)}`);\n if (anchor.groundTruth) out(` proposals: ${groundTruthLine(anchor.groundTruth)}`);\n if (proposed !== null) {\n // The overlay the visual forms draw, listed here: an unadjudicated identity consequence is a\n // proposal, never a catalog edge. Each names its target and the quantities it would relate.\n out(` proposed relations (${proposed.length}, unadjudicated identity consequences; not catalog edges):`);\n for (const p of proposed) {\n // No free input: every governing quantity of the derived relation is a registered constant.\n const sources = p.sources.length === 0 ? '{} (no sources: every input is a registered constant)' : `{${p.sources.join(', ')}}`;\n out(` ${p.id}: ${p.target} ← ${sources}`);\n }\n if (proposed.length === 0) out(' (none at this anchor and --max-orders)');\n }\n out('');\n if (focusLine !== null) out(` ${focusLine}`);\n if (edgeLegend !== null) out(` ${edgeLegend}`);\n for (const c of m.clusters.filter((x) => x.size > 1)) {\n out(` ● cluster of ${c.size}${c.anchored ? ' [ANCHORED to known physics]' : ''}`);\n out(` edges: ${c.edges.join(', ')}`);\n out(` status: ${mix(c.statusMix)}`);\n out(` link hubs: ${c.hubs.join(', ')}\\n`);\n }\n out(` ○ isolated (${m.isolated.length}) — share no quantity with any other edge:`);\n out(` ${m.isolated.length === 0 ? 'none' : m.isolated.join(', ')}`);\n out('\\n (a structural map — shared-quantity connectivity, NOT a credibility signal)');\n return exitCode;\n}\n\nexport const command: Command = {\n name: 'map',\n aliases: ['linkage'],\n flags: FLAGS,\n help: commandHelp(HELP, FLAGS),\n summary: 'Show how equations link, or where your own equation lands on that graph.',\n example: 'upt map --equation \"period = 2*pi*sqrt(length/gravity)\"',\n group: 'explore',\n run,\n};\n\nregisterCommand(command);\n"]}
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../../src/cli/commands/map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,eAAe,EAAiC,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AACxH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC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AE,KAAK;IACX,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC;IAC9B,OAAO,EAAE,0EAA0E;IACnF,OAAO,EAAE,yDAAyD;IAClE,KAAK,EAAE,SAAS;IAChB,GAAG;CACJ,CAAC;AAEF,eAAe,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * `upt map` — how the equations LINK: the text linkage map, the visual\n * (mermaid/dot/svg) physics map, and the `--equation` user-junction\n * injection. Transposed verbatim from bin/upt.mjs's `proposedJunctions()`/\n * `analyzeEquation()`/`printEquationReport()`/`mapCmd()` (lines 387-545),\n * plus `--json` and the `--json`/`--format` conflict guard.\n *\n * `parseEquationFlag` is REPLACED by the `either`-style `--equation` FlagSpec\n * (`args.ts` already extracts `--equation=...` or `--equation \"...\"` into\n * `flags.get('equation')`). `parseDiscoveryOpts` moved to `_discovery-opts.ts`\n * — the old CLI's `proposedJunctions` fed `map`'s raw args through it\n * (bin/upt.mjs line 392), so `--proposed` shares `discover`'s\n * `--max-orders`/`--anchor` validation here too.\n */\nimport { writeFileSync } from 'node:fs';\nimport type { FlagSpec, ParsedArgs } from '../args.js';\nimport { registerCommand, type Command, type CommandCtx } from '../command.js';\nimport { commandHelp, JSON_FLAG, sourceFlag } from '../flag-help.js';\nimport { resolveGraph, coreAnchor, coreLine, groundTruthAnchor, groundTruthLine, type AnchorScope } from '../graphs.js';\nimport { emitJson } from '../output.js';\nimport { publishedUrl } from '../published-url.js';\nimport { UsageError, CliError, EXIT_CHECK_FAILED } from '../errors.js';\nimport { integerFlag } from '../numeric-flag.js';\nimport { classifyDetermination, type Determination } from '../determination.js';\nimport { parseDiscoveryOpts } from './_discovery-opts.js';\nimport * as atlasMap from './_atlas-map.js';\nimport type {\n BridgeEdge,\n CanonicalComparison,\n CommunityReport,\n DerivationCycle,\n EquationAnalysis,\n EvidenceTag,\n HubRank,\n RelationType,\n VizJunction,\n VizModel,\n} from '../../cli-api.js';\nimport { canonicalCheckFailed, conventionLines } from '../conventions.js';\nimport type { UnitMode } from '../../cli-api.js';\nimport { withCatalogEvidence } from '../map-evidence.js';\nimport { DISCOVER_MAX_ORDERS_DEFAULT } from '../library-defaults.js';\n\n/** `--around` reaches this many shared-quantity hops when `--depth` is not given, and at most this many when it is. */\nconst DEFAULT_DEPTH = 1;\nconst MAX_DEPTH = 10;\n\nconst FLAGS: FlagSpec[] = [\n sourceFlag('both', 'Which graph to draw: catalog, canonical, or both. This command defaults to both.'),\n { name: '--format', valueStyle: 'attached', description: 'Output form: text, mermaid, dot, or svg. svg needs the optional @viz-js/viz peer.', defaultValue: 'text' },\n { name: '--out', valueStyle: 'attached', description: 'Write the report to PATH instead of stdout.' },\n { name: '--max-orders', valueStyle: 'attached', description: 'Magnitude-clash threshold for the --proposed overlay.', defaultValue: DISCOVER_MAX_ORDERS_DEFAULT },\n { name: '--anchor', valueStyle: 'attached', repeatable: true, description: 'Override a numeric anchor as k=v for the --proposed overlay.', defaultValue: 'mass=M_sun' },\n { name: '--proposed', valueStyle: 'none', description: 'Overlay unadjudicated identity-consequence relations.' },\n { name: '--relation', valueStyle: 'attached', description: 'Keep atlas edges whose recorded relation is TYPE.' },\n { name: '--evidence', valueStyle: 'attached', description: 'Keep atlas edges whose derived evidence set contains TAG.' },\n { name: '--around', valueStyle: 'either', description: 'Keep edges within --depth shared-quantity hops of QUANTITY.' },\n { name: '--depth', valueStyle: 'attached', description: 'Hop count for --around.', defaultValue: String(DEFAULT_DEPTH) },\n { name: '--route', valueStyle: 'either', description: 'Map the atlas route FROM,TO instead of the equation graph.' },\n { name: '--all-routes', valueStyle: 'none', description: 'With --route, list every simple route, shortest first.' },\n { name: '--max-routes', valueStyle: 'attached', description: `Cap on --all-routes. The maximum accepted is ${atlasMap.MAX_ROUTES_CEILING}.`, defaultValue: String(atlasMap.DEFAULT_MAX_ROUTES) },\n { name: '--family', valueStyle: 'either', description: 'Map one atlas family by name.' },\n { name: '--observable', valueStyle: 'either', description: 'Map bridges whose recorded text names this observable.' },\n { name: '--stored', valueStyle: 'none', description: `Derive evidence from ${publishedUrl('data/atlas/witness-results.json')}. When the file is absent (a checkout or install without data/), the command names --run.` },\n { name: '--run', valueStyle: 'none', description: 'Run the shown bridges\\' in-process witnesses now. Exit 3 if one is refuted.' },\n // optionalValue: a bare trailing --equation stores '' so the empty-check in\n // run() owns the diagnostic (old-CLI fidelity: bin/upt.mjs did `a[i+1] ?? ''`\n // and let mapCmd emit `upt: --equation requires \"TARGET = EXPR\"`, exit 2).\n { name: '--equation', valueStyle: 'either', optionalValue: true, description: 'Inject TARGET = EXPR as a user node and report where it lands.' },\n { name: '--equation-only', valueStyle: 'none', description: 'Print only the equation verdict. Errors when --equation is missing.' },\n { name: '--verbose', valueStyle: 'none', description: 'With --equation, also print the linkage map.' },\n { name: '--bind-short', valueStyle: 'none', description: 'Bind a one-letter catalog name in --equation. Without it, those names are reported and not bound.' },\n { name: '--natural', valueStyle: 'none', description: 'Set ħ = c = 1 when a dimension difference is a power of those constants.' },\n { name: '--geometrized', valueStyle: 'none', description: 'With the natural-unit rules, also set G = 1.' },\n { name: '--communities', valueStyle: 'none', description: 'Also print the layout communities (Louvain, heuristic) of the largest component. A drawing aid, not physics.' },\n { name: '--cycles', valueStyle: 'none', description: 'Also print the derivation cycles: strongly connected components of the directed source→target quantity graph.' },\n { name: '--rank-hubs', valueStyle: 'none', description: 'Also rank quantities by betweenness centrality (normalised). Computed only when asked.' },\n JSON_FLAG,\n];\n\n/** How many hubs `--rank-hubs` prints in text; `--json` carries every quantity. */\nconst HUBS_SHOWN = 10;\n\n/** Flags that add a structure section to the text and --json forms, and mean nothing on a diagram. */\nconst STRUCTURE_FLAGS = ['communities', 'cycles', 'rank-hubs'] as const;\n\nconst HELP = `upt map [--source=catalog|canonical|both] [--format=text|mermaid|dot|svg]\n [--proposed [--anchor=k=v,...] [--max-orders=N]] [--out=PATH]\n [--equation \"TARGET = EXPR\" [--equation-only] [--verbose] [--bind-short]\n [--natural] [--geometrized]] [--around=QUANTITY [--depth=N]]\n [--relation=TYPE] [--evidence=TAG] [--route=FROM,TO [--all-routes\n [--max-routes=N]]] [--family=NAME] [--observable=NAME] [--stored | --run]\n Map how the equations LINK: connected components (clusters) of the\n graph by shared quantities, the anchored core, the link hubs, and\n the isolated tail.\n --source defaults to 'both' (catalog + canonical) — a pure\n connectivity question gets the honest, all-known-physics answer by\n default; --source=catalog shows the bridge-catalog view alone.\n --out=PATH writes whatever form was asked for (text, --json or a\n visual format) to PATH instead of stdout; an empty PATH exits 1.\n --format=mermaid|dot|svg emits the VISUAL map (quantities = nodes,\n equations = junctions colored by status, one subgraph per component).\n text (default) is the unchanged linkage printout. svg renders the dot\n layout via the optional @viz-js/viz peer (npm i @viz-js/viz; or pipe\n dot through \"dot -Tsvg\"). --proposed overlays the unadjudicated\n identity-consequence relations (gray dashed); --anchor and --max-orders\n tune the discovery funnel that derives them, as in \\`upt discover\\`.\n --out writes to a file (default stdout).\n --equation \"TARGET = EXPR\" injects YOUR OWN equation as a violet 'user'\n node, dimensionally checks it, compares with the canonical registry, and\n reports nearest equations by shared-quantity overlap (not a full edge\n dump). Multi-word names may use underscores or catalog hyphens\n (planck_length / planck-length). Unknown names get a \"did you mean?\",\n and a registered constant of the inferred dimension (sigma → sigma_sb).\n A catalog target whose dimension depends on an unresolved name exits 3\n and does not quote that placeholder, unless a canonical comparison agreed.\n A one-letter catalog name (a, r, …) is reported and not bound; --bind-short\n binds it. The alias T → temperature still binds.\n An all-constant right-hand side (the Planck length) is compared at the\n SI constant values when its target is a catalog quantity.\n With --equation, the default is the verdict only. --verbose prints the\n linkage map after it. --equation-only is the same verdict and errors\n when --equation is missing (with --json: no \"linkage\" field).\n A bare e in the formula is the elementary charge. E is energy.\n Euler's number is exp(x), for example exp(1). The name euler is refused.\n --natural sets ħ = c = 1 for a dimension difference that is a power of\n those constants; --geometrized also allows powers of G. The SI default\n still refuses rest_energy = mass.\n --relation=TYPE keeps only edges whose recorded Atlas relation is that\n type; --evidence=TAG keeps only edges whose evidence set, DERIVED from\n the catalog row at read time, contains that tag.\n ⚠ Filtering changes what a missing overlay means: unfiltered, an edge\n with no overlay is KEPT; filtered, it is DROPPED, because nothing shows\n it satisfies the filter. Those drops are counted and printed separately\n from the edges that simply did not match — an unaudited graph must not\n render as a complete answer.\n --around=QUANTITY [--depth=N] keeps only the edges within N\n shared-quantity hops of QUANTITY (default ${DEFAULT_DEPTH}: the edges that use it),\n in every output form, and prints how many of the source's edges it\n kept: the others are omitted from the view, not absent from the graph.\n --route=FROM,TO and --family=NAME map the ATLAS instead: models and\n the recorded bridges between them, not shared quantities. --route\n shows the route \\`upt path\\` reports, each bridge's relation,\n assumptions, regime, bound and derived evidence, the composition\n step by step (and where the table yields no composite claim), and\n the equations each model records. --family shows one family's\n models, its bridges, the bridges from other families that touch it,\n and its rejections; --relation/--evidence filter its bridges, and a\n bridge whose tag depends on witness results is counted as undecided,\n not as a mismatch. A model's equations are only those its\n canonicalRefs record; nothing is inferred from shared quantities.\n --route=FROM,TO --all-routes lists every simple route (no model\n visited twice), shortest first, each with its composition and route\n claim, and counts the claims; --max-routes=N (default ${atlasMap.DEFAULT_MAX_ROUTES}, at most\n ${atlasMap.MAX_ROUTES_CEILING}) bounds the list, and a list cut short says so and says up to\n which bridge count it is complete.\n --observable=NAME maps the bridges whose RECORDED preserves text, or\n declared bound translation, names that observable (a whole-word text\n match, nothing inferred), lists apart those recording it as NOT\n preserved, and counts the bridges that record nothing about it;\n --relation/--evidence filter it as they filter a family.\n --stored derives evidence from the committed witness results\n (${publishedUrl('data/atlas/witness-results.json')}; it ships in data/),\n labelled with the last commit that touched it; --run runs the shown\n bridges' in-process registered witnesses now (exit 3 if any is\n refuted). Either resolves a tag once its witnesses have results; a\n witness with no result leaves it undecided, and checked, refuted and\n unresolved are counted apart.\n Every atlas view states how many of the atlas's models and bridges it\n shows, in text, --json and --format=mermaid|dot|svg.\n --communities, --cycles and --rank-hubs each add one section to the\n text report (and a key to --json); they do not apply to a diagram.\n --communities lists the layout communities (Louvain, heuristic) of the\n largest component: where a drawing may place quantities together, never\n a physics claim. --cycles lists the derivation cycles (strongly\n connected components of the directed source→target quantity graph),\n where over-determination lives. --rank-hubs ranks quantities by\n betweenness centrality (normalised; computed only when asked).\n e.g. upt map --relation=derivation --source=both\n upt map --around=temperature --depth=2 --source=catalog\n upt map --route=model-pendulum,model-lc\n upt map --route=model-string,model-dalembert --all-routes --stored\n upt map --family=oscillators --evidence=formally-proved\n upt map --observable=frequency --run`;\n\n/**\n * The edges within `depth` shared-quantity hops of `quantity`: hop 1 is every\n * edge that has it as a source or target, and each further hop adds the edges\n * sharing a quantity with one already kept.\n * @internal\n */\nexport function neighbourhood(graph: readonly BridgeEdge[], quantity: string, depth: number): BridgeEdge[] {\n const names = (e: BridgeEdge): string[] => [...e.sources.map((q) => q.name), e.target.name];\n const reached = new Set([quantity]);\n const kept = new Set<BridgeEdge>();\n for (let hop = 0; hop < depth; hop++) {\n const frontier = graph.filter((e) => !kept.has(e) && names(e).some((n) => reached.has(n)));\n if (frontier.length === 0) break;\n for (const e of frontier) {\n kept.add(e);\n for (const n of names(e)) reached.add(n);\n }\n }\n return graph.filter((e) => kept.has(e));\n}\n\nconst RELATION_TYPES: readonly RelationType[] = [\n 'derivation',\n 'exact-equivalence',\n 'restriction',\n 'approximation',\n 'coarse-graining',\n 'analytic-continuation',\n 'structural-analogy',\n 'deformation-quantization',\n];\n\nconst EVIDENCE_TAGS: readonly EvidenceTag[] = [\n 'proposed',\n 'reviewed',\n 'dimension-checked',\n 'convention-checked',\n 'symbolically-checked',\n 'numerically-supported',\n 'formally-proved',\n 'formally-proved-property',\n 'formally-proved-cross-check',\n 'empirically-supported',\n 'contradicted',\n 'unresolved',\n];\n\n/** Last value of an `attached` flag, or undefined when the flag is absent. */\nfunction lastValue(flags: ParsedArgs['flags'], name: string): string | undefined {\n const v = flags.get(name);\n return v && v.length > 0 ? v[v.length - 1] : undefined;\n}\n\n/** Validate one filter value against its vocabulary. A bad value is a CliError\n * (exit 1); an unknown FLAG is the parser's UsageError (exit 2). */\nfunction parseFilter<T extends string>(\n raw: string | undefined,\n allowed: readonly T[],\n flag: string,\n): T | undefined {\n if (raw === undefined) return undefined;\n if (!allowed.includes(raw as T)) {\n throw new CliError(`upt: unknown ${flag}='${raw}' (expected: ${allowed.join(' | ')})`);\n }\n return raw as T;\n}\n\n// Convert the derived identity-consequence proposals into viz junctions\n// (gray-dashed, status 'proposed'). The library never imports proposed-bridges;\n// the CLI does the conversion, keeping the epistemic firewall intact.\nfunction proposedJunctions(\n api: CommandCtx['api'],\n graph: readonly BridgeEdge[],\n flags: ParsedArgs['flags']\n): VizJunction[] {\n const opts = parseDiscoveryOpts(api, flags);\n const ranked = api.rankDiscoveries(graph, opts);\n return api.deriveProposedBridges(ranked).map((p) => ({\n id: p.id,\n label: p.id,\n status: 'proposed' as const,\n sources: (p.governing || []).map((g) => g.name),\n target: p.target.name,\n }));\n}\n\n// Build the catalog quantity name→dimension map for the chosen graph, then run\n// the (testable) library analysis: parse + dimensional validation + \"did you\n// mean?\" hints. The library owns the physics (constants' dimensions, inference);\n// the CLI only formats.\nasync function analyzeEquation(\n api: CommandCtx['api'],\n equation: string,\n graph: readonly BridgeEdge[],\n options?: { readonly bindShortNames?: boolean; readonly units?: Exclude<UnitMode, 'si'> },\n): Promise<{ user: EquationAnalysis; comparisons: CanonicalComparison[] }> {\n const catalogDims = new Map<string, import('../../dimensional/types.js').Dimension>();\n for (const e of graph) {\n for (const q of [...e.sources, e.target]) catalogDims.set(q.name, q.dim);\n }\n const user = await api.analyzeUserEquation(equation, catalogDims, options);\n // Dimensions cannot see a prefactor: compare with the canonical equation the\n // user's one restates, when the registry holds one (persona finding L2).\n const comparisons = user.parseError\n ? []\n : await api.compareUserEquation(equation, catalogDims, {\n bindShortNames: options?.bindShortNames,\n ...(options?.units === undefined ? {} : { constantOverrides: api.naturalConstantOverrides(options.units) }),\n });\n return { user, comparisons };\n}\n\nfunction unresolvedNames(user: EquationAnalysis): string[] {\n const placeholderNames = [\n ...(user.placeholders ?? []),\n ...(user.shortBindings ?? []).filter((b) => b.bound === false).map((b) => b.name),\n ];\n return [...new Set([...(user.hints ?? []).map((h) => h.name), ...placeholderNames])];\n}\n\n/** The exit `upt derive` uses for the same question. */\nfunction equationDetermination(\n user: EquationAnalysis,\n comparisons: readonly CanonicalComparison[],\n): Determination {\n const unresolved = unresolvedNames(user);\n const asked = user.targetDimension != null;\n return classifyDetermination({\n asked,\n agrees: comparisons.some((c) => c.kind === 'agrees'),\n checkFailed:\n (user.consistent === false && unresolved.length === 0) || canonicalCheckFailed(comparisons),\n notUnique: false,\n unresolved,\n });\n}\n\nfunction tainted(user: EquationAnalysis): boolean {\n return unresolvedNames(user).length > 0;\n}\n\n// Print the dimensional verdict, where the equation landed, and any hints.\n// `out` is ctx.out (text mode → stdout) or ctx.err (visual → stderr).\nfunction printEquationReport(\n api: CommandCtx['api'],\n model: VizModel,\n user: EquationAnalysis,\n out: (line?: string) => void,\n comparisons: readonly CanonicalComparison[] = [],\n): void {\n out('');\n const unresolved = unresolvedNames(user);\n const verdict = equationDetermination(user, comparisons);\n if (user.consistent === true) {\n out(` ✓ dimensionally consistent: ${api.format(user.rhsDimension!)}`);\n } else if (verdict.report === 'not-established') {\n const names = unresolved.map((n) => `'${n}'`).join(', ');\n out(\n ` · NOT ESTABLISHED: ${names} ${unresolved.length > 1 ? 'have' : 'has'} no catalog dimension, ` +\n 'so the right-hand side dimension was not established and is not reported.',\n );\n } else if (verdict.report === 'established' && unresolved.length > 0) {\n // A canonical agreement ran. The placeholder dimension is not that result.\n } else if (user.consistent === false) {\n out(\n ` ⚠ dimensional MISMATCH: RHS is ${api.format(user.rhsDimension!)} but the target is ${api.format(\n user.targetDimension!\n )}`\n );\n } else if (user.rhsDimension && (user.placeholders ?? []).length > 0) {\n const names = user.placeholders.map((n) => `'${n}'`).join(', ');\n out(\n ` · UNKNOWN: ${names} ${user.placeholders.length === 1 ? 'was' : 'were'} taken as dimensionless. ` +\n 'That is not the dimension of the formula, and the target is not a bound catalog name, so nothing was checked',\n );\n } else if (user.rhsDimension) {\n out(` · RHS dimension: ${api.format(user.rhsDimension)} (target not in the catalog, so no comparison)`);\n }\n for (const line of api.describeKnownRelation(comparisons, user.junction.target, [...user.junction.sources])) {\n out(` ${line}`);\n }\n for (const line of conventionLines(comparisons.map((c) => c.id))) out(` ${line}`);\n if (user.naturalNote) out(` ${user.naturalNote}`);\n const L = api.equationLanding(model, 'user-equation');\n if (L.isolated) {\n out(' ⚠ your equation is ISOLATED — it shares no quantity with this graph.');\n } else {\n out(\n ` ● your equation joins ${L.anchored ? 'the ANCHORED cluster' : 'a cluster'} of ${L.clusterSize} via {${L.sharedQuantities.join(', ')}}`\n );\n // W3/I3: do not dump ~100 edge ids — that made shared length/temperature look\n // like a physics claim. Summarise nearest equations by shared-quantity overlap.\n for (const line of api.formatConnectedSummary(model, L)) out(line);\n }\n for (const h of user.hints ?? []) {\n if (!h.suggestions.length) {\n out(` ⚠ '${h.name}' did not match a catalog quantity (run \\`upt canonical\\` for the vocabulary).`);\n } else if (h.byDimension) {\n out(` ⚠ '${h.name}' is unknown — by its inferred dimension, did you mean: ${h.suggestions.join(', ')}?`);\n } else {\n out(` ⚠ '${h.name}' did not match a catalog quantity — did you mean: ${h.suggestions.join(', ')}?`);\n }\n // Persona finding L5: `sigma` for the Stefan–Boltzmann constant `sigma_sb`.\n if ((h.constants ?? []).length > 0) {\n const list = h.constants!.join(', ');\n out(\n ` '${h.name}' has the inferred dimension of the registered constant${h.constants!.length > 1 ? 's' : ''} ${list}; ` +\n 'write that name to use its SI value',\n );\n }\n }\n // Persona finding W6: a one-letter name binds to whatever the catalog calls that letter.\n for (const b of user.shortBindings ?? []) {\n const users = model.junctions\n .filter((j) => j.id !== 'user-equation' && (j.target === b.quantity || j.sources.includes(b.quantity)))\n .map((j) => j.id)\n .sort();\n const shown = users.slice(0, 3).join(', ') + (users.length > 3 ? `, +${users.length - 3} more` : '');\n const used = users.length > 0 ? ` (used by ${shown})` : '';\n if (b.bound === false) {\n out(\n ` · '${b.name}' matches the catalog quantity ${b.quantity} ${api.format(b.dim)}${used}, a one-letter name, and is not bound. ` +\n 'Pass --bind-short to bind it, or write the full name you meant',\n );\n } else {\n out(\n ` · '${b.name}' is bound to the catalog quantity ${b.quantity} ${api.format(b.dim)}, a one-letter name` +\n `${used}; if you meant another quantity, write its full name`,\n );\n }\n }\n}\n\n/** The opt-in structure sections, each present only when its flag was given. */\ninterface StructureSections {\n readonly communities?: CommunityReport;\n readonly cycles?: readonly DerivationCycle[];\n readonly hubs?: readonly HubRank[];\n}\n\n/** Compute only the sections asked for; `rankHubs` is the betweenness pass the default path never runs. */\nasync function structureSections(\n api: CommandCtx['api'],\n graph: readonly BridgeEdge[],\n flags: ParsedArgs['flags'],\n): Promise<StructureSections> {\n return {\n ...(flags.has('communities') ? { communities: api.communitiesOf(graph) } : {}),\n ...(flags.has('cycles') ? { cycles: api.derivationCycles(graph) } : {}),\n ...(flags.has('rank-hubs') ? { hubs: await api.rankHubs(graph) } : {}),\n };\n}\n\n/** The text of the structure sections, in flag order; empty when none was asked for. A number goes through `formatQuantity`. */\nfunction structureLines(s: StructureSections, formatQuantity: (value: number, digits?: number) => string): string[] {\n const lines: string[] = [];\n if (s.communities !== undefined) {\n const c = s.communities;\n lines.push(` ${c.method} of the largest component (${c.componentSize} quantities) — a drawing aid, not physics:`);\n if (c.communities.length === 0) lines.push(' none (the graph has no component)');\n c.communities.forEach((com, i) => lines.push(` ${i + 1}. (${com.size}) ${com.quantities.join(', ')}`));\n lines.push('');\n }\n if (s.cycles !== undefined) {\n const head = s.cycles.length === 0 ? 'none — the quantity graph is acyclic' : String(s.cycles.length);\n lines.push(` derivation cycles (strongly connected components of source→target, where over-determination lives): ${head}`);\n for (const cyc of s.cycles) lines.push(` {${cyc.quantities.join(', ')}} closed by ${cyc.edges.join(', ')}`);\n lines.push('');\n }\n if (s.hubs !== undefined) {\n const shown = Math.min(HUBS_SHOWN, s.hubs.length);\n lines.push(\n ` hubs by betweenness centrality (normalised; top ${shown} of ${s.hubs.length} quantities; a cut quantity of the drawing, not a central law):`,\n );\n for (const h of s.hubs.slice(0, shown)) lines.push(` ${h.quantity.padEnd(40)} ${formatQuantity(h.betweenness, 3)} (degree ${h.degree})`);\n lines.push('');\n }\n // Sections are separated by one blank line; the closing line of the report brings its own.\n while (lines.length > 0 && lines[lines.length - 1] === '') lines.pop();\n return lines;\n}\n\n/** Flags that shape the equation graph, and so mean nothing on an atlas view. */\nconst GRAPH_ONLY_FLAGS = ['source', 'around', 'depth', 'equation', 'equation-only', 'proposed', 'max-orders', 'anchor', ...STRUCTURE_FLAGS] as const;\n\n/** Flags that only an atlas view reads. */\nconst ATLAS_ONLY_FLAGS = ['all-routes', 'max-routes', 'stored', 'run'] as const;\n\nasync function runAtlasView(\n ctx: CommandCtx,\n route: string | undefined,\n family: string | undefined,\n observable: string | undefined,\n): Promise<number> {\n const { args, api, err, write } = ctx;\n const chosen = [route !== undefined, family !== undefined, observable !== undefined].filter(Boolean).length;\n if (chosen > 1) throw new CliError('upt map: pick one atlas view: --route, --family or --observable');\n const view = route !== undefined ? '--route' : family !== undefined ? '--family' : '--observable';\n const stray = GRAPH_ONLY_FLAGS.filter((f) => args.flags.has(f));\n if (stray.length > 0) {\n throw new CliError(\n `upt map: ${view} maps the atlas, not the equation graph; ${stray.map((f) => `--${f}`).join(', ')} do${stray.length === 1 ? 'es' : ''} not apply`,\n );\n }\n const relation = parseFilter(lastValue(args.flags, 'relation'), RELATION_TYPES, '--relation');\n const evidence = parseFilter(lastValue(args.flags, 'evidence'), EVIDENCE_TAGS, '--evidence');\n if (route !== undefined && (relation !== undefined || evidence !== undefined)) {\n throw new CliError('upt map: a route is composed whole, so --relation/--evidence do not filter it; filter a family view instead (--family=NAME)');\n }\n const allRoutes = args.flags.has('all-routes');\n if (allRoutes && route === undefined) throw new CliError('upt map: --all-routes needs --route=FROM,TO');\n const maxRaw = lastValue(args.flags, 'max-routes');\n if (maxRaw !== undefined && !allRoutes) throw new CliError('upt map: --max-routes needs --all-routes');\n // The grammar first (`0x10` is usage, exit 2); the 1..ceiling range after (exit 1).\n const maxRoutes = maxRaw === undefined ? atlasMap.DEFAULT_MAX_ROUTES : integerFlag('map', '--max-routes', maxRaw);\n if (maxRoutes < 1 || maxRoutes > atlasMap.MAX_ROUTES_CEILING) {\n throw new CliError(`upt map: --max-routes=${maxRaw} must be an integer from 1 to ${atlasMap.MAX_ROUTES_CEILING}`);\n }\n if (args.flags.has('stored') && args.flags.has('run')) {\n throw new CliError('upt map: pick one witness-results source: --stored (the committed artifact) or --run (run now)');\n }\n const fmt = lastValue(args.flags, 'format') ?? 'text';\n const isJson = args.flags.has('json');\n if (isJson && fmt !== 'text') throw new UsageError('upt: pick one output form: --json or --format');\n if (!['text', 'mermaid', 'dot', 'svg'].includes(fmt)) {\n throw new CliError(`upt: unknown --format='${fmt}' (expected: text | mermaid | dot | svg)`);\n }\n\n const filter = {\n ...(relation !== undefined ? { relation } : {}),\n ...(evidence !== undefined ? { evidence } : {}),\n };\n const endpoints = route === undefined ? null : atlasMap.parseRoute(route);\n const build = (results: atlasMap.WitnessResults | null): atlasMap.AtlasView =>\n endpoints !== null\n ? allRoutes\n ? atlasMap.buildRoutesView(api, ...endpoints, maxRoutes, results)\n : atlasMap.buildRouteView(api, ...endpoints, results)\n : family !== undefined\n ? atlasMap.buildFamilyView(api, family, filter, results)\n : atlasMap.buildObservableView(api, observable!, filter, results);\n let results: atlasMap.WitnessResults | null = null;\n if (args.flags.has('stored')) results = atlasMap.loadStoredResults();\n else if (args.flags.has('run')) {\n // Unfiltered first: a filter's verdict depends on the results, so every candidate bridge is run.\n const candidates =\n endpoints === null\n ? atlasMap.bridgeIdsOf(family !== undefined ? atlasMap.buildFamilyView(api, family, {}) : atlasMap.buildObservableView(api, observable!, {}))\n : atlasMap.bridgeIdsOf(build(null));\n results = await atlasMap.runResults(api, candidates);\n }\n const v = build(results);\n const exitCode = results?.mode === 'run' && results.rows.some((r) => r.status === 'refuted') ? EXIT_CHECK_FAILED : 0;\n\n if (isJson) {\n emitJson({ command: 'map', source: 'atlas', result: v }, write);\n return exitCode;\n }\n if (fmt === 'text') {\n const lines =\n v.view === 'route'\n ? atlasMap.routeText(v)\n : v.view === 'routes'\n ? atlasMap.routesText(v)\n : v.view === 'family'\n ? atlasMap.familyText(v)\n : atlasMap.observableText(v);\n for (const line of lines) ctx.out(line);\n return exitCode;\n }\n let src: string;\n if (fmt === 'svg') {\n try {\n src = await api.renderDotToSvg(atlasMap.toDot(v));\n } catch (e) {\n throw new CliError(e && (e as Error).message ? (e as Error).message : String(e));\n }\n } else {\n src = fmt === 'mermaid' ? atlasMap.toMermaid(v) : atlasMap.toDot(v);\n }\n const path = lastValue(args.flags, 'out');\n if (path !== undefined) {\n if (!path) throw new CliError('upt: --out= requires a non-empty PATH');\n try {\n writeFileSync(path, src);\n } catch (e) {\n throw new CliError(`upt map: ${(e as Error).message}`);\n }\n err(`upt: wrote ${fmt} to ${path}`);\n } else {\n write(src);\n }\n err(`upt: ${atlasMap.viewLegend(v)}`);\n return exitCode;\n}\n\n/**\n * `--out=PATH` holds for every output form. A visual form writes its diagram\n * source (handled by the branch that renders it); the text report and the\n * `--json` envelope are captured here and written whole, so stdout stays\n * empty and the file holds exactly what stdout would have carried. An empty\n * PATH exits 1 in every form.\n */\nasync function run(ctx: CommandCtx): Promise<number> {\n const path = lastValue(ctx.args.flags, 'out');\n const fmt = lastValue(ctx.args.flags, 'format') ?? 'text';\n if (path === undefined || fmt !== 'text') return runReport(ctx);\n if (!path) throw new CliError('upt: --out= requires a non-empty PATH');\n let captured = '';\n const code = await runReport({\n ...ctx,\n out: (line?: string) => {\n captured += (line ?? '') + '\\n';\n },\n write: (s: string) => {\n captured += s;\n },\n });\n try {\n writeFileSync(path, captured);\n } catch (e) {\n throw new CliError(`upt map: ${(e as Error).message}`);\n }\n ctx.err(`upt: wrote ${ctx.args.flags.has('json') ? 'json' : 'text'} to ${path}`);\n return code;\n}\n\nasync function runReport(ctx: CommandCtx): Promise<number> {\n const { args, api, out, err, write } = ctx;\n const route = lastValue(args.flags, 'route');\n const family = lastValue(args.flags, 'family');\n const observable = lastValue(args.flags, 'observable');\n if (route !== undefined || family !== undefined || observable !== undefined) return runAtlasView(ctx, route, family, observable);\n const atlasOnly = ATLAS_ONLY_FLAGS.filter((f) => args.flags.has(f));\n if (atlasOnly.length > 0) {\n throw new CliError(\n `upt map: ${atlasOnly.map((f) => `--${f}`).join(', ')} appl${atlasOnly.length === 1 ? 'ies' : 'y'} to an atlas view ` +\n '(--route, --family or --observable), not to the equation graph',\n );\n }\n // map asks a pure connectivity question, so it defaults to --source=both\n // (catalog + canonical) rather than graphs.ts's catalog fallback used by\n // the other --source commands (e.g. discover, which keeps catalog).\n const sourceFlags = args.flags.has('source') ? args.flags : new Map(args.flags).set('source', ['both']);\n const { graph: wholeGraph, label, source } = resolveGraph(api, sourceFlags);\n\n const around = lastValue(args.flags, 'around');\n const depthRaw = lastValue(args.flags, 'depth');\n if (depthRaw !== undefined && around === undefined) throw new CliError('upt map: --depth needs --around');\n let focus: { around: string; depth: number; kept: number; of: number } | null = null;\n let fullGraph = wholeGraph;\n if (around !== undefined) {\n // The grammar first (`1e1` is usage, exit 2); the 1..MAX_DEPTH range after (exit 1).\n const depth = depthRaw === undefined ? DEFAULT_DEPTH : integerFlag('map', '--depth', depthRaw);\n if (depth < 1 || depth > MAX_DEPTH) throw new CliError(`upt map: --depth=${depthRaw} must be an integer from 1 to ${MAX_DEPTH}`);\n const known = new Set(wholeGraph.flatMap((e) => [...e.sources.map((q) => q.name), e.target.name]));\n const name = api.resolveQuantityName(around, known);\n if (name === null) {\n const near = api.suggestQuantities(around, known);\n throw new CliError(\n `upt map: '${around}' is not a quantity of the ${label} graph` + (near.length > 0 ? `; did you mean: ${near.join(', ')}?` : ''),\n );\n }\n fullGraph = neighbourhood(wholeGraph, name, depth);\n focus = { around: name, depth, kept: fullGraph.length, of: wholeGraph.length };\n }\n const focusLine =\n focus === null\n ? null\n : `focused: ${focus.kept} of ${focus.of} edges within ${focus.depth} hop(s) of '${focus.around}' [${label}]; ` +\n 'the rest are omitted from this view, not absent from the graph';\n // The two overlay filters. Parsed BEFORE anything else is computed so a bad\n // value costs nothing and always exits 1.\n const relation = parseFilter(lastValue(args.flags, 'relation'), RELATION_TYPES, '--relation');\n const evidence = parseFilter(lastValue(args.flags, 'evidence'), EVIDENCE_TAGS, '--evidence');\n const filterOpts = withCatalogEvidence({\n ...(relation !== undefined ? { relation } : {}),\n ...(evidence !== undefined ? { evidence } : {}),\n });\n // The TEXT and JSON paths filter the edge list here, because `linkageMap`\n // consumes edges. The VISUAL path hands `buildVizModel` the FULL graph with\n // the same options, so the model also judges the --proposed / --equation\n // overlay junctions, which are not edges and which `filterEdges` cannot see.\n // One predicate, two callers: they cannot disagree about what a filter\n // selects, only about how much they were asked to count.\n const { kept: graph, stats: edgeStats } = api.filterEdges(fullGraph, filterOpts);\n // Audit I3: what \"anchored\" means here, and the discovery ground truth when --proposed ran the funnel.\n const anchor: AnchorScope = {\n core: coreAnchor(graph),\n ...(args.flags.has('proposed') ? { groundTruth: groundTruthAnchor(api, parseDiscoveryOpts(api, args.flags)) } : {}),\n };\n const edgeLegend = api.formatFilterLegend(edgeStats);\n\n const fmtValues = args.flags.get('format');\n const fmt = fmtValues && fmtValues.length > 0 ? fmtValues[fmtValues.length - 1] : 'text';\n const isJson = args.flags.has('json');\n\n if (isJson && fmt !== 'text') {\n throw new UsageError('upt: pick one output form: --json or --format');\n }\n const structureAsked = STRUCTURE_FLAGS.filter((f) => args.flags.has(f));\n if (structureAsked.length > 0 && fmt !== 'text') {\n const named = structureAsked.map((f) => `--${f}`).join(', ');\n throw new UsageError(\n `upt map: ${named} print${structureAsked.length === 1 ? 's' : ''} text or --json; ${structureAsked.length === 1 ? 'it does' : 'they do'} not apply to --format=${fmt}`,\n );\n }\n // Computed only when asked, over the same filtered edge list the linkage map reads.\n const structure = await structureSections(api, graph, args.flags);\n\n // --equation injects a user-supplied \"TARGET = EXPR\" as a 'user' junction.\n let user: EquationAnalysis | null = null;\n let comparisons: CanonicalComparison[] = [];\n const equationValues = args.flags.get('equation');\n const equation = equationValues && equationValues.length > 0 ? equationValues[equationValues.length - 1] : null;\n // Persona finding L7: the verdict alone, without the linkage map after it.\n const equationOnly = args.flags.has('equation-only');\n if (equationOnly && equation == null) throw new UsageError('upt map: --equation-only needs --equation \"TARGET = EXPR\"');\n if (equationOnly && fmt !== 'text') {\n throw new UsageError(`upt map: --equation-only prints the verdict as text or --json; it does not apply to --format=${fmt}`);\n }\n if (equation != null) {\n if (!equation.trim()) {\n throw new UsageError('upt: --equation requires \"TARGET = EXPR\"');\n }\n try {\n const units: Exclude<UnitMode, 'si'> | undefined = args.flags.has('geometrized')\n ? 'geometrized'\n : args.flags.has('natural')\n ? 'natural'\n : undefined;\n if (args.flags.has('geometrized') && args.flags.has('natural')) {\n throw new UsageError('upt map: pick one unit mode: --natural (ħ = c = 1) or --geometrized (ħ = c = G = 1)');\n }\n ({ user, comparisons } = await analyzeEquation(api, equation, graph, {\n bindShortNames: args.flags.has('bind-short'),\n ...(units === undefined ? {} : { units }),\n })); // throws UserEquationError on malformed structure\n } catch (e) {\n throw new UsageError('upt: ' + (e && (e as Error).message ? (e as Error).message : String(e)));\n }\n if (user.parseError) {\n throw new UsageError('upt: ' + user.parseError); // dimensionally malformed RHS\n }\n }\n\n // The same classification `upt derive` uses. A canonical agreement stays 0.\n // A catalog target that was not established exits 3. An unbound target stays 0.\n const exitCode = user === null ? 0 : equationDetermination(user, comparisons).exit;\n\n // Ranked from the UNFILTERED graph: the proposal set is a property of the\n // whole catalog, and the model then judges each overlay junction under the\n // same filter as every other junction. Computed once for every output form.\n const proposed: VizJunction[] | null = args.flags.has('proposed') ? proposedJunctions(api, wholeGraph, args.flags) : null;\n const overlay = (extra: VizJunction[]): VizJunction[] => [...(proposed ?? []), ...extra];\n\n if (isJson) {\n const linkage = api.linkageMap(graph);\n let landing: ReturnType<typeof api.equationLanding> | undefined;\n let userEquation: Record<string, unknown> | undefined;\n if (user) {\n const model = api.buildVizModel(fullGraph, {\n title: `UPT physics map — ${label}`,\n extraJunctions: overlay([user.junction]),\n ...filterOpts,\n });\n landing = api.equationLanding(model, 'user-equation');\n userEquation = {\n equation: user.junction.label,\n consistent: tainted(user) ? null : user.consistent,\n rhsDimension: tainted(user) ? null : user.rhsDimension,\n targetDimension: user.targetDimension,\n hints: user.hints,\n shortBindings: user.shortBindings,\n ...(user.placeholders.length === 0 ? {} : { placeholders: user.placeholders }),\n canonicalComparisons: comparisons,\n catalogEdges: api.matchingCatalogEdges(user.junction.target, [...user.junction.sources]),\n };\n }\n emitJson(\n {\n command: 'map',\n source,\n anchor,\n result: {\n ...(equation != null && (equationOnly || !args.flags.has('verbose')) ? {} : { linkage }),\n ...(proposed === null ? {} : { proposed: proposed.map((p) => ({ id: p.id, target: p.target, sources: p.sources })) }),\n ...(edgeLegend !== null ? { filter: edgeStats } : {}),\n ...(focus !== null ? { focus } : {}),\n ...(user ? { landing, userEquation } : {}),\n ...structure,\n },\n },\n write\n );\n return exitCode;\n }\n\n if (fmt === 'mermaid' || fmt === 'dot' || fmt === 'svg') {\n const extraJunctions = overlay(user ? [user.junction] : []);\n const model = api.buildVizModel(fullGraph, {\n title: `UPT physics map — ${label}`,\n extraJunctions,\n ...filterOpts,\n });\n // svg is the dot layout rendered by the optional @viz-js/viz peer.\n let src: string;\n if (fmt === 'svg') {\n try {\n src = await api.renderDotToSvg(model.toDot());\n } catch (e) {\n throw new CliError(e && (e as Error).message ? (e as Error).message : String(e));\n }\n } else {\n src = fmt === 'mermaid' ? model.toMermaid() : model.toDot();\n }\n const outValues = args.flags.get('out');\n if (outValues && outValues.length > 0) {\n const path = outValues[outValues.length - 1];\n if (!path) {\n throw new CliError('upt: --out= requires a non-empty PATH');\n }\n try {\n writeFileSync(path, src);\n } catch (e) {\n throw new CliError(`upt map: ${(e as Error).message}`);\n }\n err(`upt: wrote ${fmt} (${model.junctions.length} junctions, ${model.clusters.length} clusters) to ${path}`);\n } else {\n write(src);\n }\n // Legend and landing report go to stderr so stdout/--out stays pure diagram\n // source. The diagram itself also carries the legend (see `buildVizModel`).\n if (focusLine !== null) err(`upt: ${focusLine}`);\n if (model.filterLegend !== null) err(`upt: ${model.filterLegend}`);\n if (user) printEquationReport(api, model, user, err, comparisons);\n return exitCode;\n }\n if (fmt !== 'text') {\n throw new CliError(`upt: unknown --format='${fmt}' (expected: text | mermaid | dot | svg)`);\n }\n\n // --equation: the verdict on the user's equation is the answer asked for, so it\n // comes BEFORE the linkage map, not after ~45 lines of it (persona finding N4).\n if (user) {\n const model = api.buildVizModel(fullGraph, {\n title: `UPT physics map — ${label}`,\n extraJunctions: overlay([user.junction]),\n ...filterOpts,\n });\n out(`\\nYour equation: ${user.junction.label}`);\n printEquationReport(api, model, user, out, comparisons);\n if (equationOnly || !args.flags.has('verbose')) return exitCode;\n }\n\n const m = api.linkageMap(graph);\n const mix = (s: Readonly<Record<string, number>>) =>\n Object.entries(s)\n .map(([k, v]) => `${v} ${k}`)\n .join(', ');\n out(`\\nLinkage map — how the equations connect via shared quantities [source: ${label}]`);\n out(`(${m.componentCount} components over ${graph.length} edges; ${m.compositions} compose into chains)`);\n out(` ${coreLine(anchor.core!)}`);\n if (anchor.groundTruth) out(` proposals: ${groundTruthLine(anchor.groundTruth)}`);\n if (proposed !== null) {\n // The overlay the visual forms draw, listed here: an unadjudicated identity consequence is a\n // proposal, never a catalog edge. Each names its target and the quantities it would relate.\n out(` proposed relations (${proposed.length}, unadjudicated identity consequences; not catalog edges):`);\n for (const p of proposed) {\n // No free input: every governing quantity of the derived relation is a registered constant.\n const sources = p.sources.length === 0 ? '{} (no sources: every input is a registered constant)' : `{${p.sources.join(', ')}}`;\n out(` ${p.id}: ${p.target} ← ${sources}`);\n }\n if (proposed.length === 0) out(' (none at this anchor and --max-orders)');\n }\n out('');\n if (focusLine !== null) out(` ${focusLine}`);\n if (edgeLegend !== null) out(` ${edgeLegend}`);\n for (const c of m.clusters.filter((x) => x.size > 1)) {\n out(` ● cluster of ${c.size}${c.anchored ? ' [ANCHORED to known physics]' : ''}`);\n out(` edges: ${c.edges.join(', ')}`);\n out(` status: ${mix(c.statusMix)}`);\n out(` link hubs: ${c.hubs.join(', ')}\\n`);\n }\n out(` ○ isolated (${m.isolated.length}) — share no quantity with any other edge:`);\n out(` ${m.isolated.length === 0 ? 'none' : m.isolated.join(', ')}`);\n const structureText = structureLines(structure, api.formatQuantity);\n if (structureText.length > 0) {\n out('');\n for (const line of structureText) out(line);\n }\n out('\\n (a structural map — shared-quantity connectivity, NOT a credibility signal)');\n return exitCode;\n}\n\nexport const command: Command = {\n name: 'map',\n aliases: ['linkage'],\n flags: FLAGS,\n help: commandHelp(HELP, FLAGS),\n summary: 'Show how equations link, or where your own equation lands on that graph.',\n example: 'upt map --equation \"period = 2*pi*sqrt(length/gravity)\"',\n group: 'explore',\n run,\n};\n\nregisterCommand(command);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metric.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/metric.ts"],"names":[],"mappings":"AAUA,OAAO,EAAmB,KAAK,OAAO,EAAmB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"metric.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/metric.ts"],"names":[],"mappings":"AAUA,OAAO,EAAmB,KAAK,OAAO,EAAmB,MAAM,eAAe,CAAC;AAgM/E,eAAO,MAAM,OAAO,EAAE,OAUrB,CAAC"}
|
|
@@ -37,16 +37,16 @@ function isMetric(s) {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* The metric library refuses a bad value (a non-positive mass, a point inside
|
|
40
|
-
* the horizon, an unknown parameter, a start the integrator cannot
|
|
41
|
-
* parameter in the wrong unit) with `MetricMassError`,
|
|
42
|
-
*
|
|
43
|
-
* RangeError) is a defect and is not
|
|
40
|
+
* the horizon, an unknown or repeated parameter, a start the integrator cannot
|
|
41
|
+
* take, a parameter in the wrong unit) with `MetricMassError`,
|
|
42
|
+
* `MetricValueError` or a `UnitError`. Each is a bad value, exit 1. Any other
|
|
43
|
+
* class (a plain `Error`, a TypeError, a RangeError) is a defect and is not
|
|
44
|
+
* converted.
|
|
44
45
|
*/
|
|
45
46
|
function metricValueError(api, e) {
|
|
46
|
-
if (e instanceof api.MetricMassError || e instanceof api.UnitError)
|
|
47
|
-
return new CliError(`upt metric: ${e.message}`);
|
|
48
|
-
if (e instanceof Error && e.constructor === Error)
|
|
47
|
+
if (e instanceof api.MetricMassError || e instanceof api.MetricValueError || e instanceof api.UnitError) {
|
|
49
48
|
return new CliError(`upt metric: ${e.message}`);
|
|
49
|
+
}
|
|
50
50
|
return e;
|
|
51
51
|
}
|
|
52
52
|
async function run(ctx) {
|
|
@@ -82,12 +82,14 @@ async function run(ctx) {
|
|
|
82
82
|
const a = report.parameters.a ?? 0;
|
|
83
83
|
const r = report.parameters.r;
|
|
84
84
|
const theta = report.parameters.theta ?? Math.PI / 2;
|
|
85
|
+
// Reachable: `curvatureReport` refuses M ≤ 0, but G=0 (or a c that overflows) makes
|
|
86
|
+
// M_geom = G M / c² zero with M > 0, and a supplied r passes its own check.
|
|
85
87
|
if (Mgeom === undefined || !(Mgeom > 0))
|
|
86
|
-
throw new CliError('Kerr geodesic needs a positive mass');
|
|
88
|
+
throw new CliError('upt metric: Kerr geodesic needs a positive mass');
|
|
87
89
|
const rOverM = (r ?? 10 * Mgeom) / Mgeom;
|
|
88
90
|
const aOverM = a / Mgeom;
|
|
89
91
|
if (!(Math.abs(aOverM) <= 1))
|
|
90
|
-
throw new CliError('Kerr geodesic wants |a| ≤ GM/c²');
|
|
92
|
+
throw new CliError('upt metric: Kerr geodesic wants |a| ≤ GM/c²');
|
|
91
93
|
const equatorial = Math.abs(theta - Math.PI / 2) < 1e-6;
|
|
92
94
|
if (a === 0) {
|
|
93
95
|
// At a = 0 the Kerr metric is Schwarzschild. The Boyer–Lindquist integrator refuses the
|
|
@@ -170,6 +172,7 @@ async function run(ctx) {
|
|
|
170
172
|
export const command = {
|
|
171
173
|
name: 'metric',
|
|
172
174
|
aliases: ['curvature'],
|
|
175
|
+
positionals: { max: Infinity },
|
|
173
176
|
flags: FLAGS,
|
|
174
177
|
help: commandHelp(HELP, FLAGS),
|
|
175
178
|
summary: 'Print Christoffel symbols and curvature scalars for one exact metric.',
|