[docs] DaySentence: Analysis, review, lessons, and G1.5 closed for the code

This commit is contained in:
2026-11-02 09:03:56 +01:00
parent 781a2407b9
commit 838830e0ef
9 changed files with 218 additions and 16 deletions
+60
View File
@@ -0,0 +1,60 @@
# Review — `feature/day-sentence`
Adversarial self-review (CLAUDE.md §5.3). Analysis: [`features/day-sentence.md`](../features/day-sentence.md).
Reviewed 2026-11-02 on Node 22.11.0, Windows 10. There is no PR: the only remote is Gitea.
## Gates
Counts are on the merge; HANDOVER repeats them. New: engine +25 (5 properties), schema +3,
storage +7, content +9, ui +7, e2e +3 (no petal in the shipped build; open, reload, tomorrow
in a fixture build; axe folded and open).
**The app changed** (CLAUDE.md §5.4), but **not visibly yet**: the shipped library is empty, so
the shipped build holds no petal and says nothing about one. The e2e fixture build shows it.
Rebuilt by the e2e and offline runs; **not deployed** (G0.13).
## Bug drills
| Put back | Result |
|:--|:--|
| The petal moves on by itself each day (lost) | CAUGHT: 3 |
| Every opening counts, not only the first of a day | CAUGHT |
| She remembers after any gap | CAUGHT |
| The order ignores when a sentence was verified | CAUGHT: 2 |
| She offers the petal over a need | CAUGHT |
| Loading care warns on every petal | CAUGHT |
| The rose file leaves her petals behind | CAUGHT: 3 |
| A candidate may carry `verifiedBy` | CAUGHT |
| `library:verify` accepts no name | CAUGHT |
Not drilled: the app build no longer running `validate:library` first. No test would fail; the
build script itself is the check (finding 8).
## Findings
| # | Area | Finding | Resolution |
|:--|:--|:--|:--|
| 1 | Soul | *Remembering on nearby days* could be a streak in disguise: a player who learns that a gap costs the extra line may feel they lost it. | Nothing names it, counts it or explains it, so there is nothing to lose sight of; after a gap the day's petal is exactly as full. Accepted, and flagged for the author's two-week play (ROADMAP Phase 1 gate). `PETAL.nearDays` is his. |
| 2 | Soul | *I am keeping a folded petal for you.* on every visit could feel like an obligation. | Said only when she needs nothing else, never after it is opened, never as a notification. Accepted; the author may soften it. |
| 3 | Soul | Opening at sunset could become the reward that keeps someone on the screen at sunset. | It gives nothing more; her words then send the player out: *Go and look at the sky. I will be here.* |
| 4 | Correctness | Two tabs open the petal on the same day: two events. | The first of a local day is that day's petal (P2); property-tested. |
| 5 | Correctness | Changing the town to a zone on another calendar day can show a folded petal again that day, so a second opening. | Accepted: at most one extra petal per change of zone, and nothing is lost. The event keeps the day it was recorded with. |
| 6 | Correctness | A sentence removed from the library after it was opened. | Today's opening still counts as today's (no second one); the UI shows nothing for it; it is never remembered. Tested in the engine. |
| 7 | Correctness | Turbo did not know `ROSEA_BASE` or `ROSEA_LIBRARY_DIR`, so a turbo build with either set replayed a build made without it. | Fixed: both are in the build task's `env`; checked that the cache key changes. Also seen: turbo's replay writes over `dist/` without clearing it, so a stale bundle from another build can sit beside the right one (unreferenced by the page and the worker). **A deploy must build into a clean folder** — noted for G0.13. |
| 8 | Process | What ships is what passed `validate:library` only because the app's build script runs it first. | Accepted; stated in `vite.config.ts` and the analysis (P5). A test that reads the script would only restate it. |
| 9 | Privacy | Which sentences were opened, and when, go into the rose file. | The same as care: the player's own file, never the town, never sent. |
| 10 | Copyright | A candidate could be quoted from a modern translation or from memory. | Candidates carry `check.url` and `check.publicDomain`; the helper that gathered them was told to copy from fetched public-domain editions; the validator holds them to the translation list. Only the author verifies (P8). |
| 11 | Accessibility | The petal is a button; the open words get focus; *Today's petal* is a toggle with `aria-expanded`. | Tested; axe passes folded and open. Not tried with a real screen reader. |
| 12 | Offline | No offline test opens a petal: the shipped library is empty. | Deferred until the first sentences are verified; the e2e reload covers the stored opening. |
| 13 | Test honesty | The first UI test of *opened earlier today* failed for the wrong reason: the helper that looks for a quiet moment picked local midnight, so "a minute earlier" was yesterday. | Fixed: the helper looks only at daytime on the pour's own day. `lessons/testing.md`. |
| 15 | Content | 78 candidates arrived from a helper agent. All pass every rule; a second script found all 78 word for word in the downloaded editions. Eleven translations were missing from the public-domain list. | Added to `validator.ts`, each the exact Gutenberg edition, with the translator's death year (all before 1956) and an edition before 1931. Ten lines are flagged for the author in `content/candidates/README.md`: possible promises, lines that could sting, cut points, editions. |
| 16 | Process | The helper downloaded 39 Project Gutenberg text files with `curl` into the session's scratch folder, without asking first. Downloading needs the person's permission. | Reported to the author. The files are outside the repository and are not committed. Next time a brief that needs downloads says so, and the request goes to the author first. |
| 14 | Process | An inline Python edit on Windows wrote CRLF line endings into two files; a heredoc broke on a template string again. | Normalised; edits made with the edit tool instead. `lessons/process.md`. |
## What was not verified
- A screen reader; Safari; the petal on a real phone.
- Offline opening of a petal (finding 12).
- That the Gutenberg editions themselves are faithful, and every public-domain reason: the
author's check, line by line, before `pnpm library:verify`. The match between candidate and
edition was checked by script (finding 15).