Bot-crawlable public pages: 2. Routes
Done 2026-11-07 per the plan. public-route (pure: method + raw path → status, headers, body, content-kind) plus serve-public-pages / public-dispatcher in lisp/public-pages.lisp: the grammar matched on the raw path with [^/] captures then per-segment percent-decoding (own decoder, no + to space), 301s between slash spellings (type-guarded — /p/manifest.json is the plain 404), 404 plain text that never falls through to the SPA shell, 503 only while the model or RBAC is uninitialized, 405 with Allow, query strings cut in both public-raw-path and the router, caching by status and artifact, the document CSP, nosniff, the one pre-header error boundary (plain no-store 500; files opened inside it and streamed by the adapter as full 200s — no Range, no conditional requests), and public-file-route over authorized-file-path (factored out of rest-file in rest.lisp with its 403/404 behavior byte-identical) with the image extension whitelist. decorate-public-url rides list-result (one permitted-row-ids pass per page) and be-rec only — never rec — omitted-never-nil, fresh guest check, invalid-origin-safe for the authenticated API; :public-url reserved in valid-field-names. The dispatcher claims only /p, /p/..., /sitemap.xml, /robots.txt and is registered before the SPA prefix dispatcher. Tests: the direct route suite, the wire suite, and the live HTTP suite (drakma + a raw socket for Hunchentoot's own 400s) in tests/public-pages-tests.lisp. One deviation: the plan's deleted-file 500 is the route's 404 (a file missing before the request is :missing, indistinguishable from private — the 500 is the open-after-authorize race, pinned via the open-public-file redefinition). Docs: rest.md Public pages section + the "public never means anonymous" sentences rewritten in rest.md and roles.md, model-reference reserved-key note, AGENT.md key architecture, README status. The bash-side probes (profile create/delete cycle) ran against the staging checkout, which does not carry the uncommitted script change; write<sub>profile</sub><sub>env</sub> / load<sub>profile</sub> (the required key and its refusal) were unit-tested from the dev script directly, and the expose/unexpose PUBLIC<sub>ORIGIN</sub> rewrite reruns live after the change reaches staging.
Plan: 02-routes.org
- Slot
- 5300
- Status
- 60 Done
- Tags
- mvp, backend, frontend
- Contributors
- Donnie