Checkpoint · v4 refactor — card types

The card types — settling the real set

Six kinds of study card exist in the database today, but the code only fully knows how to handle some of them, and two of them — "concept" and "passage" — got tangled up with each other along the way. This checkpoint settles the core list, untangles concept/passage, and proposes one habit that would keep this from drifting again: schemas generated straight from the live database instead of written by hand and left to go stale.

Follow-up to Decision 6, v4-refactor-plan Audit finding D15 Your own idea, carried forward
Checkpoints Latest →
The problem, in plain terms

Six card types exist; the code only half-agrees

Audit finding D15 + the archetype map (§2)

The database holds six different kinds of study card. The code that builds and manages them recognizes four by name, treats a fifth ("rule") as a bolt-on rather than its own type, and has never heard of the sixth ("concept") at all — even though 120 concept cards already exist and are visible to learners today.

Card typeRoughly how manyStatus today
Vocabulary~2,100 wordsFully supported — this rebuild's main focus
Grammar rules194Built by the old system; carried as a bolt-on, not its own first-class type
Script / alphabet32Built by the old system; recognized
Phrases28Built by the old system; recognized
Concept120Cards exist and are visible to learners — the code doesn't officially know this type exists
Passages12Cards exist, mostly incomplete/flagged; no code has ever been written to build or manage them

Underneath this, every card type stores its extra, type-specific details in one shared "extras" field — but four of the six types use it one way (a labeled bucket, e.g. {rule: …}) while vocabulary uses it a completely different way (a flat grab-bag with no label). Whatever the final list of types turns out to be, that inconsistency needs to be resolved the same time the list is ratified — it's the same underlying "no shared shape" problem as the family-storage checkpoint.

Your notes so far

What you told us on the last round

Quoted from your response to Decision 6 — lightly cleaned up from voice dictation, your words

Your note, v4-refactor-plan · Decision 6

"At this point in time, I see the core for language learning as vocabulary, grammar rules, script/alphabet, and phrases. These will be pre-built and be the master repository of information available to people learning a language.

Now, the ability to have a concept or passages is supposed to be really one card archetype, or maybe two. I'm kind of leaning toward: concept is more like cluster learning, and passages is basically like phrases. I think there was a bit of misunderstanding when I was creating the card archetypes — that phrases and passages kind of came together. Phrases are good — it could be idioms, or passages from a text, or short sentences, or phrases you should know in a language. Sort of like the things TripAdvisor would have in their dictionary of handy phrases you need to know. For the card archetype, the phrase might be at CT1, but the definition of all the data would be at CT2 in the t070 table.

So the schema should be better defined. Actually for all of these — somewhere there should be a canonical schema that we're enriching to, and the schema should exist in the database and be self-documenting. Like a query, sort of what we did for taxonomy.ts — if we want to know the schema for vocabulary, we'd call vocabulary-schema.ts and it would pull it, self-documented. Not a living document that someone maintains by hand — something generated based on the schema that actually exists in Supabase."

Decision 1 of 3

Confirm the core four

Your list, read back
📚
What this is: Your note names four card types as the pre-built master repository every learner draws from: vocabulary, grammar rules, script/alphabet, and phrases. Confirming this locks it in as the ratified core set — the one this rebuild treats as first-class from day one.
A — Confirm. Vocabulary, grammar rules, script/alphabet, phrases are the core four.
B — Adjust — something in that list needs a change; say what in the note.
Recommended: A — this matches the audit's own read of what's actually built and working today (vocabulary, rule, script, phrase all have real builders), so confirming costs nothing and unblocks the rest.
Decision 2 of 3

Untangle concept from passage

The mix-up you flagged yourself
🔀
What this is: "Concept" and "passage" overlapped by accident when the card types were first created. Your note untangles them: concept becomes its own thing, aimed at cluster-style learning (the same flip-through-a-group pattern as the family-storage checkpoint's cluster cards). Passage folds into phrases — both are "things you should know," like idioms or handy phrases a phrasebook would list; the phrase itself sits at CT1, with its full data at CT2 in the same t070 table.
A — Adopt as your note describes: concept → cluster-style learning; passage → folds into phrases (idioms / handy must-know phrases; phrase at CT1, data at CT2).
B — Keep concept and passage as separate types — note why.
Recommended: A — it matches what's live today more than it changes: the concept-shaped content (mostly the 105-card Buddhist-study deck) already behaves like grouped/cluster material, and passages have no builder at all, so folding them into phrases' proven builder is less new work than building passages fresh.
Decision 3 of 3

Schemas generated from the live database, not hand-written

Your own idea — the taxonomy.ts pattern, applied to every card type
🗂️
What this is: Right now, "what fields does a vocabulary card have" lives only in scattered code and in whatever the audit dug up by hand. Your note proposes the fix: for each card type, generate a schema file straight from the live Supabase database — the same pattern the taxonomy.ts file already uses. It's always accurate because it's pulled from what's actually there, not typed up once and left to drift.
A — Adopt. One generated, self-documenting schema file per card type (e.g. vocabulary-schema.ts), built from the live database — this becomes the one source of truth every enrichment pass writes to.
B — Discuss first — note any concern.
Recommended: A — this is your own proposal, it directly fixes the "extras field used two different ways" mess flagged above, and it's the same underlying idea as this whole audit: stop trusting hand-maintained docs, read the truth from the database itself.
Worth your eye

Where to spend your attention

🙏
The 105-card Buddhist-study deck is mostly "concept" cards today. Decision 2 above effectively decides its shape too — worth keeping in mind alongside the separate scope question (already answered: in scope) on the v4-refactor-plan board.
📄
If Decision 2 folds passage into phrases, the 12 existing passage cards (9 flagged, only 2 fully enriched) need an explicit migration call later — not blocking this checkpoint, but worth a follow-up once Decision 2 lands.
🧬
Decision 3's generated schemas aren't just documentation — they're the exact thing the ad-hoc card-generation idea (next checkpoint) needs as its target format. Worth reading that one with this decision in mind.