diff --git a/.agents/FEATURES.md b/.agents/FEATURES.md
index 037f7a0..cf2e974 100644
--- a/.agents/FEATURES.md
+++ b/.agents/FEATURES.md
@@ -20,4 +20,5 @@ One row per feature, with its analysis document (CLAUDE.md §5.1). Gaps live in
| The rose: care by feel, growth from days of care, drift, moods, her numbers; the care log and the identity | 1 | Merged to `main`; built, not deployed. Tuning is the author's | [rose.md](features/rose.md) | [feature-rose-care.md](reviews/feature-rose-care.md) |
| Where the sunset is: choose a town (or skip to a guess from the device's zone), kept on the device; tonight's sunset in the garden | 1 | Merged to `main`; built, not deployed | [sunset-place.md](features/sunset-place.md) | [feature-sunset-place.md](reviews/feature-sunset-place.md) |
| The sun: real sunrise, sunset and solar noon on the device; polar day and night | 1 | Merged to `main`; engine only, the app does not show it yet | [sun.md](features/sun.md) | [feature-sun.md](reviews/feature-sun.md) |
+| Her planet and the gardener: a round tiny planet, a boy or girl chosen at the first open, the ring of care by a tap on her, care by gesture (tilt the can, swipe weeds up, sweep petals, drag the windbreak, stroke her); every gesture also a button | 1 | Merged to `main`; built, not deployed. Code stand-ins; the painted art waits on the board | [planet-garden.md](features/planet-garden.md) | [feature-planet-garden.md](reviews/feature-planet-garden.md) |
| The art pipeline and the art board: STYLE.md (S1–S5 and the fox's F1–F4 approved), the manifest (Phase 1–3, 53 pictures), 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), [art-phase2-3-pictures.md](reviews/art-phase2-3-pictures.md) |
diff --git a/.agents/GAP_ANALYSIS.md b/.agents/GAP_ANALYSIS.md
index 726d488..dbf137b 100644
--- a/.agents/GAP_ANALYSIS.md
+++ b/.agents/GAP_ANALYSIS.md
@@ -49,7 +49,7 @@ board exist, and the first real picture is the author's to make.
## Phase 1 — The rose alone
**Started 2026-11-01** with the sun, while the Phase 0 gate waits on the author (pictures,
-sentences). Nothing in Phase 1 is visible to the player yet.
+sentences). Phase 1 is built in code, not deployed (no host yet, G0.13).
| Id | Gap | Status / evidence |
|:--|:--|:--|
@@ -61,6 +61,7 @@ sentences). Nothing in Phase 1 is visible to the player yet.
| ~~G1.7~~ | ~~Thorns were on the roadmap but undesigned~~ | Closed 2026-11-02 on `feature/thorns`, as the author chose: thorns teach gentleness. `engine/touch` (2 properties: spaced taps are never a rush; one blush a visit); a tremor is one touch; nothing recorded. 6 of 6 put-back bugs caught. |
| ~~G1.8~~ | ~~Two tabs (CLAUDE.md §8, predicted)~~ | Closed 2026-11-07 on `fix/two-tabs`. Measured first: two e2e tests failed (an open tab saw neither care nor a town from the other). Storage announces committed writes on a `BroadcastChannel`; the rose and the garden read again, adding to what they show. No lock needed: nothing stored drifts. 7 of 7 put-back bugs caught. |
| ~~G1.10~~ | ~~The garden named only the sunset, never the sunrise (ROADMAP Phase 1: *sunset and sunrise*)~~ | Closed 2026-11-17 on `feature/sunrise`: from sunset until it comes, the line names the real sunrise; the in-game sunset still names the sunset. engine `nextSunEvent` with a 300-run property; e2e at 05:00 in Brno; seen on a real Android tablet. 5 of 5 put-back bugs caught. |
+| ~~G1.9~~ | ~~The garden was a page of buttons, not a game (the author, 2026-11-17)~~ | Closed 2026-11-17 on `feature/planet-garden`: her round planet, a gardener the player chooses at the first open (fixed lists, kept in `profile`, never in the rose file), the ring of care by a tap on her, care by gesture with a button for each. 84 ui tests incl. 7 on the planet and 7 on gestures; e2e `planet.spec.ts` 3; 9 of 9 put-back bugs caught (2 only after tests were added); 7 of 7 by real touch on the Android tablet. **Open in it:** painted art for the planet and the gardener, and how customised looks are drawn (STYLE.md §3b, the author's). |
| G1.3 | Towns have no Czech names (*Vídeň*) | Open. Natural Earth has none; arrives with Czech copy. |
## The platform track — four versions (from 2026-11-17)
@@ -83,6 +84,12 @@ Svelte codebase, the apps through a Tauri 2 shell. Analysis:
| G-T8 | Webview storage eviction | Partly measured: `persist()` is `false` in WebView2 and Android WebView. Pressure eviction of app storage not measured. G-T4 is the answer either way. |
| G-T9 | The app icon is the placeholder | Open. With G0.21. |
+## Phase 6 — Release
+
+| Id | Gap | Status / evidence |
+|:--|:--|:--|
+| G6.1 | A legal check of the look: a child on a small round planet with a rose is the book's best-known image, and its estate holds trademarks | Open, **before any public release**. The author accepted the risk on 2026-11-17 (CLAUDE.md §8); the guards are STYLE.md S2, S6, §3b and review points 10–11. |
+
## Design questions — answered
Raised by GAMEPLAY.md and ROADMAP.md, answered by the author 2026-11-01. Details in
diff --git a/.agents/features/planet-garden.md b/.agents/features/planet-garden.md
new file mode 100644
index 0000000..d229b94
--- /dev/null
+++ b/.agents/features/planet-garden.md
@@ -0,0 +1,121 @@
+# The planet garden — a gardener, gestures, and her own small world
+
+Status: built on `feature/planet-garden`, merged to `main` 2026-11-17; built, not deployed. Decided by the author, Mark, on 2026-11-17, after
+seeing the garden as a page of buttons: *"It is a game: create a proper planet, a character who does
+the care, animations of how the character does it; tap the rose for actions; swipe in patterns;
+pull weeds by tapping them and swiping."* His answers the same day:
+
+- **Her world:** a **round tiny planet** (reverses STYLE.md S2).
+- **The character:** a **human gardener, a boy or a girl, customised at the beginning** (reverses
+ STYLE.md's *no people*).
+- **Gestures:** tap her to choose care; swipe weeds out; pour by tilting; patterns for the rest
+ (sweep petals, drag the windbreak, stroke her petals). **Buttons stay** for keyboard and screen
+ readers (CLAUDE.md §7: accessibility is not a phase).
+
+Review: `feature-planet-garden.md`.
+
+## 0. The risk the author accepted, and the guards
+
+A child tending a rose on a small round planet is the most recognisable image of the book whose
+text, names and drawings CLAUDE.md §5.6 rule 3 forbids, and whose estate holds trademarks
+(GAMEPLAY.md §7). The author was told this in the choice itself and chose it. Recorded here, in
+STYLE.md and CLAUDE.md, with these guards, which become review points and avoid lines:
+
+| Guard | Why |
+|:--|:--|
+| **The gardener is the player's own**: chosen and customised (boy or girl, skin tone, hair style and colour, clothes colour, a hat or not) | No two players' gardeners need look alike, and none is a fixed character from anywhere. |
+| **Never**: a scarf, a long coat or cape, a green suit with epaulettes, a crown, a sword; no outfit option recreates one | The book's boy is drawn with these. |
+| **The planet is a cultivated garden world**: meadow, the dry-stone wall, the garden bed, the chair, the wild berry bush; **no volcanoes, no baobab-like trees, no single lamp post** | The book's planet is bare with volcanoes and baobabs. |
+| **The look is our gouache** (STYLE.md §1), never pen-and-wash | The book's drawings are pen and watercolour. |
+| **No glass dome over her, ever; the windbreak is woven willow** | Unchanged (§4). |
+| **A legal check of the look before any public release** (store listings, Pages made public) | New gap; the author's risk, made visible. |
+
+## 1. Why and what, in the player's terms
+
+**The first open.** Before the garden, one quiet question: *Who tends her?* The player chooses a
+boy or a girl, then skin tone, hair, clothes colour, a hat. A small preview of their gardener turns
+as they choose. *This is me* finishes it. It can be changed later, from the garden.
+
+**The garden is a small round world.** Her planet fills the lower half of the screen, the real sky
+above it (code, as now). On its top: the garden bed with the rose, the wall behind, the chair, the
+watering can by the bed; the gardener stands beside her.
+
+**Tap the rose** and the care she needs right now opens around her as a small ring of choices (only
+what she needs; *Touch her* is always there). Choose one and the gardener walks over and does it,
+with the player's own hand in the gesture:
+
+| Care | The gesture | The gardener |
+|:--|:--|:--|
+| **Water** | **Press the can and tilt**: drag sideways from it; the further the tilt, the faster the pour. Let go when her leaves lift (the same *by feel* as now). | Holds the can, tilting it as the player tilts; water falls. |
+| **Weeds** | Weeds show in the bed. **Tap a weed, then swipe up** from it: it stretches, then pops out with its roots. | Bends, tugs, the weed comes free, the gardener bumps down on the grass and gets up. |
+| **Fallen petals** | **Sweep**: one swipe sideways across the petals gathers them. | Sweeps them into a little pile and pockets them. |
+| **Wind** | **Drag the windbreak** from the side of the bed into the wind, on her windward side. | Carries it and sets it in the ground. |
+| **Touch her** | **Stroke** slowly across her petals: a fond answer. Quick, rushed taps: *Gently. I have thorns.* (thorns.md) | Reaches out and touches a petal. |
+
+Every act is the same event as today (rose.md, thorns.md): nothing about growth, drift, the petal or
+her numbers changes. The gestures are how the player's hand meets the same rules.
+
+**Keyboard and screen readers.** The ring's choices are buttons; each one also works without its
+gesture: *Water* still pours while Space or Enter is held; *Pull the weeds* pulls them all, one by
+one, while the gardener does it; *Gather the petals*, *Shade her*, *Touch her* likewise. The scene
+says what happens in one polite line.
+
+**Reduced motion.** The gardener does not walk or bend: the scene shows the result at once.
+
+## 2. Technical architecture
+
+```mermaid
+flowchart LR
+ app["apps/rosea App.svelte"] --> shell["packages/ui Shell: first-open choice, then the scene"]
+ shell --> scene["packages/ui/scene Planet.svelte (SVG): planet, bed, rose, can, weeds, petals, windbreak, gardener"]
+ scene --> gestures["packages/ui/scene/gestures.ts pure: tilt, swipe up, sweep, drag, stroke"]
+ scene --> engine["packages/engine rose (care, pour), touch (thorns), scene/ weedsToday, petalsToday (seeded counts)"]
+ shell --> storage["packages/storage profile: gardener (shape-checked)"]
+```
+
+| # | Decision | Why |
+|:--|:--|:--|
+| G1 | **One SVG scene** (`Planet.svelte`), every part its own group with a stand-in drawn in code until art is accepted; the sky stays code (S5). | One coordinate system for gestures, animation and layout; no canvas, so every part can carry an accessible name. |
+| G2 | **Gesture recognisers are pure functions** of pointer samples (`gestures.ts`): `tiltOf`, `isSwipeUp`, `isSweep`, `dropTarget`, `strokeOf`. Unit- and property-tested. | Input interpretation is not game logic, but it must be testable without a browser. The rules stay in the engine. |
+| G3 | **How many weeds and petals** a day shows is the engine's: `weedsToday(seed, day)` (2–4 when `weedsOn`), `petalsToday(seed, day)` (3–5 when `petalsOn`). One `weed` / `petals` care event when the **last** one is pulled or gathered. | A count on screen is the engine's (CLAUDE.md §6.2). Half-pulled weeds are not care yet: nothing is written until the job is done, and leaving half-way loses nothing earned. |
+| G4 | **Pour by tilt** maps tilt to the same pour rate the hold uses (`ROSE.fullPour` over `FULL_CAN_MS`), scaled 0–1.5× by tilt; the event's `amount` is unchanged in meaning. | Watering by feel (rose.md R1) stays one rule. |
+| G5 | **The gardener** is a separate component with poses (`stand`, `walk`, `pour`, `bend`, `pull`, `sweep`, `carry`, `reach`, `sit`) and a look from the player's choice. Poses are SVG stand-ins now; real art replaces them sheet by sheet. | Art and animation can arrive later without touching gestures or rules. |
+| G6 | **The gardener's look is stored in `profile`** as `{ presentation: 'boy' \| 'girl', skin, hair, hairColour, clothes, hat }`, each from a fixed list; shape-checked like every stored value. Never sent anywhere. | No free text; nothing identifying; local only (CLAUDE.md §4). |
+| G7 | **The ring** opens on a tap of the rose; it holds only her current needs plus *Touch her*; Escape or a tap outside closes it; focus moves into it and back. | Silence and calm: no permanent row of buttons over her. |
+
+## 3. Risk analysis
+
+| Risk | Answer |
+|:--|:--|
+| **Likeness to the book** (the author's accepted risk) | §0's guards, as avoid lines in every prompt, review points, and a legal check before release. |
+| **Soul: a child avatar for adult players** | The author chose boy or girl. Recorded as a question for his two-week play: does an adult player see themselves in a child gardener? A grown-up option is one list entry away. |
+| **Soul: fiddly gestures that make care feel like failing** | Generous thresholds; every gesture has a button; a missed gesture does nothing and says nothing; nothing is lost. |
+| **Motion** | `prefers-reduced-motion`: no walking or bending; results at once. |
+| **Accessibility** | Buttons for every act (G7); one polite line says what the gardener did; keyboard focus never trapped. |
+| Privacy | The gardener's look stays in `profile`, on the device; it is not in the rose file (keep-her-safe.md K4 is unchanged). |
+| Offline | Everything is code and bundled stand-ins. |
+
+## 4. Gap analysis
+
+- New: **G1.9** the planet garden (this); **G6.x** a legal check of the look before any public release.
+- STYLE.md: S2 (where she lives) and *no people* are reversed by the author; §3b *the gardener* is
+ new; §4 and §7 gain the guards; the manifest gains the planet, the gardener's sheet and pose
+ sheets, and the customisation parts.
+- Not in this feature: the gardener on the journey's other planets (Phase 2), the fox on her planet.
+
+## 5. Verification matrix
+
+| Case | Kind | Where |
+|:--|:--|:--|
+| `tiltOf`: sideways drag → 0–1 tilt; `isSwipeUp` needs upward distance and direction; `isSweep` needs sideways distance across the petals; `strokeOf` tells a slow stroke from a tap | unit + property | `ui/test/gestures.test.ts` |
+| `weedsToday` / `petalsToday`: 0 on a day without, 2–4 / 3–5 with, the same on every replay | unit + property | `engine/test/scene.test.ts` |
+| Gardener look: every option list is fixed; storage refuses anything else; it never enters the rose file | unit | `storage/test` |
+| First open asks *Who tends her?*; the choice is kept; *Change gardener* reopens it | unit | `ui/test/gardener.test.ts` |
+| Tap the rose: the ring shows only her needs plus *Touch her*; Escape closes it and focus returns | unit | `ui/test/planet.test.ts` |
+| Pulling every weed writes one `weed` event; leaving half-way writes none | unit | same |
+| A sweep across the petals writes one `petals` event; dragging the windbreak onto the windward side writes `shade` | unit | same |
+| Pour by tilt writes one `water` event whose amount follows the tilt and time | unit | same |
+| Buttons do every act without a gesture | unit | same |
+| Reduced motion: no animation classes | unit | same |
+| Built app: first-open choice, tap the rose, pull weeds by swiping, axe | e2e | `e2e/planet.spec.ts` |
+| The real tablet: the same by real touch | device | `scripts/android-smoke.ts` (made permanent here) |
diff --git a/.agents/lessons/README.md b/.agents/lessons/README.md
index fc17bea..9754858 100644
--- a/.agents/lessons/README.md
+++ b/.agents/lessons/README.md
@@ -10,9 +10,9 @@ and **how to apply it**.
| `architecture.md` | none yet | Layering, ownership, seams. |
| [`design.md`](design.md) | 1 | Wording, silence, empty states. |
| [`art.md`](art.md) | 3 | The image pipeline. |
-| [`code.md`](code.md) | 3 | TypeScript, Svelte, async ordering, Rust. |
+| [`code.md`](code.md) | 4 | TypeScript, Svelte, async ordering, Rust. |
| [`technical.md`](technical.md) | 9 | The browser and the build as platforms. |
-| [`testing.md`](testing.md) | 13 | What makes a test worth having, and how a passing test lies. |
+| [`testing.md`](testing.md) | 15 | 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) | 4 | Workflow, commits, credentials, honesty about what shipped. |
diff --git a/.agents/lessons/code.md b/.agents/lessons/code.md
index 4040a83..d6782e0 100644
--- a/.agents/lessons/code.md
+++ b/.agents/lessons/code.md
@@ -50,3 +50,16 @@ hands out Proxies wherever state is deep.
**How to apply it.** At every storage or messaging boundary, write a plain copy built
field by field (in `@rosea/storage`, the same shape check used on reading). Keep lists
that are only passed along as `$state.raw`. Test the boundary with `new Proxy(value, {})`.
+
+## `svelte/motion` reads `matchMedia` when it is imported
+
+**What happened.** On 2026-11-17 the gardener's walk used `Tween` from `svelte/motion`. Every UI
+test file failed at import: jsdom has no `window.matchMedia`, and the module reads it at load (for
+its reduced-motion store), not when a tween runs.
+
+**Why it bit.** An import with side effects breaks every file that imports it, even transitively,
+and the error points at the module, not at the component that needed it.
+
+**How to apply it.** In `packages/ui`, animate with a small `setInterval` easing inside an
+`$effect` (`packages/ui/src/scene/Planet.svelte`), reading reduced motion once through a guarded
+`matchMedia` call. If `svelte/motion` is wanted later, stub `matchMedia` in the test setup first.
diff --git a/.agents/lessons/testing.md b/.agents/lessons/testing.md
index be22088..9777a65 100644
--- a/.agents/lessons/testing.md
+++ b/.agents/lessons/testing.md
@@ -184,3 +184,31 @@ failures; retrying nothing makes the check a coin toss.
**How to apply it.** Retry only the failure that names the link (`offline`, `closed`, `no devices`),
after `adb wait-for-device`, a bounded number of times; find the device handle again after a drop;
let every other failure end the check at once. Report how many runs failed and why.
+
+## jsdom has no `PointerEvent`, so a test pointer carries no coordinates
+
+**What happened.** On 2026-11-17 the planet garden's gesture tests fired `pointerDown` and
+`pointerMove` with `clientX`/`clientY`, and every gesture read as a tap at (0, 0). jsdom has no
+`PointerEvent`; testing-library falls back to a plain `Event`, which drops the coordinates.
+
+**Why it bit.** The test looked like a finger and measured nothing. A missing browser API in the
+test environment does not fail loudly; it quietly hands the code a poorer event.
+
+**How to apply it.** Before testing pointer gestures in jsdom, polyfill `PointerEvent` on
+`MouseEvent` (`packages/ui/test/planet.test.ts`) and assert one coordinate-dependent outcome first
+(a sideways swipe does *not* pull a weed). Check real fingers on the device (`pnpm test:android`).
+
+## A device test's clean-up must cover its very first step
+
+**What happened.** On 2026-11-17 `scripts/android-smoke.ts` connected to Chrome on the tablet
+*before* its `try`. Chrome was still cold-starting, the connect failed with *socket hang up*, and
+the `finally` that stops Chrome and removes the adb mappings never ran: Chrome stayed open on a
+device the author asked to leave as it was found. It was stopped by hand.
+
+**Why it bit.** Clean-up written for the failures you expect (a step fails) misses the one that
+happens first (the setup fails). On a shared device, a leftover is somebody else's problem.
+
+**How to apply it.** Open the `try` before the first command that changes the device; make the
+clean-up tolerate half-done setup (`page?.close()`, `browser?.close()`); retry connections that
+race a cold start (the script tries for 30 s). After every device run, check: `pidof` the app is
+empty, `reverse --list` and `forward --list` are empty.
diff --git a/.agents/reviews/feature-planet-garden.md b/.agents/reviews/feature-planet-garden.md
new file mode 100644
index 0000000..2d34c2c
--- /dev/null
+++ b/.agents/reviews/feature-planet-garden.md
@@ -0,0 +1,68 @@
+# Review — `feature/planet-garden`
+
+Adversarial self-review (CLAUDE.md §5.3). Analysis: [`features/planet-garden.md`](../features/planet-garden.md).
+Reviewed 2026-11-17 on Node 22.23.4, Windows 10. There is no PR: the only remote is Gitea.
+
+## What the author decided, and what was built
+
+Mark, on 2026-11-17: *a game, with a proper planet, a character who does the care with animations,
+taps on the rose and swiped patterns; weeds tapped and swiped out.* He chose a **round tiny planet**,
+a **human gardener, a boy or a girl, customised at the beginning**, and **all four gesture sets**.
+
+- The first open asks **Who tends her?**: boy or girl, skin tone, hair style and colour, clothes
+ colour, a hat, with a live preview; kept on the device (`profile.gardener`, a JSON Schema of
+ fixed lists). *Change gardener* reopens it.
+- The garden is **her planet** (SVG): the real sky's light (engine `lightAt`), the meadow world, her
+ bed, the wall, the chair, the watering can, the day's weeds and fallen petals (engine
+ `weedsToday`, `petalsToday`), the windbreak on a windy hour, and **the gardener**, who walks round
+ the world to the work and takes a pose for it (stand-ins until art).
+- **Tap her** (or Enter on her) opens **the ring** of what she needs, plus *Touch her* and *Close*;
+ Escape closes it, focus returns to her. **Press the can and tilt** to pour (the tilt sets the
+ rate); **swipe each weed up**; **sweep across the petals**; **drag the windbreak** to her
+ windward side; **stroke her petals** slowly. Every gesture has its button in the ring.
+- The art board gains the gardener's sheet and eight poses, and her home planet in three lights;
+ STYLE.md records S2 (reversed) and S6 with their guards and review points 10–11.
+
+Also on this branch: the tap-highlight fix (seen on the real tablet) and `pnpm test:android`.
+
+## Bug drills
+
+| Put back | Result |
+|:--|:--|
+| A sideways swipe pulls a weed | **MISSED at first**, then CAUGHT: the "sideways" tests were also too short, so the distance rule hid the direction rule; a long diagonal test added |
+| Every pulled weed is written as care, not only the last | CAUGHT |
+| The sweep need not cover every petal | CAUGHT |
+| The windbreak counts wherever it is dropped | CAUGHT |
+| Tilt is ignored (pours at the steady rate) | CAUGHT |
+| A stroke opens the ring instead of touching her | CAUGHT |
+| The gardener question is not shown at the first open | CAUGHT: 2 |
+| The gardener's look accepts any value | CAUGHT: 2 |
+| Reduced motion still walks | **MISSED at first**, then CAUGHT: the test checked a CSS class, not where the gardener stands; it now reads his angle straight after an act |
+
+The first rerun of the reduced-motion drill reported CAUGHT against a test that was failing on its own (it looked before the garden loaded); fixed, then every drill was run again against a green suite.
+
+## Findings
+
+| # | Area | Finding | Resolution |
+|:--|:--|:--|:--|
+| 1 | Likeness / legal | A child tending a rose on a small round planet is the book's most recognisable image. | The author's decision, made knowingly. Guards: the gardener is the player's own, in work clothes; nothing to choose recreates the book's boy (tested on the option lists); the planet is a cultivated garden; review points 10–11; **G6.1: a legal check of the look before any public release.** |
+| 2 | Soul | A child gardener for players who are mostly grown-ups. | Recorded as a question for the author's two-week play; a grown-up option is one list entry away (`gardener.schema.json`). |
+| 3 | Soul | Gestures can feel like failing. | Generous thresholds; a missed gesture does nothing and says nothing; every act also has a button. |
+| 4 | Accessibility | Gestures are not keyboard or screen-reader operable. | The ring's buttons do every act; the rose target is a focusable `role=button` with `aria-expanded`; one polite line says what the gardener did; axe passes on the choice, the scene and the ring (e2e). |
+| 5 | Motion | Walking and swaying. | `prefers-reduced-motion`: the gardener is placed at once (tested); the global rule shortens the rest. |
+| 6 | Two tabs | A gardener changed in one tab is not shown in another until reload (storage announces `gardener`, the UI does not listen yet). | Deferred: harmless (nothing is lost) and rare; noted for the next touch of the Shell. |
+| 7 | Correctness | Half the weeds pulled, then the tab closed: nothing written, the weeds come back. | By design (G3): care is the finished job; nothing earned is lost. |
+| 8 | Testing | jsdom has no `PointerEvent`: test pointers carried no coordinates, and `svelte/motion` read `matchMedia` at import, failing every file. | A `PointerEvent` polyfill in the planet tests; the walk is a small interval instead of `Tween`. Lessons in `testing.md` and `code.md`. |
+| 9 | Process | The first look in the browser was the **old** garden: the preview's service worker served the cached build, as a player's would until *Refresh*. | Cleared for the check; it is exactly what calm-refresh exists for. |
+| 10 | Design | The first stand-in had a shading arc that read as a smile on the planet. | Removed after looking. |
+| 11 | Art | Painted art cannot simply be recoloured for every skin tone, hair and clothes choice the way the code stand-in is. | The board makes the first look; **how the other looks are drawn is open for the author** (STYLE.md §3b). |
+| 12 | Testing | The first tablet run failed to connect while Chrome cold-started, and the connect sat **before** the `try`: Chrome was left running on the tablet. | Stopped by hand at once; the script now opens `try` before the first adb command, retries the connect for 30 s and tolerates half-done setup. Lesson in `testing.md`. |
+| — | Privacy | The gardener's look stays in `profile`; it is not in the rose file (tested); nothing is sent. | — |
+
+## Gates and devices
+
+Counts are on the merge (HANDOVER). The tablet (WAVE 10C, 2026-11-17): `pnpm test:android` **7 of 7**
+by real touch: the gardener question (a boy, a cap), the town, the ring opened by a tap on her and
+closed, pouring by tilting the can, a stroke across her petals, and offline with the server
+unreachable. Afterwards Chrome was stopped (`pidof` empty) and both adb mappings removed. **Not verified:** a screen reader; Safari; a phone smaller
+than the tablet; weeds and petals by real touch on the device (their days depend on the key).
diff --git a/CLAUDE.md b/CLAUDE.md
index 1d616d6..33e4d5f 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -59,6 +59,12 @@ encouraging, never ruling), never a name or a quote.
Neglect makes her **drift** — turn away, close a little — never break. Short visits hold her; real
time — calendar days on which care helped, never minutes on screen — brings full bloom. One tap
shows her real numbers (water, warmth, days of care, trend).
+- **Her planet and the gardener** *(decided by the author, 2026-11-17)* — she lives on a round tiny
+ planet of her own, cultivated as a garden, and **a gardener the player chooses** (a boy or a girl,
+ dressed at the first open) does the care, animated. The player cares by hand: tap her to open the
+ ring of care, tilt the can to pour, swipe weeds out, sweep petals, drag the windbreak, stroke her
+ petals; every gesture also has a button. The guards against the book's likeness are in
+ `art/STYLE.md` S2, S6, §3b and `.agents/features/planet-garden.md` §0.
- **The planets** — a journey through lonely grown-ups (the king, the vain man, the businessman, the
lamplighter, the geographer…). Each planet lets the player feel one shape of loneliness.
- **The fox** — follows at a distance from the first planet and comes closer through touch (pet,
@@ -590,6 +596,7 @@ No timestamp finer than a day, no precise location, no free text, no link to the
| **Location makes people findable** | Coarse cells next to a sparse population identify a house. Cell size must adapt to density, traces must be delayed and auto-deleted, and stranger contact is consent-only (§5.6). |
| **The library as a scam channel** | If any field lets a sender attach free text, a lonely recipient can be manipulated. The id-only contract (§6.1) is the defence. |
| **Copyright through the back door** | An image prompt "in the style of" the book's drawings, a fox or rose that looks like the original, or a famous line "paraphrased" too closely. All forbidden (§5.6); the art pipeline checks likeness (`docs/ART.md`). |
+| **A child on a small round planet with a rose** *(a risk the author accepted, 2026-11-17)* | It is the book's most recognisable image, and its estate holds trademarks. The author chose it knowingly. Keep every guard (STYLE.md S2, S6, §3b, review points 10–11: the gardener is the player's own, in work clothes, never a scarf, coat, cape, suit or crown; the planet is a cultivated garden, never volcanoes, baobabs or a lone lamp post), and **a legal check of the look comes before any public release** (G6.1). |
| **Medical claims in a store listing** | One word like *heal* in marketing copy can pull the product toward medical-device rules. `lint:copy` also runs on store text kept in the repo. |
| **IndexedDB is evictable** *(predicted; answered by `keep-her-safe.md`)* | WebKit can discard origin storage after seven days without interaction — exactly the shape of a player who drifted away and comes back. Call `navigator.storage.persist()` where it exists, prompt iOS players to install, and make export-my-rose a first-class feature. A player returning to find their rose gone is the cruellest bug this product could have. |
| **The stale service worker** *(answered by `calm-refresh.md`)* | A precached shell keeps serving old JS to a player who has "updated". Detect a waiting worker and offer an explicit, calm *refresh* control. |
diff --git a/HANDOVER.md b/HANDOVER.md
index 040d790..54ae8a5 100644
--- a/HANDOVER.md
+++ b/HANDOVER.md
@@ -2,7 +2,7 @@
Rewritten at the end of each session (CLAUDE.md §5.1).
-## Last session — 2026-10-31 to 2026-11-01
+## Last session — 2026-10-31 to 2026-11-17
**Done.**
@@ -12,8 +12,9 @@ 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: 489 (cpu-guard 13, identity 5, schema 19,
- content 88, storage 65, art-prep 61, engine 174, ui 64). E2E: 22. Offline: 1. `lint:copy`: 21 files, 0 problems.
+- **Gates (2026-11-17, the planet garden merged with the Tauri shells):** all pass on this machine.
+ Unit tests: 561 (cpu-guard 13, identity 5, schema 19, content 88, storage 70, art-prep 63, tauri 40,
+ engine 179, ui 84). E2E: 26. Offline: 1. Tablet (`pnpm test:android`): 7. `lint:copy`: 26 files, 0 problems.
`validate:library`: 13 of 13 fixtures rejected; 78 candidates pass.
- **Built, not deployed:** there is no host yet.
- **Roadmap and gameplay docs:** `docs/ROADMAP.md` and `docs/GAMEPLAY.md` are on
@@ -113,6 +114,19 @@ Rewritten at the end of each session (CLAUDE.md §5.1).
still on 127.0.0.1), driven through Chrome's DevTools socket: first open, the town, watering by a
real held touch, the in-game sunset, and **offline** reloads with the server unreachable all pass.
When device testing ends, the app used is stopped at once (the author's rule).
+- **Her planet and the gardener (2026-11-17, G1.9):** merged to `main`, as the author decided after
+ seeing a page of buttons. She lives on a round tiny planet; at the first open *Who tends her?* lets
+ the player dress a boy or a girl (fixed lists, kept in `profile`, never in the rose file; *Change
+ gardener* reopens it). A tap on her opens the ring of what she needs today plus *Touch her*; the
+ gardener walks round the planet to the work. By hand: press the can and move sideways to tilt and
+ pour (further tilts pour faster), swipe each weed up and out, sweep across the fallen petals, drag
+ the windbreak to her windward side, stroke her petals slowly. Every gesture is also a button.
+ The pictures are code stand-ins until the board's are painted. **Accepted risk:** a child on a
+ small round planet with a rose is the book's best-known image; the guards are in STYLE.md (S2, S6,
+ §3b, review points 10–11), and a legal check comes before any public release (G6.1). Tested by
+ real touch on the Android tablet (`pnpm test:android`, 7 of 7). Analysis:
+ [`.agents/features/planet-garden.md`](.agents/features/planet-garden.md). Review:
+ [`.agents/reviews/feature-planet-garden.md`](.agents/reviews/feature-planet-garden.md).
- **Four versions, one garden (2026-11-17):** merged to `main`, as the author decided: the PWA plus
an Android, iOS and desktop app from one codebase through a Tauri 2 shell, `apps/rosea-tauri`
(CLAUDE.md §2 *Four versions*, §3, §4, §8; ROADMAP *The platform track*). The **Windows app**
@@ -148,9 +162,13 @@ The notification decision is made: in-app only on the web (G0.26).
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. **Node is upgraded** (22.23.4); unpinning the dependencies pinned for 22.11 remains (G0.20).
-6. **The rose's tuning** (`.agents/features/rose.md` R2, R4, R5, R6, all in `ROSE` in
+4. **The gardener in paint:** the board asks for the first look (a girl, braids, sage, a straw hat).
+ Painted art cannot be recoloured for every skin, hair and clothes choice the way the stand-in is:
+ layered parts, a few painted looks, or tints? (STYLE.md §3b). Also: a gardener changed in one tab
+ shows in another only after a reload (the rose's care does update live).
+5. **A GitHub repository** for Pages, and whether it is public (G0.13, G0.23).
+6. **Node is upgraded** (22.23.4); unpinning the dependencies pinned for 22.11 remains (G0.20).
+7. **The rose's tuning** (`.agents/features/rose.md` R2, R4, R5, R6, all in `ROSE` in
`packages/engine/src/rose/rose.ts`): how fast she gets thirsty, how often weeds, petals and wind
come, and how many days of care each stage takes (full bloom after 25). Play it for a week,
then say what feels wrong.
@@ -169,6 +187,9 @@ The notification decision is made: in-app only on the web (G0.26).
download: ask first). The cause is unknown.
- **The Android tablet:** WAVE 10C on USB debugging; always `adb -s WAVE10CEEA036785` (an emulator
attaches too, and other projects use the same tablet). Stop the app used when testing ends.
+ `pnpm test:android` with `ROSEA_ADB=F:\Tools\Android\Sdk\platform-tools\adb.exe` and
+ `ROSEA_ANDROID_SERIAL=WAVE10CEEA036785`, while `vite preview` serves the build on 127.0.0.1:4173;
+ it stops Chrome and removes its mappings itself, even when it fails.
Its USB link drops now and then (`device offline`); `e2e/apps/check-garden.ts` waits and retries.
- **Building the apps:** Rust 1.99 (MSVC) with the four Android targets, JDK 17, the Android SDK at
`F:\Tools\Android\Sdk` (NDK 27.1), VS 2022 Build Tools, WebView2 and NSIS are all installed; a
diff --git a/apps/rosea/src/App.svelte b/apps/rosea/src/App.svelte
index 03c1f3e..ee17a8c 100644
--- a/apps/rosea/src/App.svelte
+++ b/apps/rosea/src/App.svelte
@@ -106,6 +106,8 @@
sentences,
loadOpened: () => storage.loadOpened(),
appendOpened: (event) => storage.appendOpened(event),
+ // The player's gardener, chosen at the first open (planet-garden.md G6).
+ gardener: { load: () => storage.loadGardener(), save: (look) => storage.saveGardener(look) },
// Another tab gave care, opened a petal or brought her back (two-tabs.md).
changes: (listener) => storage.onChange((what) => what === 'log' && listener()),
clientVersion: version,
diff --git a/art/STYLE.md b/art/STYLE.md
index 980446f..0c1ecb6 100644
--- a/art/STYLE.md
+++ b/art/STYLE.md
@@ -21,6 +21,14 @@ A picture that is off-style goes back for another try. It is never shipped.
> the petals, and §6 makes prompts short enough for a generator to follow. The book's motifs
> are no longer named in prompts (naming them invites them); they stay in §4 and §7, where the
> review catches them. The picture list grew to every picture Phases 1–5 need (§4).
+>
+> **Changed by Mark, 2026-11-17: her world is a round tiny planet, and a gardener tends her.**
+> Seeing the garden as a page of buttons, he asked for a game: a planet, a character who does the
+> care with animations, gestures. He chose a **round tiny planet** (S2 below, reversed) and a
+> **human gardener, a boy or a girl, chosen and dressed by the player** (S6, new), knowing that
+> a child tending a rose on a small round planet is close to the book's most recognisable image.
+> The guards that keep them our own are in §3b, §4 and review points 10–11, and a legal check of
+> the look comes before any public release (`.agents/features/planet-garden.md` §0).
---
@@ -29,7 +37,8 @@ A picture that is off-style goes back for another try. It is never shipped.
| # | Choice | Decided | Why |
|:--|:--|:--|:--|
| S1 | The medium | Matte gouache on warm paper, with soft brush outlines | It is gentle and hand-made like the rest of Domi. It is also clearly not the book's look, which is a thin pen line with loose, pale watercolour. |
-| S2 | Where the rose lives | A small garden bed on a hillside meadow, with a low dry-stone wall and a wide sky to the west | The sunset is real, so the scene needs a real horizon. It is an ordinary garden, never a tiny planet. |
+| S2 | Where the rose lives | ~~A small garden bed on a hillside meadow~~ **A round tiny planet of her own, cultivated as a garden**: meadow over it, her bed on top, a low dry-stone wall, the chair, the wild bush. *Reversed by Mark 2026-11-17.* | He wants a world of her own, as a game has. It stays a garden, never a bare rock: no volcanoes, no baobab-like trees, no single lamp post (§4). The real sky is still code behind it (S5); the in-game sunset keeps the hillside garden for its wide horizon. |
+| S6 | Who tends her | **A human gardener: a boy or a girl, chosen and dressed by the player** at the first open (skin tone, hair and its colour, clothes colour, a hat). *Decided by Mark 2026-11-17.* | The care is done by a character, with animations. The gardener is the player's own, so no two need look alike; simple work clothes and an apron, never a scarf, a long coat or cape, a green suit, a crown or a sword (§3b). |
| S3 | The rose's face | A face in the middle of the bloom: two small eyes, often half-closed, a tiny mouth and a blush | This is the description in CLAUDE.md §1, drawn as written. |
| S4 | The palette | §2 | It starts from the app's tokens (`--rose #b4485e`, `--paper #fbf6f1`). |
| S5 | The sky | Drawn in code, never painted | The sun moves at the player's real time, and the stars are the real constellations. A painted sky could do neither. |
@@ -59,7 +68,8 @@ A picture that is off-style goes back for another try. It is never shipped.
> book for adults: understated, never sugary, never a children's sticker or a cute mascot.
> Characters are alive but small-featured: their faces are a few tiny marks painted directly on
> them, with eyes as small dark dots or crescents, often half-closed. No text, letters or numbers
-> anywhere. No people, hands or human faces. Not watercolour: no wet washes, bleeding edges, blooms or
+> anywhere. No people, hands or human faces, except the player's gardener where the picture names
+> them. Not watercolour: no wet washes, bleeding edges, blooms or
> pale tints. Not digital: no 3D rendering, gloss, airbrush gradients or lens effects. An
> original design, in the manner of no existing artist, book or film.
@@ -129,6 +139,26 @@ The rose is the only character in Phase 1. Every rose picture follows the charac
---
+## 3b. The gardener (S6, decided by Mark 2026-11-17)
+
+The player's own gardener: a boy or a girl of about ten, chosen and dressed at the first open.
+Every gardener picture follows `gardener-sheet`.
+
+- **Simple work clothes:** a plain short-sleeved shirt (the boy, with trousers) or tunic (the girl,
+ with bare legs), a cream canvas apron with one pocket, small sturdy boots. Hands small and simple.
+- **A face like the others':** a few tiny painted marks, eyes often half-closed, calm and kind.
+- **The choices the player makes** (skin tone, hair style and colour, clothes colour, straw hat,
+ cap or none) are the app's (`gardener.schema.json`). The board paints **the first look** (the girl:
+ braids, brown hair, sage clothes, straw hat; and the boy, short hair, the same colours) so the
+ character can be judged. **How the other looks are drawn** (separate layers for hair and hat, or
+ clothes painted to be tinted in code) **is still open** and waits for Mark: it decides how many
+ pictures the gardener needs.
+- **Never:** a scarf, a long coat or cape, a suit with epaulettes, a crown, a sword, golden curls
+ with a green outfit, or anything that recreates the book's boy. He or she is a gardener at work.
+- **Size:** standing, a little taller than the rose.
+
+---
+
## 3a. The fox (Phase 2: F1–F2)
The fox is the second character. Every fox picture follows the character sheet `fox-sheet`.
@@ -188,7 +218,11 @@ The fox is the second character. Every fox picture follows the character sheet `
sunset wave are pictures.
- **The share frame (Phase 5):** a border of meadow round an empty middle where the player's
sky is drawn.
-- No flags, religious symbols, buildings, vehicles or people.
+- **Her home planet (S2, reversed 2026-11-17):** a small round world seen whole, covered in meadow,
+ with her round garden bed on top, a low dry-stone wall curving behind it, the wooden chair on its
+ shoulder and a few meadow flowers. Everything outside the planet is transparent: the sky is code.
+ **Never** volcanoes, baobab-like trees or a lone lamp post on it: it is a garden, not a rock.
+- No flags, religious symbols, buildings or vehicles. No people except the player's gardener.
---
@@ -255,6 +289,10 @@ tick them: *Accept* is one tap.
8. It reads as one young red-orange fox with a cream mask and a ringed tail, shy and gentle, and
nothing like the book's sandy, long-eared fox.
9. He matches `fox-sheet`: the same mask, ears, leg colour, tail rings and size.
+10. The gardener is a child at garden work, matching `gardener-sheet`: plain shirt or tunic, an
+ apron, boots; no scarf, long coat, cape, suit, crown or sword, and nothing like the book's boy.
+11. Her planet is a cultivated garden world: meadow, her bed, the wall, the chair; no volcanoes,
+ no baobab-like trees, no lone lamp post, and not the look of the book's little planet.
---
diff --git a/art/manifest.json b/art/manifest.json
index 172de5a..3a93c5a 100644
--- a/art/manifest.json
+++ b/art/manifest.json
@@ -8,6 +8,10 @@
"fox": {
"sheet": "fox-sheet",
"description": "The fox: a small, young fox; sitting, he is about as tall as the rose. A deep red-orange coat (#BC4A22), warm and glowing, never neon. A cream mask (#F3E3C8) on his face: cream cheeks and muzzle and a small cream spot above each eye. Deep brown legs and paws (#5A3A33). Rounded ears of middle size, cream inside with dark tips. A big bushy tail with three faint darker rings and a cream tip. Small dark eyes, often half-closed, a tiny dark nose and mouth. A fox's pointed muzzle and a fox's body: the mask and the tail rings are only a nod to a red panda. Shy, curious and gentle, never sly."
+ },
+ "gardener": {
+ "sheet": "gardener-sheet",
+ "description": "The gardener: the player's own, a child of about ten at garden work, a little taller than the rose. The first look: a girl with brown hair in two braids, a wide straw hat, a plain sage-green short-sleeved tunic, a cream canvas apron with one pocket, bare legs and small sturdy brown boots; or a boy with short brown hair, the same straw hat, a plain sage-green shirt and trousers, the same apron and boots. A face of a few tiny painted marks: small dark eyes, often half-closed, a short calm mouth. Kind, absorbed in the work, never posing."
}
},
"avoid": [
@@ -675,6 +679,217 @@
6
]
},
+ {
+ "phase": 1,
+ "shipped": false,
+ "character": "gardener",
+ "allow": [
+ "people, hands or human faces"
+ ],
+ "checks": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 10
+ ],
+ "id": "gardener-sheet",
+ "type": "sheet",
+ "width": 1536,
+ "height": 1024,
+ "background": "full",
+ "smallest": null,
+ "usedBy": [
+ "The reference for every gardener picture (STYLE.md §3b). Make it right after rose-sheet."
+ ],
+ "purpose": "Reference sheet that fixes the gardener's first look, the girl and the boy; never shown in the app.",
+ "subject": "The gardener, as described below, painted eight times: the top row the girl (front view; three-quarter view facing left; side view facing left; back view), the bottom row the boy in the same four views.",
+ "setting": "Isolated on plain warm off-white paper (#FBF6F1), no scenery, no ground.",
+ "composition": "Eight full figures in two rows of four, evenly spaced, all at the same scale, nothing overlapping.",
+ "include": [
+ "identical proportions, clothes and apron in every view",
+ "the same tiny painted face in every view that shows it"
+ ],
+ "avoid": [
+ "a pose that looks posed for a photograph",
+ "any tool or prop in their hands"
+ ]
+ },
+ {
+ "phase": 1,
+ "shipped": true,
+ "character": "gardener",
+ "allow": [
+ "people, hands or human faces"
+ ],
+ "checks": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 10
+ ],
+ "id": "gardener-poses-sheet",
+ "type": "spritesheet",
+ "width": 1536,
+ "height": 1024,
+ "background": "transparent",
+ "smallest": 120,
+ "usedBy": [
+ "The gardener at work on her planet (planet-garden.md G5): each pose is shown while the care it belongs to happens."
+ ],
+ "purpose": "The gardener's poses for each act of care, the girl in the first look.",
+ "angle": "The whole girl gardener in every cell, in side view facing right unless the cell says otherwise, at the same scale as gardener-sheet, the same light from the left.",
+ "grid": {
+ "cols": 4,
+ "rows": 2
+ },
+ "cells": [
+ {
+ "id": "gardener-stand",
+ "does": "standing beside something just out of the picture, hands at the sides, looking at it fondly."
+ },
+ {
+ "id": "gardener-walk",
+ "does": "walking to the right, mid-step, arms swinging a little."
+ },
+ {
+ "id": "gardener-pour",
+ "does": "holding a small round sage-green watering can in both hands, tipping it forward to the right, a thin stream of water falling."
+ },
+ {
+ "id": "gardener-pull",
+ "does": "crouched, both hands round something low on the ground just out of the picture, leaning back to pull."
+ },
+ {
+ "id": "gardener-sweep",
+ "does": "bending a little, sweeping one hand across the grass to the right, gathering."
+ },
+ {
+ "id": "gardener-carry",
+ "does": "carrying a small curved woven willow hurdle upright in front of them with both arms."
+ },
+ {
+ "id": "gardener-reach",
+ "does": "reaching one hand out gently to the right and up, as if to touch a petal, fingers soft."
+ },
+ {
+ "id": "gardener-sit",
+ "does": "sitting on nothing (the chair is its own picture), in three-quarter view facing left towards a sunset outside the picture, hands in the lap."
+ }
+ ],
+ "include": [
+ "the same gardener as gardener-sheet in every cell"
+ ],
+ "avoid": [
+ "ground or grass under them",
+ "the rose or any plant in the picture"
+ ]
+ },
+ {
+ "id": "home-planet-day",
+ "type": "layer",
+ "phase": 1,
+ "width": 1024,
+ "height": 1024,
+ "background": "transparent",
+ "shipped": true,
+ "smallest": null,
+ "usedBy": [
+ "Her home planet in the garden scene (planet-garden.md), chosen by the real sun's light (engine lightAt)."
+ ],
+ "purpose": "Her own small round world, seen whole, with everything around it transparent for the real sky behind.",
+ "subject": "No characters. A small round planet seen whole from the side, cultivated as a garden: soft meadow grass all over it with a few small meadow flowers, warm earth showing at its underside, on its top a round garden bed of warm umber soil (empty: the rose is her own picture), a low curving dry-stone wall behind the bed, a small weathered wooden chair with a pale pink cushion on its right shoulder.",
+ "setting": "The same planet in soft bright daylight from high on the left, fresh greens.",
+ "composition": "Square. The planet centred, about 70 % of the width across; its top, with the empty bed, a little above the middle. Everything outside the planet fully transparent.",
+ "include": [
+ "a fully transparent sky",
+ "an empty garden bed on top, centred"
+ ],
+ "avoid": [
+ "a painted sky, sun, moon or stars",
+ "a rose or any large flower in the bed",
+ "people or animals"
+ ],
+ "checks": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 11
+ ]
+ },
+ {
+ "id": "home-planet-golden",
+ "type": "layer",
+ "phase": 1,
+ "width": 1024,
+ "height": 1024,
+ "background": "transparent",
+ "shipped": true,
+ "smallest": null,
+ "usedBy": [
+ "Her home planet in the garden scene (planet-garden.md), chosen by the real sun's light (engine lightAt)."
+ ],
+ "purpose": "Her own small round world, seen whole, with everything around it transparent for the real sky behind.",
+ "subject": "No characters. A small round planet seen whole from the side, cultivated as a garden: soft meadow grass all over it with a few small meadow flowers, warm earth showing at its underside, on its top a round garden bed of warm umber soil (empty: the rose is her own picture), a low curving dry-stone wall behind the bed, a small weathered wooden chair with a pale pink cushion on its right shoulder.",
+ "setting": "The same planet in low evening light from the left: amber gold (#F2B860) and coral (#E9846A) on the wall and grass, long soft shadows to the right.",
+ "composition": "Square. The planet centred, about 70 % of the width across; its top, with the empty bed, a little above the middle. Everything outside the planet fully transparent.",
+ "include": [
+ "a fully transparent sky",
+ "an empty garden bed on top, centred"
+ ],
+ "avoid": [
+ "a painted sky, sun, moon or stars",
+ "a rose or any large flower in the bed",
+ "people or animals"
+ ],
+ "checks": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 11
+ ]
+ },
+ {
+ "id": "home-planet-night",
+ "type": "layer",
+ "phase": 1,
+ "width": 1024,
+ "height": 1024,
+ "background": "transparent",
+ "shipped": true,
+ "smallest": null,
+ "usedBy": [
+ "Her home planet in the garden scene (planet-garden.md), chosen by the real sun's light (engine lightAt)."
+ ],
+ "purpose": "Her own small round world, seen whole, with everything around it transparent for the real sky behind.",
+ "subject": "No characters. A small round planet seen whole from the side, cultivated as a garden: soft meadow grass all over it with a few small meadow flowers, warm earth showing at its underside, on its top a round garden bed of warm umber soil (empty: the rose is her own picture), a low curving dry-stone wall behind the bed, a small weathered wooden chair with a pale pink cushion on its right shoulder.",
+ "setting": "The same planet in night: dusk indigo (#2E3561) shadows, soft silver-blue light from above, one or two lamp-gold glow-worms in the grass; calm and safe.",
+ "composition": "Square. The planet centred, about 70 % of the width across; its top, with the empty bed, a little above the middle. Everything outside the planet fully transparent.",
+ "include": [
+ "a fully transparent sky",
+ "an empty garden bed on top, centred"
+ ],
+ "avoid": [
+ "a painted sky, sun, moon or stars",
+ "a rose or any large flower in the bed",
+ "people or animals"
+ ],
+ "checks": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 11
+ ]
+ },
{
"id": "fox-sheet",
"type": "sheet",
diff --git a/art/placeholders/gardener-carry.svg b/art/placeholders/gardener-carry.svg
new file mode 100644
index 0000000..91a665e
--- /dev/null
+++ b/art/placeholders/gardener-carry.svg
@@ -0,0 +1,4 @@
+
diff --git a/art/placeholders/gardener-poses-sheet.svg b/art/placeholders/gardener-poses-sheet.svg
new file mode 100644
index 0000000..66ba910
--- /dev/null
+++ b/art/placeholders/gardener-poses-sheet.svg
@@ -0,0 +1,4 @@
+
diff --git a/art/placeholders/gardener-pour.svg b/art/placeholders/gardener-pour.svg
new file mode 100644
index 0000000..8c24246
--- /dev/null
+++ b/art/placeholders/gardener-pour.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/gardener-pull.svg b/art/placeholders/gardener-pull.svg
new file mode 100644
index 0000000..666f590
--- /dev/null
+++ b/art/placeholders/gardener-pull.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/gardener-reach.svg b/art/placeholders/gardener-reach.svg
new file mode 100644
index 0000000..b68508b
--- /dev/null
+++ b/art/placeholders/gardener-reach.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/gardener-sheet.svg b/art/placeholders/gardener-sheet.svg
new file mode 100644
index 0000000..c910949
--- /dev/null
+++ b/art/placeholders/gardener-sheet.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/gardener-sit.svg b/art/placeholders/gardener-sit.svg
new file mode 100644
index 0000000..e553fc8
--- /dev/null
+++ b/art/placeholders/gardener-sit.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/gardener-stand.svg b/art/placeholders/gardener-stand.svg
new file mode 100644
index 0000000..94db29c
--- /dev/null
+++ b/art/placeholders/gardener-stand.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/gardener-sweep.svg b/art/placeholders/gardener-sweep.svg
new file mode 100644
index 0000000..873b8ee
--- /dev/null
+++ b/art/placeholders/gardener-sweep.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/gardener-walk.svg b/art/placeholders/gardener-walk.svg
new file mode 100644
index 0000000..5c64d37
--- /dev/null
+++ b/art/placeholders/gardener-walk.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/home-planet-day.svg b/art/placeholders/home-planet-day.svg
new file mode 100644
index 0000000..21a15fa
--- /dev/null
+++ b/art/placeholders/home-planet-day.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/home-planet-golden.svg b/art/placeholders/home-planet-golden.svg
new file mode 100644
index 0000000..4b157f6
--- /dev/null
+++ b/art/placeholders/home-planet-golden.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/art/placeholders/home-planet-night.svg b/art/placeholders/home-planet-night.svg
new file mode 100644
index 0000000..de154e6
--- /dev/null
+++ b/art/placeholders/home-planet-night.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/e2e/apps/check-garden.ts b/e2e/apps/check-garden.ts
index d593fef..1434301 100644
--- a/e2e/apps/check-garden.ts
+++ b/e2e/apps/check-garden.ts
@@ -18,6 +18,7 @@
import { expect, _android as android, chromium, type Page } from '@playwright/test';
import { PRODUCT_NAME } from '@rosea/schema';
import { en } from '@rosea/ui/copy';
+import { openRing, pastGardener } from '../garden.js';
import { spawn, spawnSync, type ChildProcess } from 'node:child_process';
import { existsSync, mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
@@ -47,7 +48,7 @@ async function garden(page: Page): Promise {
await expect(page.getByRole('heading', { level: 1 })).toHaveText(PRODUCT_NAME, { timeout: 20_000 });
}
-/** The first visit: skip the town (no town is the private choice), water her, wait for the write. */
+/** The first visit: the first gardener, skip the town (no town is the private choice), water her from the ring, wait for the write. */
async function firstVisit(page: Page): Promise {
await garden(page);
const seen = watch(page);
@@ -60,9 +61,11 @@ async function firstVisit(page: Page): Promise {
report['manifestLink'] = await page.evaluate(() => document.querySelector('link[rel="manifest"]') !== null);
report['cspMeta'] = await page.evaluate(() => document.querySelector('meta[http-equiv="Content-Security-Policy"]') !== null);
+ await pastGardener(page);
const skip = page.getByRole('button', { name: /^Not now/ });
if (await skip.isVisible().catch(() => false)) await skip.click();
+ await openRing(page);
const water = page.getByRole('button', { name: en.rose.water });
await expect(water).toBeVisible();
const box = await water.boundingBox();
diff --git a/e2e/garden.ts b/e2e/garden.ts
new file mode 100644
index 0000000..ce5ae97
--- /dev/null
+++ b/e2e/garden.ts
@@ -0,0 +1,21 @@
+import { expect, type Page } from '@playwright/test';
+import { en } from '@rosea/ui/copy';
+
+/**
+ * The first open asks *Who tends her?* (planet-garden.md §1). Tests that are not about the
+ * gardener answer it with the first look, so they reach the garden as a returning player does.
+ */
+export async function pastGardener(page: Page): Promise {
+ const question = page.getByRole('heading', { level: 2, name: en.gardener.question });
+ const garden = page.getByRole('button', { name: en.rose.care });
+ await expect(question.or(garden)).toBeVisible({ timeout: 20_000 });
+ if (await question.isVisible()) await page.getByRole('button', { name: en.gardener.done }).click();
+ await expect(garden).toBeVisible();
+}
+
+/** Opens the ring of care, as Enter on her (or a tap) does (planet-garden.md G7). */
+export async function openRing(page: Page): Promise {
+ const ring = page.getByRole('group', { name: en.scene.ring });
+ if (!(await ring.isVisible())) await page.getByRole('button', { name: en.rose.care }).press('Enter');
+ await expect(ring).toBeVisible();
+}
diff --git a/e2e/offline.spec.ts b/e2e/offline.spec.ts
index 6b9320d..cab783a 100644
--- a/e2e/offline.spec.ts
+++ b/e2e/offline.spec.ts
@@ -2,6 +2,7 @@ import { expect, test } from '@playwright/test';
import { PRODUCT_NAME } from '@rosea/schema';
import { en } from '@rosea/ui/copy';
import { startStaticServer } from './static-server.js';
+import { openRing, pastGardener } from './garden.js';
import { storedCare, storedTown } from './stored.js';
/**
@@ -24,6 +25,7 @@ test('the shell opens from the service worker with the server gone', async ({ br
await page.clock.setFixedTime(Date.parse('2026-03-29T12:00:00+02:00'));
await page.goto(server.url);
await expect(page.getByRole('heading', { level: 1 })).toHaveText(PRODUCT_NAME);
+ await pastGardener(page);
// The player answers the sunset question while online (sunset-place.md).
await page.getByRole('searchbox', { name: en.sunset.searchLabel }).fill('brno');
@@ -67,6 +69,7 @@ test('the shell opens from the service worker with the server gone', async ({ br
await storedTown(page, 'Plzeň');
// Tending the rose offline: hold Water, as a finger would (rose.md).
+ await openRing(page);
await page.getByRole('button', { name: en.rose.water }).hover();
await page.mouse.down();
await page.waitForTimeout(1500);
diff --git a/e2e/petal.spec.ts b/e2e/petal.spec.ts
index 430185e..aed2c72 100644
--- a/e2e/petal.spec.ts
+++ b/e2e/petal.spec.ts
@@ -7,6 +7,7 @@ import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { startStaticServer, type StaticServer } from './static-server.js';
+import { pastGardener } from './garden.js';
import { storedCare } from './stored.js';
import fixture from './fixtures/library/fixture.json' with { type: 'json' };
@@ -35,7 +36,7 @@ test.afterEach(async () => {
async function open(page: Page): Promise {
await page.clock.setFixedTime(MORNING);
await page.goto(server.url);
- await expect(page.getByRole('button', { name: en.rose.water })).toBeVisible();
+ await pastGardener(page);
}
test('with the shipped library still empty, she holds no petal and says nothing about one', async ({ page }) => {
diff --git a/e2e/planet.spec.ts b/e2e/planet.spec.ts
new file mode 100644
index 0000000..e3eddec
--- /dev/null
+++ b/e2e/planet.spec.ts
@@ -0,0 +1,83 @@
+import AxeBuilder from '@axe-core/playwright';
+import { expect, test, type Page } from '@playwright/test';
+import { PRODUCT_NAME } from '@rosea/schema';
+import { en } from '@rosea/ui/copy';
+import { startStaticServer, type StaticServer } from './static-server.js';
+import { storedCare } from './stored.js';
+
+/**
+ * Her planet in the BUILT app (.agents/features/planet-garden.md): the first-open choice of
+ * gardener, the ring of care, and care by the player's own hand on the can.
+ */
+test.use({ timezoneId: 'Europe/Prague', locale: 'en-US' });
+const MORNING = Date.parse('2026-03-01T08:00:00+01:00');
+
+let server: StaticServer;
+test.beforeEach(async () => {
+ server = await startStaticServer();
+});
+test.afterEach(async () => {
+ await server.close();
+});
+
+const axe = async (page: Page): Promise => (await new AxeBuilder({ page }).analyze()).violations.map((v) => `${v.id}: ${v.help}`);
+
+test('the first open asks who tends her; the chosen gardener stays after a reload', async ({ page }) => {
+ await page.clock.setFixedTime(MORNING);
+ await page.goto(server.url);
+ await expect(page.getByRole('heading', { level: 1 })).toHaveText(PRODUCT_NAME);
+ await expect(page.getByRole('heading', { level: 2, name: en.gardener.question })).toBeVisible();
+ await expect(page.getByRole('img', { name: en.gardener.preview })).toBeVisible();
+ expect(await axe(page)).toEqual([]);
+
+ await page.getByText(en.gardener.values.presentation.boy, { exact: true }).click();
+ await page.getByText(en.gardener.values.hat.cap, { exact: true }).click();
+ await page.getByRole('button', { name: en.gardener.done }).click();
+ await expect(page.getByRole('group', { name: en.scene.planet })).toBeVisible();
+ expect(await axe(page)).toEqual([]);
+
+ await page.waitForFunction(
+ () =>
+ new Promise((resolve) => {
+ const req = indexedDB.open('rosea');
+ req.onsuccess = () => {
+ const get = req.result.transaction('profile').objectStore('profile').get('gardener');
+ get.onsuccess = () => resolve((get.result as { value?: { presentation?: string } } | undefined)?.value?.presentation === 'boy');
+ get.onerror = () => resolve(false);
+ };
+ req.onerror = () => resolve(false);
+ })
+ );
+ await page.reload();
+ await expect(page.getByRole('group', { name: en.scene.planet })).toBeVisible();
+ await expect(page.getByRole('heading', { name: en.gardener.question })).toHaveCount(0);
+});
+
+test('a tap on her opens the ring of what she needs; Escape closes it', async ({ page }) => {
+ await page.clock.setFixedTime(MORNING);
+ await page.goto(server.url);
+ await page.getByRole('button', { name: en.gardener.done }).click();
+ await page.getByRole('button', { name: en.rose.care }).click();
+ const ring = page.getByRole('group', { name: en.scene.ring });
+ await expect(ring).toBeVisible();
+ await expect(ring.getByRole('button', { name: en.rose.water })).toBeFocused();
+ expect(await axe(page)).toEqual([]);
+ await page.keyboard.press('Escape');
+ await expect(ring).toHaveCount(0);
+ await expect(page.getByRole('button', { name: en.rose.care })).toBeFocused();
+});
+
+test('pressing the can and tilting it pours: she thanks the player, and it is kept', async ({ page }) => {
+ await page.clock.setFixedTime(MORNING);
+ await page.goto(server.url);
+ await page.getByRole('button', { name: en.gardener.done }).click();
+ const can = page.getByRole('img', { name: en.scene.can });
+ const box = (await can.boundingBox())!;
+ await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
+ await page.mouse.down();
+ await page.mouse.move(box.x + box.width / 2 + 90, box.y + box.height / 2, { steps: 5 });
+ await page.waitForTimeout(1300);
+ await page.mouse.up();
+ await expect(page.getByText(en.rose.says.thanks)).toBeVisible();
+ await storedCare(page, 1);
+});
diff --git a/e2e/playwright.config.ts b/e2e/playwright.config.ts
index 4101856..16f1f22 100644
--- a/e2e/playwright.config.ts
+++ b/e2e/playwright.config.ts
@@ -7,7 +7,7 @@ import { defineConfig, devices } from '@playwright/test';
*/
export default defineConfig({
testDir: '.',
- testMatch: /(shell|update|petal)\.spec\.ts/,
+ testMatch: /(shell|update|petal|planet)\.spec\.ts/,
fullyParallel: false,
workers: 1,
retries: 0,
diff --git a/e2e/shell.spec.ts b/e2e/shell.spec.ts
index aaa7455..90e409a 100644
--- a/e2e/shell.spec.ts
+++ b/e2e/shell.spec.ts
@@ -7,6 +7,7 @@ import { nextInvitation, nextSunEvent } from '@rosea/engine';
import { searchTowns } from '@rosea/content/places';
import { readFileSync } from 'node:fs';
import { BASE, startStaticServer, type StaticServer } from './static-server.js';
+import { openRing, pastGardener } from './garden.js';
import { storedCare, storedTown } from './stored.js';
let server: StaticServer;
@@ -29,6 +30,7 @@ async function open(page: Page): Promise<{ requests: string[]; cspViolations: st
});
await page.goto(server.url);
await expect(page.getByRole('heading', { level: 1 })).toHaveText(PRODUCT_NAME);
+ await pastGardener(page);
// Let the worker register and precache, so its requests are counted too.
await page.waitForFunction(() => navigator.serviceWorker.ready.then(() => true), null, { timeout: 20_000 });
return { requests, cspViolations };
@@ -204,6 +206,7 @@ test.describe('the rose, in Prague at 08:00 on 1 March 2026', () => {
/** Holds the Water button with the mouse, as a player holds it with a finger. */
async function pour(page: Page, ms: number): Promise {
+ await openRing(page);
await page.getByRole('button', { name: en.rose.water }).hover();
await page.mouse.down();
await page.waitForTimeout(ms);
@@ -232,6 +235,7 @@ test.describe('the rose, in Prague at 08:00 on 1 March 2026', () => {
// The clock is driven, not frozen: taps at one frozen instant would be one touch.
await page.clock.install({ time: MORNING });
await open(page);
+ await openRing(page);
const touch = page.getByRole('button', { name: en.rose.touch.label });
await touch.click();
await expect(page.locator('.bubble')).toHaveText(en.rose.touch.fond[0]!);
@@ -246,6 +250,14 @@ test.describe('the rose, in Prague at 08:00 on 1 March 2026', () => {
expect((await new AxeBuilder({ page }).analyze()).violations.map((v) => `${v.id}: ${v.help}`)).toEqual([]);
});
+ test('a touched control shows no browser tap box (seen on a real Android tablet)', async ({ page }) => {
+ await page.clock.setFixedTime(MORNING);
+ await open(page);
+ await openRing(page);
+ const highlight = await page.getByRole('button', { name: en.rose.water }).evaluate((el) => getComputedStyle(el).getPropertyValue('-webkit-tap-highlight-color'));
+ expect(highlight.replace(/\s/g, '')).toBe('rgba(0,0,0,0)');
+ });
+
test('the rose and her care have no accessibility violations', async ({ page }) => {
await page.clock.setFixedTime(MORNING);
await open(page);
@@ -267,6 +279,7 @@ test.describe('two tabs of the garden, in Prague at 08:00 on 1 March 2026', () =
await open(p);
await expect(p.getByText(en.rose.says.dry)).toBeVisible();
}
+ await openRing(page);
await page.getByRole('button', { name: en.rose.water }).hover();
await page.mouse.down();
await page.waitForTimeout(1500);
@@ -307,8 +320,10 @@ test.describe('keep her safe, in Prague at 08:00 on 1 March 2026', () => {
const page = await first.newPage();
await page.clock.setFixedTime(MORNING);
await page.goto(server.url);
+ await pastGardener(page);
await page.getByRole('searchbox', { name: en.sunset.searchLabel }).fill('brno');
await page.getByRole('button', { name: /^Brno/ }).first().click();
+ await openRing(page);
await page.getByRole('button', { name: en.rose.water }).hover();
await page.mouse.down();
await page.waitForTimeout(1500);
@@ -333,6 +348,7 @@ test.describe('keep her safe, in Prague at 08:00 on 1 March 2026', () => {
const page = await second.newPage();
await page.clock.setFixedTime(MORNING + 3_600_000);
await page.goto(server.url);
+ await pastGardener(page);
await expect(page.getByRole('img', { name: 'The rose, a bud.' })).toBeVisible();
await page.getByRole('button', { name: en.rose.safe.title }).click();
await page.getByLabel(en.rose.safe.bringBack).setInputFiles({ name: 'rose-2026-03-01.json', mimeType: 'application/json', buffer: Buffer.from(saved) });
diff --git a/package.json b/package.json
index 78e7747..6280f30 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,7 @@
"test": "pnpm guard:cpu && turbo run test",
"test:e2e": "pnpm guard:cpu && turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.config.ts",
"test:offline": "pnpm guard:cpu && turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.offline.config.ts",
+ "test:android": "tsx scripts/android-smoke.ts",
"validate:library": "tsx scripts/validate-library.ts",
"library:verify": "tsx scripts/verify-sentences.ts",
"lint:copy": "tsx scripts/lint-copy.ts",
diff --git a/packages/engine/src/index.ts b/packages/engine/src/index.ts
index 21fe8d8..0b29bc6 100644
--- a/packages/engine/src/index.ts
+++ b/packages/engine/src/index.ts
@@ -3,8 +3,9 @@ export {
careEvent, careIdentity, judgeCare, newCare, OWN_TRACE, petalsOn, pour, ROSE, roseAt, seeded, stageFor, weedsOn, windOn,
type Judged, type Mood, type Needs, type RoseKeys, type RoseNow, type Stage, type Trend
} from './rose/rose.js';
-export { invitation, nextInvitation, nextSunEvent, sunDay, type NamedPlace, type Place, type SunDay } from './sun/sun.js';
+export { invitation, lightAt, nextInvitation, nextSunEvent, sunDay, type Light, type NamedPlace, type Place, type SunDay } from './sun/sun.js';
export {
goodMoment, newOpened, openedIdentity, PETAL, petalAt, petalOrder, sentenceOpened, type PetalNow, type PetalSentence
} from './petal/petal.js';
export { touch, TOUCH, UNTOUCHED, type TouchReply, type TouchState } from './touch/touch.js';
+export { petalsToday, weedsToday } from './scene/scene.js';
diff --git a/packages/engine/src/scene/scene.ts b/packages/engine/src/scene/scene.ts
new file mode 100644
index 0000000..0bc1f1c
--- /dev/null
+++ b/packages/engine/src/scene/scene.ts
@@ -0,0 +1,16 @@
+/**
+ * What the planet garden shows of her day (.agents/features/planet-garden.md G3). Pure: the
+ * rose's key and the local day are parameters, so a replay shows the same weeds every time.
+ */
+import { petalsOn, seeded, weedsOn } from '../rose/rose.js';
+import type { LocalDay } from '../time/localDay.js';
+
+/** How many weeds came up in the night: 2–4 on a day with weeds, else none. */
+export function weedsToday(seed: string, day: LocalDay): number {
+ return weedsOn(seed, day) ? 2 + Math.floor(seeded(seed, day, 'weed-count') * 3) : 0;
+}
+
+/** How many of her petals have fallen: 3–5 on a day with fallen petals, else none. */
+export function petalsToday(seed: string, day: LocalDay): number {
+ return petalsOn(seed, day) ? 3 + Math.floor(seeded(seed, day, 'petal-count') * 3) : 0;
+}
diff --git a/packages/engine/src/sun/sun.ts b/packages/engine/src/sun/sun.ts
index 72309d8..e82cec6 100644
--- a/packages/engine/src/sun/sun.ts
+++ b/packages/engine/src/sun/sun.ts
@@ -159,6 +159,27 @@ export function nextInvitation(now: number, place: Place): { readonly sun: SunDa
throw new Error(`nextInvitation: no invitation within two days of ${today}`);
}
+/** The light over her planet now (planet-garden.md): the scene's sky follows the real sun. */
+export type Light = 'day' | 'golden' | 'night';
+
+/**
+ * Golden within 45 minutes before and 30 after the sunset or sunrise (in polar day, around the
+ * lowest light; in polar night, around the brightest twilight at noon); day between, night outside.
+ */
+export function lightAt(now: number, place: Place): Light {
+ const sun = sunDay(localDay(now, place.timeZone), place);
+ const near = (at: number, before: number, after: number): boolean => now >= at - before * MINUTE && now <= at + after * MINUTE;
+ switch (sun.kind) {
+ case 'polar-day':
+ return near(sun.lowestLight, 60, 60) ? 'golden' : 'day';
+ case 'polar-night':
+ return near(sun.solarNoon, 90, 90) ? 'golden' : 'night';
+ case 'sun-sets':
+ if (near(sun.sunset, 45, 30) || near(sun.sunrise, 30, 30)) return 'golden';
+ return now > sun.sunrise && now < sun.sunset ? 'day' : 'night';
+ }
+}
+
/**
* The next thing to look up for (sunrise.md R1): the sunrise of the next invitation's
* day while it is still ahead, otherwise the invitation itself. Built on
diff --git a/packages/engine/test/scene.test.ts b/packages/engine/test/scene.test.ts
new file mode 100644
index 0000000..e382257
--- /dev/null
+++ b/packages/engine/test/scene.test.ts
@@ -0,0 +1,36 @@
+import fc from 'fast-check';
+import { describe, expect, it } from 'vitest';
+import { petalsOn, weedsOn } from '../src/rose/rose.js';
+import { petalsToday, weedsToday } from '../src/scene/scene.js';
+import { addDays } from '../src/time/localDay.js';
+
+const KEY = 'K'.repeat(43);
+const days = Array.from({ length: 120 }, (_, i) => addDays('2026-01-01', i));
+
+describe('what the planet garden shows of her day (planet-garden.md G3)', () => {
+ it('weeds: none on a day without, 2–4 on a day with', () => {
+ for (const day of days) {
+ const n = weedsToday(KEY, day);
+ expect(n === 0 ? !weedsOn(KEY, day) : weedsOn(KEY, day) && n >= 2 && n <= 4).toBe(true);
+ }
+ expect(new Set(days.map((d) => weedsToday(KEY, d)).filter(Boolean)).size).toBeGreaterThan(1);
+ });
+
+ it('fallen petals: none on a day without, 3–5 on a day with', () => {
+ for (const day of days) {
+ const n = petalsToday(KEY, day);
+ expect(n === 0 ? !petalsOn(KEY, day) : petalsOn(KEY, day) && n >= 3 && n <= 5).toBe(true);
+ }
+ });
+
+ it('property: the same rose on the same day always shows the same count', () => {
+ fc.assert(
+ fc.property(fc.stringMatching(/^[A-Za-z0-9_-]{43}$/), fc.integer({ min: 0, max: 3000 }), (key, offset) => {
+ const day = addDays('2026-01-01', offset);
+ expect(weedsToday(key, day)).toBe(weedsToday(key, day));
+ expect(petalsToday(key, day)).toBe(petalsToday(key, day));
+ }),
+ { numRuns: 200 }
+ );
+ });
+});
diff --git a/packages/engine/test/sun.test.ts b/packages/engine/test/sun.test.ts
index 2fd582c..92aa84a 100644
--- a/packages/engine/test/sun.test.ts
+++ b/packages/engine/test/sun.test.ts
@@ -1,7 +1,7 @@
import fc from 'fast-check';
import { readFileSync } from 'node:fs';
import { describe, expect, it } from 'vitest';
-import { invitation, nextInvitation, nextSunEvent, sunDay, type Place, type SunDay } from '../src/sun/sun.js';
+import { invitation, lightAt, nextInvitation, nextSunEvent, sunDay, type Place, type SunDay } from '../src/sun/sun.js';
import { addDays, localDay } from '../src/time/localDay.js';
/** Recorded by scripts/fetch-sun-golden.ts from the U.S. Naval Observatory. */
@@ -317,3 +317,27 @@ describe('nextSunEvent — the next thing to look up for (sunrise.md)', () => {
);
});
});
+
+describe('lightAt — the sky over her planet (planet-garden.md)', () => {
+ const brno: Place = { lat: 49.1951, lon: 16.6068, timeZone: 'Europe/Prague' };
+ const day = sunDay('2026-03-02', brno);
+ if (day.kind !== 'sun-sets') throw new Error('Brno has a sunset in March');
+
+ it('night before dawn, golden at sunrise, day at noon, golden at sunset, night after', () => {
+ expect(lightAt(day.sunrise - 2 * HOUR, brno)).toBe('night');
+ expect(lightAt(day.sunrise, brno)).toBe('golden');
+ expect(lightAt(day.solarNoon, brno)).toBe('day');
+ expect(lightAt(day.sunset - 30 * MINUTE, brno)).toBe('golden');
+ expect(lightAt(day.sunset + 2 * HOUR, brno)).toBe('night');
+ });
+
+ it('polar day is day, golden around the lowest light; polar night is night, golden at noon', () => {
+ const tromso: Place = { lat: 69.6492, lon: 18.9553, timeZone: 'Europe/Oslo' };
+ const summer = sunDay('2026-06-21', tromso);
+ const winter = sunDay('2026-12-21', tromso);
+ if (summer.kind !== 'polar-day' || winter.kind !== 'polar-night') throw new Error('Tromsø: polar day and night');
+ expect(lightAt(summer.solarNoon, tromso)).toBe('day');
+ expect(lightAt(winter.solarNoon, tromso)).toBe('golden');
+ expect(lightAt(winter.solarNoon + 4 * HOUR, tromso)).toBe('night');
+ });
+});
diff --git a/packages/schema/schemas/gardener.schema.json b/packages/schema/schemas/gardener.schema.json
new file mode 100644
index 0000000..d6e2669
--- /dev/null
+++ b/packages/schema/schemas/gardener.schema.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "$id": "https://rosea.invalid/schema/gardener.json",
+ "title": "Gardener",
+ "description": "The look of the player's gardener, chosen at the first open (.agents/features/planet-garden.md G6). Every value is from a fixed list: no free text, nothing that identifies a person. Kept on the device in `profile`; never sent, never in the rose file. No option recreates the book's boy: there is no scarf, coat, cape, suit or crown to choose.",
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["presentation", "skin", "hair", "hairColour", "clothes", "hat"],
+ "properties": {
+ "presentation": { "enum": ["girl", "boy"] },
+ "skin": { "enum": ["skin-1", "skin-2", "skin-3", "skin-4", "skin-5", "skin-6"] },
+ "hair": { "enum": ["short", "curly", "ponytail", "braids", "bob", "bun"] },
+ "hairColour": { "enum": ["black", "dark-brown", "brown", "auburn", "red", "fair"] },
+ "clothes": { "enum": ["sage", "rose", "honey", "dusk", "plum"] },
+ "hat": { "enum": ["straw-hat", "cap", "none"] }
+ }
+}
diff --git a/packages/schema/src/gardener.ts b/packages/schema/src/gardener.ts
new file mode 100644
index 0000000..d1d84d7
--- /dev/null
+++ b/packages/schema/src/gardener.ts
@@ -0,0 +1,15 @@
+/**
+ * The gardener's fixed lists, read from gardener.schema.json itself, so the choice the player
+ * sees, the shape storage checks and the contract can never disagree (planet-garden.md G6).
+ */
+import schema from '../schemas/gardener.schema.json' with { type: 'json' };
+import type { Gardener } from './generated/index.js';
+
+type Options = { readonly [K in keyof Gardener]: readonly Gardener[K][] };
+
+export const GARDENER_OPTIONS: Options = Object.fromEntries(
+ Object.entries(schema.properties).map(([k, v]) => [k, v.enum])
+) as unknown as Options;
+
+/** The order the choice asks in. */
+export const GARDENER_FIELDS = schema.required as readonly (keyof Gardener)[];
diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts
index 9aff762..a99d1a4 100644
--- a/packages/schema/src/index.ts
+++ b/packages/schema/src/index.ts
@@ -1,2 +1,3 @@
export * from './constants.js';
export type * from './generated/index.js';
+export { GARDENER_FIELDS, GARDENER_OPTIONS } from './gardener.js';
diff --git a/packages/schema/src/validate.ts b/packages/schema/src/validate.ts
index efb35d8..9fcc89e 100644
--- a/packages/schema/src/validate.ts
+++ b/packages/schema/src/validate.ts
@@ -9,10 +9,11 @@
*/
import { Ajv, type ErrorObject, type ValidateFunction } from 'ajv';
import careEvent from '../schemas/care-event.schema.json' with { type: 'json' };
+import gardener from '../schemas/gardener.schema.json' with { type: 'json' };
import hopeSentence from '../schemas/hope-sentence.schema.json' with { type: 'json' };
import sentenceOpened from '../schemas/sentence-opened.schema.json' with { type: 'json' };
import trace from '../schemas/trace.schema.json' with { type: 'json' };
-import type { CareEvent, HopeSentence, SentenceOpened, Trace } from './generated/index.js';
+import type { CareEvent, Gardener, HopeSentence, SentenceOpened, Trace } from './generated/index.js';
export type SchemaResult =
| { readonly ok: true; readonly value: T }
@@ -40,4 +41,5 @@ function describe(error: ErrorObject): string {
export const validateHopeSentence = wrap(ajv.compile(hopeSentence));
export const validateCareEvent = wrap(ajv.compile(careEvent));
export const validateSentenceOpened = wrap(ajv.compile(sentenceOpened));
+export const validateGardener = wrap(ajv.compile(gardener));
export const validateTrace = wrap(ajv.compile(trace));
diff --git a/packages/storage/src/index.ts b/packages/storage/src/index.ts
index 7b31263..3eaea62 100644
--- a/packages/storage/src/index.ts
+++ b/packages/storage/src/index.ts
@@ -12,7 +12,7 @@
import Dexie, { type DexieOptions, type Table } from 'dexie';
import { newCare, newOpened, type NamedPlace } from '@rosea/engine';
import { isIdentity, type Identity } from '@rosea/identity';
-import { DATABASE_NAME, type CareEvent, type SentenceOpened } from '@rosea/schema';
+import { DATABASE_NAME, GARDENER_FIELDS, GARDENER_OPTIONS, type CareEvent, type Gardener, type SentenceOpened } from '@rosea/schema';
export { DATABASE_NAME };
@@ -34,6 +34,17 @@ interface KeyRow {
}
const SUNSET_PLACE = 'sunsetPlace';
+const GARDENER = 'gardener';
+
+/** The shape check for a stored gardener: exactly the six fields, each from its list. */
+export function asGardener(value: unknown): Gardener | null {
+ if (typeof value !== 'object' || value === null) return null;
+ const v = value as Record;
+ const keys = GARDENER_FIELDS;
+ if (Object.keys(v).length !== keys.length) return null;
+ for (const k of keys) if (!(GARDENER_OPTIONS[k] as readonly unknown[]).includes(v[k])) return null;
+ return Object.fromEntries(keys.map((k) => [k, v[k]])) as unknown as Gardener;
+}
const SELF = 'self';
const PAST_KEYS = 'pastKeys';
@@ -55,6 +66,9 @@ export interface RoseFile {
export interface Storage {
/** The saved sunset place, or null if the player has not answered yet. */
loadSunsetPlace(): Promise;
+ /** The player's gardener, or null before they chose one (planet-garden.md G6). */
+ loadGardener(): Promise;
+ saveGardener(look: Gardener): Promise;
saveSunsetPlace(place: SunsetPlace): Promise;
/** Appends one act of care. The log is never edited or shortened. */
appendCare(event: CareEvent): Promise;
@@ -194,7 +208,7 @@ class RoseaDatabase extends Dexie {
}
/** What another tab changed (two-tabs.md W2): only which part, never the data. */
-export type Change = 'log' | 'place';
+export type Change = 'log' | 'place' | 'gardener';
/** The channel every tab of the garden announces its writes on (two-tabs.md W1). */
export const CHANGES_CHANNEL = `${DATABASE_NAME}-changes`;
@@ -213,7 +227,7 @@ export function openStorage(options?: DexieOptions, settings: { readonly channel
if (channel) {
channel.onmessage = (message: MessageEvent) => {
const what = message.data;
- if (what !== 'log' && what !== 'place') return;
+ if (what !== 'log' && what !== 'place' && what !== 'gardener') return;
for (const listener of listeners) {
try {
listener(what);
@@ -250,6 +264,19 @@ export function openStorage(options?: DexieOptions, settings: { readonly channel
await db.profile.put({ key: SUNSET_PLACE, value: plain });
announce('place');
},
+ async loadGardener() {
+ const row = await db.profile.get(GARDENER);
+ if (row === undefined) return null;
+ const look = asGardener(row.value);
+ if (look === null) console.warn('storage: the saved gardener has an unknown shape; asking again', row.value);
+ return look;
+ },
+ async saveGardener(look) {
+ const plain = asGardener(look);
+ if (plain === null) throw new TypeError('storage: refusing to save a gardener of an unknown shape');
+ await db.profile.put({ key: GARDENER, value: plain });
+ announce('gardener');
+ },
async appendCare(event) {
const plain = asCareEvent(event);
if (plain === null) throw new TypeError('storage: refusing to append a care event of an unknown shape');
diff --git a/packages/storage/test/gardener.test.ts b/packages/storage/test/gardener.test.ts
new file mode 100644
index 0000000..4beb3d8
--- /dev/null
+++ b/packages/storage/test/gardener.test.ts
@@ -0,0 +1,71 @@
+import { GARDENER_FIELDS, GARDENER_OPTIONS, type Gardener } from '@rosea/schema';
+import { validateGardener } from '@rosea/schema/validate';
+import { IDBFactory, IDBKeyRange } from 'fake-indexeddb';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import { asGardener, openStorage, type Change, type Storage } from '../src/index.js';
+
+const look: Gardener = { presentation: 'girl', skin: 'skin-3', hair: 'braids', hairColour: 'auburn', clothes: 'sage', hat: 'straw-hat' };
+const KEY = 'K'.repeat(87);
+
+const opened: Storage[] = [];
+const open = (indexedDB: IDBFactory = new IDBFactory(), channel: string | null = null): Storage => {
+ const s = openStorage({ indexedDB, IDBKeyRange }, { channel });
+ opened.push(s);
+ return s;
+};
+afterEach(() => {
+ for (const s of opened.splice(0)) s.close();
+ vi.restoreAllMocks();
+});
+
+describe('the gardener (planet-garden.md G6)', () => {
+ it('is null before the player chose, then kept across a reopen', async () => {
+ const factory = new IDBFactory();
+ const s = open(factory);
+ expect(await s.loadGardener()).toBeNull();
+ await s.saveGardener(new Proxy(look, {}));
+ s.close();
+ expect(await open(factory).loadGardener()).toEqual(look);
+ });
+
+ it('refuses a value off its list, a missing field, an extra field, or free text', async () => {
+ const s = open();
+ for (const bad of [
+ { ...look, hat: 'crown' },
+ { ...look, clothes: 'green suit' },
+ { ...look, extra: 'a scarf' },
+ (({ hat: _, ...rest }) => rest)(look),
+ { ...look, presentation: 'Marek' }
+ ]) {
+ await expect(s.saveGardener(bad as unknown as Gardener)).rejects.toThrow(/unknown shape/);
+ }
+ expect(await s.loadGardener()).toBeNull();
+ });
+
+ it('the hand check, the schema and the lists agree', () => {
+ expect([...GARDENER_FIELDS].sort()).toEqual(Object.keys(GARDENER_OPTIONS).sort());
+ for (const k of GARDENER_FIELDS) {
+ for (const v of GARDENER_OPTIONS[k]) expect(validateGardener({ ...look, [k]: v }).ok).toBe(true);
+ expect(asGardener({ ...look, [k]: 'other' })).toBeNull();
+ expect(validateGardener({ ...look, [k]: 'other' }).ok).toBe(false);
+ }
+ expect(asGardener(look)).toEqual(look);
+ });
+
+ it('never offers what would recreate the book\'s boy', () => {
+ const everything = JSON.stringify(GARDENER_OPTIONS).toLowerCase();
+ for (const word of ['scarf', 'coat', 'cape', 'suit', 'crown', 'sword', 'golden']) expect(everything).not.toContain(word);
+ });
+
+ it('is announced to the other tabs, and never travels in the rose file', async () => {
+ const factory = new IDBFactory();
+ const a = open(factory, 'rosea-test-gardener');
+ const b = open(factory, 'rosea-test-gardener');
+ const heard: Change[] = [];
+ b.onChange((w) => heard.push(w));
+ await a.saveGardener(look);
+ await new Promise((r) => setTimeout(r, 100));
+ expect(heard).toEqual(['gardener']);
+ expect(JSON.stringify(await a.exportRose(KEY))).not.toMatch(/braids|auburn|skin-3|gardener/);
+ });
+});
diff --git a/packages/ui/src/Shell.svelte b/packages/ui/src/Shell.svelte
index 6996b68..4f0358f 100644
--- a/packages/ui/src/Shell.svelte
+++ b/packages/ui/src/Shell.svelte
@@ -1,5 +1,5 @@
+
+
+
+
+
+ {#if look.presentation === 'girl'}
+
+ {:else}
+
+ {/if}
+
+
+
+
+ {#if look.presentation === 'girl'}
+
+ {:else}
+
+ {/if}
+
+
+
+
+
+
+ {#if pose === 'pour'}
+
+
+
+
+
+ {:else if pose === 'sweep'}
+
+ {/if}
+
+
+
+
+ {#if look.hair === 'short'}
+
+ {:else if look.hair === 'curly'}
+ {#each [-8, -3, 2, 7] as x (x)}{/each}
+ {:else if look.hair === 'ponytail'}
+
+ {:else if look.hair === 'braids'}
+
+ {:else if look.hair === 'bob'}
+
+ {:else}
+
+ {/if}
+ {#if look.hat === 'straw-hat'}
+
+ {:else if look.hat === 'cap'}
+
+ {/if}
+
+
+
+
+
+
diff --git a/packages/ui/src/scene/GardenerChoice.svelte b/packages/ui/src/scene/GardenerChoice.svelte
new file mode 100644
index 0000000..370f757
--- /dev/null
+++ b/packages/ui/src/scene/GardenerChoice.svelte
@@ -0,0 +1,177 @@
+
+
+
+