Skip to content

Design Priority 1 semantic editor navigation MVP #395

Description

@dubesinhower

Problem

Konnect can inspect and mutate KiCad design data, but a client cannot reliably
establish and change the live editor context it is discussing with a user. It
cannot enumerate addressable schematic/PCB documents, observe the exact
selection, activate a hierarchical sheet instance, select and reveal an exact
KIID, or cross-probe a symbol to its footprint with result-derived proof.

The unsafe alternatives are guessing from open-document order, inferring live
state from saved files, or treating mouse/keyboard/window automation as the
primary interface.

This issue proposes one focused Priority 1 semantic Navigation MVP. It does not
cover Priority 2 batch inspection, arbitrary viewport control, notifications,
or structural design edits.

Foundations and related work

Proposed semantic surface

Names here are provisional and require maintainer approval. The important
contract is the semantic split and evidence model.

  1. get_editor_state
    • report running/addressable schematic and PCB frames;
    • report open typed documents;
    • report the active editor, document, and schematic sheet instance only
      when KiCad exposes them;
    • report the running KiCad version and a capability matrix for observation,
      selection mutation, activation, reveal/fit/center, and cross-probe.
  2. get_editor_selection
    • query one explicit project/document/editor/sheet context;
    • return stable object KIIDs/UUIDs and object types with live-IPC evidence.
  3. resolve_navigation_target
    • resolve one explicit project/document/editor/sheet plus KIID/UUID;
    • optionally accept a human reference such as C10 only when saved-design
      structure produces exactly one live-addressable target;
    • return structured candidates on ambiguity rather than choosing one.
  4. set_editor_selection
    • semantic clear, add, and remove modes;
    • exact document/sheet/object targeting;
    • read selection back and derive success from the observed set.
  5. activate_editor_target
    • activate an exact already-addressable schematic, PCB, or hierarchical
      sheet instance when the running KiCad API supports it;
    • select and reveal the exact object when supported;
    • report activation/reveal/center/fit independently so unavailable behavior
      cannot be mistaken for success.
  6. cross_probe_editor_target
    • schematic symbol -> PCB footprint and reverse;
    • pin/pad/net only when one exact destination exists;
    • return both source and destination identities before any activation or
      selection side effect;
    • perform the side effect only when every required capability is present and
      verify it through readback.

An alternative with fewer public tools and tagged operations would be compatible
with these semantics. Maintainer guidance on that packaging is requested.

Target identity

Every request that can observe or change editor state should carry an explicit
context equivalent to:

{
  "project_path": "/exact/project.kicad_pro",
  "editor": "schematic | pcb",
  "document_path": "/exact/document.kicad_sch | /exact/board.kicad_pcb",
  "sheet_instance_path": ["root-kiid", "child-sheet-kiid"],
  "object": { "kiid": "stable-uuid" }
}

sheet_instance_path is required for a reused hierarchical schematic instance.
A human reference may replace kiid only at the resolver boundary; downstream
operations consume the exact resolved KIID and context. No operation may fall
back to another project, open document, sheet instance, or duplicate reference.

Evidence and success rules

  • Keep saved-file structural evidence separate from live IPC editor evidence.
  • Do not infer live editor state solely from files.
  • Do not infer design structure solely from an editor action.
  • Return stable object IDs in every result.
  • Treat a successful transport call as an attempt, not success.
  • After selection or activation, perform a bounded readback and derive the
    response from observed project/document/sheet/selection state.
  • If KiCad 10 does not expose a stable active-frame, active-sheet, activation,
    center, fit, or reveal primitive, return an explicit unsupported capability;
    do not infer from open-document order or claim that selection implies reveal.

KiCad's typed GetOpenDocuments, GetSelection, AddToSelection,
RemoveFromSelection, and ClearSelection commands are the preferred base.
RunAction names are explicitly unstable in KiCad's protocol. No raw action
surface should be public. If one semantic activation/reveal operation cannot be
implemented otherwise, isolate its action name, gate it by KiCad version and
observed capability, and require readback before success.

Structured refusals

The public contract needs stable classifications for at least:

  • ambiguous target, with candidates;
  • stale target or stale editor state;
  • wrong project or wrong document;
  • wrong hierarchical sheet instance;
  • editor unavailable or closed;
  • unsupported capability/version;
  • unresolved cross-probe destination; and
  • post-operation readback mismatch.

Exact kind spelling should reuse Konnect's existing conventions where possible.
A former unverified success becoming a refusal should be called out in minor
version/release planning.

Acceptance

Hermetic IPC and saved-design fixtures prove this scenario:

  1. observe addressable editors, capabilities, open documents, active state when
    available, and active schematic instance when available;
  2. resolve C10 deterministically to one schematic KIID and instance;
  3. activate that exact context or return typed unsupported;
  4. select it and read back the exact project/document/sheet/KIID;
  5. cross-probe to one exact PCB footprint KIID;
  6. activate/select the PCB destination or return typed unsupported;
  7. readback proves the destination document and selection; and
  8. ambiguous, stale, closed-editor, wrong-document, wrong-sheet,
    unresolved-destination, unsupported, and readback-mismatch cases refuse.

Live KiCad checks should supplement but not replace deterministic mocks.

Decisions requested

  1. Is the six-operation semantic split acceptable, or should the same contract
    be packaged into a smaller tagged-operation surface?
  2. Is an explicit project_path required on every target request, or may a
    server-session project identity be accepted when it is itself observed and
    returned?
  3. Should unavailable activation/reveal be a successful observation result with
    per-capability status, or a top-level structured error when the caller asked
    for that side effect?

Internal typed IPC, capability, resolver, and test foundations can proceed
without fixing these public names. PRs that expose the provisional public
surface will remain draft until these decisions are settled.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-value workflow reliabilityarea:platformInstall, discovery, OS and KiCad-version compatibilityclaimedSomeone has claimed this; check the assignee before startingenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions