Rust Phase 2 Typed Footprint Slice

Decision

The first Phase 2 source-model slice is a standalone footprint summary and focused property edit. It is accepted as the foundation for wider footprint coverage, but remains review_ready in the parity registry until representative Python and corpus comparisons close.

Architecture

Contract And WASM Boundary

TypeSpec owns the read/edit a0 envelopes and generates JSON Schema, Rust, Python msgspec, and TypeScript projections. Actual Node-hosted WASM tests call readFootprint and editFootprintProperty with separate byte buffers. The read operation returns typed JSON. The edit returns a paired object containing FootprintEditResultA0 JSON and a separate KiCad UTF-8 output buffer, without base64 encoding. No-op edits return the original bytes with changed=false; model failures return diagnostics and an empty output buffer.

Test Ownership

Rack L1_025 owns typed read, source-preserving write, unknown-form survival, semantic reparse, stable second edit, exact root association, absolute lazy-error positions, ambiguity, and resource limits. Rack L0_046 owns actual WASM execution, paired edit metadata, and Rust quality. Rack L0_049 owns generated Python and TypeScript projection cleanliness.

Retained Work

Add representative legacy and modern .kicad_mod fixtures, compare the first facts to Python, expand typed pad/graphic iteration, and define the footprint plotter-IR contract before the Phase 2 boundary review. Adding new properties is intentionally outside this focused edit operation until insertion formatting and placement rules are specified.