← Back to Pull requests

feat(api): add PodGroup safeToDisrupt to opt out of consolidation #22

Closed
unknown closed this pull request without merging on Oct 29, 2026 01:14 UTC
View on GitHub
unknown unknown commented on Oct 12, 2026 19:09 UTC
Author

Description

Adds an optional PodGroupSpec.SafeToDisrupt (*bool) and the kai.scheduler/safe-to-disrupt annotation key, so a workload can opt out of evictions that are not driven by fairness or priority. Today that is the consolidation action, which evicts pods to repack nodes for a pending workload. A workload that does not survive a restart (for example replicas with restartPolicy: Never, or bare pods) can set it to false. Preempt and reclaim are unaffected. Unset means true, so existing PodGroups behave as before.

  • PodGroupSpec.SafeToDisrupt (protobuf tag 11), with the regenerated deepcopy and CRD.

  • ParseSafeToDisrupt, which the pod-grouper uses to read the annotation, as it does ParsePreemptionDelay and ParseStalenessGracePeriod.

  • SafeToDisruptAnnotationKey, next to the preemption-delay and staleness-grace-period keys.
  • The pod-grouper and scheduler changes that use these are in kai-scheduler/KAI-Scheduler#2284. Following review there, the field is named safeToDisrupt rather than safeToConsolidate, so it is not tied to one action. Following kai-scheduler/KAI-Scheduler#1928, the API part lands here first.

    Related Issues

    Part of kai-scheduler/KAI-Scheduler#2283; needed by kai-scheduler/KAI-Scheduler#2284.

    Checklist

  • Self-reviewed

  • Added/updated tests (if needed): TestParseSafeToDisrupt

  • Updated documentation (if needed): field GoDoc, which is also the CRD description

  • Added a changelog fragment via make changelog
  • Breaking Changes

    None. The field is optional and defaults to true.

    Additional Notes

    make generate manifests build test lint is clean. The only generated changes are the new field in zz_generated.deepcopy.go and in config/crd/scheduling.run.ai_podgroups.yaml.

    🤖 Generated with Claude Code

    Diff: 230 lines (+172 / -58) across 2 files Reviewer: sam-huang1223 Review duration: 23404m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 230 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.326
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #22"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37% (MEDIUM) · Higher = larger blast radius
    37%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.6% · Safe to merge
    14.6%