Commit Graph

2073 Commits

Author SHA1 Message Date
rcourtman
72bfeee246 Let a paid community install switch to the Pro runtime
A paid key activated on the public community build unlocks only the
licence-gated features compiled into that build. Patrol modes, container
update risk, Audit, RBAC and Reporting need the private Pulse Pro
runtime, and the only way to get it was the download portal. Licence
data from 14 October shows 6 of 36 v6 buyers and 39 of 109 migrated v5
licences still running only the community build.

GET /api/updates/pro-runtime reports whether this install can switch,
and POST /api/updates/pro-runtime/apply performs it. The license server
download broker decides eligibility from the activation's licence, the
same broker the Pro binary already updates from, so a refusal there
reads as not_eligible and any other failure as unavailable. Without an
activation the check answers not_activated without a network call.

The in-place switch is limited to systemd and Proxmox LXC installs. It
runs through ApplyUpdate with an explicit SwitchToProRuntime flag, so
ordinary community updates never take the broker path. It accepts the
Pro build of the running version or newer, refuses an older pin, and
keeps the signed-archive, hash, self-test, backup and history-rollback
steps of a normal update. Docker installs get the broker's
digest-pinned image commands instead. The Settings card that uses these
routes follows separately.
2026-10-14 18:20:02 +01:00
rcourtman
4f14ad6ab9 Use one primary CPU temperature rule everywhere
Three rules chose a node's single CPU temperature. Node history took
CPUMax first, agent history took cpu_package first, and the node drawer
recomputed the maximum of package, CPUMax and every core in the
browser. On an agent-fed node CPUMax is built from cores alone and can
sit below the package, and elsewhere a core can run above the package,
so the drawer's CPU temperature headline could disagree with the line
drawn beneath it and with the History tab. Node alerts and the CPU
low/record tracking used yet another package-first rule.

models.PrimaryCPUTemperatureCelsius is now the one rule: the hottest
usable package, CPU-maximum or core reading, with a sensor-map form for
agents. Node and agent history, the router's live fallbacks, the
unified resource temperature, node temperature alerts and the CPU
low/record tracking all call it. The drawer reads the resource value
through a new Node.cpuTemperature field instead of recomputing it, and
getCpuTemperature is removed.

Mock mode wrote a second package reading under a cpu.package key into
every agent host, including node-linked ones, from a series unrelated
to the node's static reading. A node and its linked agent now carry one
reading, sampled from the agent's series under the agent's real keys,
and both histories seed from that series, so the current reading
continues the line.
2026-10-13 20:15:36 +01:00
rcourtman
49b7abc860 Honour recurring and descendant maintenance in Patrol findings
Patrol's operator-state projection dereferenced the one-shot
MaintenanceStartAt/EndAt whenever IsInMaintenanceAt was true. A
recurring window also reports active but leaves those fields nil, so
the first finding Patrol evaluated during a recurring occurrence
panicked the provider. The projection now takes its bounds from the
active occurrence.

Alerts already silence guests under a host window scoped to
resource_and_descendants, but Patrol read only the exact resource, so
the same planned work dismissed a guest's alerts and still raised its
Patrol findings. Both now resolve maintenance through one rule,
unifiedresources.ActiveMaintenanceCoverageAt: own window plus
descendant-scoped ancestor windows, latest active end wins. Only
maintenance is inherited; monitoring mode, lifecycle and remediation
locks stay exact-resource state. An inherited dismissal says the window
is on a parent resource and names it on the lifecycle event, and the
Manage help now says descendants' new Patrol findings are dismissed
too.
2026-10-13 12:58:17 +01:00
rcourtman
3d322ff3a8 Stop timing the route normaliser rows that flip with layout
The advisory Benchmarks check failed #2884 on NormalizeRoute/with_uuid
alone, +12.25% (p=0.000), though that PR changed only AI handler code.
It was not the only one. Since the bounded route scanner landed on
9 October (01788459f1), normalizeRoute takes 30-180ns a path on CI runners. In 72
paired CI comparisons that measured internal/api from then until 13
October, the BenchmarkNormalizeRoute rows and their parallel variant
failed the gate 17 times. None of those PRs touched route code, and 6
of the 17 failures did not involve with_uuid: deep_path_truncated,
with_query_params, metrics_history, with_numeric_id and Parallel each
crossed 10% too. with_uuid moved past 10% in 21 of the 72 comparisons,
in both directions.

This is the same layout effect that retired the "/" fast path (#2255)
and NormalizeSegment (#2258). Go aligns functions to 32 bytes, so code
added earlier in the package moves normalizeRoute between the halves of
a 64-byte block. That changes its loops by a cycle per iteration. Every
path shares those loops, so retiring with_uuid alone would leave the
other rows failing. Summed over all six paths, a mixed-path row would
still have moved up to 10%.

BenchmarkNormalizeRoute and BenchmarkNormalizeRoute_Parallel are
removed. Their allocation columns never varied, and they are now pinned
by TestNormalizeRoute_LabelAllocationProfile. For each former path it
requires exactly one allocation, of the same size as a fresh copy of the
label. It runs in the existing isolated child process and takes the
lowest of three windows, so one stray runtime allocation cannot fail it.
BenchmarkFullMiddlewarePath still times the normaliser inside the
request path, with a CI maximum of +8.4% over those 72 runs, and
BenchmarkNormalizeRoute_DiscardedSuffix still times a long discarded
suffix. Gross classification slowdowns are left to those rows: a
doubled UUID scan has no deterministic signal, and the retired row
could not separate one from layout.

Proofs, on pulse-dev with the CI runner narrowed to ./internal/api/ at
30 samples. The probe is an unrelated init-time function in a file
sorted before http_metrics.go. It moves normalizeRoute from 32 to 0 mod
64 in the test binary without changing its size:

- old tree vs old tree plus probe: with_uuid -14.70% (p=0.001). Read the
  other way, as a PR that removes the probe, the gate exits 1 on
  NormalizeRoute/with_uuid alone, +17.23% (p=0.001). That is #2884's
  shape.
- new tree vs new tree plus probe: gate exits 0 in both directions. On
  a first run under load 9-15, three millisecond-scale rows that run no
  route code flagged at p=0.025-0.046 with spreads of 15-38%. The
  repeat came back clean in both directions.
- mutation controls on the final test: sizing the label buffer at twice
  the label fails only the new test. The existing at-most-one-allocation
  test passes it. Joining the label through an intermediate fails both.
- the route tests pass 20 times plain and 10 times under -race.
2026-10-13 10:25:33 +01:00
rcourtman
c31445e2e1 Default Pro Patrol to Ask first until a mode is chosen
Pro sells Patrol investigation, but every install starts in Watch only
and stays there unless the operator finds the mode control. In the paid
telemetry read on 12 October, 20 of 35 Pro installs with Patrol on ran
Watch only, and none of those 20 ran an investigation in 30 days, so
the feature they paid for never ran.

An install that never saved a Patrol mode now runs Ask first when it
holds a positive investigation licence. Patrol investigates new and
re-detected warning and critical findings and proposes a fix; nothing
changes without approval. The default only applies to a positive
licence answer: a missing licence checker counts as unlicensed, so a
startup window cannot spend provider budget on a free install. Free
installs and explicit choices are unchanged.

The Patrol header says so once, with the cost (the operator's AI
provider and 30-day budget) and two actions that save Ask first or
Watch only. The notice never renders on a plan-locked install. The
header also stops claiming "Watching your infrastructure" while Patrol
cannot run yet and reads "Patrol is not running yet" instead.
2026-10-12 21:00:52 +01:00
rcourtman
8cff7de026 Restore Patrol's Safe auto-fix and Autopilot modes
Reverts #2863 before any release ships it. The live Pro pricing and
Patrol pages, in English, German and Spanish, sell both modes ("applies
safe fixes in the mode you choose: Ask first, Safe auto-fix, or
Autopilot"), and paying installs chose them. Shipping the retirement
would have silently downgraded those installs while the sales page still
promised the modes.

If the modes are retired, that needs a dated notice: stop selling them
first, warn installs on those modes in-app, and then re-ship the change.
It should not arrive through an engineering cleanup.

The receipt #2863 landed stays in place; this commit adds the receipt
for the restored content.
2026-10-12 14:13:47 +01:00
rcourtman
afc4c9275d Retire Patrol's Safe auto-fix and Autopilot modes
Patrol could run some fixes on its own in two paid modes: assisted (Safe
auto-fix) and full (Autopilot, behind a server-owned acknowledgement).
Schema-v17 telemetry for the week to 2026-10-11 counts 1 assisted and 2
full installs out of 612 reporting Patrol, 4 executed Patrol actions in
30 days, all on one install, and no GitHub request for more autonomy,
while the automatic path carried its own policy leases, acknowledgement
store, per-resource allowlist, release gate and Colima lab. Investigation
is what paid installs use, so it stays.

Patrol now has two modes. Watch only reports findings. Ask first
investigates and proposes fixes, and every fix waits in Actions for an
operator to approve and run it.

- A saved assisted, full or autonomous level reads as approval, and the
  update routes refuse those levels with 400 invalid_autonomy_level.
- The core Patrol action broker only plans: Plan and Submit persist the
  plan and return. ExecuteUnderPolicy, the policy authorization lease,
  the policy admission store methods, the Autopilot acknowledgement
  persistence, routes and dialog, and the per-resource automatic-action
  allowlist (store column now written as NULL) are gone.
  GetPatrolFullModeUnlocked stays on the extension contract and reports
  false.
- Historical action records keep their policy lease and tenant/resource
  reason codes decodable, labelled as retired modes.
- The Patrol inbox no longer splits issues into "continuing without a
  decision"; every current issue is an operator decision.
- Release gate RG-06 now proves Patrol never executes without an operator
  decision (integration tier) instead of limited unattended autonomy,
  and RG-02/RG-04 point at the surviving human-admission proofs.
- Pro plan copy, AI docs, privacy telemetry wording and the subsystem
  contracts describe the two modes.
2026-10-12 11:52:11 +01:00
pulse-triage[bot]
123652e29b Preserve reviewed monitoring repairs with upstream Discovery removal
Compose current main e2f4bdff03 additively. Retain both subsystem records and the held change-age control while withdrawing only the obsolete Discovery identification test. Reviewed identities and ancestry, canonical guest History ownership and upstream feature removal remain intact.

Change-source: pulse-maintainer
2026-10-12 10:04:58 +01:00
rcourtman
39f988b220 Remove AI Discovery
AI Discovery ran a separate model-backed service scanner beside Patrol
and the Assistant: its own store, scheduler, model route, API, tool and
drawer UI. No telemetry counter ever measured its use (the telemetry
discovery_enabled flag OR'd it with network subnet discovery), the
maintainer judged it a flop, and the context it produced is already
available to the models through pulse_query, pulse_read and the
unified-resource context sections.

This deletes internal/servicediscovery, internal/ai/infradiscovery, the
pulse_discovery tool, the /api/discovery routes, the mock Discovery
fixtures, the Discovery tabs in the resource, guest, node and Docker host
drawers, the identified-service cards, readiness badges, provenance
markers, suggested web-interface URLs, the Workloads AI Context column,
the chat "Discovery is off" hint and the AI Service Context settings page.
The old settings route redirects to Assistant settings. The model-bound
sanitizer allow-list existed only to pass Discovery context through, so it
goes too, along with the CopyableCodeRow primitive that only the
Discovery tab used.

Network subnet discovery (/api/discover, the Infrastructure discovery
settings) and the discoveryTarget agent coordinates are separate features
and stay. Stored discovery_enabled, discovery_interval_hours and
discovery_model AI settings are ignored on load; the settings API decoder
is lenient, so older frontends saving those fields still succeed.
2026-10-11 22:20:25 +01:00
pulse-triage[bot]
b737fb1a3d Reconcile reviewed maintenance with current token-visibility repairs
Preserve every accepted maintenance commit while incorporating human-authored diagnostics token visibility. Resolve API guide overlap by retaining the shared ai:execute narration gate, explicit deterministic fallback and CSV refusal in both mirrors.

Change-source: pulse-maintainer
2026-10-11 21:08:36 +01:00
rcourtman
74504427df Show diagnostics callers only the API tokens they may manage
/api/diagnostics is readable with settings:read and lists the whole token
inventory: every token's ID, name, timestamps, key hint and which agents
use it, across organizations. A token bound to one organization could
read the other organizations' credential metadata, which the token
management endpoints already refuse to show it.

The diagnostics result is computed once per organization scope and cached
for every caller, so the filter runs after the cache: an API-token caller
that is not instance-wide gets an API token section rebuilt over the
tokens callerTokenMayManage allows, with counts, notes and agent usage
computed over that view. Instance-wide tokens and browser sessions get the
full section, and the cache itself still holds the full result.

Tests cover the builder (tokens, counts, usage) and the handler on the
cached path, including that a scoped caller served from the cache does
not change what the next caller sees. Each filter fails when removed.

Contract-Neutral: Behavioural fix that applies the token visibility rule to diagnostics; no new API surface or contract.
2026-10-11 20:29:30 +01:00
pulse-triage[bot]
ca1bb7d3be Integrate reviewed report narration permission guidance
Change-source: pulse-maintainer
2026-10-11 19:53:57 +01:00
pulse-triage[bot]
70d927409a Reconcile launch upstream report and token scope repairs
Change-source: pulse-maintainer
2026-10-11 19:53:54 +01:00
rcourtman
fb9c734bac Require ai:execute for AI narration of reports by token (#2836)
Reports are readable with `settings:read`, but a `POST` report can
narrate with the tenant's Pulse Assistant, a paid provider call recorded
in the cost ledger. Any token holding `settings:read` could therefore
spend that budget, while every other AI-spending route needs
`ai:execute`.

An API token now needs `ai:execute` for AI narration, on single-resource
reports and on fleet reports. Without it the report is still produced,
with the deterministic summary and a note explaining why. Browser
sessions and scheduled reports are unchanged, and `GET` keeps narrating
deterministically.

`report_ai_narration_scope_test.go` covers a session, a `settings:read`
token, a token with `monitoring:read` as well, an `ai:execute` token and
a full-access token on both handlers, and fails when either handler
ignores the gate (each handler is covered separately). The existing
contract test for the GET/POST rule still passes.
2026-10-11 19:36:09 +01:00
rcourtman
581df77438 Keep token management inside the caller's organizations (#2837)
The API token inventory is global, but only token creation recorded an
organization. Listing, reading, renaming, deleting and rotating a token
looked the target up by ID across every organization and checked scopes
only. A token bound to one organization could therefore see another
organization's tokens, and rotate one to obtain its raw credential,
including an instance-wide full-access token.

A token caller may now manage a token only if every organization the
target is bound to is one the caller is bound to. A target outside the
caller's organizations answers `404`, as if it did not exist, and is
left out of the list. Instance-wide full-access tokens (full access,
bound only to the default organization) keep managing everything, and
browser sessions are unchanged.

An instance-wide token is the most powerful credential, so only an
instance-wide caller may rotate, delete or edit one, or mint one in the
default organization (directly, or by editing a scoped token to full
access). A caller bound to several organizations that includes the
default one is not instance-wide, even though its organizations are a
superset of the target's. Callers without full-access scope are still
refused by the existing scope-containment checks, so the pinned `403`
cases are unchanged.

Tests drive each handler as an organization-bound caller. They cover
list, get, rename, delete and rotate across organizations, the
within-organization and instance-wide cases that must keep working, the
multi-organization escalation edges (rotate, mint, promote), and the
rule as a table. Each check fails when it is removed. The two existing
failures in this package when run locally on macOS (`systemd-analyze`
missing, a dev-mode expectation) also fail on `main`.

Not changed here: `quick-setup` with `force`, config import and the
development first-run reset can still replace the whole token inventory
with `settings:write`, and `/api/diagnostics` lists token metadata
globally.
2026-10-11 19:33:03 +01:00
pulse-triage[bot]
44f3d5142c Integrate reviewed agent credential-file selection repair
Retain exact Core commits and scoped normal/race/vet/ARMv7 and trusted-HTTPS process evidence. This independent repair does not establish the Pi reporter cause or installed recovery.

Change-source: pulse-maintainer
2026-10-11 19:30:02 +01:00
rcourtman
95b7f28dd1 Gate report narration in the resolver, keeping the pinned handler shape
docsLinks.test.ts pins the single-report handler's POST branch by source
text. Move the ai:execute check into resolveNarrator, the one place every
report path resolves AI narrators, instead of branching in each handler:
a caller that may not spend AI budget gets no narrator and only the
findings of an already-running AI service, and the resolver that can
construct a tenant AI service is never called. The handlers return to
their previous shape, with the single-report handler adding only the
note that explains why the report was not narrated.

Contract-Neutral: Refactor that places the same scope check at the shared resolver and restores the pinned source shape; no new API surface or contract.
2026-10-11 19:17:54 +01:00
rcourtman
d08eb80795 Keep the token list handler in the shape its source pin expects
test_agent_auth_docs pins the token-list handler's iteration and DTO
conversion by source text (range r.config.APITokens and
toAPITokenDTO(record)) to prove the inventory lists every record. The
organization filter had switched the loop to an index; iterate by value
again so the pinned shape and the filter both hold.

Contract-Neutral: Refactor that restores the pinned source shape with no change in behaviour.
2026-10-11 19:15:10 +01:00
pulse-triage[bot]
00f3f0dc89 Align report help and scope proofs with narration spending permissions
Keep generation's read scope distinct from the ai:execute permission needed for single-resource and fleet PDF narration. Preserve the bounded PR2836 runtime guard unchanged, mirror the canonical API/MSP help into shipped assets, and record the actual contract including token-triggered versus server-run schedules. Replace the old unconditional-POST source assertion with both method and spending-scope checks, and cross GET with all five caller types. The production Docs browser fixture checks the public guidance on desktop and touch phone without API requests or mutations.

Change-source: pulse-maintainer
2026-10-11 19:10:36 +01:00
pulse-triage[bot]
795b982cd8 Compose bounded report narration scope guard for documentation repair
The exact PR2836 delta is confined to the single/fleet narration handler and its five-caller regression tests. Preserve that guard unchanged on the current assigned source before aligning its API/MSP help and method/scope proofs.

Contract-Neutral: Composition of the existing AI-spending scope rule for report narration; no additional runtime behaviour or API surface.
Change-source: pulse-maintainer
2026-10-11 19:00:51 +01:00
pulse-triage[bot]
8e6d892d3d Reconcile launch upstream alert Off and token-authority repairs
Incorporate the upstream frontier present at coordination start without re-parenting reviewed source; later upstream reconciliation remains with the publication gate.

Change-source: pulse-maintainer
2026-10-11 18:52:33 +01:00
pulse-triage[bot]
f132b5b8fe Observe compressed reports in the credential hand-off journey
The real host agent sends gzip reports. Decode only the fixture observer copy, leaving the request bytes and headers unchanged for canonical router authentication and decompression. Document selected-file startup errors and retained enrolment restart semantics.

Change-source: pulse-maintainer
2026-10-11 18:44:36 +01:00
pulse-triage[bot]
75a2a34855 Respect the selected agent credential file
Keep PULSE_TOKEN out of the direct-token flag default. Refuse an unreadable or empty selected file instead of silently borrowing other credentials, while preserving enrolled runtime-token restarts and implicit token-optional startup.

Cover actual flag loading and a synthetic host issuer, private installer-writer, compiled agent and trusted HTTPS lookup/report journey. This repairs an independent source-selection defect; it does not establish the cause or recovery of Discussion #2769.

Change-source: pulse-maintainer
2026-10-11 18:28:08 +01:00
rcourtman
9a4f75b5b7 Require instance-wide authority to rotate credentials by token
POST /api/security/quick-setup with force=true sets the administrator
username and password and replaces every API token with a full-access
one. With authentication already configured, a token holding only
settings:write could call it, so settings:write was enough to take the
instance over, although the endpoint is documented as needing a
bootstrap token or an authenticated session.

A token caller now needs an instance-wide full-access token (full access,
bound only to the default organization) once the request would change
credentials. The not-forced "already configured" answer is unchanged, and
browser sessions, the bootstrap token and recovery token paths are
untouched.

The two existing force tests that used a settings:write caller are about
persistence rollback and settings preservation, so they now use a
full-access caller. The new tests use a deliberately weak password so a
caller that passes the check is stopped by validation before any
credential or session is written, and they fail when the check is removed.

Contract-Neutral: Behavioural fix that gives credential rotation the authority check regenerate-token and token management already have; no new API surface or contract.
2026-10-11 18:10:20 +01:00
rcourtman
fb4feee411 Keep token management inside the caller's organizations
The API token inventory is global, but only token creation recorded an
organization. Listing, reading, renaming, deleting and rotating a token
looked the target up by ID across every organization and checked scopes
only. A token bound to one organization could therefore see another
organization's tokens, and rotate one to obtain its raw credential,
including an instance-wide full-access token.

A token caller may now manage a token only if every organization the
target is bound to is one the caller is bound to. Instance-wide
full-access tokens keep managing everything, and browser sessions are
unchanged. A target outside the caller's organizations answers 404, as if
it did not exist, and is left out of the list.

An instance-wide full-access token is the most powerful credential, so
only an instance-wide caller may rotate, delete or edit one, or mint one
in the default organization (directly, or by editing a scoped token to
full access); a caller bound to several organizations that
includes the default one is not instance-wide, even though its
organizations are a superset of the target's.

Tests drive each handler as an organization-bound caller and fail when
the matching check is removed.

Contract-Neutral: Behavioural fix that applies the organization binding tokens already carry to token management; no new API surface or contract.
2026-10-11 17:56:38 +01:00
rcourtman
0ade941036 Require ai:execute for AI narration of reports by token
Reports are readable with settings:read, but a POST report can narrate
with the tenant's Pulse Assistant, a paid provider call recorded in the
cost ledger. Any token with settings:read could therefore spend that
budget, while every other AI-spending route needs ai:execute.

An API token now needs ai:execute for AI narration, on single-resource
and fleet reports alike. Without it the report is still produced, with
the deterministic summary and a note saying why. Browser sessions and
scheduled reports are unchanged, and GET keeps narrating
deterministically.

Tests cover a session, a settings:read token, a token with monitoring:read
as well, an ai:execute token and a full-access token on both handlers,
and fail when either handler ignores the gate.

Contract-Neutral: Behavioural fix that applies the scope other AI routes already require to report narration; no new API surface or contract.
2026-10-11 17:24:46 +01:00
pulse-triage[bot]
353be1ff00 Integrate reviewed Assistant retirement fixture repairs
Change-source: pulse-maintainer
2026-10-11 17:05:50 +01:00
rcourtman
149b55c3f9 Require an admin for non-token agent uninstall (#2833)
`POST /api/agents/agent/uninstall` (and `/api/agents/host/uninstall`) is
a collector's self-removal: a token holding `agent:report` removes the
agent that token owns. For any caller that is not a token, the handler
takes the administrative removal path (`RemoveHostAgent`) and deletes
any host agent by ID. The route was only `RequireAuth` plus
`RequireScope(agent:report)`, and browser sessions bypass token scopes,
so a non-admin SSO, proxy or organization-member session could remove
any agent, while the equivalent `unlink` and `DELETE` routes require an
admin.

The route now uses `RequireAdmin` like its neighbours. Token callers are
unchanged: `RequireAdmin` admits them and the `agent:report` scope check
still applies, so the collector's own uninstall and `install.ps1` keep
working (they are the only callers; the frontend does not use this
route).

`TestProxyAuthAdminGatesAdminEndpoints` gains the two uninstall routes
(it fails with the old wrapper: the non-admin request reached the
handler). `agent_uninstall_scope_test.go` keeps the token path reachable
and the scope check in place.
2026-10-11 16:56:42 +01:00
rcourtman
7482418db3 Admit attention lifecycle POSTs on the mutation scope (#2832)
`/api/ai/patrol/attention/` is one prefix for reads, lifecycle mutations
(`acknowledge`, `unacknowledge`, `suppress`, `unsuppress`) and action
planning. Its outer gate used the read-detail scope set
(`monitoring:read`, legacy `ai:execute`, `relay:mobile:access`) for
every method, so a token holding only `monitoring:write` was refused
before the mutation handler's own `monitoring:write` check could run.
The pinned capability inventory (`relay_mobile_capability_test.go`)
already says `POST .../{item_id}/{mutation}` needs `monitoring:write`.

The outer gate now follows `HandleAttention`'s dispatch: a lifecycle
mutation is admitted by the mutation scope set, everything else by the
read set. Behaviour that does not change: a read-only token still cannot
mutate, a write-only token still cannot read, action planning keeps its
read-side gate plus its own entitlement and plan/approve/execute
authorization, and browser sessions bypass scopes as before.

`attention_mutation_scope_test.go` pins each of those four cases and
fails when the mutation routing is reverted.
2026-10-11 16:30:40 +01:00
rcourtman
111a62cfe8 Require an admin for non-token agent uninstall
POST /api/agents/agent/uninstall (and its host alias) is a collector's
self-removal: a token holding agent:report removes the agent that token
owns. For any caller that is not a token, the handler instead takes the
administrative removal path and deletes any host agent by ID. The route
was only RequireAuth plus RequireScope(agent:report), and browser
sessions bypass token scopes, so a non-admin SSO, proxy or organization
member session could remove any agent, while the equivalent unlink and
delete routes require an admin.

The route now uses RequireAdmin like its neighbours. Token callers are
unchanged: RequireAdmin admits them and the agent:report scope check
still applies, so collector and install.ps1 self-uninstall keep working.

The existing non-admin proxy test gains the two uninstall routes, and a
new test keeps the token path reachable and the scope check in place.

Contract-Neutral: Behavioural fix that gives the administrative removal path the admin gate its sibling routes have; no new API surface or contract.
2026-10-11 16:30:23 +01:00
rcourtman
b161c42e31 Admit attention lifecycle POSTs on the mutation scope
/api/ai/patrol/attention/ is one prefix for reads, lifecycle mutations
(acknowledge, unacknowledge, suppress, unsuppress) and action planning.
Its outer gate used the read-detail scope set for every method, so a
token holding only monitoring:write was refused before the mutation
handler's own monitoring:write check ran. The pinned capability inventory
already says POST .../{item_id}/{mutation} needs monitoring:write.

The outer gate now follows the handler's dispatch: a lifecycle mutation
is admitted by the mutation scope set, everything else by the read set.
Read tokens still cannot mutate, a write-only token still cannot read,
and action planning keeps its read-side gate plus its own authorization.

Contract-Neutral: Behavioural fix that makes the route match its pinned capability inventory; no new API surface or contract.
2026-10-11 16:05:31 +01:00
rcourtman
9718555e31 Stop token callers widening or bypassing their scopes
Two authorization gaps where a token could do more than its scopes allow.

POST /api/security/regenerate-token replaces the whole token inventory,
wildcard tokens included, and issues a full-access credential (nil scopes
normalise to "*"). A token holding only settings:write could therefore
wipe every other token and mint an unrestricted one, which the normal
create and update paths refuse because a caller can only grant scopes it
holds. A token caller now needs full-access scope and must not be bound
to a non-default organization; anything narrower gets 403 and is pointed at
POST /api/security/tokens/{id}/rotate, which replaces one token. Admin
sessions are unchanged.

/api/resources/ is one prefix route gated on monitoring:read, but it also
dispatches POST link, unlink and report-merge, which persist resource
identity changes. A read-only token could change them. Anything other
than GET or HEAD on that prefix now needs monitoring:write; the more
specific registrations (operator-state, maintenance) keep their own gates.

Tests pin both boundaries and each fails when its fix is reverted. Two
existing regenerate tests that used a settings:write caller now use a
full-access one, since their subject is owner inheritance and rollback.

Contract-Neutral: Behavioural fix that enforces the documented token scope model; no new API surface or contract.
2026-10-11 15:57:35 +01:00
pulse-triage[bot]
8e20302041 Keep the real ZIP extraction limit without expensive fixture compression
The broader API race proof failed after 902 seconds with the oversized ZIP fixture among its unterminated tests; the missing panic output does not establish the cause. The fixture needlessly Deflates 100 MiB of zeros. Generate the same exact oversized entry with ZIP Store and streamed zero input instead, keeping the production cap, stream-limit assertion, archive validity and other Deflate controls unchanged.

Contract-Neutral: Only the ZIP overflow test fixture encoding and construction cost change; the actual oversized entry, runtime extraction policy, size bound, error assertions and test deadlines are unchanged.
Change-source: pulse-maintainer
2026-10-11 15:24:18 +01:00
rcourtman
fc667c2ae3 Merge remote-tracking branch 'origin/main' into pulse/sidecar-live 2026-10-11 12:35:42 +01:00
rcourtman
5d53fa7a3d Remove the Assistant mutation handlers nothing calls
pulse_control only plans typed resource actions into Pulse Actions
(executeControlResource -> typedActionPlanner). The handlers that sat
behind the retired model-authored command, file and container paths
stayed in the tree with no production caller: run command, guest
control, app-container control, Docker control and container update,
Kubernetes scale/restart/delete-pod/exec, and file append/write.
registerFileTools was never called either, so pulse_file_edit is not
registered at all; calls to it are denied by the mutation registry
before any tool lookup.

A whole-program reachability run over cmd/... lists each of them as
unreachable, and so is everything only they used: approval-record and
preflight authoring, the command and native-action audit lanes with
their remediation-lock gate and plan-hash helpers, the Docker host
resolvers, and the file write verification. The executor's autonomous
flag, whose only readers were those handlers, goes with them (the
executor's SetAutonomousMode and the flag argument of SetContext).

Delete them with their tests and the constants, types and test helpers
they stranded. The contract prose that described the removed broker now
says that plan freshness and the operator remediation lock are enforced
by internal/actionlifecycle. Two source pins that named deleted code go
(the publishActionCompleted dispatch sites and the pulse_file_edit
declaration), the standards tests drop their expectations of an
ActionPlan construction in action_audit.go and of the legacy app_container
rejection in the deleted file-edit test, and the RA35 evidence entry for
the deleted run-command test goes with them.

Left alone on purpose: the saved autonomous control level and its
entitlement and approval-admission checks, which stay as legacy
compatibility, Service.SetAutonomousMode and the chat clamp,
SetOnActionCompleted and its router wiring (no dispatcher is left, the
contract prose says so), and the protected-guests plumbing.

Rebuilt on current main: the first version had 213 commits of drift.
Two conflicts, both on code this change deletes. tools_control.go takes
the deletion over the Protected guests cleanup that landed inside
executeRunCommand. action_audit_remediation_lock_test.go goes with the
audit lanes, including the test added for the dispatch gate's read
through a succession; that gate is deleted here, and
TestLockMovedBySuccessionStillRefusesTheIDThePreviousGenerationLists in
internal/actionlifecycle covers the same refusal on the live path.
2026-10-11 12:35:28 +01:00
pulse-triage[bot]
235f0e42a2 Give TLS diagnostic controls their required runtime
Use the existing target-free Monitor fixture for diagnostics uptime and scheduler state; only the test's direct PVE/PBS probes contact its loopback server. Retain the initial nil-runtime failure without weakening production diagnostics or trust assertions.

Contract-Neutral: Tests only; supply the existing required diagnostics runtime without changing production source or diagnostic contracts.
Change-source: pulse-maintainer
2026-10-11 10:25:31 +01:00
pulse-triage[bot]
c0e11cf44a Keep diagnostic TLS recovery within saved trust
Distinguish cancelled or timed-out probes from certificate faults before classifying error text. Replace verification-bypass advice with endpoint, chain and independently verified fingerprint checks across PVE and PBS diagnostics, including scheduler errors and support JSON.

Exercise real loopback trust refusal and operator-supplied pin recovery without changing stored trust, credentials or scheduler authority.

Contract-Neutral: Restore existing TLS/timeout diagnosis and safe recovery guidance; errorKind/schema, saved trust enforcement/settings, agent lifecycle and scheduler/recovery authority remain unchanged.
Change-source: pulse-maintainer
2026-10-11 10:17:19 +01:00
pulse-triage[bot]
37864e1b4a Expose unsafe TLS recovery guidance in diagnostics
Discriminate advice that weakens certificate trust and stopped handshakes mislabelled as certificate faults, before repairing the existing diagnostic path.

Contract-Neutral: Tests only; no runtime, diagnostic schema or TLS policy change.
Change-source: pulse-maintainer
2026-10-11 10:05:21 +01:00
pulse-triage[bot]
816b20bfc5 Keep Docker update plans on the saved deployment
Replace the copyable guessed stop/run sequence with mounted-data backup and original-deployment recreation guidance. Quote the pull target as one literal shell argument, retaining manual-only and private-image boundaries. Add real-shell controls and a real handler-path check; no Docker daemon or installed recovery claim.

Change-source: pulse-maintainer
2026-10-11 07:14:41 +01:00
pulse-triage[bot]
91de06ca23 test(api): initialise persistent stores in bare auth fixtures
The exact normal and race API groups failed at the bare change-password fixture because Basic authentication requires an explicitly configured CSRF store. Give each fixture its own session and CSRF stores and join their workers at cleanup; retain the production fail-closed contract.

Contract-Neutral: Test fixture lifecycle only; production authentication and subsystem contracts are unchanged.
Change-source: pulse-maintainer
2026-10-11 01:22:36 +01:00
pulse-triage[bot]
da44cec421 fix(monitoring): publish complete resource wiring once
Apply saved notification policy before initial resource publication, batch supplemental bindings and retain explicit withdrawals for existing and future tenants. Serialize complete router initialization and refuse old binding collections before ordered writes; preserve admitted alert joins without clearing active alerts. Keep native and demo provider records separated across the mock-switch hook gap.

Contract-Neutral: Internal resource dependency wiring and publication ordering only; existing resource/API schemas, authorization and tenant boundaries, alert thresholds, retention and shutdown policy are unchanged.
Change-source: pulse-maintainer
2026-10-10 19:23:09 +01:00
pulse-triage[bot]
a61efb9cb3 Join runtime alert checks before tenant shutdown completes
Monitor.Start launched mock and connection alert passes without joining them. Tenant deletion could close stores and remove its directory while a pass still emitted alert writes. Wait for admitted passes, refuse new checks after cancellation, and retain the existing bounded-deletion refusal. Log real persistence deletion errors without exposing them in the API response.

Contract-Neutral: Preserve token scopes, tenant isolation, API responses and deletion safety contracts; bind existing internal alert passes to their monitor lifetime and retain failure diagnostics.
Change-source: pulse-maintainer
2026-10-10 16:47:05 +01:00
rcourtman
3465804dd1 Stop mock-mode callers that read identity rebuilding the estate view (#2798)
Follow-up to #2778. Stacks cleanly on main; the contract prose
cross-references the wiring change in #2796, so land that first if both
are open.

## What was wrong

In mock mode the unified view is keyed on the fixture data version,
which advances on every metric tick, and building it for the default
1,776-resource estate costs about half a second of CPU (many seconds on
a starved process). #2778 moved the metrics-target lookup onto the
fixture structure revision. The other callers that read only what the
estate lists and how it connects still rebuilt the whole view after each
tick: at startup they made 42 view requests, all misses (the
Docker-alert prune 18, the connection snapshots 13, the host-agent
evaluation 8, the chart prewarm 2, the metrics-target lookup 1), and
with no client connected the monitor tick alone rebuilt the estate about
every nine seconds.

## What changes

- Callers that read identity and topology share the view built for the
current structure revision and operator links
(`currentStructureUnifiedStateView`, `GetUnifiedStructureReadState`,
`currentModeStructureReadState`, in
`internal/monitoring/unified_structure_view.go`; `mockMetricsTarget`
uses the same cache reader): the Docker-alert prune, the workload chart
prewarm, the demo Patrol operator-state resolver, and the host-agent
evaluation. `evaluateHostAgents`, which runs on every monitor tick, now
lists nodes only when an offline host names a linked node.
- The connection-degraded alert feed keeps only platform rows
(`snapshotConnectionsForAlerts` drops every agent row, and a PBS row's
reported node name only becomes a host alias that its snapshot does not
carry). It now builds the aggregator inputs with `platformRowsOnly`, so
it no longer reads the hosts, their desired-config fingerprints or the
PBS instances. The connections endpoint, diagnostics and runtime
inventory still read them.
- Deliberately not moved:
- The mock storage chart (`resolveMockStorageTotal`): a linked pool
takes its capacity from whichever source was seen last, which a tick can
move without a structure change. It stays on the data-version view, read
once per request instead of once per uncached pool.
- `linkedHostForNode`, `getHostAgentTemperatureForNode` and
`carriedTemperatureOutlivesAgentLease` (only reachable with
`PULSE_MOCK_KEEP_REAL_POLLING`): they read a host's status, disks,
sensors and report lease, which a tick moves. Hoisting them would need
the read state threaded through the node poller, and they run after
startup, so they stay as they were.

Real mode is unchanged.

## Measured (pulse-dev, probe builds, one pinned core, GOMAXPROCS=1,
host load 30 to 110, single runs)

| | #2796 alone | with this change |
|---|---|---|
| estate view builds before the listener answers | 2 | 1 |
| estate builds, no client connected, 299 s of life | 33 | 2 (both at
startup) |
| process CPU over a 180 s steady window | 12.3 s | 3.3 s |

A separate run of the pre-#2796 build used 9.0 s over that window, so
read 12.3 against 3.3 as the comparison rather than as exact
percentages. The public demo host runs a mock estate, so the
steady-state saving is the one that matters there.

## Verification

- New tests (in registered proof files): no consumer of the structure
view rebuilds the view after a fixture tick (Docker prune, structure
node listing, workload prewarm, host-agent evaluation including an
offline host that names a linked node); the data-version view still
rebuilds; the structure view follows a structural fixture change and an
operator link; lazy correlation lists nodes only for a linked host; a
storage chart reads the estate only when it is not cached; the alert
feed does not rebuild the view, its platform rows equal the full
aggregator's, and configured PVE/PBS/PMG rows survive without the hosts;
the Patrol resolver does not rebuild the view.
- Negative controls (each fails the named test): prune, prewarm, eager
node listing, structure node listing, alert feed and Patrol resolver
each moved back to the data-version view, and a storage chart that reads
the estate before checking its cache.
- `go vet` and the targeted tests on pulse-dev.

## Known limits

- The structure view can be several ticks old, so a caller on it must
not read status, metric values, timestamps, sensors or anything a link
merges by freshness; the contract says so. The fixture sets pod node
names (which feed the platform aliases a Patrol reference can resolve
through) when the estate is built, not on a tick.
- `pbsInstanceFromReadStateView` never copies `NodeName`, so
`pbsReportedNodeNamesByInstance` appears to feed empty host aliases on
the connections endpoint. That is a separate bug, not changed here.
- The batch sharing of the storage chart's read (`sync.OnceValue` in
`GetStorageMetricsForChartBatch`) is not pinned by a test; the
single-chart laziness is.

Not a feature: no demand-ledger entry.
2026-10-10 13:44:54 +01:00
rcourtman
8823440f33 Stop mock-mode callers that read identity rebuilding the estate view
In mock mode the unified view is keyed on the fixture data version, which
advances on every metric tick, and building it for the default
1,776-resource estate costs about half a second of CPU (many seconds on a
starved process). #2778 moved the metrics-target lookup onto the fixture
structure revision; the other callers that read only what the estate
lists and how it connects still rebuilt the whole view after each tick.
At startup they made 42 view requests, all misses, and with no client
connected the monitor tick alone rebuilt the estate about every nine
seconds.

Callers that read identity and topology now share the view built for the
current structure revision and operator links (currentStructureUnifiedStateView,
GetUnifiedStructureReadState): the Docker-alert prune, the workload chart
prewarm, the demo Patrol resolver, and the host-agent evaluation, which
also lists nodes only when an offline host names a linked node. The
connection-degraded alert feed keeps only platform rows, so it no longer
reads the hosts, their desired-config fingerprints or the PBS instances
that only feed agent rows and a host alias its snapshot drops.

The mock storage chart is not one of them: a linked pool takes its
capacity from whichever source was seen last, which a tick can move
without a structure change. It keeps the data-version view, read once per
request instead of once per uncached pool. The per-node polling lookups
of a monitor that keeps real polling in mock mode (linkedHostForNode,
getHostAgentTemperatureForNode, carriedTemperatureOutlivesAgentLease)
read a host's status, disks and sensors, which a tick moves, so they stay
on the data-version view.

On pulse-dev (one pinned core, host load 30 to 110, probe builds): a
start built the estate view twice before the listener answered with the
wiring change alone and once with this; with no client connected the
process built the estate 33 times in 299 s and used 12.3 s of CPU over a
180 s window, against twice and 3.3 s with this change.
2026-10-10 12:37:42 +01:00
rcourtman
884694a046 Carry the PBS-reported node name into the connections ledger
The PBS poll records the hostname the node reports about itself on
PBSInstance.NodeName so /api/connections can alias the PBS connection by
it and group the host agent running on that machine into the PBS row.

The name reaches the unified PBS resource (PBSData.NodeName), but
Monitor.PBSInstancesSnapshot() rebuilds each instance from the read-state
view, and the view had no accessor for it, so the snapshot always carried
an empty NodeName. The ledger's reported-name map was therefore always
empty and a PBS machine configured by IP or DNS alias still showed as an
API row plus a separate agent row. The unit tests missed it because they
hand the aggregator its inputs instead of going through the monitor.

Add PBSInstanceView.NodeName() and copy it in pbsInstanceFromReadStateView.
The new ledger test drives a real monitor through the input builder, the
connection aliases and the system grouping: with the conversion line
removed it fails on the missing alias, with it the agent attaches to the
PBS system.

Only direct root@pam sessions can read the node name (API-token
connections get none), so this restores grouping for password-auth PBS
connections; token-auth ones still match only on what they were
configured with.
2026-10-10 12:06:38 +01:00
rcourtman
e885b8aced Undo only the links that hold a reported source in report-merge (#2780)
## Problem

A source-filtered `POST /api/resources/{id}/report-merge` picked the
links to undo by each fold's `Sources`, which is the folded side's whole
subtree. Two consequences:

- In a chain (Docker host linked into an agent linked into a VM), naming
only `docker` also split the agent from the VM, because the agent's fold
lists the Docker source it took in.
- Where recorded links form a cycle (S->V, W->V, S->W with V primary),
naming only `vmware` excluded V-W but left W-S, so W rejoined through S
on the next rebuild. `main` cannot record that cycle today (its third
link is skipped once W is folded), so this half is proved on hand-built
folds and will matter once chains record their closing links.

## Change

- `ManualLinkFold` records what each side is on its own (`HolderOwn`,
`FoldedOwn`), read before the other side is merged in. A repeated pair
unions them, as it does `Sources`.
- `ReportedManualLinkFolds` undoes the links that join a member carrying
a reported source to the part that stays, or to another reported member.
A member that hangs below a reported one and carries no reported source
goes with it, and its link stays. "The part that stays" is what the
resource still reaches without passing through a reported member, so a
reported member is cut from every link that would rejoin it.
- The handler uses it in place of `selected(fold.Sources...)`.

A report naming every source, or none, still undoes every link. The
drawer's Split sends every merged source, so it is unchanged; only API
callers with a real `sources` filter see a difference. No schema,
storage or response change.

## Proof

- `TestResourceReportMergeSourceFilterDetachesChainMembers`
(resourceapi): a Docker host linked into an agent linked into a VM,
reported for the leaf, the holder, both, every source and no filter,
checked on the monitor and the REST listing and against the links left
in the store.
-
`TestContract_ResourceReportMergeSourceFilterKeepsLinksOfUnreportedMembers`
(api).
- `TestReportedManualLinkFoldsDetachMembersCarryingTheSource` and
`TestReportedManualLinkFoldsLeaveNoReportedMemberJoined`
(unifiedresources): trees, the cycle above, the root re-keyed, folds
without own sources, a refold that gained a source. The second checks
that no reported member stays joined to the root; selecting by subtree
sources fails it on the cycle.
- Fold recording tests updated for the own sources; clone test checks
they are deep-copied.
- Negative controls on pulse-dev with the handler restored to the
subtree selection: the leaf case of the chain test and the new contract
test both fail with the full split they used to produce.
- Full `internal/unifiedresources` and `internal/api/resourceapi`
packages pass on pulse-dev.
2026-10-10 09:17:04 +01:00
rcourtman
21b496152c Remove the inert Assistant Protected guests setting (#2776)
## What and why

Settings > Pulse Intelligence > Assistant offered a **Protected guests**
list (`protected_guests`). The value was saved and pushed into the
Assistant tool executor, but the only code that read it was
`executeControlGuest`, which has no callers. The live mutation path,
`pulse_control type=resource` -> `executeControlResource` ->
`resolveControlTarget` -> `assistantTypedActionPlanner.PlanTypedAction`
-> `actionlifecycle.Service.Plan`, never consulted it. #2765 labelled
the field "legacy" and said it does not exclude saved plans; this
removes the setting instead of keeping a field that cannot do its job.

**Decision: remove, do not enforce.** The canonical way to keep Pulse
off a resource is its operator lock (**Never auto-remediate**, or a
Retired lifecycle): keyed by canonical resource id (a VMID or a name is
ambiguous across nodes and clusters), available for every platform, set
from the resource's own drawer, and enforced by the action lifecycle at
dispatch for every actor, approved plans included. A second,
string-keyed list that only the Assistant honours would extend a legacy
path next to a canonical one. Nothing in GitHub issues, discussions or
the demand ledger ever asked for it, and no user doc described it before
#2765.

The one real gap the lock had on the Assistant's path was planning:
`Plan` does not read operator state, so the Assistant could leave a plan
in Actions that can never run. `assistantTypedActionPlanner` now reads
the state through the tenant-scoped lifecycle store (the same read
Patrol's broker uses) and declines before `Plan`; `pulse_control`
returns an `ACTION_NOT_ALLOWED` result with `reason_code:
resource_remediation_locked` and how to clear it. A state that cannot be
read does not refuse planning, because dispatch re-checks.

## Proof it was inert (before)

- In-process, production planning chain (tool executor +
`assistantTypedActionPlanner` + real lifecycle and Proxmox executor,
only the node runner faked): a guest whose name and VMID were both in
the list was planned (`planned:true`, real action id). An
operator-locked guest was planned too.
- Live on a private non-mock stack (stub Proxmox node, stub
OpenAI-compatible provider emitting `pulse_control restart web-prod`,
`protected_guests: ["web-prod","101"]` saved): the call reached the
planner and was refused only by the runner availability gate; protection
was never consulted. (The typed action runner needs Linux systemd
containment, so planning success could not be reproduced live on macOS;
the in-process run covers it.)

## After

- Same live stack on this branch, with the old config (still carrying
`protected_guests`) loaded: `GET /api/settings/ai` omits the field,
Settings shows no field, Save sends no `protected_guests`.
- Locking `web-prod` through the real UI (guest drawer > Manage > Never
auto-remediate > Lock this resource > Save overrides) and repeating the
Assistant turn returns the lock refusal and leaves nothing in Actions.
Unlocked, the turn behaves as before.
- Negative control: with the planner check removed,
`TestAssistantDeclinesToPlanAgainstBlockedGuest` fails for both blocking
states.

## Compatibility

- A stored `protected_guests` still loads (tolerant decode) and is
dropped the next time the settings are written. `PUT
/api/settings/ai/update` ignores the key from older clients (verified by
test), and `GET` no longer returns it. No other repo reads it.
- The maintainer's saved-policy compatibility tests from #2765 keep
their real assertions (control level, entitlement, Patrol policy); only
the `ProtectedGuests` marker is gone. The legacy copy, pins and prose it
added are replaced: Settings points at the lock, docs/AI.md and
docs/AI_AUTONOMY.md say the list is gone and how to lock a resource,
contract clauses updated in ai-runtime, api-contracts, agent-lifecycle,
frontend-primitives and storage-recovery.
- `frontend-modern/browser-tests/assistant-control-compatibility.cjs` (a
manual harness for the maintainer's proof environment) is updated for
the removed field; it was not run here.

## What this does not fix (chipped separately)

- A lock is lost when its resource is manually linked into another
resource or re-keyed by an identity succession (`registry.go` fold,
`canonical_id_succession.go` `UPDATE OR IGNORE`).
- Saving a lock while a human-approved dispatch is being admitted can
race past the dispatch gate (`actionlifecycle.Service.Execute` re-checks
without the admission lock). The public copy says the lifecycle checks
the lock again before it runs an already-planned action; the contract
names the window.
- REST and Patrol planning still use the unchanged lifecycle planner;
the planning refusal is Assistant-only by design. The lock covers the
exact resource, not its host or descendants, and does not stop read-only
investigation.

## Verification

- Go: `internal/config`, `internal/ai/...`, targeted `internal/api`
(Assistant planning, AI settings handler, contract) and `go vet` pass
locally; new tests cover unlocked, Never auto-remediate, Retired,
non-blocking overrides, a non-default tenant, the exact response
envelope and no audit written on refusal.
- Frontend: tsc, eslint, copy and form-label lints,
Settings/utils/guardrail vitest pass; new AISettings test covers the
hint, read-only hiding, an old backend still echoing the list, and the
Save payload.
- Browser: private stack, desktop and 390px, Settings > Assistant and
the guest drawer Manage tab; receipt included.
- Three Sol review rounds; findings fixed (tenant store path,
overclaiming copy, retired-state remedy, missed browser harness pins,
missing receipt) or chipped.
2026-10-10 08:50:08 +01:00
rcourtman
70ed7488a4 Undo only the links that hold a reported source in report-merge
A source-filtered report-merge chose the links to undo by the sources
each fold's folded side took in, which spans that side's whole subtree.
Naming the source of a leaf in a chain (a Docker host linked into an
agent linked into a VM) also split the leaf's holder from the VM, and
where recorded links form a cycle a reported member stayed joined
through the link whose fold did not name it.

Folds now record what each side is on its own (HolderOwn, FoldedOwn),
read before the other side's sources are merged in, and
ReportedManualLinkFolds undoes the links that join a member carrying a
reported source to the part that stays or to another reported member.
A member hanging below a reported one goes with it and its link stays.
A report naming every source or none still undoes every link, so the
drawer's Split is unchanged; only API callers with a real sources
filter see a difference.
2026-10-10 08:10:56 +01:00
rcourtman
1d6d2bfcae Remove the inert Assistant Protected guests setting
Settings > Assistant offered a Protected guests list (protected_guests)
that was saved and pushed into the Assistant tool executor, but its only
reader was executeControlGuest, which nothing calls. pulse_control plans
through the shared action lifecycle and never consulted the list, so a
guest named in it (by VMID and by name) was planned like any other. The
"legacy" label added in #2765 states that limit; this removes the
setting instead of keeping a field that cannot do its job.

The canonical way to keep Pulse off a resource is its operator lock
(Never auto-remediate, or a Retired lifecycle). It is keyed by canonical
resource id, applies to every platform, and the action lifecycle refuses
dispatch for it even for approved plans. The one gap was planning: the
lifecycle plans without reading operator state, so the Assistant could
leave a plan in Actions that can never run. assistantTypedActionPlanner
now reads the state through the tenant-scoped lifecycle store (the same
read Patrol's broker uses) and declines before Plan, and pulse_control
reports the block with how to clear it. A state that cannot be read does
not refuse planning, because dispatch re-checks.

Removed: AIConfig.ProtectedGuests and its getter, the settings API
field, the executor field/setter/config, the chat service plumbing, the
Settings field and form state, and the legacy copy, pins and prose from
#2765. A stored value still loads (tolerant decode) and is dropped the
next time the settings are written; older PUT bodies that send the key
are ignored. The Settings panel points at the guest's Manage tab.
2026-10-10 07:46:45 +01:00
rcourtman
912d7ceb51 Judge connection freshness by the monitor's live poll cadence
Non-default organisations run their monitors against a detached copy of
the server config (#1619). A system-settings save reaches those monitors
only as runtime PBS and PMG polling overrides, so the copy that the
connections list reads through the org's config handlers kept the old
interval until that monitor was rebuilt. The active-to-stale cutoff is
3 x the polling interval, so raising PBS from 1m to 5m left a 3m cutoff
and Settings > Infrastructure badges read "stale" for part of every
cycle, while lowering it delayed the badge by the same factor.

Add Monitor.BasePollInterval, an override-aware reader for the clamped
PVE, PBS and PMG base cadence that never takes m.mu, and have the
connections input builder use it whenever a monitor is present. The
fixed-cadence branch of resourcePollIntervals reads the same accessor, so
resource freshness and connection freshness share one derivation.

The system settings GET is not affected: both production routes serve
SystemSettingsHandler, which reads the base config and persisted
settings; the configapi handler that reads the tenant copy is only a
fallback when that handler is absent.
2026-10-10 07:37:03 +01:00