Sub-Project 1: Parity Port (P0 — Client-Only React 19)
No External DependenciesPort POC10 features into the modular React app on localStorage. Closes the gap from POC8 to POC10.
Engineering Implementation Scope
-
Six-Capability Engine: Implement
selectNextTask(tier, evidence, lastTaskId, capability). Six modular task libraries insrc/core/tasks/(one per capability, matchinglighthouse-data.ts). -
Five New Interactive Exercise Views: Following
LighthouseExerciseView.tsxpattern and sharingEngineReadout:- Cognitive Flexibility: Second Way (option groups; same-group retry = not a switch) & The Rule Changed (sort rule flips unannounced at item 2).
- Creative Thinking: Free-text prompts with pluggable
judge()seam (12-word placeholder). - Emotional Intelligence: Stuck On Purpose riddles. Retry =
correct:true; solving is not the measure. - Self-Expression: Free-text prompts with pluggable
judge()seam (20-word placeholder). - Systems Thinking: Second-order consequence multiple choice.
- Teacher Portal CRUD: Add student (name, age), soft-remove, restore, hard-delete with typed-name confirmation and delete log. Sonia marked demo-only.
- Pure Evidence-Seeking Context Form: 16 parent & teacher questions tagged to capabilities. Pure free-text answers only—no diagnostic labels or rating pickers presented to adults (Program Flow P1, P2).
-
Code Hygiene & Policies: Strictly strip em dashes from all ported content. Fix known POC10 defects (remove broken Node
require, avoid global window leakage).
What the Client Can Test & Verify on Staging
Walk through each exercise. Verify the unannounced sort-rule flip in Cognitive Flexibility and retry mechanics in Emotional Intelligence record cleanly in EngineReadout.
Create a student, soft-remove them, view them in removed state, restore them, and execute a hard delete with typed confirmation. Verify Sonia remains pinned as demo data.
Fill out the parent and teacher context forms with authentic observational notes; verify answers save cleanly per role and child without any rating sliders.
Sub-Project 2: Infrastructure, Security & Child Safety (P1, P3, P5)
Supabase + Edge FunctionsPassword-gated hosted app, live AI intake report, Postgres database, adult accounts, and child safety safeguards.
Engineering Implementation Scope
-
Supabase Database (ap-southeast-1): Create relational tables for
profiles,students,evidence_instances,context_answers,checkpoints, andreportswith RLS policies. - Adult Magic Link Identity (P3): Adults log in via passwordless magic link. Children have no logins or accounts—each child is a pseudonymous row owned by an adult profile with zero child PII.
-
Edge Password Gate (P1): Supabase Deno Edge Function (
gate) checks shared password againstGATE_PASSWORDsecret, returning signed HMAC-SHA256 token (7-day expiry). Rotatable instantly without redeploy. -
Secure Intake Claude Proxy: Edge function (
intake-report) runs server-side Claude call using secretANTHROPIC_API_KEY. Zero keys in browser bundle. Falls back to offline profile gracefully if API is down. -
Child Safety Measures (P5):
- Age verification: Adult attests age and ticks versioned consent checkbox when creating child profile.
- AI disclosure: Clear, plain disclosure sentence on gate screen, onboarding intro, report, and Student View.
- Content moderation: Automated moderation pass (
moderate.ts) on all child-facing text. If flagged, safe fallback sentence is substituted and logged for adult review.
-
Offline Queue:
SupabaseEvidenceStorequeues events locally in localStorage when offline, auto-flushing on reconnect while computing tiers locally.
What the Client Can Test & Verify on Staging
Visit staging in a clean Incognito session. Verify that no onboarding or student page is accessible without entering the shared password.
Complete the intake questionnaire and trigger report generation. Inspect DevTools: verify all AI calls go to Supabase Edge Functions with zero API keys exposed in payloads or source.
Log in as teacher and create a student; log in as parent on another device. Confirm parent can answer context questions for their child, but cannot read teacher answers via RLS.
Sub-Project 3: Evidence to Report & Hypothesis Extraction (P2, P4)
Brief Highest-Value ItemExtract hypotheses from free-text answers via Claude, compute deterministic verdicts, and synthesize dynamic reports.
Engineering Implementation Scope
-
AI Hypothesis Extraction at Checkpoint: One Claude extraction call per role converts free-text context answers into a structured Reported Hypothesis Set:
[{ question_idx, capability, claim, direction }], wheredirectionisstrength | concern | neutralandclaimis the falsifiable restatement. Extraction never invents a capability not tagged in the question set. -
Pure Hypothesis Comparison Engine (
src/core/engine/comparison.ts): Deterministic rule matching Program Flow Step 6:neutral → Not Yet Testable
tier == No Signal → Not Yet Testable
concern && tier ≥ Provisional → Contradicted
strength && tier ≥ Provisional → Consistent
concern && tier == Emerging (scaffolded/incorrect) → Consistent
strength && tier == Emerging (independent ≥ 1) → Consistent
otherwise → Not Yet Testable -
Dual-Role Synthesis Rendering:
Single synthesis rendered through two views:
- Parent view: Growth narrative, observed tiers, and their own extracted hypotheses.
- Teacher view: Same narrative + MOE/CAIT framing and teacher extracted hypotheses.
-
Audit Logging in
checkpoints.comparisons: The extracted hypotheses are stored alongside verdicts incheckpoints.comparisonsso educators can inspect exactly what the AI derived from free text.
What the Client Can Test & Verify on Staging
Submit free-text answers describing student challenges at stuck points. Reach Provisional in exercises, click "Run check-in", and verify that the report quotes empirical instances and accurately reflects the extracted hypothesis.
Write a context note indicating difficulty with logical sequences. Complete 3 Logical tasks independently to reach Provisional. Verify the report indicates "Contradicted" with diplomatic phrasing.
View the generated milestone report as a parent, then switch to teacher login. Verify teacher sees MOE/CAIT framing while parent sees plain-language growth narrative.
Sub-Project 4: AI Judgement & Content Scaling (P6)
Post-Rubric DeliveryReplace word-count placeholder with Claude qualitative judgement for CT and SE. Hand-author additional task variants.
Engineering Implementation Scope
-
Server-Side Judgement (
judge-responseEdge Function): POST{capability, task_id, prompt, answer}. Claude evaluates response against Doc 2 facets:- Creative Thinking: Originality and Elaboration.
- Self-Expression: Vocabulary range, Syntactic complexity, Coherence, Elaboration confidence.
-
Swap Word-Count Seam: Client replaces 12/20 word count checks with
judge-responsecall. Word count preserved as graceful offline fallback. -
Audit Reason Logging:
evidence_instances.judge_reasonrecorded for teacher and educator review queue. -
Hand-Authored Task Scaling: Add 2–3 variants per difficulty level across
src/core/tasks/*. Strictly hand-authored per client policy; no AI-generated tasks.
What the Client Can Test & Verify on Staging
Submit high-effort creative responses vs generic gibberish exceeding 20 words; verify the rubric judge evaluates genuine conceptual novelty and logs the rationale.
Run consecutive exercise sessions with a student and verify that the 3-independent-instances rule draws on fresh task variants without exhausting the library.
System Architecture, Data Wall & Supabase Schemas
Unified backend topology on Supabase (ap-southeast-1) with Cloudflare Pages serving the static frontend.
Supabase Relational Database Schema
students (
id uuid pk default gen_random_uuid(),
owner_id uuid references profiles,
display_name text, age int,
consent_given_by uuid, consent_wording_version text,
removed_at timestamptz, deleted_at timestamptz
)
evidence_instances (
id bigint pk, student_id uuid references students,
capability text, task_id text, difficulty int,
behaviour text, attribution text,
time_taken_ms int, attempt_number int,
flagged_for_review bool, flag_reason text
)
context_answers (
id bigint pk, student_id uuid references students,
role text 'parent'|'teacher', author_id uuid,
question_idx int, capability text,
answer text not null -- free text only, no direction/rating
)
checkpoints (
id bigint pk, student_id uuid,
evidence_summary jsonb, comparisons jsonb -- holds extracted hypotheses + verdicts
)
reports (
id bigint pk, student_id uuid,
checkpoint_id bigint, kind text 'intake'|'milestone',
body jsonb, model text, moderated bool
)
Edge Functions & Security Layer
Verifies shared password against Supabase secret GATE_PASSWORD; returns HMAC-SHA256 token signed with GATE_TOKEN_KEY (7-day expiry).
Receives child exercise events, runs pure tagEvidence, inserts row into evidence_instances via service-role, and returns updated tier.
Server-side Claude calls using secret ANTHROPIC_API_KEY. run-checkpoint extracts hypotheses from free-text answers, tests verdicts, and moderates output before saving.
SP4: Runs Dr. Chew Lee's qualitative rubric evaluation against child responses for Creative Thinking & Self-Expression.