@dynamicalsystems/idl 0.10.0 → 0.12.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.
@@ -0,0 +1,623 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/DynamicalSystemsGroup/dsg-idl/schema/dsg-organization-source-v2.json",
4
+ "title": "dsg.organization.source/2",
5
+ "$defs": {
6
+ "organization": {
7
+ "additionalProperties": false,
8
+ "type": "object",
9
+ "required": ["schemaVersion", "kind", "org", "space", "owner", "purpose", "profile"],
10
+ "properties": {
11
+ "schemaVersion": {
12
+ "const": 2,
13
+ "type": "number"
14
+ },
15
+ "kind": {
16
+ "const": "organization",
17
+ "type": "string"
18
+ },
19
+ "org": {
20
+ "minLength": 1,
21
+ "type": "string"
22
+ },
23
+ "space": {
24
+ "pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$",
25
+ "type": "string"
26
+ },
27
+ "owner": {
28
+ "additionalProperties": false,
29
+ "type": "object",
30
+ "required": ["responsibility"],
31
+ "properties": {
32
+ "responsibility": {
33
+ "minLength": 1,
34
+ "type": "string"
35
+ },
36
+ "qualification": {
37
+ "minLength": 1,
38
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
39
+ "type": "string"
40
+ },
41
+ "designation": {
42
+ "minLength": 1,
43
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
44
+ "type": "string"
45
+ }
46
+ }
47
+ },
48
+ "purpose": {
49
+ "minLength": 1,
50
+ "type": "string"
51
+ },
52
+ "profile": {
53
+ "additionalProperties": false,
54
+ "type": "object",
55
+ "required": ["document", "facts"],
56
+ "properties": {
57
+ "document": {
58
+ "minLength": 1,
59
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
60
+ "type": "string"
61
+ },
62
+ "facts": {
63
+ "additionalProperties": false,
64
+ "type": "object",
65
+ "patternProperties": {
66
+ "^[a-z][a-z0-9-]*$": {
67
+ "minLength": 1,
68
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
69
+ "type": "string"
70
+ }
71
+ }
72
+ }
73
+ }
74
+ },
75
+ "identity": {
76
+ "additionalProperties": false,
77
+ "type": "object",
78
+ "properties": {
79
+ "principals": {
80
+ "minLength": 1,
81
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
82
+ "type": "string"
83
+ },
84
+ "qualifications": {
85
+ "minLength": 1,
86
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
87
+ "type": "string"
88
+ },
89
+ "designations": {
90
+ "minLength": 1,
91
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
92
+ "type": "string"
93
+ },
94
+ "eligibility": {
95
+ "minLength": 1,
96
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
97
+ "type": "string"
98
+ }
99
+ }
100
+ },
101
+ "policies": {
102
+ "additionalProperties": false,
103
+ "type": "object",
104
+ "required": ["sources"],
105
+ "properties": {
106
+ "sources": {
107
+ "minItems": 1,
108
+ "uniqueItems": true,
109
+ "type": "array",
110
+ "items": {
111
+ "minLength": 1,
112
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
113
+ "type": "string"
114
+ }
115
+ },
116
+ "release": {
117
+ "minLength": 1,
118
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
119
+ "type": "string"
120
+ }
121
+ }
122
+ },
123
+ "vocabulary": {
124
+ "minLength": 1,
125
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
126
+ "type": "string"
127
+ },
128
+ "admissions": {
129
+ "minLength": 1,
130
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
131
+ "type": "string"
132
+ },
133
+ "projects": {
134
+ "uniqueItems": true,
135
+ "type": "array",
136
+ "items": {
137
+ "minLength": 1,
138
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
139
+ "type": "string"
140
+ }
141
+ },
142
+ "capabilities": {
143
+ "uniqueItems": true,
144
+ "type": "array",
145
+ "items": {
146
+ "minLength": 1,
147
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
148
+ "type": "string"
149
+ }
150
+ },
151
+ "instructions": {
152
+ "type": "array",
153
+ "items": {
154
+ "additionalProperties": false,
155
+ "type": "object",
156
+ "required": ["layer", "source", "provenance"],
157
+ "properties": {
158
+ "layer": {
159
+ "anyOf": [
160
+ {
161
+ "const": "constitution",
162
+ "type": "string"
163
+ },
164
+ {
165
+ "const": "profile",
166
+ "type": "string"
167
+ },
168
+ {
169
+ "const": "project",
170
+ "type": "string"
171
+ }
172
+ ]
173
+ },
174
+ "source": {
175
+ "minLength": 1,
176
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
177
+ "type": "string"
178
+ },
179
+ "provenance": {
180
+ "minLength": 1,
181
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
182
+ "type": "string"
183
+ }
184
+ }
185
+ }
186
+ },
187
+ "documents": {
188
+ "uniqueItems": true,
189
+ "type": "array",
190
+ "items": {
191
+ "minLength": 1,
192
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
193
+ "type": "string"
194
+ }
195
+ },
196
+ "archive": {
197
+ "minLength": 1,
198
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
199
+ "type": "string"
200
+ },
201
+ "releases": {
202
+ "uniqueItems": true,
203
+ "type": "array",
204
+ "items": {
205
+ "minLength": 1,
206
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
207
+ "type": "string"
208
+ }
209
+ },
210
+ "deployment": {
211
+ "minLength": 1,
212
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
213
+ "type": "string"
214
+ },
215
+ "source": {
216
+ "additionalProperties": false,
217
+ "type": "object",
218
+ "required": ["repository", "ref", "subdirectory"],
219
+ "properties": {
220
+ "repository": {
221
+ "minLength": 1,
222
+ "type": "string"
223
+ },
224
+ "ref": {
225
+ "minLength": 1,
226
+ "type": "string"
227
+ },
228
+ "subdirectory": {
229
+ "minLength": 1,
230
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
231
+ "type": "string"
232
+ }
233
+ }
234
+ }
235
+ }
236
+ },
237
+ "workspaceProfile": {
238
+ "additionalProperties": false,
239
+ "type": "object",
240
+ "required": [
241
+ "schemaVersion",
242
+ "kind",
243
+ "id",
244
+ "profile",
245
+ "version",
246
+ "requirements",
247
+ "allowedCapabilityOrigins",
248
+ "handling",
249
+ "readinessChecks"
250
+ ],
251
+ "properties": {
252
+ "schemaVersion": {
253
+ "const": 1,
254
+ "type": "number"
255
+ },
256
+ "kind": {
257
+ "const": "workspace-profile",
258
+ "type": "string"
259
+ },
260
+ "id": {
261
+ "minLength": 1,
262
+ "type": "string"
263
+ },
264
+ "profile": {
265
+ "const": "dsg.organization.source/2",
266
+ "type": "string"
267
+ },
268
+ "version": {
269
+ "pattern": "^[1-9][0-9]*\\.[0-9]+\\.[0-9]+$",
270
+ "type": "string"
271
+ },
272
+ "requirements": {
273
+ "additionalProperties": false,
274
+ "type": "object",
275
+ "required": ["facts", "minimumProjects", "requiredCapabilities", "instructions"],
276
+ "properties": {
277
+ "facts": {
278
+ "uniqueItems": true,
279
+ "type": "array",
280
+ "items": {
281
+ "minLength": 1,
282
+ "type": "string"
283
+ }
284
+ },
285
+ "minimumProjects": {
286
+ "minimum": 0,
287
+ "maximum": 9007199254740991,
288
+ "type": "integer"
289
+ },
290
+ "requiredCapabilities": {
291
+ "uniqueItems": true,
292
+ "type": "array",
293
+ "items": {
294
+ "minLength": 1,
295
+ "type": "string"
296
+ }
297
+ },
298
+ "instructions": {
299
+ "type": "boolean"
300
+ }
301
+ }
302
+ },
303
+ "allowedCapabilityOrigins": {
304
+ "uniqueItems": true,
305
+ "type": "array",
306
+ "items": {
307
+ "anyOf": [
308
+ {
309
+ "const": "workspace",
310
+ "type": "string"
311
+ },
312
+ {
313
+ "const": "official",
314
+ "type": "string"
315
+ },
316
+ {
317
+ "const": "curated",
318
+ "type": "string"
319
+ }
320
+ ]
321
+ }
322
+ },
323
+ "handling": {
324
+ "additionalProperties": false,
325
+ "type": "object",
326
+ "required": ["required"],
327
+ "properties": {
328
+ "required": {
329
+ "type": "boolean"
330
+ }
331
+ }
332
+ },
333
+ "readinessChecks": {
334
+ "uniqueItems": true,
335
+ "type": "array",
336
+ "items": {
337
+ "minLength": 1,
338
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
339
+ "type": "string"
340
+ }
341
+ }
342
+ }
343
+ },
344
+ "projectMembership": {
345
+ "additionalProperties": false,
346
+ "type": "object",
347
+ "required": [
348
+ "schemaVersion",
349
+ "kind",
350
+ "id",
351
+ "mode",
352
+ "source",
353
+ "role",
354
+ "contract",
355
+ "handling",
356
+ "state"
357
+ ],
358
+ "properties": {
359
+ "schemaVersion": {
360
+ "const": 1,
361
+ "type": "number"
362
+ },
363
+ "kind": {
364
+ "const": "project-membership",
365
+ "type": "string"
366
+ },
367
+ "id": {
368
+ "minLength": 1,
369
+ "type": "string"
370
+ },
371
+ "mode": {
372
+ "anyOf": [
373
+ {
374
+ "const": "managed",
375
+ "type": "string"
376
+ },
377
+ {
378
+ "const": "independent",
379
+ "type": "string"
380
+ }
381
+ ]
382
+ },
383
+ "source": {
384
+ "additionalProperties": false,
385
+ "type": "object",
386
+ "required": ["repository", "revision"],
387
+ "properties": {
388
+ "repository": {
389
+ "minLength": 1,
390
+ "type": "string"
391
+ },
392
+ "revision": {
393
+ "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$",
394
+ "type": "string"
395
+ }
396
+ }
397
+ },
398
+ "role": {
399
+ "minLength": 1,
400
+ "type": "string"
401
+ },
402
+ "contract": {
403
+ "minLength": 1,
404
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
405
+ "type": "string"
406
+ },
407
+ "handling": {
408
+ "minLength": 1,
409
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
410
+ "type": "string"
411
+ },
412
+ "state": {
413
+ "anyOf": [
414
+ {
415
+ "const": "active",
416
+ "type": "string"
417
+ },
418
+ {
419
+ "const": "suspended",
420
+ "type": "string"
421
+ },
422
+ {
423
+ "const": "removed",
424
+ "type": "string"
425
+ }
426
+ ]
427
+ }
428
+ }
429
+ },
430
+ "capabilitySelection": {
431
+ "additionalProperties": false,
432
+ "type": "object",
433
+ "required": [
434
+ "schemaVersion",
435
+ "kind",
436
+ "id",
437
+ "declaration",
438
+ "components",
439
+ "origin",
440
+ "dependencyLock",
441
+ "requiredDispositions"
442
+ ],
443
+ "properties": {
444
+ "schemaVersion": {
445
+ "const": 1,
446
+ "type": "number"
447
+ },
448
+ "kind": {
449
+ "const": "capability-selection",
450
+ "type": "string"
451
+ },
452
+ "id": {
453
+ "minLength": 1,
454
+ "type": "string"
455
+ },
456
+ "declaration": {
457
+ "minLength": 1,
458
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
459
+ "type": "string"
460
+ },
461
+ "components": {
462
+ "uniqueItems": true,
463
+ "type": "array",
464
+ "items": {
465
+ "additionalProperties": false,
466
+ "type": "object",
467
+ "required": ["id", "reference"],
468
+ "properties": {
469
+ "id": {
470
+ "minLength": 1,
471
+ "type": "string"
472
+ },
473
+ "reference": {
474
+ "minLength": 1,
475
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
476
+ "type": "string"
477
+ }
478
+ }
479
+ }
480
+ },
481
+ "origin": {
482
+ "anyOf": [
483
+ {
484
+ "const": "workspace",
485
+ "type": "string"
486
+ },
487
+ {
488
+ "const": "official",
489
+ "type": "string"
490
+ },
491
+ {
492
+ "const": "curated",
493
+ "type": "string"
494
+ }
495
+ ]
496
+ },
497
+ "dependencyLock": {
498
+ "minLength": 1,
499
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
500
+ "type": "string"
501
+ },
502
+ "requiredDispositions": {
503
+ "uniqueItems": true,
504
+ "type": "array",
505
+ "items": {
506
+ "minLength": 1,
507
+ "type": "string"
508
+ }
509
+ }
510
+ }
511
+ },
512
+ "releaseDeclaration": {
513
+ "additionalProperties": false,
514
+ "type": "object",
515
+ "required": ["schemaVersion", "kind", "name", "selection", "members", "predecessors"],
516
+ "properties": {
517
+ "schemaVersion": {
518
+ "const": 1,
519
+ "type": "number"
520
+ },
521
+ "kind": {
522
+ "const": "release-declaration",
523
+ "type": "string"
524
+ },
525
+ "name": {
526
+ "minLength": 1,
527
+ "type": "string"
528
+ },
529
+ "selection": {
530
+ "additionalProperties": false,
531
+ "type": "object",
532
+ "required": ["projects", "capabilities"],
533
+ "properties": {
534
+ "projects": {
535
+ "uniqueItems": true,
536
+ "type": "array",
537
+ "items": {
538
+ "minLength": 1,
539
+ "type": "string"
540
+ }
541
+ },
542
+ "capabilities": {
543
+ "uniqueItems": true,
544
+ "type": "array",
545
+ "items": {
546
+ "minLength": 1,
547
+ "type": "string"
548
+ }
549
+ }
550
+ }
551
+ },
552
+ "members": {
553
+ "type": "array",
554
+ "items": {
555
+ "additionalProperties": false,
556
+ "type": "object",
557
+ "required": ["key", "artifact", "kind", "required", "acceptableDispositions"],
558
+ "properties": {
559
+ "key": {
560
+ "minLength": 1,
561
+ "type": "string"
562
+ },
563
+ "artifact": {
564
+ "minLength": 1,
565
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?!.*\\\\).+$",
566
+ "type": "string"
567
+ },
568
+ "kind": {
569
+ "anyOf": [
570
+ {
571
+ "const": "policy",
572
+ "type": "string"
573
+ },
574
+ {
575
+ "const": "capability-admission",
576
+ "type": "string"
577
+ },
578
+ {
579
+ "const": "workflow-publication",
580
+ "type": "string"
581
+ },
582
+ {
583
+ "const": "contract-check",
584
+ "type": "string"
585
+ },
586
+ {
587
+ "const": "target-readiness",
588
+ "type": "string"
589
+ },
590
+ {
591
+ "const": "setup-condition",
592
+ "type": "string"
593
+ }
594
+ ]
595
+ },
596
+ "required": {
597
+ "type": "boolean"
598
+ },
599
+ "acceptableDispositions": {
600
+ "minItems": 1,
601
+ "uniqueItems": true,
602
+ "type": "array",
603
+ "items": {
604
+ "minLength": 1,
605
+ "type": "string"
606
+ }
607
+ }
608
+ }
609
+ }
610
+ },
611
+ "predecessors": {
612
+ "uniqueItems": true,
613
+ "type": "array",
614
+ "items": {
615
+ "minLength": 1,
616
+ "type": "string"
617
+ }
618
+ }
619
+ }
620
+ }
621
+ },
622
+ "$ref": "#/$defs/organization"
623
+ }
@@ -0,0 +1,42 @@
1
+ // dsg.core.google-identity/1
2
+ // Owner: dsg-kernel. A verified Google identity, as the kernel sees it:
3
+ // the Google account number is the only identity key and the email
4
+ // address is a display label. The kernel carries googleSubject in the
5
+ // shape "accounts.google.com:<digits>" and never compares email for
6
+ // identity after the claim.
7
+ //
8
+ // This profile ships beside dsg.core.identity-binding/1, which remains
9
+ // the frozen shape of the detached personal-key binding path. The real
10
+ // authority is Google-attested, so a separate profile names what a
11
+ // verified identity looks like on the wire today.
12
+ //
13
+ // googleSubject is required, email is optional. hostedDomain is set
14
+ // when the verified token carries the hd claim; absent is its own
15
+ // meaning, not the same as a missing value. audience is the client id
16
+ // the token was minted for and is required.
17
+ import { type Static, Type } from "@sinclair/typebox";
18
+ import { closed, NonEmptyString, type ProfileEntry } from "../primitives.js";
19
+
20
+ export const GOOGLE_IDENTITY_PROFILE = "dsg.core.google-identity/1" as const;
21
+ export const GOOGLE_SIGN_IN_ISSUER = "https://accounts.google.com" as const;
22
+
23
+ const GoogleAccountSubject = Type.String({
24
+ pattern: "^accounts\\.google\\.com:[0-9]+$",
25
+ });
26
+
27
+ const GoogleIdentitySchemaValue = closed({
28
+ profile: Type.Literal(GOOGLE_IDENTITY_PROFILE),
29
+ issuer: Type.Literal(GOOGLE_SIGN_IN_ISSUER),
30
+ googleSubject: GoogleAccountSubject,
31
+ audience: NonEmptyString,
32
+ hostedDomain: Type.Optional(NonEmptyString),
33
+ email: Type.Optional(NonEmptyString),
34
+ });
35
+ export const GoogleIdentitySchema: typeof GoogleIdentitySchemaValue = GoogleIdentitySchemaValue;
36
+ export type GoogleIdentity = Static<typeof GoogleIdentitySchema>;
37
+
38
+ export const googleIdentityV1: ProfileEntry = {
39
+ literal: GOOGLE_IDENTITY_PROFILE,
40
+ rootDocument: "googleIdentity",
41
+ documents: { googleIdentity: GoogleIdentitySchema },
42
+ };
@@ -21,6 +21,6 @@ export type IdentityBinding = Static<typeof IdentityBindingSchema>;
21
21
 
22
22
  export const identityBindingV1: ProfileEntry = {
23
23
  literal: IDENTITY_BINDING_PROFILE,
24
- rootShape: "binding",
25
- shapes: { binding: IdentityBindingSchema },
24
+ rootDocument: "binding",
25
+ documents: { binding: IdentityBindingSchema },
26
26
  };
@@ -40,6 +40,6 @@ export type Refusal = Static<typeof RefusalSchema>;
40
40
 
41
41
  export const refusalV1: ProfileEntry = {
42
42
  literal: REFUSAL_PROFILE,
43
- rootShape: "refusal",
44
- shapes: { refusal: RefusalSchema },
43
+ rootDocument: "refusal",
44
+ documents: { refusal: RefusalSchema },
45
45
  };
@@ -61,6 +61,6 @@ export type RefusalV2 = Static<typeof RefusalV2Schema>;
61
61
 
62
62
  export const refusalV2: ProfileEntry = {
63
63
  literal: REFUSAL_V2_PROFILE,
64
- rootShape: "refusal",
65
- shapes: { refusal: RefusalV2Schema },
64
+ rootDocument: "refusal",
65
+ documents: { refusal: RefusalV2Schema },
66
66
  };