Skip to main content

ChildSpec

Struct ChildSpec 

Source
pub struct ChildSpec {
    pub caixa: String,
    pub versao: String,
    pub restart: RestartPolicy,
}
Expand description

One child entry in the supervisor’s :children list.

Every child references another caixa by :caixa <nome> + version constraint. The supervisor materializes one ComputeUnit per entry.

Fields§

§caixa: String

The child caixa’s :nome. Must resolve via the same dependency resolution path as :deps (caixa-resolver).

§versao: String

Semver constraint ("^0.1", "~0.1.2", etc.) — same shape as crate::dep::Dep::versao.

§restart: RestartPolicy

Restart policy — defaults to RestartPolicy::Permanent.

Implementations§

Source§

impl ChildSpec

Source

pub fn nome(&self) -> &str

Substrate-canonical per-:children child-caixa :nome scalar accessor every consumer that reads the OTP-shape supervised child’s identity keys off — returns the author-declared :children :caixa byte-string verbatim as a &str, borrowed from the typed slot’s own String storage.

The :children :caixa slot carries the DNS-1123 label — the child caixa’s :nome — that every emitted cluster artifact derives its metadata.name from verbatim: the rendered wasm.pleme.io/v1alpha1/ComputeUnit.metadata.name per child, the crate::LABEL_PROGRAM label value on every child’s pod identity, and the per-child K8s Service metadata.name the future wasm-operator (M3) provisions for inter-child supervision- tree wiring. Every downstream consumer that fans on the child’s caixa-name keys off this scalar (the SupervisorSpec::validate per-child DNS-1123 gate at require_valid_dns_1123_label(child.nome(), …), the per-child duplicate-detection crate::render::insert_first_seen key, the validate_no_self_supervision cross-slot equality check against the parent’s :nome, every SupervisorError variant carrying the offending child caixa verbatim for feira lint rendering, the future wasm-operator’s hierarchical reconciliation scheduler’s per-child ComputeUnit-name projection, the future M4 mesh.pleme.io/v1alpha1/Supervisor CR materializer’s per-child admission webhook).

Prior to this lift the .caixa byte-string was accessed inline at seven sites in supervisor.rs — the DNS-1123 gate’s &child.caixa, the four SupervisorError::{ChildCaixaInvalid, EmptyChildVersion, ChildVersaoInvalid, DuplicateChildCaixa} carriers’ child.caixa.clone(), the dedup key’s child.caixa.as_str(), and the validate_no_self_supervision child.caixa == parent_nome cross-slot check — seven open-coded field-accesses that expressed no compile-time link back to the typed slot. A future extension of the :children :caixa axis to a richer author surface (a per-cluster alias table the operator pins through a future :placement-scoped slot on the supervisor tree, a namespace-qualified rewrite the M4 CR materializer applies per-CR, a per-child overlay from the future :children :nome-suffix slot the MESH-COMPOSITION §III.2 roadmap acknowledges) would have had to be threaded through every open-coded copy in lockstep or one consumer would silently disagree with the peers on which caixa a given child resolves to — a child-set lookup that treated the name as "cart-worker" while the peer duplicate-detector treated it as "tenant-a/cart-worker" would silently split the DuplicateChildCaixa membership-lookup diagnostic from the self-supervision detector’s parent-equality check, a two-consumer split at the validator far from the source caixa.lisp with no field naming the identity-drift root cause. Lifting the resolution rule to a typed method on the substrate primitive means every downstream consumer of the Supervisor’s per-:children identity surface reaches for exactly one typed dispatch — the resolver’s accept-set migrates as a unit on any future axis addition.

