Commit Graph

8252 Commits

Author SHA1 Message Date
rcourtman 3291d97a14 Reserve Patrol investigation isolation work 2026-07-16 13:57:56 +01:00
rcourtman d8557c9256 Shorten fake Google API key fixtures below secret-scanner shape 2026-07-16 13:40:38 +01:00
rcourtman 62f1986d0c Release Patrol subscription schema claim 2026-07-16 13:33:44 +01:00
rcourtman e1e1048e08 Preserve durable Patrol outcomes across Claude wrapper retries 2026-07-16 12:50:15 +01:00
rcourtman 6c8ecd2284 Constrain plain Claude completion fallback 2026-07-16 12:45:24 +01:00
rcourtman 1439495e70 Accept safe plain Claude completion turns 2026-07-16 12:42:12 +01:00
rcourtman 043ecf4c66 Stabilize Claude subscription completion transport 2026-07-16 12:38:19 +01:00
rcourtman 0719e34255 Bind subscription tool calls to native schemas 2026-07-16 12:29:14 +01:00
rcourtman 4f42632cd6 Transition Patrol claim to subscription object schemas 2026-07-16 12:26:10 +01:00
rcourtman fddcc3fefe Honor Patrol lifecycle tool ordering 2026-07-16 11:39:23 +01:00
rcourtman b40b82a07b Transition Patrol claim to lifecycle ordering 2026-07-16 11:31:10 +01:00
rcourtman 07cbdd792b Separate subscription adapter trust boundaries 2026-07-16 10:44:53 +01:00
rcourtman b83a6a6457 Reserve Patrol subscription trust-boundary work 2026-07-16 10:39:16 +01:00
rcourtman 0f8d61a696 Release Patrol subscription timeout claim 2026-07-16 10:37:13 +01:00
rcourtman 47f2bdaed4 Add Go branch-coverage tests for pure config and helper packages
Adds table-driven branch-coverage unit tests for previously untested pure
helper functions across internal/alerts/config, internal/config,
internal/ai/safety, internal/ai/modelresolution, internal/operationreceipt,
internal/models, internal/securityutil and pkg/securityutil. New test files
only, with no source changes.

