Closed general

0.9.252: kicad_install_library_bundle (Cloud Library one-verb install)

Colby Knox · ·closed by John Lauer

For John's review: 0.9.252 is published and running, and adds one verb.

kicad_install_library_bundle installs an Adom wiki Cloud Library bundle zip end to end:

  • Input: zipPath (staged on the machine via write_file / write_file_chunk) + optional libraryName (defaults to the zip stem).
  • Unpacks with a zip-slip guard and size caps (256MB zip / 512MB unpacked), finds .kicad_sym + .pretty/ + 3dmodels/ regardless of a wrapping folder.
  • Reuses the existing install_library paths, including the 0.9.251 model-ref rewrite, and registers both lib tables.
  • Reports {symbols, footprints, modelsInstalled, modelRefsRewritten, kicadRunning, restartNeeded}. A running KiCad is never closed; the verb reports restartNeeded and the caller tells the user.

Why: the wiki's Cloud Libraries checkout (staging) exports a library and installs it into KiCad through the web-control transport with no AI in the loop. This verb is the install half; the page-side recipe (fetch zip, chunked stage, this verb) is installLibraryBundle in git-wiki static/webcontrol.js.

Code: handlers/install_library_bundle.py in this page's repo (pushed with the 0.9.252 release). Verified live: a 10-part bundle installed in 157ms with 10 symbols, 6 footprints, and 6 STEP models resolving.

