Documentation
¶
Overview ¶
Package intake produces a SANITIZED, deterministic summary of a design, the factual skeleton the /design-intake onboarding workflow builds on (WS3-091). Its confidentiality guarantee is STRUCTURAL. The Skeleton type has no field that can hold a net name or a net-to-net connection, so an intake summary cannot leak the confidential parts of a design (net names, topology, layout). It carries only counts, device classes, part identities (the AVL/BOM view), anomaly kinds + ref-des, and nominal voltages. The /design-intake skill runs this first, then layers judgment on top.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Anomaly ¶
type Anomaly struct {
Kind string `json:"kind"`
Count int `json:"count"`
RefDes []string `json:"ref_des,omitempty"`
}
Anomaly is a detected read/design issue, reported as a kind + count + the ref-des it touches. It carries NO net name by construction, so a pin-net conflict names the pin's COMPONENT, not the nets.
type PartRow ¶
type PartRow struct {
RefDes string `json:"ref_des"`
MPN string `json:"mpn,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
Value string `json:"value,omitempty"`
Class string `json:"class,omitempty"`
}
PartRow is the AVL/BOM view of one component, part identity only, all safe to cross the boundary. MPN is empty unless a datasheet params tier is attached to the model.
type PartTypeRow ¶
type PartTypeRow struct {
Count int `json:"count"`
MPN string `json:"mpn,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
Value string `json:"value,omitempty"`
Class string `json:"class,omitempty"`
}
PartTypeRow is one distinct part type in the BOM, a (MPN, manufacturer, value, class) tuple and how many components share it. It collapses jellybean passives (1000+ identical caps into one row) and leaves distinct MPNs one per row. A manufacturer-name variant ("Murata" vs "MURATA") surfaces as two rows, which is the intended AVL-hygiene signal.
type Skeleton ¶
type Skeleton struct {
Components int `json:"components"`
Sections int `json:"sections"`
Nets int `json:"nets"`
ClassCount map[string]int `json:"class_count"` // device class (incl. family tags, so a TVS counts in both tvs and diode) -> ref-des count
Unclassified int `json:"unclassified"` // components the classifier could not place
PartTypes []PartTypeRow `json:"part_types"` // BOM grouped by (mpn, mfr, value, class), by count desc; the default view
Parts []PartRow `json:"parts,omitempty"` // per-component AVL, sorted by ref-des; emitted only with --parts full (else omitted to keep the summary small)
RailNominals []float64 `json:"rail_nominals"` // distinct name-derived rail nominals; the NET NAMES are dropped here
Anomalies []Anomaly `json:"anomalies,omitempty"` // read/design issues, by kind; never a net name
DatasheetGaps []string `json:"datasheet_gaps,omitempty"` // MPNs on the board with no seeded PartSpec (needs a params tier)
HasParams bool `json:"has_params"` // whether MPN / datasheet-gap columns are populated
}
Skeleton is the sanitized, deterministic intake summary. Every field is a COUNT, a device CLASS, a part identity (ref-des / MPN / manufacturer / value), an anomaly kind + ref-des, or a nominal VOLTAGE. There is no field for a net name, a connection, or any topology (CONSTRAINTS C16), so the boundary is enforced by this type. Same design + model => same Skeleton. The guarantee holds because the struct fits on one screen and every field's comment says what it drops.
ITS JSON IS HAND-ROLLED, the one exception to the CLI's protojson convention (C31, agni issue 603). A proto twin would have to carry this guarantee too, in a file people edit to add fields for other reasons, so it would survive only as long as everyone remembered it. Keep encoding/json until something needs intake on a wire, and design the guarantee then.
func Build ¶
Build computes the sanitized intake Skeleton from a loaded model. Counts come from the model's classified component set (mirroring the component.class relation), and rail nominals from the name-derived net.nominal_voltage fact, projected to the VOLTAGE only so the net name never enters the result.