@kici-dev/engine 0.14.2 → 0.16.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.
Files changed (58) hide show
  1. package/dist/approval/expiry-duration.d.ts +11 -0
  2. package/dist/approval/expiry-duration.js +29 -0
  3. package/dist/audit/access-log-policy.js +2 -0
  4. package/dist/audit/retention-policy.d.ts +1 -1
  5. package/dist/audit/retention-policy.js +5 -1
  6. package/dist/auth/permissions.d.ts +69 -0
  7. package/dist/auth/permissions.js +51 -0
  8. package/dist/context/hold-type.d.ts +0 -19
  9. package/dist/context/hold-type.js +1 -37
  10. package/dist/context/index.d.ts +1 -1
  11. package/dist/context/index.js +2 -2
  12. package/dist/index.d.ts +7 -2
  13. package/dist/index.js +20 -15
  14. package/dist/labels.d.ts +2 -17
  15. package/dist/labels.js +3 -33
  16. package/dist/mcp/held-run-resolve.d.ts +2 -5
  17. package/dist/mcp/held-run-resolve.js +3 -4
  18. package/dist/metrics/metric-catalog.generated.d.ts +0 -5
  19. package/dist/metrics/metric-catalog.generated.js +0 -6
  20. package/dist/protocol/messages/access-log.d.ts +10 -0
  21. package/dist/protocol/messages/access-log.js +2 -0
  22. package/dist/protocol/messages/auth.d.ts +7 -8
  23. package/dist/protocol/messages/auth.js +12 -17
  24. package/dist/protocol/messages/browser.js +1 -1
  25. package/dist/protocol/messages/capabilities.d.ts +21 -100
  26. package/dist/protocol/messages/capabilities.js +22 -124
  27. package/dist/protocol/messages/dashboard.d.ts +64 -22
  28. package/dist/protocol/messages/dashboard.js +43 -40
  29. package/dist/protocol/messages/execution-status.d.ts +3 -3
  30. package/dist/protocol/messages/execution-status.js +7 -12
  31. package/dist/protocol/messages/join.d.ts +73 -2
  32. package/dist/protocol/messages/join.js +101 -12
  33. package/dist/protocol/messages/orchestrator-agent.d.ts +35 -40
  34. package/dist/protocol/messages/orchestrator-agent.js +63 -96
  35. package/dist/protocol/messages/peer.d.ts +278 -26
  36. package/dist/protocol/messages/peer.js +120 -65
  37. package/dist/protocol/messages/platform-orchestrator.d.ts +36 -141
  38. package/dist/protocol/messages/platform-orchestrator.js +24 -86
  39. package/dist/protocol/messages/source-registration.d.ts +0 -13
  40. package/dist/protocol/messages/source-registration.js +9 -10
  41. package/dist/protocol/version.d.ts +9 -15
  42. package/dist/protocol/version.js +9 -15
  43. package/dist/provenance/id-token-claim-names.d.ts +3 -5
  44. package/dist/provenance/id-token-claim-names.js +3 -5
  45. package/dist/status/presentation.d.ts +2 -14
  46. package/dist/status/presentation.js +3 -23
  47. package/dist/trigger/types.d.ts +125 -34
  48. package/dist/trigger/types.js +9 -24
  49. package/dist/util/date.d.ts +7 -0
  50. package/dist/util/date.js +14 -0
  51. package/dist/util/parse-duration.d.ts +6 -0
  52. package/dist/util/parse-duration.js +21 -0
  53. package/dist/util/sleep.d.ts +3 -0
  54. package/dist/util/sleep.js +10 -0
  55. package/dist/webhook/webhook-url-format.d.ts +2 -2
  56. package/dist/webhook/webhook-url-format.js +2 -2
  57. package/package.json +1 -1
  58. package/sbom.spdx.json +5 -5
@@ -1,12 +1,12 @@
1
1
  import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import { heartbeatSchema, nackSchema } from "./common.js";
