Add (param :as type) annotations to all fn/lambda params across SX spec

Extend the type annotation system from defcomp-only to fn/lambda params:
- Infrastructure: sf-lambda, py/js-collect-params-loop, and bootstrap_py.py
  now recognize (name :as type) in param lists, extracting just the name
- bootstrap_py.py: add _extract_param_name() helper, fix _emit_for_each_stmt
- 521 type annotations across 22 .sx spec files (eval, types, adapters,
  transpilers, engine, orchestration, deps, signals, router, prove, etc.)
- Zero behavioral change: annotations are metadata for static analysis only
- All bootstrappers (Python, JS, G1) pass, 81/81 spec tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 20:27:36 +00:00
parent c82941d93c
commit b99e69d1bb
23 changed files with 532 additions and 498 deletions

View File

@@ -50,7 +50,7 @@
;; Returns a list of top-level AST expressions.
(define sx-parse
(fn (source)
(fn ((source :as string))
(let ((pos 0)
(len-src (len source)))
@@ -170,7 +170,7 @@
;; -- Composite readers --
(define read-list
(fn (close-ch)
(fn ((close-ch :as string))
(let ((items (list)))
(define read-list-loop
(fn ()
@@ -352,11 +352,11 @@
(define sx-serialize-dict
(fn (d)
(fn ((d :as dict))
(str "{"
(join " "
(reduce
(fn (acc key)
(fn ((acc :as list) (key :as string))
(concat acc (list (str ":" key) (sx-serialize (dict-get d key)))))
(list)
(keys d)))