Files
flying-jib/agent/ADRs/0004-process-model-electron-bare-squid.md
T
2026-07-30 23:02:00 -04:00

1.1 KiB

ADR-0004: Process model — Electron + Bare worker + Squid child

  • Status: Superseded by ADR-0013
  • Date: 2026-07-30
  • Superseded: 2026-07-30

Context

We need a polished desktop GUI, a P2P runtime with OTA hooks, and a Node-compatible Minecraft server. One process cannot optimally host all three.

Decision

Process Runtime Responsibility
Main Electron (Node) Window, Squid lifecycle, ports, IPC hub
Renderer Chromium GUI only
Worker Bare via pear-runtime Hyperswarm, HyperDHT tunnels, Autobase, Protomux
Squid Node child Authoritative MC sim, Anvil I/O

IPC: Electron ↔ Bare via framed-stream; Main ↔ Squid via child_process (stdio/JSON or control socket).

Template: hello-pear-electron.

Consequences

Positive

  • Crash isolation for Squid
  • P2P off the UI thread
  • OTA patterns from Pear

Negative / tradeoffs

  • Multi-process complexity
  • Packaging must include Node-compatible Squid deps beside Electron

Follow-ups

  • Phase 1 implement managers
  • Decide exact Squid IPC schema