@kici-dev/engine 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/context/hold-reason.d.ts +6 -11
- package/dist/context/hold-reason.js +1 -8
- package/dist/context/index.d.ts +3 -3
- package/dist/context/index.js +3 -3
- package/dist/context/types.d.ts +12 -10
- package/dist/context/types.js +12 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -5
- package/dist/metrics/catalog-policy.js +2 -2
- package/dist/protocol/dashboard-write-operations.d.ts +8 -18
- package/dist/protocol/dashboard-write-operations.js +5 -26
- package/dist/protocol/messages/agent-run-result.d.ts +0 -1
- package/dist/protocol/messages/auth.d.ts +3 -3
- package/dist/protocol/messages/capabilities.d.ts +3 -5
- package/dist/protocol/messages/capabilities.js +4 -10
- package/dist/protocol/messages/dashboard-global-workflows.d.ts +10 -24
- package/dist/protocol/messages/dashboard-global-workflows.js +9 -15
- package/dist/protocol/messages/dashboard.d.ts +2 -23
- package/dist/protocol/messages/dashboard.js +2 -21
- package/dist/protocol/messages/oidc-token-relay.d.ts +2 -13
- package/dist/protocol/messages/oidc-token-relay.js +3 -10
- package/dist/protocol/messages/orchestrator-agent.d.ts +10 -9
- package/dist/protocol/messages/orchestrator-agent.js +10 -26
- package/dist/protocol/messages/peer.d.ts +26 -31
- package/dist/protocol/messages/peer.js +18 -38
- package/dist/protocol/messages/platform-orchestrator.d.ts +17 -79
- package/dist/protocol/messages/platform-orchestrator.js +6 -24
- package/dist/protocol/version.d.ts +10 -18
- package/dist/protocol/version.js +11 -19
- package/dist/provenance/id-token-claim-names.d.ts +13 -0
- package/dist/provenance/id-token-claim-names.js +44 -0
- package/dist/provenance/id-token-event-claims.d.ts +1 -8
- package/dist/provenance/id-token-event-claims.js +2 -7
- package/dist/provider/index.d.ts +1 -2
- package/dist/provider/index.test-d.d.ts +2 -0
- package/dist/provider/index.test-d.js +31 -0
- package/dist/provider/webhook-normalizer.d.ts +0 -42
- package/dist/trigger/types.d.ts +8 -38
- package/dist/trigger/types.js +2 -12
- package/dist/trigger/types.test-d.d.ts +2 -0
- package/dist/trigger/types.test-d.js +63 -0
- package/package.json +7 -11
- package/sbom.spdx.json +20 -20
- package/dist/protocol/messages/oidc-mint.d.ts +0 -58
- package/dist/protocol/messages/oidc-mint.js +0 -62
- package/dist/provider/contributor-resolver.d.ts +0 -30
- package/dist/provider/contributor-resolver.js +0 -2
|
@@ -15,16 +15,12 @@ const peerAgentSummarySchema = z.object({
|
|
|
15
15
|
arch: z.string(),
|
|
16
16
|
/**
|
|
17
17
|
* Kubernetes-taint-style mandatory labels inherited from the spawning
|
|
18
|
-
* scaler
|
|
19
|
-
*
|
|
20
|
-
* matcher does: a connected-agent entry only matches when
|
|
21
|
-
* mandatory label appears in the required label set.
|
|
22
|
-
*
|
|
23
|
-
* Optional + default `[]` for legacy peers — older orchestrators that
|
|
24
|
-
* predate the gate omit the field, and the coordinator falls back to
|
|
25
|
-
* "no gate" routing for those agents (matching pre-gate behavior).
|
|
18
|
+
* scaler. Always sent: a static agent and a warm-pool replenishment spawn
|
|
19
|
+
* carry `[]`, which is "no gate". Cross-peer routing applies the same gate
|
|
20
|
+
* the local label matcher does: a connected-agent entry only matches when
|
|
21
|
+
* every mandatory label appears in the required label set.
|
|
26
22
|
*/
|
|
27
|
-
mandatoryLabels: z.array(z.string())
|
|
23
|
+
mandatoryLabels: z.array(z.string()),
|
|
28
24
|
/**
|
|
29
25
|
* Name of the scaler backend that spawned this agent, or null/omitted for
|
|
30
26
|
* static (stateful) agents not bound to any scaler. Carried so the dashboard
|
|
@@ -38,7 +34,12 @@ const peerCapabilitiesSchema = z.object({
|
|
|
38
34
|
s3LogAccess: z.boolean(),
|
|
39
35
|
logRoutingOverride: z.enum(["direct", "coordinator"]).optional()
|
|
40
36
|
});
|
|
41
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Scaler capacity summary included in peer heartbeat and auth response for
|
|
39
|
+
* routing decisions. `.strict()`: the entry once carried a scaler-wide taint
|
|
40
|
+
* union a peer on this protocol floor never sends, so a stray field is a
|
|
41
|
+
* version-skew signal rather than something to ignore.
|
|
42
|
+
*/
|
|
42
43
|
const scalerCapacitySummarySchema = z.object({
|
|
43
44
|
/** Scaler backend name (e.g. "stg-worker-bare-metal") */
|
|
44
45
|
name: z.string().optional(),
|
|
@@ -57,31 +58,15 @@ const scalerCapacitySummarySchema = z.object({
|
|
|
57
58
|
*/
|
|
58
59
|
spawnsOnLocalHost: z.boolean().optional(),
|
|
59
60
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* rule as the local label matcher
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* @deprecated Use {@link labelSetMandatoryLabels}, which carries one gate
|
|
67
|
-
* per label set. This field is the union across every label set, so a
|
|
68
|
-
* scaler mixing `[linux, gpu]` with `[macos, xcode]` advertises a gate that
|
|
69
|
-
* makes its linux set unroutable. It stays populated for peers that predate
|
|
70
|
-
* the per-label-set field and is removed in v1.0.0.
|
|
71
|
-
*/
|
|
72
|
-
mandatoryLabels: z.array(z.string()).optional().default([]),
|
|
73
|
-
/**
|
|
74
|
-
* Per-label-set taint gate, index-aligned with `labelSets`: entry `i` is the
|
|
75
|
-
* gate a job must satisfy to route to `labelSets[i]`.
|
|
76
|
-
*
|
|
77
|
-
* Deliberately `.optional()` with no default. `undefined` is the only value
|
|
78
|
-
* that can mean "this peer predates the field — fall back to the scaler-wide
|
|
79
|
-
* `mandatoryLabels`"; an empty array would read as "every label set is
|
|
80
|
-
* ungated". A consumer also falls back when the length does not equal
|
|
61
|
+
* Per-label-set taint gate (Kubernetes-taint-style opt-in), index-aligned
|
|
62
|
+
* with `labelSets`: entry `i` is the set of labels a job MUST declare in
|
|
63
|
+
* `runsOn` to route to `labelSets[i]`; an empty entry means that set has no
|
|
64
|
+
* gate. Cross-peer routing applies the same rule as the local label matcher.
|
|
65
|
+
* A consumer refuses to route through an entry whose length does not equal
|
|
81
66
|
* `labelSets.length`, so a malformed advertisement is never indexed into.
|
|
82
67
|
*/
|
|
83
|
-
labelSetMandatoryLabels: z.array(z.array(z.string()))
|
|
84
|
-
});
|
|
68
|
+
labelSetMandatoryLabels: z.array(z.array(z.string()))
|
|
69
|
+
}).strict();
|
|
85
70
|
/** Peer hello: initiator sends ephemeral X25519 public key and nonce. */
|
|
86
71
|
const peerHelloSchema = z.object({
|
|
87
72
|
type: z.literal("peer.hello"),
|
|
@@ -210,11 +195,6 @@ const jobRerouteSchema = z.object({
|
|
|
210
195
|
providerContext: z.record(z.string(), z.unknown()).optional(),
|
|
211
196
|
/** Pre-signed source tarball download URL (cache hit). */
|
|
212
197
|
sourceTarUrl: z.string().optional(),
|
|
213
|
-
/**
|
|
214
|
-
* @deprecated Use `sourceTarDigest` — this carries the workflow
|
|
215
|
-
* `contentHash`, not a hash of the tarball bytes.
|
|
216
|
-
*/
|
|
217
|
-
sourceTarHash: z.string().optional(),
|
|
218
198
|
/** SHA-256 of the source tarball's own bytes, for integrity verification. */
|
|
219
199
|
sourceTarDigest: z.string().optional(),
|
|
220
200
|
/** Pre-signed dependency tarball download URL (cache hit). */
|
|
@@ -68,13 +68,11 @@ export declare function approvalExpiryHoursOf(seconds: number): number;
|
|
|
68
68
|
* bounds how long that approval stays open.
|
|
69
69
|
* - `allow` — the operator permits fork pull requests to run with reduced
|
|
70
70
|
* privilege.
|
|
71
|
-
* - `reject` — deprecated in favour of `ignore`; removed at v1.0.0.
|
|
72
71
|
*/
|
|
73
72
|
export declare const ForkPolicy: z.ZodEnum<{
|
|
74
73
|
allow: "allow";
|
|
75
74
|
hold: "hold";
|
|
76
75
|
ignore: "ignore";
|
|
77
|
-
reject: "reject";
|
|
78
76
|
}>;
|
|
79
77
|
export type ForkPolicy = z.infer<typeof ForkPolicy>;
|
|
80
78
|
/**
|
|
@@ -93,25 +91,20 @@ export declare const CiTrustLevel: z.ZodEnum<{
|
|
|
93
91
|
write: "write";
|
|
94
92
|
}>;
|
|
95
93
|
export type CiTrustLevel = z.infer<typeof CiTrustLevel>;
|
|
94
|
+
/**
|
|
95
|
+
* `.strict()`: the policy object once carried per-arm fields the gate never
|
|
96
|
+
* read, so a sender still emitting one is on a build this protocol floor
|
|
97
|
+
* refuses — a stray field is a version-skew signal, not something to ignore.
|
|
98
|
+
*/
|
|
96
99
|
export declare const trustPolicySchema: z.ZodObject<{
|
|
97
100
|
forkPolicy: z.ZodEnum<{
|
|
98
101
|
allow: "allow";
|
|
99
102
|
hold: "hold";
|
|
100
103
|
ignore: "ignore";
|
|
101
|
-
reject: "reject";
|
|
102
|
-
}>;
|
|
103
|
-
unknownContributorPolicy: z.ZodEnum<{
|
|
104
|
-
hold: "hold";
|
|
105
|
-
reject: "reject";
|
|
106
|
-
}>;
|
|
107
|
-
workflowChangePolicy: z.ZodEnum<{
|
|
108
|
-
allow: "allow";
|
|
109
|
-
hold: "hold";
|
|
110
|
-
reject: "reject";
|
|
111
104
|
}>;
|
|
112
105
|
approvalExpiryHours: z.ZodNumber;
|
|
113
106
|
approvalExpirySeconds: z.ZodOptional<z.ZodNumber>;
|
|
114
|
-
}, z.core.$
|
|
107
|
+
}, z.core.$strict>;
|
|
115
108
|
export type TrustPolicy = z.infer<typeof trustPolicySchema>;
|
|
116
109
|
/** Trust policy update pushed from Platform to orchestrator when policy or identity links change. */
|
|
117
110
|
export declare const trustPolicyUpdateSchema: z.ZodObject<{
|
|
@@ -122,20 +115,10 @@ export declare const trustPolicyUpdateSchema: z.ZodObject<{
|
|
|
122
115
|
allow: "allow";
|
|
123
116
|
hold: "hold";
|
|
124
117
|
ignore: "ignore";
|
|
125
|
-
reject: "reject";
|
|
126
|
-
}>;
|
|
127
|
-
unknownContributorPolicy: z.ZodEnum<{
|
|
128
|
-
hold: "hold";
|
|
129
|
-
reject: "reject";
|
|
130
|
-
}>;
|
|
131
|
-
workflowChangePolicy: z.ZodEnum<{
|
|
132
|
-
allow: "allow";
|
|
133
|
-
hold: "hold";
|
|
134
|
-
reject: "reject";
|
|
135
118
|
}>;
|
|
136
119
|
approvalExpiryHours: z.ZodNumber;
|
|
137
120
|
approvalExpirySeconds: z.ZodOptional<z.ZodNumber>;
|
|
138
|
-
}, z.core.$
|
|
121
|
+
}, z.core.$strict>;
|
|
139
122
|
identityLinks: z.ZodArray<z.ZodObject<{
|
|
140
123
|
userId: z.ZodString;
|
|
141
124
|
provider: z.ZodString;
|
|
@@ -317,7 +300,6 @@ export declare const platformCapabilitiesMessageSchema: z.ZodObject<{
|
|
|
317
300
|
type: z.ZodLiteral<"platform.capabilities">;
|
|
318
301
|
capabilities: z.ZodObject<{
|
|
319
302
|
orchMetrics: z.ZodOptional<z.ZodBoolean>;
|
|
320
|
-
oidcMint: z.ZodOptional<z.ZodBoolean>;
|
|
321
303
|
}, z.core.$loose>;
|
|
322
304
|
}, z.core.$strip>;
|
|
323
305
|
export type PlatformCapabilitiesMessage = z.infer<typeof platformCapabilitiesMessageSchema>;
|
|
@@ -520,7 +502,7 @@ export declare const orchCapabilitiesUpdateSchema: z.ZodObject<{
|
|
|
520
502
|
coordinator: "coordinator";
|
|
521
503
|
worker: "worker";
|
|
522
504
|
}>>;
|
|
523
|
-
dashboardWrites: z.ZodOptional<z.
|
|
505
|
+
dashboardWrites: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
524
506
|
"attestations.retry": "attestations.retry";
|
|
525
507
|
"backends.sync": "backends.sync";
|
|
526
508
|
"backends.sync_one": "backends.sync_one";
|
|
@@ -548,11 +530,11 @@ export declare const orchCapabilitiesUpdateSchema: z.ZodObject<{
|
|
|
548
530
|
"secrets.set": "secrets.set";
|
|
549
531
|
"variables.delete": "variables.delete";
|
|
550
532
|
"variables.set": "variables.set";
|
|
551
|
-
}> & z.core.$partial, z.
|
|
533
|
+
}> & z.core.$partial, z.ZodEnum<{
|
|
552
534
|
disabled: "disabled";
|
|
553
535
|
encrypted: "encrypted";
|
|
554
536
|
permissive: "permissive";
|
|
555
|
-
}
|
|
537
|
+
}>>>;
|
|
556
538
|
supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
557
539
|
dashboardEncryptionKey: z.ZodOptional<z.ZodObject<{
|
|
558
540
|
kty: z.ZodLiteral<"OKP">;
|
|
@@ -604,20 +586,10 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
|
|
|
604
586
|
allow: "allow";
|
|
605
587
|
hold: "hold";
|
|
606
588
|
ignore: "ignore";
|
|
607
|
-
reject: "reject";
|
|
608
|
-
}>;
|
|
609
|
-
unknownContributorPolicy: z.ZodEnum<{
|
|
610
|
-
hold: "hold";
|
|
611
|
-
reject: "reject";
|
|
612
|
-
}>;
|
|
613
|
-
workflowChangePolicy: z.ZodEnum<{
|
|
614
|
-
allow: "allow";
|
|
615
|
-
hold: "hold";
|
|
616
|
-
reject: "reject";
|
|
617
589
|
}>;
|
|
618
590
|
approvalExpiryHours: z.ZodNumber;
|
|
619
591
|
approvalExpirySeconds: z.ZodOptional<z.ZodNumber>;
|
|
620
|
-
}, z.core.$
|
|
592
|
+
}, z.core.$strict>;
|
|
621
593
|
identityLinks: z.ZodArray<z.ZodObject<{
|
|
622
594
|
userId: z.ZodString;
|
|
623
595
|
provider: z.ZodString;
|
|
@@ -696,27 +668,10 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
|
|
|
696
668
|
workflowRepoIdentifier: z.ZodOptional<z.ZodString>;
|
|
697
669
|
jobNames: z.ZodArray<z.ZodString>;
|
|
698
670
|
}, z.core.$strip>>;
|
|
699
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
700
|
-
type: z.ZodLiteral<"oidc.mint.response">;
|
|
701
|
-
requestId: z.ZodString;
|
|
702
|
-
result: z.ZodOptional<z.ZodObject<{
|
|
703
|
-
token: z.ZodString;
|
|
704
|
-
expiresIn: z.ZodNumber;
|
|
705
|
-
jti: z.ZodString;
|
|
706
|
-
}, z.core.$strip>>;
|
|
707
|
-
error: z.ZodOptional<z.ZodObject<{
|
|
708
|
-
code: z.ZodEnum<{
|
|
709
|
-
failed: "failed";
|
|
710
|
-
rejected: "rejected";
|
|
711
|
-
unavailable: "unavailable";
|
|
712
|
-
}>;
|
|
713
|
-
message: z.ZodString;
|
|
714
|
-
}, z.core.$strip>>;
|
|
715
671
|
}, z.core.$strip>, z.ZodObject<{
|
|
716
672
|
type: z.ZodLiteral<"platform.capabilities">;
|
|
717
673
|
capabilities: z.ZodObject<{
|
|
718
674
|
orchMetrics: z.ZodOptional<z.ZodBoolean>;
|
|
719
|
-
oidcMint: z.ZodOptional<z.ZodBoolean>;
|
|
720
675
|
}, z.core.$loose>;
|
|
721
676
|
}, z.core.$strip>, z.ZodObject<{
|
|
722
677
|
type: z.ZodLiteral<"plan.headroom">;
|
|
@@ -2938,10 +2893,6 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
|
|
|
2938
2893
|
routingKey: z.ZodOptional<z.ZodString>;
|
|
2939
2894
|
pattern: z.ZodString;
|
|
2940
2895
|
}, z.core.$strip>>>>;
|
|
2941
|
-
elevatedRepos: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
2942
|
-
routingKey: z.ZodOptional<z.ZodString>;
|
|
2943
|
-
pattern: z.ZodString;
|
|
2944
|
-
}, z.core.$strip>>>>;
|
|
2945
2896
|
}, z.core.$strict>, z.ZodObject<{
|
|
2946
2897
|
type: z.ZodLiteral<"dashboard.access-log.list">;
|
|
2947
2898
|
requestId: z.ZodString;
|
|
@@ -3568,7 +3519,7 @@ export declare const orchestratorToPlatformMessageSchema: z.ZodDiscriminatedUnio
|
|
|
3568
3519
|
coordinator: "coordinator";
|
|
3569
3520
|
worker: "worker";
|
|
3570
3521
|
}>>;
|
|
3571
|
-
dashboardWrites: z.ZodOptional<z.
|
|
3522
|
+
dashboardWrites: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
3572
3523
|
"attestations.retry": "attestations.retry";
|
|
3573
3524
|
"backends.sync": "backends.sync";
|
|
3574
3525
|
"backends.sync_one": "backends.sync_one";
|
|
@@ -3596,11 +3547,11 @@ export declare const orchestratorToPlatformMessageSchema: z.ZodDiscriminatedUnio
|
|
|
3596
3547
|
"secrets.set": "secrets.set";
|
|
3597
3548
|
"variables.delete": "variables.delete";
|
|
3598
3549
|
"variables.set": "variables.set";
|
|
3599
|
-
}> & z.core.$partial, z.
|
|
3550
|
+
}> & z.core.$partial, z.ZodEnum<{
|
|
3600
3551
|
disabled: "disabled";
|
|
3601
3552
|
encrypted: "encrypted";
|
|
3602
3553
|
permissive: "permissive";
|
|
3603
|
-
}
|
|
3554
|
+
}>>>;
|
|
3604
3555
|
supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3605
3556
|
dashboardEncryptionKey: z.ZodOptional<z.ZodObject<{
|
|
3606
3557
|
kty: z.ZodLiteral<"OKP">;
|
|
@@ -3686,7 +3637,7 @@ export declare const orchestratorToPlatformMessageSchema: z.ZodDiscriminatedUnio
|
|
|
3686
3637
|
coordinator: "coordinator";
|
|
3687
3638
|
worker: "worker";
|
|
3688
3639
|
}>>;
|
|
3689
|
-
dashboardWrites: z.ZodOptional<z.
|
|
3640
|
+
dashboardWrites: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
3690
3641
|
"attestations.retry": "attestations.retry";
|
|
3691
3642
|
"backends.sync": "backends.sync";
|
|
3692
3643
|
"backends.sync_one": "backends.sync_one";
|
|
@@ -3714,11 +3665,11 @@ export declare const orchestratorToPlatformMessageSchema: z.ZodDiscriminatedUnio
|
|
|
3714
3665
|
"secrets.set": "secrets.set";
|
|
3715
3666
|
"variables.delete": "variables.delete";
|
|
3716
3667
|
"variables.set": "variables.set";
|
|
3717
|
-
}> & z.core.$partial, z.
|
|
3668
|
+
}> & z.core.$partial, z.ZodEnum<{
|
|
3718
3669
|
disabled: "disabled";
|
|
3719
3670
|
encrypted: "encrypted";
|
|
3720
3671
|
permissive: "permissive";
|
|
3721
|
-
}
|
|
3672
|
+
}>>>;
|
|
3722
3673
|
supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3723
3674
|
dashboardEncryptionKey: z.ZodOptional<z.ZodObject<{
|
|
3724
3675
|
kty: z.ZodLiteral<"OKP">;
|
|
@@ -3803,19 +3754,6 @@ export declare const orchestratorToPlatformMessageSchema: z.ZodDiscriminatedUnio
|
|
|
3803
3754
|
sum: z.ZodOptional<z.ZodNumber>;
|
|
3804
3755
|
}, z.core.$strip>>;
|
|
3805
3756
|
timestamp: z.ZodNumber;
|
|
3806
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
3807
|
-
type: z.ZodLiteral<"oidc.mint.request">;
|
|
3808
|
-
requestId: z.ZodString;
|
|
3809
|
-
orchestratorId: z.ZodString;
|
|
3810
|
-
runId: z.ZodString;
|
|
3811
|
-
jobId: z.ZodString;
|
|
3812
|
-
audience: z.ZodString;
|
|
3813
|
-
deferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3814
|
-
statementHash: z.ZodOptional<z.ZodString>;
|
|
3815
|
-
origin: z.ZodOptional<z.ZodEnum<{
|
|
3816
|
-
deferred: "deferred";
|
|
3817
|
-
"offline-backfill": "offline-backfill";
|
|
3818
|
-
}>>;
|
|
3819
3757
|
}, z.core.$strip>, z.ZodObject<{
|
|
3820
3758
|
type: z.ZodLiteral<"cluster.membership">;
|
|
3821
3759
|
workers: z.ZodArray<z.ZodObject<{
|
|
@@ -7,7 +7,6 @@ import { dashboardPlatformToOrchSchema } from "./dashboard.js";
|
|
|
7
7
|
import { OrchRole, orchCapabilitiesSchema, platformCapabilitiesSchema } from "./capabilities.js";
|
|
8
8
|
import { authFailureSchema, authRequestSchema, authSuccessSchema } from "./auth.js";
|
|
9
9
|
import { LogStream } from "./log-stream.js";
|
|
10
|
-
import { oidcMintRequestSchema, oidcMintResponseSchema } from "./oidc-mint.js";
|
|
11
10
|
import { z } from "zod";
|
|
12
11
|
//#region src/protocol/messages/platform-orchestrator.ts
|
|
13
12
|
/**
|
|
@@ -82,12 +81,10 @@ function approvalExpiryHoursOf(seconds) {
|
|
|
82
81
|
* bounds how long that approval stays open.
|
|
83
82
|
* - `allow` — the operator permits fork pull requests to run with reduced
|
|
84
83
|
* privilege.
|
|
85
|
-
* - `reject` — deprecated in favour of `ignore`; removed at v1.0.0.
|
|
86
84
|
*/
|
|
87
85
|
const ForkPolicy = z.enum([
|
|
88
86
|
"ignore",
|
|
89
87
|
"hold",
|
|
90
|
-
"reject",
|
|
91
88
|
"allow"
|
|
92
89
|
]);
|
|
93
90
|
/**
|
|
@@ -105,27 +102,14 @@ const CiTrustLevel = z.enum([
|
|
|
105
102
|
"write",
|
|
106
103
|
"admin"
|
|
107
104
|
]);
|
|
105
|
+
/**
|
|
106
|
+
* `.strict()`: the policy object once carried per-arm fields the gate never
|
|
107
|
+
* read, so a sender still emitting one is on a build this protocol floor
|
|
108
|
+
* refuses — a stray field is a version-skew signal, not something to ignore.
|
|
109
|
+
*/
|
|
108
110
|
const trustPolicySchema = z.object({
|
|
109
111
|
forkPolicy: ForkPolicy,
|
|
110
112
|
/**
|
|
111
|
-
* @deprecated Accepted for wire compatibility and still stored and echoed
|
|
112
|
-
* back, so an orchestrator or CLI on an older build keeps seeing the value it
|
|
113
|
-
* expects. The orchestrator's trust-policy gate does not read it, so it
|
|
114
|
-
* changes no dispatch outcome. Removed at v1.0.0.
|
|
115
|
-
*/
|
|
116
|
-
unknownContributorPolicy: z.enum(["hold", "reject"]),
|
|
117
|
-
/**
|
|
118
|
-
* @deprecated Accepted for wire compatibility and still stored and echoed
|
|
119
|
-
* back, so an orchestrator or CLI on an older build keeps seeing the value it
|
|
120
|
-
* expects. The orchestrator's trust-policy gate does not read it, so it
|
|
121
|
-
* changes no dispatch outcome. Removed at v1.0.0.
|
|
122
|
-
*/
|
|
123
|
-
workflowChangePolicy: z.enum([
|
|
124
|
-
"hold",
|
|
125
|
-
"reject",
|
|
126
|
-
"allow"
|
|
127
|
-
]),
|
|
128
|
-
/**
|
|
129
113
|
* Hours a security hold stays open — the coarse spelling of
|
|
130
114
|
* `approvalExpirySeconds`, kept required so an orchestrator or CLI on an
|
|
131
115
|
* older build still receives a window it can read. Not deprecated: it is read,
|
|
@@ -151,7 +135,7 @@ const trustPolicySchema = z.object({
|
|
|
151
135
|
* mints an already-expired hold.
|
|
152
136
|
*/
|
|
153
137
|
approvalExpirySeconds: z.number().int().min(1).optional()
|
|
154
|
-
});
|
|
138
|
+
}).strict();
|
|
155
139
|
/** Trust policy update pushed from Platform to orchestrator when policy or identity links change. */
|
|
156
140
|
const trustPolicyUpdateSchema = z.object({
|
|
157
141
|
type: z.literal("trust_policy.update"),
|
|
@@ -576,7 +560,6 @@ const platformToOrchestratorMessageSchema = z.discriminatedUnion("type", [
|
|
|
576
560
|
peerDiscoverSchema,
|
|
577
561
|
peerUpdateSchema,
|
|
578
562
|
staleCheckrunCleanupSchema,
|
|
579
|
-
oidcMintResponseSchema,
|
|
580
563
|
platformCapabilitiesMessageSchema,
|
|
581
564
|
planHeadroomSchema,
|
|
582
565
|
nackSchema,
|
|
@@ -607,7 +590,6 @@ const orchestratorToPlatformMessageSchema = z.discriminatedUnion("type", [
|
|
|
607
590
|
runEventMessageSchema,
|
|
608
591
|
jobContextMessageSchema,
|
|
609
592
|
orchMetricsSchema,
|
|
610
|
-
oidcMintRequestSchema,
|
|
611
593
|
clusterMembershipSchema,
|
|
612
594
|
nackSchema
|
|
613
595
|
]);
|
|
@@ -2,28 +2,20 @@
|
|
|
2
2
|
* Protocol version. Sent during WebSocket handshake.
|
|
3
3
|
*
|
|
4
4
|
* Increment when a message schema gains something an older peer cannot parse,
|
|
5
|
-
* and pair the bump with a named floor
|
|
6
|
-
*
|
|
5
|
+
* and pair the bump with a named floor so a sender can gate on the version a
|
|
6
|
+
* peer negotiated instead of guessing.
|
|
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.
|
|
7
13
|
*/
|
|
8
|
-
export declare const PROTOCOL_VERSION =
|
|
14
|
+
export declare const PROTOCOL_VERSION = 3;
|
|
9
15
|
/**
|
|
10
16
|
* Minimum protocol version accepted.
|
|
11
17
|
* Connections below this are rejected.
|
|
12
18
|
* Capabilities handle per-feature negotiation above this baseline.
|
|
13
19
|
*/
|
|
14
|
-
export declare const MIN_PROTOCOL_VERSION =
|
|
15
|
-
/**
|
|
16
|
-
* First protocol version whose `trust_policy.update` reader accepts
|
|
17
|
-
* `forkPolicy: 'ignore'`.
|
|
18
|
-
*
|
|
19
|
-
* A peer below this version may validate the pushed policy against a
|
|
20
|
-
* `forkPolicy` enum with no `ignore` member. `trust_policy.update` is a member
|
|
21
|
-
* of a discriminated union, so that value fails the WHOLE frame rather than one
|
|
22
|
-
* field: the org's identity links, member CI trust levels and team memberships
|
|
23
|
-
* are dropped with it. The Platform therefore rewrites `ignore` to the
|
|
24
|
-
* deprecated `reject` before sending to such a peer — the value that peer's
|
|
25
|
-
* enum does carry, that denies dispatch the same way, and that this build's own
|
|
26
|
-
* fork switch already resolves through the same arm as `ignore`.
|
|
27
|
-
*/
|
|
28
|
-
export declare const FORK_POLICY_IGNORE_MIN_PROTOCOL_VERSION = 2;
|
|
20
|
+
export declare const MIN_PROTOCOL_VERSION = 3;
|
|
29
21
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/protocol/version.js
CHANGED
|
@@ -4,31 +4,23 @@ import "../rolldown-runtime-ClRpJifh.js";
|
|
|
4
4
|
* Protocol version. Sent during WebSocket handshake.
|
|
5
5
|
*
|
|
6
6
|
* Increment when a message schema gains something an older peer cannot parse,
|
|
7
|
-
* and pair the bump with a named floor
|
|
8
|
-
*
|
|
7
|
+
* and pair the bump with a named floor so a sender can gate on the version a
|
|
8
|
+
* peer negotiated instead of guessing.
|
|
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.
|
|
9
15
|
*/
|
|
10
|
-
const PROTOCOL_VERSION =
|
|
16
|
+
const PROTOCOL_VERSION = 3;
|
|
11
17
|
/**
|
|
12
18
|
* Minimum protocol version accepted.
|
|
13
19
|
* Connections below this are rejected.
|
|
14
20
|
* Capabilities handle per-feature negotiation above this baseline.
|
|
15
21
|
*/
|
|
16
|
-
const MIN_PROTOCOL_VERSION =
|
|
17
|
-
/**
|
|
18
|
-
* First protocol version whose `trust_policy.update` reader accepts
|
|
19
|
-
* `forkPolicy: 'ignore'`.
|
|
20
|
-
*
|
|
21
|
-
* A peer below this version may validate the pushed policy against a
|
|
22
|
-
* `forkPolicy` enum with no `ignore` member. `trust_policy.update` is a member
|
|
23
|
-
* of a discriminated union, so that value fails the WHOLE frame rather than one
|
|
24
|
-
* field: the org's identity links, member CI trust levels and team memberships
|
|
25
|
-
* are dropped with it. The Platform therefore rewrites `ignore` to the
|
|
26
|
-
* deprecated `reject` before sending to such a peer — the value that peer's
|
|
27
|
-
* enum does carry, that denies dispatch the same way, and that this build's own
|
|
28
|
-
* fork switch already resolves through the same arm as `ignore`.
|
|
29
|
-
*/
|
|
30
|
-
const FORK_POLICY_IGNORE_MIN_PROTOCOL_VERSION = 2;
|
|
22
|
+
const MIN_PROTOCOL_VERSION = 3;
|
|
31
23
|
//#endregion
|
|
32
|
-
export {
|
|
24
|
+
export { MIN_PROTOCOL_VERSION, PROTOCOL_VERSION };
|
|
33
25
|
|
|
34
26
|
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every claim a KiCI provenance ID token carries, in a stable order.
|
|
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
|
|
9
|
+
* a drift test checks it against the claims its builder actually emits.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ID_TOKEN_CLAIM_NAMES: readonly ['iss', 'sub', 'aud', 'iat', 'nbf', 'exp', 'jti', 'kici_run_id', 'kici_job_id', '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'];
|
|
12
|
+
export type IdTokenClaimName = (typeof ID_TOKEN_CLAIM_NAMES)[number];
|
|
13
|
+
//# sourceMappingURL=id-token-claim-names.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
//#region src/provenance/id-token-claim-names.ts
|
|
3
|
+
/**
|
|
4
|
+
* Every claim a KiCI provenance ID token carries, in a stable order.
|
|
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
|
|
11
|
+
* a drift test checks it against the claims its builder actually emits.
|
|
12
|
+
*/
|
|
13
|
+
const ID_TOKEN_CLAIM_NAMES = [
|
|
14
|
+
"iss",
|
|
15
|
+
"sub",
|
|
16
|
+
"aud",
|
|
17
|
+
"iat",
|
|
18
|
+
"nbf",
|
|
19
|
+
"exp",
|
|
20
|
+
"jti",
|
|
21
|
+
"kici_run_id",
|
|
22
|
+
"kici_job_id",
|
|
23
|
+
"repository",
|
|
24
|
+
"ref",
|
|
25
|
+
"base_ref",
|
|
26
|
+
"head_ref",
|
|
27
|
+
"head_repository",
|
|
28
|
+
"is_fork",
|
|
29
|
+
"event_name",
|
|
30
|
+
"trust_tier",
|
|
31
|
+
"actor",
|
|
32
|
+
"sha",
|
|
33
|
+
"workflow_ref",
|
|
34
|
+
"orchestrator_id",
|
|
35
|
+
"org_id",
|
|
36
|
+
"source_origin",
|
|
37
|
+
"provider",
|
|
38
|
+
"statement_hash",
|
|
39
|
+
"attestation_origin"
|
|
40
|
+
];
|
|
41
|
+
//#endregion
|
|
42
|
+
export { ID_TOKEN_CLAIM_NAMES };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=id-token-claim-names.js.map
|
|
@@ -104,15 +104,8 @@ export declare function buildEventClaims(run: EventClaimSource): EventClaims;
|
|
|
104
104
|
* `trigger_event` itself is left alone because two other readers depend on it:
|
|
105
105
|
* the dashboard's trigger-type filter and the git credential relay's
|
|
106
106
|
* `triggerTypeFilters`, both of which must keep seeing `'rerun'`.
|
|
107
|
-
*
|
|
108
|
-
* `legacyPullRequestSubject` restores the old, colliding form for one release —
|
|
109
|
-
* see `KICI_OIDC_LEGACY_PR_SUB`. It is deprecated on arrival.
|
|
110
|
-
*
|
|
111
|
-
* @deprecated `legacyPullRequestSubject` is removed at v1.0.0.
|
|
112
107
|
*/
|
|
113
|
-
export declare function buildIdTokenSubject(run: Pick<EventClaimSource, 'repo_identifier' | 'ref' | 'workflow_name' | 'trigger_event' | 'subject_trigger_event'
|
|
114
|
-
legacyPullRequestSubject?: boolean;
|
|
115
|
-
}): string;
|
|
108
|
+
export declare function buildIdTokenSubject(run: Pick<EventClaimSource, 'repo_identifier' | 'ref' | 'workflow_name' | 'trigger_event' | 'subject_trigger_event'>): string;
|
|
116
109
|
/**
|
|
117
110
|
* The orchestrator's own view of a build, sent with the job so the agent can
|
|
118
111
|
* freeze a provenance statement that matches what a live mint would say.
|
|
@@ -57,16 +57,11 @@ function buildEventClaims(run) {
|
|
|
57
57
|
* `trigger_event` itself is left alone because two other readers depend on it:
|
|
58
58
|
* the dashboard's trigger-type filter and the git credential relay's
|
|
59
59
|
* `triggerTypeFilters`, both of which must keep seeing `'rerun'`.
|
|
60
|
-
*
|
|
61
|
-
* `legacyPullRequestSubject` restores the old, colliding form for one release —
|
|
62
|
-
* see `KICI_OIDC_LEGACY_PR_SUB`. It is deprecated on arrival.
|
|
63
|
-
*
|
|
64
|
-
* @deprecated `legacyPullRequestSubject` is removed at v1.0.0.
|
|
65
60
|
*/
|
|
66
|
-
function buildIdTokenSubject(run
|
|
61
|
+
function buildIdTokenSubject(run) {
|
|
67
62
|
const repository = run.repo_identifier ?? "unknown";
|
|
68
63
|
const subjectEvent = run.subject_trigger_event ?? run.trigger_event;
|
|
69
|
-
if (
|
|
64
|
+
if (isPullRequestFamilyTriggerEvent(subjectEvent)) return `repo:${repository}:pull_request`;
|
|
70
65
|
return `repo:${repository}:ref:${run.ref ?? "unknown"}:workflow:${run.workflow_name ?? "unknown"}`;
|
|
71
66
|
}
|
|
72
67
|
/**
|
package/dist/provider/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* - RepoUrlBuilder: Provider-specific URL construction
|
|
14
14
|
*/
|
|
15
15
|
export type { ProviderType } from './types.js';
|
|
16
|
-
export type { WebhookNormalizer
|
|
16
|
+
export type { WebhookNormalizer } from './webhook-normalizer.js';
|
|
17
17
|
export type { LockFileFetcher } from './lock-file-fetcher.js';
|
|
18
18
|
export { LockFileParseError } from './lock-file-parse-error.js';
|
|
19
19
|
export type { ChangedFilesFetcher, ChangedFilesResult } from './changed-files-fetcher.js';
|
|
@@ -22,7 +22,6 @@ export type { CloneTokenProvider, ProviderGitAuth } from './clone-token-provider
|
|
|
22
22
|
export type { ForgeName, Sourced, GitCredentialRef, GitCredentialGrant, GitCredentialRequest, GitCredentialResult, } from './git-credential.js';
|
|
23
23
|
export { isMintedRef } from './git-credential.js';
|
|
24
24
|
export type { RepoUrlBuilder } from './repo-url-builder.js';
|
|
25
|
-
export type { ContributorResolver, ContributorInfo, ContributorPermission, } from './contributor-resolver.js';
|
|
26
25
|
export type { CheckStatusPoster, CheckStatus, WorkflowModificationInfo, } from './check-status-poster.js';
|
|
27
26
|
export * from './check-run-conclusion.js';
|
|
28
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { describe, expectTypeOf, it } from "vitest";
|
|
3
|
+
//#region src/provider/index.test-d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The contributor-resolution surface is gone from the provider abstraction.
|
|
6
|
+
* `ContributorResolver` and its companions were type-only, so no runtime probe
|
|
7
|
+
* can see them return; only the compiler can.
|
|
8
|
+
*/
|
|
9
|
+
describe("provider barrel", () => {
|
|
10
|
+
it("exports no ContributorResolver", () => {
|
|
11
|
+
expectTypeOf().toBeObject();
|
|
12
|
+
});
|
|
13
|
+
it("exports none of the contributor-resolution companions from the root", () => {
|
|
14
|
+
expectTypeOf().toBeObject();
|
|
15
|
+
expectTypeOf().toBeString();
|
|
16
|
+
expectTypeOf().toBeObject();
|
|
17
|
+
});
|
|
18
|
+
it("gives WebhookNormalizer no access-cache invalidation hook", () => {
|
|
19
|
+
expectTypeOf().not.toHaveProperty("getAccessCacheInvalidations");
|
|
20
|
+
});
|
|
21
|
+
it("keeps the live normalizer contract", () => {
|
|
22
|
+
expectTypeOf().toHaveProperty("provider");
|
|
23
|
+
expectTypeOf().toHaveProperty("normalizeEvent");
|
|
24
|
+
expectTypeOf().toHaveProperty("verifySignature");
|
|
25
|
+
expectTypeOf().toEqualTypeOf();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export {};
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.test-d.js.map
|