Skip to content

[METRICS] Wire ECOSYSTEM_MISMATCH_WEIGHTS injection penalty into security_auditor.py taint tracking #1089

Closed as not planned

Description

@squid-protocol

Summary

Follow-up to #1053. That issue wired SignalProcessor._get_context_multipliers into calculate_risk_vector (PR TBD), so ecosystem-mismatch files (e.g. C code embedded in a JS-dominant folder) now get real memory/state_mutation risk penalties. The third key that function returns, injection, was deliberately left unwired in that PR.

Why it's separate

_get_context_multipliers's output shape is {"memory": float, "state_mutation": float, "injection": float}, matching ECOSYSTEM_MISMATCH_WEIGHTS's shape in gitgalaxy/standards/analysis_lens.py. But unlike memory (-> _calc_safety's attack_hits) and state_mutation (-> _calc_state_flux, already consumed via mp_map), there is no injection-risk consumer anywhere in gitgalaxy/metrics/signal_processor.py. Injection-style risk is computed in a completely different module/pipeline stage: gitgalaxy/security/security_auditor.py's taint tracking.

Bundling this into #1053's PR would have meant reaching across modules for a key that currently has no ECOSYSTEM_MISMATCH_WEIGHTS entries defined anyway (systems_in_web only sets memory, web_in_systems only sets state_mutation) -- so there was no concrete penalty value to wire yet, let alone a consumer.

Proposed scope

  1. Decide whether ecosystem-mismatch injection penalties belong in security_auditor.py's taint-tracking risk math, or whether SignalProcessor should gain its own injection-risk dimension first.
  2. If the former: pass folder/file ecosystem context (or the already-computed multiplier dict) through to wherever security_auditor.py scores injection risk, and add real penalty values to ECOSYSTEM_MISMATCH_WEIGHTS for the injection key.
  3. Add a regression test analogous to test_signal_processor_ecosystem_mismatch_penalizes_safety in tests/core_engine/test_signal_processor.py, but for the injection path.
  4. Per the Differential Scan protocol (CLAUDE.md), verify via python tests/tools/crucible_check.py and re-bless golden masters if output changes.

References

Activity

  1. added
    enhancement
    metrics
    on Aug 6, 2026
  2. added a commit that references this issue on Aug 6, 2026
  3. squid-protocol commented on Sep 16, 2026

    @squid-protocol
    OwnerAuthor

    Closing as won't-do / obsolete.

    First, to correct the premise: taint tracking has not been removed. It is fully live — security_lens.py still performs the O(H) data-flow taint tracking and emits tainted_injection, and security_auditor.py still consumes it as sec_tainted_injection / raw_sec_tainted_injection.

    The real reason to close is #3022 (merged 2026-09-14, "stop overclaiming SQL injection from co-located regexes"), which established the engine's policy that injection is a structural signal, not a scorable verdict:

    This issue's entire proposal is to amplify injection risk with an ecosystem-mismatch multiplier — the exact direction #3022 deliberately retreated from. And as this issue's own body notes, there is still no injection penalty defined in ECOSYSTEM_MISMATCH_WEIGHTS (systems_in_web sets only memory, web_in_systems only state_mutation), so shipping this would mean inventing new penalty values to amplify a signal we just downgraded as low-precision.

    The now-inert injection key that SignalProcessor._get_context_multipliers still returns is tracked for removal in #3099.

  4. added a commit that references this issue on Sep 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

    enhancementmetrics

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions