@eagleoutice/flowr 2.12.3 → 2.13.1
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 +42 -95
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +3 -3
- package/abstract-interpretation/data-frame/dataframe-domain.js +14 -6
- package/abstract-interpretation/data-frame/semantics.js +12 -16
- package/abstract-interpretation/domains/abstract-domain.d.ts +46 -44
- package/abstract-interpretation/domains/abstract-domain.js +146 -6
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +16 -25
- package/abstract-interpretation/domains/bounded-set-domain.js +22 -69
- package/abstract-interpretation/domains/interval-domain.d.ts +27 -36
- package/abstract-interpretation/domains/interval-domain.js +111 -146
- package/abstract-interpretation/domains/lattice.d.ts +3 -3
- package/abstract-interpretation/domains/multi-value-state-domain.js +3 -3
- package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -19
- package/abstract-interpretation/domains/partial-product-domain.js +21 -54
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +8 -12
- package/abstract-interpretation/domains/positive-interval-domain.js +21 -50
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/product-domain.js +4 -4
- package/abstract-interpretation/domains/set-range-domain.d.ts +60 -56
- package/abstract-interpretation/domains/set-range-domain.js +141 -200
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +17 -23
- package/abstract-interpretation/domains/set-upper-bound-domain.js +59 -103
- package/abstract-interpretation/domains/singleton-domain.d.ts +15 -18
- package/abstract-interpretation/domains/singleton-domain.js +33 -72
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +12 -16
- package/abstract-interpretation/domains/state-abstract-domain.js +36 -126
- package/abstract-interpretation/domains/state-domain-like.d.ts +2 -2
- package/abstract-interpretation/domains/value-abstract-domain.d.ts +120 -0
- package/abstract-interpretation/domains/{satisfiable-domain.js → value-abstract-domain.js} +14 -2
- package/benchmark/slicer.d.ts +2 -2
- package/benchmark/slicer.js +6 -5
- package/cli/common/options.d.ts +20 -0
- package/cli/common/options.js +4 -0
- package/cli/common/scripts-info.d.ts +20 -0
- package/cli/flowr-main-options.d.ts +4 -0
- package/cli/flowr-main-options.js +5 -0
- package/cli/flowr.d.ts +5 -0
- package/cli/flowr.js +15 -7
- package/cli/repl/commands/repl-commands.d.ts +8 -0
- package/cli/repl/commands/repl-commands.js +16 -3
- package/cli/repl/commands/repl-query.js +50 -20
- package/cli/repl/commands/repl-signature.js +2 -2
- package/cli/repl/core.d.ts +14 -5
- package/cli/repl/core.js +32 -17
- package/cli/repl/parser/slice-query-parser.d.ts +69 -8
- package/cli/repl/parser/slice-query-parser.js +82 -13
- package/cli/repl/path-input.d.ts +6 -0
- package/cli/repl/path-input.js +41 -0
- package/cli/repl/print-version.js +3 -5
- package/cli/slicer-app.d.ts +4 -0
- package/cli/slicer-app.js +4 -2
- package/config.d.ts +56 -6
- package/config.js +134 -12
- package/control-flow/control-flow-graph.d.ts +3 -2
- package/control-flow/control-flow-graph.js +34 -14
- package/control-flow/semantic-cfg-guided-visitor.d.ts +3 -0
- package/control-flow/semantic-cfg-guided-visitor.js +3 -0
- package/core/steps/all/static-slicing/10-reconstruct.d.ts +6 -0
- package/core/steps/all/static-slicing/10-reconstruct.js +3 -1
- package/data/r-base-packages.generated.d.ts +1 -1
- package/data/r-base-packages.generated.js +3 -3
- package/data/sigdb/sigdb.remote.json +53 -53
- package/dataflow/environments/built-in-proc-name.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.js +2 -0
- package/dataflow/environments/built-in.d.ts +2 -0
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +3 -5
- package/dataflow/environments/default-builtin-config.js +2 -2
- package/dataflow/environments/environment.d.ts +9 -0
- package/dataflow/environments/environment.js +28 -7
- package/dataflow/environments/identifier.d.ts +1 -2
- package/dataflow/environments/identifier.js +1 -5
- package/dataflow/extractor.js +1 -2
- package/dataflow/graph/dataflowgraph-builder.js +42 -3
- package/dataflow/graph/df-helper.d.ts +15 -0
- package/dataflow/graph/df-helper.js +20 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +57 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +12 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +233 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +5 -3
- package/documentation/data/faq/faqs.js +12 -1
- package/documentation/doc-readme.js +1 -1
- package/documentation/doc-util/doc-files.d.ts +2 -2
- package/documentation/doc-util/doc-files.js +4 -7
- package/documentation/doc-util/doc-query.d.ts +12 -9
- package/documentation/doc-util/doc-query.js +63 -28
- package/documentation/wiki-absint.js +1 -4
- package/documentation/wiki-analyzer.js +8 -3
- package/documentation/wiki-cfg.js +3 -2
- package/documentation/wiki-dataflow-graph.js +14 -4
- package/documentation/wiki-interface.js +30 -16
- package/documentation/wiki-mk/doc-maker.js +1 -1
- package/documentation/wiki-query.js +190 -30
- package/documentation/wiki-signature-database.d.ts +1 -1
- package/documentation/wiki-signature-database.js +53 -27
- package/linter/linter-output.d.ts +24 -0
- package/linter/linter-output.js +117 -0
- package/linter/linter-rules.d.ts +2 -4
- package/linter/rules/dataframe-access-validation.js +4 -4
- package/linter/rules/deprecated-functions.d.ts +2 -4
- package/linter/rules/deprecated-functions.js +58 -3
- package/linter/rules/undefined-symbol.js +18 -10
- package/linter/rules/unused-definition.js +24 -0
- package/package.json +5 -2
- package/project/context/flowr-analyzer-context.d.ts +61 -1
- package/project/context/flowr-analyzer-context.js +124 -3
- package/project/context/flowr-analyzer-dependencies-context.d.ts +32 -7
- package/project/context/flowr-analyzer-dependencies-context.js +33 -3
- package/project/context/flowr-analyzer-files-context.d.ts +40 -0
- package/project/context/flowr-analyzer-files-context.js +171 -14
- package/project/context/flowr-analyzer-loading-order-context.d.ts +6 -0
- package/project/context/flowr-analyzer-loading-order-context.js +20 -0
- package/project/context/flowr-analyzer-meta-context.d.ts +92 -10
- package/project/context/flowr-analyzer-meta-context.js +64 -23
- package/project/context/flowr-file.d.ts +7 -0
- package/project/context/flowr-file.js +7 -0
- package/project/context/project-kind.d.ts +22 -0
- package/project/context/project-kind.js +27 -0
- package/project/dependency-version-space.d.ts +168 -0
- package/project/dependency-version-space.js +570 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/flowr-analyzer.d.ts +7 -0
- package/project/flowr-analyzer.js +9 -0
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +7 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +5 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +739 -0
- package/project/plugins/file-plugins/files/flowr-rda-file.js +2407 -0
- package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +31 -0
- package/project/plugins/file-plugins/files/flowr-rproject-file.js +66 -0
- package/project/plugins/file-plugins/files/r-fun-tab.d.ts +828 -0
- package/project/plugins/file-plugins/files/r-fun-tab.js +1039 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +26 -0
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +38 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +17 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +30 -0
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +36 -0
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +3 -4
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +5 -6
- package/project/plugins/flowr-analyzer-plugin.js +5 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.d.ts +14 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.js +53 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.d.ts +15 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +18 -13
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +13 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +32 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +8 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +70 -7
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.d.ts +18 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +62 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +5 -13
- package/project/plugins/package-version-plugins/package.d.ts +4 -1
- package/project/plugins/package-version-plugins/package.js +8 -5
- package/project/plugins/plugin-registry.d.ts +11 -3
- package/project/plugins/plugin-registry.js +24 -5
- package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.d.ts +51 -0
- package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.js +101 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +10 -5
- package/project/sigdb/build.js +12 -2
- package/project/sigdb/decode.d.ts +7 -0
- package/project/sigdb/decode.js +35 -4
- package/project/sigdb/decompress.d.ts +2 -0
- package/project/sigdb/decompress.js +5 -0
- package/project/sigdb/manifest.d.ts +5 -0
- package/project/sigdb/manifest.js +37 -6
- package/project/sigdb/reader.d.ts +82 -2
- package/project/sigdb/reader.js +226 -14
- package/project/sigdb/schema.d.ts +31 -5
- package/project/sigdb/schema.js +7 -3
- package/project/sigdb/{version.d.ts → sigdb-version.d.ts} +21 -1
- package/project/sigdb/sigdb-version.js +119 -0
- package/queries/catalog/absint-query/absint-query-format.d.ts +2 -0
- package/queries/catalog/absint-query/absint-query-format.js +2 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +30 -3
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -0
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/call-graph-query/call-graph-query-executor.js +3 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +6 -0
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -0
- package/queries/catalog/call-graph-query/expand-library-internals.d.ts +19 -0
- package/queries/catalog/call-graph-query/expand-library-internals.js +59 -0
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -0
- package/queries/catalog/cluster-query/cluster-query-format.js +1 -0
- package/queries/catalog/config-query/config-query-executor.js +17 -5
- package/queries/catalog/config-query/config-query-format.d.ts +19 -3
- package/queries/catalog/config-query/config-query-format.js +258 -98
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.js +1 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +13 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +117 -17
- package/queries/catalog/dice-query/dice-query-executor.js +6 -9
- package/queries/catalog/dice-query/dice-query-format.d.ts +4 -5
- package/queries/catalog/dice-query/dice-query-format.js +10 -6
- package/queries/catalog/does-call-query/does-call-query-executor.js +15 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +8 -0
- package/queries/catalog/does-call-query/does-call-query-format.js +4 -1
- package/queries/catalog/files-query/files-query-format.d.ts +2 -0
- package/queries/catalog/files-query/files-query-format.js +2 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +6 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +293 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +121 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +345 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -0
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -0
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -0
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -0
- package/queries/catalog/linter-query/linter-query-executor.js +11 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +9 -4
- package/queries/catalog/linter-query/linter-query-format.js +44 -21
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +2 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
- package/queries/catalog/origin-query/origin-query-format.js +2 -0
- package/queries/catalog/project-query/project-query-executor.d.ts +0 -15
- package/queries/catalog/project-query/project-query-executor.js +19 -62
- package/queries/catalog/project-query/project-query-format.d.ts +7 -18
- package/queries/catalog/project-query/project-query-format.js +3 -18
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -0
- package/queries/catalog/search-query/search-query-format.d.ts +1 -0
- package/queries/catalog/search-query/search-query-format.js +1 -0
- package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -0
- package/queries/catalog/signature-query/signature-query-executor.js +267 -57
- package/queries/catalog/signature-query/signature-query-format.d.ts +37 -6
- package/queries/catalog/signature-query/signature-query-format.js +41 -5
- package/queries/catalog/signature-query/signature-query-render.js +48 -6
- package/queries/catalog/slice-query-options.d.ts +49 -0
- package/queries/catalog/slice-query-options.js +50 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -12
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -15
- package/queries/catalog/static-slice-query/static-slice-query-format.js +9 -10
- package/queries/query-print.js +3 -1
- package/queries/query.d.ts +62 -2
- package/queries/query.js +9 -2
- package/r-bridge/data/data.d.ts +16 -0
- package/r-bridge/data/data.js +20 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +19 -16
- package/reconstruct/reconstruct.d.ts +18 -1
- package/reconstruct/reconstruct.js +42 -19
- package/slicing/criterion/parse.d.ts +4 -0
- package/slicing/criterion/parse.js +4 -0
- package/slicing/static/slice-call.js +17 -9
- package/slicing/static/static-slicer.d.ts +1 -1
- package/slicing/static/static-slicer.js +5 -4
- package/util/files.d.ts +19 -1
- package/util/files.js +45 -3
- package/util/glob.d.ts +19 -0
- package/util/glob.js +67 -0
- package/util/log.d.ts +12 -0
- package/util/log.js +17 -1
- package/util/logic.d.ts +6 -0
- package/util/logic.js +31 -1
- package/util/mermaid/dfg.js +17 -12
- package/util/mermaid/mermaid.js +2 -2
- package/util/objects.d.ts +5 -0
- package/util/objects.js +8 -0
- package/util/r-version.d.ts +9 -1
- package/util/r-version.js +27 -2
- package/util/schema.d.ts +18 -0
- package/util/schema.js +102 -4
- package/util/text/ansi.d.ts +4 -0
- package/util/text/ansi.js +27 -3
- package/util/text/strings.d.ts +9 -0
- package/util/text/strings.js +29 -0
- package/util/version.js +79 -6
- package/abstract-interpretation/domains/satisfiable-domain.d.ts +0 -29
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +0 -22
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +0 -52
- package/project/sigdb/version.js +0 -55
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dependency version space: for each dependency, the set of signature-database versions that survive the
|
|
3
|
+
* project's constraints (declared ranges, transitive requirements, the base-R/assumed-R bound, a date cutoff, and
|
|
4
|
+
* how the code actually calls the package), and the explosion of that space into concrete per-dependency version
|
|
5
|
+
* assignments. This is a source-agnostic resolver over {@link PackageSignatureSource} and the dependencies context;
|
|
6
|
+
* the `guess-dep-versions` query presents it, but it is usable on its own (e.g. for compatibility-matrix tooling).
|
|
7
|
+
*/
|
|
8
|
+
import { type Range } from 'semver';
|
|
9
|
+
import { type VersionString } from '../util/r-version';
|
|
10
|
+
import { type PackageSignatureSource } from './sigdb/reader';
|
|
11
|
+
import type { DecodedFunction } from './sigdb/decode';
|
|
12
|
+
import { FunctionArgument, type DataflowGraph } from '../dataflow/graph/graph';
|
|
13
|
+
import type { ReadOnlyFlowrAnalyzerDependenciesContext } from './context/flowr-analyzer-dependencies-context';
|
|
14
|
+
import type { ReadonlyFlowrAnalysisProvider } from './flowr-analyzer';
|
|
15
|
+
/** where a single bound on a dependency's version came from */
|
|
16
|
+
export type ConstraintSource = 'declared' | 'transitive' | 'signature' | 'date' | 'base-r' | 'available' | 'indirect';
|
|
17
|
+
/**
|
|
18
|
+
* One provenance-carrying constraint on a dependency's version: *where* it comes from ({@link source}/{@link origin})
|
|
19
|
+
* and *what* it requires ({@link bound}). The set of these is exactly why a range is what it is, so it can answer
|
|
20
|
+
* "it must be `>= 4.2.0` because ...".
|
|
21
|
+
*/
|
|
22
|
+
export interface DerivedConstraint {
|
|
23
|
+
readonly source: ConstraintSource;
|
|
24
|
+
/** the concrete origin of the constraint, e.g. `project metadata`, `dplyr 1.1.0`, `dplyr::filter` */
|
|
25
|
+
readonly origin: string;
|
|
26
|
+
/** a human-readable explanation, e.g. `dplyr::filter has parameter '.by' only from 1.1.0` */
|
|
27
|
+
readonly detail: string;
|
|
28
|
+
/** the qualified function that carried the evidence (for {@link ConstraintSource|signature} constraints) */
|
|
29
|
+
readonly function?: string;
|
|
30
|
+
/** the argument/parameter that carried the evidence (for signature constraints) */
|
|
31
|
+
readonly parameter?: string;
|
|
32
|
+
/** the version bound this constraint establishes, if any (e.g. `>=1.1.0`, `<=2021-05-31`) */
|
|
33
|
+
readonly bound?: string;
|
|
34
|
+
}
|
|
35
|
+
/** notified of each constraint as it is applied, so a caller can collect provenance (e.g. into the query's evidence) */
|
|
36
|
+
export type ConstraintObserver = (constraint: DerivedConstraint) => void;
|
|
37
|
+
/** resolves (and memoizes) one function's decoded signature at a given version of the current package */
|
|
38
|
+
export type FnResolver = (fn: string, version: VersionString) => DecodedFunction | undefined;
|
|
39
|
+
/** how a single function of a package is used in the code */
|
|
40
|
+
interface FunctionUsage {
|
|
41
|
+
/** the union of named argument names across all call sites (drives the lower-bound evidence) */
|
|
42
|
+
readonly named: Set<string>;
|
|
43
|
+
/** one representative argument list per distinct call *shape* (drives signature compatibility) */
|
|
44
|
+
readonly calls: Map<string, readonly FunctionArgument[]>;
|
|
45
|
+
}
|
|
46
|
+
/** per-package function usage, keyed by the function's (unqualified) name */
|
|
47
|
+
export type PackageUsage = Map<string, FunctionUsage>;
|
|
48
|
+
/** one dated release in a package's version timeline */
|
|
49
|
+
export interface TimelineEntry {
|
|
50
|
+
readonly ver: VersionString;
|
|
51
|
+
readonly date?: Date;
|
|
52
|
+
}
|
|
53
|
+
/** the version qualifier a package imposes on one of its own dependencies (a transitive constraint) */
|
|
54
|
+
export interface TransitiveConstraint {
|
|
55
|
+
readonly range: Range;
|
|
56
|
+
/** the declaring package + version, e.g. `dplyr 1.1.0` */
|
|
57
|
+
readonly from: string;
|
|
58
|
+
}
|
|
59
|
+
/** the versions of a package before and after the signature-usage filter, plus the declared inputs used to build them */
|
|
60
|
+
export interface SurvivingEntries {
|
|
61
|
+
/** versions after all constraints including signature-usage compatibility */
|
|
62
|
+
readonly survivors: TimelineEntry[];
|
|
63
|
+
/** versions after the declared/transitive/base/date constraints but *before* the signature filter */
|
|
64
|
+
readonly preSignature: TimelineEntry[];
|
|
65
|
+
/** the memoized function resolver used for the signature pass (shared so evidence reuses the decodes) */
|
|
66
|
+
readonly getFn: FnResolver;
|
|
67
|
+
/** the combined, satisfiable declared range (`inferredVersion`), or `undefined` if none/contradictory */
|
|
68
|
+
readonly declaredRange: Range | undefined;
|
|
69
|
+
/** the raw declared version constraints */
|
|
70
|
+
readonly declaredConstraints: readonly string[];
|
|
71
|
+
/** whether the package is an R-core / base package */
|
|
72
|
+
readonly base: boolean;
|
|
73
|
+
/** whether the declared + transitive constraints contradict each other (no version can satisfy them all) */
|
|
74
|
+
readonly unsatisfiable: boolean;
|
|
75
|
+
/** the total number of versions the database carries for the package (the full history the candidates are drawn from) */
|
|
76
|
+
readonly total: number;
|
|
77
|
+
}
|
|
78
|
+
/** one package's surviving versions, ordered by preference for the constraint-space explosion */
|
|
79
|
+
export interface OrderedCandidates {
|
|
80
|
+
readonly pkg: string;
|
|
81
|
+
readonly versions: readonly VersionString[];
|
|
82
|
+
}
|
|
83
|
+
/** options for {@link explodeDependencyVersions} */
|
|
84
|
+
export interface VersionExplodeOptions {
|
|
85
|
+
/** iterate each package's versions newest-first (default) or oldest-first */
|
|
86
|
+
readonly order?: 'newest' | 'oldest';
|
|
87
|
+
/** a version to prefer per package, used first when it survives the constraints (package name to version) */
|
|
88
|
+
readonly prefer?: Readonly<Record<string, VersionString>>;
|
|
89
|
+
/** restrict to these packages (default: every declared and used dependency) */
|
|
90
|
+
readonly packages?: readonly string[];
|
|
91
|
+
/** only consider releases on or before this day, `YYYY.MM.DD` (also `YYYY` or `YYYY.MM`) */
|
|
92
|
+
readonly date?: string;
|
|
93
|
+
/** cap the number of assignments produced (default {@link DefaultExplodeLimit}) */
|
|
94
|
+
readonly limit?: number;
|
|
95
|
+
}
|
|
96
|
+
/** a concrete, sigdb-available version choice for every resolvable dependency */
|
|
97
|
+
export interface VersionAssignment {
|
|
98
|
+
readonly versions: ReadonlyMap<string, VersionString>;
|
|
99
|
+
}
|
|
100
|
+
/** default safety cap on how many assignments {@link explodeDependencyVersions} yields */
|
|
101
|
+
export declare const DefaultExplodeLimit = 256;
|
|
102
|
+
/** the date cutoff (end of the named day/month/year) for a `YYYY.MM.DD` spec, or `undefined` if malformed */
|
|
103
|
+
export declare function dateCutoff(spec: string): Date | undefined;
|
|
104
|
+
/** an ISO `YYYY-MM-DD` day */
|
|
105
|
+
export declare function isoDay(date: Date): string;
|
|
106
|
+
/** scan the dataflow graph for every call that resolves (via {@link Dataflow.qualify}) to a package export */
|
|
107
|
+
export declare function collectUsage(graph: DataflowGraph, deps?: ReadOnlyFlowrAnalyzerDependenciesContext): Map<string, PackageUsage>;
|
|
108
|
+
/** intersection of multiple survivor sets -- versions that survive in every set */
|
|
109
|
+
export declare function intersectSurvivors(survivorSets: readonly (readonly TimelineEntry[])[]): TimelineEntry[];
|
|
110
|
+
/**
|
|
111
|
+
* The transitive constraints declared packages place on their own dependencies (one level deep). `versionOf` overrides
|
|
112
|
+
* which version of each declaring package to read the requirements from -- passing the previous pass's guessed versions
|
|
113
|
+
* lets two packages tighten each other (a bounded fixpoint over mutual constraints).
|
|
114
|
+
*/
|
|
115
|
+
export declare function collectTransitiveConstraints(deps: ReadOnlyFlowrAnalyzerDependenciesContext, sources: readonly PackageSignatureSource[], versionOf?: (pkg: string) => string | undefined): Map<string, TransitiveConstraint[]>;
|
|
116
|
+
/** the default bound for the fixpoint loops, overridable per query with {@link GuessDepVersionsQuery.maxIterations} */
|
|
117
|
+
export declare const DefaultFixpointIterations = 8;
|
|
118
|
+
/** repeatedly run `step` until it reports no further change (returns `false`) or `maxIterations` is reached */
|
|
119
|
+
export declare function iterateToFixpoint(maxIterations: number, step: () => boolean): void;
|
|
120
|
+
/** one package's mutable surviving set for the arc-consistency pass */
|
|
121
|
+
export interface ArcEntry {
|
|
122
|
+
readonly name: string;
|
|
123
|
+
readonly src: PackageSignatureSource | undefined;
|
|
124
|
+
/** the sigdb package its versions are drawn from (see {@link timelinePackageKey}) */
|
|
125
|
+
readonly key: string;
|
|
126
|
+
survivors: readonly TimelineEntry[];
|
|
127
|
+
}
|
|
128
|
+
/** drop, to a fixpoint, versions no co-guessed dependency can satisfy; returns the blocking partners per package */
|
|
129
|
+
export declare function enforceArcConsistency(entries: readonly ArcEntry[], maxIterations?: number): Map<string, Map<string, string>>;
|
|
130
|
+
/** a package (or a linked group sharing one version) and its surviving versions, one factor of the combination count */
|
|
131
|
+
export interface CountFactor {
|
|
132
|
+
readonly name: string;
|
|
133
|
+
readonly src: PackageSignatureSource | undefined;
|
|
134
|
+
readonly key: string;
|
|
135
|
+
readonly survivors: readonly string[];
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The runnable-combination count. Everything depends on the shared base/R `hub`, so for each hub version take the
|
|
139
|
+
* product of how many versions of every other factor are compatible with it, and sum over the hub. With no hub the
|
|
140
|
+
* factors are independent, so it is the plain product. (Constraints between two non-hub factors are not modelled.)
|
|
141
|
+
*/
|
|
142
|
+
export declare function countRunnableCombinations(hub: CountFactor | undefined, others: readonly CountFactor[]): number;
|
|
143
|
+
/** whether every requirement `pkg@ver` places on a co-guessed dependency is met by one of that partner's surviving versions */
|
|
144
|
+
export declare function versionMeetsPartners(src: PackageSignatureSource, pkg: string, ver: string, partnerSurvivors: ReadonlyMap<string, readonly string[]>, selfName: string, onReject?: (partner: string, constraint: string) => void): boolean;
|
|
145
|
+
/** an empty set, shared so callers that do not disable anything need not allocate one */
|
|
146
|
+
export declare const NoDisabledSources: ReadonlySet<ConstraintSource>;
|
|
147
|
+
/**
|
|
148
|
+
* Apply every constraint (declared, transitive, base-R, date, then signature usage) to a package's timeline. When an
|
|
149
|
+
* `observe` callback is given, emits the provenance of each constraint (including the signature lower bounds).
|
|
150
|
+
*/
|
|
151
|
+
export declare function survivingEntries(name: string, src: PackageSignatureSource | undefined, deps: ReadOnlyFlowrAnalyzerDependenciesContext, usage: PackageUsage | undefined, transitive: readonly TransitiveConstraint[], cutoff: Date | undefined, rVersion: string | undefined, observe?: ConstraintObserver, disabled?: ReadonlySet<ConstraintSource>, packageKey?: string): SurvivingEntries;
|
|
152
|
+
/** the sigdb package a target's version history is drawn from: `R` reuses `base` (their releases coincide), everything else is itself */
|
|
153
|
+
export declare function timelinePackageKey(name: string, sources: readonly PackageSignatureSource[]): string;
|
|
154
|
+
/** the ordered candidate list for one package, or `undefined` when nothing survives (shared by the query and the iterator) */
|
|
155
|
+
export declare function orderedCandidatesOf(src: PackageSignatureSource | undefined, name: string, surviving: SurvivingEntries, prefer: string | undefined, order: 'newest' | 'oldest'): OrderedCandidates | undefined;
|
|
156
|
+
/** the default explosion targets: every declared and used dependency (excluding `current`, the analyzed package's own namespace) */
|
|
157
|
+
export declare function defaultTargets(deps: ReadOnlyFlowrAnalyzerDependenciesContext, usage: ReadonlyMap<string, PackageUsage>): string[];
|
|
158
|
+
/** lazily yield concrete version assignments (one version per package) in odometer order over the per-package lists */
|
|
159
|
+
export declare function assignmentsOf(perPackage: readonly OrderedCandidates[], limit: number): Generator<VersionAssignment>;
|
|
160
|
+
/**
|
|
161
|
+
* Explode the guessed constraint space into concrete, signature-database-available version assignments: a lazy
|
|
162
|
+
* iterator over one chosen version per resolvable dependency. Each package's versions are ordered by preference
|
|
163
|
+
* (an explicitly {@link VersionExplodeOptions.prefer|preferred} version, then non-archived releases, then newest or
|
|
164
|
+
* oldest first), so the first assignments are the most preferred. The iterator is bounded by
|
|
165
|
+
* {@link VersionExplodeOptions.limit} so an enormous product cannot run away.
|
|
166
|
+
*/
|
|
167
|
+
export declare function explodeDependencyVersions(analyzer: ReadonlyFlowrAnalysisProvider, options?: VersionExplodeOptions): AsyncGenerator<VersionAssignment>;
|
|
168
|
+
export {};
|