Remove db_complexity metric from the Structural Extractor - #1021
Merged
Conversation
db_complexity never actually looked for databases -- it summed unrelated io (x3), serialization_parsing (x2), and state_mutation (x1) signature hits and called the result "database complexity," so any IO-heavy or mutation-heavy function scored as DB-complex regardless of whether a database or ORM was involved. Removes the metric from detector.py (FunctionNode schema + calculation) and every downstream consumer it had spread to: the dead graph-node attribute in network_risk_sensor.py, the DoS-score amplifier and max_db_complexity telemetry in signal_processor.py, the "Over-Permissioned Agent" security heuristic in ai_appsec_sensor.py (now gated on the real arch_io signal instead), and the SQLite schemas/report sections in record_keeper.py and llm_recorder.py. Closes #1013. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Fixes Muninn scan findings on PR #1021: - GHSA-g6cj-pr64-35w5 (CVE-2026-69247): PKCS#7 EnvelopedData decryption exposed a Bleichenbacher oracle through distinguishable errors/timing - GHSA-jwv3-5hgf-82ww (CVE-2026-69249): duplicate self-signed intermediates could cause exponential path-building - GHSA-m2h6-j472-rp4c (CVE-2026-69248): verifier accepted wildcard DNS names that escape permittedSubtrees constraints No code in this repo imports the cryptography package directly (only a keyword-string reference in analysis_lens.py's security lexicon), so this is a transitive-dependency bump with no API surface to verify. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Aug 4, 2026
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
db_complexitydidn't measure database complexity at all -- it summed unrelatedio(x3),serialization_parsing(x2), andstate_mutation(x1) signature hits, so any IO-heavy or mutation-heavy function scored as "DB complex" with zero database/ORM involvement.detector.py(schema + calculation) and every downstream consumer it had spread to beyond what the issue's checklist covered:network_risk_sensor.py(dead graph-node attribute, never read),signal_processor.py(DoS-score amplifier +max_db_complexitytelemetry),ai_appsec_sensor.py(was an alternate trigger condition in the "Over-Permissioned Agent" security rule -- now gated on the realarch_iosignal instead), and the SQLite schemas/report sections inrecord_keeper.pyandllm_recorder.py.Test plan
python -m pytest tests/-- 5451 passed, 0 failedpython tests/tools/audit_check.py-- clean (ruff baseline regenerated, all pure line-shifts; mypy/dead-key unaffected)ruff format --check-- cleantest_signal_processor.py,test_ai_appsec_sensor.py,test_record_keeper.py,test_llm_recorder.pyto match; one DoS-score threshold recalibrated since it was tuned assuming the now-removed amplifierCloses #1013.
🤖 Generated with Claude Code