Supporting Public Classes

Version

Rationale

Release consumers need a parseable date-version object, not only a raw string.

Purpose

Represent package version parts and expose the release date used by CI and downstream package checks.

Test Requirements

Tests must confirm pyproject metadata, package metadata, and parsed date fields match the release contract.

Working Definition

The model is public when a consumer can determine the exact release date from the installed package.

LibSubSymbol

Rationale

Library symbols can have unit and body-style partitions that need independent rendering and traversal.

Purpose

Carry one symbol-unit graphics group and preserve the shapes, pins, and text that compose it.

Test Requirements

Tests must prove subsymbol content emits IR records in KiCad-compatible order.

Working Definition

The model is public when symbol libraries can expose unit-level geometry without raw S-expression traversal.

SymProperty

Rationale

Symbol cleanup depends on stable named and numeric property handling.

Purpose

Represent one library-symbol property with identity, value, display, and placement data.

Test Requirements

Tests must cover standard keys, custom property IDs, get/set helpers, and removal.

Working Definition

The model is public when callers can update symbol properties without editing raw token lists.

SymPin

Rationale

Pin geometry and electrical metadata are central to symbol rendering and netlist interpretation.

Purpose

Represent a library-symbol pin with geometry, text visibility, electrical type, and graphics style.

Test Requirements

Tests must cover pin shaft geometry, inverted pins, number/name placement, and visibility rules.

Working Definition

The model is public when symbol and schematic tooling can reason about pin identity and rendering.

SymRectangle

Rationale

Symbol body outlines commonly use rectangles and need deterministic conversion to plotter IR.

Purpose

Represent a symbol rectangle with stroke, fill, and endpoint coordinates.

Test Requirements

Tests must cover rectangle-to-IR conversion and fill/stroke mapping.

Working Definition

The model is public when symbol renderers can consume rectangle geometry without parser internals.

SymCircle

Rationale

Circular symbol geometry must round-trip and render through the same IR path as other primitives.

Purpose

Represent a symbol circle with center, radius, stroke, and fill semantics.

Test Requirements

Tests must cover radius-to-diameter conversion and fill handling.

Working Definition

The model is public when callers can inspect and render circle primitives directly.

SymArc

Rationale

Arc geometry needs explicit start, midpoint, and end semantics for KiCad-style plotting.

Purpose

Represent a symbol arc and preserve enough geometry for plotter-IR conversion.

Test Requirements

Tests must verify three-point arc emission and stroke mapping.

Working Definition

The model is public when symbol arcs can render without direct S-expression access.

SymPolyline

Rationale

Symbol outlines and decorative geometry often depend on ordered point lists.

Purpose

Represent a symbol polyline with points, stroke, and fill semantics.

Test Requirements

Tests must confirm point order and plot-poly conversion remain stable.

Working Definition

The model is public when callers can preserve and render polyline point geometry.

SymBezier

Rationale

Bezier curves are less common but must remain first-class for symbol visual parity.

Purpose

Represent a symbol Bezier curve and feed cubic control points to plotter IR.

Test Requirements

Tests must cover cubic conversion and fallback behavior for short point lists.

Working Definition

The model is public when callers can preserve curved symbol geometry through conversion.

SymText

Rationale

Symbol text participates in graphics output and may include variables and visibility rules.

Purpose

Represent text graphics inside a library symbol with effects, position, and visibility.

Test Requirements

Tests must cover default effects, variable expansion, hidden text, and IR text alignment.

Working Definition

The model is public when rendering and cleanup tools can inspect text graphics directly.

SymTextBox

Rationale

KiCad symbol files can carry text-box graphics that must stay visible to downstream renderers.

Purpose

Represent a symbol text box with text, placement, stroke, fill, and text effects.

Test Requirements

Tests must at minimum keep the class in the promoted API contract until focused behavior tests land.

Working Definition

The model is public when symbol tooling can preserve the text-box payload through load and write paths.

StandardPropertyKey

Rationale

Public code needs stable symbolic names for KiCad's standard symbol properties.

Purpose

Define the canonical property keys used by symbol helpers and cleanup tools.

Test Requirements

Tests must cover standard property lookup through public mutation helpers.

Working Definition

The enum is public when callers can avoid hard-coded string variants for common symbol properties.

StandardSheetPropertyKey

Rationale

Hierarchical-sheet metadata needs the same named-key ergonomics as symbol properties.

Purpose

Define the canonical keys for sheet name and sheet file properties.

Test Requirements

Tests must cover sheet property mutation and sheet-file access through public helpers.

Working Definition

The enum is public when sheet tools can avoid raw KiCad property strings for standard fields.

PropertyId

Rationale

KiCad property IDs have stable numeric meaning that should be named in public code.