Sibling of the peer per-:membros crate::Membro::nome (4a32abf) member-caixa :nome scalar accessor on the M3 mesh-slot surface — same “one typed dispatch on the substrate primitive, thin projections at each consumer” discipline extended onto the M2 supervisor-tree per-:children child-identity axis. The two typed axes (Membro::nome on the M3 Aplicacao side, ChildSpec::nome on the M2 Supervisor side) now share one accessor discipline for the shared substrate concept “another caixa referenced by :nome”. Peer of the second M2 slot scalar accessor crate::UpgradeFromEntry::prior_versao (75d27a8) on the sibling per-:upgrade-from :from OTP-appup axis — the M2 slot family’s typed-accessor discipline now spans both the upgrade axis (:upgrade-from) and the supervision axis (:children), matching the closed M3 mesh-slot accessor family’s shape. Named nome() to match the tatara-lisp author-surface term the field’s docstring already reaches for (“The child caixa’s :nome”) and the peer crate::Membro::nome / crate::Caixa::nome / crate::dep::Dep::nome field-name discipline the substrate already carries — the accessor’s name maps directly onto the canonical caixa-identity vocabulary rather than shadowing the field’s storage-side caixa label.

Source

pub fn versao_requirement(&self) -> &str

Substrate-canonical per-:children child-caixa :versao semver- requirement scalar accessor every consumer that reads the OTP-shape supervised child’s version pin keys off — returns the author-declared :children :versao byte-string verbatim as a &str, borrowed from the typed slot’s own String storage.

The :children :versao slot carries the Cargo-shaped semver requirement string ("^0.1", "~0.1.2", "0.1.0", "*") that pins which release of the supervised child caixa the OTP-shape supervisor tree materializes against — the same requirement grammar the peer :deps :versao / :membros :versao axes carry, resolved through the shared crate::render::require_valid_versao_requirement cascade and the shared crate::version::parse_requirement parser. Every downstream consumer that fans on the child’s version pin keys off this scalar (the SupervisorSpec::validate per-child requirement gate at require_valid_versao_requirement(child.versao_requirement(), …), the SupervisorError::ChildVersaoInvalid variant’s carrier for feira lint rendering, every future per-cluster version-lock overlay the caixa-operator’s hierarchical reconciliation scheduler pins through a future :placement-scoped supervisor-tree slot, the future M4 mesh.pleme.io/v1alpha1/Supervisor CR materializer’s per-child version resolver, the future wasm-operator’s per-child lacre BLAKE3-closure lookup at ComputeUnit materialization time).

Prior to this lift the .versao byte-string was accessed inline at two &str-shaped sites in caixa-core/src/supervisor.rs — the SupervisorSpec::validate requirement-gate call require_valid_versao_requirement(&child.versao, …) and the SupervisorError::ChildVersaoInvalid carrier at versao: child.versao.clone() — two open-coded field-accesses that expressed no compile-time link back to the typed slot. A future extension of the :children :versao axis to a richer author surface (a per-cluster version-pin overlay per MESH-COMPOSITION §III.2 canary flow, a lacre-projected concrete-version rewrite the operator materializes at CR-admission time, a future :children :versao-lock per-cluster override slot the wasm-operator’s hierarchical reconciliation scheduler authors per-CR) would have had to be threaded through both open-coded copies in lockstep or one consumer would silently disagree with the peer on which release constraint a given child resolves to — the requirement-gate call reading "^0.1" while the error-body carrier read "tenant-a-pin/^0.1" would silently split the ChildVersaoInvalid diagnostic quote from the actual gate rejection input, a two-consumer split at the validator far from the source caixa.lisp with no field naming the version-pin drift root cause. Lifting the resolution rule to a typed method on the substrate primitive means every downstream requirement-facing consumer of the Supervisor’s per-:children version-pin surface reaches for exactly one typed dispatch — the resolver’s accept-set migrates as a unit on any future axis addition.

