feat(resilience): add score confidence intervals via batch Monte Carlo (#2877)

* feat(resilience): add score confidence intervals via batch Monte Carlo

Weekly cron perturbs domain weights ±10% across 100 draws per country,
stores p05/p95 in Redis. Score handler reads intervals and includes
them in the API response as ScoreInterval { p05, p95 }.

Proto field 14 (score_interval) added to GetResilienceScoreResponse.

* chore: regenerate proto types and OpenAPI docs for ScoreInterval

* fix(resilience): add seed-meta + lock + fix interval cache + percentile formula

1. Write seed-meta:resilience:intervals for health monitoring
2. Add distributed lock to prevent concurrent cron overlap
3. Move scoreInterval read outside 6h score cache boundary
4. Fix percentile index from floor to ceil-1 (nearest-rank)

* fix(health): add resilience:intervals to health + seed-health registries

* fix(seed): skip seed-meta on no-op runs + register intervals in health check
This commit is contained in:
Elie Habib
2026-04-09 22:06:54 +04:00
committed by GitHub
parent a4ded3f5da
commit 0a1b74a9b2
13 changed files with 382 additions and 3 deletions

View File

@@ -132,6 +132,8 @@ components:
format: double
dataVersion:
type: string
scoreInterval:
$ref: '#/components/schemas/ScoreInterval'
ResilienceDomain:
type: object
properties:
@@ -164,6 +166,15 @@ components:
imputedWeight:
type: number
format: double
ScoreInterval:
type: object
properties:
p05:
type: number
format: double
p95:
type: number
format: double
GetResilienceRankingRequest:
type: object
GetResilienceRankingResponse: