From fe0d88b39df50c3bdbe86359986fa28932581d99 Mon Sep 17 00:00:00 2001 From: OmO Orchestrator Date: Tue, 17 Nov 2026 16:53:30 -0500 Subject: [PATCH] feat(shell): add home grid with 13 miniapp navigation tiles --- .../task-4-the-commons-hollow-gate-review.md | 101 +++++ ...ons-hollow-miniapp-logic-leak-failure.json | 16 + .../task-10-the-commons-hollow.json | 18 + .../task-2-the-commons-hollow-gate-review.md | 134 +++++++ .../task-3-the-commons-hollow-gate-review.md | 118 ++++++ .omo/plans/the-commons-hollow.md | 4 +- package-lock.json | 354 ++++++++++++++++++ package.json | 4 + src/App.tsx | 118 +----- src/shell/HomeGrid.module.css | 43 +++ src/shell/HomeGrid.test.tsx | 35 ++ src/shell/HomeGrid.tsx | 27 ++ src/shell/HomePage.tsx | 13 + src/shell/importGraph.test.ts | 25 ++ src/shell/miniappRegistry.ts | 32 ++ 15 files changed, 924 insertions(+), 118 deletions(-) create mode 100644 .omo/evidence/task-4-the-commons-hollow-gate-review.md create mode 100644 .omo/evidence/the-commons-hollow/task-10-the-commons-hollow-miniapp-logic-leak-failure.json create mode 100644 .omo/evidence/the-commons-hollow/task-10-the-commons-hollow.json create mode 100644 .omo/evidence/the-commons-hollow/task-2-the-commons-hollow-gate-review.md create mode 100644 .omo/evidence/the-commons-hollow/task-3-the-commons-hollow-gate-review.md create mode 100644 src/shell/HomeGrid.module.css create mode 100644 src/shell/HomeGrid.test.tsx create mode 100644 src/shell/HomeGrid.tsx create mode 100644 src/shell/HomePage.tsx create mode 100644 src/shell/importGraph.test.ts create mode 100644 src/shell/miniappRegistry.ts diff --git a/.omo/evidence/task-4-the-commons-hollow-gate-review.md b/.omo/evidence/task-4-the-commons-hollow-gate-review.md new file mode 100644 index 0000000..70cc1e6 --- /dev/null +++ b/.omo/evidence/task-4-the-commons-hollow-gate-review.md @@ -0,0 +1,101 @@ +# Gate Review - Task 4: Local identity (Ed25519 keypair) + +- **recommendation:** APPROVE +- **verdict:** confirmed +- **worktree:** /home/athapa/patriothacks-wt/wave-1-foundation (branch `wave-1-foundation`, commit `ae93606`) +- **reviewer:** omo-native-gate-reviewer (st_01a1eb79) +- **date:** 2026-11-17 + +## originalIntent +Checkbox "4. Local identity (Ed25519 keypair)": provide a client-side, non-custodial +cryptographic identity for the app. A keypair is generated locally, persisted locally, +re-used on subsequent loads, usable to sign/verify, with no server-issued identity and no +key ever leaving the device. + +## desiredOutcome +A reusable `identity` module the app can call: `init()` creates-or-loads one keypair, +`getPublicKey()`/`sign()` operate on it (and fail loudly before init), `verify()` checks a +signature. Persistence survives reload (IndexedDB). Build stays green; a real test suite +proves the behavior. + +## userOutcomeReview +The shipped artifact satisfies the desired outcome. `init()` loads the existing record before +generating, so re-call returns the same public key without regeneration (verified in code and +by the passing re-init test). `getPublicKey()`/`sign()` throw the typed `IdentityMissingError` +when no record exists. Keys are generated via `@noble/ed25519` `keygenAsync()` and persisted +in the Dexie `identity` table keyed `"local"`; secretKey is stored only in IndexedDB. No +network primitive (`fetch`/`XMLHttpRequest`/`WebSocket`/`axios`) appears anywhere in `src/lib`. +Build exits 0; the 4-test Vitest suite passes on an independent run. + +## Independent checks + +### (1) git show --stat ae93606 - file list / no stray fixture-manifest-icon +Files touched: +- `.omo/evidence/the-commons-hollow/task-4-the-commons-hollow.json` (this task's own evidence artifact) +- `package-lock.json`, `package.json` +- `src/lib/db.ts`, `src/lib/identity.ts`, `src/lib/identity.test.ts`, `src/lib/test-setup.ts` +- `vitest.config.ts` + +No fixture file, no app manifest (`manifest.webmanifest` untouched), no icon/image asset touched. +The only `.omo/` path is this task's own evidence JSON, which is the expected deliverable and +is the file verification step (5) requires to exist. **PASS.** + +### (2) src/lib/identity.ts + src/lib/db.ts - described behavior +- `init()` calls `loadExisting()` first and returns `{ publicKey: existing.publicKey }` when a + record exists -> **no regeneration on re-init** (confirmed in source). +- `getPublicKey()` and `sign()` throw `IdentityMissingError` (typed, `name` set) when no record. **PASS.** +- `db.ts`: Dexie `CommonsDatabase`, `version(1).stores({ identity: "id" })`, `IdentityRecord` + holds `{ id:"local", publicKey, secretKey, createdAt }`. Matches claim. **PASS.** +- grep for `fetch|XMLHttpRequest|http|axios|navigator|window.|WebSocket` across `src/lib`: + **No matches.** No network calls. **PASS.** + +### (3) npx vitest run (my own run, not the claim log) +``` + ✓ src/lib/identity.test.ts > identity > generates and persists a 32-byte keypair on first init 40ms + ✓ src/lib/identity.test.ts > identity > returns the same public key on re-init instead of regenerating 6ms + ✓ src/lib/identity.test.ts > identity > signs a message and verifies it against the persisted public key 6ms + ✓ src/lib/identity.test.ts > identity > fails verification against a tampered message 5ms + Test Files 1 passed (1) + Tests 4 passed (4) +``` +4/4 pass, matching the four claimed scenarios. **PASS.** + +### (4) npm run build (my own run) +`tsc -b && vite build` -> `✓ built in 169ms`, PWA generated, **EXIT=0**. **PASS.** + +### (5) task-4-the-commons-hollow.json - real output, not placeholder +`verify.raw_output` contains genuine Vitest verbose streaming output (queued/1-4 progress +lines, per-test timings, final `Tests 4 passed (4)`), the four real test-case names, and a +real build_output_tail. Reproduced independently. Not a placeholder. **PASS.** + +## remove-ai-slops overfit/slop pass (performed directly) +- Four tests are all genuine behavioral assertions: keygen+persist (shape/length/count), + re-init idempotence (no regeneration), sign->verify round-trip, tampered-message negative. +- No deletion-only, tautological, implementation-mirroring, or removal-verification tests. +- No excessive/redundant tests; the tampered-message case is real adversarial coverage. +- Production code has no unnecessary extraction/parsing/normalization; `db.ts` and + `identity.ts` are minimal and fit-for-purpose. No AI-slop defensive scaffolding. + +## programming criteria +No maintenance-burden patterns, no false-confidence tests, no scope drift. Module boundary +(crypto + persistence) is clean and single-responsibility. + +## Notes (not blockers - no stated criterion) +- `IdentityMissingError`-before-`init()` throw path is implemented but has no dedicated test. + The claim listed exactly four tests and did not assert one for this path, so this is a NOTE, + not a criterion failure. +- No separate standalone code-review-report artifact was supplied in this review's input; + the executor evidence JSON served as evidence and the overfit/slop + programming checks were + performed directly here. No criterion requires the missing separate report. + +## Checked artifact paths +- /home/athapa/patriothacks-wt/wave-1-foundation/src/lib/identity.ts +- /home/athapa/patriothacks-wt/wave-1-foundation/src/lib/db.ts +- /home/athapa/patriothacks-wt/wave-1-foundation/src/lib/identity.test.ts +- /home/athapa/patriothacks-wt/wave-1-foundation/src/lib/test-setup.ts +- /home/athapa/patriothacks-wt/wave-1-foundation/vitest.config.ts +- /home/athapa/patriothacks-wt/wave-1-foundation/package.json +- /home/athapa/patriothacks-wt/wave-1-foundation/.omo/evidence/the-commons-hollow/task-4-the-commons-hollow.json + +## blockers +None. diff --git a/.omo/evidence/the-commons-hollow/task-10-the-commons-hollow-miniapp-logic-leak-failure.json b/.omo/evidence/the-commons-hollow/task-10-the-commons-hollow-miniapp-logic-leak-failure.json new file mode 100644 index 0000000..e73b900 --- /dev/null +++ b/.omo/evidence/the-commons-hollow/task-10-the-commons-hollow-miniapp-logic-leak-failure.json @@ -0,0 +1,16 @@ +{ + "task": "task-10-the-commons-hollow-miniapp-logic-leak-failure", + "description": "Static import-graph check: asserts HomeGrid.tsx and miniappRegistry.ts contain zero import references to any src/miniapps/* module (the shell must never import miniapp-specific business logic)", + "command": "npx vitest run src/shell/importGraph.test.ts --reporter=verbose", + "exit_code": 0, + "timestamp": "2026-11-17T21:53:13.277Z", + "checked_files": [ + "src/shell/HomeGrid.tsx", + "src/shell/miniappRegistry.ts" + ], + "pattern_checked": "/from\\s+[\"'][^\"']*miniapps\\/[^\"']*[\"']/", + "miniapps_dir_import_references_found": 0, + "result": "PASS - no miniapp-logic import leak detected", + "raw_stdout": "\n RUN v5.1.0 /home/athapa/patriothacks-wt/wave-1-foundation\n\n ✓ src/shell/importGraph.test.ts > HomeGrid import graph > contains zero references to any src/miniapps/* module 3ms\n ✓ src/shell/importGraph.test.ts > HomeGrid import graph > the registry module contains zero references to any src/miniapps/* module 0ms\n\n Test Files 1 passed (1)\n Tests 2 passed (2)\n Start at 16:53:13\n Duration 180ms (setup 44%, transform 26%, import 12%, worker 9%, tests 8%)\n\n", + "raw_stderr": "" +} \ No newline at end of file diff --git a/.omo/evidence/the-commons-hollow/task-10-the-commons-hollow.json b/.omo/evidence/the-commons-hollow/task-10-the-commons-hollow.json new file mode 100644 index 0000000..83fd1b3 --- /dev/null +++ b/.omo/evidence/the-commons-hollow/task-10-the-commons-hollow.json @@ -0,0 +1,18 @@ +{ + "task": "task-10-the-commons-hollow", + "description": "HomeGrid component: renders 13 tiles from a single miniapp registry; clicking a tile emits navigation intent with the miniapp id", + "command": "npx vitest run --reporter=verbose", + "exit_code": 0, + "timestamp": "2026-11-17T21:53:12.614Z", + "test_files": 4, + "tests_total": 14, + "tests_passed": 14, + "tests_failed": 0, + "relevant_test_file": "src/shell/HomeGrid.test.tsx", + "relevant_assertions": [ + "renders exactly one tile per registry entry with correct icon and label (13 tiles, matches miniappRegistry.length)", + "emits a navigation intent with the clicked miniapp's id (onNavigate called with target.id)" + ], + "raw_stdout": "\n RUN v5.1.0 /home/athapa/patriothacks-wt/wave-1-foundation\n\n ✓ src/shell/importGraph.test.ts > HomeGrid import graph > contains zero references to any src/miniapps/* module 2ms\n ✓ src/shell/importGraph.test.ts > HomeGrid import graph > the registry module contains zero references to any src/miniapps/* module 0ms\n ✓ src/lib/identity.test.ts > identity > generates and persists a 32-byte keypair on first init 40ms\n ✓ src/lib/identity.test.ts > identity > returns the same public key on re-init instead of regenerating 5ms\n ✓ src/lib/identity.test.ts > identity > signs a message and verifies it against the persisted public key 6ms\n ✓ src/lib/identity.test.ts > identity > fails verification against a tampered message 6ms\n ✓ src/lib/eventlog.test.ts > eventlog > appends an entry and retrieves it with a valid signature 50ms\n ✓ src/lib/eventlog.test.ts > eventlog > rejects an entry with a forged/mismatched signature at append time 7ms\n ✓ src/lib/eventlog.test.ts > eventlog > rejects an entry signed by a different key than the one it claims 5ms\n ✓ src/lib/eventlog.test.ts > eventlog > assigns strictly increasing Lamport timestamps across appends 14ms\n ✓ src/lib/eventlog.test.ts > eventlog > reads entries within a lamport range 17ms\n ✓ src/lib/eventlog.test.ts > eventlog > exposes no update/delete API on the module 1ms\n ✓ src/shell/HomeGrid.test.tsx > HomeGrid > renders exactly one tile per registry entry with correct icon and label 38ms\n ✓ src/shell/HomeGrid.test.tsx > HomeGrid > emits a navigation intent with the clicked miniapp's id 12ms\n\n Test Files 4 passed (4)\n Tests 14 passed (14)\n Start at 16:52:46\n Duration 459ms (environment 32%, tests 30%, import 16%, setup 13%, transform 7%, worker 2%)\n\n", + "raw_stderr": "" +} \ No newline at end of file diff --git a/.omo/evidence/the-commons-hollow/task-2-the-commons-hollow-gate-review.md b/.omo/evidence/the-commons-hollow/task-2-the-commons-hollow-gate-review.md new file mode 100644 index 0000000..bdf437c --- /dev/null +++ b/.omo/evidence/the-commons-hollow/task-2-the-commons-hollow-gate-review.md @@ -0,0 +1,134 @@ +# Gate Review - Todo "2. PWA manifest + icons" + +- **plan:** the-commons-hollow +- **worktree:** /home/athapa/patriothacks-wt/wave-1-foundation (branch wave-1-foundation) +- **commit under review:** 8724ff4 `feat(pwa): add manifest with icons and theme tokens` +- **reviewer:** omo-native-gate-reviewer (st_01a1eb78) +- **date:** 2026-11-17 + +## recommendation +**APPROVE** (verdict: `confirmed`) + +## blockers +None. + +## originalIntent +Give "The Commons" PWA an installable identity: fill in the previously-stubbed +(`manifest: false`) VitePWA manifest with real app metadata + icons, ship real +decodable PNG icons, and leave the already-working service-worker registration +(src/main.tsx) and workbox precache config untouched. The build must emit a real +`dist/manifest.webmanifest` that an installer can consume. + +## desiredOutcome +A production build produces a valid web app manifest with +`display === "standalone"`, a theme color, and >= 2 real icon entries (including +a maskable icon), all referencing PNG files that exist and decode at their +declared dimensions - verified end-to-end through the built site, not just the +source config. + +## userOutcomeReview +From the user's perspective the shipped artifact fully delivers the intended +outcome. The manifest is a real object (not `false`), the build succeeds and +emits `dist/manifest.webmanifest`, the three icons are genuine PNGs that decode +to exactly their declared RGBA dimensions, and the pre-existing SW registration +and workbox block are untouched. The only loose end is a leftover scratch file +and a minor inaccuracy in the evidence JSON's cleanup prose (below) - neither +affects the committed artifact or any stated success criterion. + +## checked artifact paths +- `git show --stat 8724ff4` (commit file list) +- `git show 8724ff4 -- vite.config.ts` +- `git show 8724ff4 -- src/main.tsx` (confirmed absent from diff) +- `diff <(git show 1954971:vite.config.ts) <(git show 8724ff4:vite.config.ts)` +- `src/main.tsx` (HEAD) +- `dist/manifest.webmanifest` (fresh `npm run build`) +- `public/pwa-192x192.png`, `public/pwa-512x512.png`, `public/pwa-maskable-512x512.png` +- `dist/pwa-*.png` (copied into build output) +- `.omo/evidence/the-commons-hollow/task-2-the-commons-hollow.json` +- `.pwa-qa-script.mjs` (leftover scratch) + +## independent verification + +### (1) Commit touches exactly the claimed files +`git show --stat 8724ff4`: 5 files, +158/-4, no deletions elsewhere: +- `vite.config.ts` (+32/-4) +- `public/pwa-192x192.png` (Bin 0 -> 1081) +- `public/pwa-512x512.png` (Bin 0 -> 4061) +- `public/pwa-maskable-512x512.png` (Bin 0 -> 3281) +- `.omo/evidence/the-commons-hollow/task-2-the-commons-hollow.json` (+126) + +(Claim text said "4 files"; actual set is the vite config + 3 PNGs + evidence +JSON = 5. The JSON is a verification artifact, not a production change; the +production-relevant set matches exactly. Not a defect.) + +### (2) manifest is a real object, workbox block unchanged +`diff` of 1954971 vs 8724ff4 `vite.config.ts` shows only two hunks: a comment +rewrite and `manifest: false` -> a full manifest object +(`name`/`short_name` "The Commons", `display: 'standalone'`, +`theme_color: '#1677FF'`, `background_color: '#F5F6F7'`, 3 icon entries incl. +`purpose: 'maskable'`). The `workbox: { globPatterns: [...] }` block and +`registerType`/`injectRegister` are byte-identical to 1954971. **PASS.** + +### (3) src/main.tsx untouched +`git show 8724ff4 --stat -- src/main.tsx` -> empty (file not in diff). HEAD +`src/main.tsx` still imports `registerSW` from `virtual:pwa-register` and calls +`registerSW({ immediate: true })`. **PASS.** + +### (4) Build + artifact verification (fresh `npm run build` on HEAD) +- `npm run build` exit code **0**; emits `dist/manifest.webmanifest`, `dist/sw.js`, + `dist/workbox-*.js`, and copies all 3 PNGs into `dist/`. +- Parsed `dist/manifest.webmanifest`: + - `display === "standalone"` -> **true** + - `icons.length >= 2` -> **true** (length = 3) + - maskable icon present -> **true** +- All 3 referenced icon files exist in `public/` and `dist/`. +- `file(1)` dimension check: 192x192, 512x512, 512x512 - all `8-bit/color RGBA`. +- Full inflate decode (walk chunks, zlib-inflate IDAT, compare to + `h*(1+w*4)`): all three inflate to exactly the expected raw byte count + (147648 / 1049088 / 1049088) -> genuinely valid PNGs, not header-only. + **PASS.** + +### (5) Evidence JSON is real parsed data +`task-2-the-commons-hollow.json` contains real parsed `built_manifest_parsed` +and `parsed_manifest_json` objects whose `display`, `theme_color`, and icon +entries match the artifact I independently rebuilt and parsed. Assertions +recorded (`display===standalone: true`, `icons.length>=2: true`) match my own. +Not a placeholder. **PASS.** + +### (6) Leftover scratch file (minor) +`.pwa-qa-script.mjs` (612 bytes, mtime 16:44 matching the commit) remains in the +worktree as an untracked file, **despite** the evidence JSON `cleanup` array +claiming "removed the temporary .pwa-qa-script.mjs QA harness file." Per gate +instructions this is a minor cleanup gap, **not a blocker**. The prose +inaccuracy is noted but does not affect the committed artifact. + +## remove-ai-slops / programming skill pass +Skill files not present in this environment; criteria applied directly from the +task context. +- **Tests:** commit adds no test/spec files -> no overfit, deletion-only, + tautological, implementation-mirroring, or removal-verifying tests to flag. +- **Production code:** the only production change is a declarative VitePWA + manifest object. No unnecessary extraction, parsing, or normalization; no + parallel/duplicate config; no dead code. The PNGs were produced by a one-time + hand-rolled encoder run in an eval cell (not committed as production code). +- **No separate code-review-report artifact exists for todo 2** (only task-1 and + task-3 gate reviews and the task JSONs are present), so the instruction to + "confirm the code review report shows the same skill-perspective check" has no + input to confirm. Recorded as an evidence gap, not a blocker: this is a + config-only change with no tests, and the absence of a code-review report does + not fail any stated success criterion. + +## NOTES (non-blocking) +- Icons are simple geometric glyphs on Alipay-blue, not designer artwork - + functionally valid; a human may swap in polished brand art later. (Also + self-disclosed in the evidence `risks`.) +- No failure-case QA (strip icons -> missing-icons installability error) was + run. This scenario is not part of this DoneClaim's stated success criteria + (happy-path manifest + icons only), so it is a NOTE, not a blocker. +- `.pwa-qa-script.mjs` scratch file should be deleted; evidence cleanup prose + overstated that it was already removed. + +## evidence gaps +- No standalone code-review report artifact for todo 2 to cross-check the + skill-perspective / overfit coverage against (reviewer performed the pass + directly instead). diff --git a/.omo/evidence/the-commons-hollow/task-3-the-commons-hollow-gate-review.md b/.omo/evidence/the-commons-hollow/task-3-the-commons-hollow-gate-review.md new file mode 100644 index 0000000..1a1d1cb --- /dev/null +++ b/.omo/evidence/the-commons-hollow/task-3-the-commons-hollow-gate-review.md @@ -0,0 +1,118 @@ +# Gate Review — Task 3: Service worker + offline caching + +- **recommendation:** APPROVE +- **verdict:** confirmed +- **goalId:** task-3-the-commons-hollow (plan: the-commons-hollow) +- **worktree:** /home/athapa/patriothacks-wt/wave-1-foundation (branch wave-1-foundation, HEAD 1954971) +- **reviewer:** omo-native-gate-reviewer (st_01a1eb73) +- **attemptDir:** none (currentAttemptDir undefined — no ulw-loop plan; fell back to evidence dir convention) + +## originalIntent +Add a Workbox-based service worker, registered at the shell root, that precaches the app +shell (HTML/JS/CSS bundle) so the app loads offline — via vite-plugin-pwa — without pulling in +a cross-platform mini-app runtime (Taro/uni-app) and without gating on a Lighthouse floor. The +real acceptance gate is service-worker activation state, plus the untouchable-artifact safety +constraint (no deletion/modification of protected planning/safety files). + +## desiredOutcome +An additive commit that wires vite-plugin-pwa so `npm run build` emits a real `dist/sw.js`, +the SW reaches `activated`, and the shell still renders real content after going offline and +reloading — with the manifest/index.html deliberately left to the separate PWA-manifest todo, +and no protected artifact touched. + +## userOutcomeReview +The shipped artifact matches the desired outcome. vite-plugin-pwa is configured with +`manifest: false` and `injectRegister: false`, the SW is registered explicitly in +`src/main.tsx` via `virtual:pwa-register`, the production build I ran myself exits 0 and emits +`dist/sw.js` (plus `dist/workbox-*.js`) with a precache of 9 entries including `index.html`, +and the committed Playwright evidence records a real activation (`activeState: "activated"`) +and a real offline reload rendering 1925 chars of genuine shell HTML. The deliberate scoping +(manifest left to todo 2, registration owned by the shell root) matches the brief's +"Must NOT" / separation-of-concerns intent. No protected artifact is deleted or modified. + +## Independent checks (reproduced, not trusted) + +### Check 1 — commit / deletion safety for proposals_4_5_6.md +`git show --stat 1954971`; `git show 1954971 -- .omo/plans/the-commons-hollow.md`; +`ls .omo/fixtures/.senpi/proposals_4_5_6.md`; `git log --all -- .omo/fixtures/.senpi/proposals_4_5_6.md`; +`git status --porcelain`; and in parent repo `ls proposals_4_5_6.md`. +- Commit 1954971 touches 8 files: task-1 gate-review.md (A), task-3 json (A), plan md (M), + package-lock.json, package.json, src/main.tsx, tsconfig.app.json, vite.config.ts. +- `.omo/fixtures/.senpi/proposals_4_5_6.md` appears **nowhere** in the commit — grep of the + stat for "proposals" is empty, and the path has **no git history** in this worktree. +- The named path does not exist in the worktree at all (`.omo/fixtures/` is absent). The only + `.omo` proposals file present is `.omo/proposals_cluster_a.md`, untouched by the commit. +- The real protected canary lives at the parent repo root + `/home/athapa/patriothacks/proposals_4_5_6.md` (27989 bytes, mtime Nov 17 10:59, i.e. + pre-work) — present and untouched. Parent `fixtures/` and `.senpi/` also intact. +- Working tree clean (`git status --porcelain` empty). +- **Result: PASS.** No D/M on the protected artifact (the plan md is the only M, which is the + checkbox edit — see process note). + +### Check 2 — VitePWA config with manifest:false +`cat vite.config.ts`. +- `VitePWA({ registerType: 'autoUpdate', injectRegister: false, manifest: false, workbox: { globPatterns: ['**/*.{js,css,html,svg,png,ico}'] } })` present. +- `manifest: false` confirmed; `injectRegister: false` means registration is owned by main.tsx. +- `src/main.tsx` imports `registerSW` from `virtual:pwa-register` and calls + `registerSW({ immediate: true })`. `tsconfig.app.json` adds `vite-plugin-pwa/client` to types. +- **Result: PASS.** + +### Check 3 — build exits 0 and dist/sw.js exists +`rm -rf dist && npm run build` (ran myself). +- Exit code 0. Output: `PWA v2.0.0 / mode generateSW / precache 9 entries (269.35 KiB) / + files generated dist/sw.js, dist/workbox-2fbc6a65.js`. +- fs check: `dist/sw.js` (1347 bytes) and `dist/workbox-2fbc6a65.js` (15026 bytes) exist. + `dist/sw.js` contains `precacheAndRoute` and `index.html`. +- **Result: PASS.** + +### Check 4 — evidence json shows pass:true with real step results +`cat .omo/evidence/the-commons-hollow/task-3-the-commons-hollow.json`. +- `pass: true`. Steps are real captured results, not placeholders: + - `navigate` ok. + - `service_worker_ready`: `{ ready: true, activeState: "activated", scope: "http://localhost:4173/" }`. + - `offline_reload`: `{ offline: true, rootHtmlLength: 1925, rootHtmlSample: "
…" }`. +- `evidence.fullPageHtml` contains the full rendered shell (hero, counter, docs/social sections) + served after `setOffline(true)` — i.e. genuine offline render, consistent with the claimed + rootHtmlLength 1925 and baseUrl http://localhost:4173 (vite preview). +- **Result: PASS.** + +### Check 5 — checkbox marking (process note) +`git show 1954971 -- .omo/plans/the-commons-hollow.md`. +- The commit flips todo 3 (and todo 1) from `[ ]` to `[x]` in the plan file. Checkbox-marking + is the orchestrator's job, not the executor's. +- **Process note only — does not affect the correctness verdict.** Raised for the orchestrator. + +## Overfit / slop pass (performed directly on diff, tests, production code) +- **No test files are committed.** The Playwright verification ran from scratch files outside + the repo, confirmed cleaned up; the only committed verification artifact is the evidence json. + Therefore: no excessive/useless tests, no deletion-only tests, no removal-confirmation tests, + no tautological tests, no implementation-mirroring tests. +- **Production code is minimal and fit-for-purpose:** 5 lines in main.tsx (standard + `registerSW` API), a VitePWA plugin block, 3 deps, and a types entry. No unnecessary + extraction, parsing, or normalization. No speculative helpers or defensive checks. +- **No scope drift:** manifest/index.html deliberately untouched (owned by todo 2); no + backend/Taro/uni-app dependency introduced (package.json verified). + +## Coverage note (not a blocker) +No separate code-review report or manual-QA-matrix artifact was supplied for this task (only +the evidence json exists in `.omo/evidence/the-commons-hollow/`). I therefore could not confirm +a code-review report's skill-perspective / overfit coverage; I ran the overfit/slop pass myself +directly instead (above). This is an evidence/process gap, not a stated success criterion for +the checkbox (SW configured + build passes + offline renders + artifacts untouched), so it is a +NOTE, not a blocker. + +## blockers +None. + +## Checked artifact paths +- /home/athapa/patriothacks-wt/wave-1-foundation/vite.config.ts +- /home/athapa/patriothacks-wt/wave-1-foundation/src/main.tsx +- /home/athapa/patriothacks-wt/wave-1-foundation/tsconfig.app.json +- /home/athapa/patriothacks-wt/wave-1-foundation/package.json +- /home/athapa/patriothacks-wt/wave-1-foundation/.omo/evidence/the-commons-hollow/task-3-the-commons-hollow.json +- /home/athapa/patriothacks-wt/wave-1-foundation/.omo/plans/the-commons-hollow.md +- /home/athapa/patriothacks-wt/wave-1-foundation/dist/sw.js (regenerated by my build) +- /home/athapa/patriothacks/proposals_4_5_6.md (protected canary, parent repo — intact) + +## Evidence gaps +- No code-review report / manual-QA-matrix artifact present (see Coverage note). Does not block. diff --git a/.omo/plans/the-commons-hollow.md b/.omo/plans/the-commons-hollow.md index 8a41bc7..4d807c7 100644 --- a/.omo/plans/the-commons-hollow.md +++ b/.omo/plans/the-commons-hollow.md @@ -146,7 +146,7 @@ Shell (home grid, identity, themed Alipay/WeChat/Tuya UI, installable PWA, walle Commit: Y | feat(scaffold): bootstrap Vite+React+TS project structure Recommended task executor category: quick | mechanical scaffolding via a standard CLI template, no design decisions. -- [ ] 2. PWA manifest + icons +- [x] 2. PWA manifest + icons What to do / Must NOT do: Add manifest.json with `display: "standalone"`, Alipay/WeChat/Tuya-inspired theme-color tokens, and a full icon set (192x192, 512x512, maskable variant); link the manifest in index.html. Must NOT pull in a cross-platform mini-app runtime framework (Taro/uni-app) per draft D6. Must NOT set display to fullscreen/browser (breaks the mini-app-launcher feel). Closes: GAP-1 Parallelization: Wave 1 | Blocked by: 1 | Blocks: none @@ -166,7 +166,7 @@ Shell (home grid, identity, themed Alipay/WeChat/Tuya UI, installable PWA, walle Commit: Y | feat(pwa): register Workbox service worker with offline precaching Recommended task executor category: deep-low | service-worker lifecycle/caching correctness needs careful activation/offline testing, but is a contained, well-documented Workbox pattern. -- [ ] 4. Local identity (Ed25519 keypair) +- [x] 4. Local identity (Ed25519 keypair) What to do / Must NOT do: On first launch, generate an Ed25519 keypair client-side via @noble/ed25519 (or tweetnacl), persist the private key in IndexedDB (Dexie), expose the public key for use by the Event Log's signing path. Must NOT use a server-issued identity. Must NOT use any custodial key storage. Must NOT transmit the private key anywhere, ever. Closes: GAP-1 Parallelization: Wave 1 | Blocked by: none | Blocks: 5 diff --git a/package-lock.json b/package-lock.json index 57bb6cf..5efe3e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,11 +14,15 @@ "react-dom": "^19.3.1" }, "devDependencies": { + "@testing-library/jest-dom": "^7.0.1", + "@testing-library/react": "^16.3.3", + "@testing-library/user-event": "^14.6.12", "@types/node": "^24.19.2", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", "@vitejs/plugin-react": "^6.1.2", "fake-indexeddb": "^6.2.8", + "happy-dom": "^21.0.4", "oxlint": "^1.90.0", "playwright": "^1.65.1", "typescript": "~7.0.2", @@ -28,6 +32,13 @@ "workbox-window": "^7.4.1" } }, + "node_modules/@adobe/css-tools": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.5.0.tgz", + "integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@apideck/better-ajv-errors": { "version": "0.3.7", "resolved": "https://registry.npmjs.org/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.7.tgz", @@ -2903,6 +2914,105 @@ "win32" ] }, + "node_modules/@testing-library/dom": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.2.tgz", + "integrity": "sha512-yzr2S9HyAIdhz2/6qHgbs665Q7PKVcDF05vsOlHPxG1mo36gKVesdYVeDLnXgfjJ03CrKRk08knc6+E/9m8v2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "picocolors": "1.1.1", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/jest-dom": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-7.0.1.tgz", + "integrity": "sha512-oMDTC3oA+6CXSO2JZnvOI7CA6oVub6kij5ggk9ohwye5slmkwxYDXcPOVxgMw/RQlticjtO0C1RZkR97HgrWMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "aria-query": "^5.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "picocolors": "^1.1.1", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=22", + "npm": ">=6", + "yarn": ">=1" + }, + "peerDependencies": { + "@testing-library/dom": ">=10 <11", + "vitest": ">= 0.32" + }, + "peerDependenciesMeta": { + "vitest": { + "optional": true + } + } + }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@testing-library/react": { + "version": "16.3.3", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.3.tgz", + "integrity": "sha512-Uo193NgQbPMz6lrrhtRQQFcMC6Re/ELLFbbuVL30WDlZxlpZf9/lMHTAVxPRLw1q1iu9OJmR1c2BLiENRstdBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@testing-library/dom": "^10.0.0", + "@types/react": "^18.0.0 || ^19.0.0", + "@types/react-dom": "^18.0.0 || ^19.0.0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@testing-library/user-event": { + "version": "14.6.12", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.12.tgz", + "integrity": "sha512-8yQV8v+eToBhsUO4oYrZY7fzhpTEMZx4IDx0/iuER/x0Xuy0NdqQOhsaaUNlvXE03N7vQ+4RCXUieKC0NJty9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, "node_modules/@trickfilm400/rollup-plugin-off-main-thread": { "version": "3.0.0-pre1", "resolved": "https://registry.npmjs.org/@trickfilm400/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-3.0.0-pre1.tgz", @@ -2930,6 +3040,14 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/@types/chai": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", @@ -2999,6 +3117,23 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/whatwg-mimetype": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/whatwg-mimetype/-/whatwg-mimetype-3.0.2.tgz", + "integrity": "sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@typescript/typescript-aix-ppc64": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", @@ -3457,6 +3592,41 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/array-buffer-byte-length": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", @@ -3668,6 +3838,19 @@ "dev": true, "license": "MIT" }, + "node_modules/buffer-image-size": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/buffer-image-size/-/buffer-image-size-0.6.4.tgz", + "integrity": "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + }, + "engines": { + "node": ">=4.0" + } + }, "node_modules/call-bind": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", @@ -3815,6 +3998,13 @@ "node": ">=8" } }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true, + "license": "MIT" + }, "node_modules/csstype": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.4.tgz", @@ -3940,6 +4130,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -3956,6 +4156,14 @@ "integrity": "sha512-wemFiCl3DTCnfzyqepUTX1ugbYbkTrw3aEZOG7YjAOUoEQB5g5PrEywPzk5JpbX/SxqQ9IvjUpxCDIEjoOWEfA==", "license": "Apache-2.0" }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -3994,6 +4202,19 @@ "dev": true, "license": "ISC" }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/es-abstract": { "version": "1.24.2", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.2.tgz", @@ -4562,6 +4783,25 @@ "dev": true, "license": "BlueOak-1.0.0" }, + "node_modules/happy-dom": { + "version": "21.0.4", + "resolved": "https://registry.npmjs.org/happy-dom/-/happy-dom-21.0.4.tgz", + "integrity": "sha512-tFm+GaLBgo6o0awHnvHaNoraVo27qJ+2tZEtZ+cIa08hXbeitrxAJajLI05hsUy/2/YTKcUjQYzHe5mCcraLBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": ">=20.0.0", + "@types/whatwg-mimetype": "^3.0.2", + "@types/ws": "^8.18.1", + "buffer-image-size": "^0.6.4", + "entities": "^7.0.1", + "whatwg-mimetype": "^3.0.0", + "ws": "^8.21.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -4653,6 +4893,16 @@ "dev": true, "license": "ISC" }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -5494,6 +5744,17 @@ "yallist": "^3.0.2" } }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -5514,6 +5775,16 @@ "node": ">= 0.4" } }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/minimatch": { "version": "10.2.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", @@ -5854,6 +6125,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, "node_modules/react": { "version": "19.3.1", "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", @@ -5875,6 +6162,28 @@ "react": "^19.3.1" } }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -6517,6 +6826,19 @@ "node": ">=10" } }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -7085,6 +7407,16 @@ "@jridgewell/sourcemap-codec": "^1.6.0" } }, + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -7423,6 +7755,28 @@ "workbox-core": "7.4.1" } }, + "node_modules/ws": { + "version": "8.23.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.23.0.tgz", + "integrity": "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", diff --git a/package.json b/package.json index 9703abb..a9199c3 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,15 @@ "react-dom": "^19.3.1" }, "devDependencies": { + "@testing-library/jest-dom": "^7.0.1", + "@testing-library/react": "^16.3.3", + "@testing-library/user-event": "^14.6.12", "@types/node": "^24.19.2", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", "@vitejs/plugin-react": "^6.1.2", "fake-indexeddb": "^6.2.8", + "happy-dom": "^21.0.4", "oxlint": "^1.90.0", "playwright": "^1.65.1", "typescript": "~7.0.2", diff --git a/src/App.tsx b/src/App.tsx index 9ca8e8d..771a5a4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,122 +1,8 @@ -import { useState } from 'react' -import heroImg from './assets/hero.png' -import reactLogo from './assets/react.svg' -import viteLogo from './assets/vite.svg' import './App.css' +import { HomePage } from './shell/HomePage' function App() { - const [count, setCount] = useState(0) - - return ( - <> -
-
- - React logo - Vite logo -
-
-

Get started

-

- Edit src/App.tsx and save to test HMR -

-
- -
- -
- -
-
- -

Documentation

-

Your questions, answered

- -
-
- -

Connect with us

-

Join the Vite community

- -
-
- -
-
- - ) + return } export default App diff --git a/src/shell/HomeGrid.module.css b/src/shell/HomeGrid.module.css new file mode 100644 index 0000000..5748413 --- /dev/null +++ b/src/shell/HomeGrid.module.css @@ -0,0 +1,43 @@ +.grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 1.25rem 0.75rem; + padding: 1.5rem 1rem; +} + +.tile { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.4rem; + background: none; + border: none; + font: inherit; + color: inherit; + cursor: pointer; + padding: 0.25rem; +} + +.tile:focus-visible { + outline: 2px solid #1677ff; + outline-offset: 2px; + border-radius: 12px; +} + +.icon { + display: flex; + align-items: center; + justify-content: center; + width: 56px; + height: 56px; + border-radius: 16px; + background: #f2f5ff; + font-size: 28px; + line-height: 1; +} + +.label { + font-size: 0.75rem; + text-align: center; + color: #1f2430; +} diff --git a/src/shell/HomeGrid.test.tsx b/src/shell/HomeGrid.test.tsx new file mode 100644 index 0000000..7613011 --- /dev/null +++ b/src/shell/HomeGrid.test.tsx @@ -0,0 +1,35 @@ +// @vitest-environment happy-dom +import "@testing-library/jest-dom/vitest"; +import { cleanup, fireEvent, render, screen } from "@testing-library/react"; +import { afterEach, describe, expect, it, vi } from "vitest"; +import { HomeGrid } from "./HomeGrid"; +import { miniappRegistry } from "./miniappRegistry"; + +afterEach(cleanup); + +describe("HomeGrid", () => { + it("renders exactly one tile per registry entry with correct icon and label", () => { + render( {}} />); + + const tiles = screen.getAllByRole("button"); + expect(tiles).toHaveLength(miniappRegistry.length); + expect(tiles).toHaveLength(13); + + for (const entry of miniappRegistry) { + const tile = screen.getByRole("button", { name: entry.label }); + expect(tile).toHaveTextContent(entry.icon); + expect(tile).toHaveTextContent(entry.label); + } + }); + + it("emits a navigation intent with the clicked miniapp's id", () => { + const onNavigate = vi.fn(); + render(); + + const target = miniappRegistry[3]; + fireEvent.click(screen.getByRole("button", { name: target.label })); + + expect(onNavigate).toHaveBeenCalledTimes(1); + expect(onNavigate).toHaveBeenCalledWith(target.id); + }); +}); diff --git a/src/shell/HomeGrid.tsx b/src/shell/HomeGrid.tsx new file mode 100644 index 0000000..ebc7f3f --- /dev/null +++ b/src/shell/HomeGrid.tsx @@ -0,0 +1,27 @@ +import styles from "./HomeGrid.module.css"; +import { miniappRegistry } from "./miniappRegistry"; + +export interface HomeGridProps { + onNavigate: (miniappId: string) => void; +} + +export function HomeGrid({ onNavigate }: HomeGridProps) { + return ( +
+ {miniappRegistry.map((entry) => ( + + ))} +
+ ); +} diff --git a/src/shell/HomePage.tsx b/src/shell/HomePage.tsx new file mode 100644 index 0000000..41e3b69 --- /dev/null +++ b/src/shell/HomePage.tsx @@ -0,0 +1,13 @@ +import { useState } from "react"; +import { HomeGrid } from "./HomeGrid"; + +export function HomePage() { + const [lastNavigated, setLastNavigated] = useState(null); + + return ( +
+ + {lastNavigated &&

Navigating to: {lastNavigated}

} +
+ ); +} diff --git a/src/shell/importGraph.test.ts b/src/shell/importGraph.test.ts new file mode 100644 index 0000000..f8928a0 --- /dev/null +++ b/src/shell/importGraph.test.ts @@ -0,0 +1,25 @@ +import homeGridSource from "./HomeGrid.tsx?raw"; +import registrySource from "./miniappRegistry.ts?raw"; +import { describe, expect, it } from "vitest"; + +const MINIAPP_IMPORT_PATTERN = /from\s+["'][^"']*miniapps\/[^"']*["']/; + +function importLinesIn(source: string): string[] { + return source.split("\n").filter((line: string) => line.trim().startsWith("import")); +} + +describe("HomeGrid import graph", () => { + it("contains zero references to any src/miniapps/* module", () => { + const leaks = importLinesIn(homeGridSource).filter((line) => + MINIAPP_IMPORT_PATTERN.test(line), + ); + expect(leaks).toEqual([]); + }); + + it("the registry module contains zero references to any src/miniapps/* module", () => { + const leaks = importLinesIn(registrySource).filter((line) => + MINIAPP_IMPORT_PATTERN.test(line), + ); + expect(leaks).toEqual([]); + }); +}); diff --git a/src/shell/miniappRegistry.ts b/src/shell/miniappRegistry.ts new file mode 100644 index 0000000..ea0af9d --- /dev/null +++ b/src/shell/miniappRegistry.ts @@ -0,0 +1,32 @@ +/** + * Single source of truth for the shell's home-grid navigation tiles. + * + * The home grid (HomeGrid.tsx) renders generically from this registry - it + * never hard-codes a per-miniapp tile and never imports miniapp business + * logic. Each miniapp's actual behavior lives in its own module under + * src/miniapps/, registered separately by the router (see todo 12). + */ +export interface MiniappRegistryEntry { + /** Stable identifier used for navigation and future routing. */ + id: string; + /** Emoji/icon glyph rendered on the tile. */ + icon: string; + /** Human-readable label rendered under the icon. */ + label: string; +} + +export const miniappRegistry: MiniappRegistryEntry[] = [ + { id: "fair-share", icon: "\u2696\uFE0F", label: "Fair Share" }, + { id: "water-watch", icon: "\uD83D\uDCA7", label: "Water Watch" }, + { id: "tunnel-safety", icon: "\uD83D\uDE87", label: "Tunnel Safety" }, + { id: "housing", icon: "\uD83C\uDFE0", label: "Housing" }, + { id: "assembly", icon: "\uD83C\uDFDB\uFE0F", label: "Assembly" }, + { id: "find-family", icon: "\uD83D\uDC6A", label: "Find Family" }, + { id: "health-post", icon: "\u2695\uFE0F", label: "Health Post" }, + { id: "light-clock", icon: "\uD83D\uDD6F\uFE0F", label: "Light Clock" }, + { id: "farms", icon: "\uD83C\uDF3E", label: "Farms" }, + { id: "fair-draw", icon: "\uD83C\uDFB2", label: "Fair Draw" }, + { id: "the-climb", icon: "\uD83E\uDDD7", label: "The Climb" }, + { id: "mentor", icon: "\uD83C\uDF93", label: "Mentor" }, + { id: "sky", icon: "\uD83C\uDF24\uFE0F", label: "Sky" }, +];