# Learnitive Project State Ledger

Updated: 2026-09-12
Status: **Homepage editor-wireframe release complete; candidate archive passed independent fresh-extraction verification.**

## Objective

Learnitive is an independent fork of the attached Interactive Shell v1.28.20 source snapshot. The fork is writer/research-first while retaining the inherited coding/runtime implementation as an optional, collapsed Code workflow.

The live Interactive Shell production estate is protected. Learnitive automation must never modify, stop, restart, reload, migrate, prune, rename, adopt, overwrite or otherwise interrupt its website, database, services, containers, networks, ports, web-server configuration or production files.

## Autonomous / handoff rules

Always-on project rules:

- `.cursor/rules/autonomous-handoff.mdc`
- `.cursor/rules/learnitive-production-isolation.mdc`
- `AGENTS.md`

Machine enforcement:

- `scripts/learnitive-isolation-guard.mjs`
- `scripts/learnitive-host-preflight.mjs`
- `scripts/learnitive-protected-production-baseline.mjs`

A resource collision is an **abort condition**. Automation may read protected production state only for before/after verification; it may not resolve a Learnitive conflict by changing the protected product.

## Deployment identity

- Public origin: `https://www.learnitive.com`
- Application root: `/var/www/learnitive.com/public_html`
- Configuration root: `/etc/learnitive/*`
- Database: `learnitive_os`
- Environment namespace: `LEARNITIVE_*`
- Package namespace: `@learnitive/*`
- Service/container/runtime namespace: `learnitive-*`
- Browser/persistence prefix: `learnitive:`
- Local project metadata: `.learnitive/`
- Product protocols: `web+learnitive`, `learnitive://`, Learnitive-owned headers

### Separate host ports

- application/API: `4210`
- collaboration signaling: `4211`
- runtime Redis: `7387`
- console gateway: `9887`
- universal runner: `9890`
- filtered egress proxy: `9892`

Port collisions abort. Existing processes are never killed or moved.

### Separate Docker networking

Proposed/default Learnitive-only ranges, subject to collision preflight:

- `172.30.240.0/24`
- `172.30.241.0/24`
- `172.30.242.0/24`
- `172.30.243.0/24`

Learnitive uses independent container names, labels, networks, volumes, Redis, queues, sockets and service accounts. Network/firewall controls hard-abort on pre-existing unowned objects.

### Independent ingress

Normal Learnitive deployment does not modify or reload the shared Apache/Nginx listener serving the protected production product. Inherited www-cutover helpers are disabled. Use independent ingress (separate host/VM/listener/IP or isolated external ingress/tunnel) to proxy `www.learnitive.com` to the private Learnitive endpoint.

## Product surface

### New Project

Top-level choices:

1. **Markdown** — default.
2. **LaTeX** — first-class academic/research workflow.
3. **Code** — collapsed by default; clicking it expands the retained language/framework catalogue.

Choosing Markdown or LaTeX collapses Code again. Programming runtimes/templates remain implemented and selectable through Code, but developer-first marketing/template discovery is not the launch focus.

### Homepage hero

The active homepage hero is now a two-column writer/education presentation rather than a terminal demonstration. The left side leads with **Write. Research. Learn.** and documentation/education-oriented copy. The right side renders `HeroEditorPreview`, a static responsive Learnitive Markdown/WYSIWYG wireframe showing:

- a **Renewable Energy Study Guide** project;
- Markdown/WYSIWYG editor chrome and local-project status;
- writer-oriented project files (`overview.md`, `study-guide.md`, `research.md`, `references.md`);
- learning objectives and key concepts;
- Paper Memory/reference context;
- contextual AI actions including **Ask AI** and **Add a 5-question quiz**.

The homepage does not render `HeroCloudTerminal`. The terminal component remains dormant in source for future Code-specific marketing/application use. The hero is static/presentational rather than a second editable workspace, hides the file sidebar on small screens, and explicitly disables its reveal animation under `prefers-reduced-motion`.

### Writer/research positioning

Launch messaging centers on:

- Markdown + WYSIWYG writing;
- LaTeX + PDF publishing;
- citations, bibliography and Paper Memory;
- local-first project ownership;
- Local AI and BYOK AI;
- learning/tutor workflows;
- Code as a secondary optional capability.

### Templates / Learn / docs

- Public template discovery is Markdown/LaTeX scoped.
- Unvalidated templates are `noIndex` and excluded from sitemap/indexable inventory.
- Empty/thin institution template hubs are omitted from sitemap until real inventory exists.
- Public Learn SEO limits explicit project modes to Markdown/LaTeX or neutral courses.
- Developer/runtime material remains retained in source for future use but is not launch-discoverable.
- Writer-launch CMS visibility policy is migration 64: `learnitive_writer_launch_visibility_20260912`.

## Branding

Primary: `#DA0B4E`.
Strong primary foreground: white.
Verified contrast: **5.07:1**.

Canonical supplied assets are installed as Learnitive logo/favicon/PWA/social assets, including:

- `packages/tooling/browser-entry/public/learnitive-logo.png`
- `packages/tooling/browser-entry/public/learnitive-logo-mobile.png`
- `packages/tooling/browser-entry/public/favicon.ico`
- `packages/tooling/browser-entry/public/favicon.svg`
- `packages/tooling/browser-entry/public/favicon-96x96.png`
- `packages/tooling/browser-entry/public/apple-touch-icon.png`
- `packages/tooling/browser-entry/public/web-app-manifest-192x192.png`
- `packages/tooling/browser-entry/public/web-app-manifest-512x512.png`
- `packages/tooling/browser-entry/public/og/learnitive.png`

Source logo SHA-256: `3ae97a9cb34c9453e668533cf880949c464ee16047330b0ec52fc48cb7805e09`.

## SEO hardening completed

The post-launch-audit SEO phase is implemented.

### Former-product branding

- Removed the remaining visible former-product terminal/hero strings.
- Namespace/brand scanners now catch spaced, upper-case, hyphenated, underscored and package-scope former-product forms.
- Removed stale `packages/tooling/browser-entry/public/interactive-templates/`; it was an unreferenced duplicate carrying an older pre-hardening template manifest.
- Public-assets audit now fails if that duplicate public namespace returns.
- Active software/docs wording avoids ambiguous former-product phrasing.
- Remaining former-product-name occurrences are intentional protected-production guard/test/history references required to enforce non-interference.

