Skip to content

Argument provenance and bad bad evi(/a)l#2399

Merged
EagleoutIce merged 10 commits intomainfrom
2397-parameter-provenance
Mar 20, 2026
Merged

Argument provenance and bad bad evi(/a)l#2399
EagleoutIce merged 10 commits intomainfrom
2397-parameter-provenance

Conversation

@EagleoutIce
Copy link
Copy Markdown
Member

No description provided.

@EagleoutIce EagleoutIce linked an issue Mar 19, 2026 that may be closed by this pull request
@EagleoutIce EagleoutIce marked this pull request as ready for review March 20, 2026 11:25
@EagleoutIce EagleoutIce requested a review from Copilot March 20, 2026 11:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an “input-sources” query plus a new “problematic-eval” linting rule that leverages provenance + input classification, while also renaming the slicing criterion type and regenerating wiki docs/tests accordingly.

Changes:

  • Introduces input-sources query and an input classifier to track/label provenance-based input types (file/network/random/param/constant).
  • Adds problematic-eval linter rule and corresponding documentation + tests.
  • Renames SingleSlicingCriterionSlicingCriterion across code/tests and updates Mermaid output to show sources.

Reviewed changes

Copilot reviewed 87 out of 91 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
wiki/[Linting Rule] Stop Call.md Regenerated wiki output (version bump + test case headings).
wiki/[Linting Rule] Problematic Eval.md New autogenerated wiki page for the new linter rule.
wiki/Search API.md Regenerated docs; Mermaid vertices now include sources.
wiki/Overview.md Regenerated docs with updated links/line refs and version info.
wiki/Linting and Testing.md Regenerated docs; updated links/line refs and R version.
wiki/Linter.md Regenerated docs; includes new rule in linter output and tag tables.
wiki/Core.md Regenerated docs; Mermaid output includes sources and updated R version.
test/functionality/r-bridge/roxygen/roxygen-parse.test.ts Updates tests to use SlicingCriterion.
test/functionality/r-bridge/roxygen/documentation-provide.test.ts Updates tests to use SlicingCriterion.
test/functionality/linter/lint-stop-call.test.ts Renames test cases for clarity.
test/functionality/linter/lint-problematic-eval.test.ts Adds tests for problematic-eval rule.
test/functionality/dataflow/query/input-source.test.ts Adds query tests for input-sources.
test/functionality/dataflow/query/does-call-query.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/query/dependencies-query.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/provenance/provenance-simple.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/origin/dfg-get-symbol-refs.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/origin/dfg-get-symbol-refs-io.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/origin/dfg-get-origin.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/main/exceptions/dataflow-exceptions.test.ts Updates types to use SlicingCriterion.
test/functionality/dataflow/linker/linked-function-definitions.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/linker/arg-pmatch.test.ts Updates test helper args to include valueId.
test/functionality/dataflow/graph/link.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/graph/cluster.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/functions/recursive-functions.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/functions/higher-order-functions.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/functions/exceptions-functions.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/environments/resolve.test.ts Updates tests to use SlicingCriterion.
test/functionality/dataflow/call-graph/call-graph-sub.test.ts Updates tests to use SlicingCriterion.
test/functionality/control-flow/useless-loop.test.ts Updates tests to use SlicingCriterion.
test/functionality/control-flow/dead-code/cfg-dead-code.test.ts Updates tests to use SlicingCriterion.
test/functionality/control-flow/cfg-mermaid.test.ts Updates tests to use SlicingCriterion.
test/functionality/benchmark/slicer.test.ts Updates expected benchmark object sizes.
test/functionality/abstract-interpretation/data-frame/data-frame.ts Updates types to use SlicingCriterion.
test/functionality/_helper/shell.ts Updates slicing helpers and docstrings to SlicingCriterion.
test/functionality/_helper/search.ts Updates helper to use SlicingCriterion.
test/functionality/_helper/linter.ts Updates helper to use SlicingCriterion.
test/functionality/_helper/dataflow/environment-builder.ts Adds valueId to argument references.
test/functionality/_helper/controlflow/happens-before.ts Updates helper signature to SlicingCriterion.
src/util/mermaid/dfg.ts Mermaid node labels now include sources when present.
src/util/collections/arrays.ts Adds uniqueArray() helper.
src/slicing/criterion/parse.ts Renames SingleSlicingCriterion to SlicingCriterion and updates helpers.
src/slicing/criterion/collect-all.ts Updates to new SlicingCriterion type.
src/search/search-executor/search-generators.ts Updates criterion parsing to use SlicingCriterion.
src/queries/query.ts Registers new input-sources query support.
src/queries/catalog/resolve-value-query/resolve-value-query-executor.ts Uses SlicingCriterion.parse.
src/queries/catalog/provenance-query/provenance-query-format.ts Updates type to SlicingCriterion.
src/queries/catalog/provenance-query/provenance-query-executor.ts Uses SlicingCriterion.tryParse and adjusts log casing.
src/queries/catalog/origin-query/origin-query-format.ts Updates types to SlicingCriterion.
src/queries/catalog/origin-query/origin-query-executor.ts Uses SlicingCriterion.tryParse and updates fingerprint type.
src/queries/catalog/location-map-query/location-map-query-format.ts Updates ids type to SlicingCriterion[].
src/queries/catalog/location-map-query/location-map-query-executor.ts Uses SlicingCriterion.tryParse.
src/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.ts Updates filter type to SlicingCriterion[].
src/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.ts Updates filter type to SlicingCriterion[].
src/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.ts Updates filter handling to SlicingCriterion.
src/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.ts Updates filter type to SlicingCriterion[].
src/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.ts Updates filter handling to SlicingCriterion.
src/queries/catalog/input-sources-query/simple-input-classifier.ts Adds input classification logic + types for input-sources.
src/queries/catalog/input-sources-query/input-sources-query-format.ts Adds query format/CLI parsing/schema + summarizer.
src/queries/catalog/input-sources-query/input-sources-query-executor.ts Implements query execution via provenance graph + classifier.
src/queries/catalog/happens-before-query/happens-before-query-format.ts Updates types to SlicingCriterion.
src/queries/catalog/happens-before-query/happens-before-query-executor.ts Uses SlicingCriterion.parse.
src/queries/catalog/does-call-query/does-call-query-format.ts Updates criterion type to SlicingCriterion.
src/queries/catalog/does-call-query/does-call-query-executor.ts Uses SlicingCriterion.tryParse.
src/queries/catalog/df-shape-query/df-shape-query-format.ts Updates criterion type to SlicingCriterion.
src/queries/catalog/df-shape-query/df-shape-query-executor.ts Uses SlicingCriterion.parse.
src/linter/rules/problematic-eval.ts Adds new linter rule using input-sources.
src/linter/linter-rules.ts Registers problematic-eval rule.
src/documentation/wiki-query.ts Updates doc examples to SlicingCriterion.
src/documentation/wiki-linter.ts Adds problematic-eval to generated linter docs.
src/dataflow/internal/process/functions/process-parameter.ts Records parameter default source ids in definitions.
src/dataflow/internal/process/functions/call/common.ts Adds valueId to function call argument references.
src/dataflow/internal/process/functions/call/built-in/built-in-function-definition.ts Adds valueId to built-in argument references.
src/dataflow/internal/process/functions/call/built-in/built-in-for-loop.ts Records loop vector as definition source id.
src/dataflow/internal/process/functions/call/built-in/built-in-assignment.ts Records assignment sourceIds in definitions.
src/dataflow/internal/process/functions/call/built-in/built-in-apply.ts Adds valueId to apply argument references.
src/dataflow/graph/vertex.ts Adds source?: NodeId[] to variable definitions.
src/dataflow/graph/graph.ts Adds valueId to named args; adjusts FunctionArgument.getReference; adds sourceIds param to setDefinitionOfVertex.
src/dataflow/graph/graph-helper.ts Uses SlicingCriterion.tryParse.
src/dataflow/graph/df-helper.ts Enhances provenance traversal (includes Argument + CDs); adjusts reduceGraph typing.
src/dataflow/environments/identifier.ts Adds Identifier.is() type guard.
src/config.ts Fixes trailing comma in FlowrConfig.setInConfigInPlace.
src/cli/slicer-app.ts Updates types to SlicingCriterion.
src/cli/repl/parser/slice-query-parser.ts Updates to SlicingCriterion.
src/benchmark/stats/stats.ts Updates types to SlicingCriterion.
package.json Bumps dev dependency versions (commitlint/typedoc/typescript).
README.md Regenerated examples; includes problematic-eval and Mermaid sources.
.github/ISSUE_TEMPLATE/linting-rule.yaml Adds “Problematic eval” as a selectable rule.
Comments suppressed due to low confidence (5)

