Skip to content

Remove algorithmic_dos metric due to compounding heuristic failures #1016

Closed as not planned

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.

Activity

  1. squid-protocol commented on Aug 4, 2026

    @squid-protocol
    OwnerAuthor

    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.

  2. added
    scope:frontier
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:frontier

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions