[docs] ArtBoard: Record the art pipeline, its review, and the board replacing the 127.0.0.1 page

This commit is contained in:
2026-11-01 20:17:03 +01:00
parent f24597dfdb
commit 3ff14fab16
11 changed files with 379 additions and 14 deletions
+101
View File
@@ -0,0 +1,101 @@
# The art pipeline and the art board
Status: on `feature/art-board`, reviewed in
[`feature-art-board.md`](../reviews/feature-art-board.md). Gap: G0.24. Roadmap: Phase 0, *art/STYLE.md
drafted with Mark, art/manifest.json for Phase 1 assets, Claude's SVG placeholders, and the art
preparation page working end to end on one asset.* The pipeline itself is [`docs/ART.md`](../../docs/ART.md).
---
## 1. Why and what, in the player's terms
The player never sees this feature. They see what it produces: one rose who looks the same in
every picture, a garden whose light follows the real day, and nothing that looks copied from
the book. Without a pipeline, each picture is a separate gamble. The rose's face drifts
between pictures, a glass dome sneaks in from the generator's memory of the book, and a 3 MB
PNG lands in the precache.
For Mark it is a board. Every picture the game needs sits on one page with the prompt that
makes it. He copies the prompt and pastes back what the generator made. The board measures the
picture, Claude reviews it, and he taps *Accept*. Claude moves it into the game.
## 2. Technical architecture
```mermaid
flowchart LR
style["art/STYLE.md"]
manifest["art/manifest.json"]
content["packages/content<br/>findForbidden"]
schema["packages/schema<br/>PRODUCT_NAME"]
prep["tools/art-prep<br/>manifest.ts · prompt.ts · placeholders.ts<br/>board.ts · accept.ts"]
placeholders["art/placeholders/*.svg"]
dist["tools/art-prep/dist/board/<br/>index.html · board-data.json · placeholders/"]
board["Art board<br/>claude.ai artifact: db + assets"]
final["art/final/*.webp"]
style --> prep
manifest --> prep
content --> prep
schema --> prep
prep -- "pnpm art:board" --> placeholders
prep -- "pnpm art:board" --> dist
dist -- "Claude publishes" --> board
board -- "Claude downloads the accepted picture;<br/>pnpm art:accept" --> final
```
`tools/art-prep` is a workspace package (`@rosea/art-prep`) so that it gets its own tests,
typecheck and lint. Nothing imports it: not the app, not the packages.
### Decisions
| # | Decision | Why |
|:--|:--|:--|
| A1 | The art preparation page is a **private claude.ai artifact**, the Panda Domi board adapted, not a page on 127.0.0.1. | Mark asked for this board. It works from his phone, keeps the pictures between sessions, and Claude can read its rows and images. The roadmap and CLAUDE.md now say so (ROADMAP Phase 0, *Decided 2026-11-01*). |
| A2 | Prompts are **built, never typed**: STYLE.md §1 plus the manifest's words. STYLE.md is the only copy of the style prompt and the review points. | The same words describe the rose every time, so she stays the same rose. Changing the style means editing one file. |
| A3 | The manifest is **checked before any prompt exists**. That covers sizes generators offer, grids that divide into whole pixels, unique ids, characters with sheets, transparent sprites and layers, and **every forbidden word** from `@rosea/content`. | A prompt naming the book is how a likeness gets in (§8). Prompts are not player copy, so `lint:copy` never reads them. |
| A4 | Every prompt ends with a **shared avoid list**: glass dome, folding screen, tiny round planet, desert, scarf, *the look of any existing book's drawings*. | The book's most recognisable images are the ones a generator will reach for when it hears *rose* and *fox*. |
| A5 | **The sky is code.** Garden pictures are layers, transparent above a horizon at 40 %. | The sun follows the player's real time and the stars are the real constellations (CLAUDE.md §1). A painted sky could be neither. |
| A6 | **Sprite sheets** come with exact pixel geometry: cut lines, cell centres, a safe box at 12 % of the cell's shorter side. Each cell can also be made *one at a time*. | Taken from the Panda Domi board, where a sheet's drift off the grid was the common failure. |
| A7 | `art:accept` **refuses rather than guesses**. A sheet with an empty or painted cell is refused whole, a transparent picture with an opaque background is refused, and so is a file still over budget at WebP quality 62. A full picture is cropped to shape, then only ever shrunk. | A cut that "mostly worked" ships a broken picture. Every final picture is precached, so the budget is real bandwidth on a player's phone. |
| A8 | Stand-ins are **generated** from the same manifest and committed in `art/placeholders/`. A test fails if they drift. | The board and, from Phase 1, the app both show them. One manifest change must update both. |
| A9 | The board's page takes the product name from `@rosea/schema` (`%PRODUCT_NAME%`). | Renaming stays a one-commit operation (CLAUDE.md preamble). |
| A10 | Claude writes its review and the `final` paths into the board's rows. The card shows them. | Mark sees on the card what Claude checked and whether the picture is in the game, with no separate report to read. |
## 3. Risk analysis
| Risk | Where | Defence |
|:--|:--|:--|
| **A picture that looks like the book** (copyright, and the product claiming a lineage it promised not to, GAMEPLAY §8) | Prompts; generated pictures | A3, A4. STYLE.md §8 makes likeness Claude's first review check. Mark's eye is the last gate. No automatic likeness check exists (docs/ART.md §5). |
| **A rose who looks hurt or sad because of the player** (a lonely person feeling worse, §8 *drift that reads as blame*) | `rose-waiting`, `rose-thirsty`, `rose-overwatered` prompts | Their prompts say *tired, not hurt*, *gently comic, never ill*, *quiet, waiting with patience, never sad, hurt or blaming*. Review point 7 is about exactly this. |
| **Words painted into a picture**, bypassing the copy library | Generated pictures | Every prompt forbids text. Claude's review refuses painted words (STYLE.md §8). The petal's words are added in code. |
| **Player data leaving the device** | The board | None can. The board holds only generated art and Mark's notes, and the app never talks to it (docs/ART.md §3, *Privacy*). |
| **Someone being reachable** | — | Not applicable: no player is involved. |
| **A huge bundle on a phone** | `art/final/` | A7's budgets: about 1.4 MB for the four layers, 120 KB per small picture. |
| **The board and the repo disagree** | Manifest changes | `art:board` rewrites `art/placeholders/` from the manifest, and the drift test fails until it is run. The board is republished from the same build. |
## 4. Gap analysis and the designed solution
| Gap (G0.24) | Solution | State |
|:--|:--|:--|
| No `docs/ART.md` | Written: the six steps, the manifest's rules, the board, budgets, what's missing | Done |
| No `art/STYLE.md` "drafted with Mark" | A draft by Claude, with its open choices S1–S5 listed for Mark | **Draft.** Mark's approval is still needed |
| No `art/manifest.json` | 11 cards, 25 Phase 1 pictures: rose sheet, stages, care, moments, care things, chair, four garden layers, icon | Done |
| No SVG placeholders | 29 stand-ins, generated and committed | Done |
| No art preparation page | The art board, published (A1) | Done |
| **Phase 0 gate:** one picture through the pipeline into `art/final/` | Every step exists and is tested with synthetic pictures | **Open.** It waits on Mark making and accepting the first real picture |
## 5. Verification matrix
| Case | Kind | Where |
|:--|:--|:--|
| The real manifest passes every check | unit | `tools/art-prep/test/manifest.test.ts` |
| Each manifest rule fires: a repeated id, cell id clash, bad id, odd size, cell/grid mismatch, non-dividing grid, grid on a single, unknown character, shipped sheet, opaque sprite, missing review point, no subject, unused picture, a book name, a medical word, *lonely* in the avoid list, a missing or wrong sheet | unit (17 cases) | same |
| STYLE.md §1 and §7 are read exactly; a missing section is an error | unit | `prompt.test.ts` |
| All 29 prompts start with §1 word for word, carry the shared avoid list, and contain no forbidden term | unit | same |
| Rose prompts ask for `rose-sheet`; the sheet itself doesn't | unit | same |
| Grid numbers in the prompt equal `cellBoxes`; tall cells made alone use 1024 × 1536 | unit | same |
| The board data has the shape the page reads; every kind has a group on the page; the page never spells the product name | unit | `board.test.ts` |
| A stand-in for every picture and cell, at its size, loading nothing; `art/placeholders/` equals the generator's output | unit | same |
| `art:accept`: single picture to WebP within budget; opaque refused; sheet cut into its cells; any-size sheet cut by grid with a note; empty cell refused by name; painted cell refused; edge-touch warned; solo cell fitted; a layer's clear sky required; a wrong-shape full picture cropped, never enlarged; over budget refused; unknown id or non-image refused | unit, real sharp (12 cases) | `accept.test.ts` |
| The board renders: 11 cards, 18 cells, 5 groups, no broken stand-in, no sideways scroll | manual, built page on 127.0.0.1 | the review |
| The published board's store starts empty | manual (`ArtifactData list art`) | the review |
| **One real picture end to end** | manual, Mark | **not done**: the Phase 0 gate |