### CMS visibility ordering

Legacy blog/doc compatibility import runs are followed by `reconcileLearnitiveWriterLaunchLegacyImports(db)`, so imported legacy developer content cannot silently undo writer-launch draft/noindex policy. Regression coverage verifies reconciliation occurs after imports and targets legacy rows only.

### Legacy URL migration

A dedicated mapping is implemented in `server/public-legacy-redirects.mjs` and documented in `SEO_LEGACY_URL_MAP.md`.

Examples:

- `/pages/about` → `/about`
- `/pages/faq` → `/faq`
- `/pages/branding` → `/about`
- `/lifetime-deal` → `/pricing`
- `/notepad` → `/features`
- `/project` → `/features`
- `/ai-api` → `/docs/ai-overview`
- selected retired integrations return explicit `410 Gone`

A substantive `/faq` route is included.

### Canonical / structured data

- Static bootstrap and dynamic SEO use `EducationalApplication` rather than developer/productivity-only schema classification.
- Feature ordering leads with Markdown, LaTeX, citations/research, Local/BYOK AI, with optional Code secondary.
- Client metadata uses the configured Learnitive production origin rather than `window.location.origin`, preventing preview hosts from rewriting canonicals.

### Server-rendered discovery

Server SEO now provides substantive prerendered bodies for blog posts, docs and template detail routes, including heading/content/internal-link context rather than metadata-only dynamic shells.

### Sitemap / RSS / template indexability

- Sitemap CMS posts/docs require published + `noindex=0`.
- RSS excludes noindex posts.
- Template sitemap/indexable inventory requires writer-launch mode, `validationStatus === 'valid'`, published status and no `noIndex` flag.
- Client template metadata cannot override a server `noindex` when no validated launch inventory exists.
- Template category/institution sitemap derivation is writer-template scoped.

### Production SEO verification

`scripts/verify-public-seo-production.sh` now checks the writer-first Learnitive strategy, legacy redirects/410s, hidden developer routes, canonicals and former-product branding instead of expecting old developer comparison/migration pages to be indexable.

Dedicated gate: `node scripts/learnitive-seo-hardening-audit.mjs` / package script `release:seo-hardening`.

Editorial/template expansion remains intentionally gated by human review/runtime validation; see `SEO_CONTENT_PLAN.md`. No generated filler is auto-published merely to create SEO inventory.

## Database/CMS

- Current SaaS schema: **64**.
- Database: `learnitive_os`.
- Deployment DB user should be scoped only to `learnitive_os.*`.
- Guard/preflight rejects the protected production DB identity.
- Compatibility imports are reconciled after import as described above.

## Verification baseline — current source

### Canonical release audit

`TERM=xterm node scripts/learnitive-current-release-audit.mjs`

Result: **452/452 PASS, 0 failures**.

The canonical audit invokes and passes:

- isolation guard;
- namespace audit;
- brand audit;
- SEO hardening audit;
- public-assets audit;
- theme audit;
- writer-launch audit;
- full dependency-free regression bundle.

### Focused deployment/isolation regression

Latest focused run after the hero change: **31/31 PASS** covering brand/namespace rejection, independent www install, external ingress, disabled cutover tools, installer idempotency, service rendering, runtime network policy and protected network ownership behavior.

### Static syntax / parse checks

Latest post-hero source pass:

- Node JS/MJS/CJS: **376 checked, 0 failures**.
- Shell: **22 checked, 0 failures**.
- Strict JSON: **177 checked, 0 failures**.
- tsconfig JSONC via TypeScript parser: **8 checked, 0 failures**.
- TypeScript/TSX parser syntax (TypeScript 5.8.3): **1074 checked, 0 failures**.

### Environment limitation

This workspace has no local `node_modules` and no `pnpm` executable. Full dependency-backed `pnpm lint:ci`, `pnpm test:ci`, production build and Playwright/browser runs cannot be claimed here. They remain required in CI/deployment when dependencies are available.

## Current phase

**Local implementation and release packaging are complete. No further local implementation phase remains unless a new product change is requested.**

Target artifacts:

- `/mnt/data/learnitive-v58-writer-launch-final.zip`
- `/mnt/data/learnitive-v58-writer-launch-final.zip.sha256`

Final package acceptance has been independently verified from a fresh extraction after the homepage editor-wireframe phase:

1. ZIP top level is `public_html/`.
2. `public_html/installer.sh` remains mode `755`.
3. Source and extracted package match recursively: **5,870 entries, 0 missing, 0 extra, 0 changed** in the candidate verification pass.
4. Learnitive isolation, namespace, branding, SEO-hardening, public-assets, theme and writer-launch gates pass from the extraction.
5. Canonical release audit passes **452/452** from the extraction.
6. Focused deployment/isolation suite passes **31/31** from the extraction.
7. Extracted static checks pass: Node **376/376**, shell **22/22**, strict JSON **177/177**, tsconfig **8/8**, TypeScript/TSX syntax **1074/1074**.
8. ZIP SHA-256 is generated alongside the archive and verified against its sidecar.

A final rebuild is performed after this ledger update so the delivered archive contains this exact completion state. Because including an archive hash inside the archive would be self-referential, the external `.sha256` sidecar is the authoritative final archive hash.

No live deployment has been performed. No protected Interactive Shell production resource has been modified.

## 2026-09-12 homepage optimisation + legacy content-code hardening

A new autonomous phase was completed after the editor-wireframe release.

### Homepage narrative optimisation

The home page now follows a progressive writer/research/education story rather than repeating feature lists:

1. Hero: **Write. Research. Learn.** with the editor wireframe and no early Pro purchase CTA.
2. **Create with AI** composer with Write / Learn / Teach / Research intent tabs and outcome starters: Document, Study Guide, Lesson, Course, Research and LaTeX; More includes Notes, Documentation, Literature Review and Thesis.
3. **What can you create?**: Documentation, Education, Research and Publishing outcomes.
4. **A complete writing workspace**: Structure → Write → Research → Refine → Publish.
5. **Your work should stay yours**: ordinary files, local-first storage, explicit AI choice and no silent cloud fallback.
6. **Write / Research / Learn workflows** with distinct user journeys.
7. Dedicated education showcase: **Learn by creating**.
8. **AI on your terms**: Local, BYOK and Project-aware assistance.
9. Template preview links for study guides, research papers and documentation.
10. Compact **Need to code too?** strip; coding stays secondary and remains available from New Project.
11. Pricing headline: **Start free. Own Pro for $29.**
12. Expanded FAQ and final CTA: **What will you create with Learnitive?**

The dormant terminal and developer implementation remain in source for future Code-specific surfaces but are not part of the launch homepage story.

### Legacy content-code licensing fix

Authoritative content codes are now treated as **10-character alphanumeric** values:

`CONTENT_CODE_PATTERN = /^[A-Z0-9]{10}$/iu`

Verification order is now deliberately:

1. receive raw entered value;
2. trim only;
3. attempt transactional `content_codes` lookup with the trimmed entered value;
4. if found + unused, grant Lifetime Pro and mark `used = 1` in the same transaction;
5. only when no matching `content_codes` row exists, normalize for predefined/Payhip verification.

This avoids uppercasing before the content-code DB lookup and preserves legacy alphanumeric codes under the database's configured collation behavior.

All launch/apply copy now says **10-character activation codes**, not 10-digit activation codes.

SaaS 500 logging now records the error name plus a bounded sanitized error message while never logging the submitted licence-code variable. Common `license_key`, `licenseKey`, `key` query parameters and labelled licence/activation values are redacted.

Dedicated regression coverage: `scripts/learnitive-content-code-license-regression.node.test.mjs` plus `server/content-code-license.node.test.mjs`.

### Verification baseline after this phase

- Canonical release audit: **455/455 PASS**.
- Content-code focused tests: **12/12 PASS**.
- Isolation / namespace / brand / SEO / public-assets / theme / writer-launch gates: **PASS**.
- `node --check` passes for the modified server modules.
- Full dependency-backed lint/build/Playwright remains unavailable locally because the packaged source contains no `node_modules` and this environment has no `pnpm` executable.

No live Interactive Shell production resource was modified or operated on.

### Definitive package verification for homepage/licensing phase

The post-homepage/post-content-code candidate package was fresh-extracted and verified successfully before final rebuild:

- canonical release audit: **455/455 PASS**;
- content-code focused suite: **12/12 PASS**;
- installer mode: **755**;
- recursive source/extraction fidelity: **5,872 entries, 0 missing, 0 extra, 0 changed**;
- available static checks: Node **377/377**, shell **22/22**, strict JSON **177/177**, TypeScript/TSX parser **1,067/1,067**;
- archive SHA-256 sidecar verified.

The final archive is rebuilt after this state update so the delivered ZIP contains this completion record. The external `.sha256` sidecar is authoritative because embedding the final archive hash inside the archive would be self-referential.

## 2026-09-15 autonomous completion — approved Learnitive homepage, SEO and release reconciliation

### Completed phases

- Permanent autonomous/context-handoff rule is active in `AGENTS.md` and `.cursor/rules/autonomous-handoff.mdc`; `scripts/learnitive-autonomous-handoff-audit.mjs` is part of the canonical release gate.
- Latest course-details/Wistia upstream deltas are retained in the Learnitive fork without touching protected Interactive Shell production.
- Homepage hero is writer/research/learning-first with the Markdown Source/Visual/PDF workspace preview and Learnitive red theme.
- Explore Learnitive uses the authoritative supplied assets:
  - `/learnitive_editor_home.webp`
  - `/learnitive_terminal_home.webp`
  - `/learnitive_ai_builder_home.webp`
- Homepage order is Hero → Explore Learnitive → Learnitive vs Overleaf → Pricing → FAQ → Final CTA → Footer.
- Learnitive vs Overleaf is the curated public comparison. `/compare` and `/compare/overleaf` are indexable and included in the sitemap; legacy developer comparison details, migration routes and software catalog remain hidden/noindex/404 at launch.
- Homepage/bootstrap metadata now matches the approved SEO title `Learnitive: AI Learning & Writing Workspace` and the learning/writing/research description.
- Pricing is Free + Pro Lifetime at `$29 one-time`; BYOK remains Pro. No inherited monthly plan is exposed by the launch pricing data.
- FAQ, final CTA and footer are Learnitive-specific and writer/research/learning-first.
- Primary brand is `#DA0B4E`; foreground on raw primary-red surfaces is `#FFFFFF`.
- Stale regression expectations were reconciled to the approved product behavior rather than reverting the implementation.
- Content-code legacy activation behavior remains hardened and verified.

### Current phase

**Local implementation, regression reconciliation and dependency-light release verification are complete.**

The only release verification not executable in this workspace is dependency-backed `pnpm lint:ci`, `pnpm test:ci`, production build and Playwright/browser testing because `pnpm` and project `node_modules` are not installed. Those gates remain required in CI or a prepared deployment environment before production rollout.

### Remaining phases

No additional local source phase remains for the approved scope. Production deployment is intentionally not performed by this package task.

### Decisions

- Generic reusable `interactive-*` CSS/DOM infrastructure remains generic; product-specific identity is Learnitive-namespaced.
- Markdown is the default writer-facing project story; LaTeX remains first-class; Code stays advanced/collapsed rather than defining the public product category.
- The supplied Editor, Terminal and AI Builder images are authoritative and are not regenerated.
- `/compare` and `/compare/overleaf` are the only launch comparison surfaces intentionally indexed; other dormant comparison data remains in source for future use.
- BYOK is a Pro entitlement.
- `$29 one-time` is the approved Lifetime Pro marketing price for this release; checkout URLs remain configuration-driven.

### Assumptions

- The latest uploaded Interactive Shell course-details archive is the upstream source authority for inherited fixes; the current Learnitive fork is authoritative for Learnitive-specific product, branding, SEO and UX decisions.
- No live production deployment is part of this task.

### Requirements preserved

- Never mutate, stop, restart, reload, migrate, prune, overwrite or reuse a protected Interactive Shell production resource.
- Conflicts with protected production must abort rather than be resolved by changing Interactive Shell.
- Raw `#DA0B4E` primary surfaces use white text/icons.
- Public positioning is learning, research and writing first.
- Autonomous execution follows `Execute → Verify → Identify problems → Fix → Verify again → Continue` and performs a complete chat handoff before context becomes unsafe.

### Dependencies / environment

