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:
@@ -54,11 +54,12 @@
|
||||
(dream-resp-body (host-bl-app (host-bl-req "/welcome/")))
|
||||
"<h1>Hello SX</h1><p>Served by lib/host.</p>")
|
||||
|
||||
;; persistence: a post materialises from the op-log (replay), and re-seeding is
|
||||
;; idempotent (no duplicate blocks appended).
|
||||
(host-bl-test "lookup materialises 2 blocks" (content/count (host/blog-lookup "welcome")) 2)
|
||||
;; persistence: the store holds 2 blocks (op-log replay), lookup materialises the
|
||||
;; doc from the store per call, and re-seeding is idempotent (no duplicate blocks).
|
||||
(host-bl-test "store has 2 blocks" (content/count (content/head host/blog-store "welcome")) 2)
|
||||
(host-bl-test "lookup materialises the doc" (content/count (host/blog-lookup "welcome")) 2)
|
||||
(host/blog-seed! "welcome" "Hello SX" "Served by lib/host." 2)
|
||||
(host-bl-test "re-seed is idempotent" (content/count (host/blog-lookup "welcome")) 2)
|
||||
(host-bl-test "re-seed is idempotent" (content/count (content/head host/blog-store "welcome")) 2)
|
||||
|
||||
;; ── unknown slug -> 404 ─────────────────────────────────────────────
|
||||
(host-bl-test
|
||||
|
||||
Reference in New Issue
Block a user