Fable MVP Codex Prompts

Part of Fable. Follows the Fable Roadmap and uses the scope in Fable Features, the flows in Fable Product Map, and the constraints in Fable Technology and Infrastructure and Fable Data and AI Design.

Open the interactive Codex TUI in the Fable application repository. Paste one entire block as a message and send it. Start at 0.1 and follow the steps in order. Check each step’s reported results before sending the next prompt. The first step records decisions and open items in docs/mvp-plan.md so later steps can run in fresh sessions.

The build assumes German stories for A1–B1, English explanations, a Next.js UI, a Go API and worker, PostgreSQL, and self-hosting with Docker. These are the roadmap’s starting proposals. Confirm or revise them in 0.1. Audio and additional languages are post-MVP.

Phase 0 — Pre-build decisions

0.1 Read the docs and settle the architecture

Prepare the German Fable MVP for implementation. Inspect the current repository and its instructions. Keep app work in the application repository. If this session is rooted in the Obsidian vault, report that I need to reopen the TUI in the application repository before making changes.

Follow the vault's sync guidance before reading the six project notes in /Users/giraycoskun/Documents/Obsidian Notes/Code/Fable. Read Fable.md, Fable Roadmap.md, Fable Features.md, Fable Product Map.md, Fable Technology and Infrastructure.md, and Fable Data and AI Design.md. Use these as source material for the app plan. If the notes are inaccessible, ask me to provide them.

Create docs/mvp-plan.md in the app repo. Record confirmed scope, proposed defaults, sequencing, and exit checks. Evaluate the proposed Next.js UI, Go API and worker, PostgreSQL, and Docker split against the existing repo. Recommend an auth approach and explain session handling, how the first admin is provisioned, and how the operator supplies server-side generation and Jev credentials. Define public sample access, permissions for private learner records, and immutable shared content boundaries. Mark decisions that need my input and explain what can proceed with fixtures. Keep paid provider calls, production deployment, and pilot recruitment pending until I authorize them.

Make the plan file and report the decisions and any blockers. End this step after planning.

Phase 1 — Define and validate German learning content

1.1 Create the rubric, grammar catalog, and sample pack

Read docs/mvp-plan.md and the current repo. Build the initial German A1–B1 content pack and review workflow. Define a compact reading rubric covering vocabulary, sentence complexity, cohesion, and inference. Choose stable grammar topic IDs and aliases for a small catalog across the supported levels. Use the German Notebook as a planning reference if available.

Write draft German texts for A1, A2, B1, borderline cases, and out-of-range examples. Separate tuning and held-out samples. Include at least one candidate sample story per supported level with stable sentence IDs and a 3–5 question multiple-choice quiz. For each answer, include the supporting sentence IDs and a short English explanation. Provide a review checklist for natural German, level, grammar, and unambiguous answers. Keep draft labels distinct from human-reviewed labels and mark any pending review. Add a repeatable fixture validation check.

Run the fixture check and report what needs a German reviewer before the public sample story or benchmark results can be used for release decisions.

1.2 Prepare the model comparison and Jev benchmark

Read docs/mvp-plan.md and the Phase 1 fixtures. Verify the current official Jev and candidate generation provider documentation before using their APIs. Prepare a repeatable local evaluation command for comparing candidate text models on the same inputs and benchmarking a pinned Jev model with a versioned rubric. Give Jev the story and rubric with choices A1, A2, B1, outside the supported range, and unclear. Withhold the requested level and reference label from Jev.

Report schema and content failures, rubric agreement by level, borderline and out-of-range errors, latency, and estimated cost when measurable. Use the tuning set to propose a confidence threshold and the held-out set to evaluate it. Record choice probabilities where available and distinguish provider errors from disagreements. Use deterministic fixtures to exercise the harness. Run live calls only when I have supplied credentials and authorized a spend limit. Keep admin review required for new packages while acceptance criteria lack reviewed evidence.

Document the evaluation command, dry-run results, and any missing human labels, provider choices, credentials, or budget. Leave automatic approval disabled unless the benchmark and my decision support it.

Phase 2 — Build the learning loop

2.1 Scaffold the app, accounts, and private data model

Read docs/mvp-plan.md and inspect the repo. Implement the agreed app foundation, reusing any existing scaffold. Establish the Next.js UI, Go API and worker, PostgreSQL migrations, local Docker setup, and CI checks where needed. Use the agreed authentication and admin provisioning decision. If auth is still open, report the decision needed and use test identities only in isolated test fixtures while progressing independent work.

Add data for exact story and quiz versions, learner references and preferences, and the job and review records needed by the next step. Require server-verified identity, ownership, and admin authorization. Set up a local end-to-end fixture with two learners, one admin, and a German story and quiz package. Document startup, migrations, configuration, and test commands in the repo. Keep secrets in server-only configuration and use placeholder values in examples.

Run the build and practical integration checks, including access through the normal API as a learner and admin. Report what runs locally and any open decisions.

2.2 Implement story reuse, generation, Jev, and review

Read docs/mvp-plan.md and continue the MVP implementation. Build the story request flow in the UI, API, and worker. Accept German level, topic, length band, and optional grammar focus. Look up eligible ready packages by normalized request and prefer unread matches. Link the exact story and quiz version to the learner. Keep personalized or identifying inputs and resulting packages private.

