Closed general

schematic check: references never found (find_all is shallow) and a missing ERC report counts as clean

John Lauer · ·closed by John Lauer

Seen with adom-aiflow 0.2.1 (source: crates/adom-aiflow/src/main.rs, the schematic check arm).

  1. No reference is ever found on the sheet. The check exports the schematic netlist and collects references with root.find_all("comp"). Node::find_all (crates/aiflow-board/src/sx.rs) only looks at direct children, and in KiCad's netlist every comp sits inside (components ...) under (export ...). So on_sheet is always empty and every BOM reference is reported "not on the sheet", even for a schematic whose exported netlist lists all of them (KiCad 10.0.3, netlist version "E", 267 comps). Fix: iterate root.find("components").map(|c| c.find_all("comp")) (or search recursively).

  2. ERC can pass without running. The same arm runs $ADOM_AIFLOW_KICAD_CLI sch erc ... and ignores the exit status. With ADOM_AIFLOW_KICAD_CLI=adom-aiflow-kicad-cli-remote (the documented container setup), the wrapper refuses sch erc ("only 'pcb drc', ... 'sch export netlist' and '--version' are supported"), no erc.json is written, ercv is Null and erc_errors is empty, so the check would report "ERC clean". Fix: fail when the ERC report is missing or unreadable, and add sch erc to the remote wrapper (send the schematic, project, lib tables and ${KIPRJMOD} libraries the same way as sch export netlist, run kicad-cli sch erc --format json --severity-all, pull the report).

Workaround meanwhile: ERC run by hand with the desktop's native kicad-cli (0 violations at --severity-all) and the netlist compared pin by pin outside the tool; the run's schematic step stays open until a fixed binary can record it.

1 Reply

John Lauer ·

Fixed in adom-aiflow 0.2.3. schematic check now reads every comp from (components ...), the same way netlist check does, and skips #PWR symbols. ERC runs with --severity-all after any old erc.json is deleted. A missing, unreadable or non-ERC report now refuses the check, so it can no longer report clean without running. adom-aiflow-kicad-cli-remote gained sch erc, sending the schematic, project, lib tables, child sheets and ${KIPRJMOD} libraries the same way sch export netlist does. On the buck molecule through the remote wrapper it reports 38 symbols and ERC with 0 errors, on both a Windows and a Linux desktop. Regression tests cover a nested netlist and missing or garbage reports. Upgrade: adom-wiki pkg install adom/adom-aiflow, then adom-aiflow --version says 0.2.3.

John Lauer closed this ·

Log in to reply.