Skip to content

file_data.ecosystem_baseline never propagated from repo-level (100% empty across 1.2M files) #1149

Closed

Description

@squid-protocol

🛑 Problem Statement

Found via #1144 (population-scale validation against 718 real repos / 1.2M files).
file_data.ecosystem_baseline is 100% empty across all 1,201,836 files in master_db_v247.db.

This isn't a missing-producer case: the repo-level repo_data.ecosystem_baseline is correctly
populated for all 718 repos (real values like "Cluster 3", matching the
repo_macro_species/z-score clustering surfaced elsewhere in the engine's own summary output).
The column exists in file_data's schema, is included in record_keeper.py's INSERT statement
(gitgalaxy/recorders/record_keeper.py:641), and is bound to a real variable positionally — but
whatever feeds that variable at file-scope is always empty, while the repo-scope equivalent works.

🎯 Objective

Either propagate the repo-level ecosystem_baseline down to each of its files (the simplest,
most likely-correct fix, since a file's ecosystem baseline is presumably just its parent repo's),
or clarify if file-level ecosystem_baseline was meant to be independently computed per-file for
polyglot/monorepo cases and that computation was simply never wired.

🛠️ Proposed Implementation

Trace the variable bound to ecosystem_baseline in the file_data INSERT (near
record_keeper.py:641) back to where it's set (or never set) before the INSERT call, and compare
against how repo_data.ecosystem_baseline gets its value successfully. Most likely fix: copy the
already-computed repo-level baseline down to each file record.

✅ Acceptance Criteria

  • A file within a repo that has a real repo_data.ecosystem_baseline produces the same
    (or an intentionally-derived) non-empty file_data.ecosystem_baseline, proven by a real
    test.

Activity

  1. added
    bug
    good first issue
    data-integrity
    schema
    on Aug 7, 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

    bugdata-integritygood first issuepriority: mediumschema

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions