Repository navigation
Wire opt-in network-centrality risk weighting into the firewall - #304
Merged
Merged
Conversation
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]>
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'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):
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
The Differential Scan Acknowledgement