3
- import { executionStatusSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema } from "./execution-status.js";
4
- import { jobContextMessageSchema, runEventMessageSchema } from "./run-events.js";
5
- import { sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema } from "./source-registration.js";
6
- import { dashboardPlatformToOrchSchema } from "./dashboard.js";
7
3
  import { OrchRole, orchCapabilitiesSchema, platformCapabilitiesSchema } from "./capabilities.js";
8
4
  import { authFailureSchema, authRequestSchema, authSuccessSchema } from "./auth.js";
9
5
  import { LogStream } from "./log-stream.js";
6
+ import { executionStatusSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema } from "./execution-status.js";
7
+ import { sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema } from "./source-registration.js";
8
+ import { jobContextMessageSchema, runEventMessageSchema } from "./run-events.js";
9
+ import { dashboardPlatformToOrchSchema } from "./dashboard.js";
10
10
  import { z } from "zod";
11
11
  //#region src/protocol/messages/platform-orchestrator.ts
12
12
  /**
@@ -15,20 +15,15 @@ import { z } from "zod";
15
15
  * from the enclosing message so the orchestrator's evaluator and cache can type
16
16
  * against the policy alone.
17
17
  */
18
+ /** Seconds in an hour. */
19
+ const SECONDS_PER_HOUR = 3600;
18
20
  /**
19
- * Documented default hours a security hold stays open.
21
+ * Documented default window a security hold stays open: 72 hours.
20
22
  *
21
23
  * The single owner of the value: the fail-closed policy, the orchestrator's
22
24
  * stored-policy default, and the hold-sizing fallback all read it, so the
23
25
  * number cannot drift between the two packages that enforce it.
24
26
  */
25
- const DEFAULT_APPROVAL_EXPIRY_HOURS = 72;
26
- /** Seconds in an hour — the one conversion between the two expiry spellings. */
27
- const SECONDS_PER_HOUR = 3600;
28
- /**
29
- * The same documented default as {@link DEFAULT_APPROVAL_EXPIRY_HOURS}, in the
30
- * granularity the policy actually stores.
31
- */
32
27
  const DEFAULT_APPROVAL_EXPIRY_SECONDS = 72 * SECONDS_PER_HOUR;
33
28
  /**
34
29
  * The shortest expressible security-hold window.
@@ -39,37 +34,8 @@ const DEFAULT_APPROVAL_EXPIRY_SECONDS = 72 * SECONDS_PER_HOUR;
39
34
  * opinion that also puts the window back out of reach of a test.
40
35
  */
41
36
  const MIN_APPROVAL_EXPIRY_SECONDS = 1;
