mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-25 21:19:38 +00:00
1f796bf6e3
## Rules as GitHub single source of truth - Add 75 individual JSON rule files (2 gather, 18 analyze, 55 IME patterns) under rules/gather/, rules/analyze/, rules/ime-log-patterns/ - Add JSON Schemas for all three rule types with VS Code IntelliSense support - Add CI combine script (rules/scripts/combine.js) + GitHub Action that validates schemas with ajv-cli and generates rules/dist/ combined files - Convert BuiltIn*.cs from hardcoded C# objects to embedded JSON resource loaders - Add GitHubRuleRepository service to fetch dist/ files from raw.githubusercontent.com - Add ReseedFromGitHubFunction: POST /api/rules/reseed-from-github?type=all|gather|analyze|ime ## IME Log Patterns - Extend ImeLogPattern model with Description and IsBuiltIn properties - Add ImeLogPatterns table + API constants - Add TableStorageService CRUD methods for IME log patterns - Add ImeLogPatternService (CRUD, merge, auto-seed from embedded JSON) - Add ImeLogPatternsFunction: GET/PUT /api/rules/ime-log-patterns (Phase 1: read-only for tenants, Galactic Admin can enable/disable/edit globally) - Add IME Log Patterns management page (/ime-log-patterns) - Wire GetAgentConfigFunction to use ImeLogPatternService instead of static class ## API route consolidation - All rule endpoints now under /api/rules/* for single certificate exclusion path: /api/rules/gather, /api/rules/analyze, /api/rules/ime-log-patterns, /api/rules/reseed-from-github ## Export buttons - Add per-rule and export-all JSON download buttons to gather-rules, analyze-rules, and ime-log-patterns pages ## Admin configuration - Replace old individual reseed buttons with unified "Fetch & Reseed from GitHub" (calls new GitHub endpoint) plus compact individual-type reseed buttons - Add CDN cache hint: GitHub raw.githubusercontent.com caches up to 5 minutes ## Preview mode - ?preview=1 URL param seeds localStorage.previewMode (persists across navigation) - ?preview=0 clears it; toggle in Navbar settings dropdown (indigo, eye icon) - IME Log Patterns nav link gated behind galacticAdminMode OR previewMode - Preview badge shown on nav link when active for normal users ## Tests - Add xUnit test project (net8.0) with 5 tests for embedded resource loading, known IME actions validation, and valid categories check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1.4 KiB
JSON
39 lines
1.4 KiB
JSON
{
|
|
"$schema": "../schema/analyze-rule.schema.json",
|
|
"ruleId": "ANALYZE-DEV-002",
|
|
"title": "High Memory Usage During Enrollment",
|
|
"description": "Detects when memory usage exceeds 90% during enrollment, which can cause app installation failures or system instability.",
|
|
"severity": "warning",
|
|
"category": "device",
|
|
"enabled": true,
|
|
"baseConfidence": 55,
|
|
"conditions": [
|
|
{
|
|
"signal": "high_memory",
|
|
"source": "event_type",
|
|
"eventType": "performance_snapshot",
|
|
"dataField": "memory_used_percent",
|
|
"operator": "gt",
|
|
"value": "90",
|
|
"required": true
|
|
}
|
|
],
|
|
"confidenceFactors": [
|
|
{ "signal": "app_failed", "condition": "exists", "weight": 20 },
|
|
{ "signal": "enrollment_failed", "condition": "exists", "weight": 15 }
|
|
],
|
|
"explanation": "Memory usage exceeded 90% during enrollment. High memory pressure can cause app installation failures, system slowdowns, and ESP timeouts.",
|
|
"remediation": [
|
|
{
|
|
"title": "Reduce memory pressure",
|
|
"steps": [
|
|
"Review which apps are being installed concurrently during ESP",
|
|
"Consider staggering resource-heavy installations",
|
|
"Check minimum RAM requirements for the device (8 GB recommended)",
|
|
"Investigate if background services are consuming excessive memory"
|
|
]
|
|
}
|
|
],
|
|
"tags": ["device", "memory", "performance"]
|
|
}
|