Skip to content

Wire opt-in network-centrality risk weighting into the firewall - #304

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

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

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Jul 23, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #302's discovery that the firewall's old evaluate_risk() read a "dependency_network" key nothing ever wrote, so network_multiplier was silently always 1.0 in production -- a previously-inert feature, never actually live. This wires it up for real, deliberately, as its own reviewed change rather than folding it into the #302 refactor.

Design decisions (both discussed and confirmed before implementing):

  • Formula: reuse the old evaluate_risk multiplier shape -- starts at 1.0, += blast_radius * 0.5 if normalized_blast_radius > 1.0, += 0.5 if betweenness_score > 0.05 -- applied post-hoc to the risk_vector score (same pattern Wire supply chain firewall to SignalProcessor's risk_vector #302 established for build_time_multiplier). This is an only-amplify design: a peripheral, low-centrality file is judged on its own merits and never gets a discount; only high-centrality "hub" files get less tolerance for the same embedded threat signal.
  • Rollout: opt-in via a new FIREWALL_NETWORK_WEIGHTING config flag (default False), mirroring Phase 10.5's MAX_SYSTEMIC_THREAT gate (also off-by-default). Since this feature never actually ran before, flipping it on unconditionally would be a silent behavior change for every existing firewall user the moment this ships -- opt-in keeps today's behavior unchanged until a repo explicitly turns it on.

Reads file_node["telemetry"]["network_metrics"] (normalized_blast_radius, betweenness_score), written by network_risk_sensor.build_dependency_graph() at Phase 4 -- well before the firewall runs at Phase 10, same ordering guarantee #302 relied on for risk_vector from Phase 3.

Added 3 tests: flag-off-by-default regression guard (proves the default itself, not just behavior under it), hub-file amplification crossing the block threshold vs. an identical peripheral file that doesn't, and the betweenness-only bonus in isolation. Full suite: 775 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's discovery that the firewall's old evaluate_risk() read
a "dependency_network" key nothing ever wrote, so network_multiplier was
silently always 1.0 in production -- a previously-inert feature, never
actually live. This wires it up for real, deliberately, as its own
reviewed change rather than folding it into the #302 refactor.

Design decisions (both discussed and confirmed before implementing):

- Formula: reuse the old evaluate_risk multiplier shape -- starts at 1.0,
  += blast_radius * 0.5 if normalized_blast_radius > 1.0, += 0.5 if
  betweenness_score > 0.05 -- applied post-hoc to the risk_vector score
  (same pattern #302 established for build_time_multiplier). This is an
  only-amplify design: a peripheral, low-centrality file is judged on its
  own merits and never gets a discount; only high-centrality "hub" files
  get less tolerance for the same embedded threat signal.
- Rollout: opt-in via a new FIREWALL_NETWORK_WEIGHTING config flag
  (default False), mirroring Phase 10.5's MAX_SYSTEMIC_THREAT gate (also
  off-by-default). Since this feature never actually ran before, flipping
  it on unconditionally would be a silent behavior change for every
  existing firewall user the moment this ships -- opt-in keeps today's
  behavior unchanged until a repo explicitly turns it on.

Reads file_node["telemetry"]["network_metrics"] (normalized_blast_radius,
betweenness_score), written by network_risk_sensor.build_dependency_graph()
at Phase 4 -- well before the firewall runs at Phase 10, same ordering
guarantee #302 relied on for risk_vector from Phase 3.

Added 3 tests: flag-off-by-default regression guard (proves the default
itself, not just behavior under it), hub-file amplification crossing the
block threshold vs. an identical peripheral file that doesn't, and the
betweenness-only bonus in isolation. Full suite: 775 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 5eff2ca into main Jul 23, 2026
22 checks passed
@squid-protocol
squid-protocol deleted the fix/unwind-duplicate-risk-exposure-p3 branch July 23, 2026 01:34
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