# Octimo Product Blueprint

This directory is the single source of truth for Octimo's product foundation.
It covers the first Olympiad-focused release while keeping curriculum,
organisations, AI capabilities, and future subscriptions extensible.

Start with the [phasewise Olympiad platform plan](olympiad-platform-plan.html),
the [syllabus and sample-question guide](olympiad-syllabus.html), and the
[OVH deployment runbook](olympiad-ovh-deployment.html), researched on 2026-10-09.
They cover Science (ISO), English (IEO) and Maths (IMO), each for Grades 2 and 5, gamified preparation, realistic virtual
exams and deployment on the existing WorkSquares DNS setup. Supplied worksheets
are references; they are not automatically imported into the question bank.

The [earlier HTML product concept](../prototype/plan.html) remains useful for
experience design. The Markdown documents below retain requirement IDs and
technical invariants; the new JSON register owns current phase order/status.

The three new HTML documents are generated from `olympiad-implementation-plan.json`,
`olympiad-program.json`, the dated `research/olympiad-*-audit-2026-10-09.json`
receipts, and `../scripts/build-olympiad-docs.mjs`. Regenerate with
`node scripts/build-olympiad-docs.mjs` from the UI repository, then run the same
command with `--check`. Do not hand-edit generated HTML.

## Documents

| Document | Purpose |
| --- | --- |
| [Phasewise Olympiad plan](olympiad-platform-plan.html) | Fourteen phases, dependencies, implementation scope, content targets and release evidence |
| [Syllabus and question references](olympiad-syllabus.html) | Five initial exam/grade profiles, official syllabus/sample PDF links and original illustrative questions |
| [OVH deployment plan](olympiad-ovh-deployment.html) | Verified infrastructure, same WorkSquares DNS, isolated database targets and release/rollback sequence |
| [Product requirements](product-requirements.md) | Vision, scope, roles, P0/P1/P2 requirements, AI and subscription rules, acceptance criteria, metrics, and roadmap |
| [Technical architecture](architecture.md) | System shape, module boundaries, stack, access control, events, AI gateway, deployment, scaling, SLOs, and ADRs |
| [Database design](database-design.md) | PostgreSQL schemas, tables, versioning, attempts, ledgers, capabilities, constraints, ERD, retention, and migration sequence |
| [Database structure delivery plan](database-structure-plan.md) | Ordered migration slices, persistence gaps, screen/read-model mapping, and verification gates |
| [UI/UX specification](ui-ux.md) | Student/Admin navigation, visual direction, screens, flows, wireframes, responsive behaviour, safety, and accessibility |
| [Important screen mockup plan](screen-mockups-plan.md) | Fifteen current product concepts, planned P0 mockups, named states, contracts, route/role integrity, gap register, and acceptance gates |
| [Repositories and environments](environments.md) | Live record of the Git repositories, the OVH development database connection details, administration and rotation steps, and environment status |

## Recommended reading order

1. Product requirements establish outcomes, scope, and release gates.
2. UI/UX and the screen mockup plan turn those requirements into reviewable
   portal experiences and contract-ready states.
3. Architecture defines runtime boundaries and quality attributes.
4. Database design defines durable state and invariants; the database structure
   plan orders them into testable delivery slices.

Engineering work should link stories and tests to the requirement identifiers in
the product specification. Material changes to scoring, versioning, AI access,
privacy, or ledgers must update every affected document in the same change.

## Implementation status — verified 2026-10-09

DBP-00 source implementation has started in the separate `octimoapi`
repository. The current source contains six explicit migrations, a
checksum-protected migration runner, tenant-scoped request context, development
and OIDC authentication modes, Problem Details responses, health checks, and a
safe `GET /api/v1/me`, `GET /api/v1/student/profile`, fail-closed
`GET /api/v1/student/onboarding`, and permission-filtered
`GET /api/v1/admin/people` projections. The Admin People route uses bounded,
filter-bound cursor pagination and returns no private contact fields.

The API baseline passes lint, typecheck, seven suites / 17 tests and build.
Read-only OVH verification found all six migrations applied to `octimo_db` on
2026-10-04, with matching local checksum prefixes, and 22 foundation tables.
The landing page, prototype and healthy API foundation are deployed at
`octimo.worksquares.ai`; other public API routes remain closed while the
container uses development authentication. The DNS A record is `51.195.88.132`
under the existing `worksquares.ai` zone.

This does not close DBP-00 or certify a learning-platform release. Live
PostgreSQL isolation tests, the runtime/private role split, real OIDC onboarding,
the application frontend, questions, lessons, attempts, virtual exams and games
remain pending. AI remains denied by default. New staging/production databases
are planned and were not created during this documentation pass.

## Baseline decisions

- Responsive web with separate Student and Admin shells.
- Modular monolith API plus independently scaled worker.
- PostgreSQL 17 system of record; PostgreSQL 18 waits for certification and
  Redis remains ephemeral.
- Immutable published content and frozen attempt manifests.
- Server-authoritative timing, scoring, progress source events, and rewards.
- Append-only XP, wallet, competition, AI-usage, consent, subscription, and
  audit history.
- The first-party Octimo API owns every core student flow; the external AI
  provider API is an optional, server-only enhancement and never a dependency
  of learning, practice, submission, results, rewards, or progress.
- Student AI is default-deny, hidden when unavailable, and enforced through
  platform, lifecycle, policy, entitlement, consent/safety, quota, and
  provider-readiness checks at every request.
- No child-directed purchase prompts, open chat, public identity, targeted ads,
  loot boxes, or pay-to-win mechanics.
- WCAG 2.2 AA target and age-appropriate privacy review before launch.

## Decisions still open

The documents intentionally identify choices that need owner approval before
implementation lock: launch age/markets, account and consent model, Olympiad
taxonomy/question formats, leaderboard policy, MVP AI rollout, reward catalog,
retention, organisation model, and future subscription owner.

Until those decisions are approved, implementations should preserve the safe
default and configurable boundaries described here.