src/queries/catalog/input-sources-query/simple-input-classifier.ts:1

  • The cds assignment is inverted: when cdTypes.length > 0 you currently set cds to undefined, and when it’s 0 you set it to uniqueArray([]) (an empty array). This drops control-dependency classifications for non-empty cdTypes and may also emit empty cds arrays. Flip the condition (set cds to uniqueArray(cdTypes) when non-empty, otherwise undefined).
    src/queries/catalog/input-sources-query/input-sources-query-format.ts:1
  • The doc comment describes provenance calculation “based on the provenance of a given function”, but this query’s interface is centered on classifying inputs for a single criterion using an input classifier config. Please update the comment to reflect what the query actually returns (classified input sources for the criterion, potentially computed over a provenance-reduced graph).
    src/queries/catalog/input-sources-query/input-sources-query-format.ts:1
  • This query’s CLI parsing reports 'Invalid provenance query format' and the parser function is misspelled (inputSourcesueryLineParser). Update the message to refer to input-sources, and fix the function name to inputSourcesQueryLineParser for readability/consistency.
    src/queries/catalog/input-sources-query/input-sources-query-format.ts:1
  • The Joi schema for config does not match InputClassifierConfig (which uses pureFns, networkFns, randomFns, readFileFns). As written, valid config fields won’t validate and documented fields won’t be read by the executor. Align the schema field names (and descriptions) with the actual InputSourcesQueryConfig shape used by executeInputSourcesQuery.
    src/queries/catalog/input-sources-query/simple-input-classifier.ts:1
  • InputClassifierFunctionIdentifier allows Identifier | NodeId, but this implementation casts every entry to BrandedIdentifier for Identifier.matches(...). If a caller passes a non-string Identifier form (e.g. namespaced tuple) this cast can misbehave at runtime and can also blur NodeId-vs-Identifier semantics. Use Identifier.is(id) (added in this PR) to guard and then call Identifier.matches(id, fn.name) only for Identifier-shaped values; otherwise only compare against fn.id for NodeId.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EagleoutIce EagleoutIce merged commit 5ee1094 into main Mar 20, 2026
19 checks passed
@EagleoutIce EagleoutIce deleted the 2397-parameter-provenance branch March 20, 2026 11:41
@EagleoutIce
Copy link
Copy Markdown
Member Author

This pull request is included in v2.10.0 (see Release v2.10.0 (Input Source Identification, Linter, Helper Improvements)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter Provenance

2 participants