Repository navigation
feat: multi-file analysis with a module graph and project summaries - #34
Merged
Merged
Conversation
# Conflicts: # src/coretrace_python/engine.py
This was referenced Sep 3, 2026
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.
Summary
Multi-file analysis (§21 Multi-File Analysis of
docs/architecture.md):--checknow accepts a directory.test: define multi-file analysis behavior), implementation follows.interprocedural/modulegraph.py: discovery of the Python files under a root (hidden and tooling directories skipped), dotted module names from packages (app/__init__.pyisapp), and aModuleGraphof the imports between project modules, taken from the import statements and the symbols they bind.SummaryIndexand theProjectSummariesinput analysis: functions defined in the project get project symbols (python.app.helpers.execute); the engine provides the index of their summaries to every module's manager. Alone, a module sees an empty index, which is the single-file behaviour.SummaryAnalysisandTaintAnalysisconsult the index when a call resolves to a project symbol, so a tainted argument passed to a helper defined in another file is a flow at the call site (through app.helpers.execute), and a helper returning attacker-controlled data taints its result across files.engine.analyze_projectiterates summaries to a fixpoint across modules. Each round re-provides the index and runs aTransformationPassthat invalidates only the results depending on it, the first real use of the manager's invalidation (§12). Syntax errors and unsupported functions are reported per file as notes.--check DIR;--emit-irstill needs a file.Not in this PR: heap and aliasing (last bullet of #27), methods called through instances across modules (needs type inference), and analysing files outside the given root.
Closes #27 except the heap and aliasing bullet, which moves to its own issue.