diff --git a/CLAUDE.md b/CLAUDE.md index d2decab..a91ec37 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,7 +43,7 @@ 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 (270 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 (293 tests) | ## Running it @@ -63,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, 270 tests pass. Exercise real flows end +- Verified state: `npm install` + typecheck clean, 293 tests pass. Exercise real flows end to end before claiming done. ## Docs (kept in `docs/`) diff --git a/README.md b/README.md index 3b6de5a..8dc34c7 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ document and conversation we've had with them. ## Build state (start here) -Working codebase, not a plan. `npm install` + typecheck are clean and **270 tests pass**. +Working codebase, not a plan. `npm install` + typecheck are clean and **293 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 43d4920..acca862 100644 --- a/STATUS.md +++ b/STATUS.md @@ -21,9 +21,9 @@ reminders driven by the dated `reminder_schedule` table. | --- | --- | | `npm install` | clean | | `npm run typecheck` (root + workspaces) | clean, no errors | -| `npm test` (`vitest run`) | **270 tests pass across 55 files** | +| `npm test` (`vitest run`) | **293 tests pass across 57 files** | -The 270 figure is the live `vitest run` count measured 2026-07-17, after the +The 293 figure is the live `vitest run` count measured 2026-07-17, after the quote-to-close funnel slice and its review fixes. Test files live under `apps/hq/test/` (49 files, including `employees`, `employees-routes`, `client-owner`, `pipeline`, `quote-followup`, and `reminder-schedule`), @@ -269,15 +269,6 @@ rasterizes for the PDF. - **AWS cost pull is env-gated** — the scheduled and manual pulls run only when `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` are configured; otherwise usage is owner-entered by hand. -- **Funnel spec phases 7–10 are designed, not built** (see - `docs/superpowers/specs/2026-07-17-quote-to-close-funnel-design.md`): the - one-click `POST /documents/:id/convert-and-send` and proforma - `POST /documents/:id/supersede` endpoints do not exist yet (the underlying - convert guards landed); invoice-overdue escalation still uses the **monthly - bucket** — the dated 7/15/30 `invoice_overdue` cadence row is seeded and - `resolveSchedule` supports it, but the scan does not read it yet; and the - module → client roster (`GET /modules/:id/clients` + CSV export + - owner/manager Notify-all) is not implemented. - **APEX import is CLI-only** — no web UI for staging/commit. - **Reminders live on the Dashboard** — there is no standalone reminders page, and there is no separate documents-list page (documents are reached from the diff --git a/docs/06-DECISIONS.md b/docs/06-DECISIONS.md index e15a0c1..bfe3d1c 100644 --- a/docs/06-DECISIONS.md +++ b/docs/06-DECISIONS.md @@ -199,9 +199,11 @@ console users are a small bounded set (single-digit headcount), the count is dis and nothing is silently truncated, which is the intent of rule 8. If the team ever grows past a screenful, paginate it like every other list. -**Delivery state (2026-07-17):** phases 1–6 landed (employee foundation + management -surface, owner plumbing, dated schedule, pipeline chase-list, escalating quote -follow-up) along with the F3/F4 convert hardening. The `convert-and-send` and -`supersede` endpoints, invoice `dN` milestone escalation (scan still uses the monthly -bucket), and the module → client roster (phases 7–10) are decided here but not yet -implemented — tracked in STATUS.md Known gaps. +**Delivery state (2026-07-17, final):** all ten phases landed. Phases 1–6 (employee +foundation + management surface, owner plumbing, dated schedule, pipeline chase-list, +escalating quote follow-up) plus the F3/F4 convert hardening, then 7–10 in the same +day's second pass: one-click `POST /documents/:id/convert-and-send` (guards → one txn +convert+issue → post-commit email), proforma `POST /documents/:id/supersede`, invoice +`dN` milestone escalation (d7/d15/d30 from the dated schedule, F7 highest-only +catch-up), and the module → client roster (`GET /modules/:id/clients` + CSV export + +owner/manager Notify-all with per-recipient audit). Suite at 293 tests / 57 files.