Skip to content

feat: analog-cli and KiCad integration, Simantic branding - #1

Open
SHONG0504 wants to merge 4 commits into
mainfrom
feat/analog-cli-integration
Open

SHONG0504 wants to merge 4 commits into
mainfrom
feat/analog-cli-integration

Conversation

@SHONG0504

@SHONG0504 SHONG0504 commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

ELI5

Orca becomes the desktop for analog-cli, the command-line circuit simulator that coding agents use to check KiCad boards and firmware. You can now open a KiCad project from the "+" menu and look at its schematic, its board layers and a spinning 3D model. A new Analog tab in the right sidebar lists every simulation the agents in your terminals have run, and clicking one opens a results tab with the pass/fail summary, the measurements and the waveforms. The app is also rebranded: the dock icon, the start screen and the title bar now show the Simantic logo and name.

What Changed

Two feature commits, a one-line follow-up that satisfies the bundled-guide convention test, and a merge of main (the branch started 179 commits behind; the only conflict was the generated localization catalog, regenerated on the merged tree).

1. analog-cli and KiCad integration (feat: analog-cli and KiCad project integration)

  • Before: Orca had no notion of KiCad projects or simulation runs. Agents ran analog-cli in a terminal and the human read JSON files.
  • After:
    • "+" → "View KiCad Project…" lists the .kicad_pro files in the workspace and opens one as an editor tab with three views: Schematic (one SVG per sheet, pan/zoom, fit), PCB (front/back presets and a per-layer picker) and 3D (interactive three.js model with top/bottom/reset). The renders come from the user's own kicad-cli into a per-user cache keyed by source mtime, and re-render when a .kicad_sch / .kicad_pcb under the project changes. Opening a .kicad_pro from the file explorer gives the same viewer; the Source toggle shows the project JSON.
    • Right sidebar → "Analog" reads analog-cli's run history store directly (run.json + CSVs) and its per-workspace session log, so each run is grouped under the terminal pane and agent that launched it, with in-flight calls shown live. Row actions: open results, re-run in a new terminal, copy the command, open an artifact, reveal the run folder, forget. A status dot on the sidebar icon shows pending or failed runs.
    • Run results tab (an editor-family tab, not persisted): verdict, exit code and elapsed time, measurements and findings from the report, uPlot waveform lanes over the recorded datasets (log-x for frequency sweeps, min/max decimated server-side), artifact links and the raw report.
    • Settings → Hardware: paths for analog-cli and kicad-cli with a discovery ladder (setting → env var → PATH → known install locations) and a live version probe.
    • Terminals now export ANALOG_CLI_SESSION and ANALOG_CLI_SESSION_LOG so the CLI stamps runs with the pane that made them. ANALOG_CLI_PARENT is deliberately not set.
    • A bundled analog-cli skill guide teaches agents the conventions; reference docs cover the viewer cache and the integration.
    • Mechanism: new runtime RPC surfaces (kicad.*, analog.*) behind defineMethod/defineStreamingMethod with zod params, bound in the edge command controller; main-process modules under src/main/kicad/ and src/main/analog-cli/ do all process and file work through runProcess; the renderer talks to them through typed clients with a request-generation guard and a small artifact LRU. Local hosts only in v1: SSH and runtime workspaces get an explicit "not supported on remote hosts yet" state and never fall back to a local binary.
    • Two 3D fixes found while testing: the WebGL context is no longer force-lost on React StrictMode effect replays (which threw Cannot read properties of null (reading 'precision') in dev), retry remounts the canvas, and the scene gets a room environment map because kicad-cli exports every footprint material as metalness 1, which renders black without one.

2. Simantic branding (feat(brand): replace the Orca icon and wordmark with Simantic)

  • App icons for macOS, Windows and Linux, the dev badge icon and the menu-bar template icons are rendered from resources/icon-source/simantic-logo-inverted.svg by a new config/scripts/render-app-icons.mjs (Electron offscreen, no ImageMagick or Xcode needed); pnpm build:icons runs it and the Orca Icon Composer project is removed.
  • The landing page, title bar app name, onboarding header and mobile home slide show the Simantic mark and the name "Simantic". resources/logo.svg is now a monochrome Simantic mark, so the settings icon, help menu and custom title bar follow without code changes. Product strings elsewhere ("Orca Mobile", menus, window title) are unchanged.

Why

analog-cli's own GUI is a separate Tauri app; running the agents in Orca and reading their simulation results in a different window loses the link between "which agent did what" and "what came out". Reading the CLI's history store and session log directly, rather than shelling out to history list --format json, keeps the sidebar cheap (a 200-run list would otherwise carry megabytes of embedded reports) and needs no CLI changes; the CLI-side improvements that would help are filed as simantic-dev/analog-cli stablyai#305–stablyai#309.

