Compare commits

..

9 Commits

Author SHA1 Message Date
mnovak 4d18ea0afc [repo] AtriumAdoption: The plan for Atrium Domi: no Tauri call, one IndexedDB database, no outgoing request, accent and icon; keep her origin when hosted, snapshot as the rosea-rose file; G-F7 narrowed by Custos's Android grant 2026-11-22 21:52:34 +01:00
mnovak b3076553ef [repo] AndroidReleaseApk: Merge the phone test passed on the Wave 10 through Fabrica's queue (PR #3) 2026-11-21 10:46:20 +01:00
mnovak 0ab845dcbb [repo] AndroidReleaseApk: The phone test passed on the Wave 10 through Fabrica's queue (1 of 1), a planted fault failed as it must; Fabrica's run records ignored 2026-11-21 10:46:16 +01:00
mnovak f5d8d2c581 [repo] AndroidReleaseApk: Merge the phone target through Fabrica's queue and the release APK built and verified; rosea-android named as Custos's gap (PR #2) 2026-11-21 08:55:42 +01:00
mnovak 7cd7dda0c0 [repo] AndroidReleaseApk: The phone target through Fabrica's queue (reset uninstall, maxMinutes, the e2e pipeline's phone step), the release APK built and verified with caches on D:, rosea-android named as Custos's gap 2026-11-21 08:53:49 +01:00
mnovak 9b8eb7036d [repo] FabricaRelease: Merge Rosea released and updated through Fabrica: pipelines, the Aula page's words and pictures, the APK signed in Custos, domi-rosea:// from the installer, the phone target (PR #1) 2026-11-19 03:44:47 +01:00
mnovak 21d3cd1119 [repo] FabricaRelease: Review with every gate's counts, the numbers picture centred, handover and a lesson 2026-11-19 03:44:36 +01:00
mnovak 3a6f2ad6ee [repo] FabricaRelease: Lint the generated release notes before the page is made; fix escapes in the APK signing test 2026-11-19 02:11:31 +01:00
mnovak 0d37f91763 [repo] FabricaRelease: Rosea as a Fabrica app: the release and e2e pipelines, the Aula page's words and pictures, the version check, the APK signed in Custos, domi-rosea:// from the installer, the phone target 2026-11-19 01:38:53 +01:00
42 changed files with 1915 additions and 8 deletions
+3
View File
@@ -5,6 +5,9 @@ One row per feature, with its analysis document (CLAUDE.md §5.1). Gaps live in
| Feature | Phase | Status | Analysis | Review | | Feature | Phase | Status | Analysis | Review |
|:--|:--|:--|:--|:--| |:--|:--|:--|:--|:--|
| Released through Fabrica: `.fabrica/` (app, release and e2e pipelines, tests, Aula pictures), the Aula page's words, the version check, the APK signed in Custos, `domi-rosea://open` from the installer, the showcase pictures on demo data, the phone target | Platform track | Merged to `main` (9b8eb70). Not published: the first release waits for the author (G-F1, G6.1) | [fabrica-release.md](features/fabrica-release.md) | [feature-fabrica-release.md](reviews/feature-fabrica-release.md) |
| Atrium Domi adoption: the inventory (Tauri calls, data, network, accent, icon) and the plan for steps 1–8 of Atrium's Appendix A | Platform track | Plan only (2026-11-22); no code until Atrium's `APP_CONTRACT.md` v0 | [atrium-adoption.md](features/atrium-adoption.md) | [docs-atrium-adoption.md](reviews/docs-atrium-adoption.md) |
| The APK for a release, tested on the Wave 10 through the phone queue: `reset: uninstall`, `maxMinutes`, the e2e pipeline's `phone` step, the release APK built and verified | Platform track | Merged (f5d8d2c); the phone test passed on the Wave 10 through the queue, 1 of 1 (2026-11-21). Blocked: `rosea-android` does not exist (G-F7); publication (G-F1) | [android-release-apk.md](features/android-release-apk.md) | [feature-android-release-apk.md](reviews/feature-android-release-apk.md) |
| Keep her safe in the apps: true words, Android's own save screen, the page kept between the system bars | Platform track | Merged to `main` 2026-11-17; built on this machine, not distributed. Closes G-T4 and, on Android, G-T5 | [keep-her-safe-apps.md](features/keep-her-safe-apps.md) | [feature-keep-her-safe-apps.md](reviews/feature-keep-her-safe-apps.md) | | Keep her safe in the apps: true words, Android's own save screen, the page kept between the system bars | Platform track | Merged to `main` 2026-11-17; built on this machine, not distributed. Closes G-T4 and, on Android, G-T5 | [keep-her-safe-apps.md](features/keep-her-safe-apps.md) | [feature-keep-her-safe-apps.md](reviews/feature-keep-her-safe-apps.md) |
| Four versions, one garden: the Tauri 2 shell (`apps/rosea-tauri`) for Android, iOS and desktop beside the PWA; a Windows build and an Android debug APK run on the tablet | Platform track | Merged to `main` 2026-11-17; built on this machine, not distributed. iOS needs a Mac (G-T1); *Keep her safe* in the apps is a release blocker (G-T4) | [tauri-platforms.md](features/tauri-platforms.md) | [feature-tauri-platforms.md](reviews/feature-tauri-platforms.md) | | Four versions, one garden: the Tauri 2 shell (`apps/rosea-tauri`) for Android, iOS and desktop beside the PWA; a Windows build and an Android debug APK run on the tablet | Platform track | Merged to `main` 2026-11-17; built on this machine, not distributed. iOS needs a Mac (G-T1); *Keep her safe* in the apps is a release blocker (G-T4) | [tauri-platforms.md](features/tauri-platforms.md) | [feature-tauri-platforms.md](reviews/feature-tauri-platforms.md) |
| 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) | | 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) |
+20 -2
View File
@@ -77,14 +77,32 @@ Svelte codebase, the apps through a Tauri 2 shell. Analysis:
| ~~G-T0~~ | ~~No shell, no app on any platform~~ | Closed 2026-11-17 on `feature/tauri-platforms`: `apps/rosea-tauri`; Windows `.exe` + NSIS installer built and checked (watered, closed, reopened, still watered); Android debug APK verified with `aapt2` (no permission, no backup) and checked on the WAVE 10C, Android 16, offline by construction. 40 shell tests; 14 of 14 drills caught. | | ~~G-T0~~ | ~~No shell, no app on any platform~~ | Closed 2026-11-17 on `feature/tauri-platforms`: `apps/rosea-tauri`; Windows `.exe` + NSIS installer built and checked (watered, closed, reopened, still watered); Android debug APK verified with `aapt2` (no permission, no backup) and checked on the WAVE 10C, Android 16, offline by construction. 40 shell tests; 14 of 14 drills caught. |
| G-T1 | iOS | Open. Needs macOS + Xcode, the iOS Rust targets, an Apple developer account. `pnpm tauri:ios` refuses elsewhere. | | G-T1 | iOS | Open. Needs macOS + Xcode, the iOS Rust targets, an Apple developer account. `pnpm tauri:ios` refuses elsewhere. |
| G-T2 | macOS and Linux desktop builds | Open. Each on its own system; macOS signing/notarisation. | | G-T2 | macOS and Linux desktop builds | Open. Each on its own system; macOS signing/notarisation. |
| G-T3 | Release signing (Android keystore, Windows certificate); AAB; stores | Open. Phase 6. Keys never in the repository. | | G-T3 | Release signing (Android keystore, Windows certificate); AAB; stores | Narrowed 2026-11-19 on `feature/fabrica-release`: the release pipeline signs the installer with Custos's `domi-code-signing` and the APK with `rosea-android` through `custos-sign`; no key in the repository (`fabrica-release.md` F4). **Still open:** `rosea-android` does not exist and Custos (0.22.0 here, 0.24.0 too) will not make it: it is not in Custos's `ANDROID_APPS` (`android-release-apk.md` A6, G-F7); no signature made yet (the first release waits, G-F1); AAB and stores (Phase 6). |
| ~~G-T4~~ | ~~Keep her safe inside the apps — release blocker~~ | Closed 2026-11-17 on `feature/keep-her-safe-apps`: the apps say *She lives in this app, on this device, until the app is removed…* and ask no browser; Android saves through its own save screen by a narrow Kotlin bridge (no plugin, no IPC, no permission) and says *She is in that file now.*; Windows downloads. Seen on the tablet (2 of 2) and on Windows (3 of 3); 572 unit tests; every drill caught after one test was tightened. | | ~~G-T4~~ | ~~Keep her safe inside the apps — release blocker~~ | Closed 2026-11-17 on `feature/keep-her-safe-apps`: the apps say *She lives in this app, on this device, until the app is removed…* and ask no browser; Android saves through its own save screen by a narrow Kotlin bridge (no plugin, no IPC, no permission) and says *She is in that file now.*; Windows downloads. Seen on the tablet (2 of 2) and on Windows (3 of 3); 572 unit tests; every drill caught after one test was tightened. |
| ~~G-T5~~ | ~~Bringing her back from a file inside the apps~~ | Closed on Android 2026-11-17: the round trip on the tablet, *Everything in that file is already here.* Windows not driven. | | ~~G-T5~~ | ~~Bringing her back from a file inside the apps~~ | Closed on Android 2026-11-17: the round trip on the tablet, *Everything in that file is already here.* Windows not driven. |
| G-T6 | WebView2's own traffic not measured for Rosea | Open. Flags from Amicitia's measurement are set; measure before a desktop release. | | G-T6 | WebView2's own traffic not measured for Rosea | Open. Flags from Amicitia's measurement are set; measure before a desktop release. |
| G-T7 | No CI for the apps | Open. With G0.22. | | G-T7 | No CI for the apps | Narrowed 2026-11-19 on `feature/fabrica-release`: `.fabrica/artifex/release.yaml` builds both apps from a tag on Fabrica's Windows runner after every gate; `.fabrica/artifex/e2e.yaml` runs the web suite on the e2e runner. Still Mark's PC, and no run on a push yet (no webhook reaches the hub). |
| 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-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. | | G-T9 | The app icon is the placeholder | Open. With G0.21. |
## Fabrica — released and updated through Fabrica (`fabrica-release.md`)
| Id | Gap | Status / evidence |
|:--|:--|:--|
| G-F1 | The first release is not published | Open, **the author's decision**: the repository is public, so a Gitea release and the Aula page are a public release, which G6.1 holds back. The pipeline, the kit and the words are ready; the tag waits. |
| G-F2 | Canalis Part B: no capability is served | Open by decision (F6): no capability found that neither writes into her nor reads her; Canalis keys need Custos, which a player does not have. |
| G-F3 | No showcase videos | Open: Pensum `kkpy69`, once Fabrica docs/37 is on `main`. |
| G-F4 | `domi-rosea://` not seen working | Open: the hook is tested as text; no installer was run on this PC (it writes the real registry). |
| ~~G-F5~~ | ~~The `phone` target has not run~~ | **Closed 2026-11-21:** `fabrica tests run --target phone` through the hub's queue, run `20261121-101158-uckm` 1 passed 0 failed on the Wave 10 (debug APK `bd59ff908125…`, commit f5d8d2c); the planted-fault drill `20261121-102500-crkf` failed as it must. The e2e pipeline's `phone` step still waits for the hub's e2e runner (Mark). Earlier: narrowed 2026-11-21 (`android-release-apk.md`): `reset: uninstall`, `maxMinutes: 20`, and the e2e pipeline's `phone` step (`device: Wave 10`) puts it in the hub's queue. **Still open:** the Wave 10 is not paired in Fabrica (`fabrica devices list`: *connected (not paired in Fabrica)*), so the step cannot get its phone; pairing is the Fabrica session's. |
| G-F7 | No key signs the APK | Open (`android-release-apk.md` A6): `rosea-android` is not in Custos's `ANDROID_APPS`, so the release's `apk` step stops at `no_key`. Custos's change (or Mark's *Create Android key*), then the release. The unsigned release APK builds and verifies. **Narrowed 2026-11-22:** Custos 0.25.0's table still has no Rosea row. Its *Android grant* makes the key on a release's first signature, from the repo's own `release` pipeline (signing.rs test `the_android_grant_makes_an_apps_key…`). Per the Aula session, Custos 0.25.2 is installed and Mark gave the grant for `mnovak/*`. This is unverified until the first signature. |
| G-F6 | PWA updates have no host | Open with G0.13: the service worker and *Refresh* are built; nothing serves the PWA. |
## Atrium Domi — adoption (`atrium-adoption.md`)
| Id | Gap | Status / evidence |
|:--|:--|:--|
| G-AT1 | Rosea is not Atrium-ready (manifest, service door, hosted mode, backup snapshot, audit, export) | Open, **plan only** (2026-11-22). Inventory: no Tauri invoke or listen, one database (`rosea` IndexedDB), no outgoing request. Step 1 waits for Atrium's `APP_CONTRACT.md` v0, and the later steps wait for their Atrium Day. R1 (keep the origin) and R4 (Rust in the shell) are Mark's. |
## Phase 6 — Release ## Phase 6 — Release
| Id | Gap | Status / evidence | | Id | Gap | Status / evidence |
+104
View File
@@ -0,0 +1,104 @@
# The Android APK in a release, tested on the Wave 10 through Fabrica's phone queue
Branch `feature/android-release-apk`, 2026-11-21. Follows [`fabrica-release.md`](fabrica-release.md) (F1–F11), which
made Rosea a Fabrica app with no release yet.
## 1. Why and what, in the player's terms
Mark asked for every Domi app to ship its APK, tested at least once on a real phone first: *install, open, the first
screen shows, one real action*. For Rosea the real action is to water her, and the check that matters is that she is
still watered after the app is closed and opened again. A rose that forgets her care on a phone is the cruellest bug
this product could have (CLAUDE.md §8).
A player gets the APK from Rosea's Aula page once a release is published. Nothing about the game changes. This
branch changes how the APK is built, tested and released.
## 2. Technical architecture
```mermaid
flowchart LR
subgraph repo["Rosea (this repository)"]
game["apps/rosea → dist-tauri/"] --> shell["apps/rosea-tauri: tauri android build"]
shell --> debug["debug APK (WebView drivable)"]
shell --> unsigned["release APK, unsigned<br/>android.ts verify: no permission, no backup"]
spec["e2e/android/garden.android.ts"]
end
subgraph fabrica["Fabrica (Mark's PC and the hub)"]
e2e["e2e pipeline, runner windows-e2e<br/>step phone: device Wave 10"] --> lease["hub: phone queue lease"]
lease --> run["fabrica tests run --target phone<br/>reset uninstall, install, launch"]
rel["release pipeline: android → approve → apk"]
end
debug --> e2e
spec --> run
run --> phone(("Wave 10"))
unsigned --> rel
rel --> custos["Custos: custos-sign apk, key rosea-android"]
custos --> mini["minisign (domi-release), SHA256SUMS"]
```
- **A1. Two APKs, one game.** The phone test drives the **debug** APK. Only a debug build's WebView can be reached
over DevTools (Fabrica docs/22 part 5), and Tauri's `devtools` feature would make the *release* WebView drivable for
anyone with a cable, so the shipped APK never gets it. The two APKs carry the same `dist-tauri/` game, the same
manifest patch (no `INTERNET`, no backup) and the same `MainActivity`. They differ in the Rust profile and the
signing key. What the phone test cannot prove about the release APK is listed in §5.
- **A2. The phone only through the queue.** The `phone` step of `.fabrica/artifex/e2e.yaml` says `device: Wave 10`.
The hub queues the run for the phone, the runner sets `ANDROID_SERIAL` and `FABRICA_PHONE_LEASED`, and the nested
`fabrica tests run --target phone` uses that phone without a lease of its own (docs/35 part 4). The spec skips
unless Fabrica's environment is there, so it never reaches for a phone by itself.
- **A3. `reset: uninstall`, not the default `clear`.** The target installs the debug APK. A release build of Rosea
on the phone has another key and would refuse the install. `clear` would wipe its data and then fail anyway;
`uninstall` wipes the same data and installs fresh. The Wave 10 is the dedicated test phone (docs/35 part 5), and
no player's rose lives on it.
- **A4. `maxMinutes: 20`.** One test of about two minutes, plus install and launch. Twenty minutes frees the phone
for the next app if the run hangs, well under the 60-minute default.
- **A5. Caches off C:.** Both pipelines name `GRADLE_USER_HOME` on `D:\build\rosea\gradle` and the NDK
(`NDK_HOME`, which the Tauri CLI needs and this PC does not set). A local build also puts Cargo's target folder,
`TEMP` and `ANDROID_USER_HOME` under `D:\build\rosea`. The pipelines keep Cargo's target in the checkout, because
the installer's artifact glob is there.
- **A6. Signing: `rosea-android` does not exist, and Custos will not make it.** Custos creates an Android key on an
app's first release only for the apps in its `ANDROID_APPS` table (`apps/desktop/src-tauri/src/signing.rs`). In
0.24.0 that table holds Postea, Culina and Liber, and Mark's PC runs 0.22.0, which holds Postea only. Rosea's `apk`
step would stop at `no_key`, as Culina's and Liber's did on 2026-11-20. Two fixes exist, and both belong to
Custos and Mark, not to this repository: a Custos change that adds `rosea-android` (`CN=Rosea Domi`, only
`mnovak/Rosea`, pipeline `release`) and its install on this PC, or Mark's *Create Android key* by hand.
`fabrica-release.md` said "Custos makes the key on the first release". It was wrong, and is corrected here.
- **A7. The certificate is forever.** Once a player installs an APK signed with `rosea-android`, every update must
carry the same certificate (CLAUDE.md §8). The CN names the product, *Rosea Domi*, and the name is still provisional.
The key outlives a rename: a renamed app keeps the old CN, and no player sees it.
## 3. Risk analysis
| Risk | Where | Answer |
| :-- | :-- | :-- |
| A player's rose lost on the test phone | `reset: uninstall` | The Wave 10 is Fabrica's dedicated test phone (docs/35 part 5). The memory rule stands: Fabrica stops the app after the run, and the spec force-stops it in `finally` as well. |
| The release APK phones home | the APK | `android.ts verify` reads the built APK with `aapt2` and refuses any permission or backup flag. It runs in the release pipeline's `android` step and in every local build. |
| Someone made reachable | none | No network feature. The APK asks for no `INTERNET` permission, so the kernel refuses every socket. |
| A tester's place on the phone | the spec | The spec chooses *Not now*, so no town is ever chosen on the phone. |
| A release signed with a stand-in key | signing | The `apk` step names `rosea-android` only, through Custos, and refuses `CUSTOS_PIPE` (sign-apk.ts). There is no fallback to a debug or local keystore. A missing key stops the release. |
| An untested APK published | the release | The phone test is a pipeline of its own: phones are leased per run, and the release must not hold the phone for two hours. Until the e2e pipeline's `phone` step has passed on a commit, that commit is not tagged (process, §5). |
## 4. Gap analysis and the designed solution
| Gap | Solution here | Left open |
| :-- | :-- | :-- |
| The phone target did not say `reset` or `maxMinutes` (the old CLI refused them) | The installed CLI reads both now: a planted `reset: wipe-everything` is refused by `fabrica artifex check`. Written: `reset: uninstall`, `maxMinutes: 20`. | none |
| No pipeline put the phone run in the queue | `e2e.yaml` gains `apk` (`pnpm tauri:android`) and `phone` (`device: Wave 10`). | It has not run: the Wave 10 is not paired in Fabrica (below). |
| The release pipeline's Android step lacked the NDK and put Gradle on C: | `NDK_HOME` and `GRADLE_USER_HOME` in `release.yaml`'s env. | none |
| The release APK was never built | Built here with caches on D:, then checked by `android.ts verify` (§5). | Not signed (A6). |
| `rosea-android` | Named as Custos's change (A6). | **Custos's and Mark's.** |
| The Wave 10 is not paired in Fabrica | `fabrica devices list` shows `WAVE 10C connected (not paired in Fabrica)`. `pass::resolve` then finds no phone named *Wave 10*, and the step fails before it runs. | **The Fabrica session's** (Pipelines → Workshop → Devices → Pair a phone). |
| Publication | G6.1: the repository is public, so a release is public, and a legal check of the look comes first. | **Mark's** (`fabrica-release.md` F1). |
## 5. Verification matrix
| Case | Kind | How | Status |
| :-- | :-- | :-- | :-- |
| The release APK builds with every cache off C: | build | `pnpm tauri:android-release` | done 2026-11-21: 27 min from cold (Gradle 9.6.1 downloaded to D:), 5.60 MiB, arm64-v8a, versionCode 1000, sha256 4d52e9eca4cd2e56… (unsigned) |
| The release APK asks for no permission and allows no backup | build check | `android.ts verify <unsigned apk>` (aapt2) | done: verified; `aapt2 dump badging` shows no `debuggable` and only androidx's own `DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION` (the app's own signature permission, not a capability) |
| `reset` and `maxMinutes` are read, and a wrong `reset` is refused | config | `fabrica artifex check` with a planted value | done: refused with `targets[1].reset: clear, uninstall or keep` |
| The pipelines are valid | config | `fabrica artifex check` | done: 0 problems |
| Install, open, first screen, water, close, reopen, still watered | e2e, real phone | `fabrica tests run --target phone` through the hub's queue (the e2e runner is not yet added, so not the pipeline step) | done 2026-11-21: run `20261121-101158-uckm` **1 passed, 0 failed** (7.9 s; waited 12 s in the queue) on the Wave 10, Android 16, debug APK sha256 `bd59ff908125…`, commit f5d8d2c |
| The phone test fails when persistence is wrong | e2e drill | planted `Days of care 2`, run through the queue, restored by copy | done: run `20261121-102500-crkf` **0 passed, 1 failed**, received `Days of care1` after the reopen |
| The spec never reaches for a phone outside the queue | e2e | `test.skip` without `FABRICA_TESTS_PACKAGE` and `ANDROID_SERIAL` | by construction |
| The signed APK verifies with `rosea-android`'s certificate | release | the `apk` step (custos-sign verifies with apksig) | **not run**: no key |
| What the debug test cannot prove about the release APK | manual | install the signed release APK on the Wave 10 once, water, close, reopen | after the key exists |
+189
View File
@@ -0,0 +1,189 @@
# Atrium adoption: making Rosea Domi "Atrium-ready" (plan)
Status: **plan only**, `docs/atrium-adoption`, 2026-11-22. No code changes yet. The brief is Mark's, passed on by the Aula
session: prepare Rosea for Atrium Domi. The source is `F:\Akce\Atrium-plan\ROADMAP.md` §1–2 and Appendix A. Rules for when each step may start:
- Step 1 code waits for Atrium's `docs/APP_CONTRACT.md` v0 on its `main`.
- Each later step waits until its Atrium Day lands.
- Visual changes wait for `@domi/ui`.
This file is the inventory Appendix A asks for, plus the decisions those steps would force on Rosea. Its §6 lists the questions for Mark.
## 1. Why and what, in the player's terms
Atrium Domi is the single free thing a Domi user installs:
- a tray service that handles updates, licences, backup and the record of *What left this computer*;
- a window whose rooms are the Domi apps.
For Rosea, three things matter to the player:
- **Backup.** Her rose is backed up with everything else, in one click, with no account. This is a stronger answer to
the trap Rosea fears most, a player coming back to find her gone (CLAUDE.md §8), than *Keep her safe* alone.
- **The record.** *What left this computer* shows Rosea as having sent nothing, which is the truth.
- **Standalone.** The garden opens inside Atrium's window, and the app still opens on its own exactly as today.
Atrium is the door, not a lock (ROADMAP §1).
Nothing about the game changes. The PWA and the Android app are not part of Atrium; Atrium is a Windows desktop
service plus a NixOS server edition.
## 2. Inventory (what Appendix A asks for)
### 2.1 Direct Tauri invoke/listen in the UI (for `@domi/bridge`, step 2)
**None.** The shell is *a window and nothing else* (CLAUDE.md §2). Here is what was checked on `main` (b307655):
- **No Tauri JavaScript API.** No `@tauri-apps/api` dependency anywhere, and no `invoke(`, `listen(` or `__TAURI__`
in `apps/rosea/src` or `packages/*/src`.
- **No commands, no plugins, no IPC grant.** `apps/rosea-tauri/src-tauri/src/lib.rs` is a bare `tauri::Builder`, and
`capabilities/` is absent on purpose, so the page has no IPC at all.
- **The one native bridge is Android-only and not Tauri.** It is `window.roseaFile.save(name, text)`, registered
with `addJavascriptInterface` in `apps/rosea-tauri/android/java/MainActivity.kt`. It is used by
`apps/rosea/src/App.svelte` for *Keep her safe* (`keep-her-safe-apps.md`) and pinned by
`apps/rosea-tauri/test/android-bridge.test.ts`. Atrium has no Android part, so it stays.
- **The one shell switch is a build-time constant,** `__ROSEA_SHELL__`, read only in `App.svelte`.
So step 2 has nothing to replace. It becomes a guard: a test that the game still imports no `@tauri-apps/api`
(added with step 1 or 3, whichever comes first).
### 2.2 Data folders and databases (for `rosea.backup.snapshot`, step 4)
**Rosea writes one thing: the IndexedDB database `rosea`**, through Dexie in `packages/storage` (schema version 2):
| Store | Contents | Can be remade? |
|:--|:--|:--|
| `profile` | the rose's name, the gardener, the chosen sunset town (or none), settings, `pastKeys` | the name, gardener and town take a tap each; `pastKeys` cannot be remade |
| `events` | the append-only care log, *the truth* (CLAUDE.md §4) | **no** |
| `keys` | the identity keypair; the private key is a **non-extractable** WebCrypto key | **no, and it cannot be read out at all** |
It sits in the webview's profile and is not a file of Rosea's own:
| Version | Folder |
|:--|:--|
| Windows (the only one Atrium sees) | `%LOCALAPPDATA%\cz.mareknovak.domi.rosea\EBWebView\` (WebView2's user data folder). The database is LevelDB under `Default\IndexedDB\https_tauri.localhost_0.indexeddb.leveldb` *(this exact path is predicted on Windows; it was seen on Android)* |
| macOS, Linux | WKWebView / WebKitGTK data folders *(predicted)*, CLAUDE.md §4 |
The Rust side writes no file. There is no SQLite.
### 2.3 Every outgoing network request (for the audit, step 5)
**None from Rosea.** The evidence:
| Layer | What holds it |
|:--|:--|
| The game | no `fetch`, `XMLHttpRequest`, `WebSocket`, `sendBeacon`, `EventSource` or `RTCPeerConnection` in `apps/rosea/src` or `packages/*/src` (grep, b307655) |
| The page's policy | CSP `connect-src 'self'` and `default-src 'self'`, from `tauri.conf.json` `app.security.csp`, held equal to the PWA's `<meta>` by the shell's test |
| The WebView2 runtime | `additionalBrowserArgs` switches off its own calls home: DoH, SmartScreen, Autofill, Translate, background networking, component update and more (CLAUDE.md §8, *the webview phones home*). **Not yet measured on Windows** |
| Android (not in Atrium) | no `INTERNET` permission, checked with `aapt2` on every build |
What could leave in future:
- the WebView2 runtime itself, if a runtime update breaks the switches;
- Phase 3 friend sync (WebRTC);
- Phase 4 `lucerna`.
Each of those gets its `fundamentum.audit.record` when it arrives. The step-5 test for Rosea is the reverse of the
Appendix's: *any* request fails the suite. Today that means a built-app e2e that records every request and expects
none outside the origin. The offline suite already comes close.
### 2.4 Accent and icon (for `domi-app.toml`, step 1)
| Field | Proposal | Source |
|:--|:--|:--|
| `id` | `rosea` | the `@rosea/*` scope, `domi-rosea://` |
| `name` | `Rosea Domi` | `packages/schema/src/constants.ts`; *Domi* never alone |
| `label` | `Rose` *(judgment: a plain word, as Appendix A asks)* | — |
| `accent` | `#b4485e` (`--rose`, light); on the dark Domi theme `#e8899b` (`--rose`, dark) | `packages/ui/src/tokens.css`; the web manifest's `theme_color` |
| `icon` | `apps/rosea/public/icon.svg`, a **placeholder** (form only). The real icon comes through `docs/ART.md` | the shell's icons are made from it at build time |
| `ui_bundle` | `apps/rosea/dist-tauri/` (base `/`, no worker, no manifest) | §3, R1 |
| `hostable` | `true`, with the origin rule in R1 | — |
| `free` | **Mark's to say** | — |
| `capabilities` | `rosea.backup.snapshot`, `rosea.ui.*` (hosted), later `rosea.export.open`. **No** `rosea.atrium.badge` | §5 |
## 3. Technical architecture (as planned)
```mermaid
flowchart LR
subgraph atrium["Atrium Domi (not in this repo)"]
svc["atrium-service<br/>\\.\pipe\domi-atrium"]
win["Atrium window"]
end
subgraph shell["apps/rosea-tauri (Rust)"]
door["service door client<br/>(new, step 1)"]
snap["rosea.backup.snapshot<br/>(new, step 4)"]
end
subgraph game["apps/rosea + packages/* (unchanged)"]
store["packages/storage<br/>exportRose / importRose"]
idb[("IndexedDB rosea<br/>in WebView2's folder")]
end
svc <--> door
door --> snap
snap -. "asks the page" .-> store --> idb
win -. "hosts rosea.ui.* (step 3)" .-> shell
game -. "imports nothing of Atrium's" .- atrium
```
**The seam stays where it is.** The game never learns Atrium exists, just as it never learns which shell it is in
except through `__ROSEA_SHELL__`. Everything Atrium needs lives in `apps/rosea-tauri`. That shell stays deletable,
and the PWA stays whole without it.
### Decisions this forces (proposed; Mark decides those marked so)
| # | Proposal | Why |
|:--|:--|:--|
| R1 | **Hosted mode keeps Rosea's own webview and origin.** Atrium shows Rosea's window as a room (`--hosted` = Rosea's process, its WebView2 folder, `https://tauri.localhost`). Atrium does not load `ui_bundle` in a webview of its own. | IndexedDB is per origin and per profile. A bundle loaded by Atrium's webview opens an **empty** database, and the player meets a new rose with hers apparently gone: the cruellest bug this product could have (CLAUDE.md §8, *the origin is forever*). If Atrium can only host by loading the bundle, Rosea is `hostable = false` until a migration is designed. |
| R2 | **The snapshot is the care log, taken by the game**: `exportRose`'s `rosea-rose` file (`keep-her-safe.md` K1: keys + events, never the private key, never the town). The shell asks the page for it and writes it into the folder the service gives. | Copying LevelDB from under a running webview is not consistent, and the private key cannot be copied at all. The `rosea-rose` file is the one format already tested to restore additively (K3, K4). |
| R3 | **Restore is *bring her back*,** not a byte copy. It goes through `importRose`, which only appends. The restored rose lives under a new key with her old care intact (K2). | Contributions only add, and the log is never rewritten (CLAUDE.md §1, §6.2). |
| R4 | **Mark decides:** the shell gains Rust code and a local named-pipe client, the first code beyond *a window*. Step 4 needs one page↔shell channel: one Tauri command, or `eval` plus an event, granted only to Rosea's own origin. | This changes CLAUDE.md §2 (*no Tauri command, no plugin*). The pipe is local, not a network, but it is new surface. It is reviewed like a plugin, for network access. |
| R5 | **No badge, and *today* only if Mark wants it.** If there is a `rosea.atrium.today` at all, it is the real sunset time (*points beyond the screen*). It never mentions the rose's state. | A badge is a count, and a count about her waiting is guilt with a ribbon (CLAUDE.md §8). |
| R6 | **Export (step 7) is the `rosea-rose` JSON**, an open format, with a README line. | It exists already. |
| R7 | **The name gains a fifth place** (`domi-app.toml`). The shell's test holds it equal to the constants, as it does for `tauri.conf.json`. | Renaming stays one commit (CLAUDE.md, header). The list in CLAUDE.md needs that line; it is the author's file. |
## 4. Risk analysis
| Risk (a person feeling worse, a location, someone reachable) | Where | Answer |
|:--|:--|:--|
| Her rose seems gone inside Atrium | hosted mode | R1: same origin and profile, or not hostable; an e2e that opens her in both and sees the same days of care |
| A restore takes care away | backup | R3: additive import only, property-tested already (K3) |
| The town leaves the device in a backup | snapshot | it is not in the file (K1). Backups are encrypted by Atrium, and the target is the player's |
| A badge or a *today* line that blames | Atrium Home | R5 |
| The pipe becomes a way in | step 1 | Canalis's Noise handshake with Tessera keys (ROADMAP §2); Rosea serves only `rosea.*` to Atrium |
| Atrium not running pulls the player away from her | step 1 | the wait and the *Atrium Domi is not running* card must never stand between a cold open and the garden. Rosea opens first, and the card is a quiet line, never a blocker (*three taps to action, one preferred*) |
## 5. Gap analysis and steps
Only the steps whose Atrium Day has landed may start, and Aula says when.
| Step | Atrium Day | Rosea's work | State |
|:--|:--|:--|:--|
| 1 Manifest + service door | Day 1 + `APP_CONTRACT.md` v0 | `domi-app.toml` (§2.4), the pipe client in the shell, R7's test | waits for APP_CONTRACT v0 |
| 2 Bridge | Day 4 | nothing to replace (§2.1); a guard test | waits |
| 3 Hosted mode | Day 4 | `--hosted`, `rosea.ui.*`, R1 | waits; R1 needs Atrium's answer |
| 4 Backup snapshot | Day 3 | R2, R3, R4; a test: a snapshot taken while she is watered restores to a consistent, additive state | waits; R4 is Mark's |
| 5 Audit | Day 2 | no request to record; a test that none is made (§2.3) | waits |
| 6 Today/search | Day 6 (optional) | R5 | Mark's choice |
| 7 Export | Day 8 | R6 | waits |
| 8 Release | — | through Fabrica, as today | waits for G6.1 and G-F1 |
Visual changes (the room's look, `@domi/ui`) wait for `@domi/ui`.
## 6. Questions for Mark (through Aula)
1. **R4:** may the shell gain Rust code, a local pipe client and one page↔shell channel? This amends CLAUDE.md §2.
2. **R1:** can Atrium host a room as the app's own window, keeping its origin? If not, Rosea is `hostable = false` for now.
3. Is Rosea **free**?
4. **R5:** should Rosea have a *today* line at all, with the sunset time only?
## 7. Verification matrix (for when the steps are built)
| Case | Kind |
|:--|:--|
| The garden opens standalone exactly as before, with Atrium absent and with it present | e2e (built `.exe`) |
| A cold open is never blocked by a missing service | e2e |
| The hosted room shows the same days of care as the standalone app | e2e, manual |
| A snapshot taken mid-watering restores without losing or doubling an act | integration |
| A restore of yesterday's snapshot adds, never removes | integration (K3's property test reused) |
| `domi-app.toml`'s name equals the constants | unit |
| The game imports no `@tauri-apps/api` | unit |
| No request leaves the origin | e2e on the built app |
| The pipe client refuses a peer without Atrium's key | integration (`canalis-testkit`) |
+196
View File
@@ -0,0 +1,196 @@
# Released through Fabrica: the release kit, the Aula page, updates, `domi-rosea://`, the showcase, the test targets
*Platform track.* Mark asked on 2026-11-19 that every Domi app be released and updated through Fabrica
(Fabrica `docs/36_app_onboarding.md`, the checklist this doc follows). This repository's CLAUDE.md wins
where the two disagree, and this doc says where they do.
## 1. Why and what, in the player's terms
Today a Rosea app reaches nobody: the Windows installer and the Android APK are build output on one
machine (G-T7, G0.22), and nothing tells an installed copy that a newer garden exists. After this
feature:
- **One release, built the same way every time.** A `vX.Y.Z` tag makes Fabrica's Windows runner run
every gate of §5.5 on a clean checkout, build the Windows installer and the Android APK, take the
pictures, and stop at Mark's Custos card. Only then is anything signed or published.
- **A page that shows her honestly.** The release carries what Aula needs for Rosea's page: a few
sentences, pictures of the built game on invented demo data (a rose tended for two weeks in an
invented garden), and the release notes. Nothing of Mark's own rose is ever in a picture.
- **Her next version arrives without a network feature in the game.** The apps still make no network
call of their own (§2, §8). The installed copy on Mark's PC moves to each release through Fabrica's
*Update all*; a player installs the next installer or APK over the old one, and her rose stays.
- **Other Domi apps can open the garden.** `domi-rosea://open` opens Rosea on Windows (Canalis
Part A). Nothing can reach into her: no other app can write into her care, read it, or send words.
**What this is not.** Not a public launch. Rosea's repository on Gitea is public, so a published
release and an Aula page are public too, and CLAUDE.md §8 and G6.1 say a legal check of the look
comes before any public release. This feature builds the release and the page; **publishing them is
Mark's decision** (F1).
## 2. Technical architecture
```mermaid
flowchart LR
tag["tag vX.Y.Z<br/>(Fabrica Deploy)"] --> hub["Fabrica hub"]
hub --> runner["Windows runner<br/>(Mark's PC)"]
subgraph repo["this repository at the tag"]
gates["pnpm lint · typecheck · test<br/>validate:library · lint:copy"]
build["turbo build: schema → engine/content/ui → @rosea/app"]
e2e["e2e + offline<br/>(built app, /Rosea/)"]
shots["pnpm aula:shots<br/>e2e/aula.spec.ts → e2e/aula/*.png"]
desktop["@rosea/tauri build:desktop<br/>NSIS installer + domi-rosea hook"]
android["@rosea/tauri build:android-release<br/>unsigned release APK, aapt2 verify"]
end
runner --> gates --> build --> e2e --> shots
build --> desktop
build --> android
shots --> kit["fabrica notes · aula shots · aula page"]
desktop --> approve{"Custos card<br/>(Mark)"}
android --> approve
kit --> approve
approve --> sign["Authenticode (domi-code-signing)<br/>APK (rosea-android, custos-sign)<br/>minisign (domi-release)"]
sign --> publish["Gitea release + signed SHA256SUMS"]
publish -. "only once Mark decides (F1)" .-> aula["Aula page /rosea/"]
publish --> update["Fabrica Update all<br/>(Mark's PC)"]
```
Packages and files:
| Piece | Where | Reads |
| :-- | :-- | :-- |
| The Fabrica app | `.fabrica/app.yaml` | — |
| The release pipeline | `.fabrica/artifex/release.yaml` | the repo at the tag |
| The e2e pipeline | `.fabrica/artifex/e2e.yaml` (`runner: windows-e2e`) | `.fabrica/tests.yaml` |
| The test targets | `.fabrica/tests.yaml`, `e2e/playwright.fabrica.config.ts`, `e2e/android/` | the built bundle; the debug APK |
| The pictures | `e2e/aula.spec.ts`, `e2e/playwright.aula.config.ts`, `.fabrica/aula.yaml` | the built bundle (PWA, `/Rosea/`) |
| The page's words | `AULA.md`, `.fabrica/aula/brief.md`, `.fabrica/notes/<version>.md` | — (checked by `lint:copy`) |
| The version check | `scripts/check-version.mjs` | the four version files |
| The scheme (Part A) | `apps/rosea-tauri/src-tauri/windows/hooks.nsh`, `tauri.windows.conf.json` | the installer only |
| The release APK | `apps/rosea-tauri/package.json` `build:android-release`, `scripts/android.ts` | the generated project |
The dependency direction of §2 is unchanged: no package gains an import, the game gains no code, the
shell gains no Rust, no crate and no plugin. Fabrica reads this repository; this repository imports
nothing of Fabrica's.
### Decisions
- **F1 — Built and signed, published only when Mark says.** The pipeline is complete: on the hub it
builds, signs after the card and publishes. Because the repository is public, the first `publish`
is a public release (G6.1). The tag is therefore made only after Mark answers. Until then the run is
made locally (`fabrica run release --step page`, which signs as a dry run). The Aula entry for the
server's `modules/aula.nix` is written down in the handover, not added.
- **F2 — One part, `desktop`; no `server` part.** The release pipeline makes both apps (Windows and
Android). The PWA's host is still the author's open question (G0.13: GitHub Pages under `/Rosea/`),
and a server part would be a NixOS module on the server, which is not this repository's to change.
When the PWA gets a host, a `server` part (or a Pages job) is added then.
- **F3 — Updates, the app's own way, with no network in the game.**
| Version | How an installed copy reaches the next release | Why not the other way |
| :-- | :-- | :-- |
| Windows | Fabrica *Update all* on Mark's PC (Fabrica docs/16): the signed `SHA256SUMS` checked against `domi-release`, the installer run with `/S /UPDATE` in place. A player runs the next installer over the old one (`installMode: currentUser`, same identifier): the WebView2 data folder, and so her rose, stays. | `tauri-plugin-updater` is a network feature and a plugin in the shell; §2 allows neither until one is reviewed for what it sends. An update check would tell a server, daily, that this person plays. No `latest.json` is published, so nothing waits for an updater that does not exist. |
| Android | The next APK, signed with the same `rosea-android` key and a higher `versionCode` (Tauri derives it from the version), installs over the old one and keeps her. A player gets it from the Aula page; the test phone gets each debug build from its `android` target. | An in-app check needs the `INTERNET` permission, which the APK must not ask for while Rosea has no network feature (§2; `android.ts verify` refuses any permission). |
| PWA | The service worker: a new bundle is a new worker, offered with *A new version of the garden is ready.* and *Refresh* (calm-refresh.md, G0.10). | Nothing to add here until it has a host (F2). |
| iOS | Not built (G-T1: needs a Mac). | — |
- **F4 — Signing through Custos only.** Authenticode with `domi-code-signing` for the installer;
the APK with `rosea-android` through `custos-sign apk` (corrected 2026-11-21, `android-release-apk.md` A6:
Custos does NOT make this key; it must be added to Custos's `ANDROID_APPS` or made by hand; a `run` step that names it in `keys:` so preflight checks it);
`domi-release` signs each file's minisign signature and `SHA256SUMS`. No key, password or token is
in the repository, a pipeline file or a log (G-T3). Each key's scope must name `mnovak/Rosea` exactly:
Mark's step in Custos, which `fabrica preflight rosea` names when it is missing.
- **F5 — `domi-rosea://open` from the installer (Canalis Part A).** The NSIS installer writes
`HKCU\Software\Classes\domi-rosea` (`URL Protocol`, `shell\open\command` = `"<exe>" "%1"`) after
install, and the uninstaller removes the key. **The installer, not every start**, because the shell is
a window and nothing else (§2): registering at start needs Rust code (a registry crate) in it. An
*Update all* or a reinstall runs the installer again in the install folder, so the command follows
the exe. The game ignores the URL: an open of `domi-rosea://…` opens the garden. If Rosea is already
open, a second window opens on the same data (no single-instance plugin, §2); two-tabs.md keeps both
windows true to the log. The app id is `rosea`, the identifier `cz.mareknovak.domi.rosea` is unchanged.
- **F6 — Canalis Part B is not done, and no capability is served.** Three reasons, each enough alone:
(1) a capability lets another program act on the player's garden, and §1 says *contributions only
add* and the care log holds only the player's own acts: a `rosea.care.*` capability would make a
number on screen that the player did not earn; (2) Canalis keys come from Custos (`custos_local`),
which a Rosea player does not have and must never need: Rosea's identity is its own anonymous
keypair (§1); (3) it would add Fundamentum crates, a server thread and IPC to a shell that has none.
So there is nothing to pin: Rosea has no Fundamentum crate, and `canalis-v1.1.0` does not apply.
Reopen with a capability that only *reads nothing and adds nothing* to her, if one is ever found.
- **F7 — The pictures come from the app's own Playwright run, on demo data the app itself made.**
`pnpm aula:shots` serves the built PWA, fixes the clock (Europe/Prague, 08:00 on fourteen
invented days in March 2026), answers the first open with the gardener's first look and the town
*Prague* (a public place, chosen from the bundled list; never a real player's town), waters her once
a day by the button as a player does, and photographs: the garden, the ring of care, her numbers,
the in-game sunset, *Keep her safe*, the first open, and the same garden on a phone's screen.
`.fabrica/aula.yaml` lists them as `file:` shots; `fabrica aula shots` checks and publishes them.
The PWA is built under `/Rosea/`, so Fabrica's own `web:` server (which serves at `/`) is not used.
**No iPhone pictures:** there is no iOS app yet (G-T1), and the PWA has no host to add to a Home
Screen (G0.13); a picture of an iPhone would show a version nobody can install.
- **F8 — Videos wait for Fabrica docs/37.** Until a `videos:` key is on Fabrica `main`, it fails
`fabrica aula shots`; the Pensum ticket `kkpy69` (*Showcase videos of the main flows for the Aula page*) holds the work.
- **F9 — Two test targets.** `.fabrica/tests.yaml`: `web` (the built PWA in a headless Chromium, the
`web` project of `e2e/playwright.fabrica.config.ts`, the same specs as `pnpm test:e2e`) and `phone`
(`kind: android`, `device: Wave 10`, the debug APK; the queue clears the app's data first, its default
`reset: clear`). `reset: uninstall` would let a debug build replace a release build, but the installed
Fabrica CLI (0.14.0) does not know `reset` or `maxMinutes` yet, so neither is written. The `android` project reaches the app's WebView with Playwright's
`_android` and waters her by the button. It runs **only through Fabrica's phone queue**
(`fabrica tests run --target phone`); `pnpm test:android` drives Chrome on a USB tablet and stays the
developer's own check of the PWA. `.fabrica/artifex/e2e.yaml` runs the `web` target on the e2e runner.
- **F10 — The version is in four files.** `package.json`, `apps/rosea/package.json` (which
`tauri.conf.json` reads), `apps/rosea-tauri/package.json` and `apps/rosea-tauri/src-tauri/Cargo.toml`.
`scripts/check-version.mjs <version>` prints each that differs in Fabrica's contract
(`<file> says <old>, the tag says <new>`), so *Deploy* bumps exactly those. The first release is
`v0.1.0`, the version every file has today.
- **F11 — The page's words are copy.** `AULA.md`, `.fabrica/aula/brief.md` and `.fabrica/notes/*.md`
are what a stranger reads about Rosea, like a store listing (§8). `lint:copy` scans them, so the
page never says *lonely*, never names the book, and makes no claim to heal anything. The release
notes `fabrica notes` writes from commit subjects are copy too: the release's `notes-copy` step runs
`lint:copy` over `target/notes/release-notes.md` before the page is made.
## 3. Risk analysis
Here risk means *a lonely person feeling worse*, *someone's location*, or *someone being reachable who
did not ask to be* (§5.1).
| Risk | Where | Answer |
| :-- | :-- | :-- |
| The page names the person it is for: *for lonely people* | `AULA.md`, the brief, the notes | They speak of the rose, the fox and the time we give to people, never of the reader's state. `lint:copy` scans all three (F11); a test of the script proves they are in its list. |
| The page promises comfort, or a cure | the same | No outcome is promised; the medical words are refused by `lint:copy`. |
| The book's look on a public page | the pictures (gardener, round planet, rose) | G6.1: not published until Mark decides (F1). The pictures are the code stand-ins, said plainly in the brief. |
| A real person's rose or town in a picture | `e2e/aula.spec.ts` | The demo rose is made by the test in a fresh browser profile; the town is a capital from the bundled list; the clock is invented. No file, no IndexedDB of a real profile is read. |
| An update check that tells a server who plays | the apps | None exists (F3). The apps still ask for no `INTERNET` permission and the shell links no plugin; `android.ts verify` and the shell's tests keep it so. |
| Auto Backup or a release build that carries debug flags | the release APK | `android.ts verify` runs on the release APK too (no permission, no backup); `custos-sign` refuses a debuggable APK. |
| Another program reaches into her | `domi-rosea://` | The URL only opens the window; its text is not read (F5). No capability is served (F6). |
| A web page opens Rosea | `domi-rosea://` | The browser asks first, as for any app link; the garden opens and does nothing else. |
| A signing key in the repository | the pipelines | Keys are Custos ids only; `custos-sign` holds no key material either (F4). |
| A release over a player's rose loses her | Windows, Android | Same identifier, same origin (`useHttpsScheme`, pinned by the shell's test), install over, never uninstall. On Android the same key; a debug and a release build cannot replace each other, so the test phone keeps debug builds only. |
| The phone is used outside the queue | the `phone` target | Only `fabrica tests run --target phone` runs the `android` project. The `android` project skips, saying why, without `FABRICA_TESTS_PACKAGE` and `ANDROID_SERIAL` (set by Fabrica). |
## 4. Gap analysis and the designed solution
| Gap | Before | After |
| :-- | :-- | :-- |
| G-T7 / G0.22: no CI for the apps | built by hand on this machine | built by Fabrica's runner from the tag; still on Mark's PC, but from a clean checkout and the same steps every time |
| G-T3: release signing keys | none | Custos only (F4) |
| No release, no page | — | the pipeline, the kit and the words; publishing is F1 |
| Installed copies never learn of a new version | — | F3 |
| No `domi-rosea://` | — | F5, Windows only |
| Nothing to show a stranger | — | F7, eight pictures |
| G0.23 (source maps) | maps in the PWA build | unchanged and still open: the installer embeds `dist-tauri/`, maps included; the source is public on Gitea already, so nothing new is exposed |
Not closed here: G6.1 (Mark's legal check), G0.13 (the PWA's host), G-T1 (iOS), Canalis Part B (F6),
the videos (F8).
## 5. Verification matrix
| Case | Unit | Integration | E2E / device | Manual |
| :-- | :-- | :-- | :-- | :-- |
| `check-version` passes with all four files equal, names each file that differs in the contract's words | `scripts/check-version.test.ts` | — | — | `node scripts/check-version.mjs 0.1.0` |
| `lint:copy` reads `AULA.md`, the brief and the notes; a forbidden word in any of them fails | `scripts/lint-copy.test.ts` | `pnpm lint:copy` | — | — |
| The pipelines and `tests.yaml` are valid | — | `fabrica artifex check` | — | `fabrica preflight rosea` |
| The NSIS hook registers and removes exactly `HKCU\Software\Classes\domi-rosea` with `"%1"` | `apps/rosea-tauri/test` (the hook's text and the config that names it) | `pnpm tauri:build` makes the installer | — | not run: installing writes Mark's real registry |
| The release APK has no permission and no backup | `android-privacy` tests (unchanged) | `build:android-release` ends with `android.ts verify` on it | — | — |
| The pictures: eight PNGs within Aula's limits, on demo data, the same on every run | — | `pnpm aula:shots`, then `fabrica aula shots` | `e2e/aula.spec.ts` | open them and look |
| The page | — | `fabrica aula brief`, `fabrica aula page` | — | read `aula-page.html` |
| The `web` target | — | `fabrica tests run --target web` | the e2e specs | — |
| The `phone` target: the WebView found, watered by the button, still watered after a restart | — | — | `e2e/android/garden.android.ts`, only through the phone queue | — |
| Bad weather: no `FABRICA_TESTS_PACKAGE` | — | — | the `android` project skips, saying why, before touching adb | — |
| A full release | — | `fabrica run release --step page` locally (signing dry-run) | — | the hub run, after F1 |
+1 -1
View File
@@ -14,7 +14,7 @@ and **how to apply it**.
| [`technical.md`](technical.md) | 10 | The browser and the build as platforms. | | [`technical.md`](technical.md) | 10 | The browser and the build as platforms. |
| [`testing.md`](testing.md) | 16 | What makes a test worth having, and how a passing test lies. | | [`testing.md`](testing.md) | 16 | 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.) | | `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) | 5 | Workflow, commits, credentials, honesty about what shipped. | | [`process.md`](process.md) | 6 | Workflow, commits, credentials, honesty about what shipped. |
A file is created with its first real entry. An empty lessons file only looks like A file is created with its first real entry. An empty lessons file only looks like
knowledge. knowledge.
+25
View File
@@ -70,3 +70,28 @@ it to a file first (the scratchpad), then run the file.
**How to apply it.** Prefix hand-typed adb commands with `MSYS_NO_PATHCONV=1`, or pass arguments from **How to apply it.** Prefix hand-typed adb commands with `MSYS_NO_PATHCONV=1`, or pass arguments from
Node (`spawnSync`), which the shell does not touch. Node (`spawnSync`), which the shell does not touch.
## A bug drill restored with `git checkout` loses the work beside it
**What happened.** On 2026-11-19 (`feature/fabrica-release`) a drill edited `scripts/lint-copy.ts`
and restored it with `git checkout --`. That brought back the *committed* file and silently dropped an
uncommitted change in it (the release notes' entry). The diff showed it at once; it was re-applied.
**Why it bit.** `git checkout -- <file>` restores the index, not the file as it was a minute ago.
**How to apply it.** Commit before drilling, or copy the file aside and copy it back. Check
`git diff --stat` after every drill.
## A claim about another system's behaviour, written from its docs' general rule, was wrong for us
**What happened.** On 2026-11-19 `fabrica-release.md` F4 said "Custos makes `rosea-android` on the
first release". Custos does that only for the apps in its `ANDROID_APPS` table, and Rosea was never in
it (`apps/desktop/src-tauri/src/signing.rs`, read on 2026-11-21). The release would have stopped at
`no_key` after Mark's approval card. Culina and Liber hit exactly that on 2026-11-20.
**Why it bit.** The doc described what Custos does for Postea, and it read like a rule for every app.
Nothing in Rosea could test the claim: the step that would have failed runs only after a human approves.
**How to apply it.** When a step depends on another system doing something for us, find the line in
that system's source or config that names us, and cite it in the analysis. If no line names us,
write the claim as a gap, not as a fact.
+69
View File
@@ -0,0 +1,69 @@
# Review: `docs/atrium-adoption` (2026-11-22)
Analysis: [`../features/atrium-adoption.md`](../features/atrium-adoption.md). This branch is a plan only. It changes no
code, no config and no player-facing words.
## What changed
- New: `.agents/features/atrium-adoption.md`, which holds the inventory, decisions R1–R7, the risks, the steps and
four questions for Mark.
- `.agents/FEATURES.md`: a new row.
- `.agents/GAP_ANALYSIS.md`:
- new section G-AT1;
- G-F7 narrowed: Custos 0.25.0's Android grant can make `rosea-android`.
## How the inventory was made
Everything was checked on `main` b307655.
- **Tauri calls:** a search of `apps/`, `packages/`, `e2e/`, `scripts/` and `tools/` for `@tauri-apps`,
`__TAURI`, `invoke(`, `.listen(`, `addJavascriptInterface` and `__ROSEA_SHELL__`.
- Found only `__ROSEA_SHELL__`, the Android `roseaFile` interface and the Tauri CLI dependency.
- The only `.listen(` is the e2e static server's.
- **Network:** a search of `apps/rosea/src` and `packages/*/src` for `fetch(`, XHR, `WebSocket`, `sendBeacon`,
`EventSource`, `RTCPeerConnection` and absolute URLs. It found nothing.
- **Accent and icon:** read from `packages/ui/src/tokens.css`, the web manifest in `vite.config.ts` and
`apps/rosea/public/icon.svg`.
- **Custos 0.25.0:** `git show v0.25.0:apps/desktop/src-tauri/src/signing.rs` in `F:\Akce\Custos`. Read only.
## Findings
1. **The Windows path of the database is predicted, not seen.** The `…\Default\IndexedDB\…leveldb` part was seen
on Android only. *Marked (predicted)* in §2.2. Measure it when step 4 is built.
2. **"No outgoing request" covers Rosea's code, not the WebView2 runtime.** The switches that silence the runtime
are undocumented feature names, and they have never been measured on Windows (CLAUDE.md §8). *Stated* in §2.3.
A request capture on the built `.exe` belongs in step 5.
3. **Appendix A's hosted mode, read literally, could lose her rose.** If Atrium loads `ui_bundle` into its own
webview, it opens another origin and profile, and so an empty database. *R1 written as a condition of
`hostable = true`*, and asked of Mark and Atrium (§6 Q2). This is the most important line in the plan.
4. **The backup snapshot cannot be a file copy.** LevelDB is live under a running webview, and the private key is
non-extractable. *R2 and R3:* the snapshot is the tested `rosea-rose` file, and a restore only adds. The cost:
a restored rose lives under a new key, as one brought back by *Keep her safe* does. That is said plainly in R3.
5. **Steps 1 and 4 change CLAUDE.md §2's *a window and nothing else*.** *Not decided here.* R4 asks Mark. This
branch does not touch CLAUDE.md.
6. **A badge would be a count about her waiting.** *R5: no badge.* The *today* line is optional and holds only
the sunset time.
7. **The *Atrium Domi is not running* card could stand between a cold open and the garden.** *§4: Rosea opens
first*, and the card is a line, never a wait.
8. **G-F7's narrowing rests on the Aula session's word** that 0.25.2 is installed and the grant is given. *Marked
unverified* until the first signature.
9. **`label = Rose` is a guess.** It is *marked (judgment)*.
## Soul, privacy, reachability, offline
- **Soul:** no change ships. The plan guards against two ways a player could feel worse: R1 (her rose seeming
gone) and R5 (a count that blames).
- **Privacy:** the snapshot file holds no town (K1). Atrium encrypts the backup, and the target is the player's.
- **Reachability:** none. The pipe is local, and Rosea serves only `rosea.*` to Atrium.
- **Offline:** unchanged.
## Gates
This branch is docs only, and no gate covers its files. `pnpm lint:copy` reads player copy and the Letter, neither
of which changed. Not rerun: `pnpm test`, e2e, offline. The bundle was not rebuilt, and this change is invisible to
the player by design.
## Not verified
- Atrium's `APP_CONTRACT.md` does not exist yet. The field names in §2.4 follow ROADMAP Appendix A and may change.
- Whether Atrium can host a room as the app's own window (R1).
@@ -0,0 +1,110 @@
# Review: `feature/android-release-apk` (2026-11-21)
Analysis: [`../features/android-release-apk.md`](../features/android-release-apk.md). The brief was Mark's, relayed by
the Aula session: release each app's APK after the most basic e2e on the Wave 10, through Fabrica's phone queue.
## What changed
- `.fabrica/tests.yaml`: the `phone` target says `reset: uninstall` and `maxMinutes: 20`.
- `.fabrica/artifex/e2e.yaml`: new steps `apk` (`pnpm tauri:android`) and `phone` (`device: Wave 10`,
`fabrica tests run --target phone`); `GRADLE_USER_HOME` on D:, `NDK_HOME` named.
- `.fabrica/artifex/release.yaml`: the same two variables, and the header no longer claims Custos makes `rosea-android`.
- `e2e/android/garden.android.ts`: force-stops the app in `finally`.
- Docs: the analysis, G-T3 and G-F5 narrowed, G-F7 new, `fabrica-release.md` F4 corrected, the handover.
## Gates
See *Counts* at the end (filled in from the run of this branch).
Also run:
- `fabrica artifex check`: 2 pipelines, app.yaml, aula.yaml, tests.yaml and brief.md, 0 problems.
- **Drill:** `reset: wipe-everything` planted in tests.yaml was refused with
`targets[1].reset: clear (the app's data), uninstall or keep`, then restored by copy, not `git checkout`
(lessons/process.md).
- `fabrica tests list --target phone`: 1 test in 1 file.
- **The release APK:**
- `pnpm tauri:android-release` with Gradle, Cargo's target, TEMP and ANDROID_USER_HOME under `D:\build\rosea`: exit 0 in 27 min.
- `android.ts verify`: no permission asked, no backup, metrics and Safe Browsing off.
- `aapt2 dump badging`: `cz.mareknovak.domi.rosea`, versionCode 1000, versionName 0.1.0, arm64-v8a, not debuggable, 5.60 MiB, sha256 `4d52e9eca4cd2e56…`, unsigned.
## Findings
1. **The release pipeline does not require the phone test.** A tag can be released whose debug APK never passed on
the Wave 10. *Deferred, with the reason.* A `device:` step in `release` would queue the whole release for the
phone from the start, and the release runs on `windows`, not `windows-e2e` (docs/35 part 2). The gate is
process for now: no tag on a commit until the e2e pipeline's `phone` step has passed on it (analysis §3). A
pipeline `needs:` across pipelines would close it; Artifex has none today.
2. **The phone tests a debug APK, and the release is a different build.** *Accepted, and stated (A1).* Only a debug
WebView can be driven. The game bytes, the manifest patch and `MainActivity` are the same; the Rust profile and
the key differ. A manual check of the signed release APK on the phone is in the matrix, for after the key exists.
3. **`reset: uninstall` instead of the asked-for `clear`.** *Kept, with the reason (A3):* a release build on the
phone would otherwise block every debug run. It loses nothing more than `clear` would.
4. **`fabrica-release.md` F4 was wrong.** It said Custos makes `rosea-android` on the first release. Custos's
`ANDROID_APPS` table never named Rosea (0.22.0: Postea; 0.24.0: Postea, Culina, Liber). *Fixed* in F4, G-T3 and
the release.yaml header, and a lesson added (process.md). The release would have stopped at `no_key` after Mark's
card, as Culina's and Liber's did.
5. **The debug build in the e2e pipeline uses the default `ANDROID_USER_HOME`** (`%USERPROFILE%\.android` on C:).
Gradle writes `debug.keystore` there if it is missing. *Accepted:* adb's pairing keys live in that folder too
(docs/35 part 2), and moving it for the step could cut the runner off from the phone. It is one small file,
and it is already there.
6. **The pipelines keep Cargo's target in the checkout** (on F:, which is nearly full). *Accepted:* the
installer's artifact glob is relative to it. Only the local build here used D:.
7. **The new `finally` line was never run.** No run of the spec is possible outside the queue. *Not verified*:
typecheck and lint only.
8. **`fabrica devices list` did one reconnect pass** (adb `devices`, mDNS, `adb connect`), and `fabrica devices queue`
asked again for the pending Custos card 836209. Neither installs, starts or taps anything on the phone. Both are
stated here, so nobody reads "nothing touched the phone" as stronger than it is.
9. **The proposed certificate CN *Rosea Domi* outlives the working name** (A7). *For Mark and Custos to decide.*
## Soul, privacy, reachability, offline
- **Soul:** no player-facing change. Nothing can make a person feel worse.
- **Privacy:** the release APK asks for no `INTERNET` permission, has no backup, and has the WebView's metrics off
(verified on the built file). The phone spec chooses *Not now*, so no town is set on the phone.
- **Reachability:** none; there is no network.
- **Offline:** unchanged; the APK cannot reach a network at all.
## Not verified
- The `phone` step and the phone target never ran. The Wave 10 is `connected (not paired in Fabrica)`, and
pairing belongs to the Fabrica session.
- No signature was made. `rosea-android` does not exist (G-F7).
- No release, by G6.1 (G-F1).
- The e2e pipeline was never started on the hub.
## Counts (this branch, 2026-11-21)
- `pnpm test`: **608 passed** (cpu-guard 13, identity 5, schema 19, content 88, storage 70, art-prep 80, release 8,
engine 179, tauri 58, ui 88).
- `pnpm lint`, `pnpm typecheck`: clean. `pnpm lint:copy`: 30 files, 0 problems.
`pnpm validate:library`: 13 of 13 fixtures rejected.
- `pnpm test:e2e` and `test:offline` were **not rerun**. Nothing the browser runs changed: the only code change is
one line in the Android spec, which those suites do not include. Their last counts (26 and 1) are from
`feature/fabrica-release`, on the same game.
## Addendum, 2026-11-21 (`fix/phone-target-run`): the phone target ran through the queue
The Fabrica session got the queue working on the Wave 10. The hub's e2e runner is not added yet, so the target
ran from this session with `fabrica tests run --target phone --as claude`, which takes the phone through the
hub's queue.
| Run | What | Result |
| :-- | :-- | :-- |
| `20261121-101158-uckm` | the spec as merged (f5d8d2c), debug APK sha256 `bd59ff908125…` | **1 passed, 0 failed** (7.9 s). Waited 12 s behind Culina's run. Fabrica uninstalled, installed, started; the WebView was drivable. |
| `20261121-101303-zvve` | drill: `Days of care 2` planted | **error, 0 run.** Waited 424 s behind Postea and Culina, then `adb install failed` with an empty reason. Not the planted fault. |
| `20261121-102500-crkf` | the same drill, once more | **0 passed, 1 failed.** Received `Days of care1` after the close and reopen, so the test checks persistence for real. |
The spec was restored by copy after each drill, and `git status` was checked after.
Findings:
10. **One `adb install` failed with no reason**, on a phone that two other apps' runs had just used. The next
run's `pm uninstall` answered `DELETE_FAILED_INTERNAL_ERROR (not installed)`, so nothing was left behind.
*Not reproduced; not Rosea's code.* For the Fabrica session: the CLI could print adb's stderr when stdout ends
with `:`.
11. **The Aula session's interim rule 2 says `reset: keep`** unless the app's data may be wiped. Rosea's data on the
test phone may be wiped (CLAUDE.md §3: `check-garden.ts android` already `pm clear`s the test app), and the
test needs a first open. *`uninstall` kept* (A3).
12. **The drill ran on the Wi-Fi line** (`192.168.100.127:5555`, rule 1 of the same message) and the passing run on
USB. Both are the same phone. Nothing to fix.
+162
View File
@@ -0,0 +1,162 @@
# Review — `feature/fabrica-release`
Adversarial self-review (CLAUDE.md §5.3). Analysis: [`features/fabrica-release.md`](../features/fabrica-release.md).
PR: https://gitea.marek-novak.cz/mnovak/Rosea/pulls/1 (the first PR on this repository).
Reviewed 2026-11-19 on Windows 10, Node 22.23.4, Fabrica CLI 0.14.0 (installed in `F:\Apps\Fabrica`),
while about twenty other sessions shared the machine: the CPU sat at 100 % for hours, so every run
below waited for the CPU guard (§5.7); none bypassed it.
## What changed for the player
Nothing in the game. The changes are around it:
- **The Windows installer** now also registers `domi-rosea://` for the user, and its uninstaller
removes it. Opening such an address opens the garden.
- **A release** can be made from a tag on Fabrica's runner, signed in Custos, with an Aula page. None
has been made: the first one waits for the author (G-F1, finding 1).
## Gates
Run on the branch head, 2026-11-19, each behind `pnpm guard:cpu` (it refused 6 times; each run waited):
| Gate | Result |
|:--|:--|
| `pnpm lint`, `pnpm typecheck` | 0 problems (svelte-check 0 errors, 0 warnings; 18 of 18 turbo tasks; root and `tools/release` tsc clean) |
| `pnpm lint:copy` | 29 files, 0 problems (now with `AULA.md`, the brief and the notes) |
| `pnpm validate:library` | 13 of 13 fixtures rejected; 78 candidates |
| `pnpm test` | **608 passed**: identity 5, cpu-guard 13, content 88, schema 19, **release 8** (new), art-prep 80, storage 70, ui 88, engine 179, **tauri 58** (+11). A first run under 100 % load timed out one engine test (10.5 s against 5 s; code untouched here) and stopped turbo; the rerun passed. |
| `pnpm test:e2e` | 26 passed. A first run under load timed out the two-profile *keep her safe* test (30 s); the rerun passed. |
| `pnpm test:offline` | 1 passed |
| `pnpm aula:shots` | 2 passed; 8 PNGs (1280 × 800 and 720 × 1600), looked at one by one |
| `fabrica artifex check` | 2 pipelines, app.yaml, aula.yaml, tests.yaml, brief: 0 problems |
| `fabrica aula brief` / `aula shots` / `aula page` / `notes` | the line, 2 paragraphs, 8 captions, 0 problems; 8 shots and `aula.json`; `aula-page.json` and `.html`; 28 changes, 0 copy problems |
| `fabrica tests list` | `web` 26 tests, `phone` 1 test |
| `fabrica preflight rosea --dir .` | 0 blockers, 2 warnings (Custos not checked: finding 2; pnpm's version unread) |
| `pnpm tauri:build` (target on D:) | `Rosea Domi_0.1.0_x64-setup.exe`, 1.31 MiB; the generated `installer.nsi` includes `hooks.nsh` and calls both hooks |
**The bundle** (CLAUDE.md §5.4): the game's code is unchanged, so the PWA bundle is the same; the
installer differs by the NSIS hook. Nothing was deployed or distributed.
## Bug drills
Each test was run with its bug put back, then the file restored by copy (never `git checkout`, see
finding 9):
| Put back | Result |
|:--|:--|
| The hook's command without `"%1"` | CAUGHT (`config.test.ts`) |
| The uninstaller keeps the `domi-rosea` key | CAUGHT (`config.test.ts`) |
| `check-version` forgets `apps/rosea/package.json` (the file the installer and APK read) | CAUGHT (2 tests) |
| `lint:copy` forgets the generated release notes | CAUGHT (`copy.test.ts`) |
| The APK's scope says `mnovak/rosea` | CAUGHT (`sign-apk.test.ts`) |
| `CUSTOS_PIPE` accepted (another Custos signs) | CAUGHT (`sign-apk.test.ts`) |
6 of 6.
## Findings
1. **Publishing is a public release, and G6.1 forbids one (blocker for the release, not the merge).**
The repository on Gitea is public (`private: false`, read anonymously), so a Fabrica `publish` and
the Aula page are public. CLAUDE.md §8 and G6.1: *a legal check of the look comes before any public
release*. **Deferred to the author:** asked through the session that started this one, with three
choices (publish now; make the repository private first; wait). Until then no tag is made. G-F1.
2. **Custos's side was not checked.** `fabrica preflight rosea --dir .` says 0 blockers, 2 warnings, but
the CLI has no `fabrica/` grant yet, so the keys and scopes were *not* checked. Expected blockers
before the first release, each Mark's step in Custos: `domi-code-signing` and `domi-release` must
name `mnovak/Rosea` in their scope; `rosea-android` does not exist (Custos makes it on the first
signature). Running preflight raised a Custos card to certify the Fabrica CLI (match code
836209): it was not retried. **Deferred:** Mark's Custos.
3. **The release's `pnpm test` refuses on a busy PC.** The runner is Mark's desktop, so the CPU guard
runs inside the release; at today's load it would wait three minutes and fail the step after the
install. **Kept:** §5.7 says a dedicated machine may set `ROSEA_CPU_MAX`, a busy desktop may not. A
refused release is re-run when the PC is calm (Fabrica: *Re-run*).
4. **The installed Fabrica CLI does not know `reset` or `maxMinutes`** (docs/35, on Fabrica `main`).
**Fixed:** left out of `tests.yaml`, which now passes `fabrica artifex check`; the reason is in the
file. With the queue's default `clear`, a release build on the phone would block the debug one; the
file says so.
5. **Generated release notes were not copy-checked.** `fabrica notes` writes commit subjects to a page
strangers read; a subject could carry a forbidden word. **Fixed:** `lint:copy` reads
`target/notes/release-notes.md` when it exists, and the release's `notes-copy` step runs before
`page`. Today's notes (28 changes): 0 problems.
6. **Two Custos cards per release.** Fabrica's approval and Authenticode share the run's card; the APK
is signed by `custos-sign` with its own run id (`rosea-v<version>`), so it is a second card (and on
the first release a *first signature* card). **Kept:** the pipeline gives a `run` step no run id to
pass; Postea does the same.
7. **`domi-rosea://` and a running Rosea.** Without a single-instance plugin a second window opens on
the same data. Two windows behave as two tabs (two-tabs.md), so nothing is lost or doubled; a
second window is still a surprise. **Kept**, by §2 (no plugin); written in F5.
8. **Shared Fabrica files.** `F:\Apps\Fabrica\data\workspace.yaml` and `deploy.json` were edited while
other sessions edit them too: Rosea was appended by a read-modify-write within one second, after
another session had added Amicitia and Liber. Both files were read back: every earlier entry is
still there. **Kept:** there is no lock to take.
9. **A drill restored a file with `git checkout` and lost an uncommitted change** (the notes entry in
`lint-copy.ts`). Found at once by the diff, re-applied and committed. **Fixed** the method: drills
now copy the file aside and back.
10. **Gates ran after the first commits, not before** (§5.5 asks for green before any commit). The
machine's load held every full run back for hours. **Fixed in order, not in time:** nothing is
merged before the gates above are green.
11. **The pictures are not the same on every run.** A fresh profile makes a fresh key, and her
weeds and fallen petals follow it, so the garden in two runs differs (weeds in one, none in the
other; water 40 % or 39 % with the hold's real timing). Each picture is still honest. **Kept**,
and Fabrica's `visual` step (docs/28) is not in the release: it would stop every release on a
difference nobody made. A fixed demo key would need a seam in `@rosea/identity`; not worth it now.
12. **Build output on F:.** F: was nearly full (18 GB free, about twenty sessions building). **Fixed
for this session:** Cargo's target and temporary files went to `D:\build\rosea`. The pipeline itself
builds in the runner's folder (`E:\fabrica-runner`). Gradle's home on the runner is its default,
on C:; not changed here (no Android build ran here).
## Soul
*Can this make a lonely person feel worse?* The words a stranger reads (`AULA.md`, the brief, the
notes) were read for guilt, comparison and promises: they say *nothing is lost by being away*,
*no streak resets, no reminders, no counting of anyone*, and call the version early and the pictures
stand-ins. No sentence names the reader's state or promises comfort. `lint:copy` passes on them. The
pictures show one invented rose tended for two weeks, with no number about anyone else. Looked; found
nothing beyond finding 1.
## Privacy
Every path by which a byte could leave the device: **none was added to the game.** No updater, no
plugin, no permission; `latest.json` is not published, so no future build can be pointed at one by
accident. The bytes this feature sends leave Mark's PC, not a player's: the pipeline's release to
Gitea, `fabrica preflight` to the hub and Custos. The pictures are taken on loopback in throwaway
profiles; both tests assert that no request left the test server's origin. The demo rose's file
carries no town (asserted).
## Reachability
`domi-rosea://` lets a local program or a web page (after the browser asks) open the garden. It
cannot pass anything in: the game reads no argument. No Canalis capability is served, so no other app
can reach into her (F6). Nobody becomes reachable.
## Offline
Unchanged: the game makes no request. The release pipeline runs `pnpm test:offline` before anything
is built for a player.
## Test honesty
The new tests fail with their bug put back (6 of 6, above). The `phone` target's spec has never run
(see *Not verified*), so it may be wrong in ways only a phone shows.
## Scope
In: the six onboarding items as they apply (F1–F11). Out: the release itself (finding 1), Canalis
Part B (F6), videos (F8, Pensum `kkpy69`), a `server` part (F2), iOS (G-T1).
## Not verified
- **No release and no signature**: no tag (finding 1). So no Custos card was answered, no
`SHA256SUMS` exists, the Aula page is not live, and `publish`, `sign`, `apk` and `minisign` have never
run. The hub run (`fabrica deploy rosea --part desktop`) has never run.
- **The Android release build** (`pnpm tauri:android-release`) was not run here: its Gradle home is on
C:, which this session may not use. Its only difference from the debug build that works is `--debug`
and the verified path; the first release run is its first build.
- **`domi-rosea://` on a real install**: the installer was built, not run (it writes the real registry).
- **The `phone` target**: never run. It must go through Fabrica's phone queue; the spec may need fixes
that only a phone shows (G-F5).
- **The `e2e` pipeline on the e2e runner**: not started (manual; it would compete with the release
sessions on this PC).
- **Fabrica's *Update all* over a Rosea install**: needs a signed release first.
- **WebView2's own traffic** (G-T6): still unmeasured for Rosea.
+16
View File
@@ -0,0 +1,16 @@
# Rosea Domi declares itself to Fabrica (.agents/features/fabrica-release.md; Fabrica core docs/FORMATS.md,
# "Fabrica: the app"). One part: the release pipeline makes the Windows installer and the Android APK from one
# tag. No server part: the PWA's host is still the author's question (GAP_ANALYSIS G0.13), and a server part is
# a NixOS module on the server, not this repository's (F2). The colour is --rose.
# aula: true means the releases carry Aula's kit. The page appears on Aula only once the server's
# modules/aula.nix lists Rosea, and that waits for the author: the look's legal check comes before any public
# release (CLAUDE.md §8, GAP_ANALYSIS G6.1; fabrica-release.md F1).
name: Rosea
icon: flower
color: "#b4485e"
aula: true
tagPrefix: v
parts:
desktop:
pipeline: release
check: node scripts/check-version.mjs
+34
View File
@@ -0,0 +1,34 @@
# Rosea Domi: the e2e suites on this PC's e2e runner (fabrica-release.md F9, android-release-apk.md; Fabrica
# docs/20_tests.md, docs/31_runners_here.md, docs/35_phone_queue.md).
# web: the PWA built, then `fabrica tests run --target web` (Playwright headless against the BUILT bundle under
# /Rosea/), the records, traces and screenshots kept with the run.
# phone: the debug APK built, then `fabrica tests run --target phone` on the Wave 10. The step says `device:`, so
# the hub queues this run for the phone and the nested run uses the run's phone (FABRICA_PHONE_LEASED);
# no adb reaches the phone outside the queue. The run waits in the queue without holding a runner.
# Manual: no push webhook reaches the hub yet. Gradle's cache is on D: (never C:; F: is the crowded workspace).
name: e2e
on:
manual: true
runner: windows-e2e
env:
PLAYWRIGHT_BROWSERS_PATH: 'F:\ms-playwright'
GRADLE_USER_HOME: 'D:\build\rosea\gradle'
NDK_HOME: 'F:\Tools\Android\Sdk\ndk\27.1.12297006'
steps:
- id: install
run: pnpm install --frozen-lockfile
- id: build
needs: [install]
run: pnpm build
- id: web
needs: [build]
run: fabrica tests run --target web
artifacts: [".fabrica/runs/tests/**"]
- id: apk
needs: [install]
run: pnpm tauri:android
- id: phone
needs: [apk]
device: Wave 10
run: fabrica tests run --target phone
artifacts: [".fabrica/runs/tests/**"]
+108
View File
@@ -0,0 +1,108 @@
# Rosea Domi: one release, both apps (.agents/features/fabrica-release.md; Fabrica docs/36_app_onboarding.md).
# A `vX.Y.Z` tag (Fabrica: Apps → Rosea → Deploy, or `fabrica deploy rosea --part desktop`) is started on the hub.
# The Windows runner (the Fabrica app on Mark's PC, whose folder is on every step's PATH, so `fabrica` is its own
# CLI) runs every gate of CLAUDE.md §5.5 on a clean checkout, the e2e and offline suites against the BUILT PWA,
# takes the Aula pictures on demo data (e2e/aula.spec.ts), and builds the Windows installer and the Android APK.
# Nothing is signed before Mark's card. Then: Authenticode on the installer (domi-code-signing); the APK through
# custos-sign with rosea-android (NOT made by Custos on its own: android-release-apk.md A6, until then `no_key`); a minisign
# signature for each (domi-release); the release with SHA256SUMS signed by domi-release.
# No updater and no latest.json: the apps make no network call of their own (CLAUDE.md §2). Mark's PC updates
# through Fabrica's Update all; a player installs the next file over the old one (F3).
# The repository is public, so `publish` is a public release: the tag waits for the author (G6.1, F1).
# Playwright's browsers are in F:\ms-playwright (CLAUDE.md §3: never C:); nothing is downloaded during a release.
name: release
on:
tag: "v*"
manual: true
runner: windows
env:
PLAYWRIGHT_BROWSERS_PATH: 'F:\ms-playwright'
CUSTOS_SIGN_EXE: 'F:\Apps\Custos\custos-sign.exe'
# The Android build (android-release-apk.md): the Tauri CLI needs the NDK named; Gradle's cache on D:, never C:.
GRADLE_USER_HOME: 'D:\build\rosea\gradle'
NDK_HOME: 'F:\Tools\Android\Sdk\ndk\27.1.12297006'
steps:
- id: version
run: node scripts/check-version.mjs ${{ version }}
- id: install
run: pnpm install --frozen-lockfile
- id: lint
needs: [install]
run: pnpm lint
- id: typecheck
needs: [install]
run: pnpm typecheck
- id: test
needs: [install]
run: pnpm test
- id: library
needs: [install]
run: pnpm validate:library
- id: copy
needs: [install]
run: pnpm lint:copy
- id: e2e
needs: [lint, typecheck, test, library, copy]
run: pnpm test:e2e
- id: offline
needs: [e2e]
run: pnpm test:offline
- id: pictures
needs: [offline]
run: pnpm aula:shots
- id: desktop
needs: [offline]
run: pnpm tauri:build
artifacts: ["apps/rosea-tauri/src-tauri/target/release/bundle/nsis/*-setup.exe"]
- id: android
needs: [desktop]
run: pnpm tauri:android-release
- id: notes
run: fabrica notes
artifacts: ["target/notes/release-notes.md", "target/notes/release-notes.json"]
- id: notes-copy
needs: [notes, install]
run: pnpm lint:copy
- id: shots
needs: [pictures]
run: fabrica aula shots
artifacts: ["target/aula/aula-*.png", "target/aula/aula.json"]
- id: page
needs: [notes-copy, shots]
run: fabrica aula page
artifacts: ["target/aula/aula-page.json", "target/aula/aula-page.html"]
- id: approve
needs: [version, desktop, android, page]
approve: "Release Rosea ${{ tag }}?"
- id: sign
needs: [approve]
sign:
key: domi-code-signing
kind: authenticode
files: ["**/*-setup.exe"]
- id: apk
needs: [approve]
run: pnpm --filter @rosea/tauri sign:apk ${{ version }} ${{ commit }}
keys: [rosea-android]
artifacts: ["target/release/rosea-domi-*-arm64.apk"]
- id: minisign
needs: [sign, apk]
sign:
key: domi-release
kind: minisign
files: ["**/*-setup.exe", "**/rosea-domi-*-arm64.apk"]
- id: publish
needs: [minisign]
publish:
gitea-release: true
files:
- "**/*-setup.exe"
- "**/*-setup.exe.minisig"
- "**/rosea-domi-*-arm64.apk"
- "**/rosea-domi-*-arm64.apk.minisig"
- "target/aula/aula-*.png"
- "target/aula/aula.json"
- "target/aula/aula-page.json"
- "**/release-notes.md"
- "**/release-notes.json"
sums: domi-release
+39
View File
@@ -0,0 +1,39 @@
# Rosea's pictures for its Aula page (fabrica-release.md F7; Fabrica docs/19_web_shots.md). All are taken by the
# app's own Playwright run (`pnpm aula:shots`, e2e/aula.spec.ts) from the BUILT PWA on demo data the game itself
# made: an invented rose watered once a day for two weeks in March 2026, in Prague, with the gardener's first look.
# `fabrica aula shots` checks and publishes the files; it starts no browser of its own (the PWA lives under
# /Rosea/, and Fabrica's server serves at /). No iPhone pictures: there is no iOS app yet (G-T1).
size: [1280, 800]
shots:
- name: garden
title: Her planet after two weeks of care
section: In a browser or on Windows
file: e2e/aula/garden.png
- name: ring
title: What she needs today
section: In a browser or on Windows
file: e2e/aula/ring.png
- name: numbers
title: Her numbers
section: In a browser or on Windows
file: e2e/aula/numbers.png
- name: sunset
title: Move the chair
section: In a browser or on Windows
file: e2e/aula/sunset.png
- name: safe
title: Keep her safe
section: In a browser or on Windows
file: e2e/aula/safe.png
- name: first-open
title: Who tends her?
section: The first open
file: e2e/aula/first-open.png
- name: phone-garden
title: The garden on a phone
section: On a phone
file: e2e/aula/phone-garden.png
- name: phone-ring
title: What she needs, on a phone
section: On a phone
file: e2e/aula/phone-ring.png
+14
View File
@@ -0,0 +1,14 @@
A small game about a living rose, a fox, and the time we give to people. An early version.
You tend one rose on a round tiny planet of her own. Water her by feel, pull the weeds, gather her fallen petals, shade her from the wind. She grows from the days on which you cared for her, never from a streak, and when you are away she waits.
The garden follows the real sun of a town you choose. No account, nothing sent anywhere. The pictures are stand-ins drawn in code until the painted ones are ready.
- garden: Her planet after two weeks of care, with the gardener beside her and tonight's real sunset below.
- ring: A tap on her shows what she needs today.
- numbers: Her numbers: water, warmth, days of care and how she is.
- sunset: Move the chair: a quiet sunset in the garden, with nothing to press.
- safe: Keep her safe: save her to a file, and bring her back on any device.
- first-open: The first open: dress the gardener who tends her.
- phone-garden: The same garden on a phone.
- phone-ring: On a phone, what she needs is one tap away.
+9
View File
@@ -0,0 +1,9 @@
The first release of Rosea Domi, an early version: the rose, her planet and the gardener.
- Tend her by hand or by button: water by feel, pull weeds, gather petals, shade her from the wind, touch her gently.
- She grows from the days on which care helped, never from a streak, and waits when you are away.
- A gardener you dress at the first open, who walks round her planet to the work.
- The real sunset and sunrise of a town you choose, and a quiet sunset in the garden.
- Keep her safe: save her to a file and bring her back on any device.
- A Windows installer and an Android app. Nothing is sent anywhere; the Android app asks for no permission at all.
- The pictures are stand-ins drawn in code until the painted ones are ready.
@@ -0,0 +1,15 @@
---
id: kkpy69
title: Showcase videos of the main flows for the Aula page
status: todo
priority: normal
labels: [showcase, aula]
created: 2026-11-19T01:31:09+01:00
updated: 2026-11-19T01:31:09+01:00
doc: .agents/features/fabrica-release.md
---
Once Fabrica docs/37 (showcase videos: .fabrica/aula.yaml videos:, WebM <= 8 MiB, <= 60 s, <= 6 per release, published as target/aula/aula-<name>.webm under SHA256SUMS) is on Fabrica main, record short videos from e2e/aula.spec.ts on the same demo garden: watering by the can, the ring of care, moving the chair (the in-game sunset), keeping her safe in a file. Add them to aula.yaml videos: and to the release's publish files. Until then a videos: key fails fabrica aula shots (fabrica-release.md F8).
## Log
- 2026-11-19T01:31:09+01:00 mnovak: created
+24
View File
@@ -0,0 +1,24 @@
# Rosea Domi's Playwright targets (fabrica-release.md F9, android-release-apk.md; Fabrica docs/20_tests.md,
# docs/22_devices.md, docs/35_phone_queue.md). `fabrica tests run --target <name>`, or Tests in Fabrica.
# web: the BUILT PWA (build it first: `pnpm build`) in headless Chromium: the specs of `pnpm test:e2e`.
# phone: the Android debug APK on the Wave 10 test phone, only through Fabrica's phone queue (the e2e pipeline's
# `phone` step, or `fabrica tests run --target phone`). Build it first (`pnpm tauri:android`). A debug APK,
# because only a debug build's WebView can be driven (docs/22 part 5); the release APK is the same game.
# `reset: uninstall`: the app is installed fresh, so a release build of Rosea on the phone (another key)
# cannot block the run. Nothing of Rosea's on the test phone is kept: it holds no rose of anyone's.
dir: .
config: e2e/playwright.fabrica.config.ts
targets:
- name: web
kind: web
title: The garden in a browser
project: web
- name: phone
kind: android
title: The Android app on the test phone
project: android
device: Wave 10
package: cz.mareknovak.domi.rosea
reset: uninstall
maxMinutes: 20
apk: apps/rosea-tauri/src-tauri/gen/android/app/build/outputs/apk/universal/debug/app-universal-debug.apk
+5
View File
@@ -37,3 +37,8 @@ packages/schema/src/generated/
dist-tauri/ dist-tauri/
apps/rosea-tauri/src-tauri/gen/ apps/rosea-tauri/src-tauri/gen/
apps/rosea-tauri/src-tauri/icons/ apps/rosea-tauri/src-tauri/icons/
# The Aula pictures, taken by `pnpm aula:shots` (e2e/aula.spec.ts) and published by Fabrica, never committed
e2e/aula/
# Fabrica's records of `fabrica tests run` (run.json, traces): local evidence, quoted in the reviews, never committed
.fabrica/runs/
+45
View File
@@ -0,0 +1,45 @@
# Rosea Domi
*Rosea* (Latin: rose-coloured) is a small game about a living rose, a fox, and the time we give to
people. You tend one rose on a round tiny planet of her own. She grows from the days on which you
cared for her, never from a streak, and when you are away she waits.
**This is an early version.** The rose, her planet and the gardener are here; the fox, the other
planets, friends and the shared sky come later. The pictures are simple stand-ins drawn in code
until the painted ones are ready.
## What you do
- **Tend her by hand.** Tap her to see what she needs today. Tilt the watering can and stop when her
leaves lift: too much is as bad as too little. Pull the weeds, sweep up fallen petals, set the
windbreak against the wind. Every gesture also has a plain button, and works from the keyboard.
- **Choose who tends her.** At the first open you dress your gardener, a boy or a girl.
- **Watch the real sky.** Choose a town near you (or let the device's time zone guess), and the
garden names tonight's real sunset, and after it the real sunrise. *Move the chair* shows a quiet
sunset in the garden, half a minute with nothing to press, then says when the real one is.
- **Her numbers, one tap away.** Water, warmth, days of care and how she is, about her alone.
- **Keep her safe.** Save her to a file and bring her back on any device.
Nothing is lost by being away: no streak resets, no reminders, no counting of anyone.
## Private by construction
There is no account, no email and no password. Everything stays on your device: her care, your town,
your gardener. The game sends nothing anywhere and shows nothing from anywhere else. The Android app
does not even ask for the permission to use the internet.
## Installing
- **Windows:** run `Rosea Domi_<version>_x64-setup.exe`. It installs for you alone, with no
administrator rights.
- **Android:** install the `.apk` (Android 7 or newer). Your phone will ask you to allow installing
apps from where you downloaded it.
- **iPhone, macOS and Linux:** not yet.
Each file is signed: its SHA-256 is in `SHA256SUMS`, and `SHA256SUMS.minisig` is its signature.
## Updating
Install the newer file over the old one, the same way. Your rose stays: she lives with the app on
your device, and a newer version keeps her. Removing the app removes her too, so save her to a file
first (*Her numbers* → *Keep her safe* → *Save her to a file*).
+12
View File
@@ -205,6 +205,9 @@ apps/rosea-tauri ──► apps/rosea's BUILT output (dist-tauri/) only — no p
- `apps/rosea` contains zero growth, taming or sky logic. It renders what the engine returns. - `apps/rosea` contains zero growth, taming or sky logic. It renders what the engine returns.
- `services/lucerna` must be deletable. If removing it breaks the rose, the planets, the fox, friends - `services/lucerna` must be deletable. If removing it breaks the rose, the planets, the fox, friends
or the sunset, the shared sky has stopped being optional and that is a **blocker**. or the sunset, the shared sky has stopped being optional and that is a **blocker**.
- `.fabrica/` is how Fabrica releases both apps (`fabrica-release.md`): it reads this repository and this
repository imports nothing of Fabrica's. The Windows installer also registers `domi-rosea://` for the
user (an NSIS hook, no Rust code): any such address opens the garden and nothing else.
- `apps/rosea-tauri` must be deletable too: removing it leaves the PWA whole. The game never asks - `apps/rosea-tauri` must be deletable too: removing it leaves the PWA whole. The game never asks
which shell it is in except through one build-time constant, `__ROSEA_SHELL__` (`'web'` or which shell it is in except through one build-time constant, `__ROSEA_SHELL__` (`'web'` or
`'tauri'`), read in `apps/rosea/src/App.svelte` only, for wiring (no service worker; the app counts `'tauri'`), read in `apps/rosea/src/App.svelte` only, for wiring (no service worker; the app counts
@@ -288,6 +291,15 @@ pnpm tauri:ios # macOS + Xcode only — refuses elsewh
pnpm --filter @rosea/tauri test # the shell's tests: config (CSP, name, origin), privacy patch, shell build pnpm --filter @rosea/tauri test # the shell's tests: config (CSP, name, origin), privacy patch, shell build
tsx e2e/apps/check-garden.ts desktop # the built .exe: water her, close, reopen, still watered (temp data folder) tsx e2e/apps/check-garden.ts desktop # the built .exe: water her, close, reopen, still watered (temp data folder)
tsx e2e/apps/check-garden.ts android # the installed APK on the device over adb; `pm clear`s the TEST app first tsx e2e/apps/check-garden.ts android # the installed APK on the device over adb; `pm clear`s the TEST app first
pnpm tauri:android-release # the release APK (unsigned; verified with aapt2); Fabrica signs it in Custos
# Released through Fabrica (.fabrica/; .agents/features/fabrica-release.md):
node scripts/check-version.mjs <x.y.z> # the four version files agree; Fabrica's Deploy bumps what it names
pnpm aula:shots # builds, then the Aula pictures on demo data -> e2e/aula/*.png
fabrica artifex check # the pipelines, tests.yaml, aula.yaml and the brief
fabrica tests run --target web # the e2e specs as Fabrica's target (build first)
fabrica tests run --target phone # the debug APK on the test phone, ONLY through Fabrica's phone queue
fabrica deploy rosea --part desktop # a release: bump, tag, the hub's run, Mark's Custos cards. Public: G6.1 first
# Not yet — they arrive with their first feature: # Not yet — they arrive with their first feature:
cargo test --manifest-path services/lucerna/Cargo.toml # Phase 4 onward cargo test --manifest-path services/lucerna/Cargo.toml # Phase 4 onward
+48 -1
View File
@@ -2,7 +2,54 @@
Rewritten at the end of each session (CLAUDE.md §5.1). Rewritten at the end of each session (CLAUDE.md §5.1).
## Last session — 2026-10-31 to 2026-11-17 ## Latest — 2026-11-22: the Atrium Domi adoption plan (plan only)
- **`docs/atrium-adoption`**: [`.agents/features/atrium-adoption.md`](.agents/features/atrium-adoption.md) has the
inventory Atrium's Appendix A asks for:
- no Tauri invoke or listen;
- one database, `rosea` IndexedDB in WebView2's folder;
- no outgoing request;
- accent `#b4485e` / `#e8899b`; the icon is the placeholder `icon.svg`.
- **The plan's decisions:** R1 keep Rosea's own origin when hosted, or her rose seems gone; R2/R3 snapshot and
restore as the `rosea-rose` file, additive only. R4 (Rust in the shell) and R1 are Mark's, along with *free* and
*today* (G-AT1).
- **Code waits** for Atrium's `docs/APP_CONTRACT.md` v0 (the Aula session says when). Visual changes wait for `@domi/ui`.
- **The key:** Custos 0.25's *Android grant* (Mark, `mnovak/*`, per Aula) should make `rosea-android` at the first
signature (G-F7, unverified).
- **The release:** still waits for Mark's own yes in this session to remove G6.1 from CLAUDE.md. The request
reached this session only through the Aula session, and CLAUDE.md is not edited on a relayed request.
## Earlier — 2026-11-21: the APK for a release, tested through the phone queue (blocked twice)
- **`feature/android-release-apk`**: the phone target says `reset: uninstall` and `maxMinutes: 20`; the e2e
pipeline gains `apk` and `phone` (`device: Wave 10`, so the hub queues it); both pipelines name the NDK and put
Gradle's cache on D:. Analysis: [`.agents/features/android-release-apk.md`](.agents/features/android-release-apk.md).
Review: [`.agents/reviews/feature-android-release-apk.md`](.agents/reviews/feature-android-release-apk.md).
- **The phone test passed** through the hub's queue (`fabrica tests run --target phone`): run
`20261121-101158-uckm`, 1 passed, 0 failed, on the Wave 10. A planted fault failed as it must. The e2e pipeline's
`phone` step still waits for the hub's e2e runner (Mark).
- **Blocked on the key:** `rosea-android` does not exist, and Custos will not make it, because it is not in Custos's
`ANDROID_APPS` (0.22.0 here, 0.24.0 too). This corrects `fabrica-release.md` F4. It needs a Custos change or
Mark's *Create Android key* (G-F7).
- **Still the author's:** publication (G6.1, G-F1).
## Earlier — 2026-11-19: released through Fabrica (built, not published)
- **Rosea is a Fabrica app** (`feature/fabrica-release`, PR mnovak/Rosea#1): `.fabrica/` (app, the
`release` and `e2e` pipelines, `tests.yaml` with `web` and `phone`, `aula.yaml`), `AULA.md`, the brief
and the 0.1.0 notes, `scripts/check-version.mjs`, the APK signed in Custos (`sign:apk`,
`rosea-android`), `domi-rosea://` from the installer, the pictures on demo data (`pnpm aula:shots`).
Analysis: [`.agents/features/fabrica-release.md`](.agents/features/fabrica-release.md). Review:
[`.agents/reviews/feature-fabrica-release.md`](.agents/reviews/feature-fabrica-release.md).
Rosea is in Fabrica's workspace and `deploy.json` on this PC.
- **No release was made.** The Gitea repository is public, so a release is public, and G6.1 comes
first. The author's choice is open (G-F1): publish anyway, make the repository private first, or wait.
- **Before the first release, in Custos (Mark):** `domi-code-signing` and `domi-release` scoped to
`mnovak/Rosea`; `rosea-android` is made by Custos on the first APK signature; back the vault up.
- **Not run:** the `phone` target (only through Fabrica's phone queue); no installer was run, so
`domi-rosea://` is tested as text only (G-F4).
## Earlier — 2026-10-31 to 2026-11-17
**Done.** **Done.**
+2
View File
@@ -8,6 +8,8 @@
"dev": "tsx scripts/icons.ts && tauri dev", "dev": "tsx scripts/icons.ts && tauri dev",
"build:desktop": "tsx scripts/icons.ts && tauri build", "build:desktop": "tsx scripts/icons.ts && tauri build",
"build:android": "tsx scripts/android.ts prepare && tauri android build --debug --apk --target aarch64 && tsx scripts/android.ts verify", "build:android": "tsx scripts/android.ts prepare && tauri android build --debug --apk --target aarch64 && tsx scripts/android.ts verify",
"build:android-release": "tsx scripts/android.ts prepare && tauri android build --apk --target aarch64 && tsx scripts/android.ts verify src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk",
"sign:apk": "tsx scripts/sign-apk.ts",
"build:ios": "tsx scripts/ios.ts", "build:ios": "tsx scripts/ios.ts",
"android:privacy": "tsx scripts/android.ts apply", "android:privacy": "tsx scripts/android.ts apply",
"android:verify": "tsx scripts/android.ts verify", "android:verify": "tsx scripts/android.ts verify",
+26
View File
@@ -0,0 +1,26 @@
/**
* `pnpm --filter @rosea/tauri sign:apk <version> <commit>`: the release APK, signed in Custos
* (fabrica-release.md F4). Runs after the release's approval; Mark's card shows the match code
* custos-sign prints. Nothing is written unless custos-sign signs and verifies.
*/
import { spawnSync } from 'node:child_process';
import { existsSync, mkdirSync } from 'node:fs';
import { join } from 'node:path';
import { custosSign, signArgs, signedApkName, UNSIGNED_APK } from '../src/sign-apk.js';
import { PACKAGE, SRC_TAURI } from './tauri.js';
const [version = '', commit = ''] = process.argv.slice(2);
try {
const unsigned = join(SRC_TAURI, UNSIGNED_APK);
if (!existsSync(unsigned)) throw new Error(`no release APK at ${unsigned}; run 'pnpm tauri:android-release' first`);
const outDir = join(PACKAGE, '..', '..', 'target', 'release');
mkdirSync(outDir, { recursive: true });
const exe = custosSign(process.env, existsSync);
const args = signArgs({ version, commit, unsigned, out: join(outDir, signedApkName(version)) });
const run = spawnSync(exe, args, { stdio: 'inherit' });
if (run.error) throw run.error;
process.exit(run.status ?? 1);
} catch (e) {
console.error(`sign:apk: ${e instanceof Error ? e.message : String(e)}`);
process.exit(1);
}
@@ -1 +1,7 @@
{ "$schema": "https://schema.tauri.app/config/2", "bundle": { "targets": ["nsis"] } } {
"$schema": "https://schema.tauri.app/config/2",
"bundle": {
"targets": ["nsis"],
"windows": { "nsis": { "installerHooks": "./windows/hooks.nsh" } }
}
}
@@ -0,0 +1,16 @@
; Rosea Domi's installer hooks (.agents/features/fabrica-release.md F5; Fundamentum's Canalis, Part A).
; The installer registers domi-rosea://open for the current user, and the uninstaller removes it.
; Here and not at every start: the shell is a window and nothing else (CLAUDE.md §2), and a reinstall
; or Fabrica's Update all (/UPDATE in the same folder) runs this again, so the command follows the exe.
; The game reads no argument: any domi-rosea:// address opens the garden, and nothing else.
!macro NSIS_HOOK_POSTINSTALL
WriteRegStr HKCU "Software\Classes\domi-rosea" "" "URL:Rosea Domi"
WriteRegStr HKCU "Software\Classes\domi-rosea" "URL Protocol" ""
WriteRegStr HKCU "Software\Classes\domi-rosea\DefaultIcon" "" '"$INSTDIR\${MAINBINARYNAME}.exe",0'
WriteRegStr HKCU "Software\Classes\domi-rosea\shell\open\command" "" '"$INSTDIR\${MAINBINARYNAME}.exe" "%1"'
!macroend
!macro NSIS_HOOK_POSTUNINSTALL
DeleteRegKey HKCU "Software\Classes\domi-rosea"
!macroend
+54
View File
@@ -0,0 +1,54 @@
/**
* What the release asks custos-sign to do with the Android APK (fabrica-release.md F4). Kept
* apart from the script that runs it so the arguments can be tested without Custos.
*
* The key `rosea-android` lives in Custos only; custos-sign holds no key material either. Its
* scope is exactly `mnovak/Rosea`, the release pipeline, a tag (Custos makes the key on the first
* release, behind Mark's first-signature card).
*/
export const APK_KEY = 'rosea-android';
export const REPO = 'mnovak/Rosea';
/** Where Gradle leaves the release APK of `tauri android build --apk --target aarch64`, from src-tauri. */
export const UNSIGNED_APK = 'gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk';
/** The published APK's name: the app, the version, the one ABI it is built for. */
export const signedApkName = (version: string): string => `rosea-domi-${version}-arm64.apk`;
export interface SignRequest {
readonly version: string;
readonly commit: string;
readonly unsigned: string;
readonly out: string;
}
/** The arguments of `custos-sign apk`, or the reason they cannot be made. */
export function signArgs(r: SignRequest): string[] {
if (!/^\d+\.\d+\.\d+$/.test(r.version)) throw new Error(`not a version: ${r.version}`);
if (!/^[0-9a-f]{40}$/.test(r.commit)) throw new Error(`not a commit: ${r.commit}`);
return [
'apk', r.unsigned,
'--out', r.out,
'--key', APK_KEY,
'--repo', REPO,
'--pipeline', 'release',
'--commit', r.commit,
'--trigger', 'tag',
'--run', `rosea-v${r.version}`,
'--version', r.version,
'--step', 'apk'
];
}
/**
* Which custos-sign to run. `CUSTOS_SIGN_EXE` names it; when it names a file that is not there,
* the release refuses rather than run another one from PATH. `CUSTOS_PIPE` is refused: a signed
* run must reach Mark's Custos, never a test instance whose key is nobody's.
*/
export function custosSign(env: Readonly<Record<string, string | undefined>>, exists: (p: string) => boolean): string {
if (env['CUSTOS_PIPE']) throw new Error('CUSTOS_PIPE is set: the APK would be signed by another Custos than Mark\'s');
const named = env['CUSTOS_SIGN_EXE'];
if (named === undefined || named === '') return 'custos-sign.exe';
if (!exists(named)) throw new Error(`CUSTOS_SIGN_EXE names ${named}, which is not there`);
return named;
}
+39
View File
@@ -103,6 +103,45 @@ describe('tauri.conf.json', () => {
}); });
}); });
describe('domi-rosea://open, from the installer (fabrica-release.md F5)', () => {
const windows = JSON.parse(readFileSync(join(SRC_TAURI, 'tauri.windows.conf.json'), 'utf8')) as {
bundle: { windows?: { nsis?: { installerHooks?: string; installMode?: string } } };
};
const hooksPath = windows.bundle.windows?.nsis?.installerHooks ?? '';
const hooks = existsSync(join(SRC_TAURI, hooksPath)) ? readFileSync(join(SRC_TAURI, hooksPath), 'utf8') : '';
/** The NSIS statements of one macro, comments dropped. */
const macro = (name: string): string[] =>
(new RegExp(`!macro ${name}\\r?\\n([\\s\\S]*?)!macroend`).exec(hooks)?.[1] ?? '')
.split(/\r?\n/)
.map((l) => l.trim())
.filter((l) => l !== '' && !l.startsWith(';'));
it('the Windows installer runs the hooks file, and installs for the current user only', () => {
expect(hooksPath).toBe('./windows/hooks.nsh');
expect(hooks).not.toBe('');
const nsis = (conf.bundle as { windows?: { nsis?: { installMode?: string } } }).windows?.nsis;
expect(nsis?.installMode).toBe('currentUser');
});
it('registers exactly the domi-rosea scheme under HKCU, opening the installed exe with the address', () => {
expect(macro('NSIS_HOOK_POSTINSTALL')).toEqual([
'WriteRegStr HKCU "Software\\Classes\\domi-rosea" "" "URL:Rosea Domi"',
'WriteRegStr HKCU "Software\\Classes\\domi-rosea" "URL Protocol" ""',
`WriteRegStr HKCU "Software\\Classes\\domi-rosea\\DefaultIcon" "" '"$INSTDIR\\\${MAINBINARYNAME}.exe",0'`,
`WriteRegStr HKCU "Software\\Classes\\domi-rosea\\shell\\open\\command" "" '"$INSTDIR\\\${MAINBINARYNAME}.exe" "%1"'`
]);
});
it('the uninstaller removes that key and nothing else', () => {
expect(macro('NSIS_HOOK_POSTUNINSTALL')).toEqual(['DeleteRegKey HKCU "Software\\Classes\\domi-rosea"']);
});
it('writes nowhere else: no machine-wide key, no other hook', () => {
expect(hooks).not.toMatch(/HKLM|HKCR|HKEY_/);
expect([...hooks.matchAll(/!macro (\w+)/g)].map((m) => m[1])).toEqual(['NSIS_HOOK_POSTINSTALL', 'NSIS_HOOK_POSTUNINSTALL']);
});
});
describe('the Rust side (D5)', () => { describe('the Rust side (D5)', () => {
it('depends on tauri alone: no plugin, no SDK', () => { it('depends on tauri alone: no plugin, no SDK', () => {
const cargo = readFileSync(join(SRC_TAURI, 'Cargo.toml'), 'utf8'); const cargo = readFileSync(join(SRC_TAURI, 'Cargo.toml'), 'utf8');
+54
View File
@@ -0,0 +1,54 @@
/**
* The release APK is signed in Custos and nowhere else (fabrica-release.md F4): the arguments
* name the one key, the exact repository and a tag, and the script never falls back to another
* custos-sign or another Custos.
*/
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { describe, expect, it } from 'vitest';
import { APK_KEY, custosSign, signArgs, signedApkName, UNSIGNED_APK } from '../src/sign-apk.js';
const COMMIT = 'a'.repeat(40);
const pkg = JSON.parse(readFileSync(join(fileURLToPath(new URL('..', import.meta.url)), 'package.json'), 'utf8')) as { scripts: Record<string, string> };
describe('signArgs', () => {
it('asks for rosea-android, scoped to mnovak/Rosea, the release pipeline and a tag', () => {
const args = signArgs({ version: '0.1.0', commit: COMMIT, unsigned: 'in.apk', out: 'out.apk' });
expect(args).toEqual([
'apk', 'in.apk', '--out', 'out.apk', '--key', 'rosea-android', '--repo', 'mnovak/Rosea', '--pipeline', 'release',
'--commit', COMMIT, '--trigger', 'tag', '--run', 'rosea-v0.1.0', '--version', '0.1.0', '--step', 'apk'
]);
expect(APK_KEY).toBe('rosea-android');
});
it('refuses a version or a commit that is not one', () => {
expect(() => signArgs({ version: 'v0.1.0', commit: COMMIT, unsigned: 'a', out: 'b' })).toThrow(/not a version/);
expect(() => signArgs({ version: '0.1.0', commit: 'HEAD', unsigned: 'a', out: 'b' })).toThrow(/not a commit/);
});
it('names the published APK by app, version and ABI', () => {
expect(signedApkName('0.1.0')).toBe('rosea-domi-0.1.0-arm64.apk');
});
it('signs the release build that android.ts verified, never the debug one', () => {
expect(UNSIGNED_APK).toContain('/release/');
expect(pkg.scripts['build:android-release']).toContain(`verify src-tauri/${UNSIGNED_APK}`);
expect(pkg.scripts['build:android-release']).not.toContain('--debug');
});
});
describe('custosSign', () => {
it('runs the custos-sign CUSTOS_SIGN_EXE names, else the one on PATH', () => {
expect(custosSign({ CUSTOS_SIGN_EXE: 'F:\\Apps\\Custos\\custos-sign.exe' }, () => true)).toBe('F:\\Apps\\Custos\\custos-sign.exe');
expect(custosSign({}, () => true)).toBe('custos-sign.exe');
});
it('refuses a named custos-sign that is not there, rather than another one', () => {
expect(() => custosSign({ CUSTOS_SIGN_EXE: 'X:\\nowhere.exe' }, () => false)).toThrow(/not there/);
});
it('refuses another Custos (CUSTOS_PIPE)', () => {
expect(() => custosSign({ CUSTOS_PIPE: '\\\\.\\pipe\\test' }, () => true)).toThrow(/CUSTOS_PIPE/);
});
});
+56
View File
@@ -0,0 +1,56 @@
import { _android as android, expect, test, type AndroidDevice, type Page } from '@playwright/test';
import { en } from '@rosea/ui/copy';
import { pastGardener, openRing } from '../garden.js';
import { storedCare } from '../stored.js';
/**
* The Android app on Fabrica's test phone (.agents/features/fabrica-release.md F9): the debug
* APK Fabrica installed, reached through its WebView with Playwright's own Android support
* (Fabrica docs/22_devices.md). Only `fabrica tests run --target phone` runs it: the phone is
* leased from Fabrica's queue, the app's data is cleared first, and Fabrica stops the app after.
* Watering is by the keyboard's Space held down: the same pour as a held finger (rose.md), and
* the one input a WebView reached over DevTools takes as a player's.
*/
const PKG = process.env['FABRICA_TESTS_PACKAGE'];
const SERIAL = process.env['ANDROID_SERIAL'];
test.skip(!PKG || !SERIAL, "runs only through Fabrica's phone queue: fabrica tests run --target phone");
async function garden(device: AndroidDevice): Promise<Page> {
const webView = await device.webView({ pkg: PKG! }, { timeout: 30_000 });
const page = await webView.page();
await expect(page.getByRole('heading', { level: 2, name: en.gardener.question }).or(page.getByRole('button', { name: en.rose.care }))).toBeVisible({
timeout: 30_000
});
return page;
}
test('the garden opens on the phone; she is watered, and still watered after the app is closed and opened', async () => {
test.setTimeout(240_000);
const device = (await android.devices()).find((d) => d.serial() === SERIAL);
expect(device, `no phone with the serial ${SERIAL} on adb`).toBeDefined();
try {
let page = await garden(device!);
await pastGardener(page);
// No town: the private choice, and it keeps the test free of any place.
await page.getByRole('button', { name: /^Not now/ }).click();
await openRing(page);
await page.getByRole('button', { name: en.rose.water }).focus();
await page.keyboard.down('Space');
await page.waitForTimeout(1500);
await page.keyboard.up('Space');
await expect(page.getByText(en.rose.says.thanks)).toBeVisible();
await storedCare(page, 1);
await device!.shell(`am force-stop ${PKG!}`);
await device!.shell(`monkey -p ${PKG!} -c android.intent.category.LAUNCHER 1`);
page = await garden(device!);
await page.getByRole('button', { name: en.rose.numbers }).click();
await expect(page.locator('#rose-numbers')).toContainText(`${en.rose.daysOfCare}1`);
} finally {
// Fabrica stops the app after the run too; the phone is never left with Rosea open (memory rule, 2026-11-17).
await device?.shell(`am force-stop ${PKG!}`).catch((e: unknown) => console.warn(`force-stop: ${String(e)}`));
await device?.close();
}
});
+164
View File
@@ -0,0 +1,164 @@
import { mkdirSync } from 'node:fs';
import { readFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import { expect, test, type Browser, type BrowserContext, type Page } from '@playwright/test';
import { en } from '@rosea/ui/copy';
import { openRing, pastGardener } from './garden.js';
import { startStaticServer, type StaticServer } from './static-server.js';
import { storedCare, storedTown } from './stored.js';
/**
* The pictures for Rosea's Aula page (.agents/features/fabrica-release.md F7), taken from the
* BUILT PWA. The demo garden is made by the game itself, as a player makes one: the first look
* of the gardener, the town Prague, and two weeks of watering, once each morning, in an invented
* March. No file, profile or town of a real player is read. `.fabrica/aula.yaml` lists the files;
* `fabrica aula shots` checks and publishes them.
*/
const OUT = fileURLToPath(new URL('./aula/', import.meta.url));
const ZONE = 'Europe/Prague';
const DAYS = 14;
/** 08:00 in Prague on day `n` of March 2026 (CET, before the clocks change on the 29th). */
const morning = (n: number): number => Date.parse(`2026-03-${String(n).padStart(2, '0')}T08:00:00+01:00`);
const LAST = morning(DAYS + 1);
let server: StaticServer;
test.beforeAll(async () => {
mkdirSync(OUT, { recursive: true });
server = await startStaticServer();
});
test.afterAll(async () => {
await server.close();
});
/** Holds Water with the mouse, as a player holds it with a finger, until she thanks them. */
async function water(page: Page): Promise<void> {
await openRing(page);
await page.getByRole('button', { name: en.rose.water }).hover();
await page.mouse.down();
await page.waitForTimeout(1500);
await page.mouse.up();
await expect(page.getByText(en.rose.says.thanks)).toBeVisible();
}
async function shot(page: Page, name: string): Promise<void> {
await page.screenshot({ path: `${OUT}${name}.png`, animations: 'disabled', caret: 'hide' });
}
/** Every request the page makes, to prove the pictures were taken with nothing from elsewhere. */
function watch(page: Page): string[] {
const requests: string[] = [];
page.on('request', (r) => requests.push(r.url()));
return requests;
}
async function chooseGardenerAndTown(page: Page): Promise<void> {
await pastGardener(page);
await page.getByRole('searchbox', { name: en.sunset.searchLabel }).fill('prague');
await page.getByRole('button', { name: /^Prague/ }).first().click();
await storedTown(page, 'Prague');
}
async function newContext(browser: Browser, phone: boolean): Promise<BrowserContext> {
const common = { timezoneId: ZONE, locale: 'en-US', colorScheme: 'light' as const, reducedMotion: 'reduce' as const };
return phone
? browser.newContext({
...common,
viewport: { width: 360, height: 800 },
deviceScaleFactor: 2,
isMobile: true,
hasTouch: true,
userAgent: 'Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36'
})
: browser.newContext({ ...common, viewport: { width: 1280, height: 800 }, deviceScaleFactor: 1 });
}
test.describe.configure({ mode: 'serial', timeout: 300_000 });
let saved = '';
test('two weeks in an invented garden, photographed on a desktop', async ({ browser }) => {
const context = await newContext(browser, false);
try {
const page = await context.newPage();
const requests = watch(page);
await page.clock.install({ time: morning(1) });
await page.goto(server.url);
await expect(page.getByRole('heading', { level: 2, name: en.gardener.question })).toBeVisible({ timeout: 20_000 });
await shot(page, 'first-open');
await chooseGardenerAndTown(page);
for (let day = 1; day <= DAYS; day += 1) {
if (day > 1) {
await page.clock.setSystemTime(morning(day));
await page.reload();
await expect(page.getByRole('button', { name: en.rose.care })).toBeVisible();
}
await water(page);
await storedCare(page, day);
}
// The fifteenth morning: what she needs today, before any care.
await page.clock.setSystemTime(LAST);
await page.reload();
await expect(page.getByRole('button', { name: en.rose.care })).toBeVisible();
await expect(page.locator('.sun p').first()).toHaveText(/in Prague\.$/);
await shot(page, 'garden');
await openRing(page);
await shot(page, 'ring');
await page.keyboard.press('Escape');
await page.getByRole('button', { name: en.rose.numbers }).click();
await expect(page.locator('#rose-numbers')).toContainText(en.rose.daysOfCare);
await page.locator('#rose-numbers').evaluate((el) => el.scrollIntoView({ block: 'center' }));
await shot(page, 'numbers');
await page.getByRole('button', { name: en.rose.safe.title }).click();
await expect(page.getByRole('button', { name: en.rose.safe.save })).toBeVisible();
await page.getByRole('button', { name: en.rose.safe.save }).scrollIntoViewIfNeeded();
await shot(page, 'safe');
// The same rose, carried to the phone below as a player carries her: in a file.
const download = page.waitForEvent('download');
await page.getByRole('button', { name: en.rose.safe.save }).click();
saved = await readFile((await (await download).path())!, 'utf8');
expect(saved).not.toMatch(/Prague|privateKey/);
await page.reload();
await page.getByRole('button', { name: en.chair.move }).click();
const scene = page.getByRole('dialog', { name: en.chair.scene });
await expect(scene).toBeVisible();
await page.clock.runFor(30_000);
await expect(scene.getByText(/^Tonight the sun sets at .* in Prague\.$/)).toBeVisible();
await shot(page, 'sunset');
expect(requests.filter((url) => !url.startsWith(server.origin + '/'))).toEqual([]);
} finally {
await context.close();
}
});
test('the same rose on a phone', async ({ browser }) => {
expect(saved, 'the desktop test saves the rose this one opens').not.toBe('');
const context = await newContext(browser, true);
try {
const page = await context.newPage();
const requests = watch(page);
await page.clock.install({ time: LAST });
await page.goto(server.url);
await chooseGardenerAndTown(page);
await page.getByRole('button', { name: en.rose.safe.title }).click();
await page.getByLabel(en.rose.safe.bringBack).setInputFiles({ name: 'rose.json', mimeType: 'application/json', buffer: Buffer.from(saved) });
await expect(page.getByText(/^She is back/)).toBeVisible();
await storedCare(page, DAYS);
await page.reload();
await expect(page.getByRole('button', { name: en.rose.care })).toBeVisible();
await shot(page, 'phone-garden');
await openRing(page);
await shot(page, 'phone-ring');
expect(requests.filter((url) => !url.startsWith(server.origin + '/'))).toEqual([]);
} finally {
await context.close();
}
});
+19
View File
@@ -0,0 +1,19 @@
import { defineConfig, devices } from '@playwright/test';
/**
* The Aula pictures (`pnpm aula:shots`, .agents/features/fabrica-release.md F7): the BUILT PWA
* on demo data the game makes itself, written to e2e/aula/ (git-ignored). Its own config, so
* `pnpm test:e2e` stays the suite of record and the pictures are taken only when asked for.
*/
export default defineConfig({
testDir: '.',
testMatch: /aula\.spec\.ts/,
fullyParallel: false,
workers: 1,
retries: 0,
reporter: [['list']],
use: {
...devices['Desktop Chrome'],
trace: 'retain-on-failure'
}
});
+21
View File
@@ -0,0 +1,21 @@
import { defineConfig, devices } from '@playwright/test';
/**
* Fabrica's targets (.fabrica/tests.yaml; .agents/features/fabrica-release.md F9).
* - `web`: the specs of `pnpm test:e2e`, against the BUILT bundle (build it first).
* - `android`: the app on Fabrica's test phone, leased from its phone queue. Without the
* environment Fabrica gives it, the test skips and says why: it never reaches for a phone itself.
* `pnpm test:e2e` keeps its own config, so nothing here changes the suite of record.
*/
export default defineConfig({
testDir: '.',
fullyParallel: false,
workers: 1,
retries: 0,
reporter: [['list']],
use: { trace: 'retain-on-failure' },
projects: [
{ name: 'web', testMatch: /(shell|update|petal|planet)\.spec\.ts/, use: { ...devices['Desktop Chrome'] } },
{ name: 'android', testMatch: /android\/.*\.android\.ts/ }
]
});
+2
View File
@@ -16,6 +16,7 @@
"test:e2e": "pnpm guard:cpu && turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.config.ts", "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: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", "test:android": "tsx scripts/android-smoke.ts",
"aula:shots": "pnpm guard:cpu && turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.aula.config.ts",
"validate:library": "tsx scripts/validate-library.ts", "validate:library": "tsx scripts/validate-library.ts",
"library:verify": "tsx scripts/verify-sentences.ts", "library:verify": "tsx scripts/verify-sentences.ts",
"lint:copy": "tsx scripts/lint-copy.ts", "lint:copy": "tsx scripts/lint-copy.ts",
@@ -25,6 +26,7 @@
"tauri:dev": "pnpm --filter @rosea/tauri dev", "tauri:dev": "pnpm --filter @rosea/tauri dev",
"tauri:build": "pnpm --filter @rosea/tauri build:desktop", "tauri:build": "pnpm --filter @rosea/tauri build:desktop",
"tauri:android": "pnpm --filter @rosea/tauri build:android", "tauri:android": "pnpm --filter @rosea/tauri build:android",
"tauri:android-release": "pnpm --filter @rosea/tauri build:android-release",
"tauri:ios": "pnpm --filter @rosea/tauri build:ios" "tauri:ios": "pnpm --filter @rosea/tauri build:ios"
}, },
"devDependencies": { "devDependencies": {
+12
View File
@@ -271,6 +271,18 @@ importers:
specifier: 3.2.7 specifier: 3.2.7
version: 3.2.7(@types/node@22.20.1)(jsdom@25.0.1)(terser@5.51.2)(tsx@4.23.12) version: 3.2.7(@types/node@22.20.1)(jsdom@25.0.1)(terser@5.51.2)(tsx@4.23.12)
tools/release:
devDependencies:
'@types/node':
specifier: 22.20.1
version: 22.20.1
typescript:
specifier: 5.9.3
version: 5.9.3
vitest:
specifier: 3.2.7
version: 3.2.7(@types/node@22.20.1)(jsdom@25.0.1)(terser@5.51.2)(tsx@4.23.12)
packages: packages:
'@apideck/better-ajv-errors@0.3.7': '@apideck/better-ajv-errors@0.3.7':
+3
View File
@@ -0,0 +1,3 @@
/** Types for check-version.mjs, which Fabrica runs with plain `node` (no build step). */
export declare const VERSION_FILES: readonly string[];
export declare function versionProblems(root: string, want: string | undefined): string[];
+38
View File
@@ -0,0 +1,38 @@
// The release tag and the version files must agree (.agents/features/fabrica-release.md F10).
// Fabrica's Deploy runs `node scripts/check-version.mjs <version>` and rewrites exactly the files it names;
// each line is Fabrica's contract: `<file> says <old>, the tag says <new>` (Fabrica docs/04_deploy.md).
// The installer and the APK take their version from apps/rosea/package.json (tauri.conf.json reads it).
import { readFileSync } from 'node:fs';
import { join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
/** Every file that carries the app's version, relative to the repository root. */
export const VERSION_FILES = [
'package.json',
'apps/rosea/package.json',
'apps/rosea-tauri/package.json',
'apps/rosea-tauri/src-tauri/Cargo.toml'
];
function versionOf(root, file) {
const text = readFileSync(join(root, file), 'utf8');
if (file.endsWith('.toml')) return text.match(/^version = "([^"]+)"/m)?.[1];
return JSON.parse(text).version;
}
/** The lines to print, one per file whose version is not `want`. Empty when they all agree. */
export function versionProblems(root, want) {
if (!want) return ['usage: node scripts/check-version.mjs <version>'];
return VERSION_FILES.map((f) => [f, versionOf(root, f)])
.filter(([, v]) => v !== want)
.map(([f, v]) => `${f} says ${v}, the tag says ${want}`);
}
const isMain = (arg) => Boolean(arg) && resolve(arg).toLowerCase() === fileURLToPath(import.meta.url).toLowerCase();
if (isMain(process.argv[1])) {
const want = process.argv[2]?.replace(/^v/, '');
const problems = versionProblems(fileURLToPath(new URL('..', import.meta.url)), want);
for (const p of problems) console.error(p);
if (problems.length > 0) process.exit(1);
console.log(`version ${want} everywhere`);
}
+20 -3
View File
@@ -19,11 +19,22 @@ const TARGETS: readonly { dir: string; ext: readonly string[] }[] = [
{ dir: 'packages/ui/src', ext: ['.ts', '.svelte', '.css'] }, { dir: 'packages/ui/src', ext: ['.ts', '.svelte', '.css'] },
{ dir: 'apps/rosea/src', ext: ['.ts', '.svelte', '.css'] }, { dir: 'apps/rosea/src', ext: ['.ts', '.svelte', '.css'] },
// Store listings, once they exist, live here and are player-facing too (§8). // Store listings, once they exist, live here and are player-facing too (§8).
{ dir: 'store', ext: ['.md', '.txt', '.json'] } { dir: 'store', ext: ['.md', '.txt', '.json'] },
// The Aula page's brief and each release's notes: a stranger reads them (fabrica-release.md F11).
{ dir: '.fabrica/aula', ext: ['.md'] },
{ dir: '.fabrica/notes', ext: ['.md'] }
]; ];
/** Single files: the page shell, the config that builds the web manifest, and the Letter. */ /** Single files: the page shell, the config that builds the web manifest, the Letter, and the Aula page's text. */
const FILES: readonly string[] = ['apps/rosea/index.html', 'apps/rosea/vite.config.ts', 'docs/LETTER.md']; const FILES: readonly string[] = [
'apps/rosea/index.html',
'apps/rosea/vite.config.ts',
'docs/LETTER.md',
'AULA.md',
// Written by `fabrica notes` from commit subjects during a release; read when it is there, so the
// release's `notes-copy` step stops a forbidden word before it reaches the page (fabrica-release.md F11).
'target/notes/release-notes.md'
];
function walk(dir: string, ext: readonly string[]): string[] { function walk(dir: string, ext: readonly string[]): string[] {
if (!existsSync(dir)) return []; if (!existsSync(dir)) return [];
@@ -44,6 +55,12 @@ if (files.length === 0) {
process.exit(1); process.exit(1);
} }
// `--list` prints what would be read and checks nothing: the seam tools/release tests the list through.
if (process.argv.includes('--list')) {
for (const file of files) console.log(relative(root, file).replace(/\\/g, '/'));
process.exit(0);
}
let problems = 0; let problems = 0;
for (const file of files) { for (const file of files) {
for (const p of lintCopy(readFileSync(file, 'utf8'))) { for (const p of lintCopy(readFileSync(file, 'utf8'))) {
+16
View File
@@ -0,0 +1,16 @@
{
"name": "@rosea/release",
"version": "0.1.0",
"private": true,
"type": "module",
"description": "Tests of what a release through Fabrica reads from this repository (.agents/features/fabrica-release.md): the version files, the page's words under lint:copy, the pipeline files. Never imported by the app.",
"scripts": {
"typecheck": "tsc -p tsconfig.json",
"test": "vitest run --reporter=verbose"
},
"devDependencies": {
"@types/node": "22.20.1",
"typescript": "5.9.3",
"vitest": "3.2.7"
}
}
+49
View File
@@ -0,0 +1,49 @@
import { spawnSync } from 'node:child_process';
import { createRequire } from 'node:module';
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { describe, expect, it } from 'vitest';
/**
* The Aula page's words are read by strangers, like a store listing (CLAUDE.md §8), so
* lint:copy must read them (fabrica-release.md F11). The rules themselves are tested in
* @rosea/content; this proves the files are in the list the script checks.
*/
const repo = fileURLToPath(new URL('../../../', import.meta.url));
const tsx = createRequire(join(repo, 'package.json')).resolve('tsx/cli');
function listed(): string[] {
const run = spawnSync(process.execPath, [tsx, join(repo, 'scripts/lint-copy.ts'), '--list'], { cwd: repo, encoding: 'utf8' });
expect(run.status, run.stderr).toBe(0);
return run.stdout.split(/\r?\n/).filter(Boolean);
}
describe('lint:copy reads the Aula page', { timeout: 60_000 }, () => {
it('AULA.md, the brief and every release note are checked', () => {
const files = listed();
expect(files).toContain('AULA.md');
expect(files).toContain('.fabrica/aula/brief.md');
expect(files).toContain('.fabrica/notes/0.1.0.md');
});
it("a release's generated notes are checked when they are there", () => {
const notes = join(repo, 'target/notes/release-notes.md');
const had = existsSync(notes);
if (!had) {
mkdirSync(dirname(notes), { recursive: true });
writeFileSync(notes, '# notes\n');
}
try {
expect(listed()).toContain('target/notes/release-notes.md');
} finally {
if (!had) rmSync(notes);
}
});
it('the game itself is still checked', () => {
const files = listed();
expect(files).toContain('packages/ui/src/copy/en.ts');
expect(files).toContain('docs/LETTER.md');
});
});
+62
View File
@@ -0,0 +1,62 @@
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { spawnSync } from 'node:child_process';
import { afterEach, describe, expect, it } from 'vitest';
import { VERSION_FILES, versionProblems } from '../../../scripts/check-version.mjs';
/** The version check Fabrica's Deploy reads (fabrica-release.md F10). */
const repo = fileURLToPath(new URL('../../../', import.meta.url));
const temps: string[] = [];
afterEach(() => {
for (const t of temps.splice(0)) rmSync(t, { recursive: true, force: true });
});
function fakeRepo(versions: Record<string, string>): string {
const root = mkdtempSync(join(tmpdir(), 'rosea-version-'));
temps.push(root);
for (const file of VERSION_FILES) {
const v = versions[file] ?? '0.1.0';
mkdirSync(dirname(join(root, file)), { recursive: true });
const text = file.endsWith('.toml') ? `[package]\nname = "x"\nversion = "${v}"\n` : JSON.stringify({ name: 'x', version: v });
writeFileSync(join(root, file), text);
}
return root;
}
describe('check-version', { timeout: 30_000 }, () => {
it('agrees when every file carries the version', () => {
expect(versionProblems(fakeRepo({}), '0.1.0')).toEqual([]);
});
it('names each file that differs, in the words Fabrica parses', () => {
const root = fakeRepo({ 'apps/rosea-tauri/src-tauri/Cargo.toml': '0.0.9', 'apps/rosea/package.json': '0.2.0' });
expect(versionProblems(root, '0.1.0')).toEqual([
'apps/rosea/package.json says 0.2.0, the tag says 0.1.0',
'apps/rosea-tauri/src-tauri/Cargo.toml says 0.0.9, the tag says 0.1.0'
]);
});
it('refuses without a version', () => {
expect(versionProblems(fakeRepo({}), undefined)).toEqual(['usage: node scripts/check-version.mjs <version>']);
});
it('covers the file the installer and the APK take their version from', () => {
const conf = JSON.parse(readFileSync(join(repo, 'apps/rosea-tauri/src-tauri/tauri.conf.json'), 'utf8')) as { version: string };
// tauri.conf.json names the game's package.json relative to itself.
const named = join('apps/rosea-tauri/src-tauri', conf.version).replace(/\\/g, '/');
expect(VERSION_FILES).toContain(named);
});
it('this repository agrees with itself, and the CLI says so (a v prefix is the tag, not the version)', () => {
const version = (JSON.parse(readFileSync(join(repo, 'package.json'), 'utf8')) as { version: string }).version;
expect(versionProblems(repo, version)).toEqual([]);
const ok = spawnSync(process.execPath, [join(repo, 'scripts/check-version.mjs'), `v${version}`], { encoding: 'utf8' });
expect(ok.status).toBe(0);
expect(ok.stdout).toContain(`version ${version} everywhere`);
const bad = spawnSync(process.execPath, [join(repo, 'scripts/check-version.mjs'), '9.9.9'], { encoding: 'utf8' });
expect(bad.status).toBe(1);
expect(bad.stderr).toContain(`package.json says ${version}, the tag says 9.9.9`);
});
});
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["node"]
},
"include": ["test/**/*.ts"]
}