app
KiCad - the KiCad Bridge
Public Made by Adomby adom
Reference implementation of the KiCad bridge: multi-instance Python server, forward path via kicad-cli, reverse path via in-process plugin. Most complex of the three bundled bridges.
← Commit history
plan: phase 3 in code, waiting on ConfRoomROG
2 files changed
+2−1
docs/rust-port-plan.md+1@@ -13,6 +13,7 @@ Written 2026-09-11 from a full audit of the 0.9.350 source, the Adom Bridge (ab) | 2026-09-11 | Phase 1, second pass: 33 verbs in the native binary. Added the netlist group (extract_netlist, trace_net, find_connections, analyze_connections), the lint group (lint_board, lint_schematic, lint_library, format_upgrade), libraries and settings (list_symbols, list_footprints, adom_library_status, get_settings, set_settings, list_design_rules, set_design_rules) and maintenance (model_check, pcm_list, pcm_install, pcm_uninstall, check_for_updates). 73 tests in kicad-core, including parser tests on real KiCad 10 DRC and ERC reports produced by service-kicad. The HTTPS client sits behind a `net` cargo feature so the macOS type-check runs from a box without a darwin C toolchain. Smoke on ConfRoomROG: every verb answers with the Python shapes; one fix found there (a kicad-cli plot check that times out on a 500-symbol stock library was reported as a refusal, in Python too). PCM zip handling is std-only (inflate and SHA-256 written in the crate) so the binary carries no zip or crypto dependency. Schematic edit, misc (ipc_api, export_molecule, errors, log_tail) and install groups in progress. | | 2026-09-11 | Phase 1, third pass: 50 verbs. Schematic edit in place landed (place_symbol, wire, label, move, delete, set_property: lossless s-expression round trip, .bak per write, ERC before and after through kicad-cli with the delta reported; verified on KiCad 10.0.5, and service-kicad ERC accepts the edited sheets in the test suite). Install group landed (install_library, install_symbol, install_footprint, install_library_bundle, adom_library_heal, make_part_project, export_part). Misc group landed (ipc_api, export_molecule, errors, log_tail) plus the first-run seeding in core. Uninstall is the full Python contract (all-artifacts and testResidue modes, verified on ConfRoomROG). 119 tests. The native zip was installed through ab itself on ConfRoomROG (pinned cache, spawn kind exe) and the verb runner drove it over the relay: every ported, runner-visible verb passes (35 of 35, the rest skip by design), the 47 window and routing verbs fail as expected until their phases. One contract fix from that run: ab forwards bare verb names, and the binary now accepts both forms. Phase 2 (routing on the Rust IPC client) in progress. | | 2026-09-11 | Phase 2 landed in code: the nine routing verbs on `kicad-ipc-rs` (revision is the SHA-256 of the board as KiCad serialises it, one native commit per call, DRC on a disposable snapshot with `--refill-zones`), the four file-based routing verbs on a Rust port of the PCB parser (the routed file is byte-identical to the Python's apart from UUIDs), and `kicad_autoroute` with the ai engine returning a plan request and freerouting reserved for phase 2b. 139 tests; the six-net fixture routed on disk passes service-kicad DRC with zero errors. 59 verbs in the binary. Live IPC verification on ConfRoomROG is pending: the box dropped off the relay right after the phase 2 binary was staged (winvm went with it, which points at the network rather than the binary). Phase 3 started: the Windows and UI Automation crates cross-compile, the window-control surface is on the Platform trait, and the Windows implementation and the window verbs are being written in parallel. |+| 2026-09-11 | Phase 3 landed in code: the Windows layer (window enumeration with hung detection, process queries, background spawn with SW_SHOWNOACTIVATE, posted keys and clicks, WM_SETTEXT, native menu walk plus WM_COMMAND, button clicks through BM_CLICK with a deadline then UI Automation, in-process UIA invoke and set-value, foreground push and the one sanctioned bring-to-front with a measured result, placement, PrintWindow capture for the canvas probe, idle time), every cross-process call gated on a WM_NULL probe so a hung KiCad can never hang the bridge; the ab callback client with forwarded caller identity; the KiCad window model and dialog tables; and the 20 window verbs (launch, the open family with the rungs recorded as `mechanism`, the close family with discardChanges through the save prompt, dismiss_dialogs, window_info, state, screenshot_all through ab, send_key, click, place_footprint, enable_software_opengl). Progress dialogs are never dismissed; SendInput is not in the native build at all. 79 verbs, 160 tests, exe 3.5 MB. Live verification of phases 2 and 3 waits on ConfRoomROG, which has been off the relay since the phase 2 binary was resumed there; winvm came back on its own, so the box needs a look. | ## The goal in one sentence
rust/README.md+1−1@@ -8,7 +8,7 @@ The Rust port of the Adom KiCad Bridge. One binary per OS, no runtime to provisi |---|---|---| | `crates/kicad-platform` | The `Platform` trait and exactly one implementation compiled in per target: `windows.rs`, `macos.rs` (Kyle), `linux.rs` (Barrett). Install discovery, settings and documents dirs, quiet child processes; later window control, UI automation, dialog sweep and focus etiquette. | Yes, this is the only crate that is | | `crates/kicad-core` | Detection ordering, the kicad-cli runner and report parsers, KiCad file editing (phase 1b), IPC client (phase 2). Talks to the OS only through `kicad_platform::native()`. | No |-| `crates/kicad-bridge` | The binary: HTTP server (`/status`, `/command`), the verb catalog and the verb handlers. | No |+| `crates/kicad-bridge` | The binary: HTTP server (`/status`, `/command`), the verb catalog and the verb groups (one file per group, registered in `groups.rs`). | No | A verb that needs something the current OS does not implement yet returns `kicad_platform::unsupported("...")`: `errorCode: not_supported_on_platform`, the OS, and the owner's name in the hint. Readiness and diagnostics carry a `platform.capabilities` block so an AI can tell what this build can do before calling anything.