Covers alert-config normalization and validation, sensitive-path and
redaction classifiers, URL normalizers, provider model resolution,
operation-receipt decoding, credential masking, and account-to-org role
mapping. 57 TestBranchCov functions in 12 files, all vet and gofmt clean.
2026-07-16 10:19:51 +01:00
rcourtman 4dcba3a1d8 Name the actual OIDC token verification failure on the login page
Every ID token verification failure rendered the issuer-mismatch
advice, sending users with audience or clock problems down the wrong
path and telling users with a genuine issuer mismatch nothing they had
not already checked (#1533). Map the distinct verification failures
(issuer, audience, expiry) to their own error codes and give each
accurate login-page copy pointing at the server log's got/want detail.
2026-07-16 10:15:42 +01:00
rcourtman 506d2e5b7e Serve agent config from continuity state during reload windows
A full monitor reload tears the state down and rebuilds it empty, so
agent-reported host rows vanish until each agent's next report lands.
Config fetches in that window 404ed with a perfectly valid token, which
showed up as rare correlated agent_config_fetch failures across
unrelated agents (#1570).

When the live snapshot has no match, resolve the host from the
persisted continuity store with the same semantics as the live path. A
report-scoped token resolves only its bound host and manage-scoped
tokens resolve by host ID. Deliberately removed hosts stay 404 because
removal deletes their continuity entry.
2026-07-16 10:13:14 +01:00
rcourtman cdae56df0f Align qualification wait with subscription preflight 2026-07-16 10:05:20 +01:00
rcourtman b84f650e77 Allow bounded subscription-agent preflights 2026-07-16 09:54:34 +01:00
rcourtman 2bc48774c2 Let deleted hosts re-enroll with a freshly generated token
Deleting a host writes a machine-id-keyed removal block that rejected
every future report with HTTP 400, and the error pointed at an Allow
reconnect control that is not wired into the UI, leaving the machine
permanently unable to enroll without changing its machine-id (#1581).

Three holes made the block effectively immortal:
- The 24h TTL sweep only iterated the in-memory removal maps, which
  reset on every restart, so persisted blocks never expired. Sweep the
  persisted entries by their own RemovedAt for host agents, Docker
  hosts, and Kubernetes clusters.
- AllowHostAgentReenroll (and the Docker and Kubernetes equivalents)
  bailed out when the ID was missing from the in-memory map, so even
  the API escape hatch stopped clearing persisted blocks after a
  restart. Check and clear the persisted store independently.
- A report presenting an API token created after the removal is
  explicit re-add intent (the user generated a fresh install command),
  so clear the block and accept it. A still-running old agent keeps
  presenting its pre-removal token and stays blocked.

Also reword the rejection to describe the two working recovery paths
instead of the unwired Settings control.
2026-07-16 09:50:04 +01:00
rcourtman 5867d439a3 Reconcile recovery points against source enumerations
The recovery store was upsert-only: backups and snapshots deleted at
the source lingered as recovery_points rows until the 90-day retention
prune. ListRollups kept returning a rollup with a frozen LastSuccessAt,
so the backup-age alert for a deleted guest re-raised every poll cycle
and acknowledging or clearing it could never stick (#1580).

Each backup poll already publishes a complete per-instance enumeration
(partial failures early-return or carry previous entries forward), so
attach a reconcile scope to that ingest batch. After the upsert, points
in the scope (provider + id class + instance) that were not part of the
enumeration are deleted, which lets the existing per-cycle alert sweep
resolve the alert. An empty enumeration is meaningful and clears the
scope, covering the delete-all-backups case from the report.

Also make the async ingest queue batches instead of overwriting the
single pending slot, which silently dropped a full poll cycle whenever
two sources coalesced behind an active batch.
2026-07-16 09:38:53 +01:00
rcourtman 99cb04fb89 Reserve Patrol subscription timeout qualification 2026-07-16 09:35:30 +01:00
rcourtman 4bd9b0c079 Show timezone on alert email start times
Alert start times are stored in UTC and the email templates rendered
them with no zone conversion or label, so the Started line read as a
local clock while showing UTC (#1582). Convert to the server's local
zone and include the zone name.
2026-07-16 09:29:01 +01:00
rcourtman c70431caaf Honor configured availability poll interval in the scheduler
An availability target's configured poll interval only seeded the
adaptive scheduler: BuildPlan derived every instance's cadence from the
global adaptive bounds, and a failing probe raised the staleness score
and error penalty, collapsing the probe interval toward the global
5-second minimum. With interval 120s and failure threshold 4 the alert
was promised after ~8 minutes of downtime but fired within the first
minute because the four consecutive failures accumulated at the
collapsed cadence (#1582).

Availability checks promise pollInterval x failureThreshold as the
detection window, so the cadence is a user contract, not a scheduling
hint. Add a FixedIntervalPollProvider extension that pins an instance
to its configured interval, implement it for availability targets, and
bypass adaptive selection wherever the next run is computed (plan
building, rescheduling, and the non-adaptive fallback paths).
2026-07-16 09:26:53 +01:00
rcourtman 4421945e9b Normalize v prefix in install.ps1 agent version check
The Windows installer compared the downloaded agent's --version output
(v6.0.5) against the server's /api/version value (6.0.5) literally, so
every matching install still warned about a version mismatch (#1527).
Strip the leading v from both sides before comparing, matching what
install.sh already does.
2026-07-16 09:16:51 +01:00
rcourtman 84d43e16e4 Release Patrol reporting reliability claim 2026-07-16 07:27:26 +01:00
rcourtman 362b96dbca Repair rejected Patrol finding batch siblings 2026-07-16 07:22:13 +01:00
rcourtman b397896be3 Harden Patrol multi-finding report guidance 2026-07-16 06:42:53 +01:00
rcourtman 7a8a090d37 Harden Patrol multi-finding report guidance 2026-07-16 06:40:17 +01:00
rcourtman 2614c39270 Reserve Patrol reporting reliability work 2026-07-16 06:32:42 +01:00
rcourtman 513243314a Release repeated restart evidence claim 2026-07-15 21:22:30 +01:00
rcourtman c527405f16 Reject invalid Patrol reconfirmation prerequisites 2026-07-15 21:20:56 +01:00
rcourtman f8aac166b6 Treat repeated container restarts as actionable evidence 2026-07-15 20:42:17 +01:00
rcourtman 6921ea40bc Reserve repeated restart evidence claim 2026-07-15 20:36:38 +01:00
rcourtman 15a6990da4 Release grounded Patrol finding claim 2026-07-15 19:35:39 +01:00
rcourtman e9b23455ba Prevent Patrol from echoing untrusted instructions 2026-07-15 18:59:40 +01:00
rcourtman 473d5ed1b5 Require grounded actionable Patrol findings 2026-07-15 18:44:33 +01:00
rcourtman 960892efa3 Reserve actionable Patrol finding claim 2026-07-15 18:36:38 +01:00
rcourtman 7c21b670ac Release authoritative Docker OOM alert claim 2026-07-15 17:57:15 +01:00
rcourtman e3382c8bcb Use authoritative Docker OOM evidence 2026-07-15 17:55:26 +01:00
rcourtman e499f92360 Reserve authoritative Docker OOM alert claim 2026-07-15 17:38:35 +01:00
rcourtman 2b44f2b0b8 Release Patrol qualification confidence claim 2026-07-15 17:36:40 +01:00
rcourtman a39150ba4c Make qualification profiles statistically passable 2026-07-15 17:34:57 +01:00
rcourtman bb12f45ffb Reserve Patrol qualification confidence claim 2026-07-15 17:29:54 +01:00
rcourtman b27a97491b Release Patrol evidence continuity claim 2026-07-15 17:23:56 +01:00
rcourtman 3bf6d7d8f8 Renew Patrol evidence continuity claim 2026-07-15 15:51:46 +01:00
rcourtman d307fe8869 Preserve Patrol investigation evidence continuity 2026-07-15 15:43:18 +01:00
rcourtman 9e3765e19d Reserve Patrol evidence continuity claim 2026-07-15 15:32:01 +01:00
rcourtman 1eb736e359 Add branch-coverage tests for provider tool-artifact leak detectors
New table-driven tests raise branch coverage on
SplitTrailingProviderToolNamePrefix and the JSON and plain function
tool-call leak-index helpers, covering empty content, no-alnum tails,
prefix-hold versus pass-through and regex no-match paths. Test-only.
2026-07-15 15:11:02 +01:00
rcourtman b6ed899ad5 Add branch-coverage tests for provider context and tool-choice helpers
New table-driven tests raise branch coverage on ContextWindowTokens,
extractModelName, isDigits, rateLimitInfo, normalizeOpenAICompatibleChatURL,
stop-reason normalization and the OpenAI, Anthropic and Gemini tool-choice
converters, covering date-suffix stripping, malformed URLs and default arms.
Test-only, no source changes.
2026-07-15 15:08:59 +01:00