@kici-dev/engine 0.1.13 → 0.1.15

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 (43) hide show
  1. package/README.md +13 -1
  2. package/dist/audit/access-log-policy.js +12 -0
  3. package/dist/audit/retention-policy.js +6 -0
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +8 -7
  6. package/dist/labels.d.ts +7 -0
  7. package/dist/labels.js +11 -2
  8. package/dist/metrics/metric-catalog.generated.d.ts +50 -0
  9. package/dist/metrics/metric-catalog.generated.js +60 -0
  10. package/dist/protocol/analytics-events.d.ts +16 -0
  11. package/dist/protocol/analytics-events.js +20 -0
  12. package/dist/protocol/dashboard-write-operations.d.ts +4 -1
  13. package/dist/protocol/dashboard-write-operations.js +11 -1
  14. package/dist/protocol/messages/access-log.d.ts +16 -0
  15. package/dist/protocol/messages/access-log.js +3 -0
  16. package/dist/protocol/messages/actor.d.ts +2 -0
  17. package/dist/protocol/messages/actor.js +12 -2
  18. package/dist/protocol/messages/auth.d.ts +1 -0
  19. package/dist/protocol/messages/capabilities.d.ts +1 -0
  20. package/dist/protocol/messages/dashboard-global-workflows.d.ts +2 -0
  21. package/dist/protocol/messages/dashboard.d.ts +685 -6
  22. package/dist/protocol/messages/dashboard.js +183 -10
  23. package/dist/protocol/messages/event-log.d.ts +4 -0
  24. package/dist/protocol/messages/event-log.js +4 -0
  25. package/dist/protocol/messages/execution-status.d.ts +133 -0
  26. package/dist/protocol/messages/execution-status.js +83 -3
  27. package/dist/protocol/messages/orchestrator-agent.d.ts +164 -0
  28. package/dist/protocol/messages/orchestrator-agent.js +118 -2
  29. package/dist/protocol/messages/peer.d.ts +13 -0
  30. package/dist/protocol/messages/peer.js +14 -1
  31. package/dist/protocol/messages/platform-orchestrator.d.ts +188 -0
  32. package/dist/protocol/messages/platform-orchestrator.js +3 -55
  33. package/dist/protocol/messages/run-events.d.ts +1 -0
  34. package/dist/provider/index.d.ts +1 -0
  35. package/dist/provider/index.js +2 -1
  36. package/dist/provider/lock-file-parse-error.d.ts +14 -0
  37. package/dist/provider/lock-file-parse-error.js +22 -0
  38. package/dist/trigger/types.d.ts +8 -1
  39. package/dist/trigger/types.js +3 -1
  40. package/dist/ws/close-codes.d.ts +7 -0
  41. package/dist/ws/close-codes.js +8 -1
  42. package/package.json +15 -8
  43. package/sbom.spdx.json +5 -5
@@ -1,9 +1,11 @@
1
1
  import "../../chunk-gOLHoazu.js";
2
2
  import { actorPrincipalSchema } from "./actor.js";
3
+ import { initFailureSchema } from "./execution-status.js";
3
4
  import { SourceSubtype } from "./source-registration.js";
4
5
  import { dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema } from "./access-log.js";
5
6
  import { dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema } from "./run-events.js";
6
7
  import { EventLogSource, EventLogStatus, PayloadOmittedReason } from "./event-log.js";
8
+ import { ScalerBackendType } from "../../scaler/scaler-backend-type.js";
7
9
  import { globalWorkflowsGetRequestSchema, globalWorkflowsGetResponseSchema, globalWorkflowsUpdateRequestSchema, globalWorkflowsUpdateResponseSchema } from "./dashboard-global-workflows.js";
8
10
  import { z } from "zod";
9
11
  //#region src/protocol/messages/dashboard.ts
@@ -56,6 +58,11 @@ const dashboardJobDetailSchema = z.object({
56
58
  outputs: z.record(z.string(), z.record(z.string(), z.unknown())).nullable().optional(),
57
59
  /** Secret output key names produced by this job (values are NOT included -- display masked). */
58
60
  secretOutputKeys: z.array(z.string()).nullable().optional(),
61
+ /**
62
+ * Structured init-failure signal for jobs that never started. Presence means
63
+ * the job is a synthetic `rejected-*` or `init-failed-*` row; status will be 'failed'.
64
+ */
65
+ initFailure: initFailureSchema.optional(),
59
66
  steps: z.array(dashboardStepDetailSchema)
60
67
  });
61
68
  /** Trust context from orchestrator execution_runs (populated for PR-triggered runs). */
