Repository navigation
Description
🛑 Problem Statement (expanded scope)
Found via #1144 (population-scale validation against 718 real repos / 1.2M files). The raw
tabs_vs_spaces hit-count column (repo_data/file_data/function_data) is exactly 0 across
every row in master_db_v247.db, unfiltered.
Digging into why surfaced a bigger design problem than a single dead column. There are two
tabs_vs_spaces entries sharing one slug across two different schemas:
SIGNAL_SCHEMA["tabs_vs_spaces"]— the raw hit-count column above. AlwaysNonein every
language's rule dict inlanguage_standards.py→ always 0. Genuinely dead, no producer.RISK_SCHEMA["tabs_vs_spaces"]— a real, working derived score from
signal_processor.py's_calc_civil_war(), fed by the actually-functioning raw signatures
indent_tabs/indent_spaces(universal regex,detector.py). 0 = pure tabs, 100 = pure
spaces, 50 = mixed/neutral. This one has real data (865,481 / 1,201,836 files nonzero, avg 88.0
per the original report).
tabs_vs_spaces was designed as a lighthearted "which indentation camp is this codebase in"
stat — not a real risk/quality signal, and not intended to measure formatting consistency as
if it were a code-quality bar to clear. But #2 above lives in RISK_SCHEMA today, labeled
"Civil War Exposure," as if it were one more percentage-weighted risk exposure like
cognitive_load or tech_debt.
The tell that it never actually behaved like risk: every consumer of it already special-cased
it as not-risk, without anyone ever pulling it out of RISK_SCHEMA:
- excluded from the ML feature vector (
signal_processor.py) - excluded from cumulative-risk ranking, with a comment saying so (
signal_processor.py) - skipped in the LLM report's risk table and "Primary Risk Drivers" (
llm_recorder.py, two
sites) audit_recorder.pyliterally reverse-engineers the 0-100 percentage back into
"Tabs" / "Spaces" / "Mixed" / "Neutral / Deadlocked" labels for the formal audit report —
i.e. someone already rebuilt the "what camp is this repo in" read from the outside, because the
RISK_SCHEMAversion wasn't fit for that purpose as shipped.
🎯 Objective
Stop conflating a lighthearted structural fact with a risk-exposure score. Concretely:
- Remove the dead raw
tabs_vs_spaceskey fromSIGNAL_SCHEMA(the original ask). - Remove the derived
tabs_vs_spacesscore fromRISK_SCHEMAentirely — it should not report as
a "risk exposure" percentage anywhere (report output, DB column, ML feature vector). - Keep
indent_tabs/indent_spacesas-is — they're real, working raw structural signatures. - Surface the "which camp" read as plain descriptive telemetry (same bucket as
archetype/
ownership, which already live outside the risk vector for the same reason) instead of as a
disguised risk percentage.
🛠️ Implementation
analysis_lens.py: droptabs_vs_spacesfrom bothRISK_SCHEMAandSIGNAL_SCHEMAlists, and
fromFRIENDLY_MAP/EXPOSURE_LABELS.language_standards.py: remove the vestigial"tabs_vs_spaces": Noneentry (+ its comment)
from every language's rule dict.signal_processor.py: replace_calc_civil_war()(returned a 0-100 float into
exposure_vector) with_calc_indentation_style()(returns a descriptive string:"Tabs"/
"Spaces"/"Mixed (NN.N% Spaces / NN.N% Tabs)"/"Neutral / No Indentation"), written into
telemetry_payload["indentation_style"]instead of the risk vector. Delete the now-dead
special-casing this collapses (blanket-risk-vector default for doc languages, ML-vector skip,
cumulative-risk exclusion).llm_recorder.py: remove the two now-deadtabs_vs_spacesskip sites in the risk table and
"Primary Risk Drivers" list.audit_recorder.py: remove the reverse-engineering block that rebuilt "Tabs/Spaces/Mixed" from
the risk percentage; source"Indentation Style"directly from
telemetry["indentation_style"]in the identity block instead (next toArchitect/Language).record_keeper.py:risk_tabs_vs_spacesSQLite column drops automatically (schema-driven from
RISK_SCHEMA).- Re-bless
tests/golden_master_audit.json/tests/golden_master_zero_dep_audit.jsonvia
tests/tools/update_golden_master.py(risk-vector shape changes).
✅ Acceptance Criteria
- No
tabs_vs_spaceskey remains inRISK_SCHEMAorSIGNAL_SCHEMA. -
indentation_styletelemetry fact is populated and surfaced in at least the audit report. -
risk_tabs_vs_spacesDB column no longer produced. -
tests/dead_key_audit.py --cibaseline unaffected (or updated if needed). -
crucible_check.pyclean / golden master fixtures re-blessed with rationale in the PR.
Activity
[-]tabs_vs_spaces raw hit-count column is vestigial dead weight (superseded by risk_tabs_vs_spaces)[/-][+]tabs_vs_spaces conflates a lighthearted structural fact with a risk-exposure score -- move out of RISK_SCHEMA[/+]fix(metrics): stop conflating tabs_vs_spaces with a risk exposure (#1147
docs(recorders): confirm audit_shadow_apis has a real, working produc…