feat(career): genre families — sub-genres inherit the family drill#951
Conversation
The enrichment fallback made the passport rack real (hundreds of MB
sub-genres) but only the five exact umbrella keys carried Virtuoso
drills. Genres now resolve to a family by keyword substring (MB's
vocabulary is open — 'metalcore' must hit metal without an alias),
first-match-wins in list order ('blues rock' → blues), and inherit the
family's requirement from the same genres map. Exact entries still win;
per-instrument scoping unchanged; unmatched genres stay songs-only.
Data: families for metal (incl. djent/grindcore/thrash/doom), blues,
jazz (bebop/swing/bossa), funk (disco), rock (punk/grunge/shoegaze).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughCareer passports now define genre families and inherit family-level drill requirements when no exact genre override exists. Exact genre entries remain preferred, while unmatched genres receive no family drills. ChangesCareer passport genre families
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/plugins/career/test_passports.py (1)
232-236: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExact-override assertion doesn't actually distinguish itself from family fallback.
genres_cfg["metal"]is both the exact entry for gkey"metal"and the fallback target when family resolution returns"metal", so this assertion would still pass even if the exact-match branch in_badge_requirementwere removed. Consider a case where the exact override differs from the family default (e.g. monkeypatch a distinct override for a subgenre key) to truly exercise precedence.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/plugins/career/test_passports.py` around lines 232 - 236, Update the exact-override test around _badge_requirement to use a subgenre whose exact configuration is distinct from its family fallback, such as by monkeypatching a separate override for the subgenre key. Assert that _passport returns the exact override for that genre, so the test fails if exact-match precedence is removed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/plugins/career/test_passports.py`:
- Around line 232-236: Update the exact-override test around _badge_requirement
to use a subgenre whose exact configuration is distinct from its family
fallback, such as by monkeypatching a separate override for the subgenre key.
Assert that _passport returns the exact override for that genre, so the test
fails if exact-match precedence is removed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6f0a5948-34a5-42fc-9edd-2c2ac997560f
📒 Files selected for processing (3)
plugins/career/passports.jsonplugins/career/routes.pytests/plugins/career/test_passports.py
The enrichment fallback (#949) made the passport rack real — hundreds of MB sub-genres — but only the five exact umbrella keys carried Virtuoso drill requirements, so "death metal" (×439 on the real library) was songs-only while "metal" demanded Gallop Picking.
Genres now resolve to a family by keyword substring (MB's vocabulary is open — "metalcore" must hit metal without an exact alias), first-match-wins in list order ("blues rock" → blues), and inherit the family's requirement from the same
genresmap. Exact per-genre entries still win; per-instrument scoping unchanged (a keys passport never inherits a guitar drill); unmatched genres stay songs-only.Shipped families: metal (djent/grindcore/thrash/doom), blues, jazz (bebop/swing/bossa), funk (disco), rock (punk/grunge/shoegaze). Pure data — retuning coverage is a
passports.jsonedit.Testing
Family inheritance (death metal, metalcore substring), list-order ambiguity (blues rock), outside-family songs-only, exact-beats-family, per-instrument isolation. 29 career tests green. Codex preflight clean (round 1).
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes