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.
This commit is contained in:
Maofeng
2026-07-30 07:40:08 +08:00
parent 949b8d6cdb
commit 572fed47b4
8 changed files with 1983 additions and 7 deletions
+12
View File
@@ -68,6 +68,18 @@ pub enum RuntimeError {
#[error("actor for {0} stopped before returning a result")]
ActorStopped(ServiceKey),
#[error("service revision {0} does not export the resident actor interface")]
NotResident(ServiceKey),
#[error("resident event for {service} exceeds the {limit}-byte payload limit")]
ResidentEventTooLarge { service: ServiceKey, limit: usize },
#[error("resident event for {service} returned more than {limit} effects")]
TooManyResidentEffects { service: ServiceKey, limit: usize },
#[error("invalid resident effect: {0}")]
InvalidResidentEffect(String),
#[error("input for {service} exceeds the {limit}-byte limit")]
InputTooLarge { service: ServiceKey, limit: usize },