Open bug report

pcb drc (and the kicad-cli shim) still check boards against KiCad's default rules; the drc-project fix never reached GitHub or prod

Ray · 9d ago

service-kicad pcb drc X.kicad_pcb uploads only the .kicad_pcb. So does the container kicad-cli shim, because it routes pcb drc and pcb export to that same command. The board's rules sit beside it, in X.kicad_pro (board.design_settings.rules) and X.kicad_dru (custom rules). They never reach the service, so production DRC runs against KiCad's default rules. A board that breaks its own rules passes, and anyone checking a board through the service or the shim gets the wrong answer, with exit 0.

#4 asked for this and PR 2 answered it with a separate pcb drc-project verb and a /kicad/pcb/drc-project route. That code lives only in this page's source (package 1.1.1). It is not on GitHub adom-inc/service-kicad main, which is still at 08def5a, and that is what the prod watchdog builds from. So:

  • the live service returns 404 for POST /kicad/pcb/drc-project (checked 2026-10-15);
  • the installed CLI (1.1.0) does not print the PROJECT_RULES_OMITTED warning either (#3 has the same note from Colby about the 1.1.1 package shipping the pre-fix binary);
  • even with PR 2 deployed, plain pcb drc (and therefore the shim) would still check against the defaults. It would only warn.

Repro

The board has one 0.2 mm track. thin.kicad_dru sets (constraint track_width (min 0.3mm)). A second copy sits beside a thin.kicad_pro that has min_track_width: 0.25.

Ground truth from local kicad-cli 10.0.1 (the ghcr.io/kicad/kicad:10.0.1 image) with the files beside the board:

track_width: Track width (board setup constraints min width 0.3000 mm; actual 0.2000 mm)    # .kicad_dru
track_width: Track width (board setup constraints min width 0.2500 mm; actual 0.2000 mm)    # .kicad_pro

Live service, through the installed CLI and the shim:

$ service-kicad pcb drc thin.kicad_pcb
errors: 0  warnings: 0  total: 0
  [warning] track_dangling: Track has unconnected end
$ kicad-cli pcb drc --format json --output shim.json thin.kicad_pcb    # shim -> service
violations: track_dangling only

Fix proposed

GitHub PR: https://github.com/adom-inc/service-kicad/pull/4

When X.kicad_pro or X.kicad_dru sits beside the board, plain pcb drc and the other pcb exports upload a tar of the board plus those files. The service extracts them into one directory, so kicad-cli loads the project. A raw .kicad_pcb body still works unchanged, and the shim picks the fix up without changes of its own. The tests include an end-to-end kicad-cli DRC test, and each one fails with the fix reverted. The server changed, so the service has to be redeployed.

John, there are two design points where this differs from PR 2. They are yours to decide:

  1. It fixes the existing verb in place rather than adding a second one, so the shim and every existing caller get the right answer without changing.
  2. Against an older service that rejects the tar, the CLI retries with the board alone and prints a loud warning. #4 asked for "no fallback to defaults". Making that a hard failure is a one-line change.

The two approaches can also be combined: drc-project's hashing, rule-probe and library tables, with pcb drc sending the siblings automatically. The more urgent problem is that the page source and GitHub main have diverged, so none of PR 2 or PR 3 is deployed.

2 Replies

Ray · 9d ago

GitHub PR https://github.com/adom-inc/service-kicad/pull/6 ports wiki PRs 2 and 3 (and the 1.1.1 shim/install changes) onto main after #4, reconciled: pcb drc sends the .kicad_pro/.kicad_dru and keeps PR 3's honest counts; pcb drc-project stays as the strict form (requires the project files, fails with PROJECT_FILES_MISSING otherwise, own route). Release 1.2.0 is built and staged, not published; waiting on review.

Log in to reply.