@@ -74,6 +81,11 @@ const dashboardRunDetailResponseSchema = z.object({
74
81
  requestId: z.string(),
75
82
  jobs: z.array(dashboardJobDetailSchema),
76
83
  trustContext: trustContextSchema.optional(),
84
+ /**
85
+ * Structured init-failure signal for runs that never started. Set when the
86
+ * run row was created via recordInitFailureRun() on the orchestrator side.
87
+ */
88
+ initFailure: initFailureSchema.optional(),
77
89
  error: z.string().optional()
78
90
  });
79
91
  /** Response with step log lines (correlates to dashboard.step.logs). */
@@ -84,6 +96,108 @@ const dashboardStepLogsResponseSchema = z.object({
84
96
  totalLines: z.number(),
85
97
  error: z.string().optional()
86
98
  });
99
+ /**
100
+ * Run-summary projection from the orchestrator's execution_runs table.
101
+ *
102
+ * The required fields (`runId` / `routingKey` / `status`) are always present.
103
+ * Every other field is optional: the orchestrator omits what it cannot
104
+ * supply, and the customer runs page degrades a missing field to '—'.
105
+ */
106
+ const dashboardRunSummarySchema = z.object({
107
+ runId: z.string(),
108
+ routingKey: z.string(),
109
+ status: z.string(),
110
+ repoIdentifier: z.string().nullable().optional(),
111
+ createdAt: z.string(),
112
+ updatedAt: z.string().optional(),
113
+ trigger: z.string().optional(),
114
+ workflowName: z.string().optional(),
115
+ sha: z.string().optional(),
116
+ ref: z.string().optional(),
117
+ triggerEvent: z.string().optional(),
118
+ commitMessage: z.string().optional(),
119
+ jobCount: z.number().optional(),
120
+ startedAt: z.string().optional(),
121
+ completedAt: z.string().optional(),
122
+ durationMs: z.number().optional(),
123
+ parentRunId: z.string().optional(),
124
+ originalRunId: z.string().optional(),
125
+ triggeredBy: z.string().optional(),
126
+ cancelledBy: z.string().optional(),
127
+ failureReason: z.string().optional(),
128
+ hadCompileJob: z.boolean().optional(),
129
+ compileJobId: z.string().optional(),
130
+ source: z.object({
131
+ routingKey: z.string(),
132
+ name: z.string().nullable(),
133
+ subtype: z.string(),
134
+ provider: z.string()
135
+ }).optional()
136
+ });
137
+ /** Request a page of run summaries from the orchestrator. */
138
+ const dashboardRunsListRequestSchema = z.object({
139
+ type: z.literal("dashboard.runs.list"),
140
+ requestId: z.string(),
141
+ actor: actorPrincipalSchema,
142
+ /** Page size (1-200). Bounds protect the orchestrator from unbounded reads. */
143
+ limit: z.number().int().min(1).max(200).optional(),
144
+ cursor: z.string().optional()
145
+ });
146
+ /** Response with the page of run summaries + next-page cursor. */
147
+ const dashboardRunsListResponseSchema = z.object({
148
+ type: z.literal("dashboard.runs.list.response"),
149
+ requestId: z.string(),
150
+ runs: z.array(dashboardRunSummarySchema),
151
+ nextCursor: z.string().optional(),
152
+ error: z.string().optional()
153
+ });
154
+ /** Request the distinct filter-option values from the orchestrator. */
155
+ const dashboardRunsFiltersRequestSchema = z.object({
156
+ type: z.literal("dashboard.runs.filters"),
157
+ requestId: z.string(),
158
+ actor: actorPrincipalSchema
159
+ });
160
+ /** Response with the distinct filter-option values. */
161
+ const dashboardRunsFiltersResponseSchema = z.object({
162
+ type: z.literal("dashboard.runs.filters.response"),
163
+ requestId: z.string(),
164
+ statuses: z.array(z.string()),
165
+ workflows: z.array(z.string()),
166
+ branches: z.array(z.string()),
167
+ repositories: z.array(z.string()),
168
+ triggerTypes: z.array(z.string()),
169
+ sources: z.array(z.object({
170
+ routingKey: z.string(),
171
+ name: z.string().nullable()
172
+ })),
173
+ error: z.string().optional()
174
+ });
175
+ /** Minimal source-summary projection from the orchestrator's sources tables. */
176
+ const dashboardSourceSummarySchema = z.object({
177
+ routingKey: z.string(),
178
+ name: z.string().nullable(),
179
+ provider: z.string(),
180
+ subtype: SourceSubtype,
181
+ enabled: z.boolean(),
182
+ createdAt: z.string()
183
+ });
184
+ /** Request a page of source summaries from the orchestrator. */
185
+ const dashboardSourcesListRequestSchema = z.object({
186
+ type: z.literal("dashboard.sources.list"),
187
+ requestId: z.string(),
188
+ actor: actorPrincipalSchema,
189
+ /** Page size (1-200). Bounds protect the orchestrator from unbounded reads. */
190
+ limit: z.number().int().min(1).max(200).optional(),
191
+ cursor: z.string().optional()
192
+ });
193
+ /** Response with the page of source summaries + next-page cursor. */
194
+ const dashboardSourcesListResponseSchema = z.object({
195
+ type: z.literal("dashboard.sources.list.response"),
196
+ requestId: z.string(),
197
+ sources: z.array(dashboardSourceSummarySchema),
198
+ nextCursor: z.string().optional(),
199
+ error: z.string().optional()
200
+ });
87
201
  /** Request to re-run a completed run. */
88
202
  const runRerunRequestSchema = z.object({
89
203
  type: z.literal("run.rerun.request"),
@@ -417,6 +531,7 @@ const envListResponseSchema = z.object({
417
531
  type: environmentTypeSchema,
418
532
  globPattern: z.string().nullable(),
419
533
  enabled: z.boolean(),
534
+ allowLocalExecution: z.boolean(),
420
535
  createdAt: z.coerce.string(),
421
536
  updatedAt: z.coerce.string()
422
537
  })).optional(),
@@ -444,6 +559,7 @@ const envGetResponseSchema = z.object({
444
559
  waitTimerSeconds: z.number().nullable(),
445
560
  holdExpirySeconds: z.number().nullable(),
446
561
  enabled: z.boolean(),
562
+ allowLocalExecution: z.boolean(),
447
563
  createdAt: z.coerce.string(),
448
564
  updatedAt: z.coerce.string()
449
565
  }).optional(),
@@ -495,6 +611,19 @@ const envUpdateResponseSchema = z.object({
495
611
  requestId: z.string(),
496
612
  error: z.string().optional()
497
613
  });
614
+ /** Set an environment's test-run access flag (allowLocalExecution). */
615
+ const envTestAccessSetRequestSchema = z.object({
616
+ type: z.literal("dashboard.environments.test_access.set"),
617
+ requestId: z.string(),
618
+ actor: actorPrincipalSchema,
619
+ environmentId: z.string(),
620
+ allowLocalExecution: z.boolean()
621
+ });
622
+ const envTestAccessSetResponseSchema = z.object({
623
+ type: z.literal("dashboard.environments.test_access.set.response"),
624
+ requestId: z.string(),
625
+ error: z.string().optional()
626
+ });
498
627
  /** Delete an environment. */
499
628
  const envDeleteRequestSchema = z.object({
500
629
  type: z.literal("dashboard.environments.delete"),
@@ -502,10 +631,22 @@ const envDeleteRequestSchema = z.object({
502
631
  actor: actorPrincipalSchema,
503
632
  environmentId: z.string()
504
633
  });
634
+ /**
635
+ * Machine-readable codes for environment-delete rejections.
636
+ *
637
+ * Three-category response taxonomy on dashboard responses, each mapped to a
638
+ * distinct HTTP status by the Platform proxy: a bare free-text `error` is the
639
+ * human message and maps to 400; a missing result (e.g. environment not found)
640
+ * maps to 404; an `errorCode` flags a specific business rejection mapped to a
641
+ * non-400/404 status — here `pending_held_runs` → 409. The sibling precedent is
642
+ * the rerun response's `errorCode` (`runArchivedNotRerunnable` → 410) above.
643
+ */
644
+ const EnvDeleteErrorCode = z.enum(["pending_held_runs"]);
505
645
  const envDeleteResponseSchema = z.object({
506
646
  type: z.literal("dashboard.environments.delete.response"),
507
647
  requestId: z.string(),
508
- error: z.string().optional()
648
+ error: z.string().optional(),
649
+ errorCode: EnvDeleteErrorCode.optional()
509
650
  });
510
651
  /** List variables for an environment. */
511
652
  const envVarsListRequestSchema = z.object({
@@ -754,8 +895,8 @@ const heldRunsListResponseSchema = z.object({
754
895
  heldRuns: z.array(z.object({
755
896
  id: z.string(),
756
897
  runId: z.string(),
757
- environmentId: z.string(),
758
- environmentName: z.string(),
898
+ environmentId: z.string().nullable(),
899
+ environmentName: z.string().nullable(),
759
900
  holdType: z.string(),
760
901
  queueType: HeldRunQueueType,
761
902
  status: HeldRunStatus,
@@ -829,11 +970,19 @@ const diagnosticsAgentSchema = z.object({
829
970
  /** Single scaler backend within the diagnostics response. */
830
971
  const diagnosticsScalerSchema = z.object({
831
972
  name: z.string(),
832
- type: z.string(),
973
+ type: ScalerBackendType,
833
974
  maxAgents: z.number(),
834
975
  activeAgents: z.number(),
835
976
  labelSets: z.array(z.array(z.string())),
836
- config: z.record(z.string(), z.unknown()).optional()
977
+ config: z.record(z.string(), z.unknown()).optional(),
978
+ /**
979
+ * The spawning host of this scaler, declared statically by its backend.
980
+ * Populated (with the owning orchestrator instance's hostname) for backends
981
+ * that spawn agents on the host itself — bare-metal, Firecracker, container
982
+ * on a local runtime socket. Omitted for backends that provision elsewhere
983
+ * (remote container runtime, future cloud backends).
984
+ */
985
+ hosts: z.array(z.string()).optional()
837
986
  });
838
987
  /** Agent info within a peer diagnostics entry (subset of full agent schema). */
839
988
  const diagnosticsPeerAgentSchema = z.object({
@@ -842,7 +991,9 @@ const diagnosticsPeerAgentSchema = z.object({
842
991
  platform: z.string(),
843
992
  arch: z.string(),
844
993
  activeJobs: z.number(),
845
- maxConcurrency: z.number()
994
+ maxConcurrency: z.number(),
995
+ /** Scaler backend that spawned the agent, or null for static (stateful) agents. */
996
+ scalerName: z.string().nullable().optional()
846
997
  });
847
998
  /** Peer orchestrator reported by coordinator in diagnostics. */
848
999
  const diagnosticsPeerSchema = z.object({
@@ -868,7 +1019,8 @@ const diagnosticsPeerSchema = z.object({
868
1019
  type: z.string().optional(),
869
1020
  activeCount: z.number(),
870
1021
  maxAgents: z.number(),
871
- labelSets: z.array(z.array(z.string()))
1022
+ labelSets: z.array(z.array(z.string())),
1023
+ spawnsOnLocalHost: z.boolean().optional()
872
1024
  })).optional(),
873
1025
  dependencyHealth: z.array(z.object({
874
1026
  name: z.string(),
@@ -922,7 +1074,13 @@ const dashboardDiagnosticsResponseSchema = z.object({
922
1074
  /** Total number of registered agents (always populated regardless of includeAgents). */
923
1075
  agentCount: z.number().nullable().optional(),
924
1076
  /** Number of agents not bound to any scaler. */
925
- statefulAgentCount: z.number().nullable().optional()
1077
+ statefulAgentCount: z.number().nullable().optional(),
1078
+ /**
1079
+ * Distinct host names of stateful (unbound) agents, derived from their
1080
+ * self-reported kici:host: labels. Lets the dashboard surface the hosts of
1081
+ * long-lived standalone agents on the collapsed "Stateful agents" header.
1082
+ */
1083
+ statefulHosts: z.array(z.string()).optional()
926
1084
  }),
927
1085
  agents: z.array(diagnosticsAgentSchema),
928
1086
  scalers: z.array(diagnosticsScalerSchema).optional(),
@@ -1144,6 +1302,9 @@ const backendTestResponseSchema = z.object({
1144
1302
  const dashboardPlatformToOrchSchema = z.discriminatedUnion("type", [
1145
1303
  dashboardRunDetailRequestSchema,
1146
1304
  dashboardStepLogsRequestSchema,
1305
+ dashboardRunsListRequestSchema,
1306
+ dashboardRunsFiltersRequestSchema,
1307
+ dashboardSourcesListRequestSchema,
1147
1308
  runRerunRequestSchema,
1148
1309
  manualScheduleRequestSchema,
1149
1310
  runCancelRequestSchema,
@@ -1153,6 +1314,7 @@ const dashboardPlatformToOrchSchema = z.discriminatedUnion("type", [
1153
1314
  envGetRequestSchema,
1154
1315
  envCreateRequestSchema,
1155
1316
  envUpdateRequestSchema,
1317
+ envTestAccessSetRequestSchema,
1156
1318
  envDeleteRequestSchema,
1157
1319
  envVarsListRequestSchema,
1158
1320
  envVarSetRequestSchema,
@@ -1198,6 +1360,9 @@ const dashboardPlatformToOrchSchema = z.discriminatedUnion("type", [
1198
1360
  const dashboardOrchToPlatformSchema = z.discriminatedUnion("type", [
1199
1361
  dashboardRunDetailResponseSchema,
1200
1362
  dashboardStepLogsResponseSchema,
1363
+ dashboardRunsListResponseSchema,
1364
+ dashboardRunsFiltersResponseSchema,
1365
+ dashboardSourcesListResponseSchema,
1201
1366
  runRerunResponseSchema,
1202
1367
  manualScheduleResponseSchema,
1203
1368
  runCancelResponseSchema,
@@ -1207,6 +1372,7 @@ const dashboardOrchToPlatformSchema = z.discriminatedUnion("type", [
1207
1372
  envGetResponseSchema,
1208
1373
  envCreateResponseSchema,
1209
1374
  envUpdateResponseSchema,
1375
+ envTestAccessSetResponseSchema,
1210
1376
  envDeleteResponseSchema,
1211
1377
  envVarsListResponseSchema,
1212
1378
  envVarSetResponseSchema,
@@ -1251,7 +1417,14 @@ const dashboardOrchToPlatformSchema = z.discriminatedUnion("type", [
1251
1417
  /** REST API response for run detail (jobs with nested steps). */
1252
1418
  const dashboardRunDetailApiResponseSchema = z.object({
1253
1419
  jobs: z.array(dashboardJobDetailSchema),
1254
- trustContext: trustContextSchema.optional()
1420
+ trustContext: trustContextSchema.optional(),
1421
+ /**
1422
+ * Structured init-failure signal for runs that never started a step. Set
1423
+ * when the run row was created via `recordInitFailureRun()` on the
1424
+ * orchestrator and surfaced to the dashboard so the banner can render
1425
+ * even while the orchestrator is offline (Platform-DB fallback path).
1426
+ */
1427
+ initFailure: initFailureSchema.optional()
1255
1428
  });
1256
1429
  /** REST API response for step logs. */
1257
1430
  const dashboardStepLogsApiResponseSchema = z.object({
@@ -1316,6 +1489,6 @@ const orgMemberSchema = z.object({
1316
1489
  /** Response for org members list endpoint. */
1317
1490
  const memberListResponseSchema = z.object({ members: z.array(orgMemberSchema) });
1318
1491
  //#endregion
1319
- export { EventLogPayloadStreamError, HeldRunQueueType, HeldRunStatus, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runRerunRequestSchema, trustPolicyResponseSchema };
1492
+ export { EnvDeleteErrorCode, EventLogPayloadStreamError, HeldRunQueueType, HeldRunStatus, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runRerunRequestSchema, trustPolicyResponseSchema };
1320
1493
 
1321
1494
  //# sourceMappingURL=dashboard.js.map
@@ -9,6 +9,9 @@ import { z } from 'zod';
9
9
  * - `duplicate` — dedup cache rejected the delivery.
10
10
  * - `lockfile_missing` — repo lookup succeeded but no lock file was found
11
11
  * (and no global workflows matched either).
12
+ * - `lockfile_corrupt` — a lock file was present at the repo ref but could not
13
+ * be parsed or validated; the orchestrator records a `lock_resolution`
14
+ * init-failure run for the delivery.
12
15
  * - `failed` — pipeline threw an unhandled error. `error_message` carries
13
16
  * the message.
14
17
  */
@@ -18,6 +21,7 @@ export declare const EventLogStatus: z.ZodEnum<{
18
21
  processed: "processed";
19
22
  duplicate: "duplicate";
20
23
  lockfile_missing: "lockfile_missing";
24
+ lockfile_corrupt: "lockfile_corrupt";
21
25
  }>;
22
26
  export type EventLogStatus = z.infer<typeof EventLogStatus>;
23
27
  /**
@@ -11,6 +11,9 @@ import { z } from "zod";
11
11
  * - `duplicate` — dedup cache rejected the delivery.
12
12
  * - `lockfile_missing` — repo lookup succeeded but no lock file was found
13
13
  * (and no global workflows matched either).
14
+ * - `lockfile_corrupt` — a lock file was present at the repo ref but could not
15
+ * be parsed or validated; the orchestrator records a `lock_resolution`
16
+ * init-failure run for the delivery.
14
17
  * - `failed` — pipeline threw an unhandled error. `error_message` carries
15
18
  * the message.
16
19
  */
@@ -19,6 +22,7 @@ const EventLogStatus = z.enum([
19
22
  "processed",
20
23
  "duplicate",
21
24
  "lockfile_missing",
25
+ "lockfile_corrupt",
22
26
  "failed"
23
27
  ]);
24
28
  /**
@@ -32,6 +32,103 @@ export declare const ExecutionStepStatus: z.ZodEnum<{
32
32
  skipped: "skipped";
33
33
  }>;
34
34
  export type ExecutionStepStatus = z.infer<typeof ExecutionStepStatus>;
35
+ /**
36
+ * Distinct reasons a run/job ended because a configured wall-clock timeout
37
+ * was exceeded. Surfaced in the failure/cancel reason so the dashboard can
38
+ * label "timed out" instead of a generic failure.
39
+ *
40
+ * - `job_timeout` — a job exceeded its `timeout` (total job wall-clock,
41
+ * agent-enforced in the forked workflow-runner).
42
+ * - `workflow_timeout` — a run exceeded the workflow `timeout` (whole-run
43
+ * wall-clock, orchestrator-enforced run deadline).
44
+ *
45
+ * Step-level timeouts are reported inline in the step error message and do
46
+ * NOT use this enum (they predate it and stay as-is).
47
+ */
48
+ export declare const TimeoutReason: z.ZodEnum<{
49
+ job_timeout: "job_timeout";
50
+ workflow_timeout: "workflow_timeout";
51
+ }>;
52
+ export type TimeoutReason = z.infer<typeof TimeoutReason>;
53
+ /**
54
+ * Categories of init failure — i.e. failures that prevent a run from ever
55
+ * executing a step. Set at the detection site (orchestrator or agent) and
56
+ * persisted alongside the run/job row so the dashboard can render an
57
+ * explanatory banner even when the orchestrator is offline.
58
+ *
59
+ * Scope is carried separately on `initFailureSchema.scope`:
60
+ * - `run`-scoped categories fail the whole run before any job runs
61
+ * (secret_resolution, install_secrets, lock_resolution,
62
+ * build_coordination).
63
+ * - `job`-scoped categories fail one job and leave siblings alone
64
+ * (environment_rules, dynamic_eval, no_agent, matrix_expansion).
65
+ */
66
+ export declare const InitFailureCategory: z.ZodEnum<{
67
+ secret_resolution: "secret_resolution";
68
+ install_secrets: "install_secrets";
69
+ lock_resolution: "lock_resolution";
70
+ build_coordination: "build_coordination";
71
+ environment_rules: "environment_rules";
72
+ dynamic_eval: "dynamic_eval";
73
+ no_agent: "no_agent";
74
+ matrix_expansion: "matrix_expansion";
75
+ }>;
76
+ export type InitFailureCategory = z.infer<typeof InitFailureCategory>;
77
+ /**
78
+ * `step_type` values for the user-facing cache pseudo-steps that appear in the
79
+ * run timeline. Mirrors the `hook:*` pseudo-step `step_type` convention: each
80
+ * declarative job/step cache restore or save surfaces as one pseudo-step so the
81
+ * dashboard can render it inline alongside the real steps.
82
+ */
83
+ export declare const CacheStepType: z.ZodEnum<{
84
+ "cache:restore": "cache:restore";
85
+ "cache:save": "cache:save";
86
+ }>;
87
+ export type CacheStepType = z.infer<typeof CacheStepType>;
88
+ /** `run.event` types emitted for user-facing cache operations. */
89
+ export declare const CacheRunEventType: z.ZodEnum<{
90
+ "cache.restore": "cache.restore";
91
+ "cache.save": "cache.save";
92
+ }>;
93
+ export type CacheRunEventType = z.infer<typeof CacheRunEventType>;
94
+ /**
95
+ * Outcome recorded on a cache pseudo-step (drives the pseudo-step status + the
96
+ * `run.event` metadata).
97
+ *
98
+ * - `hit` — restore found an entry (exact key or restoreKeys prefix).
99
+ * - `miss` — restore found nothing.
100
+ * - `saved` — save uploaded a new entry under the immutable key.
101
+ * - `skipped` — save was a no-op (the immutable exact key already existed).
102
+ * - `error` — the restore/save failed (pack/extract/transport error).
103
+ */
104
+ export declare const CacheOutcome: z.ZodEnum<{
105
+ error: "error";
106
+ skipped: "skipped";
107
+ hit: "hit";
108
+ miss: "miss";
109
+ saved: "saved";
110
+ }>;
111
+ export type CacheOutcome = z.infer<typeof CacheOutcome>;
112
+ /** Structured init-failure signal. Presence on a run/job means "never started". */
113
+ export declare const initFailureSchema: z.ZodObject<{
114
+ scope: z.ZodEnum<{
115
+ run: "run";
116
+ job: "job";
117
+ }>;
118
+ category: z.ZodEnum<{
119
+ secret_resolution: "secret_resolution";
120
+ install_secrets: "install_secrets";
121
+ lock_resolution: "lock_resolution";
122
+ build_coordination: "build_coordination";
123
+ environment_rules: "environment_rules";
124
+ dynamic_eval: "dynamic_eval";
125
+ no_agent: "no_agent";
126
+ matrix_expansion: "matrix_expansion";
127
+ }>;
128
+ message: z.ZodString;
129
+ jobName: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strip>;
131
+ export type InitFailure = z.infer<typeof initFailureSchema>;
35
132
  /** Terminal run states that indicate the run has completed. */
36
133
  export declare const TERMINAL_RUN_STATES: ReadonlySet<string>;
37
134
  /** Terminal job states that indicate the job is no longer running. */
@@ -65,6 +162,24 @@ export declare const executionStatusSchema: z.ZodObject<{
65
162
  triggeredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
163
  failureReason: z.ZodOptional<z.ZodString>;
67
164
  logBytes: z.ZodOptional<z.ZodNumber>;
165
+ initFailure: z.ZodOptional<z.ZodObject<{
166
+ scope: z.ZodEnum<{
167
+ run: "run";
168
+ job: "job";
169
+ }>;
170
+ category: z.ZodEnum<{
171
+ secret_resolution: "secret_resolution";
172
+ install_secrets: "install_secrets";
173
+ lock_resolution: "lock_resolution";
174
+ build_coordination: "build_coordination";
175
+ environment_rules: "environment_rules";
176
+ dynamic_eval: "dynamic_eval";
177
+ no_agent: "no_agent";
178
+ matrix_expansion: "matrix_expansion";
179
+ }>;
180
+ message: z.ZodString;
181
+ jobName: z.ZodOptional<z.ZodString>;
182
+ }, z.core.$strip>>;
68
183
  }, z.core.$strip>;
69
184
  /** Per-step status forwarded from agent to Platform (real-time). */
70
185
  export declare const stepStatusForwardSchema: z.ZodObject<{
@@ -115,6 +230,24 @@ export declare const jobStatusForwardSchema: z.ZodObject<{
115
230
  runsOnLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
231
  logBytes: z.ZodOptional<z.ZodNumber>;
117
232
  timestamp: z.ZodNumber;
233
+ initFailure: z.ZodOptional<z.ZodObject<{
234
+ scope: z.ZodEnum<{
235
+ run: "run";
236
+ job: "job";
237
+ }>;
238
+ category: z.ZodEnum<{
239
+ secret_resolution: "secret_resolution";
240
+ install_secrets: "install_secrets";
241
+ lock_resolution: "lock_resolution";
242
+ build_coordination: "build_coordination";
243
+ environment_rules: "environment_rules";
244
+ dynamic_eval: "dynamic_eval";
245
+ no_agent: "no_agent";
246
+ matrix_expansion: "matrix_expansion";
247
+ }>;
248
+ message: z.ZodString;
249
+ jobName: z.ZodOptional<z.ZodString>;
250
+ }, z.core.$strip>>;
118
251
  }, z.core.$strip>;
119
252
  /** State replay sent on orchestrator reconnection -- full snapshot of active runs and jobs. */
120
253
  export declare const stateReplaySchema: z.ZodObject<{
@@ -31,6 +31,78 @@ const ExecutionStepStatus = z.enum([
31
31
  "failed",
32
32
  "skipped"
33
33
  ]);
34
+ /**
35
+ * Distinct reasons a run/job ended because a configured wall-clock timeout
36
+ * was exceeded. Surfaced in the failure/cancel reason so the dashboard can
37
+ * label "timed out" instead of a generic failure.
38
+ *
39
+ * - `job_timeout` — a job exceeded its `timeout` (total job wall-clock,
40
+ * agent-enforced in the forked workflow-runner).
41
+ * - `workflow_timeout` — a run exceeded the workflow `timeout` (whole-run
42
+ * wall-clock, orchestrator-enforced run deadline).
43
+ *
44
+ * Step-level timeouts are reported inline in the step error message and do
45
+ * NOT use this enum (they predate it and stay as-is).
46
+ */
47
+ const TimeoutReason = z.enum(["job_timeout", "workflow_timeout"]);
48
+ /**
49
+ * Categories of init failure — i.e. failures that prevent a run from ever
50
+ * executing a step. Set at the detection site (orchestrator or agent) and
51
+ * persisted alongside the run/job row so the dashboard can render an
52
+ * explanatory banner even when the orchestrator is offline.
53
+ *
54
+ * Scope is carried separately on `initFailureSchema.scope`:
55
+ * - `run`-scoped categories fail the whole run before any job runs
56
+ * (secret_resolution, install_secrets, lock_resolution,
57
+ * build_coordination).
58
+ * - `job`-scoped categories fail one job and leave siblings alone
59
+ * (environment_rules, dynamic_eval, no_agent, matrix_expansion).
60
+ */
61
+ const InitFailureCategory = z.enum([
62
+ "secret_resolution",
63
+ "install_secrets",
64
+ "lock_resolution",
65
+ "build_coordination",
66
+ "environment_rules",
67
+ "dynamic_eval",
68
+ "no_agent",
69
+ "matrix_expansion"
70
+ ]);
71
+ /**
72
+ * `step_type` values for the user-facing cache pseudo-steps that appear in the
73
+ * run timeline. Mirrors the `hook:*` pseudo-step `step_type` convention: each
74
+ * declarative job/step cache restore or save surfaces as one pseudo-step so the
75
+ * dashboard can render it inline alongside the real steps.
76
+ */
77
+ const CacheStepType = z.enum(["cache:restore", "cache:save"]);
78
+ /** `run.event` types emitted for user-facing cache operations. */
79
+ const CacheRunEventType = z.enum(["cache.restore", "cache.save"]);
80
+ /**
81
+ * Outcome recorded on a cache pseudo-step (drives the pseudo-step status + the
82
+ * `run.event` metadata).
83
+ *
84
+ * - `hit` — restore found an entry (exact key or restoreKeys prefix).
85
+ * - `miss` — restore found nothing.
86
+ * - `saved` — save uploaded a new entry under the immutable key.
87
+ * - `skipped` — save was a no-op (the immutable exact key already existed).
88
+ * - `error` — the restore/save failed (pack/extract/transport error).
89
+ */
90
+ const CacheOutcome = z.enum([
91
+ "hit",
92
+ "miss",
93
+ "saved",
94
+ "skipped",
95
+ "error"
96
+ ]);
97
+ /** Structured init-failure signal. Presence on a run/job means "never started". */
98
+ const initFailureSchema = z.object({
99
+ scope: z.enum(["run", "job"]),
100
+ category: InitFailureCategory,
101
+ /** Human-readable failure message (same content surfaced by RunFailureSummary). */
102
+ message: z.string(),
103
+ /** Set when scope === 'job'. */
104
+ jobName: z.string().optional()
105
+ });
34
106
  /** Terminal run states that indicate the run has completed. */
35
107
  const TERMINAL_RUN_STATES = new Set([
36
108
  ExecutionRunStatus.enum.success,
@@ -80,7 +152,13 @@ const executionStatusSchema = z.object({
80
152
  * Only set on terminal run states. Powers the operator-side
81
153
  * `kici_org_log_bytes` capacity-planning gauge on the Platform.
82
154
  */
83
- logBytes: z.number().int().nonnegative().optional()
155
+ logBytes: z.number().int().nonnegative().optional(),
156
+ /**
157
+ * Structured init-failure signal. Set by the orchestrator when the run
158
+ * never executed a single step. Persisted in execution_runs.init_failure
159
+ * on both orchestrator and Platform sides. Only present when status === 'failed'.
160
+ */
161
+ initFailure: initFailureSchema.optional()
84
162
  });
85
163
  /** Per-step status forwarded from agent to Platform (real-time). */
86
164
  const stepStatusForwardSchema = z.object({
@@ -121,7 +199,9 @@ const jobStatusForwardSchema = z.object({
121
199
  * `kici_org_log_bytes` capacity-planning gauge on the Platform.
122
200
  */
123
201
  logBytes: z.number().int().nonnegative().optional(),
124
- timestamp: z.number()
202
+ timestamp: z.number(),
203
+ /** Structured init-failure signal — set for synthetic rejected-* / init-failed-* jobs. */
204
+ initFailure: initFailureSchema.optional()
125
205
  });
126
206
  /** State replay sent on orchestrator reconnection -- full snapshot of active runs and jobs. */
127
207
  const stateReplaySchema = z.object({
@@ -161,6 +241,6 @@ const stateReplaySchema = z.object({
161
241
  timestamp: z.number()
162
242
  });
163
243
  //#endregion
164
- export { ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, executionStatusSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema };
244
+ export { CacheOutcome, CacheRunEventType, CacheStepType, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, InitFailureCategory, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TimeoutReason, executionStatusSchema, initFailureSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema };
165
245
 
166
246
  //# sourceMappingURL=execution-status.js.map