ipal-doctor: one command that checks a site against the team rules

bin ipal-doctor + @intecion/ipal-kit/doctor: static rules (versions, Node 22, AGENT.md §3
layout and naming, database names, env rules, headers, X-Powered-By, CSP, 2FA, cookie
scanner, adminMeta, AGENTS.md, skills, seeds, block library via blockLibraryManifest,
ipal-audit --quick), registry rules (latest plugin, pnpm audit --prod), live rules (--url,
ipal-seo-check), deep rules (--deep via payload run; GET /api/ipal/doctor, off until
IPAL_DOCTOR_TOKEN). Human / JSON output, --strict, exit codes 0/1/2/3, --sites drift table,
ipal-doctor.json with reasons, until, files, seen.

Fixes found on the way: sitemap leaves out the System pages 404 page; ipal-audit finds
array labels after fields, any form seed, runs grep in UTF-8; ipal-seo-check counts
duplicate titles per language. Reference site at zero findings (static), CI steps on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 16:03:00 +01:00
co-authored by Claude Opus 5.5
parent 0ab133fbd7
commit a4e8cfeae8
62 changed files with 2998 additions and 70 deletions
+4 -6
View File
@@ -1,9 +1,7 @@
# ipal-doctor — proposal
Status: **design approved 2026-10-29** (all of D1–D9, with the adjustments in §6). Build approved in this order:
design tokens and the block library, then the reference site, then the doctor and the starter. Not started — the
doctor waits for the coordinator's start signal.
Date: 2026-10-29 · plugin version at the time: 1.14.6.
Status: **built** (branch `claude/ipal-doctor-build`). The user guide is [docs/doctor.md](../doctor.md); this file
keeps the design and the decisions (§6). Where the two differ, doctor.md describes what shipped.
## 1. What it is
@@ -132,7 +130,7 @@ Live checks are GET only, no login, a doctor user agent, at most ~20 requests. `
### 3.1 Shipping — a bin in the plugin
`bin/ipal-doctor.mjs` next to `bin/ipal-skills.mjs`, zero dependencies, Node built-ins and `fetch`. The rules
sit in `bin/doctor/rules/*.mjs`, one module per group, each exporting
sit in `src/modules/doctor/rules/*.ts` (built to `dist/`, the bin imports them), one module per group, each exporting
`{ id, group, severity, source, docs, check(ctx) }`.
Why in the plugin and not a separate package: the rules change with the plugin (a new required import-map entry,
@@ -158,7 +156,7 @@ run anywhere and does not touch the network except `plugin-latest` and `deps-aud
Some rules need the real data: users without TOTP, cookies waiting for approval, the exact import map, the real
environment. Two ways, decision D3:
- **A. `ipal-doctor --deep`** runs `pnpm payload run node_modules/@intecion/ipal-kit/bin/doctor/deep.ts`: the Local
- **A. `ipal-doctor --deep`** runs `pnpm payload run node_modules/@intecion/ipal-kit/dist/modules/doctor/probe.js`: the Local
API, read-only queries (`count`), locally with the dev database (sites are built and checked locally), or in the Coolify app container's terminal
against the MongoDB container. No new route.
- **B. A status endpoint** `GET /api/ipal/doctor`, **off unless `IPAL_DOCTOR_TOKEN` is set** (≥ 32 chars, bearer,