Commit Graph

796 Commits

Author SHA1 Message Date
rcourtman 76201e89ce Add deep-copy independence and qualification render coverage tests
Two more newly added *_w0716_coverage_test.go files from the same
branch-coverage wave, touching no source and no existing test.

- internal/models deep-copy clone independence for Docker, Kubernetes,
  ZFS and PBS clones, each mutating the original and asserting the clone
  stays unchanged
- internal/ai/qualification lab shell-quoting and resource-name
  rendering plus report replay predicates and markdown renderers
2026-07-16 22:56:24 +01:00
rcourtman e23448df7b Allow Patrol to record sequential findings 2026-07-16 22:50:11 +01:00
rcourtman c2b8d6b9a0 Add pure branch-coverage tests for the fresh Patrol and Docker drop
Cover previously-unexecuted branches in modules that gained behavior
since the last wave. All six are newly added *_w0716_coverage_test.go
files that modify no source and no existing test.

- internal/ai/chat investigation-budget injection plus the agentic
  tool-event and string helpers
- internal/ai/qualification manifest Validate error arms and the Patrol
  docker-predicate and finding-prerequisite validators
- internal/unifiedresources adapters transforms and ContractResourceType
- internal/config AIConfig nil-receiver default branches
- pkg/aicontracts orchestrator error methods and investigation config
2026-07-16 22:27:29 +01:00
rcourtman 4d80e53588 Align restart-loop qualification with Patrol threshold 2026-07-16 20:53:02 +01:00
rcourtman cae8477128 Preserve Patrol replay safety outcomes 2026-07-16 20:30:37 +01:00
rcourtman afbcd3023c Bound automatic Patrol inference allowances 2026-07-16 19:55:44 +01:00
rcourtman 676117bf27 Separate Patrol evidence and model-turn budgets 2026-07-16 17:50:08 +01:00
rcourtman b6e5f4d512 Align remediation qualification with Patrol policy 2026-07-16 17:01:37 +01:00
rcourtman 524aa16233 Add Go branch-coverage tests for monitoring cluster helpers and ai-tools formatting
Adds branch-coverage unit tests for previously uncovered pure functions in
internal/monitoring and internal/ai/tools. New test files only, with no source
changes.

Covers existing-cluster IP-override and fingerprint lookup, storage-summary
capacity-trend building, nouveau GPU temperature parsing, resolved-resource
control identity, and available-agent-host formatting. 32 TestBranchCov
functions in 2 files, all vet and gofmt clean.
2026-07-16 16:25:10 +01:00
rcourtman b91ba759c9 Route Claude native tool intent through Pulse 2026-07-16 16:09:48 +01:00
rcourtman d162110233 Make remediation fixtures model-neutral 2026-07-16 15:44:19 +01:00
rcourtman fb9584aae6 Add Go branch-coverage tests for alerts monitoring model-resolution ai and licensing helpers
Adds table-driven branch-coverage unit tests for previously uncovered pure
functions across internal/alerts/config, internal/ai/modelresolution,
internal/monitoring, internal/ai, internal/ai/qualification and pkg/licensing.
New test files only, with no source changes.

Covers per-subsystem alert-default normalization, configured model and provider
resolution, fleet-doctor identity and cluster-endpoint helpers, docker-state and
infrastructure-key mapping, investigation and SMART issue helpers, JSON and
autonomy normalization, and licensing feature-tier resolution. 65 TestBranchCov
functions in 7 files, all vet and gofmt clean.
2026-07-16 15:17:45 +01:00
rcourtman cde850c686 Isolate Patrol investigation dispatch from Watch runs 2026-07-16 14:06:01 +01:00
rcourtman d8557c9256 Shorten fake Google API key fixtures below secret-scanner shape 2026-07-16 13:40:38 +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 fddcc3fefe Honor Patrol lifecycle tool ordering 2026-07-16 11:39:23 +01:00
rcourtman 07cbdd792b Separate subscription adapter trust boundaries 2026-07-16 10:44:53 +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 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 362b96dbca Repair rejected Patrol finding batch siblings 2026-07-16 07:22:13 +01:00
rcourtman 7a8a090d37 Harden Patrol multi-finding report guidance 2026-07-16 06:40:17 +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 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 a39150ba4c Make qualification profiles statistically passable 2026-07-15 17:34:57 +01:00
rcourtman d307fe8869 Preserve Patrol investigation evidence continuity 2026-07-15 15:43:18 +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
rcourtman c775eed739 Add branch-coverage tests for qualification scorer and report helpers
New table-driven tests raise branch coverage on applyGates, ApplyProTrackGates,
findFault, bestFindingMatch, validatePredicates, ApplyQualificationGates,
canonicalToolInput, sanitizeArtifactText and allObservationsPassed, covering
previously uncovered gate arms, grounding misses, redaction and JSON edge
cases. Test-only, no source changes.
2026-07-15 15:04:26 +01:00
rcourtman 7da4890ce9 Add branch-coverage tests for AI tools command classifiers
New table-driven tests raise branch coverage on the timeout, curl/wget,
env and recovery-point canonicalization helpers in internal/ai/tools,
exercising previously uncovered flag-parsing arms, mutation-method
detection and numeric-detail type cases. Test-only, no source changes.
2026-07-15 15:02:19 +01:00
rcourtman 580093155f Resolve canonical Patrol discovery targets 2026-07-15 12:07:42 +01:00
rcourtman 87699dfff3 Align remediation qualification with advertised actions 2026-07-15 11:31:56 +01:00
rcourtman 03ae7d2b58 Score investigation facts without magic words 2026-07-15 10:56:12 +01:00
rcourtman cdc109d408 Publish Patrol investigation limits live 2026-07-15 10:49:16 +01:00
rcourtman a95edafcf1 Qualify model-led Patrol investigations 2026-07-15 10:32:16 +01:00
rcourtman a717790e90 Pin Patrol qualification routes per suite 2026-07-15 09:46:53 +01:00
rcourtman 2774744b11 Preserve canonical resource IDs in Patrol queries 2026-07-15 09:16:39 +01:00
rcourtman a8e42fc7fe Preserve coding-plan provenance in qualification 2026-07-15 00:06:56 +01:00
rcourtman 61ef640a51 Normalize subscription models before CLI execution 2026-07-14 23:45:10 +01:00
rcourtman f03b0c01e7 Add branch-coverage tests for tools canonical query helpers
New white-box table tests over the pure resource-resolution helpers in
internal/ai/tools/current_resource.go, taking canonicalQueryTypeForResolvedResource,
canonicalQueryIDForResolvedResource and resolvedResourceKindMatchesLocation from
partial to full branch coverage. Every kind switch arm, the provider-uid then
resource-id then alias fallback chain, and the nil guards are pinned to exact
output.

One file, tests only, no source changes. Gates green with go test, gofmt and go
vet, plus an adversarial GLM review scoring three KEEP and zero reject.
2026-07-14 23:38:09 +01:00
rcourtman 63442b7fe4 Add branch-coverage tests for patrol runtime failure classifiers
New white-box table tests over the pure error classifiers in
internal/ai/patrol_runtime_failure.go, taking ClassifyProviderConnectionFailure
from 18 percent to full coverage and closing the residual branches in
patrolRuntimeFailureFromError and summarizePatrolRuntimeFailureDetail. Every
reachable switch arm is pinned to its exact diagnostic output, and the four
grouped causes that only preflight and readiness state can set are documented
as out of reach from a plain error input rather than faked.

One file, tests only, no source changes. Gates green with go test, gofmt and
go vet, plus an adversarial GLM review scoring two KEEP, one WEAK and zero
reject.
2026-07-14 23:23:14 +01:00
rcourtman 89a7b88093 Distinguish subscription allowances from API spend 2026-07-14 23:12:37 +01:00
rcourtman 99615c18e3 Support Patrol streaming on subscription routes 2026-07-14 23:05:28 +01:00
rcourtman 917a9e5421 Add local subscription model routes 2026-07-14 22:57:38 +01:00
rcourtman d0d8426cb9 Add branch-coverage tests for qualification contribution helpers
New white-box table tests over the pure validators, predicates and readme
renderer in internal/ai/qualification/contribution.go, covering
ValidateContributionChallenge, validateContributionIdentity,
everyRunChallengeBound, observationsPassedOrEmpty, reportPhasePassed,
ContributionBundle.Validate and renderContributionReadme.

One file, tests only, no source changes. Gates green with go test, gofmt
and go vet, plus an adversarial GLM review scoring seven KEEP and zero
reject.
2026-07-14 22:50:13 +01:00