Open feature request

Add project-aware DRC and warn when single-file checks omit custom rules

John Lauer · 1mo ago

service-kicad 1.1.0, git 08def5a76503bd78100febd697ad48cd5d61f022, native KiCad 10.0.2. Linux CLI caller. Reproduced 9 September 2026; current CLI help and API source inspected.

A board must be checked with its actual .kicad_pro and .kicad_dru files to qualify a fab profile. service-kicad pcb drc FILE currently transmits only .kicad_pcb bytes, and pcb_drc in api/src/main.rs writes that body to a randomly named temporary board. Sibling project files and their matching stem are lost. There is no pcb drc-project CLI command or corresponding route in the inspected source.

Repro is attached as instapcb-rule-candidate.zip. rule-probe.kicad_dru includes a named negative control, depth-lab-proof-custom-rules-loaded, which disallows vias. The board contains two vias. Running the current CLI with the adjacent rules present produced the attached native report: 11 ordinary findings, but no named probe rule or disallowed-via finding. The report therefore proves only the single-file/default-settings path, not the submitted InstaPCB rules. Existing summary-count issue adom/service-kicad#3 is separate.

Please add a CLI project operation that safely packages the board, native project, custom rules and needed library tables; preserves the selected board stem; rejects path traversal, symlinks and ambiguous board selection; and runs native DRC in an isolated job directory. Return KiCad/service versions, hashes of the actual inputs, which settings/rules loaded, and native parse errors without falling back to defaults. For the existing single-file command, detect sibling project/rules locally and emit an actionable hint that they were omitted.

Acceptance: the attached negative-control rule must appear in the result; removing only the probe rule must then exercise pad-pair spacing, via/PTH annular width, drill limits and edge/hole constraints from the selected profile. Include a malformed-rule case that fails visibly. Preserve detailed native violations and do not equate HTTP success with DRC pass. No service deployment or installed binary change was made during this report.

instapcb-rule-candidate.zip

rule-probe-single-file-drc.json

2 Replies

John Lauer · 1mo ago

Draft implementation is available in service-kicad PR2, from local source commit 83fa3c4470356ce5a6e1f5748c88f223b5aa70ea, candidate 1.1.1-dev.0.

The CLI/API preserve an explicitly selected board stem, native project/rules and explicit library inputs. Archive validation rejects unsafe paths, links and duplicates; job concurrency and native child lifetime are bounded. Responses carry input hashes and native diagnostics. An optional named negative-control observation returns a failure when absent, preserving the full report. The old command emits PROJECT_RULES_OMITTED for detected siblings.

Validation completed: 18 Rust tests, plus five CLI/HTTP cases from the committed source. The self-contained verification/test_project_drc.py reproduces the HTTP cases with an explicitly labeled protocol test double and cleans up its own server. Attached results do NOT represent native KiCad DRC. Shared production remains unchanged.

Required before release: execute the supplied real rule-probe project on KiCad, verify native malformed-rule behavior and profile constraints, then remove only the probe in a separate copy. Input hashes and protocol tests alone do not qualify manufacturing rules.

r76-project-transport-self-contained.json

service-project-drc-tests-r76.txt

John Lauer · 1mo ago

Merged PR 2 into master (commit 2b18ad1): adds the project crate, the /kicad/pcb/drc-project route, the pcb drc-project CLI verb, the PROJECT_RULES_OMITTED hint on single-file DRC, and the API/README/SKILL docs.

Leaving this issue open until the release gate in the PR body is done: run the attached rule-probe project on native KiCad 10, confirm the negative-control rule shows up in the native violations, verify malformed-rule behavior, then re-run with only the probe removed. The shared service has not been redeployed with this change yet.

Log in to reply.