Skip to content

Remove algorithmic_dos metric due to compounding heuristic failures #1016

Description

@squid-protocol

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:

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions