Commit Graph

1796 Commits

Author SHA1 Message Date
rcourtman
f56df44a76 refactor(33-data-model-integrity): protect state getters in internal/updates 2026-02-12 01:22:38 +00:00
rcourtman
6b3a90b310 refactor(33-data-model-integrity): reset derived child state in internal/unifiedresources 2026-02-12 01:17:57 +00:00
rcourtman
1533b58166 refactor(33-data-model-integrity): enforce io metric json fields in internal/types 2026-02-12 01:12:45 +00:00
rcourtman
ebb4d13f31 refactor(33-data-model-integrity): preserve snapshot integrity in internal/truenas 2026-02-12 00:54:28 +00:00
rcourtman
a9bdf21aae refactor(33-data-model-integrity): reconcile known_hosts cache state in internal/ssh 2026-02-12 00:49:04 +00:00
rcourtman
6d3bac744c refactor(33-data-model-integrity): preserve optional SMART status semantics in internal/smartctl 2026-02-12 00:43:59 +00:00
rcourtman
963da3841b refactor(33-data-model-integrity): fix stale discovery age checks in internal/servicediscovery 2026-02-12 00:37:50 +00:00
rcourtman
c4826fbafd refactor(33-data-model-integrity): normalize millidegree parsing in internal/sensors 2026-02-12 00:29:28 +00:00
rcourtman
2c50583522 refactor(33-data-model-integrity): bind signed config host identity in internal/remoteconfig 2026-02-12 00:24:36 +00:00
rcourtman
08d3681c13 refactor(33-data-model-integrity): harden stop-state lifecycle in internal/notifications 2026-02-12 00:19:51 +00:00
rcourtman
87cbaafc88 refactor(33-data-model-integrity): preserve active circuit-breaker state in internal/monitoring 2026-02-12 00:15:17 +00:00
rcourtman
edd04a322c refactor(33-data-model-integrity): omit zero token last-used timestamps in internal/models 2026-02-12 00:07:05 +00:00
rcourtman
9c3cf84705 refactor(config-validation): harden remote config client validation in internal/remoteconfig 2026-02-11 20:16:58 +00:00
rcourtman
e012cc328e ai: harden explore/read-only reliability and stream recovery 2026-02-11 19:39:04 +00:00
rcourtman
40a6f91513 feat(onboarding): instrument unified agent install telemetry 2026-02-11 18:58:39 +00:00
rcourtman
6de597ce2f test(updates): fix history constants and stale manager queue assertions 2026-02-11 18:22:25 +00:00
rcourtman
43ec020122 refactor(api): unify agent install command generation 2026-02-11 18:19:48 +00:00
rcourtman
9caa808c26 refactor(error-handling): harden scan error paths in internal/discovery 2026-02-11 14:54:23 +00:00
rcourtman
c216ff07b7 refactor(error-handling): wrap crypto errors in internal/crypto 2026-02-11 14:48:53 +00:00
rcourtman
506bafd533 refactor(error-handling): harden recovery paths in internal/config 2026-02-11 14:44:19 +00:00
rcourtman
1794e5cbf1 refactor(error-handling): strengthen provisioning error context in internal/cloudcp 2026-02-11 14:38:37 +00:00
rcourtman
ea4c94c199 refactor(05-error-handling): improve file cleanup errors in internal/alerts 2026-02-11 14:32:32 +00:00
rcourtman
ee2819f3b9 feat(ai): add explore status events and observability rules 2026-02-11 14:31:12 +00:00
rcourtman
45b78993f3 refactor(error-handling): wrap bare error returns and check Close() in internal/dockeragent
- Wrap bare error returns in verifyELFMagic, collectOnce, sendReport,
  disableSelf, and removeFileIfExists with fmt.Errorf context
- Explicitly discard Close() errors in cleanup paths (self_update.go,
  container_update.go)
2026-02-11 14:24:32 +00:00
rcourtman
2a39045ee1 refactor(error-handling): check RowsAffected() errors in internal/cloudcp/registry
Previously 8 calls to res.RowsAffected() discarded the error with `_`.
Now properly check and return wrapped errors.
2026-02-11 14:22:43 +00:00
rcourtman
944b8a6d76 refactor(error-handling): use defer for file.Close() in internal/api agent download handlers 2026-02-11 14:16:37 +00:00
rcourtman
7150b7d0f4 refactor(error-handling): improve error handling in internal/ai 2026-02-11 14:14:28 +00:00
rcourtman
5ba9086d78 refactor(error-handling): wrap bare error returns in internal/agentbinaries 2026-02-11 14:12:42 +00:00
rcourtman
7204a76e3a refactor(error-handling): log rename failure in logging rotation
rotateLocked() silently swallowed rename errors during log rotation.
Now reports failures to stderr (can't use log package from within the
logging package itself).
2026-02-11 14:08:53 +00:00
rcourtman
477ef4a8b8 refactor(error-handling): check JSON decode error in ai/eval patrol runner
waitForPatrolIdle() silently discarded json.Decode errors, causing
it to treat decode failures as "patrol is idle" (zero-value false).
Now returns an error on decode failure.
2026-02-11 14:08:43 +00:00
rcourtman
9f015ae744 refactor(error-handling): improve error handling in agentupdate and agentexec
- Wrap bare return err in verifyBinaryMagic with context (file path)
- Log previously ignored sendMessage errors in agent WebSocket server
- Log invalid regex patterns in command policy compilation instead of silent skip
2026-02-11 14:03:52 +00:00
rcourtman
8fbafa849e refactor(naming-consistency): fix vmid → vmID casing in internal/alerts
Rename vmid local variables, parameters, and struct fields to vmID to
follow Go acronym conventions. String literals and log field names are
unchanged.
2026-02-11 13:51:44 +00:00
rcourtman
354722f152 refactor(naming-consistency): fix ContainerId → ContainerID in internal/api types
Rename VersionResponse.ContainerId to ContainerID to follow Go acronym
conventions. JSON tag remains unchanged for wire compatibility.
2026-02-11 13:46:45 +00:00
rcourtman
88d51f4a6e refactor(naming-consistency): fix acronym casing in internal/models frontend types
Rename LinkedHostAgentId → LinkedHostAgentID and LinkedNodeId → LinkedNodeID
in NodeFrontend and HostFrontend structs to follow Go acronym conventions.
JSON tags remain unchanged for wire compatibility.
2026-02-11 13:46:35 +00:00
rcourtman
8238a73b8b refactor(naming-consistency): fix acronym casing in internal/api sso_handlers.go
Rename Go identifiers to follow Go convention for acronyms (all-caps):
- JwksURI → JWKSURI (JWKS + URI)
- SAMLACSUrl → SAMLACSURL (SAML + ACS + URL)

JSON wire tags unchanged.
2026-02-11 13:29:31 +00:00
rcourtman
96e423fc81 fix(hosted): skip bootstrap token screen in hosted mode
In hosted mode, authentication is handled by the cloud handoff flow,
so the bootstrap token is unnecessary. Without this fix, tenants show
the "paste your bootstrap token" screen after login.
2026-02-11 13:20:41 +00:00
rcourtman
3200b80952 refactor(duplicate-functions): extract runSystemctlCommand helper in internal/dockeragent
disableSystemdService and stopSystemdService had nearly identical logic
for running systemctl, handling exit codes, and formatting errors.
Extracted shared runSystemctlCommand() parameterized by action name.
2026-02-11 13:13:43 +00:00
rcourtman
1066cd457e refactor(duplicate-functions): extract collectAgentHostnames helper in internal/ai/tools
formatTargetHostRequired and formatAvailableAgentHosts had identical
hostname-extraction loops. Extracted shared collectAgentHostnames()
helper to eliminate the duplication.
2026-02-11 13:11:50 +00:00
rcourtman
824168941b feat(cloudcp): switch email provider from Postmark to Resend
Resend is already used by the license server and finance workflows, so
using it here avoids a second provider. The admin magic-link endpoint
now accepts send_email to deliver the link directly via Resend.

Env var: POSTMARK_SERVER_TOKEN -> RESEND_API_KEY
2026-02-11 13:03:22 +00:00
rcourtman
80be9db632 feat(cloudcp): add admin magic link generation endpoint
POST /admin/magic-link (admin-key authenticated) accepts {email, tenant_id}
and returns a ready-to-send magic link URL, replacing the need for manual
scripts on the droplet.
2026-02-11 12:50:55 +00:00
rcourtman
51c983f91f ai(chat): harden explore pre-pass isolation and observability
- Add explore telemetry (outcomes, latency, tokens) to AI metrics\n- Isolate explore loop state from main loop FSM/knowledge accumulator\n- Emit user-visible explore trace via thinking stream events\n- Switch to structured <explore_context> injection block\n- Expand tests for trace visibility and explicit-model fallback behavior
2026-02-11 12:12:10 +00:00
rcourtman
a8abdd73ae ai(chat): enforce explicit BYOK model selection for explore
- Resolve explore models only from explicit user-configured fields\n- Selection order: request override, DiscoveryModel, ChatModel, Model\n- Skip explore when no explicit model is configured\n- Add regression test coverage for no-explicit-model behavior
2026-02-11 11:17:36 +00:00
rcourtman
2e01a1cab8 refactor(dead-code): remove unused HostFieldMatches in internal/ssh 2026-02-11 10:07:13 +00:00
rcourtman
59ba3b1f93 fix(router): dispatch /auth/ paths to mux instead of SPA handler
The ServeHTTP method only routed /api/, /ws, /socket.io/, and /download/
prefixes to the mux — /auth/cloud-handoff fell through to the frontend
SPA handler, breaking the cloud login flow.
2026-02-11 10:03:38 +00:00
rcourtman
6fcd2aaefb refactor(dead-code): remove unused symbols in internal/servicediscovery 2026-02-11 10:02:39 +00:00
rcourtman
e5e35b9933 refactor(dead-code): remove unused marshalStatus in internal/relay 2026-02-11 09:52:15 +00:00
rcourtman
bfafe0ac77 ai(chat): add default-on explore pre-pass for interactive chat
- Add read-only explore scout pre-pass before main ExecuteStream loop\n- Inject concise explore findings into main user-context message\n- Use discovery model when configured, fallback safely to chat provider\n- Exclude explore in autonomous mode and support backend kill switch via PULSE_EXPLORE_ENABLED\n- Add coverage for read-only tool filtering and enabled/disabled explore behavior
2026-02-11 09:33:44 +00:00
rcourtman
f98de80634 refactor(dead-code): remove unused symbols in internal/metrics
Remove 2 dead exported methods and 3 cascading dead helpers:
- GetRecentWindows() - no production callers
- FormatForContext() - no production callers
- floatToString(), signedFloatToString(), padLeft() - only used by FormatForContext
2026-02-11 09:33:28 +00:00
rcourtman
e8d2990074 refactor(dead-code): remove unused symbols in internal/license
Remove 5 unused symbols:
- ErrNoLicense from license.go
- EventOrgCreated, EventNotificationSent, EventTenantSwitch from metering/event.go
- OpReadOnly from subscription/state.go
2026-02-11 09:27:43 +00:00
rcourtman
715b6c5f9c refactor(dead-code): remove unused ErrInternalError and WrapAuthError in internal/errors 2026-02-11 09:12:57 +00:00