You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove algorithmic_dos metric due to compounding heuristic failures #1016
Remove algorithmic_dos metric due to compounding heuristic failures
Description
The algorithmic_dos measurement in gitgalaxy/metrics/signal_processor.py needs to be completely removed. An investigation into the ML Threat Intelligence engine's massive false positives (like flagging static UI files as O(N^6) threats) reveals that this metric is fundamentally flawed and structurally unsound.
Why it is broken
The calculation for algorithmic_dos is mathematically built on top of two underlying heuristics that we have already proven to be entirely hallucinated:
big_o_depth (Whitespace Indentation): The engine uses depth**2 as the baseline func_threat. Because big_o_depth derives its value purely by counting whitespace indentation, any deeply nested but completely safe code (like standard server listeners or nested JSON configuration files) instantly generates an exponential Algorithmic DoS threat base score.
db_complexity (Regex String Matching): The base threat is then compounded by a multiplier derived from db_complexity. Because this metric naively counts regex occurrences of words like select and join regardless of semantic context, standard string manipulation combined with deep indentation triggers catastrophic false positives.
Conclusion: The algorithmic_dos metric does not measure actual Denial of Service vulnerability; it simply measures whitespace indentation depth multiplied by arbitrary string matches. This causes standard framework files (like Django's runserver.py) and purely static frontend components to be falsely flagged with 100% Algorithmic DoS risk.
Action Items
Remove _calc_algorithmic_dos from gitgalaxy/metrics/signal_processor.py.
Remove algorithmic_dos from RISK_SCHEMA and all upstream/downstream aggregators.
Ensure any AI threat reporting logic depending on this score is decoupled.
Duplicate of #1015, which bundles this same algorithmic_dos removal together with logic_bomb (both live in _calc_algorithmic_dos/_calc_logic_bomb in signal_processor.py, same PR scope). This issue's rationale (the db_complexity compounding, already removed in #1013) is a useful addition and will be folded into #1015's PR description.
Closing this out in favor of #1015 to avoid removing algorithmic_dos twice. Tracked under the wave epic: #1025.
Activity
squid-protocol commentedon Aug 4, 2026
Duplicate of #1015, which bundles this same
algorithmic_dosremoval together withlogic_bomb(both live in_calc_algorithmic_dos/_calc_logic_bombinsignal_processor.py, same PR scope). This issue's rationale (thedb_complexitycompounding, already removed in #1013) is a useful addition and will be folded into #1015's PR description.Closing this out in favor of #1015 to avoid removing
algorithmic_dostwice. Tracked under the wave epic: #1025.