Pulse/internal/hostagent
rcourtman f4c2fd0c38 Fail closed on unknown remediation lock state for autonomous dispatches
The AI action broker treated an unreadable operator lock as unlocked:
isResourceRemediationLocked returned (false, nil) with no audit store
wired, and the caller logged store errors then dispatched anyway. An
operator's NeverAutoRemediate=true could be silently ignored whenever
the policy store was missing or erroring, which is unacceptable while
Patrol and Assistant run at assisted or full autonomy.

Posture change at the dispatch decision point:
- isResourceRemediationLocked now reports unknown state (nil store or
  lookup failure) as an ErrRemediationLockStateUnknown-wrapped error
  instead of silently defaulting to unlocked.
- New checkRemediationLockForDispatch gate: dispatches without an
  approved human decision fail CLOSED on unknown lock state and
  surface "remediation lock state unknown; operator approval
  required". Human-approved dispatches keep the historical fail-open
  behavior with a warning log. A confirmed lock still refuses even
  approved dispatches, as before.
- executeNativeActionWithAudit (TrueNAS app start/stop/restart) now
  enforces the lock too; it previously skipped the check entirely.
- Refusals persist Failed audit records with stable
  remediation_lock_state_unknown: / resource_remediation_locked:
  ErrorMessage prefixes.
- ai-runtime subsystem contract updated to pin the new posture.

Tests cover store-error and nil-store at both autonomy postures on
both dispatch paths; routing/control tests now wire an in-memory
audit store since autonomous dispatch without one is refused.
2026-07-10 00:14:01 +01:00
..
agent.go Modernize Unified Agent lifecycle and platform support 2026-07-09 23:20:35 +01:00
agent_bench_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
agent_buffering_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
agent_collection_test.go Harden unified agent runtime and installer 2026-04-23 23:04:18 +01:00
agent_flushbuffer_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
agent_metrics_test.go Modernize Unified Agent lifecycle and platform support 2026-07-09 23:20:35 +01:00
agent_new_test.go Modernize Unified Agent lifecycle and platform support 2026-07-09 23:20:35 +01:00
agent_sensors_test.go Add typed NVIDIA GPU stats 2026-06-30 09:43:33 +01:00
agent_state_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
agent_test.go Clarify Pulse Agent host profile support 2026-05-07 22:28:24 +01:00
buffer_persist_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
ceph.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
ceph_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
cluster_sensors.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
cluster_sensors_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
collector_observability_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
command_client_test.go Allow local Pulse HTTP agent URLs 2026-07-03 00:24:40 +01:00
commands.go Allow local Pulse HTTP agent URLs 2026-07-03 00:24:40 +01:00
commands_backoff_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
commands_connect_test.go Harden unified agent runtime and installer 2026-04-23 23:04:18 +01:00
commands_coverage_test.go Stabilize hostagent backend release tests 2026-06-03 21:41:09 +01:00
commands_deploy.go Close remaining CodeQL allocation and cookie gaps 2026-07-09 20:10:08 +01:00
commands_deploy_test.go Harden remaining CodeQL security boundaries 2026-07-09 19:46:40 +01:00
commands_execute_test.go Tighten unified agent hardening proof 2026-04-23 23:37:25 +01:00
commands_registration_test.go Require explicit websocket origin continuity 2026-04-22 04:46:13 +01:00
commands_test.go Harden agent command and deploy trust boundaries 2026-04-21 23:50:34 +01:00
enroll.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
enroll_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
hostagent_coverage_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
mdadm.go Fix mdadm RAID fallback discovery 2026-05-05 09:29:34 +01:00
mdadm_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
mock_collector_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
network_helpers_test.go test: Add comprehensive test coverage across packages 2026-01-19 19:26:18 +00:00
nvidia_smi.go Fail closed on unknown remediation lock state for autonomous dispatches 2026-07-10 00:14:01 +01:00
os_identity.go Fix PVE version detection on agent hosts 2026-05-08 15:30:08 +01:00
proxmox_setup.go Prefer route-aware Proxmox host URLs 2026-07-07 10:37:10 +01:00
proxmox_setup_network_coverage_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
proxmox_setup_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
send_report_test.go Surface agent auth failures and staleness instead of a silent 401 loop 2026-07-08 08:35:46 +01:00
smartctl.go Harden CodeQL storage and integer boundaries 2026-07-09 17:37:08 +01:00
smartctl_coverage_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
smartctl_discovery_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
smartctl_size_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
smartctl_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
smartctl_test_helpers_test.go Partition host agent tests by platform 2026-07-09 23:40:34 +01:00
sysinfo.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
sysinfo_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
unraid.go fix(hostagent): clear stale Unraid sync action when resync position is zero 2026-06-27 17:08:02 +01:00
unraid_test.go fix(hostagent): clear stale Unraid sync action when resync position is zero 2026-06-27 17:08:02 +01:00
version.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
zfs.go Surface ZFS pool membership on physical disks 2026-04-23 20:38:33 +01:00
zfs_test.go Surface ZFS pool membership on physical disks 2026-04-23 20:38:33 +01:00