Skip to main content

COMPUTEUNIT_SPEC_KEY_MODULE

Constant COMPUTEUNIT_SPEC_KEY_MODULE 

Source
pub const COMPUTEUNIT_SPEC_KEY_MODULE: &str = "module";
Expand description

Canonical wasm.pleme.io/v1alpha1/ComputeUnit CRD spec.module per-CR wasm-module-reference sub-block key — the top-level spec.* child every rendered ComputeUnit YAML carries to name the wasm component (module.source: oci://... for OCI-hosted binaries, module.source: file://... for locally-mounted wasm bundles) the M2.5 wasm-engine instantiator loads at Servico bring-up. The single source of truth every downstream consumer that reads or emits the per-CR module sub-block reaches for:

  • [caixa_flux::programs_yaml_entry] splices the ComputeUnit YAML’s spec.module verbatim through into the emitted programs[] entry (the lareira-fleet-programs library chart’s per-entry module-source axis, populated from the ComputeUnit’s spec.module per the docstring on programs_yaml_entry above);
  • [caixa_helm::build_values_yaml] threads the same spec.module sub-block into the rendered values.yaml’s DEFAULT_LIBRARY_NAME-wrapped block so the pleme-computeunit library chart’s per-Servico module axis binds to the exact source the caixa.lisp’s :servicos fixture pins;
  • every test-fixture navigator in both crates that reaches into the rendered programs[] entry / values.yaml block by the module sub-block key to pin the per-Servico module-source axis round-trip (six sites across caixa_flux’s per-entry module + module.source drift-detection sweep + caixa_helm’s per-values module drift-detection sweep) resolves the same &'static str when parsing back the rendered document;
  • every future per-Servico renderer the absorption-roadmap acknowledges (the M4 mesh.pleme.io/v1alpha1/Aplicacao CR materializer’s per-:membros module-source resolver, a future per-cluster ComputeUnit-CR admission webhook keying off the same accepted sub-block set, the future caixa-otel collector-pipeline emitter’s per-Servico module-scrape reference).

Until this lift landed the byte "module" lived as six verbatim inline literals across caixa_flux and caixa_helm’s test-fixture navigators (four sites in caixa-flux — programs_yaml_entry_round_trips’s entry.get("module") pair + upsert_helmrelease_replaces_existing’s .get("module") + upsert_into_programs_yaml’s .get("module") — and two sites in caixa-helm — values_yaml_wraps_under_pleme_computeunit_key’s cu_block.get("module") + values_yaml_wrap_key_follows_library_name_override’s peer navigator on the library-name-override axis). A future ComputeUnit CRD schema-key rebrand on the per-CR module-reference axis (the substrate moving the wasm-component reference to binary: for parity with OCI OpenContainer Image nomenclature, to component: for parity with WIT Component Model wire terminology, to spec.wasm.source for schema-clarity once the ComputeUnit CRD grows sibling spec.native.* / spec.container.* runtime- discriminators as the ABSORPTION-ROADMAP.md M4-M5 trajectory names) without a coordinated edit across all six sites would silently split the schema: the emitter would write under the drifted key while every downstream test would still probe module: — the lareira-fleet-programs library chart’s per-entry module-source axis would silently receive an empty reference, the workload would silently come up with no wasm module bound (the M2.5 instantiator falls back to the library chart’s admission-time default of a hello-world stub, or fails the bring-up at wasm-engine parse time with a diagnostic far from the caixa.lisp source), and the failure would surface as “the Servico’s pods are running but they aren’t running our code” far from the rebrand commit’s source. Lifting the literal to one &'static str closes the drift footgun structurally — every consumer reads the same memory, so any future rebrand reaches every consumer by construction.

Same “the typed constant lives in one place” discipline the peer M2_KEY_LIMITS / M2_KEY_BEHAVIOR / M2_KEY_UPGRADE_FROM lifts apply on the sibling caixa.lisp M2 typed-slot canonical- camelCase-key surfaces — extends the discipline from the caixa- source-side M2 typed-slot overlay-key triple onto the substrate- side wasm.pleme.io/v1alpha1/ComputeUnit CRD per-spec.* sub-block axis every rendered ComputeUnit YAML declares as its top-level (module, trigger, capabilities) triple (the peer COMPUTEUNIT_SPEC_KEY_TRIGGER + COMPUTEUNIT_SPEC_KEY_CAPABILITIES siblings complete the substrate-side ComputeUnit-CRD per-spec.* sub-block re-export triple).