Purpose

Expose standard property ID values and the user-property start offset.

Test Requirements

Tests must verify the enum remains integer-compatible and preserves expected values.

Working Definition

The enum is public when property creation can choose deterministic KiCad IDs.

PinElectricalType

Rationale

Pin electrical classifications are stable schema data for symbol and netlist consumers.

Purpose

Expose KiCad pin electrical types as a public enum.

Test Requirements

Tests must keep the enum in the promoted API contract and add behavior checks when netlist rules depend on it.

Working Definition

The enum is public when callers can classify pins without raw strings.

PinGraphicStyle

Rationale

Pin shapes affect symbol drawing and must remain explicit for renderers.

Purpose

Expose KiCad pin graphics styles as a public enum.

Test Requirements

Tests must cover graphical style effects such as inverted-pin bubble geometry.

Working Definition

The enum is public when symbol renderers can branch on pin style without raw strings.

LabelShape

Rationale

Hierarchical and global labels use shape data to select decoration geometry.

Purpose

Expose KiCad label shape values for schematic model and rendering code.

Test Requirements

Tests must cover decoration geometry selected from label shape and orientation.

Working Definition

The enum is public when schematic tools can interpret label IO direction without raw strings.

Pad

Rationale

Pads are central to PCB geometry, connectivity, fabrication output, and assembly projection.

Purpose

Represent one KiCad footprint pad with geometry, layers, drill, custom primitives, and metadata.

Test Requirements

Tests must cover common pad shapes, NPTH behavior, drills, and custom primitives.

Working Definition

The model is public when callers can inspect and convert pad geometry without raw board tokens.

FpText

Rationale

Footprint text drives reference/value rendering and silkscreen automation.

Purpose

Represent footprint text with type, string, layer, effects, visibility, and placement.

Test Requirements

Tests must cover basic IR conversion, hidden text, empty text, and effects mapping.

Working Definition

The model is public when footprint tooling can edit and render text safely.

FpLine

Rationale

Footprint line primitives are a common carrier for fab, silkscreen, and courtyard outlines.

Purpose

Represent one footprint line with layer and stroke attributes.

Test Requirements

Tests must confirm line conversion preserves coordinates, layer, and width.

Working Definition

The model is public when outline cleanup can manipulate footprint lines directly.

FpTextBox

Rationale

Footprint text boxes need explicit borders, wrapping, and variable expansion for rendering parity.

Purpose

Represent footprint-local text boxes with geometry, layer, effects, stroke, and fill.

Test Requirements

Tests must cover parsing border flags and emitting both border and expanded text ops.

Working Definition

The model is public when renderers can preserve text-box geometry through footprint conversion.

GrLine

Rationale

Board graphics lines carry outlines, documentation geometry, and mechanical annotations.

Purpose

Represent board-level line graphics with layer and stroke data.

Test Requirements

Tests must verify coordinate handling and record-level layer metadata.

Working Definition

The model is public when board graphics can be converted without S-expression access.

GrText

Rationale

Board text participates in fabrication drawings, labels, and render-cache generation.

Purpose

Represent board text with layer, effects, placement, variables, and optional render cache.

Test Requirements

Tests must cover text conversion, empty/hidden behavior, variables, and render-cache attachment.

Working Definition

The model is public when board text can be edited and rendered through typed APIs.

GrTextBox

Rationale

Board text boxes combine framed geometry, text layout, and render-cache behavior.

Purpose

Represent board-level text boxes with text, geometry, stroke, fill, layer, and effects.

Test Requirements

Tests must cover border/text IR emission, default alignment, and knockout cache synthesis.

Working Definition

The model is public when board text-box rendering can be validated independently.

Net

Rationale

Board net records are needed by connectivity, highlighting, and downstream design views.

Purpose

Represent a KiCad PCB net code and name as a typed public model.

Test Requirements

Tests must keep the model in the promoted API contract and add behavior checks as board-net APIs grow.

Working Definition

The model is public when downstream tools can pass net identity without raw board records.

Layer

Rationale

Layer identity and ordering are shared by parsing, rendering, and fabrication workflows.

Purpose

Represent one board layer with KiCad ordinal, canonical name, type, and user name.

Test Requirements

Tests must keep the model in the promoted API contract and add behavior checks for layer mutation APIs.

Working Definition

The model is public when callers can reason about board layers without raw tuple structures.

KiCadProjectSidecar

Rationale

Project sidecar files may become part of downstream cruncher workflow state.

Purpose

Represent known project-adjacent paths in a typed way without making them mandatory.

Test Requirements

Tests must keep the model in the promoted API contract until sidecar behavior is expanded.

Working Definition

The model is public when project discovery can expose optional adjacent files predictably.

ProjectVariant

Rationale

