Bot-crawlable public pages
Done 2026-11-07, all three children landed in order (Renderer → Routes → SPA; see their entries for implementation detail and deviations). What shipped: lisp/public-pages.lisp (request-time renderer + routes + :public-url wire key, ~1500 lines), the fixture models/test/public-pages-test.lisp, tests/public-pages-tests.lisp with four suites (renderer, route, wire, live HTTP) plus the unseeded empty-state group, web/src/publicLink.ts + tests + the Best Link changes in web/src/App.tsx, PUBLIC_ORIGIN through data-ui.lisp / profile env / expose-unexpose / the deploy template, and docs (model-reference, rest, roles, deployment, cli, AGENT.md, README). Engine fixes the item forced, all in backend.lisp beyond the two planned edits and flagged in child 1: db-value's :null handling (nullable booleans/integers/passwords could not be inserted), execute-write-to's :null skip (the db-value fix otherwise seeded NULL write-through rows), and the amended 4b pin (NULL boolean reads nil via the shared value-or-nil collapse, not :null — the "no longer reads true" invariant holds). Two pre-existing test-helper bugs fixed (th-make-directory's be-id arity, th-make-file's format string). Final gates: scripts/data-ui tests 3544/3544 across 55 groups (public-pages 391 seeded + 19 empty-state checks; the suite is the slowest group at ~24s); npm test:public-link 11, test:url-state 60, test:region 49, build green. Live probes: curl against the REPL image (root / record / robots / feed / file / SPA shell on /posts / HEAD / POST 405), render timings recorded in child 1 (no memo needed at blog scale), and the profile-env write/load path unit-tested from the dev script (the live expose/unexpose probe reruns once the script change reaches the staging checkout — profile verbs route there). The manual staging acceptance script (03-spa.org) still gates the release once a guest-enabled staging model exists.
Promoted to MVP 2026-10-24: a finished blog with no discoverable public face is not shippable. The demo video's closer is pasting a /p/ URL and watching a real unfurl render.
Guest login is a frontend ritual, and a cold fetch of any URL returns the empty SPA shell, so crawlers and unfurlers see nothing. The fix is a distinct public URL space, not same-URL SSR and not bot-UA sniffing. Guest-readable types with a :view-form are rendered to HTML on request at /p/, /p/<type>/, and /p/<type>/<uuid>, with a per-type RSS feed at /p/<type>/rss.xml, /sitemap.xml, and /robots.txt. The address is the row uuid, never a slug. The SPA stays the editing surface.
Redesigned 2026-11-06. The goal is a blog that Google and the AI indexers find and that humans can read at the public URL. So: the renderer is in-process 3bmd, reading the database as the guest role on every request — no materialized tree, no pass, no worker, no manifest, no generation stamp, no set-model coupling, nothing to rebuild after a snapshot restore. Humans arriving at /p/ read the page there; a visible "Open in app" link leads to the SPA. There is no bot-gated forward, no bot detection, and no script on a public page (the JSON-LD block is inert data). The pages look a little like the app: a site header from site-chrome (the model :title today; the extension point for the publisher / styling item), the SPA's light-theme colors and font, a blog layout with title, date, author, rendered markdown, images, FK links, and the declared :children region. Structured data is emitted because it is what the indexers read: OG tags, article:published_time, a BlogPosting JSON-LD block, feed autodiscovery, <lastmod> in the sitemap. Images are /p/files/<type>/<path> URLs authorized as guest at fetch time, not copied bytes; the earlier /p/files/<hash>.<ext> grammar is withdrawn. The "RSS feed" item is absorbed. The anonymous reach of /p/ equals the guest token's reach: eligibility requires :guest-allowed t, the same switch that lets anyone log in as guest, so a model with guest login off publishes nothing.
Revision 5, 2026-11-07, after Kimi's fourth review (wording only; Kimi judged the set implementation-ready): /p/ is a strict subset of the guest token's reach, not equal to it (public-type-p also requires type-level guest read); the renderer uses *guest-user* (database.lisp) rather than rest.lisp's *guest*, which loads after public-pages.lisp and would warn on every full load; the deploy-template note names the manifest renderer ({{DOMAIN}} is in no .yaml.tpl); the type-index step names the feed autodiscovery <link>.
Revision 4, 2026-11-06, after Kimi's third review (all claims verified against misc.lisp, request.lisp, backend.lisp, App.tsx, tests/helpers.lisp): the adapter no longer uses h:handle-static-file (its Range / conditional handling runs after headers are set and outside any boundary, answers 206 on HEAD and a 416 that keeps the image type and max-age=3600) — it opens the file inside one pre-header error boundary and streams it itself as a full 200, no Range, no 304 (Donnie, 2026-11-06, after confirming buffered streaming handles any size; a follow-up if the image whitelist ever grows to video or PDF); eligibility enforced inside guest-record / guest-records, not only by the route; the backend's view-result converts a NULL boolean to :true, so a nullable boolean reads as true in the API and would render as Yes — Donnie permitted the one-line fix (:null stays :null), the second backend.lisp edit; valid-public-origin (&optional (origin *public-origin*)) returns the canonical origin (trailing slash stripped) that every consumer uses; full XML 1.0 Char sanitizer tested directly; the poll fixture is a real :moderate button on :comments with :action (:test-async) and its :moderate-status companion on the View form (the SPA polls only -status keys), completed out of band with be-set-field-value; empty-state cells run in their own with-model group or restore in unwind-protect; :links public with a View form; invalid UTF-8 in the path is also Hunchentoot's 400; the SPA clipboard fence resets copyState on record change (the old cleanup left "Copied" on the next record indefinitely); copyBestLink goes through the new helpers; the recovery acceptance case keeps q in the URL; insert closes the form rather than reopening View.
Revision 3, 2026-11-06, after Kimi's second review (all claims verified against Hunchentoot 1.3.1, rest.lisp, App.tsx): the route reads the raw request URI (script-name is already decoded, so %2F is unusable there) and malformed percent escapes are Hunchentoot's own 400 before dispatch; the adapter is redone around h:handle-static-file (fs-path returns a string, the content type is the function's argument, HEAD follows the GET path, no nil body); one handler-case in the adapter turns any error into a plain no-store 500 (the server runs *show-lisp-errors-p* t); 503 means only "no model" and a set-model is an accepted few seconds of 500s (no model.lisp change); the file route requires an fs-backed leaf; record-timestamps converts universal-time integers with dt:timestamp-string as view-result-values does; 3bmd-ext-code-blocks is loaded so fenced code renders (walker-owned node, no Pygments); View-form order vs model order named; one empty-state matrix for root / type / record / feed / sitemap / robots; the fixture declares its own :post-tags joiner (blog-test's joins comments to tags), the view joins, a non-fs tree leaf, and real password / hidden / file / button fields with secret-looking values; live HTTP tests in the rest-tests style; the SPA canonical <link> is dropped; the acceptance script follows the SPA's real non-URL View path (dismissRecordError), a seeded running status for the poll case, and a blocked /api/item for the fallback case.
Revision 2, 2026-11-06, after Kimi's review: :guest-allowed gate; view-scoped types excluded (be-list scopes, be-rec does not); timestamps fetched by a separate query (an explicit :view-form list never carries them); the Markdown printer is our own walker over the 3bmd AST (3bmd's HTML printer interpolates URLs unescaped); JSON-LD via string-keyed yason with \u003c; RSS / sitemap namespaces and UTC zone suffixes pinned; omitted region :sort normalized as region-spec-list does; user-read-type-ids changed to delegate to permitted-row-ids so be-list stops silently truncating at one RBAC page (the one permitted backend.lisp edit, Donnie 2026-11-06); authorized-file-path returns a reason so /api/file keeps 403 vs 404; own percent-decoder; cache by status; Best Link keys on the loaded record and a list-row fallback drops public-url.
The Best Link control from "Record permalinks" keeps that label and copies public-url when the record carries one, and the SPA hash otherwise. public-url is a fresh guest-read check on the wire records, so there is no lag window. It does not get a second button. Rewriting the address bar to /p/ is Post MVP.
Depends on "Record permalinks" (the id grammar, the sibling id, and the one Copy control) and "Embedded child region" (the :children declaration and the :fk-eq filter), both DONE.
Restructured 2026-11-06 into three numbered children, replacing the four 2026-11-02 children of the materialized design. Ordering constraint: (1) → (2) → (3). Do not start (3) before (2) is serving, or Best Link can copy a /p/ URL that still returns the SPA shell. Each child carries its own plan file; the overview file holds ordering and the shared-contract index.
Notes: public-pages-notes.org — history only; the plan is complete without it. The 2026-11-02 per-child plans are archived under ~/workbench/public-pages-plan/materialized/.
Plan: public-pages-plan.org — overview only: ordering and the shared-contract index; the spec text lives in the per-child plan files linked below.
- Slot
- 5100
- Status
- 60 Done
- Tags
- mvp, backend, frontend
- Contributors
- Donnie