Phase 1 Step 2 of architecture roadmap. The OCaml HTTP server is now
generic — all sx_docs-specific values (layout components, path prefix,
title, warmup paths, handler prefixes, CSS/JS, client libs) move into
sx/sx/app-config.sx as a __app-config dict. Server reads config at
startup with hardcoded defaults as fallback, so it works with no config,
partial config, or full config.
Removed: 9 demo data stubs, stepper cookie cache logic, page-functions.sx
directory heuristic. Added: 29-test server config test suite covering
standard, custom, no-config, and minimal-config scenarios.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove prism.js, sweetalert2, body.js, sx-browser.js from shell —
only WASM kernel (sx_browser.bc.wasm.js + sx-platform.js) loads
- Restore request-handler.sx integration: SX handles routing + AJAX
detection, OCaml does aser → SSR → shell render pipeline
- AJAX fragment support: SX-Request header returns content fragment
(~14KB) instead of full page (~858KB), cached with "ajax:" prefix
- Fix language/applications/etc page functions to return empty fragment
instead of nil (was causing 404s)
- Shared JIT VM globals: env_bind hook mirrors ALL bindings to a single
shared globals table — eliminates stale-snapshot class of JIT bugs
- Add native `parse` function for components that need SX parsing
- Clean up unused shell params (sx-js-hash, body-js-hash, head-scripts,
body-scripts, use-wasm) from shell.sx, helpers.py, and server.ml
14/32 Playwright tests pass (navigation, SSR, isomorphic, geography).
Remaining failures are client-side (WASM bytecode 404s block hydration).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The sx-handle-request function (which routes URLs to page rendering)
was removed from request-handler.sx. Without it, the server's
http_render_page calls sx-handle-request which doesn't exist,
returning nil for every request → 500 errors.
Restored from the last known working version (394c86b).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- request-handler.sx: replace all dots (not just `.(`) and auto-quote
undefined symbols as strings so 3-level URLs like
/sx/(geography.(reactive.(examples.counter))) resolve correctly
- sx-platform.js: register popstate handler (was missing from manual
boot sequence) and fetch full HTML for back/forward navigation
- sx_ref.ml: add CEK step limit (10M steps) checked every 4096 steps
so runaway renders return 500 instead of blocking the worker forever
- Rename test-runner.sx → runner-placeholder.sx to avoid `test-` skip
- Playwright config: pin testDir, single worker, ignore worktrees
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The handler routes correctly and renders content, but shell statics
(__shell-sx-css etc.) resolve to nil/empty in the handler scope.
use-wasm flag also not working — need to remove sx-browser.js fallback.
Needs: debug shell static resolution in SX handler scope.
Remove sx-browser.js from shell template entirely.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
web/request-handler.sx: configurable SX handler called by OCaml server.
Detects AJAX (SX-Request header) and returns content fragment (no shell)
vs full page with shell. All routing, layout, response format in SX.
OCaml server: http_render_page calls sx-handle-request via CEK.
No application logic in OCaml — just HTTP accept + SX function call.
signal-condition rename: reactive signal works, condition system uses
signal-condition. Island SSR renders correctly (4/5 tests pass).
WASM JIT: no permanent disable on failure. Live globals.
WIP: page-sx empty in SX handler — client routing needs it.
Navigation tests timeout (links not found after boot).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New web/request-handler.sx: configurable SX function (sx-handle-request)
that receives path + headers + env and returns rendered HTML.
The handler decides full page vs AJAX fragment.
OCaml server: http_render_page now just calls the SX handler.
All routing, layout selection, AJAX detection moved to SX.
Header parsing added. is_sx_request removed from OCaml.
Configurable via SX_REQUEST_HANDLER env var (default: sx-handle-request).
WIP: handler has parse errors on some URL formats. Needs debugging.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>