@dynamicalsystems/idl 0.12.0 → 0.13.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,217 @@
1
+ // dsg.extension.release/1
2
+ // Semantic, immutable Extension Release manifests. Publication signatures and
3
+ // observations are separate envelopes; this body never self-references its
4
+ // digest and never carries transport or verification outcomes.
5
+ import { type Static, Type } from "@sinclair/typebox";
6
+ import {
7
+ closed,
8
+ Hex64,
9
+ NonEmptyString,
10
+ Orn,
11
+ Reference,
12
+ SafeInt,
13
+ UtcSecond,
14
+ type ProfileEntry,
15
+ } from "../primitives.js";
16
+
17
+ export const EXTENSION_RELEASE_PROFILE = "dsg.extension.release/1" as const;
18
+ export const EXTENSION_RELEASE_CANONICALIZATION = "RFC8785-JCS-UTF8" as const;
19
+
20
+ const IdentifierSchema = Type.String({ pattern: "^[a-z][a-z0-9-]*(?:[.-][a-z0-9]+)*$" });
21
+ const IdentifierSet = () => Type.Array(IdentifierSchema, { uniqueItems: true });
22
+ const RequiredStrings = () => Type.Array(NonEmptyString, { minItems: 1, uniqueItems: true });
23
+
24
+ export const ExtensionReleaseReferenceSchema = Reference;
25
+ export type ExtensionReleaseReference = Static<typeof ExtensionReleaseReferenceSchema>;
26
+
27
+ export const ExtensionComponentKindSchema = Type.Union([
28
+ Type.Literal("workflow"),
29
+ Type.Literal("example"),
30
+ Type.Literal("contract"),
31
+ Type.Literal("job-class"),
32
+ Type.Literal("workload-artifact"),
33
+ Type.Literal("event-catalog"),
34
+ Type.Literal("connector"),
35
+ Type.Literal("module"),
36
+ Type.Literal("check"),
37
+ Type.Literal("vocabulary"),
38
+ Type.Literal("assurance"),
39
+ Type.Literal("documentation"),
40
+ ]);
41
+ export type ExtensionComponentKind = Static<typeof ExtensionComponentKindSchema>;
42
+
43
+ export const ExtensionComponentReferenceSchema = Reference;
44
+ export type ExtensionComponentReference = Static<typeof ExtensionComponentReferenceSchema>;
45
+
46
+ const ComponentProperties = {
47
+ id: IdentifierSchema,
48
+ reference: ExtensionComponentReferenceSchema,
49
+ mediaType: NonEmptyString,
50
+ required: Type.Boolean(),
51
+ dependsOn: IdentifierSet(),
52
+ };
53
+
54
+ export const ExtensionComponentSchema = closed({
55
+ ...ComponentProperties,
56
+ kind: ExtensionComponentKindSchema,
57
+ });
58
+ export type ExtensionComponent = Static<typeof ExtensionComponentSchema>;
59
+
60
+ const ComputeComponentKindSchema = Type.Union([
61
+ Type.Literal("workflow"),
62
+ Type.Literal("example"),
63
+ Type.Literal("contract"),
64
+ Type.Literal("job-class"),
65
+ Type.Literal("workload-artifact"),
66
+ Type.Literal("event-catalog"),
67
+ Type.Literal("connector"),
68
+ Type.Literal("module"),
69
+ Type.Literal("check"),
70
+ Type.Literal("vocabulary"),
71
+ Type.Literal("assurance"),
72
+ Type.Literal("documentation"),
73
+ ]);
74
+ const ComputeComponentSchema = closed({
75
+ ...ComponentProperties,
76
+ kind: ComputeComponentKindSchema,
77
+ });
78
+ const NonComputeComponentKindSchema = Type.Union([
79
+ Type.Literal("workflow"),
80
+ Type.Literal("example"),
81
+ Type.Literal("contract"),
82
+ Type.Literal("event-catalog"),
83
+ Type.Literal("connector"),
84
+ Type.Literal("module"),
85
+ Type.Literal("check"),
86
+ Type.Literal("vocabulary"),
87
+ Type.Literal("assurance"),
88
+ Type.Literal("documentation"),
89
+ ]);
90
+ const NonComputeComponentSchema = closed({
91
+ ...ComponentProperties,
92
+ kind: NonComputeComponentKindSchema,
93
+ });
94
+
95
+ export const ExtensionDependencyKindSchema = Type.Union([
96
+ Type.Literal("extension-release"),
97
+ Type.Literal("idl-package"),
98
+ Type.Literal("module-release"),
99
+ Type.Literal("law-release"),
100
+ Type.Literal("event-catalog"),
101
+ Type.Literal("example-release"),
102
+ Type.Literal("target-release"),
103
+ ]);
104
+ export type ExtensionDependencyKind = Static<typeof ExtensionDependencyKindSchema>;
105
+
106
+ export const ExtensionDependencySchema = closed({
107
+ id: IdentifierSchema,
108
+ kind: ExtensionDependencyKindSchema,
109
+ reference: Reference,
110
+ required: Type.Boolean(),
111
+ });
112
+ export type ExtensionDependency = Static<typeof ExtensionDependencySchema>;
113
+
114
+ /** Shared requirements contain no compute-only workload obligations. */
115
+ export const ExtensionRequirementsSchema = closed({
116
+ idlProfiles: Type.Array(NonEmptyString, { uniqueItems: true }),
117
+ roles: Type.Array(NonEmptyString, { uniqueItems: true }),
118
+ qualification: Type.Optional(Reference),
119
+ handling: Type.Union([
120
+ Type.Literal("public"),
121
+ Type.Literal("restricted"),
122
+ Type.Literal("confidential"),
123
+ ]),
124
+ });
125
+ export type ExtensionRequirements = Static<typeof ExtensionRequirementsSchema>;
126
+
127
+ export const ExtensionComputeRequirementsSchema = closed({
128
+ idlProfiles: Type.Array(NonEmptyString, { uniqueItems: true }),
129
+ roles: Type.Array(NonEmptyString, { uniqueItems: true }),
130
+ qualification: Type.Optional(Reference),
131
+ handling: Type.Union([
132
+ Type.Literal("public"),
133
+ Type.Literal("restricted"),
134
+ Type.Literal("confidential"),
135
+ ]),
136
+ supportedPlatforms: RequiredStrings(),
137
+ targets: Type.Array(Reference, { uniqueItems: true }),
138
+ isolation: Type.Union([Type.Literal("ephemeral"), Type.Literal("dedicated")]),
139
+ retention: Type.Union([
140
+ Type.Literal("ephemeral"),
141
+ Type.Literal("bounded"),
142
+ Type.Literal("durable"),
143
+ ]),
144
+ completion: Reference,
145
+ teardown: Reference,
146
+ evidence: Reference,
147
+ replay: Reference,
148
+ });
149
+ export type ExtensionComputeRequirements = Static<typeof ExtensionComputeRequirementsSchema>;
150
+
151
+ export const ExtensionBoundsSchema = closed({
152
+ maxDurationSeconds: SafeInt,
153
+ maxParallelism: SafeInt,
154
+ maxUsdMicroUnits: SafeInt,
155
+ });
156
+ export type ExtensionBounds = Static<typeof ExtensionBoundsSchema>;
157
+
158
+ const ReleaseIdentity = {
159
+ profile: Type.Literal(EXTENSION_RELEASE_PROFILE),
160
+ schemaVersion: Type.Literal(1),
161
+ kind: Type.Literal("extension-release"),
162
+ publisher: Orn,
163
+ name: IdentifierSchema,
164
+ version: Type.String({ pattern: "^(?:0|[1-9][0-9]*)\\.[0-9]+\\.[0-9]+$" }),
165
+ /** Derived from publisher, namespace, name, and version; never from this
166
+ * body's digest, so canonical hashing has no self-reference. */
167
+ releaseOrn: Orn,
168
+ namespace: NonEmptyString,
169
+ source: closed({
170
+ repository: NonEmptyString,
171
+ revision: Type.String({ pattern: "^(?:[0-9a-f]{40}|[0-9a-f]{64})$" }),
172
+ }),
173
+ build: closed({ provenance: Reference, sourceDigest: Hex64 }),
174
+ canonicalization: Type.Literal(EXTENSION_RELEASE_CANONICALIZATION),
175
+ dependencies: Type.Array(ExtensionDependencySchema, { uniqueItems: true }),
176
+ };
177
+
178
+ const ComputeReleaseSchema = closed({
179
+ ...ReleaseIdentity,
180
+ compute: Type.Literal(true),
181
+ components: Type.Array(ComputeComponentSchema, { minItems: 1, uniqueItems: true }),
182
+ requirements: ExtensionComputeRequirementsSchema,
183
+ bounds: ExtensionBoundsSchema,
184
+ });
185
+ const NonComputeReleaseSchema = closed({
186
+ ...ReleaseIdentity,
187
+ compute: Type.Literal(false),
188
+ components: Type.Array(NonComputeComponentSchema, { minItems: 1, uniqueItems: true }),
189
+ requirements: ExtensionRequirementsSchema,
190
+ });
191
+ export const ExtensionReleaseSchema = Type.Union([ComputeReleaseSchema, NonComputeReleaseSchema]);
192
+ export type ExtensionRelease = Static<typeof ExtensionReleaseSchema>;
193
+
194
+ /** Detached publisher envelope. `release.sha256` and `bodySha256` both pin
195
+ * the RFC 8785 JCS UTF-8 bytes of the semantic release body. */
196
+ export const ExtensionReleaseSignatureSchema = closed({
197
+ profile: Type.Literal(EXTENSION_RELEASE_PROFILE),
198
+ schemaVersion: Type.Literal(1),
199
+ kind: Type.Literal("extension-release-signature"),
200
+ release: ExtensionReleaseReferenceSchema,
201
+ publisher: Orn,
202
+ publicKey: Hex64,
203
+ bodySha256: Hex64,
204
+ canonicalization: Type.Literal(EXTENSION_RELEASE_CANONICALIZATION),
205
+ signature: Type.String({ pattern: "^[0-9a-f]{128}$" }),
206
+ signedAt: UtcSecond,
207
+ });
208
+ export type ExtensionReleaseSignature = Static<typeof ExtensionReleaseSignatureSchema>;
209
+
210
+ export const extensionReleaseV1: ProfileEntry = {
211
+ literal: EXTENSION_RELEASE_PROFILE,
212
+ rootDocument: "release",
213
+ documents: {
214
+ release: ExtensionReleaseSchema,
215
+ signature: ExtensionReleaseSignatureSchema,
216
+ },
217
+ };
package/src/index.ts CHANGED
@@ -183,6 +183,132 @@ export type {
183
183
  ReleaseMemberKind,
184
184
  WorkspaceProfile,
185
185
  } from "./organization/source.v2.js";
186
+ export {
187
+ EXTENSION_RELEASE_PROFILE,
188
+ EXTENSION_RELEASE_CANONICALIZATION,
189
+ ExtensionReleaseReferenceSchema,
190
+ ExtensionComponentReferenceSchema,
191
+ ExtensionComponentKindSchema,
192
+ ExtensionComponentSchema,
193
+ ExtensionDependencyKindSchema,
194
+ ExtensionDependencySchema,
195
+ ExtensionRequirementsSchema,
196
+ ExtensionComputeRequirementsSchema,
197
+ ExtensionBoundsSchema,
198
+ ExtensionReleaseSchema,
199
+ ExtensionReleaseSignatureSchema,
200
+ } from "./extension/release.v1.js";
201
+ export type {
202
+ ExtensionReleaseReference,
203
+ ExtensionComponentReference,
204
+ ExtensionComponentKind,
205
+ ExtensionComponent,
206
+ ExtensionDependencyKind,
207
+ ExtensionDependency,
208
+ ExtensionRequirements,
209
+ ExtensionComputeRequirements,
210
+ ExtensionBounds,
211
+ ExtensionRelease,
212
+ ExtensionReleaseSignature,
213
+ } from "./extension/release.v1.js";
214
+ export {
215
+ ORGANIZATION_SOURCE_V3_PROFILE,
216
+ OrganizationRootV3Schema,
217
+ WorkspaceProfileV3Schema,
218
+ OrganizationSourceProjectSchema,
219
+ CapabilitySelectionV3Schema,
220
+ OrganizationSelectionDispositionSchema,
221
+ AuthoredOverlaySchema,
222
+ OrganizationDependencyLockSchema,
223
+ OrganizationSourceReleaseMemberSchema,
224
+ OrganizationReleaseDeclarationSchema,
225
+ } from "./organization/source.v3.js";
226
+ export type {
227
+ OrganizationRootV3,
228
+ WorkspaceProfileV3,
229
+ OrganizationSourceProject,
230
+ CapabilitySelectionV3,
231
+ OrganizationSelectionDisposition,
232
+ AuthoredOverlay,
233
+ OrganizationDependencyLock,
234
+ OrganizationSourceReleaseMember,
235
+ OrganizationReleaseDeclaration,
236
+ } from "./organization/source.v3.js";
237
+ export {
238
+ ORGANIZATION_RELEASE_PROFILE,
239
+ ORGANIZATION_RELEASE_CANONICALIZATION,
240
+ CompilerContractSchema,
241
+ DependencyKindSchema,
242
+ DependencyLockEntrySchema,
243
+ DependencyLockSchema,
244
+ OrganizationBuildSchema,
245
+ BuildSelectionSchema,
246
+ BuildComponentSchema,
247
+ OrganizationReleaseMemberKindSchema,
248
+ OrganizationReleaseMemberSchema,
249
+ OrganizationReleaseSchema,
250
+ ComponentBindingSchema,
251
+ ImportDispositionSchema,
252
+ ReleaseStatusSchema,
253
+ ReleaseStatusObservationSchema,
254
+ ReleaseEligibilitySchema,
255
+ ApprovedUseSchema,
256
+ AdmissionRecordSchema,
257
+ AdmissionStatusObservationSchema,
258
+ MemberObservationSchema,
259
+ ActiveMemberSchema,
260
+ ActiveSetSchema,
261
+ CatalogEntrySchema,
262
+ CatalogSchema,
263
+ BoundAttestationSchema,
264
+ } from "./organization/release.v1.js";
265
+ export type {
266
+ CompilerContract,
267
+ DependencyKind,
268
+ DependencyLockEntry,
269
+ DependencyLock,
270
+ OrganizationBuild,
271
+ BuildSelection,
272
+ BuildComponent,
273
+ OrganizationReleaseMemberKind,
274
+ OrganizationReleaseMember,
275
+ OrganizationRelease,
276
+ ComponentBinding,
277
+ ImportDisposition,
278
+ ReleaseStatus,
279
+ ReleaseStatusObservation,
280
+ ReleaseEligibility,
281
+ ApprovedUse,
282
+ AdmissionRecord,
283
+ AdmissionStatusObservation,
284
+ MemberObservation,
285
+ ActiveMember,
286
+ ActiveSet,
287
+ CatalogEntry,
288
+ Catalog,
289
+ BoundAttestation,
290
+ } from "./organization/release.v1.js";
291
+ export { JOB_CLASS_PROFILE, JobClassBoundsSchema, JobClassSchema } from "./run/job-class.v1.js";
292
+ export type { JobClassBounds, JobClass } from "./run/job-class.v1.js";
293
+ export {
294
+ WORKLOAD_ARTIFACT_PROFILE,
295
+ WorkloadArtifactSchema,
296
+ WorkloadArtifactProvenanceSchema,
297
+ WorkloadSourceSchema,
298
+ OciPlatformSchema,
299
+ } from "./run/workload-artifact.v1.js";
300
+ export type {
301
+ WorkloadArtifact,
302
+ WorkloadArtifactProvenance,
303
+ WorkloadSource,
304
+ OciPlatform,
305
+ } from "./run/workload-artifact.v1.js";
306
+ export {
307
+ EXECUTION_BINDING_PROFILE,
308
+ ExecutionBindingSchema,
309
+ ExecutionRequestEnvelopeSchema,
310
+ } from "./run/execution-binding.v1.js";
311
+ export type { ExecutionBinding, ExecutionRequestEnvelope } from "./run/execution-binding.v1.js";
186
312
 
187
313
  import type { ProfileEntry } from "./primitives.js";
188
314
  import { dispatchConsumeV1 } from "./kernel/dispatch-consume.v1.js";
@@ -204,6 +330,12 @@ import { bootstrapV1 } from "./kernel/bootstrap.v1.js";
204
330
  import { ordinaryAuthorityV1 } from "./kernel/ordinary-authority.v1.js";
205
331
  import { standingOrderActivationV1 } from "./kernel/standing-order-activation.v1.js";
206
332
  import { organizationSourceV2 } from "./organization/source.v2.js";
333
+ import { extensionReleaseV1 } from "./extension/release.v1.js";
334
+ import { organizationSourceV3 } from "./organization/source.v3.js";
335
+ import { organizationReleaseV1 } from "./organization/release.v1.js";
336
+ import { jobClassV1 } from "./run/job-class.v1.js";
337
+ import { workloadArtifactV1 } from "./run/workload-artifact.v1.js";
338
+ import { executionBindingV1 } from "./run/execution-binding.v1.js";
207
339
  /** Every profile this version of the package defines, keyed by literal.
208
340
  * Profile modules are added here as they are extracted; the rules test
209
341
  * and the schema emitter walk this registry, so a module that is not
@@ -228,4 +360,10 @@ export const PROFILES = {
228
360
  [ordinaryAuthorityV1.literal]: ordinaryAuthorityV1,
229
361
  [standingOrderActivationV1.literal]: standingOrderActivationV1,
230
362
  [organizationSourceV2.literal]: organizationSourceV2,
363
+ [extensionReleaseV1.literal]: extensionReleaseV1,
364
+ [organizationSourceV3.literal]: organizationSourceV3,
365
+ [organizationReleaseV1.literal]: organizationReleaseV1,
366
+ [jobClassV1.literal]: jobClassV1,
367
+ [workloadArtifactV1.literal]: workloadArtifactV1,
368
+ [executionBindingV1.literal]: executionBindingV1,
231
369
  } satisfies Readonly<Record<string, ProfileEntry>>;