refactor(ipc): share the IPC classification gate and board test mock - #334
Open
pauliuszaleckas wants to merge 1 commit into
Open
refactor(ipc): share the IPC classification gate and board test mock#334pauliuszaleckas wants to merge 1 commit into
pauliuszaleckas wants to merge 1 commit into
Conversation
Groundwork for a board graphic-delete tool, useful on its own: - with_ipc_classified moves to tools/mod.rs. It was about to exist twice verbatim, and it is the gate deciding whether a board file may be edited behind a live KiCAD — the one helper whose copies must not drift. - get_items_of_types_in asks for several object types in one GetItems. The field is repeated and every send_command dials a fresh socket, so four types cost one round trip instead of four. - delete_items_in addresses a named document, like the other _in methods. delete_items delegates to it; deleting from the first open board rather than the requested one was the same hazard the reader fixes hit. - pcb_board's tests get one mock KiCAD (board_mock) owning the socket, the envelope, and the GetOpenDocuments answer, so a test writes only its own command arms. Three duplicate ToolContext builders go with it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pauliuszaleckas
force-pushed
the
refactor/shared-ipc-gate
branch
from
August 26, 2026 20:33
ab770ab to
cf63cdc
Compare
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.
Groundwork for a board graphic-delete tool, useful on its own.
with_ipc_classifiedmoves totools/mod.rs. It was about to exist twiceverbatim, and it is the gate deciding whether a board file may be edited
behind a live KiCad — the one helper whose copies must not drift. Related
context in Closed-board fallback cannot tell "KiCAD was never running" from "KiCAD just died holding this board" #240.
get_items_of_types_inasks for several object types in oneGetItems. Thefield is repeated and every
send_commanddials a fresh socket, so four typescost one round trip instead of four. A non-OK status is now an error rather
than an empty result — previously a failed request was indistinguishable from
an empty board, and one failure zeroed every type in the batch.
delete_items_inaddresses a named document, like the other_inmethods.delete_itemsdelegates to it; deleting from the first open board rather thanthe requested one was the same hazard the reader fixes hit.
pcb_board's tests get one mock KiCad (board_mock) owning the socket, theenvelope, and the
GetOpenDocumentsanswer, so a test writes only its owncommand arms. Three duplicate
ToolContextbuilders go with it.No tool surface, argument, or response shape changes.
Gate run locally on this commit alone:
cargo test --workspace --locked --lib --tests,cargo test --workspace --locked --doc,cargo clippy --workspace --locked -- -D warnings,cargo fmt --all -- --check.