Skip to content

[BUG/METRICS] Per-file "repo_z_score" telemetry is never populated -- real value lives at summary["repo_macro_species"]["z_score"] #371

Closed

Description

@squid-protocol

🛑 Problem Statement

Found by the dead key auditor (#325). Two read sites:

# gitgalaxy/recorders/record_keeper.py:505
repo_z = tel.get("repo_z_score", 0.0)
# gitgalaxy/recorders/llm_recorder.py:1416
repo_z = tel.get("repo_z_score", 0.0)

Both read a per-file telemetry["repo_z_score"] key that is never written anywhere. The real repo-wide z-score is computed and stored, but nested one level differently and at repo scope, not per file: summary["repo_macro_species"]["z_score"] (signal_processor.py, and correctly read this way elsewhere -- e.g. llm_recorder.py:1254,1269 does macro_info = summary.get("repo_macro_species", {}) then macro_info.get("z_score", 0.0)). Nothing ever threads that repo-wide value down into each file's own telemetry dict, so these two flat reads always fall back to 0.0. Both the SQLite repo_z_score REAL column and the LLM brief's per-file z-score are always 0.0.

🎯 Objective

Decide whether per-file repo_z_score should exist at all (each file tagged with the repo's overall drift z-score for context), and if so, make it real.

🛠️ Proposed Implementation

If per-file tagging is the intent: in galaxyscope.py's telemetry-assembly step, copy summary["repo_macro_species"]["z_score"] into each file's telemetry["repo_z_score"] after summary is computed. If it's not actually needed per-file (the repo-level value is enough), remove these two dead reads and the SQLite column instead.

✅ Acceptance Criteria

  • Either repo_z_score is real per-file data proven by a test, or the dead reads/column are removed with a documented reason.

Activity

  1. added
    bug
    metrics
    data-integrity
    on Jul 24, 2026
  2. squid-protocol commented on Jul 24, 2026

    @squid-protocol
    OwnerAuthor

    Fixed in #382 (merged).

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

    bugdata-integritymetricspriority: medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions