Rust Phase 4 native compiled graph semantics

Status: accepted with direct executable Rust evidence. This vertical slice ports deterministic identity, graph-wide semantic validation, and native project-to-graph production for all ten a0 row families.

Identity allocation

CompiledGraphIdentityAllocator owns scope and selector normalization, canonical ASCII JSON, duplicate-address detection, and UUIDv7 byte formatting. It matches all shared source, derived, supporting, Unicode, precedence, normalization, and failure vectors. RustCrypto sha2 supplies only SHA-256, and unicode-casefold supplies Unicode full case folding; both sit behind package-owned APIs and work without native FFI. Canonicalization and allocation policy remain in-house. Locked dependency versions and the package-owned API boundary are governed by the Rust workspace standard; neither dependency API is part of this public contract.

Semantic validation

Validation first applies the strict TypeSpec transport boundary, then builds each reference index exactly once. It validates RFC 4122 UUIDv7 row identity, uniqueness, typed references, exact bidirectional definition/page and occurrence/page ownership, exact hierarchy parent/child inverse ownership, terminal/local/component page ownership, scalar hierarchy bindings, resolution completeness, and graphical target attribution.

Hierarchy cycle detection uses one color map and marks each unit occurrence visiting and done once. Runtime is O(rows + references), retained validation memory is O(rows), and no collection cross-product or repeated parent-chain walk is used. The validator borrows generated DTO strings and does not clone row payloads. Compiler input and output ceilings belong to the upcoming named source-bundle/compiler operation; this already-owned DTO validator does not invent a second arbitrary size policy.

Native production boundary

CompiledSchematicGraphLimits independently bounds every emitted row family and aggregate retained string bytes. Each row check occurs before publication and each retained-string charge occurs before the corresponding graph allocation. Defaults are broad format-safety ceilings rather than product-size assumptions; native callers can retain them while untrusted-input adapters may tighten them. Source-bundle and connectivity limits separately bound parsed input, compiler work, and intermediate connectivity state.

Evidence and retained work