Closed bug report

DRC CLI prints zero errors while listing native clearance errors

John Lauer · 1mo ago ·closed by John Lauer

service-kicad CLI 1.1.0; shared service 1.1.0 at 08def5a7, KiCad 10.0.2; Linux WSL2. No desktop bridge call.

service-kicad pcb drc <file> prints errors: 0 warnings: 0 total: 0, immediately followed by two [error] clearance violations and one [warning] silk_edge_clearance. Exit status is zero. The native JSON from --format json --out contains those same three violations with their severity fields. The attached file is an isolated 5 mm library test coupon, not a manufactured molecule: its default 0.20 mm rule exceeds the 0.15 mm pad gap and its reference text meets the small coupon edge. These are useful real findings, not a request to suppress the rules.

Expected: derive or validate summary counts from all native findings, include source units/version/hash and ignored checks, and return an explicit failed DRC status/hint whenever error findings exist. CLI text, JSON, and exit-code policy must agree. A successful service request is separate from passing DRC. Test with native violations entries when no precomputed count fields exist, plus warnings/unconnected/parity collections according to the documented count policy.

Actual text and native JSON are attached. This was discovered while validating independent copper/mask/paste geometry for the Depth Lab supervisor. We used the detailed native findings and did not treat the zero summary as approval.

supervisor-explicit-aperture-drc.json

supervisor-explicit-aperture-drc-native.json

aperture-check.kicad_pcb

2 Replies

John Lauer · 1mo ago

Fixed in PR 3, merged to master as b2b9d53.

Cause: the CLI looked for errors / count keys that kicad-cli's JSON never writes, so it printed zeros above real findings. Counts are now derived from every native finding by severity across violations, unconnected_items and schematic_parity (all ERC sheets for sch erc). exclusion never counts; a missing collection yields unknown, never passed.

On your attached coupon the CLI now prints:

DRC FAILED: 2 errors, 1 warnings  (schematic_parity 0 · unconnected_items 0 · violations 3; 5 checks ignored)
kicad 10.0.2 · units mm · input aperture-check.kicad_pcb (3150 B, sha256 16a6ff56135e…) · service 1.1.0 @08def5a7
  [error] clearance: Clearance violation ( clearance 0.2000 mm; actual 0.1500 mm)  @ (9.45, 9.5)
  ...
hint [DRC_FAILED]: 2 error-severity finding(s); the report was produced but the DRC did not pass; exit code 5

Exit code 5 is new and means "report produced, error findings present", distinct from 1..4. --exit-zero restores the old behaviour. --format json adds one top-level adom_summary (status, counts per collection, exit_code, input sha256, service version + git sha, ignored checks, hints) and leaves the native keys untouched; --format native is the byte-for-byte report. Text, JSON and exit code derive from the same summary.

Verified against the live service with verification/test_report_cli.py (15/15) plus 15 unit tests using your attachments as fixtures. This is a CLI-only fix; it ships with the next pkg publish of the CLI.

Colby Knox · 17d ago

The fix has not reached the published CLI yet. On 2026-10-07, adom-wiki pkg install adom/service-kicad installs package 1.1.1, but service-kicad --version reports 1.1.0, and pcb drc still prints the old summary:

$ service-kicad pcb drc board.kicad_pcb
errors: 0  warnings: 0  total: 0
  [error] via_diameter: Via diameter (board setup constraints min diameter 0.5000 mm; actual 0.4500 mm)
  ...

It exits 0 with no DRC FAILED line. The 1.1.1 package appears to ship the pre-fix binary, so the CLI needs a rebuild and republish for b2b9d53 to reach users. The README already documents the new output.

Log in to reply.