feat(pcb): export revision-bound Specctra DSN - #338
Conversation
0011119 to
31b7628
Compare
|
Release-integration note: Konnect v0.10.0 added four placement tools while this branch was in review. That blind-side change conflicted with every generated tool-count surface, so the earlier green CI no longer represented the released registry. I rebased onto current main and synchronized this PR at 215 registered / 221 total tools. I also corrected the new public argument to manifest_output_path, added structured DSN/SES/bridge capability facts to the export result, and added a Freerouting v2.3.0-owned DSN corpus fixture alongside the real KiCad board fixture. The focused Specctra suite passes (10 passed, 1 live Java test intentionally ignored), and all six documentation/count contract tests pass. Fresh CI is now authoritative. |
31b7628 to
b260085
Compare
b260085 to
40cd690
Compare
|
Post-guidance-stack refresh: merged current |
User-visible outcome
Adds
export_specctra_dsnto thepcb_exporttoolset. A supported board that is open in KiCad PCB Editor can now produce a deterministic Specctra DSN and a revision-bound reverse manifest without Python, SWIG, GUI automation, or direct board-file editing.Part of #337. This is the first adapter in the agreed three-PR series; it does not advertise end-to-end autorouting or SES import.
Design
GetOpenDocuments.SaveDocumentToStringbefore and after querying KiCad's effective netclass values.topola_specctrafor the DSN AST/parser/serializer while retaining Konnect-owned KiCad lowering and fail-closed validation.The deliberately narrow first profile supports two copper layers, front-side SMD or plated-through footprints, circle/rectangle pads, one closed straight-line outline, and no existing routing, zones, custom DRC rules, local clearance overrides, pad offsets, or removed-unused-layer pads. Unsupported input is refused rather than approximated.
Compatibility and migration
This adds one public MCP tool and updates the synchronized catalogue from 210 to 211 registered tools (217 including meta-tools). No existing tool, schema, config key, path, or behavior changes. There is no persisted migration.
The manifest schema starts at version 1 so the SES importer can reject incompatible artifacts explicitly in PR 2.
Tests
Passed locally:
cargo test --workspace --locked --lib --testscargo test --workspace --locked --doccargo clippy --workspace --locked --all-targets -- -D warningscargo fmt --all -- --checkFREEROUTING_JAR=/path/to/freerouting-2.3.0.jar cargo test -p konnect-core freerouting_accepts_exported_fixture -- --ignoredThe opt-in engine parity test ran against the installed Freerouting 2.3.0 JAR. Freerouting loaded the generated DSN, completed routing, exited successfully, and produced a non-empty SES. IPC envelope and value conversion are covered with a mock KiCad server. A live-GUI test is intentionally not part of CI because it requires an open disposable board and KiCad API socket.
Risk and rollback
The main risk is incorrect interchange semantics. The first profile minimizes that surface, round-trips every generated DSN through the Specctra parser, and tests the artifact with Freerouting itself. The tool never mutates the live board and never replaces an output file.
Rollback is a straight revert of this commit; no board or config migration is required.