Phase 4: Move web framework files to web/ and web/tests/

signals.sx, engine.sx, orchestration.sx, boot.sx, router.sx, deps.sx,
forms.sx, page-helpers.sx, adapters, boundary files → web/
Web tests → web/tests/
Test runners updated with _SPEC_TESTS and _WEB_TESTS paths.
All 89 tests pass (20 signal + 43 CEK + 26 CEK reactive).
Both bootstrappers build fully (5993 Python lines, 387KB JS).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 02:26:18 +00:00
parent 7036621be8
commit 72eaefac13
15 changed files with 2111 additions and 17 deletions

View File

@@ -1440,7 +1440,7 @@ def compile_ref_to_py(
prim_modules.append(m)
ref_dir = os.path.join(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")), "shared", "sx", "ref")
_project = os.path.abspath(os.path.join(ref_dir, "..", ".."))
_project = os.path.abspath(os.path.join(ref_dir, "..", "..", ".."))
_source_dirs = [
os.path.join(_project, "spec"),
os.path.join(_project, "web"),

View File

@@ -5,6 +5,8 @@ import os, sys
_HERE = os.path.dirname(os.path.abspath(__file__))
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
sys.path.insert(0, _PROJECT)
sys.setrecursionlimit(20000)
@@ -212,25 +214,25 @@ for name in ["sf-defhandler", "sf-defpage", "sf-defquery", "sf-defaction"]:
env[name] = lambda args, e, _n=name: NIL
# Load test framework
with open(os.path.join(_HERE, "test-framework.sx")) as f:
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
# Load signals module
print("Loading signals.sx ...")
with open(os.path.join(_HERE, "signals.sx")) as f:
with open(os.path.join(_PROJECT, "web", "signals.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
# Load frames module
print("Loading frames.sx ...")
with open(os.path.join(_HERE, "frames.sx")) as f:
with open(os.path.join(_PROJECT, "spec", "frames.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
# Load CEK module
print("Loading cek.sx ...")
with open(os.path.join(_HERE, "cek.sx")) as f:
with open(os.path.join(_PROJECT, "spec", "cek.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
@@ -239,7 +241,7 @@ print("=" * 60)
print("Running test-cek-reactive.sx")
print("=" * 60)
with open(os.path.join(_HERE, "test-cek-reactive.sx")) as f:
with open(os.path.join(_WEB_TESTS, "test-cek-reactive.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))

View File

@@ -5,6 +5,8 @@ import os, sys
_HERE = os.path.dirname(os.path.abspath(__file__))
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
sys.path.insert(0, _PROJECT)
from shared.sx.ref.sx_ref import sx_parse as parse_all
@@ -223,19 +225,19 @@ for name in ["sf-defhandler", "sf-defpage", "sf-defquery", "sf-defaction"]:
env[name] = lambda args, e, _n=name: NIL
# Load test framework
with open(os.path.join(_HERE, "test-framework.sx")) as f:
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
# Load frames module
print("Loading frames.sx ...")
with open(os.path.join(_HERE, "frames.sx")) as f:
with open(os.path.join(_PROJECT, "spec", "frames.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
# Load CEK module
print("Loading cek.sx ...")
with open(os.path.join(_HERE, "cek.sx")) as f:
with open(os.path.join(_PROJECT, "spec", "cek.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
@@ -255,7 +257,7 @@ print("=" * 60)
print("Running test-cek.sx")
print("=" * 60)
with open(os.path.join(_HERE, "test-cek.sx")) as f:
with open(os.path.join(_SPEC_TESTS, "test-cek.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))

View File

@@ -5,6 +5,8 @@ import os, sys, subprocess, tempfile
_HERE = os.path.dirname(os.path.abspath(__file__))
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
sys.path.insert(0, _PROJECT)
# Bootstrap a fresh sx_ref with continuations enabled
@@ -87,7 +89,7 @@ env["push-suite"] = _push_suite
env["pop-suite"] = _pop_suite
# Load test framework
with open(os.path.join(_HERE, "test-framework.sx")) as f:
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
@@ -96,7 +98,7 @@ print("=" * 60)
print("Running test-continuations.sx")
print("=" * 60)
with open(os.path.join(_HERE, "test-continuations.sx")) as f:
with open(os.path.join(_SPEC_TESTS, "test-continuations.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))

View File

@@ -10,6 +10,8 @@ import os, sys
_HERE = os.path.dirname(os.path.abspath(__file__))
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
sys.path.insert(0, _PROJECT)
from shared.sx.ref.sx_ref import sx_parse as parse_all
@@ -143,7 +145,7 @@ env["register-in-scope"] = sx_ref.register_in_scope
env["callable?"] = sx_ref.is_callable
# Load test framework
with open(os.path.join(_HERE, "test-framework.sx")) as f:
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
@@ -152,7 +154,7 @@ print("=" * 60)
print("Running test-signals.sx")
print("=" * 60)
with open(os.path.join(_HERE, "test-signals.sx")) as f:
with open(os.path.join(_WEB_TESTS, "test-signals.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))

View File

@@ -5,6 +5,8 @@ import os, sys
_HERE = os.path.dirname(os.path.abspath(__file__))
_PROJECT = os.path.abspath(os.path.join(_HERE, "..", "..", ".."))
_SPEC_TESTS = os.path.join(_PROJECT, "spec", "tests")
_WEB_TESTS = os.path.join(_PROJECT, "web", "tests")
sys.path.insert(0, _PROJECT)
from shared.sx.ref.sx_ref import sx_parse as parse_all
@@ -167,7 +169,7 @@ env["env-has?"] = env_has
env["env-set!"] = env_set
# Load test framework (macros + assertion helpers)
with open(os.path.join(_HERE, "test-framework.sx")) as f:
with open(os.path.join(_SPEC_TESTS, "test-framework.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))
@@ -181,7 +183,7 @@ print("=" * 60)
print("Running test-types.sx")
print("=" * 60)
with open(os.path.join(_HERE, "test-types.sx")) as f:
with open(os.path.join(_SPEC_TESTS, "test-types.sx")) as f:
for expr in parse_all(f.read()):
trampoline(eval_expr(expr, env))