Commit Graph

7 Commits

Author SHA1 Message Date
Maofeng aea42ba0a6 docs(runtime): explain actor and resident invariants 2026-07-30 08:13:27 +08:00
Maofeng 572fed47b4 feat(runtime): supervise resident component resources
Detect the resident actor export, route Host events through the bounded Actor mailbox, enforce fuel, deadlines, payload limits, and translate WIT effects into typed runtime values.

Add a revision-scoped ResidentSession with deny-by-default TCP, UDP, and Unix endpoint policies, non-reused resource IDs, stream lifecycle and backpressure state, atomic effect validation, timers, subscriptions, extension sources, and shutdown handling.

Cover passive rejection, real Component ABI round trips, resource ownership, endpoint policy, and driver operation validation with integration tests.
2026-07-30 07:40:08 +08:00
Maofeng 53a8c6b690 feat(runtime): cache compiled components
Enable Wasmtime's persistent compilation cache and expose an optional cache directory in RuntimeConfig.

Create and canonicalize the configured directory before Engine construction, and report cache filesystem and configuration failures through dedicated RuntimeError variants.
2026-07-30 07:18:21 +08:00
Maofeng 778fbd2a06 feat(runtime): unregister service revisions
Add a lifecycle-serialized unregister operation that stops a resident Actor before releasing its registered and compiled Component.

Return the existing not-registered and unavailable errors without leaving a partially removed live revision, and cover Actor and registration count cleanup.
2026-07-29 20:25:58 +08:00
Maofeng 8d8d136510 feat(runtime): host service-scoped KV capability
Introduce an injectable, deadline-aware KvBackend boundary and link only the exact wasmeld:kv/store@0.1.0 import requested by a Component.

Namespace entries by service ID so revisions share state while services remain isolated, reject registrations without a backend, and enforce 256-byte keys and 64 KiB values.

Cover capability discovery, cross-revision sharing, service isolation, missing backends, and resource limits with Component integration tests.
2026-07-29 19:37:10 +08:00
Maofeng 5b32886efe feat(runtime): modularize host capabilities
- add an exact-version Capability Registry and structured descriptors
- move Clock bindings, host state, and Linker installation into its own module
- derive required capabilities from Component imports and link only requested interfaces
- cover exact-version resolution and minimal per-component capability sets
2026-07-29 19:13:35 +08:00
Maofeng cfac7d85f0 feat(runtime): add resident Wasmtime actor runtime
- define versioned service and clock WIT contracts
- enforce import allowlists, fuel, epoch, memory, I/O, and mailbox limits
- keep one Store and Component Instance resident per serial Actor
- add echo, counter, fault, spin, and capability probe components
- cover lifecycle, concurrency, sandbox, and fault recovery behavior
2026-07-27 04:59:33 +08:00