Add count-aware confidence and database-owned classifier tunables (D-0050) #127
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/classifier-count-aware-confidence"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Adds count-aware confidence to the deterministic incident classifier and makes the six classifier control values database-owned, Admin-UI editable, and API-exposed (D-0050).
Count-aware confidence.
DeterministicIncidentClassifieradds a bounded repeat-volume term to confidence:min(RepeatConfidenceBonusCap, RepeatConfidenceCoefficient * log2(eventCount)), applied only once the incident's event count reachesRepeatConfidenceMinEvents(defaults 4 / 0.08 / 0.30). A high-volume incident can gain confidence without its severity moving; severity stays decoupled.Database-owned tunables. The six controls (
ScoreForFullConfidence,SeverityPerScorePoint,BlockRecommendationScore,RepeatConfidenceMinEvents,RepeatConfidenceCoefficient,RepeatConfidenceBonusCap) live in a single-rowclassifier_settingsstore, seeded create-only fromClassifierOptions, edited on/configuration(step-up gated, audited), and hot-refreshed over the Postgresviegard_config_classifier_settingsNOTIFY channel. They are exposed read-only at/api/v1/classifier/settings(with aseededflag that falls back to code options until seeded). The already database-owned policy thresholds are now also exposed at/api/v1/policy/thresholds.No related issue.
How was this tested?
dotnet build- 0 errors, 0 warnings (Viegard.slnx)dotnet test- all pass (Application 536/536, AdminApi 201/201, Postgres integration 82/82)End-to-end render check against a disposable in-memory instance (no real installation or database touched):
GET /api/v1/classifier/settingsreturnedseeded=falsewith the code-option fallback values, thenseeded=truewith the submitted values after editing and saving on/configuration.GET /api/v1/policy/thresholdsreturned the threshold values./configurationclassifier section rendered all six inputs; the edit round-trip persisted and audited.Postgres integration tests were also run against a disposable Postgres 17 container (the per-test truncate list now includes
classifier_settingsto keep test isolation).Checklist