Repository navigation
feat(archetypes): retrain function/file/repo brains on the v2.9.0 corpus - #3196
Conversation
Retrained all archetype models on the fresh 739-repo v2.9.0 fleet scan (8.27M functions, 1.49M files) via the population-analyses trainers: - GENERAL_FUNCTION_INFERENCE_MODEL: k=14, re-labeled (12 archetypes kept 1:1 by nearest-centroid on the aligned contract; 'Tests & Verification' merged into 'Annotated & Test Methods'; new 'Stateful Encapsulated Methods' for the Encapsulated-Accessors split). Feature contract dropped log_density_token_mass (Rosetta governance) -> 37-dim. DNA_SOURCES carried over from the prior brain (schema-stable engine->hit_vector mapping the trainer does not emit). - GENERAL_FILE_INFERENCE_MODEL: k=18, 83-dim (now includes the 14 function stoichiometry features from func_cluster_ratios). DNA_SOURCES carried over. - file_archetype_brain.json (k=15) + repo_archetype_brain.json (k=7): refrozen, both self-validate at 100%. repo feature_contract_sha re-pinned (composition features follow the retrained file archetypes) with engine review. Parity: a real scan classifies func/file/composition/repo with no dimension mismatch and no Unclassified flood (func 748/748, file 146/146, composition 146/146 on original_doom). Detection accuracy unchanged (1.0, no confusion). Golden masters reblessed -- all 12,727 diffs are archetype-driven, no structural/language drift. Full engine suite 9681 passed; archetype parity 14/14. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Process notes — this retrain took far longer than it should haveRecording the friction so the next archetype retrain is a fraction of the effort. Ranked by payoff. 1. The corpus DB was on the HDD → the rollup was I/O-bound (biggest single cost)
2. There is no single "retrain" entry point — it's ~10 manual, order-sensitive stepsThe real order is: merge → train functions → label functions →
3. The trainer doesn't emit
|
…#4105) * feat(archetypes): graded per-level validation + drift harness (#4100) The archetype brains are retrained offline far less often than the engine changes, so labels are allowed to drift ahead of a retrain -- but no longer unseen. Each level of the function -> file -> composition-file -> composition-repo tower now carries a trust state (VALIDATED / DRIFTING / UNVALIDATED / DEGRADED / INVALID): - archetype_parity: live structural checks incl. cross-level label-vocabulary parity (which the per-brain gate could not see), brain fingerprints, and validation_status() combining them with the shipped record. - archetype_brains/archetype_validation.json: trained-at engine/corpus, per-level agreement with the trained state, eroding archetypes, open retrain issue, history. Agreement is stability, not accuracy. - INVALID levels are withheld ("Unvalidated"); withholding depends only on the brains, never on the auto-refreshed record. - tests/tools/archetype_drift.py + tests/archetype_trained_baseline.json (crucible labels at the #3196 trained-against engine, 44ffeb1). - Golden Crucible job: one shared scan feeds the golden diff and a report-only drift summary. archetype-validation.yml re-measures on main, opens a record PR for review when a number moves, and opens/updates/closes one archetype-retrain issue. - LLM brief section 0 + audit forensic trail report the state (the audit block is sanitized from golden diffs like a timestamp). Found and now flagged: the composition brain reads pre-#3196 function labels (DEGRADED), and the repo brain's inputs share no label with the composition brain (INVALID -> repo composition archetype withheld). Golden masters re-blessed: 8 diffs per mode, all the withheld repo composition archetype (Hub-Coupled Monorepo -> Unvalidated, z 5.592 -> 0.0). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(#4100): make multi-line strings explicit for CodeQL implicit-concatenation alerts Hoist render_issue's multi-line strings to named constants and build structural problems via _problem(), so no list/tuple element relies on implicit string concatenation. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Retrains all archetype models on the fresh 739-repo v2.9.0 fleet scan (8.27 M functions, 1.49 M files) and bakes the new brains into the engine.
What changed
GENERAL_FUNCTION_INFERENCE_MODELlog_density_token_mass(Rosetta governance) → 37-dim.GENERAL_FILE_INFERENCE_MODELfunc_cluster_ratios).file_archetype_brain.jsonrepo_archetype_brain.jsonfeature_contract_share-pinned (composition features follow the retrained file archetypes).DNA_SOURCES(the schema-stable feature→hit_vector mapping the trainer doesn't emit) is carried over from the prior brains, verified to cover every new feature.Validation
Unclassifiedflood — func 748/748, file 146/146, composition 146/146; new labels flow through ("Stateful Encapsulated Methods", "Compute Cores Files"). Values changed vsmain(= new clustering).feature_contract_shaupdated deliberately per the intentional-change gate).Notes
analysis_lens.pydiff is large because the two model dicts are machine-generated and were reformatted on regeneration — the semantic change is just those two constants..txt/.csv/.json) land in a companiongitgalaxy-population-analysesPR.🤖 Generated with Claude Code