Argument provenance and bad bad evi(/a)l#2399
Merged
EagleoutIce merged 10 commits intomainfrom Mar 20, 2026
Merged
Conversation
Closed
There was a problem hiding this comment.
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-sourcesquery and an input classifier to track/label provenance-based input types (file/network/random/param/constant). - Adds
problematic-evallinter rule and corresponding documentation + tests. - Renames
SingleSlicingCriterion→SlicingCriterionacross code/tests and updates Mermaid output to showsources.
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
cdsassignment is inverted: whencdTypes.length > 0you currently setcdstoundefined, and when it’s0you set it touniqueArray([])(an empty array). This drops control-dependency classifications for non-emptycdTypesand may also emit empty cds arrays. Flip the condition (setcdstouniqueArray(cdTypes)when non-empty, otherwiseundefined).
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
criterionusing 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 toinput-sources, and fix the function name toinputSourcesQueryLineParserfor readability/consistency.
src/queries/catalog/input-sources-query/input-sources-query-format.ts:1 - The Joi schema for
configdoes not matchInputClassifierConfig(which usespureFns,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 actualInputSourcesQueryConfigshape used byexecuteInputSourcesQuery.
src/queries/catalog/input-sources-query/simple-input-classifier.ts:1 InputClassifierFunctionIdentifierallowsIdentifier | NodeId, but this implementation casts every entry toBrandedIdentifierforIdentifier.matches(...). If a caller passes a non-stringIdentifierform (e.g. namespaced tuple) this cast can misbehave at runtime and can also blur NodeId-vs-Identifier semantics. UseIdentifier.is(id)(added in this PR) to guard and then callIdentifier.matches(id, fn.name)only for Identifier-shaped values; otherwise only compare againstfn.idforNodeId.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/queries/catalog/input-sources-query/input-sources-query-executor.ts
Outdated
Show resolved
Hide resolved
Member
Author
|
This pull request is included in v2.10.0 (see Release v2.10.0 (Input Source Identification, Linter, Helper Improvements)). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.