From a005acb93d1d788d2c73a72c4d6f94c7acb0453c Mon Sep 17 00:00:00 2001 From: lilleman Date: Wed, 5 Aug 2026 23:41:12 +0200 Subject: [PATCH] Cut non-essential prose from docs and comments, and require the same of every future change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit README loses the competitor comparison, the personas and the repeated philosophy; the five near-identical E2E command blocks become a table plus one command, and the file map a clause per entry. AGENTS.md keeps every decision but drops the narrative around them. todo.md's completed items collapse to their task line — git holds the rest. Comments lose restatement, README duplication and history ("used to", "originally", dated notes). AGENTS.md gains a Prose discipline section making this a standing pass on every change rather than a one-off cleanup. src/compose.test.ts now expects 6 documented E2E run commands, not 10, since the README states the command once instead of per suite. --- AGENTS.md | 284 ++-- README.md | 1654 +++++++------------ e2e-tests/devstack-login.spec.ts | 21 +- e2e-tests/full-flow.spec.ts | 4 +- e2e-tests/visual.spec.ts | 5 +- examples/plugins/admin/README.md | 40 +- examples/plugins/admin/admin-grants.test.ts | 6 +- examples/plugins/admin/admin-shared.ts | 31 +- examples/plugins/admin/admin-users.ts | 7 +- examples/plugins/admin/plugin.ts | 10 +- src/auth/bootstrap.test.ts | 7 +- src/auth/bootstrap.ts | 19 +- src/auth/denylist.ts | 24 +- src/auth/guards.ts | 8 +- src/auth/routes.ts | 6 +- src/compose.test.ts | 2 +- src/config.ts | 12 +- src/http/app.test.ts | 28 +- src/http/app.ts | 139 +- src/http/safe-url.ts | 17 +- src/http/security-headers.ts | 18 +- src/i18n/load.ts | 14 +- src/i18n/translate.ts | 15 +- src/logger.ts | 27 +- src/plugin-host/plugin.ts | 70 +- src/plugin-host/system.ts | 9 +- src/ui/chrome.ts | 20 +- src/ui/nav.ts | 11 +- todo.md | 111 +- 29 files changed, 980 insertions(+), 1639 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index bad976d..052e732 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,20 +3,27 @@ Guidance for AI agents and contributors working in this repo. Read `README.md` for commands and layout. -## Maintaining this file +## Prose discipline -Every agent session reads this file in full, so its length is a cost paid on every task. -Keep it the shortest thing that still changes what someone does. +Every word in this repo is read again on every future task, so prose is a recurring cost. On **any** +change, sweep the prose you touched — this file, `README.md`, the example READMEs, and code +comments — and cut it back to what a competent reader could not infer: -- **Trim as you add.** After any edit, re-read the whole file and compress: merge overlapping - entries, cut prose that restates a rule, drop what the code or `README.md` already says. - Question each section — same information, fewer words. -- **Record the decision and the reason it turns on, nothing else.** Not the investigation, not - what was tried first, not how it was verified — that belongs in the PR that made the change. +- **Delete history.** Git holds it. No "this moved from X", "used to be Y", "was tried and + rejected", "(declined twice)", dated changelog entries, or the symptom that prompted a fix. Record + the decision and the reason it *currently* turns on, nothing else. +- **Delete restatement.** A comment that says what the adjacent line says, a doc paragraph that + re-explains a table above it, a file-map entry that expands the filename. The fix is deletion, + not trimming. +- **Delete the self-evident** and anything already stated once elsewhere. **One home per fact** — + link to it instead of repeating it; the same sentence in five files is five chances to drift. - **Give every accepted risk an expiry** ("valid while X"), and delete the entry once X stops holding. -- **One home per fact.** Link to it rather than restating it — the same sentence in five files - is five things to update and five chances to drift. +- **Keep** the surprising why, the footgun, the invariant, the external constraint, and the one-time + setup a reader cannot dig out of the code. Once a line has earned its place, make it short and + information-dense. + +Trimming is not a separate task to schedule — do it in the same change, every time. ## How to work with tasks @@ -31,29 +38,23 @@ branch, create a PR and merge it when the CI/CD turns green. 1. **Simplicity** — prefer the solution that is easiest to understand, smallest, and most readable. 2. **Few dependencies** — runtime deps stay minimal (today `ejs`, `lucide-static`, `@larvit/log`). Prefer the Node standard library; justify any new dependency; do not add frameworks. The app is - **stateless — no database**. Auth/identity/OAuth are **Ory sidecar services** (Kratos/Keto/Hydra, - backed by Postgres), reached over their REST APIs with built-in `fetch` — no SDK. New - capabilities ship as **plugin folders** under `plugins/` that fetch their data from upstream - services, not as core code. + **stateless — no database**. Auth/identity/OAuth are **Ory sidecar services** reached over their + REST APIs with built-in `fetch` — no SDK. New capabilities ship as **plugin folders** under + `plugins/` that fetch their data from upstream services, not as core code. 3. **Strict TypeScript** — `tsconfig.json` is strict (incl. `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `verbatimModuleSyntax`). Keep it that way. Prefer exact types; limit nullable and multi-option types. -4. **Environment-agnostic** — the app never asks *which environment* it runs in; no `NODE_ENV` - branching. Every behaviour is an **explicit config toggle** (e.g. `CACHE_TEMPLATES`, - `REQUIRE_SECURE_SECRETS`), read once in `src/config.ts`. Compose files set them per deployment. -5. **Semantic, accessible DOM** — use the right element for the job (landmarks, one `

` per page - + sane heading order, lists, `` with row/column headers, `
`/``, - `
` with row/column headers, `
`/``, `