feat(backend): manage cluster role assignments through deployment stacks #7536
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #7536"
general
weight: 0.35
stevekuznetsov
Why
Separate cluster role-assignment policy from Azure execution using durable Cosmos stack intent. A single authoritative deployment stack manages the desired assignments and removes assignments omitted from subsequent templates.
No tracking ticket was supplied; this PR implements the requested mechanism and its first producer together.
What
Spec.Stackfor Apply and Delete; deletion settings come from itsProperties.ActionOnUnmanagepolicy.NoOp; reject zero-valued decisions. Initial Apply responses and associated GETs share Apply-state interpretation without conflating it with the current desired action or Delete acceptance. Action-focused logs explain submission attempts and changed observations; unchanged polls and cooldowns stay silent.Status is a last observation, not instantaneous live truth. Unknown submission outcomes recover by observation and, when needed, redundant application. Bounded stale observations across crashes and intent reversions are accepted until periodic repair. Producers own sequencing, target immutability, and avoiding competing desires.
Testing
make generatecompleted without additional changes;make verify-json-formatpassed.make tidyis stable, and independent readonly dependency resolution passed across workspace modules.deleting, and then 404. Probe resources were deleted and verified absent.Retry Contract
An unchanged invalid-intent outcome is eligible again only after its configured interval, using persisted state and time rather than event filtering. New rejected attempts renew that interval even when diagnostics are identical; unchanged GET observations do not write. Completed-operation metadata does not restart the interval, and condition transition timestamps change only when their truth value changes.
Invalid intent is narrowly identified by
InvalidTemplateorInvalidRequestContent, directly or as all direct causes beneathDeploymentStackDeploymentFailed. Broad/nested errors remain retryable. Real responses demonstrate thatInvalidTemplateDeployment, including HTTP 400, can represent a permission failure without a structured authorization code, so neither that code nor HTTP 400 alone establishes invalid intent.Pending work requests fixed 30-second polling. Execution failures use ordinary workqueue errors; other events may reconcile earlier. No manual Retry-After parsing or additional retry gate is imposed.
Operational Notes
Existing eligible clusters migrate automatically. Historical assignments never adopted by a stack are intentionally left alone. Existing-cluster adoption, production FPA permissions, and SMI execution still require rollout validation. No shared role-definition, CI/CD, or image-configuration changes are included. Personal-environment documentation changes remain outside this PR.
Two commits separate the generic machinery from the role-assignment migration.