Pulse/internal
rcourtman 5f000b7974 feat: Complete Unified Resource Architecture (Phases 1-3)
This commit implements the Unified Resource Architecture for AI-first
infrastructure management. Key features:

Phase 1 - Backend Unification:
- New unified Resource type with 9 resource types, 7 platforms, 7 statuses
- Resource store with identity-based deduplication (hostname, machineID, IP)
- 8 converter functions (FromNode, FromVM, FromContainer, etc.)
- REST API endpoints: /api/resources, /api/resources/stats, /api/resources/{id}
- 28 comprehensive unit tests

Phase 2 - AI Context Enhancement:
- Unified context builder for AI system prompts
- Cross-platform query methods: GetTopByCPU, GetTopByMemory, GetTopByDisk
- Resource correlation: GetRelated (parent, children, siblings, cluster)
- Infrastructure summary: GetResourceSummary with health status counts
- AI context now includes top consumers and infrastructure overview

Phase 3 - Agent Preference & Hybrid Mode:
- Polling optimization methods in resource store
- ResourceStoreInterface added to Monitor
- SetResourceStore() and shouldSkipNodeMetrics() helper methods
- Store automatically wired into Monitor via Router.SetMonitor()
- Foundation ready for reduced API polling when agents are active

Files added:
- internal/resources/resource.go - Core Resource type
- internal/resources/store.go - Store with deduplication
- internal/resources/converters.go - Type converters
- internal/resources/platform_data.go - Platform-specific data
- internal/resources/store_test.go - 28 tests
- internal/resources/converters_test.go - Converter tests
- internal/api/resource_handlers.go - REST API handlers
- internal/ai/resource_context.go - AI context builder
- .gemini/docs/unified-resource-architecture.md - Architecture docs

All tests pass.
2025-12-07 13:49:00 +00:00
..
agentbinaries chore: fix staticcheck SA warnings 2025-11-27 09:16:53 +00:00
agentexec feat: AI features, agent improvements, and host monitoring enhancements 2025-12-05 10:37:02 +00:00
agentupdate feat: AI features, agent improvements, and host monitoring enhancements 2025-12-05 10:37:02 +00:00
ai feat: Complete Unified Resource Architecture (Phases 1-3) 2025-12-07 13:49:00 +00:00
alerts Add host alert deduplication with tests 2025-12-07 12:38:38 +00:00
api feat: Complete Unified Resource Architecture (Phases 1-3) 2025-12-07 13:49:00 +00:00
auth refactor: Remove duplicate IsPasswordHashed from auth package 2025-12-02 17:19:07 +00:00
buffer Fix offline buffering: add tests, remove unused config, fix flaky test 2025-12-02 22:31:44 +00:00
config AI Problem Solver implementation and various fixes 2025-12-06 23:46:08 +00:00
crypto chore: remove additional dead code 2025-11-27 05:13:26 +00:00
discovery Add unit tests for discovery config_override utility functions 2025-11-30 00:50:07 +00:00
dockeragent Fix offline buffering: add tests, remove unused config, fix flaky test 2025-12-02 22:31:44 +00:00
errors refactor: Remove unreachable dead code branches 2025-12-02 14:48:57 +00:00
hostagent feat: AI features, agent improvements, and host monitoring enhancements 2025-12-05 10:37:02 +00:00
hostmetrics feat: AI features, agent improvements, and host monitoring enhancements 2025-12-05 10:37:02 +00:00
logging chore: remove dead code and unused exports 2025-11-27 13:17:39 +00:00
mdadm perf: Pre-compile regexes in mdadm package 2025-12-02 15:11:04 +00:00
metrics AI Problem Solver implementation and various fixes 2025-12-06 23:46:08 +00:00
mock docs: Add godoc comments to more exported functions 2025-12-02 16:03:57 +00:00
models feat: Add OS type display for LXC containers 2025-12-05 12:43:32 +00:00
monitoring feat: Complete Unified Resource Architecture (Phases 1-3) 2025-12-07 13:49:00 +00:00
notifications style: Apply gofmt to 37 files 2025-12-02 17:21:48 +00:00
resources feat: Complete Unified Resource Architecture (Phases 1-3) 2025-12-07 13:49:00 +00:00
sensors feat: AI features, agent improvements, and host monitoring enhancements 2025-12-05 10:37:02 +00:00
ssh/knownhosts test: Add tests for SSH knownhosts error and path methods 2025-12-01 17:50:13 +00:00
system style: fix gofmt formatting inconsistencies 2025-11-26 23:44:36 +00:00
tempproxy perf: Remove redundant fmt.Sprintf in tempproxy contains function 2025-12-02 15:24:40 +00:00
types test: add unit tests for types package 2025-11-26 14:10:21 +00:00
updates style: Apply gofmt to 37 files 2025-12-02 17:21:48 +00:00
utils AI Problem Solver implementation and various fixes 2025-12-06 23:46:08 +00:00
websocket refactor: Remove unreachable dead code branches 2025-12-02 14:56:35 +00:00