# Plan: deck kinds, levels, hidden decks, sources, creators, recommendations, topics and search kinds as data Owner requests of 2026-11-12: #1133 (culture decks from real works, with the people behind them and their legacy), #1134 (culture woven through the courses), #1135 (proverbs), #1136 (phrasal and multi-word verbs), #1137 (topics, and search that covers situations), #1139 (professional decks), #1140 (search results by type). Under them: #107 (new deck topics are data, question types fixed), #99, #94, #95, #527. This page is the design of the **scaffolding only**: the fields, files, rules and code that let every one of those decks arrive as data on `decks-live`, with no code change per deck. No deck content is written here, and no deck agent starts (CLAUDE.md: deck work is paused). The field reference is in [Deck-Format](Deck-Format#deck-kinds-levels-hidden-decks-sources-creators-and-topics). ## What is true today (checked in the code, 2026-11-12) - `kind` in a deck header is the **file's structure** (`vocab`, `grammar`, `reading`, `layer`, `rules`, ...). The released app shows a `kind` it does not know as a broken deck. So a deck's topic cannot reuse `kind`. - **A "situations deck" is not a deck.** `kind: situations` is one file per language (`decks//-situations.yaml`) of sheets that list ids of cards that live in ordinary decks; at most six icons, each once, which are Today's six buttons. It is listed in the index under its own key, `situations`, apart from `files`. #1137 and #1139 say "situations decks": this plan covers both the sheets and the new professional **decks**. - `section` (#107) and `audience` (#96) are in no parser or validator yet. `level` exists only as a path's `milestone` marks (A1, A2, B1) and `levels` word counts. `themes.yaml` is the only `shared` file. - Search (`lib/core/search/card_index.dart`) indexes **cards only**: an FTS5 trigram table `cards(text, card UNINDEXED, deck UNINDEXED)`; the `kind:` token (`words`, `grammar`, `script`, `reading`) is the card's deck kind. Decks, units, topics, concepts and situations are not searched as items. - A path's `"*"` takes every deck of the course that the path does not list. - The index's `files` list is read by every released app; anything new that an old app must not see goes under its own key (as `situations`, `script_guides`, `media`, `resources` do) or behind `min_app` (ADR-0052). ## Decisions Each is the default taken so no one waits; the open ones are at the end. ### D1. Deck kinds: a new header field `genre`, not `kind` `genre` is one of `culture`, `proverbs`, `multiword`, `professional`. It is **optional** (a deck without it is an ordinary path deck) and lives on a core or a single-file deck, never on a layer (a layer may not repeat it; the validator says so as it does for `part`). Genre-less decks are unchanged. The genre list is **code in the validator** (the table `GENRES`, below, the one place a rule is written) and **data for the app**: the app reads only the string and looks it up in the shared file `decks/sections.yaml` (D8) for its name, section and search kind; an unknown genre in that file is a generic "Beyond the basics" deck with the level, hidden and source rules still applied. So a new genre is: a row in `sections.yaml`, a row in `GENRES`, no app release. (If the owner wants the name `kind` kept: a rename is a one-line change; it would need `min_app` for every genre deck, which D9 does anyway.) | Genre | Header `kind` it may have | Cards | Modes a card may carry (#107's shipped set) | Required beyond the header | |---|---|---|---|---| | `culture` | `vocab` (quotes, lines, names: `pos: phrase`), `reading` (a passage with its questions) | A real work's text, or a name of a work or person | `recognition`, `listening`; a reading deck's questions take `reading`. Never `production` or `grammar`: a poem is not typed, and proper names are recognition and listening only (#99). `speaking` joins when #89 ships. | `level` on deck and cards; `source` block on every card or passage; `creator` on every card (D5); `tags` has `unreviewed` or `reviewed` | | `proverbs` | `vocab` | The proverb (`target`, `pos: phrase`), the meaning (`native`), the literal in `notes`, one example, a `register` | `recognition`, `listening` (#94: phrases are not typed). | `level`; `source` block on every card (`basis: oral-tradition` with a `collection` is allowed); `register` on every card | | `multiword` | `vocab`, `grammar` (a pattern table: main verb x light verb) | The verb phrase, meaning, literal parts in `notes`, an example | `recognition`, `production`, `listening` (a phrase is produced by word order, ADR-0024), and `grammar` on a grammar deck's cells | `level`; a `notes` entry of kind `usage` on every card (separable or not, which particle or case follows: #1136). Optional `pattern_family` string on the deck (`compound-verb`, `te-form-auxiliary`, `resultative`, `prepositional`, `pronominal`, `phrasal`), shown on the deck page, never read by code. | | `professional` | `vocab`, `reading` | The field's vocabulary and phrases | `recognition`, `production` (words), `listening`; `speaking` when #89 ships | `professional` (a profession id, D8); `hidden: true`; `level`; tag `unreviewed` or `reviewed`; a second reviewer for the field is recorded as `checked_by` with `role: field` | The question types stay the fixed set of #107; a genre only **narrows** which a card may carry, never adds one. The validator refuses a card whose `modes` names a type its deck's genre does not list. The app never checks genre to decide a mode: it reads `modes` and `pos` as it does today. A **professional deck is one situation of one profession in one language** (`ja-medicine-conference-registration`), not a translation of another language's deck. A profession is the set of decks that share `professional`; the deck's `name` is the scene (introducing yourself, registering, presenting and Q&A, asking for clarification, a site visit, safety, email and calls, core vocabulary, formal register: #1139). No scene field is needed. ### D2. Levels: `level` on decks and cards, one rule - Values, in order: `A1 < A2 < B1 < B2 < C1 < C2`. The paths reach B1, so a learner's level tops out at B1 today; B2 and above are valid data that nobody sees until a path grows (never rejected, never shown early). - `level` on the deck header is the **lowest level the deck suits**: a deck is offered when the learner's level is at or above it. A card's `level` (optional; default the deck's) may not be **below** the deck's (validator). A reading passage and a creator's bio tier take `level` the same way. - **Learner's level, per language** (pure function, `lib/core/decks/levels.dart`): the level of the path unit the learner has reached. A path unit's level is the first milestone (`A1`, `A2`, `B1`) at or after it; units after the B1 mark are B1. The furthest unit the learner has unlocked or been placed at (placement, `lib/app/unlocks.dart`) gives the level. A language whose path has no milestones (a notation course) has no level: levelled items are not offered in it. - **The rule, one gate** (`LevelGate` in `lib/core/decks/levels.dart`, called from every place a levelled item reaches the learner): an item above the learner's level is **never drilled, never shown as content, and never put in a result with its text**. Concretely: - Today, the Decks tab, lessons, reviews, weaving: not offered. - Search: **decks, topics, situations and units above the level are listed, marked with their level and not startable** (#1137, #1140: "marked"); the setting "Hide what is above my level" removes them (default off). **Culture and proverb cards above the level are not indexed for that learner at all** (#1133: never show an item above the level). - A culture item may be shown "in a supported form" only where the deck's data holds it: a card's `notes` gloss at the lower level is a different card with a lower `level`; the app never simplifies text itself. - Genre-less path decks keep their position as their level: nothing changes for them, and they never carry `level` unless the deck wants it. ### D3. `hidden: true` A deck-header flag (core or single file; not on a layer). A hidden deck is: - **Not** in the Decks tab's lists or sections, **not** in Today (no new cards, no due cards, no daily plan), **not** on or placed by a path (the `"*"` wildcard skips it; the validator refuses a path that names one), **not** in placement banks, language completeness ("% of B1"), stats denominators or a course's deck counts. - **Searchable**: it and its cards are indexed (as the `situations` kind for a professional deck, D6) and listed from the moment the index is read, before its file is downloaded: the index entry carries its title, genre, `professional`, level, language, native and card count (D9). - **Addable**: "Add to my courses" on a result downloads it on demand (`DeckDownloads`, hash checked like any file) and puts it in the learner's added decks. **Default decision**: once added, its cards are drilled and due reviews join Today (the learner chose it), and the deck is listed on the Decks tab under a collapsed "Added from search" group for that course, which is the only place it shows without a search. A learner can remove it again. - `hidden: true` is **required** on `professional` decks and allowed on any other genre; on a genre-less deck it is allowed too (a niche deck) and acts the same. `audience: adult` (#96) is separate and untouched by this plan. ### D4. `source` block on every culture and proverb card A mapping on the **core's** card (the source of the target text is the language's, not a translation's). The existing string `source` (header, note, fact, example, passage) is untouched; this block is the card's. ```yaml source: author: "Gurajada Apparao" # "anonymous" allowed (proverbs, folk) work: "Kanyasulkam" # a proverb: `collection:` in its place date: 1892 # a year, or "1892-1909", or "c. 1750" edition: "Visalandhra, 1962 ed." # edition or url: one of the two url: "https://example.org/..." basis: "public-domain" # public-domain | licensed | quotation | oral-tradition author_died: 1915 # public-domain basis, a year jurisdiction: "IN" # ISO 3166-1 alpha-2, where the status was judged licence: "CC-BY-4.0" # licensed basis: SPDX id; quotation: a short note licence_url: "https://..." # licensed basis rights_checked: "2026-11-12" # date, ISO ``` Validator rules (genres `culture` and `proverbs`; any other deck may carry a block and gets the same shape check): 1. Every card (or passage) has a `source` mapping. Missing is an error. 2. Required: `date`, `basis`, `jurisdiction`, `rights_checked`; `author` and `work` (proverbs: `author` and `collection`, or `basis: oral-tradition` with a `collection`); one of `edition` and `url` (`url` must be `https`). 3. `basis: public-domain` needs `author_died` (or `author: "anonymous"` and a `date` before 1900) and passes a **mechanical floor**: died + term < this year, the term from a table in the tool (life + 60 for IN and BD, 70 for ES, FR and JP, 50 for CN, 70 otherwise; anonymous: publication + 70). The floor catches typos; it is not a legal opinion, which the reviewer owns (D10). 4. `basis: licensed` needs `licence` (an SPDX id that allows copying and adapting: `CC0-1.0`, `CC-BY-4.0`, `CC-BY-SA-4.0`) and `licence_url`. 5. `basis: quotation` (a work not in the public domain, #1133: "only short quotation that the law allows") needs `licence` (the note naming the exception, such as `"short quotation, Berne Convention art. 10(1)"`) and the card's `target` of at most 25 words, and the deck may hold at most 5 such cards. Anything longer is an error: leave it out. 6. `basis: oral-tradition` is allowed for `proverbs` only (and for a folk `culture` item with `author: "anonymous"`), with `collection` or `region`. 7. `rights_checked` is not in the future; `date` is not after `rights_checked`; `date` is not before the creator's `born` (D5). 8. The deck's `license` (CC-BY-SA-4.0) must be compatible: a `licensed` card whose licence is not on the allow list above is refused (no NC, no ND). 9. A deck tagged `reviewed` needs the card's `checked_by` (existing field). The app shows the block on the card's page ("Source": author, work, date, edition or link, the basis in words) and Settings lists the deck under Sources (already does for a header `source`). Parsing: `Card.source` as a typed `CardSource` (all fields optional in the parser, which never refuses on rights: that is the validator's job, so an old deck still loads). ### D5. Creators: the people behind the works A culture card names its creator by id: card field `creator: "te-gurajada"` (one id; a list for a work by several). **A creator appears once**, however many cards and decks cite them, in a **deck-owned shared file per language**, `decks/creators/.yaml` (`kind: creators`), listed in the index `shared` list, downloaded with the decks, never bundled (Plan-Deck-Owned-Data's rule: entirely about decks, changes with them). It is per language only so that no single file grows past the 512 KB shared limit; a creator belongs to the file of the language of their works and an id is unique across all files. ```yaml schema: 1 kind: creators id: "creators-te" language: "te" license: "CC-BY-SA-4.0" eras: # the language's own tradition (not a world scheme) - id: "adhunika" name: { te: "ఆధునిక యుగం", en: "The Modern Age" } reading: { te: "ādhunika yugaṁ" } from: 1850 to: null # null: still running (the timeline's "today") creators: - id: "te-gurajada" # permanent, `-` name: te: { text: "గురజాడ అప్పారావు", reading: "gurajāḍa appārāvu", ipa: "ɡʊɾɐdʒɐːɖɐ ɐpːɐːɾɐːʋʊ" } en: { text: "Gurajada Apparao" } born: 1862 died: 1915 # absent: also `living: true` era: "adhunika" region: "coastal-andhra" # a region id of the language's path bio: # per UI language, plain prose en: "A playwright and poet who ..." bio_target: # optional: in the language learned, by level A2: { text: "...", reading: "...", ipa: "..." } image: # optional; absent means the app draws a placeholder file: "decks/creators/images/te-gurajada.jpg" credit: "Photographer or archive name" author: "Person or body" licence: "public-domain" # public-domain | CC0-1.0 | CC-BY-4.0 | CC-BY-SA-4.0 licence_url: "https://..." source_url: "https://..." retrieved: "2026-11-12" legacy: # D5b text: { en: "Taught in ... today." } items: - { kind: "curriculum", year: 1990, text: { en: "..." }, source: { url: "https://...", accessed: "2026-11-12" } } related: [ { creator: "te-gidugu", relation: "influence" } ] checked_by: [ ... ] # the existing field, D10 ``` Rules: - **Name** per language with `text`, `reading` and `ipa` for every script the language needs a reading for (the same rule as card text: Deck-Format "Script in prose"); an `en` name always. - **Dates**: `born` and `died` are years (negative for BCE; `{ year, circa: true }` for an uncertain one). `born < died`; `died` no later than this year; a lifespan of at most 120; `died` absent needs `living: true` (and a living creator's image must be `licence` `CC0-1.0`/`CC-BY-4.0`/`CC-BY-SA-4.0`, never `public-domain` by age, and the owner's rule of no living politicians or contested figures is a reviewer check). A creator's `era` must exist in the file's `eras` and contain the creator's active years (`born + 15` to `died`) within 50 years of its `from` and `to`. Era ranges: `from < to`, and eras of one file may overlap (a tradition's eras do). - **Image**: optional. If present: `file` exists under `decks/creators/images/`, one of jpg, png or webp, at most 300 KB, at most 1024 px on a side; **all of** `credit`, `author`, `licence`, `licence_url` (not for `public-domain`: then a `source_url` showing the date), `source_url` (https) and `retrieved` are required; `licence` is on the allow list (no NC, ND or "fair use"). No image: the app draws a placeholder (initials in the language's script), and the card says nothing about it. The card page shows the credit under the picture. A file in `creators/images/` that no creator cites is an error. - **Ids**: permanent, like card ids; never reused; a retired creator is deleted, and a card naming a missing creator is an error. - **Referenced from cards**: `creator` on a culture card must name a creator of the card's language; the card's `source.author` must equal one of that creator's names (any script) or be `"anonymous"` (then no `creator`). Every creator in the file is cited by at least one card (a warning, not an error, while a deck is in progress). - **Bio and legacy are claims** and follow D5b. #### D5b. Legacy: how the person and the work still shape the culture today `legacy` on a creator, and optionally on a culture card where the work's afterlife differs from its creator's. - `legacy.text`: a short text per UI language (at most 60 words), and optionally `legacy.text_target` by level (`A1`, `A2`, `B1`, each with `reading` and `ipa`): the app shows the highest level at or below the learner's. - `legacy.items`: **required** for any `legacy` (a summary alone is an error): one to six concrete, checkable examples, each `{ kind, text, year?, source }`. `kind` is one of `curriculum`, `festival`, `film`, `music`, `saying`, `commemoration`, `adaptation`, `place`, `other`; `text` is per UI language; `year` (optional) places it on the timeline's "today" end; `source` is a mapping with an https `url` or a `work`, and `accessed` (a date) or `date`. A legacy claim without a source fails the validator exactly as a culture note's claim must carry one. - `related`: optional echoes: `{ creator | card: , relation: adaptation | influence | response | echo }`; the ids must exist. - The reviewer checks each item (D10). A living politician or contested claim is left out (CLAUDE.md, #99 rules). #### D5c. The timeline is derived, not stored twice The timeline needs no file of its own. The app builds it from the data above: a **creator** is a span (`born` to `died`, an open end for `living`), a **work** is a point (a card's `source.date`, a range drawn as a span), grouped by the creator's `era`, with the eras as the axis bands, and a legacy item's `year` as a mark after the span, so the line **runs to the present year**: "today" is its right end. The learner's level limits it exactly as D2 does: only works at or below the level are points. The pure function `buildTimeline(creators, cards, level)` lives in `lib/core/decks/timeline.dart` (no Flutter) and is tested without a device. Its screen waits for the mockup. ### D6. Topics: language-specific, deck-owned, searchable A topic is something a learner would search for in one language: a grammar peculiarity, a verb form, a class of words, a profession, a situation. It **holds no card text**, like a situations file; it names what already exists. - **File**: `decks//-topics.yaml`, `kind: topics`, one per language (a file `-topics.yaml`, `id: -topics`), beside the language's other files and downloaded with the language. It is **not** in `shared`, because Plan-Deck-Owned-Data's rule keeps a language's own files out of `shared` (they already download with the language); the index lists it under a per-language key `topics`, apart from `files`, because the released app would show an unknown `kind` as a broken deck. It is edited on decks-live, with the decks, and never needs a release. - **Ids**: `-`, `[a-z0-9-]+`, permanent, unique across the file (`ja-wa-vs-ga`, `es-ser-vs-estar`, `hi-ergative-ne`); a retired topic is deleted. - **Names**: `name` and `summary` keyed by UI language code, `en` required (the learner sees the first spoken language it is written in, as a situation's `title`). Names of the thing in the target language go in `term` (`{ text, reading }`: は vs が, ser / estar). - **What it covers** (all optional lists, at least one required): | Key | Names | Resolved against | |---|---|---| | `decks` | core ids of the language's decks (any genre, hidden ones included) | the language's decks | | `units` | a path unit by **any core id on it**, or its `planned` id | the language's path | | `cards` | card ids of the language | the language's decks | | `grammar` | path `grammar:` concept ids (`be`, `lo`, `conditional`) and rules-table names | the path's `grammar` lists | | `situations` | a situation sheet's `id` | the language's situations file | | `topics` | related topic ids of the same file | this file | | `script_units` | feature ids of the language's script guides (`features[].id` of `-script`, or `-