Hybrid MVP Architecture

Concurrency-first flow

flowchart LR
  fileWatcher[FileWatcher] --> changeQueue[ChangeQueue]
  changeQueue --> buildPlanner[BuildPlannerRust]
  buildPlanner --> swiftFront[swiftFrontendWorkerPool]
  buildPlanner --> rustSubset[swiftSubsetRustFront]
  swiftFront --> silPipe[silPipelineRust]
  rustSubset --> astCache[astCache]
  silPipe --> patchGen[patchGenerator]
  patchGen --> hotReloadD[hotReloadDaemon]
  hotReloadD --> previewHost[swiftUIPreviewHost]
  astCache --> metricsSvc[metricsService]
  silPipe --> metricsSvc
  hotReloadD --> metricsSvc

Shared protocol

See shared/protocol/events.schema.json.

Cancellation model

SwiftUI reload policy

  1. Try patch-based reload.
  2. If compatibility check fails, trigger deterministic host restart.