How yourikka/minicloud works
MiniCloud is a single-process development platform for admitting and serving WASI WebAssembly functions. The principal workflow is management API writes for a Function, artifact, validated immutable Version, and Route; the local serving projection then converges, letting callers invoke the published function through the HTTP Gateway and Worker. The graph preserves those domain stages and the validator, execution, and worker-serving layers. The README documents the process composition; sampled source confirms key handler and validation behavior, but several internal links rely on that documented composition.
Main entry points: controller.go Local Controller · agent.go Worker Agent · runtime.go Process Composition · sync.go Serving Projection
Components 23
Management and Control
- Management API
internal/managementhttp/handler.go - Local Controller
internal/localcontroller/controller.go - Function Catalog
internal/controlplane/catalog.go - Version Lifecycle
internal/controlplane/release.go - Route State
internal/controlplane/route.go - Operation Records
internal/controlplane/operation.go
Artifact Admission
- Artifact Store
internal/artifact/store.go - Validator Client
internal/validator/client.go - Isolated Validator
cmd/minicloud-validator/main.go - Module Admission
internal/validator/engine/engine.go
Serving and Routing
- Serving Projection
internal/localserving/sync.go - Discovery Builder
internal/discovery/builder.go - Gateway Discovery
internal/gatewaydiscovery/store.go - Invocation HTTP
internal/gatewayhttp/handler.go - Gateway Invocation
internal/gatewayinvoke/gateway.go - Route Balancer
internal/gatewayroute/balancer.go
Worker Execution
- Worker Agent
internal/workeragent/agent.go - Worker Registry
internal/workerregistry/registry.go - Compiled Cache
internal/workercache/cache.go - WASM Engine
internal/wasmexec/engine.go
Local Core
- Process Composition
internal/localcore/runtime.go
Other components
- Platform Operator
- Function Caller
Connections 25
- Platform Operator → Management API: manages functions
- Management API → Local Controller: dispatches writes
- Local Controller → Function Catalog: updates catalog
- Local Controller → Version Lifecycle: records versions
- Local Controller → Route State: publishes routes
- Local Controller → Operation Records: tracks operations
- Local Controller → Artifact Store: stores artifacts
- Local Controller → Validator Client: requests validation
- Validator Client → Isolated Validator: starts child
- Isolated Validator → Module Admission: validates module
- Local Controller → Serving Projection: updates serving state
- Serving Projection → Discovery Builder: builds view
- Serving Projection → Gateway Discovery: publishes view
- Function Caller → Invocation HTTP: invokes function
- Invocation HTTP → Gateway Discovery: reads serving view
- Invocation HTTP → Gateway Invocation: dispatches invocation
- Gateway Invocation → Route Balancer: selects worker
- Gateway Invocation → Worker Agent: dispatches work
- Worker Agent → Worker Registry: uses workers
- Worker Agent → Compiled Cache: loads program
- Worker Agent → WASM Engine: executes module
- Process Composition → Local Controller: composes
- Process Composition → Serving Projection: runs projection
- Process Composition → Invocation HTTP: hosts listener
- Process Composition → Worker Agent: hosts worker