You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The export boundary now enforces a shared postcondition: every advertised artifact must exist, be a regular file, and contain data. Gerber and drill exports additionally require the expected output set, while project snapshots propagate either schematic or PCB export failure instead of returning phantom paths.
Manufacturing packages now expose complete; incomplete packages return an MCP error and omit upload instructions. The file list is assembled from verified paths rather than a raw directory scan, so stale or empty files cannot masquerade as current output.
This PR is intentionally stacked on #269. Its first commit is the export-option implementation from that PR; after #269 merges, the remaining diff is the focused artifact-verification commit cda33a3.
Compatibility and rollback
snapshot_project now fails when either requested PDF is missing or empty. This is an intentional correction of false-success behavior.
Requested drill output is mandatory for a complete manufacturing package.
Manufacturing responses add complete; partial packages use isError: true and no longer include upload instructions.
KiCad project sources remain read-only throughout export and validation.
cargo test --workspace --locked --lib --tests: all new tests pass; the workspace reaches 555/558 konnect-core tests, with only the same three pre-existing local update_symbols_from_library_* failures caused by the installed KiCad Device:R library shadowing the test fixture
real MCP manufacturing export against a temporary copy of the Voice Satellite six-layer board: complete: true, 14 verified non-empty artifacts, including all 11 requested Gerber plots plus PTH and NPTH drill files
real MCP project snapshot: verified non-empty schematic and PCB PDFs
fake-CLI regression tests confirm that a zero exit status without output fails closed
#266 is merged and covers this branch's export_pdf rewrite (plus the SVG half this one lacked). The artifact-verification core here — issue #252, checking every reported export exists and is non-empty — is still wanted and still yours to land: please rebase over current main so this PR keeps only that. Note snapshot_project's let _ = swallow (#252) is the highest-value target.
The premise here — a reported artifact must exist and be non-empty — holds up
well. One case it does not reach yet, found while measuring something else: exporting a hierarchical schematic to SVG writes one file per sheet.
KiCad 10.0.4, its own bundled pic_programmer demo, through kicad-cli sch export svg:
A leaf sheet yields one file; a root with children yields one per sheet.
export_schematic_svg returns output_dir.join("<stem>.svg"), so the verify_nonempty_file this PR adds covers the root sheet and the child sheets
are neither verified nor reported. On a hierarchical schematic the caller never
learns they were written at all.
This is kicad-cli's own asymmetry rather than anything on this side:
PDF puts every sheet in one document; SVG cannot, so it takes a directory and
names the files itself.
Worth folding into this PR? Verifying the child files means enumerating them,
and once enumerated, returning them is nearly free. It does change export_schematic_svg's return type, which #277 is also touching. If you would
rather not, #291 takes it: apply the caller's stem to every file written and
report them all.
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
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
kicad-cliexits successfullyCloses #252
Approach
The export boundary now enforces a shared postcondition: every advertised artifact must exist, be a regular file, and contain data. Gerber and drill exports additionally require the expected output set, while project snapshots propagate either schematic or PCB export failure instead of returning phantom paths.
Manufacturing packages now expose
complete; incomplete packages return an MCP error and omit upload instructions. The file list is assembled from verified paths rather than a raw directory scan, so stale or empty files cannot masquerade as current output.This PR is intentionally stacked on #269. Its first commit is the export-option implementation from that PR; after #269 merges, the remaining diff is the focused artifact-verification commit
cda33a3.Compatibility and rollback
snapshot_projectnow fails when either requested PDF is missing or empty. This is an intentional correction of false-success behavior.complete; partial packages useisError: trueand no longer include upload instructions.Validation
cargo test --workspace --locked --lib --tests: all new tests pass; the workspace reaches 555/558konnect-coretests, with only the same three pre-existing localupdate_symbols_from_library_*failures caused by the installed KiCadDevice:Rlibrary shadowing the test fixturecargo test --workspace --locked --doc: passcargo clippy --workspace --locked --all-targets -- -D warnings: passcargo fmt --all -- --check: passcomplete: true, 14 verified non-empty artifacts, including all 11 requested Gerber plots plus PTH and NPTH drill files