Sibling of the peer per-:membros crate::Membro::versao_requirement (a40b0e3) member-caixa :versao scalar accessor on the M3 mesh-slot surface — same “one typed dispatch on the substrate primitive, thin projections at each consumer” discipline extended onto the M2 supervisor-tree per-:children child-version-pin axis. The two typed axes (Membro::versao_requirement on the M3 Aplicacao side, ChildSpec::versao_requirement on the M2 Supervisor side) now share one accessor discipline for the shared substrate concept “another caixa referenced by a Cargo-shaped semver requirement”. Peer of the sibling per-:children ChildSpec::nome (57c61d0) child-caixa :nome scalar accessor — the pair (nome(), versao_requirement()) jointly projects the (caixa, versao) field pair every OTP-shape supervisor-tree consumer that fans on per-child identity + version pin keys off, closing the last unlifted per-:children String-carry axis so every downstream per-:children reader now routes through a typed dispatch on the substrate primitive. Named versao_requirement() rather than versao() because the field’s storage-side .versao label is already the author-surface term (:versao); the accessor’s name carries the semantic role — the semver requirement string the shared crate::version::parse_requirement entry-point consumes — so a raw field access and a typed dispatch read differently at every consumer site. Matches the peer crate::Membro::versao_requirement naming discipline verbatim.

Source

pub fn restart(&self) -> RestartPolicy

Substrate-canonical per-:children :restart OTP-shaped per-child post-exit restart-decision policy scalar accessor every consumer that dispatches on the supervised child’s post-exit reconcile posture keys off — returns the author-declared :children :restart variant verbatim as a RestartPolicy, Copy-projected from the typed slot’s own RestartPolicy storage.

The :children :restart slot carries the closed-set OTP-shaped per-child restart-decision policy discriminator (RestartPolicy::Permanent — always restart, the OTP permanent worker-child default; RestartPolicy::Transient — restart only on abnormal exit, the OTP transient clean-completion-aware default; RestartPolicy::Temporary — never restart, the OTP temporary one-shot default) that every downstream consumer of the Supervisor’s per-child post-exit reconcile branch keys off. Every future downstream consumer that fans on the per-child restart-decision keys off this scalar (the future feira app graph per-child restart column, the future wasm-operator’s per-child post-exit restart-decision branch, the future M4 mesh.pleme.io/v1alpha1/Supervisor CR materializer’s per-child admission webhook, the caixa-operator’s hierarchical reconciliation scheduler’s per-child post-exit reconcile branch, the RestartPolicy::as_str Serialize-derive-pinning path the [tests::restart_policy_variants_serialize_to_lifted_scalar_values] pin threads through).

Peer of the sibling per-:supervisor SupervisorSpec::estrategia (eafb619) Copy-return RestartStrategy sibling-restart-strategy scalar accessor and the M3 mesh-slot crate::Placement::estrategia (921fe1b) Copy-return crate::PlacementStrategy distribution-strategy scalar accessor — same “one typed dispatch on the substrate primitive, Copy-projected closed-set enum-arm discriminator that partitions the downstream renderer’s per-arm fan-out” discipline extended onto the M2 supervisor-slot per-:children restart-decision-policy Copy-composite-enum scalar axis. Third axis on the per-:children ChildSpec type — companion to the sibling per-:children ChildSpec::nome (57c61d0) child-caixa :nome scalar accessor and the per-:children ChildSpec::versao_requirement (2c053c8) child-caixa :versao semver-requirement scalar accessor on the sibling String-carry axes. The triple (nome(), versao_requirement(), restart()) jointly projects the (caixa, versao, restart) field trio every OTP-shape supervisor- tree consumer that fans on per-child identity + version pin + restart-decision keys off, closing the last unlifted per-:children axis so every downstream per-:children reader now routes through a typed dispatch on the substrate primitive. Named restart() to match the storage field’s name and the author-surface :children :restart slot term verbatim; the accessor’s identity name maps onto the canonical OTP-shape per-child restart-decision- policy vocabulary the RestartPolicy enum’s docstring already carries.

Trait Implementations§

Source§

impl Clone for ChildSpec

Source§

fn clone(&self) -> ChildSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChildSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ChildSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ChildSpec

Source§

impl PartialEq for ChildSpec

Source§

fn eq(&self, other: &ChildSpec) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ChildSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ChildSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.