Skip to content

Exchange formats ​

This section defines data representations independently of the transport carrying them. A viewer facet sent over WebSocket and the equivalent static facet use the same data contract; framing and sequencing belong to Communication.

Format inventory ​

RepresentationPurposeAuthoritative definition / detail
BoardCanonical compiled geometry, connectivity, provenance and findingscore/model.ts, compiler architecture
SiteData and facetsViewer-oriented records split by consumer demandcore/site-data.ts, core/site-facets.ts
Packed shapesItem-indexed polygon rings, coverage and openingscore/site-shapes.ts
SelectionShared board/target/snapshot focus statecore/selection.ts, interaction state
Diagnostic recordsRule, severity, entity references, location and optional evidenceFindings, core/finding.ts
BrowserModulePackaged virtual project for browser compilationBrowser module format, currently format 1
Manufacturing setGerbers, drills, BOM, placement, manifest, zip and SVGFabrication files
Model descriptors and meshesGenerated/file model placement and converted geometry3D descriptors, step/binary.ts
Library packageExported parts/circuits and built boards consumed by another projectLibrary packaging

The dedicated Viewer records and snapshots page defines headers, packed shapes, source locations and envelopes. Model mesh binary specifies the byte layout of converted geometry.

Identity and coordinates ​

A numeric item ID is local to a compile. Cross-compile relationships use the declared references, UIDs and snapshot context. Reusing an old numeric ID after a new snapshot can select an unrelated item. A UID derives from source identity; edits can change it, so a UID is not a promise of permanence through arbitrary source rewrites.

Compiled board geometry uses millimetres and y-down coordinates. Source positions may use grids or explicit units; conversion happens before they become board coordinates. Model-local positions and placement transforms must be interpreted in their documented frames. LSP positions use zero-based lines and UTF-16 characters, while compiler source ranges use their own declared representation; do not copy coordinates between these formats without conversion.

Runs, snapshots and event cursors are different identifiers: snapshots use <session>.<run> and event cursors use <session>:<seq>. They cannot be sorted or substituted as if they were the same field.

Viewer facets ​

FacetPrincipal contents
metaBoard identity, rules, stackup, bounds, nets, footprints and edit availability
schSchematic drawing
layersLayers, holes, source ranges, item rows and routing records
shapesGeometry rings, face coverage and openings
model3D model representation
findingsDRC/ERC, ratsnest, connectivity and statistics
fabBOM, fabrication/download metadata and timings

The FACETS table is the authoritative key-to-facet and facet-to-view mapping. Consumers must not assume that loading one facet supplies another. Streaming identity, invalidation and hashes are specified in Viewer loading.

Packed rings use parallel arrays: ids names each item's numeric ID, n gives that item's ring count, len gives each ring's point count, and xy concatenates x/y pairs. Interpret these arrays together and use the shared pack/read helpers. Shape IDs are not indexes into the array of item rows.

Diagnostic and artifact semantics ​

A finding has structured identity and evidence; its rendered sentence is not a replacement for those fields. Drawing views display the rule/type. The checks viewer formats the full record and can copy it as Markdown. Preserve optional evidence fields when carrying findings between consumers.

The fabrication contract distinguishes generated files, checked output and stale retained output. STATUS: ORDERABLE describes the implemented checks; it does not validate electrical intent. PCB SVG is an export with the https://pcb.svg/ns/1 metadata namespace, not a complete editable-source round trip.

Compatibility boundaries ​

Protocol versions, browser-module format numbers, package versions and internal cache identities are separate mechanisms. There is no universal schema version that automatically makes every record compatible. Do not infer a portable interchange guarantee from a cache's JSON extension or a TypeScript interface's existence.

Most exact fields currently live in shared TypeScript declarations. The repository does not provide a complete language-neutral JSON Schema suite for every representation. A non-TypeScript integration must implement validation against the declared version and test fixtures; additional generated schemas remain a conformance improvement, not a shipped guarantee.

See Conformance for schema checks, source/display equality, round-trip tests and release coverage.

MIT licensed. A proof of concept, pre 0.1.