42
- /** The longest window the Platform accepts: one year, the bound already applied to hours. */
43
- const MAX_APPROVAL_EXPIRY_HOURS = 8760;
44
- /** {@link MAX_APPROVAL_EXPIRY_HOURS} in seconds, so neither spelling outranges the other. */
45
- const MAX_APPROVAL_EXPIRY_SECONDS = MAX_APPROVAL_EXPIRY_HOURS * SECONDS_PER_HOUR;
46
- /**
47
- * The window a policy actually means, in seconds.
48
- *
49
- * `approvalExpirySeconds` is the authority and `approvalExpiryHours` its coarse
50
- * spelling, so the more specific field wins whenever both are present — the
51
- * only rule that never discards what an operator asked for. A policy carrying
52
- * neither (an older peer that sent no window at all) falls back to the
53
- * documented default.
54
- */
55
- function approvalExpirySecondsOf(policy) {
56
- if (policy.approvalExpirySeconds != null) return policy.approvalExpirySeconds;
57
- if (policy.approvalExpiryHours != null) return policy.approvalExpiryHours * SECONDS_PER_HOUR;
58
- return DEFAULT_APPROVAL_EXPIRY_SECONDS;
59
- }
60
- /**
61
- * The coarse `approvalExpiryHours` view of a window stored in seconds.
62
- *
63
- * Rounds UP, and never below one hour. A sub-hour window has no exact hours
64
- * spelling, and the peer reading this field is one that cannot express the real
65
- * value anyway — so the choice is which way to be wrong. Rounding up yields a
66
- * longer hold than asked for, which stays approvable; rounding down yields zero,
67
- * which is the already-expired hold `MIN_APPROVAL_EXPIRY_SECONDS` exists to
68
- * prevent.
69
- */
70
- function approvalExpiryHoursOf(seconds) {
71
- return Math.max(1, Math.ceil(seconds / SECONDS_PER_HOUR));
72
- }
37
+ /** The longest window the Platform accepts: one year. */
38
+ const MAX_APPROVAL_EXPIRY_SECONDS = 8760 * SECONDS_PER_HOUR;
73
39
  /**
74
40
  * The org-level fork switch: the setting an org's trust policy carries for how
75
41
  * fork pull requests are treated. Each value names what the operator is
@@ -110,31 +76,14 @@ const CiTrustLevel = z.enum([
110
76
  const trustPolicySchema = z.object({
111
77
  forkPolicy: ForkPolicy,
112
78
  /**
113
- * Hours a security hold stays open — the coarse spelling of
114
- * `approvalExpirySeconds`, kept required so an orchestrator or CLI on an
115
- * older build still receives a window it can read. Not deprecated: it is read,
116
- * enforced whenever no seconds value accompanies it, and remains the
117
- * ergonomic way to say "72 hours".
118
- *
119
- * Integer and positive: the column is INTEGER NOT NULL, so a fractional value
120
- * throws inside the fire-and-forget persist and the policy is then silently
121
- * never stored, and a zero or negative value mints an already-expired hold.
122
- */
123
- approvalExpiryHours: z.number().int().min(1),
124
- /**
125
- * Seconds a security hold stays open — the authoritative window, and the one
126
- * granularity that can express a sub-hour hold.
79
+ * Seconds a security hold stays open.
127
80
  *
128
- * Optional because an older Platform sends only the hours field; a frame
129
- * without it resolves through {@link approvalExpirySecondsOf}, which falls
130
- * back to `approvalExpiryHours * SECONDS_PER_HOUR`. When both are present this
131
- * one wins, at every layer.
132
- *
133
- * Integer and at least {@link MIN_APPROVAL_EXPIRY_SECONDS} for the same two
134
- * reasons the hours field is: the column is INTEGER, and a non-positive window
81
+ * Integer and at least {@link MIN_APPROVAL_EXPIRY_SECONDS}: the column is
82
+ * INTEGER, so a fractional value throws inside the fire-and-forget persist
83
+ * and the policy is then silently never stored, and a non-positive window
135
84
  * mints an already-expired hold.
136
85
  */
137
- approvalExpirySeconds: z.number().int().min(1).optional()
86
+ approvalExpirySeconds: z.number().int().min(1)
138
87
  }).strict();
139
88
  /** Trust policy update pushed from Platform to orchestrator when policy or identity links change. */
