Repository navigation
Copy max_big_o back onto the file dict, not just the graph node (#372) - #383
Merged
Merged
Conversation
dev_agent_firewall.py's Agentic Black Hole check reads
file_data.get("max_big_o") directly, but the only producer,
network_risk_sensor.py, set it exclusively as a networkx graph node
attribute (G.nodes[path]) -- a different object entirely. The function
already reads max_big_o back OUT of the graph node to compute
is_algorithmic_bottleneck, it just never wrote that same value onto the
file dict itself. One-line fix at the exact point telemetry is already
written back to the file node.
Also fixed the Zero-Dependency Mode fallback path (_fallback_build_graph),
which didn't compute max_big_o at all -- it doesn't actually need
networkx (it's pure Python off "functions"), so there's no reason
Zero-Dependency Mode should be any more broken here than the main path.
Tests:
- test_network_risk_sensor.py: assertions on both the main networkx path
and the Zero-Dependency Mode fallback proving file_data["max_big_o"]
is now populated correctly for both a simple and a complex function.
- test_dev_agent_firewall.py: new end-to-end test
(test_black_hole_detection_from_real_network_risk_sensor_output) that
runs the REAL NetworkRiskSensor.build_dependency_graph() and feeds its
real output into the REAL DevAgentFirewall.evaluate_ecosystem(),
proving the Agentic Black Hole guardrail now fires on genuine O(N^4)
complexity -- not just a hand-mocked "max_big_o": 3 like the existing
unit test.
tests/dead_key_audit_baseline.json: "max_big_o" removed now that it's
fixed (`python tests/dead_key_audit.py --ci` confirmed clean at 6
baselined keys, zero regressions).
Full suite: 859 passed, 1 pre-existing xfail.
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.
Summary
Closes #372.
dev_agent_firewall.py's Agentic Black Hole check readsfile_data.get("max_big_o")directly, but the only producer,network_risk_sensor.py, set it exclusively as a networkx graph node attribute (G.nodes[path]) -- a different object entirely. The function already readsmax_big_oback OUT of the graph node to computeis_algorithmic_bottleneck, it just never wrote that same value onto the file dict itself. One-line fix at the exact point telemetry is already written back to the file node.Also fixed the Zero-Dependency Mode fallback path (
_fallback_build_graph), which didn't computemax_big_oat all -- it doesn't actually need networkx (it's pure Python off"functions"), so there's no reason Zero-Dependency Mode should be any more broken here than the main path.Test plan
test_network_risk_sensor.py: assertions on both the main networkx path and the Zero-Dependency Mode fallback provingfile_data["max_big_o"]is now populated correctly for both a simple and a complex function.test_dev_agent_firewall.py: new end-to-end test (test_black_hole_detection_from_real_network_risk_sensor_output) that runs the REALNetworkRiskSensor.build_dependency_graph()and feeds its real output into the REALDevAgentFirewall.evaluate_ecosystem(), proving the Agentic Black Hole guardrail now fires on genuine O(N^4) complexity -- not just a hand-mocked"max_big_o": 3like the existing unit test.tests/dead_key_audit_baseline.json:"max_big_o"removed now that it's fixed (python tests/dead_key_audit.py --ciconfirmed clean at 6 baselined keys, zero regressions).python -m pytest tests/ -q-- full suite, 859 passed, 1 pre-existing xfail.flake8 . --count --select=E9,F63,F7,F82-- 0.🤖 Generated with Claude Code