Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Surface service + storage facts in the AI context pack

rcourtmanb216e38304eb
diff --git a/internal/servicediscovery/formatters.go b/internal/servicediscovery/formatters.go
index 484618763d..9eb5f80f2c 100644
--- a/internal/servicediscovery/formatters.go
+++ b/internal/servicediscovery/formatters.go
@@ -122,12 +122,18 @@ func formatSingleDiscovery(d *ResourceDiscovery) string {
func filterImportantFacts(facts []DiscoveryFact) []DiscoveryFact {
var important []DiscoveryFact
- // Priority categories
+ // Priority categories — facts the assistant needs to understand and act on
+ // the workload. Service + storage were previously dropped, yet a service
+ // fact (e.g. the systemd unit) is exactly how you restart/reload a workload,
+ // and a storage fact (e.g. the backing dataset/disk) is where its data
+ // physically lives — neither is redundant with the path/CLI sections.
priorityCategories := map[FactCategory]bool{
FactCategoryHardware: true, // GPU, TPU
FactCategoryDependency: true, // MQTT, database connections
FactCategorySecurity: true, // Auth info
FactCategoryVersion: true, // Version info
+ FactCategoryService: true, // how the service is managed (systemd unit, init)
+ FactCategoryStorage: true, // where data physically lives (pool/dataset/disk)
}
for _, f := range facts {
diff --git a/internal/servicediscovery/scenario_corpus_test.go b/internal/servicediscovery/scenario_corpus_test.go
index 260377de3d..61a4612934 100644
--- a/internal/servicediscovery/scenario_corpus_test.go
+++ b/internal/servicediscovery/scenario_corpus_test.go
@@ -84,6 +84,40 @@ func contextScenarioCorpus() []contextScenario {
"/opt/homeassistant/config -> /config",
},
},
+ {
+ name: "postgresql LXC",
+ userQuestion: "the database is slow and I may need to restart it",
+ discovery: &ResourceDiscovery{
+ ID: MakeResourceID(ResourceTypeSystemContainer, "minipc", "112"),
+ ResourceType: ResourceTypeSystemContainer,
+ ResourceID: "112",
+ TargetID: "minipc",
+ Hostname: "pg-primary",
+ ServiceType: "postgresql",
+ ServiceName: "PostgreSQL",
+ ServiceVersion: "16.3",
+ Category: CategoryDatabase,
+ CLIAccess: "pct exec 112 -- bash",
+ ConfigPaths: []string{"/etc/postgresql/16/main/postgresql.conf"},
+ DataPaths: []string{"/var/lib/postgresql/16/main"},
+ LogPaths: []string{"/var/log/postgresql/postgresql-16-main.log"},
+ Ports: []PortInfo{{Port: 5432, Protocol: "tcp", Process: "postgres"}},
+ Facts: []DiscoveryFact{
+ {Category: FactCategoryService, Key: "systemd_unit", Value: "[email protected]", Source: "running_services", Confidence: 0.9},
+ {Category: FactCategoryStorage, Key: "data_filesystem", Value: "zfs tank/postgres", Source: "disk_usage", Confidence: 0.85},
+ },
+ },
+ // To triage slowness and restart, the Assistant needs how to reach
+ // the guest, the config + log, AND how the service is managed (the
+ // systemd unit) and where its data lives (the dataset) — service and
+ // storage facts the context pack used to drop.
+ mustContain: []string{
+ "pct exec 112",
+ "postgresql.conf",
+ "tank/postgres",
+ },
+ },
}
}