Add API and web application design documents

This commit is contained in:
Jan Doubravský
2026-09-24 10:15:24 +02:00
parent 6737a27fa0
commit 91d480595d
6 changed files with 553 additions and 16 deletions
+37
View File
@@ -7,6 +7,43 @@ ships documents, so it uses the same `v#` scheme as the documents themselves.
Individual guideline documents carry their own `Document Version` header, and the skills carry
`metadata.version`; both are independent of the revisions below.
## v7 — 2026-09-24
### Added
- **`API/DESIGN_DOCUMENT_API.md` v2** — guidelines for any project that exposes an HTTP API,
carried in addition to the language design document. It settles what was previously left to
precedent: the URL version (`/v0`) and the product version are separate axes, the first naming a
frozen consumer contract that moves only on a breaking change, the second following semantic
versioning per release. Also fixes path naming
(`/v<n>/<CONSUMER>/<resource-in-kebab-case>`, resources spelled out and never PascalCase),
parameter and handler naming, the response envelope and its reserved paging keys, when an
endpoint may be a delta and when it must stay a full snapshot, status-code meanings (an empty
collection is `200`, not `404`), and the endpoint-level testing floor.
- `API/DESIGN_DOCUMENT_API.md` registered in `check_versions.py` and in the project-type table, so
`--sync` propagates it like every other guideline document.
- Section 2.1 was rewritten before release (v1 → v2). The v1 draft filed `/subscribe` under
endpoints that are "not part of any consumer contract" and declared the whole group free to
change with the product version. It is the opposite: the token endpoints are the widest
contract in the API, every delta consumer holds a token they issued, and the unversioned
legacy feeds are contracts too. The section now splits operational endpoints from unversioned
consumer endpoints and subjects the second group to section 1.1 — having no version to bump
is not permission to break.
- **`WEB/DESIGN_DOCUMENT_WEBAPP.md` v1** — guidelines for a server-rendered web interface driven
over a websocket (NiceGUI on FastAPI), carried in addition to `DESIGN_DOCUMENT_PYTHON.md`. Covers
layers, one connection and one lock per service, page and dialog structure, where the language
belongs, tables as the main idiom (including the slot trap), hand-written canvases, theming,
performance, errors and notifications, authentication, testing, and a checklist for a new screen.
### Changed
- **`AGENTS.md` v8 → v9** — the table mapping project types to design documents is gone. Every
`DESIGN_DOCUMENT*.md` in the project root now applies, with the suffix saying what it covers (a
language, application vs. library, or a part of the system such as `_WEBAPP`), so the list can no
longer go stale. Where two design documents disagree, the more specific one wins for what it covers.
- The `MASTERS` comment in `check_versions.py` no longer claims a design document is always named
after a language — it is named after what it scopes, which may be a cross-cutting concern.
---
## v6 — 2026-08-18
### Added