fix(ai): raise anomaly threshold to 2x, filter 'Ran diagnostic' noise

More aggressive noise filtering:

1. Anomaly threshold raised from 1.5x to 2x
   - 1.5x is too borderline to be actionable
   - Now requires genuinely significant deviation

2. Filter out 'Ran diagnostic' and 'Executed command' fallback items
   - These are generic summaries that provide no value
   - Only show remediations with specific, meaningful descriptions

Goal: If something shows in AI Intelligence, it should demand attention.
This commit is contained in:
rcourtman 2025-12-21 17:19:32 +00:00
parent 0f22906767
commit c8a32a7131
2 changed files with 12 additions and 4 deletions

View file

@ -271,6 +271,12 @@ export const AIOverviewTable: Component<{ showWhenEmpty?: boolean }> = (props) =
: actionableRemediations.slice(0, ACTION_LIMIT);
for (const rem of visibleRemediations) {
// Get the title - skip if it's just the generic fallback
const title = rem.summary || summarizeValue(rem.problem, rem.action);
if (title === 'Ran diagnostic' || title === 'Executed command') {
continue; // Skip generic fallbacks - not actionable
}
const outcomeBadgeClass: Record<string, string> = {
resolved: 'bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300',
partial: 'bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300',
@ -282,7 +288,7 @@ export const AIOverviewTable: Component<{ showWhenEmpty?: boolean }> = (props) =
type: 'impact',
typeBadge: rem.outcome === 'resolved' ? 'Fixed' : rem.outcome === 'failed' ? 'Failed' : 'Action',
typeBadgeClass: outcomeBadgeClass[rem.outcome] || 'bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-300',
title: rem.summary || summarizeValue(rem.problem, rem.action), // Use backend summary or fallback
title: title,
subtitle: rem.resource_name || '',
timestamp: formatRelativeTime(rem.timestamp),
locked: false,
@ -291,6 +297,7 @@ export const AIOverviewTable: Component<{ showWhenEmpty?: boolean }> = (props) =
}
// Changes - only show meaningful changes, not noise
// Skip: created (just patrol discovering resources)
// Skip: backed_up (backups have their own section, no need to duplicate here)

View file

@ -296,11 +296,12 @@ func (s *Store) CheckResourceAnomalies(resourceID string, metrics map[string]flo
ratio := value / baseline.Mean
// Filter out statistically significant but practically meaningless anomalies
// Users don't care about "1.0x baseline" or small deviations
// Require at least 50% deviation from baseline to report
if ratio >= 0.5 && ratio <= 1.5 {
// Users don't care about small deviations from baseline
// Require at least 2x above baseline OR 0.5x below to be truly actionable
if ratio >= 0.5 && ratio <= 2.0 {
continue // Too close to baseline to be actionable
}
report := AnomalyReport{
ResourceID: resourceID,