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.

feat(telemetry): export the Patrol blocked cause at schema v10

rcourtmanf38e95eb7209
diff --git a/docs/PRIVACY.md b/docs/PRIVACY.md
index aaf7e57ddd..e1b1b86690 100644
--- a/docs/PRIVACY.md
+++ b/docs/PRIVACY.md
@@ -160,6 +160,7 @@ Every field is listed below with the reason it exists. Nothing else is included
| Pulse Intelligence Patrol new findings 30d | `5` | Count new findings produced by Patrol in the current 30-day telemetry window without sending finding IDs or details |
| Pulse Intelligence Patrol investigations 30d | `3` | Count findings investigated by Patrol in the current 30-day telemetry window without sending finding IDs, resource IDs, or details |
| Pulse Intelligence Patrol resolved findings 30d | `2` | Count findings resolved or fix-verified in the current 30-day telemetry window without sending finding IDs, resource IDs, fix details, or verification detail |
+| Pulse Intelligence Patrol blocked cause | `provider_not_configured` | See one fixed machine cause code when Patrol is enabled but blocked from running, so an install whose Patrol can never work is distinguishable from one that runs and finds nothing, without sending blocked-reason text, provider endpoints, model names, error text, or configuration |
| Pulse Intelligence external agent enabled | `true`/`false` | See whether at least one token can use the external Pulse Intelligence agent/MCP surface without sending token counts, names, scopes, or values |
| Pulse Intelligence external agent used 30d | `true`/`false` | See whether an external-agent-capable API token reached a Pulse Intelligence agent/MCP route in the current 30-day telemetry window without sending token identity, route parameters, resource IDs, or request details |
| Pulse Intelligence MCP adapter used 30d | `true`/`false` | See whether the `pulse-mcp` adapter reached a Pulse Intelligence agent/MCP route in the current 30-day telemetry window without sending token identity, route parameters, resource IDs, prompts, or request details |
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 6965f8164a..d91d485026 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -933,6 +933,13 @@ share of the fleet still awaiting an agent capable of typed refusals stays
measurable and is never mistaken for a categorization failure. Dispatch still repeats all local
preconditions after durable admission because preflight evidence is not a
lease and target state may race after approval.
+
+The aggregate telemetry assembled through the shared `internal/api/` router
+also exports the Patrol blocked cause enum at schema v10. That value is
+derived from Patrol runtime state on the server, never from agent transport,
+agent refusal traffic, or agent identity, and it adds no agent-visible
+surface: agent refusal reporting, its typed vocabulary, and the `uncoded`
+partition above are unchanged by it.
Proxmox VM and LXC lifecycle affordances follow the same adjacent boundary:
lifecycle and fleet surfaces may consume backend-advertised `start`,
`shutdown`, `reboot`, and `stop` capabilities and typed `actionReadiness`, but
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 9906d7c1ec..7c3f05b83b 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -9397,7 +9397,7 @@ together: `type Ping struct` in `internal/telemetry/telemetry.go`, the
Retired columns stay in the live receiver database rather than being dropped:
migrations only add, the columns hold real rows from the schema-v6 window, and
nothing writes them once the receiver struct loses the fields.
-### Telemetry payload parity spans three surfaces at schema v9
+### Telemetry payload parity spans three surfaces at schema v10
Schema v8 preserved the same three-surface parity requirement and added
content-free approved-action refusal counters for target change, prerequisite
@@ -9414,6 +9414,17 @@ collapsing the two made a partition starved by agent rollout read exactly like
a partition that is wrong. The `uncoded` counter is a count only; the refusal's
error text, command, target, and action payload stay on the install.
+Schema v10 adds `pulse_intelligence_patrol_blocked_cause`: the fixed machine
+cause code (for example `provider_not_configured`) exported only while an
+enabled Patrol is in the blocked runtime state. Field telemetry could not
+distinguish an install whose Patrol can never run from one that runs and finds
+nothing — both presented as high run counts with zero AI calls and zero
+findings. Only the typed enum leaves the install: the blocked-reason text,
+provider endpoint, model name, and configuration stay local, a blocked reason
+carrying no typed cause exports nothing rather than free text, and a disabled,
+active, or mid-run Patrol exports an empty value even when a stale cause is
+still recorded.
+
### Per-tenant resource stores are released on offboarding and shutdown
`ResourceHandlers.getStore` opens a SQLite handle per org and caches it for the
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index 56818c7222..39cff48fb9 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -2106,14 +2106,19 @@ actor, and every audit row read stay on the install.
### Telemetry ingestion matches the released sender while storage stays compatible
-The active outbound contract is schema v9. Schema v8 added content-free
+The active outbound contract is schema v10. Schema v8 added content-free
approved-action refusal counters for target change, prerequisite failure, and
invalid typed contract so agent-side pre-mutation failures no longer collapse
into `other`. Schema v9 completes that split with a content-free `uncoded`
counter for refusals that carried no machine reason code at all, which is what
every agent older than the typed refusal contract reports. Without it a split
starved by agent rollout is indistinguishable from a broken one, because both
-present as `other` absorbing every refusal.
+present as `other` absorbing every refusal. Schema v10 adds the Patrol blocked
+cause: one fixed machine enum exported only while an enabled Patrol is in the
+blocked runtime state, so an install whose Patrol can never run is
+distinguishable from one that runs and finds nothing. Blocked-reason text,
+provider endpoints, model names, and configuration stay on the install, and an
+untyped blocked reason exports nothing rather than free text.
The earlier draft schema-v8 `business_estate` field was reverted and must not
remain in the license server's accepted ping struct merely because a private receiver build
and database migration briefly carried it. Existing deployed databases need no
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 7d0d026499..a9408dd198 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -378,6 +378,12 @@ persisted high-water mark, is pruned to its retention bound, and is a count of
runs only. It never records run identity, scope resource IDs, finding IDs,
evidence, or narrative, and it is not recovery coverage, backup verification,
or storage-health proof.
+
+The schema-v10 Patrol blocked cause rides the outbound ping only and creates
+no new persisted state: it is read from live Patrol runtime status at snapshot
+time, not from the run history list or the run tally, records no run identity,
+provider configuration, or blocked-reason text, and is likewise not recovery
+coverage or storage-health proof.
First-party workflow starter activity recorded through shared `internal/api/`
handlers, including Pro activation entry-point telemetry for the same
operations-loop prompt, is likewise API/privacy/commercial activation evidence
diff --git a/frontend-modern/public/docs/PRIVACY.md b/frontend-modern/public/docs/PRIVACY.md
index aaf7e57ddd..e1b1b86690 100644
--- a/frontend-modern/public/docs/PRIVACY.md
+++ b/frontend-modern/public/docs/PRIVACY.md
@@ -160,6 +160,7 @@ Every field is listed below with the reason it exists. Nothing else is included
| Pulse Intelligence Patrol new findings 30d | `5` | Count new findings produced by Patrol in the current 30-day telemetry window without sending finding IDs or details |
| Pulse Intelligence Patrol investigations 30d | `3` | Count findings investigated by Patrol in the current 30-day telemetry window without sending finding IDs, resource IDs, or details |
| Pulse Intelligence Patrol resolved findings 30d | `2` | Count findings resolved or fix-verified in the current 30-day telemetry window without sending finding IDs, resource IDs, fix details, or verification detail |
+| Pulse Intelligence Patrol blocked cause | `provider_not_configured` | See one fixed machine cause code when Patrol is enabled but blocked from running, so an install whose Patrol can never work is distinguishable from one that runs and finds nothing, without sending blocked-reason text, provider endpoints, model names, error text, or configuration |
| Pulse Intelligence external agent enabled | `true`/`false` | See whether at least one token can use the external Pulse Intelligence agent/MCP surface without sending token counts, names, scopes, or values |
| Pulse Intelligence external agent used 30d | `true`/`false` | See whether an external-agent-capable API token reached a Pulse Intelligence agent/MCP route in the current 30-day telemetry window without sending token identity, route parameters, resource IDs, or request details |
| Pulse Intelligence MCP adapter used 30d | `true`/`false` | See whether the `pulse-mcp` adapter reached a Pulse Intelligence agent/MCP route in the current 30-day telemetry window without sending token identity, route parameters, resource IDs, prompts, or request details |
diff --git a/internal/api/contract_test.go b/internal/api/contract_test.go
index e4ed6e0b23..f667ef96cc 100644
--- a/internal/api/contract_test.go
+++ b/internal/api/contract_test.go
@@ -24367,3 +24367,51 @@ func TestApprovedActionRefusalPartitionSeparatesUncodedFromOther(t *testing.T) {
t.Fatalf("category(some_future_typed_code) = %q, want other", got)
}
}
+
+// The schema-v10 Patrol blocked cause must export the typed enum code for a
+// currently blocked Patrol and nothing in every other state. Field telemetry
+// could not distinguish an enabled Patrol that can never run (provider init
+// failed, model unsuitable) from one that runs and finds nothing — both
+// presented as high run counts with zero AI calls and zero findings. The
+// export is the enum only: an untyped blocked reason must not fall back to
+// free text, and a stale cause on a non-blocked Patrol must not leak.
+func TestContract_PatrolBlockedCauseTelemetryExportsEnumOnlyWhileBlocked(t *testing.T) {
+ blocked := func(cause ai.PatrolFailureCause) ai.PatrolStatus {
+ return ai.PatrolStatus{
+ Enabled: true,
+ RuntimeState: ai.PatrolRuntimeStateBlocked,
+ BlockedReason: "AI provider unavailable",
+ BlockedCause: cause,
+ }
+ }
+
+ if got := pulseIntelligencePatrolBlockedCauseForTelemetry(blocked(ai.PatrolFailureCauseProviderNotConfigured)); got != "provider_not_configured" {
+ t.Fatalf("blocked patrol cause = %q, want provider_not_configured", got)
+ }
+
+ // A blocked reason without a typed cause exports nothing rather than
+ // falling back to free text.
+ if got := pulseIntelligencePatrolBlockedCauseForTelemetry(blocked("")); got != "" {
+ t.Fatalf("untyped blocked cause exported %q, want empty", got)
+ }
+ if got := pulseIntelligencePatrolBlockedCauseForTelemetry(blocked(ai.PatrolFailureCauseNone)); got != "" {
+ t.Fatalf("cause none exported %q, want empty", got)
+ }
+
+ // A disabled Patrol is not blocked, and a stale cause on an active or
+ // running Patrol must not be exported.
+ for _, state := range []ai.PatrolRuntimeState{
+ ai.PatrolRuntimeStateDisabled,
+ ai.PatrolRuntimeStateActive,
+ ai.PatrolRuntimeStateRunning,
+ } {
+ status := ai.PatrolStatus{
+ Enabled: state != ai.PatrolRuntimeStateDisabled,
+ RuntimeState: state,
+ BlockedCause: ai.PatrolFailureCauseProviderNotConfigured,
+ }
+ if got := pulseIntelligencePatrolBlockedCauseForTelemetry(status); got != "" {
+ t.Fatalf("runtime state %q exported %q, want empty", state, got)
+ }
+ }
+}
diff --git a/internal/api/telemetry_pulse_intelligence.go b/internal/api/telemetry_pulse_intelligence.go
index b4b650e5b0..d6447f2185 100644
--- a/internal/api/telemetry_pulse_intelligence.go
+++ b/internal/api/telemetry_pulse_intelligence.go
@@ -1,16 +1,54 @@
package api
import (
+ "context"
"regexp"
"strings"
"time"
+ "github.com/rcourtman/pulse-go-rewrite/internal/ai"
"github.com/rcourtman/pulse-go-rewrite/internal/telemetry"
unifiedresources "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
"github.com/rcourtman/pulse-go-rewrite/pkg/aicontracts"
"github.com/rs/zerolog/log"
)
+// pulseIntelligencePatrolBlockedCause returns the fixed machine cause code
+// for a Patrol that is enabled but blocked from running (for example
+// provider_not_configured), or an empty string when Patrol is disabled,
+// healthy, mid-run, or unavailable. Only the enum cause code leaves the
+// process: no blocked-reason text, provider endpoint, model name, or
+// configuration.
+func (r *Router) pulseIntelligencePatrolBlockedCause() string {
+ if r == nil || r.aiSettingsHandler == nil {
+ return ""
+ }
+ patrol := r.aiSettingsHandler.getPatrolService(context.Background())
+ if patrol == nil {
+ return ""
+ }
+ status := retireQuickstartPatrolStatus(patrol.GetStatus())
+ return pulseIntelligencePatrolBlockedCauseForTelemetry(status)
+}
+
+// pulseIntelligencePatrolBlockedCauseForTelemetry reduces a patrol status to
+// the content-free cause code exported by usage telemetry. Anything but a
+// currently blocked Patrol exports nothing, and a blocked reason that carries
+// no typed cause exports nothing rather than free text.
+func pulseIntelligencePatrolBlockedCauseForTelemetry(status ai.PatrolStatus) string {
+ if status.RuntimeState != ai.PatrolRuntimeStateBlocked {
+ return ""
+ }
+ cause := strings.TrimSpace(string(status.BlockedCause))
+ if cause == string(ai.PatrolFailureCauseNone) {
+ return ""
+ }
+ if len(cause) > 64 {
+ cause = cause[:64]
+ }
+ return cause
+}
+
// ApplyUpdateTelemetrySnapshot adds router-owned, content-free update funnel
// counters to the outbound usage telemetry snapshot.
func (r *Router) ApplyUpdateTelemetrySnapshot(s *telemetry.Snapshot, now time.Time) {
@@ -25,7 +63,11 @@ func (r *Router) ApplyUpdateTelemetrySnapshot(s *telemetry.Snapshot, now time.Ti
// command text, approval actors/reasons, action outputs, and resource IDs.
func (r *Router) GetPulseIntelligenceActionTelemetry(since time.Time) telemetry.PulseIntelligenceActionSnapshot {
var snapshot telemetry.PulseIntelligenceActionSnapshot
- if r == nil || r.resourceHandlers == nil {
+ if r == nil {
+ return snapshot
+ }
+ snapshot.PatrolBlockedCause = r.pulseIntelligencePatrolBlockedCause()
+ if r.resourceHandlers == nil {
return snapshot
}
diff --git a/internal/telemetry/telemetry.go b/internal/telemetry/telemetry.go
index e7d18de4c1..2c546f4c08 100644
--- a/internal/telemetry/telemetry.go
+++ b/internal/telemetry/telemetry.go
@@ -45,6 +45,7 @@
// legacy pro_activation metric keys for cohort continuity,
// operations-loop workflow starter request counts by surface, Assistant/Patrol AI calls,
// Patrol runs/new findings/investigations/resolved findings/autofixes,
+// the fixed machine cause code when an enabled Patrol is blocked from running,
// external-agent readiness/usage, action plans, approval requests, rejected
// action decisions, approved action decisions, approved action attempts,
// and approved action successes
@@ -154,7 +155,12 @@ const (
// from refusals whose code is simply unrecognised. Agents that predate the
// typed refusal contract report the former, and folding them into "other"
// made a starved split indistinguishable from a broken one.
- TelemetrySchemaVersion = 9
+ // Schema v10 adds the Patrol runtime blocked cause so an enabled Patrol
+ // that cannot run at all (no provider, unsuitable model, open circuit)
+ // is distinguishable in the fleet from one that runs and finds nothing.
+ // Field telemetry showed both present identically: high run counts with
+ // zero AI calls and zero findings.
+ TelemetrySchemaVersion = 10
)
type installIDRecord struct {
@@ -276,61 +282,62 @@ type Ping struct {
NotificationFailuresUnknown7d int `json:"notification_failures_unknown_7d"`
// Pulse Intelligence usage (30-day counts/booleans — no prompts, commands, outputs, resource IDs, or token values)
- PulseIntelligenceLoopConfigured bool `json:"pulse_intelligence_loop_configured"`
- PulseIntelligenceLoopActive30d bool `json:"pulse_intelligence_loop_active_30d"`
- PulseIntelligenceCompleteOperationsLoop30d bool `json:"pulse_intelligence_complete_operations_loop_30d"`
- PulseIntelligenceApprovedExecutionLoop30d bool `json:"pulse_intelligence_approved_execution_loop_30d"`
- PulseIntelligenceResolvedOperationsLoop30d bool `json:"pulse_intelligence_resolved_operations_loop_30d"`
- PulseIntelligencePatrolControlCompletedOperationsLoop30d bool `json:"pulse_intelligence_patrol_control_completed_operations_loop_30d"`
- PulseIntelligencePatrolControlResolvedOperationsLoop30d bool `json:"pulse_intelligence_patrol_control_resolved_operations_loop_30d"`
- PulseIntelligencePatrolControlPaidCompletedOperationsLoop30d bool `json:"pulse_intelligence_patrol_control_paid_completed_operations_loop_30d"`
- PulseIntelligencePatrolControlPaidResolvedOperationsLoop30d bool `json:"pulse_intelligence_patrol_control_paid_resolved_operations_loop_30d"`
- PulseIntelligenceProActivationCompletedOperationsLoop30d bool `json:"pulse_intelligence_pro_activation_completed_operations_loop_30d"`
- PulseIntelligenceProActivationResolvedOperationsLoop30d bool `json:"pulse_intelligence_pro_activation_resolved_operations_loop_30d"`
- PulseIntelligenceProActivationPaidCompletedOperationsLoop30d bool `json:"pulse_intelligence_pro_activation_paid_completed_operations_loop_30d"`
- PulseIntelligenceProActivationPaidResolvedOperationsLoop30d bool `json:"pulse_intelligence_pro_activation_paid_resolved_operations_loop_30d"`
- PulseIntelligenceGovernedActionActive30d bool `json:"pulse_intelligence_governed_action_active_30d"`
- PulseIntelligenceAssistantOperationsLoop30d bool `json:"pulse_intelligence_assistant_operations_loop_30d"`
- PulseIntelligenceAssistantApprovedExecutionLoop30d bool `json:"pulse_intelligence_assistant_approved_execution_loop_30d"`
- PulseIntelligenceAssistantApprovedActionSuccessLoop30d bool `json:"pulse_intelligence_assistant_approved_action_success_loop_30d"`
- PulseIntelligenceAssistantResolvedOperationsLoop30d bool `json:"pulse_intelligence_assistant_resolved_operations_loop_30d"`
- PulseIntelligenceExternalAgentOperationsLoop30d bool `json:"pulse_intelligence_external_agent_operations_loop_30d"`
- PulseIntelligenceExternalAgentApprovedExecutionLoop30d bool `json:"pulse_intelligence_external_agent_approved_execution_loop_30d"`
- PulseIntelligenceExternalAgentApprovedActionSuccessLoop30d bool `json:"pulse_intelligence_external_agent_approved_action_success_loop_30d"`
- PulseIntelligenceExternalAgentResolvedOperationsLoop30d bool `json:"pulse_intelligence_external_agent_resolved_operations_loop_30d"`
- PulseIntelligenceMCPAdapterOperationsLoop30d bool `json:"pulse_intelligence_mcp_adapter_operations_loop_30d"`
- PulseIntelligenceMCPAdapterApprovedExecutionLoop30d bool `json:"pulse_intelligence_mcp_adapter_approved_execution_loop_30d"`
- PulseIntelligenceMCPAdapterApprovedActionSuccessLoop30d bool `json:"pulse_intelligence_mcp_adapter_approved_action_success_loop_30d"`
- PulseIntelligenceMCPAdapterResolvedOperationsLoop30d bool `json:"pulse_intelligence_mcp_adapter_resolved_operations_loop_30d"`
- PulseIntelligenceOperationsLoopStarterRequests30d int `json:"pulse_intelligence_operations_loop_starter_requests_30d"`
- PulseIntelligenceAssistantOperationsLoopStarterRequests30d int `json:"pulse_intelligence_assistant_operations_loop_starter_requests_30d"`
- PulseIntelligencePatrolOperationsLoopStarterRequests30d int `json:"pulse_intelligence_patrol_operations_loop_starter_requests_30d"`
- PulseIntelligencePatrolControlOperationsLoopStarterRequests30d int `json:"pulse_intelligence_patrol_control_operations_loop_starter_requests_30d"`
- PulseIntelligenceProActivationOperationsLoopStarterRequests30d int `json:"pulse_intelligence_pro_activation_operations_loop_starter_requests_30d"`
- PulseIntelligenceMCPOperationsLoopStarterRequests30d int `json:"pulse_intelligence_mcp_operations_loop_starter_requests_30d"`
- PulseIntelligenceAssistantAICalls30d int `json:"pulse_intelligence_assistant_ai_calls_30d"`
- PulseIntelligenceAssistantContextAICalls30d int `json:"pulse_intelligence_assistant_context_ai_calls_30d"`
- PulseIntelligenceAssistantToolCalls30d int `json:"pulse_intelligence_assistant_tool_calls_30d"`
- PulseIntelligencePatrolAICalls30d int `json:"pulse_intelligence_patrol_ai_calls_30d"`
- PulseIntelligencePatrolRuns30d int `json:"pulse_intelligence_patrol_runs_30d"`
- PulseIntelligencePatrolNewFindings30d int `json:"pulse_intelligence_patrol_new_findings_30d"`
- PulseIntelligencePatrolInvestigations30d int `json:"pulse_intelligence_patrol_investigations_30d"`
- PulseIntelligencePatrolResolvedFindings30d int `json:"pulse_intelligence_patrol_resolved_findings_30d"`
- PulseIntelligenceExternalAgentEnabled bool `json:"pulse_intelligence_external_agent_enabled"`
- PulseIntelligenceExternalAgentUsed30d bool `json:"pulse_intelligence_external_agent_used_30d"`
- PulseIntelligenceMCPAdapterUsed30d bool `json:"pulse_intelligence_mcp_adapter_used_30d"`
- PulseIntelligenceExternalAgentContextRequests30d int `json:"pulse_intelligence_external_agent_context_requests_30d"`
- PulseIntelligenceExternalAgentEventStreamRequests30d int `json:"pulse_intelligence_external_agent_event_stream_requests_30d"`
- PulseIntelligenceExternalAgentProvisioningRequests30d int `json:"pulse_intelligence_external_agent_provisioning_requests_30d"`
- PulseIntelligenceExternalAgentOperatorStateRequests30d int `json:"pulse_intelligence_external_agent_operator_state_requests_30d"`
- PulseIntelligenceExternalAgentFindingRequests30d int `json:"pulse_intelligence_external_agent_finding_requests_30d"`
- PulseIntelligenceExternalAgentActionRequests30d int `json:"pulse_intelligence_external_agent_action_requests_30d"`
- PulseIntelligenceActionPlans30d int `json:"pulse_intelligence_action_plans_30d"`
- PulseIntelligenceApprovalRequests30d int `json:"pulse_intelligence_approval_requests_30d"`
- PulseIntelligenceRejectedActionDecisions30d int `json:"pulse_intelligence_rejected_action_decisions_30d"`
- PulseIntelligenceApprovedActionDecisions30d int `json:"pulse_intelligence_approved_action_decisions_30d"`
- PulseIntelligenceApprovedActionAttempts30d int `json:"pulse_intelligence_approved_action_attempts_30d"`
- PulseIntelligenceApprovedActionSuccesses30d int `json:"pulse_intelligence_approved_action_successes_30d"`
+ PulseIntelligenceLoopConfigured bool `json:"pulse_intelligence_loop_configured"`
+ PulseIntelligenceLoopActive30d bool `json:"pulse_intelligence_loop_active_30d"`
+ PulseIntelligenceCompleteOperationsLoop30d bool `json:"pulse_intelligence_complete_operations_loop_30d"`
+ PulseIntelligenceApprovedExecutionLoop30d bool `json:"pulse_intelligence_approved_execution_loop_30d"`
+ PulseIntelligenceResolvedOperationsLoop30d bool `json:"pulse_intelligence_resolved_operations_loop_30d"`
+ PulseIntelligencePatrolControlCompletedOperationsLoop30d bool `json:"pulse_intelligence_patrol_control_completed_operations_loop_30d"`
+ PulseIntelligencePatrolControlResolvedOperationsLoop30d bool `json:"pulse_intelligence_patrol_control_resolved_operations_loop_30d"`
+ PulseIntelligencePatrolControlPaidCompletedOperationsLoop30d bool `json:"pulse_intelligence_patrol_control_paid_completed_operations_loop_30d"`
+ PulseIntelligencePatrolControlPaidResolvedOperationsLoop30d bool `json:"pulse_intelligence_patrol_control_paid_resolved_operations_loop_30d"`
+ PulseIntelligenceProActivationCompletedOperationsLoop30d bool `json:"pulse_intelligence_pro_activation_completed_operations_loop_30d"`
+ PulseIntelligenceProActivationResolvedOperationsLoop30d bool `json:"pulse_intelligence_pro_activation_resolved_operations_loop_30d"`
+ PulseIntelligenceProActivationPaidCompletedOperationsLoop30d bool `json:"pulse_intelligence_pro_activation_paid_completed_operations_loop_30d"`
+ PulseIntelligenceProActivationPaidResolvedOperationsLoop30d bool `json:"pulse_intelligence_pro_activation_paid_resolved_operations_loop_30d"`
+ PulseIntelligenceGovernedActionActive30d bool `json:"pulse_intelligence_governed_action_active_30d"`
+ PulseIntelligenceAssistantOperationsLoop30d bool `json:"pulse_intelligence_assistant_operations_loop_30d"`
+ PulseIntelligenceAssistantApprovedExecutionLoop30d bool `json:"pulse_intelligence_assistant_approved_execution_loop_30d"`
+ PulseIntelligenceAssistantApprovedActionSuccessLoop30d bool `json:"pulse_intelligence_assistant_approved_action_success_loop_30d"`
+ PulseIntelligenceAssistantResolvedOperationsLoop30d bool `json:"pulse_intelligence_assistant_resolved_operations_loop_30d"`
+ PulseIntelligenceExternalAgentOperationsLoop30d bool `json:"pulse_intelligence_external_agent_operations_loop_30d"`
+ PulseIntelligenceExternalAgentApprovedExecutionLoop30d bool `json:"pulse_intelligence_external_agent_approved_execution_loop_30d"`
+ PulseIntelligenceExternalAgentApprovedActionSuccessLoop30d bool `json:"pulse_intelligence_external_agent_approved_action_success_loop_30d"`
+ PulseIntelligenceExternalAgentResolvedOperationsLoop30d bool `json:"pulse_intelligence_external_agent_resolved_operations_loop_30d"`
+ PulseIntelligenceMCPAdapterOperationsLoop30d bool `json:"pulse_intelligence_mcp_adapter_operations_loop_30d"`
+ PulseIntelligenceMCPAdapterApprovedExecutionLoop30d bool `json:"pulse_intelligence_mcp_adapter_approved_execution_loop_30d"`
+ PulseIntelligenceMCPAdapterApprovedActionSuccessLoop30d bool `json:"pulse_intelligence_mcp_adapter_approved_action_success_loop_30d"`
+ PulseIntelligenceMCPAdapterResolvedOperationsLoop30d bool `json:"pulse_intelligence_mcp_adapter_resolved_operations_loop_30d"`
+ PulseIntelligenceOperationsLoopStarterRequests30d int `json:"pulse_intelligence_operations_loop_starter_requests_30d"`
+ PulseIntelligenceAssistantOperationsLoopStarterRequests30d int `json:"pulse_intelligence_assistant_operations_loop_starter_requests_30d"`
+ PulseIntelligencePatrolOperationsLoopStarterRequests30d int `json:"pulse_intelligence_patrol_operations_loop_starter_requests_30d"`
+ PulseIntelligencePatrolControlOperationsLoopStarterRequests30d int `json:"pulse_intelligence_patrol_control_operations_loop_starter_requests_30d"`
+ PulseIntelligenceProActivationOperationsLoopStarterRequests30d int `json:"pulse_intelligence_pro_activation_operations_loop_starter_requests_30d"`
+ PulseIntelligenceMCPOperationsLoopStarterRequests30d int `json:"pulse_intelligence_mcp_operations_loop_starter_requests_30d"`
+ PulseIntelligenceAssistantAICalls30d int `json:"pulse_intelligence_assistant_ai_calls_30d"`
+ PulseIntelligenceAssistantContextAICalls30d int `json:"pulse_intelligence_assistant_context_ai_calls_30d"`
+ PulseIntelligenceAssistantToolCalls30d int `json:"pulse_intelligence_assistant_tool_calls_30d"`
+ PulseIntelligencePatrolAICalls30d int `json:"pulse_intelligence_patrol_ai_calls_30d"`
+ PulseIntelligencePatrolRuns30d int `json:"pulse_intelligence_patrol_runs_30d"`
+ PulseIntelligencePatrolNewFindings30d int `json:"pulse_intelligence_patrol_new_findings_30d"`
+ PulseIntelligencePatrolInvestigations30d int `json:"pulse_intelligence_patrol_investigations_30d"`
+ PulseIntelligencePatrolResolvedFindings30d int `json:"pulse_intelligence_patrol_resolved_findings_30d"`
+ PulseIntelligencePatrolBlockedCause string `json:"pulse_intelligence_patrol_blocked_cause,omitempty"`
+ PulseIntelligenceExternalAgentEnabled bool `json:"pulse_intelligence_external_agent_enabled"`
+ PulseIntelligenceExternalAgentUsed30d bool `json:"pulse_intelligence_external_agent_used_30d"`
+ PulseIntelligenceMCPAdapterUsed30d bool `json:"pulse_intelligence_mcp_adapter_used_30d"`
+ PulseIntelligenceExternalAgentContextRequests30d int `json:"pulse_intelligence_external_agent_context_requests_30d"`
+ PulseIntelligenceExternalAgentEventStreamRequests30d int `json:"pulse_intelligence_external_agent_event_stream_requests_30d"`
+ PulseIntelligenceExternalAgentProvisioningRequests30d int `json:"pulse_intelligence_external_agent_provisioning_requests_30d"`
+ PulseIntelligenceExternalAgentOperatorStateRequests30d int `json:"pulse_intelligence_external_agent_operator_state_requests_30d"`
+ PulseIntelligenceExternalAgentFindingRequests30d int `json:"pulse_intelligence_external_agent_finding_requests_30d"`
+ PulseIntelligenceExternalAgentActionRequests30d int `json:"pulse_intelligence_external_agent_action_requests_30d"`
+ PulseIntelligenceActionPlans30d int `json:"pulse_intelligence_action_plans_30d"`
+ PulseIntelligenceApprovalRequests30d int `json:"pulse_intelligence_approval_requests_30d"`
+ PulseIntelligenceRejectedActionDecisions30d int `json:"pulse_intelligence_rejected_action_decisions_30d"`
+ PulseIntelligenceApprovedActionDecisions30d int `json:"pulse_intelligence_approved_action_decisions_30d"`
+ PulseIntelligenceApprovedActionAttempts30d int `json:"pulse_intelligence_approved_action_attempts_30d"`
+ PulseIntelligenceApprovedActionSuccesses30d int `json:"pulse_intelligence_approved_action_successes_30d"`
// Cause-coded approved-action failure counters. Together with successes
// and still-in-flight attempts these partition the attempt count, so the
@@ -460,6 +467,7 @@ type Snapshot struct {
PulseIntelligencePatrolNewFindings30d int
PulseIntelligencePatrolInvestigations30d int
PulseIntelligencePatrolResolvedFindings30d int
+ PulseIntelligencePatrolBlockedCause string
PulseIntelligenceExternalAgentEnabled bool
PulseIntelligenceExternalAgentOperationsLoopReady bool
PulseIntelligenceExternalAgentUsed30d bool
@@ -546,6 +554,11 @@ type PulseIntelligenceActionSnapshot struct {
// ApprovedActionLastFailureReason30d is the machine reason code of the
// most recent approved-action failure, sanitized to a closed code shape.
ApprovedActionLastFailureReason30d string
+ // PatrolBlockedCause is the fixed machine cause code exported only while
+ // an enabled Patrol is in the blocked runtime state. Blocked-reason text,
+ // provider endpoints, model names, and configuration never leave the
+ // runtime.
+ PatrolBlockedCause string
}
// ApplyUpdateTelemetrySnapshot adds content-free update funnel counters from
@@ -1061,6 +1074,7 @@ func applySnapshot(base Ping, fn SnapshotFunc) Ping {
ping.PulseIntelligencePatrolNewFindings30d = s.PulseIntelligencePatrolNewFindings30d
ping.PulseIntelligencePatrolInvestigations30d = s.PulseIntelligencePatrolInvestigations30d
ping.PulseIntelligencePatrolResolvedFindings30d = s.PulseIntelligencePatrolResolvedFindings30d
+ ping.PulseIntelligencePatrolBlockedCause = s.PulseIntelligencePatrolBlockedCause
ping.PulseIntelligenceExternalAgentEnabled = s.PulseIntelligenceExternalAgentEnabled
ping.PulseIntelligenceExternalAgentUsed30d = s.PulseIntelligenceExternalAgentUsed30d
ping.PulseIntelligenceMCPAdapterUsed30d = s.PulseIntelligenceMCPAdapterUsed30d
diff --git a/internal/telemetry/telemetry_test.go b/internal/telemetry/telemetry_test.go
index b89b818e93..84c479d856 100644
--- a/internal/telemetry/telemetry_test.go
+++ b/internal/telemetry/telemetry_test.go
@@ -407,6 +407,7 @@ func TestApplySnapshot(t *testing.T) {
PulseIntelligencePatrolNewFindings30d: 5,
PulseIntelligencePatrolInvestigations30d: 6,
PulseIntelligencePatrolResolvedFindings30d: 3,
+ PulseIntelligencePatrolBlockedCause: "provider_not_configured",
PulseIntelligenceExternalAgentEnabled: true,
PulseIntelligenceExternalAgentUsed30d: true,
PulseIntelligenceMCPAdapterUsed30d: true,
@@ -527,6 +528,7 @@ func TestApplySnapshot(t *testing.T) {
ping.PulseIntelligencePatrolNewFindings30d != 5 ||
ping.PulseIntelligencePatrolInvestigations30d != 6 ||
ping.PulseIntelligencePatrolResolvedFindings30d != 3 ||
+ ping.PulseIntelligencePatrolBlockedCause != "provider_not_configured" ||
ping.PulseIntelligenceActionPlans30d != 6 ||
ping.PulseIntelligenceApprovalRequests30d != 2 ||
ping.PulseIntelligenceRejectedActionDecisions30d != 1 ||
diff --git a/pkg/server/telemetry_pulse_intelligence.go b/pkg/server/telemetry_pulse_intelligence.go
index d2773c20ab..0da61eca99 100644
--- a/pkg/server/telemetry_pulse_intelligence.go
+++ b/pkg/server/telemetry_pulse_intelligence.go
@@ -53,6 +53,7 @@ func applyPulseIntelligenceTelemetrySnapshot(
snap.PulseIntelligenceApprovedActionRefusalsOther30d = actionSnapshot.ApprovedActionRefusalsOther30d
snap.PulseIntelligenceVerifiedFindingResolutions30d = actionSnapshot.VerifiedFindingResolutions30d
snap.PulseIntelligenceApprovedActionLastFailureReason30d = actionSnapshot.ApprovedActionLastFailureReason30d
+ snap.PulseIntelligencePatrolBlockedCause = actionSnapshot.PatrolBlockedCause
applyPulseIntelligenceAdoptionSnapshot(snap)
}
diff --git a/pkg/server/telemetry_pulse_intelligence_test.go b/pkg/server/telemetry_pulse_intelligence_test.go
index ed04dd7aa9..62713abf1e 100644
--- a/pkg/server/telemetry_pulse_intelligence_test.go
+++ b/pkg/server/telemetry_pulse_intelligence_test.go
@@ -1070,3 +1070,17 @@ func TestApplyPulseIntelligencePatrolRunSnapshotIgnoresHistoryCap(t *testing.T)
t.Fatalf("PulseIntelligencePatrolRuns30d = %d, want %d", snap.PulseIntelligencePatrolRuns30d, total)
}
}
+
+// The Patrol blocked cause must ride the router snapshot into the outbound
+// ping unchanged, so a blocked install is distinguishable in the fleet from
+// one whose Patrol runs and finds nothing.
+func TestApplyPulseIntelligenceTelemetrySnapshotCarriesPatrolBlockedCause(t *testing.T) {
+ snap := &telemetry.Snapshot{}
+ actionSnapshot := telemetry.PulseIntelligenceActionSnapshot{
+ PatrolBlockedCause: "provider_not_configured",
+ }
+ applyPulseIntelligenceTelemetrySnapshot(snap, nil, nil, actionSnapshot, time.Now().UTC())
+ if snap.PulseIntelligencePatrolBlockedCause != "provider_not_configured" {
+ t.Fatalf("PulseIntelligencePatrolBlockedCause = %q, want provider_not_configured", snap.PulseIntelligencePatrolBlockedCause)
+ }
+}