intake

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Markdown

func Markdown(s *Skeleton, full bool) string

Markdown renders the Skeleton as the intake.md sections. It can only print what the Skeleton holds, which is no net name. full selects the parts view, false (default) printing the BOM by distinct type and true the per-component AVL.

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

func Build(m check.Model) *Skeleton

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL