universal-physics-tensor 10.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -36
- package/bin/upt.mjs +13 -1
- package/data/applied-cases.json +1892 -0
- package/data/applied-cases.schema.json +194 -0
- 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 +389 -230
- package/data/bridge-catalog.schema.json +45 -7
- package/data/units.json +6 -25
- 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 +9 -15
- 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 +35 -25
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +37 -25
- 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/catalog-checks.d.ts +10 -0
- package/dist/cases/catalog-checks.d.ts.map +1 -0
- package/dist/cases/catalog-checks.js +241 -0
- package/dist/cases/catalog-checks.js.map +1 -0
- package/dist/cases/catalog.d.ts +83 -0
- package/dist/cases/catalog.d.ts.map +1 -0
- package/dist/cases/catalog.js +118 -0
- package/dist/cases/catalog.js.map +1 -0
- package/dist/cases/engine.d.ts +13 -0
- package/dist/cases/engine.d.ts.map +1 -0
- package/dist/cases/engine.js +179 -0
- package/dist/cases/engine.js.map +1 -0
- package/dist/cases/index.d.ts.map +1 -1
- package/dist/cases/index.js +5 -7
- package/dist/cases/index.js.map +1 -1
- package/dist/cases/methods.d.ts +215 -0
- package/dist/cases/methods.d.ts.map +1 -0
- package/dist/cases/methods.js +743 -0
- package/dist/cases/methods.js.map +1 -0
- 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/types.d.ts +12 -0
- package/dist/cases/types.d.ts.map +1 -1
- package/dist/cases/types.js.map +1 -1
- package/dist/cli/args.d.ts +25 -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 +11 -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 +1 -0
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +9 -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 +122 -73
- 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 +67 -39
- 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 +24 -3
- 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 +7 -1
- 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 +84 -11
- 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/determination.d.ts +1 -0
- package/dist/cli/determination.d.ts.map +1 -1
- package/dist/cli/determination.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/flag-help.d.ts +1 -0
- package/dist/cli/flag-help.d.ts.map +1 -1
- package/dist/cli/flag-help.js +1 -0
- package/dist/cli/flag-help.js.map +1 -1
- package/dist/cli/graphs.d.ts +2 -0
- package/dist/cli/graphs.d.ts.map +1 -1
- package/dist/cli/graphs.js +1 -0
- package/dist/cli/graphs.js.map +1 -1
- package/dist/cli/main.d.ts +8 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +19 -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 +28 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +23 -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 +12 -9
- 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 +1 -0
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +8 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +36 -5
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +30 -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 +3 -3
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +11 -38
- 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/consequence.d.ts +15 -5
- package/dist/composition/consequence.d.ts.map +1 -1
- package/dist/composition/consequence.js +6 -4
- package/dist/composition/consequence.js.map +1 -1
- package/dist/composition/discovery.d.ts +129 -9
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +171 -67
- 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 +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +6 -15
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +26 -14
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +64 -72
- 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/grounding.d.ts.map +1 -1
- package/dist/composition/grounding.js +19 -7
- package/dist/composition/grounding.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 +7 -8
- package/dist/composition/mathts-quiet.d.ts.map +1 -1
- package/dist/composition/mathts-quiet.js +7 -16
- 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/own-equation-magnitude.d.ts +95 -0
- package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
- package/dist/composition/own-equation-magnitude.js +270 -0
- package/dist/composition/own-equation-magnitude.js.map +1 -0
- package/dist/composition/probe/backend-protocol.d.ts +3 -0
- package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
- package/dist/composition/probe/backend-protocol.js.map +1 -1
- package/dist/composition/probe/candidate-store.d.ts +1 -0
- package/dist/composition/probe/candidate-store.d.ts.map +1 -1
- package/dist/composition/probe/candidate-store.js +1 -0
- package/dist/composition/probe/candidate-store.js.map +1 -1
- package/dist/composition/probe/corpus.d.ts +8 -4
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +23 -12
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +18 -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 +7 -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 +2 -0
- 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 +7 -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 +30 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +58 -36
- 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 +25 -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 +5 -0
- package/dist/composition/probe/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +73 -24
- 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 +251 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +8 -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 +7 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +10 -7
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/run-manifest.d.ts +1 -0
- package/dist/composition/probe/run-manifest.d.ts.map +1 -1
- package/dist/composition/probe/run-manifest.js.map +1 -1
- package/dist/composition/probe/scalar-search.d.ts +50 -0
- package/dist/composition/probe/scalar-search.d.ts.map +1 -0
- package/dist/composition/probe/scalar-search.js +169 -0
- package/dist/composition/probe/scalar-search.js.map +1 -0
- package/dist/composition/probe/scoring.d.ts +1 -0
- package/dist/composition/probe/scoring.d.ts.map +1 -1
- package/dist/composition/probe/scoring.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 +235 -184
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +16 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +29 -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 +52 -12
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +107 -60
- 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 +29 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts +15 -0
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +12 -4
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/user-equation.d.ts +1 -0
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +3 -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 +42 -41
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +71 -51
- 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-ast-gradient.d.ts +27 -23
- package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-ast-gradient.js +75 -173
- package/dist/diff/bridge-ast-gradient.js.map +1 -1
- 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/ast-types.d.ts +15 -0
- package/dist/dimensional/ast-types.d.ts.map +1 -1
- package/dist/dimensional/ast-types.js.map +1 -1
- 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/curvature-composite.d.ts +1 -1
- package/dist/dimensional/curvature-composite.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 +24 -11
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +122 -130
- 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/mathts-unit-delegation.d.ts +29 -0
- package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
- package/dist/dimensional/mathts-unit-delegation.js +187 -0
- package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
- package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
- package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
- package/dist/dimensional/mathts-unit-wrapper.js +190 -0
- package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
- 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/scalar-lowering.d.ts +21 -0
- package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
- package/dist/dimensional/scalar-lowering.js +45 -0
- package/dist/dimensional/scalar-lowering.js.map +1 -0
- 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.d.ts +5 -1
- package/dist/dimensional/unit-data.d.ts.map +1 -1
- package/dist/dimensional/unit-data.js +30 -6
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/dimensional/units.d.ts +2 -0
- package/dist/dimensional/units.d.ts.map +1 -1
- package/dist/dimensional/units.js +59 -3
- package/dist/dimensional/units.js.map +1 -1
- package/dist/dimensional/validator.d.ts +2 -0
- package/dist/dimensional/validator.d.ts.map +1 -1
- package/dist/dimensional/validator.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/connection-lowering-helpers.d.ts +3 -1
- package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
- package/dist/numerical/connection-lowering-helpers.js +11 -15
- package/dist/numerical/connection-lowering-helpers.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/pderiv.d.ts.map +1 -1
- package/dist/numerical/pderiv.js +2 -6
- package/dist/numerical/pderiv.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 +11 -13
- 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/strides.d.ts +3 -2
- package/dist/numerical/strides.d.ts.map +1 -1
- package/dist/numerical/strides.js +3 -10
- package/dist/numerical/strides.js.map +1 -1
- 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 +9 -12
- package/dist/cases/brownian-sphere.d.ts +0 -68
- package/dist/cases/brownian-sphere.d.ts.map +0 -1
- package/dist/cases/brownian-sphere.js +0 -354
- package/dist/cases/brownian-sphere.js.map +0 -1
- package/dist/cases/damped-resonator.d.ts +0 -23
- package/dist/cases/damped-resonator.d.ts.map +0 -1
- package/dist/cases/damped-resonator.js +0 -224
- package/dist/cases/damped-resonator.js.map +0 -1
- package/dist/cases/kepler-rv.d.ts +0 -13
- package/dist/cases/kepler-rv.d.ts.map +0 -1
- package/dist/cases/kepler-rv.js +0 -172
- package/dist/cases/kepler-rv.js.map +0 -1
- package/dist/cases/lumped-cooling.d.ts +0 -46
- package/dist/cases/lumped-cooling.d.ts.map +0 -1
- package/dist/cases/lumped-cooling.js +0 -261
- package/dist/cases/lumped-cooling.js.map +0 -1
- package/dist/cases/resistor-noise.d.ts +0 -14
- package/dist/cases/resistor-noise.d.ts.map +0 -1
- package/dist/cases/resistor-noise.js +0 -215
- package/dist/cases/resistor-noise.js.map +0 -1
- package/dist/cases/skin-depth.d.ts +0 -21
- package/dist/cases/skin-depth.d.ts.map +0 -1
- package/dist/cases/skin-depth.js +0 -174
- package/dist/cases/skin-depth.js.map +0 -1
package/dist/cli/record.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/cli/record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAE,MAAM,EA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C,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAClI,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,IAAI,EAAE;YAAE,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/**\n * Experiment record and replay for the UPT CLI — the global options\n * `--record=FILE`, `--replay=FILE` and `--show-record=FILE`\n * (design: `docs/planning/Experiment-Record-Replay-Design-Note.md`).\n *\n * A record is JSON Lines, one `upt-record/2` entry per invocation, appended and\n * never rewritten, so a failed invocation stays next to the ones that\n * succeeded. Replay re-runs each entry in-process and keeps three outcomes\n * apart — reproduced, differs, not replayable — and reports environment\n * changes and record-integrity findings beside them, never folded into them.\n *\n * `main.ts` passes its dispatcher and the `cli-api` barrel in, so this module\n * neither imports the barrel nor re-enters the global-option parser.\n */\n\nimport { createHash } from 'node:crypto';\nimport { appendFileSync, closeSync, existsSync, mkdtempSync, openSync, readFileSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { basename, join } from 'node:path';\nimport type * as cliApi from '../cli-api.js';\nimport { parseArgs } from './args.js';\nimport { resolveCommand } from './command.js';\nimport { storedResultsFile } from './commands/_atlas-map.js';\nimport { CliError, UsageError } from './errors.js';\nimport { emitJson } from './output.js';\nimport { moduleSources, staticReach, type Attribution } from './record-reach.js';\nimport { constantTables, tableFingerprint, type ConstantTable } from './record-tables.js';\nimport { canonicalJson, captureEnvironment } from '../composition/canonical-json.js';\nimport { packageVersion, peerVersions } from './version.js';\n\n/** The output callbacks a recorded or replayed CLI invocation writes through. */\nexport type Io = {\n out: (line?: string) => void;\n err: (line?: string) => void;\n write: (s: string) => void;\n};\n\n/** A CLI dispatcher invoked with argv and an isolated output sink. */\nexport type Dispatch = (argv: string[], io: Io) => Promise<number>;\n\nexport const RECORD_SCHEMA = 'upt-record/2';\nconst SUPERSEDED_SCHEMA = 'upt-record/1';\n\n/** The toolchain, parser, peers and constants captured beside a CLI invocation. */\nexport interface RecordEnvironment {\n uptVersion: string;\n node: string;\n formulaParser: string;\n simplifier: boolean;\n peers: Record<string, string | null>;\n constantTables: Record<string, ConstantTable>;\n}\n\n/** The exit state and captured streams of one recorded CLI invocation. */\nexport interface RecordResult {\n exitCode: number | null;\n threw: string | null;\n stdout: string;\n stderr: string;\n stdoutSha256: string;\n stderrSha256: string;\n}\n\n/** One JSON-lines record entry for a CLI invocation and its replay inputs. */\nexport interface RecordEntry {\n schema: typeof RECORD_SCHEMA;\n recordedAt: string;\n argv: string[];\n argvSha256: string;\n parsed: { command: string; flags: Record<string, string[]>; positionals: string[] } | null;\n attribution: Attribution | null;\n environment: RecordEnvironment;\n result: RecordResult;\n artifacts: { path: string; sha256: string }[];\n /**\n * Files the invocation read, hashed before it ran (`null`: absent or unreadable then). Absent\n * from entries written before input files were hashed.\n */\n inputs?: RecordInput[];\n /** SHA-256 of every other field, serialised by {@link canonicalJson}. */\n entrySha256: string;\n}\n\n/** One input file an invocation read, hashed before it ran. */\nexport interface RecordInput {\n /** The flag that named the file, or `--problem observationsPath` for the file a problem names. */\n flag: string;\n path: string;\n sha256: string | null;\n}\n\nexport const sha256 = (s: string | Buffer): string => createHash('sha256').update(s).digest('hex');\n\nexport const argvFingerprint = (argv: unknown): string => sha256(canonicalJson(argv, 'record'));\n\n/** Hash a record entry after excluding its stored fingerprint field. */\nexport function entryFingerprint(entry: Partial<RecordEntry>): string {\n const { entrySha256: _, ...rest } = entry;\n return sha256(canonicalJson(rest, 'record'));\n}\n\n/** The record profile of {@link captureEnvironment}, fed from the CLI toolchain. */\nfunction recordEnvironment(api: typeof cliApi): Promise<RecordEnvironment> {\n return captureEnvironment('record', {\n uptVersion: packageVersion(),\n node: process.version,\n formulaParser: () => api.getFormulaParserKind(),\n simplifier: () => api.isSimplifierAvailable(),\n peers: () => peerVersions(),\n constantTables: async () => (await constantTables()).tables,\n });\n}\n\nasync function attribute(argv: string[]): Promise<Attribution | null> {\n const command = argv[0] === undefined ? undefined : resolveCommand(argv[0]);\n if (!command) return null;\n const { tables, kinds } = await constantTables();\n const reach = staticReach(command.name, tables, kinds);\n return reach && { ...reach, modules: moduleSources(command.name) ?? {} };\n}\n\nfunction parseInvocation(argv: string[]): RecordEntry['parsed'] {\n const [cmd, ...rest] = argv;\n const command = cmd === undefined ? undefined : resolveCommand(cmd);\n if (!command) return null;\n try {\n const { flags, positionals } = parseArgs(command.name, rest, command.flags);\n return { command: command.name, flags: Object.fromEntries(flags), positionals };\n } catch (e) {\n // An argument list the command refuses has no parsed form, and the entry records `null`.\n // Any other failure of the parser is a defect and is not recorded as a refused invocation.\n if (e instanceof UsageError) return null;\n throw e;\n }\n}\n\n/** The `probe` flags that name a file the invocation reads. */\nconst PROBE_INPUT_FLAGS = ['problem', 'h1', 'h2', 'bounds', 'data', 'replication'] as const;\n\n/** The stop reason a probe search reports when its wall-clock budget ran out, in text or JSON. */\nconst TIME_LIMIT_STATED = /(?:\\bstop: |\"stopReason\": \")time-limit\\b/;\n\nfunction hashFile(path: string): string | null {\n try {\n return sha256(readFileSync(path));\n } catch {\n // `null` is the record's one word for \"no bytes to hash then\" (`RecordInput.sha256`): the file\n // is absent or cannot be read, and replay compares that word, not the reason.\n return null;\n }\n}\n\n/** The observations file a problem file names, or null (also when the problem cannot be read). */\nfunction observationsOf(problem: string, api: typeof cliApi): string | null {\n try {\n const raw: unknown = JSON.parse(readFileSync(problem, 'utf8'));\n return typeof raw === 'object' && raw !== null && 'observationsPath' in raw && typeof raw.observationsPath === 'string'\n ? api.resolveObservationsPath({ observationsPath: raw.observationsPath }, problem)\n : null;\n } catch {\n // A problem file that is absent or is not JSON names no observations file here; the run\n // itself reports that file, and `readInputs` hashes the problem file apart from this.\n return null;\n }\n}\n\n/** The files an invocation reads, by rule from its parsed arguments; hashed as they are now. */\nfunction readInputs(parsed: RecordEntry['parsed'], api: typeof cliApi): RecordInput[] {\n if (!parsed) return [];\n const files: { flag: string; path: string }[] = [];\n if (parsed.command === 'probe') {\n for (const name of PROBE_INPUT_FLAGS) {\n const path = parsed.flags[name]?.[0] ?? '';\n if (path === '') continue;\n files.push({ flag: `--${name}`, path });\n const observations = name === 'problem' ? observationsOf(path, api) : null;\n if (observations !== null) files.push({ flag: '--problem observationsPath', path: observations });\n }\n }\n if ((parsed.command === 'atlas' || parsed.command === 'map') && parsed.flags.stored !== undefined) {\n files.push({ flag: '--stored', path: storedResultsFile() });\n }\n return files.map((f) => ({ ...f, sha256: hashFile(f.path) }));\n}\n\nconst short = (h: string): string => `${h.slice(0, 12)}…`;\n\n/**\n * Why an entry must not be re-run, or null. Declared by rule from the record and the files as\n * they are now, never inferred from a mismatch of the outputs.\n */\nfunction notReplayableReason(entry: RecordEntry, api: typeof cliApi): string | null {\n const parsed = parseInvocation(entry.argv);\n if (!parsed) return null;\n const out = parsed.flags.out?.[0] ?? '';\n if (out !== '' && (entry.artifacts ?? []).length === 0) {\n return `it was to write a file (--out=${out}) and wrote no file, so there is no artifact to compare a replay with`;\n }\n const worker = parsed.flags.worker?.[0] ?? '';\n if (parsed.command === 'probe' && worker !== '') {\n return `it ran an external worker (--worker=${worker}), whose output the record does not capture`;\n }\n const reads = entry.inputs;\n if (!Array.isArray(reads)) {\n const names = readInputs(parsed, api);\n if (names.length > 0) {\n return `it reads ${names.map((n) => `${n.path} (${n.flag})`).join(', ')} and was recorded before input files were hashed; record it again`;\n }\n } else {\n const changed: string[] = [];\n for (const i of reads) {\n const now = hashFile(i.path);\n if (now === i.sha256) continue;\n if (now === null) changed.push(`${i.path} (${i.flag}) is missing now`);\n else if (i.sha256 === null) changed.push(`${i.path} (${i.flag}) exists now and was absent at recording`);\n else changed.push(`${i.path} (${i.flag}) changed since recording (sha256 ${short(i.sha256)} -> ${short(now)})`);\n }\n if (changed.length > 0) return `an input it read differs from the recorded one: ${changed.join('; ')}`;\n }\n if (parsed.command === 'probe' && TIME_LIMIT_STATED.test(entry.result.stdout)) {\n return 'the recorded run stopped on its wall-clock budget (time-limit), so what it searched depends on the speed of the machine';\n }\n return null;\n}\n\nasync function runCaptured(\n dispatch: Dispatch,\n argv: string[],\n tee?: Io,\n): Promise<{ exitCode: number | null; threw: string | null; stdout: string; stderr: string; error?: unknown }> {\n let stdout = '';\n let stderr = '';\n const io: Io = {\n out: (line) => {\n stdout += (line ?? '') + '\\n';\n tee?.out(line);\n },\n err: (line) => {\n stderr += (line ?? '') + '\\n';\n tee?.err(line);\n },\n write: (s) => {\n stdout += s;\n tee?.write(s);\n },\n };\n try {\n return { exitCode: await dispatch(argv, io), threw: null, stdout, stderr };\n } catch (e) {\n return { exitCode: null, threw: e instanceof Error ? e.message : String(e), stdout, stderr, error: e };\n }\n}\n\n/** What a failed call said: an `Error`'s message, else the thrown value as text. */\nconst messageOf = (e: unknown): string => (e instanceof Error ? e.message : String(e));\n\nfunction assertAppendable(file: string): void {\n try {\n closeSync(openSync(file, 'a'));\n } catch (e) {\n throw new CliError(`upt: cannot append to record '${file}': ${messageOf(e)}`);\n }\n}\n\n/** Run `argv` exactly as without `--record`, then append its entry. An unexpected exception is\n * recorded and rethrown, so recording never changes what the caller sees. */\nexport async function recordInvocation(\n file: string,\n argv: string[],\n dispatch: Dispatch,\n io: Io,\n api: typeof cliApi,\n): Promise<number> {\n assertAppendable(file);\n const recordedAt = new Date().toISOString();\n const parsed = parseInvocation(argv);\n const inputs = readInputs(parsed, api);\n const run = await runCaptured(dispatch, argv, io);\n const artifacts: RecordEntry['artifacts'] = [];\n const outPath = parsed?.flags.out?.[0] ?? '';\n if (outPath !== '' && existsSync(outPath)) artifacts.push({ path: outPath, sha256: sha256(readFileSync(outPath)) });\n const entry: Omit<RecordEntry, 'entrySha256'> = {\n schema: RECORD_SCHEMA,\n recordedAt,\n argv,\n argvSha256: argvFingerprint(argv),\n parsed,\n attribution: await attribute(argv),\n environment: await recordEnvironment(api),\n result: {\n exitCode: run.exitCode,\n threw: run.threw,\n stdout: run.stdout,\n stderr: run.stderr,\n stdoutSha256: sha256(run.stdout),\n stderrSha256: sha256(run.stderr),\n },\n artifacts,\n inputs,\n };\n appendFileSync(file, JSON.stringify({ ...entry, entrySha256: entryFingerprint(entry) }) + '\\n');\n // `exitCode` is null exactly when the dispatcher threw, and then `error` holds what it threw.\n if (run.exitCode === null) throw run.error ?? new Error(run.threw ?? 'the invocation ended without an exit code');\n return run.exitCode;\n}\n\ntype Line = { line: number; entry: RecordEntry } | { line: number; error: string };\n\nfunction isEntry(v: unknown): v is RecordEntry {\n // `v` is any parsed JSON line. The cast only lets the property reads below type-check:\n // each one is guarded by the `typeof`/`Array.isArray` test on the same expression, and\n // `typeof e === 'object' && e !== null` comes first, so a non-object is never read.\n const e = v as RecordEntry;\n return (\n typeof e === 'object' &&\n e !== null &&\n e.schema === RECORD_SCHEMA &&\n Array.isArray(e.argv) &&\n e.argv.every((a) => typeof a === 'string') &&\n typeof e.environment === 'object' &&\n e.environment !== null &&\n typeof e.result === 'object' &&\n e.result !== null &&\n typeof e.result.stdout === 'string' &&\n typeof e.result.stderr === 'string' &&\n (typeof e.result.exitCode === 'number' || e.result.exitCode === null)\n );\n}\n\nfunction readRecord(file: string): Line[] {\n let text: string;\n try {\n text = readFileSync(file, 'utf8');\n } catch (e) {\n throw new CliError(`upt: cannot read record '${file}': ${messageOf(e)}`);\n }\n const lines: Line[] = [];\n text.split('\\n').forEach((raw, i) => {\n if (raw.trim() === '') return;\n let v: unknown;\n try {\n v = JSON.parse(raw);\n } catch (e) {\n // `JSON.parse` throws a SyntaxError for text that is not JSON; any other failure is a defect.\n if (!(e instanceof SyntaxError)) throw e;\n lines.push({ line: i + 1, error: `line ${i + 1} is not valid JSON` });\n return;\n }\n if (isEntry(v)) lines.push({ line: i + 1, entry: v });\n else if (typeof v === 'object' && v !== null && 'schema' in v && v.schema === SUPERSEDED_SCHEMA) {\n lines.push({\n line: i + 1,\n error: `line ${i + 1} is a ${SUPERSEDED_SCHEMA} entry, written before its arguments, the entry and each constant table were hashed; record it again`,\n });\n } else lines.push({ line: i + 1, error: `line ${i + 1} is not a ${RECORD_SCHEMA} entry` });\n });\n if (lines.length === 0) throw new CliError(`upt: record '${file}' holds no entries`);\n return lines;\n}\n\nconst SAFE_TOKEN = /^[A-Za-z0-9_\\-=.,:/+@%]+$/;\nconst shellQuote = (t: string): string => (SAFE_TOKEN.test(t) ? t : `'${t.replace(/'/g, `'\\\\''`)}'`);\nconst commandLine = (argv: string[]): string => ['$ upt', ...argv.map(shellQuote)].join(' ');\n\n/**\n * Whether the recorded command's code could read a changed constant, by the entry's static\n * attribution: an upper bound derived from the import graph at recording, not an observed read.\n */\nexport type Reach = 'reachable' | 'not-reachable' | 'unattributed';\n\n/** One runtime or reachable-constant fact that differs between recording and replay. */\nexport interface EnvironmentChange {\n fact: string;\n recorded: unknown;\n current: unknown;\n reach?: Reach;\n}\n\nfunction reachOf(attribution: Attribution | null | undefined, table: string, key?: string): Reach {\n if (!attribution || typeof attribution.tables !== 'object' || attribution.tables === null) return 'unattributed';\n const keys = attribution.tables[table];\n if (!Array.isArray(keys)) return 'not-reachable';\n return key === undefined || keys.includes('*') || keys.includes(key) ? 'reachable' : 'not-reachable';\n}\n\nfunction environmentChanges(\n recorded: Partial<RecordEnvironment>,\n live: RecordEnvironment,\n attribution: Attribution | null | undefined,\n): EnvironmentChange[] {\n const changes: EnvironmentChange[] = [];\n const cmp = (fact: string, a: unknown, b: unknown, reach?: Reach): void => {\n if (a !== b) changes.push({ fact, recorded: a ?? null, current: b ?? null, ...(reach ? { reach } : {}) });\n };\n cmp('uptVersion', recorded.uptVersion, live.uptVersion);\n cmp('node', recorded.node, live.node);\n cmp('formulaParser', recorded.formulaParser, live.formulaParser);\n cmp('simplifier', recorded.simplifier, live.simplifier);\n const recPeers = recorded.peers ?? {};\n for (const k of [...new Set([...Object.keys(recPeers), ...Object.keys(live.peers)])].sort()) {\n cmp(`peer ${k}`, recPeers[k], live.peers[k]);\n }\n const recTables = (typeof recorded.constantTables === 'object' && recorded.constantTables) || {};\n for (const name of [...new Set([...Object.keys(recTables), ...Object.keys(live.constantTables)])].sort()) {\n const a = recTables[name];\n const b = live.constantTables[name];\n if (!a || !b) {\n cmp(`table ${name}`, a ? 'present' : null, b ? 'present' : null, reachOf(attribution, name));\n continue;\n }\n const av = (typeof a.values === 'object' && a.values) || {};\n const changedReach: Reach[] = [];\n for (const k of [...new Set([...Object.keys(av), ...Object.keys(b.values)])].sort()) {\n if (av[k] === b.values[k]) continue;\n changedReach.push(reachOf(attribution, name, k));\n cmp(`constant ${name} ${k}`, av[k], b.values[k], changedReach[changedReach.length - 1]);\n }\n // A fingerprint change is reachable when a changed value is; with no changed value it is the table's.\n const tableReach =\n changedReach.length === 0 ? reachOf(attribution, name) : changedReach.includes('reachable') ? 'reachable' : changedReach[0];\n cmp(`table ${name} sha256`, a.sha256, b.sha256, tableReach);\n }\n return changes;\n}\n\nfunction integrityFindings(entry: RecordEntry): string[] {\n const findings: string[] = [];\n const hashOf = (field: string, recordedHash: unknown, actual: string): void => {\n if (typeof recordedHash !== 'string') findings.push(`entry has no ${field}`);\n else if (recordedHash !== actual) findings.push(`recorded ${field.replace(/Sha256$/, '')} does not match its recorded ${field}`);\n };\n hashOf('argvSha256', entry.argvSha256, argvFingerprint(entry.argv));\n const r = entry.result;\n if (sha256(r.stdout) !== r.stdoutSha256) findings.push('recorded stdout does not match its recorded stdoutSha256');\n if (sha256(r.stderr) !== r.stderrSha256) findings.push('recorded stderr does not match its recorded stderrSha256');\n const tables = entry.environment.constantTables;\n if (typeof tables !== 'object' || tables === null) findings.push('entry has no constantTables');\n else {\n for (const [name, t] of Object.entries(tables)) {\n // A record is read from disk, so a table may be `null` or lack `values` whatever its type says.\n const table: Partial<ConstantTable> | null = t;\n const values = table?.values;\n if (typeof values !== 'object' || values === null || tableFingerprint(values) !== table?.sha256) {\n findings.push(`recorded table ${name} does not match its recorded sha256`);\n }\n }\n }\n hashOf('entrySha256', entry.entrySha256, entryFingerprint(entry));\n return findings;\n}\n\nconst clip = (s: string): string => (s.length > 200 ? s.slice(0, 200) + '…' : s);\n\n/** One output stream, exit state or artifact difference found during replay. */\nexport interface StreamDifference {\n stream: 'exit' | 'stdout' | 'stderr' | 'artifact';\n /** The recorded path of a written file (`artifact` only). */\n path?: string;\n firstDifferingLine?: number;\n recorded: string;\n replayed: string;\n recordedSha256?: string;\n replayedSha256?: string;\n}\n\nfunction streamDifference(stream: 'stdout' | 'stderr', recorded: string, replayed: string): StreamDifference | null {\n if (recorded === replayed) return null;\n const a = recorded.split('\\n');\n const b = replayed.split('\\n');\n let i = 0;\n while (i < a.length && i < b.length && a[i] === b[i]) i++;\n return {\n stream,\n firstDifferingLine: i + 1,\n recorded: i < a.length ? clip(a[i]) : '<end of output>',\n replayed: i < b.length ? clip(b[i]) : '<end of output>',\n recordedSha256: sha256(recorded),\n replayedSha256: sha256(replayed),\n };\n}\n\nconst exitLabel = (code: number | null, threw: string | null): string =>\n code === null ? `threw: ${threw ?? 'unknown error'}` : `exit ${code}`;\n\n/** The replay classification for one record entry. */\nexport type ReplayOutcome = 'reproduced' | 'differs' | 'not-replayable';\n\n/** The replay report for one record entry, including environment and integrity findings. */\nexport interface ReplayEntryReport {\n line: number;\n argv: string[] | null;\n outcome: ReplayOutcome;\n reason?: string;\n exit?: { recorded: string; replayed: string };\n differences: StreamDifference[];\n /** Each file the entry wrote: its recorded hash and the hash of the replay's temporary copy. */\n artifacts?: { path: string; recorded: string; replayed: string | null }[];\n attribution: Attribution | null;\n /** Whether the sources of the modules the command loads were compared (entries with a command). */\n moduleSources?: 'compared' | 'not-recorded';\n environmentChanges: EnvironmentChange[];\n integrity: string[];\n}\n\n/** Each module the command loads whose source hash differs from the recorded one. */\nfunction moduleChanges(attribution: Attribution | null | undefined): {\n changes: EnvironmentChange[];\n moduleSources?: 'compared' | 'not-recorded';\n} {\n if (!attribution || typeof attribution.command !== 'string') return { changes: [] };\n const recorded = attribution.modules;\n if (typeof recorded !== 'object' || recorded === null) return { changes: [], moduleSources: 'not-recorded' };\n const live = moduleSources(attribution.command) ?? {};\n const changes: EnvironmentChange[] = [];\n for (const name of [...new Set([...Object.keys(recorded), ...Object.keys(live)])].sort()) {\n if (recorded[name] !== live[name]) {\n changes.push({ fact: `module ${name}`, recorded: recorded[name] ?? null, current: live[name] ?? null, reach: 'reachable' });\n }\n }\n return { changes, moduleSources: 'compared' };\n}\n\n/**\n * Re-run an entry that wrote a file with `--out` pointed at a temporary path instead, so the\n * recorded path is never overwritten; the temporary path is written back as the recorded one in\n * the replayed streams, and the file is returned by hash.\n */\nasync function runRedirected(\n dispatch: Dispatch,\n entry: RecordEntry,\n): Promise<{ run: Awaited<ReturnType<typeof runCaptured>>; artifact: { path: string; recorded: string; replayed: string | null } }> {\n const recorded = entry.artifacts[0];\n const dir = mkdtempSync(join(tmpdir(), 'upt-replay-'));\n const temp = join(dir, basename(recorded.path) || 'artifact');\n try {\n const argv = entry.argv.map((t) => (t.startsWith('--out=') ? `--out=${temp}` : t));\n const run = await runCaptured(dispatch, argv);\n const back = (s: string): string => s.split(temp).join(recorded.path);\n return {\n run: { ...run, stdout: back(run.stdout), stderr: back(run.stderr), threw: run.threw === null ? null : back(run.threw) },\n artifact: { path: recorded.path, recorded: recorded.sha256, replayed: hashFile(temp) },\n };\n } finally {\n rmSync(dir, { recursive: true, force: true });\n }\n}\n\n/** Replay every entry in a record file and report reproduced, differing and not-replayable entries. */\nexport async function replayRecord(\n file: string,\n json: boolean,\n dispatch: Dispatch,\n io: Io,\n api: typeof cliApi,\n): Promise<number> {\n const lines = readRecord(file);\n const live = await recordEnvironment(api);\n const reports: ReplayEntryReport[] = [];\n for (const l of lines) {\n if ('error' in l) {\n reports.push({\n line: l.line,\n argv: null,\n outcome: 'not-replayable',\n reason: l.error,\n differences: [],\n attribution: null,\n environmentChanges: [],\n integrity: [],\n });\n continue;\n }\n const { entry } = l;\n const modules = moduleChanges(entry.attribution);\n const base = {\n line: l.line,\n argv: entry.argv,\n attribution: entry.attribution ?? null,\n ...(modules.moduleSources ? { moduleSources: modules.moduleSources } : {}),\n environmentChanges: [...environmentChanges(entry.environment, live, entry.attribution), ...modules.changes],\n integrity: integrityFindings(entry),\n };\n const reason = notReplayableReason(entry, api);\n if (reason) {\n reports.push({ ...base, outcome: 'not-replayable', reason, differences: [] });\n continue;\n }\n const writes = (entry.artifacts ?? []).length > 0 && (parseInvocation(entry.argv)?.flags.out?.[0] ?? '') !== '';\n const { run, artifact } = writes\n ? await runRedirected(dispatch, entry)\n : { run: await runCaptured(dispatch, entry.argv), artifact: null };\n if (parseInvocation(entry.argv)?.command === 'probe' && TIME_LIMIT_STATED.test(run.stdout)) {\n reports.push({\n ...base,\n outcome: 'not-replayable',\n reason:\n 'the replay stopped on its wall-clock budget (time-limit) and the recorded run did not, so the two ran ' +\n 'different searches; nothing was compared',\n differences: [],\n });\n continue;\n }\n const recordedExit = exitLabel(entry.result.exitCode, entry.result.threw ?? null);\n const replayedExit = exitLabel(run.exitCode, run.threw);\n const differences: StreamDifference[] = [];\n if (recordedExit !== replayedExit) differences.push({ stream: 'exit', recorded: recordedExit, replayed: replayedExit });\n for (const d of [\n streamDifference('stdout', entry.result.stdout, run.stdout),\n streamDifference('stderr', entry.result.stderr, run.stderr),\n ]) {\n if (d) differences.push(d);\n }\n if (artifact && artifact.recorded !== artifact.replayed) {\n differences.push({ stream: 'artifact', path: artifact.path, recorded: artifact.recorded, replayed: artifact.replayed ?? '<no file>' });\n }\n reports.push({\n ...base,\n outcome: differences.length === 0 ? 'reproduced' : 'differs',\n exit: { recorded: recordedExit, replayed: replayedExit },\n differences,\n ...(artifact ? { artifacts: [artifact] } : {}),\n });\n }\n\n const count = (o: ReplayOutcome): number => reports.filter((r) => r.outcome === o).length;\n const summary = {\n entries: reports.length,\n reproduced: count('reproduced'),\n differs: count('differs'),\n notReplayable: count('not-replayable'),\n environmentChanged: reports.filter((r) => r.environmentChanges.length > 0).length,\n integrityFindings: reports.reduce((n, r) => n + r.integrity.length, 0),\n };\n const status =\n summary.differs > 0 ? 3 : summary.notReplayable + summary.environmentChanged + summary.integrityFindings > 0 ? 1 : 0;\n\n if (json) {\n emitJson({ command: 'replay', options: { file }, result: { environment: live, entries: reports, summary } }, io.write);\n return status;\n }\n\n const { out } = io;\n out(`upt replay — ${file}: ${reports.length} ${reports.length === 1 ? 'entry' : 'entries'}`);\n out(`environment now: ${describeEnvironment(live)}`);\n for (const r of reports) {\n out(`[line ${r.line}] ${r.argv ? commandLine(r.argv) : '(unreadable)'}`);\n if (r.outcome === 'not-replayable') {\n out(` NOT REPLAYABLE — ${r.reason}`);\n } else if (r.outcome === 'reproduced') {\n out(\n ` reproduced — ${r.exit!.replayed}, stdout and stderr identical` +\n (r.artifacts ? `, and the file it wrote (written to a temporary path, not over ${r.artifacts[0].path})` : ''),\n );\n } else {\n out(` DIFFERS — ${r.differences.map((d) => d.stream).join(', ')}`);\n for (const d of r.differences) {\n if (d.stream === 'exit') {\n out(` exit: recorded ${d.recorded}, replayed ${d.replayed}`);\n } else if (d.stream === 'artifact') {\n out(` artifact ${d.path}: recorded sha256 ${d.recorded}, replayed ${d.replayed} (written to a temporary path)`);\n } else {\n out(` ${d.stream}: first difference at line ${d.firstDifferingLine}`);\n out(` recorded: ${d.recorded}`);\n out(` replayed: ${d.replayed}`);\n }\n }\n }\n if (r.environmentChanges.length > 0) {\n out(' environment changed since recording:');\n for (const c of r.environmentChanges) {\n out(` ${c.fact}: ${JSON.stringify(c.recorded)} -> ${JSON.stringify(c.current)}${reachNote(c.reach, r.attribution?.command)}`);\n }\n }\n if (r.moduleSources === 'not-recorded') {\n out(' module sources: not recorded in this entry, so a changed literal a module keeps private would go unseen');\n }\n for (const f of r.integrity) out(` record integrity: ${f} (the record was edited after it was written)`);\n }\n out(\n `summary: ${summary.reproduced} reproduced, ${summary.differs} differ, ${summary.notReplayable} not replayable; ` +\n `environment changed for ${summary.environmentChanged} of ${summary.entries}; ` +\n `${summary.integrityFindings} integrity finding${summary.integrityFindings === 1 ? '' : 's'}`,\n );\n return status;\n}\n\nfunction reachNote(reach: Reach | undefined, command: string | undefined): string {\n if (reach === 'reachable') return ` — reachable from '${command}' (static upper bound, not an observed read)`;\n if (reach === 'not-reachable') return ` — not reachable from '${command}' by static import analysis`;\n if (reach === 'unattributed') return ' — no attribution (the entry ran no command module)';\n return '';\n}\n\nfunction describeEnvironment(env: Partial<RecordEnvironment>): string {\n const peers = Object.entries(env.peers ?? {})\n .map(([k, v]) => `${k} ${v ?? 'absent'}`)\n .join(', ');\n const tables = (typeof env.constantTables === 'object' && env.constantTables) || {};\n const combined = sha256(\n canonicalJson(\n Object.fromEntries(Object.entries(tables).map(([k, t]) => [k, t?.sha256])),\n 'record',\n ),\n );\n return (\n `upt ${env.uptVersion}, node ${env.node}, formula parser ${env.formulaParser}, ` +\n `simplifier ${env.simplifier ? 'available' : 'unavailable'}, ` +\n `${Object.keys(tables).length} constant tables (sha256 of their fingerprints ${combined.slice(0, 12)}…)` +\n (peers ? `\\n peers: ${peers}` : '')\n );\n}\n\n/** Render a record file's entries without replaying them. */\nexport function showRecord(file: string, json: boolean, io: Io): number {\n const lines = readRecord(file);\n if (json) {\n emitJson(\n {\n command: 'show-record',\n options: { file },\n result: lines.map((l) => ('error' in l ? { line: l.line, error: l.error } : { line: l.line, ...l.entry })),\n },\n io.write,\n );\n return 0;\n }\n const { out } = io;\n const block = (text: string, mark: string): void => {\n if (text !== '') for (const s of text.replace(/\\n$/, '').split('\\n')) out(` ${mark} ${s}`);\n };\n out(`upt record — ${file}: ${lines.length} ${lines.length === 1 ? 'entry' : 'entries'}`);\n let lastEnv = '';\n for (const l of lines) {\n if ('error' in l) {\n out(`[line ${l.line}] unreadable: ${l.error}`);\n continue;\n }\n const { entry } = l;\n const env = JSON.stringify(entry.environment);\n if (env !== lastEnv) {\n out(`environment: ${describeEnvironment(entry.environment)}`);\n lastEnv = env;\n }\n out(`[line ${l.line}] ${commandLine(entry.argv)} (${exitLabel(entry.result.exitCode, entry.result.threw ?? null)}; recorded ${entry.recordedAt})`);\n block(entry.result.stdout, '|');\n block(entry.result.stderr, '!');\n for (const i of entry.inputs ?? []) out(` read ${i.path} (${i.flag}; ${i.sha256 === null ? 'absent' : `sha256 ${i.sha256}`})`);\n for (const a of entry.artifacts ?? []) out(` wrote ${a.path} (sha256 ${a.sha256})`);\n }\n return 0;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/cli/record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAY5D,MAAM,aA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IAAI,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,cAAc,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC;QACrJ,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE;YAAE,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAClI,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,IAAI,EAAE;YAAE,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["/**\n * Experiment record and replay for the UPT CLI — the global options\n * `--record=FILE`, `--replay=FILE` and `--show-record=FILE`\n * (design: `docs/planning/Experiment-Record-Replay-Design-Note.md`).\n *\n * A record is JSON Lines, one `upt-record/2` entry per invocation, appended and\n * never rewritten, so a failed invocation stays next to the ones that\n * succeeded. Replay re-runs each entry in-process and keeps three outcomes\n * apart — reproduced, differs, not replayable — and reports environment\n * changes and record-integrity findings beside them, never folded into them.\n *\n * `main.ts` passes its dispatcher and the `cli-api` barrel in, so this module\n * neither imports the barrel nor re-enters the global-option parser.\n */\n\nimport { readJsonFile } from '../core/data-file.js';\nimport { sha256Hex } from '../core/hash.js';\nimport { appendFileSync, closeSync, existsSync, mkdtempSync, openSync, readFileSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { basename, join } from 'node:path';\nimport type * as cliApi from '../cli-api.js';\nimport { parseArgs } from './args.js';\nimport { resolveCommand } from './command.js';\nimport { storedResultsFile } from './stored-results.js';\nimport { CliError, UsageError } from './errors.js';\nimport { emitJson } from './output.js';\nimport { moduleSources, staticReach, type Attribution } from './record-reach.js';\nimport { constantTables, tableFingerprint, type ConstantTable } from './record-tables.js';\nimport { canonicalJson, captureEnvironment } from '../composition/canonical-json.js';\nimport { packageVersion, peerVersions } from './version.js';\n\n/** The output callbacks a recorded or replayed CLI invocation writes through. */\nexport type Io = {\n out: (line?: string) => void;\n err: (line?: string) => void;\n write: (s: string) => void;\n};\n\n/** A CLI dispatcher invoked with argv and an isolated output sink. */\nexport type Dispatch = (argv: string[], io: Io) => Promise<number>;\n\nconst RECORD_SCHEMA = 'upt-record/2';\nconst SUPERSEDED_SCHEMA = 'upt-record/1';\n\n/** The toolchain, parser, peers and constants captured beside a CLI invocation. */\nexport interface RecordEnvironment {\n uptVersion: string;\n node: string;\n formulaParser: string;\n simplifier: boolean;\n peers: Record<string, string | null>;\n constantTables: Record<string, ConstantTable>;\n}\n\n/** The exit state and captured streams of one recorded CLI invocation. */\nexport interface RecordResult {\n exitCode: number | null;\n threw: string | null;\n stdout: string;\n stderr: string;\n stdoutSha256: string;\n stderrSha256: string;\n}\n\n/** One JSON-lines record entry for a CLI invocation and its replay inputs. */\nexport interface RecordEntry {\n schema: 'upt-record/2';\n recordedAt: string;\n argv: string[];\n argvSha256: string;\n parsed: { command: string; flags: Record<string, string[]>; positionals: string[] } | null;\n attribution: Attribution | null;\n environment: RecordEnvironment;\n result: RecordResult;\n artifacts: { path: string; sha256: string }[];\n /**\n * Files the invocation read, hashed before it ran (`null`: absent or unreadable then). Absent\n * from entries written before input files were hashed.\n */\n inputs?: RecordInput[];\n /** SHA-256 of every other field, serialised by {@link canonicalJson}. */\n entrySha256: string;\n}\n\n/** One input file an invocation read, hashed before it ran. */\nexport interface RecordInput {\n /** The flag that named the file, or `--problem observationsPath` for the file a problem names. */\n flag: string;\n path: string;\n sha256: string | null;\n}\n\nexport const sha256 = (s: string | Buffer): string => sha256Hex(s);\n\nconst argvFingerprint = (argv: unknown): string => sha256(canonicalJson(argv, 'record'));\n\n/** Hash a record entry after excluding its stored fingerprint field. */\nfunction entryFingerprint(entry: Partial<RecordEntry>): string {\n const { entrySha256: _, ...rest } = entry;\n return sha256(canonicalJson(rest, 'record'));\n}\n\n/** The record profile of {@link captureEnvironment}, fed from the CLI toolchain. */\nfunction recordEnvironment(api: typeof cliApi): Promise<RecordEnvironment> {\n return captureEnvironment('record', {\n uptVersion: packageVersion(),\n node: process.version,\n formulaParser: () => api.getFormulaParserKind(),\n simplifier: () => api.isSimplifierAvailable(),\n peers: () => peerVersions(),\n constantTables: async () => (await constantTables()).tables,\n });\n}\n\nasync function attribute(argv: string[]): Promise<Attribution | null> {\n const command = argv[0] === undefined ? undefined : resolveCommand(argv[0]);\n if (!command) return null;\n const { tables, kinds } = await constantTables();\n const reach = staticReach(command.name, tables, kinds);\n return reach && { ...reach, modules: moduleSources(command.name) ?? {} };\n}\n\nfunction parseInvocation(argv: string[]): RecordEntry['parsed'] {\n const [cmd, ...rest] = argv;\n const command = cmd === undefined ? undefined : resolveCommand(cmd);\n if (!command) return null;\n try {\n const { flags, positionals } = parseArgs(command.name, rest, command.flags, command.positionals);\n return { command: command.name, flags: Object.fromEntries(flags), positionals };\n } catch (e) {\n // An argument list the command refuses has no parsed form, and the entry records `null`.\n // Any other failure of the parser is a defect and is not recorded as a refused invocation.\n if (e instanceof UsageError) return null;\n throw e;\n }\n}\n\n/** The `probe` flags that name a file the invocation reads. */\nconst PROBE_INPUT_FLAGS = ['problem', 'h1', 'h2', 'bounds', 'data', 'replication'] as const;\n\n/** The stop reason a probe search reports when its wall-clock budget ran out, in text or JSON. */\nconst TIME_LIMIT_STATED = /(?:\\bstop: |\"stopReason\": \")time-limit\\b/;\n\nfunction hashFile(path: string): string | null {\n try {\n return sha256(readFileSync(path));\n } catch {\n // `null` is the record's one word for \"no bytes to hash then\" (`RecordInput.sha256`): the file\n // is absent or cannot be read, and replay compares that word, not the reason.\n return null;\n }\n}\n\n/** The observations file a problem file names, or null (also when the problem cannot be read). */\nfunction observationsOf(problem: string, api: typeof cliApi): string | null {\n try {\n const raw: unknown = readJsonFile(problem);\n return typeof raw === 'object' && raw !== null && 'observationsPath' in raw && typeof raw.observationsPath === 'string'\n ? api.resolveObservationsPath({ observationsPath: raw.observationsPath }, problem)\n : null;\n } catch {\n // A problem file that is absent or is not JSON names no observations file here; the run\n // itself reports that file, and `readInputs` hashes the problem file apart from this.\n return null;\n }\n}\n\n/** The files an invocation reads, by rule from its parsed arguments; hashed as they are now. */\nfunction readInputs(parsed: RecordEntry['parsed'], api: typeof cliApi): RecordInput[] {\n if (!parsed) return [];\n const files: { flag: string; path: string }[] = [];\n if (parsed.command === 'probe') {\n for (const name of PROBE_INPUT_FLAGS) {\n const path = parsed.flags[name]?.[0] ?? '';\n if (path === '') continue;\n files.push({ flag: `--${name}`, path });\n const observations = name === 'problem' ? observationsOf(path, api) : null;\n if (observations !== null) files.push({ flag: '--problem observationsPath', path: observations });\n }\n }\n if ((parsed.command === 'atlas' || parsed.command === 'map') && parsed.flags.stored !== undefined) {\n files.push({ flag: '--stored', path: storedResultsFile() });\n }\n return files.map((f) => ({ ...f, sha256: hashFile(f.path) }));\n}\n\nconst short = (h: string): string => `${h.slice(0, 12)}…`;\n\n/**\n * Why an entry must not be re-run, or null. Declared by rule from the record and the files as\n * they are now, never inferred from a mismatch of the outputs.\n */\nfunction notReplayableReason(entry: RecordEntry, api: typeof cliApi): string | null {\n const parsed = parseInvocation(entry.argv);\n if (!parsed) return null;\n const out = parsed.flags.out?.[0] ?? '';\n if (out !== '' && (entry.artifacts ?? []).length === 0) {\n return `it was to write a file (--out=${out}) and wrote no file, so there is no artifact to compare a replay with`;\n }\n const worker = parsed.flags.worker?.[0] ?? '';\n if (parsed.command === 'probe' && worker !== '') {\n return `it ran an external worker (--worker=${worker}), whose output the record does not capture`;\n }\n const reads = entry.inputs;\n if (!Array.isArray(reads)) {\n const names = readInputs(parsed, api);\n if (names.length > 0) {\n return `it reads ${names.map((n) => `${n.path} (${n.flag})`).join(', ')} and was recorded before input files were hashed; record it again`;\n }\n } else {\n const changed: string[] = [];\n for (const i of reads) {\n const now = hashFile(i.path);\n if (now === i.sha256) continue;\n if (now === null) changed.push(`${i.path} (${i.flag}) is missing now`);\n else if (i.sha256 === null) changed.push(`${i.path} (${i.flag}) exists now and was absent at recording`);\n else changed.push(`${i.path} (${i.flag}) changed since recording (sha256 ${short(i.sha256)} -> ${short(now)})`);\n }\n if (changed.length > 0) return `an input it read differs from the recorded one: ${changed.join('; ')}`;\n }\n if (parsed.command === 'probe' && TIME_LIMIT_STATED.test(entry.result.stdout)) {\n return 'the recorded run stopped on its wall-clock budget (time-limit), so what it searched depends on the speed of the machine';\n }\n return null;\n}\n\nasync function runCaptured(\n dispatch: Dispatch,\n argv: string[],\n tee?: Io,\n): Promise<{ exitCode: number | null; threw: string | null; stdout: string; stderr: string; error?: unknown }> {\n let stdout = '';\n let stderr = '';\n const io: Io = {\n out: (line) => {\n stdout += (line ?? '') + '\\n';\n tee?.out(line);\n },\n err: (line) => {\n stderr += (line ?? '') + '\\n';\n tee?.err(line);\n },\n write: (s) => {\n stdout += s;\n tee?.write(s);\n },\n };\n try {\n return { exitCode: await dispatch(argv, io), threw: null, stdout, stderr };\n } catch (e) {\n return { exitCode: null, threw: e instanceof Error ? e.message : String(e), stdout, stderr, error: e };\n }\n}\n\n/** What a failed call said: an `Error`'s message, else the thrown value as text. */\nconst messageOf = (e: unknown): string => (e instanceof Error ? e.message : String(e));\n\nfunction assertAppendable(file: string): void {\n try {\n closeSync(openSync(file, 'a'));\n } catch (e) {\n throw new CliError(`upt: cannot append to record '${file}': ${messageOf(e)}`);\n }\n}\n\n/** Run `argv` exactly as without `--record`, then append its entry. An unexpected exception is\n * recorded and rethrown, so recording never changes what the caller sees. */\nexport async function recordInvocation(\n file: string,\n argv: string[],\n dispatch: Dispatch,\n io: Io,\n api: typeof cliApi,\n): Promise<number> {\n assertAppendable(file);\n const recordedAt = new Date().toISOString();\n const parsed = parseInvocation(argv);\n const inputs = readInputs(parsed, api);\n const run = await runCaptured(dispatch, argv, io);\n const artifacts: RecordEntry['artifacts'] = [];\n const outPath = parsed?.flags.out?.[0] ?? '';\n if (outPath !== '' && existsSync(outPath)) artifacts.push({ path: outPath, sha256: sha256(readFileSync(outPath)) });\n const entry: Omit<RecordEntry, 'entrySha256'> = {\n schema: RECORD_SCHEMA,\n recordedAt,\n argv,\n argvSha256: argvFingerprint(argv),\n parsed,\n attribution: await attribute(argv),\n environment: await recordEnvironment(api),\n result: {\n exitCode: run.exitCode,\n threw: run.threw,\n stdout: run.stdout,\n stderr: run.stderr,\n stdoutSha256: sha256(run.stdout),\n stderrSha256: sha256(run.stderr),\n },\n artifacts,\n inputs,\n };\n appendFileSync(file, JSON.stringify({ ...entry, entrySha256: entryFingerprint(entry) }) + '\\n');\n // `exitCode` is null exactly when the dispatcher threw, and then `error` holds what it threw.\n if (run.exitCode === null) throw run.error ?? new Error(run.threw ?? 'the invocation ended without an exit code');\n return run.exitCode;\n}\n\ntype Line = { line: number; entry: RecordEntry } | { line: number; error: string };\n\nfunction isEntry(v: unknown): v is RecordEntry {\n // `v` is any parsed JSON line. The cast only lets the property reads below type-check:\n // each one is guarded by the `typeof`/`Array.isArray` test on the same expression, and\n // `typeof e === 'object' && e !== null` comes first, so a non-object is never read.\n const e = v as RecordEntry;\n return (\n typeof e === 'object' &&\n e !== null &&\n e.schema === RECORD_SCHEMA &&\n Array.isArray(e.argv) &&\n e.argv.every((a) => typeof a === 'string') &&\n typeof e.environment === 'object' &&\n e.environment !== null &&\n typeof e.result === 'object' &&\n e.result !== null &&\n typeof e.result.stdout === 'string' &&\n typeof e.result.stderr === 'string' &&\n (typeof e.result.exitCode === 'number' || e.result.exitCode === null)\n );\n}\n\nfunction readRecord(file: string): Line[] {\n let text: string;\n try {\n text = readFileSync(file, 'utf8');\n } catch (e) {\n throw new CliError(`upt: cannot read record '${file}': ${messageOf(e)}`);\n }\n const lines: Line[] = [];\n text.split('\\n').forEach((raw, i) => {\n if (raw.trim() === '') return;\n let v: unknown;\n try {\n v = JSON.parse(raw);\n } catch (e) {\n // `JSON.parse` throws a SyntaxError for text that is not JSON; any other failure is a defect.\n if (!(e instanceof SyntaxError)) throw e;\n lines.push({ line: i + 1, error: `line ${i + 1} is not valid JSON` });\n return;\n }\n if (isEntry(v)) lines.push({ line: i + 1, entry: v });\n else if (typeof v === 'object' && v !== null && 'schema' in v && v.schema === SUPERSEDED_SCHEMA) {\n lines.push({\n line: i + 1,\n error: `line ${i + 1} is a ${SUPERSEDED_SCHEMA} entry, written before its arguments, the entry and each constant table were hashed; record it again`,\n });\n } else lines.push({ line: i + 1, error: `line ${i + 1} is not a ${RECORD_SCHEMA} entry` });\n });\n if (lines.length === 0) throw new CliError(`upt: record '${file}' holds no entries`);\n return lines;\n}\n\nconst SAFE_TOKEN = /^[A-Za-z0-9_\\-=.,:/+@%]+$/;\nconst shellQuote = (t: string): string => (SAFE_TOKEN.test(t) ? t : `'${t.replace(/'/g, `'\\\\''`)}'`);\nconst commandLine = (argv: string[]): string => ['$ upt', ...argv.map(shellQuote)].join(' ');\n\n/**\n * Whether the recorded command's code could read a changed constant, by the entry's static\n * attribution: an upper bound derived from the import graph at recording, not an observed read.\n */\nexport type Reach = 'reachable' | 'not-reachable' | 'unattributed';\n\n/** One runtime or reachable-constant fact that differs between recording and replay. */\nexport interface EnvironmentChange {\n fact: string;\n recorded: unknown;\n current: unknown;\n reach?: Reach;\n}\n\nfunction reachOf(attribution: Attribution | null | undefined, table: string, key?: string): Reach {\n if (!attribution || typeof attribution.tables !== 'object' || attribution.tables === null) return 'unattributed';\n const keys = attribution.tables[table];\n if (!Array.isArray(keys)) return 'not-reachable';\n return key === undefined || keys.includes('*') || keys.includes(key) ? 'reachable' : 'not-reachable';\n}\n\nfunction environmentChanges(\n recorded: Partial<RecordEnvironment>,\n live: RecordEnvironment,\n attribution: Attribution | null | undefined,\n): EnvironmentChange[] {\n const changes: EnvironmentChange[] = [];\n const cmp = (fact: string, a: unknown, b: unknown, reach?: Reach): void => {\n if (a !== b) changes.push({ fact, recorded: a ?? null, current: b ?? null, ...(reach ? { reach } : {}) });\n };\n cmp('uptVersion', recorded.uptVersion, live.uptVersion);\n cmp('node', recorded.node, live.node);\n cmp('formulaParser', recorded.formulaParser, live.formulaParser);\n cmp('simplifier', recorded.simplifier, live.simplifier);\n const recPeers = recorded.peers ?? {};\n for (const k of [...new Set([...Object.keys(recPeers), ...Object.keys(live.peers)])].sort()) {\n cmp(`peer ${k}`, recPeers[k], live.peers[k]);\n }\n const recTables = (typeof recorded.constantTables === 'object' && recorded.constantTables) || {};\n for (const name of [...new Set([...Object.keys(recTables), ...Object.keys(live.constantTables)])].sort()) {\n const a = recTables[name];\n const b = live.constantTables[name];\n if (!a || !b) {\n cmp(`table ${name}`, a ? 'present' : null, b ? 'present' : null, reachOf(attribution, name));\n continue;\n }\n const av = (typeof a.values === 'object' && a.values) || {};\n const changedReach: Reach[] = [];\n for (const k of [...new Set([...Object.keys(av), ...Object.keys(b.values)])].sort()) {\n if (av[k] === b.values[k]) continue;\n changedReach.push(reachOf(attribution, name, k));\n cmp(`constant ${name} ${k}`, av[k], b.values[k], changedReach[changedReach.length - 1]);\n }\n // A fingerprint change is reachable when a changed value is; with no changed value it is the table's.\n const tableReach =\n changedReach.length === 0 ? reachOf(attribution, name) : changedReach.includes('reachable') ? 'reachable' : changedReach[0];\n cmp(`table ${name} sha256`, a.sha256, b.sha256, tableReach);\n }\n return changes;\n}\n\nfunction integrityFindings(entry: RecordEntry): string[] {\n const findings: string[] = [];\n const hashOf = (field: string, recordedHash: unknown, actual: string): void => {\n if (typeof recordedHash !== 'string') findings.push(`entry has no ${field}`);\n else if (recordedHash !== actual) findings.push(`recorded ${field.replace(/Sha256$/, '')} does not match its recorded ${field}`);\n };\n hashOf('argvSha256', entry.argvSha256, argvFingerprint(entry.argv));\n const r = entry.result;\n if (sha256(r.stdout) !== r.stdoutSha256) findings.push('recorded stdout does not match its recorded stdoutSha256');\n if (sha256(r.stderr) !== r.stderrSha256) findings.push('recorded stderr does not match its recorded stderrSha256');\n const tables = entry.environment.constantTables;\n if (typeof tables !== 'object' || tables === null) findings.push('entry has no constantTables');\n else {\n for (const [name, t] of Object.entries(tables)) {\n // A record is read from disk, so a table may be `null` or lack `values` whatever its type says.\n const table: Partial<ConstantTable> | null = t;\n const values = table?.values;\n if (typeof values !== 'object' || values === null || tableFingerprint(values) !== table?.sha256) {\n findings.push(`recorded table ${name} does not match its recorded sha256`);\n }\n }\n }\n hashOf('entrySha256', entry.entrySha256, entryFingerprint(entry));\n return findings;\n}\n\nconst clip = (s: string): string => (s.length > 200 ? s.slice(0, 200) + '…' : s);\n\n/** One output stream, exit state or artifact difference found during replay. */\nexport interface StreamDifference {\n stream: 'exit' | 'stdout' | 'stderr' | 'artifact';\n /** The recorded path of a written file (`artifact` only). */\n path?: string;\n firstDifferingLine?: number;\n recorded: string;\n replayed: string;\n recordedSha256?: string;\n replayedSha256?: string;\n}\n\nfunction streamDifference(stream: 'stdout' | 'stderr', recorded: string, replayed: string): StreamDifference | null {\n if (recorded === replayed) return null;\n const a = recorded.split('\\n');\n const b = replayed.split('\\n');\n let i = 0;\n while (i < a.length && i < b.length && a[i] === b[i]) i++;\n return {\n stream,\n firstDifferingLine: i + 1,\n recorded: i < a.length ? clip(a[i]) : '<end of output>',\n replayed: i < b.length ? clip(b[i]) : '<end of output>',\n recordedSha256: sha256(recorded),\n replayedSha256: sha256(replayed),\n };\n}\n\nconst exitLabel = (code: number | null, threw: string | null): string =>\n code === null ? `threw: ${threw ?? 'unknown error'}` : `exit ${code}`;\n\n/** The replay classification for one record entry. */\nexport type ReplayOutcome = 'reproduced' | 'differs' | 'not-replayable';\n\n/** The replay report for one record entry, including environment and integrity findings. */\nexport interface ReplayEntryReport {\n line: number;\n argv: string[] | null;\n outcome: ReplayOutcome;\n reason?: string;\n exit?: { recorded: string; replayed: string };\n differences: StreamDifference[];\n /** Each file the entry wrote: its recorded hash and the hash of the replay's temporary copy. */\n artifacts?: { path: string; recorded: string; replayed: string | null }[];\n attribution: Attribution | null;\n /** Whether the sources of the modules the command loads were compared (entries with a command). */\n moduleSources?: 'compared' | 'not-recorded';\n environmentChanges: EnvironmentChange[];\n integrity: string[];\n}\n\n/** Each module the command loads whose source hash differs from the recorded one. */\nfunction moduleChanges(attribution: Attribution | null | undefined): {\n changes: EnvironmentChange[];\n moduleSources?: 'compared' | 'not-recorded';\n} {\n if (!attribution || typeof attribution.command !== 'string') return { changes: [] };\n const recorded = attribution.modules;\n if (typeof recorded !== 'object' || recorded === null) return { changes: [], moduleSources: 'not-recorded' };\n const live = moduleSources(attribution.command) ?? {};\n const changes: EnvironmentChange[] = [];\n for (const name of [...new Set([...Object.keys(recorded), ...Object.keys(live)])].sort()) {\n if (recorded[name] !== live[name]) {\n changes.push({ fact: `module ${name}`, recorded: recorded[name] ?? null, current: live[name] ?? null, reach: 'reachable' });\n }\n }\n return { changes, moduleSources: 'compared' };\n}\n\n/**\n * Re-run an entry that wrote a file with `--out` pointed at a temporary path instead, so the\n * recorded path is never overwritten; the temporary path is written back as the recorded one in\n * the replayed streams, and the file is returned by hash.\n */\nasync function runRedirected(\n dispatch: Dispatch,\n entry: RecordEntry,\n): Promise<{ run: Awaited<ReturnType<typeof runCaptured>>; artifact: { path: string; recorded: string; replayed: string | null } }> {\n const recorded = entry.artifacts[0];\n const dir = mkdtempSync(join(tmpdir(), 'upt-replay-'));\n const temp = join(dir, basename(recorded.path) || 'artifact');\n try {\n const argv = entry.argv.map((t) => (t.startsWith('--out=') ? `--out=${temp}` : t));\n const run = await runCaptured(dispatch, argv);\n const back = (s: string): string => s.split(temp).join(recorded.path);\n return {\n run: { ...run, stdout: back(run.stdout), stderr: back(run.stderr), threw: run.threw === null ? null : back(run.threw) },\n artifact: { path: recorded.path, recorded: recorded.sha256, replayed: hashFile(temp) },\n };\n } finally {\n rmSync(dir, { recursive: true, force: true });\n }\n}\n\n/** Replay every entry in a record file and report reproduced, differing and not-replayable entries. */\nexport async function replayRecord(\n file: string,\n json: boolean,\n dispatch: Dispatch,\n io: Io,\n api: typeof cliApi,\n): Promise<number> {\n const lines = readRecord(file);\n const live = await recordEnvironment(api);\n const reports: ReplayEntryReport[] = [];\n for (const l of lines) {\n if ('error' in l) {\n reports.push({\n line: l.line,\n argv: null,\n outcome: 'not-replayable',\n reason: l.error,\n differences: [],\n attribution: null,\n environmentChanges: [],\n integrity: [],\n });\n continue;\n }\n const { entry } = l;\n const modules = moduleChanges(entry.attribution);\n const base = {\n line: l.line,\n argv: entry.argv,\n attribution: entry.attribution ?? null,\n ...(modules.moduleSources ? { moduleSources: modules.moduleSources } : {}),\n environmentChanges: [...environmentChanges(entry.environment, live, entry.attribution), ...modules.changes],\n integrity: integrityFindings(entry),\n };\n const reason = notReplayableReason(entry, api);\n if (reason) {\n reports.push({ ...base, outcome: 'not-replayable', reason, differences: [] });\n continue;\n }\n const writes = (entry.artifacts ?? []).length > 0 && (parseInvocation(entry.argv)?.flags.out?.[0] ?? '') !== '';\n const { run, artifact } = writes\n ? await runRedirected(dispatch, entry)\n : { run: await runCaptured(dispatch, entry.argv), artifact: null };\n if (parseInvocation(entry.argv)?.command === 'probe' && TIME_LIMIT_STATED.test(run.stdout)) {\n reports.push({\n ...base,\n outcome: 'not-replayable',\n reason:\n 'the replay stopped on its wall-clock budget (time-limit) and the recorded run did not, so the two ran ' +\n 'different searches; nothing was compared',\n differences: [],\n });\n continue;\n }\n const recordedExit = exitLabel(entry.result.exitCode, entry.result.threw ?? null);\n const replayedExit = exitLabel(run.exitCode, run.threw);\n const differences: StreamDifference[] = [];\n if (recordedExit !== replayedExit) differences.push({ stream: 'exit', recorded: recordedExit, replayed: replayedExit });\n for (const d of [\n streamDifference('stdout', entry.result.stdout, run.stdout),\n streamDifference('stderr', entry.result.stderr, run.stderr),\n ]) {\n if (d) differences.push(d);\n }\n if (artifact && artifact.recorded !== artifact.replayed) {\n differences.push({ stream: 'artifact', path: artifact.path, recorded: artifact.recorded, replayed: artifact.replayed ?? '<no file>' });\n }\n reports.push({\n ...base,\n outcome: differences.length === 0 ? 'reproduced' : 'differs',\n exit: { recorded: recordedExit, replayed: replayedExit },\n differences,\n ...(artifact ? { artifacts: [artifact] } : {}),\n });\n }\n\n const count = (o: ReplayOutcome): number => reports.filter((r) => r.outcome === o).length;\n const summary = {\n entries: reports.length,\n reproduced: count('reproduced'),\n differs: count('differs'),\n notReplayable: count('not-replayable'),\n environmentChanged: reports.filter((r) => r.environmentChanges.length > 0).length,\n integrityFindings: reports.reduce((n, r) => n + r.integrity.length, 0),\n };\n const status =\n summary.differs > 0 ? 3 : summary.notReplayable + summary.environmentChanged + summary.integrityFindings > 0 ? 1 : 0;\n\n if (json) {\n emitJson({ command: 'replay', options: { file }, result: { environment: live, entries: reports, summary } }, io.write);\n return status;\n }\n\n const { out } = io;\n out(`upt replay — ${file}: ${reports.length} ${reports.length === 1 ? 'entry' : 'entries'}`);\n out(`environment now: ${describeEnvironment(live)}`);\n for (const r of reports) {\n out(`[line ${r.line}] ${r.argv ? commandLine(r.argv) : '(unreadable)'}`);\n if (r.outcome === 'not-replayable') {\n out(` NOT REPLAYABLE — ${r.reason}`);\n } else if (r.outcome === 'reproduced') {\n out(\n ` reproduced — ${r.exit!.replayed}, stdout and stderr identical` +\n (r.artifacts ? `, and the file it wrote (written to a temporary path, not over ${r.artifacts[0].path})` : ''),\n );\n } else {\n out(` DIFFERS — ${r.differences.map((d) => d.stream).join(', ')}`);\n for (const d of r.differences) {\n if (d.stream === 'exit') {\n out(` exit: recorded ${d.recorded}, replayed ${d.replayed}`);\n } else if (d.stream === 'artifact') {\n out(` artifact ${d.path}: recorded sha256 ${d.recorded}, replayed ${d.replayed} (written to a temporary path)`);\n } else {\n out(` ${d.stream}: first difference at line ${d.firstDifferingLine}`);\n out(` recorded: ${d.recorded}`);\n out(` replayed: ${d.replayed}`);\n }\n }\n }\n if (r.environmentChanges.length > 0) {\n out(' environment changed since recording:');\n for (const c of r.environmentChanges) {\n out(` ${c.fact}: ${JSON.stringify(c.recorded)} -> ${JSON.stringify(c.current)}${reachNote(c.reach, r.attribution?.command)}`);\n }\n }\n if (r.moduleSources === 'not-recorded') {\n out(' module sources: not recorded in this entry, so a changed literal a module keeps private would go unseen');\n }\n for (const f of r.integrity) out(` record integrity: ${f} (the record was edited after it was written)`);\n }\n out(\n `summary: ${summary.reproduced} reproduced, ${summary.differs} differ, ${summary.notReplayable} not replayable; ` +\n `environment changed for ${summary.environmentChanged} of ${summary.entries}; ` +\n `${summary.integrityFindings} integrity finding${summary.integrityFindings === 1 ? '' : 's'}`,\n );\n return status;\n}\n\nfunction reachNote(reach: Reach | undefined, command: string | undefined): string {\n if (reach === 'reachable') return ` — reachable from '${command}' (static upper bound, not an observed read)`;\n if (reach === 'not-reachable') return ` — not reachable from '${command}' by static import analysis`;\n if (reach === 'unattributed') return ' — no attribution (the entry ran no command module)';\n return '';\n}\n\nfunction describeEnvironment(env: Partial<RecordEnvironment>): string {\n const peers = Object.entries(env.peers ?? {})\n .map(([k, v]) => `${k} ${v ?? 'absent'}`)\n .join(', ');\n const tables = (typeof env.constantTables === 'object' && env.constantTables) || {};\n const combined = sha256(\n canonicalJson(\n Object.fromEntries(Object.entries(tables).map(([k, t]) => [k, t?.sha256])),\n 'record',\n ),\n );\n return (\n `upt ${env.uptVersion}, node ${env.node}, formula parser ${env.formulaParser}, ` +\n `simplifier ${env.simplifier ? 'available' : 'unavailable'}, ` +\n `${Object.keys(tables).length} constant tables (sha256 of their fingerprints ${combined.slice(0, 12)}…)` +\n (peers ? `\\n peers: ${peers}` : '')\n );\n}\n\n/** Render a record file's entries without replaying them. */\nexport function showRecord(file: string, json: boolean, io: Io): number {\n const lines = readRecord(file);\n if (json) {\n emitJson(\n {\n command: 'show-record',\n options: { file },\n result: lines.map((l) => ('error' in l ? { line: l.line, error: l.error } : { line: l.line, ...l.entry })),\n },\n io.write,\n );\n return 0;\n }\n const { out } = io;\n const block = (text: string, mark: string): void => {\n if (text !== '') for (const s of text.replace(/\\n$/, '').split('\\n')) out(` ${mark} ${s}`);\n };\n out(`upt record — ${file}: ${lines.length} ${lines.length === 1 ? 'entry' : 'entries'}`);\n let lastEnv = '';\n for (const l of lines) {\n if ('error' in l) {\n out(`[line ${l.line}] unreadable: ${l.error}`);\n continue;\n }\n const { entry } = l;\n const env = JSON.stringify(entry.environment);\n if (env !== lastEnv) {\n out(`environment: ${describeEnvironment(entry.environment)}`);\n lastEnv = env;\n }\n out(`[line ${l.line}] ${commandLine(entry.argv)} (${exitLabel(entry.result.exitCode, entry.result.threw ?? null)}; recorded ${entry.recordedAt})`);\n block(entry.result.stdout, '|');\n block(entry.result.stderr, '!');\n for (const i of entry.inputs ?? []) out(` read ${i.path} (${i.flag}; ${i.sha256 === null ? 'absent' : `sha256 ${i.sha256}`})`);\n for (const a of entry.artifacts ?? []) out(` wrote ${a.path} (sha256 ${a.sha256})`);\n }\n return 0;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-index.d.ts","sourceRoot":"","sources":["../../src/cli/search-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,oDAAoD;AACpD,MAAM,MAAM,UAAU,GAClB,gBAAgB,GAChB,oBAAoB,GACpB,aAAa,GACb,cAAc,GACd,UAAU,GACV,cAAc,GACd,QAAQ,CAAC;AAEb,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,EAQrE,CAAC;AAEF,8FAA8F;AAC9F,UAAU,KAAK;IACb,QAAQ,CAAC,KAAK,EAAE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,CAAC,EAAE,MAAM,CAAC;IACxB,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CAC5C;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,CAAoD,CAAC;AAiChG,eAAO,MAAM,IAAI,MAAO,MAAM,KAAG,MAAiE,CAAC;AAInG;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAMnE;AA+CD,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,WAAW,EAAE,CAyItE;AAyBD;;;;;;2EAM2E;AAC3E,wBAAgB,cAAc,CAC5B,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EACtB,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,WAAW,EAAE,CAiEf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EACtB,IAAI,EAAE,MAAM,GACX;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;CAAE,GAAG,IAAI,CA0BxF"}
|
package/dist/cli/search-index.js
CHANGED
|
@@ -127,15 +127,16 @@ export function buildSearchIndex(api) {
|
|
|
127
127
|
const ev = api.BRIDGE_EVALUATORS.get(b.id);
|
|
128
128
|
const ref = ev === undefined ? api.catalogFormalRef(b.id) : undefined;
|
|
129
129
|
const formulaRoute = ev === undefined && ref !== undefined;
|
|
130
|
+
const key = api.catalogEdgeKey(b.id);
|
|
130
131
|
entries.push({
|
|
131
132
|
kind: 'catalog-bridge',
|
|
132
|
-
id:
|
|
133
|
-
line:
|
|
133
|
+
id: key,
|
|
134
|
+
line: `${key} ${b.name} [${b.status}]`,
|
|
134
135
|
command: ev !== undefined
|
|
135
|
-
? `upt evaluate
|
|
136
|
+
? `upt evaluate ${key} ${ev.inputKeys.map((k) => `${k}=…`).join(' ')}`
|
|
136
137
|
: formulaRoute
|
|
137
|
-
? `upt atlas
|
|
138
|
-
: `upt explain
|
|
138
|
+
? `upt atlas ${key}`
|
|
139
|
+
: `upt explain ${key}`,
|
|
139
140
|
commandLabel: ev !== undefined ? 'evaluate' : formulaRoute ? 'formula' : 'no evaluator; route',
|
|
140
141
|
...(ev !== undefined
|
|
141
142
|
? { note: `units: ${ev.parameters.map((p) => `${p.key} in ${p.unit || 'dimensionless'}`).join(', ')}; a value may carry its own unit` }
|
|
@@ -143,7 +144,7 @@ export function buildSearchIndex(api) {
|
|
|
143
144
|
? { note: ref.covers }
|
|
144
145
|
: {}),
|
|
145
146
|
fields: [
|
|
146
|
-
{ label: 'id', text: `be ${b.id}`, exact: [
|
|
147
|
+
{ label: 'id', text: `be ${b.id}`, exact: [key] },
|
|
147
148
|
...titleAndGloss('name', b.name),
|
|
148
149
|
{ label: 'description', text: affirmativeSentences(b.context ?? '') },
|
|
149
150
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-index.js","sourceRoot":"","sources":["../../src/cli/search-index.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,eAAe,GAA+C;IACzE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IACrC,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IAC7C,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,cAAc,EAAE,eAAe,CAAC;IACjC,CAAC,UAAU,EAAE,YAAY,CAAC;IAC1B,CAAC,cAAc,EAAE,eAAe,CAAC;IACjC,CAAC,QAAQ,EAAE,SAAS,CAAC;CACtB,CAAC;AASF;;;;;GAKG;AACH,SAAS,aAAa,CAAC,KAAa,EAAE,IAAY,EAAE,KAAyB;IAC3E,MAAM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C;YAAE,SAAS;QACnC,IACE,IAAI,KAAK,IAAI;YACb,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM;YACjC,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAC7E,CAAC;YACD,IAAI,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * The word index behind `upt search`, shared with `upt explain`'s NOT COVERED answer (audit I5).\n *\n * It indexes every registry the CLI exposes by WORD: names, ids, symbols, genuine aliases\n * (`resolveQuantityName`) and catalog-bridge descriptions. An equal dimension is never a match: a\n * radius is not a wavelength, and angular frequency is not frequency, even where the two share a\n * dimension.\n *\n * A word of one or two letters is a symbol, not an English word: it matches a quantity symbol, an\n * alias or a whole id segment exactly, and never a stray letter inside a description.\n */\nimport type { CommandCtx } from './command.js';\n\n/** The registry a search-index entry comes from. */\nexport type SearchKind =\n | 'catalog-bridge'\n | 'canonical-equation'\n | 'atlas-model'\n | 'atlas-bridge'\n | 'quantity'\n | 'applied-case'\n | 'regime';\n\nexport const SEARCH_SECTIONS: readonly (readonly [SearchKind, string])[] = [\n ['catalog-bridge', 'catalog bridges'],\n ['canonical-equation', 'canonical equations'],\n ['atlas-model', 'atlas models'],\n ['atlas-bridge', 'atlas bridges'],\n ['quantity', 'quantities'],\n ['applied-case', 'applied cases'],\n ['regime', 'regimes'],\n];\n\n/** A searchable field: its label, its words, and the exact strings a short word may equal. */\ninterface Field {\n readonly label: string;\n readonly text: string;\n readonly exact?: readonly string[];\n}\n\n/**\n * A trailing parenthetical is a gloss, not part of the title.\n * `Reynolds analogy (Prandtl number 1)` is the title plus the gloss\n * `Prandtl number 1`. A parenthesis with no preceding space, such as `ν(z)`,\n * stays in the title.\n */\nfunction titleAndGloss(label: string, text: string, exact?: readonly string[]): Field[] {\n const match = /^(.*?)\\s+\\(([^()]*)\\)\\s*$/.exec(text);\n const gloss = match?.[2]?.trim() ?? '';\n if (match === null || gloss.length === 0) {\n return [{ label, text, ...(exact === undefined ? {} : { exact }) }];\n }\n return [\n { label, text: match[1]!.trim(), ...(exact === undefined ? {} : { exact }) },\n { label: 'gloss', text: gloss },\n ];\n}\n\n/** One indexed record: its registry, its id, the line `upt search` prints, the command that shows it, and its searchable fields. */\nexport interface SearchEntry {\n readonly kind: SearchKind;\n readonly id: string;\n readonly line: string;\n readonly command: string;\n readonly commandLabel: string;\n readonly note?: string;\n readonly fields: readonly Field[];\n}\n\n/** A query word that matched only as a proper prefix of a longer indexed word. */\nexport interface PrefixMatch {\n readonly query: string;\n readonly word: string;\n}\n\n/** An entry that matched every query word, the fields it matched in, and the alias that resolved it, if one did. */\nexport interface SearchMatch {\n readonly entry: SearchEntry;\n readonly matchedIn: readonly string[];\n readonly alias?: string;\n /** Present when a query word is a proper prefix of the indexed word, not that word. */\n readonly prefixes?: readonly PrefixMatch[];\n}\n\n/**\n * Words `upt search` and the phrase matcher do not require of a field. A single letter is\n * not one: `a` and `b` are symbols (`truncation-coefficient-a`, the impact parameter), and\n * a word the query gave is either matched or reported, never dropped (Tom's review of #502).\n */\nexport const STOP_WORDS: ReadonlySet<string> = new Set(['of', 'the', 'and', 'for', 'in', 'an']);\n\n/**\n * The wider list the NOT-COVERED suggestion drops from a failed `explain` name before it\n * searches: a name's function words (`not-a-quantity`, `rate-of-change`) are not what the\n * reader asked for. Only {@link searchNameWords} reads it.\n */\nconst SUGGESTION_STOP_WORDS: ReadonlySet<string> = new Set([...STOP_WORDS, 'a', 'not', 'is', 'to', 'by', 'on', 'at', 'with', 'from', 'or', 'as', 'no']);\n\n/**\n * The kind of thing a name asks for. A suggestion may not drop one of these,\n * and it may not keep only these when the name also named a subject\n * (`debye-length` is not the word `length`, and it is not the word `debye`).\n * `equation` is not one of these: `schrodinger-equation` still searches `schrodinger`.\n */\nconst KIND_WORDS: ReadonlySet<string> = new Set([\n 'length',\n 'radius',\n 'frequency',\n 'speed',\n 'energy',\n 'number',\n 'heat',\n 'capacity',\n]);\n\n/**\n * A suggestion query is not an explicit search. One- and two-letter hyphen\n * fragments are symbols (`a`, `T`), and the fewest-match rule would pick\n * them over the real word. Explicit `queryWords` still accepts them.\n */\nconst MIN_SUGGESTION_TOKEN = 3;\n\nexport const fold = (s: string): string => s.normalize('NFD').replace(/\\p{M}/gu, '').toLowerCase();\nconst WORD_BREAK = /[^\\p{L}\\p{N}]+/u;\nconst words = (s: string): string[] => fold(s).split(WORD_BREAK).filter((w) => w.length > 0);\n\n/**\n * Query words from the positionals. A space inside one argument and a hyphen\n * are the same break the index uses, so `\"radiation pressure\"` and\n * `magnetic-field` are two words each. Case stays, so a one-letter symbol\n * such as `T` still matches that exact alias.\n * @internal\n */\nexport function queryWords(positionals: readonly string[]): string[] {\n const out: string[] = [];\n for (const p of positionals) {\n for (const w of p.split(WORD_BREAK)) if (w.length > 0) out.push(w);\n }\n return out;\n}\n\n/**\n * Drop a sentence that denies an identity. \"Not the classical skin depth\"\n * is not a claim about skin depth. \"is a different equation\" is not that\n * equation. A sentence that states the claim and also says \"not an axiom\"\n * stays, because it does not open with Not and it is not \"a different\" identity.\n */\nfunction affirmativeSentences(text: string): string {\n return text\n .split(/(?<=[.!?])\\s+/)\n .filter((sentence) => !/^\\s*not\\b/i.test(sentence) && !/\\bis a different\\b/i.test(sentence))\n .join(' ');\n}\n\n/** The fields of `e` that `q` matches, or `null` when it matches none.\n * `prefixOf` is set only when no field contains `q` as a whole word. */\nfunction matchWord(q: string, e: SearchEntry): { labels: string[]; prefixOf?: string } | null {\n const short = q.length <= 2;\n const fq = fold(q);\n if (short) {\n const hit = e.fields.filter(\n (f) => (f.exact ?? []).includes(q) || (f.label === 'id' && words(f.text).includes(fq)),\n );\n return hit.length === 0 ? null : { labels: hit.map((f) => f.label) };\n }\n const labels: string[] = [];\n let exact = false;\n let prefixOf: string | undefined;\n for (const f of e.fields) {\n const ws = words(f.text);\n const exactHere = ws.includes(fq) || (f.exact ?? []).some((x) => fold(x) === fq);\n if (exactHere) {\n labels.push(f.label);\n exact = true;\n continue;\n }\n const pref = ws.find((w) => w.startsWith(fq) && w.length > fq.length);\n if (pref !== undefined) {\n labels.push(f.label);\n prefixOf ??= pref;\n }\n }\n if (labels.length === 0) return null;\n return exact ? { labels } : { labels, ...(prefixOf === undefined ? {} : { prefixOf }) };\n}\n\n/** Index every registry the CLI exposes, including applied cases. */\nexport function buildSearchIndex(api: CommandCtx['api']): SearchEntry[] {\n const entries: SearchEntry[] = [];\n const fmt = api.format;\n\n for (const b of api.BRIDGE_EQUATIONS) {\n const ev = api.BRIDGE_EVALUATORS.get(b.id);\n const ref = ev === undefined ? api.catalogFormalRef(b.id) : undefined;\n const formulaRoute = ev === undefined && ref !== undefined;\n entries.push({\n kind: 'catalog-bridge',\n id: `be-${b.id}`,\n line: `be-${b.id} ${b.name} [${b.status}]`,\n command: ev !== undefined\n ? `upt evaluate be-${b.id} ${ev.inputKeys.map((k) => `${k}=…`).join(' ')}`\n : formulaRoute\n ? `upt atlas be-${b.id}`\n : `upt explain be-${b.id}`,\n commandLabel: ev !== undefined ? 'evaluate' : formulaRoute ? 'formula' : 'no evaluator; route',\n ...(ev !== undefined\n ? { note: `units: ${ev.parameters.map((p) => `${p.key} in ${p.unit || 'dimensionless'}`).join(', ')}; a value may carry its own unit` }\n : formulaRoute\n ? { note: ref!.covers }\n : {}),\n fields: [\n { label: 'id', text: `be ${b.id}`, exact: [`be-${b.id}`] },\n ...titleAndGloss('name', b.name),\n { label: 'description', text: affirmativeSentences(b.context ?? '') },\n ],\n });\n }\n\n for (const c of api.CANONICAL_EQUATIONS) {\n const t = c.dimensional.target;\n const inputs = c.dimensional.governing.map((g) => `${g.name} ${fmt(g.dim)}`).join(', ');\n entries.push({\n kind: 'canonical-equation',\n id: c.id,\n line: `${c.id} ${c.name} — target ${t.name} ${fmt(t.dim)}; inputs: ${inputs || 'none'}`,\n command: `upt explain ${t.name} --source=canonical`,\n commandLabel: 'inspect',\n fields: [\n { label: 'id', text: c.id, exact: [c.id] },\n ...titleAndGloss('name', c.name),\n { label: 'variables', text: [t.name, ...c.dimensional.governing.map((g) => g.name)].join(' ') },\n ],\n });\n }\n\n for (const f of api.ATLAS_FAMILIES) {\n for (const m of f.models) {\n entries.push({\n kind: 'atlas-model',\n id: m.id,\n line: `${m.id} [${f.family}]`,\n command: `upt regime ${f.family} · upt path ${m.id} <to-model>`,\n commandLabel: 'inspect',\n fields: [{ label: 'id', text: m.id, exact: [m.id] }],\n });\n }\n for (const b of f.bridges) {\n entries.push({\n kind: 'atlas-bridge',\n id: b.id,\n line: `${b.id} ${b.relation} [${f.family}]: ${b.premises.join(' + ')} → ${b.conclusion}`,\n command: `upt atlas ${b.id}`,\n commandLabel: 'inspect',\n fields: [\n { label: 'id', text: b.id, exact: [b.id] },\n { label: 'models', text: [...b.premises, b.conclusion].join(' ') },\n ],\n });\n }\n }\n\n // A quantity keeps every dimension it carries in every graph that names it,\n // so a name used with two dimensions shows both rather than one silently.\n const quantities = new Map<string, { symbols: Set<string>; dims: Set<string>; graphs: Set<string>; aliases: Set<string> }>();\n const addQ = (\n q: { name: string; symbol: string; dim: Parameters<typeof fmt>[0] },\n graph: string,\n aliases: readonly string[] = [],\n ): void => {\n const cur = quantities.get(q.name) ?? { symbols: new Set(), dims: new Set(), graphs: new Set(), aliases: new Set() };\n cur.symbols.add(q.symbol);\n cur.dims.add(fmt(q.dim));\n cur.graphs.add(graph);\n for (const a of aliases) cur.aliases.add(a);\n quantities.set(q.name, cur);\n };\n for (const [graph, edges] of [['catalog', api.CATALOG_GRAPH], ['canonical', api.CANONICAL_GRAPH]] as const) {\n for (const e of edges) {\n for (const s of e.sources) addQ(s, graph, e.aliases?.[s.name] ?? []);\n addQ(e.target, graph);\n }\n }\n for (const registration of api.domainRegimeRegistrations()) {\n const vacuous = registration.records.every((record) => record.regime.inequalities.length === 0);\n entries.push({\n kind: 'regime',\n id: registration.name,\n line: vacuous ? `${registration.name} — vacuous registration (no inequality)` : registration.name,\n command: `upt regime ${registration.name}`,\n commandLabel: 'inspect',\n fields: [{ label: 'name', text: registration.name, exact: [registration.name] }],\n });\n }\n\n for (const c of api.APPLIED_CASES.values()) {\n entries.push({\n kind: 'applied-case',\n id: c.id,\n line: `${c.id} ${c.title}`,\n command: `upt evaluate ${c.id}`,\n commandLabel: 'evaluate',\n fields: [\n { label: 'id', text: c.id, exact: [c.id] },\n { label: 'name', text: c.title },\n ],\n });\n }\n\n for (const [name, q] of quantities) {\n const graphs = [...q.graphs];\n entries.push({\n kind: 'quantity',\n id: name,\n line: `${name} ${[...q.dims].join(' / ')} — symbol ${[...q.symbols].join(', ')}; in: ${graphs.join(', ')}`,\n command: `upt explain ${name} --source=${graphs.length === 2 ? 'both' : graphs[0]}`,\n commandLabel: 'inspect',\n fields: [\n { label: 'name', text: name, exact: [name, ...q.aliases] },\n { label: 'symbol', text: [...q.symbols, ...q.aliases].join(' '), exact: [...q.symbols, ...q.aliases] },\n ],\n });\n }\n return entries;\n}\n\n/** True when `window` and `query` are the same words, order aside. */\nfunction sameWords(window: readonly string[], query: readonly string[]): boolean {\n if (window.length !== query.length) return false;\n const a = [...window].sort();\n const b = [...query].sort();\n return a.every((w, i) => w === b[i]);\n}\n\n/**\n * A phrase is a contiguous run of a field's content words. Stop words in the\n * field are not part of the run, so \"speed of sound\" is the words speed, sound.\n * The query's order does not have to be the field's order.\n */\nfunction phraseInField(text: string, query: readonly string[]): boolean {\n const field = words(text).filter((w) => !STOP_WORDS.has(w));\n const q = query.map(fold).filter((w) => !STOP_WORDS.has(w));\n if (q.length === 0 || field.length < q.length) return false;\n for (let i = 0; i + q.length <= field.length; i++) {\n if (sameWords(field.slice(i, i + q.length), q)) return true;\n }\n return false;\n}\n\n/** Every entry of `index` that EVERY word of `significant` matches, name and id matches first.\n * One word matches as before, including a proper prefix. Two or more words match only as whole\n * words. When one field contains two or more of them, those words have to sit together in that\n * field; a field that scatters them does not count. Words that never share a non-gloss field\n * still match, so \"thermal\" in a description and \"noise\" in a name still find Johnson–Nyquist.\n * A gloss does not combine with another field. A query whose words are the gloss is labeled\n * gloss. A query split across the title and the gloss matches nothing. */\nexport function matchEveryWord(\n api: CommandCtx['api'],\n index: readonly SearchEntry[],\n significant: readonly string[],\n): SearchMatch[] {\n const quantityNames = new Set(index.filter((e) => e.kind === 'quantity').map((e) => e.id));\n const aliasTargets = new Map<string, string>();\n for (const q of significant) {\n const resolved = api.resolveQuantityName(q, quantityNames);\n if (resolved !== null && resolved !== q) aliasTargets.set(resolved, q);\n }\n\n const glued = significant.join('_');\n const matches: SearchMatch[] = [];\n for (const e of index) {\n if (glued.includes('_') && e.fields.some((f) => (f.exact ?? []).includes(glued))) {\n matches.push({ entry: e, matchedIn: ['alias'], alias: glued });\n continue;\n }\n if (significant.length > 1) {\n const folded = significant.map(fold).filter((w) => !STOP_WORDS.has(w));\n const gloss = e.fields.find((f) => f.label === 'gloss' && phraseInField(f.text, folded));\n if (gloss !== undefined) {\n matches.push({ entry: e, matchedIn: ['gloss'] });\n continue;\n }\n const labels: string[] = [];\n const covered = new Set<string>();\n for (const f of e.fields) {\n if (f.label === 'gloss') continue;\n const fieldWords = words(f.text).filter((w) => !STOP_WORDS.has(w));\n const present = folded.filter((q) => fieldWords.includes(q));\n if (present.length === 0) continue;\n // Scattered co-occurrence is not the phrase. \"Reynolds\" and \"number\"\n // both sit in \"Reynolds analogy (Prandtl number 1)\" and are not it.\n if (present.length >= 2 && !phraseInField(f.text, present)) continue;\n labels.push(f.label);\n for (const q of present) covered.add(q);\n }\n if (folded.some((q) => !covered.has(q))) continue;\n matches.push({ entry: e, matchedIn: labels });\n continue;\n }\n const alias = e.kind === 'quantity' ? aliasTargets.get(e.id) : undefined;\n const labels = new Set<string>();\n const prefixes: PrefixMatch[] = [];\n let all = true;\n for (const q of significant) {\n const hit = alias === q ? { labels: ['alias'] } : matchWord(q, e);\n if (hit === null) {\n all = false;\n break;\n }\n for (const l of hit.labels) labels.add(l);\n if (hit.prefixOf !== undefined) prefixes.push({ query: q, word: hit.prefixOf });\n }\n if (!all) continue;\n const order = e.fields.map((f) => f.label).concat('alias');\n matches.push({\n entry: e,\n matchedIn: order.filter((l) => labels.has(l)),\n ...(alias === undefined ? {} : { alias }),\n ...(prefixes.length === 0 ? {} : { prefixes }),\n });\n }\n // A match on a name or id reads before one found only in a description.\n const rank = (m: SearchMatch): number =>\n m.matchedIn.includes('id') || (m.matchedIn.includes('name') && !m.matchedIn.includes('description')) ? 0 : 1;\n return matches.sort((a, b) => rank(a) - rank(b));\n}\n\n/**\n * What `upt search` finds for the words of a name that is not a quantity (`schrodinger-equation`):\n * the name splits on `-`, `_` and spaces, stop words drop, and the words are searched together. When\n * no entry matches every word, the largest set of the words that some entry does match is used\n * instead, the one with the fewest matches when sets tie (so the rarer word `schrodinger` beats the\n * common word `equation`). A set that drops a kind word (`length`, `number`, and the others in\n * `KIND_WORDS`) is not used, and neither is a set of only those words when the name also named a\n * subject. A token shorter than three letters is dropped: it is a symbol, and\n * `not-a-quantity-xyz` must not search `a`. Returns `null` when no word matches anything. At most\n * six words are tried.\n */\nexport function searchNameWords(\n api: CommandCtx['api'],\n name: string,\n): { readonly words: readonly string[]; readonly matches: readonly SearchMatch[] } | null {\n const all = name\n .split(/[-_\\s]+/)\n .filter((w) => w.length >= MIN_SUGGESTION_TOKEN && !SUGGESTION_STOP_WORDS.has(fold(w)))\n .slice(0, 6);\n if (all.length === 0) return null;\n const index = buildSearchIndex(api);\n let best: { words: string[]; matches: SearchMatch[] } | null = null;\n for (let mask = (1 << all.length) - 1; mask > 0; mask--) {\n const subset = all.filter((_, i) => (mask & (1 << i)) !== 0);\n if (best !== null && subset.length < best.words.length) continue;\n const dropped = all.filter((w) => !subset.includes(w));\n if (dropped.some((w) => KIND_WORDS.has(fold(w)))) continue;\n const askedForASubject = all.some((w) => !KIND_WORDS.has(fold(w)));\n if (askedForASubject && subset.every((w) => KIND_WORDS.has(fold(w)))) continue;\n const matches = matchEveryWord(api, index, subset);\n if (matches.length === 0) continue;\n if (\n best === null ||\n subset.length > best.words.length ||\n (subset.length === best.words.length && matches.length < best.matches.length)\n ) {\n best = { words: subset, matches };\n }\n }\n return best;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"search-index.js","sourceRoot":"","sources":["../../src/cli/search-index.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,eAAe,GAA+C;IACzE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IACrC,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IAC7C,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,cAAc,EAAE,eAAe,CAAC;IACjC,CAAC,UAAU,EAAE,YAAY,CAAC;IAC1B,CAAC,cAAc,EAAE,eAAe,CAAC;IACjC,CAAC,QAAQ,EAAE,SAAS,CAAC;CACtB,CAAC;AASF;;;;;GAKG;AACH,SAAS,aAAa,CAAC,KAAa,EAAE,IAAY,EAAE,KAAyB;IAC3E,MAAM,KAAK,GAAG,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO;QACL,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,KAAK,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MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAAE,SAAS;QAC3D,MAAM,gBAAgB,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,IAAI,gBAAgB,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAAE,SAAS;QAC/E,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnC,IACE,IAAI,KAAK,IAAI;YACb,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM;YACjC,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAC7E,CAAC;YACD,IAAI,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * The word index behind `upt search`, shared with `upt explain`'s NOT COVERED answer (audit I5).\n *\n * It indexes every registry the CLI exposes by WORD: names, ids, symbols, genuine aliases\n * (`resolveQuantityName`) and catalog-bridge descriptions. An equal dimension is never a match: a\n * radius is not a wavelength, and angular frequency is not frequency, even where the two share a\n * dimension.\n *\n * A word of one or two letters is a symbol, not an English word: it matches a quantity symbol, an\n * alias or a whole id segment exactly, and never a stray letter inside a description.\n */\nimport type { CommandCtx } from './command.js';\n\n/** The registry a search-index entry comes from. */\nexport type SearchKind =\n | 'catalog-bridge'\n | 'canonical-equation'\n | 'atlas-model'\n | 'atlas-bridge'\n | 'quantity'\n | 'applied-case'\n | 'regime';\n\nexport const SEARCH_SECTIONS: readonly (readonly [SearchKind, string])[] = [\n ['catalog-bridge', 'catalog bridges'],\n ['canonical-equation', 'canonical equations'],\n ['atlas-model', 'atlas models'],\n ['atlas-bridge', 'atlas bridges'],\n ['quantity', 'quantities'],\n ['applied-case', 'applied cases'],\n ['regime', 'regimes'],\n];\n\n/** A searchable field: its label, its words, and the exact strings a short word may equal. */\ninterface Field {\n readonly label: string;\n readonly text: string;\n readonly exact?: readonly string[];\n}\n\n/**\n * A trailing parenthetical is a gloss, not part of the title.\n * `Reynolds analogy (Prandtl number 1)` is the title plus the gloss\n * `Prandtl number 1`. A parenthesis with no preceding space, such as `ν(z)`,\n * stays in the title.\n */\nfunction titleAndGloss(label: string, text: string, exact?: readonly string[]): Field[] {\n const match = /^(.*?)\\s+\\(([^()]*)\\)\\s*$/.exec(text);\n const gloss = match?.[2]?.trim() ?? '';\n if (match === null || gloss.length === 0) {\n return [{ label, text, ...(exact === undefined ? {} : { exact }) }];\n }\n return [\n { label, text: match[1]!.trim(), ...(exact === undefined ? {} : { exact }) },\n { label: 'gloss', text: gloss },\n ];\n}\n\n/** One indexed record: its registry, its id, the line `upt search` prints, the command that shows it, and its searchable fields. */\nexport interface SearchEntry {\n readonly kind: SearchKind;\n readonly id: string;\n readonly line: string;\n readonly command: string;\n readonly commandLabel: string;\n readonly note?: string;\n readonly fields: readonly Field[];\n}\n\n/** A query word that matched only as a proper prefix of a longer indexed word. */\nexport interface PrefixMatch {\n readonly query: string;\n readonly word: string;\n}\n\n/** An entry that matched every query word, the fields it matched in, and the alias that resolved it, if one did. */\nexport interface SearchMatch {\n readonly entry: SearchEntry;\n readonly matchedIn: readonly string[];\n readonly alias?: string;\n /** Present when a query word is a proper prefix of the indexed word, not that word. */\n readonly prefixes?: readonly PrefixMatch[];\n}\n\n/**\n * Words `upt search` and the phrase matcher do not require of a field. A single letter is\n * not one: `a` and `b` are symbols (`truncation-coefficient-a`, the impact parameter), and\n * a word the query gave is either matched or reported, never dropped (Tom's review of #502).\n */\nexport const STOP_WORDS: ReadonlySet<string> = new Set(['of', 'the', 'and', 'for', 'in', 'an']);\n\n/**\n * The wider list the NOT-COVERED suggestion drops from a failed `explain` name before it\n * searches: a name's function words (`not-a-quantity`, `rate-of-change`) are not what the\n * reader asked for. Only {@link searchNameWords} reads it.\n */\nconst SUGGESTION_STOP_WORDS: ReadonlySet<string> = new Set([...STOP_WORDS, 'a', 'not', 'is', 'to', 'by', 'on', 'at', 'with', 'from', 'or', 'as', 'no']);\n\n/**\n * The kind of thing a name asks for. A suggestion may not drop one of these,\n * and it may not keep only these when the name also named a subject\n * (`debye-length` is not the word `length`, and it is not the word `debye`).\n * `equation` is not one of these: `schrodinger-equation` still searches `schrodinger`.\n */\nconst KIND_WORDS: ReadonlySet<string> = new Set([\n 'length',\n 'radius',\n 'frequency',\n 'speed',\n 'energy',\n 'number',\n 'heat',\n 'capacity',\n]);\n\n/**\n * A suggestion query is not an explicit search. One- and two-letter hyphen\n * fragments are symbols (`a`, `T`), and the fewest-match rule would pick\n * them over the real word. Explicit `queryWords` still accepts them.\n */\nconst MIN_SUGGESTION_TOKEN = 3;\n\nexport const fold = (s: string): string => s.normalize('NFD').replace(/\\p{M}/gu, '').toLowerCase();\nconst WORD_BREAK = /[^\\p{L}\\p{N}]+/u;\nconst words = (s: string): string[] => fold(s).split(WORD_BREAK).filter((w) => w.length > 0);\n\n/**\n * Query words from the positionals. A space inside one argument and a hyphen\n * are the same break the index uses, so `\"radiation pressure\"` and\n * `magnetic-field` are two words each. Case stays, so a one-letter symbol\n * such as `T` still matches that exact alias.\n * @internal\n */\nexport function queryWords(positionals: readonly string[]): string[] {\n const out: string[] = [];\n for (const p of positionals) {\n for (const w of p.split(WORD_BREAK)) if (w.length > 0) out.push(w);\n }\n return out;\n}\n\n/**\n * Drop a sentence that denies an identity. \"Not the classical skin depth\"\n * is not a claim about skin depth. \"is a different equation\" is not that\n * equation. A sentence that states the claim and also says \"not an axiom\"\n * stays, because it does not open with Not and it is not \"a different\" identity.\n */\nfunction affirmativeSentences(text: string): string {\n return text\n .split(/(?<=[.!?])\\s+/)\n .filter((sentence) => !/^\\s*not\\b/i.test(sentence) && !/\\bis a different\\b/i.test(sentence))\n .join(' ');\n}\n\n/** The fields of `e` that `q` matches, or `null` when it matches none.\n * `prefixOf` is set only when no field contains `q` as a whole word. */\nfunction matchWord(q: string, e: SearchEntry): { labels: string[]; prefixOf?: string } | null {\n const short = q.length <= 2;\n const fq = fold(q);\n if (short) {\n const hit = e.fields.filter(\n (f) => (f.exact ?? []).includes(q) || (f.label === 'id' && words(f.text).includes(fq)),\n );\n return hit.length === 0 ? null : { labels: hit.map((f) => f.label) };\n }\n const labels: string[] = [];\n let exact = false;\n let prefixOf: string | undefined;\n for (const f of e.fields) {\n const ws = words(f.text);\n const exactHere = ws.includes(fq) || (f.exact ?? []).some((x) => fold(x) === fq);\n if (exactHere) {\n labels.push(f.label);\n exact = true;\n continue;\n }\n const pref = ws.find((w) => w.startsWith(fq) && w.length > fq.length);\n if (pref !== undefined) {\n labels.push(f.label);\n prefixOf ??= pref;\n }\n }\n if (labels.length === 0) return null;\n return exact ? { labels } : { labels, ...(prefixOf === undefined ? {} : { prefixOf }) };\n}\n\n/** Index every registry the CLI exposes, including applied cases. */\nexport function buildSearchIndex(api: CommandCtx['api']): SearchEntry[] {\n const entries: SearchEntry[] = [];\n const fmt = api.format;\n\n for (const b of api.BRIDGE_EQUATIONS) {\n const ev = api.BRIDGE_EVALUATORS.get(b.id);\n const ref = ev === undefined ? api.catalogFormalRef(b.id) : undefined;\n const formulaRoute = ev === undefined && ref !== undefined;\n const key = api.catalogEdgeKey(b.id);\n entries.push({\n kind: 'catalog-bridge',\n id: key,\n line: `${key} ${b.name} [${b.status}]`,\n command: ev !== undefined\n ? `upt evaluate ${key} ${ev.inputKeys.map((k) => `${k}=…`).join(' ')}`\n : formulaRoute\n ? `upt atlas ${key}`\n : `upt explain ${key}`,\n commandLabel: ev !== undefined ? 'evaluate' : formulaRoute ? 'formula' : 'no evaluator; route',\n ...(ev !== undefined\n ? { note: `units: ${ev.parameters.map((p) => `${p.key} in ${p.unit || 'dimensionless'}`).join(', ')}; a value may carry its own unit` }\n : formulaRoute\n ? { note: ref!.covers }\n : {}),\n fields: [\n { label: 'id', text: `be ${b.id}`, exact: [key] },\n ...titleAndGloss('name', b.name),\n { label: 'description', text: affirmativeSentences(b.context ?? '') },\n ],\n });\n }\n\n for (const c of api.CANONICAL_EQUATIONS) {\n const t = c.dimensional.target;\n const inputs = c.dimensional.governing.map((g) => `${g.name} ${fmt(g.dim)}`).join(', ');\n entries.push({\n kind: 'canonical-equation',\n id: c.id,\n line: `${c.id} ${c.name} — target ${t.name} ${fmt(t.dim)}; inputs: ${inputs || 'none'}`,\n command: `upt explain ${t.name} --source=canonical`,\n commandLabel: 'inspect',\n fields: [\n { label: 'id', text: c.id, exact: [c.id] },\n ...titleAndGloss('name', c.name),\n { label: 'variables', text: [t.name, ...c.dimensional.governing.map((g) => g.name)].join(' ') },\n ],\n });\n }\n\n for (const f of api.ATLAS_FAMILIES) {\n for (const m of f.models) {\n entries.push({\n kind: 'atlas-model',\n id: m.id,\n line: `${m.id} [${f.family}]`,\n command: `upt regime ${f.family} · upt path ${m.id} <to-model>`,\n commandLabel: 'inspect',\n fields: [{ label: 'id', text: m.id, exact: [m.id] }],\n });\n }\n for (const b of f.bridges) {\n entries.push({\n kind: 'atlas-bridge',\n id: b.id,\n line: `${b.id} ${b.relation} [${f.family}]: ${b.premises.join(' + ')} → ${b.conclusion}`,\n command: `upt atlas ${b.id}`,\n commandLabel: 'inspect',\n fields: [\n { label: 'id', text: b.id, exact: [b.id] },\n { label: 'models', text: [...b.premises, b.conclusion].join(' ') },\n ],\n });\n }\n }\n\n // A quantity keeps every dimension it carries in every graph that names it,\n // so a name used with two dimensions shows both rather than one silently.\n const quantities = new Map<string, { symbols: Set<string>; dims: Set<string>; graphs: Set<string>; aliases: Set<string> }>();\n const addQ = (\n q: { name: string; symbol: string; dim: Parameters<typeof fmt>[0] },\n graph: string,\n aliases: readonly string[] = [],\n ): void => {\n const cur = quantities.get(q.name) ?? { symbols: new Set(), dims: new Set(), graphs: new Set(), aliases: new Set() };\n cur.symbols.add(q.symbol);\n cur.dims.add(fmt(q.dim));\n cur.graphs.add(graph);\n for (const a of aliases) cur.aliases.add(a);\n quantities.set(q.name, cur);\n };\n for (const [graph, edges] of [['catalog', api.CATALOG_GRAPH], ['canonical', api.CANONICAL_GRAPH]] as const) {\n for (const e of edges) {\n for (const s of e.sources) addQ(s, graph, e.aliases?.[s.name] ?? []);\n addQ(e.target, graph);\n }\n }\n for (const registration of api.domainRegimeRegistrations()) {\n const vacuous = registration.records.every((record) => record.regime.inequalities.length === 0);\n entries.push({\n kind: 'regime',\n id: registration.name,\n line: vacuous ? `${registration.name} — vacuous registration (no inequality)` : registration.name,\n command: `upt regime ${registration.name}`,\n commandLabel: 'inspect',\n fields: [{ label: 'name', text: registration.name, exact: [registration.name] }],\n });\n }\n\n for (const c of api.APPLIED_CASES.values()) {\n entries.push({\n kind: 'applied-case',\n id: c.id,\n line: `${c.id} ${c.title}`,\n command: `upt evaluate ${c.id}`,\n commandLabel: 'evaluate',\n fields: [\n { label: 'id', text: c.id, exact: [c.id] },\n { label: 'name', text: c.title },\n ],\n });\n }\n\n for (const [name, q] of quantities) {\n const graphs = [...q.graphs];\n entries.push({\n kind: 'quantity',\n id: name,\n line: `${name} ${[...q.dims].join(' / ')} — symbol ${[...q.symbols].join(', ')}; in: ${graphs.join(', ')}`,\n command: `upt explain ${name} --source=${graphs.length === 2 ? 'both' : graphs[0]}`,\n commandLabel: 'inspect',\n fields: [\n { label: 'name', text: name, exact: [name, ...q.aliases] },\n { label: 'symbol', text: [...q.symbols, ...q.aliases].join(' '), exact: [...q.symbols, ...q.aliases] },\n ],\n });\n }\n return entries;\n}\n\n/** True when `window` and `query` are the same words, order aside. */\nfunction sameWords(window: readonly string[], query: readonly string[]): boolean {\n if (window.length !== query.length) return false;\n const a = [...window].sort();\n const b = [...query].sort();\n return a.every((w, i) => w === b[i]);\n}\n\n/**\n * A phrase is a contiguous run of a field's content words. Stop words in the\n * field are not part of the run, so \"speed of sound\" is the words speed, sound.\n * The query's order does not have to be the field's order.\n */\nfunction phraseInField(text: string, query: readonly string[]): boolean {\n const field = words(text).filter((w) => !STOP_WORDS.has(w));\n const q = query.map(fold).filter((w) => !STOP_WORDS.has(w));\n if (q.length === 0 || field.length < q.length) return false;\n for (let i = 0; i + q.length <= field.length; i++) {\n if (sameWords(field.slice(i, i + q.length), q)) return true;\n }\n return false;\n}\n\n/** Every entry of `index` that EVERY word of `significant` matches, name and id matches first.\n * One word matches as before, including a proper prefix. Two or more words match only as whole\n * words. When one field contains two or more of them, those words have to sit together in that\n * field; a field that scatters them does not count. Words that never share a non-gloss field\n * still match, so \"thermal\" in a description and \"noise\" in a name still find Johnson–Nyquist.\n * A gloss does not combine with another field. A query whose words are the gloss is labeled\n * gloss. A query split across the title and the gloss matches nothing. */\nexport function matchEveryWord(\n api: CommandCtx['api'],\n index: readonly SearchEntry[],\n significant: readonly string[],\n): SearchMatch[] {\n const quantityNames = new Set(index.filter((e) => e.kind === 'quantity').map((e) => e.id));\n const aliasTargets = new Map<string, string>();\n for (const q of significant) {\n const resolved = api.resolveQuantityName(q, quantityNames);\n if (resolved !== null && resolved !== q) aliasTargets.set(resolved, q);\n }\n\n const glued = significant.join('_');\n const matches: SearchMatch[] = [];\n for (const e of index) {\n if (glued.includes('_') && e.fields.some((f) => (f.exact ?? []).includes(glued))) {\n matches.push({ entry: e, matchedIn: ['alias'], alias: glued });\n continue;\n }\n if (significant.length > 1) {\n const folded = significant.map(fold).filter((w) => !STOP_WORDS.has(w));\n const gloss = e.fields.find((f) => f.label === 'gloss' && phraseInField(f.text, folded));\n if (gloss !== undefined) {\n matches.push({ entry: e, matchedIn: ['gloss'] });\n continue;\n }\n const labels: string[] = [];\n const covered = new Set<string>();\n for (const f of e.fields) {\n if (f.label === 'gloss') continue;\n const fieldWords = words(f.text).filter((w) => !STOP_WORDS.has(w));\n const present = folded.filter((q) => fieldWords.includes(q));\n if (present.length === 0) continue;\n // Scattered co-occurrence is not the phrase. \"Reynolds\" and \"number\"\n // both sit in \"Reynolds analogy (Prandtl number 1)\" and are not it.\n if (present.length >= 2 && !phraseInField(f.text, present)) continue;\n labels.push(f.label);\n for (const q of present) covered.add(q);\n }\n if (folded.some((q) => !covered.has(q))) continue;\n matches.push({ entry: e, matchedIn: labels });\n continue;\n }\n const alias = e.kind === 'quantity' ? aliasTargets.get(e.id) : undefined;\n const labels = new Set<string>();\n const prefixes: PrefixMatch[] = [];\n let all = true;\n for (const q of significant) {\n const hit = alias === q ? { labels: ['alias'] } : matchWord(q, e);\n if (hit === null) {\n all = false;\n break;\n }\n for (const l of hit.labels) labels.add(l);\n if (hit.prefixOf !== undefined) prefixes.push({ query: q, word: hit.prefixOf });\n }\n if (!all) continue;\n const order = e.fields.map((f) => f.label).concat('alias');\n matches.push({\n entry: e,\n matchedIn: order.filter((l) => labels.has(l)),\n ...(alias === undefined ? {} : { alias }),\n ...(prefixes.length === 0 ? {} : { prefixes }),\n });\n }\n // A match on a name or id reads before one found only in a description.\n const rank = (m: SearchMatch): number =>\n m.matchedIn.includes('id') || (m.matchedIn.includes('name') && !m.matchedIn.includes('description')) ? 0 : 1;\n return matches.sort((a, b) => rank(a) - rank(b));\n}\n\n/**\n * What `upt search` finds for the words of a name that is not a quantity (`schrodinger-equation`):\n * the name splits on `-`, `_` and spaces, stop words drop, and the words are searched together. When\n * no entry matches every word, the largest set of the words that some entry does match is used\n * instead, the one with the fewest matches when sets tie (so the rarer word `schrodinger` beats the\n * common word `equation`). A set that drops a kind word (`length`, `number`, and the others in\n * `KIND_WORDS`) is not used, and neither is a set of only those words when the name also named a\n * subject. A token shorter than three letters is dropped: it is a symbol, and\n * `not-a-quantity-xyz` must not search `a`. Returns `null` when no word matches anything. At most\n * six words are tried.\n */\nexport function searchNameWords(\n api: CommandCtx['api'],\n name: string,\n): { readonly words: readonly string[]; readonly matches: readonly SearchMatch[] } | null {\n const all = name\n .split(/[-_\\s]+/)\n .filter((w) => w.length >= MIN_SUGGESTION_TOKEN && !SUGGESTION_STOP_WORDS.has(fold(w)))\n .slice(0, 6);\n if (all.length === 0) return null;\n const index = buildSearchIndex(api);\n let best: { words: string[]; matches: SearchMatch[] } | null = null;\n for (let mask = (1 << all.length) - 1; mask > 0; mask--) {\n const subset = all.filter((_, i) => (mask & (1 << i)) !== 0);\n if (best !== null && subset.length < best.words.length) continue;\n const dropped = all.filter((w) => !subset.includes(w));\n if (dropped.some((w) => KIND_WORDS.has(fold(w)))) continue;\n const askedForASubject = all.some((w) => !KIND_WORDS.has(fold(w)));\n if (askedForASubject && subset.every((w) => KIND_WORDS.has(fold(w)))) continue;\n const matches = matchEveryWord(api, index, subset);\n if (matches.length === 0) continue;\n if (\n best === null ||\n subset.length > best.words.length ||\n (subset.length === best.words.length && matches.length < best.matches.length)\n ) {\n best = { words: subset, matches };\n }\n }\n return best;\n}\n"]}
|
package/dist/cli/statuses.d.ts
CHANGED
|
@@ -18,8 +18,6 @@ export interface StatusDefinition {
|
|
|
18
18
|
export declare const STATUS_GLOSSARY: readonly StatusDefinition[];
|
|
19
19
|
/** The definitions of the statuses `command` can emit, keyed as in the glossary. */
|
|
20
20
|
export declare function definitionsFor(command: string): Record<string, string>;
|
|
21
|
-
/** The glossary meaning of status `key`; throws on a key the glossary does not define. */
|
|
22
|
-
export declare function statusMeaning(key: string): string;
|
|
23
21
|
/** The text of `upt help statuses`: each status, its words, the commands that emit it, and its meaning. */
|
|
24
22
|
export declare function glossaryText(): string;
|
|
25
23
|
//# sourceMappingURL=statuses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statuses.d.ts","sourceRoot":"","sources":["../../src/cli/statuses.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,gBAAgB,
|
|
1
|
+
{"version":3,"file":"statuses.d.ts","sourceRoot":"","sources":["../../src/cli/statuses.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,gBAAgB,EAmStD,CAAC;AAEF,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAItE;AAED,2GAA2G;AAC3G,wBAAgB,YAAY,IAAI,MAAM,CAarC"}
|
package/dist/cli/statuses.js
CHANGED
|
@@ -182,8 +182,18 @@ export const STATUS_GLOSSARY = [
|
|
|
182
182
|
{
|
|
183
183
|
key: 'promising',
|
|
184
184
|
words: ['PROMISING', 'promising'],
|
|
185
|
-
meaning: 'an identification a ≡ b that is numerically consistent, connects disconnected physics
|
|
186
|
-
'one quantity: worth a physicist\'s review, not
|
|
185
|
+
meaning: 'an identification a ≡ b that is numerically consistent, connects disconnected physics, unlocks at least ' +
|
|
186
|
+
'one quantity, and survived a magnitude comparison that could have failed: worth a physicist\'s review, not ' +
|
|
187
|
+
'evidence that it holds',
|
|
188
|
+
commands: ['discover'],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
key: 'promising-unchecked',
|
|
192
|
+
// `UNCHECKED` alone is `unknown` in the other commands; in `discover` it is this tier's heading word.
|
|
193
|
+
words: ['promising-unchecked', 'PROMISING, MAGNITUDE UNCHECKED', 'UNCHECKED'],
|
|
194
|
+
meaning: 'the same structure as promising (consistent, connects disconnected physics, unlocks at least one quantity), ' +
|
|
195
|
+
'but the magnitude falsifier never tested it: an endpoint has no representative magnitude, or the graph fixes ' +
|
|
196
|
+
'the ratio at every anchor so the comparison could not fail. Counted apart from promising and never added to it',
|
|
187
197
|
commands: ['discover'],
|
|
188
198
|
},
|
|
189
199
|
{
|
|
@@ -265,13 +275,6 @@ export function definitionsFor(command) {
|
|
|
265
275
|
out[s.key] = s.meaning;
|
|
266
276
|
return out;
|
|
267
277
|
}
|
|
268
|
-
/** The glossary meaning of status `key`; throws on a key the glossary does not define. */
|
|
269
|
-
export function statusMeaning(key) {
|
|
270
|
-
const s = STATUS_GLOSSARY.find((d) => d.key === key);
|
|
271
|
-
if (s === undefined)
|
|
272
|
-
throw new Error(`statuses: no status '${key}'`);
|
|
273
|
-
return s.meaning;
|
|
274
|
-
}
|
|
275
278
|
/** The text of `upt help statuses`: each status, its words, the commands that emit it, and its meaning. */
|
|
276
279
|
export function glossaryText() {
|
|
277
280
|
const lines = [
|