Conversation
korkin25
marked this pull request as ready for review
September 17, 2026 19:52
Collaborator
|
Please correct these items before final review:
The missing independent KiCad load is explicit validation debt rather than a merge blocker for this focused saved-library change: hosted CI is green, the syntax/readback tests use a KiCad-authored fixture, and no live board is mutated. The items above are deterministic blockers on the current head. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #296.
create_footprintandedit_footprint_padcan only describe a circular hole:drillis a scalar diameter. KiCad supports(drill oval width height), soplated slots — connector shields, USB-C mechanical pads, keyed headers — cannot
be authored through the library tools today. Saved oval drills are already
readable through
get_footprint_info(include_pads=true); this PR adds thematching write path so a slot can be created and edited, not only inspected.
Approach
Extend the existing
drillargument instead of adding a tool: it accepts eitherthe current positive scalar diameter or an explicit object,
{"shape":"oval","width":0.6,"height":1.6}, in pad-local millimetres. Padrotation rotates the hole, so no separate drill-rotation concept is introduced.
One helper (
footprint_drill_sexp) owns schema, validation and serialization forboth tools, so creation and editing cannot drift apart.
Editing now replaces the complete direct-child
(drill …)block found by theS-expression parser rather than truncating at the first
). A drill that carriesa nested
(offset …)is refused with an explicit error instead of silentlydropping the offset; creating or clearing offsets stays out of scope and is
tracked as the separate follow-up under #296.
Architectural fit
Extends existing library tools and the shared KiCad S-expression handling. No new
tool, transport, service, dependency, or workaround — tool names and counts are
unchanged, so no registry or doc-count update applies.
Branch and dependencies
mainat9d33cf0c239257f41a178cd26a2513d6e568d1c0.db08e2670eb894206532a4d3994464b9ca03a092.and generic regression coverage for
create_footprint/edit_footprint_pad.This does not close #296; the remaining generation controls stay outside its scope.
Compatibility and safety
Public schema change, backward compatible:
drillbecomes aoneOfof theexisting positive number and the new closed oval object. Every call that works
today keeps working and keeps serializing as
(drill 0.8); no migration needed.The oval object accepts exactly
shape,width,height. Dimensions must benumeric, finite, strictly positive, and fit inside the pad size. A drill is only
accepted on
thru_hole/np_thru_holepads. Validation runs for every padbefore anything is written, so an invalid request never leaves a partially
written footprint — a rejected
create_footprintdoes not create the file atall, and a rejected
edit_footprint_padleaves the target byte-identical.Unrelated footprint content is preserved, verified against a KiCad-authored
fixture already in the repository. No IPC or live-board path is touched.
Validation
Changed tool behavior
{shape:"oval",width,height}in pad-local mm; omitteddrillkeeps current behavior. Schema asserted against the live tool definitions and validated withjsonschema.ovalshape, holes larger than the pad, and drills on SMD pads are refused withinvalid_argumentnaming the field (pads[i].drill).get_footprint_info(include_pads=true),source=file. No live PCB/IPC state required or claimed.(drill oval 0.6 1.6),(drill 0.8), pad rotation(at 0 0 90)and layers; typed readback reportsshape:"oval",size:{x:0.6,y:1.6}. Editing a KiCad-authored fixture changes exactly one substring and nothing else.(offset …)fails explicitly rather than producing an uncertain result.Commands run locally on this exact head (
db08e267), Linux, Rust 1.96.0:cargo fmt --all -- --check— clean.cargo test --workspace --locked --lib --tests(what CI runs) — 1910 passed, 0 failed, 31 ignored (pre-existing environment-dependent tests).cargo test --workspace --locked --doc— 8 passed, 0 failed, 2 ignored.cargo clippy --workspace --locked --all-targets -- -D warnings— clean, no warnings.cargo test -p konnect-core --locked oval_drill— five focused tests: scalar/oval schema acceptance, create+edit+typed readback round-trip with rotation, invalid payloads leaving files unchanged, offset-drill refusal, and preservation of a KiCad-authored footprint.Limitations: creating, editing or clearing a drill
(offset …)remainsunsupported — an existing offset is preserved on unrelated edits and refused on a
drill edit. Arbitrary non-oval cutouts stay out of scope and belong to the
Edge.Cutswork.Review checklist
crates/konnect-core/src/tools/library.rs.upstream/main, has no merge conflicts, and CI passed on this exact head — all ten hosted checks green ondb08e267(run 35266667047), including Check & Test on ubuntu, macOS and Windows.upstream/main, not a release tag.docs/NAMING_CONVENTIONS.md; thedrillfield keeps its name and gains a compatible alternative form, reusing the existingshape/width/heightvocabulary.Marked ready for review after all ten hosted checks passed on this exact head.
That is the author's readiness only — review and the
status:*workflow labelremain the maintainer's decision. No merge or auto-merge is requested, and no
status:ready-to-mergeis claimed.🤖 Generated with Claude Code