diff --git a/src/v4/extdeps/languages/rust.dag b/src/v4/extdeps/languages/rust.dag index 62848205282..7718a134da0 100644 --- a/src/v4/extdeps/languages/rust.dag +++ b/src/v4/extdeps/languages/rust.dag @@ -1,19 +1,287 @@ // src/v4/extdeps/languages/rust.dag // // Scope: Rust target language spec — primitives, syntax, codegen rules. -// Anchor: https://doc.rust-lang.org/reference/ (Rust Reference) -// Unifies: (per THESIS:188) language spec = transport spec = interpreter runtime. ONE substrate carrier for all three roles. Different lenses read different facts from the same data (emission reads syntax; transport reads serialization; interpreter reads execution semantics). A worker needing transport or runtime extends this file, not a new "transport spec" file. +// Anchor: https://doc.rust-lang.org/reference/ (Rust Reference) — the +// versioned upstream specification (L-2 fidelity authority). +// The Reference is the spec the carriers below are pinned to; +// when the Reference changes (a new edition adds / renames a +// primitive; the stable IEEE-754 width set grows; a new +// visibility scope), the change is a visible C1 edit to the +// relevant declaration below, never a silent extension. +// Unifies: (per THESIS:188) language spec = transport spec = interpreter +// runtime. ONE substrate carrier for all three roles. Different +// lenses read different facts from the same data (emission +// reads syntax; transport reads serialization; interpreter +// reads execution semantics). A worker needing transport or +// runtime extends this file, not a new "transport spec" file. // -// Owns: -// - Rust primitives (i32, String, Vec, ...) with algebra inhabitance -// - emission rules: .dag Node -> Rust source -// - cost realization: Rust-specific bounds for compositional cost lens +// STRUCTURAL FINDING (this slice's deliverable, manager directive +// msg_4f7e1280 — the operator-critical-path T-4 directive, item 3; +// reinforced msg_8b477982). +// Rust's TYPE-SYSTEM SURFACE — scalar primitive vocabulary, reference +// kinds, visibility scopes — fits the substrate's existing +// classifier shape (closed Disj + Conj records) without modification. +// No 7th connective, no 6th behavior is surfaced by this slice. The +// slice declares the Rust type VOCABULARY as Node-shaped declaration- +// class data; it deliberately STOPS at the carrier-shaped seams where +// D1 (parse/emit operations — ratified Outcome = Produced { value: +// T } | Rejected { diagnostic: Diagnostic }, LANDED 2026-05-16 in +// std/diagnostic.dag via PR #3181 commit 54d12e62a; this slice does +// not yet consume Outcome directly, as parse/emit are pipeline- +// stage operations owned elsewhere — see Owned ELSEWHERE below) and +// D2 (per-language primitive inhabitance + fn-value-expression form +// — RATIFIED 2026-05-16 via PR #3195 commit 44a37ad46, encoded as +// the DECISIONS.md D2 row's THREE-THIN-FACTS resolver shape: +// alias-identity to the std/ carrier + grounding map + +// operation-semantics carriers; the prior msg_640d429c-pending +// framing is SUPERSEDED) plug in. +// +// The seams are NAMED in "Owned ELSEWHERE" below with their owners +// and dissolution triggers. Authoring those seams here would have +// improvised past D1/D2 — exactly the keen-wren-419 (T-4.6) / +// loyal-koi-702 (T-4 languages) STOP-and-escalate precedent +// established 2026-05-16. Deferral-with-named-trigger, never +// improvisation. +// +// Owns (this slice — REVISED from scaffold; scaffold's "Rust primitives +// with algebra inhabitance" + "emission rules" + "cost realization" +// lines are PRESERVED AS GOALS in the Owns→ELSEWHERE table below; +// the slice-vs-bundled split is explicit, not silent — same revision +// discipline as ptx.dag #3170): +// +// - Rust scalar primitive vocabulary as closed structural carriers: +// RustIntKind (signed / unsigned), RustIntWidth (Bits8/16/32/64/ +// 128 + Pointer for isize/usize per std/machine.dag PointerWidth), +// RustFloatWidth (Bits32/64 — the stable Rust IEEE-754 width set; +// f16/f128 are unstable per the pinned Reference) +// - Rust scalar typed-shape sum: RustScalar — the SINGLE +// authority for Rust's six-way primitive-type partition per +// Reference §3.3-§3.6 (Int/Float/Bool/Char/Str/Never), with +// heterogeneous variant payloads so illegal kind×width pairs +// are STRUCTURALLY UNREPRESENTABLE: IntScalar { kind, width }; +// FloatScalar { width }; BoolScalar / CharScalar / StrScalar / +// NeverScalar carry no width payload. (`()` is a TupleType per +// §3.10 — out-of-scope for this slice; see SCOPE NEGATIVE +// Tuple types.) A prior `RustScalarKind` enum was deleted as +// a P2 duplicate-authority partition over the same six kinds +// (openai-pro REQUEST_CHANGES 2026-05-16T15:30:41Z — Practice 7 +// projection-over-enumeration discipline). +// - Rust reference vocabulary: RustReferenceKind (Shared / Exclusive +// — Rust's `&T` vs `&mut T`), and the Conj carrier RustReference +// attaching it to an opaque lifetime Symbol (K-1) AND the +// referent Node (the Reference's TypeNoBounds slot) — three +// coordinates total per `&'lifetime mut? TypeNoBounds`, so +// `&'a i32` and `&'a str` are distinct facts (P1/P2 fidelity) +// - Rust visibility scope: RustVisibility (Private / Pub / PubIn +// { path: PubInPath }) + PubInPath { resolved_path: +// List } + NamedSegment { id: Symbol } — the +// three-way visibility partition reflecting the Reference's +// fundamental form (§visibility-and-privacy). PubInPath carries +// an ABSOLUTE PATH FROM CRATE ROOT (empty = `pub(crate)`; non- +// empty = `pub(in crate::...)`). The carrier is a 🟡 SCAFFOLD +// (see PubInPath's bridge note): SHAPE-level invariants are +// type-enforced (one resolved_path field; closed-record +// NamedSegment; List equality on Symbol elements); SEMANTIC- +// level invariants (real-module-ness of segments, valid +// containment descent, strict-ancestor of target, end-to-end +// same-resolved-scope ⇒ same-canonical-value) are PRODUCER- +// OBLIGATION pending the module-tree substrate (named +// dissolution trigger: typed Module-Node + ancestor-relation +// Witness in std/; co-temporal with the bundled T-4 +// LanguageModel grammar work that the resolver consumes). +// `pub(crate)`, `pub(super)`, `pub(in )` source +// forms all canonicalize to their absolute-from-crate-root +// resolved path at parse/resolve time; the carrier represents +// the post-resolution canonical form only. Reference-invalid +// and reflexive-current-module cases canonicalize to Private +// upstream and never reach this carrier. +// - Rust per-target cost-realization carrier shape: RustCost (per- +// instruction + per-allocation components — the per-target +// projection U1 reads; the carrier SHAPE only, no concrete cost +// instance-values in this slice — those ride T-12 lens/cost.dag +// per "Owned ELSEWHERE" below) +// - Rust D2 RESOLVER shape (per the encoded DECISIONS.md D2 row, +// 2026-05-16 commit 44a37ad46): GroundingMap +// (surface-spelling Conj — 🟡 TRACKED-SCAFFOLD: declaration +// body is canonical D2a(2) SHAPE, PLACEMENT is operator-pending +// per T-4 mgr msg_148854d5; one decl ≠ P2 violation; fan-out +// files DO NOT re-declare — see resolver-block note), +// OverflowAction (closed two-way Disj — PanicOnOverflow / +// TwoComplementWrap, the permitted-set of Rust integer- +// overflow runtime actions per Reference behavior-not-considered- +// unsafe.html#integer-overflow), +// OverflowDisposition (closed two-variant Disj — +// MustPanicOnOverflow / MayPanicOrTwoComplementWrap, the +// per-build-mode disposition classifier; each variant nullary +// so the deterministic Reference facts are structurally pinned +// by variant identity — no payload could carry an illegal +// action; addresses BLOCKING reviewers 2026-05-16T19:26:35Z +// + 2026-05-16T20:33:06Z + openai-pro REQUEST_CHANGES @ f2dcea63 +// + codex BLOCKING @ 57f2f029); plus +// the LANDABLE NOW alias-identity row `type RustBool = Bool` + +// `data rust_bool_grounding: GroundingMap = +// GroundingMap { spelling: "bool" }` (std/logic.dag's Bool is +// landed; bool-now/integers-pending split is the sanctioned +// scaffold-drift disposition per manager directive msg_2c2716dd). +// Per-primitive alias-identity rows for integers / floats / +// char / str / never are 🟡 TRACKED-SCAFFOLD with named owner + +// dissolution trigger per the D2-resolver block below; they +// amend in as one-line landings as their std/ targets reach +// `origin/main`. +// +// Owned ELSEWHERE (deliberately NOT in this slice — named owners + +// dissolution triggers per directive item 3 "DEFER explicitly, with +// named owner + dissolution trigger"): +// +// - Rust scalar inhabitance — D2 RATIFIED 2026-05-16 (encoded +// DECISIONS.md D2 row, commit 44a37ad46, via PR #3195 merge). +// The RATIFIED FORM is NOT per-language `data rust_i32_ring: +// OrderedRing<...> = ...` rows (the original STOP-2/STOP-3 +// escalation surfaced that shape as the parallel-substrate +// INVARIANTS P1:42 `numeric_aliases_align_to_refinements` +// forbids). The ratified form is the THREE-THIN-FACTS D2a +// resolver: alias-identity to the std/ carrier +// (`type RustI32 = Int32` — algebra inhabitance flows through +// the alias per the `List = FreeMonoid` precedent) + +// grounding map (surface spelling) + operation-semantics +// carrier (OverflowDisposition for integers; NaN/Inf for +// floats). The resolver-shape carriers (GroundingMap, +// OverflowAction, OverflowDisposition) + the bool alias-identity +// row LAND IN THIS SLICE (per the Owns bullet above). The +// remaining per-primitive alias-identity rows are 🟡 TRACKED- +// SCAFFOLD deferred to their named std/ targets per the +// resolver-block deferral table below. +// SUBSTRATE SINGLE-AUTHORITY GUARD (per manager directive +// msg_2c2716dd): rust.dag (and any sibling extdeps/languages/ +// file) MUST NOT mint the std/ Int / UInt / Float / IntPointer / +// UIntPointer carriers locally; that authority is std/integer.dag +// and std/float.dag (T-3 Wave-A3). Local minting would produce +// parallel substrates and break P2 single-authority at the +// carrier level. The legitimate landing per primitive is alias- +// identity to the existing std/ source, never a parallel +// declaration. +// +// - Bidirectional Rust LanguageModel substrate (grammar productions +// as declarative B2-OMNI data, C5-fidelity disposition tags per +// surface feature, ingest∘emit roundtrip carrier): the BUNDLED +// work of T-4 across all 5 Shape A source languages, where "the +// SHAPE is the work" (TASKS.md T-4 authoring contract). Will +// consume the D1 `Outcome = Produced { value: T } | Rejected +// { diagnostic: Diagnostic }` carrier — LANDED 2026-05-16 in +// std/diagnostic.dag via PR #3181 commit 54d12e62a. When the +// bundled LanguageModel shape lands (operations typed via +// Outcome), this file's classifiers slot into the Rust +// `LanguageModel` instance without revision; their I/O contract +// is the immutable header above. This slice does not author the +// Outcome-typed operations directly — parse/emit are pipeline- +// stage operations owned elsewhere (see next bullet). +// STOP-TRIGGER (named, binding): the temptation to STUB an +// `emit_rust : Node -> Outcome` op HERE — even with +// the Outcome carrier now landed — is the FORBIDDEN deferral +// (the v3 failure mode the value-or-Diagnostic-STOP precedent +// foreclosed). Emission ops belong in compiler/05_emit.dag +// (T-10); parse ops in compiler/02_parse.dag (T-7); not in this +// language-spec file. Stub-to-keep-moving is the exact shape +// that broke v3; the named "Owned ELSEWHERE" note is the +// legitimate deferral form (ptx #3170 precedent). +// SEAM: the Rust grammar production data attaches as Node trees +// in this file (B2-OMNI: grammar is data, not code); the carriers +// declared here are the type-system structure the grammar +// references when productions resolve type expressions. +// +// - Pipeline emission/ingest operations (`.dag` Node → Rust source; +// Rust source → Node ingest with C5-fidelity classification per +// surface feature). Will consume the ratified `Outcome` D1 +// carrier (LANDED in std/diagnostic.dag via #3181 commit +// 54d12e62a). Owners: compiler/05_emit.dag (T-10), +// compiler/02_parse.dag (T-7) — emission and ingest are +// pipeline-stage operations, NOT facts of this language file. +// The LanguageModel data DECLARES the bidirectional rules; the +// pipeline stages EXECUTE them. +// STOP-TRIGGER (named, binding): authoring `emit_rust : Node -> +// Outcome` here would parallel-represent the Outcome- +// typed emission op across every language file — exactly the v3 +// cross-layer-drift failure mode the keen-wren-419 STOP (T-4.6 +// formats, msg_0da56c18) foreclosed. The D1 carrier landing did +// NOT make this slice the right home for emission ops; defer- +// with-named-trigger, never stub. +// +// - Rust ownership / lifetime semantic enforcement (the borrow- +// checker rules — single-owner, exclusive-mutable, lifetime +// well-scopedness): the OWNERSHIP LENS lens/ownership.dag (T-13) +// CONSUMES the `RustReference` carrier declared here as the +// structural fact it reads. Per THESIS:401 IN-B "effects are +// intrinsic to the type signature, not an annotation layer" — +// `&` / `&mut` / `'a` are STRUCTURAL Rust facts, not annotations; +// they are declared here as the type-system surface and READ by +// the ownership lens from the signature, never re-declared as a +// parallel ownership taxonomy. +// +// - Rust per-instruction cost INSTANCE-VALUES (concrete +// `RustCost { instruction_cost: 1, allocation_cost: 0 }` rows per +// operation): the carrier SHAPE is owned here (RustCost below); +// concrete cost rows ride T-12 lens/cost.dag + U2 (the per-target +// projection of U1's `Homomorphism<…, …, RustScalar>.map`). Pre- +// T-12 instance-values would parallel-represent the cost the map +// structurally encodes — the U1 no-engine smell (algebra.dag U1). // // Consumes: -// - std/node.dag: all connectives + behaviors (this is target SPEC) -// - std/algebra.dag: inhabitance declarations +// - std/node.dag: `Node` (the bounded kernel's single recursive +// type per A1; the `referent: Node` field on `RustReference` +// carries the reference's TypeNoBounds per Reference §types- +// pointer) and `Symbol` (the K-1 opaque kernel identity used +// as the lifetime tag on `RustReference` + the segment carrier +// for `RustVisibility.PubIn`'s SimplePath). Both are equality- +// only at the boundary (Symbol's K-1 discipline); Node carries +// its structural recursion through `children` per A1. +// - std/logic.dag: `Bool` (KERNEL-AMBIENT — STRUCTURE.md +// "Kernel-ambient types"; usable without an import, but +// std/logic.dag is its sole modeling authority). The D2a +// alias-identity row `type RustBool = Bool` references the +// type-parameter `Bool` directly via the kernel-ambient +// resolution; no `import` statement is needed (v2-compiler +// verifies 0-diag without one). Naming std/logic.dag here +// makes the substrate-authority dependency explicit; the +// absence of an `import` statement is the kernel-ambient +// discipline made operational. +// `Int` is kernel-ambient (the RustCost components' raw Int +// carrier per the 🟡 scaffold bridge to std/cardinality.dag); +// `List` is kernel-ambient (used as `List` in +// `PubInPath.resolved_path` — the segments are local typed-Conj +// values carrying an opaque `Symbol` identifier per K-1). The +// only `import` statements are `Node` and `Symbol` from +// std/node.dag — driven by the `RustReference` Conj record's +// `referent: Node` and `lifetime: Symbol` fields, plus the +// `id: Symbol` field on `NamedSegment` (Node/Symbol are NOT +// kernel-ambient, so they require explicit import even when +// used in type-parameter / field-type position). +// (The scaffold header's prior `std/node.dag, std/algebra.dag` +// Consumes line was anticipatory — std/node.dag IS imported +// (`Node` + `Symbol`, exactly as std/diagnostic.dag imports +// `Node`); std/algebra.dag is NOT imported in this slice because +// the algebra inhabitance for Rust primitives flows through the +// D2a(1) alias-identity targets (e.g. `type RustI32 = Int32`) +// rather than per-language `OrderedRing` instance +// rows in this file (the D2 row's machine-readable-inhabitance +// form, per `List = FreeMonoid` precedent); the algebra +// structure is consumed transitively through the std/ alias +// target's own algebra inhabitance, never re-declared here. +// The revised Consumes block +// reflects what the file actually depends on, distinguishing +// import-required (Node + Symbol) from kernel-ambient (Bool + +// Int + List). Consumes correction rides the systemic operator +// scaffold-Consumes reconciliation, T-4 mgr synthesis +// msg_1fddb75c — the surface+trigger discipline lets the +// operator ratify all per-file Consumes strikes uniformly in +// one pass; this is not worker-settled. The kernel-ambient vs +// imported framing reconciliation is per claude-opus-4-7's +// exploratory observation 2026-05-16T09:00:49Z.) // -// Status: scaffold — fill per TASKS.md T-4 +// Status: T-4 rust-slice modeled 2026-05-16 (loyal-koi-702); structural +// finding: NO STOP from the type-system surface. The I/O contract in +// this header is immutable for downstream workers. Splitting this +// file requires explicit operator ratification (substrate extension +// = stop signal). // Brief: see BRIEF_TEMPLATE.md; this file's I/O contract is the immutable // contract for the worker. Splitting this file requires explicit operator // ratification (substrate extension = stop signal). @@ -21,3 +289,1809 @@ module v4.extdeps.languages.rust + +import v4.std.node { Node, Symbol } +// Bool from v4.std.logic is KERNEL-AMBIENT (STRUCTURE.md "Kernel- +// ambient types") — usable without an import statement in any v4 +// .dag file. The D2a alias-identity row `type RustBool = Bool` +// below references the type-parameter `Bool` directly; v2-compiler +// resolves it ambiently (verified 0-diag). + + +// ───────────────────────────────────────────────────────────────────── +// Modeling notes (read before validating against the anchor) +// +// THE SLICE-VS-BUNDLED FRAMING (T-4, manager directive msg_4f7e1280, +// operator-critical-path item 3). T-4 is the bundled work across the +// 5 Shape A source languages: "the SHAPE is the work" — establish the +// canonical declarative LanguageModel shape on one language, then fan +// out to the other 4. THIS slice is the rust HALF of fix-the-shape- +// once: the type-system VOCABULARY and Rust-side carrier shapes, with +// the D1/D2-dependent pieces (parse/emit operations + scalar algebra +// inhabitance instance-values) explicitly DEFERRED to their named +// owners. Deferral ≠ improvisation: every deferred item is named in +// "Owned ELSEWHERE" with its owner and dissolution trigger. +// +// THE RUST → SUBSTRATE STRUCTURAL FIT. Each Rust surface concept maps +// to a member of the closed substrate axes (node.dag's 6 connectives +// + 5 L1 behaviors). The mapping, member-by-member — recording it +// here because the fit IS the deliverable (per the slice's structural +// finding above): +// +// - FUNCTION declarations and applications split across the two +// substrate axes per A1's two-coordinated-substrate framing: +// +// A Rust `fn name(args) -> T { body }` DECLARATION ↦ Arrow +// (the type-substrate connective; node.dag's TypeNode with +// connective: Arrow). The declaration introduces a typed +// function — `(args) -> T` — whose body is a sub-DAG of L1 +// behaviors (Value / Transform / Branch / Loop / Bind), +// referenced from the Arrow's children. The function's +// IDENTITY (a FunctionRef the call site refers to) is the +// Arrow declaration. +// +// A Rust function APPLICATION (call site `f(x, y)`) ↦ Transform +// (the computation-substrate behavior; node.dag's +// ComputationNode with behavior: Transform). Transform IS the +// application behavior of the typed-total-λ fragment per +// INVARIANTS:72 (Curry-Howard / System F lineage): the callee +// is a function value (resolved to the Arrow it references), +// the args are operands, and the application yields the +// result. node.dag:209 names this explicitly: "Transform = +// application." +// +// The distinction matters per the substrate's +// two-coordinated-axes discipline (THESIS §198-203): a Node +// belongs to EXACTLY one substrate at a time — either type- +// side (with a connective) or computation-side (with a +// behavior). A `fn` declaration and its call site are +// DIFFERENT Nodes: the declaration is a type Node (Arrow +// connective), the call site is a computation Node (Transform +// behavior). Conflating them was the earlier doc's defect, +// surfaced by openai-pro REQUEST_CHANGES 2026-05-16T11:15:38Z. +// +// - LET-BINDING (`let x: T = expr;` and `let mut x: T = expr;`) ↦ +// Bind. A Rust `let` introduces a name into a scope with a value; +// that is exactly Bind (node.dag:209 "Bind = let"). Mutability of +// the binding (`mut`) is a structural BINDING-LEVEL fact (the +// binding admits later `x = …;`), distinct from the REFERENCE- +// KIND-LEVEL mutability `&mut`; the latter is a TYPE-LEVEL fact +// carried by RustReferenceKind. The two are not the same axis, +// per the Rust Reference's separation of place expressions and +// reference types. +// +// - MATCH (`match expr { pat => … }`) ↦ Branch. Rust's match against +// a sum-typed value (`Option` / `Result` / user `enum`s) +// is exactly Branch over the Disj's variants (node.dag:209 +// "Branch = sums"). The match is total-by-construction (Rust +// itself rejects non-exhaustive matches over closed enums); that +// totality IS Branch's discipline. Predicated execution +// (`if cond { … } else { … }`) folds into the same Branch over a +// two-variant `Bool` Disj. +// +// - LOOP (`for x in iter`, `while cond`, `loop { … break …; }`) ↦ +// Loop with BOUNDED descent (node.dag:42-68, the A2 discipline). +// `for x in iter` is bounded by the iterator's cardinality (a +// finite measure when the iterator is bounded); `while cond` is +// bounded by a ranking dimension that decreases on each +// iteration; `loop { }` is structurally unbounded UNLESS the +// body's `break` makes the effective descent bounded. A Rust +// `loop {}` with no break is a STOP under A2 (the substrate +// refuses to claim totality it cannot prove); the v4 Rust model +// reads bounded loops, fail-closes on unbounded ones. +// +// - LITERAL / VALUE (`42i32`, `"hello"`, `true`) ↦ Value +// (node.dag:209). A literal IS a Value. The literal's typed +// interpretation (its scalar kind + width for numerics; its +// UTF-8 byte sequence for strings) flows through the D2 ratified +// resolver — the literal's Value carrier is just a Node; the +// typed interpretation rides the D2a(1) alias-identity to the +// std/ carrier (`type RustI32 = Int32`) where the algebra +// inhabitance lives. (`()` is a Value literal too, but it is a +// zero-tuple TupleType — out-of-scope for this slice; see +// SCOPE NEGATIVE Tuple types below.) +// +// - REFERENCES (`&T`, `&mut T`, `'a` lifetime parameters) ↦ effect- +// typed parameter (structural Conj field), per THESIS:401 IN-B +// applied to Rust. A reference is NOT a separate behavior; it is +// a TYPE whose `kind: RustReferenceKind` and `lifetime: Symbol` +// fields are structural Conj coordinates. Memory access through +// a reference is a Transform whose operand type CARRIES the +// reference kind in its signature; the borrow-checker (T-13 +// ownership lens) READS that signature and validates well- +// scopedness as a structural property. This is EXACTLY the ptx +// IN-B precedent (`state_space: StateSpace` on RegisterScalar); +// references are Rust's analog of state-space tags. +// Tempting alternative: a `Borrow` behavior wrapping every `&T` +// formation. REJECTED — that would parallel-represent what the +// Transform's signature already says; the effect-typed parameter +// is the unannotated primitive (feedback_no_annotations). +// +// CONCLUSION. The type-system half of Rust's spec fits the existing +// substrate with no new connectives, no new behaviors, no parallel +// taxonomies. The classifiers declared below are the closed Rust-side +// surface; their composition with grammar productions (Owned +// ELSEWHERE) and inhabitance instance-values (Owned ELSEWHERE — rides +// D2) lands when those dependencies dissolve, with the I/O contract +// of THIS file immutable. +// +// SCOPE NEGATIVE (operator-tier, do not work around). +// - Tuple types (`(T₁, T₂, …)`, including the zero-tuple `()` / +// "unit"). Per the Rust Reference §types-tuple, tuples are their +// own type category — NOT primitive scalars. `()` is the zero- +// field TupleType (the single-inhabitant terminal type by +// CARDINALITY, not a scalar primitive). Modeling tuples requires +// a generic tuple-type carrier (Conj over `arity: Cardinality` +// and `components: List`), which composes over +// std/cardinality.dag's refinement substrate (T-3) when that +// lands. Until then `()` and tuple types in general are out-of- +// scope for this slice; emitting `()` as a literal Value is +// fine (it is a Value Node — the modeling notes' LITERAL/VALUE +// mapping says so) but the type carrier is deferred to the +// tuple-types substrate. +// (Corrected 2026-05-16 per BLOCKING operator review on PR +// #3174: the prior slice mis-classified `()` as a `Unit` variant +// of `RustScalar`. The Reference partitions it as a tuple, and +// INVARIANTS P1 modeling-faithfulness requires the substrate +// partition to ground in the spec partition. Removed from this +// slice; named for tuple-types substrate.) +// - The full Rust GRAMMAR production set (item declarations, +// expression syntax, pattern syntax, attribute syntax, macro +// syntax) is owned by the bundled T-4 LanguageModel shape — same +// framing as ptx's "warp-level intrinsics + tensor cores" +// scope-negative. Not authored here. +// - Rust async/await semantics (`async fn`, `.await`, `Future` +// trait). These compose over the type-system carriers declared +// here (an `async fn` returns a Future-typed value), but the +// coordination-effect typing is owned by extdeps/coordination.dag +// (T-4.8, IN-B carriers); not authored here. +// - Trait objects (`dyn Trait`), generic bounds (``), +// associated types — Rust's nominal generics + bounded +// polymorphism. Modeled at the LanguageModel grammar layer (T-4 +// bundled work); structural inhabitance against std/algebra.dag +// algebras rides D2. The reference Conj record below carries an +// opaque `lifetime: Symbol` field — that IS the generic-lifetime- +// parameter surface; richer trait-bound surfaces compose over the +// LanguageModel. +// - Const generics, type-level integers, `[T; N]` array length as a +// generic. Modeled at the LanguageModel layer; the `N` length +// surfaces as a bounded `Int` via std/cardinality.dag refinement +// when that lands. +// - `unsafe` blocks, raw pointers (`*const T` / `*mut T`), FFI. The +// `unsafe` surface is a STRUCTURAL boundary fact (the function / +// block's signature carries an `unsafe` discriminator); the +// ownership lens (T-13) reads that fact to admit operations the +// safe surface forbids. The discriminator carrier lands when +// T-13's brief is authored; not the rust-vocabulary layer. +// +// PRACTICE-4 LEDGER DISCIPLINE. Every closed-Disj carrier below +// carries the full 🟢/🟡/🔴 + all five patterns (Fact-placement / +// Variant-is-data / Algebraic-form / Dimensional / Parameterized- +// family-Practice-7) per modeling-discipline.md §4 (operator-ratified +// binding 2026-05-15, gate (b) — #3163 made the 4-pattern miss the +// proof case; do not omit Practice-7). Conj records carry no ledger +// (only coproducts dissolve); scaffold-residual Conj fields (RustCost +// raw Int components) carry a 🟡 bridge note mirroring std/diagnostic +// .dag's `Extent.ByteRange` and ptx.dag's `Dim3` / `PtxCost` +// precedent. + + +// ───────────────────────────────────────────────────────────────────── +// RustIntKind — the closed Rust signed-vs-unsigned integer kind. The +// Rust Reference §3.4 numeric-types-integer-types declares exactly +// two integer kinds: signed (i*) and unsigned (u*). Each integer +// scalar in Rust's spec is one of these. +// Spec: https://doc.rust-lang.org/reference/types/numeric.html +// +// - Signed — `i8` / `i16` / `i32` / `i64` / `i128` / `isize` +// (two's-complement signed integers) +// - Unsigned — `u8` / `u16` / `u32` / `u64` / `u128` / `usize` +// (unsigned modular integers) +// +// CLOSED (C1 stop-signal). A third integer kind (e.g. a saturating- +// integer family distinct from the existing wrapping `Wrapping` +// library type) is an edit to THIS declaration routed to operator +// ratification under the L-2 pin discipline (a future Reference +// revision modifying the integer kind partition is a visible diff, +// never a silent extension). The `Wrapping` / `Saturating` +// library types are LIBRARIES (per L-2, a library is just a program +// in the modeled language = Node), NOT additional integer kinds. +// +// Coproduct dissolution (Practice 4 / modeling-discipline.md §4) — +// 🟢 GREEN (terminal). Ledger — five patterns attempted: +// 1. Fact placement — FAILS: every integer-scalar consumer (the +// Rust `LanguageModel` grammar's integer-literal production, +// the per-target cost-realization for integer ops, the +// eventual inhabitance walk for Semiring-vs-OrderedRing +// dispatch) reads the kind tag uniformly; shared classifier, +// not a per-consumer scattered fact. +// 2. Variant-is-data — FAILS: nullary tags from a closed +// Reference-defined set. A `{ signed: Bool }` proxy replaces a +// closed 2-valued exhaustive sum with an unbounded Bool — and +// while Bool is 2-valued, the Bool proxy ALSO admits the read +// "is the integer kind 'true' or 'false'?" — exactly the M4 +// "closed sets are enums, not numeric/boolean proxies" smell. +// The enum IS the faithful form. +// 3. Algebraic form — PARTIAL: each kind grounds in a std/algebra +// structure (Signed → OrderedRing, Unsigned → Semiring — minus +// negate). That grounding IS the inhabitance walk owned by +// std/integer.dag per P2 (and rides D2 + T-3 per "Owned +// ELSEWHERE"); the kind enum itself stays a closed classifier. +// The "kind → algebra" map is the future inhabitance walk, not +// a richer std/ source to collapse this enum INTO. +// 4. Dimensional — FAILS: a single Rust integer type has EXACTLY +// ONE kind; `i32` is signed, `u32` is unsigned, the Reference +// admits no "both" type. Mutually-exclusive alternatives, not +// simultaneous coordinates. (Kind × Width is the Cartesian +// product on RustIntScalar's IntScalar variant — that is the +// dimensional model.) +// 5. Parameterized family — FAILS: Signed and Unsigned are the +// Rust Reference's integer-kind partition; they are NOT one +// generic `F` / projection over a separately-declared source +// set (Practice 7). One could attempt `IntKind` parameterized over a 2-element algebra +// subset, but the partition is the spec's irreducible +// kind-distinction, not a mechanical copy of a richer set. +// Terminal: the closed two-way Rust integer-kind partition; a 3rd is +// the C1 stop-signal (a visible ratified edit to this declaration, +// STRUCTURE.md commitment #1). +type RustIntKind + = Signed + | Unsigned + + +// ───────────────────────────────────────────────────────────────────── +// RustIntWidth — the closed Rust integer bit-width classifier. The +// Rust Reference §3.4 admits exactly six widths in the stable spec +// (each available in both Signed and Unsigned kind, except Pointer +// which is platform-dependent and reads the host machine's +// pointer-width per std/machine.dag). +// Spec: https://doc.rust-lang.org/reference/types/numeric.html +// +// - Bits8 — `i8` / `u8` (1-byte integers) +// - Bits16 — `i16` / `u16` (2-byte integers) +// - Bits32 — `i32` / `u32` (4-byte integers; the Rust idiomatic +// default integer width) +// - Bits64 — `i64` / `u64` (8-byte integers) +// - Bits128 — `i128` / `u128` (16-byte integers) +// - Pointer — `isize` / `usize` (platform pointer-sized integers; +// the host's pointer-width per +// std/machine.dag PointerWidth) +// +// CLOSED (C1 stop-signal). A 256-bit width is an edit to THIS +// declaration under the L-2 pin discipline (a future Reference +// revision adding an integer width is a visible diff). +// +// Pointer is STRUCTURALLY distinct from the fixed bit-counts — it +// reads the host machine's pointer-width per STRUCTURE.md's +// PointerWidth platform-dependence rule (commitment #2 referenced +// indirectly: scalar widths declare their platform-dependence +// structurally, not as an annotation). When std/machine.dag's +// PointerWidth carrier lands (T-3 wave A3 dependency cited in +// "Owned ELSEWHERE"), Pointer-width Rust integers resolve through +// it; pre-T-3 the Pointer variant is the declared SURFACE that the +// resolution will plug into. This is NOT a "scaffold" 🟡 bridge — +// the variant is the terminal form; only its dependent inhabitance +// rides T-3. +// +// Coproduct dissolution (Practice 4 / modeling-discipline.md §4) — +// 🟢 GREEN (terminal). Ledger — five patterns attempted: +// 1. Fact placement — FAILS: every integer-scalar consumer reads +// the width to size representations (emission of `i32` vs +// `i64`; per-target cost-realization sizes); shared +// classifier, not scattered. +// 2. Variant-is-data — FAILS: a `{ bits: Int }` proxy +// (8/16/32/64/128/) replaces a closed 6-valued +// exhaustive sum with an unbounded Int (bits=42 +// representable), AND fails to express Pointer's platform- +// dependence as a structural fact (it would force a single +// concrete bit-count at decl time). The widths are NOT free +// Int values; they are the Rust-Reference-admitted subset, so +// a free-Int carrier would ratify illegal widths (the +// INVARIANTS P2 illegal-states-unrepresentable shape, same as +// ptx.dag RegisterWidth). +// 3. Algebraic form — partially N/A: the bit-counts form an +// ordered set (8 < 16 < 32 < … with Pointer ∈ {32, 64} on +// common targets), but the ORDER is derived FROM the closed +// enum (and Pointer's value reads machine.dag), not a richer +// source — pointing to a `Lattice` would +// parallel-represent the enumeration the order is defined +// over (algebra.dag U1 engine-debt smell). +// 4. Dimensional — FAILS: a single typed integer has EXACTLY ONE +// width; mutually-exclusive alternatives. The kind × width +// Cartesian product lives on RustScalar's IntScalar variant +// (Disj-with-payload), not on this enum. +// 5. Parameterized family — FAILS: the six widths are the Rust +// Reference's stable-integer-width set; they are NOT one +// generic `F` / projection over a separately-declared +// source set (Practice 7). The bit-count itself IS the +// discriminant for the fixed variants; Pointer is a +// DIFFERENT-SHAPED variant (platform-dependent, not a fixed +// count) — they are not all `F`. A richer +// machine-width source would be std/machine.dag's +// MachineWidth, but that source is the inhabitance walk's +// target (Compose>), not a +// collapsing source for this enum. +// Terminal: the closed six-way Rust integer-width classifier for the +// pinned Rust Reference; a 7th is the C1 stop-signal. +type RustIntWidth + = Bits8 + | Bits16 + | Bits32 + | Bits64 + | Bits128 + | Pointer + + +// ───────────────────────────────────────────────────────────────────── +// RustFloatWidth — the closed Rust floating-point bit-width +// classifier. The Rust Reference §3.4 numeric-types-floating-point +// stable spec admits exactly two widths (both IEEE-754 binary +// formats); f16 and f128 exist in the Reference as UNSTABLE feature +// gates and are NOT part of the pinned stable spec this file models +// (they are a visible C1 edit when they stabilize, never a silent +// extension). +// Spec: https://doc.rust-lang.org/reference/types/numeric.html +// +// - Bits32 — `f32` (IEEE-754 binary32 single-precision) +// - Bits64 — `f64` (IEEE-754 binary64 double-precision; the Rust +// idiomatic default float width) +// +// CLOSED (C1 stop-signal). f16 / bf16 / f128 stabilization is an +// edit to THIS declaration under the L-2 pin discipline. +// +// Coproduct dissolution (Practice 4 / modeling-discipline.md §4) — +// 🟢 GREEN (terminal). Ledger — five patterns attempted: +// 1. Fact placement — FAILS: every float-scalar consumer reads the +// width to size representations (emission of `f32` vs `f64`; +// cost-realization for floating-point ops); shared classifier, +// not scattered. +// 2. Variant-is-data — FAILS: a `{ bits: Int }` proxy (32/64) +// replaces a closed 2-valued exhaustive sum with an unbounded +// Int — and floating-point widths are NOT free Int values; +// they are the IEEE-754-binary-format-admitted subset Rust +// stabilizes, so a free-Int carrier would ratify illegal +// widths (P2 illegal-states-unrepresentable; the same shape +// as RustIntWidth's argument). +// 3. Algebraic form — N/A by construction: the two widths +// structurally inhabit the SAME algebra (std/algebra.dag +// `ApproximateField` per the rounding-aware framing — +// INVARIANTS:43, std/float.dag scaffold's anchor); they do +// not partition into distinct algebraic structures (`f32` and +// `f64` are both ApproximateFields, only the precision +// differs). No richer std/ source to collapse the enum INTO. +// 4. Dimensional — FAILS: a single typed float has EXACTLY ONE +// width; mutually-exclusive alternatives. (Rust does not +// admit `f32 ⊓ f64` as a hybrid type.) +// 5. Parameterized family — FAILS: the two widths are the Rust- +// stable-IEEE-754-binary-format set; they are NOT one generic +// `F` / projection over a separately-declared source set +// (Practice 7). A richer IEEE-754 source (the full +// binary16/32/64/128 set) is the spec's universe, but Rust +// admits only the binary32/64 subset stably — the choice of +// "which widths Rust stabilizes" is the partition discriminant, +// not a parameterization of a richer source set. +// Terminal: the closed two-way Rust stable-float-width classifier. +type RustFloatWidth + = Bits32 + | Bits64 + + + +// ───────────────────────────────────────────────────────────────────── +// RustScalar — a typed Rust primitive-scalar value: kind × (width if +// applicable). Disj sum with NAMED-FIELD VARIANT PAYLOADS so that +// the kind × width admissibility is STRUCTURALLY ENFORCED — Bool / +// Char / Str / Never carry no width payload, so "Bool with width= +// Bits32" is unrepresentable (not "rejected by a check" — +// unrepresentable, the INVARIANTS P2 illegal-states-unrepresentable +// shape, the same design choice node.dag took with EdgeLabel's +// `Positional` and algebra.dag took with the Field type's omitted +// total `reciprocal`). +// +// - IntScalar — { kind: RustIntKind, width: RustIntWidth } +// e.g. IntScalar { kind: Signed, width: Bits32 } +// is Rust's `i32`; IntScalar { kind: Unsigned, +// width: Pointer } is `usize`. +// - FloatScalar — { width: RustFloatWidth } +// e.g. FloatScalar { width: Bits64 } is `f64`. +// - BoolScalar — Rust's `bool` (the two-valued type — there is +// no width variant; the Reference does not expose +// bool's storage width as a discriminator). +// - CharScalar — Rust's `char` (Unicode scalar value; the +// 32-bit representation is internal storage, not +// a kind-level discriminator the Reference +// exposes). +// - StrScalar — Rust's `str` (UTF-8 unsized string slice; +// Reference §3.5 textual-types). A DYNAMICALLY- +// SIZED TYPE (DST) per Reference §dynamically- +// sized-types — legal in any DST context: behind +// reference types (`&str` / `&mut str`); behind +// pointer types (`*const str` / `*mut str` / +// `Box` / `Rc` / `Arc`); as +// `?Sized` type parameters / associated types; +// as the final field of a struct. References are +// the most common context but not the only valid +// one. The unsized / DST property is a STRUCTURAL +// Rust fact; there is no kind-level width or sub- +// discriminator on str itself). +// - NeverScalar — Rust's `!` (Reference §3.6 never-type; empty- +// inhabitance type. No width, no kind sub- +// discriminator; its empty-cardinality is the +// grounding fact, deferred to std/cardinality +// .dag's empty-cardinality carrier per "Owned +// ELSEWHERE"). +// +// `()` (the zero-tuple Unit type) is DELIBERATELY NOT a variant of +// this Disj: per Reference §3.10 it is a TupleType, not a primitive +// scalar. See SCOPE NEGATIVE Tuple types in the header. +// Spec: https://doc.rust-lang.org/reference/types.html +// Per-variant spec URLs: +// Bool / BoolScalar: https://doc.rust-lang.org/reference/types/boolean.html +// Int / IntScalar: https://doc.rust-lang.org/reference/types/numeric.html +// Float / FloatScalar: https://doc.rust-lang.org/reference/types/numeric.html +// Char / CharScalar: https://doc.rust-lang.org/reference/types/textual.html +// Str / StrScalar: https://doc.rust-lang.org/reference/types/textual.html +// Never / NeverScalar: https://doc.rust-lang.org/reference/types/never.html +// (this Disj is the +// typed-value carrier composing kind × width over those.) +// +// The structural argument for the Disj-with-payloads (vs ptx's +// Conj-record `RegisterScalar { kind, width, state_space }`): in +// PTX every typed register has a (kind, width, state_space), so +// the three-coordinate Conj is the natural form. In Rust, the +// six scalar kinds have DIFFERENT structural shapes — Int has +// (kind, width), Float has (width), Bool/Char/Str/Never have +// nothing beyond the kind. A Conj record `{ kind, width? }` would +// force a width Option for Bool/Char/Str/Never, ratifying the +// illegal state "Bool with width=Bits32" — exactly the M4 / +// Practice-2/6 / P2 pattern those disciplines structurally forbid. +// The Disj-with-payloads is the dissolved form: each variant +// carries EXACTLY the structural data its kind admits, and no +// illegal kind×width combination is constructible. +// +// ROLE under the RATIFIED D2 resolver (DECISIONS.md D2 row, commit +// 44a37ad46, via PR #3195 merge 2026-05-16). RustScalar is the +// PARSE-STAGE SOURCE-SYNTAX CLASSIFIER for Rust's six-way scalar +// partition — the closed Disj that captures Reference §3.3-§3.6's +// kind×width-or-not surface shape. It is NOT the inhabitance +// carrier. Per the ratified D2a three-thin-facts form, primitive +// inhabitance + grounding land via: +// (1) alias-identity to the std/ carrier +// (`type RustI32 = Int32` — algebra inhabitance flows through +// the alias per the `List = FreeMonoid` precedent; +// Node identity, machine-readable); +// (2) grounding map (`data rust_i32_grounding: GroundingMap +// = GroundingMap { spelling: "i32" }`); +// (3) per-language operation-semantics carriers (OverflowDisposition +// for integers; NaN/Inf handling for floats). +// See the D2 resolver block at the carrier declarations below for +// the canonical form contract. The earlier pre-ratification framing +// of this seam ("when D2 lands, per-variant inhabitance lands in +// this file with these typed variants as their carriers — IntScalar +// is the carrier for Rust's i32 inhabitance into OrderedRing") is +// SUPERSEDED — that shape was the parallel-substrate per-language +// `data rust_: OrderedRing` inhabitance the D2 row +// (D2.2 + INVARIANTS P1:42 `numeric_aliases_align_to_refinements`) +// explicitly forbids. RustScalar variants are NOT carriers for +// algebra inhabitance; the alias-identity targets (`Int32`, +// `Float32`, `Bool`, etc.) ARE, via the kernel-ambient / std/ +// algebra structures attached to them. Per BLOCKING reviewer +// 2026-05-16T20:45:01Z (openai-pro REQUEST_CHANGES on sha:dfb9464e): +// unreconciled seam prose contradicting the ratified resolver +// shape would mislead downstream workers into the superseded +// per-variant-inhabitance path. +// +// Coproduct dissolution (Practice 4 / modeling-discipline.md §4) — +// 🟢 GREEN (terminal). Ledger — five patterns attempted: +// 1. Fact placement — FAILS: every Rust-typed value consumer +// (literal parsing, expression typing, emission to source, +// cost-realization, eventual inhabitance dispatch) reads the +// scalar's kind + width-if-applicable through this carrier; +// shared, not scattered. +// 2. Variant-is-data — FAILS: collapsing the variants to a +// uniform record `{ kind: , width: Option<…> }` +// reintroduces the illegal state "Bool with width=Bits32" +// this Disj-with-payloads design exists to forbid. The +// six-variant Disj IS the dissolved form (P2 + Practice +// 2/6 + M4). Such a separate `kind` enum would ALSO be a +// P2 duplicate-authority partition over the same six kinds +// this Disj already partitions on (the prior `RustScalarKind` +// enum landed in an earlier iteration and was deleted per +// Practice 7 / P2 — see header Owns block). +// 3. Algebraic form — PARTIAL: each variant grounds in a std/ +// algebra or cardinality structure (IntScalar → OrderedRing +// / Semiring per RustIntKind; FloatScalar → +// ApproximateField; BoolScalar → BooleanAlgebra; CharScalar +// → Cardinality refinement on Int32 (the surrogate-excluded +// Unicode scalar value subset); StrScalar → FreeMonoid +// per std/text.dag's UTF-8 framing; NeverScalar → empty +// cardinality (the absurd-inhabitance type)). That grounding +// IS the inhabitance walk owned ELSEWHERE per P2; the Disj +// structure here is the closed surface, not a collapsing +// target. +// 4. Dimensional — FAILS: a single Rust scalar value IS EXACTLY +// ONE variant of this Disj; mutually-exclusive alternatives. +// The shapes differ across variants (IntScalar carries two +// coordinates; FloatScalar one; the rest none) — they cannot +// be coordinates of a single record without the illegal-state +// smell. +// 5. Parameterized family — FAILS: the six variants are NOT one +// generic `F` / projection over a separately-declared +// source set (Practice 7). The PTX RegisterScalar pattern +// (Conj-record over (kind, width, state_space)) was projection- +// uniform; Rust scalars are NOT projection-uniform — they +// have heterogeneous structural shapes (the kind partitions +// across structurally-distinct value spaces, with three +// distinct algebraic groundings + a cardinality refinement + +// an empty-cardinality). The Disj-with-heterogeneous-payloads +// is the irreducible faithful form. +// Terminal: the closed six-variant Rust primitive-scalar typed-value +// sum; illegal kind×width combinations are unrepresentable by +// construction; `()` is TupleType (Reference §3.10), out-of-scope +// for this slice. +type RustScalar + = IntScalar { kind: RustIntKind, width: RustIntWidth } + | FloatScalar { width: RustFloatWidth } + | BoolScalar + | CharScalar + | StrScalar + | NeverScalar + + +// ───────────────────────────────────────────────────────────────────── +// RustReferenceKind — the closed Rust reference-kind classifier. The +// Rust Reference §types-reference admits exactly two reference kinds +// (the borrow-kind partition that the borrow checker enforces): +// Spec: https://doc.rust-lang.org/reference/types/pointer.html +// +// - Shared — `&T` shared / immutable reference; multiple +// concurrent shared references to the same +// place are admitted; the referent is +// read-only through the reference. +// - Exclusive — `&mut T` exclusive / mutable reference; at most +// one exclusive reference to a given place +// exists at a time, and no shared reference +// coexists; the referent is read-write +// through the reference. +// +// CLOSED (C1 stop-signal). A third reference kind (e.g. a `&pin T` +// distinct from the existing `Pin<&T>` library wrapper) would be an +// edit to THIS declaration under the L-2 pin discipline. `Pin<&T>` +// itself is a LIBRARY (per L-2, libraries are just programs in the +// modeled language = Node), NOT a third reference kind. +// +// IN-B SEAM (effects intrinsic to the type signature, THESIS:401). +// The RustReference Conj record below ATTACHES this kind to an +// opaque lifetime Symbol, making the reference a structural Conj +// field on a typed value (the same shape as ptx.dag's +// `state_space: StateSpace` on RegisterScalar). The OWNERSHIP LENS +// (lens/ownership.dag, T-13) READS this field from typed +// signatures; the borrow-checker rules are a STRUCTURAL property +// of the signature, not a parallel ownership taxonomy. +// +// Coproduct dissolution (Practice 4 / modeling-discipline.md §4) — +// 🟢 GREEN (terminal). Ledger — five patterns attempted: +// 1. Fact placement — FAILS: every reference-bearing-typed-value +// consumer (the ownership lens, the emission of `&` vs `&mut`, +// the borrow-aliasing check) reads the kind tag uniformly; +// shared classifier, not scattered. +// 2. Variant-is-data — FAILS: a `{ mutable: Bool }` proxy +// replaces a closed 2-valued exhaustive sum with an unbounded +// Bool (the same M4 smell as RustIntKind's signed-vs-unsigned), +// AND conflates the BINDING-LEVEL mutability axis (`let mut`) +// with the TYPE-LEVEL reference-kind axis (`&mut`) — those are +// structurally distinct in the Rust Reference (place +// expressions vs reference types). The enum IS the faithful +// form on the reference-kind axis. +// 3. Algebraic form — N/A by construction: the two reference +// kinds do not trace to a richer std/ algebraic structure +// (Shared / Exclusive are the borrow-kind partition; they +// are not Lattice-ordered or algebra-inhabiting in their own +// right — the algebras are on the REFERENT type, not the +// reference). No richer std/ source. +// 4. Dimensional — FAILS: a single Rust reference has EXACTLY +// ONE kind; `&T` and `&mut T` are alternatives, never +// simultaneous coordinates (Rust forbids the co-existence at +// runtime — that IS the borrow-checker's exclusivity rule). +// 5. Parameterized family — FAILS: Shared / Exclusive are the +// Rust borrow-kind partition; they are NOT one generic +// `F` / projection over a separately-declared source set +// (Practice 7). The kinds correspond to STRUCTURALLY DISTINCT +// aliasing disciplines (many-reader-no-writer vs one-writer- +// no-reader) — they are not projection-uniform over any +// richer source. +// Terminal: the closed two-way Rust reference-kind partition; the +// borrow-checker's structural exclusivity invariant is what +// distinguishes the two, not a property the enum compresses. +type RustReferenceKind + = Shared + | Exclusive + + +// ───────────────────────────────────────────────────────────────────── +// NamedSegment — a module-identifier path segment. Conj record (no +// Practice-4 ledger). +// +// - id the segment's identifier (an opaque K-1 Symbol; the +// spelling `outer_mod` / `inner_mod` etc. lives in the +// boundary intern table, never readable from kernel / +// lens code per node.dag:70-86) +// +// Used inside `PubInPath.resolved_path` (the absolute path from +// crate root) for module-qualified visibility paths like +// `pub(in crate::outer_mod::inner_mod)`. +// Spec: https://doc.rust-lang.org/reference/paths.html +type NamedSegment { + id: Symbol +} + + +// ────────────────────────────────────────────────────────────────── +// PubInPath — a typed Rust `pub(in path)` resolved-scope carrier. +// Conj record (no Practice-4 ledger). +// +// CANONICAL SHAPE: an ABSOLUTE PATH FROM CRATE ROOT, expressed as a +// `List`. Empty list `[]` denotes the crate root itself +// (equivalent to `pub(crate)`); a non-empty list `[A, B, ...]` denotes +// the module at `crate::A::B::...`. +// +// 🟡 SCAFFOLD — producer-obligation enforcement of the ancestor- +// resolution invariant (openai-pro/gpt-5.5-pro REQUEST_CHANGES +// 2026-05-16T13:24:03Z). The TYPE structurally enforces only the +// SHAPE (a List of NamedSegments, each carrying an opaque Symbol id); +// it does NOT enforce the SEMANTIC properties Rust's +// `pub(in path)` requires: that the resolved_path's segments name +// real modules, that those modules form an existing chain from crate +// root, and that the target module is a STRICT ANCESTOR of the +// declaring item (not the current module — which is Private — and +// not a non-ancestor — which is parse-rejected). Those semantic +// invariants live in the parser/resolver's contract; the carrier +// has no module-tree substrate to ground them structurally yet. +// Three bridge properties (same pattern as Dim3 / RustCost / +// SuperHops): +// (a) scaffold doc — THIS note. The carrier is a post-resolution +// canonical form expressed as the resolved absolute path; the +// resolver pre-validates module-resolution + strict-ancestor- +// relation before constructing PubInPath. +// (b) bounds on use — producers (parser / resolver) MUST verify: +// (i) every NamedSegment.id resolves to a real module in the +// defining crate; (ii) the resolved_path forms a valid +// descent from crate root through actual module containment; +// (iii) the target module is a strict ancestor of the +// declaring item. Failing any check → Diagnostic upstream, not +// a PubInPath value. The carrier represents only validated +// post-resolution scopes. +// (c) dissolution trigger — when std/ exposes a typed MODULE-TREE +// carrier (a Module-Node type with ancestor-relation Witness +// and module-existence Witness facts), PubInPath collapses to +// a refined `{ target: ModuleRef, ancestor_proof: Witness<...> }` +// form where the semantic invariants are TYPE-LEVEL. That +// module-tree substrate is a future-substrate question +// (likely co-temporal with the bundled T-4 LanguageModel +// grammar productions when those land, since the resolver +// needs to consume them); it is NOT modeled in this slice. +// +// What IS type-enforced today (the shape-level claims): +// - PubInPath has exactly one field; producers can't structurally +// forget the resolved_path. +// - NamedSegment is closed-record-with-one-field; producers can't +// structurally include extra coordinates per segment. +// - Same resolved_path List value = same PubInPath value at the +// SHAPE level (Lists are structurally equal when their elements +// are equal; opaque Symbol id equality is K-1-discipline). +// Single-authority THIS layer: the canonical-form discipline. +// +// What IS NOT type-enforced today (the producer-obligation claims): +// - That resolved_path names a real module that exists in the +// defining crate. +// - That the target module is a strict ancestor of the declaring +// item. +// - That the resolved_path's segments form a valid descent through +// actual module containment (vs an arbitrary sequence of opaque +// Symbols). +// +// The earlier doc-comment claim that this carrier is "P2 enforced +// structurally" overstated what the type system actually does — the +// shape is enforced structurally, but the semantic ancestor-validity +// is producer-obligated until the module-tree substrate lands. This +// 🟡 SCAFFOLD framing is the honest acknowledgment. +// +// (Corrected 2026-05-16 per openai-pro/gpt-5.5-pro BLOCKING review +// 2026-05-16T08:36:04Z. Prior head-rooted shape +// `{ root: PubInRoot, suffix: List }` with PubInRoot = +// AtCrate | AtSuperChain admitted TWO structural values for the SAME +// resolved scope: `pub(super)` for an item in `crate::a::b` would +// canonicalize to `PubInPath { root: AtSuperChain { hops: OneSuper }, +// suffix: [] }` while `pub(in crate::a)` for the same item would +// canonicalize to `PubInPath { root: AtCrate, suffix: [a] }` — both +// denoting the parent-module scope. Same resolved scope, two +// structural authorities = P2 violation. The earlier SuperHops + +// PubInRoot carriers were SOURCE-SPELLING artifacts — absolute-from- +// crate vs relative-from-current — not canonical forms. Per the +// openai-pro finding: the canonical carrier should key the resolved +// module once, not preserve absolute-vs-relative source spelling in +// the canonical value. Refactored to a single absolute-path-from- +// crate-root form; SuperHops + PubInRoot deleted as non-canonical. A +// future slice may want a separate pre-resolution syntactic carrier +// for IDE / diagnostic-span use cases; that lives alongside this one, +// not in place of it.) +// +// - resolved_path the absolute path FROM CRATE ROOT to the +// visibility-restriction module. Empty = crate +// root (= `pub(crate)`); `[a]` = `crate::a`; +// `[a, b, c]` = `crate::a::b::c`. The parser/ +// resolver canonicalizes every valid `pub(in +// )` source form to its absolute +// path before constructing this carrier. +// +// Reference's invalid-path cases — empty source path; non-ancestor +// modules; the SimplePath resolving to the item's current module +// (which is no-modifier visibility, canonicalizes to Private, not +// PubIn) — are parse/resolver-rejected or canonicalized upstream; +// the carrier represents only validated post-resolution scopes (per +// the producer-obligation bridge above). Same-resolved-scope ⇒ +// same-resolved_path-List is a SHAPE-LEVEL property; same-resolved- +// scope ⇒ same-canonical-RustVisibility-value depends on the +// resolver computing the same absolute path for every source form +// that points at the same module (producer-side, awaiting the +// module-tree substrate to make it type-level). +// Spec: https://doc.rust-lang.org/reference/visibility-and-privacy.html +type PubInPath { + resolved_path: List +} + + +// ───────────────────────────────────────────────────────────────────── +// PubInPath is POST-RESOLUTION canonical form (codex BLOCKING review +// 2026-05-16T06:26:18Z made this explicit). +// +// The Rust Reference SimplePath grammar admits multiple SOURCE forms +// that resolve to the same VISIBILITY SCOPE. PubInPath represents the +// post-canonicalization scope, NOT the source-path syntax. The parser / +// resolver is responsible for normalizing source forms into the +// canonical PubInPath / Private values before constructing +// RustVisibility. The carrier shape itself only admits canonical forms; +// non-canonical source paths cannot be constructed at all. +// +// Canonicalization rules (parser/resolver-side, per Reference's +// path-resolution rules): +// +// SOURCE FORM → CANONICAL RustVisibility +// ───────────────────────────────────────────────────────────────── +// → Private +// `pub(self)` → Private (Reference equivalence) +// `pub(in self)` → Private (Reference equivalence) +// `pub` → Pub +// `pub(crate)` / `pub(in crate)` → PubIn { path: +// PubInPath { resolved_path: [] } } +// (empty absolute path = crate root) +// — APPLIES ONLY when the item is +// declared in a STRICT DESCENDANT +// of the crate root (i.e. inside +// some `crate::a::b::…` module). +// For an item declared AT THE +// CRATE ROOT itself (top-level +// item in `lib.rs` / `main.rs`), +// the crate-root visibility scope +// coincides with the no-modifier +// scope: Private = "defining +// module + descendants" = "crate +// root + all of crate" = same as +// pub(crate). For crate-root items, +// `pub(crate)` canonicalizes to +// `Private` (single authority for +// the no-modifier scope). This is +// the same context-dependent rule +// as the `pub(in )` +// reflexive-ancestor case, applied +// to the crate-root-as-current- +// module special case (operator +// BLOCKING 2026-05-16T08:36:04Z + +// openai-pro REQUEST_CHANGES +// 2026-05-16T09:27:05Z). +// `pub(in )` → the resolver computes the +// ABSOLUTE PATH from crate root to +// the module the SimplePath +// resolves to, then: +// — resolved module IS a STRICT +// ancestor of the item → +// PubIn { path: PubInPath { +// resolved_path: +// +// } } +// — resolved module IS the item's +// current module (reflexive +// ancestor) → +// Private (the no-modifier +// scope; same canonical form +// as `pub(self)` / no-modifier +// per Reference equivalence) +// — resolved module is NOT an +// ancestor of the item → +// parse/resolver REJECTS +// (per Reference's ancestor +// rule for `pub(in path)`) +// Concretely, for an item declared +// in `crate::a::b::c`: +// `pub(super)` → +// resolves to `crate::a::b` +// → PubIn { path: PubInPath { +// resolved_path: [a, b] } } +// `pub(super::super)` → +// resolves to `crate::a` +// → PubIn { path: PubInPath { +// resolved_path: [a] } } +// `pub(in crate::a)` → +// resolves to `crate::a` +// → PubIn { path: PubInPath { +// resolved_path: [a] } } +// (SAME canonical value as +// `pub(super::super)` — single +// authority per resolved scope) +// `pub(in crate::a::b::c)` → +// resolves to current module +// → Private (reflexive case) +// `pub(in self::super)` → +// resolves to `crate::a::b` +// → SAME as `pub(super)` +// `pub(in crate::other)` → +// not an ancestor → REJECTED +// `pub(in $crate::…)` (macro → out-of-scope for this slice +// context) (SCOPE NEGATIVE per the header; +// hygienic-macro support is a +// future C1 edit to NamedSegment / +// a sibling macro-context carrier). +// +// SINGLE-AUTHORITY INVARIANT (BLOCKING operator review 2026-05-16T07: +// 30:48Z + openai-pro REQUEST_CHANGES 2026-05-16T08:36:04Z). Multiple +// source forms with the SAME resolved module MUST canonicalize to the +// SAME RustVisibility value. The absolute-path-from-crate-root form +// makes this STRUCTURALLY enforced: there is exactly ONE +// `List` per module under crate. The resolver does the +// path-resolution work (walk up super-chains, look up self-prefix +// paths, etc.) before constructing PubInPath; the carrier doesn't +// distinguish source-spelling variants because there's no place to +// put that distinction. +// +// The carrier provides the destination type; the parser/resolver +// provides the canonicalization. Source-syntax modeling for IDE / +// diagnostic-span use cases is an explicit future-substrate question +// — a separate pre-resolution syntactic carrier would live alongside +// PubInPath, not in place of it. + + +// ───────────────────────────────────────────────────────────────────── +// RustVisibility — the closed Rust item-visibility classifier. The +// Rust Reference §visibility-and-privacy partitions item visibility +// into TWO fundamental forms — unrestricted (`pub`) and path- +// restricted (`pub(in SimplePath)`) — with `pub(crate)` / `pub(self)` +// / `pub(super)` as syntactic CONVENIENCE FORMS of the latter +// (Reference: "`pub(crate)` is the same as `pub(in crate)`. `pub(super)` +// is the same as `pub(in super)`. `pub(self)` is the same as +// `pub(in self)` AND is the same as not using `pub` at all"). The +// faithful structural partition is therefore THREE variants — the +// absent / unrestricted / path-restricted axis — with the path- +// restricted variant CARRYING its SimplePath as a head-rooted +// `PubInPath { resolved_path: List }` (declared above +// this type). The carrier is keyed by the ABSOLUTE PATH FROM CRATE +// ROOT to the resolved ancestor module — ONE canonical PubInPath +// value per resolved scope at the SHAPE level (List equality on +// Symbol elements); SEMANTIC-level enforcement (real-module-ness, +// strict-ancestor, end-to-end same-resolved-scope canonicalization) +// is producer-obligation 🟡 scaffold per PubInPath's bridge note +// (declared above this type) — pending the module-tree substrate. +// Reference-invalid path-qualifier orderings are upstream parse- +// rejected by the resolver before construction. All valid source +// forms (`pub(self)` / `pub(in self)` / no-modifier / `pub(crate)` / +// `pub(in crate)` / `pub(super)` / `pub(in super::…)` / `pub(in +// self::super::…)` / `pub(in )`) canonicalize to either +// Private (if resolved scope is the item's current module) or PubIn +// { path: PubInPath { resolved_path: } } +// (if resolved scope is a strict ancestor) per the canonicalization +// rules table below the PubInPath declaration. Multiple source forms +// with the SAME resolved scope produce the SAME canonical value. +// Per BLOCKING reviews 2026-05-16T05:06:51Z / 06:26:18-19Z / +// 07:30:47-48Z / 08:36:04Z (openai-pro REQUEST_CHANGES). +// Spec: https://doc.rust-lang.org/reference/visibility-and-privacy.html +// +// - Private — items without a `pub` modifier (the Rust default; +// visible only within the defining module and its +// descendants per the privacy rules). PER REFERENCE +// EQUIVALENCE: this variant is ALSO the canonical +// representation of `pub(self)` and `pub(in self)` +// (the Reference states all three are the same +// visibility). The three source forms (no-modifier, +// `pub(self)`, `pub(in self)`) ALL canonicalize to +// THIS variant — STRUCTURALLY: PubInPath carries an +// absolute-from-crate-root path; the resolver +// canonicalizes any source form whose resolved +// module IS the item's current module to Private +// (not PubIn). One canonical representation per +// resolved scope; the no-modifier scope has exactly +// one structural form: Private. +// - Pub — `pub` publicly visible (no restriction +// beyond the defining crate's API surface) +// - PubIn { path: PubInPath } +// — `pub(in SimplePath)` — visible to the module at +// the resolved SimplePath. The path is +// `PubInPath { resolved_path: List }` +// (declared above this type) — an ABSOLUTE PATH FROM +// CRATE ROOT. Empty resolved_path denotes the crate +// root itself (= `pub(crate)`); non-empty denotes +// the module at `crate::::::…`. +// Canonical examples (for an item in `crate::a::b::c`): +// `pub(crate)` → `PubIn { path: { resolved_path: [] } }`; +// `pub(super)` → `PubIn { path: { resolved_path: [a, b] } }`; +// `pub(super::super)` → `PubIn { path: { resolved_path: [a] } }`; +// `pub(in crate::a)` → SAME as `pub(super::super)` +// (same resolved scope → same canonical value). +// Source-syntax variants pointing at the SAME resolved +// module produce the SAME canonical PubInPath value at +// the SHAPE level (the absolute-from-crate-root shape +// structurally collapses source spellings into one +// List); SEMANTIC-level enforcement (that +// the absolute path is actually computed correctly by +// the resolver) is producer-obligation 🟡 scaffold per +// PubInPath's bridge note. Reference-invalid path- +// qualifier orderings (a non-ancestor resolved module; +// an empty SimplePath) are parse/resolver-rejected +// before construction. Self-prefixed +// source forms (`pub(in self::super)`, etc.) resolve +// via name-resolution to their absolute ancestor path +// before construction; the carrier doesn't see the +// source-spelling prefix. `pub(self)` / `pub(in self)` +// / `pub(in )` all canonicalize +// to Private (the no-modifier scope; one canonical +// representation). +// +// (Corrected 2026-05-16 per THREE BLOCKING reviews on PR #3174: +// 1. Prior 4-way partition `Private | Crate | Super | Pub` dropped +// the `pub(in SimplePath)` path fact (P1 + P2 violation). +// 2. Folding ALL `pub(in path)` syntactic forms into a +// `PubIn { path: List }` included `pub(in self)` / +// `pub(self)` — both Reference-equivalent to NO-MODIFIER +// (Private), so the model admitted TWO authorities for the +// same visibility scope: `Private` AND +// `PubIn { path: [self-symbol] }` (P2 violation). +// 3. The remediation in fix 2 documented the invariant as a +// producer obligation only (`rust_visibility_well_formed` +// noop fn / doc-comment) — but the structural state +// `PubIn { path: [self-symbol] }` was still CONSTRUCTIBLE +// (codex REQUEST_CHANGES 2026-05-16T02:51:57Z: "the +// single-authority rule for pub(self)/pub(in self) vs Private +// is not structurally enforced by the model being introduced +// here"). The illegal-states-unrepresentable discipline +// (Practices 2 & 6) requires STRUCTURAL enforcement. +// 4. The first round-3 correction introduced `RustPathSegment` +// (Crate | Super | Named) and `PubIn { path: +// List }` — the Self exclusion was type- +// enforced, but the list itself remained UNCONSTRAINED, so +// illegal Reference path-qualifier orderings were still +// constructible: `[]` (empty), `[Crate, Super]` (super after +// crate root; no parent of crate), `[Named]` alone (bare named +// without root), and `Super` after a `Named` segment (e.g. +// `[Crate, Named, Super]` = `crate::foo::super`, an invalid +// super-position). Operator BLOCKING 2026-05-16T05:06:51Z +// named this: "PubIn stores an unconstrained +// List, so impossible or edition-dependent +// visibility paths […] are constructible despite Rust +// Reference path-qualifier rules, violating extdeps fidelity +// and INVARIANTS P2." +// 5. Round-4 introduced a head-rooted Conj +// `PubInPath { root: PubInRoot, suffix: List }` +// with PubInRoot = AtCrate | AtSuperChain { hops: SuperHops }. +// Reference-invalid orderings were structurally unrepresentable +// under that shape, but it admitted TWO structural values for +// the SAME resolved scope: `pub(super)` for an item in +// `crate::a::b` → `PubInPath { root: AtSuperChain { hops: +// OneSuper }, suffix: [] }`, while `pub(in crate::a)` for the +// same item → `PubInPath { root: AtCrate, suffix: [a] }`. +// Both denoted the parent-module scope; same resolved scope, +// two structural authorities = P2 violation. Operator BLOCKING +// 2026-05-16T07:30:48Z + openai-pro REQUEST_CHANGES +// 2026-05-16T08:36:04Z named this: "the canonical carrier +// should key the resolved module once, not preserve absolute- +// vs-relative source spelling in the canonical value." +// The final corrected partition collapses to a single +// absolute-path-from-crate-root shape: `PubInPath { resolved_path: +// List }` (declared above this type). Empty +// `resolved_path` = the crate root (≡ `pub(crate)`); non-empty = +// `crate::::::…`. One canonical PubInPath value per +// resolved ancestor scope at the SHAPE level (no parallel +// absolute-vs-relative forms to pick between, since AtSuperChain is +// deleted); SEMANTIC-level enforcement (module-existence, valid +// containment descent, strict-ancestor of target) is producer- +// obligation 🟡 scaffold per PubInPath's bridge note. The earlier +// "P2 single-authority TYPE-ENFORCED" framing on this round +// overstated what the type enforces — corrected per openai-pro +// REQUEST_CHANGES 2026-05-16T15:04:44Z which caught the contradiction +// between the header claim and the scaffold's actual producer- +// obligation status. SuperHops + PubInRoot are DELETED as non- +// canonical source-spelling artifacts; the resolver canonicalizes +// every valid `pub(in )` source form to its absolute +// path before constructing PubInPath. Reference-invalid orderings +// (non-ancestor resolved modules) are parse/resolver-rejected +// upstream; the reflexive-current-module case canonicalizes to +// Private (one canonical representation for the no-modifier +// scope). The earlier doc wording that claimed `self::outer` +// "canonicalizes by dropping the leading self" was WRONG — +// corrected per BLOCKING operator review 2026-05-16T03:44:50Z; the +// new absolute-path shape moots the self-prefix question entirely +// (the resolver computes the absolute resolved path, regardless of +// source-syntax prefix).) +// +// CLOSED (C1 stop-signal). A fourth top-level form is an edit to +// THIS declaration under the L-2 pin discipline. The PubIn variant +// carries the path STRUCTURALLY (not as a separate parallel-named +// variant), so future Reference revisions adding new convenience +// shorthand for an existing path family are NOT a C1 edit — they +// fold into PubIn's path-list. +// +// Coproduct dissolution (Practice 4 / modeling-discipline.md §4) — +// 🟢 GREEN (terminal). Ledger — five patterns attempted: +// 1. Fact placement — FAILS: every Rust-item consumer (emission +// of the visibility modifier, the cross-module-name-resolution +// walk, the public-API-surface synthesis for documentation / +// coordination contracts) reads the visibility tag uniformly; +// shared classifier, not scattered. +// 2. Variant-is-data — FAILS: collapsing to a uniform record +// `{ kind: Symbol, path: List? }` reintroduces the +// readable-string-as-tag heuristic K-1 forecloses AND the +// illegal state "kind=Pub with path=[...]" (Pub carries no +// path — that combination is unrepresentable here by +// construction; the Disj-with-payloads is the dissolved form +// per P2 + Practice 2/6 + M4). +// 3. Algebraic form — PARTIAL: visibility scopes form a partial +// order (Private ⊑ PubIn { path: [Super] } ⊑ PubIn { path: +// [Crate] } ⊑ Pub for items in a nested module — and PubIn +// paths in general are ordered by module containment; +// pub(self) ≡ Private is structurally enforced, not a +// separate level). The partial-order is DERIVED FROM the +// closed enum + the namespace's module-containment relation, +// not a richer std/ source — pointing to a +// `BoundedLattice` would parallel-represent +// the visibility taxonomy the order is defined over +// (algebra.dag U1 engine-debt smell — the same argument +// ptx.dag's BarrierScope ledger makes). +// 4. Dimensional — FAILS: a single Rust item has EXACTLY ONE +// visibility modifier; the three variants are mutually- +// exclusive alternatives (an item is private, OR `pub`, OR +// `pub(in )` — never a combination). The path-INSIDE +// PubIn is a structural Conj field within that variant, not +// a separate Disj coordinate. +// 5. Parameterized family — FAILS: the three variants are NOT +// one generic `F` / projection over a separately-declared +// source set (Practice 7). Private and Pub are nullary +// tags; PubIn carries a PubInPath (absolute-from-crate-root +// `{ resolved_path: List }`). They are +// structurally heterogeneous (the Disj-with-payloads shape +// is irreducible — collapsing PubIn into Private/Pub would +// lose the path fact, exactly the regression this BLOCKING +// fix undid). +// Terminal: the closed three-way Rust item-visibility partition +// reflecting the Reference's fundamental form. Reference +// equivalences canonicalize to absolute-from-crate-root paths: +// `pub(crate)` / `pub(in crate)` → `PubIn { path: PubInPath { +// resolved_path: [] } }`; `pub(super)` for item in `crate::a::b` +// → `PubIn { path: PubInPath { resolved_path: [a] } }` (the +// parent module's absolute path); `pub(self)` / `pub(in self)` / +// no-modifier / any `pub(in )` resolving to current module +// → `Private` (one canonical representation for the no-modifier +// scope). +type RustVisibility + = Private + | Pub + | PubIn { path: PubInPath } + + +// RustVisibility well-formedness — SPLIT enforcement (shape: type- +// level / semantic: producer-obligation 🟡 scaffold via PubInPath's +// scaffold bridge). +// +// What IS type-enforced today (shape-level invariants — structural): +// - RustVisibility's three-variant Disj forces a value to be +// exactly one of Private / Pub / PubIn { path: PubInPath }. +// - PubInPath's single-field shape forces a resolved_path +// coordinate; no parallel absolute-vs-relative representation +// is admitted by the type. +// - NamedSegment's closed-record-with-one-field shape forces a +// single Symbol id per segment. +// - List equality on the resolved_path is structural; two values +// with the same opaque-Symbol-id list ARE the same PubInPath +// value (K-1 Symbol equality is the boundary). +// +// What is NOT type-enforced today (semantic-level invariants — +// producer-obligation 🟡 scaffold, per PubInPath's bridge note): +// - That each NamedSegment.id resolves to an actually-existing +// module in the defining crate. +// - That the resolved_path's segments form a valid descent through +// real module containment (vs an arbitrary Symbol sequence). +// - That the target module is a STRICT ANCESTOR of the declaring +// item (vs the current module, which is Private, or a non- +// ancestor, which is parse-rejected). +// - That "same resolved scope ⇒ same canonical PubInPath value" +// holds end-to-end (this depends on the resolver computing the +// same absolute path for every source form pointing at the +// same module — producer-side until the module-tree substrate +// makes resolution type-level). +// +// Per the openai-pro REQUEST_CHANGES 2026-05-16T13:24:03Z framing: +// the earlier "TYPE-ENFORCED" claim conflated these two layers. The +// shape IS type-enforced; the semantic ancestor-validity IS NOT. +// Dissolution trigger: when std/ exposes a typed MODULE-TREE +// substrate (Module-Node + ancestor-relation Witness + module- +// existence Witness), the semantic invariants become type-level — +// PubInPath collapses to a refined { target: ModuleRef, +// ancestor_proof: Witness<...> } form. Co-temporal with the bundled +// T-4 LanguageModel grammar work (since the resolver consumes those +// productions). See PubInPath's 🟡 SCAFFOLD declaration above for +// the full bridge properties. + + +// ───────────────────────────────────────────────────────────────────── +// RustReference — a typed Rust reference. Per Reference §types-pointer, +// a reference type is `&'lifetime mut? TypeNoBounds` — THREE structural +// coordinates: lifetime × reference-kind × referent type. All three +// are CARRIED here so `&'a i32` and `&'a str` are distinct facts +// (P1 modeling-faithfulness + P2 boundary-discipline). Conj record +// (no Practice-4 ledger — only coproducts dissolve). +// Spec: https://doc.rust-lang.org/reference/types/pointer.html +// +// - kind which reference kind (Shared / Exclusive — the +// borrow-kind partition the borrow checker reads; +// the `mut?` slot in the Reference grammar) +// - lifetime the reference's lifetime identity (an opaque +// K-1 Symbol — equality only, no spelling +// accessor; the human-readable `'a` / `'static` +// spellings live in a boundary intern table, never +// in kernel/lens code, exactly as Symbol's K-1 +// discipline forecloses — node.dag:70-86; the +// `'lifetime` slot in the Reference grammar) +// - referent the type the reference points to (the Reference's +// `TypeNoBounds` slot). Carried as a `Node` — the +// bounded kernel's single recursive type per +// node.dag A1 ("recursion lives SOLELY in Node +// children") — same shape as `Edge.target: Node` +// and `Diagnostic.correction Suggested(Node)`: any +// type expression IS a Node (a subtree of Nodes +// IS a Node; there is no separate "TypeNoBounds +// alias" the compiler sees through, per +// feedback_nodes_are_nodes / +// feedback_naming_is_aliasing). Whether the +// referent is in fact a TypeNode (a kind=TypeNode +// Node) is a structural well-formedness invariant +// the LanguageModel grammar enforces — the same +// discipline node.dag's `node_well_formed` +// applies to a connective's child shapes, not a +// type-level constraint here. +// +// (Corrected 2026-05-16 per BLOCKING operator review on PR #3174: +// the prior `{ kind, lifetime }`-only shape dropped the referent +// fact, so `&'a i32` and `&'a str` collapsed to one structural +// fact. INVARIANTS P1 modeling-faithfulness AND P2 boundary- +// discipline violations — the Reference's ReferenceType rule +// CARRIES all three coordinates. Faithful form restored.) +// +// The `lifetime` Symbol IS the generic-lifetime-parameter surface +// the bundled T-4 LanguageModel grammar productions resolve. A +// concrete lifetime ('a, 'static, an anonymous-region from elision) +// resolves to a Symbol at the binding site (per node.dag's name- +// reference resolution through the namespace); the Conj record is +// the typed value the ownership lens reads. +// +// IN-B / structural-fact discipline (per the header STRUCTURAL +// FINDING). The RustReference Conj record IS the structural surface +// of the IN-B claim "ownership / lifetime are intrinsic to the type +// signature, NOT an annotation layer" (THESIS:401, scaffold header +// IN-B framing applied to Rust). Memory access through a reference +// is a Transform whose operand type CARRIES this record in its +// signature; the ownership lens (lens/ownership.dag, T-13) READS +// the (kind, lifetime, referent) coordinates directly from the +// typed signature and validates well-scopedness as a structural +// property — there is no separate "borrow-fact annotation" layer. +// The referent's own type-Node structure is recursively read by the +// lens as needed (since `referent: Node` admits the full type- +// expression grammar — array types, generic instantiations, function +// pointer types, further references — without this file declaring +// each shape separately; that grammar is the bundled T-4 +// LanguageModel work, this Conj is the carrier shape). +type RustReference { + kind: RustReferenceKind + lifetime: Symbol + referent: Node +} + + +// ───────────────────────────────────────────────────────────────────── +// RustCost — the per-target cost-realization carrier shape for the +// Rust `LanguageModel`. Conj record (no Practice-4 ledger). +// Spec: gunbc-internal — cost realization is a v4 substrate concern +// (U1 / U2 per std/algebra.dag + lens/cost.dag), not a Rust-language +// spec fact; no upstream URL applies. The carrier SHAPE is gunbc's, +// pinned by the U1 one-homomorphism-with-cost discipline. +// +// This declares the SHAPE the U1 spine reads when computing Rust- +// side realization cost — both components per the scaffold header's +// "cost realization: Rust-specific bounds for compositional cost +// lens" claim (preserved as a goal; the carrier shape lands now, +// the cost INSTANCE-VALUES land downstream per "Owned ELSEWHERE"): +// +// - instruction_cost per-operation throughput cost (the U1 +// per-target-op cost projection — the `map` +// side of `Homomorphism<…, …, RustScalar>` +// carries this; cost is read FROM the map's +// structure, never stored as a parallel +// field per algebra.dag's U1 no-engine +// discipline) +// - allocation_cost per-allocation cost (the Rust-specific +// contribution: heap allocations through +// `Box` / `Vec` / `String` carry a cost +// distinct from per-instruction throughput; +// the per-target shape that the cost lens +// T-12 reads when synthesizing a Rust +// realization's total cost) +// +// 🟡 SCAFFOLD (same bridge as std/diagnostic.dag's `Extent.ByteRange` +// and ptx.dag's `Dim3` / `PtxCost`). With only kernel-ambient `Int` +// available at the T-4 phase, `{ instruction_cost: Int, +// allocation_cost: Int }` STRUCTURALLY ADMITS illegal states +// (negative costs; nonsense magnitudes). modeling-discipline.md §2 +// (illegal-states-unrepresentable) forbids admitting them; no +// bounded-Cardinality refinement substrate exists yet to exclude +// them. It is a TRACKED scaffold, declared with the three bridge +// properties (the precedent diagnostic.dag established 2026-05-15): +// (a) scaffold doc — THIS note; the carrier is provisional, not +// the terminal refined-positive shape. +// (b) bounds on use — a producer MUST construct only non-negative +// costs; until the substrate enforces it the invariant is +// producer-side; a RustCost with negative components is a +// producer bug, not a legal value. +// (c) dissolution trigger — when std/cardinality.dag's refinement +// substrate lands (T-3, P4 decidability), `instruction_cost` +// and `allocation_cost` become refined bounded-non-negative- +// Int axes, and this scaffold dissolves. +// +// SEAM (where T-12 cost-lens reads). When lens/cost.dag (T-12, U2) +// lands, its `SymbolicCost` lattice carrier composes over the per- +// target projections; the Rust projection is read from this Conj +// record's components per the U2 "complexity consumes cost, never +// re-derives" discipline. Pre-T-12, RustCost is the declared SHAPE +// the projection plugs into; concrete cost instance-values per +// operation (e.g. `Add` costs `RustCost { instruction_cost: 1, +// allocation_cost: 0 }`) ride T-12 + D2 per "Owned ELSEWHERE." +type RustCost { + instruction_cost: Int + allocation_cost: Int +} + + +// ═════════════════════════════════════════════════════════════════════ +// D2 RESOLVER SHAPE — per-primitive three-thin-facts declarations. +// +// Per the operator-ratified DECISIONS.md D2 row (2026-05-16, encoded +// via PR #3195 merge at 44a37ad46), a language extdeps file is a +// RESOLVER for the abstract std/ carriers — the +// `infra(abstract) → gcloud/aws(concrete)` pattern. Per primitive, +// THREE thin declarations: +// +// (1) alias-identity to the std/ carrier (`type RustI32 = Int32`) +// — the machine-readable-inhabitance form (`List = +// FreeMonoid` precedent); the algebra inhabitance flows +// through the alias, so "see through the labels" is literal +// Node identity. +// (2) grounding map (surface spelling — `i32`). +// (3) operation-semantics carriers (OverflowDisposition, +// NaN/Inf handling) — genuine per-language facts, siblings +// to the alias. +// +// Per the D2 row: a per-language `data _: +// OrderedRing<Prim, …>` inhabitance is the parallel-substrate +// INVARIANTS P1:42 forbids (`numeric_aliases_align_to_refinements`) +// — superseded. The prior #3174 head's RustScalar Disj REGISTRY +// (18 named `data rust_X: RustScalar = …` rows) + IrToRust +// carrier + bool_to_rust_bool row + assert_bool_to_rust_bool_consistency +// fn DISSOLVE into the three-thin-facts shape (this commit). The +// faithful RustScalar TYPE vocabulary (the Disj of source-syntax +// scalar categories with payload-bearing variants — IntScalar / +// FloatScalar / BoolScalar / CharScalar / StrScalar / NeverScalar — +// declared above) STAYS as the parse-stage source-syntax +// classifier; only the inhabitance-form items dissolve. +// +// Per the D2 row's D2.2: coercion = the U1 homomorphism realized by +// the generic B2-OMNI emit fold reading the resolver data. NOT a +// hand table (the prior IrToRust<> per-target string table is the +// shape INVARIANTS P1 forbids — its dissolution is exactly this +// reshape). NOT a per-language emit lens (B2-OMNI/B4: one generic +// emit, target-specificity is declarative T-11 data). +// +// Per the D2 row's D2.3: compound/generic coercion composes for +// FREE via the Node catamorphism (A1's single recursive type; +// `List` = `Instantiation` recursed); no per-instantiation +// rows. Not blocked on the Functor hierarchy. +// +// Per the D2 row's D2.4: round-trip guarantee is structural-on-F +// per C5-1; TestClaims document it, never establish it. The prior +// Layer-2 `assert_bool_to_rust_bool_consistency` fn — a forward- +// anchor that documented an assertion the structural law makes +// redundant — dissolves with this commit. +// +// Per the D2 row's D2.5: overflow/UB/arbitrary-precision are +// DISTINCT std/ carriers selected by the alias target + the +// per-language OverflowDisposition carrier, never a re-declared +// semantics. +// +// Per the D2 row's scope guard: D2 covers per-primitive inhabitance +// form ONLY. It does NOT decide LanguageModel-grammar facts (C++ +// most-vexing-parse, TypeScript structural typing) — those ride +// C5-3 / B2-OMNI / B4 per their own cascade. Grammar-slice workers +// must not import D2 reasoning into them. +// +// CURRENT-MAIN GROUNDING STATE (snapshot 2026-05-16 post-#3195 merge): +// - std/logic.dag: `Bool` LANDED (#3166) → RustBool alias-identity +// + grounding-map land NOW (this commit). +// - std/nat.dag: `Nat` LANDED — but Rust doesn't have an arbitrary- +// precision-Nat primitive (every Rust numeric primitive is +// bounded); no direct alias. +// - std/machine.dag: `Word*` / `MachineWidth` / `PointerWidth` +// LANDED — these are the machine-width substrate. Integer +// aliases compose them with std/integer.dag's eventual `Int` +// concept; they don't standalone-alias from rust.dag. +// - std/text.dag: `Char = Nat` and `String = FreeMonoid` +// LANDED — but `Char` is unrefined Nat (no Unicode-scalar- +// value bound), and `String` is unrefined FreeMonoid (no +// UTF-8 well-formedness). Rust's `char` (Unicode scalar value +// excluding surrogate range) and `str` (UTF-8) are +// REFINEMENTS, not direct alias targets. Alias-identity DEFERRED +// pending refined std/text.dag carriers OR a per-language +// refinement-disposition carrier (D2 scope-guard ambiguity — +// escalate if/when authoring the char/str alias surfaces this). +// - std/integer.dag: NOT YET FILLED (scaffold only). Integer +// aliases (RustI8 = Int8 through RustI128 = Int128 / RustIsize +// / RustU8..U128 / RustUsize) DEFERRED pending T-3 Wave-A3. +// - std/float.dag: NOT YET FILLED. Float aliases (RustF32 = +// Float32 / RustF64 = Float64) DEFERRED pending T-3 Wave-A3. +// - Never carrier: std/cardinality.dag has Multiplicity but no +// explicit empty-cardinality / Never type. RustNever alias +// DEFERRED pending its std/ source. + + +// ───────────────────────────────────────────────────────────────────── +// GroundingMap — the per-primitive surface-spelling +// carrier. Conj record (no Practice-4 ledger). +// +// Per the D2 row D2a(2): a "grounding map (surface spelling)". +// Each Rust primitive's alias-identity declaration is paired with a +// `data _grounding: GroundingMap<> = GroundingMap +// { spelling: "" }` row that names the Rust source +// token for emit / ingest. The spelling is a `String` boundary value +// (the canonical surface text); it lives at the source-syntax +// boundary, not in kernel/lens code. +// +// Spec: https://doc.rust-lang.org/reference/types.html +// (per-primitive Reference URLs are on the alias-identity +// declarations below.) +// +// 🟡 TRACKED-SCAFFOLD — GroundingMap's HOME is OPERATOR-PENDING +// +// The encoded DECISIONS.md D2 row (commit 44a37ad46) specifies the +// resolver SHAPE — "grounding map (surface spelling)" as D2a(2) — +// but did not pin WHERE the shared resolver TYPE lives in the +// closed file tree. This rust.dag declaration is PROVISIONAL: +// +// - One declaration alone is NOT a P2 violation; parallel- +// declaration would emerge only if sibling extdeps/languages/ +// files (python.dag / go.dag / cpp.dag / typescript.dag) +// re-declare an identical `type GroundingMap { +// spelling: String }`. Five identical declarations of the +// SAME convergence carrier is the parallel-declaration P2 +// forbids (the import-never-redeclare-carriers discipline). +// Per-primitive INSTANCES (rust_bool_grounding, +// py_bool_grounding, etc.) correctly stay per-file; only the +// TYPE needs ONE home. +// +// - The D2 RESOLVER SHAPE is CANONICAL regardless of where the +// type ultimately lives. The fan-out (python/go/cpp/ts) must +// not redeclare GroundingMap locally — that is the P2 +// violation cascade. Fan-out files defer D2a(2) under the +// SAME named trigger as this declaration; per-language +// instance rows author when the home is pinned. +// +// - NAMED OWNER: operator. Surfaced via T-4 mgr (vivid-carp-207 +// msg_148854d5 2026-05-16) for placement decision — three +// candidate homes under escalation (placement-first-hold, +// rust-as-shared-authority, new shared extdeps resolver file). +// Co-drafted tradeoff analysis surfaced to T-4 mgr by +// loyal-koi-702 + merry-ibex-337 (D2 author). +// +// - DISSOLUTION TRIGGER: operator pins GroundingMap's home. On +// that decision THIS declaration either STAYS (rust-as- +// shared-authority option — rust.dag becomes the canonical +// home, sibling files import from extdeps.languages.rust) or +// MOVES to the chosen home (new shared resolver file / +// elsewhere — and rust.dag adds `import { GroundingMap }`). +// +// SCAFFOLD vs CANONICAL discipline: the declaration BODY (`{ +// spelling: String }`) is the canonical D2a(2) SHAPE per the D2 +// row; only its PLACEMENT is the operator-pending facet. A future +// home change is a relocation + import edit, NOT a re-modeling. +type GroundingMap { + spelling: String +} + + +// ───────────────────────────────────────────────────────────────────── +// OverflowAction — the closed SET of permitted runtime actions on +// Rust integer arithmetic overflow per Rust Reference +// behavior-not-considered-unsafe.html#integer-overflow: +// +// "When the programmer has enabled `debug_assert!` assertions (for +// example, by enabling a non-optimized build), implementations +// must insert dynamic checks that `panic` on overflow. Other kinds +// of builds may result in `panics` or silently wrapped values on +// overflow, at the implementation's discretion. In the case of +// implicitly-wrapped overflow, implementations must provide +// well-defined (even if still considered erroneous) results by +// using two's complement overflow conventions." +// +// Spec: https://doc.rust-lang.org/reference/behavior-not-considered-unsafe.html#integer-overflow +// +// - PanicOnOverflow — runtime panic; the action implementations +// MUST take in builds with `debug_assert!` +// enabled. Also a permitted action in other +// builds at implementation discretion. +// - TwoComplementWrap — silently wrap using two's-complement +// conventions. Permitted in builds WITHOUT +// `debug_assert!` at implementation +// discretion; commonly the actual choice +// when `-C overflow-checks=off` (the +// release-profile default). +// +// Explicit per-operation forms (`wrapping_*`, `checked_*`, +// `saturating_*`, `overflowing_*`, `Wrapping` newtype) opt the +// caller into specific behavior at the call site, INDEPENDENT of +// the build-mode default; those are method-name facts modeled +// elsewhere (LanguageModel + the std library's integer-method +// surface), not new OverflowAction variants. +// +// CLOSED (C1 stop-signal). A third variant would require a Reference +// edit (e.g. a future stable saturating-default mode); change is a +// visible C1 edit to THIS declaration under the L-2 pin discipline. +// +// Coproduct dissolution (Practice 4 / modeling-discipline.md §4) — +// 🟢 GREEN (terminal). Ledger — five patterns attempted: +// 1. Fact placement — FAILS: every integer-op consumer reading +// the disposition tag uniformly to determine runtime behavior; +// shared classifier, not scattered. +// 2. Variant-is-data — FAILS: a `{ name: Symbol }` proxy reopens +// the readable-string-as-tag K-1 anti-pattern. Two nullary +// structural alternatives — the enum IS the faithful form. +// 3. Algebraic form — N/A by construction: PanicOnOverflow vs +// TwoComplementWrap is a Rust-specific runtime-dispatch +// partition; it doesn't trace to a richer std/ algebraic +// structure (no Monoid / Lattice on these two actions). No +// richer std/ source. +// 4. Dimensional — FAILS: a single overflow event produces +// EXACTLY ONE of these two actions per the Reference; +// mutually-exclusive alternatives, not simultaneous +// coordinates. +// 5. Parameterized family — FAILS: the two are distinct Rust- +// Reference permitted-action primitives; NOT one generic +// `F` / projection over a separately-declared source set +// (Practice 7). +// Terminal: the closed two-element permitted-set per Reference +// behavior-not-considered-unsafe.html#integer-overflow. The +// `wrapping_*` / `checked_*` / `saturating_*` / `overflowing_*` +// explicit-per-op forms are method-NAME facts on the integer +// types' library surface (modeled in the bundled T-4 LanguageModel +// grammar work, not here), NOT additional OverflowAction +// variants — they opt the call site into specific behavior +// independent of the build-mode action. +type OverflowAction + = PanicOnOverflow + | TwoComplementWrap + + +// ───────────────────────────────────────────────────────────────────── +// OverflowDisposition — the per-language operation- +// semantics carrier for Rust integer arithmetic (D2a(3)). Closed +// two-variant Disj capturing the Rust Reference's two per-build-mode +// overflow-disposition cases per behavior-not-considered-unsafe.html +// #integer-overflow. +// +// Each variant is NULLARY — the disposition is structurally pinned by +// the variant identity; there is no payload that could carry an +// alternative action and admit an illegal state. Per BLOCKING +// reviewer 2026-05-16T20:33:06Z (an earlier shape carried +// `debug_assert_required_action: OverflowAction`, which made +// `TwoComplementWrap` constructible for a fact the Reference fixes to +// panic — INVARIANTS P2 illegal-states-unrepresentable violation; the +// new shape forecloses that). +// +// - MustPanicOnOverflow +// Reference: "When the programmer has enabled `debug_assert!` +// assertions ... implementations MUST insert dynamic checks +// that panic on overflow." This is a deterministic spec fact; +// the variant has no payload (the action is pinned to panic by +// variant identity). +// +// - MayPanicOrTwoComplementWrap +// Reference: "Other kinds of builds may result in panics OR +// silently wrapped values on overflow, at the implementation's +// discretion." The choice between actions IS impl-defined +// (commonly driven by `-C overflow-checks=on|off`, the release +// profile default being `off`); that selection is build- +// configuration tooling state, not a language fact, and is +// therefore NOT recorded structurally. The wrap-CONVENTION is +// a language fact — Reference: "implementations must provide +// well-defined ... results by using two's complement overflow +// conventions" — and is structurally encoded in the variant +// NAME (`TwoComplementWrap`, not just `Wrap`; no arbitrary-wrap +// sibling). +// +// CLOSED (C1 stop-signal). Reference additions to the per-build-mode +// disposition set (e.g. a future stable saturating-default mode) +// require an edit to THIS declaration under the L-2 pin discipline. +// +// Coproduct dissolution (Practice 4 / modeling-discipline.md §4) — +// 🟢 GREEN (terminal). Ledger — five patterns attempted: +// 1. Fact placement — FAILS: every Rust-integer-overflow-semantics +// consumer reads the per-build-mode disposition uniformly; +// shared classifier, not scattered. +// 2. Variant-is-data — FAILS: collapsing to a uniform record +// `{ kind: , ... }` reintroduces the readable-string +// -as-tag K-1 anti-pattern; carrying an OverflowAction payload +// on the MustPanic variant ALSO reopens the BLOCKING the prior +// shape was rejected for (the action would become variable; the +// illegal value "MustPanic with action=TwoComplementWrap" would +// be constructible). Two nullary structural alternatives IS the +// faithful form. +// 3. Algebraic form — N/A by construction: MustPanicOnOverflow vs +// MayPanicOrTwoComplementWrap is a Reference-defined per-build- +// mode disposition partition; it doesn't trace to a richer std/ +// algebraic structure. No richer std/ source. +// 4. Dimensional — FAILS: at a given build configuration EXACTLY +// ONE of these dispositions applies; mutually-exclusive +// alternatives, not simultaneous coordinates. A Rust integer +// type's overflow semantics enumerates BOTH dispositions across +// build modes, but each individual overflow event is governed +// by exactly one disposition at a time. +// 5. Parameterized family — FAILS: the two are Reference-defined +// per-build-mode classification primitives; NOT one generic +// `F` / projection over a separately-declared source set +// (Practice 7). The build-mode axis (debug_assert enabled vs +// disabled) is the partition discriminant, not a separately- +// declared source set the dispositions parameterize over. +// Terminal: the closed two-element Rust-Reference per-build-mode +// integer-overflow-disposition classifier. +// +// Per the D2 row D2.5: overflow/UB/arbitrary-precision are DISTINCT +// std/ carriers selected by the alias target + the per-language +// OverflowDisposition carrier, never a re-declared semantics. This +// classifier carries Rust's per-build-mode disposition rules; the +// abstract-vs-bounded-integer-semantics axis is selected via the +// alias target (e.g. RustI32 → Int32 vs an arbitrary-precision Int +// — the former is bounded and overflow-disposed, the latter is +// arbitrary-precision and overflow-impossible). +// +// Floats use a separate operation-semantics carrier (NaN/Inf +// handling per IEEE-754) — that one lands when the float aliases +// land (pending std/float.dag T-3 Wave-A3). The integer-overflow +// case is the canonical instance of the D2a(3) shape; the float +// case mirrors structurally with different variants. +type OverflowDisposition + = MustPanicOnOverflow + | MayPanicOrTwoComplementWrap + + +// ───────────────────────────────────────────────────────────────────── +// Per-primitive alias-identity + grounding declarations. +// +// Each Rust primitive type below is declared as a thin three-fact +// resolver: (1) alias-identity to its std/ carrier, (2) grounding- +// map for surface spelling, (3) operation-semantics carrier (for +// integers, OverflowDisposition; for floats, a future NaN/Inf +// disposition carrier; Bool/Char/Str/Never have no per-op runtime +// dispatch and don't carry one). +// +// LANDABLE NOW — grounded against current origin/main carriers: + +// Rust `bool` ↔ std/logic.dag's `Bool` (LANDED via #3166). +// Alias-identity: literal Node identity per the D2 row's +// "see through the labels" framing. +type RustBool = Bool + +data rust_bool_grounding: GroundingMap = GroundingMap { + spelling: "bool" +} + +// Bool has no overflow / runtime-dispatch operation semantics; no +// OverflowDisposition row. + + +// 🟡 TRACKED-SCAFFOLD — DEFERRED ALIAS-IDENTITY ROWS +// +// The alias-identity rows below (D2a(1)) are 🟡 TRACKED-SCAFFOLD — +// shape ratified, landing blocked on named upstream substrate, with +// explicit owner + trigger + form contract so the deferral is a +// tracked-scaffold not a silent gap. Per manager directive +// msg_2c2716dd 2026-05-16 and the encoded DECISIONS.md D2 row. +// +// FORM CONTRACT — for each deferred alias, the form is the encoded +// DECISIONS.md D2 row (commit 44a37ad46, line 57). Land as: +// - `type Rust = ` alias-identity (D2a(1)); +// algebra inhabitance flows through the alias per the +// `List = FreeMonoid` precedent — no parallel-substrate +// per-language `OrderedRing, …>` inhabitance +// (INVARIANTS P1:42 `numeric_aliases_align_to_refinements`). +// - `data rust__grounding: GroundingMap> = +// GroundingMap { spelling: "" }` row (D2a(2)). +// - for integer aliases: two D2a(3) overflow-disposition rows +// per integer type, capturing the Reference's per-build-mode +// dispositions uniformly across all integer widths (the +// Reference fact does not vary by width): +// `data rust__overflow_under_debug_assert: +// OverflowDisposition> = MustPanicOnOverflow` +// `data rust__overflow_without_debug_assert: +// OverflowDisposition> = MayPanicOrTwoComplementWrap` +// SECONDARY DEFERRAL: each of these data rows has a TOP-LEVEL +// SUM-VARIANT body (`= MustPanicOnOverflow` etc.) which falls +// into Class-5-Gap-3 (ROADMAP.md:418, ValueBody::Unparsed for +// top-level sum-variant literal bodies; substrate items +// #920/#1017/#1068). Named owner: R2/R3 ValueBody substrate +// work. Trigger: Class-5-Gap-3 closes (top-level +// ValueBody::Unparsed → structural-validation lands). So these +// instance rows are DOUBLE-deferred: pending (a) std/integer.dag +// ladder for the alias-target Rust AND (b) Class-5-Gap-3 +// closure for the body shape. Either gating order is fine. +// The TYPE shape (OverflowDisposition Disj above) is canonical +// regardless of the instance landing. +// - for float aliases: a NaN/Inf disposition carrier row +// (the carrier itself lands with std/float.dag's +// ApproximateField inhabitance — same 🟡 TRACKED- +// SCAFFOLD deferral pattern, float.dag as named owner). +// +// SUBSTRATE SINGLE-AUTHORITY GUARD — `rust.dag` (and any sibling +// `verilog.dag` / `python.dag` / etc.) MUST NOT mint the std/ Int / +// UInt / Float / IntPointer / UIntPointer types locally. The +// abstract numeric carriers have SINGLE AUTHORITY at `std/` +// (substrate single-authority per INVARIANTS P2 + scaffold-drift +// discipline). The extdeps file's only contribution is the +// alias-identity to the std/ source — minting them locally would +// produce parallel substrates and break P2 enforcement at the +// carrier level. +// +// ─── DEFERRED ROWS — TRACKED ────────────────────────────────────── +// +// Rust signed integers — RustI8 / RustI16 / RustI32 / RustI64 / +// RustI128 / RustIsize +// - target form type RustI8 = Int8 … +// + grounding `spelling: "i8"` etc. +// + OverflowDisposition row (Reference +// §numeric default per width) +// - named owner std/integer.dag — the `Int` arbitrary- +// precision integer concept + the +// `Int8..Int128 = Compose>` bounded-width +// ladder (per INVARIANTS:42 + +// `numeric_aliases_align_to_refinements` +// ratchet) + the `IntPointer = +// Compose` ladder. +// - dispatch wave T-3 Wave-A3 (substrate spine integer +// carriers). +// - dissolution trigger +// when the `Int8..Int128` + `IntPointer` +// ladder lands on `origin/main` in +// `std/integer.dag`, the rows above amend +// in as one-line landings each. +// +// Rust unsigned integers — RustU8 / RustU16 / RustU32 / RustU64 / +// RustU128 / RustUsize +// - target form type RustU8 = UInt8 … +// + grounding `spelling: "u8"` etc. +// + OverflowDisposition row (same Rust +// defaults; the wrap arithmetic is +// modular per width — the disposition +// tag selects the runtime action, the +// alias target carries the modular +// algebra). +// - named owner std/integer.dag — the `UInt8..UInt128 = +// Compose>` +// bounded-width ladder + `UIntPointer = +// Compose` ladder. +// - dispatch wave T-3 Wave-A3. +// - dissolution trigger +// same as signed — `UInt*` ladder landing +// on `origin/main` in `std/integer.dag`. +// +// Rust floats — RustF32 / RustF64 +// - target form type RustF32 = Float32 … +// + grounding `spelling: "f32"` etc. +// + NaN/Inf disposition carrier row +// (carrier itself lands with +// std/float.dag). +// - named owner std/float.dag — the `Float` / +// `Float32` / `Float64` carriers and the +// `ApproximateField` algebra +// instance D2b's FunctionRef → Arrow +// IEEE-754 op declarations attach to. +// - dispatch wave T-3 Wave-A3. +// - dissolution trigger +// when `std/float.dag` lands its +// `Float32` / `Float64` ladder + the +// `ApproximateField` inhabitance +// on `origin/main`, the rows above and +// the D2b realization surface below +// amend in together. +// +// Rust char / str — RustChar / RustStr +// - target form type RustChar = Char / type RustStr = +// String + grounding (`"char"` / `"str"`). +// - named owner std/text.dag — Char/String are LANDED +// but unrefined; Rust's `char` (Unicode +// scalar value excluding surrogates) and +// `str` (UTF-8) are REFINEMENTS, not +// direct alias targets. +// - dispatch wave pending REFINEMENT-DISPOSITION decision +// (D2 scope-guard ambiguity). +// - dissolution trigger +// EITHER (a) `std/text.dag` refines `Char` +// to its Unicode-scalar-value form + +// `String` to its UTF-8 form, in which +// case alias-identity lands directly; +// OR (b) an operator-ratified per- +// language refinement-disposition carrier +// lands (D2 row's open scope-guard +// question), in which case the alias +// lands + that carrier carries the +// Rust-side refinement. The decision +// between (a) and (b) is an escalation +// point — surface to the operator when +// authoring the alias forces it. +// +// Rust never type — RustNever +// - target form type RustNever = . +// - named owner std/cardinality.dag — has Multiplicity +// but no explicit empty-cardinality / +// Never type yet. +// - dispatch wave pending std/ empty-cardinality / Never +// carrier authoring (no current dispatch +// wave assignment). +// - dissolution trigger +// when std/ lands its Never / empty- +// cardinality carrier on `origin/main`. + + +// ───────────────────────────────────────────────────────────────────── +// D2b — Rust's IEEE-754 float operation realizations. +// +// Per the D2 row D2b: IEEE-754 float arithmetic is a genuinely- +// irreducible spec primitive. It flows through THESIS:203's +// `Transform → FunctionRef → Arrow` pattern, where the Arrow's +// `body` is a REALIZATION DECLARATION in `extdeps/languages/*` — +// the per-target resolver. D2b coins NO new carrier (no +// `Symbol`+`Anchor` data node referenced directly by the +// inhabitance — that would be the second external-primitive path +// P2 forbids). +// +// For Rust specifically, the IEEE-754 op Arrow body realizations +// (the per-op declarations that capture how Rust source represents +// `+ / - / * / /` etc. on `f32` / `f64`) live in this file. BUT: +// per the D2 row's SCOPE GUARD, "D2 covers per-primitive +// inhabitance form ONLY: it does NOT decide LanguageModel-grammar +// facts." The Arrow-body realization data IS grammar/emission +// facts (Rust source tokens for arithmetic operators, precedence, +// associativity). Those land with the bundled T-4 LanguageModel +// grammar work; the D2 row directs the SHAPE (Transform → +// FunctionRef → Arrow with body = extdeps realization) but doesn't +// author the realizations themselves. +// +// For this slice: the realizations are DEFERRED to the bundled T-4 +// LanguageModel grammar bundle. They land alongside the broader +// grammar production data; not in this canonical reshape. +// +// (Also pending: std/float.dag's ApproximateField inhabitance, which +// the FunctionRefs to op Arrows live INSIDE. Until std/float.dag +// lands its ApproximateField instance and the per-op Arrow +// declarations are bound to FunctionRefs, the D2b realization +// surface in rust.dag has nothing to attach to.)