Skip to content

Archetype brains carry no training provenance #3124

Closed

Description

@squid-protocol

Found by a design review of gitgalaxy/metrics/archetype_classifier.py and the baked brains in gitgalaxy/standards/archetype_brains/.

Both baked composition brains ship with zero record of what produced them

Verified key sets:

  • file_archetype_brain.json (k=15): k, stoich_weight, stoich_archetypes, aux_features, aux_quantiles, centroids, noncode_languages, min_coding_loc, noncode_bucket, z_score_params
  • repo_archetype_brain.json (k=7): k, comp_weight, comp_archetypes, min_files, scale_features, coupling_feature, aux_quantiles, feature_order, centroids, micro_bucket, z_score_params

Neither carries any meta / trained_on / corpus / sha / date / version key — confirmed by direct key inspection, not by eye.

They are loaded at gitgalaxy/standards/analysis_lens.py:33-34 from gitgalaxy/standards/archetype_brains/, and the trainers that produce them live outside this repository (the train-archetypes skill covers the cluster_functions/files/repos.py k-means trainers, a freeze step, and pushing artifacts into both gitgalaxy and gitgalaxy-population-analyses).

So there is no in-repo way to answer: which corpus, at which commit, with what language mix, produced the centroids currently shipping?

Why it matters

Every archetype label and fit z-score in a customer-facing brief — Composition Archetype: I/O & Config Routines Files (z +0.49), Architectural Drift Z-Score: -0.592 — is implicitly a claim about a reference population that nobody can identify or reproduce.

This is conspicuous next to the surrounding discipline:

artifact provenance record
keyword-rosetta corpus FIDELITY_PROVENANCE in gitgalaxy/standards/fidelity_table.py:23 — corpus, corpus_sha, engine_mode, languages, signals, with an audit that warns when it goes stale
tree-sitter accuracy committed per-language baselines (30 tests/tree_sitter_accuracy_baseline_<lang>.json)
composition archetype brains nothing

#3123 raises the stakes further by turning the brains into a conformance authority: "your generated code does not look like real Java" is only as defensible as the corpus behind it.

Ask

Bake a provenance block into both brains at freeze time, carrying: corpus name, corpus commit sha, trained-at timestamp, file count, language mix, trainer version, and k.

Surface it in the LLM brief's section 0 FORENSIC TRACEABILITY (gitgalaxy/recorders/llm_recorder.py:210), which already reports Engine, Git Remote and Zero-Dependency Mode.

Note for the implementer: section 0 deliberately excludes fields that vary between two scans of the same commit — a per-scan field made its auto-merging PR a ~21-commits/day treadmill (see the comment at llm_recorder.py:214-220). Brain provenance is static per engine version, changing only when a brain is refrozen, so it satisfies that constraint — but say so in the PR, or it will look like a re-litigation of that decision.

Add a test asserting the block is present and non-empty, so a future freeze cannot silently drop it.

The freeze step lives in the other repo, so this likely needs a paired change in gitgalaxy-population-analyses. Flagging that rather than assuming it is all in-repo.

Scope note

This is about the two composition brains (file_archetype_brain.json, repo_archetype_brain.json). The separate inference brain family (GENERAL_FILE_INFERENCE_MODEL / SPECIFIC_FILE_INFERENCE_MODEL in analysis_lens.py) has its own open governance work in #3085, with history in #1158 and epic #1160 — related, but a different artifact and not what this issue asks to change.

Related

#3123 (the conformance use that depends on this being credible), #3122 (epic), #3085 / #1158 / #1160 (neighbouring archetype-model governance).

Activity

  1. added
    enhancement
    ml-ops
    metrics
    core-engine
    on Sep 17, 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

    core-engineenhancementmetricsml-ops

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions