@kici-dev/engine 0.5.0 → 0.6.1

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.
Files changed (68) hide show
  1. package/dist/audit/access-log-policy.js +1 -0
  2. package/dist/audit/retention-policy.js +2 -0
  3. package/dist/context/held-run-job-id.d.ts +26 -10
  4. package/dist/context/held-run-job-id.js +30 -11
  5. package/dist/context/index.d.ts +1 -1
  6. package/dist/context/index.js +3 -3
  7. package/dist/context/types.d.ts +10 -1
  8. package/dist/context/types.js +10 -1
  9. package/dist/index.d.ts +4 -2
  10. package/dist/index.js +14 -11
  11. package/dist/labels.d.ts +66 -12
  12. package/dist/labels.js +74 -17
  13. package/dist/mcp/held-run-resolve.d.ts +40 -0
  14. package/dist/mcp/held-run-resolve.js +68 -15
  15. package/dist/mcp/tool-schemas.d.ts +4 -0
  16. package/dist/mcp/tool-schemas.js +13 -1
  17. package/dist/metrics/catalog-policy.d.ts +6 -3
  18. package/dist/metrics/catalog-policy.js +31 -10
  19. package/dist/metrics/metric-catalog.generated.d.ts +110 -0
  20. package/dist/metrics/metric-catalog.generated.js +132 -0
  21. package/dist/protocol/dashboard-global-workflows.js +2 -2
  22. package/dist/protocol/event-log-payload.js +1 -1
  23. package/dist/protocol/messages/access-log.d.ts +5 -0
  24. package/dist/protocol/messages/access-log.js +1 -0
  25. package/dist/protocol/messages/actor.d.ts +13 -2
  26. package/dist/protocol/messages/actor.js +16 -5
  27. package/dist/protocol/messages/common.js +1 -1
  28. package/dist/protocol/messages/dashboard-global-workflows.d.ts +21 -0
  29. package/dist/protocol/messages/dashboard-global-workflows.js +28 -1
  30. package/dist/protocol/messages/dashboard.d.ts +46 -5
  31. package/dist/protocol/messages/dashboard.js +67 -7
  32. package/dist/protocol/messages/execution-status.d.ts +41 -0
  33. package/dist/protocol/messages/execution-status.js +53 -2
  34. package/dist/protocol/messages/git-credential-relay.d.ts +78 -0
  35. package/dist/protocol/messages/git-credential-relay.js +86 -0
  36. package/dist/protocol/messages/orchestrator-agent.d.ts +89 -0
  37. package/dist/protocol/messages/orchestrator-agent.js +98 -3
  38. package/dist/protocol/messages/peer.d.ts +7 -0
  39. package/dist/protocol/messages/peer.js +18 -1
  40. package/dist/protocol/messages/platform-orchestrator.d.ts +150 -0
  41. package/dist/protocol/messages/platform-orchestrator.js +164 -19
  42. package/dist/protocol/version.d.ts +19 -2
  43. package/dist/protocol/version.js +20 -3
  44. package/dist/provenance/verify.js +11 -10
  45. package/dist/provider/check-status-poster.d.ts +24 -3
  46. package/dist/provider/contributor-resolver.d.ts +11 -3
  47. package/dist/provider/git-credential.d.ts +77 -0
  48. package/dist/provider/git-credential.js +10 -0
  49. package/dist/provider/index.d.ts +2 -0
  50. package/dist/provider/index.js +2 -1
  51. package/dist/provider/webhook-normalizer.d.ts +12 -12
  52. package/dist/repo/pattern-negation.d.ts +73 -0
  53. package/dist/repo/pattern-negation.js +86 -0
  54. package/dist/scaler/registry-auth.d.ts +18 -0
  55. package/dist/scaler/registry-auth.js +28 -0
  56. package/dist/scaler/scaler-backend-type.d.ts +35 -0
  57. package/dist/scaler/scaler-backend-type.js +39 -2
  58. package/dist/scaler/scaler-events.d.ts +79 -0
  59. package/dist/scaler/scaler-events.js +87 -0
  60. package/dist/trigger/content-requirements.js +1 -1
  61. package/dist/trigger/decision-trace.d.ts +79 -0
  62. package/dist/trigger/decision-trace.js +116 -8
  63. package/dist/trigger/matcher.js +4 -2
  64. package/dist/trigger/types.d.ts +87 -7
  65. package/dist/trigger/types.js +6 -1
  66. package/dist/ws/rate-limiter.js +3 -3
  67. package/package.json +11 -3
  68. package/sbom.spdx.json +15 -15
@@ -1,4 +1,6 @@
1
1
  export declare const MetricNames: {
2
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_DURATION_SECONDS: 'kici_agent_between_jobs_reset_duration_seconds';
3
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_TOTAL: 'kici_agent_between_jobs_reset_total';
2
4
  readonly KICI_AGENT_CLONE_DURATION_SECONDS: 'kici_agent_clone_duration_seconds';
3
5
  readonly KICI_AGENT_CONNECTION_STATUS: 'kici_agent_connection_status';
4
6
  readonly KICI_AGENT_JOBS_ACTIVE: 'kici_agent_jobs_active';
@@ -7,6 +9,8 @@ export declare const MetricNames: {
7
9
  readonly KICI_AGENT_LOG_BACKPRESSURE_EVENTS_TOTAL: 'kici_agent_log_backpressure_events_total';
8
10
  readonly KICI_AGENT_LOG_BYTES_TOTAL: 'kici_agent_log_bytes_total';
9
11
  readonly KICI_AGENT_LOG_LINES_DROPPED_TOTAL: 'kici_agent_log_lines_dropped_total';
12
+ readonly KICI_AGENT_ORPHAN_CLEANUP_TOTAL: 'kici_agent_orphan_cleanup_total';
13
+ readonly KICI_AGENT_ORPHANS_REAPED_TOTAL: 'kici_agent_orphans_reaped_total';
10
14
  readonly KICI_AGENT_STEP_DURATION_SECONDS: 'kici_agent_step_duration_seconds';
11
15
  readonly KICI_AGENT_STEPS_TOTAL: 'kici_agent_steps_total';
12
16
  readonly KICI_BILLING_EMAIL_SEND_TOTAL: 'kici_billing_email_send_total';
@@ -36,6 +40,7 @@ export declare const MetricNames: {
36
40
  readonly KICI_ORCH_DISPATCH_QUEUE_DEPTH_BY_LABEL: 'kici_orch_dispatch_queue_depth_by_label';
37
41
  readonly KICI_ORCH_DISPATCH_QUEUE_ROWS_PRUNED_TOTAL: 'kici_orch_dispatch_queue_rows_pruned_total';
38
42
  readonly KICI_ORCH_EVENT_ATTEMPTS: 'kici_orch_event_attempts';
43
+ readonly KICI_ORCH_EVENT_CATCH_UP_FAILURES_TOTAL: 'kici_orch_event_catch_up_failures_total';
39
44
  readonly KICI_ORCH_EVENT_DISPATCH_SUCCESS_TOTAL: 'kici_orch_event_dispatch_success_total';
40
45
  readonly KICI_ORCH_EVENT_DLQ_DEPTH: 'kici_orch_event_dlq_depth';
41
46
  readonly KICI_ORCH_EVENT_DLQ_TOTAL: 'kici_orch_event_dlq_total';
@@ -43,6 +48,7 @@ export declare const MetricNames: {
43
48
  readonly KICI_ORCH_EVENT_RETRY_TOTAL: 'kici_orch_event_retry_total';
44
49
  readonly KICI_ORCH_EXECUTION_DURATION_SECONDS: 'kici_orch_execution_duration_seconds';
45
50
  readonly KICI_ORCH_EXECUTIONS_TOTAL: 'kici_orch_executions_total';
51
+ readonly KICI_ORCH_FORK_EVENTS_IGNORED_TOTAL: 'kici_orch_fork_events_ignored_total';
46
52
  readonly KICI_ORCH_GITHUB_CHECK_RUN_TOTAL: 'kici_orch_github_check_run_total';
47
53
  readonly KICI_ORCH_GLOBAL_EVAL_CACHE_LOOKUPS_TOTAL: 'kici_orch_global_eval_cache_lookups_total';
48
54
  readonly KICI_ORCH_GLOBAL_EVAL_CANDIDATES_TOTAL: 'kici_orch_global_eval_candidates_total';
@@ -81,12 +87,25 @@ export declare const MetricNames: {
81
87
  readonly KICI_ORCH_PENDING_ATTESTATIONS_CURRENT: 'kici_orch_pending_attestations_current';
82
88
  readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: 'kici_orch_pg_pool_client_errors_total';
83
89
  readonly KICI_ORCH_REJECTED_ATTESTATIONS_CURRENT: 'kici_orch_rejected_attestations_current';
90
+ readonly KICI_ORCH_SCALER_ADOPTION_LOOKUP_FAILURES_TOTAL: 'kici_orch_scaler_adoption_lookup_failures_total';
91
+ readonly KICI_ORCH_SCALER_CAP_LOCK_FAILURES_TOTAL: 'kici_orch_scaler_cap_lock_failures_total';
84
92
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: 'kici_orch_scaler_config_reloads_total';
85
93
  readonly KICI_ORCH_SCALER_CPUS_USED: 'kici_orch_scaler_cpus_used';
94
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISION_TIMEOUT_TOTAL: 'kici_orch_scaler_external_provision_timeout_total';
95
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISIONING_ACTIVE: 'kici_orch_scaler_external_provisioning_active';
86
96
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: 'kici_orch_scaler_memory_bytes_used';
97
+ readonly KICI_ORCH_SCALER_REAP_BLOCKED: 'kici_orch_scaler_reap_blocked';
98
+ readonly KICI_ORCH_SCALER_REAP_UNSEEN_PROVISIONS: 'kici_orch_scaler_reap_unseen_provisions';
87
99
  readonly KICI_ORCH_SCALER_REDISPATCH_TOTAL: 'kici_orch_scaler_redispatch_total';
100
+ readonly KICI_ORCH_SCALER_SCALE_DOWN_EMITTED_TOTAL: 'kici_orch_scaler_scale_down_emitted_total';
101
+ readonly KICI_ORCH_SCALER_SCALE_UP_EMITTED_TOTAL: 'kici_orch_scaler_scale_up_emitted_total';
88
102
  readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: 'kici_orch_scaler_spawn_failures_total';
89
103
  readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: 'kici_orch_scaler_spawn_refusals_total';
104
+ readonly KICI_ORCH_SCALER_WARM_POOL_IN_FLIGHT: 'kici_orch_scaler_warm_pool_in_flight';
105
+ readonly KICI_ORCH_SCALER_WARM_POOL_READY: 'kici_orch_scaler_warm_pool_ready';
106
+ readonly KICI_ORCH_SCALER_WARM_POOL_REAPED_TOTAL: 'kici_orch_scaler_warm_pool_reaped_total';
107
+ readonly KICI_ORCH_SCALER_WARM_POOL_SPAWNS_TOTAL: 'kici_orch_scaler_warm_pool_spawns_total';
108
+ readonly KICI_ORCH_SCALER_WARM_POOL_TARGET: 'kici_orch_scaler_warm_pool_target';
90
109
  readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: 'kici_orch_source_cache_hits_total';
91
110
  readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: 'kici_orch_source_cache_misses_total';
92
111
  readonly KICI_ORCH_STALE_DETECTION_DURATION_SECONDS: 'kici_orch_stale_detection_duration_seconds';
@@ -138,6 +157,9 @@ export declare const MetricNames: {
138
157
  readonly KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: 'kici_platform_log_lines_forwarded_total';
139
158
  readonly KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: 'kici_platform_metrics_query_rate_limited_total';
140
159
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: 'kici_platform_mimir_relay_errors_total';
160
+ readonly KICI_PLATFORM_MIMIR_RELAY_FINAL_DROPS_TOTAL: 'kici_platform_mimir_relay_final_drops_total';
161
+ readonly KICI_PLATFORM_MIMIR_RELAY_RETRIES_TOTAL: 'kici_platform_mimir_relay_retries_total';
162
+ readonly KICI_PLATFORM_MIMIR_RELAY_SHED_TOTAL: 'kici_platform_mimir_relay_shed_total';
141
163
  readonly KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: 'kici_platform_notifications_delivered_total';
142
164
  readonly KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: 'kici_platform_notifications_suppressed_total';
143
165
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: 'kici_platform_orch_metrics_filtered_total';
@@ -207,6 +229,8 @@ export declare const MetricNames: {
207
229
  };
208
230
  export type MetricName = (typeof MetricNames)[keyof typeof MetricNames];
209
231
  export declare const MetricLabels: {
232
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_DURATION_SECONDS: readonly ['scaler'];
233
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_TOTAL: readonly ['status', 'scaler'];
210
234
  readonly KICI_AGENT_CLONE_DURATION_SECONDS: readonly ['scaler'];
211
235
  readonly KICI_AGENT_CONNECTION_STATUS: readonly ['scaler'];
212
236
  readonly KICI_AGENT_JOBS_ACTIVE: readonly ['scaler'];
@@ -215,6 +239,8 @@ export declare const MetricLabels: {
215
239
  readonly KICI_AGENT_LOG_BACKPRESSURE_EVENTS_TOTAL: readonly ['mode', 'scaler'];
216
240
  readonly KICI_AGENT_LOG_BYTES_TOTAL: readonly ['scaler'];
217
241
  readonly KICI_AGENT_LOG_LINES_DROPPED_TOTAL: readonly ['scaler'];
242
+ readonly KICI_AGENT_ORPHAN_CLEANUP_TOTAL: readonly ['status', 'scaler'];
243
+ readonly KICI_AGENT_ORPHANS_REAPED_TOTAL: readonly ['scaler'];
218
244
  readonly KICI_AGENT_STEP_DURATION_SECONDS: readonly ['scaler'];
219
245
  readonly KICI_AGENT_STEPS_TOTAL: readonly ['status', 'scaler'];
220
246
  readonly KICI_BILLING_EMAIL_SEND_TOTAL: readonly ['kind', 'status'];
@@ -244,6 +270,7 @@ export declare const MetricLabels: {
244
270
  readonly KICI_ORCH_DISPATCH_QUEUE_DEPTH_BY_LABEL: readonly ['status', 'label'];
245
271
  readonly KICI_ORCH_DISPATCH_QUEUE_ROWS_PRUNED_TOTAL: readonly [];
246
272
  readonly KICI_ORCH_EVENT_ATTEMPTS: readonly ['event_name', 'result'];
273
+ readonly KICI_ORCH_EVENT_CATCH_UP_FAILURES_TOTAL: readonly [];
247
274
  readonly KICI_ORCH_EVENT_DISPATCH_SUCCESS_TOTAL: readonly ['event_name'];
248
275
  readonly KICI_ORCH_EVENT_DLQ_DEPTH: readonly [];
249
276
  readonly KICI_ORCH_EVENT_DLQ_TOTAL: readonly ['event_name', 'reason'];
@@ -251,6 +278,7 @@ export declare const MetricLabels: {
251
278
  readonly KICI_ORCH_EVENT_RETRY_TOTAL: readonly ['event_name'];
252
279
  readonly KICI_ORCH_EXECUTION_DURATION_SECONDS: readonly [];
253
280
  readonly KICI_ORCH_EXECUTIONS_TOTAL: readonly ['status'];
281
+ readonly KICI_ORCH_FORK_EVENTS_IGNORED_TOTAL: readonly ['provider'];
254
282
  readonly KICI_ORCH_GITHUB_CHECK_RUN_TOTAL: readonly ['operation'];
255
283
  readonly KICI_ORCH_GLOBAL_EVAL_CACHE_LOOKUPS_TOTAL: readonly ['result'];
256
284
  readonly KICI_ORCH_GLOBAL_EVAL_CANDIDATES_TOTAL: readonly [];
@@ -289,12 +317,25 @@ export declare const MetricLabels: {
289
317
  readonly KICI_ORCH_PENDING_ATTESTATIONS_CURRENT: readonly [];
290
318
  readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: readonly ['source'];
291
319
  readonly KICI_ORCH_REJECTED_ATTESTATIONS_CURRENT: readonly [];
320
+ readonly KICI_ORCH_SCALER_ADOPTION_LOOKUP_FAILURES_TOTAL: readonly [];
321
+ readonly KICI_ORCH_SCALER_CAP_LOCK_FAILURES_TOTAL: readonly ['reason'];
292
322
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: readonly ['result'];
293
323
  readonly KICI_ORCH_SCALER_CPUS_USED: readonly ['scaler', 'scalerType', 'machinePool'];
324
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISION_TIMEOUT_TOTAL: readonly ['scaler'];
325
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISIONING_ACTIVE: readonly ['scaler'];
294
326
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: readonly ['scaler', 'scalerType', 'machinePool'];
327
+ readonly KICI_ORCH_SCALER_REAP_BLOCKED: readonly [];
328
+ readonly KICI_ORCH_SCALER_REAP_UNSEEN_PROVISIONS: readonly [];
295
329
  readonly KICI_ORCH_SCALER_REDISPATCH_TOTAL: readonly ['trigger'];
330
+ readonly KICI_ORCH_SCALER_SCALE_DOWN_EMITTED_TOTAL: readonly ['scaler', 'reason'];
331
+ readonly KICI_ORCH_SCALER_SCALE_UP_EMITTED_TOTAL: readonly ['scaler'];
296
332
  readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: readonly ['backend', 'bound'];
297
333
  readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: readonly [];
334
+ readonly KICI_ORCH_SCALER_WARM_POOL_IN_FLIGHT: readonly ['scaler', 'labelSet'];
335
+ readonly KICI_ORCH_SCALER_WARM_POOL_READY: readonly ['scaler', 'labelSet'];
336
+ readonly KICI_ORCH_SCALER_WARM_POOL_REAPED_TOTAL: readonly ['scaler'];
337
+ readonly KICI_ORCH_SCALER_WARM_POOL_SPAWNS_TOTAL: readonly ['scaler'];
338
+ readonly KICI_ORCH_SCALER_WARM_POOL_TARGET: readonly ['scaler', 'labelSet'];
298
339
  readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: readonly [];
299
340
  readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: readonly [];
300
341
  readonly KICI_ORCH_STALE_DETECTION_DURATION_SECONDS: readonly [];
@@ -346,6 +387,9 @@ export declare const MetricLabels: {
346
387
  readonly KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: readonly [];
347
388
  readonly KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: readonly ['org_id'];
348
389
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: readonly ['reason'];
390
+ readonly KICI_PLATFORM_MIMIR_RELAY_FINAL_DROPS_TOTAL: readonly ['reason'];
391
+ readonly KICI_PLATFORM_MIMIR_RELAY_RETRIES_TOTAL: readonly ['reason'];
392
+ readonly KICI_PLATFORM_MIMIR_RELAY_SHED_TOTAL: readonly [];
349
393
  readonly KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: readonly ['channel_type', 'result'];
350
394
  readonly KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: readonly ['org_id'];
351
395
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: readonly ['reason', 'metric'];
@@ -414,6 +458,8 @@ export declare const MetricLabels: {
414
458
  readonly V8JS_RESOURCE_ACTIVE: readonly ['v8js.resource.type', 'scaler'];
415
459
  };
416
460
  export declare const MetricKind: {
461
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_DURATION_SECONDS: 'histogram';
462
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_TOTAL: 'counter';
417
463
  readonly KICI_AGENT_CLONE_DURATION_SECONDS: 'histogram';
418
464
  readonly KICI_AGENT_CONNECTION_STATUS: 'upDownCounter';
419
465
  readonly KICI_AGENT_JOBS_ACTIVE: 'upDownCounter';
@@ -422,6 +468,8 @@ export declare const MetricKind: {
422
468
  readonly KICI_AGENT_LOG_BACKPRESSURE_EVENTS_TOTAL: 'counter';
423
469
  readonly KICI_AGENT_LOG_BYTES_TOTAL: 'counter';
424
470
  readonly KICI_AGENT_LOG_LINES_DROPPED_TOTAL: 'counter';
471
+ readonly KICI_AGENT_ORPHAN_CLEANUP_TOTAL: 'counter';
472
+ readonly KICI_AGENT_ORPHANS_REAPED_TOTAL: 'counter';
425
473
  readonly KICI_AGENT_STEP_DURATION_SECONDS: 'histogram';
426
474
  readonly KICI_AGENT_STEPS_TOTAL: 'counter';
427
475
  readonly KICI_BILLING_EMAIL_SEND_TOTAL: 'counter';
@@ -451,6 +499,7 @@ export declare const MetricKind: {
451
499
  readonly KICI_ORCH_DISPATCH_QUEUE_DEPTH_BY_LABEL: 'observableGauge';
452
500
  readonly KICI_ORCH_DISPATCH_QUEUE_ROWS_PRUNED_TOTAL: 'counter';
453
501
  readonly KICI_ORCH_EVENT_ATTEMPTS: 'histogram';
502
+ readonly KICI_ORCH_EVENT_CATCH_UP_FAILURES_TOTAL: 'counter';
454
503
  readonly KICI_ORCH_EVENT_DISPATCH_SUCCESS_TOTAL: 'counter';
455
504
  readonly KICI_ORCH_EVENT_DLQ_DEPTH: 'observableGauge';
456
505
  readonly KICI_ORCH_EVENT_DLQ_TOTAL: 'counter';
@@ -458,6 +507,7 @@ export declare const MetricKind: {
458
507
  readonly KICI_ORCH_EVENT_RETRY_TOTAL: 'counter';
459
508
  readonly KICI_ORCH_EXECUTION_DURATION_SECONDS: 'histogram';
460
509
  readonly KICI_ORCH_EXECUTIONS_TOTAL: 'counter';
510
+ readonly KICI_ORCH_FORK_EVENTS_IGNORED_TOTAL: 'counter';
461
511
  readonly KICI_ORCH_GITHUB_CHECK_RUN_TOTAL: 'counter';
462
512
  readonly KICI_ORCH_GLOBAL_EVAL_CACHE_LOOKUPS_TOTAL: 'counter';
463
513
  readonly KICI_ORCH_GLOBAL_EVAL_CANDIDATES_TOTAL: 'counter';
@@ -496,12 +546,25 @@ export declare const MetricKind: {
496
546
  readonly KICI_ORCH_PENDING_ATTESTATIONS_CURRENT: 'observableGauge';
497
547
  readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: 'counter';
498
548
  readonly KICI_ORCH_REJECTED_ATTESTATIONS_CURRENT: 'observableGauge';
549
+ readonly KICI_ORCH_SCALER_ADOPTION_LOOKUP_FAILURES_TOTAL: 'counter';
550
+ readonly KICI_ORCH_SCALER_CAP_LOCK_FAILURES_TOTAL: 'counter';
499
551
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: 'counter';
500
552
  readonly KICI_ORCH_SCALER_CPUS_USED: 'observableGauge';
553
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISION_TIMEOUT_TOTAL: 'counter';
554
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISIONING_ACTIVE: 'observableGauge';
501
555
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: 'observableGauge';
556
+ readonly KICI_ORCH_SCALER_REAP_BLOCKED: 'observableGauge';
557
+ readonly KICI_ORCH_SCALER_REAP_UNSEEN_PROVISIONS: 'observableGauge';
502
558
  readonly KICI_ORCH_SCALER_REDISPATCH_TOTAL: 'counter';
559
+ readonly KICI_ORCH_SCALER_SCALE_DOWN_EMITTED_TOTAL: 'counter';
560
+ readonly KICI_ORCH_SCALER_SCALE_UP_EMITTED_TOTAL: 'counter';
503
561
  readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: 'counter';
504
562
  readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: 'observableGauge';
563
+ readonly KICI_ORCH_SCALER_WARM_POOL_IN_FLIGHT: 'observableGauge';
564
+ readonly KICI_ORCH_SCALER_WARM_POOL_READY: 'observableGauge';
565
+ readonly KICI_ORCH_SCALER_WARM_POOL_REAPED_TOTAL: 'counter';
566
+ readonly KICI_ORCH_SCALER_WARM_POOL_SPAWNS_TOTAL: 'counter';
567
+ readonly KICI_ORCH_SCALER_WARM_POOL_TARGET: 'observableGauge';
505
568
  readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: 'counter';
506
569
  readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: 'counter';
507
570
  readonly KICI_ORCH_STALE_DETECTION_DURATION_SECONDS: 'histogram';
@@ -553,6 +616,9 @@ export declare const MetricKind: {
553
616
  readonly KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: 'counter';
554
617
  readonly KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: 'counter';
555
618
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: 'counter';
619
+ readonly KICI_PLATFORM_MIMIR_RELAY_FINAL_DROPS_TOTAL: 'counter';
620
+ readonly KICI_PLATFORM_MIMIR_RELAY_RETRIES_TOTAL: 'counter';
621
+ readonly KICI_PLATFORM_MIMIR_RELAY_SHED_TOTAL: 'counter';
556
622
  readonly KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: 'counter';
557
623
  readonly KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: 'counter';
558
624
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: 'counter';
@@ -621,6 +687,8 @@ export declare const MetricKind: {
621
687
  readonly V8JS_RESOURCE_ACTIVE: 'gauge';
622
688
  };
623
689
  export declare const MetricDescription: {
690
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_DURATION_SECONDS: 'Between-jobs reset command duration in seconds';
691
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_TOTAL: 'Total operator between-jobs reset command invocations';
624
692
  readonly KICI_AGENT_CLONE_DURATION_SECONDS: 'Git clone duration in seconds';
625
693
  readonly KICI_AGENT_CONNECTION_STATUS: 'Orchestrator WebSocket connection status (0=disconnected, 1=connected)';
626
694
  readonly KICI_AGENT_JOBS_ACTIVE: 'Number of currently running jobs';
@@ -629,6 +697,8 @@ export declare const MetricDescription: {
629
697
  readonly KICI_AGENT_LOG_BACKPRESSURE_EVENTS_TOTAL: 'Total log-streamer backpressure rising-edge events';
630
698
  readonly KICI_AGENT_LOG_BYTES_TOTAL: 'Total log bytes streamed';
631
699
  readonly KICI_AGENT_LOG_LINES_DROPPED_TOTAL: 'Total log lines dropped due to backpressure';
700
+ readonly KICI_AGENT_ORPHAN_CLEANUP_TOTAL: 'Total out-of-band declared-cleanup re-runs';
701
+ readonly KICI_AGENT_ORPHANS_REAPED_TOTAL: 'Total processes killed by the between-jobs process-group reap';
632
702
  readonly KICI_AGENT_STEP_DURATION_SECONDS: 'Step execution duration in seconds';
633
703
  readonly KICI_AGENT_STEPS_TOTAL: 'Total number of completed steps';
634
704
  readonly KICI_BILLING_EMAIL_SEND_TOTAL: 'Billing emails sent, by kind and status';
@@ -658,6 +728,7 @@ export declare const MetricDescription: {
658
728
  readonly KICI_ORCH_DISPATCH_QUEUE_DEPTH_BY_LABEL: 'Current pending dispatch_queue depth per runs_on label (multi-label jobs fan out)';
659
729
  readonly KICI_ORCH_DISPATCH_QUEUE_ROWS_PRUNED_TOTAL: 'Terminal dispatch_queue rows deleted by the retention sweep';
660
730
  readonly KICI_ORCH_EVENT_ATTEMPTS: 'Distribution of dispatch attempts at terminal outcome (success or DLQ)';
731
+ readonly KICI_ORCH_EVENT_CATCH_UP_FAILURES_TOTAL: 'Startup internal-event catch-up scans that threw';
661
732
  readonly KICI_ORCH_EVENT_DISPATCH_SUCCESS_TOTAL: 'Internal events delivered to all matching workflows successfully (after the lease commits processed=true)';
662
733
  readonly KICI_ORCH_EVENT_DLQ_DEPTH: 'Current count of events sitting in the DLQ awaiting operator triage';
663
734
  readonly KICI_ORCH_EVENT_DLQ_TOTAL: 'Internal events moved to the DLQ after exhausting retries';
@@ -665,6 +736,7 @@ export declare const MetricDescription: {
665
736
  readonly KICI_ORCH_EVENT_RETRY_TOTAL: 'Internal-event dispatch failures that triggered a retry (lease released, next_retry_at scheduled)';
666
737
  readonly KICI_ORCH_EXECUTION_DURATION_SECONDS: 'Duration of execution runs in seconds';
667
738
  readonly KICI_ORCH_EXECUTIONS_TOTAL: 'Total number of execution runs';
739
+ readonly KICI_ORCH_FORK_EVENTS_IGNORED_TOTAL: 'Total fork pull-request events dropped by the org fork policy';
668
740
  readonly KICI_ORCH_GITHUB_CHECK_RUN_TOTAL: 'Total number of GitHub check run API calls';
669
741
  readonly KICI_ORCH_GLOBAL_EVAL_CACHE_LOOKUPS_TOTAL: 'Tier-2 global eval round cache lookups by outcome';
670
742
  readonly KICI_ORCH_GLOBAL_EVAL_CANDIDATES_TOTAL: 'Global workflow candidates handed to a Tier-2 eval round';
@@ -703,12 +775,25 @@ export declare const MetricDescription: {
703
775
  readonly KICI_ORCH_PENDING_ATTESTATIONS_CURRENT: 'Deferred attestations awaiting a later mint';
704
776
  readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: 'Total pg connection errors absorbed without a process restart';
705
777
  readonly KICI_ORCH_REJECTED_ATTESTATIONS_CURRENT: 'Deferred attestations permanently rejected (run/job absent on Platform); terminal, re-attempted only via kici-admin attestations retry --include-rejected';
778
+ readonly KICI_ORCH_SCALER_ADOPTION_LOOKUP_FAILURES_TOTAL: 'Cumulative event-scaler spawn-record adoption lookups that failed with a store error.';
779
+ readonly KICI_ORCH_SCALER_CAP_LOCK_FAILURES_TOTAL: 'Total event-scaler cluster-wide cap checks that failed, refusing their spawn without evaluating the cap. A rising rate means event autoscaling is not running; read reason to tell a stalled database from a contended lock.';
706
780
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: 'Total number of scaler config reload operations';
707
781
  readonly KICI_ORCH_SCALER_CPUS_USED: 'Current CPU reservations summed by scaler / pool. scaler="__global__" is the orchestrator-wide total; machinePool="<name>" rows reflect the on-disk ledger.';
782
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISION_TIMEOUT_TOTAL: 'Cumulative event-scaler provisions torn down for spawn-timeout (agent never registered), labeled by scaler.';
783
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISIONING_ACTIVE: 'Current in-flight external (event-scaler) provisions, labeled by scaler (provisioning + active).';
708
784
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: 'Current memory reservations (bytes) summed by scaler / pool. scaler="__global__" is the orchestrator-wide total; machinePool="<name>" rows reflect the on-disk ledger.';
785
+ readonly KICI_ORCH_SCALER_REAP_BLOCKED: 'Whether the event-scaler provision reaper is standing down for lack of any connected coordinator peer (1) or sweeping (0).';
786
+ readonly KICI_ORCH_SCALER_REAP_UNSEEN_PROVISIONS: 'Event-scaler provisions whose agent has been registered on no coordinator for at least the flap grace, being timed by the leader-gated reaper.';
709
787
  readonly KICI_ORCH_SCALER_REDISPATCH_TOTAL: 'Cumulative count of pending jobs re-offered to the scaler after capacity freed, labeled by trigger (hook | sweep).';
788
+ readonly KICI_ORCH_SCALER_SCALE_DOWN_EMITTED_TOTAL: 'Cumulative kici.scaler.scale-down events emitted by event scalers, labeled by scaler + reason.';
789
+ readonly KICI_ORCH_SCALER_SCALE_UP_EMITTED_TOTAL: 'Cumulative kici.scaler.scale-up events emitted by event scalers, labeled by scaler.';
710
790
  readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: 'Total scaler agent spawn failures (job-bound and warm-pool)';
711
791
  readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: 'Cumulative count of scaler spawn requests refused due to resource caps (maxAgents, resourceCap, globalResourceCap, machinePool).';
792
+ readonly KICI_ORCH_SCALER_WARM_POOL_IN_FLIGHT: 'Warm-pool spawns started but not yet registered. A deficit covered by these is filling, not failing.';
793
+ readonly KICI_ORCH_SCALER_WARM_POOL_READY: 'Agents able to serve a job for a warm pool label set — the same query the dispatcher makes.';
794
+ readonly KICI_ORCH_SCALER_WARM_POOL_REAPED_TOTAL: 'Total warm-pool agents destroyed as surplus — past their idle timeout, or above a lowered target, per scaler.';
795
+ readonly KICI_ORCH_SCALER_WARM_POOL_SPAWNS_TOTAL: 'Total warm-pool spawns started, per scaler.';
796
+ readonly KICI_ORCH_SCALER_WARM_POOL_TARGET: 'Configured number of agents a warm pool keeps ready for a label set.';
712
797
  readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: 'Total number of source tarball cache hits';
713
798
  readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: 'Total number of source tarball cache misses';
714
799
  readonly KICI_ORCH_STALE_DETECTION_DURATION_SECONDS: 'Time between job becoming stale and detection (seconds)';
@@ -760,6 +845,9 @@ export declare const MetricDescription: {
760
845
  readonly KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: 'Total log lines forwarded from orchestrators';
761
846
  readonly KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: 'Total dashboard metric-query requests rate-limited (429).';
762
847
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: 'Total Mimir push-relay errors (Platform-embedded metrics). Labels: reason.';
848
+ readonly KICI_PLATFORM_MIMIR_RELAY_FINAL_DROPS_TOTAL: 'Total Mimir push-relay batches dropped permanently (data loss). Labels: reason.';
849
+ readonly KICI_PLATFORM_MIMIR_RELAY_RETRIES_TOTAL: 'Total Mimir push-relay retry attempts (Platform-embedded metrics). Labels: reason.';
850
+ readonly KICI_PLATFORM_MIMIR_RELAY_SHED_TOTAL: 'Total Mimir push-relay batches shed without retry (concurrent-retry cap reached).';
763
851
  readonly KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: 'Notification delivery attempts that reached a terminal outcome';
764
852
  readonly KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: 'Run-terminal notifications suppressed by the per-org notification quota';
765
853
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: 'Orchestrator-pushed metric data points dropped or rewritten by the catalog allow-list. Labels: reason, metric.';
@@ -835,6 +923,8 @@ export declare const MetricDescription: {
835
923
  * the only valid push payloads.
836
924
  */
837
925
  export declare const MetricService: {
926
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_DURATION_SECONDS: 'agent';
927
+ readonly KICI_AGENT_BETWEEN_JOBS_RESET_TOTAL: 'agent';
838
928
  readonly KICI_AGENT_CLONE_DURATION_SECONDS: 'agent';
839
929
  readonly KICI_AGENT_CONNECTION_STATUS: 'agent';
840
930
  readonly KICI_AGENT_JOBS_ACTIVE: 'agent';
@@ -843,6 +933,8 @@ export declare const MetricService: {
843
933
  readonly KICI_AGENT_LOG_BACKPRESSURE_EVENTS_TOTAL: 'agent';
844
934
  readonly KICI_AGENT_LOG_BYTES_TOTAL: 'agent';
845
935
  readonly KICI_AGENT_LOG_LINES_DROPPED_TOTAL: 'agent';
936
+ readonly KICI_AGENT_ORPHAN_CLEANUP_TOTAL: 'agent';
937
+ readonly KICI_AGENT_ORPHANS_REAPED_TOTAL: 'agent';
846
938
  readonly KICI_AGENT_STEP_DURATION_SECONDS: 'agent';
847
939
  readonly KICI_AGENT_STEPS_TOTAL: 'agent';
848
940
  readonly KICI_BILLING_EMAIL_SEND_TOTAL: 'platform';
@@ -872,6 +964,7 @@ export declare const MetricService: {
872
964
  readonly KICI_ORCH_DISPATCH_QUEUE_DEPTH_BY_LABEL: 'orchestrator';
873
965
  readonly KICI_ORCH_DISPATCH_QUEUE_ROWS_PRUNED_TOTAL: 'orchestrator';
874
966
  readonly KICI_ORCH_EVENT_ATTEMPTS: 'orchestrator';
967
+ readonly KICI_ORCH_EVENT_CATCH_UP_FAILURES_TOTAL: 'orchestrator';
875
968
  readonly KICI_ORCH_EVENT_DISPATCH_SUCCESS_TOTAL: 'orchestrator';
876
969
  readonly KICI_ORCH_EVENT_DLQ_DEPTH: 'orchestrator';
877
970
  readonly KICI_ORCH_EVENT_DLQ_TOTAL: 'orchestrator';
@@ -879,6 +972,7 @@ export declare const MetricService: {
879
972
  readonly KICI_ORCH_EVENT_RETRY_TOTAL: 'orchestrator';
880
973
  readonly KICI_ORCH_EXECUTION_DURATION_SECONDS: 'orchestrator';
881
974
  readonly KICI_ORCH_EXECUTIONS_TOTAL: 'orchestrator';
975
+ readonly KICI_ORCH_FORK_EVENTS_IGNORED_TOTAL: 'orchestrator';
882
976
  readonly KICI_ORCH_GITHUB_CHECK_RUN_TOTAL: 'orchestrator';
883
977
  readonly KICI_ORCH_GLOBAL_EVAL_CACHE_LOOKUPS_TOTAL: 'orchestrator';
884
978
  readonly KICI_ORCH_GLOBAL_EVAL_CANDIDATES_TOTAL: 'orchestrator';
@@ -917,12 +1011,25 @@ export declare const MetricService: {
917
1011
  readonly KICI_ORCH_PENDING_ATTESTATIONS_CURRENT: 'orchestrator';
918
1012
  readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: 'orchestrator';
919
1013
  readonly KICI_ORCH_REJECTED_ATTESTATIONS_CURRENT: 'orchestrator';
1014
+ readonly KICI_ORCH_SCALER_ADOPTION_LOOKUP_FAILURES_TOTAL: 'orchestrator';
1015
+ readonly KICI_ORCH_SCALER_CAP_LOCK_FAILURES_TOTAL: 'orchestrator';
920
1016
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: 'orchestrator';
921
1017
  readonly KICI_ORCH_SCALER_CPUS_USED: 'orchestrator';
1018
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISION_TIMEOUT_TOTAL: 'orchestrator';
1019
+ readonly KICI_ORCH_SCALER_EXTERNAL_PROVISIONING_ACTIVE: 'orchestrator';
922
1020
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: 'orchestrator';
1021
+ readonly KICI_ORCH_SCALER_REAP_BLOCKED: 'orchestrator';
1022
+ readonly KICI_ORCH_SCALER_REAP_UNSEEN_PROVISIONS: 'orchestrator';
923
1023
  readonly KICI_ORCH_SCALER_REDISPATCH_TOTAL: 'orchestrator';
1024
+ readonly KICI_ORCH_SCALER_SCALE_DOWN_EMITTED_TOTAL: 'orchestrator';
1025
+ readonly KICI_ORCH_SCALER_SCALE_UP_EMITTED_TOTAL: 'orchestrator';
924
1026
  readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: 'orchestrator';
925
1027
  readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: 'orchestrator';
1028
+ readonly KICI_ORCH_SCALER_WARM_POOL_IN_FLIGHT: 'orchestrator';
1029
+ readonly KICI_ORCH_SCALER_WARM_POOL_READY: 'orchestrator';
1030
+ readonly KICI_ORCH_SCALER_WARM_POOL_REAPED_TOTAL: 'orchestrator';
1031
+ readonly KICI_ORCH_SCALER_WARM_POOL_SPAWNS_TOTAL: 'orchestrator';
1032
+ readonly KICI_ORCH_SCALER_WARM_POOL_TARGET: 'orchestrator';
926
1033
  readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: 'orchestrator';
927
1034
  readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: 'orchestrator';
928
1035
  readonly KICI_ORCH_STALE_DETECTION_DURATION_SECONDS: 'orchestrator';
@@ -974,6 +1081,9 @@ export declare const MetricService: {
974
1081
  readonly KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: 'platform';
975
1082
  readonly KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: 'platform';
976
1083
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: 'platform';
1084
+ readonly KICI_PLATFORM_MIMIR_RELAY_FINAL_DROPS_TOTAL: 'platform';
1085
+ readonly KICI_PLATFORM_MIMIR_RELAY_RETRIES_TOTAL: 'platform';
1086
+ readonly KICI_PLATFORM_MIMIR_RELAY_SHED_TOTAL: 'platform';
977
1087
  readonly KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: 'platform';
978
1088
  readonly KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: 'platform';
979
1089
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: 'platform';