Variant-aware design views need stable names and descriptions from project metadata.

Purpose

Represent one KiCad project variant in a small typed model.

Test Requirements

Tests must cover variant lookup, iteration, and equality through project helpers.

Working Definition

The model is public when downstream tools can select variants without raw JSON traversal.

KiCadPlotterDocument

Rationale

The plotter IR document is the common exchange object between KiCad models and SVG renderers.

Purpose

Contain plotter records, bounds, source metadata, and JSON serialization for a rendered document.

Test Requirements

Tests must cover dict/file round-trip, normalization, schema checks, and source-path handling.

Working Definition

The model is public when downstream code can store and replay KiCad drawing operations.

KiCadPlotterRecord

Rationale

Renderers and design views need per-object grouping around plotter operations.

Purpose

Represent one logical plotted object with operation list, object metadata, layers, and bounds.

Test Requirements

Tests must cover record round-trip and preservation of operations and bounds.

Working Definition

The model is public when object-level SVG groups can be built from IR records.

KiCadPlotterOp

Rationale

Individual plotter operations are the stable primitive contract for renderers.

Purpose

Represent one drawing operation with kind, payload, optional index, and convenience constructors.

Test Requirements

Tests must cover constructors, enum coercion, dict round-trip, and invalid payload checks.

Working Definition

The model is public when all renderer inputs can be expressed as typed plotter operations.

KiCadPlotterOpKind

Rationale

Operation kinds define the durable drawing vocabulary used by the IR.

Purpose

Enumerate supported plotter operation kinds with names aligned to KiCad drawing behavior.

Test Requirements

Tests must keep the enum synchronized with the expected plotter virtual operation set.

Working Definition

The enum is public when renderer code can dispatch without stringly-typed conditionals.

KiCadFillType

Rationale

Fill semantics cross symbol, schematic, footprint, PCB, and SVG rendering boundaries.

Purpose

Represent KiCad fill modes in the plotter IR.

Test Requirements

Tests must cover string and enum coercion plus conversion from source-model fill types.

Working Definition

The enum is public when IR producers and renderers agree on fill behavior.

KiCadLineStyle

Rationale

Dashed and solid stroke semantics must survive conversion into SVG.

Purpose

Represent supported KiCad line styles in the plotter IR.

Test Requirements

Tests must cover dash operation payloads and renderer-visible style values.

Working Definition

The enum is public when style-aware renderers can consume line style values directly.

KiCadHorizAlign

Rationale

Horizontal text alignment affects symbol, schematic, board, and IR SVG placement.

Purpose

Represent horizontal text alignment values in the plotter IR.

Test Requirements

Tests must cover text operation payloads carrying horizontal alignment.

Working Definition

The enum is public when renderers can align text without source-specific enums.

KiCadVertAlign

Rationale

Vertical text alignment is needed for KiCad-compatible symbol and board text placement.

Purpose

Represent vertical text alignment values in the plotter IR.

Test Requirements

Tests must cover text operation payloads carrying vertical alignment.

Working Definition

The enum is public when renderers can align text without source-specific enums.

KiCadPenAction

Rationale

Pen movement records preserve the original plotter stream semantics.

Purpose

Represent pen up/down action values for low-level plotter operations.

Test Requirements

Tests must cover string and enum round-trip through pen operations.

Working Definition

The enum is public when low-level plotter traces can be replayed without raw action strings.

KiCadEnvironment

Rationale

Applications need KiCad installation and configuration discovery without relying on legacy prefixed utility functions.

Purpose

Provide one object that owns KiCad executable discovery, beta-version selection, and user configuration path lookup.

Test Requirements

Tests must cover deterministic installation ranking, beta filtering, and versioned configuration directory discovery.

Working Definition

The class is public when downstream tools can find the active KiCad CLI and config roots through object methods.

KiCadFilterPipeline

Rationale

File-level cleanup is KiCad-format behavior and should be grouped behind an object API instead of package-level prefixed functions.

Purpose

Expose deterministic footprint, symbol, schematic, and PCB cleanup operations for applications that decide when to run them.

Test Requirements

Tests must keep the pipeline methods available and the L2 filter suite must exercise file-to-file behavior.

Working Definition

The class is public when callers can run all supported file filters without importing individual implementation functions.

KiCadNameIndex

Rationale

Library tools need fast symbol and footprint name discovery without parsing entire KiCad models or importing legacy prefixed helpers.

Purpose

Provide one object for extracting names from KiCad library files, building directory indexes, and finding matching assets.

Test Requirements

Tests must cover quoted, unquoted, fallback, real-corpus, and recursive index-building cases for symbols and footprints.

Working Definition

The class is public when downstream library indexes can discover KiCad symbol and footprint names through object methods.