1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! L2 - the Davinci semantic IR (codename Disegno): the pivot stage and the
//! primary consumer surface.
//!
//! **Experimental:** the stage API may change in any alpha release; record
//! intentional breaking changes in the release notes.
//!
//! Named after Leonardo's *disegno*: the drawing that carries the idea,
//! independent of the material it is later executed in.
//!
//! L2 is the normalized, input-neutral representation of UI semantics
//! (`docs/davinci/architecture.md`, "L2 — Disegno"). Vue templates, JSX and
//! pug all lower into the same [`op`] family; whatever is genuinely
//! Vue-specific stays a `vue.*` dialect op instead of shaping the core.
//! The Vue template lowering into this family is `vize_l1_to_l2` (codename
//! Ricalco; P2-8); this crate holds the type family, its folio
//! page, the invariants that are enforceable by construction, and the verifier
//! for the ones that are not:
//!
//! - [`op`] — the op enums ([`op::Op`], [`op::BindingOp`]) and their payload
//! types, arena-resident and **`Drop`-free by construction** through
//! `vize_l0::{Box, Vec}` (whose const assertion rejects `Drop`
//! payloads; P1-10 measured it catching two real violations).
//! - [`expr`] — [`expr::ExprRef`], the expression reference: retained JS
//! AST, foreign dialect (type-only until phase 6), or the classified
//! escape with pessimal documented semantics (P2-5b's decision; record
//! in `docs/davinci/plan/phase-2-records/p2-5b.md`).
//! - [`dump`] — [`crate::dump::Page`], the L2 stage dump
//! (`docs/davinci/plan/folio-format.md`, "Disegno page").
//! - [`verify`] — the between-pass invariant checks (P2-6), debug/CI only:
//! local in the GHC `-dcore-lint` sense, and never in a release build.
//! - [`scope`] / [`provenance`] — the side-table vocabulary lowerings
//! attach beside the tree (P2-8): hygiene scope tags on
//! binding-introducing ops, and before/after provenance records that
//! survive failure. Neutral types here so every input dialect's lowering
//! (Vue today, JSX at P2-16) speaks the same facts.
//! - [`analysis`] — backend-neutral computations and canonical fact schemas
//! over L2 control and retained expressions. Dialect lowering crates may
//! adapt their transitional owners to these analyses without owning the
//! product vocabulary.
//!
//! The crate is `no_std + alloc` from birth so L2 artifacts print and parse
//! on any target (wasm32-wasip2 included; P2-14 makes that lane required).
extern crate alloc;