- Node.js is available.
- Global TypeScript parser is available for syntax-only source parsing.
- `pnpm` is not installed and the repository has no local `node_modules`; dependency-backed lint/build/Playwright are therefore not claimed.

### Final verification — source tree

- Canonical release audit: **461/461 PASS**.
- Content-code focused tests: **12/12 PASS**.
- Approved homepage/assets/comparison/pricing/LMS focused bundle: **43/43 PASS**.
- Public SEO focused suite: **31/31 PASS**.
- SEO migration/visibility focused suite: **7/7 PASS**.
- Isolation, namespace, brand, SEO-hardening, public-assets, theme, writer-launch and autonomous-handoff gates: **PASS**.
- Node JS/MJS/CJS syntax: **380/380 PASS**.
- Shell syntax: **22/22 PASS**.
- Strict JSON: **177/177 PASS**.
- tsconfig JSONC parse: **8/8 PASS**.
- TypeScript/TSX parser syntax: **1078/1078 PASS**.

### Problems and fixes

- Five final failures were stale SEO/comparison expectations. They expected the superseded homepage title and treated `/compare/overleaf` as hidden. Tests were updated to the approved `Learnitive: AI Learning & Writing Workspace` metadata and curated public Overleaf comparison.
- The static browser bootstrap still carried the old homepage title/description while server/dynamic metadata had already been updated. `packages/tooling/browser-entry/index.html` was aligned to the approved metadata so first HTML and hydrated metadata agree.
- The sitemap omitted the now-public comparison hub and Overleaf comparison. `server/public-index.mjs` now includes `/compare` and `/compare/overleaf` while continuing to omit developer comparisons and migrations.

### Artifacts / files changed in this completion pass

- `packages/tooling/browser-entry/index.html`
- `server/public-index.mjs`
- `server/public-seo.node.test.mjs`
- `scripts/learnitive-public-seo-migration-expansion.node.test.mjs`
- `PROJECT_STATE_LEDGER.md`
- `NEXT_CHAT_CONTINUATION_PROMPT.md`
- `CURRENT_SNAPSHOT_STATE.txt`

### Outstanding risks / limitations

- Dependency-backed lint, build and browser/Playwright tests still need to run in CI or a prepared deployment environment before production release.
- Competitor capabilities/pricing can change; the Overleaf detail page keeps dated official-source review metadata and should be reverified before major marketing refreshes.
- No live deployment or production non-interference baseline was executed because this task produced and verified source artifacts only.

### Target deliverables

- `/mnt/data/learnitive-v58-writer-launch-final.zip`
- `/mnt/data/learnitive-v58-writer-launch-final.zip.sha256`

The final archive must contain one top-level `public_html/`, preserve executable modes, match this source tree after fresh extraction, and pass the canonical dependency-light release audit from the extracted artifact. The external `.sha256` sidecar is authoritative because embedding the final archive hash inside the archive would be self-referential.

### Package acceptance procedure

A release-candidate archive was created with one top-level `public_html/` and fresh-extracted before the final state-record rebuild. Candidate verification confirmed:

- recursive source/extraction fidelity: **5,879 entries, 0 missing, 0 extra, 0 content changes, 0 mode changes**;
- `public_html/installer.sh` remains mode **755**;
- extracted canonical release audit: **461/461 PASS**;
- extracted Node syntax: **380/380 PASS**;
- extracted shell syntax: **22/22 PASS**;
- extracted strict JSON: **177/177 PASS**;
- extracted tsconfig JSONC: **8/8 PASS**;
- extracted TypeScript/TSX parser syntax: **1078/1078 PASS**.

After this ledger update, the archive is rebuilt and the same content/mode fidelity plus canonical audit are rerun externally against the final ZIP. The external `.sha256` sidecar and final verification report are authoritative for the final archive bytes.

## 2026-09-15 edu.learnitive.com staging → www.learnitive.com cutover audit

### Objective

Prepare the accepted Learnitive writer/learning release for public staging at `https://edu.learnitive.com`, then promote the tested candidate to canonical production at `https://www.learnitive.com`, without mutating the protected Interactive Shell production ingress/lifecycle.

### Completed changes

- Active staging hostname/root changed from legacy `os.learnitive.com` to `edu.learnitive.com` and `/var/www/edu.learnitive.com/public_html`.
- Legacy `os.learnitive.com` staging marker/root recognition remains only for backward-compatible adoption of an older staging install.
- Added dedicated staging env template `deploy/config/learnitive-edu.env.example`.
- Fresh staging defaults passwordless email off; OAuth/email/CAPTCHA/outbound integrations require deliberate staging-safe configuration.
- Config repair safely normalizes only approved Learnitive origins to the selected edu/www profile.
- GitHub OAuth callback is rewritten to the active edu/www public origin.
- Replaced staging SPA fallback vhost behavior with production-shaped API/WebSocket/server-rendered route proxying.
- Added mandatory staging `X-Robots-Tag: noindex, nofollow, noarchive`.
- Non-production server-rendered metadata is forced noindex; staging robots disallows all crawling; browser hydration preserves noindex and uses the active staging origin for canonical/social metadata.
- Added manual edu→www post-acceptance redirect templates; installer does not enable/reload shared Apache/Nginx.
- Preview frame-ancestor policy now recognizes edu + www.
- Updated production SEO/local ingress verification to the writer-first curated `/compare/overleaf` surface and hidden developer comparison/migration surfaces.
- Added staging-specific live/local verification scripts and included staging vhost/runtime/safety regressions in the canonical current release audit.
- Added `EDU_STAGING.md` and `STAGING_AUDIT_2026-09-15.md`.
- Corrected stale deployment documentation/comments that implied the installer managed shared ingress.
- Reconciled stale staging tests that still required `os.learnitive.com`.
- Updated README staging/product guidance and removed the contradictory reusable CSS namespace instruction.

### Vhost source templates

- `deploy/apache/edu.learnitive.com-http.conf`
- `deploy/apache/edu.learnitive.com-https.conf`
- `deploy/apache/edu.learnitive.com-cutover-redirect-http.conf`
- `deploy/apache/edu.learnitive.com-cutover-redirect-https.conf`
- `deploy/apache/www.learnitive.com-http.conf`
- `deploy/apache/www.learnitive.com-https.conf`
- `deploy/apache/learnitive.com-redirect-https.conf`
- `deploy/apache/preview.learnitive.com-https.conf`

