R7RS guard special form + transpiler fixes

- guard as CEK special form in evaluator.sx, desugars to call/cc +
  handler-bind with sentinel-based re-raise (avoids handler loop)
- bootstrap.py: fix bind_lambda_with_rest type annotations, auto-inject
  make_raise_guard_frame when transpiler drops it
- mcp_tree: add timeout param to sx_test (default 300s)
- 2566/2568 tests pass (2 pre-existing scope failures)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 12:34:01 +00:00
parent 508a0017a7
commit 21ad052272
4 changed files with 105 additions and 13 deletions

View File

@@ -704,13 +704,14 @@ let rec handle_tool name args =
let spec_dir = try Sys.getenv "SX_SPEC_DIR" with Not_found -> "spec" in
Filename.dirname spec_dir
in
let timeout = args |> member "timeout" |> to_int_option |> Option.value ~default:300 in
let cmd = match host with
| "ocaml" ->
Printf.sprintf "cd %s/hosts/ocaml && eval $(opam env 2>/dev/null) && dune exec bin/run_tests.exe%s 2>&1"
project_dir (if full then " -- --full" else "")
Printf.sprintf "cd %s/hosts/ocaml && eval $(opam env 2>/dev/null) && timeout %d dune exec bin/run_tests.exe%s 2>&1"
project_dir timeout (if full then " -- --full" else "")
| "js" | _ ->
Printf.sprintf "cd %s && node hosts/javascript/run_tests.js%s 2>&1"
project_dir (if full then " --full" else "")
Printf.sprintf "cd %s && timeout %d node hosts/javascript/run_tests.js%s 2>&1"
project_dir timeout (if full then " --full" else "")
in
let ic = Unix.open_process_in cmd in
let lines = ref [] in