mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 14:00:29 +00:00
8310974634
Complete Phase 2 baseline integration: - Add baseline_exports.go for clean type aliasing - Wire baseline store initialization into StartPatrol - Implement startBaselineLearning background loop - Runs initial learning after 5 min delay - Updates baselines every hour from metrics history - Learns from 7 days of data for nodes, VMs, containers - Add SetBaselineStore methods throughout the chain (Router -> AIHandler -> Service -> PatrolService) - Persists baselines to data directory as JSON The baseline learning loop: 1. Starts automatically when AI patrol starts 2. Queries metrics history for all resources 3. Computes mean, stddev, percentiles for cpu/memory/disk 4. Saves baselines to disk for durability 5. Anomaly detection uses these baselines in context builder All tests passing.
Internal API Package
This directory contains the API server implementation for Pulse.
Important Note About frontend-modern/
The frontend-modern/ subdirectory that appears here is:
- AUTO-GENERATED during builds
- NOT the source code - just a build artifact
- IN .gitignore - never committed
- REQUIRED BY GO - The embed directive needs it here
Frontend Development Location
👉 Edit frontend files at: /opt/pulse/frontend-modern/src/
Why This Structure?
Go's //go:embed directive has limitations:
- Cannot use
../paths to access parent directories - Cannot follow symbolic links
- Must embed files within the Go module
This is a known Go limitation and our structure works around it.