|
3 | 3 | The live cache. Current facts only; if a change makes a line here wrong, |
4 | 4 | fixing it is part of that change. Dates are absolute (YYYY-MM-DD). |
5 | 5 |
|
6 | | -Last verified: 2026-07-30 |
| 6 | +Last verified: 2026-07-31 |
7 | 7 |
|
8 | 8 | ## Status |
9 | 9 |
|
10 | 10 | - Gate G0 (brief and plan) PASSED 2026-07-30. Gate G1 (working pipeline) is |
11 | | - ACTIVE. Build order: `plans/BUILD-PLAN.md`. |
12 | | -- WP-A (scaffold and gates) complete and verified 2026-07-30, not yet |
13 | | - committed (commits happen only when the maintainer asks). |
14 | | -- WP-F is part built: the review pipeline runs end to end against a scripted |
15 | | - stage runner, with sweeps, reconciliation, the quotation check and the |
16 | | - coverage audit all enforced and mutation-tested. |
17 | | -- All remaining work is planned in detail as `docs/plans/EXECUTION-ORDER.md` |
18 | | - (items T1-T19, three founder gates, decisions D-1..D-20 pre-resolved). The |
19 | | - driver works it top to bottom without asking between gates. |
20 | | -- T1 to T7 are DONE. The engine spine is complete and the quality gate is in |
21 | | - place: a correct review of the seeded fixture carries through the pipeline |
22 | | - intact, a misquoted finding is discarded, and the clean files stay clean. |
23 | | - The gate is mutation-proven and runs in verify.sh. |
24 | | -- T8, T9 and the FG-2 demo are planned to commit level in |
25 | | - `docs/plans/M2-FINISH-PLAN.md` (work items W1-W8): resume via checkpointed |
26 | | - stage outputs, the job manager and SSE, and the demo script. Next: W1. |
27 | | -- The two external AI plans have not arrived. They fold in as spec |
28 | | - amendments when they do; they do not block the build. |
29 | | - |
30 | | -## Stack (installed and proven 2026-07-30) |
| 11 | + ACTIVE and its evidence is ready: see `plans/FG2-CHECKLIST.md`. The verdict |
| 12 | + is the maintainer's, and nothing in this repository marks it passed. |
| 13 | +- The app is usable end to end. A person can add a project from a git URL, see |
| 14 | + its branches, set up a review with a pre-flight estimate, watch it run, |
| 15 | + decide every finding, complete it, and export a report. |
| 16 | +- Milestone M2 is finished: `plans/M2-FINISH-PLAN.md` items W1-W8 are DONE, |
| 17 | + including checkpointed resume, the job manager, SSE, and the demo script. |
| 18 | +- Milestone M3 is finished apart from these records: |
| 19 | + `plans/M3-FINISH-PLAN.md` items V1-V8 are DONE. V9 is this file and the |
| 20 | + FG-2 checklist. |
| 21 | +- The two external AI plans never arrived. They fold in as spec amendments if |
| 22 | + they do; they did not block the build. |
| 23 | + |
| 24 | +## Stack (installed and proven 2026-07-31) |
31 | 25 |
|
32 | 26 | Node 22.22.1, npm 11.17.0, git 2.43.0, Claude Code 2.1.71 on Linux. |
33 | 27 |
|
34 | 28 | next ^16.2.12, react ^19.2.8, typescript ^6.0.3, drizzle-orm ^0.45.2, |
35 | | -drizzle-kit ^0.31.10, better-sqlite3 ^13.0.2 (native binding verified |
36 | | -working), zod ^4.4.3, tailwindcss ^4.3.3, vitest ^4.1.10, |
37 | | -@playwright/test ^1.62.0 (browsers NOT yet installed), eslint ^9.39.5, |
| 29 | +drizzle-kit ^0.31.10, better-sqlite3 ^13.0.2, zod ^4.4.3, tailwindcss ^4.3.3, |
| 30 | +vitest ^4.1.10, @playwright/test ^1.62.0 (chromium installed), eslint ^9.39.5, |
38 | 31 | prettier ^3.9.6, ulid ^3.0.2. |
39 | 32 |
|
40 | 33 | TypeScript runs strict plus `noUncheckedIndexedAccess`, |
41 | 34 | `noImplicitOverride`, `noFallthroughCasesInSwitch`. |
42 | 35 |
|
43 | 36 | ## Commands |
44 | 37 |
|
45 | | -See `CLAUDE.md` section 3. `./verify.sh` is the single gate and passes as of |
46 | | -2026-07-30, including `--build`. Its failure branches are proven, not |
47 | | -assumed: non-zero exit, error marker printed while exiting 0, step timeout, |
48 | | -and house-style violations (em dash and emoji) each fail the gate; a clean |
49 | | -tree passes. `--e2e` has never run: there are no e2e specs yet and no |
50 | | -Playwright browsers installed. |
| 38 | +See `CLAUDE.md` section 3. `./verify.sh` is the single gate. As of 2026-07-31 |
| 39 | +it passes with `--build --e2e`: 566 unit tests passing and 6 skipped across 38 |
| 40 | +files, plus 15 browser tests. CI runs `./verify.sh --build --e2e`; the local |
| 41 | +default leaves both off so it stays fast. |
| 42 | + |
| 43 | +`npm run demo:fixture -- --fake` reviews the seeded fixture end to end with no |
| 44 | +model and no money, scoring the result against the fixture's manifest. |
| 45 | + |
| 46 | +## Environment |
| 47 | + |
| 48 | +- `TRYSQUARE_DATA` - the data root, default `~/.local/share/trysquare`. Holds |
| 49 | + `db.sqlite`, `projects/`, `runs/` and `exports/`. |
| 50 | +- `TRYSQUARE_CLAUDE_PATH` - the binary reviews run through, default `claude` |
| 51 | + on PATH. Every run records which one it used as a run note. |
| 52 | + |
| 53 | +## Settings |
| 54 | + |
| 55 | +Stored in the `settings` table, edited on the settings screen. Only these keys |
| 56 | +are accepted; anything else is refused by name. |
| 57 | + |
| 58 | +- `maxConcurrentReviews` (default 1). Two reviews share one usage limit. |
| 59 | +- `stageTimeoutMinutes` (default 20). |
| 60 | +- `stageMaxBudgetUsd` (default 15). A ceiling on any single model call; zero |
| 61 | + removes the ceiling. |
51 | 62 |
|
52 | 63 | ## Structure |
53 | 64 |
|
54 | 65 | - `CLAUDE.md` - charter. `docs/` - specs, ledgers, plans. |
55 | | -- `src/lib/` - pure domain logic: `paths.ts`, `ids.ts`, `domain/enums.ts`, |
56 | | - `domain/state-machines.ts` (review and finding state machines). |
57 | | -- `src/server/db/` - schema (14 tables), client, migrations, and |
58 | | - repositories for projects, reviews, ledger, findings, models, settings. |
59 | | -- `src/lib/git/` - pure git logic: diff parsing, URL validation, changed |
60 | | - exported symbols. |
61 | | -- `src/server/gitops/` - the only code that spawns git: clone, fetch, refs, |
62 | | - worktrees, bundle builder. |
63 | | -- `src/lib/engine/` - CLI event schemas and command construction (pure). |
64 | | -- `src/server/engine/` - the only code that spawns claude: stage runner, |
65 | | - stream decoding, model probing, auth status. |
66 | | -- `src/lib/rulesets/` - protocol import with a fidelity gate, markdown |
67 | | - export, prompt composition, and rule/file batch planning. |
68 | | -- `src/lib/review/` - mechanical sweeps, the quotation check, stage output |
69 | | - schemas, and stage reconciliation. |
70 | | -- `src/server/review/` - the pipeline orchestrator. |
| 66 | +- `src/lib/` - pure and I/O free: paths, ids, domain enums and state machines, |
| 67 | + git diff and URL parsing, changed exported symbols, mechanical sweeps, the |
| 68 | + quotation check, stage schemas, budget arithmetic, ruleset import with a |
| 69 | + fidelity gate, prompt composition, batch planning, and the report renderer. |
| 70 | +- `src/server/db/` - schema (14 tables), client, migrations 0000 to 0007, and |
| 71 | + repositories for projects, reviews, ledger, findings, models, rulesets, |
| 72 | + settings and stage executions. |
| 73 | +- `src/server/gitops/` - the only code that spawns git. |
| 74 | +- `src/server/engine/` - the only code that spawns claude. |
| 75 | +- `src/server/review/` - the pipeline, the engine runner, the checkpointing |
| 76 | + runner that makes a resumed stage free, the service that runs a review from |
| 77 | + a row, merged detection, and the report assembler. |
| 78 | +- `src/server/jobs/` - the event bus, the job manager, and the SSE stream. |
| 79 | +- `src/server/api/` - one response shape for every route. |
| 80 | +- `src/app/api/` - 27 route handlers. `src/app/` - 9 screens. |
| 81 | +- `src/components/` - the shared UI vocabulary, the left rail, and the |
| 82 | + confirmation queue. |
| 83 | +- `scripts/` - the house-style gate, the leak gate, the nothing-hidden gate, |
| 84 | + and the fixture demo. |
71 | 85 | - `tests/fixtures/example-protocol.md` - the public sample protocol the |
72 | 86 | fidelity gate runs against. |
73 | | -- `tests/fixtures/fake-claude.mjs` - stand-in CLI so engine tests are |
74 | | - hermetic and cost nothing. |
75 | | -- `drizzle/` - the committed initial migration. |
76 | | -- `src/app/` - Next App Router (placeholder page only). |
77 | | -- `src/server/`, `src/components/` - not created yet. |
78 | | -- `scripts/check-style.mjs` - house-style gate. |
79 | | -- `tests/` - unit tests. `e2e/` - not created yet. |
| 87 | +- `tests/fixtures/fake-claude.mjs` - stand-in CLI, so tests are hermetic and |
| 88 | + cost nothing. |
| 89 | +- `tests/` - unit and integration tests. `e2e/` - the browser journey and the |
| 90 | + theme pass. `drizzle/` - eight committed migrations. |
80 | 91 | - `verify.sh` - the gate. |
81 | 92 |
|
82 | | -Runtime layout the app will create on disk is specced in |
83 | | -`01-ARCHITECTURE.md` section 5 and implemented by `src/lib/paths.ts`. |
| 93 | +Runtime layout on disk is specced in `01-ARCHITECTURE.md` section 5 and |
| 94 | +implemented by `src/lib/paths.ts`. |
| 95 | + |
| 96 | +## Screens |
| 97 | + |
| 98 | +`/projects`, `/projects/[id]`, `/reviews`, `/reviews/new`, `/reviews/[id]`, |
| 99 | +`/rulesets`, `/rulesets/[id]`, `/settings`. The root redirects to projects. |
84 | 100 |
|
85 | 101 | ## Known issues |
86 | 102 |
|
| 103 | +- One Turbopack build warning remains, traced to the engine's per-review log |
| 104 | + paths, which cannot be static. It affects only the standalone output |
| 105 | + manifest, which this app does not use. Adopting `output: "standalone"` |
| 106 | + voids that acceptance; the re-check trigger is in `DECISIONS.md`. |
87 | 107 | - 9 high npm advisories remain, all the same `brace-expansion` DoS reached |
88 | 108 | through minimatch 3.x inside eslint and eslint-config-next's plugins. No |
89 | 109 | compatible patched version exists; forcing the patched 5.0.8 breaks eslint |
90 | | - (verified). Lint-time dev dependency only. Reasoning and re-check trigger |
91 | | - in `DECISIONS.md` (2026-07-30 ACCEPTED RISK). |
| 110 | + (verified). Lint-time dev dependency only. Reasoning and re-check trigger in |
| 111 | + `DECISIONS.md` (2026-07-30 ACCEPTED RISK). |
92 | 112 | - Next's build rewrites `tsconfig.json` (sets `jsx: react-jsx`, adds |
93 | 113 | `.next/dev/types`). Run prettier on it after a build or the format gate |
94 | 114 | fails on the next run. |
| 115 | +- An interrupted Playwright run can leave its server holding port 3100, and |
| 116 | + the next `--e2e` then fails saying the port is in use. Reusing an existing |
| 117 | + server is deliberately not allowed, because it would run the journey |
| 118 | + against a server started without the fake engine. |
| 119 | + |
| 120 | +## Not built |
| 121 | + |
| 122 | +- More than one dependency per review: the model and the screens take a |
| 123 | + single linked project. |
| 124 | +- Emailing a report (`plans/idea-inbox.md`). |
| 125 | +- Any authentication. This is a local, single-user tool by design. |
95 | 126 |
|
96 | 127 | ## External services |
97 | 128 |
|
|
0 commit comments