Skip to main content

engenho_types/
lib.rs

1//! # engenho-types
2//!
3//! The typed Kubernetes resource catalog for engenho.
4//!
5//! Per `pleme-io/theory/ENGENHO.md` §II.1, every Kubernetes kind is a
6//! `#[derive(KubeResource, TataraDomain)]` struct mechanically emitted by
7//! `forge-gen` from upstream OpenAPI v3 (Pillar 12 — generation over
8//! composition). The non-negotiable rule of this crate: **no hand-authored
9//! resource types**. If you reach for a hand-written struct, you are
10//! violating the prime directive — extend the generator instead.
11//!
12//! ## Crate layout (target)
13//!
14//! ```text
15//! engenho-types/
16//! ├── src/
17//! │   ├── lib.rs                 (this file — module roots + invariants)
18//! │   ├── kind.rs                (trait KubeResource — the typed contract)
19//! │   ├── meta.rs                (ObjectMeta, ListMeta, TypeMeta)
20//! │   ├── api.rs                 (GroupVersionKind, GroupVersionResource)
21//! │   ├── core_v1/               (generated — Pod, Service, Namespace, …)
22//! │   ├── apps_v1/               (generated — Deployment, ReplicaSet, …)
23//! │   ├── rbac_v1/               (generated — Role, ClusterRole, …)
24//! │   ├── networking_v1/         (generated — NetworkPolicy, Ingress, …)
25//! │   ├── storage_v1/            (generated — StorageClass, …)
26//! │   ├── coordination_v1/       (generated — Lease, …)
27//! │   ├── apiextensions_v1/      (generated — CustomResourceDefinition)
28//! │   └── …                      (~16 generated kind groups total)
29//! ├── vendor/
30//! │   └── openapi/v1.34.0/       (BLAKE3-attested upstream schemas)
31//! └── tests/
32//!     ├── openapi_roundtrip.rs   (each kind ↔ openapi-spec/v3/*.json)
33//!     ├── bit_repro.rs           (forge-gen regenerate == tree source)
34//!     └── lisp_authoring.rs      (TataraDomain round-trip per kind)
35//! ```
36//!
37//! ## Status — M0.0
38//!
39//! Crate scaffold only. The first kind (Pod) lands in M0.0.1 as a
40//! hand-authored target shape, validated by `tests/openapi_roundtrip.rs`
41//! against `vendor/openapi/v1.34.0/api__v1_openapi.json` — that hand-author
42//! is **the generator's bullseye**, the byte-for-byte target that
43//! `forge-gen --backend kube-resource` must emit by M0.0.3. The kind itself
44//! is then deleted from the tree and replaced by the generator's output.
45//!
46//! ## Ship gate (theory/ENGENHO.md §XIII)
47//!
48//! Engenho ships ONLY when Sonobuoy `--mode=certified-conformance`
49//! passes on Kubernetes 1.34 with zero skips. Until M4 lands, the kasou
50//! + kikai bridge runs k3s v1.34 in production locally and supplies the
51//! operator kubectl experience while engenho catches up.
52
53#![warn(clippy::pedantic)]
54#![allow(clippy::module_name_repetitions)]
55
56pub mod api;
57pub mod auth;
58pub mod client;
59pub mod consistency_tier;
60pub mod error;
61pub mod generated_v1_34;
62pub mod informer;
63pub mod kind;
64pub mod meta;
65pub mod nomad_v1;
66pub mod patch;
67pub mod translator;
68pub mod primitives;
69pub mod reconciler;
70pub mod watch;
71
72pub use consistency_tier::{
73    tier_from_metadata, ConsistencyTier, CONSISTENCY_TIER_ANNOTATION,
74};
75
76// Generated kind modules land below this line. M0.0.1 introduces core_v1::Pod
77// as the proof-of-pipeline; M0.0.3 replaces it with generator output; M0.0.4
78// scales to ~150 kinds across ~16 groups.
79
80#[cfg(test)]
81mod tests {
82    #[test]
83    fn workspace_compiles() {
84        // Placeholder. M0.0 trivially passes; meaningful tests come with
85        // the first generated kind. The point of this test is to detect
86        // workspace breakage during scaffolding, not to verify behaviour.
87    }
88}