Expand description
A native, language-independent client-root capability.
A Hyperactor mesh program has exactly one root client. Rust and Python are alternative bootstrap implementations of that one root, not separate root namespaces; worker ProcAgents host actors but never become client roots.
ClientRootRef is an opaque bearer capability to the root, carried in an
actor’s ActorEnvironment and inherited by
descendants. Its sole authority is to create or reuse a statically declared,
root-owned service through the root ProcAgent’s [EnsureClientRootService]
handler.
§CROOT invariant registry
- CROOT-1 (singleton binding): the active client bootstrap binds
[
ClientRootApi] on the program’s one root ProcAgent and stores that exact reference; worker ProcAgents never bind it. - CROOT-2 (typed API attenuation):
ClientRootRefexposes only typed ensure-service authority and no root administration. - CROOT-3 (single identity): exact name/type/parameter equality returns
one cached spawn result; a type or parameter-byte difference for the same
name conflicts. The service actor is created under a fresh random instance
id, which avoids the predictable collision a name-derived id would create;
the create path re-draws the id if it collides with one already present in
actor_states. - CROOT-4 (worker rejection): a worker ProcAgent has no bound client-root handler, so a retyped worker reference reaches an unbound port and cannot create a service.
- CROOT-5 (root ownership): service lifetime belongs to the root ProcAgent, never the requester; a reused reference to a service that has reached a terminal state fails closed rather than returning a dead actor.
- CROOT-6 (validation): a capability absent from the actor environment
fails closed —
ClientRootRef::from_envreturns an error rather than a silentNone, before any request is sent. - CROOT-7 (continuity): each created service receives the same
ClientRootRefin its native environment. - CROOT-8 (runtime neutrality): Rust and Python roots store the same native capability under the same environment key.
- CROOT-9 (map layering): a service’s spawn result and lifecycle live
solely in the ProcAgent
actor_statesregistry; the service-identity table records only the (actor type, exact parameter bytes, instance id) a repeat ensure must match. Only ensure writes that table, and only alongside theactor_statesentry, so the two never disagree. - CROOT-10 (attestation boundary): the only explicit attestation restores
ActorRef<A>immediately after the erased spawn reply whose requested and recorded actor type was derived from that sameA; every other reference is bound or deserialized. - CROOT-11 (handler resilience): the
EnsureClientRootServicehandler disables undeliverable-return on its reply and always returnsOk(()), reporting every expected failure through the typed reply; a malformed, conflicting, or reply-undeliverable request never faults the root ProcAgent. - CROOT-12 (crate layering): every client-root type and policy stays in
hyperactor_mesh(or a higher composition crate);hyperactorremains a generic attribute carrier with no static mesh dependency.
Structs§
- Client
Root Ref - An opaque bearer capability to the program’s one client root.
- Client
Root Service - A statically declared, root-owned service: a fixed service name plus a
registered actor type
A. Callers supplyA::Params; there is no caller-supplied runtime actor type or untyped address.
Enums§
- Client
Root Error - A typed failure from a client-root ensure request.
Statics§
- CLIENT_
ROOT - The client-root capability carried in an actor’s environment.