Rust Phase 2 Symbol Plotter-IR Slice

Decision

Library-symbol bytes now produce the cache-free geometry and text subset of kicad.plotter_ir.a0. Rectangles, circles, three-point arcs, polylines, and cubic Béziers reuse the same producer-neutral operations as footprints and future PCB and schematic readers. Pin shafts and all nine non-text pin decorations share those operations as well. Body text, pin numbers, and pin names emit canonical layer-free Text operations; outline shaping and render-cache generation remain separate.

Source Selection And Semantics

Contracts And Resource Bounds

TypeSpec owns the symbol request, result, document, record union, shared style fields, expanded fill vocabulary, and Bézier operation. Generated Rust, Python/msgspec, and TypeScript projections are committed. Semantic validation requires the lib_symbol header first and permits only canonical layer-free geometry and cache-free Text in lib_subsymbol records. Operation kinds and global indices are exact, and any cache/marker/layer state on symbol text is rejected; footprint graphics still require a layer and pad/drill states cannot cross into symbol output.

Source bytes, depth, library symbol count, subsymbol count, operation count, geometry point count, source text-carrier count, retained UTF-8 text bytes, project-variable entry/byte sidecars, and output bytes are independently bounded. Every failure returns diagnostics with empty output. Browser callers use plotSymbolIr with separate source and request byte arrays.

Evidence And Retained Work

Rack L1_027 compares the exact body, body-text, pin-label, and all-style pin operation streams with the Python oracle, validates both the generated strict schema and established IR schema, and orchestrates native and host-adapter Rust tests. The real WASM suite covers successful exact-case text plus fail-closed text-carrier, safe-integer, and geometry limits. Rustfmt, warnings-denied Clippy, the wn-dev-std structural ratchet, the complete Cargo workspace, and deterministic contract generation pass.

Native font shaping, outline extraction, and render-cache generation for symbol text remain later rendering work. Inheritance resolves base geometry and base pin visibility/offset settings while retaining requested-child header metadata; broader inherited source-model fields remain future typed model expansion.