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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-reach.js","sourceRoot":"","sources":["../../src/cli/record-reach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,E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EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAChF,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAChC,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["/**\n * Static attribution for an experiment record: which constants a command's code can reach\n * (design: `docs/planning/Experiment-Record-Replay-Design-Note.md`).\n *\n * The reach is derived from the import graph of the modules as they are on disk when the entry is\n * recorded, not declared by hand and not observed while the command runs. It is an UPPER BOUND:\n *\n * - from `cli/commands/<command>` every relative static and literal dynamic import is followed;\n * - a `cli/` module reaches the `cli-api` barrel through `ctx.api`, not through an import, so every\n * barrel export whose name occurs as a word in a reached `cli/` module adds its source module;\n * - a named export of a module-exports table is reached when a reached module imports it by name\n * or by namespace, re-exports it, or the table's own module mentions it outside its declaration;\n * - an object table is reached whole (`*`) when its module is reached.\n *\n * Comments and strings are not stripped, so a name mentioned only in a comment counts as reached:\n * that errs toward \"reachable\", never toward \"not reachable\".\n *\n * The same import graph gives the modules the command loads. Each one's source is hashed, so a\n * change to a literal a module keeps private, which no constant table holds, is still named.\n */\n\nimport { createHash } from 'node:crypto';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve, sep } from 'node:path';\nimport { MODULE_EXT, SOURCE_ROOT, tableName, type TableKind } from './record-tables.js';\n\nexport const REACH_METHOD = 'static-import-reach';\n\n/** The constant-table keys and module sources a recorded command can reach, by static import reach (it errs toward reachable). */\nexport interface Attribution {\n method: typeof REACH_METHOD;\n command: string;\n /** Table name -> the keys the command's code can reach, or `['*']` for the whole table. */\n tables: Record<string, string[]>;\n /**\n * Module name (as a table is named) -> SHA-256 of its source, for every module the command\n * loads. Absent from entries written before module sources were hashed.\n */\n modules?: Record<string, string>;\n}\n\n/** A reached module reads `names` of `file`, `*` for all of them. */\ninterface Read {\n file: string;\n names: string[] | '*';\n}\n\n/** `file` re-exports: `pairs` as `[exported, original]` (`original` `*` for a namespace), or everything. */\ninterface Reexport {\n file: string;\n pairs: [string, string][] | '*';\n}\n\nconst source = new Map<string, string>();\nconst read = (file: string): string => {\n let s = source.get(file);\n if (s === undefined) {\n s = readFileSync(file, 'utf8');\n source.set(file, s);\n }\n return s;\n};\n\nfunction resolveSpec(from: string, spec: string): string | null {\n if (!spec.startsWith('.')) return null;\n let file = resolve(dirname(from), spec);\n if (MODULE_EXT !== '.js') file = file.replace(/\\.js$/, MODULE_EXT);\n return existsSync(file) ? file : null;\n}\n\n/** `[exported-or-local, original]` for each value binding of an import or export clause. */\nfunction clausePairs(clause: string): [string, string][] | '*' {\n const ns = /\\*\\s*as\\s+([\\w$]+)/.exec(clause);\n if (ns) return [[ns[1], '*']];\n if (/^\\s*\\*\\s*$/.test(clause)) return '*';\n const pairs: [string, string][] = [];\n const braces = /\\{([^}]*)\\}/.exec(clause);\n if (braces) {\n for (const part of braces[1].split(',')) {\n const m = /^\\s*(type\\s+)?([\\w$]+)(?:\\s+as\\s+([\\w$]+))?/.exec(part);\n if (m && !m[1]) pairs.push([m[3] ?? m[2], m[2]]);\n }\n }\n const def = /^\\s*([\\w$]+)\\s*(,|$)/.exec(clause);\n if (def && def[1] !== 'type') pairs.push([def[1], 'default']);\n return pairs;\n}\n\nconst STATIC_FROM = /\\b(import|export)\\s+(type\\s+)?([^'\";]*?)\\s*from\\s*['\"]([^'\"]+)['\"]/g;\nconst SIDE_EFFECT = /\\bimport\\s*['\"]([^'\"]+)['\"]/g;\nconst DYNAMIC = /\\bimport\\s*\\(\\s*['\"]([^'\"]+)['\"]\\s*\\)/g;\n\nconst parsed = new Map<string, { reads: Read[]; reexports: Reexport[] }>();\n\nfunction edges(file: string): { reads: Read[]; reexports: Reexport[] } {\n const hit = parsed.get(file);\n if (hit) return hit;\n const text = read(file);\n const reads: Read[] = [];\n const reexports: Reexport[] = [];\n for (const m of text.matchAll(STATIC_FROM)) {\n if (m[2]) continue;\n const target = resolveSpec(file, m[4]);\n if (!target) continue;\n const pairs = clausePairs(m[3]);\n if (m[1] === 'export') reexports.push({ file: target, pairs });\n else reads.push({ file: target, names: pairs === '*' || pairs.some(([, o]) => o === '*') ? '*' : pairs.map(([, o]) => o) });\n }\n for (const m of text.matchAll(SIDE_EFFECT)) {\n const target = resolveSpec(file, m[1]);\n if (target) reads.push({ file: target, names: [] });\n }\n for (const m of text.matchAll(DYNAMIC)) {\n const target = resolveSpec(file, m[1]);\n if (target) reads.push({ file: target, names: '*' });\n }\n const out = { reads, reexports };\n parsed.set(file, out);\n return out;\n}\n\nconst words = (text: string): Set<string> => new Set(text.match(/[A-Za-z_$][\\w$]*/g) ?? []);\n\n/** What a `cli/` module reaches through `ctx.api`: each `cli-api` export whose name occurs in it. */\nfunction apiReads(file: string): Read[] {\n const barrel = join(SOURCE_ROOT, `cli-api${MODULE_EXT}`);\n const w = words(read(file));\n const out: Read[] = [];\n for (const re of edges(barrel).reexports) {\n if (re.pairs === '*') out.push({ file: re.file, names: '*' });\n else for (const [exported, original] of re.pairs) if (w.has(exported)) out.push({ file: re.file, names: original === '*' ? '*' : [original] });\n }\n return out;\n}\n\n/** Comments that open a line: outside a multi-line template literal a line cannot begin code with\n * `/*` or `//`, so no code is removed. A comment after code stays, which errs toward \"reachable\". */\nconst withoutLeadingComments = (text: string): string =>\n text.replace(/^[ \\t]*\\/\\*[\\s\\S]*?\\*\\//gm, '').replace(/^[ \\t]*\\/\\/.*$/gm, '');\n\nconst mentions = (text: string, name: string): number =>\n text.match(new RegExp(`(?<![\\\\w$])${name.replace(/\\$/g, '\\\\$')}(?![\\\\w$])`, 'g'))?.length ?? 0;\n\nconst cache = new Map<string, Attribution | null>();\nconst loadedCache = new Map<string, { loaded: Set<string>; directReads: Read[] } | null>();\n\n/** Every module `command` loads, and what each reads, or null when the command has no module. */\nfunction loadedModules(command: string): { loaded: Set<string>; directReads: Read[] } | null {\n if (loadedCache.has(command)) return loadedCache.get(command)!;\n const seed = join(SOURCE_ROOT, 'cli', 'commands', `${command}${MODULE_EXT}`);\n if (!existsSync(seed)) {\n loadedCache.set(command, null);\n return null;\n }\n const cliDir = join(SOURCE_ROOT, 'cli') + sep;\n\n // Modules loaded: every import and re-export is followed, since loading runs top-level code.\n const loaded = new Set<string>();\n const directReads: Read[] = [];\n const queue = [seed];\n while (queue.length > 0) {\n const file = queue.pop()!;\n if (loaded.has(file)) continue;\n loaded.add(file);\n const { reads, reexports } = edges(file);\n const all = file.startsWith(cliDir) ? [...reads, ...apiReads(file)] : reads;\n directReads.push(...all);\n for (const t of [...all.map((r) => r.file), ...reexports.map((r) => r.file)]) if (!loaded.has(t)) queue.push(t);\n }\n const out = { loaded, directReads };\n loadedCache.set(command, out);\n return out;\n}\n\n/**\n * SHA-256 of one module's source. The module was found when the import graph was walked, so a\n * failed read is not \"absent\": the value keeps which kind of failure it was (`unreadable (EACCES)`,\n * `unreadable (EISDIR)`, ...), not one word for all of them.\n */\nexport function sourceHash(file: string): string {\n try {\n return createHash('sha256').update(readFileSync(file)).digest('hex');\n } catch (e) {\n const code = e instanceof Error && 'code' in e && typeof e.code === 'string' ? e.code : 'error';\n return `unreadable (${code})`;\n }\n}\n\n/**\n * SHA-256 of the source of every module `command` loads, keyed by module name, read from disk now\n * (not from the parse cache), or null when the command has no module of its own.\n */\nexport function moduleSources(command: string): Record<string, string> | null {\n const mods = loadedModules(command);\n if (!mods) return null;\n const out: Record<string, string> = {};\n for (const file of [...mods.loaded].sort()) out[tableName(file)] = sourceHash(file);\n return out;\n}\n\n/** The reach of `command`'s code into `tables`, or null when the command has no module of its own. */\nexport function staticReach(\n command: string,\n tables: Record<string, { values: Record<string, unknown> }>,\n kinds: Record<string, TableKind>,\n): Attribution | null {\n if (cache.has(command)) return cache.get(command)!;\n const mods = loadedModules(command);\n if (!mods) {\n cache.set(command, null);\n return null;\n }\n const { loaded, directReads } = mods;\n\n // Names read: an import reads its names; a re-export passes on only the names read from it.\n const namesOf = new Map<string, Set<string> | '*'>();\n const mark = (file: string, names: string[] | '*'): void => {\n const prev = namesOf.get(file) ?? new Set<string>();\n if (prev === '*') return;\n const fresh = names === '*' ? ['*'] : names.filter((n) => !prev.has(n));\n if (fresh.length === 0) {\n namesOf.set(file, prev);\n return;\n }\n namesOf.set(file, names === '*' ? '*' : new Set([...prev, ...fresh]));\n for (const re of edges(file).reexports) {\n if (re.pairs === '*') mark(re.file, names === '*' ? '*' : fresh);\n else {\n for (const [exported, original] of re.pairs) {\n if (names === '*' || fresh.includes(exported)) mark(re.file, original === '*' ? '*' : [original]);\n }\n }\n }\n };\n for (const r of directReads) mark(r.file, r.names);\n\n const out: Record<string, string[]> = {};\n for (const [name, table] of Object.entries(tables)) {\n const file = join(SOURCE_ROOT, `${name}${MODULE_EXT}`);\n const names = namesOf.get(file);\n if (!loaded.has(file) || tableName(file) !== name || names === undefined || (names !== '*' && names.size === 0)) continue;\n if (kinds[name] !== 'module-exports') {\n out[name] = ['*'];\n continue;\n }\n const own = withoutLeadingComments(read(file));\n const keys = Object.keys(table.values).filter((k) => names === '*' || names.has(k) || mentions(own, k) > 1);\n if (keys.length > 0) out[name] = keys.length === Object.keys(table.values).length ? ['*'] : keys.sort();\n }\n const attribution: Attribution = { method: REACH_METHOD, command, tables: out };\n cache.set(command, attribution);\n return attribution;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"record-reach.js","sourceRoot":"","sources":["../../src/cli/record-reach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAExF,MAAM,CAAC,MAAM,YAAY,GAAG,qBAAqB,CAAC;AA2BlD,MAAM,MAAM,GAAG,IAAI,GAAG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,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;YAAE,SAAS;QAC1H,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,gBAAgB,EAAE,CAAC;YACrC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAClB,SAAS;QACX,CAAC;QACD,MAAM,GAAG,GAAG,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5G,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC1G,CAAC;IACD,MAAM,WAAW,GAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAChF,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAChC,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["/**\n * Static attribution for an experiment record: which constants a command's code can reach\n * (design: `docs/planning/Experiment-Record-Replay-Design-Note.md`).\n *\n * The reach is derived from the import graph of the modules as they are on disk when the entry is\n * recorded, not declared by hand and not observed while the command runs. It is an UPPER BOUND:\n *\n * - from `cli/commands/<command>` every relative static and literal dynamic import is followed;\n * - a `cli/` module reaches the `cli-api` barrel through `ctx.api`, not through an import, so every\n * barrel export whose name occurs as a word in a reached `cli/` module adds its source module;\n * - a named export of a module-exports table is reached when a reached module imports it by name\n * or by namespace, re-exports it, or the table's own module mentions it outside its declaration;\n * - an object table is reached whole (`*`) when its module is reached.\n *\n * Comments and strings are not stripped, so a name mentioned only in a comment counts as reached:\n * that errs toward \"reachable\", never toward \"not reachable\".\n *\n * The same import graph gives the modules the command loads. Each one's source is hashed, so a\n * change to a literal a module keeps private, which no constant table holds, is still named.\n */\n\nimport { sha256Hex } from '../core/hash.js';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve, sep } from 'node:path';\nimport { MODULE_EXT, SOURCE_ROOT, tableName, type TableKind } from './record-tables.js';\n\nexport const REACH_METHOD = 'static-import-reach';\n\n/** The constant-table keys and module sources a recorded command can reach, by static import reach (it errs toward reachable). */\nexport interface Attribution {\n method: typeof REACH_METHOD;\n command: string;\n /** Table name -> the keys the command's code can reach, or `['*']` for the whole table. */\n tables: Record<string, string[]>;\n /**\n * Module name (as a table is named) -> SHA-256 of its source, for every module the command\n * loads. Absent from entries written before module sources were hashed.\n */\n modules?: Record<string, string>;\n}\n\n/** A reached module reads `names` of `file`, `*` for all of them. */\ninterface Read {\n file: string;\n names: string[] | '*';\n}\n\n/** `file` re-exports: `pairs` as `[exported, original]` (`original` `*` for a namespace), or everything. */\ninterface Reexport {\n file: string;\n pairs: [string, string][] | '*';\n}\n\nconst source = new Map<string, string>();\nconst read = (file: string): string => {\n let s = source.get(file);\n if (s === undefined) {\n s = readFileSync(file, 'utf8');\n source.set(file, s);\n }\n return s;\n};\n\nfunction resolveSpec(from: string, spec: string): string | null {\n if (!spec.startsWith('.')) return null;\n let file = resolve(dirname(from), spec);\n if (MODULE_EXT !== '.js') file = file.replace(/\\.js$/, MODULE_EXT);\n return existsSync(file) ? file : null;\n}\n\n/** `[exported-or-local, original]` for each value binding of an import or export clause. */\nfunction clausePairs(clause: string): [string, string][] | '*' {\n const ns = /\\*\\s*as\\s+([\\w$]+)/.exec(clause);\n if (ns) return [[ns[1], '*']];\n if (/^\\s*\\*\\s*$/.test(clause)) return '*';\n const pairs: [string, string][] = [];\n const braces = /\\{([^}]*)\\}/.exec(clause);\n if (braces) {\n for (const part of braces[1].split(',')) {\n const m = /^\\s*(type\\s+)?([\\w$]+)(?:\\s+as\\s+([\\w$]+))?/.exec(part);\n if (m && !m[1]) pairs.push([m[3] ?? m[2], m[2]]);\n }\n }\n const def = /^\\s*([\\w$]+)\\s*(,|$)/.exec(clause);\n if (def && def[1] !== 'type') pairs.push([def[1], 'default']);\n return pairs;\n}\n\nconst STATIC_FROM = /\\b(import|export)\\s+(type\\s+)?([^'\";]*?)\\s*from\\s*['\"]([^'\"]+)['\"]/g;\nconst SIDE_EFFECT = /\\bimport\\s*['\"]([^'\"]+)['\"]/g;\nconst DYNAMIC = /\\bimport\\s*\\(\\s*['\"]([^'\"]+)['\"]\\s*\\)/g;\n\nconst parsed = new Map<string, { reads: Read[]; reexports: Reexport[] }>();\n\nfunction edges(file: string): { reads: Read[]; reexports: Reexport[] } {\n const hit = parsed.get(file);\n if (hit) return hit;\n const text = read(file);\n const reads: Read[] = [];\n const reexports: Reexport[] = [];\n for (const m of text.matchAll(STATIC_FROM)) {\n if (m[2]) continue;\n const target = resolveSpec(file, m[4]);\n if (!target) continue;\n const pairs = clausePairs(m[3]);\n if (m[1] === 'export') reexports.push({ file: target, pairs });\n else reads.push({ file: target, names: pairs === '*' || pairs.some(([, o]) => o === '*') ? '*' : pairs.map(([, o]) => o) });\n }\n for (const m of text.matchAll(SIDE_EFFECT)) {\n const target = resolveSpec(file, m[1]);\n if (target) reads.push({ file: target, names: [] });\n }\n for (const m of text.matchAll(DYNAMIC)) {\n const target = resolveSpec(file, m[1]);\n if (target) reads.push({ file: target, names: '*' });\n }\n const out = { reads, reexports };\n parsed.set(file, out);\n return out;\n}\n\nconst words = (text: string): Set<string> => new Set(text.match(/[A-Za-z_$][\\w$]*/g) ?? []);\n\n/** What a `cli/` module reaches through `ctx.api`: each `cli-api` export whose name occurs in it. */\nfunction apiReads(file: string): Read[] {\n const barrel = join(SOURCE_ROOT, `cli-api${MODULE_EXT}`);\n const w = words(read(file));\n const out: Read[] = [];\n for (const re of edges(barrel).reexports) {\n if (re.pairs === '*') out.push({ file: re.file, names: '*' });\n else for (const [exported, original] of re.pairs) if (w.has(exported)) out.push({ file: re.file, names: original === '*' ? '*' : [original] });\n }\n return out;\n}\n\n/** Comments that open a line: outside a multi-line template literal a line cannot begin code with\n * `/*` or `//`, so no code is removed. A comment after code stays, which errs toward \"reachable\". */\nconst withoutLeadingComments = (text: string): string =>\n text.replace(/^[ \\t]*\\/\\*[\\s\\S]*?\\*\\//gm, '').replace(/^[ \\t]*\\/\\/.*$/gm, '');\n\nconst mentions = (text: string, name: string): number =>\n text.match(new RegExp(`(?<![\\\\w$])${name.replace(/\\$/g, '\\\\$')}(?![\\\\w$])`, 'g'))?.length ?? 0;\n\nconst cache = new Map<string, Attribution | null>();\nconst loadedCache = new Map<string, { loaded: Set<string>; directReads: Read[] } | null>();\n\n/** Every module `command` loads, and what each reads, or null when the command has no module. */\nfunction loadedModules(command: string): { loaded: Set<string>; directReads: Read[] } | null {\n if (loadedCache.has(command)) return loadedCache.get(command)!;\n const seed = join(SOURCE_ROOT, 'cli', 'commands', `${command}${MODULE_EXT}`);\n if (!existsSync(seed)) {\n loadedCache.set(command, null);\n return null;\n }\n const cliDir = join(SOURCE_ROOT, 'cli') + sep;\n\n // Modules loaded: every import and re-export is followed, since loading runs top-level code.\n const loaded = new Set<string>();\n const directReads: Read[] = [];\n const queue = [seed];\n while (queue.length > 0) {\n const file = queue.pop()!;\n if (loaded.has(file)) continue;\n loaded.add(file);\n const { reads, reexports } = edges(file);\n const all = file.startsWith(cliDir) ? [...reads, ...apiReads(file)] : reads;\n directReads.push(...all);\n for (const t of [...all.map((r) => r.file), ...reexports.map((r) => r.file)]) if (!loaded.has(t)) queue.push(t);\n }\n const out = { loaded, directReads };\n loadedCache.set(command, out);\n return out;\n}\n\n/**\n * SHA-256 of one module's source. The module was found when the import graph was walked, so a\n * failed read is not \"absent\": the value keeps which kind of failure it was (`unreadable (EACCES)`,\n * `unreadable (EISDIR)`, ...), not one word for all of them.\n */\nexport function sourceHash(file: string): string {\n try {\n return sha256Hex(readFileSync(file));\n } catch (e) {\n const code = e instanceof Error && 'code' in e && typeof e.code === 'string' ? e.code : 'error';\n return `unreadable (${code})`;\n }\n}\n\n/**\n * SHA-256 of the source of every module `command` loads, keyed by module name, read from disk now\n * (not from the parse cache), or null when the command has no module of its own.\n */\nexport function moduleSources(command: string): Record<string, string> | null {\n const mods = loadedModules(command);\n if (!mods) return null;\n const out: Record<string, string> = {};\n for (const file of [...mods.loaded].sort()) out[tableName(file)] = sourceHash(file);\n return out;\n}\n\n/** The reach of `command`'s code into `tables`, or null when the command has no module of its own. */\nexport function staticReach(\n command: string,\n tables: Record<string, { values: Record<string, unknown> }>,\n kinds: Record<string, TableKind>,\n): Attribution | null {\n if (cache.has(command)) return cache.get(command)!;\n const mods = loadedModules(command);\n if (!mods) {\n cache.set(command, null);\n return null;\n }\n const { loaded, directReads } = mods;\n\n // Names read: an import reads its names; a re-export passes on only the names read from it.\n const namesOf = new Map<string, Set<string> | '*'>();\n const mark = (file: string, names: string[] | '*'): void => {\n const prev = namesOf.get(file) ?? new Set<string>();\n if (prev === '*') return;\n const fresh = names === '*' ? ['*'] : names.filter((n) => !prev.has(n));\n if (fresh.length === 0) {\n namesOf.set(file, prev);\n return;\n }\n namesOf.set(file, names === '*' ? '*' : new Set([...prev, ...fresh]));\n for (const re of edges(file).reexports) {\n if (re.pairs === '*') mark(re.file, names === '*' ? '*' : fresh);\n else {\n for (const [exported, original] of re.pairs) {\n if (names === '*' || fresh.includes(exported)) mark(re.file, original === '*' ? '*' : [original]);\n }\n }\n }\n };\n for (const r of directReads) mark(r.file, r.names);\n\n const out: Record<string, string[]> = {};\n for (const [name, table] of Object.entries(tables)) {\n const file = join(SOURCE_ROOT, `${name}${MODULE_EXT}`);\n const names = namesOf.get(file);\n if (!loaded.has(file) || tableName(file) !== name || names === undefined || (names !== '*' && names.size === 0)) continue;\n if (kinds[name] !== 'module-exports') {\n out[name] = ['*'];\n continue;\n }\n const own = withoutLeadingComments(read(file));\n const keys = Object.keys(table.values).filter((k) => names === '*' || names.has(k) || mentions(own, k) > 1);\n if (keys.length > 0) out[name] = keys.length === Object.keys(table.values).length ? ['*'] : keys.sort();\n }\n const attribution: Attribution = { method: REACH_METHOD, command, tables: out };\n cache.set(command, attribution);\n return attribution;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-tables.d.ts","sourceRoot":"","sources":["../../src/cli/record-tables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"record-tables.d.ts","sourceRoot":"","sources":["../../src/cli/record-tables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAaH,oFAAoF;AACpF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD,uFAAuF;AACvF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEpD,mGAAmG;AACnG,eAAO,MAAM,WAAW,QAAiD,CAAC;AAC1E,eAAO,MAAM,UAAU,QAA0C,CAAC;AAElE,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,WAAY,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,KAAG,MACgC,CAAC;AA6BvG,eAAO,MAAM,SAAS,SAAU,MAAM,KAAG,MACsC,CAAC;AAiChF,oGAAoG;AACpG,wBAAgB,cAAc,IAAI,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;CAAE,CAAC,CAoBrH"}
|
|
@@ -16,21 +16,22 @@
|
|
|
16
16
|
*
|
|
17
17
|
* A literal a module keeps private (not exported, not in one of the object tables) is in no table.
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
19
|
+
import { compareCodepoint } from '../core/compare.js';
|
|
20
|
+
import { sha256Hex } from '../core/hash.js';
|
|
20
21
|
import { readdirSync, statSync } from 'node:fs';
|
|
21
22
|
import { extname, join, relative, sep } from 'node:path';
|
|
22
23
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
23
24
|
import { CANONICAL_CONSTANTS } from '../composition/canonical-graph.js';
|
|
24
25
|
import { CONSTANTS as SYMBOLIC_CONSTANTS } from '../dimensional/symbolic-constants.js';
|
|
26
|
+
import { BASES } from '../dimensional/algebra.js';
|
|
25
27
|
import { unitTables } from '../dimensional/units.js';
|
|
26
|
-
const sha256 = (s) => createHash('sha256').update(s).digest('hex');
|
|
27
28
|
/** Source root (`dist/` when built, `src/` under a TypeScript loader) and its module extension. */
|
|
28
29
|
export const SOURCE_ROOT = fileURLToPath(new URL('../', import.meta.url));
|
|
29
30
|
export const MODULE_EXT = extname(fileURLToPath(import.meta.url));
|
|
30
31
|
/** Serialised with sorted keys so the fingerprint does not depend on declaration order. */
|
|
31
|
-
export const tableFingerprint = (values) =>
|
|
32
|
+
export const tableFingerprint = (values) => sha256Hex(JSON.stringify(Object.fromEntries(Object.keys(values).sort().map((k) => [k, values[k]]))));
|
|
32
33
|
/** Exponents in a fixed base order, independent of how `format()` names a dimension. */
|
|
33
|
-
const dimensionText = (d) =>
|
|
34
|
+
const dimensionText = (d) => BASES
|
|
34
35
|
.filter((b) => d[b] !== 0)
|
|
35
36
|
.map((b) => `${b}^${d[b]}`)
|
|
36
37
|
.join(' ') || '1';
|
|
@@ -101,7 +102,7 @@ export function constantTables() {
|
|
|
101
102
|
}
|
|
102
103
|
for (const [name, values] of Object.entries(objectTables()))
|
|
103
104
|
found.push([name, values, 'object']);
|
|
104
|
-
found.sort(([a], [b]) => (a
|
|
105
|
+
found.sort(([a], [b]) => compareCodepoint(a, b));
|
|
105
106
|
const tables = {};
|
|
106
107
|
const kinds = {};
|
|
107
108
|
for (const [name, values, kind] of found) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-tables.js","sourceRoot":"","sources":["../../src/cli/record-tables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAcrD,MAAM,MAAM,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAEnF,mGAAmG;AACnG,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,G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AC,GAAG,IAAI,CAAC;QACrB,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC,CAAC,EAAE,CAAC;IACL,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * The constant tables an experiment record fingerprints, each under its own name so replay can\n * say WHICH table changed (design: `docs/planning/Experiment-Record-Replay-Design-Note.md`).\n *\n * A table is named by the source module that holds it, relative to the source root and without\n * extension (`core/constants`, `dimensional/units`, `bridges/be58-johnson-nyquist-confrontation`).\n * Two kinds:\n *\n * - **module exports** — every numeric export of `core/constants` and of each module under\n * `bridges/` and `cases/`, found by listing those directories, so a module added later is\n * fingerprinted without being listed here;\n * - **object tables** — the unit and prefix tables of `dimensional/units` (with the SHA-256 of\n * `data/units.json`, the file they are read from), and the constant\n * registries `dimensional/symbolic-constants` and `composition/canonical-graph`, flattened to\n * `key.field` entries.\n *\n * A literal a module keeps private (not exported, not in one of the object tables) is in no table.\n */\n\nimport { createHash } from 'node:crypto';\nimport { readdirSync, statSync } from 'node:fs';\nimport { extname, join, relative, sep } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport { CANONICAL_CONSTANTS } from '../composition/canonical-graph.js';\nimport { CONSTANTS as SYMBOLIC_CONSTANTS } from '../dimensional/symbolic-constants.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { unitTables } from '../dimensional/units.js';\n\n/** A serialisable primitive value that can be fingerprinted in a constant table. */\nexport type TableValue = number | string | boolean;\n\n/** A named table of constants and the SHA-256 fingerprint of its serialised values. */\nexport interface ConstantTable {\n values: Record<string, TableValue>;\n sha256: string;\n}\n\n/** The source shape used to build a constant table. */\nexport type TableKind = 'module-exports' | 'object';\n\nconst sha256 = (s: string): string => createHash('sha256').update(s).digest('hex');\n\n/** Source root (`dist/` when built, `src/` under a TypeScript loader) and its module extension. */\nexport const SOURCE_ROOT = fileURLToPath(new URL('../', import.meta.url));\nexport const MODULE_EXT = extname(fileURLToPath(import.meta.url));\n\n/** Serialised with sorted keys so the fingerprint does not depend on declaration order. */\nexport const tableFingerprint = (values: Record<string, TableValue>): string =>\n sha256(JSON.stringify(Object.fromEntries(Object.keys(values).sort().map((k) => [k, values[k]]))));\n\n/** Exponents in a fixed base order, independent of how `format()` names a dimension. */\nconst dimensionText = (d: Dimension): string =>\n (['L', 'M', 'T', 'I', 'Theta', 'N', 'J'] as const)\n .filter((b) => d[b] !== 0)\n .map((b) => `${b}^${d[b]}`)\n .join(' ') || '1';\n\nconst MODULE_EXPORT_ROOTS = ['core/constants', 'bridges', 'cases'];\n\nfunction moduleFiles(rel: string): string[] {\n const path = join(SOURCE_ROOT, rel);\n let isDir = false;\n try {\n isDir = statSync(path).isDirectory();\n } catch {\n return [path + MODULE_EXT];\n }\n if (!isDir) return [path];\n return readdirSync(path)\n .sort()\n .flatMap((f) => {\n const p = join(path, f);\n if (statSync(p).isDirectory()) return moduleFiles(join(rel, f));\n return f.endsWith(MODULE_EXT) && !f.endsWith(`.d${MODULE_EXT}`) && f !== `index${MODULE_EXT}` ? [p] : [];\n });\n}\n\nexport const tableName = (file: string): string =>\n relative(SOURCE_ROOT, file).slice(0, -MODULE_EXT.length).split(sep).join('/');\n\nfunction objectTables(): Record<string, Record<string, TableValue>> {\n const units: Record<string, TableValue> = {};\n const { units: unitMap, prefixes, celsiusOffsetK, sourceSha256 } = unitTables();\n for (const [sym, [scale, dim, prefixable, cycles]] of unitMap) {\n units[`${sym}.scale`] = scale;\n units[`${sym}.dimension`] = dimensionText(dim);\n units[`${sym}.prefixable`] = prefixable;\n // A cycle-counting row multiplies an angular input by 2π, so it changes a result like a scale does.\n units[`${sym}.cycles`] = cycles; // the cycle-count flag (Hz, rpm); the reader keeps the count and prints a note, it does not multiply by 2π\n }\n for (const [p, f] of prefixes) units[`prefix.${p}`] = f;\n units['degC.offsetK'] = celsiusOffsetK;\n // The whole file, so a refused spelling, a prefix letter, an affine row or a note is covered too.\n units['data/units.json.sha256'] = sourceSha256;\n const registry = (table: Readonly<Record<string, { value: number; dim: Dimension }>>): Record<string, TableValue> => {\n const out: Record<string, TableValue> = {};\n for (const [k, c] of Object.entries(table)) {\n out[`${k}.value`] = c.value;\n out[`${k}.dimension`] = dimensionText(c.dim);\n }\n return out;\n };\n return {\n 'dimensional/units': units,\n 'dimensional/symbolic-constants': registry(SYMBOLIC_CONSTANTS),\n 'composition/canonical-graph': registry(CANONICAL_CONSTANTS),\n };\n}\n\nlet cached: Promise<{ tables: Record<string, ConstantTable>; kinds: Record<string, TableKind> }> | undefined;\n\n/** Every table, keyed by name, sorted. Read once per process: tables are module-level constants. */\nexport function constantTables(): Promise<{ tables: Record<string, ConstantTable>; kinds: Record<string, TableKind> }> {\n cached ??= (async () => {\n const found: [string, Record<string, TableValue>, TableKind][] = [];\n for (const file of MODULE_EXPORT_ROOTS.flatMap(moduleFiles)) {\n const mod = (await import(pathToFileURL(file).href)) as Record<string, unknown>;\n const values: Record<string, TableValue> = {};\n for (const [k, v] of Object.entries(mod)) if (typeof v === 'number') values[k] = v;\n if (Object.keys(values).length > 0) found.push([tableName(file), values, 'module-exports']);\n }\n for (const [name, values] of Object.entries(objectTables())) found.push([name, values, 'object']);\n found.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));\n const tables: Record<string, ConstantTable> = {};\n const kinds: Record<string, TableKind> = {};\n for (const [name, values, kind] of found) {\n tables[name] = { values, sha256: tableFingerprint(values) };\n kinds[name] = kind;\n }\n return { tables, kinds };\n })();\n return cached;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"record-tables.js","sourceRoot":"","sources":["../../src/cli/record-tables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EA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kC,EAAE,CAAC;QACjD,MAAM,KAAK,GAA8B,EAAE,CAAC;QAC5C,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5D,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QACrB,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC,CAAC,EAAE,CAAC;IACL,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * The constant tables an experiment record fingerprints, each under its own name so replay can\n * say WHICH table changed (design: `docs/planning/Experiment-Record-Replay-Design-Note.md`).\n *\n * A table is named by the source module that holds it, relative to the source root and without\n * extension (`core/constants`, `dimensional/units`, `bridges/be58-johnson-nyquist-confrontation`).\n * Two kinds:\n *\n * - **module exports** — every numeric export of `core/constants` and of each module under\n * `bridges/` and `cases/`, found by listing those directories, so a module added later is\n * fingerprinted without being listed here;\n * - **object tables** — the unit and prefix tables of `dimensional/units` (with the SHA-256 of\n * `data/units.json`, the file they are read from), and the constant\n * registries `dimensional/symbolic-constants` and `composition/canonical-graph`, flattened to\n * `key.field` entries.\n *\n * A literal a module keeps private (not exported, not in one of the object tables) is in no table.\n */\n\nimport { compareCodepoint } from '../core/compare.js';\nimport { sha256Hex } from '../core/hash.js';\nimport { readdirSync, statSync } from 'node:fs';\nimport { extname, join, relative, sep } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport { CANONICAL_CONSTANTS } from '../composition/canonical-graph.js';\nimport { CONSTANTS as SYMBOLIC_CONSTANTS } from '../dimensional/symbolic-constants.js';\nimport { BASES } from '../dimensional/algebra.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { unitTables } from '../dimensional/units.js';\n\n/** A serialisable primitive value that can be fingerprinted in a constant table. */\nexport type TableValue = number | string | boolean;\n\n/** A named table of constants and the SHA-256 fingerprint of its serialised values. */\nexport interface ConstantTable {\n values: Record<string, TableValue>;\n sha256: string;\n}\n\n/** The source shape used to build a constant table. */\nexport type TableKind = 'module-exports' | 'object';\n\n/** Source root (`dist/` when built, `src/` under a TypeScript loader) and its module extension. */\nexport const SOURCE_ROOT = fileURLToPath(new URL('../', import.meta.url));\nexport const MODULE_EXT = extname(fileURLToPath(import.meta.url));\n\n/** Serialised with sorted keys so the fingerprint does not depend on declaration order. */\nexport const tableFingerprint = (values: Record<string, TableValue>): string =>\n sha256Hex(JSON.stringify(Object.fromEntries(Object.keys(values).sort().map((k) => [k, values[k]]))));\n\n/** Exponents in a fixed base order, independent of how `format()` names a dimension. */\nconst dimensionText = (d: Dimension): string =>\n BASES\n .filter((b) => d[b] !== 0)\n .map((b) => `${b}^${d[b]}`)\n .join(' ') || '1';\n\nconst MODULE_EXPORT_ROOTS = ['core/constants', 'bridges', 'cases'];\n\nfunction moduleFiles(rel: string): string[] {\n const path = join(SOURCE_ROOT, rel);\n let isDir = false;\n try {\n isDir = statSync(path).isDirectory();\n } catch {\n return [path + MODULE_EXT];\n }\n if (!isDir) return [path];\n return readdirSync(path)\n .sort()\n .flatMap((f) => {\n const p = join(path, f);\n if (statSync(p).isDirectory()) return moduleFiles(join(rel, f));\n return f.endsWith(MODULE_EXT) && !f.endsWith(`.d${MODULE_EXT}`) && f !== `index${MODULE_EXT}` ? [p] : [];\n });\n}\n\nexport const tableName = (file: string): string =>\n relative(SOURCE_ROOT, file).slice(0, -MODULE_EXT.length).split(sep).join('/');\n\nfunction objectTables(): Record<string, Record<string, TableValue>> {\n const units: Record<string, TableValue> = {};\n const { units: unitMap, prefixes, celsiusOffsetK, sourceSha256 } = unitTables();\n for (const [sym, [scale, dim, prefixable, cycles]] of unitMap) {\n units[`${sym}.scale`] = scale;\n units[`${sym}.dimension`] = dimensionText(dim);\n units[`${sym}.prefixable`] = prefixable;\n // A cycle-counting row multiplies an angular input by 2π, so it changes a result like a scale does.\n units[`${sym}.cycles`] = cycles; // the cycle-count flag (Hz, rpm); the reader keeps the count and prints a note, it does not multiply by 2π\n }\n for (const [p, f] of prefixes) units[`prefix.${p}`] = f;\n units['degC.offsetK'] = celsiusOffsetK;\n // The whole file, so a refused spelling, a prefix letter, an affine row or a note is covered too.\n units['data/units.json.sha256'] = sourceSha256;\n const registry = (table: Readonly<Record<string, { value: number; dim: Dimension }>>): Record<string, TableValue> => {\n const out: Record<string, TableValue> = {};\n for (const [k, c] of Object.entries(table)) {\n out[`${k}.value`] = c.value;\n out[`${k}.dimension`] = dimensionText(c.dim);\n }\n return out;\n };\n return {\n 'dimensional/units': units,\n 'dimensional/symbolic-constants': registry(SYMBOLIC_CONSTANTS),\n 'composition/canonical-graph': registry(CANONICAL_CONSTANTS),\n };\n}\n\nlet cached: Promise<{ tables: Record<string, ConstantTable>; kinds: Record<string, TableKind> }> | undefined;\n\n/** Every table, keyed by name, sorted. Read once per process: tables are module-level constants. */\nexport function constantTables(): Promise<{ tables: Record<string, ConstantTable>; kinds: Record<string, TableKind> }> {\n cached ??= (async () => {\n const found: [string, Record<string, TableValue>, TableKind][] = [];\n for (const file of MODULE_EXPORT_ROOTS.flatMap(moduleFiles)) {\n const mod = (await import(pathToFileURL(file).href)) as Record<string, unknown>;\n const values: Record<string, TableValue> = {};\n for (const [k, v] of Object.entries(mod)) if (typeof v === 'number') values[k] = v;\n if (Object.keys(values).length > 0) found.push([tableName(file), values, 'module-exports']);\n }\n for (const [name, values] of Object.entries(objectTables())) found.push([name, values, 'object']);\n found.sort(([a], [b]) => compareCodepoint(a, b));\n const tables: Record<string, ConstantTable> = {};\n const kinds: Record<string, TableKind> = {};\n for (const [name, values, kind] of found) {\n tables[name] = { values, sha256: tableFingerprint(values) };\n kinds[name] = kind;\n }\n return { tables, kinds };\n })();\n return cached;\n}\n"]}
|
package/dist/cli/record.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export type Io = {
|
|
|
23
23
|
};
|
|
24
24
|
/** A CLI dispatcher invoked with argv and an isolated output sink. */
|
|
25
25
|
export type Dispatch = (argv: string[], io: Io) => Promise<number>;
|
|
26
|
-
export declare const RECORD_SCHEMA = "upt-record/2";
|
|
27
26
|
/** The toolchain, parser, peers and constants captured beside a CLI invocation. */
|
|
28
27
|
export interface RecordEnvironment {
|
|
29
28
|
uptVersion: string;
|
|
@@ -44,7 +43,7 @@ export interface RecordResult {
|
|
|
44
43
|
}
|
|
45
44
|
/** One JSON-lines record entry for a CLI invocation and its replay inputs. */
|
|
46
45
|
export interface RecordEntry {
|
|
47
|
-
schema:
|
|
46
|
+
schema: 'upt-record/2';
|
|
48
47
|
recordedAt: string;
|
|
49
48
|
argv: string[];
|
|
50
49
|
argvSha256: string;
|
|
@@ -76,9 +75,6 @@ export interface RecordInput {
|
|
|
76
75
|
sha256: string | null;
|
|
77
76
|
}
|
|
78
77
|
export declare const sha256: (s: string | Buffer) => string;
|
|
79
|
-
export declare const argvFingerprint: (argv: unknown) => string;
|
|
80
|
-
/** Hash a record entry after excluding its stored fingerprint field. */
|
|
81
|
-
export declare function entryFingerprint(entry: Partial<RecordEntry>): string;
|
|
82
78
|
/** Run `argv` exactly as without `--record`, then append its entry. An unexpected exception is
|
|
83
79
|
* recorded and rethrown, so recording never changes what the caller sees. */
|
|
84
80
|
export declare function recordInvocation(file: string, argv: string[], dispatch: Dispatch, io: Io, api: typeof cliApi): Promise<number>;
|
package/dist/cli/record.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/cli/record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../src/cli/record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAM7C,OAAO,EA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6D;AAC7D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,MAAM,CAqCtE"}
|
package/dist/cli/record.js
CHANGED
|
@@ -12,25 +12,26 @@
|
|
|
12
12
|
* `main.ts` passes its dispatcher and the `cli-api` barrel in, so this module
|
|
13
13
|
* neither imports the barrel nor re-enters the global-option parser.
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
15
|
+
import { readJsonFile } from '../core/data-file.js';
|
|
16
|
+
import { sha256Hex } from '../core/hash.js';
|
|
16
17
|
import { appendFileSync, closeSync, existsSync, mkdtempSync, openSync, readFileSync, rmSync } from 'node:fs';
|
|
17
18
|
import { tmpdir } from 'node:os';
|
|
18
19
|
import { basename, join } from 'node:path';
|
|
19
20
|
import { parseArgs } from './args.js';
|
|
20
21
|
import { resolveCommand } from './command.js';
|
|
21
|
-
import { storedResultsFile } from './
|
|
22
|
+
import { storedResultsFile } from './stored-results.js';
|
|
22
23
|
import { CliError, UsageError } from './errors.js';
|
|
23
24
|
import { emitJson } from './output.js';
|
|
24
25
|
import { moduleSources, staticReach } from './record-reach.js';
|
|
25
26
|
import { constantTables, tableFingerprint } from './record-tables.js';
|
|
26
27
|
import { canonicalJson, captureEnvironment } from '../composition/canonical-json.js';
|
|
27
28
|
import { packageVersion, peerVersions } from './version.js';
|
|
28
|
-
|
|
29
|
+
const RECORD_SCHEMA = 'upt-record/2';
|
|
29
30
|
const SUPERSEDED_SCHEMA = 'upt-record/1';
|
|
30
|
-
export const sha256 = (s) =>
|
|
31
|
-
|
|
31
|
+
export const sha256 = (s) => sha256Hex(s);
|
|
32
|
+
const argvFingerprint = (argv) => sha256(canonicalJson(argv, 'record'));
|
|
32
33
|
/** Hash a record entry after excluding its stored fingerprint field. */
|
|
33
|
-
|
|
34
|
+
function entryFingerprint(entry) {
|
|
34
35
|
const { entrySha256: _, ...rest } = entry;
|
|
35
36
|
return sha256(canonicalJson(rest, 'record'));
|
|
36
37
|
}
|
|
@@ -59,7 +60,7 @@ function parseInvocation(argv) {
|
|
|
59
60
|
if (!command)
|
|
60
61
|
return null;
|
|
61
62
|
try {
|
|
62
|
-
const { flags, positionals } = parseArgs(command.name, rest, command.flags);
|
|
63
|
+
const { flags, positionals } = parseArgs(command.name, rest, command.flags, command.positionals);
|
|
63
64
|
return { command: command.name, flags: Object.fromEntries(flags), positionals };
|
|
64
65
|
}
|
|
65
66
|
catch (e) {
|
|
@@ -87,7 +88,7 @@ function hashFile(path) {
|
|
|
87
88
|
/** The observations file a problem file names, or null (also when the problem cannot be read). */
|
|
88
89
|
function observationsOf(problem, api) {
|
|
89
90
|
try {
|
|
90
|
-
const raw =
|
|
91
|
+
const raw = readJsonFile(problem);
|
|
91
92
|
return typeof raw === 'object' && raw !== null && 'observationsPath' in raw && typeof raw.observationsPath === 'string'
|
|
92
93
|
? api.resolveObservationsPath({ observationsPath: raw.observationsPath }, problem)
|
|
93
94
|
: null;
|