140
89
  const trustPolicyUpdateSchema = z.object({
@@ -345,12 +294,8 @@ const staleCheckrunCleanupSchema = z.object({
345
294
  });
346
295
  /**
347
296
  * Platform capability advertisement, sent once by the Platform after the
348
- * orchestrator authenticates. The orchestrator caches it per connection and
349
- * pre-flight-checks its own feature-gated sends against it, so a self-hosted
350
- * orchestrator running ahead of the hosted Platform surfaces a diagnosable
351
- * capability gap instead of firing a frame the Platform would silently drop.
352
- * Payload is `platformCapabilitiesSchema` (`.passthrough()`, absent =
353
- * unsupported).
297
+ * orchestrator authenticates. Payload is `platformCapabilitiesSchema`, which
298
+ * defines no flag at protocol 4.
354
299
  */
355
300
  const platformCapabilitiesMessageSchema = z.object({
356
301
  type: z.literal("platform.capabilities"),
@@ -436,20 +381,16 @@ const planHeadroomSchema = z.object({
436
381
  /**
437
382
  * Acknowledgment that a webhook was received and processing started.
438
383
  *
439
- * Under the chunked relay protocol the orchestrator also reports the HMAC
440
- * verification outcome here via `result`, and may include a non-secret-bearing
441
- * diagnostic in `reason` when result is a rejection. Both fields are optional
442
- * for backward compatibility during the rollout: pre-cutover senders omit them.
384
+ * The orchestrator reports the HMAC verification outcome via `result`, and may
385
+ * include a non-secret-bearing diagnostic in `reason` when result is a
386
+ * rejection.
443
387
  */
444
388
  const webhookAckSchema = z.object({
445
389
  type: z.literal("webhook.ack"),
446
390
  messageId: z.string(),
447
391
  deliveryId: z.string(),
448
- /**
449
- * Verification + processing outcome. Required from the chunked relay path
450
- * (commit 3 onwards on the orch side); pre-chunked acks omit this.
451
- */
452
- result: WebhookRelayResult.optional(),
392
+ /** Verification + processing outcome. */
393
+ result: WebhookRelayResult,
453
394
  /**
454
395
  * Optional non-secret-bearing diagnostic for rejection cases. MUST NOT
455
396
  * include any secret material (HMAC keys, bearer tokens, computed signatures).
@@ -479,11 +420,8 @@ const logChunkSchema = z.object({
479
420
  stepIndex: z.number(),
480
421
  lines: z.array(z.string()),
481
422
  timestamp: z.number(),
482
- /**
483
- * Which stream these lines came from. Optional for backward compatibility
484
- * with orchestrators that do not send it; absent is read as `stdout`.
485
- */
486
- stream: LogStream.optional()
423
+ /** Which stream these lines came from. */
424
+ stream: LogStream
487
425
  });
488
426
  /**
489
427
  * Phase of an orchestration/provisioning log line. Mirrors the phases the
@@ -620,6 +558,6 @@ const ORCH_TO_PLATFORM_RECOGNIZED_TYPES = new Set(collectDiscriminatorTypes(orch
620
558
  */
621
559
  const PLATFORM_TO_ORCH_RECOGNIZED_TYPES = new Set(collectDiscriminatorTypes(platformToOrchestratorMessageSchema));
622
560
  //#endregion
623
- export { CLUSTER_MEMBERSHIP_MAX_WORKERS, CiTrustLevel, DEFAULT_APPROVAL_EXPIRY_HOURS, DEFAULT_APPROVAL_EXPIRY_SECONDS, ForkPolicy, MAX_APPROVAL_EXPIRY_HOURS, MAX_APPROVAL_EXPIRY_SECONDS, MIN_APPROVAL_EXPIRY_SECONDS, ORCH_TO_PLATFORM_RECOGNIZED_TYPES, OrchLogPhase, PLATFORM_TO_ORCH_RECOGNIZED_TYPES, SECONDS_PER_HOUR, WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WebhookRelayResult, approvalExpiryHoursOf, approvalExpirySecondsOf, cacheStatsSchema, clusterMembershipSchema, collectDiscriminatorTypes, executionEventSchema, logChunkSchema, orchCapabilitiesUpdateSchema, orchLogChunkSchema, orchMetricsSchema, orchestratorToPlatformMessageSchema, peerDiscoverSchema, peerUpdateSchema, planHeadroomSchema, platformCapabilitiesMessageSchema, platformToOrchestratorMessageSchema, staleCheckrunCleanupSchema, trustPolicySchema, trustPolicyUpdateSchema, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
561
+ export { CLUSTER_MEMBERSHIP_MAX_WORKERS, CiTrustLevel, DEFAULT_APPROVAL_EXPIRY_SECONDS, ForkPolicy, MAX_APPROVAL_EXPIRY_SECONDS, MIN_APPROVAL_EXPIRY_SECONDS, ORCH_TO_PLATFORM_RECOGNIZED_TYPES, OrchLogPhase, PLATFORM_TO_ORCH_RECOGNIZED_TYPES, SECONDS_PER_HOUR, WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WebhookRelayResult, cacheStatsSchema, clusterMembershipSchema, collectDiscriminatorTypes, executionEventSchema, logChunkSchema, orchLogChunkSchema, orchMetricsSchema, orchestratorToPlatformMessageSchema, peerDiscoverSchema, peerUpdateSchema, planHeadroomSchema, platformCapabilitiesMessageSchema, platformToOrchestratorMessageSchema, staleCheckrunCleanupSchema, trustPolicySchema, trustPolicyUpdateSchema, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
624
562
 
625
563
  //# sourceMappingURL=platform-orchestrator.js.map
@@ -134,19 +134,6 @@ export declare const sourceRegistrationSchema: z.ZodObject<{
134
134
  s3LogAccess: z.ZodOptional<z.ZodBoolean>;
135
135
  queueTimeoutMs: z.ZodOptional<z.ZodNumber>;
136
136
  }, z.core.$strip>;
137
- /**
138
- * One accepted source in a {@link sourceRegistrationAckSchema}. Carries the
139
- * public webhook URL the Platform computed for this routing key so the
140
- * orchestrator (which only knows its org *alias*, never the canonical org id)
141
- * can surface it to the operator — e.g. `kici-admin source add` printing the
142
- * URL to paste into a GitHub App. `webhookUrl` is null when the Platform has
143
- * no public webhook base configured (`config.webhookPublicUrl` unset).
144
- */
145
- export declare const acceptedSourceSchema: z.ZodObject<{
146
- routingKey: z.ZodString;
147
- webhookUrl: z.ZodNullable<z.ZodString>;
148
- }, z.core.$strip>;
149
- export type AcceptedSource = z.infer<typeof acceptedSourceSchema>;
150
137
  /** Platform acknowledgment of source registration. */
151
138
  export declare const sourceRegistrationAckSchema: z.ZodObject<{
152
139
  type: z.ZodLiteral<"source.register.ack">;
@@ -131,30 +131,29 @@ const sourceRegistrationSchema = z.object({
131
131
  * different orchestrator clusters that accidentally share the same
132
132
  * `clusterName` in one org: every coord in an HA cluster shares the
133
133
  * same orch DB and therefore the same `clusterId`, while two unrelated
134
- * clusters carry distinct UUIDs. Optional — older orchestrators that
135
- * haven't been redeployed yet won't publish it, in which case Platform
136
- * skips the cross-cluster collision warn for that connection.
134
+ * clusters carry distinct UUIDs. Absent when the orchestrator could not
135
+ * read its cluster id, in which case Platform skips the cross-cluster
136
+ * collision warn for that connection.
137
137
  */
138
138
  clusterId: z.string().uuid().optional(),
139
139
  /** Reachable address for peer-to-peer connections (from KICI_CLUSTER_ADDRESS env var). */
140
140
  address: z.string().nullable().optional(),
141
- /** Orchestrator version (e.g. "0.0.1"). Optional for backward compatibility with older orchestrators. */
141
+ /** Orchestrator version (e.g. "0.0.1"). Absent when the orchestrator cannot read its own version. */
142
142
  version: z.string().optional(),
143
- /** Orchestrator config mode. Optional for backward compatibility. */
143
+ /** Orchestrator config mode. */
144
144
  mode: OrchestratorMode.optional(),
145
145
  /** Scaler backends configured on this orchestrator (e.g. ["container", "firecracker"]). */
146
146
  scalerBackends: z.array(z.string()).optional(),
147
147
  /**
148
148
  * How the orchestrator process itself was deployed (systemd/launchd/windows/
149
149
  * compose/unknown), used by the dashboard to build the correct kici-admin
150
- * invocation. Optional: older orchestrators that haven't been redeployed don't
151
- * publish it, in which case the dashboard treats the shape as `unknown`.
150
+ * invocation. Absent when the orchestrator cannot detect it, in which case
151
+ * the dashboard treats the shape as `unknown`.
152
152
  */
153
153
  deployment: DeploymentIdentitySchema.optional(),
154
154
  /**
155
155
  * Where this orchestrator's own config files live on its host, so the
156
- * dashboard can point an operator straight at them. Optional: an
157
- * orchestrator that predates the field omits it, and each member is omitted
156
+ * dashboard can point an operator straight at them. Each member is omitted
158
157
  * independently when that path is not knowable.
159
158
  */
160
159
  configPaths: ConfigPathsSchema.optional(),
@@ -205,6 +204,6 @@ const sourceDeregisterAckSchema = z.object({
205
204
  removed: z.array(z.string())
206
205
  });
207
206
  //#endregion
208
- export { OWN_INGRESS_MODES, OrchestratorMode, PLATFORM_CONNECTED_MODES, RELAY_INGRESS_MODES, SourceProvider, SourceSubtype, acceptedSourceSchema, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema };
207
+ export { OWN_INGRESS_MODES, OrchestratorMode, PLATFORM_CONNECTED_MODES, RELAY_INGRESS_MODES, SourceProvider, SourceSubtype, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema };
209
208
 
210
209
  //# sourceMappingURL=source-registration.js.map
@@ -1,21 +1,15 @@
1
1
  /**
2
2
  * Protocol version. Sent during WebSocket handshake.
3
3
  *
4
- * Increment when a message schema gains something an older peer cannot parse,
5
- * and pair the bump with a named floor so a sender can gate on the version a
6
- * peer negotiated instead of guessing.
4
+ * Increment when a message schema gains something an older peer cannot parse.
5
+ * The minimum equals the current version, so every bump is a breaking change:
6
+ * every tier upgrades in the same window.
7
7
  *
8
- * Version 3 records that a version-2 peer (every 0.8.x build) cannot parse the
9
- * 0.9.0 `trust_policy.update` policy, the peer heartbeat, or the
10
- * `artifacts.upload.complete` frame: the fields it requires were removed and
11
- * the schemas are strict, so a version-2 peer that was let through the
12
- * handshake would drop or refuse those frames silently.
8
+ * Version 4: fields every sender already set are required, and the capability
9
+ * flags every build advertised are gone. A version-3 peer (every release
10
+ * before it) may omit those fields, so it is refused at connect.
13
11
  */
14
- export declare const PROTOCOL_VERSION = 3;
15
- /**
16
- * Minimum protocol version accepted.
17
- * Connections below this are rejected.
18
- * Capabilities handle per-feature negotiation above this baseline.
19
- */
20
- export declare const MIN_PROTOCOL_VERSION = 3;
12
+ export declare const PROTOCOL_VERSION = 4;
13
+ /** Minimum protocol version accepted. Connections below this are rejected. */
14
+ export declare const MIN_PROTOCOL_VERSION = 4;
21
15
  //# sourceMappingURL=version.d.ts.map
@@ -3,23 +3,17 @@ import "../rolldown-runtime-ClRpJifh.js";
3
3
  /**
4
4
  * Protocol version. Sent during WebSocket handshake.
5
5
  *
6
- * Increment when a message schema gains something an older peer cannot parse,
7
- * and pair the bump with a named floor so a sender can gate on the version a
8
- * peer negotiated instead of guessing.
6
+ * Increment when a message schema gains something an older peer cannot parse.
7
+ * The minimum equals the current version, so every bump is a breaking change:
8
+ * every tier upgrades in the same window.
9
9
  *
10
- * Version 3 records that a version-2 peer (every 0.8.x build) cannot parse the
11
- * 0.9.0 `trust_policy.update` policy, the peer heartbeat, or the
12
- * `artifacts.upload.complete` frame: the fields it requires were removed and
13
- * the schemas are strict, so a version-2 peer that was let through the
14
- * handshake would drop or refuse those frames silently.
10
+ * Version 4: fields every sender already set are required, and the capability
11
+ * flags every build advertised are gone. A version-3 peer (every release
12
+ * before it) may omit those fields, so it is refused at connect.
15
13
  */
16
- const PROTOCOL_VERSION = 3;
17
- /**
18
- * Minimum protocol version accepted.
19
- * Connections below this are rejected.
20
- * Capabilities handle per-feature negotiation above this baseline.
21
- */
22
- const MIN_PROTOCOL_VERSION = 3;
14
+ const PROTOCOL_VERSION = 4;
15
+ /** Minimum protocol version accepted. Connections below this are rejected. */
16
+ const MIN_PROTOCOL_VERSION = 4;
23
17
  //#endregion
24
18
  export { MIN_PROTOCOL_VERSION, PROTOCOL_VERSION };
25
19
 
@@ -1,11 +1,9 @@
1
1
  /**
2
2
  * Every claim a KiCI provenance ID token carries, in a stable order.
3
3
  *
4
- * Both OIDC discovery documents render `claims_supported` from this list — the
5
- * orchestrator issuer that mints tokens today and the legacy Platform issuer
6
- * whose already-issued tokens carried the same shape — so a relying party
7
- * configuring a trust policy reads the same names under either `iss`. The
8
- * orchestrator binds the list to its `IdTokenClaims` type at compile time and
4
+ * The orchestrator's OIDC discovery document renders `claims_supported` from
5
+ * this list, so a relying party configuring a trust policy reads the names the
6
+ * tokens carry. The orchestrator binds the list to its `IdTokenClaims` type at compile time and
9
7
  * a drift test checks it against the claims its builder actually emits.
10
8
  */
11
9
  export declare const ID_TOKEN_CLAIM_NAMES: readonly ['iss', 'sub', 'aud', 'iat', 'nbf', 'exp', 'jti', 'kici_run_id', 'kici_job_id', 'repository', 'workflow_repository', 'ref', 'base_ref', 'head_ref', 'head_repository', 'is_fork', 'event_name', 'trust_tier', 'actor', 'sha', 'workflow_ref', 'orchestrator_id', 'org_id', 'source_origin', 'provider', 'statement_hash', 'attestation_origin'];
@@ -3,11 +3,9 @@ import "../rolldown-runtime-ClRpJifh.js";
3
3
  /**
4
4
  * Every claim a KiCI provenance ID token carries, in a stable order.
5
5
  *
6
- * Both OIDC discovery documents render `claims_supported` from this list — the
7
- * orchestrator issuer that mints tokens today and the legacy Platform issuer
8
- * whose already-issued tokens carried the same shape — so a relying party
9
- * configuring a trust policy reads the same names under either `iss`. The
10
- * orchestrator binds the list to its `IdTokenClaims` type at compile time and
6
+ * The orchestrator's OIDC discovery document renders `claims_supported` from
7
+ * this list, so a relying party configuring a trust policy reads the names the
8
+ * tokens carry. The orchestrator binds the list to its `IdTokenClaims` type at compile time and
11
9
  * a drift test checks it against the claims its builder actually emits.
12
10
  */
13
11
  const ID_TOKEN_CLAIM_NAMES = [
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Shared execution-status presentation vocabulary: the canonical status union,
3
- * a total precedence order for roll-up aggregates, legacy-spelling resolution,
3
+ * a total precedence order for roll-up aggregates, canonical-status resolution,
4
4
  * and a per-status failure classification.
5
5
  *
6
6
  * Pure Zod (browser-safe): the engine barrel re-exports this module and the
@@ -23,21 +23,9 @@ export type CanonicalStatus = ExecutionRunStatus | ExecutionJobStatus;
23
23
  export declare const CANONICAL_STATUSES: readonly CanonicalStatus[];
24
24
  /** Canonical statuses ordered worst-first. Derived from `STATUS_RANK`. */
25
25
  export declare const STATUS_PRECEDENCE: readonly CanonicalStatus[];
26
- /**
27
- * Legacy status spellings that map onto a canonical status. An alias always
28
- * resolves like the status it aliases, so a consumer never needs a second
29
- * hand-written copy of the mapping.
30
- */
31
- export declare const LEGACY_STATUS_ALIASES: Readonly<Record<string, CanonicalStatus>>;
32
26
  /**
33
27
  * Resolve a status string onto its canonical status, or `undefined` when it is
34
- * neither canonical nor a known legacy alias. Callers that accept mixed case
35
- * lowercase their input first.
36
- *
37
- * `Object.hasOwn`, not a bare index: an object literal inherits
38
- * `Object.prototype`, so indexing it with `toString` / `constructor` /
39
- * `valueOf` would yield a function rather than `undefined` and the caller's
40
- * fallback would never fire.
28
+ * not canonical. Callers that accept mixed case lowercase their input first.
41
29
  */
42
30
  export declare function toCanonicalStatus(status: string): CanonicalStatus | undefined;
43
31
  /**
@@ -4,7 +4,7 @@ import { z } from "zod";
4
4
  //#region src/status/presentation.ts
5
5
  /**
6
6
  * Shared execution-status presentation vocabulary: the canonical status union,
7
- * a total precedence order for roll-up aggregates, legacy-spelling resolution,
7
+ * a total precedence order for roll-up aggregates, canonical-status resolution,
8
8
  * and a per-status failure classification.
9
9
  *
10
10
  * Pure Zod (browser-safe): the engine barrel re-exports this module and the
@@ -61,30 +61,10 @@ const STATUS_RANK = Object.freeze({
61
61
  /** Canonical statuses ordered worst-first. Derived from `STATUS_RANK`. */
62
62
  const STATUS_PRECEDENCE = Object.freeze([...CANONICAL_STATUSES].sort((a, b) => STATUS_RANK[a] - STATUS_RANK[b]));
63
63
  /**
64
- * Legacy status spellings that map onto a canonical status. An alias always
65
- * resolves like the status it aliases, so a consumer never needs a second
66
- * hand-written copy of the mapping.
67
- */
68
- const LEGACY_STATUS_ALIASES = Object.freeze({
69
- passed: ExecutionRunStatus.enum.success,
70
- completed: ExecutionRunStatus.enum.success,
71
- in_progress: ExecutionRunStatus.enum.running,
72
- error: ExecutionRunStatus.enum.failed,
73
- canceled: ExecutionRunStatus.enum.cancelled,
74
- waiting: ExecutionRunStatus.enum.pending
75
- });
76
- /**
77
64
  * Resolve a status string onto its canonical status, or `undefined` when it is
78
- * neither canonical nor a known legacy alias. Callers that accept mixed case
79
- * lowercase their input first.
80
- *
81
- * `Object.hasOwn`, not a bare index: an object literal inherits
82
- * `Object.prototype`, so indexing it with `toString` / `constructor` /
83
- * `valueOf` would yield a function rather than `undefined` and the caller's
84
- * fallback would never fire.
65
+ * not canonical. Callers that accept mixed case lowercase their input first.
85
66
  */
86
67
  function toCanonicalStatus(status) {
87
- if (Object.hasOwn(LEGACY_STATUS_ALIASES, status)) return LEGACY_STATUS_ALIASES[status];
88
68
  return CANONICAL_SET.has(status) ? status : void 0;
89
69
  }
90
70
  /**
@@ -158,6 +138,6 @@ function isFailureStatus(status) {
158
138
  return canonical !== void 0 && STATUS_FAILURE_CLASS[canonical] === StatusFailureClass.enum.failure;
159
139
  }
160
140
  //#endregion
161
- export { CANONICAL_STATUSES, LEGACY_STATUS_ALIASES, STATUS_FAILURE_CLASS, STATUS_PRECEDENCE, StatusFailureClass, isFailureStatus, toCanonicalStatus, worstStatus };
141
+ export { CANONICAL_STATUSES, STATUS_FAILURE_CLASS, STATUS_PRECEDENCE, StatusFailureClass, isFailureStatus, toCanonicalStatus, worstStatus };
162
142
 
163
143
  //# sourceMappingURL=presentation.js.map