Skip to content

Make EKS upgrade scoring deterministic across runs#2

Open
kahhaw9368 wants to merge 1 commit into
mainfrom
fix/deterministic-scoring
Open

Make EKS upgrade scoring deterministic across runs#2
kahhaw9368 wants to merge 1 commit into
mainfrom
fix/deterministic-scoring

Conversation

@kahhaw9368

Copy link
Copy Markdown
Contributor

Problem

The same cluster (test-old-cluster, 1.31→1.32) scored 72% on one run and 88% on another with no change to the cluster. The scoring arithmetic is deterministic, but the finding list feeding it was built from model judgment in three spots, so two runs legitimately diverged.

Root causes & fixes

1. Deprecated v1beta3 APF objects (10-pt swing). The steering both said "count them" and "they're harmless system objects." Replaced with a deterministic two-test filter in deprecated-apis.md Step 3b:

  • Test 1 (stored apiVersion): if the live object is already stored on ...k8s.io/v1, exclude it — a v1beta3 string in managedFields is stale edit-history, not live config.
  • Test 2 (writer identity): if the only writer of v1beta3 is an internal APF controller (api-priority-and-fairness-config-*, eks-internal), exclude it. Count only when a user tool (kubectl/helm/argocd/flux) wrote the removed version.

Verified live: eks-exempt / eks-leader-election / eks-workload-high are stored on v1 with only internal-controller history → correctly excluded (0 pts).

2. Add-on compatibility (4-pt swing). "COMPATIBLE" was assignable without checking. Made aws eks describe-addon-versions comparison mandatory in addon-compatibility.md with a bright-line verdict table — no COMPATIBLE without running the check.

3. Anonymous-auth restriction (2-pt swing). The finding fit both Breaking Changes and Behavioral Changes. Pinned its single scoring home to Breaking Changes (Category 1, 4 pts); added do-not-double-count guards in both files.

4. Safety net. Added a score-reconciliation hard gate in report-generation.md: headline score must equal 100 minus the Master Finding List sum, and every "always flag" item must appear as a row. Catches header/table drift automatically.

Result

The cluster now scores a stable 82% on every run — the two prior runs were over-penalized (72, counted the flowcontrol false positives) and under-penalized (88, also dropped the real add-on and anon-auth findings) respectively. The corrected run keeps the genuine deductions and drops only the false positives.

Files changed

  • .claude/skills/eks-upgrade/steering/deprecated-apis.md
  • .claude/skills/eks-upgrade/steering/breaking-changes.md
  • .claude/skills/eks-upgrade/steering/addon-compatibility.md
  • .claude/skills/eks-upgrade/steering/report-generation.md

🤖 Generated with Claude Code

The same cluster scored 72% and 88% on two runs because three scoring
decisions were left to model judgment rather than pinned to rules:

1. Deprecated v1beta3 APF objects: steering both said "count them" and
   "they're harmless system objects." Added deterministic Step 3b two-test
   filter — a FlowSchema/PriorityLevelConfiguration counts only if its
   stored (live) apiVersion is a removed version OR a user tool
   (kubectl/helm/argocd/flux) wrote the removed version. Objects already
   stored on v1 whose only v1beta3 trace comes from internal APF
   controllers (api-priority-and-fairness-config-*, eks-internal) are
   false positives and do not count. Verified against the live cluster:
   eks-exempt / eks-leader-election / eks-workload-high are stored on v1
   with only internal-controller v1beta3 history -> correctly excluded.
   Referenced from report-generation Category 2 and breaking-changes.

2. Add-on compatibility: "compatible" was assignable without checking.
   Made `describe-addon-versions` comparison mandatory with a bright-line
   verdict table — no COMPATIBLE without running the check.

3. Anonymous-auth restriction fit two categories (Breaking vs Behavioral).
   Pinned its single scoring home to Breaking Changes; added do-not-double-
   count guards in both files.

Also added a score-reconciliation hard gate: headline score must equal
100 minus the Master Finding List sum, and every "always flag" item must
appear as a row. Catches header/table drift automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant