wiki/dev-log.md
Dev Log — The Journey So Far
Narrative of how CurioQuest reached its current state. (For the wiki's own operation log, see log.md.)
1. Seed idea
Personalized, curriculum-aligned STEM story + activity books where the child is the hero, led by a chosen guide, ending in a home experiment — built to grow with the child across grades. Earlier exploration included an n8n / 12-agent architecture; the old 12-agent architecture remains superseded, but n8n itself was reinstated on 2026-06-08 as the backend workflow/control plane for observability and founder/operator control.
2. Research (2026-06-01)
Four parallel AI research reports (ChatGPT, Perplexity, Gemini, Claude), US-first, run independently against the same brief.
3. Synthesis (2026-06-01 → 02)
The four reports were triangulated into a decision-grade synthesis (summary · raw). Verdict: No-Go on the original freemium model; Conditional Go if repositioned (~27/100 as-pitched → ~52/100 repositioned). The single most important insight: the risk is the business model and trust positioning, not the product idea or the technology. The decisive next action: run a concierge pilot to measure the one number no report could find — gifting preview→paid conversion.
4. Objective lock-down → v0.2 (2026-06-02)
The synthesis's keep/change/kill recommendations were folded into the Project Objective (raw). Major locks this session, each now an ADR: - Freemium → preview→purchase (ADR-001). - Owned IP → Professor T-Rex as signature/default; in-story guide personalizable (ADR-002). - Characters → original-only; hard-block third-party (ADR-003). - Privacy → no-photo default + COPPA-by-design (ADR-004). - Subscription → progression as MVP core (school-year plan + season pass + Bridge packs), not a monthly box. - POD → Lulu / Gelato / Peecho, not Printify.
5. Business model → v1.0 (2026-06-02)
The economics were written up as a bootstrap flywheel (summary · raw): start on $1,000, no salary, reinvest everything; the one rule is contribution > CAC (ADR-005). Three cases (Pessimistic/Realistic/Best) make the lesson explicit — CAC and plan attach flip the outcome. Channel locked to Shopify-only (ADR-006).
6. Revenue model (interactive)
An interactive companion (revenue-model.html) renders the three cases with draggable dials across a 12-month P&L (TARGET / PROJECTION / PLAN views) — so the levers can be felt, not just read.
7. Build mode transition
Mode: BUILD. The design/research layer is frozen enough for the pilot factory build. The current build focus is the concierge pilot book-making factory plus Operator Console, with Module 00 Curriculum Service and Module 1 Intake now built in code. The launch approach remains pilot first, platform second: validate the pilot-only unknowns before broader platform/commercial automation.
8. Module 1 Intake Built + Durable Storage (2026-06-04)
Status: Done for the current intake slice. The Operator Console root screen now captures the validated CreationBrief as the first workflow step, with controlled fields for appearance, cast, pet kind, location, and curriculum topic selection.
Durable state: services/operator-api/src/operator_api/intake_store.py creates and manages SQLite table intake_submissions at services/operator-api/operator.db. POST /runs saves the validated brief first, then starts the factory run, and returns both run_id and intake_id. GET /intakes/{intake_id} reads the saved intake submission.
Product boundary: book_format / enrollment are no longer shown in Intake. The factory defaults them internally to digital/single; print remains a later standalone capability attached to generated books.
Verification: operator-api suite 46 passed; book-factory brief tests 26 passed; operator-console typecheck and lint passed.
Handoff: parallel agents should read Intake Module Build Status — 2026-06-04 before modifying Module 1 or adjacent contracts.
2026-06-04 (late) — Soft UI / Neumorphism implemented in operator-console
Reskinned apps/operator-console/ to the ratified Neumorphism handoff: tokens/components ported verbatim, 6 screens (Home, Curriculum + Intake live-wired re-skin, Run/Gate/Artifacts promoted to real routes via shared RunProvider). tsc+eslint clean; all routes screenshot-verified vs handoff. Open founder call: --muted #6b7280 ~3.8:1 fails AA for small text. Detail: repo docs/status/2026-06-04-soft-ui-console-implementation.md.
2026-06-04 — Module merge decision: storyboard + layout
Status: Decided.
What happened: Founder decided M8 Page Plan and M9 Page Specs should be one operational module, and M13 Compose Page and M14 Assemble Book should be one operational module. The repo/vault spec was updated to v1.1.
Key decisions: See ADR-007.
Next: Future implementation should preserve existing artifacts where useful, but operator review/build planning should treat M8 as the storyboard gate and M13 as the layout/book assembly blocker.
2026-06-04 — Module merge decision: lesson design + activity
Status: Decided.
What happened: Founder decided M3 Lesson Design and M3b Experiment Deriver should operate as one module. The activity is now treated as a task/output inside M3, not a separate downstream step.
Key decisions: See ADR-008.
Next: Future implementation should keep ActivitySheet as a first-class artifact, but M3 owns generation, safety-codex checking, caching, and operator review for both LessonBlueprint and ActivitySheet.
2026-06-04 — Module 2 Fetch Curriculum Packet complete
Status: Complete.
What happened: M2 was renamed and closed as Fetch Curriculum Packet + Reuse Check. It is intentionally small: fetch the published catalog row by topic_id, validate status and grade, expose selected catalog fields as LessonSpec, compute reuse keys, and emit ReuseDecision. It does not generate lesson content.
Verification: services/book-factory M2 unit test: 10 passed. services/operator-api topic-backed run-store/API verification: 10 passed. Prior full operator-api suite: 55 passed.
Next: M3 Lesson Design + Activity is the first creative lesson-generation module.
2026-06-05 — M3 Lesson Design + Activity BUILT (TDD)
What happened: M3 implemented end-to-end via TDD against founder-ratified decisions. One step, one gate, two sequential gpt-4o calls: Call 1 → LessonBlueprint (now with reward{secret_code,badge_name} + activity_brief); Call 2 → new ActivitySheet (safe household experiment) grounded in call-1's concept, then run through a deterministic banned-hazard safety check (book_factory/safety.py + new SafetyViolation). Operator gate shows 6 cards and supports a NEW cross-cutting steering feature: type a note before Regenerate → injected into the re-run prompts (transport via new GateFeedback artifact; run_store.enter_gate() now returns a (decision, note) tuple).
Verification: book-factory uv run pytest → 234 passed; ruff clean; pyright --strict 0 errors. operator-api → 70 passed; ruff/pyright clean. operator-console → tsc + eslint clean.
NOT done: no real-LLM run (fakes only — real gpt-4o JSON shape unproven); no browser screenshot of the new gate; no downstream consumer of ActivitySheet (M8 ACTIVITY pages unbuilt). Uncommitted.
Next: founder picks — (a) validate M3 live, (b) build M4 Cast Definition, (c) first-book blockers M11+M13, or (d) spec the 4 missing supporting docs.
2026-06-08 — n8n reinstated as backend workflow/control plane
Status: Decided.
What happened: Founder explicitly reset the backend direction: CurioQuest is doing backend workflow orchestration in n8n, not opaque code orchestration. n8n gives the founder observability, workflow inspection, manual control, and recovery paths during the concierge pilot.
Key decisions: See ADR-2026-06-08. The old 12-agent architecture remains rejected; the n8n prohibition is removed.
Next: backend workflow work should define versioned webhook/payload contracts, keep typed code helpers test-covered, and smoke-test both local and production n8n paths.
2026-06-14 — First COMPLETE book end-to-end + failure-mode SOP
Status: Done.
What happened: Built the full downstream book pipeline into n8n WF1 (page plan → dialogue → activity → visual brief → image prompts → 26 gpt-image-2 pages) plus the one sanctioned non-n8n step /api/assemble-book (pdf-lib + sharp, TDD). Produced the first complete book end-to-end for sound_quest (G1) — a 28-page PDF in Supabase; character consistency held in production (Professor T-Rex pinned "no spikes" — the image spike's exact drift bug, fixed via the visual-brief continuity sheet). Added full | downstream | images entry modes so expensive upstream isn't re-run. The earlier plan's 3-workflow design (WF2 webhook, WF3 sub-workflow) was non-functional on this instance → extended WF1 instead; assembly runs locally until the site is publicly deployed.
Key decisions: Every run failure was turned into a guardrail. Canonical catalog in the repo: docs/engineering/pipeline-sop-and-failure-modes.md (13 failure modes: symptom→cause→fix→mechanism→detection, n8n authoring/debugging playbook, pre-flight checklist). Tested code guards: sanitizeWinAnsi, compressImageToJpeg, renderActivityPages (assembleBook lib); likeStartsWith PostgREST-wildcard guard; curl/TLS + GET-backup PUT helper.
Tests written: 11 TDD tests on the PDF lib (assembleBook.*.test.ts).
Next: book 2 (wilting_mystery, K) for cross-grade repeatability; optional vision-QC stage; add an in-n8n Assemble_Book HTTP node once the site is deployed.
2026-06-14 (PM) — Quality reset + competitor + 3 parallel threads
Status: Pivot. Pipeline plumbing works; output quality does NOT.
What happened: Founder reviewed both generated books and the verdict is POOR / not shippable. Real WITHIN-book character drift: Ronav's look changes across pages; Professor T-Rex shrinks to a pet-sized dinosaur (he must be a guide-sized adult-height dino). Story, dialogue, images, and book layout all need to improve. Process correction: Claude over-claimed "consistency held" off a 6-page spot-check — whole-artifact review + a vision-QC gate are now mandatory; bias to quality over volume. A competitor surfaced — https://sciquest-heroes.com/waitlist ("SciQuest Heroes") — raising urgency to capture demand.
Decision / next: next session questions the founder first (story / dialogue / images / character canon / layout / waitlist), then runs 3 parallel threads: (1) character consistency — persistent character bible + reference-image conditioning + whole-book vision-QC; (2) book-layout redesign; (3) soft-launch waitlist + lead-capture site (urgent vs competitor). Detail + questioning agenda in repo SESSION.md; behavioural capture in memory curioquest-quality-reset-and-threads-2026-06-14.