# Projects Module — Recipe (per FVW v8 §11.1)

**Module ID:** `oscar.projects`
**Module version:** 0.1.0
**Status:** Constitutional (per §37 latent doctrine, locally ratified).

---

## A. Product Description

**What this module is:** The project spine. Every artefact in Oscar belongs to a project. The Projects view is the dashboard for project management; ProjectsContext provides the current project as the universal scoping context.

**UI structure:**
- ProjectsView: grid of project cards
- Project card: name, type, state badge, artefact counts, current marker
- New project modal: name + type selector

**States:** draft → active → paused → archived → deleted (5 states per §37.5).

## B. Structural Contract

### B.0 Reconstruction Mode Declaration (per §33, §33.5)
- **Mode:** Sovereign SPA Mode (per DO-001)

### B.1 Inputs/Outputs

**Inputs:** user actions (create, switch, set state)
**Outputs:** project cards, current project marker, IDB writes

### B.2 Interface Contract (R5)

```ts
interface ProjectsContextValue {
  current: Project | null;
  all: Project[];
  switchTo: (projectId: string) => void;
  create: (project) => Promise<Project>;
  setState: (projectId, state) => Promise<void>;
  refresh: () => Promise<void>;
}
```

### B.3 Module Boundaries

**OWNS:** projects model, ProjectsContext, ProjectsView
**MUST NOT own:** artefacts themselves (those belong to other modules but reference project_id)

## C. Reconstruction Notes

### C.1 Evidence
- `pact/latent/section-37-project-spine.md` (latent ratification)
- `app/src/data/models/Project.ts`
- `app/src/projects/ProjectsContext.tsx`
- `app/src/views/Projects.tsx`
- `app/src/data/persistence/idb.ts` (projects store, DB_VERSION 2→3)

### C.2 Migration
- v2 → v3: on first launch, create default project; existing artefacts get `project_id = "default"` per-view

---

## END OF RECIPE.MD
