# Oscar Platform — Main Pact Document

**This is the constitutional document that defines Oscar's identity, sovereignty, and structure.**

**Date:** 2026-06-29
**Status:** Constitutional (ratified per FVW v8 v0.10.0 §01, §02)
**Supersedes:** `pact/platform/README.md` (which now serves as entry doc only)
**Schema:** `freshvibe-way-v8.app-pact v1.0.0`

---

## 1. Identity (per §03)

- **App ID:** `studio.oscar.platform`
- **App name:** Oscar Platform
- **Version:** 1.0.0
- **Domain:** `oscar.freshvibe.studio` (operator wires DNS)
- **Cloudflare Pages project:** `oscar-platform`
- **Live URL:** https://oscar-platform.pages.dev
- **Lineage:** R1-R18 original Oscar website → Sovereign SPA pivot (Phase 1-10)
- **Supersedes:** `avidtech6/oscar-ai/R18`
- **Recipe ID:** `studio.oscar.platform.recipe.v1`

**DNA reference:** `pact/dna/app.dna.json`

---

## 2. Reconstruction Mode Declaration (per §33, §33.5)

Per DO-001 (PENDING UPSTREAM RATIFICATION of §33.5):

- **Mode:** **Sovereign SPA Mode** (third mode; not yet ratified in FVW v8)
- **Target runtime:** React 18 + TypeScript + Vite (no Mantine)
- **Module file extension:** .tsx
- **View fragment format:** React components in `<Name>.tsx`
- **State management:** React hooks (useState, useContext, useReducer)
- **Theme tokens:** CSS custom properties (no Mantine theme provider)
- **Render approach:** JSX with conditional render
- **Mount point:** `App.tsx` mounts `<OscarShell>`
- **Persistence:** IndexedDB (browser-only) + localStorage (`oscar:` prefix)

**Until §33.5 is ratified upstream, this declaration is locally binding via DO-001.**

---

## 3. Micro-Model Status (per §15, §15.3-bis)

Per DO-002 (PENDING UPSTREAM RATIFICATION of §15.3-bis):

- **Brain manifest:** `app/src/brain/manifest.ts`
- **Declared model:** `Qwen/Qwen2.5-0.5B-Instruct-GGUF` Q4_K_M, 380 MB
- **§15.3 ceiling:** 2M parameters (micro-model constitutional)
- **Qwen 0.5B params:** 500M (250× over ceiling)
- **Status:** **STUB — constitution gap**

**Resolution path:** §15.3-bis amendment proposes a "browser-loadable model" tier (100k-1B params) which would legitimize Qwen 0.5B. Until ratified, Oscar's brain is constitutionally latent.

**Until §15.3-bis is ratified, this declaration is locally binding via DO-002.**

---

## 4. Smart-X Toggles (per §16.3, §16.5)

**Reference:** `pact/recipes/smart/features.json`

### 4.1 Enabled features (3 of 14)

| Smart-X | Status | Module |
|---|---|---|
| Smart Chat | ✅ shipped | assistant/ |
| Smart Explain | ✅ shipped | assistant/heuristics.ts |
| Smart Engines | ✅ shipped | intelligence/adapters/smart.ts |

### 4.2 Partial features (6 of 14)

| Smart-X | Status | Location |
|---|---|---|
| Smart CMS | ⚠️ partial | views (Reports/Notes editors) |
| Smart Input | ⚠️ partial | writing/draft.ts (requires generative provider) |
| Smart Docs | ⚠️ partial | intelligence/standards/ library (manual summaries) |
| Smart Peek | ⚠️ partial | assistant/SheetMin (peek state) |
| Smart Preview | ⚠️ partial | views/Blog.tsx (preview tab) |
| Smart Metadata | ⚠️ partial | views/Notes.tsx (tag extraction) |

### 4.3 Absent features (5 of 14)

| Smart-X | Status | Notes |
|---|---|---|
| Smart Insights | ❌ absent | CompletenessMeter exists in ux/ but not surfaced |
| Smart Rebuild | ❌ absent | Not implemented |
| Smart Modes | ❌ partial | View/Edit modes exist per-route; "modes" UX absent |
| Smart Search | ❌ absent | search/ is keyword-only, not semantic |
| Smart History | ❌ absent | UndoToast exists in ux/ but unwired; no artefact versioning |

**The 14 Smart-X features are constitutional toggles per §16.3. The user can toggle each per project (when §37 Project Spine is implemented in Phase C1).**

---

## 5. Cross-References to Mandatory Artefacts

| Artefact | Path | Status |
|---|---|---|
| `app-pact.md` (this doc) | `pact/platform/app-pact.md` | ✅ |
| Invariants | `pact/platform/invariants.md` | ✅ |
| Anti-drift | `pact/platform/anti-drift.md` | ✅ |
| Sovereignty | `pact/platform/sovereignty.md` | ✅ (preserved as subordinated doc) |
| Entry README | `pact/platform/README.md` | ✅ (preserved) |
| DNA | `pact/dna/app.dna.json` | ✅ |
| Trace atlas | `pact/trace-atlas/atlas.json` | ✅ |
| Overlays | `pact/overlays/dark-green-palette.overlay.md` | ✅ |
| App-VP tests | `pact/vp/{sovereignty,runtime,intelligence,data,ux,build,adversarial,rules-md-checks,c9-state-shape-checks,c8-shape-matrix-checks,smart-features-checks}.test.ts` | 11 suites, ~70 invariants |
| Recipe Books | `pact/recipes/<module>/` × 12 modules × 10 items each | ✅ |
| Codex per module | `pact/codex/oscar.<module>.codex.md` × 12 modules | ✅ |
| Fragments | `pact/fragments/oscar.*.md` × 50+ | ✅ |
| Decisions | `pact/decisions/DO-*.md` × 8 | ✅ |
| Extraction | `pact/extraction/{baseline-snapshot,runtime-inventory,sovereignty-baseline}.md` | ✅ |

**Score:** 8 of 8 mandatory artefacts present (after Phase A2).

---

## 6. Constitutional Rules

### 6.1 Per FVW v8 v0.10.0 §08 (Anti-Drift)

The 25 anti-drift rules + 20 gates + 12 failure modes apply. See `pact/platform/anti-drift.md`.

### 6.2 Per FVW v8 v0.10.0 §35 (Module-Pact Registration)

Every module MUST declare `constitutional_fragments` in `module.json`. Drift-check MP-1 enforces.

### 6.3 Per FVW v8 v0.10.0 §22 (Behaviour-First Codex)

Every module's `codex.md` MUST contain C1-C8 (and C9 per v9-fvw proposal).

### 6.4 Per FVW v8 v0.10.0 §11.9 (9 Things in rules.md)

Every module's `rules.md` MUST contain the 9 universal things in §11.9 format.

### 6.5 Per FVW v8 v0.10.0 §16.5 (recipe-book/smart/)

A `recipe-book/smart/` directory MUST exist with 6 JSON files for any Product Smart App at Level 4+.

---

## 7. Reconstruction Procedure (per §00 + §34)

Per `pact/recipes/recipe.md`:

1. Read this pact (`app-pact.md`)
2. Read invariants, anti-drift, DNA
3. Read FVW v8 doctrine (canonical reference)
4. For each module, read its Recipe Book (10 items per §11)
5. Read Trace Atlas (5-level chain per §04)
6. Implement per the declared mode (Sovereign SPA Mode per DO-001)
7. Run App-VP test suite (~70 invariants)
8. Deploy per CF Pages

---

## END OF APP-PACT.MD

*Constitutional document for Oscar Platform. Frozen per FVW v8 v0.10.0 §01.*
