mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
Stage S2 of the two-tier design. IrFunction gains a tier (absent means static); lowering assigns it from function bodies, placing functions that use the dyn vocabulary in the dynamic tier, and the validator enforces invariant I1: a static function performs no dynamic operation, only boundary operations (dynFrom, dynCheck, kind tests) and moves. Serialized IR keeps the field out in this stage and loaders derive it again, so every IR, LLVM and executable artifact is unchanged. Every committed refusal and runtime fence becomes a recorded demotion request attributed to the binding, field, function instance, class or module the dynamic tier would take over, while the compiler still refuses and fences as before. `scriptc coverage` reports dynamic-tier statements (statementsDynamic), `--explain-dynamic[=<name>]` prints the demotion chains, and `--tier=auto|static-only` is wired through build, run and coverage for stage S6; both modes compile identically today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>