Expand description
Introspection attr keys — mesh-topology concepts.
These keys are published by HostMeshAgent, ProcAgent, and
MeshAdminAgent to describe mesh topology (hosts, procs, root).
Actor-runtime keys (status, actor_type, messages_processed, etc.)
are declared in hyperactor::introspect.
See hyperactor::introspect for naming convention, invariant
labels, and the IntrospectAttr meta-attribute pattern.
§Mesh key invariants (MK-*)
- MK-1 (metadata completeness): Every mesh-topology
introspection key must carry
@meta(INTROSPECT = ...)with non-emptynameanddesc. - MK-2 (short-name uniqueness): Covered by
test_introspect_short_names_are_globally_uniqueinhyperactor::introspect(cross-crate).
§Attrs invariants (IA-*)
These govern how IntrospectResult.attrs is built in
hyperactor::introspect and how properties is derived via
derive_properties.
- IA-1 (attrs-json):
IntrospectResult.attrsis always a valid JSON object string. - IA-2 (runtime-precedence): Runtime-owned introspection keys override any same-named keys in published attrs.
- IA-3 (status-shape):
status_reasonis present in attrs iff the status string carries a reason. - IA-4 (failure-shape):
failure_*attrs are present iff effective status isfailed. - IA-5 (payload-totality): Every
IntrospectResultsetsattrs– never omitted, never null.
§Attrs view invariants (AV-*)
These govern the typed view layer (*AttrsView structs).
- AV-1 (view-roundtrip): For each view V,
V::from_attrs(&v.to_attrs()) == Ok(v)(modulo documented normalization/defaulting). - AV-2 (required-key-strictness):
from_attrsfails iff required keys for that view are missing. - AV-3 (unknown-key-tolerance): Unknown attrs keys must not affect successful decode outcome. Concretization of IA-6.
§Derive invariants (DP-*)
- DP-1 (derive-precedence):
derive_propertiesdispatches onnode_typefirst, then falls back toerror_code, thenstatus, then unknown. This order is the canonical detection chain. - DP-2 (derive-totality-on-parse-failure):
derive_propertiesis total; malformed or incoherent attrs never panic and map toNodeProperties::Errorwith detail. - DP-3 (derive-precedence-stability):
derive_propertiesdetection order is stable and explicit:node_type>error_code>status> unknown. - DP-4 (error-on-decode-failure): Any view decode or
invariant failure maps to a deterministic
NodeProperties::Errorwith amalformed_*code family, without panic.
§Open-row invariant (IA-6)
- IA-6 (open-row-forward-compat): View decoders ignore unknown attrs keys; only required known keys and local invariants affect decoding outcome. Concretized by AV-3.
Structs§
- Error
Attrs View - Typed view over attrs for an error node.
- Failure
Info - Structured failure information for failed actors.
- Host
Attrs View - Typed view over attrs for a host node.
- Node
Payload - Uniform response for any node in the mesh topology.
- Proc
Attrs View - Typed view over attrs for a proc node.
- Root
Attrs View - Typed view over attrs for a root node.
Enums§
- Node
Properties - Node-specific metadata. Externally-tagged enum — the JSON key is the variant name (Root, Host, Proc, Actor, Error).
Statics§
- ADDR
- Host network address (e.g. “10.0.0.1:8080”).
- FAILED_
ACTOR_ COUNT - Count of failed actors in a proc.
- IS_
POISONED - Whether this proc is refusing new spawns due to actor failures.
- NODE_
TYPE - Topology role of this node: “root”, “host”, “proc”, “error”.
- NUM_
ACTORS - Number of actors in a proc.
- NUM_
HOSTS - Number of hosts in the mesh (root only).
- NUM_
PROCS - Number of procs on a host.
- PROC_
NAME - Human-readable proc name.
- STARTED_
AT - Timestamp when the mesh was started.
- STARTED_
BY - Username who started the mesh.
- STOPPED_
CHILDREN - References of stopped children (proc only).
- STOPPED_
RETENTION_ CAP - Cap on stopped children retention.
- SYSTEM_
CHILDREN - References of system/infrastructure children.
Functions§
- derive_
properties - Derive
NodePropertiesfrom a JSON-serialized attrs string. - to_
node_ payload - Convert an internal
IntrospectResultinto an API-facingNodePayloadby derivingpropertiesfrom attrs. Convert anIntrospectResultto a presentationNodePayloadwithpropertiesderived from attrs. - to_
node_ payload_ with - Convert an
IntrospectResultto aNodePayload, overriding identity and parent for correct tree navigation.