feat(navigation): observe exact editor selection - #397
Conversation
|
Same coordination request here: please pause further work on this draft while we start with #369 and land the existing stack from the bottom up. #397 is stacked on #396 and all of its earlier prerequisites, so every change below it currently ripples through the whole branch. Once #396 has been rebuilt on the final accepted IPC base and the #395 public API decisions are settled, #397 can be restacked once and reviewed against stable prerequisites. Holding here will avoid repeated rebases and keep the eventual review and test evidence meaningful. |
|
The unique N2 portion of this cumulative draft has been reconstructed directly on the merged N1 foundation as #491. #491 preserves the original authorship, retains the already-merged safety work and tests, and passes the complete local gate. This old stacked draft is now superseded and is being closed so there is only one active implementation path. |
Summary
GetSelectionobservation with a before/after open-document freshness checkget_editor_selectionto theeditor_navigationtoolsetNavigation MVP rationale
This is N2, the readback foundation for verified navigation. Selection mutation and cross-probe cannot claim success unless the client can observe the exact selected KIIIDs in the intended project, document, editor, and hierarchy instance.
Public naming and compatibility remain provisional under #395, so this PR is intentionally a draft.
Dependency
Behavior and refusals
The request must echo one exact identity returned by
get_editor_state.GetOpenDocumentsis matched beforeGetSelectionand read again afterward because KiCad'sSelectionResponsecarries no response header. No first-document fallback exists.The full observation fails closed for:
Intentionally unsupported
C10as identity (N3)The vendored KiCad 10 schematic schema models lines and labels but not schematic symbols. Such selections return
unsupported_capability; they are not guessed from bytes or saved files.Verification
cargo fmt --all -- --check— passcargo test -p konnect-ipc --test mock_server_test— 44 passed, 1 ignoredcargo test -p konnect-core editor_navigation --lib— 6 passedcargo test --workspace --all-targets— pass (933 core tests; all non-environmental targets passed)cargo clippy --workspace --all-targets -- -D warnings— passxtask fix-doc-counts --check— 21 toolsets, 223 registered tools, 230 total; currentgit diff --check— passRemaining risks