Files
Kill_LIFE/ai-agentic-embedded-base/specs/yiacad_git_eda_platform_spec.md
T
kxkm 1c6c1952e8 fix+feat: restore CI/PIO regressions, 30-entry HF dataset, new tests & hardware
Regressions fixed (aa916de simplification):
- firmware/platformio.ini: restore esp32s3_waveshare (pioarduino platform,
  lib_deps: ArduinoJson/ESP32_Display_Panel/ESP32-audioI2S/IO_Expander,
  BOARD_HAS_PSRAM, I2S pins), restore esp32s3_qemu (extends waveshare +
  QEMU_BUILD), fix default_envs=esp32s3_waveshare, keep build_dir=/tmp/kl_pio_build
- .github/workflows/ci.yml: restore firmware-native (112 Unity tests),
  firmware-build (esp32s3_waveshare artifact), firmware-sim (Wokwi gated),
  hardware-export (KiCad ERC + SVG/PDF/netlist + KiBot + compliance)
- .gitignore: add .kibot-venv/ and .pio-venv/ (prevent committing venvs)

Dataset (HuggingFace clemsail/kill-life-embedded-qa v2):
- generate_hf_dataset.py: rag_query timeout 30s->120s (LLM takes ~45s),
  rag_search timeout 15s->30s; resolves intermittent server-busy failures
- 30 entries (10+10+5+5) -- 100% coverage vs 21/40 previously

Firmware tests (112/112):
- 4 suites: test_basic (39), test_modules (32), test_radio_state (26),
  test_wifi_state (15); test_logic.cpp now a stub (content moved to test_basic)

Hardware:
- esp32_minimal.kicad_pcb, esp32s3_enclosure.FCStd/.step, gen_pcb.py,
  gen_enclosure.py, REGISTRY.md, ERC reports for all design blocks

MCP tools:
- apify_mcp.py: +5 Kill_LIFE tools (fetch_espressif_docs, fetch_kicad_library_info,
  fetch_platformio_registry, ingest_to_rag, get_runtime_info)
- mcp_runtime_status.py: fix classify_overall -- accept_degraded respected for
  failed checks, task annotations, optional_degraded logic cleaned up
- deploy/cad/docker-compose.yml: path mascarade->mascarade-main

Specs & docs:
- docs/plans/TODO_2026-03-26.md, TODO_2026-03-27.md
- ai-agentic-embedded-base/specs: arch, tasks, intake, spec updates
- docs/playbooks/kicad_happy_hw_bom_forge.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 22:14:33 +01:00

4.0 KiB

Spec - YiACAD Git-based EDA platform

Intent

Build the web-facing YiACAD product as a Git-first EDA platform:

  • each project maps to a Git repository
  • KiCad files remain the source of truth
  • Excalidraw diagrams live as versioned JSON beside the EDA project
  • the web product adds dashboard, review, artifacts, realtime collaboration, and CI orchestration

Core decisions

1. Platform core

  • self-hosted Gitea or GitLab
  • multi-tenant orgs and teams
  • one project equals one repository

2. EDA engine

  • queue-backed worker orchestration
  • KiCad headless in containers
  • KiBot for reproducible outputs
  • KiAuto for ERC and DRC gates

3. Frontend

  • Next.js + React
  • Excalidraw for system and wiring diagrams
  • KiCanvas for PCB and schematic viewing
  • Three.js and WASM are phase-2/phase-3 concerns, not MVP blockers

4. Realtime

  • Yjs as CRDT layer
  • dedicated websocket server
  • persistence lane isolated from the HTTP GraphQL gateway

5. Data model

  • Git keeps canonical EDA and diagram files
  • Postgres or equivalent metadata/graph layer powers search, analytics, intelligent diffs, and SaaS controls

6. Parts/library system

  • ElasticSearch or Typesense
  • Redis cache
  • imports from KiCad libs and external catalogs

7. Hardware CI/CD

  • Git push triggers CI
  • workers run KiBot and KiCad CLI
  • outputs include Gerber, BOM, STEP, PDF

8. Infra

  • Kubernetes-backed workers
  • S3 or Minio for artifacts
  • Postgres for metadata
  • Redis or Kafka for queueing
  • OAuth or SSO at the edge

9. Multi-tenancy

  • namespace isolation
  • CI quotas
  • usage-based controls

10. Business model

  • free tier: public projects, limited CI
  • paid tier: private repos, compute CI, advanced collaboration
  • expansion: fabrication API, pricing, sourcing, component marketplace

11. Intelligence overlay

  • review assist stays read-only until Git and CI read models are real
  • MCP or service-first tools are the preferred boundary for parts search, CI triggers, artifact fetch, and ops summary
  • Git remains the only product source of truth; Yjs remains collaboration transport; workers remain execution

Product pages

  • Project dashboard
  • Diagram editor
  • PCB viewer
  • PR review

Roadmap

Phase 1

  • Git + KiBot CI
  • web viewer
  • artifact surfacing

Phase 2

  • collaboration and comments
  • parts DB
  • PR previews

Phase 3

  • browser-side editing
  • simulation
  • AI assist

Mermaid

flowchart TD
  Browser["Frontend app\nDashboard + Diagram + PCB + PR review"] --> Gateway["API gateway\nAuth + routing + GraphQL"]
  Gateway --> Project["Project service"]
  Gateway --> Realtime["Realtime service"]
  Gateway --> CI["CI orchestrator"]
  Gateway --> Parts["Parts DB service"]
  Realtime --> CRDT["Yjs / CRDT"]
  Realtime --> WS["WebSocket server"]
  CI --> Queue["Redis / Kafka queue"]
  Queue --> Workers["EDA workers on Kubernetes"]
  Workers --> KiCad["KiCad CLI"]
  Workers --> KiBot["KiBot"]
  Workers --> Exports["STEP + Gerber + PDF"]
  Project --> Git["Git source of truth"]
  Parts --> Search["Elastic / Typesense + cache"]
  CI --> Artifacts["S3 / Minio artifacts"]
  Gateway --> Meta["Postgres metadata + graph model"]

Current implementation delta

  • web/ now hosts the first Next.js scaffold.
  • GraphQL currently exposes project state, diagrams, CI queue, artifacts, and PR review placeholders.
  • Realtime transport is present as a dedicated Yjs websocket lane, but Excalidraw scene binding to CRDT is not done yet.
  • KiCanvas support is vendored from the official bundle path into web/public/vendor/kicanvas.js.
  • Queueing is now Redis-backed through BullMQ, with a dedicated worker entry at web/workers/eda-worker.mjs.
  • The worker already routes into existing repo tools for kicad-headless, step-export, KiBot-compatible output generation, and KiAuto hooks.
  • The remaining gaps are explicit: no real Git/PR read model yet, no live artifact serving surface, no Excalidraw-to-Yjs scene binding, and no read-only review assist/ops summary inside the product.