Skip to content

Churn risk is silently zeroed for documentation and critical-secret-leak files #245

Description

@squid-protocol

File: signal_processor.py
Labels: bug, data-integrity, priority:high
Description
calculate_risk_vector has three code paths:

Critical-secret-leak override (~line 309)
Static-literature/documentation override (~line 403)
Normal active-signal path (~line 462, the only one reached for ordinary code files)

Paths 1 and 2 both compute raw_churn_freq and use it to set the churn entry in risk_vector directly (lines 331, 417), but their telemetry dicts (lines 333–350, 427–437) never include a "raw_churn_freq" key. Only path 3's telemetry_payload stores it (line 825).
Separately, summarize_galaxy_metrics calls _normalize_temporal_metrics (line 871), which runs over every file in parsed_files and unconditionally overwrites risk_vector[churn_idx]:
python# lines 1266, 1277
freq = file_data.get("telemetry", {}).get("raw_churn_freq", 0.0)
...
file_data["risk_vector"][idx] = round(final_churn, 2)
Impact: For every markdown/plaintext/documentation file and every file flagged as a critical secret leak, raw_churn_freq reads back as the default 0.0 (it was never written), so the correctly-computed churn score from paths 1/2 gets clobbered with 0.0 during the global normalization pass. These files will always report zero churn risk in the final report regardless of actual git history — silently and without any error.
Fix: Add "raw_churn_freq": raw_churn_freq to the telemetry dicts built in both the critical-leak branch and the static-literature branch, or have _normalize_temporal_metrics skip files whose archetype indicates a static/literature/leak override.

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-engineModifications to the central physics and parsing engine

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions