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.

Fail closed Docker and Podman actions without agents

rcourtman53a05ccb7cff
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 8f1e32a046..dd9782b2eb 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -238,7 +238,8 @@ Docker / Podman from lifecycle-local code.
Disconnected command-agent state is also API-owned readiness: lifecycle
surfaces may reflect missing backend-advertised capabilities, but must not
reconnect, substitute, or directly address an agent to make a stale container
-action executable.
+action executable. Backend resource payloads and plan-action readiness are the
+only supported lifecycle signal for that state.
Assistant session rename through `PATCH /api/ai/sessions/{id}` follows that
same browser-safe history boundary. Lifecycle surfaces, MCP adapters, and
agents may display the updated title as human navigation metadata, but they
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index bd839cc82e..0cf263470d 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -1004,6 +1004,15 @@ the canonical monitored-system blocked payload.
not duplicate the initial lifecycle events. MCP, CLI, and UI consumers may
adapt this payload, but they must not become the source of truth for action
planning semantics.
+ Executor-owned live readiness is part of planning, not a UI precheck:
+ after planner validation and before audit persistence, `actions.go` must ask
+ the registered executor whether the resource/capability is currently
+ executable. A failed readiness check returns `409`
+ `action_execution_unavailable`, does not create or mutate an action audit
+ record, and must not dispatch commands. Docker / Podman lifecycle readiness
+ uses that hook for command-agent connectivity and runtime posture; browser
+ controls may consume advertised capabilities, but must not replace this
+ check with direct shell, SSH, provider, or agent-command calls.
Action approval decisions are API-owned as a separate non-execution
contract: `POST /api/actions/{id}/decision` may only record an
`approved` or `rejected` decision against a persisted `pending_approval`
@@ -2492,7 +2501,8 @@ field-level reasons on validation failures (e.g.
need to parse human text to know which field went wrong. The
manifest's per-capability `errorCodes` lists declare the closed
set: `plan_action` carries `invalid_action_request`,
-`resource_not_found`, `capability_not_found`; `decide_action`
+`resource_not_found`, `capability_not_found`,
+`action_execution_unavailable`; `decide_action`
carries `missing_id`, `invalid_id`, `invalid_action_decision`,
`action_not_found`, `action_not_pending`, `action_plan_expired`;
`execute_action` carries `missing_id`, `invalid_id`,
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 6068885c43..94d27c88cf 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -227,6 +227,10 @@ not storage or recovery controls: storage/recovery consumers may render their
redacted action history as context, but must not treat container lifecycle
capabilities, `DockerData`, or agent command verification as backup freshness,
restore support, or a recovery-local execution path.
+Disconnected command-agent readiness for those lifecycle actions remains an
+API/runtime fail-closed condition; storage/recovery consumers may observe that
+an action is unavailable, but must not reinterpret it as recovery degradation
+or attempt a recovery-local container command path.
Storage and recovery surfaces may consume Discovery context from the shared
API boundary when it helps explain protected workloads or storage-adjacent
services, including mock-mode config/data/log path examples. That context is
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index d676f6bf9f..6310616ae9 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -439,6 +439,13 @@ container inventory table.
`/api/actions/*` and the agent command server; platform rows or drawers
must not wire direct shell, SSH, provider, or runtime calls around this
capability contract.
+ API resource responses must project only currently executable lifecycle
+ capabilities: when the command agent that owns the Docker / Podman runtime is
+ not connected, `resources.go` filters those capabilities from list and
+ detail payloads before frontend controls render. Planning still rechecks the
+ same readiness boundary and fails closed with `action_execution_unavailable`
+ before audit creation if the live command path disappears after the resource
+ response was read.
TrueNAS app inventory enters the model as native `TrueNASData.App`
metadata on canonical `app-container` resources. The facet is sourced from
the TrueNAS API app inventory (`app.query` plus active workload/stat
diff --git a/internal/api/actions.go b/internal/api/actions.go
index d824eef2c3..89a653ffec 100644
--- a/internal/api/actions.go
+++ b/internal/api/actions.go
@@ -24,6 +24,12 @@ type ActionExecutor interface {
ExecuteAction(ctx context.Context, record unified.ActionAuditRecord) (*unified.ExecutionResult, error)
}
+// ActionAvailabilityChecker lets an executor contribute live readiness checks
+// before Pulse advertises or persists an executable action plan.
+type ActionAvailabilityChecker interface {
+ CheckActionAvailable(ctx context.Context, req unified.ActionRequest, resource unified.Resource) error
+}
+
type actionDecisionRequest struct {
Outcome unified.ApprovalOutcome `json:"outcome"`
Reason string `json:"reason,omitempty"`
@@ -114,6 +120,16 @@ func (h *ResourceHandlers) HandlePlanAction(w http.ResponseWriter, r *http.Reque
}
req = normalizeActionRequestForAudit(req)
+ if checker, ok := h.actionExecutor.(ActionAvailabilityChecker); ok {
+ if err := checker.CheckActionAvailable(r.Context(), req, *resource); err != nil {
+ writeJSONErrorWithDetails(w, http.StatusConflict, "action_execution_unavailable", "Action execution is unavailable", map[string]string{
+ "resourceId": req.ResourceID,
+ "capabilityName": req.CapabilityName,
+ "reason": sanitizeErrorForClient(err, "action execution is unavailable"),
+ })
+ return
+ }
+ }
store, err := h.getStore(orgID)
if err != nil {
writeJSONError(w, http.StatusServiceUnavailable, "action_audit_unavailable", "Action audit history is not available")
diff --git a/internal/api/agent_capabilities.go b/internal/api/agent_capabilities.go
index 4e6aee21a8..a362dd89cb 100644
--- a/internal/api/agent_capabilities.go
+++ b/internal/api/agent_capabilities.go
@@ -441,14 +441,14 @@ var agentCapabilitiesManifest = AgentCapabilitiesManifest{
},
{
Name: "plan_action",
- Description: "Plan an action against a resource. The planner validates the request, looks up the capability on the resource, and returns an ActionPlan with the approval policy, blast radius, plan hash, and preflight summary. The plan is persisted to the audit history at the planned/pending state so subsequent decide_action and execute_action calls can reference it by id. Plan-and-execute is a two-step flow when the resulting plan requires approval, one-step otherwise.",
+ Description: "Plan an action against a resource. The planner validates the request, looks up the capability on the resource, checks executor-owned live availability, and returns an ActionPlan with the approval policy, blast radius, plan hash, and preflight summary. The plan is persisted to the audit history at the planned/pending state only after the live availability check passes, so subsequent decide_action and execute_action calls can reference it by id. Plan-and-execute is a two-step flow when the resulting plan requires approval, one-step otherwise.",
Category: "action",
Method: http.MethodPost,
Path: "/api/actions/plan",
Scope: "ai:execute",
RequestBodyShape: "ActionRequest",
ResponseShape: "ActionPlan",
- ErrorCodes: []string{"invalid_action_request", "resource_not_found", "capability_not_found"},
+ ErrorCodes: []string{"invalid_action_request", "resource_not_found", "capability_not_found", "action_execution_unavailable"},
},
{
Name: "decide_action",
diff --git a/internal/api/contract_test.go b/internal/api/contract_test.go
index 8da70909b7..9391def7a3 100644
--- a/internal/api/contract_test.go
+++ b/internal/api/contract_test.go
@@ -15136,6 +15136,20 @@ func TestContract_AgentSurfaceErrorCodesMatchManifestDeclarations(t *testing.T)
}
}
+func TestContract_PlanActionDeclaresExecutionUnavailable(t *testing.T) {
+ source, err := os.ReadFile("agent_capabilities.go")
+ if err != nil {
+ t.Fatalf("read agent_capabilities.go: %v", err)
+ }
+ src := string(source)
+ if !strings.Contains(src, `Name: "plan_action"`) {
+ t.Fatal("agent capabilities manifest must declare plan_action")
+ }
+ if !strings.Contains(src, `"action_execution_unavailable"`) {
+ t.Error("plan_action must declare action_execution_unavailable so agents can branch on executor-owned live-readiness refusal")
+ }
+}
+
// TestContract_AgentCapabilitiesManifestIsPublic pins the auth
// contract for the discovery surface: the manifest must be in the
// router's publicPaths list so it serves without a token. The
diff --git a/internal/api/docker_container_action_executor.go b/internal/api/docker_container_action_executor.go
index 6a8279b533..8159fcc522 100644
--- a/internal/api/docker_container_action_executor.go
+++ b/internal/api/docker_container_action_executor.go
@@ -15,6 +15,7 @@ const dockerContainerLifecycleHandler = "docker.container.lifecycle"
type dockerActionAgentCommander interface {
ExecuteCommand(ctx context.Context, agentID string, cmd agentexec.ExecuteCommandPayload) (*agentexec.CommandResultPayload, error)
+ IsAgentConnected(agentID string) bool
}
type dockerContainerActionExecutor struct {
@@ -55,6 +56,9 @@ func (e dockerContainerActionExecutor) ExecuteAction(ctx context.Context, record
if agentID == "" {
return nil, fmt.Errorf("docker container resource %q is not backed by a reporting Pulse agent", record.Request.ResourceID)
}
+ if !e.agents.IsAgentConnected(agentID) {
+ return nil, fmt.Errorf("docker container command agent %q is not connected", agentID)
+ }
command := fmt.Sprintf("%s %s %s", runtime, operation, shellQuote(containerRef))
result, err := e.agents.ExecuteCommand(ctx, agentID, agentexec.ExecuteCommandPayload{
@@ -87,6 +91,25 @@ func (e dockerContainerActionExecutor) ExecuteAction(ctx context.Context, record
return execution, nil
}
+func (e dockerContainerActionExecutor) CheckActionAvailable(ctx context.Context, req unified.ActionRequest, resource unified.Resource) error {
+ operation := strings.TrimSpace(req.CapabilityName)
+ capability, ok := findDockerLifecycleCapability(resource.Capabilities, operation)
+ if !ok || capability.InternalHandler != dockerContainerLifecycleHandler {
+ return nil
+ }
+ if e.agents == nil {
+ return fmt.Errorf("docker container command agent manager is not available")
+ }
+ if _, err := e.executableDockerContainerResource(ctx, resource, operation); err != nil {
+ return err
+ }
+ agentID := strings.TrimSpace(resource.Docker.AgentID)
+ if !e.agents.IsAgentConnected(agentID) {
+ return fmt.Errorf("docker container command agent %q is not connected", agentID)
+ }
+ return nil
+}
+
func (e dockerContainerActionExecutor) currentDockerContainerResource(ctx context.Context, resourceID, operation string) (unified.Resource, error) {
if e.resources == nil {
return unified.Resource{}, fmt.Errorf("resource handler unavailable")
@@ -99,11 +122,15 @@ func (e dockerContainerActionExecutor) currentDockerContainerResource(ctx contex
if !ok || resource == nil {
return unified.Resource{}, fmt.Errorf("resource %q is no longer present", resourceID)
}
+ return e.executableDockerContainerResource(ctx, *resource, operation)
+}
+
+func (e dockerContainerActionExecutor) executableDockerContainerResource(_ context.Context, resource unified.Resource, operation string) (unified.Resource, error) {
if resource.Type != unified.ResourceTypeAppContainer || resource.Docker == nil {
- return unified.Resource{}, fmt.Errorf("resource %q is not a Docker or Podman container", resourceID)
+ return unified.Resource{}, fmt.Errorf("resource %q is not a Docker or Podman container", resource.ID)
}
if status := resource.SourceStatus[unified.SourceDocker]; strings.EqualFold(strings.TrimSpace(status.Status), "stale") || strings.EqualFold(strings.TrimSpace(status.Status), "offline") {
- return unified.Resource{}, fmt.Errorf("docker inventory for resource %q is %s", resourceID, status.Status)
+ return unified.Resource{}, fmt.Errorf("docker inventory for resource %q is %s", resource.ID, status.Status)
}
if resource.Docker.Security != nil && resource.Docker.Security.MutatingCommandsBlocked {
reason := strings.TrimSpace(resource.Docker.Security.MutatingCommandsBlockedReason)
@@ -113,11 +140,11 @@ func (e dockerContainerActionExecutor) currentDockerContainerResource(ctx contex
return unified.Resource{}, fmt.Errorf("docker container lifecycle action is blocked by host policy: %s", reason)
}
if capability, ok := findDockerLifecycleCapability(resource.Capabilities, operation); !ok {
- return unified.Resource{}, fmt.Errorf("resource %q does not currently advertise %s capability", resourceID, operation)
+ return unified.Resource{}, fmt.Errorf("resource %q does not currently advertise %s capability", resource.ID, operation)
} else if capability.InternalHandler != dockerContainerLifecycleHandler {
- return unified.Resource{}, fmt.Errorf("resource %q advertises %s through unsupported handler %q", resourceID, operation, capability.InternalHandler)
+ return unified.Resource{}, fmt.Errorf("resource %q advertises %s through unsupported handler %q", resource.ID, operation, capability.InternalHandler)
}
- return *resource, nil
+ return resource, nil
}
func findDockerLifecycleCapability(capabilities []unified.ResourceCapability, operation string) (unified.ResourceCapability, bool) {
diff --git a/internal/api/docker_container_action_executor_test.go b/internal/api/docker_container_action_executor_test.go
index b980635e3a..45842e3ede 100644
--- a/internal/api/docker_container_action_executor_test.go
+++ b/internal/api/docker_container_action_executor_test.go
@@ -18,8 +18,9 @@ import (
)
type fakeDockerActionAgentCommander struct {
- results []*agentexec.CommandResultPayload
- calls []agentexec.ExecuteCommandPayload
+ results []*agentexec.CommandResultPayload
+ calls []agentexec.ExecuteCommandPayload
+ connected map[string]bool
}
func (f *fakeDockerActionAgentCommander) ExecuteCommand(_ context.Context, _ string, cmd agentexec.ExecuteCommandPayload) (*agentexec.CommandResultPayload, error) {
@@ -32,6 +33,21 @@ func (f *fakeDockerActionAgentCommander) ExecuteCommand(_ context.Context, _ str
return result, nil
}
+func (f *fakeDockerActionAgentCommander) IsAgentConnected(agentID string) bool {
+ if f.connected == nil {
+ return true
+ }
+ return f.connected[agentID]
+}
+
+func dockerActionCapabilityNames(capabilities []unified.ResourceCapability) []string {
+ names := make([]string, 0, len(capabilities))
+ for _, capability := range capabilities {
+ names = append(names, capability.Name)
+ }
+ return names
+}
+
func TestDockerContainerActionExecutorDispatchesPodmanRestartAndVerification(t *testing.T) {
now := time.Now().UTC()
h := NewResourceHandlers(&config.Config{DataPath: t.TempDir()})
@@ -89,6 +105,120 @@ func TestDockerContainerActionExecutorFailsWhenCapabilityNoLongerAdvertised(t *t
}
}
+func TestDockerContainerActionExecutorAvailabilityRequiresConnectedAgent(t *testing.T) {
+ now := time.Now().UTC()
+ resource := dockerContainerActionResource("app-container:api", "docker", "running", now)
+ h := NewResourceHandlers(&config.Config{DataPath: t.TempDir()})
+ h.SetStateProvider(resourceUnifiedSeedProvider{
+ snapshot: models.StateSnapshot{LastUpdate: now},
+ resources: []unified.Resource{resource},
+ })
+ agents := &fakeDockerActionAgentCommander{connected: map[string]bool{"agent-1": false}}
+ executor := newDockerContainerActionExecutor(h, agents).(dockerContainerActionExecutor)
+
+ err := executor.CheckActionAvailable(context.Background(), unified.ActionRequest{
+ RequestID: "req-availability",
+ ResourceID: "app-container:api",
+ CapabilityName: "restart",
+ Reason: "operator requested restart",
+ RequestedBy: "operator",
+ }, resource)
+ if err == nil || !strings.Contains(err.Error(), `docker container command agent "agent-1" is not connected`) {
+ t.Fatalf("CheckActionAvailable err = %v, want disconnected agent", err)
+ }
+ if len(agents.calls) != 0 {
+ t.Fatalf("agent calls = %#v, want none", agents.calls)
+ }
+}
+
+func TestHandlePlanActionRejectsDisconnectedDockerContainerAgent(t *testing.T) {
+ now := time.Now().UTC()
+ h := NewResourceHandlers(&config.Config{DataPath: t.TempDir()})
+ h.SetStateProvider(resourceUnifiedSeedProvider{
+ snapshot: models.StateSnapshot{LastUpdate: now},
+ resources: []unified.Resource{
+ dockerContainerActionResource("app-container:api", "docker", "running", now),
+ },
+ })
+ h.SetActionExecutor(newDockerContainerActionExecutor(h, &fakeDockerActionAgentCommander{
+ connected: map[string]bool{"agent-1": false},
+ }))
+
+ rec := httptest.NewRecorder()
+ req := httptest.NewRequest(http.MethodPost, "/api/actions/plan", bytes.NewBufferString(`{
+ "requestId":"req-disconnected-agent",
+ "resourceId":"app-container:api",
+ "capabilityName":"restart",
+ "reason":"operator requested restart",
+ "requestedBy":"operator"
+ }`))
+ h.HandlePlanAction(rec, req)
+
+ if rec.Code != http.StatusConflict {
+ t.Fatalf("plan status = %d, want %d, body=%s", rec.Code, http.StatusConflict, rec.Body.String())
+ }
+ if !strings.Contains(rec.Body.String(), `"error":"action_execution_unavailable"`) ||
+ !strings.Contains(rec.Body.String(), `"reason":"action execution is unavailable"`) {
+ t.Fatalf("unexpected response body: %s", rec.Body.String())
+ }
+ store, err := h.getStore("default")
+ if err != nil {
+ t.Fatalf("get store: %v", err)
+ }
+ audits, err := store.GetActionAudits("app-container:api", time.Time{}, 10)
+ if err != nil {
+ t.Fatalf("GetActionAudits: %v", err)
+ }
+ if len(audits) != 0 {
+ t.Fatalf("audits = %#v, want none for refused plan", audits)
+ }
+}
+
+func TestResourceResponsesFilterDisconnectedDockerLifecycleCapabilities(t *testing.T) {
+ now := time.Now().UTC()
+ h := NewResourceHandlers(&config.Config{DataPath: t.TempDir()})
+ h.SetStateProvider(resourceUnifiedSeedProvider{
+ snapshot: models.StateSnapshot{LastUpdate: now},
+ resources: []unified.Resource{
+ dockerContainerActionResource("app-container:api", "docker", "running", now),
+ },
+ })
+ h.SetActionExecutor(newDockerContainerActionExecutor(h, &fakeDockerActionAgentCommander{
+ connected: map[string]bool{"agent-1": false},
+ }))
+
+ listRec := httptest.NewRecorder()
+ listReq := httptest.NewRequest(http.MethodGet, "/api/resources?type=app-container", nil)
+ h.HandleListResources(listRec, listReq)
+ if listRec.Code != http.StatusOK {
+ t.Fatalf("list status = %d, body=%s", listRec.Code, listRec.Body.String())
+ }
+ var list ResourcesResponse
+ if err := json.Unmarshal(listRec.Body.Bytes(), &list); err != nil {
+ t.Fatalf("decode list: %v", err)
+ }
+ if len(list.Data) != 1 {
+ t.Fatalf("list data len = %d, want 1", len(list.Data))
+ }
+ if got := dockerActionCapabilityNames(list.Data[0].Capabilities); len(got) != 0 {
+ t.Fatalf("list capabilities = %#v, want none", got)
+ }
+
+ detailRec := httptest.NewRecorder()
+ detailReq := httptest.NewRequest(http.MethodGet, "/api/resources/app-container:api", nil)
+ h.HandleGetResource(detailRec, detailReq)
+ if detailRec.Code != http.StatusOK {
+ t.Fatalf("detail status = %d, body=%s", detailRec.Code, detailRec.Body.String())
+ }
+ var detail unified.Resource
+ if err := json.Unmarshal(detailRec.Body.Bytes(), &detail); err != nil {
+ t.Fatalf("decode detail: %v", err)
+ }
+ if got := dockerActionCapabilityNames(detail.Capabilities); len(got) != 0 {
+ t.Fatalf("detail capabilities = %#v, want none", got)
+ }
+}
+
func TestHandleExecuteActionRejectsNeverAutoRemediateBeforeExecutor(t *testing.T) {
now := time.Date(2026, 5, 4, 14, 0, 0, 0, time.UTC)
h := NewResourceHandlers(&config.Config{DataPath: t.TempDir()})
diff --git a/internal/api/resources.go b/internal/api/resources.go
index a230eb2616..8ac8cb6282 100644
--- a/internal/api/resources.go
+++ b/internal/api/resources.go
@@ -1,6 +1,7 @@
package api
import (
+ "context"
"encoding/json"
"errors"
"io"
@@ -149,6 +150,7 @@ func (h *ResourceHandlers) HandleListResources(w http.ResponseWriter, r *http.Re
}
allResources := presentationResourcesFromRegistry(registry)
+ h.applyActionAvailability(r.Context(), allResources)
resources := allResources
if unsupported := unsupportedResourceTypeFilterTokens(r.URL.Query().Get("type")); len(unsupported) > 0 {
http.Error(w, "unsupported type filter token(s): "+strings.Join(unsupported, ", "), http.StatusBadRequest)
@@ -294,6 +296,9 @@ func (h *ResourceHandlers) HandleGetResource(w http.ResponseWriter, r *http.Requ
}
resourceCopy := *resource
+ resourceCopies := []unified.Resource{resourceCopy}
+ h.applyActionAvailability(r.Context(), resourceCopies)
+ resourceCopy = resourceCopies[0]
attachDiscoveryTarget(&resourceCopy)
h.attachDiscoveryReadiness(&resourceCopy, time.Now().UTC())
attachMetricsTarget(&resourceCopy, registry)
@@ -304,6 +309,38 @@ func (h *ResourceHandlers) HandleGetResource(w http.ResponseWriter, r *http.Requ
json.NewEncoder(w).Encode(resourceCopy)
}
+func (h *ResourceHandlers) applyActionAvailability(ctx context.Context, resources []unified.Resource) {
+ checker, ok := h.actionExecutor.(ActionAvailabilityChecker)
+ if !ok || checker == nil {
+ return
+ }
+ for i := range resources {
+ if len(resources[i].Capabilities) == 0 {
+ continue
+ }
+ filtered := make([]unified.ResourceCapability, 0, len(resources[i].Capabilities))
+ for _, capability := range resources[i].Capabilities {
+ req := unified.ActionRequest{
+ RequestID: "resource-capability-availability",
+ ResourceID: resources[i].ID,
+ CapabilityName: capability.Name,
+ Params: map[string]any{},
+ Reason: "Projecting currently executable resource capabilities.",
+ RequestedBy: "system:resource-api",
+ }
+ if err := checker.CheckActionAvailable(ctx, req, resources[i]); err != nil {
+ continue
+ }
+ filtered = append(filtered, capability)
+ }
+ if len(filtered) == 0 {
+ resources[i].Capabilities = nil
+ } else {
+ resources[i].Capabilities = filtered
+ }
+ }
+}
+
func presentationResourcesFromRegistry(registry *unified.ResourceRegistry) []unified.Resource {
if registry == nil {
return nil
diff --git a/internal/unifiedresources/code_standards_test.go b/internal/unifiedresources/code_standards_test.go
index 9bb34b8dc0..2096b66856 100644
--- a/internal/unifiedresources/code_standards_test.go
+++ b/internal/unifiedresources/code_standards_test.go
@@ -574,12 +574,14 @@ func TestActionExecutionContractStaysAPIOwned(t *testing.T) {
},
filepath.Join("..", "api", "actions.go"): {
"type ActionExecutor interface",
+ "type ActionAvailabilityChecker interface",
"func (h *ResourceHandlers) HandleExecuteAction(w http.ResponseWriter, r *http.Request)",
"func (h *ResourceHandlers) validateActionPlanFresh(orgID string, record unified.ActionAuditRecord) error",
"func recordRefusedActionExecution(store unified.ResourceStore, record unified.ActionAuditRecord",
"func (h *ResourceHandlers) publishActionCompleted(record unified.ActionAuditRecord)",
"store.RecordActionExecutionStart(started, startEvent)",
"store.RecordActionExecutionResult(completed, doneEvent)",
+ "action_execution_unavailable",
"action_plan_drift",
"action_executor_unavailable",
},
@@ -588,6 +590,7 @@ func TestActionExecutionContractStaysAPIOwned(t *testing.T) {
"actionCompleted func(unified.ActionAuditRecord)",
"func (h *ResourceHandlers) SetActionExecutor(executor ActionExecutor)",
"func (h *ResourceHandlers) SetActionCompletedPublisher(",
+ "func (h *ResourceHandlers) applyActionAvailability(ctx context.Context, resources []unified.Resource)",
},
filepath.Join("..", "api", "agent_events.go"): {
"func (b *AgentEventBroadcaster) PublishActionCompletedRecord(record unifiedresources.ActionAuditRecord)",