On a miss, use a durable job with request idempotency, atomic leases, expired lease recovery, bounded retries, and concurrent miss coalescing for reusable inputs. Use a configurable server-side generation adapter and the separate Jev adapter from the benchmark work. Validate structured German story and quiz output, language, length, sentence IDs, grammar references, and supporting answer evidence. Persist requested and estimated levels and check provenance. Wire generation status, retry, and review states in the UI. Give admins a way to inspect, release, or reject candidates with an audit record. Keep admin review as the default unless automatic acceptance was approved after the benchmark.

Verify with two learners that concurrent reusable requests produce one package, a ready hit skips both providers, private requests stay scoped, and expired leases and provider errors recover as designed. Verify Jev match, mismatch, uncertainty, and failure with fixtures. Report results and unresolved provider setup.

2.3 Build the reader, contextual help, and grammar wiki

Read docs/mvp-plan.md and implement the German reader and help flow using the existing app. Support readable adjustable typography, keyboard-friendly word and phrase selection, an explicit sentence grammar action, verified grammar-focus highlights, and a dismissible mobile help panel that preserves reading position. Keep translation behind an explicit practice action.

Return contextual English word help with meaning, lemma or phrase, part of speech, relevant noun or verb details, and an example. Handle idioms, inflected forms, and separable verbs. Preserve German spelling and show uncertainty when a fact cannot be established.

Resolve grammar questions to a canonical topic and construction or intent. Reuse the active wiki version by topic, intent, explanation language, and applicable level without calling the generation provider. Coalesce concurrent reusable misses and save new structured entries with AI provenance and an unreviewed status. Keep passage-specific explanations and personal context scoped to the learner. Add admin search, review, versioned correction, and withdrawal with an audit record. Withdrawn entries must be ineligible for future reuse.

Verify that two A2 learners asking about dative after mit reuse one entry, dative with helfen resolves separately, and passage-specific or withdrawn entries cannot leak into shared results. Check reader behavior on mobile and with keyboard navigation where the environment supports it.

2.4 Finish comprehension and verify the first complete session

Read docs/mvp-plan.md. Add the quiz and results screens for the exact story version. Use 3–5 choice questions covering main idea and detail. Score server-side and keep answer keys and evidence out of the pre-submission learner response. On submission, return the score, explanations, and supporting sentences. Record separate attempts for retries and provide a route back to the reader or a new story.

Finish the admin views for searching learner accounts and generated packages and inspecting story versions, quizzes, and level checks. Enforce admin authorization on every related API. Using fixtures and the normal app entry points, verify the full generate or reuse → read → word or grammar help → quiz → results path with two learners and an admin. Check that one learner cannot read another learner’s attempts or open the admin views. Report the commands and scenarios that passed, and any incomplete phase exit checks.

Phase 3 — Make the MVP work across sessions

3.1 Add the public sample, library, vocabulary, and modes

Read docs/mvp-plan.md. Implement the public sample flow using a reviewed package with precomputed word help and a short quiz. Let visitors read and try the check before signup and show signup when they want persistence or custom generation. If the reviewed package is pending, verify the flow locally with a draft fixture and document the release blocker. Keep the guest path independent of paid generation calls.

Add learner preferences, a library pinned to exact package versions, resume position, and learner-controlled reading completion. Save words and phrases with original sentence contexts. Deduplicate per learner by normalized lemma or phrase and language while retaining multiple contexts. Add a learning summary with comprehension and assistance shown separately. In Practice, make help available. In Check, hide it until submission unless the learner opts back in, and record actual help use with the attempt.

Verify anonymous sample access, resume after sign-in, stable links after a new story version, retained vocabulary contexts, separate retry attempts, assistance tracking, and private data isolation between two accounts.

3.2 Add operator controls and exercise recovery

Read docs/mvp-plan.md. Implement version-linked feedback for story passages and wiki entries, admin job and feedback inspection, per-account quotas, and a configurable global spend ceiling. Make budget enforcement safe with concurrent jobs and retries. Track cache outcomes, job errors, latency, and provider usage or cost estimates without logging private learner text or credentials. Implement account deletion and document what happens to private learner data, retained audit records, and eligible shared packages.

Finish the self-hosted Docker deployment instructions with local and production configuration, migrations, health checks, provider credentials, and backup and restore procedures. Test restore to disposable storage and run the app against the restored database. Exercise retry and quota behavior, deletion and authorization, and the complete learner flow at mobile and desktop widths using keyboard and accessible focus behavior.

Run the repo’s validation commands and report concrete release blockers, verification limits, and the exact commands the operator needs. Use a local or disposable environment for this step.

Phase 4 — Prepare and evaluate the German pilot

4.1 Set up pilot measurement and apply the readiness gate

Read docs/mvp-plan.md, the rubric and benchmark reports, and the implementation verification. Prepare the German pilot checklist and a report for first-story completion, quiz completion, return sessions, explanation helpfulness, difficulty complaints by level, failed generations, and cost per completed session. Recommend provisional thresholds and a pilot budget for my approval before the pilot. Define how to collect reviewer and learner feedback and adjust future targets after a baseline.

Run a local readiness review covering A1–B1, sample approval, shared and private data boundaries, Jev review behavior, accessibility, backup recovery, and operating costs. If I have supplied real pilot results, assess them against the agreed thresholds and fix reproducible in-scope problems. Otherwise record the evidence still needed and the steps for an operator to collect it. Report the German readiness decision with evidence and open items. Keep live pilot activity and production changes subject to my authorization.