Active staging ingress routes private app/API/SSR to 4210, collaboration WebSockets to 4211 and console-gateway WebSockets to 9887. The staging vhost mirrors the production routing contract while adding staging-only noindex protections.

### Verification

- Canonical current release audit: **481/481 PASS**.
- Release-quality orchestration: **PASS** (current release audit, public assets, lock sync, workspace dependency consistency, public barrels).
- Targeted staging/server bundle: **79/79 PASS** before consolidation into the canonical suite.
- Shell syntax: **23/23 PASS**.
- Changed JS/MJS: `node --check` PASS.
- `package.json`: strict JSON parse PASS.
- Apache template syntax: **7/7 staging/production/cutover templates parsed with Apache 2.4 `Syntax OK`** using non-mutating temporary cert/root substitutions and explicit module loads.
- Isolation/namespace/branding/SEO/theme/writer-launch/handoff audits all pass through the canonical gate.

### Deployment model decision

This release implements the requested **sequential promotion model**: edu staging is tested first, then the same Learnitive service/config identities are promoted to www. It is not a supported permanent side-by-side staging + production stack.

If edu must remain live as a permanent staging environment after launch, create independent staging config/service names, ports, Redis/container/queue namespace, database/user and (if needed) preview origin before running both environments concurrently.

### Remaining target-host acceptance

No live infrastructure was changed in this source audit. Before production cutover:

1. publish the candidate to `/var/www/edu.learnitive.com/public_html`;
2. provision edu DNS/TLS on an independent Learnitive ingress;
3. run ingress config syntax/health checks;
4. run `scripts/verify-edu-local-vhost.sh` and `scripts/verify-edu-staging.mjs`;
5. run dependency-backed `pnpm lint:ci`, `pnpm test:ci`, `pnpm build`, `pnpm local-ci-check`, Playwright and manual product acceptance;
6. freeze the accepted candidate and promote that same release to `/var/www/learnitive.com/public_html`;
7. activate www/apex independent ingress and run the www local/SEO cutover verifiers;
8. only after www passes, optionally retire edu or activate the manual one-hop edu→www redirect templates;
9. perform final read-only Interactive Shell before/after non-interference verification.

### Outstanding recommendations

- Put public staging behind Cloudflare Access or an equivalent independent access control if pre-release confidentiality is desired; noindex is not authentication.
- If SaaS is enabled on edu against `learnitive_os`, treat staging relational data as production-bound unless explicitly cleaned before cutover. For destructive QA or long-lived staging, use a dedicated staging database.
- Use staging-specific OAuth/SMTP/Turnstile/analytics/licence-provider credentials; do not copy production secrets merely to make staging tests pass.

### Staging/cutover source artifact

The source artifact for this phase is packaged as `learnitive-v58-edu-staging-www-cutover-audited-final.zip` with two top-level entries: executable production helper `run.sh` and the complete `public_html/` source tree. The external SHA-256 sidecar and verification report are authoritative for the final archive bytes; the hash is intentionally not embedded inside the archive.

## Writer AI homepage + office implementation — 2026-09-15

Implemented the approved writer-first homepage refinement on top of the edu-staging Docker-network-owner hotfix baseline.

### Product changes

- Create Project remains Markdown-first on initial open. Selecting **Code** now atomically selects the Python starter and clears the visible Markdown/LaTeX document selection; later explicit language/framework choices are preserved until the user re-enters Code mode from a document mode.
- Homepage hero H1 is now exactly **“Privacy First Research” / “Writing Platform”** with a smaller responsive scale while retaining the Markdown-first Source/Visual/PDF workspace preview.
- A functional AI writing composer now mounts immediately below the hero and before Explore Learnitive. It reuses the existing auth, Pro entitlement, AI Settings/provider readiness, pending-intent/sessionStorage, canonical CreateWorkspaceDialog and AI-agent handoff infrastructure.
- Homepage writer quick starts are Research Paper, Essay, Study Notes, Literature Review, LaTeX, Report and Article, with additional writing types under More. General writing intents default to Markdown; explicit LaTeX remains LaTeX and explicit software prompts still infer advanced Code starters.
- The About page's first image is the supplied `/learnitive-office.webp`, displayed as a wide editorial image with descriptive non-location-specific alt text.
- Public homepage AI settings/allowed quick-start normalization now upgrades legacy developer-only quick-start configuration to the writer-first defaults without rewriting historical migrations.

### Verification

- Targeted changed-feature tests: **55/55 PASS**.
- Public-content regression after About image update: **5/5 PASS**.
- Canonical current release audit: **490/490 PASS**.
- Release-quality orchestration: **PASS**, including isolation, namespace, branding, SEO hardening, public assets, theme, writer launch, autonomous handoff, lock sync, dependency version consistency and public barrel validation.
- Shell syntax: **23/23 PASS**.
- Strict JSON parse: **177/177 PASS**.
- JS/MJS/CJS syntax: **382/382 PASS**.
- TypeScript/TSX parser pass: **1076/1076 PASS**.
- Supplied office asset SHA-256: `d6cca2bcece899297735cc192d9736cf91f8c62fd07e33980b75e89a3e143205`.

### Environment limitation

This audit workspace still has no project `node_modules`/pnpm installation, so dependency-backed `pnpm lint:ci`, `pnpm test:ci`, `pnpm build`, `pnpm local-ci-check` and browser Playwright execution must run on the staging host/CI before production promotion. The source-level Playwright suite was updated for the writer composer behavior and parses successfully.


## LaTeX hero + prompt actions + source-backed reviews + social media assets — 2026-09-15

Implemented the approved homepage/About refinement on top of the current edu-staging-safe Learnitive release.

### Product changes

- Reduced the final authoritative homepage hero H1 sizing while preserving the exact two-line `Privacy First Research` / `Writing Platform` copy.
- Converted the simulated homepage workspace to a Learnitive LaTeX research editor: `main.tex`, `references.bib`, `figures`, `analysis`, `notes.md`, interactive Source/Visual reveal, LaTeX syntax, Compile state, synchronized visual document and PDF preview, plus TikZ/Terminal/AI Review/Review/Tools/TexLab cues.
- Preserved slider keyboard/pointer accessibility, auto reveal behavior, focus/hover pause, reduced-motion handling and PDF revision feedback.
- Added a separate icon-and-label `Try a prompt` row beneath `What will you write today?` with research abstract, literature review, thesis outline, academic rewrite, methodology, study notes, source comparison, research questions, annotated bibliography, paper summary, research table and citation-help actions. Prompt actions populate the composer without submitting and do not overwrite manually edited text.
- Kept icon-and-label project starters separate under `Start with a project`: Research Paper, Essay, Study Notes, Literature Review, LaTeX, Report, Article and More.
- Added a two-row source-backed customer review marquee with a reduced-motion/mobile static-snap alternative. External review cards are Han Lee / Trustpilot and Amit Jaiswal / DealMirror; existing named Learnitive customer testimonials remain first-party testimonials without invented star ratings or third-party verification labels.
- Removed unsupported review-count/G2 claims from the active review surface.
- About value icons now use Learnitive primary red with white foreground.
- About bottom carousel now uses `/learnitive-team3.webp` and `/learnitive-office3.webp` while retaining its existing controls, 8-second rotation, hover/focus pause and reduced-motion behavior.
- `/learnitive-og.webp` is now the canonical default OG/Twitter image in browser metadata and server-rendered SEO. Article-specific valid cover images remain unchanged.
- Public asset audit now requires the three supplied WebP assets.

### Supplied media verification

- `learnitive-og.webp`: **1731 × 909 WEBP**.
- `learnitive-team3.webp`: **1672 × 941 WEBP**.
- `learnitive-office3.webp`: **1672 × 941 WEBP**.

### Verification

- Targeted homepage/review/SEO regression bundle: **68/68 PASS**.
- Canonical current release audit: **501/501 PASS**.
- Release-quality orchestration: **PASS** (isolation, namespace, brand, SEO hardening, public assets, theme, writer launch, autonomous handoff, current release tests, lock sync, dependency consistency and public barrel validation).
- Public assets audit: **16 required assets PASS**.
- Namespace audit: **1483 active text files PASS**.
- Isolation guard: **398 deployment/server/script files PASS**.
- Brand, SEO hardening, theme, writer-launch and autonomous-handoff audits: **PASS**.
- Changed JS/MJS syntax checks: **PASS**.
- Active homepage review/LaTeX components contain no unsupported G2/review-count copy and no `texise-*` namespace.

### Environment limitation

The packaging workspace has no installed project `node_modules`, so dependency-backed `pnpm lint:ci`, `pnpm test:ci`, `pnpm build`, `pnpm local-ci-check` and browser Playwright execution remain required on staging/CI before production promotion. Playwright source coverage was updated for prompt actions, LaTeX hero behavior, real review links and About carousel media.

### Candidate artifact

The candidate package name for this phase is `learnitive-v58-writer-latex-prompts-real-reviews-final.zip`, with root `run.sh` plus the complete `public_html/` tree. The external SHA-256 sidecar and verification report are authoritative for the final packaged bytes.

## Homepage pricing + AI output-format refinement — 2026-09-15

### Completed phases

- Centered the complete home-pricing introduction and post-card actions while preserving left-aligned pricing-card content.
- Added responsive vertical padding around the desktop customer-review marquee without changing its real source-backed review data or accessibility behavior.
- Enforced left alignment for the simulated LaTeX source editor and right alignment for source line numbers.
- Reduced the authoritative homepage hero-title scale again on desktop and mobile.
- Added explicit icon-labelled Markdown/LaTeX output-format controls to the homepage AI writer.
- Extended the pending home AI handoff contract so output format survives authentication and AI setup and reaches the canonical project-creation workflow.
- Preserved advanced code intent precedence while making selected Markdown/LaTeX authoritative for writing projects.
- Added an explicit `Set up AI to continue` prompt before opening global AI Settings when no Agent-capable provider is ready; cancellation leaves the composer intact and successful setup resumes the pending creation once.
- Removed the passive AI requirements footer note.
- Added/updated source-level Playwright and dependency-light Node regression coverage.

### Current phase

Package and verify this incremental release from the current edu-staging-safe source tree.

### Remaining phases

- Run dependency-backed `pnpm lint:ci`, `pnpm test:ci`, `pnpm build`, `pnpm local-ci-check` and relevant Playwright/manual acceptance on staging/CI.
- Promote only the exact accepted artifact to www under the existing sequential staging→production model.

### Decisions and assumptions

- Markdown remains the default homepage writing format.
- LaTeX is an explicit peer format and is not inferred solely from generic research wording when the user has chosen Markdown.
- Explicit advanced code project intents remain code even if a document-format value is present for backward compatibility.
- Existing source-backed review identities/links are preserved; no invented review count, aggregate score, G2 badge or fabricated reviewer was added.

### Requirements and dependencies

- Preserve strict Interactive Shell production isolation and the existing Learnitive staging ownership/network hotfixes.
- Reuse the existing global AI Settings/provider readiness, auth, Pro gate, CreateWorkspaceDialog and single-use agent handoff.
- Do not add a second AI provider configuration system.

### Tests

- Focused changed-feature Node bundle: **29/29 PASS**.
- Canonical current release audit: **506/506 PASS** after adding the new focused regression.
- Isolation, namespace, brand, SEO, public-assets, theme, writer-launch and autonomous-handoff checks remain green inside the canonical audit.

### Problems and fixes

- Previous homepage AI flow immediately opened settings when AI readiness failed. It now asks first and only opens settings after the user selects `Set up AI`.
- Previous document format was implicit/inferred. It is now explicit state persisted in the home AI handoff.
- Previous home pricing/post-card copy relied on mixed inherited alignment. It is now explicitly centered without affecting card internals.

### Artifacts

- Working tree: `/mnt/data/learnitive_pricing_ai_work`.
- Final ZIP/SHA/verification sidecar are produced after the release-quality and fresh-extract packaging checks.

### Risks

- Project dependencies are not installed in this packaging workspace, so dependency-backed TypeScript/lint/build/browser gates cannot be claimed here.
- AI provider readiness behavior must still be smoke-tested in the real staging browser with the deployment's actual provider configuration.


## Home AI simplification + Interactive Shell dynamic-sandbox isolation hotfix — 2026-09-16

### Trigger and diagnosis

