Repository navigation
Remove logic_bomb and algorithmic_dos metrics from the risk engine - #1029
Merged
Merged
Conversation
Both metrics generate systematic false positives by criminalizing standard programming patterns. logic_bomb multiplies branching logic by defensive payloads (panics/cleanup), so any safe function that validates input and raises on failure -- log rotators, garbage collectors -- scores as a "Logic Bomb" purely from keyword co-occurrence, with no AST-level link between trigger and payload. algorithmic_dos layers on top of it, deriving "Big-O" purely from whitespace indentation depth and compounding it with unrelated io/api signals, so deeply nested but harmless server loops (e.g. Django's runserver.py) get flagged as intentional DoS attacks. Removes both from signal_processor.py (calc functions, exposure vector, tuning lookups) and analysis_lens.py (RISK_SCHEMA, RISK_EQUATION_TUNING, NATIVE_WEIGHTS, ECOSYSTEM_MISMATCH_WEIGHTS, CONTEXT_VIOLATION_MATRIX, FRIENDLY_MAP, EXPOSURE_LABELS, ThreatPolicy thresholds), plus every downstream consumer: audit_recorder.py, llm_recorder.py, supply_chain_firewall.py, and the stale galaxyscope:ignore suppression comment in state_rehydrator.py. Deletes the two dedicated wiki pages and fixes the doc mentions/index links. Golden master fixtures (both full-precision and zero-dependency mode) regenerated via update_golden_master.py -- the diff is exactly the two removed keys disappearing from every file's risk vector, nothing else moved. Closes #1015. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
4 tasks done
squid-protocol
added a commit
that referenced
this pull request
Aug 4, 2026
…engine (#1032) - Deletes the indentation-based Big-O tracker and the name-occurrence-count recursion heuristic in detector.py, plus the FunctionNode fields they fed. Both generated systematic false positives: whitespace geometry doesn't measure algorithmic complexity, and counting a function's own name inside its body triggers on docstrings, comments, logging, and super().setUp() patterns. - Removes every downstream consumer beyond the issue's own checklist, found via grep: the magnitude/impact complexity_multiplier in detector.py, the "Algorithmic Network Bottleneck" feature in network_risk_sensor.py (a networkx graph attribute + telemetry field with no other consumer), signal_processor.py's max_algorithmic_complexity telemetry string, the big-O term in the documentation-risk "opaque execution" formula, the concurrency "resource exhaustion guard" starvation multiplier, and dev_agent_firewall.py's Context Window Exhaustion gate (now token_mass alone, consistent with #1013's choice not to invent a replacement AST-less heuristic). - Updates the two wiki pages and CLAUDE.md/ANTIGRAVITY.md self-scan-DB example queries that referenced these fields. This is sub-issue #1014 of epic #1025, next after #1015 since algorithmic_dos (#1015, merged via #1029) was mathematically built on big_o_depth. Closes #1014. Test plan: - python -m pytest tests/ -- 5444 passed, 0 failed, 2 skipped, 11 xfailed, 3 xpassed - python tests/tools/audit_check.py --regenerate -- clean (ruff/mypy baselines regenerated, all pure line-shifts) - ruff format --check -- clean - Golden master fixtures regenerated via update_golden_master.py in both full-precision and zero-dependency venvs -- diff is magnitude/impact and the concurrency/documentation risk scores shifting downward across the corpus now that the fake complexity multipliers are gone; crucible_check.py passes clean on both modes after blessing. 🤖 Generated with Claude Code Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]>
This was referenced Aug 7, 2026
squid-protocol
added a commit
that referenced
this pull request
Aug 7, 2026
- Rewrite 106 file:///home/joe/... absolute-path links (82 files) into working links: source-code references now point at GitHub blob URLs, internal cross-links now use relative wiki paths. These previously resolved only on the author's own machine and were dead for every reader of the deployed site. - Drop the mkdocs.yml nav entry for 08-20-logic-bomb-exposure.md, whose underlying metric was removed from the risk engine in #1029; the page was never created, leaving a dangling nav link. - Remove the dead teardown-of-rails.md link from the Museum of Code index -- no such page was ever authored. Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]>
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
logic_bombandalgorithmic_dosrisk metrics engine-wide: both generate systematic false positives by criminalizing standard patterns (defensive validation code, deeply-indented-but-harmless server loops) via unrelated regex hit-count co-occurrence rather than any real control/data-flow analysis._calc_logic_bomb/_calc_algorithmic_dosand every schema/config entry that fed them (RISK_SCHEMA,RISK_EQUATION_TUNING,NATIVE_WEIGHTS,ECOSYSTEM_MISMATCH_WEIGHTS,CONTEXT_VIOLATION_MATRIX,FRIENDLY_MAP,EXPOSURE_LABELS,ThreatPolicythresholds), plus every downstream consumer (audit_recorder.py,llm_recorder.py,supply_chain_firewall.py, a stalegalaxyscope:ignorecomment instate_rehydrator.py).This is sub-issue #1015 of epic #1025 (post-
db_complexityoverreaching-metrics removal wave), first in execution order since #1015 absorbs the duplicate #1016 andalgorithmic_dosis mathematically built onbig_o_depth(#1014, next in the epic).Closes #1015.
Test plan
python -m pytest tests/— 5447 passed, 0 failed, 2 skipped, 11 xfailed (pre-existing), 3 xpassedpython tests/tools/audit_check.py— clean (ruff baseline regenerated for pure line-shifts only)ruff format --check— no new drift from this changepython tests/tools/update_golden_master.pyin both full-precision and zero-dependency venvs (.crucible_venvs/) — diff is exactly the two removed keys disappearing from every scanned file's risk vector, confirmed no other output moved🤖 Generated with Claude Code