Repository navigation
fix(#4106): compute file-archetype distance + fingerprint; retire the dead per-language fields - #4117
Merged
Merged
Conversation
…re the dead per-language fields
Five per-file archetype fields were placeholders reported as measurements --
constant N/A / 0.0 / {} on every crucible file since #3061 moved file
classification into record_keeper, which only overwrote the label.
Computed (general file archetype, k=18):
- record_keeper._classify_file_archetype_detail returns the nearest archetype,
its Euclidean centroid distance and the distance to every centroid; the loop
already computed them and threw them away. Written to global_drift and
archetype_fingerprint, which revives the GPU a_ids/a_dists secondary match,
the LLM brief's "Top Global Matches" and its mixed-responsibility section.
- The audit key "Repository Drift (Z-Score)" becomes
"Repository Drift (Centroid Distance)" -- it is a distance, not a z-score.
- Mixed-responsibility now uses a RELATIVE gap (ENGINE_CONSTANTS
MIXED_RESPONSIBILITY_GAP = 0.02: second-nearest within 2% of the nearest).
The old absolute 0.9 was tuned for a retired feature space and would flag
33% of crucible code files; 0.02 flags ~5% (149/3,003).
Retired (per-language "local micro-species"):
- SPECIFIC_FILE_INFERENCE_MODEL (~3,600 lines) and LANGUAGE_INFERENCE_MODELS
are removed: nothing applied them since #3061, and they could not be applied
-- no FEATURE_NAMES, and 74 dims match no feature space the engine computes.
- local_archetype/local_drift/local_fingerprint leave the telemetry, the audit
("File Archetype", "File Drift (Z-Score)", "File Fingerprint"), the LLM brief
(incl. the "Severe Anti-Patterns" drift-ratio check) and the LLM graph DB.
- docs/wiki/08-19 no longer documents the drift-ratio multiplier.
Golden masters re-blessed: only 3_architectural_profile parts move -- four
retired keys deleted, repository_fingerprint populated, and the renamed
distance key added.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
…pe-fields # Conflicts: # tests/tools_recorders/test_audit_recorder.py
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4106.
Problem
Five per-file archetype fields were placeholders reported as measurements: constant
N/A/0.0/{}on all 3,003 crucible code files. #3061 moved file classification intorecord_keeper, which only overwrites the label. Nothing has computed the distance or fingerprint since, and nothing applies the per-language model at all.Fix
Computed: the general file archetype (k=18).
record_keeper._classify_file_archetype_detailreturns the nearest archetype, its Euclidean distance to that centroid, and the distance to every centroid. The nearest-centroid loop already computed all of them and threw them away. They're now written toglobal_drift/archetype_fingerprint, which revives:a_ids/a_dists(the site reads onlya_ids[i][0], so a secondary id is safe);Repository Drift (Z-Score)→Repository Drift (Centroid Distance). It's a distance, never a z-score. Nothing outside the recorder read the old key.delta <= 0.9was tuned for a feature space retired in fix(archetypes): classify file archetype from a self-describing brain, post-assembly #3061: on today's fingerprints (median distance 6.1) it would flag 33% of crucible code files. It's now relative,ENGINE_CONSTANTS["MIXED_RESPONSIBILITY_GAP"] = 0.02(second-nearest within 2% of the nearest), which flags ~5% (149 / 3,003). Both the LLM brief and the GPU recorder use the same constant.Retired: the per-language "local micro-species" model.
SPECIFIC_FILE_INFERENCE_MODEL(~3,600 lines) andLANGUAGE_INFERENCE_MODELSare removed. Nothing applied them since fix(archetypes): classify file archetype from a self-describing brain, post-assembly #3061, and they can't be applied: there's noFEATURE_NAMES, and 74 dims match no feature space the engine computes (83 at fix(archetypes): classify file archetype from a self-describing brain, post-assembly #3061, 84 today). Reviving them means retraining as a self-describing brain.local_archetype/local_drift/local_fingerprintare removed from:File Archetype,File Drift (Z-Score),File Fingerprint);docs/wiki/08-19no longer documents the drift-ratio multiplier. The page also flags that_calc_obscured_payloaditself is no longer insignal_processor.pyand needs re-verification.Golden master
Re-blessed against crucible v1.6.0. Only
3_architectural_profileparts move in each fixture:repository_fingerprintis now populated;repository_drift_centroid_distanceis added.No label, signal, risk or summary value changed.
Tests
test_signal_processor: the detail call returns the correct distance and full fingerprint, and the nearest label matches the minimum distance.test_audit_recorder: the distance is reported under its new key, and the retired keys are absent.Merge order
This touches
llm_recorder.py/audit_recorder.py/record_keeper.py, as does #4113. Whichever merges second needs a merge frommain(import-line and adjacent-hunk conflicts only).🤖 Generated with Claude Code