diff --git a/.agents/FEATURES.md b/.agents/FEATURES.md index 511c848..3dc8f08 100644 --- a/.agents/FEATURES.md +++ b/.agents/FEATURES.md @@ -8,3 +8,4 @@ One row per feature, with its analysis document (CLAUDE.md §5.1). Gaps live in | Workspace, contracts, gates, PWA shell | 0 | Merged to `main` 2026-11-01 (`d11d242`); built, not deployed. Phase 0 gate still open | [phase0-workspace.md](features/phase0-workspace.md) | [feature-phase0-workspace.md](reviews/feature-phase0-workspace.md) | | Roadmap and gameplay docs, read against the code | 0 | Merged 2026-11-01; Q1–Q7 answered by the author | — | [docs-roadmap-gameplay.md](reviews/docs-roadmap-gameplay.md) | | The Letter slot: page at `#letter`, empty `docs/LETTER.md` | 0 | Merged to `main`; built, not deployed. Invisible until the author writes | [letter-slot.md](features/letter-slot.md) | [feature-letter-slot.md](reviews/feature-letter-slot.md) | +| The art pipeline and the art board: STYLE.md draft, Phase 1 manifest, stand-ins, `tools/art-prep`, the published board | 0 | Merged to `main`; board published (private). The app is unchanged. Gate waits on the first real picture | [art-pipeline.md](features/art-pipeline.md) | [feature-art-board.md](reviews/feature-art-board.md) | diff --git a/.agents/GAP_ANALYSIS.md b/.agents/GAP_ANALYSIS.md index fae9d69..a8446fe 100644 --- a/.agents/GAP_ANALYSIS.md +++ b/.agents/GAP_ANALYSIS.md @@ -12,7 +12,8 @@ workspace part of Phase 0 is in ## Phase 0 — Foundations **Gate open.** The workspace is merged (G0.1–G0.9). Still missing for the gate: the -60 sentences (G0.18) and one illustration through the pipeline (G0.24). +60 sentences (G0.18) and one illustration through the pipeline (G0.24): the pipeline and the +board exist, and the first real picture is the author's to make. | Id | Gap | Status / evidence | |:--|:--|:--| @@ -39,7 +40,7 @@ workspace part of Phase 0 is in | G0.21 | No PNG icons | Open (predicted trap). iOS ignores SVG for `apple-touch-icon`. Comes through the art pipeline. | | G0.22 | No CI | Open. Every gate ran on this machine only. With G0.13. | | G0.23 | Source maps are built and would be published | Open. `sourcemap: true`; maps are not precached. Decide with G0.13 whether the repository is public. If not, use `'hidden'`. | -| G0.24 | No art pipeline: `docs/ART.md`, `art/STYLE.md` (drafted with the author), `art/manifest.json` for Phase 1 assets, SVG placeholders, `tools/art-prep` | Open. **Phase 0 gate**: one illustration goes through prompt, paste, automatic checks, review and the author's approval into `art/final/`. | +| G0.24 | No art pipeline: `docs/ART.md`, `art/STYLE.md` (drafted with the author), `art/manifest.json` for Phase 1 assets, SVG placeholders, `tools/art-prep` | **Pipeline built 2026-11-01** (`feature/art-board`): docs/ART.md, the Phase 1 manifest (25 pictures), 29 generated stand-ins, `tools/art-prep` (50 tests; 5 of 5 put-back bugs caught), the art board published. **Still open:** STYLE.md is Claude's draft waiting for the author (S1–S5), and the **Phase 0 gate**, one real picture through every step into `art/final/`. | | ~~G0.25~~ | ~~No slot for *A Letter from the Gardener*~~ | Closed 2026-11-01, merged to `main`. `docs/LETTER.md` holds slots as comments only; the page opens at `#letter` once it has words. 16 ui tests, and e2e on both the empty and a temporary written letter. Mutations caught: the link while empty, any link scheme, focus not moving, *heal* in the letter. | | G0.27 | The quiet door to real help has no numbers (§5.6 rule 5) | Open. The slot is in `docs/LETTER.md`. Support lines are real-world facts the author must verify, per country, so the door exists only once the letter does. | | ~~G0.26~~ | ~~Not decided: how the sunset invitation reaches the player on the web~~ | Closed 2026-11-01 by the author (Q6): in-app only on the web, no push server; local notifications through the Tauri shell in Phase 6. Recorded in ROADMAP Phase 0 and CLAUDE.md §8. | diff --git a/.agents/features/art-pipeline.md b/.agents/features/art-pipeline.md new file mode 100644 index 0000000..6f155b6 --- /dev/null +++ b/.agents/features/art-pipeline.md @@ -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
findForbidden"] + schema["packages/schema
PRODUCT_NAME"] + prep["tools/art-prep
manifest.ts · prompt.ts · placeholders.ts
board.ts · accept.ts"] + placeholders["art/placeholders/*.svg"] + dist["tools/art-prep/dist/board/
index.html · board-data.json · placeholders/"] + board["Art board
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;
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 | diff --git a/.agents/lessons/README.md b/.agents/lessons/README.md index 3ca0961..e5764cd 100644 --- a/.agents/lessons/README.md +++ b/.agents/lessons/README.md @@ -9,9 +9,9 @@ and **how to apply it**. | `soul.md` | none yet | What comforts and what only looks like comfort. **The most important file here.** No mechanic exists yet that could teach anything. | | `architecture.md` | none yet | Layering, ownership, seams. | | `design.md` | none yet | Wording, silence, empty states. | -| `art.md` | none yet | The image pipeline. | +| [`art.md`](art.md) | 2 | The image pipeline. | | [`code.md`](code.md) | 2 | TypeScript, Svelte, async ordering, Rust. | -| [`technical.md`](technical.md) | 4 | The browser and the build as platforms. | +| [`technical.md`](technical.md) | 5 | The browser and the build as platforms. | | [`testing.md`](testing.md) | 4 | What makes a test worth having, and how a passing test lies. | | `privacy.md` | none yet | What could leave the device or make a person findable. (The geocell finding is in the review, not here: it was caught before it cost anything.) | | [`process.md`](process.md) | 2 | Workflow, commits, credentials, honesty about what shipped. | diff --git a/.agents/lessons/art.md b/.agents/lessons/art.md new file mode 100644 index 0000000..592ca3a --- /dev/null +++ b/.agents/lessons/art.md @@ -0,0 +1,34 @@ +# Art + +What the image pipeline taught (CLAUDE.md §5.1b). + +## "Never enlarge" also skips the crop + +**What happened.** `art:accept` first resized a full-background picture with sharp's +`fit: 'cover'` and `withoutEnlargement: true`. A 900 × 600 picture accepted as the +1024 × 1024 app icon came out 900 × 600. Because it was smaller than the target, sharp +skipped the whole resize, crop included, and a rectangle would have become the icon. The +test *a full-background picture of the wrong shape is cropped from the middle* caught +it before the first real picture existed (`tools/art-prep/src/accept.ts`, `middle()`). + +**Why it bit.** One option can switch off two jobs: changing the shape and changing the +size. "Don't blow it up" was meant for the size only. + +**How to apply it.** Crop to the target shape first, as its own step, then only ever +shrink. Test the small, wrongly shaped input as well as the large one: a generator that +ignores the requested size is the normal case, not the edge case. + +## A check on prompt words catches what review would miss + +**What happened.** The first `pnpm art:board` refused its own manifest: the waiting +rose's cell said she was "quiet and *patient*", and `patient` is on the forbidden list +(§5.6 rule 3). The manifest checker runs `findForbidden` from `@rosea/content` over +every word a prompt is built from. + +**Why it bit.** Prompts are not player-facing, so `lint:copy` never reads them. But a +prompt that names the book, or a word that drifts in from it, is exactly how a +likeness gets into the art (§8, *copyright through the back door*). + +**How to apply it.** Any text that is assembled into something sent outside, a prompt +included, goes through the same forbidden list as player copy. Reword: *waiting with +patience* is allowed. diff --git a/.agents/lessons/technical.md b/.agents/lessons/technical.md index b63310c..492feb8 100644 --- a/.agents/lessons/technical.md +++ b/.agents/lessons/technical.md @@ -55,3 +55,18 @@ fresh. This is CLAUDE.md §5.4 again, caused by the build tool and not the servi **How to apply it.** Any file the app bundles from outside its package goes into `globalDependencies` or the task's `inputs`, in the same commit as the import. To check, change the file, run the build, and look for `cache miss`. + +## A preview on a busy port shows someone else's app + +**What happened.** The art board's local preview was given port 5180. Ludus's dev +server already listened on `localhost:5180`, so the preview pane opened **Ludus**, +whose page text appeared under the board's tab. Port 5191 was busy too. The board +rendered only on 5237, after `netstat` confirmed the port was free. + +**Why it bit.** A server that fails to bind, or binds 127.0.0.1 while another app holds +`localhost`, does not always stop loudly, and the browser simply shows whatever is +listening. This machine runs many projects. + +**How to apply it.** Before starting a preview, check that the port is free +(`netstat -ano | grep :`). After it starts, check the page title before you trust +anything the page says. diff --git a/.agents/reviews/feature-art-board.md b/.agents/reviews/feature-art-board.md new file mode 100644 index 0000000..fd14d23 --- /dev/null +++ b/.agents/reviews/feature-art-board.md @@ -0,0 +1,73 @@ +# Review — `feature/art-board` + +Adversarial self-review (CLAUDE.md §5.3). Analysis: +[`features/art-pipeline.md`](../features/art-pipeline.md). Reviewed 2026-11-01 on Node 22.11.0, +Windows 10. There is no PR: the only remote is Gitea, and this session cannot open one there. + +## Gates — counts, not exit codes + +| Gate | Result | +|:--|:--| +| `pnpm lint` | exit 0 | +| `pnpm typecheck` | exit 0, now including `@rosea/art-prep`; `svelte-check` 0 errors, 0 warnings | +| `pnpm test` | **180 passed**: schema 15, content 47, **art-prep 50 (new)**, engine 52, ui 16 | +| `pnpm lint:copy` | 12 files, 0 problems (the board and prompts are not player copy; A3 covers prompts) | +| `pnpm validate:library` | 0 entries; 13 of 13 fixtures rejected | +| `pnpm test:e2e` | 7 passed | +| `pnpm test:offline` | 1 passed | +| `pnpm art:board` | 11 cards, 25 pictures, 29 stand-ins | + +**The app is unchanged** (§5.4). No app file changed, so the bundle is the same; e2e and offline +ran to show that. **The board is published**, as a private claude.ai artifact (version 1). +Its `art` collection was read back once and is empty, as it should be. + +**The board, rendered once** from `tools/art-prep/dist/board/` on 127.0.0.1: +*Rosea Domi Art Board*, 11 cards, 18 cell slots, groups *Character sheet · 1*, +*Sprite sheets · 4*, *Garden layers · 4*, *Single pictures · 1*, *App icon · 1*. No stand-in +failed to load and nothing overflowed sideways. Served locally, the page has no claude.ai +runtime, so it showed its read-only state. Upload and Accept were **not** exercised (see +*not verified*). + +## Test honesty — bugs put back + +| Bug put back | Result | +|:--|:--| +| The forbidden-word check skipped for asset texts | CAUGHT: 3 failed (book name, medical word, forbidden name never reaches the board) | +| The shared avoid list dropped from single-picture prompts | CAUGHT: *every one carries the shared avoid list* | +| `art:accept` stops refusing a sheet with an empty cell | CAUGHT: *refuses the whole sheet when a cell is empty* | +| The board page loses its *Garden layers* group | CAUGHT: *every kind in the manifest has a group on the board page* | +| A committed stand-in drifts from the generator | CAUGHT: *art/placeholders/ holds exactly what the generator makes* | +| `fit: cover` with `withoutEnlargement` (the first draft) | CAUGHT, as the real finding 1 | + +## Findings + +| # | Area | Finding | Resolution | +|:--|:--|:--|:--| +| 1 | **Correctness** | `art:accept` resized full pictures with `cover` + `withoutEnlargement`. A small, wrongly shaped picture skipped the crop too: a 900 × 600 picture accepted as the square app icon stayed 900 × 600. | **Fixed**: crop to shape first (`middle()`), then only shrink. Test asserts 600 × 600. Lesson: `art.md`. | +| 2 | **Copyright** | The manifest's own text said the waiting rose is *patient*, a forbidden word, and nothing would have caught a book name in a prompt either, because `lint:copy` does not read prompts. | **Fixed by design**: `checkManifest` runs `findForbidden` over every prompt word, and `art:board` refused its own first draft. Lesson: `art.md`. | +| 3 | **Copyright** | No automatic likeness check: a generated picture that looks like the book's drawings is caught only by Claude's review and Mark's eye. | **Accepted for Phase 0**, written down in docs/ART.md §5. The prompts' shared avoid list (A4) lowers the odds, and review point 3 names it. | +| 4 | **Soul** | The rose's moods are where guilt can enter art: a thirsty or waiting rose drawn as hurt blames the player (§8). | **Addressed in the prompts**: *tired, not hurt*, *gently comic, never ill*, *quiet, waiting with patience, never sad, hurt or blaming*. Review point 7. The real pictures still need looking at, which is Mark's and Claude's job on the board. | +| 5 | **Privacy** | The board stores pictures on claude.ai. | **Accepted**: only generated art and Mark's notes. The app never contacts the board, and art reaches the app only through git. Nothing about a player exists there. | +| 6 | Process | The roadmap and CLAUDE.md planned `tools/art-prep` as a 127.0.0.1 page. The board replaces it at Mark's request. | **Recorded**: ROADMAP Phase 0 *Decided 2026-11-01*, CLAUDE.md §2, §3 and §9, docs/ART.md §3. | +| 7 | Correctness | STYLE.md is Claude's draft. The roadmap says *drafted with Mark*. Every prompt on the board inherits the draft. | **Open**: S1–S5 in STYLE.md §0 wait for Mark. The first card, `rose-sheet`, is the test. If it looks wrong, STYLE.md changes, `art:board` rebuilds and the board is republished. | +| 8 | Correctness | The board's local preview first showed **Ludus**: ports 5180 and 5191 were taken on this machine. | **Fixed** for the preview (port 5237, checked free). It affected only this review's look at the page, not the board. Lesson: `technical.md`. | +| 9 | Scope | The garden layers assume a horizon at 40 % and a bed at 72 %. Phase 1's screen design may want other numbers. | **Accepted**: the numbers are in the manifest, so changing them costs a rebuild and new pictures, which is the reason to decide before Mark makes the layers. Noted for the Phase 1 feature doc. | +| 10 | Offline | The board needs the network; the game doesn't. | **Not applicable to the player**: the board is a tool. `art/final/` ships inside the precached bundle (Phase 1). | +| 11 | Test honesty | `cli-board.ts` and `cli-accept.ts` (file writing, argument parsing) have no tests. `art:board` was run, and `art:accept` was not run on a real file. | **Accepted**: the logic under them is tested. `art:accept` runs for real with the first accepted picture, the Phase 0 gate. | + +Looked for and found none: + +- **Reachability.** No player is involved. +- **Correctness cases from §5.3.** Clock, DST, two tabs and partial writes do not apply to the + tool. On the board, a second tab is handled by the store's live snapshot, as in Panda Domi's. + +## What was NOT verified + +- **Uploading, pasting and accepting on the published board.** These need Mark signed in. The + page code is Panda Domi's, which works there, adapted only in tokens, groups, wording and the + review line. +- **Any real generated picture.** Every `art:accept` test uses synthetic pictures made with sharp. +- **The style itself.** Whether the gouache direction reads as Rosea and not as the book can only be + judged on real pictures. +- **Dark mode and phone width of the published board** were not looked at. The local check was one + desktop render. diff --git a/CLAUDE.md b/CLAUDE.md index 01fa340..bfa789d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -115,8 +115,8 @@ feed of anything. ## 2. Repository layout -Phase 0 scaffolded `schema`, `engine`, `content`, `ui` and `apps/rosea`. `storage`, `identity`, -`sync`, `services/lucerna`, `tools/art-prep` and `art/` arrive with their first feature, because an +Phase 0 scaffolded `schema`, `engine`, `content`, `ui`, `apps/rosea`, `tools/art-prep` and `art/`. +`storage`, `identity`, `sync` and `services/lucerna` arrive with their first feature, because an empty package has a test suite that runs nothing ([`phase0-workspace.md`](.agents/features/phase0-workspace.md) D1). ``` @@ -154,7 +154,9 @@ art/ final/ # approved, optimised illustrations (WebP/AVIF) tools/ - art-prep/ # the art preparation page (docs/ART.md §3). Local only, 127.0.0.1. + art-prep/ # prompts, stand-ins and the art board's files from art/manifest.json; + # the accept step into art/final/ (docs/ART.md). The board itself is a + # private claude.ai page (decided 2026-11-01, docs/ART.md §3). content/ library/ # hope sentences, one file per source tradition @@ -176,7 +178,7 @@ apps/rosea ──► packages/ui ──► packages/engine ──► packages/sc ├───────► packages/sync ──► packages/schema └───────► packages/identity ──► packages/schema services/lucerna ──► packages/schema (trace shape only, via generated JSON Schema) -tools/art-prep ──► art/manifest.json (never imported by the app) +tools/art-prep ──► art/manifest.json, packages/content, packages/schema (never imported by the app) ``` - `packages/engine` is pure. Time and randomness are parameters. This is what makes growth, taming and @@ -217,9 +219,10 @@ pnpm test:e2e # builds, then Playwright against the B pnpm test:offline # builds, loads once, CLOSES the server, reloads pnpm validate:library # every hope sentence; fixtures must FAIL pnpm lint:copy # forbidden words and names (§5.6) +pnpm art:board # prompts + stand-ins -> tools/art-prep/dist/board/ (docs/ART.md) +pnpm art:accept # an accepted picture -> art/final/*.webp, sheets cut # Not yet — they arrive with their first feature: -pnpm art:prep # opens tools/art-prep on 127.0.0.1 cargo test --manifest-path services/lucerna/Cargo.toml # Phase 4 onward ``` @@ -514,7 +517,7 @@ No timestamp finer than a day, no precise location, no free text, no link to the |:--|:--| | Understand why something behaves strangely | `.agents/lessons/` — `soul.md` first | | Know what is planned and which gate we are at | `docs/ROADMAP.md` | -| Make or replace an illustration | `docs/ART.md`, then `pnpm art:prep` | +| Make or replace an illustration | `docs/ART.md`, then `art/manifest.json` and `pnpm art:board` | | Change how the rose grows | `packages/engine/src/growth/` | | Change how the fox comes closer | `packages/engine/src/taming/` | | Change the sunset or sunrise | `packages/engine/src/sun/` — read the polar and DST traps first | diff --git a/HANDOVER.md b/HANDOVER.md index 3dff9cf..eb954bc 100644 --- a/HANDOVER.md +++ b/HANDOVER.md @@ -12,8 +12,8 @@ Rewritten at the end of each session (CLAUDE.md §5.1). Gitea hashes match. Analysis: [`.agents/features/phase0-workspace.md`](.agents/features/phase0-workspace.md). Review, with counts and the mutation results: [`.agents/reviews/feature-phase0-workspace.md`](.agents/reviews/feature-phase0-workspace.md). -- **Gates:** all pass on this machine. Unit tests: 117 (schema 15, content 47, - engine 52, ui 3). E2E: 6. Offline: 1. `lint:copy`: 9 files, 0 problems. +- **Gates:** all pass on this machine. Unit tests: 180 (schema 15, content 47, + art-prep 50, engine 52, ui 16). E2E: 7. Offline: 1. `lint:copy`: 12 files, 0 problems. `validate:library`: 13 of 13 fixtures rejected. - **Built, not deployed:** there is no host yet. - **Roadmap and gameplay docs:** `docs/ROADMAP.md` and `docs/GAMEPLAY.md` are on @@ -25,10 +25,18 @@ Rewritten at the end of each session (CLAUDE.md §5.1). holds slots as comments only. Once the author writes in it, a link to the letter appears in the garden, and the page opens at `#letter`, offline too. Review: [`.agents/reviews/feature-letter-slot.md`](.agents/reviews/feature-letter-slot.md). +- **The art pipeline and the art board:** merged to `main`. [`docs/ART.md`](docs/ART.md) is the + pipeline. [`art/STYLE.md`](art/STYLE.md) is a draft for the author. [`art/manifest.json`](art/manifest.json) + lists 25 Phase 1 pictures, with 29 stand-ins in `art/placeholders/`. `tools/art-prep` builds + prompts and the board (`pnpm art:board`) and moves accepted pictures into `art/final/` + (`pnpm art:accept`). The board is published, private: + https://claude.ai/artifact/Y3xM4F5WGv77Qp2UdMXWix. To update it, run `pnpm art:board`, then + republish `tools/art-prep/dist/board/` to that URL. Review: + [`.agents/reviews/feature-art-board.md`](.agents/reviews/feature-art-board.md). **Phase 0 is not finished.** The roadmap's Phase 0 is more than the workspace. Its gate needs 60 verified sentences (G0.18) and one illustration through the art -pipeline (G0.24). Also open: a GitHub remote (G0.13). The Letter slot is built (G0.25). +pipeline (G0.24). The pipeline and the board are built; the first real picture is not made yet. Also open: a GitHub remote (G0.13). The Letter slot is built (G0.25). The notification decision is made: in-app only on the web (G0.26). **Waiting on the author.** @@ -37,7 +45,11 @@ The notification decision is made: in-app only on the web (G0.26). door to real help (G0.27), and Q9 (may the letter name the book). 2. **Sentences:** an agent may propose public-domain candidates with their sources. Only the author can mark one verified. -3. **`docs/ART.md` and `art/STYLE.md`**, which are needed before the art pipeline. +3. **Art:** read `art/STYLE.md` §0 (S1–S5) and approve or change the style. Then make + `rose-sheet` on the board and accept it. That is the first step of the Phase 0 art gate. + After an accept, Claude reads the row (`ArtifactData get art/`), downloads the picture + (`Artifact read` with the asset id as `path`), runs `pnpm art:accept`, commits on `art/`, + and writes `final` back into the row. 4. **A GitHub repository** for Pages, and whether it is public (G0.13, G0.23). 5. **Upgrading Node** to ≥ 22.13 on this machine (G0.20). diff --git a/docs/ART.md b/docs/ART.md new file mode 100644 index 0000000..4edd0ec --- /dev/null +++ b/docs/ART.md @@ -0,0 +1,123 @@ +# ART.md — how every picture is made + +Every illustration in Rosea Domi goes through this pipeline. A picture that skipped a step is +not shipped, however good it looks (CLAUDE.md §7). + +- **What the pictures look like:** [`art/STYLE.md`](../art/STYLE.md). It is a draft until Mark + approves it. +- **Which pictures exist:** [`art/manifest.json`](../art/manifest.json), Phase 1 first. +- **The tools:** [`tools/art-prep/`](../tools/art-prep/). It turns those two files into prompts, + stand-ins and the board, and moves accepted pictures into `art/final/`. +- **The board:** a private claude.ai page, *Rosea Domi Art Board*. It is published from + `tools/art-prep/dist/board/`, and Mark works there. + +--- + +## 1. The steps + +```mermaid +flowchart LR + style["art/STYLE.md
§1 system prompt, §7 review points"] + manifest["art/manifest.json
every picture"] + prep["tools/art-prep
pnpm art:board"] + board["Art board
(claude.ai, private)"] + gen["Mark's image generator"] + final["art/final/*.webp"] + app["apps/rosea
(Phase 1 onward)"] + style --> prep + manifest --> prep + prep -- "prompts, stand-ins" --> board + board -- "copy prompt" --> gen + gen -- "paste picture" --> board + board -- "accepted: Claude runs pnpm art:accept" --> final + final -- "git" --> app +``` + +1. **Prompt.** `pnpm art:board` builds every prompt from STYLE.md §1 and the manifest. A + prompt is never typed by hand, so the rose is described the same way every time. Claude + then republishes the board. +2. **Make.** Mark copies a prompt into his image generator. He starts with `rose-sheet`, the + character sheet, because every rose prompt asks for it as the reference picture. +3. **Paste.** Mark pastes or drops the result onto its card. The board measures it at once: + its shape, whether the background is transparent, and for a sprite sheet whether each cell + holds its own drawing and stays clear of the cut lines. +4. **Claude's review.** Claude reads the uploaded picture and checks it against STYLE.md §7 + and §8: likeness to the book, soul, and painted words. Claude writes the review into the + card's row, and it shows on the card as *Claude's review*. +5. **Mark's approval.** *Accept* or *Another try*, with an optional note. The note goes into + the next prompt for that picture. +6. **Into the game.** Claude downloads the accepted picture from the board, runs + `pnpm art:accept `, and commits the WebP files on an `art/` branch. + `art:accept` cuts sprite sheets apart, checks again and keeps each file within budget + (§4). Claude then writes `final` into the row, and the card says *In art/final/*. + +**The Phase 0 gate** is one picture all the way through these six steps (ROADMAP.md, Phase 0). +The board starts with `rose-sheet`. The first picture the app will actually show is the app +icon. + +## 2. The manifest + +`art/manifest.json` says what is wanted, never whether it is done. Progress lives on the board. +Each picture has an id, a kind, the size it is made at, its background, where it is used, and +the words its prompt is built from. `tools/art-prep` refuses a manifest with any of these: + +- an id that repeats, or that isn't lower-case words joined by hyphens +- a size image generators don't offer +- a grid that doesn't match its cells, or doesn't divide the sheet into whole pixels +- a character without a sheet +- a sprite or layer on a full background +- a review point that STYLE.md §7 doesn't have +- **any forbidden word or name** from `@rosea/content`, the same list `lint:copy` uses. A prompt + that names the book's title, its author or anything in Tolkien never reaches a generator. + +## 3. The board + +The board is the Panda Domi art board, adapted for Rosea. Its source is +`tools/art-prep/board/index.html`. `pnpm art:board` fills in the product name from +`@rosea/schema` and writes the page, `board-data.json` and the stand-ins to +`tools/art-prep/dist/board/`, which is git-ignored. + +- **Stand-ins** are Claude's SVG placeholders from `tools/art-prep/src/placeholders.ts`. They + are committed under `art/placeholders/`, and a test fails if they drift from the manifest. +- **The board's store** (claude.ai artifact storage) holds one row per picture: the uploaded + image's id, its measurements, the status, Mark's note, Claude's review and `final`. Only + editors of the board can write. +- **All at once:** every picture still to make can go out as one long prompt. Files dropped + together are matched to pictures by their names. + +### Decided 2026-11-01: a claude.ai board, not a page on 127.0.0.1 + +The roadmap first planned `tools/art-prep` as a page served on 127.0.0.1. Mark asked instead +for the board Panda Domi already uses. It works from any device, it keeps the pictures between +sessions, and Claude can read it. `tools/art-prep` stays: it builds the board's files and runs +the accept step. + +**Privacy.** Only generated art and Mark's notes go to the board. No player data, ever: the +app never talks to the board, and pictures reach the app only through git (`art/final/`). The +board is private to Mark unless he shares it. + +## 4. The budget per final picture + +Every final picture is precached, so a player downloads all of them once. `art:accept` +encodes WebP at quality 82, then 72, then 62, and refuses a picture that is still over its +budget. + +| Kind | Budget | Why | +|:--|:--|:--| +| Garden layer (1024 × 1536) | 350 KB | Four layers: about 1.4 MB, the largest share of the bundle | +| Character sheet | 400 KB | A reference only. It is kept in `art/final/` but never shipped | +| Single picture, sprite-sheet cell | 120 KB | Small things over the garden | +| App icon | 120 KB | Phase 1 also makes the PNG sizes the web manifest needs from it | + +`art:accept` never makes a picture bigger. A picture smaller than its size is kept at its own +size, and the step says so. + +## 5. What is not here yet + +- **The app does not show any final picture yet.** Phase 1 builds the rose's screen and swaps + the stand-ins for `art/final/` files. The app icon (`apps/rosea/public/icon.svg`) is still a + stand-in. +- **A likeness check by machine.** Likeness to the book is judged by Claude's review and + Mark's eye (STYLE.md §8). No automatic comparison exists. +- **Fox, planets and berries.** These are Phase 2. Their pictures join the manifest with the + Phase 2 feature docs. diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index a513222..06adb9b 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -70,6 +70,8 @@ start. - The first **60 sentences** of the library, each sourced and verified public domain. - **Art**: `art/STYLE.md` drafted with Mark, `art/manifest.json` for Phase 1 assets, Claude's SVG placeholders, and the **art preparation page** (`tools/art-prep`) working end to end on one asset. + *Decided 2026-11-01:* the art preparation page is a private claude.ai art board, like Panda Domi's; + `tools/art-prep` builds its files and moves accepted pictures into `art/final/` (`docs/ART.md` §3). - A slot for *A Letter from the Gardener* — the author writes it; agents only scaffold the page. - **Decision recorded:** how the sunset invitation reaches the player on the web (see the notification trap in `CLAUDE.md` §8). *Decided 2026-11-01:* on the web the invitation lives inside the app only —