A GitHub PR (adom-bridge-kicad#1) was opened first and closed in favor of this issue; note the GitHub mirror is 2.5 months behind this page's repo, which is the live source.

7 Replies

Colby Knox ·

Follow-up: 0.9.253 adds capture:true to kicad_install_library_bundle. After a successful install (and only when KiCad was NOT already running), the verb opens the Symbol Editor on the new library in the background, returns the standard shot frame (thumbnailDataUrl), and closes the editor it opened; proofSkipped names why when no frame is possible. The verb joined _SPAWNS_WINDOW and _SPAWNS_WINDOW_FOCUS so the proof window rides the focus guardian and can never land on top of the user. The wiki export flow renders the frame under the install status as proof. Verified live: real Symbol Editor frame of the installed library, editor closed after, user focus untouched.

John Lauer ·

0.9.261 is published: your 0.9.251-0.9.260 work merged with three fixes of mine that had been silently reverted.

What happened, because it will happen to someone else. I published 0.9.250 as a release zip, and its SOURCE never reached this page repo. tools/build_release.py --publish pushed only BRIDGE_VERSION, bridge.json and the manifest, never the files it had just shipped. So the zip and the repo disagreed, you cloned the repo, built 0.9.251 from it, and reverted my work with no warning. Nothing failed. The repo is what the next person builds from, so the repo is what has to be right.

What was lost and is now back (absent from 0.9.251 through 0.9.260):

  • adom_library.py: the quote-aware .kicad_sym parser with a refuse-to-write balance gate. This is the one that matters: it was written after a merge corrupted a real user library, and the old 249-line parser is what corrupted it.
  • handlers/demo.py: beat captions and pre-rendered narration.
  • handlers/open_symbol_editor.py: the #54 sub-node verify and the retryable starting contract.

Your work is intact, and I checked rather than assumed. install_library.py is still your 367-line version with the 3D-model carry, install_library_bundle.py is untouched, and server.py keeps all five of your registration references. This was a real three-way merge against the commit you branched from (55249157), not a file-level pick: 12 files taken from me where you never touched them, 4 from you, 7 auto-merged, zero conflicts. server.py came out at exactly base + mine + yours (1553 + 87 + 10 = 1650), and the verb set is the exact union of both sides, 66 verbs on the running build.

Fixed the cause too. build_release.py now pushes every file the zip ships, chunked, so the release and the repo agree by construction instead of by the operator remembering to list changed sources by hand. Worth pulling before your next release, or 0.9.262 will revert 0.9.261 the same way.

Verified on ConfRoomROG first, then AdomLapper: both running 0.9.261, kicad_readiness green, your bundle verb registered.

John Lauer ·

+1 for the one-verb model -- extend it with the plan / restartNeeded CONTRACT so ab can render a good UI

Verified your bundle verb end-to-end this session: a 5-part cloud-library bundle -> kicad_install_library_bundle {zipPath} -> 5 symbols / 4 footprints / 4 STEP models in one library, both lib-tables registered. This is exactly the "bridge owns the whole multi-part import behind ONE verb" model -- fusion should follow it (filed fusion-bridge#67).

One gap for the wiki / web-control UI: the verb does not emit the CONTRACT ab needs to render a realistic bar + pre-lay-out evidence slots WITHOUT knowing any KiCad internals:

  1. Pre-flight / plan: { steps, totalEtaSec, expectedEvidence:[{part, slots:["symbol","footprint","3d"]}] } so ab can pre-lay-out the evidence image slots. KiCad install is fast (no per-part 3D bind) so the ETA matters less than for Fusion, but the expected-evidence SHAPE still lets the UI prepare.
  2. restartNeeded as a STRUCTURED field, not just the _hint string. Driving your verb through the wiki /libraries page fired a "Library installed into KiCad" toast with NO restart note -- the user is told it is installed but the library will not APPEAR until KiCad restarts. Surface restartNeeded:true first-class so ab renders "installed -- restart KiCad to use it."

(The kicad_show_library no-evidence / progress-block / resolvedSymbol asks are already in your #62 -- not re-filing those.)

Demarcation: ab DEFINES + RENDERS the generic contract; the bridge OWNS the import and decides what evidence it produces. I withdrew my duplicate #64 in favor of this comment on your thread.

Colby Knox ·

Pulled 0.9.261 into the working copy and verified the merge from this side: our install_library.py, install_library_bundle.py, and the plugin deploy fix came through byte-identical, and adom_library.py, handlers/demo.py, and the open_symbol_editor verify are back in place. The root cause lands on both of us: our releases built from the page repo exactly as you said, and nothing warned either side. Your build_release.py fix is the right ending, the repo and the zip agree by construction now, and 0.9.262 will be the first release cut from your merged base with that tool, so the revert loop is closed.

On restartNeeded: it has been a structured field since 0.9.252 (data.restartNeeded, next to kicadRunning), so the gap you hit was the wiki UI, not the verb. The receipt status line carried the restart note but the toast fired a bare "Library installed into KiCad". Fixed on the wiki today: when data.restartNeeded is true the toast now reads "Installed. Restart KiCad to see the library", and the status line keeps the fuller explanation.

On the plan contract: agreed, and here is the shape I intend for 0.9.262. planOnly:true on kicad_install_library_bundle, with the zip already staged, unpacks the listing only (no install, no table writes) and returns plan: { steps: [{id, label, etaSec}], totalEtaSec, expectedEvidence: [{part, slots}] }, where slots per part reflect what the bundle carries (symbol always; footprint when the .pretty has one; 3d when a model matches). The real run then reports against the same step ids. One honesty note that mirrors the #65 evidence decision: KiCad install produces per-part RESULTS but only ONE image, the single background Symbol Editor frame, so expectedEvidence will declare per-part result slots and one final library frame rather than promising per-part images the lane never takes. If ab wants a different spelling for any of that, say so before I cut 0.9.262.

John Lauer ·

Closing this, with the last open piece of it shipped in 1.0.13 (insiders).

Where the three threads in here ended up in the native (Rust) bridge:

  • kicad_install_library_bundle is carried over verb for verb: same args (zipPath, libraryName, capture), same zip-slip guard and size caps, same <Lib>.kicad_sym + <Lib>.pretty/ + 3dmodels/ discovery through a wrapping folder, same model-ref rewrite, both lib tables registered, and the same {symbols, footprints, modelsInstalled, modelRefsRewritten, kicadRunning, restartNeeded} report. A running KiCad is still never closed.
  • restartNeeded as a structured field (your ask 2) has been first class since 0.9.252 and still is. What the native build had wrong was the VALUE: it hardcoded kicadRunning: null and restartNeeded: true with a "this build has no process scan yet" note, while the process scan was right there in the same crate and being used by the installer. So every caller was told "restart KiCad" even when no KiCad was running, which is the honest-sounding answer that trains people to ignore it. 1.0.13 wires all three of those verbs (kicad_install_library_bundle, the PCM verbs, kicad_ipc_api) to the real scan: true means the user really must restart, false means nothing to restart and the reply says so, null means this OS layer has no scan and restartNeeded stays true as the safe answer, with kicadRunningUnknownBecause naming why. kicadPids is reported when KiCad is up. Unit test: install_kicad::tests::running_report_follows_the_scan.
  • The plan contract (your ask 1, planOnly:true with {steps, totalEtaSec, expectedEvidence}) was designed here for 0.9.262 and never built, on either side. It is not in the native build. I am not going to hold a 2026-08 announcement thread open for it: filed separately so it can be scheduled on its own, with your shape and your honesty note (per-part result slots, one final library frame, never per-part images the lane does not take).
John Lauer ·

The plan contract is now adom/kicad-bridge#106, carrying your shape and your evidence honesty note.

John Lauer closed this ·
John Lauer ·

Live check on ConfRoomROG, now on 1.0.13: the process scan answers, so the null is really gone on Windows.

kicad_upgrade {dryRun: true}
  errorCode  kicad_running
  kicadPids  [26200, 29048]
  error      "KiCad is running (pids [26200, 29048]); the installer would fail on files in use."

That is the same kicad_running() the bundle install, the PCM verbs and kicad_ipc_api now call, so on any Windows box kicadRunning is a real true/false and restartNeeded follows it instead of always saying yes.

Log in to reply.