Rust schematic Plotter-IR Phase 5 graphics

Status: accepted. P5_062 extends the native schematic document with polylines, arcs, circles, rectangles, cubic Béziers, rule areas, embedded images, and tables. The earlier foundation and annotation entry points remain unchanged, and the full producer performs no project, image, or font discovery.

Order and source ownership

Raw bounded source spans preserve nanometre precision and emit records after text boxes in the fixed family order graphic_polyline, graphic_arc, graphic_circle, graphic_rectangle, graphic_bezier, rule_area, image, and table. Source order is stable within each family. Rule-area identity belongs to its nested shape; table cells remain children of one flattened table record.

Drawing semantics

Graphics use KiCad's fixed notes-layer defaults independently of project line-width settings. Filled shapes preserve the authoritative fill-before- outline split. Four-point Béziers emit one cubic operation, while malformed arities fail closed. Rule-area polylines are closed explicitly and retain their policy flags.

Tables reuse the accepted text-box renderer, one-pass variables, and one document-wide deterministic font session. Cell layout metadata and authored render caches remain ignored because the Python producer does not retain them. Font selection and wrapping therefore share aggregate hash and work ceilings with preceding annotations.

Image safety boundary

Schematic images admit canonical PNG, JPEG, and BMP payloads with bounded header and density parsing. Encoded and decoded bytes, data parts, image dimensions, pixels, metadata work, scale, and derived extents are validated before publication. Invalid base64, unsupported or truncated payloads, nonpositive scale, and zero dimensions fail closed instead of reproducing Python's permissive zero-sized fallback. Worksheet images remain separately PNG-only.

Contract, resources, and evidence

The strict schematic contract gains eight record arms and their required request ceilings without adding a PlotterOperation kind. TypeSpec and the generated Rust, Python, TypeScript, and JSON Schema projections regenerate atomically. Independent limits cover each family, table cells and retained lines, image resources, input and output points, records, operations, text, metadata, and the inherited text-engine work. Errors publish no partial document.

Hermetic shared vectors cover all graphic and rule shapes, real SHA-verified PNG/JPEG/BMP density cases, metric-independent table cells, and fixture-font wrapping. Rack L1_036, focused native tests, strict semantic mutations, and generated-binding checks own the executable evidence. P5_070 now owns placed symbols and overlap overplots; P5_071 retains hierarchical sheets. This native-first slice adds no WASM or Cruncher endpoint.