[repo] Workspace: Review Phase 0 and record gaps, lessons and handover
Adversarial review with per-package counts and 13 reintroduced bugs, all caught. Fixes from the review: the trace geocell is capped at 6 characters (~1 km; 16 allowed centimetres), one forbidden-word hit per place, and an e2e guard that meta charset stays within the first 1024 bytes. CLAUDE.md §6.2 no longer contradicts itself about care acts; §2 and §3 say what Phase 0 actually built.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Phase 0 — the workspace
|
||||
|
||||
Status: **built on `feature/phase0-workspace`**, not yet merged.
|
||||
Status: **built on `feature/phase0-workspace`**, not yet merged. Review:
|
||||
[`feature-phase0-workspace.md`](../reviews/feature-phase0-workspace.md).
|
||||
Gates closed and still open: [`GAP_ANALYSIS.md`](../GAP_ANALYSIS.md).
|
||||
|
||||
`docs/ROADMAP.md` does not exist yet, so this document defines Phase 0 itself. It
|
||||
@@ -44,15 +45,19 @@ flowchart LR
|
||||
scripts["scripts/<br/>lint-copy, validate-library,<br/>git hooks"]
|
||||
e2e["e2e/<br/>Playwright: built bundle,<br/>server killed for offline"]
|
||||
|
||||
app --> ui --> engine --> schema
|
||||
app --> content --> schema
|
||||
content --> engine
|
||||
app --> ui --> schema
|
||||
engine --> schema
|
||||
content --> schema
|
||||
app --> schema
|
||||
scripts --> content
|
||||
content -. reads .-> lib
|
||||
e2e -. serves .-> app
|
||||
```
|
||||
|
||||
`ui → engine` (CLAUDE.md §2) is not drawn because nothing in `ui` calls the engine yet, and an unused
|
||||
dependency is a dependency nobody tested. It arrives with the first component that renders a value
|
||||
the engine computes. `app → content` likewise.
|
||||
|
||||
### Decisions
|
||||
|
||||
| # | Decision | Why |
|
||||
@@ -66,6 +71,9 @@ flowchart LR
|
||||
| D7 | The CSP lives in a `<meta>` tag: `default-src 'self'`, no inline script. The service worker is registered from an emitted file, not an inline snippet. | GitHub Pages cannot set headers (§8, predicted). An inline registration script would need `'unsafe-inline'` and quietly widen the policy for everything. |
|
||||
| D8 | No deploy workflow yet. | There is no GitHub remote. A workflow for a host that does not exist is configuration nobody can test. |
|
||||
| D9 | `localDay(epochMs, timeZone)` is the only day computation. It formats with `Intl.DateTimeFormat` for an explicit IANA zone. | §7: one module computes a day. The zone is always passed in. A city the player chooses maps to a zone, and so does the device fallback, which the app reads and the engine never does. |
|
||||
| D10 | `apps/rosea/vite.config.ts` imports the name constants by **relative path** (`../../packages/schema/src/constants.js`), not as `@rosea/schema`. | Vite bundles a config's relative imports but externalises anything under `node_modules`, and Node cannot load a workspace package's `.ts`. `--configLoader runner` fixed `vite build` but not `svelte-check`, which still printed *failed to load config* inside a green run. The constants module is pure and has no imports. |
|
||||
| D11 | Every direct dependency is **pinned exactly** to the version Ludus's lockfile resolved, and `engine-strict` is off. | This machine runs Node 22.11. Fresh resolution pulled `@axe-core/playwright@4.14` (needs ≥ 22.12) and `eslint-visitor-keys@5` (declares ≥ 22.13). Ludus runs the same packages on the same Node. Upgrading Node is G0.20. |
|
||||
| D12 | The trace's `geocell` is capped at 6 characters. | Found in self-review: the first draft allowed 16, and a 16-character geohash is centimetres. Six is ~1.2 × 0.6 km, the ~1 km of CLAUDE.md §4. Anything finer is rejected by the schema, before any code could send it. |
|
||||
|
||||
## 3. Risk analysis
|
||||
|
||||
@@ -101,13 +109,19 @@ is no mechanic yet that could carry any of them.
|
||||
| Hope-sentence schema accepts a valid entry | unit | `packages/schema/test/schemas.test.ts` |
|
||||
| Care event rejects an unknown `act`, a missing `localDay`, free text in `messageId` | unit | same |
|
||||
| Trace rejects a timestamp finer than a day and extra properties | unit | same |
|
||||
| `localDay` in Prague on both 2026 DST days, Sydney, Anchorage, UTC±14 | unit (golden) | `packages/engine/test/localDay.test.ts` |
|
||||
| Monday 23:30 in Prague is Monday, not Tuesday | unit | same |
|
||||
| `localDay` is the same for every ms within one local day (property) | property | same, fast-check |
|
||||
| `localDay` in Prague on both 2026 DST days, Sydney, Reykjavík, UTC+14, UTC−12 | unit (golden) | `packages/engine/test/localDay.test.ts` |
|
||||
| Monday evening in Anchorage is Monday, though the UTC day is Tuesday (the trap, measured) | unit | same |
|
||||
| An unknown zone throws instead of falling back to UTC | unit | same |
|
||||
| Days never go backwards, always advance within 26 h, are deterministic (8 zones, 2000–2100) | property | same, fast-check |
|
||||
| Each purity ban fires on an impure snippet; clean code passes | unit | `packages/engine/test/purity-lint.test.ts` |
|
||||
| Every fixture in `content/fixtures/` fails with its named message | unit | `packages/content/test/validator.test.ts` |
|
||||
| Forbidden words: whole-word, case-insensitive; no false hit on *treaty* or *cured meat*… | unit | `packages/content/test/forbidden.test.ts` |
|
||||
| Shell copy passes `lint:copy` | unit + script | `packages/ui/test/copy.test.ts`, `pnpm lint:copy` |
|
||||
| Forbidden words: whole-word, case-insensitive; no false hit on *treaty*, *healthy*, *patience* | unit | `packages/content/test/forbidden.test.ts` |
|
||||
| `lint:copy` core: strings and markup caught, comments ignored, *Domi* never alone | unit | `packages/content/test/copy-lint.test.ts` |
|
||||
| Shell copy passes `lint:copy` | script | `pnpm lint:copy` |
|
||||
| Shell names the product from the constant, has a `main` landmark and no controls | unit | `packages/ui/test/Shell.test.ts` |
|
||||
| Trace rejects a geocell finer than ~1 km | unit | `packages/schema/test/schemas.test.ts` |
|
||||
| `<meta charset>` stays within the first 1024 bytes after the CSP | e2e | `e2e/shell.spec.ts` |
|
||||
| Hooks block a > 5 MB file and an AI trailer, and pass a clean commit | manual, run | `.agents/reviews/feature-phase0-workspace.md` |
|
||||
| Built app renders its name at `/Rosea/` | e2e | `e2e/shell.spec.ts` |
|
||||
| No request to any other origin; no cookie; no `localStorage` | e2e | same |
|
||||
| Manifest `scope`/`start_url` and service-worker scope equal the base | e2e | same |
|
||||
|
||||
Reference in New Issue
Block a user