docs(CLAUDE.md): codify the conditions convention#329
Merged
Conversation
Adds a Conditions section to the project's working-doc next to Status patches. Establishes School 1 (always-present, transition with reason) as the default for every metav1.Condition on SeiNodeDeployment, SeiNode, and SeiNodeTask, matching Kubernetes upstream Pod / Deployment / Gateway-API / CAPI conventions. School 2 (absent-when-not-applicable) is reserved for two narrow cases: *Needed-style exception conditions and kubectl wait consumer conditions (SeiNodeTask Ready/Failed). Lands ahead of two follow-up PRs: - PR B: rename ConditionRouteReady to ConditionNetworkingReady and migrate to School 1 with stable reasons (NetworkingDisabled, NoEffectiveRoutes, etc.), removing both removeCondition call sites - PR C: orphan-cleanup envtest exercising the new condition shape
PR SummaryLow Risk Overview Also documents additional guardrails like using Reviewed by Cursor Bugbot for commit 985c691. Bugbot is set up for automated code reviews on this repo. Configure here. |
This was referenced May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
### Conditionssection toCLAUDE.mdnext to### Status patches. Codifies the working convention formetav1.Conditionlifecycle across all three controllers (SeiNodeDeployment,SeiNode,SeiNodeTask).Net: 1 file, +37 / 0.
Why now
Today the codebase mixes two patterns:
NodesReady,GenesisCeremonyComplete,PlanInProgress,RolloutInProgress,TargetReadyRouteReady,GenesisCeremonyNeeded,ImportPVCReady,SigningKeyReady,NodeKeyReady,OperatorKeyringReady, SeiNodeTaskReady/FailedRouteReadywas originally surfaced by the SRE Coral review on the envtest Phase 5 orphan-cleanup PR: the condition is removed whenspec.networkingis unset, which is indistinguishable inkubectl describefrom "controller hasn't reconciled yet." Before fixing one site, we want the doctrine.Coral cross-review (kubernetes-specialist + sre-engineer) converged unambiguously:
BackendNotFound) are expressed asStatus=False, Reason=BackendNotFound, never as absence. Deployment'sReplicaFailureis the rare canonical School 2 (transient exception condition).PausedPR specifically to insist it ships School 1, because PromQL keyed onkube_..._status_condition{type="Paused"}becomes brittle if the condition disappears when not paused (absent()gymnastics, false-positive scrape-down alarms on Grafana panels).RouteReady→NetworkingReadyis the first conversion (PR B); the rest harmonize on first edit through their respective controller files.What the doctrine says
Status+Reason+lastTransitionTime.*Needed-style (whereFalsewould be tautological) andkubectl waitconsumers where present-vs-absent semantics are load-bearing (SeiNodeTask).*Ready/*InProgress/*Complete→ School 1;*Needed→ School 2. No mixed polarities for the same subject (the SeiNodeTaskReady/Failedpair is the documented exception, justified bykubectl wait --for=condition=Ready=true+--for=condition=Failed=truedual-exit signaling).False/NotApplicableinstead.CamelCase, finite set per condition type. Dynamic data goes in the message.ObservedGenerationdiscipline. EverysetConditionsite populates it. The four directapimeta.SetStatusConditioncalls ininternal/controller/nodetask/controller.goare a known divergence to harmonize on first edit through that file.Coral cross-review on this PR
K8s-specialist flagged:
*Pendingvs*InProgresswere lumped together; dropped*Pendingsince*InProgresscovers both for sei's domain.kubectl wait --for=condition=Failedis the dual exit signal — explained why the SeiNodeTaskReady+Failedmixed-polarity pair is the documented exception.ObservedGenerationknown divergence — call out the specific nodetask call sites needing harmonization.False/NotApplicableguidance for the transition-to-inapplicable case.All incorporated.
Test plan
🤖 Generated with Claude Code