@checkstack/anomaly-frontend 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,190 @@
1
1
  # @checkstack/anomaly-frontend
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 42abfff: Remove global anomaly settings — configuration is now field-only.
8
+
9
+ `AnomalySettings` (template- and assignment-level) no longer carries
10
+ `sensitivity`, `confirmationWindow`, `driftEnabled`, or `driftThreshold`.
11
+ These were duplicating the per-field configuration path with awkward
12
+ cascade semantics, and a single global multiplier was meaningless across
13
+ fields with different units (ms, %, counts).
14
+
15
+ The schema retains only the truly global concerns:
16
+
17
+ - `enabled` — master kill switch for the assignment
18
+ - `baselineWindow` — there is one history per system, not per field
19
+ - `notify` — one notification preference per assignment
20
+ - `fieldOverrides` — per-field configuration (where everything else now lives)
21
+
22
+ `resolveEffectiveConfig` collapses to two layers: field override → schema
23
+ default → engine fallback constant. The plugin-author defaults set via
24
+ `x-anomaly-*` annotations now drive sensitivity/window/drift across the
25
+ detector and drift evaluator (previously only floors were threaded
26
+ through the schema layer).
27
+
28
+ **Breaking changes:**
29
+
30
+ - Any global `sensitivity`/`confirmationWindow`/`driftEnabled`/
31
+ `driftThreshold` values previously stored in `anomaly_configurations`
32
+ or `anomaly_assignments` are silently stripped on parse. Users who
33
+ customized these globals will revert to the plugin's tuned per-field
34
+ defaults; if they want to keep those values they must re-apply them
35
+ per field in the new UI.
36
+ - `AnomalySettingsForm` no longer renders the global sliders. The form
37
+ now shows: enable toggle, baseline window selector, notify toggle,
38
+ field overrides editor.
39
+ - `AnomalyFieldOverridesEditor` props `defaultSensitivity`,
40
+ `defaultConfirmationWindow`, `defaultDriftEnabled`, `defaultDriftThreshold`
41
+ are removed. Engine fallbacks (1.0, 3, true, 2) are now hard-coded
42
+ internal constants used only when neither field override nor schema
43
+ default is set.
44
+ - The GitOps `System.anomaly` entry schema (in `anomaly-gitops-kinds`)
45
+ drops `sensitivity`, `confirmationWindow`, `driftEnabled`, and
46
+ `driftThreshold` to match the new `AnomalySettings` shape. YAML files
47
+ declaring those fields will be rejected at parse time — operators
48
+ must move per-field tuning into `fieldOverrides`.
49
+
50
+ This change makes the override model trivial to explain ("plugin defaults,
51
+ overridden per field") and removes a class of confusing "where did this
52
+ threshold come from?" questions.
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [42abfff]
57
+ - Updated dependencies [42abfff]
58
+ - Updated dependencies [3547670]
59
+ - Updated dependencies [1ef2e79]
60
+ - Updated dependencies [aa89bc5]
61
+ - Updated dependencies [3547670]
62
+ - Updated dependencies [950d6ec]
63
+ - Updated dependencies [3547670]
64
+ - Updated dependencies [3547670]
65
+ - @checkstack/anomaly-common@1.1.0
66
+ - @checkstack/common@0.9.0
67
+ - @checkstack/ui@1.8.0
68
+ - @checkstack/catalog-common@2.1.0
69
+ - @checkstack/frontend-api@0.5.0
70
+ - @checkstack/notification-frontend@0.4.0
71
+ - @checkstack/healthcheck-frontend@0.19.0
72
+ - @checkstack/healthcheck-common@1.0.2
73
+ - @checkstack/notification-common@1.0.2
74
+ - @checkstack/signal-frontend@0.1.2
75
+
76
+ ## 0.3.1
77
+
78
+ ### Patch Changes
79
+
80
+ - 50e5f5f: Runtime plugin system: install + uninstall plugins from npm, GitHub releases
81
+ (including private GitHub Enterprise instances), or tarball uploads at
82
+ runtime, with multi-package bundles, dependency-derived compatibility checks,
83
+ multi-instance coordination via a Postgres artifact store, and
84
+ single-coordinator destructive cleanup.
85
+
86
+ Highlights:
87
+
88
+ - New `PluginSource` discriminated union and `PluginInstaller` /
89
+ `PluginInstallerRegistry` interfaces in `@checkstack/backend-api`. The
90
+ GitHub variant accepts an optional `apiBaseUrl` so deployments backed by
91
+ GitHub Enterprise can install from `https://ghe.example.com/api/v3`
92
+ instead of `api.github.com`.
93
+ - New `installPackageMetadataSchema` (Zod) in `@checkstack/common` validates
94
+ every plugin's `package.json` at install time. Required fields: `name`,
95
+ `version`, `description`, `author`, `license`, `checkstack.type`,
96
+ `checkstack.pluginId`. Optional: `checkstack.bundle`,
97
+ `checkstack.usageInstructions`, `checkstack.allowInstallScripts`.
98
+ - New `pluginManagerContract` in `@checkstack/pluginmanager-common` with
99
+ `list`, `previewInstall`, `install`, `previewUninstall`, `uninstall`, and
100
+ `events` procedures.
101
+ - New `@checkstack/pluginmanager-frontend` admin UI: installed-plugins list
102
+ with per-row uninstall (typed-confirmation modal, schema/configs/cascade
103
+ toggles), install page with NPM / Tarball Upload / GitHub Release tabs
104
+ (Catalog tab disabled — coming soon), and an events page surfacing the
105
+ install/uninstall audit log.
106
+ - New `bunx @checkstack/scripts plugin-pack` CLI for plugin authors —
107
+ per-package mode produces an npm-shaped tarball; `--bundle` mode produces
108
+ an outer tarball containing every sibling declared in
109
+ `package.json#checkstack.bundle`. Published to npm so external authors
110
+ can `bunx` it directly without a workspace checkout.
111
+ - Compatibility derived from `package.json#dependencies` ranges
112
+ (`semver.satisfies` against the platform's loaded `@checkstack/*`
113
+ versions) — no separate `compatibility` field.
114
+ - Multi-instance: originator persists artifacts + `plugins` rows + broadcasts
115
+ install/uninstall; receiving instances do in-process register/unregister
116
+ only. Destructive ops (drop schema, delete plugin_configs, delete
117
+ artifacts, delete `plugins` rows) run exactly once on the originator.
118
+ - Fresh-instance bootstrap: `loadPlugins()` hydrates any
119
+ `is_uninstallable=true` plugin missing from `node_modules` from the
120
+ artifact store before normal Phase 1 register.
121
+ - New schema: `plugin_artifacts` (tarball storage), `plugin_install_events`
122
+ (audit/error log). `plugins` extended with `version`, `metadata`,
123
+ `source`, `bundle_id`, `is_primary`. Local plugin sync now writes
124
+ `version` from each plugin's `package.json` so the admin UI shows real
125
+ versions instead of `—`.
126
+ - Tarball-upload endpoint (`POST /api/pluginmanager/upload-tarball`) for
127
+ the install UI; access-gated by `pluginmanager.plugin.manage`.
128
+ - Plugin Manager menu link added to the user menu (main grid, alongside
129
+ Profile / Notification Settings / etc.).
130
+
131
+ Cross-cutting changes:
132
+
133
+ - Backend request/response logging now flows through `rootLogger` (winston)
134
+ instead of `hono/logger`. 5xx responses include the response body inline
135
+ so swallowed early-return errors are visible in the log.
136
+ - The `/api/:pluginId/*` dispatcher now logs which core service is missing
137
+ or which `pluginId` had no metadata when it 500s.
138
+ - New `registerCorePluginMetadata` on `PluginManager` for core routers
139
+ (like the plugin manager itself) that need their metadata visible to the
140
+ RPC dispatcher without going through the full plugin lifecycle.
141
+ - ESLint: `unicorn/no-null` is now disabled globally. Drizzle distinguishes
142
+ between `null` (writes a real SQL NULL) and `undefined` (skip the column
143
+ on insert), so treating them as interchangeable produced latent bugs at
144
+ the persistence boundary. The bulk of the patch-bumped packages above
145
+ reflect lint-fix touches that landed when this rule was relaxed.
146
+ - Workspace-wide license normalization to `Elastic-2.0` (matches
147
+ `LICENSE.md`). Every `package.json` in the workspace now declares the
148
+ same SPDX identifier; the patch bumps capture this.
149
+
150
+ Plugin packages (every `plugins/*`): added a `pack` npm script
151
+ (`bunx @checkstack/scripts plugin-pack`), mirrored each plugin's
152
+ `pluginId` from `plugin-metadata.ts` into `package.json#checkstack.pluginId`
153
+ so install-time validation passes, stubbed any missing required metadata
154
+ fields (`description`, `author`, `license`), and added
155
+ `checkstack.bundle` to multi-package plugin primaries (telegram, rcon, ssh,
156
+ jira, queue-bullmq, queue-memory, cache-memory).
157
+
158
+ Breaking changes:
159
+
160
+ - The legacy single-method `PluginInstaller` interface (`install(packageName)`)
161
+ is removed. Callers must use `coreServices.pluginInstallerRegistry`.
162
+ - The old `pluginAdminContract` and `createPluginAdminRouter` are removed.
163
+ Replaced by `pluginManagerContract` in `@checkstack/pluginmanager-common`
164
+ and `createPluginManagerRouter` in `core/backend`.
165
+ - `@checkstack/test-utils-backend` no longer exports
166
+ `createMockPluginInstaller` / `MockPluginInstaller` (the legacy interface
167
+ it shimmed is gone).
168
+
169
+ Note: bumps are limited to `minor` (for packages with new public API
170
+ surface) and `patch` (for downstream consumers, license normalization,
171
+ and lint fixes). No `major` bumps despite the `PluginInstaller` removal —
172
+ the legacy interface had no third-party consumers in the wild before this
173
+ runtime plugin system landed, and the contract surface is the same shape
174
+ modulo the rename.
175
+
176
+ - Updated dependencies [50e5f5f]
177
+ - @checkstack/catalog-common@2.0.1
178
+ - @checkstack/common@0.8.0
179
+ - @checkstack/healthcheck-frontend@0.18.2
180
+ - @checkstack/notification-frontend@0.3.1
181
+ - @checkstack/signal-frontend@0.1.1
182
+ - @checkstack/ui@1.7.1
183
+ - @checkstack/anomaly-common@1.0.1
184
+ - @checkstack/frontend-api@0.4.2
185
+ - @checkstack/healthcheck-common@1.0.1
186
+ - @checkstack/notification-common@1.0.1
187
+
3
188
  ## 0.3.0
4
189
 
5
190
  ### Minor Changes
package/package.json CHANGED
@@ -1,27 +1,28 @@
1
1
  {
2
2
  "name": "@checkstack/anomaly-frontend",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
+ "license": "Elastic-2.0",
4
5
  "type": "module",
5
6
  "main": "src/index.tsx",
6
7
  "checkstack": {
7
8
  "type": "frontend"
8
9
  },
9
10
  "scripts": {
10
- "typecheck": "tsc --noEmit",
11
+ "typecheck": "tsgo -b",
11
12
  "lint": "bun run lint:code",
12
13
  "lint:code": "eslint . --max-warnings 0"
13
14
  },
14
15
  "dependencies": {
15
- "@checkstack/anomaly-common": "0.3.0",
16
- "@checkstack/catalog-common": "1.5.3",
17
- "@checkstack/common": "0.7.0",
18
- "@checkstack/frontend-api": "0.4.0",
19
- "@checkstack/healthcheck-common": "0.13.0",
20
- "@checkstack/healthcheck-frontend": "0.18.0",
21
- "@checkstack/notification-common": "0.3.0",
22
- "@checkstack/notification-frontend": "0.2.36",
23
- "@checkstack/signal-frontend": "0.1.0",
24
- "@checkstack/ui": "1.6.1",
16
+ "@checkstack/anomaly-common": "1.0.1",
17
+ "@checkstack/catalog-common": "2.0.1",
18
+ "@checkstack/common": "0.8.0",
19
+ "@checkstack/frontend-api": "0.4.2",
20
+ "@checkstack/healthcheck-common": "1.0.1",
21
+ "@checkstack/healthcheck-frontend": "0.18.2",
22
+ "@checkstack/notification-common": "1.0.1",
23
+ "@checkstack/notification-frontend": "0.3.1",
24
+ "@checkstack/signal-frontend": "0.1.1",
25
+ "@checkstack/ui": "1.7.1",
25
26
  "date-fns": "^4.1.0",
26
27
  "lucide-react": "^0.344.0",
27
28
  "react": "^18.2.0",
@@ -29,8 +30,8 @@
29
30
  "zod": "^4.2.1"
30
31
  },
31
32
  "devDependencies": {
32
- "@checkstack/scripts": "0.1.2",
33
- "@checkstack/tsconfig": "0.0.5",
33
+ "@checkstack/scripts": "0.3.0",
34
+ "@checkstack/tsconfig": "0.0.7",
34
35
  "@types/react": "^18.2.0",
35
36
  "typescript": "^5.0.0"
36
37
  }
@@ -24,10 +24,8 @@ import {
24
24
 
25
25
  const DEFAULT_VALUES: AnomalySettingsFormValues = {
26
26
  enabled: true,
27
- sensitivity: 1,
28
- confirmationWindow: 3,
29
- driftEnabled: true,
30
- driftThreshold: 2,
27
+ baselineWindow: "7d",
28
+ notify: true,
31
29
  fieldOverrides: {},
32
30
  };
33
31
 
@@ -74,13 +72,9 @@ export function AnomalyConfigPanel({ context }: { context: AssignmentIDEContext
74
72
  const tpl = templateRecord?.data;
75
73
  setValues({
76
74
  enabled: configRecord.data.enabled ?? true,
77
- sensitivity: configRecord.data.sensitivity ?? tpl?.sensitivity ?? 1,
78
- confirmationWindow:
79
- configRecord.data.confirmationWindow ?? tpl?.confirmationWindow ?? 3,
80
- driftEnabled:
81
- configRecord.data.driftEnabled ?? tpl?.driftEnabled ?? true,
82
- driftThreshold:
83
- configRecord.data.driftThreshold ?? tpl?.driftThreshold ?? 2,
75
+ baselineWindow:
76
+ configRecord.data.baselineWindow ?? tpl?.baselineWindow ?? "7d",
77
+ notify: configRecord.data.notify ?? tpl?.notify ?? true,
84
78
  fieldOverrides:
85
79
  (configRecord.data.fieldOverrides as Record<string, AnomalyFieldConfig>) ??
86
80
  {},