﻿# Algebra I platform implementation and verification

Implemented November 4, 2026 in the existing Next.js application and configured local MySQL database. The implementation is available locally; it has not been deployed to production.

## Entry points

- `/algebra-1/resources`: published curriculum catalogue and lesson search.
- `/algebra-1/staar`: original question-bank practice and simulation setup.
- `/algebra-1/dashboard`: authenticated learning progress, separate scores, AI working review, revision recommendations and editable schedules.
- `/algebra-teacher/platform`: existing-admin-authorized curriculum, questions, configuration, validation, import/export and teacher review.

The existing classroom dashboards link to these features. Existing brand header/footer components and legacy resource routes are preserved.

## Delivered content and workflows

- 11 units and 185 canonical lessons; all 49 content TEKS and seven process standards mapped. Each lesson has vocabulary, formulas, objectives, explanations, five worked examples, revision notes, applications, mistakes, FAQs, four objective questions and one detailed written prompt with a 10-point rubric.
- 5,880 distinct original bank questions, separate from lesson exercises. Every content standard has 120 questions across four difficulty tags. Supported practice formats are multiple choice, multiselect, inline choice and numerical equation entry. This is an original practice mix; graphing/drag-and-drop/match-table formats from official releases are not reproduced.
- Topic, reporting-category, mixed, weak-area and full-length modes. Topic practice uses a shared pool of its mapped content TEKS, including related lesson skills, rather than promising an isolated subskill bank for every lesson. Simulations follow the verified scored blueprint of 50 questions / 59 points, including nine two-point questions. Category allocations and practice duration are configurable within validated bounds. No official scale score, official performance band or complete official testing-interface equivalence is claimed.
- Server-owned question snapshots, serialized autosaves, revision conflict rejection, flags, saved practice feedback, final reviews, persisted deadlines and automatic expiry when a session is next accessed. Clients cannot submit answers after the deadline. No background scheduler is needed for enforcement; unopened expired sessions are finalized on their next request.
- Exact rational numeric scoring and deterministic partial credit. The multiselect practice rubric awards two for both correct selections, one for one correct with no incorrect selection, zero otherwise. This internal rubric is explained to students.
- Separate lesson objective, AI written, STAAR practice and mock histories. Actual server-measured active lesson time, threshold-based completion, resume links, unit progress and recommendations. Preparation coverage, recent strengths, category guides and protected teacher performance aggregates are included. Recent improvement replaces old weak-topic signals. AI recommendations include teacher-adjusted marks and supplemental working reviews.
- Structured server-side OpenAI integration: actual student-step quotations, alternative-method and partial-credit instructions, unsupported-answer guardrail, uncertainty flags, bounded rubric scores, authored reference solutions, protected keys and friendly failure states. Supplemental STAAR working review is restricted to equation-entry questions and never changes deterministic exam scores.
- Immutable original AI evaluations and append-only teacher adjustments with reasons. Reviews use the rubric stored with the evaluation, preserve original feedback and recalculate lesson completion.
- Published/draft content, stable route identifiers, optimistic editing, required-section/key/TEKS validation, process-evidence checks, mathematical verification acknowledgement, duplicate bank-prompt detection, admin-only export and draft batch import (1–100 records / request). Imports are not automatic publication. The editor uses editable JSON for complete content and settings.
- Existing account and parent/student ownership rules, server-side admin authorization, no-store private APIs, noindex private pages, CSRF origin checks, bounded payloads, paid-evaluation concurrency locks, rate limits and idempotent submissions. Public DTOs exclude answer keys and reference solutions before assessment feedback is available.
- Public catalogue and sitemap follow published database records, including new administrator-created topics. Unpublished lessons return 404 and disappear from the catalogue. Private dashboards and randomized session URLs are excluded from indexing.

## Database and installation

Run from the repository with its normal database environment configured:

```powershell
node scripts/migrate-algebra-curriculum.mjs
node scripts/seed-algebra-platform.mjs
```

Both migrations have been applied locally. The seed preserves administrator edits and drafts. It refreshes only untouched seeded records. Existing users, Algebra students, scheduled lessons and classroom attempts are reused or preserved; no duplicate login/student system was introduced.

Normalized `cv_algebra_*` tables store units, standards, topics and mappings, lesson snapshots and exercises, categories and questions, settings, examination attempts and responses, activities, immutable AI evaluations, teacher reviews and study plans. Existing `dashboard_algebracurriculumattempt` remains the curriculum submission history.

## Verification evidence

- `validation.json`: 185 lessons, 740 objective questions, 185 detailed prompts, no unmapped TEKS or structural failures.
- `independent-math-verification.json`: 1,840 independently checked curriculum mathematical cases; 10 causation study-design cases are logical review cases rather than symbolic calculations.
- `staar-independent-math.json`: 5,760 independently checked mathematical cases; 120 causation cases classified separately; zero failures.
- `platform-tests.json`: every bank key and partial-credit path, rational parser precedence/injection rejection, all lesson validators, blueprint allocation, structured AI fixtures, actual-step evidence, uncertainty, ownership, activity measurement, editable plans, all practice modes, saves and flags, stale revisions, score masking, deadline expiry, separate scores, publication/unpublication, draft import, export and immutable teacher reviews.
- `integration-tests.json`: original curriculum regression suite, all 740 objective keys, rubric/provider fixtures, rate limits, ownership, idempotency, payload/version/origin validation and regression model calculations.
- `routes-validation.json`: HTTP checks of all 185 curriculum and 16 legacy resource URLs, metadata, structured data and private-solution omission.
- Scoped ESLint and TypeScript checks pass. A full repository production build has not been verified; the earlier full type check exceeded Node's default 4 GB heap.

Reproduce local checks with the development server running:

```powershell
node scripts/audit-algebra-curriculum.mjs
node scripts/audit-algebra-staar.mjs
python scripts/verify-algebra-math.py .artifacts/algebra/staar-math-cases.json reports/algebra/staar-independent-math.json
python scripts/verify-algebra-math.py
node scripts/test-algebra-curriculum.mjs
node scripts/test-algebra-platform.mjs
node scripts/check-algebra-pages.mjs
node scripts/check-algebra-live-ai.mjs
```

Temporary integration accounts, students, sessions, questions and publication fixtures are removed after tests. SymPy is a verification dependency, not an application runtime dependency. The STAAR audit exports bank cases for the independent checker. Lesson grading uses its published lesson rubric; supplemental equation-entry reviews use the configured default rubric.

## Outstanding acceptance checks

1. **Live OpenAI grading is blocked:** the configured server credential still returns HTTP 401 `invalid_api_key`. `live-ai-check.json` records the blocked result. Replace `OPENAI_API_KEY` in the server environment, reload/restart the application and run `node scripts/check-algebra-live-ai.mjs`. It checks complete work, valid alternative methods, partial work, unsupported answers and arithmetic errors. Provider fixtures pass, but live grading has not been accepted.
2. **Visual/mobile browser QA remains unverified:** the in-app browser connection reports that no IAB backend is available. Earlier Computer Use was also stopped by URL verification policy. Responsive components are implemented; no successful visual inspection, interactive browser test or mobile viewport verification is claimed.
3. **Production build and deployment remain unverified.** Local compilation, HTTP, API/database integration and scoped static checks do not establish a successful whole-repository production build.

These outstanding checks prevent describing the product as fully accepted or production-verified. No approval request is needed for the implemented local work.
