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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skin-depth.js","sourceRoot":"","sources":["../../src/cases/skin-depth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,IAAI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ACnG,KAAK,CAAC,OAAO,EAAE,qFAAqF,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,aAAa,EACzI,8KAA8K,CAAC;gBACjL,KAAK,CAAC,iBAAiB,EAAE,0EAA0E,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EACzI,8FAA8F,CAAC;gBACjG,KAAK,CAAC,OAAO,EAAE,oDAAoD,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAC9G,sGAAsG,CAAC;aAC1G;YACD,SAAS,EAAE;gBACT,4HAA4H;gBAC5H,8FAA8F;aAC/F;SACF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/**\n * Applied case: the skin depth of a planar conductor driven at one frequency —\n * how far an AC field (and its current) penetrates, and the surface\n * resistance that sets the conductor's AC loss.\n *\n * In one dimension the Maxwell equations with a local Ohm law in a conductor\n * are the telegraph equation of `model-telegraph`, with relaxation time ε/σ\n * and diffusivity 1/(μσ). Dropping the displacement current is\n * `ab-telegraph-diffusion`, which leaves magnetic diffusion and the classical\n * δ = √(2ρ/(ωμ)) (Jackson, Classical Electrodynamics, 3rd ed., §5.18 and\n * §8.1). This case evaluates δ, checks the three premises the classical\n * result needs — a good conductor, a local conductivity (the mean free path\n * well inside δ; otherwise the anomalous skin effect, Pippard 1947), a DC\n * conductivity (ωτ ≪ 1, Drude) — and the half-space boundary condition, and\n * compares δ with the penetration depth of the full plane-wave solution.\n *\n * @module cases/skin-depth\n */\nimport { C_SI } from '../core/constants.js';\nimport { check, requirePositive, signedRelativeDifference, type AppliedCase } from './types.js';\n\nconst ID = 'case-skin-depth';\n\n/** Vacuum permeability μ0, CODATA 2018 (N/A²). @internal */\nexport const MU_0_SI = 1.25663706212e-6;\n\n/** Vacuum permittivity ε0 = 1/(μ0 c²) (F/m). @internal */\nexport const EPS_0_SI = 1 / (MU_0_SI * C_SI * C_SI);\n\n/** ωε/σ ceiling: the displacement current then moves the penetration depth by ≈ ωε/(2σ) ≤ 0.5%. @internal */\nexport const MAX_DISPLACEMENT_RATIO = 0.01;\n\n/** l/δ ceiling for a local (classical) conductivity. @internal */\nexport const MAX_MFP_RATIO = 0.1;\n\n/** ωτ ceiling: the Drude σ(ω) = σ0/(1 − iωτ) is then within 0.5% of σ0 in modulus. @internal */\nexport const MAX_OMEGA_TAU = 0.1;\n\n/** d/δ floor: the field reaching the back face is then ≤ e^{−5} ≈ 0.7% of the surface field. @internal */\nexport const MIN_THICKNESS_RATIO = 5;\n\n/**\n * δ_Maxwell/δ for the plane wave k² = ω²με + iωμσ, as a function of r = ωε/σ:\n * 1/Im k = δ √(√(1 + r²) + r), written without the cancellation of |z| − Re z.\n * @internal\n */\nexport function maxwellDepthFactor(r: number): number {\n return Math.sqrt(Math.hypot(1, r) + r);\n}\n\nexport const SKIN_DEPTH_CASE: AppliedCase = {\n id: ID,\n title: 'Skin depth of a planar conductor (good-conductor, local and DC-conductivity regimes)',\n parameters: [\n { key: 'rho_ohm_m', quantity: 'resistivity', symbol: 'ρ', unit: 'ohm*m', meaning: 'DC resistivity 1/σ at the conductor\\'s temperature (copper at 20 °C ≈ 1.68e-8), > 0' },\n { key: 'f_Hz', quantity: 'frequency', symbol: 'f', unit: 'Hz', meaning: 'drive frequency ω/2π, > 0' },\n { key: 'mu_r', quantity: 'relative permeability', symbol: 'μ_r', unit: '', meaning: 'μ/μ0 of the conductor, taken constant and linear (1 for copper), > 0' },\n { key: 'eps_r', quantity: 'relative permittivity', symbol: 'ε_r', unit: '', meaning: 'ε/ε0 of the bound charges, beside the conduction current (1 for a metal, ≈ 11.7 for silicon), > 0' },\n { key: 'l_mfp_m', quantity: 'carrier mean free path', symbol: 'l', unit: 'm', meaning: 'the conduction carriers\\' mean free path at the conductor\\'s temperature (copper at 293 K ≈ 39 nm), > 0' },\n { key: 'v_carrier_m_per_s', quantity: 'carrier speed', symbol: 'v', unit: 'm/s', meaning: 'speed setting τ = l/v: the Fermi velocity in a metal (copper 1.57e6), the thermal velocity in a non-degenerate semiconductor, > 0' },\n { key: 'thickness_m', quantity: 'conductor thickness', symbol: 'd', unit: 'm', meaning: 'thickness of the planar conductor, driven from one face, > 0' },\n ],\n governing: {\n parent: [\n '∇×E = −∂B/∂t, ∇×H = σE + ∂D/∂t, B = μH, D = εE (Maxwell with a local Ohm law J = σE)',\n 'one dimension, H = H_y(x, t): (ε/σ) ∂²H/∂t² + ∂H/∂t = (1/(μσ)) ∂²H/∂x² (the telegraph equation of model-telegraph)',\n 'driven at ω on a half-space: H ∝ e^{i(kx − ωt)}, k² = ω²με + iωμσ, penetration depth 1/Im k',\n ],\n scalar: [\n '∂H/∂t = (1/(μσ)) ∂²H/∂x² (displacement current dropped: magnetic diffusion; ab-telegraph-diffusion)',\n 'H(x, t) = H0 e^{−x/δ} cos(ωt − x/δ), δ = √(2ρ/(ωμ)), μ = μ_r μ0',\n 'surface resistance R_s = ρ/δ (per square: the DC resistance of a sheet of thickness δ)',\n ],\n distinction:\n 'The parent is a vector field obeying a wave equation with loss, whose conductivity is a local, frequency-independent ' +\n 'constant; the scalar keeps one decay length for one field component in a half-space. Dropped: the displacement ' +\n 'current (the wave part, O(ωε/σ)), any non-local or frequency-dependent conductivity, the back face of a finite ' +\n 'conductor, and the conductor\\'s curvature and edges.',\n },\n observable: 'delta_m',\n outputs: [\n { key: 'omega_per_s', symbol: 'ω', unit: 's^-1', meaning: 'angular frequency 2πf' },\n { key: 'delta_m', symbol: 'δ', unit: 'm', meaning: 'classical skin depth √(2ρ/(ωμ)): the field and current fall by 1/e per δ' },\n { key: 'R_s_ohm', symbol: 'R_s', unit: 'ohm', meaning: 'surface resistance ρ/δ, per square (the real part of the surface impedance)' },\n { key: 'delta_maxwell_m', symbol: 'δ_M', unit: 'm', meaning: '1/Im k with the displacement current kept: the parent plane-wave penetration depth' },\n { key: 'maxwell_deviation', symbol: 'δ/δ_M − 1', unit: '', meaning: signedRelativeDifference('classical δ', 'parent penetration depth') },\n { key: 'displacement_ratio', symbol: 'ωε/σ', unit: '', meaning: 'displacement current over conduction current' },\n { key: 'mfp_ratio', symbol: 'l/δ', unit: '', meaning: 'mean free path over skin depth' },\n { key: 'omega_tau', symbol: 'ωτ', unit: '', meaning: 'ω l/v: the drive period against the carrier relaxation time' },\n { key: 'thickness_ratio', symbol: 'd/δ', unit: '', meaning: 'conductor thickness in skin depths' },\n { key: 'back_field_ratio', symbol: 'e^{−d/δ}', unit: '', meaning: 'field amplitude at the back face over the surface amplitude (half-space profile)' },\n ],\n conditions: [\n 'a planar, homogeneous, isotropic conductor filling 0 ≤ x ≤ d, driven at x = 0 by a tangential field H_y(0, t) = H0 cos ωt',\n 'periodic steady state: the start-up transient has decayed (it does so over a few periods near the surface)',\n 'half-space profile: the field vanishes deep in the conductor (checked through d/δ); the medium outside x = 0 enters only through H0',\n ],\n comparison: {\n reference: 'the parent plane wave in a local ohmic medium, displacement current kept: 1/Im k, k² = ω²με + iωμσ',\n valueKey: 'delta_m',\n referenceKey: 'delta_maxwell_m',\n deviationKey: 'maxwell_deviation',\n method: 'closed form 1/Im k = δ √(√(1 + r²) + r), r = ωε/σ',\n },\n notIncluded: [\n 'the temperature dependence of ρ (a conductor heated by its own AC loss has a larger δ)',\n 'surface roughness, which raises the AC loss once the rms roughness approaches δ (Hammerstad–Bekkadal)',\n 'curvature: for a round wire of radius a the Bessel-function solution replaces the planar profile, with corrections of order δ/a',\n 'ferromagnetic hysteresis and saturation: μ_r is taken constant and linear',\n 'the anomalous-regime surface impedance itself (Reuter–Sondheimer), which this case refuses rather than evaluates',\n ],\n measurement: [\n 'surface resistance: the unloaded Q of a cavity walled with the conductor is Q = G/R_s, G the cavity\\'s geometry factor; ' +\n 'compare the R_s inferred from Q with R_s_ohm',\n 'AC resistance: per square of the driven face it is R_s = ρ/δ against ρ/d at DC, so R_ac/R_dc = d/δ for d ≫ δ',\n 'eddy-current probing: the phase lag x/δ of the field at depth x, or the transmission e^{−d/δ} through a foil when d/δ is not large (a thin foil is where this case refuses)',\n ],\n links: [\n { id: 'model-telegraph', role: 'τ u_tt + u_t = D u_xx: the 1-D Maxwell equations in an ohmic conductor, with τ = ε/σ and D = 1/(μσ)' },\n { id: 'ab-telegraph-diffusion', role: 'dropping τ u_tt (here the displacement current) to reach diffusion; its small parameter τDq² is of order ωε/σ at q ~ 1/δ' },\n { id: 'model-fick', role: 'the diffusion equation u_t = D u_xx that the magnetic field obeys once the displacement current is dropped' },\n { id: 'CE-drude-resistivity', role: 'ρ = m/(nq²τ): the DC resistivity whose τ the DC-conductivity check compares with the drive period' },\n ],\n examples: {\n valid: {\n args: ['rho_ohm_m=1.68e-8', 'f_Hz=1MHz', 'mu_r=1', 'eps_r=1', 'l_mfp_m=39nm', 'v_carrier_m_per_s=1.57e6', 'thickness_m=1mm'],\n note: 'a 1 mm copper plate at room temperature driven at 1 MHz: δ ≈ 65 µm',\n fails: [],\n },\n failures: [\n {\n args: ['rho_ohm_m=1.68e-11', 'f_Hz=100MHz', 'mu_r=1', 'eps_r=1', 'l_mfp_m=39um', 'v_carrier_m_per_s=1.57e6', 'thickness_m=1mm'],\n note: 'high-purity copper at 4 K (residual-resistance ratio ≈ 1000) at 100 MHz: l ≈ 39 µm is ~190 δ — the anomalous skin effect',\n fails: ['local'],\n },\n {\n args: ['rho_ohm_m=1.68e-8', 'f_Hz=100kHz', 'mu_r=1', 'eps_r=1', 'l_mfp_m=39nm', 'v_carrier_m_per_s=1.57e6', 'thickness_m=35um'],\n note: 'a 35 µm copper foil at 100 kHz: δ ≈ 206 µm, so the foil is a sixth of a skin depth and the half-space profile does not apply',\n fails: ['thick'],\n },\n {\n args: ['rho_ohm_m=0.1', 'f_Hz=10GHz', 'mu_r=1', 'eps_r=11.7', 'l_mfp_m=28nm', 'v_carrier_m_per_s=2.3e5', 'thickness_m=10mm'],\n note: 'lightly doped silicon (10 Ω·cm) at 10 GHz: ωε/σ ≈ 0.65, a lossy dielectric rather than a good conductor',\n fails: ['good-conductor'],\n },\n ],\n },\n /** Evaluate the classical skin depth and conductor-regime checks for the supplied inputs. */\n run(i) {\n requirePositive(ID, i, ['rho_ohm_m', 'f_Hz', 'mu_r', 'eps_r', 'l_mfp_m', 'v_carrier_m_per_s', 'thickness_m']);\n const { rho_ohm_m: rho, f_Hz: f, mu_r: muR, eps_r: epsR, l_mfp_m: l, v_carrier_m_per_s: v, thickness_m: d } = i as Record<string, number>;\n const omega = 2 * Math.PI * f;\n const mu = muR * MU_0_SI;\n const delta = Math.sqrt((2 * rho) / (omega * mu));\n const r = omega * epsR * EPS_0_SI * rho;\n const deltaMaxwell = delta * maxwellDepthFactor(r);\n const omegaTau = (omega * l) / v;\n return {\n outputs: {\n omega_per_s: omega,\n delta_m: delta,\n R_s_ohm: rho / delta,\n delta_maxwell_m: deltaMaxwell,\n maxwell_deviation: delta / deltaMaxwell - 1,\n displacement_ratio: r,\n mfp_ratio: l / delta,\n omega_tau: omegaTau,\n thickness_ratio: d / delta,\n back_field_ratio: Math.exp(-d / delta),\n },\n checks: [\n check('good-conductor', 'good conductor: conduction current ≫ displacement current', 'ωε/σ', r, '<=', MAX_DISPLACEMENT_RATIO,\n 'chosen threshold for ≪ 1: the parent penetration depth then differs from δ by ≈ ωε/(2σ) ≤ 0.5%'),\n check('local', 'local conductivity: the carriers\\' mean free path well inside the skin depth, l ≪ δ', 'l/δ', l / delta, '<=', MAX_MFP_RATIO,\n 'chosen threshold for ≪ 1; beyond it the current at a point depends on the field over a path l and the anomalous skin effect sets in (Pippard 1947; Reuter & Sondheimer 1948)'),\n check('dc-conductivity', 'DC conductivity: the drive is slow beside the carrier relaxation, ωτ ≪ 1', 'ω l/v', omegaTau, '<=', MAX_OMEGA_TAU,\n 'chosen threshold for ≪ 1: the Drude σ(ω) = σ0/(1 − iωτ) is then within 0.5% of σ0 in modulus'),\n check('thick', 'the conductor is a half-space for the field: d ≫ δ', 'd/δ', d / delta, '>=', MIN_THICKNESS_RATIO,\n 'chosen threshold: the half-space field at the back face is then ≤ e^{−5} ≈ 0.7% of the surface field'),\n ],\n unchecked: [\n 'ρ, μ_r and ε_r are the values at the conductor\\'s temperature and at f; τ = l/v assumes one carrier species with one speed',\n 'the conductor is planar on the scale of δ (a wire of radius a needs a ≫ δ, not checked here)',\n ],\n };\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"skin-depth.js","sourceRoot":"","sources":["../../src/cases/skin-depth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAoB,MAAM,YAAY,CAAC;AAEhG,MAAM,EAAE,GAAG,iBAAiB,CAAC;AAE7B,6GAA6G;AAC7G,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,kEAAkE;AAClE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAEjC,gGAAgG;AAChG,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAEjC,0GAA0G;AAC1G,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,CAAS;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,EAAE,EAAE,EAAE;IACN,KAAK,EAAE,sFAAsF;IAC7F,UAAU,EAAE;QACV,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,qFAAqF,EAAE;QACzK,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,G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AG,KAAK,CAAC;aACvC;YACD,MAAM,EAAE;gBACN,KAAK,CAAC,gBAAgB,EAAE,2DAA2D,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAC1H,gGAAgG,CAAC;gBACnG,KAAK,CAAC,OAAO,EAAE,qFAAqF,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,aAAa,EACzI,8KAA8K,CAAC;gBACjL,KAAK,CAAC,iBAAiB,EAAE,0EAA0E,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EACzI,8FAA8F,CAAC;gBACjG,KAAK,CAAC,OAAO,EAAE,oDAAoD,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAC9G,sGAAsG,CAAC;aAC1G;YACD,SAAS,EAAE;gBACT,4HAA4H;gBAC5H,8FAA8F;aAC/F;SACF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/**\n * Applied case: the skin depth of a planar conductor driven at one frequency —\n * how far an AC field (and its current) penetrates, and the surface\n * resistance that sets the conductor's AC loss.\n *\n * In one dimension the Maxwell equations with a local Ohm law in a conductor\n * are the telegraph equation of `model-telegraph`, with relaxation time ε/σ\n * and diffusivity 1/(μσ). Dropping the displacement current is\n * `ab-telegraph-diffusion`, which leaves magnetic diffusion and the classical\n * δ = √(2ρ/(ωμ)) (Jackson, Classical Electrodynamics, 3rd ed., §5.18 and\n * §8.1). This case evaluates δ, checks the three premises the classical\n * result needs — a good conductor, a local conductivity (the mean free path\n * well inside δ; otherwise the anomalous skin effect, Pippard 1947), a DC\n * conductivity (ωτ ≪ 1, Drude) — and the half-space boundary condition, and\n * compares δ with the penetration depth of the full plane-wave solution.\n *\n * @module cases/skin-depth\n */\nimport { EPS0_SI, MU0_SI } from '../core/constants.js';\nimport { check, requirePositive, signedRelativeDifference, type AppliedCase } from './types.js';\n\nconst ID = 'case-skin-depth';\n\n/** ωε/σ ceiling: the displacement current then moves the penetration depth by ≈ ωε/(2σ) ≤ 0.5%. @internal */\nexport const MAX_DISPLACEMENT_RATIO = 0.01;\n\n/** l/δ ceiling for a local (classical) conductivity. @internal */\nexport const MAX_MFP_RATIO = 0.1;\n\n/** ωτ ceiling: the Drude σ(ω) = σ0/(1 − iωτ) is then within 0.5% of σ0 in modulus. @internal */\nexport const MAX_OMEGA_TAU = 0.1;\n\n/** d/δ floor: the field reaching the back face is then ≤ e^{−5} ≈ 0.7% of the surface field. @internal */\nexport const MIN_THICKNESS_RATIO = 5;\n\n/**\n * δ_Maxwell/δ for the plane wave k² = ω²με + iωμσ, as a function of r = ωε/σ:\n * 1/Im k = δ √(√(1 + r²) + r), written without the cancellation of |z| − Re z.\n * @internal\n */\nexport function maxwellDepthFactor(r: number): number {\n return Math.sqrt(Math.hypot(1, r) + r);\n}\n\nexport const SKIN_DEPTH_CASE: AppliedCase = {\n id: ID,\n title: 'Skin depth of a planar conductor (good-conductor, local and DC-conductivity regimes)',\n parameters: [\n { key: 'rho_ohm_m', quantity: 'resistivity', symbol: 'ρ', unit: 'ohm*m', meaning: 'DC resistivity 1/σ at the conductor\\'s temperature (copper at 20 °C ≈ 1.68e-8), > 0' },\n { key: 'f_Hz', quantity: 'frequency', symbol: 'f', unit: 'Hz', meaning: 'drive frequency ω/2π, > 0' },\n { key: 'mu_r', quantity: 'relative permeability', symbol: 'μ_r', unit: '', meaning: 'μ/μ0 of the conductor, taken constant and linear (1 for copper), > 0' },\n { key: 'eps_r', quantity: 'relative permittivity', symbol: 'ε_r', unit: '', meaning: 'ε/ε0 of the bound charges, beside the conduction current (1 for a metal, ≈ 11.7 for silicon), > 0' },\n { key: 'l_mfp_m', quantity: 'carrier mean free path', symbol: 'l', unit: 'm', meaning: 'the conduction carriers\\' mean free path at the conductor\\'s temperature (copper at 293 K ≈ 39 nm), > 0' },\n { key: 'v_carrier_m_per_s', quantity: 'carrier speed', symbol: 'v', unit: 'm/s', meaning: 'speed setting τ = l/v: the Fermi velocity in a metal (copper 1.57e6), the thermal velocity in a non-degenerate semiconductor, > 0' },\n { key: 'thickness_m', quantity: 'conductor thickness', symbol: 'd', unit: 'm', meaning: 'thickness of the planar conductor, driven from one face, > 0' },\n ],\n governing: {\n parent: [\n '∇×E = −∂B/∂t, ∇×H = σE + ∂D/∂t, B = μH, D = εE (Maxwell with a local Ohm law J = σE)',\n 'one dimension, H = H_y(x, t): (ε/σ) ∂²H/∂t² + ∂H/∂t = (1/(μσ)) ∂²H/∂x² (the telegraph equation of model-telegraph)',\n 'driven at ω on a half-space: H ∝ e^{i(kx − ωt)}, k² = ω²με + iωμσ, penetration depth 1/Im k',\n ],\n scalar: [\n '∂H/∂t = (1/(μσ)) ∂²H/∂x² (displacement current dropped: magnetic diffusion; ab-telegraph-diffusion)',\n 'H(x, t) = H0 e^{−x/δ} cos(ωt − x/δ), δ = √(2ρ/(ωμ)), μ = μ_r μ0',\n 'surface resistance R_s = ρ/δ (per square: the DC resistance of a sheet of thickness δ)',\n ],\n distinction:\n 'The parent is a vector field obeying a wave equation with loss, whose conductivity is a local, frequency-independent ' +\n 'constant; the scalar keeps one decay length for one field component in a half-space. Dropped: the displacement ' +\n 'current (the wave part, O(ωε/σ)), any non-local or frequency-dependent conductivity, the back face of a finite ' +\n 'conductor, and the conductor\\'s curvature and edges.',\n },\n observable: 'delta_m',\n outputs: [\n { key: 'omega_per_s', symbol: 'ω', unit: 's^-1', meaning: 'angular frequency 2πf' },\n { key: 'delta_m', symbol: 'δ', unit: 'm', meaning: 'classical skin depth √(2ρ/(ωμ)): the field and current fall by 1/e per δ' },\n { key: 'R_s_ohm', symbol: 'R_s', unit: 'ohm', meaning: 'surface resistance ρ/δ, per square (the real part of the surface impedance)' },\n { key: 'delta_maxwell_m', symbol: 'δ_M', unit: 'm', meaning: '1/Im k with the displacement current kept: the parent plane-wave penetration depth' },\n { key: 'maxwell_deviation', symbol: 'δ/δ_M − 1', unit: '', meaning: signedRelativeDifference('classical δ', 'parent penetration depth') },\n { key: 'displacement_ratio', symbol: 'ωε/σ', unit: '', meaning: 'displacement current over conduction current' },\n { key: 'mfp_ratio', symbol: 'l/δ', unit: '', meaning: 'mean free path over skin depth' },\n { key: 'omega_tau', symbol: 'ωτ', unit: '', meaning: 'ω l/v: the drive period against the carrier relaxation time' },\n { key: 'thickness_ratio', symbol: 'd/δ', unit: '', meaning: 'conductor thickness in skin depths' },\n { key: 'back_field_ratio', symbol: 'e^{−d/δ}', unit: '', meaning: 'field amplitude at the back face over the surface amplitude (half-space profile)' },\n ],\n conditions: [\n 'a planar, homogeneous, isotropic conductor filling 0 ≤ x ≤ d, driven at x = 0 by a tangential field H_y(0, t) = H0 cos ωt',\n 'periodic steady state: the start-up transient has decayed (it does so over a few periods near the surface)',\n 'half-space profile: the field vanishes deep in the conductor (checked through d/δ); the medium outside x = 0 enters only through H0',\n ],\n comparison: {\n reference: 'the parent plane wave in a local ohmic medium, displacement current kept: 1/Im k, k² = ω²με + iωμσ',\n valueKey: 'delta_m',\n referenceKey: 'delta_maxwell_m',\n deviationKey: 'maxwell_deviation',\n method: 'closed form 1/Im k = δ √(√(1 + r²) + r), r = ωε/σ',\n },\n notIncluded: [\n 'the temperature dependence of ρ (a conductor heated by its own AC loss has a larger δ)',\n 'surface roughness, which raises the AC loss once the rms roughness approaches δ (Hammerstad–Bekkadal)',\n 'curvature: for a round wire of radius a the Bessel-function solution replaces the planar profile, with corrections of order δ/a',\n 'ferromagnetic hysteresis and saturation: μ_r is taken constant and linear',\n 'the anomalous-regime surface impedance itself (Reuter–Sondheimer), which this case refuses rather than evaluates',\n ],\n measurement: [\n 'surface resistance: the unloaded Q of a cavity walled with the conductor is Q = G/R_s, G the cavity\\'s geometry factor; ' +\n 'compare the R_s inferred from Q with R_s_ohm',\n 'AC resistance: per square of the driven face it is R_s = ρ/δ against ρ/d at DC, so R_ac/R_dc = d/δ for d ≫ δ',\n 'eddy-current probing: the phase lag x/δ of the field at depth x, or the transmission e^{−d/δ} through a foil when d/δ is not large (a thin foil is where this case refuses)',\n ],\n links: [\n { id: 'model-telegraph', role: 'τ u_tt + u_t = D u_xx: the 1-D Maxwell equations in an ohmic conductor, with τ = ε/σ and D = 1/(μσ)' },\n { id: 'ab-telegraph-diffusion', role: 'dropping τ u_tt (here the displacement current) to reach diffusion; its small parameter τDq² is of order ωε/σ at q ~ 1/δ' },\n { id: 'model-fick', role: 'the diffusion equation u_t = D u_xx that the magnetic field obeys once the displacement current is dropped' },\n { id: 'CE-drude-resistivity', role: 'ρ = m/(nq²τ): the DC resistivity whose τ the DC-conductivity check compares with the drive period' },\n ],\n examples: {\n valid: {\n args: ['rho_ohm_m=1.68e-8', 'f_Hz=1MHz', 'mu_r=1', 'eps_r=1', 'l_mfp_m=39nm', 'v_carrier_m_per_s=1.57e6', 'thickness_m=1mm'],\n note: 'a 1 mm copper plate at room temperature driven at 1 MHz: δ ≈ 65 µm',\n fails: [],\n },\n failures: [\n {\n args: ['rho_ohm_m=1.68e-11', 'f_Hz=100MHz', 'mu_r=1', 'eps_r=1', 'l_mfp_m=39um', 'v_carrier_m_per_s=1.57e6', 'thickness_m=1mm'],\n note: 'high-purity copper at 4 K (residual-resistance ratio ≈ 1000) at 100 MHz: l ≈ 39 µm is ~190 δ — the anomalous skin effect',\n fails: ['local'],\n },\n {\n args: ['rho_ohm_m=1.68e-8', 'f_Hz=100kHz', 'mu_r=1', 'eps_r=1', 'l_mfp_m=39nm', 'v_carrier_m_per_s=1.57e6', 'thickness_m=35um'],\n note: 'a 35 µm copper foil at 100 kHz: δ ≈ 206 µm, so the foil is a sixth of a skin depth and the half-space profile does not apply',\n fails: ['thick'],\n },\n {\n args: ['rho_ohm_m=0.1', 'f_Hz=10GHz', 'mu_r=1', 'eps_r=11.7', 'l_mfp_m=28nm', 'v_carrier_m_per_s=2.3e5', 'thickness_m=10mm'],\n note: 'lightly doped silicon (10 Ω·cm) at 10 GHz: ωε/σ ≈ 0.65, a lossy dielectric rather than a good conductor',\n fails: ['good-conductor'],\n },\n ],\n },\n /** Evaluate the classical skin depth and conductor-regime checks for the supplied inputs. */\n run(i) {\n requirePositive(ID, i, ['rho_ohm_m', 'f_Hz', 'mu_r', 'eps_r', 'l_mfp_m', 'v_carrier_m_per_s', 'thickness_m']);\n const { rho_ohm_m: rho, f_Hz: f, mu_r: muR, eps_r: epsR, l_mfp_m: l, v_carrier_m_per_s: v, thickness_m: d } = i as Record<string, number>;\n const omega = 2 * Math.PI * f;\n const mu = muR * MU0_SI;\n const delta = Math.sqrt((2 * rho) / (omega * mu));\n const r = omega * epsR * EPS0_SI * rho;\n const deltaMaxwell = delta * maxwellDepthFactor(r);\n const omegaTau = (omega * l) / v;\n return {\n outputs: {\n omega_per_s: omega,\n delta_m: delta,\n R_s_ohm: rho / delta,\n delta_maxwell_m: deltaMaxwell,\n maxwell_deviation: delta / deltaMaxwell - 1,\n displacement_ratio: r,\n mfp_ratio: l / delta,\n omega_tau: omegaTau,\n thickness_ratio: d / delta,\n back_field_ratio: Math.exp(-d / delta),\n },\n checks: [\n check('good-conductor', 'good conductor: conduction current ≫ displacement current', 'ωε/σ', r, '<=', MAX_DISPLACEMENT_RATIO,\n 'chosen threshold for ≪ 1: the parent penetration depth then differs from δ by ≈ ωε/(2σ) ≤ 0.5%'),\n check('local', 'local conductivity: the carriers\\' mean free path well inside the skin depth, l ≪ δ', 'l/δ', l / delta, '<=', MAX_MFP_RATIO,\n 'chosen threshold for ≪ 1; beyond it the current at a point depends on the field over a path l and the anomalous skin effect sets in (Pippard 1947; Reuter & Sondheimer 1948)'),\n check('dc-conductivity', 'DC conductivity: the drive is slow beside the carrier relaxation, ωτ ≪ 1', 'ω l/v', omegaTau, '<=', MAX_OMEGA_TAU,\n 'chosen threshold for ≪ 1: the Drude σ(ω) = σ0/(1 − iωτ) is then within 0.5% of σ0 in modulus'),\n check('thick', 'the conductor is a half-space for the field: d ≫ δ', 'd/δ', d / delta, '>=', MIN_THICKNESS_RATIO,\n 'chosen threshold: the half-space field at the back face is then ≤ e^{−5} ≈ 0.7% of the surface field'),\n ],\n unchecked: [\n 'ρ, μ_r and ε_r are the values at the conductor\\'s temperature and at f; τ = l/v assumes one carrier species with one speed',\n 'the conductor is planar on the scale of δ (a wire of radius a needs a ≫ δ, not checked here)',\n ],\n };\n },\n};\n"]}
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
export interface FlagSpec {
|
|
11
11
|
name: string;
|
|
12
12
|
valueStyle: 'attached' | 'next' | 'either' | 'none';
|
|
13
|
+
/** The flag may be given more than once; the values are kept in order. */
|
|
13
14
|
repeatable?: boolean;
|
|
14
15
|
/** For 'either'/'next' styles: a missing value stores '' instead of throwing —
|
|
15
16
|
* exists for old-CLI fidelity (--equation's empty-value diagnostic belongs to
|
|
@@ -31,5 +32,26 @@ export interface ParsedArgs {
|
|
|
31
32
|
flags: Map<string, string[]>;
|
|
32
33
|
positionals: string[];
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
+
/**
|
|
36
|
+
* How many positional arguments a command reads. A command declares it on its registration;
|
|
37
|
+
* absent means none, and every positional is then a stray token (cli/README.md §Hardening:
|
|
38
|
+
* nothing typed is silently dropped).
|
|
39
|
+
*/
|
|
40
|
+
export interface PositionalArity {
|
|
41
|
+
/** The most positionals the command reads; `Infinity` for a list. The token past it is refused. */
|
|
42
|
+
readonly max: number;
|
|
43
|
+
}
|
|
44
|
+
/** No positional is read. The parser's default when a command declares nothing. */
|
|
45
|
+
export declare const NO_POSITIONALS: PositionalArity;
|
|
46
|
+
/**
|
|
47
|
+
* Refuse the positional past `max` as a usage error naming the token and the command:
|
|
48
|
+
* `upt audit: unexpected argument 'junk' (audit takes no positional arguments; see upt help audit)`.
|
|
49
|
+
* `command` may carry a subverb (`probe scan`), whose first word is the help target.
|
|
50
|
+
*/
|
|
51
|
+
export declare function refuseExtraPositionals(command: string, positionals: readonly string[], max: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* Parse `argv` against the command's flag specs. `positionals` is the command's declared arity
|
|
54
|
+
* (`Command.positionals`); a token past it, or any token when none is declared, is a `UsageError`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function parseArgs(command: string, argv: string[], specs: FlagSpec[], arity?: PositionalArity): ParsedArgs;
|
|
35
57
|
//# sourceMappingURL=args.d.ts.map
|
package/dist/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;uCAEmC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,0CAA0C;AAC1C,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAGvE;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpD,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;uCAEmC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,0CAA0C;AAC1C,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAGvE;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,mGAAmG;IACnG,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,mFAAmF;AACnF,eAAO,MAAM,cAAc,EAAE,eAA4B,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CASzG;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,QAAQ,EAAE,EACjB,KAAK,GAAE,eAAgC,GACtC,UAAU,CA+EZ"}
|
package/dist/cli/args.js
CHANGED
|
@@ -15,13 +15,34 @@ export function optionTokens(argv) {
|
|
|
15
15
|
const end = argv.indexOf(END_OF_OPTIONS);
|
|
16
16
|
return end === -1 ? argv : argv.slice(0, end);
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
/** No positional is read. The parser's default when a command declares nothing. */
|
|
19
|
+
export const NO_POSITIONALS = { max: 0 };
|
|
20
|
+
/**
|
|
21
|
+
* Refuse the positional past `max` as a usage error naming the token and the command:
|
|
22
|
+
* `upt audit: unexpected argument 'junk' (audit takes no positional arguments; see upt help audit)`.
|
|
23
|
+
* `command` may carry a subverb (`probe scan`), whose first word is the help target.
|
|
24
|
+
*/
|
|
25
|
+
export function refuseExtraPositionals(command, positionals, max) {
|
|
26
|
+
if (positionals.length <= max)
|
|
27
|
+
return;
|
|
28
|
+
const takes = max === 0
|
|
29
|
+
? `${command} takes no positional arguments`
|
|
30
|
+
: `${command} takes at most ${max} positional argument${max === 1 ? '' : 's'}`;
|
|
31
|
+
throw new UsageError(`upt ${command}: unexpected argument '${positionals[max]}' (${takes}; see upt help ${command.split(' ')[0]})`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parse `argv` against the command's flag specs. `positionals` is the command's declared arity
|
|
35
|
+
* (`Command.positionals`); a token past it, or any token when none is declared, is a `UsageError`.
|
|
36
|
+
*/
|
|
37
|
+
export function parseArgs(command, argv, specs, arity = NO_POSITIONALS) {
|
|
19
38
|
const bySpecName = new Map();
|
|
20
39
|
for (const spec of specs)
|
|
21
40
|
bySpecName.set(spec.name, spec);
|
|
22
41
|
const flags = new Map();
|
|
23
42
|
const positionals = [];
|
|
24
43
|
const hint = `(see upt help ${command})`;
|
|
44
|
+
// Every flag refusal names the command first, as every other refusal does (`upt audit: ...`).
|
|
45
|
+
const refuse = (message) => new UsageError(`upt ${command}: ${message}`);
|
|
25
46
|
for (let i = 0; i < argv.length; i++) {
|
|
26
47
|
const token = argv[i];
|
|
27
48
|
if (token === END_OF_OPTIONS) {
|
|
@@ -39,22 +60,22 @@ export function parseArgs(command, argv, specs) {
|
|
|
39
60
|
if (!spec) {
|
|
40
61
|
// The three file options belong to `upt`, not to a command, and are read only before the command.
|
|
41
62
|
if (flagName === '--record' || flagName === '--replay' || flagName === '--show-record') {
|
|
42
|
-
throw
|
|
63
|
+
throw refuse(`unknown flag '${flagName}' for '${command}' ${hint}; ${flagName} is an option of upt itself and goes before the command: upt ${flagName}=FILE ${command} ...`);
|
|
43
64
|
}
|
|
44
|
-
throw
|
|
65
|
+
throw refuse(`unknown flag '${flagName}' for '${command}' ${hint}`);
|
|
45
66
|
}
|
|
46
67
|
let value;
|
|
47
68
|
if (attachedValue !== undefined) {
|
|
48
69
|
if (spec.valueStyle === 'next') {
|
|
49
|
-
throw
|
|
70
|
+
throw refuse(`flag '${spec.name}' does not accept an attached value; use '${spec.name} VALUE' for '${command}' ${hint}`);
|
|
50
71
|
}
|
|
51
72
|
if (spec.valueStyle === 'none') {
|
|
52
|
-
throw
|
|
73
|
+
throw refuse(`flag '${spec.name}' takes no value for '${command}' ${hint}`);
|
|
53
74
|
}
|
|
54
75
|
value = attachedValue;
|
|
55
76
|
}
|
|
56
77
|
else if (spec.valueStyle === 'attached') {
|
|
57
|
-
throw
|
|
78
|
+
throw refuse(`flag '${spec.name}' requires '${spec.name}=VALUE' for '${command}' ${hint}`);
|
|
58
79
|
}
|
|
59
80
|
else if (spec.valueStyle === 'none') {
|
|
60
81
|
value = '';
|
|
@@ -64,7 +85,7 @@ export function parseArgs(command, argv, specs) {
|
|
|
64
85
|
const next = argv[i + 1];
|
|
65
86
|
if (next === undefined || next.startsWith('--')) {
|
|
66
87
|
if (!spec.optionalValue) {
|
|
67
|
-
throw
|
|
88
|
+
throw refuse(`flag '${spec.name}' requires a value for '${command}' ${hint}`);
|
|
68
89
|
}
|
|
69
90
|
value = '';
|
|
70
91
|
}
|
|
@@ -77,7 +98,7 @@ export function parseArgs(command, argv, specs) {
|
|
|
77
98
|
const existing = flags.get(key);
|
|
78
99
|
if (existing) {
|
|
79
100
|
if (!spec.repeatable) {
|
|
80
|
-
throw
|
|
101
|
+
throw refuse(`flag '${spec.name}' given more than once for '${command}' ${hint}`);
|
|
81
102
|
}
|
|
82
103
|
existing.push(value);
|
|
83
104
|
}
|
|
@@ -85,6 +106,7 @@ export function parseArgs(command, argv, specs) {
|
|
|
85
106
|
flags.set(key, [value]);
|
|
86
107
|
}
|
|
87
108
|
}
|
|
109
|
+
refuseExtraPositionals(command, positionals, arity.max);
|
|
88
110
|
return { flags, positionals };
|
|
89
111
|
}
|
|
90
112
|
//# sourceMappingURL=args.js.map
|
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAmBzC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,IAAuB;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IACzC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC;AAOD,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,IAAc,EAAE,KAAiB;IAC1E,MAAM,UAAU,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC/C,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAE1D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC1C,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,MAAM,IAAI,GAAG,iBAAiB,OAAO,GAAG,CAAC;IAEzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,KAAK,KAAK,cAAc,EAAE,CAAC;YAC7B,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,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AAS,IAAI,CAAC,IAAI,+BAA+B,OAAO,KAAK,IAAI,EAAE,CAAC,CAAC;YAC5F,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC","sourcesContent":["/**\n * Hand-written declarative flag parser for the UPT CLI.\n *\n * Only tokens starting with `--` are treated as flags; everything else\n * (including `name=value` and `name:dim` positionals) passes through to\n * `positionals` untouched and in original order. A bare `--` ends the\n * options: every later token is a positional, whatever it starts with.\n * Single left-to-right scan, zero dependencies.\n */\n\nimport { UsageError } from './errors.js';\n\nexport interface FlagSpec {\n name: string; // e.g. '--source'\n valueStyle: 'attached' | 'next' | 'either' | 'none';\n repeatable?: boolean; // only --anchor today\n /** For 'either'/'next' styles: a missing value stores '' instead of throwing —\n * exists for old-CLI fidelity (--equation's empty-value diagnostic belongs to\n * the command, not the parser). */\n optionalValue?: boolean;\n /**\n * One sentence printed by `upt help` and by `docs/CLI.md`.\n * A registered command's flags set this. The parser does not read it.\n */\n description?: string;\n /** Printed default, when the command has one. Omit when there is no default. */\n defaultValue?: string;\n}\n\n/** The token that ends option parsing. */\nexport const END_OF_OPTIONS = '--';\n\n/** The tokens before a bare `--`: the ones the dispatcher may read as options. */\nexport function optionTokens(argv: readonly string[]): readonly string[] {\n const end = argv.indexOf(END_OF_OPTIONS);\n return end === -1 ? argv : argv.slice(0, end);\n}\n\nexport interface ParsedArgs {\n flags: Map<string, string[]>; // name (no dashes) -> raw values ('' for none-style)\n positionals: string[];\n}\n\nexport function parseArgs(command: string, argv: string[], specs: FlagSpec[]): ParsedArgs {\n const bySpecName = new Map<string, FlagSpec>();\n for (const spec of specs) bySpecName.set(spec.name, spec);\n\n const flags = new Map<string, string[]>();\n const positionals: string[] = [];\n const hint = `(see upt help ${command})`;\n\n for (let i = 0; i < argv.length; i++) {\n const token = argv[i];\n if (token === END_OF_OPTIONS) {\n positionals.push(...argv.slice(i + 1));\n break;\n }\n if (!token.startsWith('--')) {\n positionals.push(token);\n continue;\n }\n\n const eqIndex = token.indexOf('=');\n const flagName = eqIndex === -1 ? token : token.slice(0, eqIndex);\n const attachedValue = eqIndex === -1 ? undefined : token.slice(eqIndex + 1);\n\n const spec = bySpecName.get(flagName);\n if (!spec) {\n // The three file options belong to `upt`, not to a command, and are read only before the command.\n if (flagName === '--record' || flagName === '--replay' || flagName === '--show-record') {\n throw new UsageError(\n `unknown flag '${flagName}' for '${command}' ${hint}; ${flagName} is an option of upt itself and goes before the command: upt ${flagName}=FILE ${command} ...`,\n );\n }\n throw new UsageError(`unknown flag '${flagName}' for '${command}' ${hint}`);\n }\n\n let value: string;\n if (attachedValue !== undefined) {\n if (spec.valueStyle === 'next') {\n throw new UsageError(\n `flag '${spec.name}' does not accept an attached value; use '${spec.name} VALUE' for '${command}' ${hint}`\n );\n }\n if (spec.valueStyle === 'none') {\n throw new UsageError(`flag '${spec.name}' takes no value for '${command}' ${hint}`);\n }\n value = attachedValue;\n } else if (spec.valueStyle === 'attached') {\n throw new UsageError(`flag '${spec.name}' requires '${spec.name}=VALUE' for '${command}' ${hint}`);\n } else if (spec.valueStyle === 'none') {\n value = '';\n } else {\n // 'next' or 'either' with no attached value: consume the next token.\n const next = argv[i + 1];\n if (next === undefined || next.startsWith('--')) {\n if (!spec.optionalValue) {\n throw new UsageError(`flag '${spec.name}' requires a value for '${command}' ${hint}`);\n }\n value = '';\n } else {\n value = next;\n i++;\n }\n }\n\n const key = spec.name.slice(2);\n const existing = flags.get(key);\n if (existing) {\n if (!spec.repeatable) {\n throw new UsageError(`flag '${spec.name}' given more than once for '${command}' ${hint}`);\n }\n existing.push(value);\n } else {\n flags.set(key, [value]);\n }\n }\n\n return { flags, positionals };\n}\n"]}
|
|
1
|
+
{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AK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;oBACxB,MAAM,MAAM,CAAC,SAAS,IAAI,CAAC,IAAI,2BAA2B,OAAO,KAAK,IAAI,EAAE,CAAC,CAAC;gBAChF,CAAC;gBACD,KAAK,GAAG,EAAE,CAAC;YACb,CAAC;iBAAM,CAAC;gBACN,KAAK,GAAG,IAAI,CAAC;gBACb,CAAC,EAAE,CAAC;YACN,CAAC;QACH,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;gBACrB,MAAM,MAAM,CAAC,SAAS,IAAI,CAAC,IAAI,+BAA+B,OAAO,KAAK,IAAI,EAAE,CAAC,CAAC;YACpF,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,sBAAsB,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACxD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC","sourcesContent":["/**\n * Hand-written declarative flag parser for the UPT CLI.\n *\n * Only tokens starting with `--` are treated as flags; everything else\n * (including `name=value` and `name:dim` positionals) passes through to\n * `positionals` untouched and in original order. A bare `--` ends the\n * options: every later token is a positional, whatever it starts with.\n * Single left-to-right scan, zero dependencies.\n */\n\nimport { UsageError } from './errors.js';\n\nexport interface FlagSpec {\n name: string; // e.g. '--source'\n valueStyle: 'attached' | 'next' | 'either' | 'none';\n /** The flag may be given more than once; the values are kept in order. */\n repeatable?: boolean;\n /** For 'either'/'next' styles: a missing value stores '' instead of throwing —\n * exists for old-CLI fidelity (--equation's empty-value diagnostic belongs to\n * the command, not the parser). */\n optionalValue?: boolean;\n /**\n * One sentence printed by `upt help` and by `docs/CLI.md`.\n * A registered command's flags set this. The parser does not read it.\n */\n description?: string;\n /** Printed default, when the command has one. Omit when there is no default. */\n defaultValue?: string;\n}\n\n/** The token that ends option parsing. */\nexport const END_OF_OPTIONS = '--';\n\n/** The tokens before a bare `--`: the ones the dispatcher may read as options. */\nexport function optionTokens(argv: readonly string[]): readonly string[] {\n const end = argv.indexOf(END_OF_OPTIONS);\n return end === -1 ? argv : argv.slice(0, end);\n}\n\nexport interface ParsedArgs {\n flags: Map<string, string[]>; // name (no dashes) -> raw values ('' for none-style)\n positionals: string[];\n}\n\n/**\n * How many positional arguments a command reads. A command declares it on its registration;\n * absent means none, and every positional is then a stray token (cli/README.md §Hardening:\n * nothing typed is silently dropped).\n */\nexport interface PositionalArity {\n /** The most positionals the command reads; `Infinity` for a list. The token past it is refused. */\n readonly max: number;\n}\n\n/** No positional is read. The parser's default when a command declares nothing. */\nexport const NO_POSITIONALS: PositionalArity = { max: 0 };\n\n/**\n * Refuse the positional past `max` as a usage error naming the token and the command:\n * `upt audit: unexpected argument 'junk' (audit takes no positional arguments; see upt help audit)`.\n * `command` may carry a subverb (`probe scan`), whose first word is the help target.\n */\nexport function refuseExtraPositionals(command: string, positionals: readonly string[], max: number): void {\n if (positionals.length <= max) return;\n const takes =\n max === 0\n ? `${command} takes no positional arguments`\n : `${command} takes at most ${max} positional argument${max === 1 ? '' : 's'}`;\n throw new UsageError(\n `upt ${command}: unexpected argument '${positionals[max]}' (${takes}; see upt help ${command.split(' ')[0]})`,\n );\n}\n\n/**\n * Parse `argv` against the command's flag specs. `positionals` is the command's declared arity\n * (`Command.positionals`); a token past it, or any token when none is declared, is a `UsageError`.\n */\nexport function parseArgs(\n command: string,\n argv: string[],\n specs: FlagSpec[],\n arity: PositionalArity = NO_POSITIONALS,\n): ParsedArgs {\n const bySpecName = new Map<string, FlagSpec>();\n for (const spec of specs) bySpecName.set(spec.name, spec);\n\n const flags = new Map<string, string[]>();\n const positionals: string[] = [];\n const hint = `(see upt help ${command})`;\n // Every flag refusal names the command first, as every other refusal does (`upt audit: ...`).\n const refuse = (message: string): UsageError => new UsageError(`upt ${command}: ${message}`);\n\n for (let i = 0; i < argv.length; i++) {\n const token = argv[i];\n if (token === END_OF_OPTIONS) {\n positionals.push(...argv.slice(i + 1));\n break;\n }\n if (!token.startsWith('--')) {\n positionals.push(token);\n continue;\n }\n\n const eqIndex = token.indexOf('=');\n const flagName = eqIndex === -1 ? token : token.slice(0, eqIndex);\n const attachedValue = eqIndex === -1 ? undefined : token.slice(eqIndex + 1);\n\n const spec = bySpecName.get(flagName);\n if (!spec) {\n // The three file options belong to `upt`, not to a command, and are read only before the command.\n if (flagName === '--record' || flagName === '--replay' || flagName === '--show-record') {\n throw refuse(\n `unknown flag '${flagName}' for '${command}' ${hint}; ${flagName} is an option of upt itself and goes before the command: upt ${flagName}=FILE ${command} ...`,\n );\n }\n throw refuse(`unknown flag '${flagName}' for '${command}' ${hint}`);\n }\n\n let value: string;\n if (attachedValue !== undefined) {\n if (spec.valueStyle === 'next') {\n throw refuse(\n `flag '${spec.name}' does not accept an attached value; use '${spec.name} VALUE' for '${command}' ${hint}`\n );\n }\n if (spec.valueStyle === 'none') {\n throw refuse(`flag '${spec.name}' takes no value for '${command}' ${hint}`);\n }\n value = attachedValue;\n } else if (spec.valueStyle === 'attached') {\n throw refuse(`flag '${spec.name}' requires '${spec.name}=VALUE' for '${command}' ${hint}`);\n } else if (spec.valueStyle === 'none') {\n value = '';\n } else {\n // 'next' or 'either' with no attached value: consume the next token.\n const next = argv[i + 1];\n if (next === undefined || next.startsWith('--')) {\n if (!spec.optionalValue) {\n throw refuse(`flag '${spec.name}' requires a value for '${command}' ${hint}`);\n }\n value = '';\n } else {\n value = next;\n i++;\n }\n }\n\n const key = spec.name.slice(2);\n const existing = flags.get(key);\n if (existing) {\n if (!spec.repeatable) {\n throw refuse(`flag '${spec.name}' given more than once for '${command}' ${hint}`);\n }\n existing.push(value);\n } else {\n flags.set(key, [value]);\n }\n }\n\n refuseExtraPositionals(command, positionals, arity.max);\n return { flags, positionals };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../src/cli/bindings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../src/cli/bindings.ts"],"names":[],"mappings":"AAcA,uGAAuG;AACvG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,SAAe,GAAG,UAAU,EAAE,CAY/G"}
|
package/dist/cli/bindings.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @module cli/bindings
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
+
import { splitAssignment } from '../core/assignment.js';
|
|
12
13
|
import { CliError, UsageError } from './errors.js';
|
|
13
14
|
/**
|
|
14
15
|
* Split `name=value` tokens. `shape` names the expected form in the usage
|
|
@@ -18,14 +19,14 @@ export function splitAssignments(command, tokens, shape = 'name=value') {
|
|
|
18
19
|
const out = [];
|
|
19
20
|
const seen = new Set();
|
|
20
21
|
for (const token of tokens) {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
22
|
+
const split = splitAssignment(token);
|
|
23
|
+
if (split === null)
|
|
23
24
|
throw new UsageError(`upt ${command}: '${token}' must be ${shape}. See \`upt help ${command.split(' ')[0]}\`.`);
|
|
24
|
-
const name =
|
|
25
|
+
const { name, raw } = split;
|
|
25
26
|
if (seen.has(name))
|
|
26
27
|
throw new CliError(`upt ${command}: '${name}' is given twice ('${token}'); give one value per name`);
|
|
27
28
|
seen.add(name);
|
|
28
|
-
out.push({ name, raw
|
|
29
|
+
out.push({ name, raw, token });
|
|
29
30
|
}
|
|
30
31
|
return out;
|
|
31
32
|
}
|
package/dist/cli/bindings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../src/cli/bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUnD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,MAAyB,EAAE,KAAK,GAAG,YAAY;IAC/F,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,
|
|
1
|
+
{"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../src/cli/bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUnD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,MAAyB,EAAE,KAAK,GAAG,YAAY;IAC/F,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,KAAK,KAAK,IAAI;YAAE,MAAM,IAAI,UAAU,CAAC,OAAO,OAAO,MAAM,KAAK,aAAa,KAAK,oBAAoB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACpI,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,QAAQ,CAAC,OAAO,OAAO,MAAM,IAAI,sBAAsB,KAAK,6BAA6B,CAAC,CAAC;QACzH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/**\n * The one reader of `name=value` tokens for every command that takes them\n * (`eval`, `explain`, `evaluate` and its `--sigma`, `regime`/`path` `--at`,\n * `metric`). It settles two things once: a token with no `=` (or an empty\n * name) is a malformed invocation, exit 2; a name given twice is refused,\n * exit 1, never \"the last one wins\". The value itself is read by the\n * command's own binding reader afterwards.\n *\n * @module cli/bindings\n * @internal\n */\nimport { splitAssignment } from '../core/assignment.js';\nimport { CliError, UsageError } from './errors.js';\n\n/** One `name=value` token, split. `raw` may be empty (`mass=`); the reader decides what that means. */\nexport interface Assignment {\n readonly name: string;\n readonly raw: string;\n /** The token as given, for messages. */\n readonly token: string;\n}\n\n/**\n * Split `name=value` tokens. `shape` names the expected form in the usage\n * message (`name=value`, `group=value`, `key=value (e.g. mu_e=2)`).\n */\nexport function splitAssignments(command: string, tokens: readonly string[], shape = 'name=value'): Assignment[] {\n const out: Assignment[] = [];\n const seen = new Set<string>();\n for (const token of tokens) {\n const split = splitAssignment(token);\n if (split === null) throw new UsageError(`upt ${command}: '${token}' must be ${shape}. See \\`upt help ${command.split(' ')[0]}\\`.`);\n const { name, raw } = split;\n if (seen.has(name)) throw new CliError(`upt ${command}: '${name}' is given twice ('${token}'); give one value per name`);\n seen.add(name);\n out.push({ name, raw, token });\n }\n return out;\n}\n"]}
|
package/dist/cli/command.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* themselves (typically from their own module's top-level side effect, or
|
|
10
10
|
* from a barrel later tasks import) without `runCli`'s body ever changing.
|
|
11
11
|
*/
|
|
12
|
-
import type { ParsedArgs, FlagSpec } from './args.js';
|
|
12
|
+
import type { ParsedArgs, FlagSpec, PositionalArity } from './args.js';
|
|
13
13
|
import type * as cliApi from '../cli-api.js';
|
|
14
14
|
export interface CommandCtx {
|
|
15
15
|
args: ParsedArgs;
|
|
@@ -36,6 +36,13 @@ export interface Command {
|
|
|
36
36
|
group?: CommandGroup;
|
|
37
37
|
/** Subverbs, when the command has them. `probe` is the one that does. */
|
|
38
38
|
subcommands?: readonly CommandSub[];
|
|
39
|
+
/**
|
|
40
|
+
* The positional arguments the command reads. Absent: none, and a stray token is a usage
|
|
41
|
+
* error (exit 2) naming the token and the command, checked once by the parser the dispatcher
|
|
42
|
+
* runs (`parseArgs`), so `run` never sees a token it would drop. A command that reads
|
|
43
|
+
* positionals declares how many (`{ max: Infinity }` for a list).
|
|
44
|
+
*/
|
|
45
|
+
positionals?: PositionalArity;
|
|
39
46
|
run(ctx: CommandCtx): Promise<number>;
|
|
40
47
|
}
|
|
41
48
|
/** Register a command under its name and every alias. Later registrations for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/cli/command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/cli/command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAE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cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEvE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C;AAED;;;6EAG6E;AAC7E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEtD;AAED;;yEAEyE;AACzE,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
package/dist/cli/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/cli/command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/cli/command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA2CH,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAmB,CAAC;AAE5C;;uDAEuD;AACvD,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpC,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO;QAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACpE,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAAC,WAAmB;IAChD,OAAO,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACxE,CAAC;AAED;;;6EAG6E;AAC7E,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,eAAe,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAED;;yEAEyE;AACzE,MAAM,UAAU,oBAAoB;IAClC,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Command registry + the `Command`/`CommandCtx` contract for the UPT CLI.\n *\n * A `Command` is a self-contained verb handler: its own flag specs, its own\n * help block, and a `run` that receives an injected `CommandCtx` (never\n * reaches for `process.stdout`/`process.argv` itself, so it is trivially\n * testable in-process). `main.ts` owns dispatch (`runCli`); this module only\n * owns the registry those commands plug into — new commands register\n * themselves (typically from their own module's top-level side effect, or\n * from a barrel later tasks import) without `runCli`'s body ever changing.\n */\n\nimport type { ParsedArgs, FlagSpec, PositionalArity } from './args.js';\nimport type * as cliApi from '../cli-api.js';\n\nexport interface CommandCtx {\n args: ParsedArgs;\n api: typeof cliApi; // injected so tests can stub; main.ts passes the real barrel\n out: (line?: string) => void; // console.log semantics: write((line ?? '') + '\\n')\n err: (line?: string) => void; // same semantics on stderr\n write: (s: string) => void; // raw stdout write, no newline (diagram output only)\n}\n\n/** README / docs/CLI.md grouping. The generator is the only reader. */\nexport type CommandGroup = 'evaluate' | 'explore' | 'discovery' | 'data' | 'utilities';\n\nexport interface CommandSub {\n readonly name: string;\n readonly summary: string;\n}\n\nexport interface Command {\n name: string;\n aliases: string[];\n flags: FlagSpec[];\n help: string; // per-command usage block; the Flags section is renderFlagCatalog(flags)\n /** One line for the README table and docs/CLI.md. */\n summary?: string;\n /** One real invocation, including the `upt` word. */\n example?: string;\n group?: CommandGroup;\n /** Subverbs, when the command has them. `probe` is the one that does. */\n subcommands?: readonly CommandSub[];\n /**\n * The positional arguments the command reads. Absent: none, and a stray token is a usage\n * error (exit 2) naming the token and the command, checked once by the parser the dispatcher\n * runs (`parseArgs`), so `run` never sees a token it would drop. A command that reads\n * positionals declares how many (`{ max: Infinity }` for a list).\n */\n positionals?: PositionalArity;\n run(ctx: CommandCtx): Promise<number>; // 0 on success; throws UsageError/CliError otherwise\n}\n\nconst registry = new Map<string, Command>();\n\n/** Register a command under its name and every alias. Later registrations for\n * an already-taken name/alias overwrite the earlier one (keeps this usable\n * from tests that re-register a stub across cases). */\nexport function registerCommand(command: Command): void {\n registry.set(command.name, command);\n for (const alias of command.aliases) registry.set(alias, command);\n}\n\n/** Look up a command by its primary name or any alias. */\nexport function resolveCommand(nameOrAlias: string): Command | undefined {\n return registry.get(nameOrAlias);\n}\n\n/**\n * The PRIMARY names of every registered command, sorted (aliases excluded).\n *\n * The authority on what the CLI can run. `upt --help` is this list, each\n * command's own `help`, so a command registered without a help entry is still\n * named; `tests/cli/help-covers-registry.test.ts` compares the two. `upt chain`\n * is registered and omitted from that text.\n */\nexport function listCommandNames(): string[] {\n return [...new Set([...registry.values()].map((c) => c.name))].sort();\n}\n\n/** Test-only registration hook. Same behavior as `registerCommand` — kept as\n * a distinct, deliberately-unexciting name so it reads as test scaffolding\n * (not part of the CLI's own porting surface) at call sites in\n * `tests/cli/*.test.ts`. Not re-exported from `cli-api.ts` or `index.ts`. */\nexport function registerForTest(command: Command): void {\n registerCommand(command);\n}\n\n/** Test-only reset hook: clears every registered command (including\n * aliases). Lets test files register stub commands without leaking them\n * across files that share the module registry within a single worker. */\nexport function clearRegistryForTest(): void {\n registry.clear();\n}\n"]}
|
|
@@ -2,8 +2,6 @@ import type { CommandCtx } from '../command.js';
|
|
|
2
2
|
import type { EvidenceTag, RelationType } from '../../atlas/types.js';
|
|
3
3
|
import { claimReport, type TransportReport } from './_atlas-route.js';
|
|
4
4
|
type Api = CommandCtx['api'];
|
|
5
|
-
export declare const ATLAS_SOURCE: string;
|
|
6
|
-
export declare const LINK_SOURCE = "AtlasModel.canonicalRefs";
|
|
7
5
|
/** A canonical equation recorded for an atlas model, with its graph edge when present. */
|
|
8
6
|
export interface EquationLink {
|
|
9
7
|
id: string;
|
|
@@ -84,9 +82,6 @@ export interface WitnessOutcomes {
|
|
|
84
82
|
/** No row in the source: a name, not a result. */
|
|
85
83
|
notObserved: string[];
|
|
86
84
|
}
|
|
87
|
-
export declare const STORED_RESULTS_PATH = "data/atlas/witness-results.json";
|
|
88
|
-
/** The absolute path `--stored` reads, which an experiment record hashes as an input. */
|
|
89
|
-
export declare function storedResultsFile(): string;
|
|
90
85
|
/**
|
|
91
86
|
* The committed witness-results artifact. It is a repository file, not shipped
|
|
92
87
|
* in the package, so its absence is refused rather than read as "no results":
|
|
@@ -382,14 +377,10 @@ export interface FamilyView {
|
|
|
382
377
|
witnessResults?: ResultsTally;
|
|
383
378
|
epistemics: string;
|
|
384
379
|
}
|
|
385
|
-
/** Format the bridge-filter counts shown in text and diagram legends. */
|
|
386
|
-
export declare function formatAtlasFilterLegend(s: AtlasFilterStats | null): string | null;
|
|
387
380
|
/** Every bridge a view draws on, for running their witnesses before the view is built with the results. */
|
|
388
381
|
export declare function bridgeIdsOf(v: AtlasView): Set<string>;
|
|
389
382
|
/** Build a family-focused atlas map, applying relation and evidence filters to its bridges. */
|
|
390
383
|
export declare function buildFamilyView(api: Api, name: string, filter: AtlasFilter, results?: WitnessResults | null): FamilyView;
|
|
391
|
-
/** Format witness-result provenance and counts for a rendered atlas view. */
|
|
392
|
-
export declare function resultsLine(t: ResultsTally | undefined): string | null;
|
|
393
384
|
/** Render a focused route view as human-readable CLI output lines. */
|
|
394
385
|
export declare function routeText(v: RouteView): string[];
|
|
395
386
|
/** Render a family atlas view as human-readable CLI output lines. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_atlas-map.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/_atlas-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_atlas-map.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/_atlas-map.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OA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KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CA4B1C"}
|
|
@@ -34,28 +34,18 @@
|
|
|
34
34
|
*/
|
|
35
35
|
import { execFileSync } from 'node:child_process';
|
|
36
36
|
import { readFileSync } from 'node:fs';
|
|
37
|
-
import { join } from 'node:path';
|
|
38
|
-
import { fileURLToPath } from 'node:url';
|
|
39
37
|
import { CliError } from '../errors.js';
|
|
40
38
|
import { publishedUrl } from '../published-url.js';
|
|
39
|
+
import { repoRoot, STORED_RESULTS_PATH, storedResultsFile } from '../stored-results.js';
|
|
41
40
|
import { showInequality } from './regime.js';
|
|
42
41
|
import { claimReport, explainsRefusal, missingForComposite, routeClaim, selectRoute, transportReport, } from './_atlas-route.js';
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const ATLAS_SOURCE = `atlas (the models and bridges of every family, ${publishedUrl('src/atlas/families.ts')})`;
|
|
43
|
+
const LINK_SOURCE = 'AtlasModel.canonicalRefs';
|
|
45
44
|
const NO_LINK = 'no canonical equation recorded in its canonicalRefs (an absent link, not a finding that none exists; ' +
|
|
46
45
|
'nothing is inferred from shared quantities or names)';
|
|
47
46
|
const EPISTEMICS = 'bridges are recorded transformations between models; the equation links are only those a model records. ' +
|
|
48
47
|
'A route existing is not a warrant: the composed claim is.';
|
|
49
|
-
export const STORED_RESULTS_PATH = 'data/atlas/witness-results.json';
|
|
50
48
|
const ARTIFACT_CARRIES = 'the artifact records no commit or date of its own';
|
|
51
|
-
/** The repository root, when this module runs from a checkout (src/ or dist/). */
|
|
52
|
-
function repoRoot() {
|
|
53
|
-
return fileURLToPath(new URL('../../../', import.meta.url));
|
|
54
|
-
}
|
|
55
|
-
/** The absolute path `--stored` reads, which an experiment record hashes as an input. */
|
|
56
|
-
export function storedResultsFile() {
|
|
57
|
-
return join(repoRoot(), STORED_RESULTS_PATH);
|
|
58
|
-
}
|
|
59
49
|
function git(args, cwd) {
|
|
60
50
|
try {
|
|
61
51
|
return execFileSync('git', args, { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], timeout: 5000 }).trim();
|
|
@@ -427,8 +417,8 @@ const OBSERVABLE_MATCH = "a case-insensitive whole-word text match against each
|
|
|
427
417
|
'and the observable names of its declared bound translations; nothing is inferred from dimensions, quantities or ' +
|
|
428
418
|
'the transformation, and a bridge that records nothing about the observable is counted apart from one that records ' +
|
|
429
419
|
'it as not preserved';
|
|
430
|
-
function wordMatcher(term) {
|
|
431
|
-
const escaped =
|
|
420
|
+
function wordMatcher(api, term) {
|
|
421
|
+
const escaped = api.escapeRegExp(term);
|
|
432
422
|
const re = new RegExp(`(^|[^\\p{L}\\p{N}])${escaped}($|[^\\p{L}\\p{N}])`, 'iu');
|
|
433
423
|
return (text) => re.test(text);
|
|
434
424
|
}
|
|
@@ -437,7 +427,7 @@ export function buildObservableView(api, observable, filter, results = null) {
|
|
|
437
427
|
const term = observable.trim();
|
|
438
428
|
if (term.length < 2)
|
|
439
429
|
throw new CliError(`upt map: --observable='${observable}' must name an observable (two characters or more)`);
|
|
440
|
-
const hit = wordMatcher(term);
|
|
430
|
+
const hit = wordMatcher(api, term);
|
|
441
431
|
const models = allModels(api);
|
|
442
432
|
const rows = api.ATLAS_FAMILIES.flatMap((f) => f.bridges.map((b) => ({ family: f.family, b })));
|
|
443
433
|
const matched = rows.map(({ family, b }) => ({
|
|
@@ -551,7 +541,7 @@ function judge(b, f) {
|
|
|
551
541
|
return b.evidence.undecided.includes(f.evidence) ? 'undecided' : 'not-matching';
|
|
552
542
|
}
|
|
553
543
|
/** Format the bridge-filter counts shown in text and diagram legends. */
|
|
554
|
-
|
|
544
|
+
function formatAtlasFilterLegend(s) {
|
|
555
545
|
if (s === null)
|
|
556
546
|
return null;
|
|
557
547
|
const terms = [
|
|
@@ -655,7 +645,7 @@ function outcomeLine(r) {
|
|
|
655
645
|
`unresolved ${unresolved} · no result ${ids(r.notObserved)}`);
|
|
656
646
|
}
|
|
657
647
|
/** Format witness-result provenance and counts for a rendered atlas view. */
|
|
658
|
-
|
|
648
|
+
function resultsLine(t) {
|
|
659
649
|
if (t === undefined)
|
|
660
650
|
return null;
|
|
661
651
|
const w = t.witnesses;
|