Build Order & Checklist

β›” Build Precedence Rule (enforced)
If two sections conflict, the authority page (12-meta-authority.html) and sections tagged [V1-PRODUCTION] override all other text.
Remove or rewrite conflicting older text β€” do not leave both versions in place.
Claude Code must only implement [V1-PRODUCTION] sections. All other tags mean: skip.

Part of: Pickatale Master Build Wiki | Version: v1.7 | Last Updated: 2026-04-18


12. Build Order

Source: (D) | Status: Confirmed

Phase 1 β€” Infrastructure βœ… COMPLETE

22 services live. Reader App live with finger-follow, vertical mode, accessibility panel, TTS, karaoke. Nightly bot verified 2026-04-17.

Phase 2 β€” Intelligence Loop ← CURRENT (INCOMPLETE)

Must build in this order:

  1. CM REST API β€” GET /api/v1/objectives (territory, year_level, subject). X-Internal-Key auth. Unblocks everything else.
  2. AI Learning Orchestrator β€” gap detection β†’ story selection β†’ adaptive levelling β†’ assessment trigger β†’ mastery eval β†’ reports. Port 3121.
  3. Reinforcement Engine β€” built inside Orchestrator. Ranks gaps by: word tap frequency, MAZE errors, low WCPM, comprehension <65%, slow pages.
  4. Assessment Bot β€” 3–5 MCQ questions per book (GPT-4o from page texts). Score β†’ level_recommendation. POST result to Learner Bot.
  5. Comprehension Quiz UI in Reader App β€” post-book screen, fetches questions from Assessment Bot.
  6. Placement Test in Reader App β€” first-login flow, sets initial FK level in Learner Profile.
  7. Account Center learner_profiles schema β€” full SSO profile unification.

Phase 3 β€” Fix + Wire Siloed Services

  1. Wire SendGrid (key from Sig β€” legal requirement).
  2. Swap to Azure TTS (key from Sig β€” code ready).
  3. Start Decodables, Voice Assessment, Talk AI services.
  4. Wire Fluency Assessment β†’ Learner Profile (push FK + CEFR after each scoring).
  5. Wire Voice Assessment β†’ Learner Profile.
  6. Wire Decodables, Talk β†’ Telemetry.
  7. Build landscape reading mode in Reader App.
  8. Build Miles/Tokens reward UI.
  9. Teacher Portal SSO via Account Center.

Phase 4 β€” Real Data + ML

  1. Pickatale Create API (Borja) β€” personalised illustrated stories.
  2. First real children on platform β€” Learner Bot live cycles.
  3. Recommendation Engine v2 β€” collaborative filtering.
  4. ML training pipeline.


13. Claude Code Build Brief

Source: (D) + code audit | Status: Confirmed

Stack (currently deployed β€” confirmed)

Layer Technology
Reader client React 19 + Vite + TypeScript
Reader server Express + tRPC + Drizzle ORM
Other services Node.js / Express (mix)
Database MySQL 8 β€” shared Docker instance (internal access only β€” see ops docs)
Infrastructure Docker + Caddy reverse proxy
Auth JWT (httpOnly cookies) + uc_session cookie (Account Center)
Internal calls X-Internal-Key header, 5s timeout
Platform target PWA + Capacitor (iOS/Android)

Database Connection

Host from containers: : (see ops docs)
Root password: stored in secure env β€” contact server admin
Rule: docker compose down && up after .env changes (never restart β€” does not reload env)

Service Disk Locations (Confirmed)

Service Path
Reader /home/ubuntu/reader/
Telemetry /home/ubuntu/telemetry/
LRS /home/ubuntu/lrs/
Adaptive Engine /home/ubuntu/adaptive-content/
Learner Bot /home/ubuntu/learner-bot/
Teacher Portal /home/ubuntu/teacher-portal/
Parent Portal /home/ubuntu/parent-portal/
CM /home/ubuntu/cm/
Content Service /home/ubuntu/content-meta/
Fluency /home/ubuntu/fluency/
Voice Assessment /home/ubuntu/Voice/

