feat(career): passport backend — genre badges computed from stars#935
Merged
Conversation
The badge-journey layer on top of career stars (Christian's career-mode
v2 design, composed with the shipped venue system). Badges are computed
on read from song_stats × the library's effective genre — never stored:
Bronze = N genre songs at min_stars (data-driven in passports.json,
default 5 songs at 2★) plus any configured virtuoso drill nodes.
New endpoints under /api/plugins/career/:
- GET /passports passport walls per instrument: badges, ticket
stubs (qualifying songs), library genres, drills
- POST /passports/commit instrument commitment (idempotent wax seal)
- POST /passports/open open a genre passport (implies commitment)
- POST /drill-state intake for the relayed virtuoso.progress
snapshot (career's frontend listens on the bus)
Instrument attribution reuses progression.instrument_for_arrangement via
the song_stats arrangement index; the genre column goes through the
host's override-aware effective-genre SQL. Non-graded instruments (bass,
drums) render shown-not-judged — repertoire, never a false badge denial.
Persisted state (commitments, opened passports, drill snapshot) lives
under CONFIG_DIR/career/ and rides the settings export bundle via
settings.server_files; a minimal settings.html documents it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds configurable Career passports with computed badge progress, persisted commitments and drill snapshots, new API endpoints, settings metadata, and comprehensive backend tests. ChangesCareer passports
Estimated code review effort: 4 (Complex) | ~45 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 |
This was referenced Jul 13, 2026
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.
What
The passport backend — the badge-journey layer of career mode (Christian's career-mode v2 design, composed with the shipped venue/star system). Genre badges are computed on read from
song_stats× the library's effective genre, exactly like venue stars — never stored.plugins/career/passports.json, default 5 songs at 2★) + any configured virtuoso drill nodes (empty in v1 — ships songs-only).GET /api/plugins/career/passports— per-instrument passport walls: badges, qualifying-song "ticket stubs", the library genre list (override-aware via the host's effective-genre SQL), drill status.POST /passports/commit— instrument commitment (idempotent; only-gained-never-lost).POST /passports/open— open a genre passport (implies commitment; permissive server, ceremony ordering is the UI's job).POST /drill-state— intake for the relayed Virtuosovirtuoso.progresssnapshot (the career frontend subscribes to thevirtuoso:progressbus event that currently fires into a void — UI lands in the follow-up PR).Design points
progression.instrument_for_arrangementvia thesong_stats.arrangementindex — a bass performance never credits a guitar badge.shown_not_judged: repertoire, never a false badge denial.CONFIG_DIR/career/and rides the settings export/import bundle viasettings.server_files; a minimalsettings.htmldocuments it. Badges themselves are never persisted._stars()— orphaned stats can't feed stubs.Testing
tests/plugins/career/test_passports.py(badge earned/in-progress, instrument split, per-instrument best-accuracy merge, orphan exclusion, genre-rack case collapse, commit/open idempotence + validation, drill gating, snapshot validation). Full backend suite: 2448 passed.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation