Commit Graph

886 Commits

Author SHA1 Message Date
pulse-triage[bot]
3202a32c50 Preserve visible memory caps on inherited cgroup mounts
When an inherited mount root lies above the namespace root, retain its enforcing cap without guessing a directory for the process. Keep exact mappings, unrelated mounts, and the MemTotal fallback distinct.

Change-source: pulse-maintainer
2026-11-23 03:28:30 +00:00
pulse-triage[bot]
db2c1894a3 Detect Pulse's memory limit in delegated cgroup mounts
Resolve the running service's controller path against each visible mount root before selecting the tightest cap. Keep the MemTotal fallback for hidden LXC caps and retain the existing operator override and GC headroom.

Change-source: pulse-maintainer
2026-11-23 00:22:36 +00:00
rcourtman
2b78a6f874 feat(standalone): show agent libvirt and XCP-ng VMs under Machines
Adds an evidence-gated VMs tab on the Machines page (/standalone/vms) so
virtual machines reported by standalone Pulse Agents (Unraid, Linux
libvirt/KVM, and XCP-ng) are visible alongside their hosts without
cluttering estates that have no standalone VMs.

- Query type=agent,vm,network-endpoint on StandalonePageSurface while
  excluding Proxmox, Kubernetes, TrueNAS, and vSphere sources
- Add StandaloneVirtualMachinesTable and standaloneVmTableModel with
  host scoping, status/search/sort controls, and ResourceDetailDrawer
  support including hypervisor/vCPU/host facts
- Add single-line VM count pills on desktop/tablet host rows linking
  directly to /standalone/vms?host=<id> and route standalone VM links in
  resourcePagePath to /standalone/vms
- Read libvirt balloon.available/usable/unused counters so guests with
  virtio-balloon stats report actual memory usage instead of 100%
  allocation and shutoff domains report zero memory usage
2026-11-22 14:30:23 +00:00
rcourtman
b4dbb681ba perf(proxmox): aggregate PBS consumers and guard async storage polls
Three targeted memory and resource-hygiene fixes on Proxmox VE + PBS
paths:

1. internal/unifiedresources: aggregate pbsGuestBackupsOf by
   (instance, datastore, guest) with a snapshot count instead of storing
   one pbsGuestBackup entry per PBS snapshot, cutting registry memory
   and rollup scan cost by ~100x on multi-thousand-snapshot estates while
   preserving exact TopConsumers counts.
2. internal/monitoring: add a per-instance in-flight guard to
   pollStorageAsync so slow NFS/PBS storage endpoints cannot stack
   overlapping 60s background storage polls on every poll tick.
3. pkg/proxmox + internal/monitoring: export Client.CloseIdleConnections
   and defer it on throwaway proxmox.NewClient callers in storage
   fallback and runtime cluster detection.

Contract-Neutral: issue-1803 internal PBS consumer rollup aggregation, PVE storage in-flight guard, and throwaway proxmox client idle connection cleanup with no public-contract delta
2026-11-21 23:10:59 +00:00
rcourtman
047e8b4648 perf(memory): cap LXC Go heap and cut PVE/PBS memory churn (#1803)
Address seven memory-ceiling and hot-path allocation bugs uncovered while
investigating #1803 on Proxmox VE LXC + PBS estates:

1. pkg/server: read /proc/meminfo MemTotal alongside cgroup v1/v2 limits so
   Proxmox VE LXC containers (where memory.max sits above the /ns cgroup root
   and reads "max") still derive an accurate GOMEMLIMIT via lxcfs.
2. internal/alerts: avoid per-row Alert.Clone() during HistoryManager identity
   lookups/updates and trim Evidence on aged resolved alerts beyond the
   recently-resolved window.
3. internal/recovery/store: skip full PBS table scans in UpsertPoints when no
   point needs historical Proxmox PBS identity resolution, filter by timestamp
   before unmarshaling subject_ref_json, and replace unbounded looseCandidates
   slices with O(1) ambiguity tracking.
4. internal/recovery/store: stream RefreshProtectionPostures and
   listRequestedProtectionPostures one subject_key group at a time, skip
   fetching/unmarshaling details_json and repository_ref_json when
   provider_scope is already stored, and project only the evidence fields read
   during posture derivation.
5. internal/monitoring: allow unrelated full-inventory recovery batches (such
   as PBS snapshots) to coalesce past disjoint scoped batches (such as PVE
   guest snapshots), and zero processed batches immediately in the ingest loop.
6. internal/models: stop State.syncBackupsLocked() from deep-cloning all
   PVE/PBS/PMG backups into a duplicate State.Backups copy on every update.

Contract-Neutral: issue-1803 internal memory-limit and allocation-churn fixes with no public-contract delta
2026-11-21 19:22:33 +00:00
pulse-triage[bot]
d75e79167f Scope Proxmox task-log duplicate tracking to each row
Leave provider extension validation intact without retaining a previous row's key allocation. Check that the same provider key, including an escaped spelling, is accepted on a later row.

Change-source: pulse-maintainer
Contract-Neutral: Duplicate tracking storage changes only. Complete-response checks, accepted rows and provider extensions, status, limits, errors and downstream evidence are unchanged.
2026-11-21 01:23:30 +00:00
pulse-triage[bot]
8bd99a24b9 Merge commit 'eb820208d6289e26aa827aea21a46c8e56cdf46e' into maintainer-async/20261121T000021Z-core-runtime/pulse
Change-source: pulse-maintainer
2026-11-21 00:44:40 +00:00
pulse-triage[bot]
997ded8aa7 Decode Proxmox backup task logs with less work
Decode ordered log rows directly in the time-budgeted backup scan. Preserve whole-response and field validation so a malformed read never displaces accepted per-guest evidence.

Change-source: pulse-maintainer
Contract-Neutral: Response status and bounds, ordered row admission, diagnostics, provider reads, per-guest evidence and rendered fields are unchanged; only decoding cost changes.
2026-11-21 00:08:12 +00:00
pulse-triage[bot]
837e0eb55b Decode Proxmox backup task pages with less work
Read each task's fields into the final value while keeping duplicate keys, alternate canonical spellings, invalid scalars and contradictory completion non-authoritative. This reduces decoding work inside the time-budgeted backup scan.

Contract-Neutral: Field admission, response bounds, task values and order, provider reads, and rendered results are unchanged; only backup-page decoding and its tests change.
Change-source: pulse-maintainer
2026-11-20 23:12:13 +00:00
pulse-triage[bot]
ae4112e7f3 Stop treating Home Assistant Supervisor's latest alias as an update
Let Home Assistant decide Supervisor updates for its own channel. Preserve monitoring, suppress the non-comparison in old and new agent reports, and retire stale alias-only alerts without clearing unknown checks for other containers.

Contract-Neutral: Corrects which Docker image observation is comparable without changing report or resource schemas, alert lifecycles for checkable images, settings, or action authority.
Change-source: pulse-maintainer
2026-11-19 01:02:54 +00:00
rcourtman
1741bbf02e Reduce the work on the backend race-test critical path
Seed the steady-state metrics fixture by ordered poll inside SQLite.
Retain the same history, measured writes and WAL frame assertions.

Refresh whole-package scheduling costs from eight complete CI receipts.
Use the existing two runners and four package slots on each. Source
continues to define the complete test inventory.
2026-11-18 20:36:26 +00:00
pulse-triage[bot]
6bdadcc4db Keep PMG queue alerts open until the relevant readings prove recovery (#4618)
**Keep PMG queue alerts open until the relevant readings prove
recovery**

Evaluate the node metrics independently. Keep qshape count completeness
and inclusive age bounds with the poll so partial counts cannot clear
incidents and an ambiguous age cannot clear a warning or downgrade a
critical incident. Recover each known reading on its own and retain the
existing queue payload and alert identities.

Contract-Neutral: Repairs incomplete PMG observations using the existing
queue fields, alert identities, thresholds, aggregate count policy and
notification routing.

**Keep the PMG queue projection separate from alert observations**

Only observed component counts contribute to the alert subtotal.
Preserve the existing published numeric fields even when the flexible
decoder could not establish an exact count.

Contract-Neutral: Keeps the existing PMG queue JSON and only separates
the live alert evidence from that projection.

**Do not report a Proxmox port down when carrier is unavailable**

Send explicit link state only for observed carrier or independently
confirmed administrative down. Keep a readable speed when carrier is
unknown and leave addressless port inventory and bridge accounting
unchanged.

Contract-Neutral: Uses the existing optional physical link state and its
unknown, up and down meanings; host routing, traffic attribution and
report schema are unchanged.

---
Fleet candidate `20261118T154534Z-core-runtime` from the `core-runtime`
lane. Reviewed tip `7ea271d09a75de4a1bca863bfd999e6fd97f31c4` on `main`.

[How Pulse handles
triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
2026-11-18 17:28:04 +00:00
rcourtman
ac3efdaa61 Count map opens and saved images in telemetry (#4604)
The infrastructure map is a named bet, graded on 18 December on whether
people open it and save its image. Nothing counted either.

Supersedes #4597, which counted saves per view. The map now has one view
(#4599), so those counts are gone.

## What is counted

Telemetry schema v24 adds three counts, each a number of browser
sessions over 30 days:

| Field | Counts sessions that |
|---|---|
| `infrastructure_map_open_sessions_30d` | opened the map |
| `infrastructure_map_export_sessions_30d` | saved an image |
| `infrastructure_map_export_names_hidden_sessions_30d` | saved an image
with names hidden |

## What is not sent

The map draws names, addresses and networks, and the saved image
contains them. None of them, nor the image, leaves the browser for this
count. The browser posts one closed value to `POST
/api/usage/infrastructure-map`, once per session. The route rejects
unknown fields, unknown values and trailing JSON. The server keeps a
daily tally and drops any key outside the closed set on read and on
write.

Density (names or compact) is not counted. It defaults from estate size,
so it would measure the estate and not a choice.

## Also in here

- The once-per-session rule is the one the workload-history counters
already had. Both now use one recorder (`src/api/sessionActivity.ts`).
The workload-history test is unchanged and passes.
- `InfrastructureMapSurface.test.tsx` renders the page and reads the
saved image's markup for names and addresses. It is registered as a
proof for the `infrastructure-map` policy.
- The tally file is registered under `security-privacy`.
- `PRIVACY.md` and its shipped mirror list the three fields, schema 24
and the dated change row.

## Bundle budget

A third commit raises one number in `.bundlesize.json`. On main the
`UserAssignmentsPanel` chunk measures 7991 gzip bytes against a limit of
7991, with no headroom. It reached that limit in #4602 (before it, the
chunk built at about 7.77 kB). On this branch the same panel code
measures 7997, so the bundle check failed by 6 bytes. This change does
not edit that panel. The likely cause is that new exports in the shared
entry rename the bindings the chunk imports; I measured the sizes, not
the cause. The chunk's reference goes from 6949 to 6975, which allows
8021 bytes and leaves 24 of headroom.

## Order of landing

- Built on #4599 (the map as the service diagram only) and #4601 (the
map fitted to one screen), which have both merged. The map page file
changed in #4601 and here, so the merge combined them and a follow-up
commit records the browser pass for the combined file.
- Receiver: rcourtman/pulse-pro#919 added the columns and
rcourtman/pulse-pro#923 drops the per-view ones. The licence server
needs a deploy before counts are stored.
- No release note file is added. Schema v22 did not add one either. The
first release that carries v24 has to name it in its notes, as
`PRIVACY.md` promises.

## Checks

- Go: the telemetry package, the tally tests, and the handler and route
inventory tests in `internal/api` pass.
- Frontend: type-check, the lint audits, header audit and cpd pass, and
so do the 200 test files run (the map, the API clients, Settings,
Workloads and the app architecture tests).
- `registry_audit.py --check`, `contract_audit.py --check`, the
completion and receipt guards and `check_telemetry_schema_parity.py`
pass.
- Browser, private mock stack at 1280 and 375 wide, on the combined
page: opening the map posted one count, a save posted one, a save with
names hidden posted one, a repeat save and a reload posted nothing, and
the telemetry preview showed schema 24 with all three counts at 1. The
workload-history range counter still posted.
- Not checked in a browser: a real file download (the download click was
intercepted), how the fit responds to dragging the window narrower,
light theme, Firefox and Safari.
2026-11-18 16:52:38 +00:00
pulse-triage[bot]
fff32e6768 Keep the PMG queue projection separate from alert observations
Only observed component counts contribute to the alert subtotal. Preserve the existing published numeric fields even when the flexible decoder could not establish an exact count.

Contract-Neutral: Keeps the existing PMG queue JSON and only separates the live alert evidence from that projection.
Change-source: pulse-maintainer
2026-11-18 16:09:35 +00:00
pulse-triage[bot]
b2ac90c322 Keep PMG queue alerts open until the relevant readings prove recovery
Evaluate the node metrics independently. Keep qshape count completeness and inclusive age bounds with the poll so partial counts cannot clear incidents and an ambiguous age cannot clear a warning or downgrade a critical incident. Recover each known reading on its own and retain the existing queue payload and alert identities.

Contract-Neutral: Repairs incomplete PMG observations using the existing queue fields, alert identities, thresholds, aggregate count policy and notification routing.
Change-source: pulse-maintainer
2026-11-18 16:00:31 +00:00
rcourtman
5045360d7d Report each host's default gateway and DNS servers (#4607)
## What

The host agent reports each machine's IPv4 default gateways and DNS
servers, and the server carries them to the host model, the agent facet
of the resource (`agent.defaultGateways`, `agent.dnsServers`) and the
frontend type.

## Why

Pulse knew every address a machine holds and nothing about where it
sends traffic for other networks or where it resolves names. No router,
gateway or resolver could appear anywhere in the product, because
nothing collected one.

## Behaviour to know

- Gateways come from `/proc/net/route`: default routes that go through a
gateway, lowest metric first, each with its interface. Linux only, IPv4
only.
- DNS servers come from `/etc/resolv.conf`, in the file's order. When
that holds only loopback addresses and
`/run/systemd/resolve/resolv.conf` names servers, those are reported,
because the systemd-resolved stub says nothing about where names are
resolved. A host that runs its own resolver on loopback keeps the
loopback address.
- Two or three small local file reads per report. No command is run and
no permission or flag is needed.
- The server accepts only IP addresses and an interface name, stores
addresses in canonical form, and keeps at most eight of each.
- A report without the block (an older agent, or a platform with no
readable route table) leaves both lists missing. That is unknown, never
"no gateway".
- The legacy host row sent to the frontend state is unchanged. Nothing
reads the fields yet.

## Checked

- Unit tests: route-table and resolv.conf parsing (metric order,
duplicates, routes that name no next hop, comments, bounds), the
systemd-resolved stub and a real local resolver, the agent report,
ingest validation, the model clone, the adapter, wire shape, clone and
view, frontend types and the resource read.
- The parser inputs match real files read from an Unraid host
(`nameserver 192.168.0.1 # eth0:v4`), a Proxmox node on Tailscale DNS,
and an Ubuntu VM behind the systemd-resolved stub.
- A rig: Pulse and `pulse-agent` built from this branch on a real Ubuntu
24.04 machine. See the receipt for the values observed.

## Not in this PR

- Drawing it on the infrastructure map.
- IPv6 default routes, and gateways on macOS, Windows and FreeBSD.
- Gateway and DNS for a Proxmox node with no agent, which the PVE API
could supply.
- Mock data.
2026-11-18 15:27:18 +00:00
rcourtman
5ccf18e980 feat(proxmox): dim node ports that have no link (#4606)
The hardware strip drew an unplugged port exactly like a cabled one, so
a dead or dropped link could not be spotted at a glance.

The agent now reads sysfs carrier for each device-backed port and
reports linkUp: true with a link, false with no cable, no partner or
an administratively down port. Software interfaces leave it unset, and
a speed the driver still reports without a link is dropped as stale.
The field is carried through the host model, unified resources and the
frontend types, and the strip draws a no-link port at 40% opacity with
"no link" in its hover title. Unknown state (Proxmox-only rows, older
agents) draws as before rather than guessed down.
2026-11-18 15:08:34 +00:00
rcourtman
bc3d4a9ed3 Report each host's default gateway and DNS servers
Pulse knew every address a machine holds and nothing about where it
sends traffic bound for other networks or where it resolves names. No
router, gateway or resolver could appear anywhere, because nothing
collected one.

The host agent now reads both from the host's own files on every report:
IPv4 default routes from /proc/net/route, lowest metric first, and the
nameservers of /etc/resolv.conf. Behind a systemd-resolved stub it
reports the servers the stub forwards to. The server accepts only IP
addresses and an interface name, bounds both lists, and carries them on
the host model, the agent facet of the resource and the frontend type.

Gateways are Linux only and IPv4 only. A report without the block stays
unknown, which is never read as "no gateway".

Nothing reads the fields yet. The infrastructure map will use them to
name the gateway machines route through.
2026-11-18 13:29:26 +00:00
rcourtman
2da9f11505 Report each container's network mode from the Docker agent
A container that uses another container's network (a download client
behind a VPN container) has no network attachments and no published
ports of its own, so Pulse showed it with no network at all and nothing
said where its traffic went. On a real Unraid host three containers
looked like that.

The agent already inspects every container. It now reports the
runtime's network mode as the runtime wrote it: bridge, host, none, a
network name, or container:<id>. The server keeps it trimmed and bounded
on the container model, the app-container resource and the frontend
types. A report without it stays empty, which means not reported and
never "no network".

Nothing reads the field yet. The infrastructure map will use it to draw
a container next to the one whose network it uses.
2026-11-18 13:15:47 +00:00
rcourtman
23a693ab46 feat(proxmox): dim node ports that have no link
The hardware strip drew an unplugged port exactly like a cabled one, so
a dead or dropped link could not be spotted at a glance.

The agent now reads sysfs carrier for each device-backed port and
reports linkUp: true with a link, false with no cable, no partner or
an administratively down port. Software interfaces leave it unset, and
a speed the driver still reports without a link is dropped as stale.
The field is carried through the host model, unified resources and the
frontend types, and the strip draws a no-link port at 40% opacity with
"no link" in its hover title. Unknown state (Proxmox-only rows, older
agents) draws as before rather than guessed down.
2026-11-18 12:48:57 +00:00
rcourtman
c19e025c69 Count map opens and saved images in telemetry
The infrastructure map is a named bet, graded on 18 December on whether
people open it and save its image. Nothing counted either, so the grade
could only have read forum mentions.

Schema v24 adds three counts to the ping, each a number of browser
sessions over 30 days: sessions that opened the map, sessions that saved
an image, and sessions that saved one with names hidden. The browser
reports each milestone to its own Pulse server once per session, through
a new route that takes one closed value and nothing else. The server
keeps a daily tally and drops any key outside the closed set. The map
draws names, addresses and networks, and none of them, nor the image,
leaves the browser for this.

Density is not counted: it defaults from estate size, so it would
measure the estate and not a choice.

The session rule is the one the workload-history counters already had,
so both now share one recorder instead of two copies of it.

PRIVACY.md lists the three fields and the v24 change. The receiver is
in rcourtman/pulse-pro (PRs 919 and 923) and needs a licence-server
deploy before the counts are stored.
2026-11-18 12:39:09 +00:00
pulse-triage[bot]
fa8528d949 Keep Proxmox backup failures beyond overlapping task pages
Separate paging progress from observation quality. Continue after a full page with new jobs, but do not count any overlapping scan as coverage or move the durable checkpoint. Preserve the first decoded observation per task, the existing read cap, and access-denial withdrawal.

Contract-Neutral: Enforces the existing partial-history and failed-read checkpoint rules within the same paging limits, authority, retention and payload contract.
Change-source: pulse-maintainer
2026-11-18 12:17:25 +00:00
pulse-triage[bot]
a0b4ac9216 Keep PBS restore points through unread group inventories
Require identifiable, unique backup groups and an explicit count before a namespace listing can renew or remove restore-point evidence. Keep valid empty inventories and explicit zero counts authoritative.

Change-source: pulse-maintainer
2026-11-18 08:38:39 +00:00
pulse-triage[bot]
90d14f73ba Keep PBS job failures through unread inventory responses
Use the existing whole-body inventory boundary for configured sync, verify and prune jobs. An unread or unidentifiable list must not retire a known failure, including after restart. Keep valid empty lists and new results authoritative.

Change-source: pulse-maintainer
2026-11-18 06:18:00 +00:00
rcourtman
b0468b07ff Support Docker Compose application diagnosis and reviewed service updates (#4571)
Pulse now groups Compose services by runtime and project. Operators can
follow a service from the Docker installer to its checks, recent
failures and opt-in live logs. Container alerts can be muted on one
runtime while endpoint and machine checks keep their own settings.

For an explicitly registered deployment source, an approved update
changes one service image in the local Compose file or publishes a Git
branch against the reviewed base. The application shows the running
manifest and a fresh linked HTTP result separately, with recovery
instructions for the source owner. The Docker demo includes a matching
deployment image and a failed readiness check.

Verified both update paths through a private Docker daemon, registry,
Git remote and authenticated Pulse UI. Before the Git rollout the
running digest differed. After each rollout the digest matched, HTTP
returned v2, the peer container ID was unchanged and the application
volume marker survived. Browser checks also covered monitoring-only
onboarding, opt-in logs, scoped alert mute, desktop and mobile failure
diagnosis and retrying a scoped port check with simulated Proxmox guest
inventory. The production build passed all bundle budgets and 692
targeted frontend tests. All 34 action review tests passed after the
mobile digest wrapping fix. The full mock, Docker agent and Docker
protocol packages passed 479 tests. Three fixture-dependent Docker agent
tests were skipped in the standard package run. A separate native Docker
run on the final source exercised the directory-scoped replacement and
confirmed v1 to v2, an unchanged peer and retained application data.
2026-11-18 03:54:07 +00:00
rcourtman
f30b2555ea Review Compose updates against their deployment source
Docker operators need to diagnose service failures and change one image
without losing the source that owns a running application. Bind approved
updates to the registered Compose file or Git base, then show the running
image and fresh HTTP evidence after rollout. Keep log access opt-in, mute
container alerts per runtime, and connect the Docker installer and demo
to the application workflow.
2026-11-18 02:36:36 +00:00
rcourtman
feacbf0e1d Measure Patrol outcomes independently of finding cleanup
Record each closed investigation in a private 30-day ledger and reconcile
later action outcomes by local run key. Export fixed outcome and handoff
counts with observation coverage while keeping legacy finding counts separate.

Verify cleanup, replay, concurrency, failed writes and rollback boundaries,
and carry schema 23 through the payload preview and privacy disclosure.
2026-11-17 23:34:01 +00:00
rcourtman
107c4e29f9 Make metric history free on every plan
Community installs already stored 90 days of daily metric averages and
366 days of availability history, but the chart, availability and agent
history reads refused anything past seven days, and lapsed paid installs
had history past seven days purged 60 days after a downgrade. Locking
users out of data on their own disk is the kind of limit that drew the
loudest complaints before (the monitored-system cap, SSO), and it is not
what people pay for: 12 of 88 covered paid installs read past seven days
in the last 30 days.

The history routes now serve every supported range on every plan, and
storage retention alone decides how far back the answer goes.
long_term_metrics moves into Community as a compatibility key with no
upgrade reason. TierHistoryDays, max_history_days and the downgrade
purge (DowngradeRetentionState, the metrics store commercial ceiling and
the generated-report purge) are removed, so nothing deletes history or
reports because a plan ended. The chart and drawer lock panels, the
history plan link, the billing summary row and the plan copy that sold
history go with them. Paying users lose nothing.

The public pricing pages and licence server copy in pulse-pro change
when the release carrying this ships.
2026-11-17 20:11:48 +00:00
rcourtman
8af1f7f519 Tell Patrol it can read inside a guest it cannot power-cycle
On a Proxmox node whose agent has commands on but no action runner, a
guest disk alert's check was told only that Pulse cannot run an action
for the guest and to use Proxmox. Runs read that as Pulse having no
command or log access there and raised nothing, though a read inside the
guest through the node's agent names the folder that filled the disk
(fault set pve-v1, cell P2).

The action catalog now carries a reads fact, from the routing pulse_read
uses, when the agent that would take a read reports commands on. The
alert seed says an investigation can read disk usage, files and logs
inside a running guest. Space and age alerts no longer get the node's
refused power actions or the start-on-boot line, since no start, stop
or restart changes them.
2026-11-14 21:44:33 +00:00
pulse-triage[bot]
dd54dcb7f8 Preserve Proxmox snapshot memory-state evidence (#4376)
**Preserve Proxmox snapshot memory-state evidence**

Read each snapshot's explicit memory flag instead of assuming every QEMU
snapshot includes RAM. Preserve legacy no-claim behavior and reject
ambiguous flags without replacing accepted inventory. Carry the existing
boolean through live backup JSON, recovery records and the existing
agent snapshots reader; no tool or history-source expansion.

**Compare retained equal-time snapshots by identity**

The state rebuilds its snapshot slice from a map and sorts by time only.
Make the new memory-evidence regression compare every field by exact ID,
also checking count and duplicates, rather than depending on an
unspecified order for the two equal-time guest snapshots.

---
Fleet candidate `20261114T072803Z-core-runtime` from the `core-runtime`
lane. Reviewed tip `6b49b67e2ba0a363392ab58c4fe33e3cf4b18454` on `main`.

[How Pulse handles
triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
2026-11-14 09:59:50 +00:00
rcourtman
3cefc38316 Count agents with commands on and failure logs on in telemetry
Pulse cannot say how many owners turned on agent commands or failure
logs. So nobody can tell how many owners a Patrol fix that needs
commands reaches, and the failure-logs feature cannot be graded at 30
days, as the demand ledger requires.

Schema v22 adds two counts to the ping. agent_hosts_commands_enabled
counts agent hosts whose agent reports commands on.
docker_hosts_failure_logs_enabled counts Docker hosts whose agent
reports failure logs on. Both are integers; no host, name or log text
leaves the install.

The Docker agent did not report its failure-logs setting, only lines
when a container failed. Its report now says whether the setting is on
(failureLogsEnabled, omitted when off), and the server keeps it on the
Docker host and its unified view. It is reported so it can be counted;
the server still cannot change it.

The commands count follows what agents report, so it includes an agent
that accepted a remote command setting under the legacy authority, not
only those started with --enable-commands. A live check showed this: an
agent restarted without the flag stayed at commands on because it
re-applied the server's setting, while failure logs, which only the
host can set, dropped to off.

PRIVACY.md lists both fields and the v22 change. The receiver change
is rcourtman/pulse-pro#820; it needs a licence-server deploy before
the counts are stored.
2026-11-14 09:04:31 +00:00
pulse-triage[bot]
7b124eab10 Preserve Proxmox snapshot memory-state evidence
Read each snapshot's explicit memory flag instead of assuming every QEMU snapshot includes RAM. Preserve legacy no-claim behavior and reject ambiguous flags without replacing accepted inventory. Carry the existing boolean through live backup JSON, recovery records and the existing agent snapshots reader; no tool or history-source expansion.

Change-source: pulse-maintainer
2026-11-14 07:51:09 +00:00
pulse-triage[bot]
0e231eff8d Use virtual time for the synthetic pinned-dial budget fixture
A retained standard proof missed the healthy third fake address under the existing 1.5-second budget. The fake dials only wait on context timers; drive this named fixture with synctest instead of host wall time. Preserve every original assertion and the exact budget and concurrency bounds, and additionally require the third address to win at 750ms. The failed wall-time sample stays adverse; its scheduling cause is unknown. No product timeout, chart SLO or live performance claim changes.

Contract-Neutral: This is a deterministic test-fixture correction only; production dialing and every timeout, fallback, concurrency and destination contract are unchanged.
Change-source: pulse-maintainer
2026-11-14 01:11:27 +00:00
pulse-triage[bot]
33183dc950 Keep appliance policy refusals distinct from ordinary dial failures
Retain genuine cancellation and approved-peer connection errors. Give VMware a fixed safe existing-category policy explanation instead of mislabeling a refused destination as an unreachable host. Strengthen consumer assertions to count accepted TCP sockets as well as requests.

Contract-Neutral: Correct existing appliance-policy failure handling without adding public fields, routes, scopes or categories, and retain the established transport/privacy contracts.
Change-source: pulse-maintainer
2026-11-14 01:00:07 +00:00
pulse-triage[bot]
1a156c8e33 Bind tenant appliance dials and saved polls to their destination policy
Validate each complete DNS answer at dial time and connect only to its numeric addresses, including TrueNAS WebSocket reconnects. Retain server-derived tenant save provenance for polling, ignore submitted policy metadata, preserve legacy/instance-managed behavior and keep TLS, pins and failed observations intact.

Contract-Neutral: Complete the existing tenant appliance-destination rule without changing public fields, routes, scopes, TLS, History or recovery contracts; new provenance is internal storage only and legacy records are unchanged.
Change-source: pulse-maintainer
2026-11-14 00:51:54 +00:00
rcourtman
e0a98e49f1 Limit the addresses organization admins can connect Pulse to
An organization's owner or admin manages that organization's connections,
availability checks and email settings, but is not the instance operator.
Those routes connect from the Pulse server itself, so on a multi-org or
hosted install the address should not be one of the server's own.

Requests that RequireOrgAdmin or RequireOrgManager admit without instance
authority now carry a tenant outbound policy. Node, connection probe,
availability, TrueNAS, vCenter and SMTP destinations are refused with 403
when they are loopback, link-local, unspecified, multicast or a cloud
metadata address, and a host name is refused unless every address it
resolves to passes. Private networks stay allowed for shared-process
organizations and provider client runtimes, where tenants' systems sit on
the LAN or behind a VPN, and are closed on Pulse Cloud. Availability
checks are held to the policy whatever their observation locations, since
agent-only checks run on the server when the external probe entitlement
lapses.

The TrueNAS and vCenter clients also stop following redirects to another
host, matching the same-origin rule the Proxmox clients already apply; an
HTTP to HTTPS upgrade on the same host still follows.

Instance administrators, and so every single-tenant install, are not
affected.
2026-11-13 22:33:06 +00:00
rcourtman
d55beecdeb Report a failed container's last log lines, by local opt-in
On a default install Pulse can see that a container failed and not why.
The line that names the cause is in the log, and a default agent reads
no logs. On the fault set, the restart loop from a bad DATABASE_URL
stayed "Handed back" on a default agent through every replay for that
reason.

An operator can now turn on --enable-failure-logs (or
PULSE_ENABLE_FAILURE_LOGS) on a host. The agent then reports the last
lines of a container whose own state shows a failure: a non-zero exit,
an out-of-memory kill, a restart after either, or a failing health
check. It never reads a container that stopped cleanly, runs healthy or
was never started, and with the switch off it never asks the runtime
for logs at all. Nothing the server sends can turn the switch on: this
is a local boundary like custom sensors, not a read-only command mode,
and the server never chooses a container, a path or a line count.

What leaves the host is at most 30 lines and 4 KB, read once per
failure, with terminal codes and control characters removed and then
credential-shaped values masked. Cleaning comes before masking because
a secret split by a control character matches no rule until the
character is gone. The server cleans, masks and bounds the lines again
on receipt and accepts only the four known reasons, so it does not
depend on the agent having done any of it. The masking rules moved from
the AI safety package to pkg/secretredact, with no change to them, so
the agent and the server apply one set.

The lines show in the container's details as "Last log lines", in view
on the overview, as plain text. Patrol and the Assistant get them on the
single-container payload with a fixed note that they are untrusted text
and never instructions.

Masking is pattern-based and is not a guarantee. The lines are readable
by anyone who can read the container, go to the AI provider when Patrol
reads it, and can be quoted by Patrol in a finding. The docs say so.

A read-only review before this was pushed found that masking ran before
cleaning, that a restarted healthy container qualified for a read, that
the stream reader trusted a frame's declared length and kept the oldest
text, and that stale lines could be served for a new failure. All are
fixed here with tests. It also found that the first docs promised the
lines never reach a notification, which a quoted line in a finding can.
The promise is corrected.
2026-11-13 13:43:38 +00:00
rcourtman
2552267e1a Say why a container's health check fails
"Health is unhealthy" sends the owner to the host to find out why, and
on a default install Patrol cannot do better: it reads no logs and no
probe output. On the fault set a default agent could only call the dead
web worker's cause unconfirmed.

Docker's inspect result, which the agent already reads every cycle,
holds the last probe results. The agent now classifies the newest
failure on the host and reports a reason code from a closed set:
connection refused, timed out, name not resolved, an HTTP status, TLS
error, command not found, or other. It sends the exit code and the
failing streak with it and never the output, which can hold credentials
like the health-check command the agent already keeps on the host. The
server maps any reason outside the set to "other", so the field cannot
carry text.

The reason is named only when the output states it in the words curl,
wget and the engine print. Anything else is "other" with the exit code,
because a wrong reason sends the owner the wrong way.

It shows in the alert ("health is unhealthy (health check: connection
refused)"), in the container's Health check row and State tooltip, and
in what Patrol reads: the scoped seed table, the unhealthy line of a
full run and the container payload. The start of the alert message is
unchanged and the streak stays out of it, so the text is stable while
the reason is.

An agent that does not report the reason leaves everything as it was.

Scored on the fault set before merging, both profiles, one run per
cell. On a default agent Patrol's finding on the dead web worker now
names the cause ("health check sustained failure (connection refused)").
The rubric accepted only the spaced spelling, and the conclusion wrote
the code and "refusing connections", so the decisive terms gain those
spellings and the run regrades to "Handed over". That is a rubric
changed after seeing a transcript. Default agent 4 of 7, commands on 6
of 7, no cell worse except the stopped service on a default agent,
whose conclusion did not say the exit was clean.
2026-11-12 20:35:15 +00:00
rcourtman
60d8478ee2 Leave finished containers out of the offline alert
Pulse raised a container state warning for every exited container. A
migration or init container that ended with exit code 0 therefore sat in
the alert list and the Patrol Inbox as a problem waiting for a decision,
and its warning spent one of Patrol's four hourly looks at long-standing
alerts. Issue 1677 reported the same noise for TrueNAS init containers.

Exit code 0 alone cannot tell a finished job from a service that was
stopped gracefully, and the agent did not report what can: the restart
policy. It now sends Docker's policy name for every container. The state
check leaves a container alone when it exited 0, was not OOM killed, has
the policy "no" or "on-failure" (Docker leaves a clean exit down under
both) and ran for less than an hour.

The run time is there for a service that has no restart policy. It exits
0 when Docker shuts down for a host reboot and then stays down, and that
outage has to alert. Jobs run for minutes and services for days, so one
hour separates them; a container with no start or finish time is never
called finished.

Everything else alerts as before, including a container under "always"
or "unless-stopped" and any container whose agent is too old to report
the policy. An override that carries its own offline severity for a
container still alerts on a finished job, because it is an explicit
request to hear whenever that container is not running.
2026-11-12 08:43:09 +00:00
pulse-triage[bot]
7de796f72d Reject unconfirmed CLI action acknowledgements
Bind plans to their request and decisions/executions to the requested action before writing success JSON. Require explicit allowed/state, preserve replayed and in-flight outcomes, and advise audit inspection rather than blind POST retries.

Contract-Neutral: CLI-only validation of existing action response bindings and required outcome fields; no API schema, authorization, routing or server lifecycle change.
Change-source: pulse-maintainer
2026-11-11 16:44:05 +00:00
pulse-triage[bot]
628f2f0f85 Bind CLI capability results to the requested resource
Reject missing, blank and mismatched resource identities before reporting capability availability. Preserve bound resources with omitted, null or empty capabilities because the actual facets handler omits an empty capabilities field. Registered command regressions cover fixed and chunked envelopes, populated output, HTTP refusals, request identity and typed output. Same-origin TLS controls use the existing canonical empty facets wire shape without changing redirect policy.

Contract-Neutral: Enforce the existing resource binding in native capability reads; preserve matching capability output, optional empty facets, API schemas, authentication, grants, routes and execution behavior.
Change-source: pulse-maintainer
2026-11-11 15:47:15 +00:00
pulse-triage[bot]
a86648b84a Merge commit '49e4d34679fb22b82fefd3d6537498717cbe3089' into maintainer-async/20261111T143849Z-core-runtime/pulse
Change-source: pulse-maintainer
2026-11-11 14:40:15 +00:00
rcourtman
8cabf8c79a Start a stopped Proxmox guest from a commands-on agent (#4279)
Draft. Auto-merge is off. Scored once on a real Proxmox node at the
first commit. The two commits after it are not scored yet.

A node's own Pulse agent, installed with "Allow Pulse to run commands on
this host", can now start a stopped Proxmox guest after an admin
approves. It starts and does nothing else. Stop, shutdown and reboot
still need the action runner.

Before this, a guest action ran only through the action runner. Getting
one takes five steps, needs HTTPS and turns command access off on the
node. So Patrol handed a dead container back even on a commands-on node.

## What changed

**Agent.** The collector could not run a typed command. Its transient
systemd unit was bound to `pulse-agent-runner.service`, used the
runner's state directory and started a launcher only the runner binary
serves.

- The collector binary serves the launcher for its own catalog only: the
containment probe, `pct|qm status <vmid>` and `pct|qm start <vmid>`.
- The unit is bound to `pulse-agent.service` and its result file lives
in the collector's state directory. Every other unit property is the
runner's. A test compares the two argument lists and allows only
`BindsTo`, `After` and `PartOf` to differ.
- The collector names its units `pulse-agent-collector-action-*`, so
neither supervisor's start-up reconciliation can stop the other's units.
This is a third difference. It is a name, not a containment property.
- The collector refuses stop, shutdown and reboot in three places: its
manager, its command boundary and its launcher.
- A commands-off collector builds no containment and refuses the typed
message.

**What the agent reports.** `proxmox_guest_start_version: 1` at
registration, only when all of these hold: commands enabled, a Proxmox
node (`pct` or `qm` present), root, running as `pulse-agent.service`,
durable receipts, containment probe passed. Otherwise
`proxmox_guest_start_unavailable` with `not_systemd_service` or
`containment_unavailable`. On a host that is not a Proxmox node it
reports nothing and logs nothing.

**Server.** The dispatch gate allows a collector session `start` and
nothing else. The executor routes to the node's runner first, then for
`start` to the node's own command session. It decides from the reported
field, never from an agent version.

**Which agent.** A start goes only to an agent Pulse has evidence runs
on the guest's own node (`tools.GuestNodeAgentFor`). All of these must
hold:

- Exactly one agent is tied to the node.
- The node is on the guest's own Proxmox connection, under the guest's
own node name.
- The agent carries the node's name, and no other node Pulse monitors
does.
- One of the agent's own interfaces holds an address that Proxmox itself
lists for that node and for no other node.

Three things are not evidence. The link, because Pulse links an agent to
a node on a sole matching hostname. The address Pulse dials, because it
can be a reverse proxy on another host. The agent's configured report
address, because it is a setting. A hostname never selects the agent.
Anything less is refused with `guest_start_agent_unconfirmed`.

This is evidence, not proof of the machine. See "Known limits" below.

**Which agent versions qualify.** None released so far. The first
release that carries this change, and later. An older agent gets "the
Pulse agent on that node is too old. Update the Pulse agent on pve1,
then try again."

**Verification.** A start an agent session ran is confirmed only by
Pulse's own Proxmox API check. The agent's readback stays on the result
as evidence with `independent_observation_required`. This is tighter
than the runner path, which is unchanged.

**Approval.** Unchanged: `MinimumApprovalLevel` admin, no automatic
authorization.

**Not only Patrol.** The executor is shared, so anything that plans a
guest start through the action API takes the same route, with the same
approval and the same check. The web UI has no Start button for a
Proxmox guest today.

## What a refused action says

| Case | Code | Sentence |
|---|---|---|
| Stop, shutdown, reboot, no runner | `action_runner_unavailable` |
Pulse cannot stop or restart guests on pve1: that needs the Pulse action
runner on that node. "Allow Pulse to run commands on this host" covers
starting a stopped guest only. Use Proxmox for this. |
| Start, commands off | `host_commands_disabled` | Commands are not
enabled on the Pulse agent on pve1. To allow them, run the Pulse install
command on pve1 again with "Allow Pulse to run commands on this host"
ticked. |
| Start, agent too old | `guest_start_agent_update_required` | Pulse
cannot start guests on pve1 yet: the Pulse agent on that node is too
old. Update the Pulse agent on pve1, then try again. |
| Start, not a systemd service | `guest_start_unavailable` | Pulse
cannot start guests on pve1: the Pulse agent on that node does not run
as the pulse-agent systemd service, and Pulse starts a guest only
through one that does. Use Proxmox for this. |
| Start, containment failed | `guest_start_unavailable` | Pulse cannot
start guests on pve1: the Pulse agent on that node could not set up the
contained way it runs a start. Its log says why. Use Proxmox for this. |
| Start, no agent takes commands | `guest_start_agent_not_connected` |
Pulse cannot start guests on pve1: no Pulse agent that accepts commands
is connected on that node. Use Proxmox for this. |
| Start, agent not confirmed on the node |
`guest_start_agent_unconfirmed` | Pulse cannot start guests on pve1: it
cannot confirm which Pulse agent runs on that node. It needs an address
that the agent reports and only that node has. Use Proxmox for this. |

The Patrol catalog (`patrolActionBroker.Capabilities`) shows `start` as
runnable on a capable node and does not show the other three there. The
Patrol page row is now "Can't start guests". The installer checkbox says
what it covers.

## Two things checked in code

**How command messages are protected on plain HTTP.** They are not.

- The agent sends its credential in the first frame (`sendRegistration`,
`internal/hostagent/commands.go`). On `http://` that is clear text. The
collector allows plain HTTP on local networks.
- Messages are not signed. The one signed thing is the approval grant on
a shell command the policy marks approval-required. Its key is
`sha256(prefix + token)` (`internal/agentexec/approval_grant.go`), so
anyone who read the credential can forge it. A `trusted` flag in the
message skips the grant.
- A typed guest message carries a digest of its own fields with no key.
- So someone who can change traffic on that path already has a root
shell on a commands-on node. A start request adds nothing to that.
- Someone who holds the credential can hold the node's session and
answer "started" without starting. That is why only Pulse's own Proxmox
check confirms the start.

**Whether anything else refuses the request on a commands session.** One
thing did, and it was the agent.

- Server: the gate and the executor's runner lookup. Nothing in
`internal/actionlifecycle` asks for a runner.
- Receipts: the collector opens the same receipt store, so admission
passed.
- Policy: `internal/agentexec/policy.go` is not consulted for a typed
message. It is untouched.
- Agent: typed containment was runner-only in three places (unit
binding, state directory, launcher). The first `pct status` read failed
and nothing started. This PR changes that for status and start only.

## Bounds, and where I read one differently

- Start runs in the `proxmox-handoff` catalog on the runner, because
Proxmox takes the guest's processes into its own scope. So the collector
serves that catalog for `start` only (not `pct reboot`), with the
runner's exact properties. The brief said handoff stays runner only.
Start cannot run any other way, and no property is looser than the
runner's.
- The collector's unit name prefix differs from the runner's, as above.
- The command session does not wait for the containment probe more than
five seconds. Containment waits on systemd without a limit of its own,
and a stuck probe must not keep shell commands and Docker actions from
connecting.
- `internal/ai/patrol_guest_lifecycle_test.go` pinned the old sentence
in two places. I changed those two fixtures and nothing else in that
file.
- The commit guard wanted a registered proof to exercise
`InfrastructureInstallerSection.tsx`. The real render test now asserts
the new checkbox sentence, and one source-text pin that test already
covers was deleted from the registered file. No pin was added.
- A start is runnable for every stopped guest on a capable node. The
third commit asks Proxmox who stopped the guest before anything is filed
or proposed. See "Who stopped it".

## Second review

After the first push I had the diff reviewed again and fixed what it
found. Seven rounds, each finding verified in code first.

- **Wrong machine.** The first version followed a hostname. Later
versions trusted a link, the dialled endpoint, the agent's report
address and a private address under a shared name. Each could reach a
machine that only shares the node's name or sits in front of it. The
rule under "Which agent" above is the result.
- **No settings step for an unconfirmed agent.** An agent Pulse cannot
confirm gets the unconfirmed sentence even when it reports commands off.
Nobody is told to switch commands on for an agent that may sit on
another machine, for a start that would still be refused. The catalog's
separate commands-off fact is unchanged: it is about running commands
for the resource at all and follows the read route, as on main.
- **Verification rule from a stale route.** A route planned on the
runner now demands a runner at dispatch
(`agentexec.RequireActionRunnerSession`). A collector that took the
runner's place under the same agent ID is refused, so its answer is
never judged by the runner's rule.
- **Service check.** The agent's cgroup must be exactly
`/system.slice/pulse-agent.service`. A user manager's unit of that name
no longer passes.
- **Containment per process.** The agent replaces its command client
when commands are switched. Every client of one state directory now
shares one containment, so a new client cannot prepare again while an
old client's start is finishing.
- **Late readiness.** A registration waits at most five seconds for the
probe. If the answer changes afterwards, the agent restates it on the
live session with an `agent_capabilities` message on its ping tick. The
session is not dropped.
- **Docs.** Several sentences claimed more than the code did. They now
match.

## Known limits

These fail closed with the unconfirmed sentence:

- A node whose network inventory Pulse cannot read through the Proxmox
API.
- Two monitored nodes with the same name. Neither can have a guest
started through its agent.
- A machine monitored through two connections: guests seen through the
connection its node record does not carry.

Not ruled out: a machine that Pulse does not monitor as a node, carries
the node's name and holds one of the node's addresses. Closing that
takes the node proving its own Proxmox identity, for example the agent
reporting the local Proxmox API certificate fingerprint for Pulse to
compare with the one it sees on the API. That is an agent change of its
own and is not in this PR.

Not changed: the action runner's own node lookup still follows a unique
hostname, as before this PR. The same reasoning applies to it and it is
a separate change.

## Who stopped it

Scoring on a real node found that a guest a person stopped got a start
proposal that did not say a person stopped it. The stopped-guest check
files on any running to stopped move unless Pulse ran the stop, and this
PR makes start runnable on many more nodes. The second commit fixes
that.

Pulse now reads the node's task log for the guest once, through its own
Proxmox API connection, when it first sees the stop
(`internal/ai/findings_proxmox_stop_cause.go`). Of the stop, restart and
start tasks that bear on the stop, the last to begin decides.

| What the log shows | What Pulse does |
|---|---|
| A stop task last: `qmstop`, `qmshutdown`, `qmsuspend`, `qmrollback`,
`vzstop`, `vzshutdown`, `vzsuspend`, `vzrollback`, `hastop` | No
finding, no investigation, no start proposal. Logged at debug with the
task and user. |
| No such task, or a start that worked last, in a log read in full |
Finding. It says the guest was not stopped through Proxmox. Evidence
carries `stop_cause=no_stop_task`. |
| A restart or a failed start last | Finding. It names the task.
`stop_cause=restart_task`. |
| The log was not read in full | Finding. It says Pulse cannot tell
whether a person stopped the guest, with the reason.
`stop_cause=unknown`. The start proposal's reason gets the same
sentence. |

A read is not full when the request failed, 200 rows came back, or
Pulse's access is not confirmed to hold `Sys.Audit` on `/nodes/<node>`.
Without that permission Proxmox answers with the caller's own tasks and
no error, so an empty answer alone proves nothing. A stop task seen in
such a read decides nothing either, because a later start may be hidden.

A stop Pulse ran after an approval is still recognized from the action
audit first, without reading the log.

The Proxmox user who ran a task is written to the debug log line and
nowhere else. A finding, the scan seed, a tool result and a proposal
reason can each reach a model provider, so none of them names the user.
A test holds that.

**The model's own path.**

- The scan seed lists each guest Pulse saw stop, with what the log said.
- An alert run on a guest somebody stopped is told so. It is not told
which actions Pulse could run or that the guest starts on boot.
- No finding is opened from the powered-off alert of such a guest.
- `patrol_report_finding` refuses a reliability finding about a guest
being down while Pulse has accounted for the stop. That ends the
duplicate: one dead guest gets one finding and one start approval. It
reads the report's key and title only, so a missing backup or a failing
replication on the same guest is still filed. A model that words the
stop in a way the lists miss still files a second finding.

**The proposal reason.** `patrolActionBroker` appends "Pulse could not
read the node's task log, so it cannot tell whether a person stopped
this guest. Check that before you approve a start." to a start that
answers a finding with an unknown cause. It is added once, on plan and
on submit.

**What each Proxmox action logs.** Read from the installed source of
Proxmox VE 9.2, not exercised:

- VM pause is `qmpause`. The guest stays running, so nothing is seen.
- VM hibernate is `qmsuspend`. It counts as a stop. The VM also carries
a lock, which the check already skips.
- Container suspend is `vzsuspend`. It counts as a stop.
- A stop or shutdown of an HA guest is `hastop` by the user, then the HA
manager's own `qmshutdown` or `vzshutdown`. Both count.
- A stop-mode backup of a VM runs `qm shutdown`, which logs
`qmshutdown`. Of a container it stops the guest inside the `vzdump` task
with no stop task. The guest is locked for the length of the backup,
which the check already skips.

**Limits.**

- A person who shuts a guest down from inside it leaves no task. That
reads as "not stopped through Proxmox" and a start is proposed. The
words say "from inside the guest or it failed", not "by itself".
- The cause is held in memory. After a restart a deliberately stopped
guest is still quiet in the check, which needs a running observation
first, but the model's path no longer has the note.
- A shutdown that began more than two hours before Pulse last saw the
guest running is missed.
- A second review of this part ran three rounds. Its findings are fixed
except one I left: if a finding's cause changes between the plan and the
submit of one proposal, the submit is refused.

## Issue 4249

Not part of this. It makes the systemd half of that fix small: a
collector now has its own supervisor, unit binding and launcher. It does
not settle whether a monitoring-only collector should start a root
transient unit for a read-only `apt-get -s`, or what a host without
systemd gets.

## Tests

Run on pulse-dev through `pulse-dev-validate`, on the final tree of all
three commits.

- Whole packages: `internal/hostagent`, `internal/agentexec`,
`internal/ai`, `internal/ai/tools`, `internal/actionlifecycle`,
`pkg/aicontracts`, `pkg/proxmox`, `internal/mock`: ok. No existing agent
test file was changed.
- `internal/monitoring`: the new task-read tests pass. The whole package
ran past Go's default ten-minute limit on pulse-dev just after its
reboot, with no test hung. It runs in CI.
- Under the race detector: the new agent tests, the server session tests
and the stopped-guest watcher tests: ok.
- `internal/api`: the Proxmox, Patrol catalog, broker, guest start and
proposal note tests: ok. The full package runs in CI.
- `cmd/pulse-agent`: the whole package passed at the first commit (272
s). Not rerun. It is unchanged since.
- Vet on every touched package, on Linux and for macOS. The agent builds
for Linux, macOS, Windows and FreeBSD.
- Frontend: 30 test files, 369 tests, ok. Types, lint and format, ok.
- Docs: the Python docs tests, ok.
- Browser, first commit: private mock Pro stack on pulse-dev at 1440 and
390, dark and light.
- Browser, second commit: the same stack rebuilt. As served, the
commands row names every mock node and "Can't start guests" is absent.
The row was seen by rewriting the start refusal for three nodes, one of
them with the new unconfirmed code. Each commit has its own receipt.
- Mock data: every mock node listed the same address, so the new rule
refused all 45 mock nodes as unconfirmed. Mock nodes now have their own
addresses and each node's agent reports them. After that the real server
confirmed every mock agent and said commands off, which is the rule
passing through the whole server path on mock data.

The pre-commit hook passed on pulse-dev with the real guards for each
commit.

Not run: a real Proxmox node for the two new commits, a model. The first
commit was scored on a real node by the orchestrating session.

## To qualify the agent build on a node

1. Build both from this branch on a Linux box:
- `CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pulse-agent
./cmd/pulse-agent`
- the server as usual. It must be this branch too, or the gate refuses.
2. Install the agent on the node with the published installer and "Allow
Pulse to run commands on this host" ticked, so the unit, the credential
and `--enable-commands` are the real ones. A server built without
signing keys cannot serve the agent download.
3. Swap the binary: `systemctl stop pulse-agent`, then `install -o root
-g root -m 0755 pulse-agent /usr/local/bin/pulse-agent`, then `systemctl
start pulse-agent`. It must stay root-owned and not group or world
writable, or containment refuses it.
4. A plain build reports version `dev`, which turns the agent's
auto-update off, so the swapped binary stays.
5. Look for "Typed action containment is ready" in `journalctl -u
pulse-agent`. A warning "cannot start Proxmox guests" names the reason
instead.
6. While a start runs, `systemctl list-units
'pulse-agent-collector-action-*'` shows the unit.

## Enterprise

rcourtman/pulse-enterprise#270 changes the investigation prompt's
wording to match. It is its own draft, pins this branch's head and
merges after this one.
2026-11-11 14:08:54 +00:00
pulse-triage[bot]
49e4d34679 Reject incomplete and unbound CLI action history responses
Do not invent empty action history or overwrite a missing response identity after a successful HTTP status. Require explicit collections and counts, verify the count and requested action/resource binding, and preserve canonical arrays and legacy null-empty responses. Registered command tests exercise fixed/chunked envelopes, valid output, HTTP refusals and request identity without retries. Positive TLS redirect fixtures return the existing canonical history schema; redirect, bearer and caller-policy assertions stay unchanged.

Contract-Neutral: Enforce existing action history response collections, counts and request identities in CLI reads; preserve valid output, null-empty compatibility, API payloads, grants, filters and execution behavior.
Change-source: pulse-maintainer
2026-11-11 13:37:28 +00:00
pulse-triage[bot]
ea83022b25 Return canonical fleet data in CLI TLS redirect controls
The positive same-origin TLS fixture must return the real connections envelope after the CLI stops inventing an empty inventory. Supply an explicit empty array only for the fleet read; keep every redirect, TLS trust, bearer, body, request-count and client-policy assertion unchanged. The two failures at 48d4b1014d remain retained evidence.

Contract-Neutral: Correct only the positive test fixture to the existing connections envelope; no runtime, authority or TLS contract changes.
Change-source: pulse-maintainer
2026-11-11 12:42:37 +00:00
rcourtman
07fca008ba Ask Proxmox who stopped a guest before proposing a start
With a commands-on agent able to start guests, the stopped-guest check
applies to far more nodes. It filed a finding for every guest that went
from running to stopped unless Pulse itself had stopped it. So a guest
somebody stopped in the Proxmox UI became a warning, a model
investigation and a request to approve starting it again, with nothing
saying a person had stopped it.

Proxmox knows the difference. Every stop that goes through it is a task
in the node's log with the user who asked. Pulse now reads that log for
the guest once, through its own Proxmox API connection, when it first
sees the stop.

- A stop, shutdown, suspend, rollback or HA stop task that nothing
  started the guest after: somebody did this on purpose. No finding, no
  investigation, no start proposal.
- No such task in a log read in full: the finding says the guest was
  not stopped through Proxmox.
- A restart or a failed start last: the finding names it.
- A log Pulse could not read in full: the finding stays and says Pulse
  cannot tell whether a person stopped the guest. The reason an admin
  reads before approving the start says the same. Proxmox answers a
  caller without Sys.Audit on the node with its own tasks only and no
  error, so an empty answer counts only when that permission is
  confirmed. Unknown is never taken to mean nobody stopped it.

The model's own scan gets the same fact. Its seed lists each guest Pulse
saw stop with what the log said, an alert run on a deliberately stopped
guest is told so, and no finding is opened from that guest's powered-off
alert. A reliability finding about a guest being down is refused while
Pulse has already accounted for the stop, which ends the second finding
and second start approval a model filed for one dead container.

The Proxmox user who ran a task is logged at debug and goes nowhere
else. Findings, the seed and tool results can reach a model provider, so
none of them names the user.

Not covered: a guest shut down from inside leaves no task and reads as
not stopped through Proxmox. The cause is held in memory, so the model's
note is gone after a restart.
2026-11-11 12:40:57 +00:00
rcourtman
4fe00744ba Send a guest start only to an agent confirmed on its node
The first commit on this branch let a node's own Pulse agent start a
stopped Proxmox guest, and chose that agent by hostname. Another
machine can hold a node's name, and the same VMID there is a different
guest. A second review of the branch found that and the faults below.

Which agent. A start now needs all of this, or it is refused with
guest_start_agent_unconfirmed: exactly one agent tied to the node, the
node on the guest's own Proxmox connection under the guest's own node
name, the agent carrying the node's name with no other monitored node
of that name, and an address on one of the agent's own interfaces that
Proxmox lists for that node and for no other. The link Pulse makes on a
matching name is not evidence, nor the address Pulse dials, which can be
a proxy, nor the agent's configured report address. This is evidence and
not proof: a machine Pulse does not monitor as a node, with the node's
name and one of its addresses, is not ruled out. An agent Pulse cannot
confirm is not told to switch commands on either, because the start
would still be refused.

Runner routes. A route planned on the action runner now demands a runner
at dispatch. A collector that took the runner's place under the same
agent ID is refused, so its answer is never judged by the runner's rule.

Agent side. The service check is the exact cgroup
/system.slice/pulse-agent.service, so a user manager's unit of that name
no longer passes. Every command client of one state directory shares one
containment, so a client created when commands are switched cannot
prepare again while an old client's start is finishing. A registration
waits five seconds for the containment probe, not fifteen, and a later
change is restated on the live session with an agent_capabilities
message.

Mock data. Every mock node listed the same address and its agent
reported an unrelated one, so the new rule refused every mock node's
agent as unconfirmed. Mock nodes now have their own addresses and each
node's agent reports them, as on a real node.

Docs said more than the code did in several places. They now match.
2026-11-11 12:35:49 +00:00
pulse-triage[bot]
48d4b1014d Reject unknown fleet inventory in CLI reads
The canonical connections handler emits an explicit array, including [] for an empty scope. The CLI instead converted null or missing inventories into a successful empty fleet. Return a response error before writing JSON and preserve valid empty/populated output, request authority and existing HTTP error handling. Registered command tests cover fixed and chunked HTTP responses, response errors and forward-compatible row fields.

Contract-Neutral: Preserve the existing connections array schema and valid CLI output; reject missing or null inventories instead of inventing an empty fleet.
Change-source: pulse-maintainer
2026-11-11 12:35:15 +00:00
rcourtman
0140328072 Start a stopped Proxmox guest from a commands-on agent
Pulse could start, stop or restart a Proxmox guest only through a
separately enrolled action runner. Getting one takes five steps, needs
HTTPS and turns command access off on the node. So when a container
died, Patrol handed it back even on a node whose owner had ticked
"Allow Pulse to run commands on this host".

A node's own Pulse agent can now start a stopped guest, after an admin
approves. It starts and does nothing else: stop, shutdown and reboot
stay with the action runner, refused on an agent session by the server
gate, by the executor and by the agent itself.

The agent could not run a typed command at all. Its transient systemd
unit was bound to the runner's service, used the runner's state
directory and started a launcher only the runner binary serves. The
collector now serves that launcher for its own catalog (the containment
probe, a status read and a start), binds the unit to its own service and
uses its own state directory. Every other unit property is the
runner's. The runner's path is unchanged.

The server decides from what the agent reports at registration, never
from a version. The agent reports it only with commands enabled, as
root, running as pulse-agent.service on a Proxmox node, with durable
receipts and a passed containment probe. Otherwise it gives a closed
reason and Pulse says which it is: commands off, agent too old, not a
systemd service, or containment not set up.

A start an agent session ran is confirmed only by Pulse's own Proxmox
check. The agent's readback stays as evidence and no longer confirms.

No installer change, no default change, no new scope, no telemetry.
2026-11-11 09:12:40 +00:00
pulse-triage[bot]
2eee21630d Keep interactive configuration backup prompts off stdout
Send passphrase prompts and confirmation diagnostics to stderr, respecting each command's configured diagnostic writer, so a redirected interactive export remains an importable encrypted archive. Exercise confirmation/read failures, silent env and flag paths, and actual interactive export/import with saved scoped access.

Contract-Neutral: Native CLI human passphrase stream correction only; archive encryption and format, command flags, env/flag precedence, terminal password reading, saved formats and authority, HTTP responses and frontend states are unchanged.
Change-source: pulse-maintainer
2026-11-11 05:26:35 +00:00