lichen.page.review from the reviewed point 0b92cb61 to stack eb5a1653, as one PR per subsystem (review set)

product: 08 Builds: scripts, shortcodes, SSGs and the server render #55

targeting oct/07-publishing from oct/08-builds
Closed opened by and assigned to notplants-bot.bsky.social
targeting oct/07-publishing from oct/08-builds

superseded by the full set from 09-23, #17–#37

description: Review set for lichen.page.review, 0b92cb61 (reviewed) → eb5a1653 (stack). PR 8 of 16. 19 files, +990/−518. One commit, 94780ae5b4ef, which sets these files to their content at eb5a1653. Targets #7 (oct/07-publishing). #9 stacks on this one. Tests and generated files are not in any PR; they are in main.

A site's build, its scripts and the server-side render, after the operator's review notes N1, N2, N6 and N7 and SITE-FRONT-BOUNDARY decision 6:

  • Script runners are their own module, scripts/ (N6). The interpreters (Lua and JavaScript in-process, Python as a child), the child protocol and the worker per language moved out of shortcodes/. Shortcodes, build hooks, the script SSG and lichen's own SSR all use them.
  • SSR is no longer a shortcode (N6). The no-JavaScript editor page's renderer is ssr/runtime.rs and ssr/renderer.rs: lichen's own React bundle on a worker thread confined to its scratch.
  • Shortcode outputs are cached (N2, R4): keyed by the script, its request and a digest of everything under shortcodes/, for the life of the process. A script can opt out (cache = false); a server can turn the cache off (use_shortcodes_cache = false).
  • What a build's scripts write is committed without advancing the tree's revision (N1), only after a publication whose scripts actually ran, and editors are told the tree may have changed.
  • Everything a build starts stays in the call's process group (decision 6): Lua's io.popen/os.execute, and every mdBook preprocessor and renderer, go through call-join, so nothing they start can outlive the call.
  • Over the storage limit, no site code runs (SHB-STORAGE1).
  • The default lichen-ssg layout moved to ssg/templates/layout.html (N7).

info: Plans: OPERATOR-REVIEW-REVISIONS-2026-10-13.md and its spec OPERATOR-REVIEW-REVISIONS-SPEC-2026-10-15.md (N1, N2/R4, N6, N7; the notes are in OPERATOR-REVIEW-NOTES-2026-10-13.md), SITE-FRONT-BOUNDARY-2026-10-17.md decision 6 (unit 3). Background: SSG-SCRIPT-SHORTCODES-2026-10-02.md, REPLACE-TERA-WITH-SSR-REACT-2026-10-07.md.

Files (all crates/lichen-site/src/)

  • scripts.rs — new: the runners' shared limits and errors, in_process_call, work_in, call_join_words. Read first.
  • scripts/runner.rs, child.rs, lua.rs, js.rs, python.rs — moved from shortcodes/ (renames). lua.rs gains the call-group join for io.popen and os.execute.
  • shortcodes.rs (−303) — what is left is shortcodes proper: syntax, calls, the build's interpreters, the cache's use.
  • shortcodes/cache.rs — new: the output cache.
  • ssr.rs, ssr/renderer.rs (new), ssr/runtime.rs (moved from shortcodes/ssr.rs) — the no-JavaScript page's render.
  • rebuild.rs — the build lane: PublishedHook commits a build's writes, editors are told after a preview or check that ran scripts, the storage check.
  • ssg/mdbook.rs — every mdBook command put in the build's process group; a time bound.
  • ssg/hugo.rs, ssg/lichen.rs, ssg/script.rs, ssg/ssg_trait.rs — follow-ups of the above.
  • ssg/templates/layout.html — moved from ssg/layout.html, unchanged; templates.rs points at it.

Moved in: scripts.rs and templates.rs (site core, by their paths).

Lives elsewhere

  • The publish that asks for a build: #7. The confinement of the worker threads and the call-join mode itself: #1.
  • The server setting use_shortcodes_cache: server_settings.rs in #11 and settings/server.rs in #13.
  • Tests (shortcodes/tests/, ssg/tests/, tests/rebuild.rs, tests/call_cleanup.rs, call_runner_probes.rs) are in main.
Commits 0