Repository navigation
Remove dead ThreatPolicy/SecurityLens.policy plumbing - #303
Merged
Merged
Conversation
Follow-up to #302 (which deleted SecurityLens.evaluate_risk() and self.policy). ThreatPolicy existed solely to build the policy dict that evaluate_risk() consumed; with that method gone, every _active_policy / ThreatPolicy.get_policy(...) call site is dead code, and SecurityLens's policy kwarg is silently ignored (the constructor no longer stores or reads it). Re-ran a repo-wide grep for ThreatPolicy/SecurityLens(policy= before touching anything, per the original cleanup plan, to confirm scope: - galaxyscope.py (3 sites): worker init, Orchestrator.__init__, and the CLI args.paranoid path. Dropped the ThreatPolicy import and the _active_policy if/else blocks; SecurityLens(policy=_active_policy) -> SecurityLens(). The CLI site's "ZERO-TRUST MODE" log line stays under args.paranoid -- PARANOID_MODE is still live via SignalProcessor.is_paranoid, only the now-dead policy computation goes. - vault_sentinel.py, sbom_recorder.py: same import + constructor simplification. These call SecurityLens.scan_content(), never evaluate_risk(), so they were never broken -- just carrying a policy kwarg with no effect. ThreatPolicy the class itself is left in analysis_lens.py; the grep confirms it's now only self-referential (the class body and its own get_policy() classmethod), but deleting the class is a separate call from cleaning up its callers. Full test suite: 772 passed, 1 xfailed (pre-existing), 0 failures. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
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.
Follow-up to #302 (which deleted SecurityLens.evaluate_risk() and self.policy). ThreatPolicy existed solely to build the policy dict that evaluate_risk() consumed; with that method gone, every _active_policy / ThreatPolicy.get_policy(...) call site is dead code, and SecurityLens's policy kwarg is silently ignored (the constructor no longer stores or reads it).
Re-ran a repo-wide grep for ThreatPolicy/SecurityLens(policy= before touching anything, per the original cleanup plan, to confirm scope:
ThreatPolicy the class itself is left in analysis_lens.py; the grep confirms it's now only self-referential (the class body and its own get_policy() classmethod), but deleting the class is a separate call from cleaning up its callers.
Full test suite: 772 passed, 1 xfailed (pre-existing), 0 failures.
Description of Structural Changes
Visual Observatory Testing
The Differential Scan Acknowledgement