Expand description
§engenho-diff
A differential integration-test harness: detect where engenho’s Kubernetes surface diverges from k3s, using a live k3s cluster as the reference oracle. This is engenho’s mechanical path to CNCF conformance — every divergence it surfaces is a typed, attributed gap to close.
§Shape
One authored set of typed Operations is fired at TWO DiffTargets
— engenho (EngenhoTarget, booted in-process) and k3s
(K3sTarget, the oracle) — and each paired Observation is folded
through a typed Normalizer into a recursive JSON differ that yields a
typed Verdict:
┌──────────── Operation ────────────┐
▼ ▼
EngenhoTarget.raw() K3sTarget.raw()
│ │
Observation ───┐ ┌─── Observation
▼ ▼
Normalizer (mask volatile fields)
│ │
▼ ▼
cotejo::diff_observations → Verdict
{ Parity | Divergent(..) | ReferenceUnreachable }Verdict::Parity is proof-by-absence — no code outside this crate can
construct one (★★ UNREPRESENTABILITY). JsonPath is a typed value,
rendered only through Display (★★ TYPED EMISSION).
Re-exports§
pub use cotejo::diff_observations;pub use cotejo::run;pub use cotejo::run_strict;pub use normalize::Mask;pub use normalize::Normalizer;pub use normalize::volatile_meta;pub use observe::DiffError;pub use observe::HttpMethod;pub use observe::Observation;pub use op::OpKind;pub use op::Operation;pub use op::RestPath;pub use path::JsonPath;pub use path::PathSeg;pub use target::DiffTarget;pub use target::EngenhoTarget;pub use target::K3sTarget;pub use verdict::Divergence;pub use verdict::Gvr;pub use verdict::ParityWitness;pub use verdict::Severity;pub use verdict::Side;pub use verdict::StatusCause;pub use verdict::Verb;pub use verdict::Verdict;
Modules§
- cotejo
cotejo(Portuguese: a collation / side-by-side comparison) — the diff interpreter. It executes anOperationagainst twoDiffTargets and folds the pairedObservations through theNormalizerinto a typedVerdict. The core differ (diff_observations) is a pure function over twoObservations + aNormalizer— unit-testable with zero clusters.- normalize
- The
Normalizer— a typed, ordered list ofMasks that strips legitimately-varying fields BEFORE the differ runs. Without it every diff is ~100% noise (uid/resourceVersion/timestamps differ on every object). The masks are auditable: strict mode (seecrate::cotejo) re-diffs the RAW objects and re-reports whatever a mask suppressed asSeverity::Cosmetic, so a mask can never silently hide a real gap. - observe
- The response half of the harness — a typed
Observationcaptured from aDiffTarget, plus theHttpMethodverb and theDiffErrorfailure taxonomy. - op
- The stimulus half of the harness — a typed
Operationfired at both targets. Constructors build the K8s REST path from typed segments (aRestPath, rendered viaDisplay), never aformat!()-composed URL. - path
JsonPath— the typed coordinate a divergence lives at.- target
- The two ends of the diff — the
DiffTargettrait and its concrete impls:EngenhoTarget(booted in-process, the r7 seam) andK3sTarget(the live reference oracle from a kubeconfig). - verdict
- The typed verdict + divergence taxonomy.