# Learnitive 2.0 — Hotfix33 Autonomous Continuation Prompt

## Objective

Continue Learnitive 2.0 autonomously from the fully verified Hotfix33 source state. Do not redo completed implementation. The immediate task is authoritative staging acceptance of the fresh canonical Learn installation and SQL-safe seed payloads.

## Protected boundaries

Deployment target only:

- `https://os.learnitive.com`
- `/var/www/os.learnitive.com`
- `/var/www/os.learnitive.com/public_html`
- `/etc/learnitive`

Do not modify production `learnitive.com` / `www.learnitive.com`, `texise.com` / `www.texise.com`, `/etc/texise/*`, TeXise vhosts or TeXise services.

Canonical staging ports: API 4210, collaboration 4211, Redis 7387, Console Gateway 9887, Universal Runner 9890.

## Latest authoritative staging result

The latest live run passed namespace/frozen-lock/runtime/R12 preflights, unified runner setup, production build, systemd Learn media verification, SaaS preflight, Redis/Runner/Console/API health and **all 69 universal templates** with `failedBuiltins=0`. The user had manually removed the `learn_*` tables first.

Seeded Learn validation then passed `latex-fundamentals` and failed at `python-fundamentals`:

`Error: invalid_learn_starter`

The failure occurs in `normalizeLearnStarter()` before Python execution. Infrastructure and templates are not implicated.

## Hotfix33 correction

1. Canonical Learn structured seeds no longer embed hand-escaped JSON in SQL. `server/saas-migrations.mjs` uses `sqlJsonLiteral()` → UTF-8 hex → `CONVERT(X'…' USING utf8mb4)`, preserving exact JSON bytes through MySQL.
2. The Python starter now round-trips to `{ files: { "main.py": "print(\"Hello from Learnitive!\")\n" }, entryFile: "main.py" }`.
3. The JavaScript `values-and-arrays` starter now prints `2`, `4`, `6` on separate lines to match its authored expected output.
4. Quiz JSON containing nested quotes is byte-roundtrip tested.
5. Staging now automatically rebuilds Learn fresh on every installer run via `server/reset-staging-saas-schema.mjs`. It drops only `learn_*` tables and clears only migration versions 27–35. It is hard-locked to staging URL and database `learnitive_os`; it never drops the DB and preserves accounts/admin/CMS data.
6. The reset runs before SaaS preflight. `runSaasMigrations()` recognizes the cleared Learn ledger as `freshLearnInstall=true` and executes canonical Learn migrations 27–35 in order rather than using the legacy reconciliation branch.
7. Learnitive DB defaults/examples and diagnostics now consistently use `learnitive_os` and `/etc/learnitive/learnitive.env`.

## Verification completed

- supported server/static suite: **363/363 PASS**;
- focused SaaS migration suite: **15/15 PASS**;
- project-runtime strip-types suite: **10/10 PASS**;
- frozen pnpm lock sync PASS: 69 importers / 1581 package records / 1583 snapshots / 1171 reachable snapshots;
- trusted runtime manifest PASS: 9 production imports;
- R12 namespace/static preview/full release contract PASS;
- brand-reference audit PASS: 0 violations across 9805 classified references;
- branding/provenance audit PASS: 709 production-facing text files;
- current logo/favicon/PWA regression: 2/2 PASS;
- staging/root installer shell syntax PASS;
- changed Node module syntax PASS;
- Apache configtest: Syntax OK.

## Next staging acceptance sequence

1. Deploy Hotfix33 to `os.learnitive.com` only and run the installer from the beginning.
2. Confirm `Main service Learn media sandbox paths verified.`
3. Confirm `Resetting the disposable staging Learn schema before canonical Learn migrations.`
4. Confirm `Fresh staging Learn reset complete: database=learnitive_os; ...`.
5. Confirm SaaS preflight reports `schema=35`, `freshLearnInstall=true`, `learnSeedMissing=0`, `learnSeedGraphMissing=0`.
6. Confirm Redis, Universal Runner, Console Gateway and main API health.
7. Confirm all 69 universal templates still validate with `failedBuiltins=0`; do not prune healthy templates.
8. Confirm seeded Learn validation proceeds past `python-fundamentals` and reaches every canonical course and executable exercise.
9. Continue Node/Python/C++ queue smoke and fairness/result isolation.
10. Continue LaTeX API → Redis → Universal Runner smoke, PDF and fallback behavior.
11. Verify React JS/TS, TypeScript/Vite, Vue and Svelte Web Preview/error overlay.
12. Verify Markdown visual/Bangle workflow.
13. Verify Learn uploaded/YouTube/Wistia media, captions/posters, solution gating and Free/Pro entitlements.
14. Verify public HTTPS `/projects`, favicon, fonts and SNI routes.
15. If staging exposes another defect, diagnose → patch → add an exact regression → rerun release gates → package the next non-overwriting hotfix.

## Autonomous execution rule

Execute continuously using Execute -> Verify -> Diagnose -> Fix -> Verify again -> Continue. Do not ask for routine confirmation. Ask only when an external credential/permission is genuinely unavailable or an irreversible high-impact action cannot be inferred safely. Maintain the exact current state in durable docs before handoff.

Continue autonomously from this exact state. Do not restart completed phases. Do not ask for confirmation. Execute all remaining phases sequentially, verify each phase, fix problems, and continue until the project is complete. If this chat again approaches its context limit, generate another complete continuation prompt for the next chat before stopping.
