Repository navigation
fix(python): inspect imported initialization callables - #897
Open
yashrajp22 wants to merge 2 commits into
Open
yashrajp22 wants to merge 2 commits into
yashrajp22 wants to merge 2 commits into
Conversation
Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
1 task
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.
An imported setup function can replace a harmless output function with a shell executor. The release branch currently skips that imported function body, allowing the scan to report SAFE with complete analysis when it should retain CAUTION and incomplete analysis.
This change follows imported names used during module initialization, including aliases, callbacks, defaults and decorators. It reuses the existing bounded import analysis and preserves harmless setup, unused imports and selected safe helpers beside unrelated functions.
This PR targets the v2.13.1 release branch because the affected import checks were added there while integrating #849. It is a separate correction for #852 and should remain unmerged until release inclusion is requested.
Known precision limit: reading a value from a module with unrelated shell-capable functions, or retaining uncertain nested callback code, can now leave analysis incomplete. The module-constant case was reproduced separately. Narrowing these cases requires additional attribute and control-flow analysis.
Validation: 30 new regression cases; 1,742 targeted tests passed in source and fresh installed-wheel runs. All 13 focused skills passed across base/head and source/wheel (52 CLI scans), including unsafe setup returning CAUTION/incomplete and harmless setup staying SAFE/complete. Fresh wheel/sdist package checks and Ruff lint/format passed. All 12 catalog skills also matched across base/head and source/wheel (48 more CLI scans). These were offline checks with no LLM provider. CodeRabbit and Greptile completed final-commit reviews with no new findings; the earlier conservative precision findings remain documented above.