The first staging run of the homepage pricing/AI-format release completed build, runtime, template, queue, LaTeX and local-health acceptance but failed the final read-only Interactive Shell isolation baseline. Host diagnostics proved the protected long-lived Interactive Shell containers/networks were unchanged while normal Interactive Shell guest runtime containers were created/destroyed during the Learnitive deployment window. The baseline verifier incorrectly treated every `interactive-shell-*` runtime container as immutable infrastructure.

### Isolation fix

- `scripts/learnitive-protected-production-baseline.mjs` now excludes expected ephemeral Interactive Shell runtime containers matching `interactive-shell-guest-*` and `interactive-shell-dev-u*` from immutable Docker-container identity comparison.
- Protected Docker networks remain fully compared, and all other matching Interactive Shell containers remain protected.
- Docker mismatch diagnostics now identify the exact protected container/network added, removed or whose identity changed.
- On a genuine mismatch the verifier writes a read-only `*.after.json` protected-state snapshot and reports both before/after paths.
- `deploy/learnitive/install-staging.sh` now preserves failed forensic baseline files instead of deleting them and avoids a duplicate EXIT-time baseline failure after the explicit final verification has already failed.
- A new mocked-Docker regression proves guest/dev sandbox churn passes while a protected infrastructure container ID change still fails closed.

### Homepage AI simplification

- Removed the entire homepage `Start with a project` strip, including the LaTeX/More card row. The canonical Create Project dialog still retains Markdown, LaTeX and advanced Code project creation; only the redundant homepage starter strip is removed.
- Homepage AI is now one focused writing request flow: visible `Describe your project` label, clearer research/writing placeholder, `Add context` labelled control, keyboard shortcut hint, `Create project` CTA, icon-labelled `Popular writing tasks`, and explicit Markdown/LaTeX output format.
- The helper copy now explains that Learnitive converts a goal, pasted notes or a research task into an editable Markdown or LaTeX project.
- Prompt-task buttons still fill but never auto-submit and continue protecting manually edited text from replacement.
- Markdown remains the default output format; LaTeX remains a first-class explicit choice and survives login/AI setup through the existing pending handoff.
- Existing Pro/auth/provider-readiness behavior remains unchanged, including the explicit `Set up AI to continue` gate before global AI Settings.

### Verification

- Focused changed-feature bundle: **21/21 PASS**.
- Canonical dependency-light current release audit: **509/509 PASS**.
- Release-quality orchestration: **PASS** including public assets, lock sync, workspace dependency consistency and public barrel validation.
- Writer-launch audit: **PASS**.
- Isolation/namespace/brand/SEO/public-assets/theme/autonomous-handoff gates inside the canonical audit: **PASS**.
- `node --check` for changed MJS regression/audit files: PASS.
- `bash -n deploy/learnitive/install-staging.sh`: PASS.
- Dependency-backed staging build/Playwright still must be run for this hotfix after publishing; the parent release's staging build/runtime checks passed before the false-positive isolation failure.

### Next operational action

Package this exact tree, deploy it to `/var/www/edu.learnitive.com`, and rerun `./run.sh`. The expected difference is that normal Interactive Shell guest/dev sandbox churn during the deployment window no longer fails the immutable infrastructure baseline. Any genuine protected container/network identity change must still fail with detailed forensic output.

### Packaged candidate

- Candidate archive: `learnitive-v58-home-ai-simplified-isolation-hotfix-final.zip`.
- Root layout remains executable `run.sh` plus complete `public_html/`.
- Fresh-extract comparison must remain byte-for-byte identical to the working tree before handoff; the external SHA-256 sidecar is authoritative for final archive bytes.

## www production one-shot cutover package — 2026-09-16

### Completed phases

- Removed `Learn` from the shared `PUBLIC_PRIMARY_NAV`, so public/external headers and `/projects` no longer show the top-menu Learn link while `/learn` routes remain available.
- Added a root production workflow for `/var/www/learnitive.com` that runs a read-only Apache/TLS preflight before application-service mutation, preserves filesystem-backed staging state, deploys the production `www` profile, normalizes active Learnitive paths to the production root, then activates production vhosts.
- Added guarded Learnitive-only Apache cutover for `www.learnitive.com`, apex `learnitive.com`, and `edu.learnitive.com -> www.learnitive.com`.
- Added safe migration of old enabled vhost files only when their complete `ServerName`/`ServerAlias` set consists solely of the three Learnitive cutover hostnames; mixed-domain files fail closed.
- Added automatic existing-certificate discovery for www, apex and edu, with host-specific override variables; the package does not run Certbot or alter Apache modules.
- Added persistent pre-cutover vhost backup under `/var/backups/learnitive/apache-vhosts/`, rollback on activation failure, protected Interactive Shell Apache-file before/after snapshots, Apache configtest, graceful reload and local HTTPS acceptance.
- `edu.learnitive.com` is redirected only after the production application installer succeeds and www local verification is ready to run; `/var/www/edu.learnitive.com` itself is retained untouched as a rollback filesystem copy.
- If the vhost activation fails after application activation, the Apache state is rolled back and the www successful-release marker is cleared so a corrected rerun cannot incorrectly short-circuit.

### Current phase

Package and hand off the exact production-ready tree for upload to `/var/www/learnitive.com/`.

### Remaining phases

- On the target server, ensure existing valid TLS certificates cover `www.learnitive.com`, `learnitive.com`, and `edu.learnitive.com`, and ensure DNS for www/apex points to the host as intended.
- Extract the release into `/var/www/learnitive.com/` and run `./run.sh` as root.
- Run public external verification after DNS/edge propagation and manually smoke auth, Markdown/LaTeX, PDF, AI, collaboration and terminal paths.

### Decisions and assumptions

- The user explicitly requested the production package to fix/activate Learnitive vhosts as part of `./run.sh`; this is a narrow exception to the default independent-ingress rule.
- The cutover may gracefully reload Apache but may not restart it, change Apache modules, run Certbot, or mutate Interactive Shell vhost/config/certificate files.
- `legacy.learnitive.com` and `preview.learnitive.com` remain independent and are not claimed by the production cutover.
- The relational database remains `learnitive_os`; domain promotion does not rename or recreate it.

### Requirements and dependencies

