From ac161003193ed3861419272bb85c8db902a3e611 Mon Sep 17 00:00:00 2001 From: Brummel Date: Sun, 10 May 2026 12:46:15 +0200 Subject: [PATCH] =?UTF-8?q?design-md-consolidation=203.2:=20invert=20?= =?UTF-8?q?=C2=A7Data-model=20SoT=20=E2=80=94=20DESIGN.md=20canonical,=20a?= =?UTF-8?q?st.rs=20projection,=20drift=20test=20enforces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/DESIGN.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/DESIGN.md b/docs/DESIGN.md index f4a02d8..4c5d4c5 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -1705,12 +1705,13 @@ hashes stay bit-identical. ## Data model The on-disk JSON-AST is what the toolchain hashes, typechecks, and -lowers. Every node in this section is the schema mirror of an enum or -struct in `crates/ailang-core/src/ast.rs`; whenever the two disagree, -`ast.rs` is the source of truth. Every additive field is declared with -`skip_serializing_if` so pre-existing fixtures keep bit-identical -canonical-JSON hashes — that gating contract is what makes growing -the schema cheap. +lowers. **This section is the canonical schema.** The Rust types in +`crates/ailang-core/src/ast.rs` are the in-memory projection of it; +when the two disagree, this section wins, and the drift test +`crates/ailang-core/tests/design_schema_drift.rs` fires. Every +additive field is declared with `skip_serializing_if` so pre-existing +fixtures keep bit-identical canonical-JSON hashes — that gating +contract is what makes growing the schema cheap. ### Module