host: per-request IO kernel fix + fully-dynamic blog (no cache), 159/159
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 16s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 16s
KERNEL (sx_server.ml): route http-listen handlers through cek_run_with_io instead of bare Sx_runtime.sx_call, so handlers resolve per-request IO (durable persist reads/writes) via the same IO-driving runner the REPL uses. Verified: per-request read+write, 10 concurrent writes (15 on disk, no corruption), handler errors don't crash the server, http contract 6/6. BLOG: fully dynamic — host/blog-post reads the post from the durable store (content/head) AND renders (content/html) per request, no in-memory view, no cached output. Possible because of the IO fix. Honest ~2s due to interpreted Smalltalk render. Render speed is NOT solved here: the JIT (precompiler) isn't installed in the serving mode and currently miscompiles the Smalltalk evaluator's nested ASTs (enabling it breaks ~60% of tests). Fixing the JIT is a separate, high-payoff effort. Documented in the plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -104,12 +104,8 @@ EPOCH=1
|
||||
echo "(eval \"(host/blog-use-store! (persist/durable-backend))\")"
|
||||
EPOCH=$((EPOCH+1))
|
||||
echo "(epoch $EPOCH)"
|
||||
# Materialise any persisted posts into the in-memory view, then ensure the
|
||||
# welcome post exists (idempotent). Both run on the main thread (IO is fine
|
||||
# here; request handlers only read the view).
|
||||
echo "(eval \"(host/blog-load-all!)\")"
|
||||
EPOCH=$((EPOCH+1))
|
||||
echo "(epoch $EPOCH)"
|
||||
# Idempotently seed the welcome post into the durable store (no-op if present).
|
||||
# Handlers read + render from the store per request (per-request IO).
|
||||
echo "(eval \"(host/blog-seed! \\\"welcome\\\" \\\"Welcome to the SX host\\\" \\\"This page is rendered by lib/host on the SX runtime, persisted in the SX store — no Quart.\\\" 1)\")"
|
||||
EPOCH=$((EPOCH+1))
|
||||
echo "(epoch $EPOCH)"
|
||||
|
||||
Reference in New Issue
Block a user