- Root execution from `/var/www/learnitive.com`.
- Existing Apache with rewrite, proxy, proxy_http, proxy_wstunnel, headers and ssl modules already enabled.
- Existing readable certificates/keys for www, apex and edu.
- Existing Learnitive application dependencies are installed/built by the normal installer on the target host.

### Tests

- Focused navigation/www-cutover tests: **28/28 PASS**.
- Canonical current-release audit: **511/511 PASS**.
- Release-quality orchestration: **PASS**.
- Namespace, brand, SEO, public-assets, theme, writer-launch, AUTO, isolation, lock-sync, workspace dependency and public-barrel gates: **PASS**.
- Shell syntax for root launcher, vhost activator and local verifier: **PASS**.

### Problems and fixes

- Earlier production packaging assumed operator-managed ingress and could not fulfill a one-command www move. The new guarded wrapper performs Learnitive-only vhost activation after a read-only preflight and full application acceptance.
- Existing vhost conflicts can now be migrated automatically when they are demonstrably Learnitive-only; mixed-domain owners abort rather than risking unrelated domains.
- The old vhost helper required one certificate covering both apex and www. The new resolver accepts separate certificates for each hostname and independently validates certificate hostname coverage, expiry and private-key match.

### Artifacts

- Working tree: `/mnt/data/learnitive_www_final_work`.
- Final ZIP/SHA/verification report are generated from this exact tree after fresh-extract fidelity checks.

### Risks

- This packaging environment cannot execute the real target host Apache reload or validate the server's installed certificates/DNS; the root launcher therefore performs those checks on-host before mutating application services.
- A graceful Apache reload still touches the shared listener process; protection relies on exact Learnitive-only site mutation, configtest, protected-file snapshots and fail-closed rollback.

## 2026-09-16 — production Cloud Terminal WSS cutover-order hotfix

### Target-host failure diagnosed

- The production application, Redis, Universal Runner, Packages + Git proxy, Console Gateway and main API all reached readiness.
- The deployment then failed only at the functional Cloud Terminal smoke with `Unexpected server response: 404` while connecting to `wss://www.learnitive.com/console-gateway/...`.
- The Console Gateway itself created and cleaned the smoke sandbox successfully, proving the private gateway/Docker path was alive.
- Root cause: the core installer intentionally runs before `run.sh` activates the new Learnitive-only production Apache vhosts. The smoke incorrectly required the future `/console-gateway/` public WSS route before the vhost containing that route had been activated. The still-active legacy Learnitive vhost therefore returned 404.

### Fix

- `deploy/learnitive/install-staging.sh` now keeps the existing end-to-end public WSS smoke for staging, but on the `www` profile it first certifies the private loopback WebSocket -> Console Gateway -> Docker -> PTY path without depending on not-yet-active production ingress.
- `scripts/verify-www-local-vhost.sh` now runs the same authenticated terminal smoke through `https://www.learnitive.com` after the guarded Learnitive-only Apache cutover. It resolves www to loopback, creates/destroys only its own Learnitive guest sandbox, and fails the vhost verifier if public WSS or PTY execution is not functional.
- `deploy/learnitive/install-www-vhosts.sh` already rolls the Learnitive vhost cutover back when local verification fails, so production ingress is now both correctly ordered and still fail-closed.
- No Docker network/container relabelling, deletion or recreation was added. No Interactive Shell resource is selected or modified.

### Verification

- Focused installer/www tests: **17/17 PASS**.
- Shell syntax: `deploy/learnitive/install-staging.sh` and `scripts/verify-www-local-vhost.sh` **PASS**.
- Canonical current-release audit: **521/521 PASS**.
- Release-quality orchestration: **PASS**.



## 2026-09-16 — production root-launcher contract hotfix

### Target-host failure diagnosed

- The corrected private terminal smoke completed and the full production installer reached `R12 www installation and real execution acceptance passed`, but Apache remained on the legacy Learnitive vhost and `https://www.learnitive.com` still returned 404.
- The expected root-launcher line `Installing and verifying www.learnitive.com, apex redirect, and edu.learnitive.com -> www cutover vhosts.` never appeared after the child installer returned.
- The packaged root `run.sh` contains that activation step, so the host was executing a stale/custom root launcher while `public_html` had been updated. This allowed the child installer to succeed without the parent performing the guarded Apache cutover.

### Fix

- Root `run.sh` now exports an explicit `LEARNITIVE_WWW_ROOT_LAUNCHER_CONTRACT=www-vhost-cutover-v3` contract immediately before starting the production installer.
- `deploy/learnitive/install-production-www.sh` now refuses production installation unless that exact current-root-launcher contract is present. A stale/bypassed launcher therefore fails immediately instead of spending the full deployment and leaving Apache unchanged.
- The actual vhost mutation remains owned only by root `run.sh` through `install-www-vhosts.sh --activate`; the core installer remains external-ingress-only.
- No Interactive Shell configuration, Learnitive Docker ownership, certificates, firewall, or Apache modules are changed by this contract check.


## 2026-09-16 — production Apache commit ownership hotfix

### Target-host failure diagnosed

- The v3 root-launcher contract was present and the entire www child installer completed successfully, including private terminal smoke, template/runtime/LaTeX acceptance and schema checks.
- Despite that, the root process again never emitted its post-child vhost activation line. Apache kept the legacy Learnitive vhost enabled and `https://www.learnitive.com` returned Apache 404.
- The old `sites-available/learnitive.com*.conf` files being unchanged is expected by design; the real failure was that their enabled legacy symlinks were never replaced by the canonical www/apex/edu sites.

### Fix

- Bumped the complete-release launcher contract to `www-vhost-cutover-v4`.
- Root `run.sh` still performs read-only Apache/TLS preflight before application mutation.
- `deploy/learnitive/install-production-www.sh` now runs the core installer as a child instead of `exec`, performs production path normalization, and commits `install-www-vhosts.sh --activate` itself before returning.
- Root `run.sh` no longer owns a post-child mutation step; after the production wrapper returns it only verifies the committed `.www-vhosts` marker and reports completion.
- The core installer remains external-ingress-only. The existing vhost helper still changes only Learnitive site files/symlinks, snapshots protected Apache config, runs configtest + graceful reload, validates www/apex/edu plus public WSS/PTy, and rolls back on failure.
- A failed vhost activation clears the www successful-release marker so a corrected rerun cannot short-circuit.
