1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
//! Closed-set of FluxCD resource kinds emitted or consumed by the
//! tatara reconciler + typed projections for their `(apiVersion, kind)`
//! pair — the substrate primitive that owns the workspace-wide (variant
//! → wire-form identity) mapping every Flux-facing site would otherwise
//! restate by hand.
//!
//! Pre-lift the `(apiVersion, kind)` pairing was hand-authored across
//! FIVE production sites in `tatara-reconciler` past the ★★
//! PRIME-DIRECTIVE ≥ 2 duplication threshold, split across two axes:
//!
//! * `Kustomization` — two production sites:
//! * `tatara-reconciler::boundary::evaluate` — the
//! `ConditionKind::KustomizationHealthy` arm's
//! `evaluate_flux_ready(..., "kustomize.toolkit.fluxcd.io/v1",
//! "Kustomization")` call.
//! * `tatara-reconciler::render::render_flux` — the emitted
//! `json!({"apiVersion": "kustomize.toolkit.fluxcd.io/v1",
//! "kind": "Kustomization", ...})` block.
//! * `HelmRelease` — two production sites:
//! * `tatara-reconciler::boundary::evaluate` — the
//! `ConditionKind::HelmReleaseReleased` arm's
//! `evaluate_flux_ready(..., "helm.toolkit.fluxcd.io/v2",
//! "HelmRelease")` call.
//! * `tatara-reconciler::render::render_aplicacao` — the emitted
//! `json!({"apiVersion": "helm.toolkit.fluxcd.io/v2",
//! "kind": "HelmRelease", ...})` block.
//! * `OCIRepository` — two production sites (both in
//! `tatara-reconciler::render::render_aplicacao`):
//! * The emitted `json!({"apiVersion":
//! "source.toolkit.fluxcd.io/v1beta2", "kind": "OCIRepository",
//! ...})` block for the `oci://` chart-ref branch.
//! * The inline `chartRef.kind = "OCIRepository"` slot on the
//! sibling HelmRelease spec.
//!
//! Every pre-lift site restated the axis-typed `&'static str` slot
//! byte-identically; a regression that swapped ONE arm's `apiVersion`
//! from `v1` to `v1beta1` (a Flux API-version bump that reaches only
//! one of the two sites) or misspelled `Kustomization` at ONE site
//! would silently mis-route the reconciler's SSA-fetch against the
//! K8s API server (fetch under one apiVersion + apply under another
//! is a 404 at wire time). Post-lift every axis binds at ONE closed-
//! set owner and rustc enforces every consumer reads the pair from
//! the SAME variant.
//!
//! Sibling to the same-shape `IntentKind` closed set on the
//! `Intent` tagged-union axis (in `crate::intent`): both project a
//! closed set of variant → wire-form identity slots through named
//! per-variant methods; `IntentKind::as_str` returns the camelCase
//! wire key of a serde variant, while `FluxResource::api_version` +
//! `FluxResource::kind` return the K8s `apiVersion` + `kind` wire
//! strings of a Flux resource variant. Peer to the sibling
//! substrate primitives `owner_reference_json` / `api_version()` /
//! `PROCESS_KIND` in `crate::lib` on the same "K8s wire-form
//! identity" axis but for the tatara `Process` CRD itself, rather
//! than for the Flux resources tatara's reconciler emits or
//! consumes.
//!
//! Extension: a fourth Flux resource kind (a `Bucket` for
//! S3-backed sources, a `Receiver` for webhook-triggered
//! reconciliation, an `Alert` / `Provider` for notification-
//! controller integration, an `ImagePolicy` / `ImageRepository`
//! for image-driven reconciliation, a hypothetical Flux
//! `GitRepository` variant we don't yet reach for at the wire) lands
//! as ONE variant + ONE `api_version` arm + ONE `kind` arm + ONE
//! `ALL` entry, all four exhaustively enforced by rustc's match
//! coverage. Every downstream Flux-facing consumer inherits the
//! extension mechanically through the same `FluxResource::X.api_version()`
//! / `.kind()` dispatch pair.
//!
//! Theory grounding: THEORY.md §VI.1 (generation over composition —
//! the (apiVersion, kind) pairing recurred at five hand-authored sites
//! past the PRIME-DIRECTIVE ≥ 2 duplication trigger, and is lifted to
//! ONE closed-set owner per axis here). THEORY.md §II.1 invariant 5
//! (composition preserves proofs — the two per-axis mappings live at
//! ONE typed algebra projection apiece; a regression that drifted the
//! apiVersion at ONE consumer would fail-loudly at this module's byte-
//! shape pins rather than as silent SSA-fetch-vs-emit skew at the
//! reconciler wire).
/// Closed set of FluxCD resource kinds this repo's reconciler emits or
/// consumes at the wire. The three variants partition the current
/// Flux-facing surface:
///
/// * `Kustomization` — `kustomize-controller` reconciles a set of
/// K8s manifests from a source (`GitRepository` / `OCIRepository`).
/// Emitted by [`crate::intent::FluxIntent`]; consumed by
/// `ConditionKind::KustomizationHealthy`.
/// * `HelmRelease` — `helm-controller` installs / upgrades a Helm
/// chart from a source. Emitted by [`crate::intent::AplicacaoIntent`];
/// consumed by `ConditionKind::HelmReleaseReleased`.
/// * `OCIRepository` — `source-controller` pulls a chart from an OCI
/// registry. Emitted by [`crate::intent::AplicacaoIntent`] for
/// `oci://` chart refs, referenced by the sibling HelmRelease's
/// `chartRef` slot.
///
/// Every variant carries a stable `(api_version, kind)` pair through
/// its typed projections; both projections are `const fn` so the
/// pair reduces to a `&'static str` slot at every callsite with no
/// runtime overhead.