Architecture
System overview
One Vercel app: the page, four API routes, SERV, GitHub, and the fixtures.
Pich is one Next.js app on Vercel. The page and four API routes ship together; there is no separate backend, database, or queue.
components
Browser (src/app/page.tsx, src/components/pich/workflow.tsx)
│
├─ POST /api/compile → SERV Reasoning → validateChecklist()
├─ POST /api/check → evaluate() on 8 bundled fixtures
├─ POST /api/check-repo → GitHub (read only) → evaluate()
└─ POST /api/explain → evaluate() → SERV Reasoning| Component | Owns | Does not own |
|---|---|---|
| Page | The 4-step flow, display of checklist, verdicts, evidence, notes | Any verdict logic or secrets |
| SERV Reasoning | Reading advisory prose into a checklist; wording the client note | The verdict, file reading, the final checklist (validation can drop items) |
| validateChecklist() | Rejecting non-verbatim quotes, unknown predicates, invalid ranges; polarity correction | Deciding what the advisory means |
| evaluate() | Observing predicates in files and choosing the verdict | Fetching files, calling SERV |
| GitHub reader | Fetching an allowlist of files as text from a public repo | Installing, building, or running anything |
| Fixtures | 8 demo apps bundled into the build | Real client data |
Source: src/app/api, src/lib.