Skip to content

feat: SLA Risk Score (M118)#260

Merged
hlin99 merged 1 commit into
mainfrom
feat/m118-sla-risk-score
Apr 6, 2026
Merged

feat: SLA Risk Score (M118)#260
hlin99 merged 1 commit into
mainfrom
feat/m118-sla-risk-score

Conversation

@hlin99

@hlin99 hlin99 commented Apr 6, 2026

Copy link
Copy Markdown
Member

Summary

Composite 0-100 SLA risk score combining five signal dimensions into a single actionable metric.

Changes

  • SLARiskScorer class in sla_risk.py
  • Pydantic models: RiskScore, RiskFactor, SLARiskReport, RiskLevel
  • 5 risk factors with configurable weights:
    • Headroom tightness (30%): how close P95 latencies are to SLA thresholds
    • Tail heaviness (20%): P99/P50 ratio indicating long-tail risk
    • Latency jitter (20%): CV of latency indicating instability
    • Convergence adequacy (15%): whether sample size is sufficient
    • Error budget burn rate (15%): rate of SLA-violating requests
  • Risk levels: LOW (0-25), MODERATE (25-50), HIGH (50-75), CRITICAL (75-100)
  • CLI sla-risk subcommand with table + JSON output
  • Programmatic assess_sla_risk() API
  • 30 new tests

Closes #259

- SLARiskScorer class in sla_risk.py
- Pydantic models: RiskScore, RiskFactor, SLARiskReport, RiskLevel
- Composite 0-100 score: headroom (30%), tail (20%), jitter (20%), convergence (15%), burn rate (15%)
- Per-factor detail with individual scores and explanations
- Risk level classification: LOW/MODERATE/HIGH/CRITICAL
- CLI sla-risk subcommand with table + JSON output
- Programmatic assess_sla_risk() API
- 30 new tests

Closes #259

@hlin99-Review-Bot hlin99-Review-Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM. Clean implementation — 5-factor composite risk scoring with well-bounded outputs, good test coverage (30 tests), proper edge case handling. CI all green.

@hlin99-Review-BotX hlin99-Review-BotX left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved. 5-factor composite risk scorer is well-designed — clean scoring functions with proper clamping, good Pydantic models, CLI with table+JSON output, and 30 tests. CI all green. Ship it.

@hlin99-Review-BotX hlin99-Review-BotX left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved (hlin99-Review-BotX)

Idea Value: Strong — composite risk scoring combining headroom, tail, jitter, convergence, and burn rate into a single actionable metric is genuinely useful for SLA management.

Code Quality:

  • Clean Pydantic models with proper field descriptions
  • Scoring functions are well-bounded (0-100) with sensible thresholds
  • Convergence check via running P95 windows is a nice touch
  • CLI with both table and JSON output
  • 30 tests, CI green across Python 3.10/3.11/3.12
  • docs/iterations/current.md updated

LGTM.

@hlin99 hlin99 merged commit 7f8b39d into main Apr 6, 2026
5 checks passed
@hlin99 hlin99 deleted the feat/m118-sla-risk-score branch April 6, 2026 10:40
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.

feat: SLA Risk Score (M118)

3 participants