Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Score ¶
Score implements the spec §6 formula:
score = max(0, 100 − min(75, 25·#blockers) − min(20, 5·#warnings)) ready = #blockers == 0
Info findings are listed but never scored.
func TeamScores ¶
TeamScores groups a report's findings by team and scores each subset with Score. A finding attributed to N teams counts for each of them; a finding with no teams is attributed to the empty-string team "" (callers render it as "unattributed"). Pure: no I/O, no clock — same contract as Evaluate. The result is deliberately NOT part of engine.Report; servers and CLIs compute it at presentation time.
Types ¶
type CapabilityGap ¶
type CapabilityGap struct {
Capability inventory.Capability `json:"capability"`
Reason string `json:"reason"`
}
type Category ¶
type Category string
const ( CatRemovedAPI Category = "removed-api" CatDeprecatedAPI Category = "deprecated-api" CatDeprecatedAPIInUse Category = "deprecated-api-in-use" CatEOLAddon Category = "eol-addon" CatEOLApproaching Category = "eol-approaching" CatVersionSkew Category = "version-skew" CatChartIncompat Category = "chart-incompat" CatKBStale Category = "kb-stale" )
type Finding ¶
type Finding struct {
Category Category `json:"category"`
Severity Severity `json:"severity"`
// Key is the finding's stable, count-free identity: it never embeds
// object counts, node counts, or other volatile numbers, so the same
// underlying problem keeps the same Key across snapshots even as Title
// fluctuates ("3 objects" → "2 objects"). Notification delta diffing
// keys on it. Convention: category + "/" + stable discriminator
// (e.g. "removed-api/extensions/v1beta1/Ingress", "eol-addon/ingress-nginx").
Key string `json:"key,omitempty"`
Title string `json:"title"` // one line, deterministic
Detail string `json:"detail"` // evidence sentence(s), deterministic
Teams []string `json:"teams,omitempty"` // sorted, deduped
Namespaces []string `json:"namespaces,omitempty"`
Remediation string `json:"remediation,omitempty"`
Citations []string `json:"citations,omitempty"`
}
type Report ¶
type Report struct {
ClusterID string `json:"clusterId"`
Target inventory.Version `json:"target"`
KBVersion string `json:"kbVersion"`
Score int `json:"score"`
Ready bool `json:"ready"`
Findings []Finding `json:"findings"` // sorted: severity desc, category, title
NotAssessed []CapabilityGap `json:"notAssessed,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.