Skip to content

[BUG/APPSEC] Dev Agent Firewall's Silent Mutation Risk dampener can never be satisfied -- nothing writes telemetry["has_tests"] #373

Closed

Description

@squid-protocol

🛑 Problem Statement

Found by the dead key auditor (#325). gitgalaxy/tools/ai_guardrails/dev_agent_firewall.py:105:

has_tests = file_data.get("telemetry", {}).get("has_tests", False)

Used in the "Cascading State Flux (Silent Mutation Risk)" rule:

if state_flux > 50 and in_degree > 5 and not has_tests:
    guardrails["silent_mutation_risk"] = True

No producer anywhere writes telemetry["has_tests"], so has_tests is always False, and not has_tests is always True. Unlike most of the other findings in this audit, this is a false-positive risk, not a false-negative one: a high-flux, high-in-degree file can never have this guardrail dampened by genuine test coverage, even if it's thoroughly tested. The engine already computes real coverage data (meta.get("test_coverage_map", {}), used elsewhere in signal_processor.py's verification scoring) -- it's just never threaded into telemetry["has_tests"].

🎯 Objective

Files with real, meaningful test coverage should be able to suppress the Silent Mutation Risk guardrail as designed.

🛠️ Proposed Implementation

Derive a real boolean from the existing test_coverage_map (or the verification risk score) and write it into telemetry["has_tests"] before DevAgentFirewall.evaluate_ecosystem() runs.

✅ Acceptance Criteria

  • A file with high state flux, high in-degree, AND real test coverage does NOT trigger silent_mutation_risk, proven by a test using the real pipeline.

Activity

  1. added
    bug
    appsec
    threat: false-positive
    on Jul 24, 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

    appsecbugpriority: mediumthreat: false-positive

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions