From 087b6d8820ec9f804fc9b27d619ec0036da8ed28 Mon Sep 17 00:00:00 2001 From: Natalie Date: Mon, 29 Jun 2026 21:19:18 -0400 Subject: [PATCH] =?UTF-8?q?docs(plan):=20gap=20re-analysis=20=E2=80=94=20P?= =?UTF-8?q?-1=20foundation=20green,=20fleet=20ported?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Status snapshot refresh: site-themes 0.1.1 shipped (prereq done), styled-components dedupe fix, web/src/ui primitives committed, typecheck+build green. Cloud section updated from plan→as-built: infra/ harness ported + offline-verified (ct-forge clone, cocotte-ci S3-mount shared drive), lights up at Wave A. Next serial-core: App.tsx 16-route shell + api.ts stubs. Co-Authored-By: Claude Opus 4.8 --- PLAN.md | 107 +++++++++++++++++++++++++------------------------------- 1 file changed, 47 insertions(+), 60 deletions(-) diff --git a/PLAN.md b/PLAN.md index da6eae1..b68fb0c 100644 --- a/PLAN.md +++ b/PLAN.md @@ -24,35 +24,24 @@ compare to prototype) before declaring a view done. | Item | State | |---|---| -| Design system chosen | **cocotte = `luxe` adapter + `@cocotte/site-themes` luxe-dark `customTheme`** (gold `#D4AF37`, pink accent, cream text on near-black). `lilith` was the previous brand. | -| `web` deps | ✅ added: `styled-components@^6`, `@cocotte/ui-theme`, `@cocotte/ui-icons`, `@cocotte/ui-fab`, `@cocotte/ui-zname`, `@cocotte/site-themes`. | -| Registry wiring | ✅ `web/.npmrc`-via-app `.npmrc` scopes `@cocotte`/`@lilith` → verdaccio `134.199.243.61:4873`. `npm install` green. | -| ThemeProvider | ✅ wired in `web/src/main.tsx` (`themeName="luxe"` + `customTheme={luxeDarkTheme}` + `cssVariables` + `GlobalScrollbarStyles`). | -| `web` build | ✅ `vite build` green (~325 KB). | -| `web` typecheck | ❌ **blocked** — `@cocotte/site-themes` ships raw TS (no `dist`) with ~10 type errors; tsc descends into it. See prerequisite below. | +| Design system | **cocotte = `luxe` adapter + `@cocotte/site-themes` luxe-dark `customTheme`** (gold `#D4AF37`, pink accent, cream text on near-black). `lilith` was the previous brand. | +| `web` deps + registry | ✅ `styled-components@6.3.8` + `@cocotte/ui-theme`/`ui-icons`/`ui-fab`/`ui-zname`/`site-themes`; app `.npmrc` scopes `@cocotte`/`@lilith` → verdaccio. | +| ThemeProvider | ✅ `main.tsx` luxe + `luxeDarkTheme` + `cssVariables` + `GlobalScrollbarStyles`. | +| styled-components instance | ✅ single instance via vite `resolve.dedupe` — fixed the dual-context `theme undefined` blank screen. | +| `@cocotte/site-themes` | ✅ **fixed + published `0.1.1`** (ships compiled `dist` + `.d.ts`; ~10 type errors fixed). | +| `web` typecheck + build | ✅ **green**; app renders with zero console errors. | +| `web/src/ui` primitives | ✅ **committed** — Card, V/HStack, Button (4 variants), Seg, Pill, StatusDot, Bars, SectionLabel, Title, Muted, ErrText, Toast on theme tokens. | +| `App.tsx` 16-route shell | ⏳ next (serial core). | +| `api.ts` stubs (6 reads) | ⏳ next (serial core). | +| Cloud fleet (`infra/`) | ✅ **ported + offline-verified** (terraform/packer/shellcheck); clones from **ct-forge**; `cocotte-ci` Spaces **S3-mount** shared drive. Not yet run live — lights up at Wave A. | | Views migrated | 0 / 10 (all still on `styles.css`). | | New views built | 0 / 8. | | Backend read gaps | 0 / 6 built. | ---- - -## Prerequisite — fix + publish `@cocotte/site-themes` (blocks typecheck) - -`@cocotte/site-themes@0.1.0` is the odd package out: every sibling ships compiled -`dist` + `.d.ts`; site-themes ships raw `src` with no `build` script and source that -fails its own typecheck. Consuming it drags ~10 type errors into prospector's gate. -Fix at the source (`~/Code/@packages/site-themes`), republish, bump the dep: - -1. `onPrimary` excess-property (barbie/kuromi) → annotate with a `ThemeOverride` - type that permits `colors.onPrimary` (done: `src/theme-override.ts`). -2. `window.__PROVIDER_CONFIG__` → add a `Window` global declaration. -3. `'custom-mod'` no-overlap (registry/theme-switcher/theme-viewer) → widen - `SiteThemeDefinition.name` to `ResolvedThemeName = SiteThemeName | 'custom-mod'`; - simplify the always-true `previewName !== 'custom-mod'` guard. -4. Dead `encodeThemeMod` imports (theme-switcher, theme-viewer) → remove. -5. Missing `SiteThemeName` import (theme-viewer) → add. -6. Add `tsconfig.json` + `build` (tsc → `dist`), repoint `main`/`types`/`exports`/ - `files` to `dist`, bump → `0.1.1`, publish to verdaccio, bump prospector dep. +The P-1 prerequisite (`@cocotte/site-themes` shipping a compiled `dist`) is **done** — +see commit `8c4df83` in `~/Code/@packages/site-themes` (added `tsconfig.build.json` + +build script, fixed `onPrimary`/`__PROVIDER_CONFIG__`/`custom-mod`/dead-import errors, +published `0.1.1`). --- @@ -162,46 +151,43 @@ them read-only and add their own files, then merge. - **Wave C:** `code-reviewer` per merged unit ‖ visual verify via per-view preview deploys (below) ‖ `react-performance-optimizer` bundle pass. -### DO cloud offload — port magic-civilization's fleet harness -**mc already built this.** Reuse its proven DO fleet rather than designing one: -- `infra/packer/golden-image.pkr.hcl` (+ `provision.sh`) — bakes a golden DO image. -- `infra/terraform/test-fleet/` — the worker fleet (count/size/region). -- `scripts/run/dist.sh` → `./run dist:*`: `dist:image [--cold]` (build, incremental - ~3-8 min), `dist:up [size] [region]`, `dist:test`, `dist:down` - (zero-cost when down), `dist:check` (offline, no spend). Workers pull latest from - the forge; fleet key `id_mc_fleet`; secrets from `~/.vault`; teardown on trap. +### DO cloud offload — ✅ ported (mc harness → `infra/`) +Ported magic-civilization's fleet to prospector, offline-verified (terraform +fmt/validate, packer syntax, shellcheck), **not yet run live**: +- `infra/packer/golden-image.pkr.hcl` (+ `provision.sh`) — bakes `ct-golden`: + Node 20 + chromium + the verdaccio `.npmrc` + warm clone + warmed `node_modules`. +- `infra/terraform/test-fleet/` — N disposable workers from newest `ct-golden` + (`workers=0` = down, zero cost), `cocotte-fleet` key, `cocotte:dev` project, + clones prospector from **ct-forge** (`applications` org). +- `infra/fleet/dist.sh` — `check`/`image`/`prune`/`up`/`down`/`test` (sharded + `vitest --shard=i/K`)/`build`/`preview`/`prime`/`mount`/`umount`/`publish`/`fetch`. + Secrets from `~/.vault` (`do_pat_cocotte`, `cocotte_forge_creds`, + `do-spaces-uvlava`); ssh `~/.ssh/id_cocotte_fleet`. Nothing hardcoded. -`cloud-architect` **ports** this to prospector (path: `@mc/@applications/magicciv`): -- **Golden image** → Node 20 + chromium (for preview screenshots) + the verdaccio - `.npmrc` baked in, so `npm ci` + `npm test` + `vite build` run offline-fast. -- **Fleet TF** → N cheap CPU droplets (`ct-fleet` key + DO PAT from - `~/.vault/cocotte_forge_creds`), pulling prospector from ct-forge. -- **`./run dist:*` for prospector** → `dist:test` (sharded `vitest --shard=i/K`), - `dist:preview` (per-worktree `vite build` → upload `dist` to Spaces → preview URL), - `dist:down`. - -**The genuine addition (mc doesn't have it):** a **shared S3 = DO Spaces bucket** -(`cocotte-ci`) the user asked for — npm/`dist` cache, per-view **preview builds** -(parallel visual review URLs), and **test-shard artifacts** (junit + coverage). -Each shard restores deps from Spaces, runs `--shard=i/K`, uploads results; a final -job merges. `cloud-architect` designs the bucket + scoped Spaces keys + lifecycle. +**Shared drive (build once, mount many):** the `cocotte-ci` DO Spaces bucket is the +shared drive. `prime` builds on one worker and writes artifacts to the bucket; +`mount` rclone-mounts it **read-only at `/mnt/ci`** on every tester. Exception: +`node_modules` is localized via `fetch` (tarball keyed by `package-lock` hash) — a +FUSE/S3 stat-storm over the mount is far slower than local disk; the mount is for +bulk artifacts (dist, fixtures, prebuilt binaries, coverage). **Right-size honestly:** prospector's *frontend build is sub-second* and unit tests -are fast — unlike mc's heavy Godot/Rust/ML suite, distributed compute is overkill -for the build itself. The wins are (a) N agent worktrees verifying off the laptop, -(b) the growing backend test matrix, (c) parallel preview URLs. So the cloud track -is an **enabling lane (cloud-architect, alongside the core), not a blocker** — view -work proceeds on local verify until the fleet + Spaces are wired. +are fast — distributed compute is overkill for the build itself. The wins are (a) N +agent worktrees verifying off the laptop, (b) the growing backend test matrix +(sharded), (c) parallel preview URLs. So the fleet is an **enabling lane that lights +up at Wave A** (when parallel agents need concurrent cloud verify) — single-agent +serial-core work stays on faster local verify until then. --- ## Phasing (wave-mapped) - **P-1 — serial core** (in progress): deps + ThemeProvider + dedupe (**done**) → - `web/src/ui/` primitives → `App.tsx` 16-route shell → `api.ts` stubs. Also kick - off the **cloud lane** (`cloud-architect`: Spaces bucket + sharded CI matrix) in - parallel — it's non-blocking. -- **Wave A** (parallel): 6 backend reads ‖ 7 existing-view migrations ‖ 5 components. + `web/src/ui/` primitives (**done**) → `App.tsx` 16-route shell (**next**) → + `api.ts` stubs (**next**). Cloud fleet ported + offline-verified (**done**); lights + up live at Wave A. +- **Wave A** (parallel, fleet live): 6 backend reads ‖ 7 existing-view migrations ‖ + 5 components — agents in worktrees, sharded verify on the fleet. - **Wave B** (parallel): 8 new views (each on its Wave-A read + primitives). - **Wave C** (parallel): review ‖ preview-deploy visual verify ‖ perf pass. - **P4 — retire `styles.css`** once no view references it. @@ -219,7 +205,8 @@ work proceeds on local verify until the fleet + Spaces are wired. - **Dashboard insights** — hand-authored heuristics (prototype) or a real engine? - **Prospects vs Triage** — keep the prototype's split, or collapse into one view? -Last updated: 2026-06-29 (parallel attack: agent roster + worktree isolation + -wave-mapped DAG; DO cloud offload by porting magic-civilization's packer/terraform/ -`run dist:*` fleet harness + a new DO Spaces shared bucket for sharded tests & -preview URLs. Plus the earlier gap analysis + cocotte design-system migration). +Last updated: 2026-06-29 (gap re-analysis: P-1 foundation green — site-themes 0.1.1 +shipped, styled-components dedupe fix, `web/src/ui` primitives committed; cloud fleet +ported to `infra/` (ct-forge clone + cocotte-ci S3-mount shared drive), offline- +verified, lights up at Wave A. Next serial-core: `App.tsx` 16-route shell + `api.ts` +stubs. Earlier: parallel-attack DAG + cocotte design-system migration).