Move stdlib out of spec — clean spec/library boundary

spec/ now contains only the language definition (5 files):
  evaluator.sx, parser.sx, primitives.sx, render.sx, special-forms.sx

lib/ contains code written IN the language (8 files):
  stdlib.sx, types.sx, freeze.sx, content.sx,
  bytecode.sx, compiler.sx, vm.sx, callcc.sx

Test files follow source: spec/tests/ for core language tests,
lib/tests/ for library tests (continuations, freeze, types, vm).

Updated all consumers:
- JS/Python/OCaml bootstrappers: added lib/ to source search paths
- OCaml bridge: spec_dir for parser/render, lib_dir for compiler/freeze
- JS test runner: scans spec/tests/ (always) + lib/tests/ (--full)
- OCaml test runner: scans spec/tests/, lib tests via explicit request
- Docker dev mounts: added ./lib:/app/lib:ro

Tests: 1041 JS standard, 1322 JS full, 1101 OCaml — all pass

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 23:18:30 +00:00
parent 50871780a3
commit f3f70cc00b
26 changed files with 109 additions and 64 deletions

View File

@@ -386,12 +386,13 @@ let () =
in
let root = find_root (Sys.getcwd ()) in
let spec p = Filename.concat (Filename.concat root "spec") p in
let lib p = Filename.concat (Filename.concat root "lib") p in
let web p = Filename.concat (Filename.concat root "web") p in
let env = make_integration_env () in
(* Load spec + adapters *)
Printf.printf "Loading spec + adapters...\n%!";
(* Load spec + lib + adapters *)
Printf.printf "Loading spec + lib + adapters...\n%!";
let load path =
if Sys.file_exists path then begin
let exprs = Sx_parser.parse_file path in
@@ -405,6 +406,7 @@ let () =
load (web "signals.sx");
load (web "adapter-html.sx");
load (web "adapter-sx.sx");
ignore lib; (* available for future library loading *)
(* Helper: render SX source string to HTML *)
let render_html src =