Files
Rosea/.agents/reviews/feature-keep-her-safe-apps.md

96 lines
8.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Review — `feature/keep-her-safe-apps`
Adversarial self-review (CLAUDE.md §5.3). Analysis: [`features/keep-her-safe-apps.md`](../features/keep-her-safe-apps.md).
Reviewed 2026-11-17 on Windows 10, Node 22.23.4, Tauri CLI 2.12.5, WebView2 157; the Android tablet is
the WAVE 10C (Android 16, WebView 140). Closes the release blocker G-T4 found in
[`feature-tauri-platforms.md`](feature-tauri-platforms.md) finding 1. No PR: the only remote is Gitea.
## What changed for the player
- **In the Android and Windows apps**, *Keep her safe* says *She lives in this app, on this device,
until the app is removed. A saved file keeps her anywhere.* The browser sentences, *Ask the browser
to keep her* and the iPhone install hint are gone there; `persist()` is no longer asked.
- **On Android**, *Save her to a file* opens Android's own save screen. When the file is written the
garden says *She is in that file now.*; a player who steps back hears nothing.
- **The PWA is unchanged** (its words, its download; the e2e suite still passes).
## Gates
Run on the branch head (based on `main` 0b72ae0, with the planet garden), 2026-11-17:
| Gate | Result |
|:--|:--|
| `pnpm lint`, `pnpm typecheck` | 0 problems (svelte-check: 0 errors, 0 warnings, after finding 5) |
| `pnpm lint:copy` | 0 problems |
| `pnpm validate:library` | 13 of 13 fixtures rejected; 78 candidates |
| `pnpm test` (guard waited 28 s at 100 %, then started at 42 %; rerun after findings 10–12 at 71 %) | **572 passed**: identity 5, schema 19, cpu-guard 13, content 88, storage 70, art-prep 63, engine 179, **tauri 47** (+7), **ui 88** (+4 here) |
| `pnpm test:e2e` | 26 passed |
| `pnpm test:offline` | 1 passed |
| `pnpm tauri:android` | built; Kotlin compiled; `aapt2`: still no permission, no backup |
| `pnpm tauri:build` + `check-garden.ts desktop` | **3 of 3 passed**: the app's words shown, no browser words; *Save her to a file* started a download (`rose-2026-11-17.json`, cancelled by the check) |
| `check-garden.ts android` (WAVE 10C over Wi-Fi adb, unlocked by the author) | **2 of 2 passed after the fixes** (findings 10–12): opened, watered, force-stopped, reopened, still watered; the app's words; *Save her to a file* → Android's save screen → *She is in that file now.*; *Bring her back from a file* → Android's picker → *Everything in that file is already here.*; the test file removed from `Download`, the app stopped. Earlier runs: 1 failed on the adb server, 3 on findings 11 and 12. |
**The app changed** (CLAUDE.md §5.4): the apps' *Keep her safe*. Rebuilt; **not deployed or
distributed** (G0.13; the apps exist on this machine only).
## Bug drills
| Put back | Result |
|:--|:--|
| `KeepSafe` ignores where she lives (browser words in the app) | CAUGHT |
| The app still asks the browser to keep her | CAUGHT |
| *She is in that file now.* said whatever the answer | CAUGHT |
| The app words speak of a browser | CAUGHT |
| The Kotlin interface renamed (`roseFile`) | CAUGHT |
| The Kotlin answers on another event | CAUGHT |
| The file-name rule lets any `.json` through | CAUGHT (by *accepts the file name the garden gives … and nothing else*) |
| `@Keep` dropped from the bridge class | CAUGHT |
| The game takes any answer but `false` as success | CAUGHT |
| `android.ts check` with Tauri's own `MainActivity` | CAUGHT (exit 1; `apply` puts Rosea's back, exit 0) |
| The page no longer kept between the bars (listener renamed; padding dropped) | CAUGHT, both — after the first test **missed** the renamed call (it matched a substring; tightened to the exact call and padding) |
| The bars' paper drifts from `tokens.css` | CAUGHT |
**Not drilled, and nothing off the device would catch it:** the 8 MB limit and one save at a time
(Kotlin only); `evaluateJavascript` being blocked by the page's CSP (only the device run shows the
answer arriving).
## Findings
| # | Area | Finding | Resolution |
|:--|:--|:--|:--|
| 1 | **Soul** | The release blocker itself: words of fear and a remedy that did nothing (G-T4). | Fixed: true words in the apps, a working save on Android, a quiet confirmation. |
| 2 | Soul | Should a cancelled save say something (*Nothing was saved.*)? | No: stepping back is the player's choice; commenting on it would scold. The earlier *saved* word is cleared, so nothing false stays on screen. |
| 3 | Privacy | The bridge is a JavaScript interface any script in the WebView could call. | Only the game's page runs there (no network, `'self'` CSP). The bridge accepts only `rose-YYYY-MM-DD.json` and up to 8 MB, and can only open a screen the player must confirm. |
| 4 | Privacy | The player may choose a cloud folder in Android's save screen. | Their choice, made in the system's own screen; the file never holds the town (keep-her-safe.md K4). The game still has no `INTERNET`. |
| 5 | Correctness | svelte-check warned that `inApp` read `wiring` once (`state_referenced_locally`). | `$derived`; 0 warnings. |
| 6 | Test honesty | The desktop check failed twice reading *Her numbers* after the restart: it pressed before her care had been read back (the planet garden made the first paint earlier). | The check waits for her picture, then presses until the button says it is open, never pressing an open one; then 3 of 3 passed. |
| 7 | Correctness | Two quick taps on *Save* while Android's screen opens. | The game returns the same pending promise; Kotlin ignores a second call while busy. Not tried on the device. |
| 8 | Scope | iOS (WKWebView) will need its own save. | G-T1; noted in the analysis. |
| 9 | Process | The tablet was asleep behind a secure lock when the device check was due. | Waited for the author to unlock it; nothing was bypassed. |
| 10 | **Design** | Seen on the tablet's screenshot: the app drew **under Android's system bars** — the clock over the title, the navigation bar over *Bring her back from a file*. Tauri's stock activity turns edge-to-edge on and leaves the page under the bars. | Rosea's `MainActivity` keeps the page between the bars and paints them with the garden's paper, light or dark with the system (as Culina does); a test holds the colours equal to `tokens.css`; seen fixed on the tablet (dark theme). |
| 11 | Test honesty | The check tapped the picker's file while the screen was still sliding in. | It taps only a node that stands still across two readings. |
| 12 | Test honesty | The check matched a node by its description too, and DocumentsUI's *Preview the file …* button comes first: it opened a preview, not the file, and the check failed for a reason that was the check's own. | The file is chosen by its own text only. Found by a probe that did the steps by hand and succeeded. |
| 13 | Process | Git Bash rewrites `/sdcard/…` arguments to Windows paths for `adb shell` typed by hand. | `MSYS_NO_PATHCONV=1` for hand-typed adb; the check passes arguments from Node and is not affected. Lesson in process.md. |
| 14 | Process | The USB link hung `adb install`; the same tablet was reachable over Wi-Fi adb (another session's connection on the shared adb server). | Installed and checked over Wi-Fi; nothing in the other session's state was changed. |
## Correctness
- **Second run**: `android.ts apply` copies the activity each time; `check` compares bytes.
- **App closed mid-save**: the file is written on Android's side only after the player presses Save;
if the app dies before the answer, the promise never resolves and the garden simply says nothing
(the next visit is fresh). Not tried.
- **Two tabs**: an app has one window.
## Reachability, offline
Nothing reaches anyone. The save and the picker work with no network (the app has none).
## What was NOT verified
- iOS, macOS, Linux.
- A minified release APK (the `@Keep` is checked in source only).
- Saving to a cloud folder or a memory card; Android versions other than 16.
- Bringing back a file made on *another* device (the round trip used the same tablet, so it answered *already here*; the merge itself is storage's, tested in keep-her-safe.md).
- The light theme's bars on the tablet (seen in the dark theme only; the colour is tested).
- Bringing her back on Windows (WebView2's file dialog was not driven).