Skip to content

StatisticalAuditor constructed without lang_defs -> GATE C/D density gates are dead code in production #2325

Description

@squid-protocol

Summary

gitgalaxy/galaxyscope.py:722:

self.auditor = StatisticalAuditor(parent_logger=logger)

No lang_defs argument. StatisticalAuditor.__init__ does self.lang_defs = lang_defs or {}, so in every real scan self.lang_defs == {}.

In audit()'s per-language loop, the inert check is:

if hasattr(self, "lang_defs") and lid in self.lang_defs:
    rules = self.lang_defs[lid].get("rules", {})
    active_signals = sum(1 for key in self.SIGNAL_KEYS if rules.get(key) is not None)
    if active_signals == 0:
        is_inert = True
else:
    is_inert = True  # Unknown/Undefined languages are inert by default   <-- ALWAYS taken

if is_inert:
    verified_files.extend(group)
    ...
    continue

Since lid is never in {}, every language group is treated as inert and short-circuited straight into verified_files. That means:

  • GATE C (low-sample orphan threshold — revert to plaintext)
  • GATE D (MAD baseline, Impossible Density Law rho > 3.0, Zero-Density hard floor)
  • dead-code detection (_is_dead_code)
  • the polyglot-blend baseline defense

…none of them execute against real scans. Only the pre-loop Heuristic Extension Consensus triage actually runs.

Evidence

Confirmed while fixing #1926: a real scan of language-crucible/data/yacc logs [yacc] Bypassed 2 artifact(s) (Static Asset: 0 Active Signals) — yacc obviously has dozens of active signal rules, but the auditor can't see them.

Impact / decision needed

Either:

  • Wire it up — pass config["LANGUAGE_DEFINITIONS"] (or lang_defs) into the constructor. This turns GATE C/D back on, which will change output for small / sparse / low-confidence corpora (that's the whole point of those gates) — needs a full golden-master regression pass and a review of what it re-flags.
  • Or delete the dead gates if they're not wanted.

Not urgent (nothing is currently broken because of this — arguably the opposite), but the code reads as active defense that isn't.

Found via #1926 / #2324.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing engine

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions