[Feature]: Support multiple master resumes (language/role tracks) instead of exactly one
Is your feature request related to a problem? Please describe.
I job-hunt across countries and need two master resumes in different languages — an English one and a Chinese one — each tailored independently against different postings.
Today that is not possible. The storage layer allows exactly one master resume:
# apps/backend/app/models.py
Index("ux_resumes_single_master", "is_master", unique=True, sqlite_where=text("is_master = 1"))So switching languages means deleting the English master and re-uploading in Chinese, which throws away that track's tailored history. Going back means deleting again.
Two things make this sharper than it first looks.
1. A second upload already succeeds — it is just unreachable. create_resume_atomic_master() only takes over the master slot when the current master is failed or processing (apps/backend/app/database.py), so a second upload lands as a row with is_master=False, parent_id=NULL. It is neither a master nor a tailored resume. The backend could tailor it — /resumes/improve, /improve/preview and /improve/confirm all take the base as an explicit request.resume_id — but no UI path reaches it, because the base comes from a single localStorage['master_resume_id'] that the dashboard derives with data.find(r => r.is_master). The row just sits there. Deleting the English master is therefore forced by a frontend assumption, not by the tailoring pipeline.
2. Refinement grounds on the global master regardless of what is being tailored. In both tailoring paths:
# apps/backend/app/routers/resumes.py — in /improve/preview and /improve
master_resume = await db.get_master_resume()
master_data = _get_original_resume_data(master_resume) if master_resume else _get_original_resume_data(resume)The alignment check never looks at which resume the request actually targets. That is already wrong today for any non-master base, and under multiple languages it means a Chinese resume gets fact-checked against an English one. I am happy to send this part as a standalone bug fix, independent of the feature.
Describe the solution you'd like
Allow more than one master resume, so each is the root of an independent "track" that can be tailored against its own postings.
Concretely, what I think this needs:
- Schema. Replace the single-master partial unique index with a per-track constraint. Add
languagetoresumes(drives prompt output; tailored rows inherit it from their base, stored denormalised so it survives the base being deleted) and a human-readabletrack_labelsuch asEN – Backend.is_master=truecomes to mean "root of a track". - Fix the grounding. Walk
parent_idup to the track root instead of callingget_master_resume(). - Per-track language.
content_languageis currently one global value inconfig.json, and neitherImproveResumeRequestnor theresumestable carries a language. The good news: every downstream service (improver,refiner,cover_letter,interview_prep,resume_wizard) is already parameterised aslanguage: str, so only the router-levellanguage = get_content_language()calls need to resolve per-resume first and fall back to the global default. No service signatures change. - Frontend. Dashboard renders one card per track rather than a single-master ternary, and the tailor page gets a track selector, replacing the single
localStoragekey. - Migration. There is no Alembic in the repo, but
app/main.pyalready runs an idempotent startup migration (app/scripts/migrate_tinydb_to_sqlite.py). A new idempotent step could follow that precedent to drop the index and backfilllanguage, so no migration framework needs to be introduced.
Two parts need no work at all: parent_id already expresses "derived from", and applications.master_resume_id already groups tracker entries by base resume.
I would deliberately not hard-bind a track to a language. Splitting by language is my case, but splitting by role within one language (a Java track and an AI track) is just as natural, and "named tracks, each with a language attribute" costs the same to build.
Describe alternatives you've considered
One bilingual resume. This is what I tried first, and it is worse than either single-language version. The parse is noticeably lower quality, and running Enhance on a bilingual document makes the layout fall apart — the two languages get interleaved and the section structure degrades. A single document is not a substitute for two tracks.
Deleting and re-uploading per language. Works, but loses the other track's tailored resumes and their tracker links, and delete_resume() does not cascade, so the deleted master leaves tailored rows behind with a dangling parent_id.
Promoting the orphan row manually. db.set_master_resume() already exists and does the demote/flush/promote dance correctly within one transaction, but it is exposed through no endpoint — only tests use it. Even just surfacing that as an API would give a usable manual switch, though it still only allows one active track at a time.
Additional context
Happy to implement this, but I would rather agree on the data model before writing it, since it changes an invariant that is deliberately enforced at the storage layer and needs a real migration for existing databases. Specific questions:
- Is "multiple named tracks" the direction you would want, or would you prefer something narrower — for example keeping one master and adding explicit language variants under it?
- For the constraint: drop single-master uniqueness entirely, or keep a uniqueness guarantee per track (
unique(track_label)/unique(is_master, language))? - Deleting a track root: cascade to its tailored resumes, or leave them (today's behaviour, which orphans
parent_id)? - Would you take the refinement-grounding fix as a separate PR now, ahead of any of this?
I would split the work into backend + migration first, then the track UI, to keep each reviewable.
Versions: repo at main, backend Python 3.13, frontend Next.js 16.3.3.
Source: srbhr/Resume-Matcher