Both new views live in the editor tab family instead of a new TabContentType because a new tab kind touches ~30 files; the .kicad_pro viewer follows the IpynbViewer/CsvViewer pattern and the run tab follows the check-details precedent. Rendering through kicad-cli (not a port of KiCad's geometry code) matches what analog-gui already did and keeps parity with what the user sees in KiCad. three.js and uPlot were added because the repo had no 3D or charting library; both are MIT and lazily chunked.

Linked Issue

N/A — fork-internal feature branch on simantic-dev/orca. Related analog-cli issues: simantic-dev/analog-cli stablyai#305, stablyai#306, stablyai#307, stablyai#308, stablyai#309.

Visual Proof

Headless Electron screenshots exist for the Analog panel with a live run, the run results tab with waveforms, the schematic, PCB and 3D views, and the landing page in both themes. gh cannot upload attachments, so they are not attached yet; the author will drag-and-drop them into a comment.

Testing

  • On the branch as merged with main: pnpm tc (node + web) passes, the full pnpm lint chain passes, and the unit suites for every area this branch touches pass (2,868 files, 26,802 tests).

  • Full pnpm test on the pre-merge branch: 84,224 passed, 13 failed. One failure was ours (the bundled-guide convention test) and is fixed in the third commit. The other 12 also fail on the branch's base commit or only under full-suite load: skill-recipe-shell (macOS bash 3.2 set -u on an empty array), session-search-fts5-contract (SQLite build), codex-fetcher-pty-settle and claude-structured-real-cli (need the real CLIs), relay-region-correction (the cloud app's pg dependency is not installed here), and three timing-sensitive files that pass in isolation.

  • Playwright headless Electron (tests/e2e/analog-kicad-smoke.spec.ts, opt-in via ORCA_ANALOG_SMOKE_PROJECT / ORCA_ANALOG_SMOKE_HISTORY) against the real analog-cli workspace: Analog panel lists runs, a live run appears in flight under its terminal and flips to a verdict, the run tab renders charts, and the KiCad viewer renders schematic, PCB and a populated 3D board.

  • Platform: macOS 26 (Apple silicon), KiCad 9.0.3. Linux and Windows not exercised; platform-specific code is limited to the discovery ladders (Windows install paths use path.win32) and the WSL env passthrough list.

  • SSH: remote workspaces short-circuit to the unsupported state before any RPC; covered by unit tests, not exercised against a live SSH host.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Written with Claude Code (Claude Fable 5.1) under the author's direction.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: no shell interpolation (argv only, runProcess); layer names validated against ^[A-Za-z0-9_.]+$; artifact reads are limited to registered artifact ids; SVGs go through DOMPurify. Cross-platform: discovery ladders cover macOS/Linux/Windows; WSL passes the two analog env vars through. Remote SSH: explicit unsupported state, no local fallback. Mobile: home slide branding only. Backwards compatibility: new optional settings fields, new right-sidebar tab id normalized on load, run tabs not persisted. Performance: renders cached by source stamp, chunked 1 MiB artifact reads, min/max decimation of datasets, on-demand 3D rendering (no animation loop).

Checklist

  • This PR is small and focused — it is not; it is the whole v1 integration plus the rebrand, split into two commits.
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason — being attached as comments
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — see Testing

🤖 Generated with Claude Code

SHONG0504 and others added 4 commits September 20, 2026 15:03
Make Orca a frontend for analog-cli, the SPICE/co-simulation CLI agents
use to validate KiCad boards and firmware.

- "+" menu: "View KiCad Project…" opens a .kicad_pro as an editor tab with
  Schematic, PCB (per-layer SVG) and interactive 3D (three.js GLB) views,
  rendered through kicad-cli into a per-user cache and refreshed when the
  schematic or board files change.
- Right sidebar: an "Analog" tab lists analog-cli runs from the history
  store, grouped by the Orca terminal pane that made them (terminals now
  export ANALOG_CLI_SESSION / ANALOG_CLI_SESSION_LOG), with in-flight calls,
  verdicts, re-run, copy command, open artifact and forget actions.
- Run results tab: summary, measurements and findings, uPlot waveform lanes
  over the recorded CSV datasets (min/max decimated), artifacts and the raw
  report.
- Settings › Hardware: analog-cli and kicad-cli paths with a discovery
  ladder and version probe.
- Bundled analog-cli skill guide, reference docs, SSH boundary row. Local
  hosts only in v1; remote workspaces get an explicit unsupported state.
- 3D view: keep the WebGL context across StrictMode effect replays and
  key the canvas on retry; add a room environment so kicad-cli's fully
  metallic export materials render with their colors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- App icons (macOS .icns, Windows .ico, Linux/runtime PNGs, dev badge,
  menu-bar templates) rendered from resources/icon-source/
  simantic-logo-inverted.svg by config/scripts/render-app-icons.mjs, which
  rasterizes through the repo's Electron offscreen; pnpm build:icons now
  runs it. The Orca Icon Composer project is retired.
- Landing page shows the Simantic tile and the "Simantic" wordmark; the
  titlebar app name, onboarding header and mobile home slide follow.
  resources/logo.svg is now a monochrome Simantic mark so the settings
  icon, help menu and custom title bar pick it up unchanged.
- The default app-icon option is labeled "Simantic".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every bundled guide tells the agent that the command name is a placeholder
for the executable the stub resolved; the generator test enforces it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Brings the branch up to the fork's main (179 upstream commits). The one
conflict was the generated English localization catalog; it and the
runtime-required catalog were regenerated with the sync scripts on the
merged tree. Typecheck, the full lint chain, and the unit suites for
every area the branch touches pass on the result.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@SHONG0504

Copy link
Copy Markdown
Member Author

analog panel, run tab, schematic, PCB, 3D
01-analog-panel
01b-analog-panel-live-run
02-run-summary
03-run-datasets
04-kicad-schematic
05-kicad-pcb
06-kicad-3d

landing page, dark and light
landing-dark
landing-light

3D board before and after the lighting fix
kicad-3d-after-fix
kicad-3d-environment-top
kicad-3d-environment

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant