From 062ddd0737f1acc97ff6717b04cb99671b6487bb Mon Sep 17 00:00:00 2001 From: Thomas Joise Date: Fri, 17 Jul 2026 03:28:38 +0530 Subject: [PATCH] =?UTF-8?q?docs:=20record=20redesign=20verification=20?= =?UTF-8?q?=E2=80=94=20255=20tests,=20new=20shell=20description,=20run-fro?= =?UTF-8?q?m-root=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit E2E walked in the real app: login split panel, shell (groups/badge/health), Ctrl+K palette with live client search, dashboard, clients chips, Client 360 (tabs + pulse ribbon click-through), document view + PDF, reports chips, dark mode, 420px drawer. Verification session minted directly in the dev DB and deleted after; servers stopped; stray apps/hq/data DB removed. Co-Authored-By: Claude Opus 4.8 (1M context) --- CLAUDE.md | 9 ++++++--- README.md | 2 +- STATUS.md | 16 +++++++++------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 26457c8..868e061 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,14 +43,17 @@ distilled to what applies to HQ. A change that breaks one does not land. | Append-only audit | Every mutation calls `writeAudit(db, userId, action, entity, id, before, after)` in the **same transaction** as the change. The audit log is append-only — never update or delete rows. Previews and the public share route write nothing. | `audit.ts` | | Client id is the future tenant id | `client.id` is a client-generated UUIDv7 that becomes `tenant_id` when the cloud tier stands up — same rows, promoted once. Never re-key clients. | `repos-clients.ts` | | No silent caps | Every list that can grow paginates or warns; never silently truncate. | reports, directory queries | -| Strict TS, green before landing | Strict TypeScript everywhere; `npm run typecheck` and `npm test` both clean before anything lands. Money math is locked by tests — a rounding change without a test change does not land. | `tsc`, vitest (177 tests) | +| Strict TS, green before landing | Strict TypeScript everywhere; `npm run typecheck` and `npm test` both clean before anything lands. Money math is locked by tests — a rounding change without a test change does not land. | `tsc`, vitest (255 tests) | ## Running it ``` npm install # workspace root, once # backend (serves API on :5182, and the built web UI + public /share links) -cd apps/hq && npm start # build-server.mjs → dist/server.cjs; first boot prints a one-time owner password +# RUN FROM THE REPO ROOT — the DB path resolves to ./data/hq.db from CWD, so +# `cd apps/hq && npm start` would boot a fresh empty DB in apps/hq/data instead. +npm run build --workspace @sims/hq +node apps/hq/dist/server.cjs # first boot on an empty data/ prints a one-time owner password # frontend dev (Vite on :5183, proxies /api and /share to :5182) cd apps/hq-web && npm run dev ``` @@ -60,7 +63,7 @@ cd apps/hq-web && npm run dev - Env: `HQ_DATA_DIR` (DB location), `SIMS_PIN_PEPPER` (set once, never change), `HQ_SECRET_KEY` (before Gmail), `GOOGLE_*` (Gmail), `AWS_*` (Cost Explorer), `HQ_PORT` (default 5182). - Health check: `GET /api/health` → `{ ok: true }`. -- Verified state: `npm install` + typecheck clean, 177 tests pass. Exercise real flows end +- Verified state: `npm install` + typecheck clean, 255 tests pass. Exercise real flows end to end before claiming done. ## Docs (kept in `docs/`) diff --git a/README.md b/README.md index 2cf9a5b..5190d2e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ document and conversation we've had with them. ## Build state (start here) -Working codebase, not a plan. `npm install` + typecheck are clean and **177 tests pass**. +Working codebase, not a plan. `npm install` + typecheck are clean and **255 tests pass**. Current state and run-vs-pending detail live in **[STATUS.md](STATUS.md)**; the go-live runbook (server, HTTPS, backups, Gmail/AWS/import wiring, the Postgres switch) is in **[docs/DEPLOY-HQ.md](docs/DEPLOY-HQ.md)**. diff --git a/STATUS.md b/STATUS.md index a31682f..2bc653f 100644 --- a/STATUS.md +++ b/STATUS.md @@ -17,11 +17,11 @@ append-only audit trail, an APEX cutover importer, and a background scheduler. | --- | --- | | `npm install` | clean | | `npm run typecheck` (root + workspaces) | clean, no errors | -| `npm test` (`vitest run`) | **177 tests pass across 46 files** | +| `npm test` (`vitest run`) | **255 tests pass across 55 files** | -The 177 figure was re-counted from source (`it(`/`test(` blocks) and matches the -suite. Test files: 43 under `apps/hq/test/`, plus one each in -`packages/{domain,auth,billing-engine}/test/`. +The 255 figure is the live `vitest run` count (grew with the pipeline/follow-up +and redesign work). Test files live under `apps/hq/test/`, `apps/hq-web/test/`, +and `packages/{domain,auth,billing-engine,ui}/test/`. ## Architecture @@ -180,9 +180,11 @@ Everything below is implemented and exercised by tests via the Express router ## Frontend screens (`apps/hq-web`) -Shell (`Layout.tsx`): left nav, top bar with theme switcher + logout, and a -Gmail-disconnected banner. Nav is Dashboard / Clients / Modules / Reports / New -Document, plus **Document Template** for owners. Routes (`main.tsx`): +Shell (`Layout.tsx`): grouped sidebar (WORK / CATALOG / INSIGHT / ADMIN) with +lucide icons and a reminder-queue count badge, top bar with Ctrl+K command +palette, Gmail status pill, theme/accent switcher and user chip, plus the +Gmail-disconnected banner. Owner-only items (Employees, Document Template) +appear in ADMIN; the warm ops-console restyle is the 2026-07-17 redesign spec. Routes (`main.tsx`): | Route | Screen | What it does | | --- | --- | --- |