feat: implement Delta Analysis Engine for auditing dependency version bumps (#106)#114
Open
prasiddhi-105 wants to merge 2 commits into
Open
feat: implement Delta Analysis Engine for auditing dependency version bumps (#106)#114prasiddhi-105 wants to merge 2 commits into
prasiddhi-105 wants to merge 2 commits into
Conversation
|
|
Author
|
hii would love to work under you and contribute in your project, please assign me. |
Owner
|
@prasiddhi-105 Please fix failing checks |
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.
Linked issue
Closes #106
What this PR does
This PR implements the core Delta Analysis Engine to evaluate third-party package modifications and dependency version bumps. It dynamically fetches source distributions directly from public registries (such as PyPI) and extracts them into temporary file structures. It then analyzes the differences to track completely new files and runs an AST-based static analyzer over the source code to flag high-risk patterns like
eval(), preventing hidden security regressions.Type of change
ML tier (if applicable)
N/A
How did you test this?
I tested this implementation locally using Python's sandbox runtime environment by passing version bump sequences through the parsing and auditing pipeline.
requests: 2.28.1 -> 2.31.0..tar.gz) from the PyPI JSON API.ast) node inspections, and returns the strictly formatted output schema payload without errors.🛠️ Implementation Details
delta_engine.pyusing regex mapping to extract package metadata (dependency_name,old_version, andnew_version) from incoming strings..tar.gz).added_files, paired with a built-in Abstract Syntax Tree (ast) walker to check python files for high-risk language signatures.Verified Output Payload Schema:
{ "supply_chain_diff": { "dependency": "requests", "upgrade_path": "2.28.1 -> 2.31.0", "risk_assessment": { "added_files": [], "suspicious_patterns_detected": [], "overall_risk_score": "low" } } }