Commit
refactor(essentia): retire the heuristic classification rules engine
Commit details
Commit notes
CLAP zero-shot now owns sample type/instrument/tonality, so the hand-tuned spectral/envelope classifier and the duplicated key-gating policy are dead weight. Remove them and let measurement + CLAP speak for themselves.
Essentia service: - Delete classification_rules.py (is_unclassified_percussive + key_is_reliable) - Delete analyze_classification (the ~250-line if/elif drum ladder) and its now-orphaned helpers (_band_energy_ratios, _normalize_entropy) - Drop DrumClassification model + classification from the response, and the extract_classification toggle - Replace the percussion/loop/duration-aware key_is_reliable gate with a small intrinsic floor in analyze(): analyze_tonal already nulls atonal keys; we now only drop a surviving key when BOTH its confidence and tonality are weak. Sample-type-aware key suppression is the CLAP tonality signal's job downstream. - Remove the obsolete classification unit tests
Backend: - essentia-client.ts: drop ClassificationFeatures + classification from the contract; the mapper no longer derives drumType (always null now) — CLAP owns sample_type/instrument - worker.ts: the CLAP job now also writes the legacy drum_type/drum_type_confidence from the CLAP instrument so that column stays populated and consistent - Update essentia-client tests to assert the mapper leaves type to CLAP
Note: the unrelated *dead* TypeScript classifier (classifyDrumType + analyzeAudioWithTypeScript* in audio-analysis.ts) is unreferenced and left for a separate cleanup.
Co-Authored-By: Claude Opus 4.8 <[email redacted]> Claude-Session: [private session redacted]
- Files changed
- 14
- Lines added
- +46
- Lines removed
- −925