Non-Negotiable Rules

  1. Never hardcode secrets β€” all in .env files only.
  2. No cross-service DB access β€” API contracts only (X-Internal-Key).
  3. learner_id (UUID) is the universal child identifier β€” never integer IDs cross-service.
  4. All services connect to the shared DB via internal host (see ops docs β€” never hardcode the address).
  5. docker compose down && up (not restart) after .env changes.
  6. Show live test output before marking any task done.
  7. Use Context7 MCP before writing code for any 3rd-party library.
  8. Voice audio MUST NOT be stored. Audio may exist only in-memory during request processing and must be deleted immediately after transcription. No logging, caching, queues, or retries may contain raw audio.
  9. Raw touch data must be anonymised after session analysis.
  10. Every web project must use the Pip logo as favicon β€” never default framework icons.

Immediate Phase 2 Tasks (in order)

**Task 1: CM REST API

File: /home/ubuntu/cm/src/routes/objectives.ts Endpoint: GET /api/v1/objectives?territory=&year_level=&subject= Auth: X-Internal-Key Returns: [{id, title, description, difficulty, vocabulary[], story_potential_score}]

Task 2: Orchestrator service New service: /home/ubuntu/orchestrator/ | Port: 3121 Flow: query Learner Bot status β†’ query CM objectives β†’ select story β†’ POST to Adaptive Engine β†’ store for Reader β†’ trigger Assessment Bot β†’ receive result β†’ POST to Learner Bot quiz-result β†’ update Learner Profile

Task 3: Assessment Bot Module or service. POST /api/v1/assess/generate (GPT-4o, 3-5 MCQ). POST /api/v1/assess/result (score, level_recommendation drop/hold/raise). Pass threshold: 65%.

Task 4: Comprehension Quiz UI File: /home/ubuntu/reader/client/src/pages/QuizPage.tsx Trigger: after book completed. Fetch from Assessment Bot. Submit via reader server proxy to Learner Bot /bot/:learner_id/quiz-result.

Task 5: Placement Test File: /home/ubuntu/reader/client/src/pages/PlacementTest.tsx Trigger: first login (reading_level is null). Short passage at median FK. Adjust up/down based on responses. PATCH Learner Profile with result.



27. Build Order (Complete β€” Including Identity and Billing)

Source: (D) | Status: Confirmed

Phase 1 β€” Identity Foundation (MUST BUILD FIRST)

These do not exist yet. Nothing else is buildable without them.

  1. invites table + invite flow (flow 15.9)
  2. email_log + audit_log tables (NFR-012 compliance)
  3. subscriptions + entitlement_grants tables
  4. checkEntitlement() middleware β€” called by every protected endpoint
  5. Teacher Portal teacher_notifications table + PARENT_CLAIM_REQUEST flow
  6. parent_claims table + claim approval flow (flow 20.1)

Phase 2 β€” Intelligence Loop (Section 12 β€” unchanged)

CM REST API β†’ Orchestrator β†’ Assessment Bot β†’ Quiz UI β†’ Placement Test β†’ Account Center learner_profiles

Phase 3 β€” Billing (After Phase 1 Identity)

  1. Stripe integration (checkout, webhooks, subscription lifecycle)
  2. Subscription expiry handling (grace period, feature lock, bot pause)
  3. Admin entitlement grant/revoke tool
  4. Payment receipt emails, renewal failure emails

Phase 4 β€” Admin Tools (Section 24)

  1. admin.readingtester.com panel
  2. Impersonation (Section 24.2)
  3. Merge duplicates (Section 24.6)
  4. Audit log viewer (Section 24.7)

Phase 5 β€” Fix Siloed Services (Section 12 Phase 3)

Wire Fluency β†’ Learner Profile. Start Decodables, Voice, Talk. Azure TTS swap. Landscape mode. Reward UI.




35. End-to-End Build Checklist

Source: (D) | Status: Confirmed as build gates

Claude Code must verify ALL items pass before each phase is considered complete.

Gate 1: Identity (Sections 28–29 prerequisite)

Gate 2: Billing (before any feature access)

Gate 3: Roster (before children can read)

Gate 4: Child Reading

Gate 5: Intelligence Loop

Gate 6: Notifications

Gate 7: Admin Tools