@checkstack/healthcheck-common 0.10.0 → 0.11.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,84 @@
1
1
  # @checkstack/healthcheck-common
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 26d8bae: Distributed satellite health checks and Assignment IDE page
8
+
9
+ **Satellite System**
10
+
11
+ - New `satellite-backend`, `satellite-common`, `satellite-frontend`, and `satellite` agent packages for distributed health check execution
12
+ - WebSocket-based satellite connectivity with authentication, heartbeats, and live configuration push
13
+ - Satellite management UI with create dialog, status badges, and list page
14
+
15
+ **Live Configuration Updates**
16
+
17
+ - Added `assignmentChanged` hook to `healthcheck-backend` for cross-plugin communication
18
+ - `satellite-backend` subscribes to assignment changes and pushes config updates to connected satellites in real-time
19
+
20
+ **Assignment IDE Page**
21
+
22
+ - Replaced the 1028-line modal-based `SystemHealthCheckAssignment` component with a full-page IDE layout
23
+ - New modular components: `AssignmentTree`, `GeneralPanel`, `ThresholdsPanel`, `RetentionPanel`, `ExecutionPanel`
24
+ - Added unassign capability and sorted assignment lists for stable ordering
25
+
26
+ **Shared IDE Primitives**
27
+
28
+ - Extracted `IDETreeNode`, `IDETreeSection`, `IDEStatusBar`, `IDELayout` to `@checkstack/ui` for cross-plugin reuse
29
+ - Migrated existing health check IDE editor to use shared primitives
30
+
31
+ **Infrastructure**
32
+
33
+ - Added `Dockerfile.satellite` for containerized satellite deployment
34
+ - WebSocket route registry in `@checkstack/backend` and `@checkstack/backend-api`
35
+
36
+ - 26d8bae: Source attribution and filtering for satellite health checks
37
+
38
+ **Source Attribution**
39
+
40
+ - Fixed satellite result attribution: runs from satellites now correctly display their source instead of defaulting to "Local"
41
+ - Added `sourceId` and `sourceLabel` to both public and detailed history API responses
42
+
43
+ **Source Filtering**
44
+
45
+ - Added `sourceFilter` parameter to `getHistory`, `getDetailedHistory`, and `getDetailedAggregatedHistory` RPC endpoints
46
+ - Source filter supports "local" (core-only), specific satellite UUID, or all sources
47
+ - Filter applies to all three aggregation tiers (raw, hourly, daily)
48
+
49
+ **Frontend**
50
+
51
+ - System detail accordion shows source filter buttons (All / Local / per-satellite) next to date range filter
52
+ - Filter applies to both charts and recent runs table
53
+ - Source column added to the recent runs table with Local/Remote badges
54
+ - Health check history detail page includes per-satellite source filter buttons
55
+
56
+ ## 0.10.1
57
+
58
+ ### Patch Changes
59
+
60
+ - 3c34b07: Complete SLO Reliability Engine frontend and backend
61
+
62
+ **Frontend** — 7 new visualization components:
63
+
64
+ - `StreakCounter`: Fire-themed compliance streak counter with color-coded flame and best-streak trophy
65
+ - `AchievementBadge`: Emoji-labeled badges for 9 achievement types with hover tooltip
66
+ - `AttributionChart`: Horizontal stacked bar showing error budget split (self/upstream/remaining)
67
+ - `DowntimeTimeline`: Dot-and-line timeline with attribution badges and timestamps
68
+ - `SloTrendChart`: Pure SVG availability trend line chart from daily snapshots
69
+ - `MilestoneFeed`: Organization-wide milestone feed on the SLO overview sidebar
70
+ - `DependencyExclusionConfig`: Interactive upstream dependency picker for SLO editor
71
+
72
+ **Backend** — Weekly digest scheduled integration event:
73
+
74
+ - `weekly-digest.ts`: Cron job (Monday 09:00 UTC) emitting SLO performance summary
75
+ - Top/worst performers, breach counts, and streak data delivered via configured notification channels
76
+ - New `sloWeeklyDigest` hook registered as integration event
77
+
78
+ - Updated dependencies [d1a2796]
79
+ - @checkstack/common@0.6.5
80
+ - @checkstack/signal-common@0.1.9
81
+
3
82
  ## 0.10.0
4
83
 
5
84
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-common",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -8,13 +8,13 @@
8
8
  }
9
9
  },
10
10
  "dependencies": {
11
- "@checkstack/common": "0.6.4",
12
- "@checkstack/signal-common": "0.1.8",
11
+ "@checkstack/common": "0.6.5",
12
+ "@checkstack/signal-common": "0.1.9",
13
13
  "zod": "^4.2.1"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "^5.7.2",
17
- "@checkstack/tsconfig": "0.0.4",
17
+ "@checkstack/tsconfig": "0.0.5",
18
18
  "@checkstack/scripts": "0.1.2"
19
19
  },
20
20
  "scripts": {
package/src/routes.ts CHANGED
@@ -7,6 +7,7 @@ export const healthcheckRoutes = createRoutes("healthcheck", {
7
7
  config: "/config",
8
8
  create: "/config/create",
9
9
  edit: "/config/:configId/edit",
10
+ assignments: "/assignments/:systemId",
10
11
  history: "/history",
11
12
  historyDetail: "/history/:systemId/:configurationId",
12
13
  historyRun: "/history/:systemId/:configurationId/:runId",
@@ -12,6 +12,7 @@ import {
12
12
  HealthCheckRunSchema,
13
13
  HealthCheckRunPublicSchema,
14
14
  HealthCheckStatusSchema,
15
+ HealthCheckRunResultSchema,
15
16
  StateThresholdsSchema,
16
17
  RetentionConfigSchema,
17
18
  AggregatedBucketBaseSchema,
@@ -148,6 +149,10 @@ export const healthCheckContract = {
148
149
  configurationName: z.string(),
149
150
  enabled: z.boolean(),
150
151
  stateThresholds: StateThresholdsSchema.optional(),
152
+ /** IDs of satellites assigned to execute this health check */
153
+ satelliteIds: z.array(z.string()).optional(),
154
+ /** Whether to also run this check locally on the core (default: true) */
155
+ includeLocal: z.boolean(),
151
156
  }),
152
157
  ),
153
158
  ),
@@ -228,6 +233,8 @@ export const healthCheckContract = {
228
233
  configurationId: z.string().optional(),
229
234
  startDate: z.date().optional(),
230
235
  endDate: z.date().optional(),
236
+ /** Filter by source: "local" = core only, satellite UUID = specific satellite, undefined = all */
237
+ sourceFilter: z.string().optional(),
231
238
  limit: z.number().optional().default(10),
232
239
  offset: z.number().optional().default(0),
233
240
  sortOrder: z.enum(["asc", "desc"]),
@@ -251,6 +258,8 @@ export const healthCheckContract = {
251
258
  configurationId: z.string().optional(),
252
259
  startDate: z.date().optional(),
253
260
  endDate: z.date().optional(),
261
+ /** Filter by source: "local" = core only, satellite UUID = specific satellite, undefined = all */
262
+ sourceFilter: z.string().optional(),
254
263
  limit: z.number().optional().default(10),
255
264
  offset: z.number().optional().default(0),
256
265
  sortOrder: z.enum(["asc", "desc"]),
@@ -309,6 +318,8 @@ export const healthCheckContract = {
309
318
  configurationId: z.string(),
310
319
  startDate: z.date(),
311
320
  endDate: z.date(),
321
+ /** Filter by source: "local" = core only, satellite UUID = specific satellite, undefined = all */
322
+ sourceFilter: z.string().optional(),
312
323
  /** Target number of data points (default: 500). Bucket interval is calculated as (endDate - startDate) / targetPoints */
313
324
  targetPoints: z.number().min(10).max(2000).default(500),
314
325
  }),
@@ -372,25 +383,66 @@ export const healthCheckContract = {
372
383
  }),
373
384
  ),
374
385
 
375
- getAvailabilityStats: proc({
386
+ // ==========================================================================
387
+ // SERVICE INTERFACE (userType: "service" — backend-to-backend only)
388
+ // Used by satellite-backend to fetch assignments and submit results.
389
+ // ==========================================================================
390
+
391
+ getAssignmentsForSatellite: proc({
376
392
  operationType: "query",
377
- userType: "public",
378
- access: [healthCheckAccess.status],
393
+ userType: "service",
394
+ access: [],
395
+ })
396
+ .input(z.object({ satelliteId: z.string() }))
397
+ .output(
398
+ z.array(
399
+ z.object({
400
+ configId: z.string(),
401
+ systemId: z.string(),
402
+ strategyId: z.string(),
403
+ config: z.record(z.string(), z.unknown()),
404
+ collectors: z
405
+ .array(
406
+ z.object({
407
+ id: z.string(),
408
+ collectorId: z.string(),
409
+ config: z.record(z.string(), z.unknown()),
410
+ assertions: z
411
+ .array(
412
+ z.object({
413
+ field: z.string(),
414
+ jsonPath: z.string().optional(),
415
+ operator: z.string(),
416
+ value: z.unknown().optional(),
417
+ }),
418
+ )
419
+ .optional(),
420
+ }),
421
+ )
422
+ .optional(),
423
+ intervalSeconds: z.number(),
424
+ }),
425
+ ),
426
+ ),
427
+
428
+ ingestSatelliteResult: proc({
429
+ operationType: "mutation",
430
+ userType: "service",
431
+ access: [],
379
432
  })
380
433
  .input(
381
434
  z.object({
435
+ configId: z.string(),
382
436
  systemId: z.string(),
383
- configurationId: z.string(),
437
+ status: HealthCheckStatusSchema,
438
+ latencyMs: z.number().optional(),
439
+ result: HealthCheckRunResultSchema.optional(),
440
+ executedAt: z.string(),
441
+ sourceId: z.string(),
442
+ sourceLabel: z.string(),
384
443
  }),
385
444
  )
386
- .output(
387
- z.object({
388
- availability31Days: z.number().nullable(),
389
- availability365Days: z.number().nullable(),
390
- totalRuns31Days: z.number(),
391
- totalRuns365Days: z.number(),
392
- }),
393
- ),
445
+ .output(z.void()),
394
446
  };
395
447
  // Export contract type
396
448
  export type HealthCheckContract = typeof healthCheckContract;
package/src/schemas.ts CHANGED
@@ -124,6 +124,25 @@ export const HealthCheckStatusSchema = z.enum([
124
124
 
125
125
  export type HealthCheckStatus = z.infer<typeof HealthCheckStatusSchema>;
126
126
 
127
+ /**
128
+ * Canonical shape for a single health check run result.
129
+ * Both the local queue-executor and satellite agent MUST produce this shape
130
+ * to ensure the frontend (auto-charts, history detail) renders correctly.
131
+ */
132
+ export const HealthCheckRunResultSchema = z.object({
133
+ status: HealthCheckStatusSchema,
134
+ latencyMs: z.number(),
135
+ message: z.string().optional(),
136
+ metadata: z.object({
137
+ connected: z.boolean(),
138
+ connectionTimeMs: z.number().optional(),
139
+ collectors: z.record(z.string(), z.unknown()).optional(),
140
+ error: z.string().optional(),
141
+ }),
142
+ });
143
+
144
+ export type HealthCheckRunResult = z.infer<typeof HealthCheckRunResultSchema>;
145
+
127
146
  // --- State Threshold Schemas ---
128
147
 
129
148
  /**
@@ -192,6 +211,10 @@ export const AssociateHealthCheckSchema = z.object({
192
211
  configurationId: z.string().uuid(),
193
212
  enabled: z.boolean().default(true),
194
213
  stateThresholds: StateThresholdsSchema.optional(),
214
+ /** IDs of satellites assigned to execute this health check */
215
+ satelliteIds: z.array(z.string()).optional(),
216
+ /** Whether to also run this check locally on the core instance (default: true) */
217
+ includeLocal: z.boolean().default(true),
195
218
  });
196
219
 
197
220
  export type AssociateHealthCheck = z.infer<typeof AssociateHealthCheckSchema>;
@@ -210,6 +233,10 @@ export const HealthCheckRunSchema = z.object({
210
233
  result: z.record(z.string(), z.unknown()),
211
234
  timestamp: z.date(),
212
235
  latencyMs: z.number().optional(),
236
+ /** Source ID for result attribution (null = local core, UUID = satellite) */
237
+ sourceId: z.string().optional(),
238
+ /** Human-readable source label (e.g. "Local" or "EU West (eu-west-1)") */
239
+ sourceLabel: z.string().optional(),
213
240
  });
214
241
 
215
242
  export type HealthCheckRun = z.infer<typeof HealthCheckRunSchema>;
@@ -246,6 +273,10 @@ export const HealthCheckRunPublicSchema = z.object({
246
273
  status: HealthCheckStatusSchema,
247
274
  timestamp: z.date(),
248
275
  latencyMs: z.number().optional(),
276
+ /** Source ID for result attribution (null = local core, UUID = satellite) */
277
+ sourceId: z.string().optional(),
278
+ /** Human-readable source label (e.g. "Local" or "EU West (eu-west-1)") */
279
+ sourceLabel: z.string().optional(),
249
280
  });
250
281
 
251
282
  export type HealthCheckRunPublic = z.infer<typeof HealthCheckRunPublicSchema>;