Skip to content

Agent SOP: Genre Audit

Audit existing genre tags across a Rekordbox collection using cached enrichment and audio evidence.

Paste into your agent to start:

Audit my existing genre tags.

Constraints

  • Taxonomy is compiled. The alias map in src/domain/classification/taxonomy/aliases.rs cannot be changed at runtime. If the user disagrees with a mapping, the agent works around it by using the user’s preferred genre directly.
  • No auto-tagging. Every genre change requires explicit human approval.
  • Cache-first. Audit runs from cached data. If cache is empty for a track, it is flagged as insufficient evidence — do not trigger enrichment mid-audit.
  • XML export only. No direct DB writes. All changes flow through update_trackspreview_changeswrite_xml.

Prerequisites

cache_coverage(has_genre=true)

Use the scoped entries as evidence-quality signals. Discogs readiness is album-aware: searched includes cached no-matches, has_result counts provider matches, and usable_genre counts matches that map into the classifier taxonomy. A searched no-match is operationally complete but not genre-usable; errors are neither searched nor matched. Fill missing core searches and Stratum analysis where practical:

analyze_audio_batch(has_genre=true, skip_cached=true, max_tracks=200)
enrich_tracks(has_genre=true, skip_cached=true, providers=["discogs"], max_tracks=50)

For each bounded enrichment or audio call, start with offset=0, record its successes and identity-bearing failures, then continue with offset=page.next_offset while page.has_more is true. The offset indexes the underlying stable selector, so cached/current prefixes do not consume work slots. After traversing the scope, retry failed explicit track_ids separately and re-run cache_coverage(has_genre=true). Stop only when the core searched and Stratum/Essentia readiness matches the intended audit mode, or report the unresolved failures. A cached no-match is searched, not matched. If the library or selector order changes mid-run, discard the cursor and restart at zero. Keep each enrichment traversal’s providers, skip_cached, and force_refresh values fixed. Keep Essentia availability fixed for an audio traversal; if Essentia is installed or becomes newly available, or if skip_cached changes, restart that audio scope at zero.

Full classification and audit recommendations require fresh, valid Stratum and Essentia cache rows for each track. Missing, stale, or invalid analyzer evidence produces Degraded mode, caps confidence at Low, requires review, and is never auto-staged. A valid sparse payload counts as present while its null detector fields remain unknown. Use cache_coverage and calibration_coverage to see the remaining work. Explicit --stratum-only CLI analysis remains supported but cannot produce Full classification readiness by itself. Retry actual errors, but do not require a Discogs match for a legitimately searched release.

Recommended: run suggest_normalizations() and stage alias fixes before auditing. This ensures the audit compares against canonical genre names, not aliases that inflate conflict counts.

Steps

1. Audit batch

audit_genres(max_tracks=50)

The server applies the genre decision tree to tracks that already have genres, comparing the evidence-based result against the current tag. Only conflicts and manual-review tracks appear in results. Manual review includes confirmations whose confidence is low or insufficient; agreement with the current tag does not make weak evidence disappear.

High confidence requires at least two independent source groups: Discogs, a distinct Rekordbox label, or audio. Discogs styles and a label copied from that same response count once, and audio rules plus calibrated profiles count once. The current genre is only a normalization hint or conservative tie-breaker.

Report the confidence distribution before review: “This batch: N high, N medium, N low, N insufficient out of N total.”

2. Review by confidence tier

Process each tier separately, highest confidence first.

High confidence

Present as a numbered list, grouped by suggested genre for scannability:

High confidence (12 conflicts):
→ Deep Techno (5):
#1 Artist A — Track X | Techno → Deep Techno (Discogs: Deep Techno x3, label: Delsin → Deep Techno)
#2 Artist B — Track Y | Techno → Deep Techno (Discogs: Deep Techno x2, label: Ilian Tape → Deep Techno)
...
→ Tech House (3):
#6 Artist C — Track Z | House → Tech House (Discogs: Tech House x2, label: Tech House)
...

Ask user: “Approve all, or reject/change specific numbers.”

Stage approved changes.

Medium confidence

Same numbered-list format. Highlight evidence tensions where sources disagree.

Ask user: “Approve all, or reject/change specific numbers. Say ‘investigate #N’ for any you want more context on.”

For investigated tracks: use artist discography, label roster, and related tracks in the library to form a recommendation.

Stage approved changes.

Low confidence and manual review

These need per-track judgment. For each:

  1. Read the evidence and flags from the audit result
  2. Use artist reputation, label context, and track title to form a recommendation
  3. Present reasoning: Artist on Label — known for [context]. Evidence: [summary]. Recommend: GENRE because [reason].

Present in small groups (3–5) and ask user to approve/reject/change each.

Stage approved changes.

3. Paginate

Repeat Steps 1–2 with the explicit audit_genres offset until all audit tracks are processed. This classification offset is separate from the enrichment and audio page.next_offset traversals above.

Report cumulative progress between batches: "Batch 3/N: M audited, X changes staged, Y confirmed."

4. Export

preview_changes()

Ask user: “Export these changes to XML?”

write_xml()

Report output path, then walk the user through the Rekordbox import:

  1. Add XML to Rekordbox — Open Preferences → Advanced → rekordbox xml → Imported Library → Browse → select the exported XML file.
  2. Open the XML view — In the sidebar, click the “Display rekordbox xml” icon. The imported tracks appear under “All Tracks”.
  3. Import into collection — Select all tracks (Cmd+A), right-click → Import To Collection. When prompted “Do you want to load information in the tag of the library being imported?”, click Yes (tick “Don’t ask me again” for bulk imports).