Skip to content

Remove dead ThreatPolicy/SecurityLens.policy plumbing - #303

Merged
squid-protocol merged 1 commit into
mainfrom
fix/unwind-duplicate-risk-exposure-p2
Jul 23, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/unwind-duplicate-risk-exposure-p2

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

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.

Description of Structural Changes

Visual Observatory Testing

  • I tested the output JSON on GitGalaxy.io OR the Airgap Observatory.
  • Flexbox constraints, HUD elements, and 3D rendering remain intact.

The Differential Scan Acknowledgement

  • I understand that my PR will be subjected to a Full Differential Scan.
  • I have provided the link to the specific repository this PR addresses so it can be tested alongside the 80-repo calibrated baseline.
  • I believe these changes will measurably improve the engine's Accuracy, Speed, Utility, or Ethos without causing regressions.

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]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 14e2512 into main Jul 23, 2026
22 checks passed
@squid-protocol
squid-protocol deleted the fix/unwind-duplicate-risk-exposure-p2 branch July 23, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant