@openvtc/trust-tasks 0.20.5 → 0.20.7

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 (112) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/_shared/components.d.ts +55 -6
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/git-ns/_shared/0.1/git-ns.d.ts +1 -1
  5. package/dist/git-ns/_shared/0.1/git-ns.d.ts.map +1 -1
  6. package/dist/git-ns/_shared/0.2/git-ns.d.ts +1 -1
  7. package/dist/git-ns/_shared/0.2/git-ns.d.ts.map +1 -1
  8. package/dist/git-ns/_shared/0.3/git-ns.d.ts +16 -0
  9. package/dist/git-ns/_shared/0.3/git-ns.d.ts.map +1 -0
  10. package/dist/git-ns/_shared/0.3/git-ns.js +6 -0
  11. package/dist/git-ns/_shared/0.3/git-ns.js.map +1 -0
  12. package/dist/git-ns/bridge/event/0.2/payload.d.ts +1348 -0
  13. package/dist/git-ns/bridge/event/0.2/payload.d.ts.map +1 -0
  14. package/dist/git-ns/bridge/event/0.2/payload.js +785 -0
  15. package/dist/git-ns/bridge/event/0.2/payload.js.map +1 -0
  16. package/dist/git-ns/bridge/job/0.1/payload.d.ts +1 -1
  17. package/dist/git-ns/bridge/job/0.1/payload.d.ts.map +1 -1
  18. package/dist/git-ns/bridge/job/0.2/payload.d.ts +1 -1
  19. package/dist/git-ns/bridge/job/0.2/payload.d.ts.map +1 -1
  20. package/dist/git-ns/bridge/job/0.3/payload.d.ts +1068 -0
  21. package/dist/git-ns/bridge/job/0.3/payload.d.ts.map +1 -0
  22. package/dist/git-ns/bridge/job/0.3/payload.js +573 -0
  23. package/dist/git-ns/bridge/job/0.3/payload.js.map +1 -0
  24. package/dist/git-ns/drift/resolve/0.1/payload.d.ts +1 -1
  25. package/dist/git-ns/drift/resolve/0.1/payload.d.ts.map +1 -1
  26. package/dist/git-ns/drift/resolve/0.2/payload.d.ts +1060 -0
  27. package/dist/git-ns/drift/resolve/0.2/payload.d.ts.map +1 -0
  28. package/dist/git-ns/drift/resolve/0.2/payload.js +630 -0
  29. package/dist/git-ns/drift/resolve/0.2/payload.js.map +1 -0
  30. package/dist/git-ns/namespace/reseat/0.1/payload.d.ts +1 -1
  31. package/dist/git-ns/namespace/reseat/0.1/payload.d.ts.map +1 -1
  32. package/dist/git-ns/namespace/reseat/0.2/payload.d.ts +515 -0
  33. package/dist/git-ns/namespace/reseat/0.2/payload.d.ts.map +1 -0
  34. package/dist/git-ns/namespace/reseat/0.2/payload.js +296 -0
  35. package/dist/git-ns/namespace/reseat/0.2/payload.js.map +1 -0
  36. package/dist/git-ns/repo/adopt/0.1/payload.d.ts +1 -1
  37. package/dist/git-ns/repo/adopt/0.1/payload.d.ts.map +1 -1
  38. package/dist/git-ns/repo/adopt/0.2/payload.d.ts +962 -0
  39. package/dist/git-ns/repo/adopt/0.2/payload.d.ts.map +1 -0
  40. package/dist/git-ns/repo/adopt/0.2/payload.js +583 -0
  41. package/dist/git-ns/repo/adopt/0.2/payload.js.map +1 -0
  42. package/dist/git-ns/repo/archive/0.1/payload.d.ts +1 -1
  43. package/dist/git-ns/repo/archive/0.1/payload.d.ts.map +1 -1
  44. package/dist/git-ns/repo/archive/0.2/payload.d.ts +959 -0
  45. package/dist/git-ns/repo/archive/0.2/payload.d.ts.map +1 -0
  46. package/dist/git-ns/repo/archive/0.2/payload.js +584 -0
  47. package/dist/git-ns/repo/archive/0.2/payload.js.map +1 -0
  48. package/dist/git-ns/repo/create/0.1/payload.d.ts +1 -1
  49. package/dist/git-ns/repo/create/0.1/payload.d.ts.map +1 -1
  50. package/dist/git-ns/repo/create/0.2/payload.d.ts +1074 -0
  51. package/dist/git-ns/repo/create/0.2/payload.d.ts.map +1 -0
  52. package/dist/git-ns/repo/create/0.2/payload.js +636 -0
  53. package/dist/git-ns/repo/create/0.2/payload.js.map +1 -0
  54. package/dist/git-ns/repo/transfer/0.1/payload.d.ts +1 -1
  55. package/dist/git-ns/repo/transfer/0.1/payload.d.ts.map +1 -1
  56. package/dist/git-ns/repo/transfer/0.2/payload.d.ts +947 -0
  57. package/dist/git-ns/repo/transfer/0.2/payload.d.ts.map +1 -0
  58. package/dist/git-ns/repo/transfer/0.2/payload.js +577 -0
  59. package/dist/git-ns/repo/transfer/0.2/payload.js.map +1 -0
  60. package/dist/git-ns/right/grant/0.1/payload.d.ts +1 -1
  61. package/dist/git-ns/right/grant/0.1/payload.d.ts.map +1 -1
  62. package/dist/git-ns/right/grant/0.2/payload.d.ts +506 -0
  63. package/dist/git-ns/right/grant/0.2/payload.d.ts.map +1 -0
  64. package/dist/git-ns/right/grant/0.2/payload.js +289 -0
  65. package/dist/git-ns/right/grant/0.2/payload.js.map +1 -0
  66. package/dist/git-ns/right/revoke/0.1/payload.d.ts +1 -1
  67. package/dist/git-ns/right/revoke/0.1/payload.d.ts.map +1 -1
  68. package/dist/git-ns/right/revoke/0.2/payload.d.ts +492 -0
  69. package/dist/git-ns/right/revoke/0.2/payload.d.ts.map +1 -0
  70. package/dist/git-ns/right/revoke/0.2/payload.js +284 -0
  71. package/dist/git-ns/right/revoke/0.2/payload.js.map +1 -0
  72. package/dist/git-ns/view/0.1/payload.d.ts +1 -1
  73. package/dist/git-ns/view/0.1/payload.d.ts.map +1 -1
  74. package/dist/git-ns/view/0.2/payload.d.ts +1 -1
  75. package/dist/git-ns/view/0.2/payload.d.ts.map +1 -1
  76. package/dist/git-ns/view/0.3/payload.d.ts +1524 -0
  77. package/dist/git-ns/view/0.3/payload.d.ts.map +1 -0
  78. package/dist/git-ns/view/0.3/payload.js +918 -0
  79. package/dist/git-ns/view/0.3/payload.js.map +1 -0
  80. package/dist/index.d.ts +12 -0
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +12 -0
  83. package/dist/index.js.map +1 -1
  84. package/package.json +1 -1
  85. package/src/_shared/components.ts +55 -6
  86. package/src/git-ns/_shared/0.1/git-ns.ts +1 -1
  87. package/src/git-ns/_shared/0.2/git-ns.ts +1 -1
  88. package/src/git-ns/_shared/0.3/git-ns.ts +17 -0
  89. package/src/git-ns/bridge/event/0.2/payload.ts +902 -0
  90. package/src/git-ns/bridge/job/0.1/payload.ts +1 -1
  91. package/src/git-ns/bridge/job/0.2/payload.ts +1 -1
  92. package/src/git-ns/bridge/job/0.3/payload.ts +691 -0
  93. package/src/git-ns/drift/resolve/0.1/payload.ts +1 -1
  94. package/src/git-ns/drift/resolve/0.2/payload.ts +699 -0
  95. package/src/git-ns/namespace/reseat/0.1/payload.ts +1 -1
  96. package/src/git-ns/namespace/reseat/0.2/payload.ts +342 -0
  97. package/src/git-ns/repo/adopt/0.1/payload.ts +1 -1
  98. package/src/git-ns/repo/adopt/0.2/payload.ts +628 -0
  99. package/src/git-ns/repo/archive/0.1/payload.ts +1 -1
  100. package/src/git-ns/repo/archive/0.2/payload.ts +626 -0
  101. package/src/git-ns/repo/create/0.1/payload.ts +1 -1
  102. package/src/git-ns/repo/create/0.2/payload.ts +689 -0
  103. package/src/git-ns/repo/transfer/0.1/payload.ts +1 -1
  104. package/src/git-ns/repo/transfer/0.2/payload.ts +619 -0
  105. package/src/git-ns/right/grant/0.1/payload.ts +1 -1
  106. package/src/git-ns/right/grant/0.2/payload.ts +340 -0
  107. package/src/git-ns/right/revoke/0.1/payload.ts +1 -1
  108. package/src/git-ns/right/revoke/0.2/payload.ts +331 -0
  109. package/src/git-ns/view/0.1/payload.ts +1 -1
  110. package/src/git-ns/view/0.2/payload.ts +1 -1
  111. package/src/git-ns/view/0.3/payload.ts +981 -0
  112. package/src/index.ts +12 -0
@@ -0,0 +1,902 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/git-ns/bridge/event/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { DriftItem, Ext, ForgeAccount, ForgeHost, ForgeId, NamespaceId, RepoResource } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.
11
+ */
12
+ export type ForgeEvent =
13
+ | RepoRenamed
14
+ | RepoTransferred
15
+ | RepoCreatedUnmanaged
16
+ | RepoDeleted
17
+ | RoleChanged
18
+ | ProtectionChanged
19
+ | InstallationRemoved
20
+ | AccountLinked
21
+ | BindCompleted;
22
+
23
+ /**
24
+ * The bridge tells the VTC something happened on the forge — translated from the forge's webhook or found by an inspection sweep — together with any drift it now sees.
25
+ */
26
+ export interface GitNamespacesBridgeEventPayload {
27
+ /**
28
+ * The namespace the event happened in.
29
+ */
30
+ namespace: NamespaceId;
31
+ event: ForgeEvent;
32
+ /**
33
+ * The complete outstanding drift for each repository the event concerns, replacing what the VTC held for those repositories. Absent: the event changes no repository's drift.
34
+ */
35
+ drift?: DriftItem[];
36
+ ext?: Ext;
37
+ }
38
+ export interface RepoRenamed {
39
+ type: "repoRenamed";
40
+ forgeId: ForgeId;
41
+ from: RepoResource;
42
+ to: RepoResource;
43
+ }
44
+ export interface RepoTransferred {
45
+ type: "repoTransferred";
46
+ forgeId: ForgeId;
47
+ from: RepoResource;
48
+ to: RepoResource;
49
+ }
50
+ export interface RepoCreatedUnmanaged {
51
+ type: "repoCreatedUnmanaged";
52
+ forgeId: ForgeId;
53
+ resource: RepoResource;
54
+ }
55
+ export interface RepoDeleted {
56
+ type: "repoDeleted";
57
+ forgeId: ForgeId;
58
+ resource: RepoResource;
59
+ }
60
+ export interface RoleChanged {
61
+ type: "roleChanged";
62
+ forgeId: ForgeId;
63
+ resource: RepoResource;
64
+ account: ForgeAccount;
65
+ /**
66
+ * The role the account now holds. Absent: the account holds no role now.
67
+ */
68
+ role?: string;
69
+ }
70
+ export interface ProtectionChanged {
71
+ type: "protectionChanged";
72
+ forgeId: ForgeId;
73
+ resource: RepoResource;
74
+ /**
75
+ * Whether the forge still refuses merges without a passing verify-trust check, with no bypass.
76
+ */
77
+ requiredCheck: boolean;
78
+ }
79
+ export interface InstallationRemoved {
80
+ type: "installationRemoved";
81
+ }
82
+ export interface AccountLinked {
83
+ type: "accountLinked";
84
+ /**
85
+ * The beginAccountLink job.
86
+ */
87
+ jobId: string;
88
+ account: ForgeAccount;
89
+ }
90
+ export interface BindCompleted {
91
+ type: "bindCompleted";
92
+ /**
93
+ * The beginBind job.
94
+ */
95
+ jobId: string;
96
+ /**
97
+ * The forge's id for the owner, which survives renames.
98
+ */
99
+ ownerId: ForgeId;
100
+ kind: "organization" | "user";
101
+ }
102
+ /**
103
+ * The VTC has recorded the event. Nothing else is returned.
104
+ */
105
+ export interface GitNamespacesBridgeEventResponsePayload {
106
+ ext?: Ext;
107
+ }
108
+
109
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
110
+ export type { DriftItem, Ext, ForgeAccount, ForgeHost, ForgeId, NamespaceId, RepoResource };
111
+
112
+ /** Trust Task type URI. */
113
+ export const TYPE_URI = "https://trusttasks.org/spec/git-ns/bridge/event/0.2" as const;
114
+
115
+ /** Stable alias for this specification's request payload shape. */
116
+ export type Payload = GitNamespacesBridgeEventPayload;
117
+
118
+ /** Trust Task response type URI (request type URI + "#response"). */
119
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/git-ns/bridge/event/0.2#response" as const;
120
+
121
+ /** Stable alias for this specification's success-response payload shape. */
122
+ export type Response = GitNamespacesBridgeEventResponsePayload;
123
+
124
+ /**
125
+ * This specification's payload schema, as a value.
126
+ *
127
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
128
+ * rather than only as a `.json` file because TypeScript types are erased
129
+ * at runtime: without a schema a consumer has nothing to validate, and
130
+ * every REQUIRED payload member is optional in practice. Cross-file
131
+ * `$ref`s are already inlined, so it needs no resolver.
132
+ */
133
+ export const PAYLOAD_SCHEMA = {
134
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
135
+ "$id": "https://trusttasks.org/spec/git-ns/bridge/event/0.2",
136
+ "title": "Git Namespaces — Bridge Event — payload",
137
+ "description": "The bridge tells the VTC something happened on the forge — translated from the forge's webhook or found by an inspection sweep — together with any drift it now sees.",
138
+ "type": "object",
139
+ "additionalProperties": false,
140
+ "required": [
141
+ "namespace",
142
+ "event"
143
+ ],
144
+ "properties": {
145
+ "namespace": {
146
+ "$ref": "#/$defs/NamespaceId",
147
+ "description": "The namespace the event happened in."
148
+ },
149
+ "event": {
150
+ "$ref": "#/$defs/ForgeEvent"
151
+ },
152
+ "drift": {
153
+ "type": "array",
154
+ "items": {
155
+ "$ref": "#/$defs/DriftItem"
156
+ },
157
+ "description": "The complete outstanding drift for each repository the event concerns, replacing what the VTC held for those repositories. Absent: the event changes no repository's drift."
158
+ },
159
+ "ext": {
160
+ "$ref": "#/$defs/Ext"
161
+ }
162
+ },
163
+ "$defs": {
164
+ "JobId": {
165
+ "type": "string",
166
+ "minLength": 1,
167
+ "maxLength": 128,
168
+ "description": "The VTC's identifier for a job, unique across the VTC's jobs."
169
+ },
170
+ "ForgeRole": {
171
+ "type": "string",
172
+ "minLength": 1,
173
+ "maxLength": 64,
174
+ "description": "A role in the forge's own vocabulary (`maintain`, `write`)."
175
+ },
176
+ "ForgeEvent": {
177
+ "title": "ForgeEvent",
178
+ "description": "One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.",
179
+ "type": "object",
180
+ "oneOf": [
181
+ {
182
+ "title": "RepoRenamed",
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": [
186
+ "type",
187
+ "forgeId",
188
+ "from",
189
+ "to"
190
+ ],
191
+ "properties": {
192
+ "type": {
193
+ "const": "repoRenamed"
194
+ },
195
+ "forgeId": {
196
+ "$ref": "#/$defs/ForgeId"
197
+ },
198
+ "from": {
199
+ "$ref": "#/$defs/RepoResource"
200
+ },
201
+ "to": {
202
+ "$ref": "#/$defs/RepoResource"
203
+ }
204
+ }
205
+ },
206
+ {
207
+ "title": "RepoTransferred",
208
+ "type": "object",
209
+ "additionalProperties": false,
210
+ "required": [
211
+ "type",
212
+ "forgeId",
213
+ "from",
214
+ "to"
215
+ ],
216
+ "properties": {
217
+ "type": {
218
+ "const": "repoTransferred"
219
+ },
220
+ "forgeId": {
221
+ "$ref": "#/$defs/ForgeId"
222
+ },
223
+ "from": {
224
+ "$ref": "#/$defs/RepoResource"
225
+ },
226
+ "to": {
227
+ "$ref": "#/$defs/RepoResource"
228
+ }
229
+ }
230
+ },
231
+ {
232
+ "title": "RepoCreatedUnmanaged",
233
+ "type": "object",
234
+ "additionalProperties": false,
235
+ "required": [
236
+ "type",
237
+ "forgeId",
238
+ "resource"
239
+ ],
240
+ "properties": {
241
+ "type": {
242
+ "const": "repoCreatedUnmanaged"
243
+ },
244
+ "forgeId": {
245
+ "$ref": "#/$defs/ForgeId"
246
+ },
247
+ "resource": {
248
+ "$ref": "#/$defs/RepoResource"
249
+ }
250
+ }
251
+ },
252
+ {
253
+ "title": "RepoDeleted",
254
+ "type": "object",
255
+ "additionalProperties": false,
256
+ "required": [
257
+ "type",
258
+ "forgeId",
259
+ "resource"
260
+ ],
261
+ "properties": {
262
+ "type": {
263
+ "const": "repoDeleted"
264
+ },
265
+ "forgeId": {
266
+ "$ref": "#/$defs/ForgeId"
267
+ },
268
+ "resource": {
269
+ "$ref": "#/$defs/RepoResource"
270
+ }
271
+ }
272
+ },
273
+ {
274
+ "title": "RoleChanged",
275
+ "type": "object",
276
+ "additionalProperties": false,
277
+ "required": [
278
+ "type",
279
+ "forgeId",
280
+ "resource",
281
+ "account"
282
+ ],
283
+ "properties": {
284
+ "type": {
285
+ "const": "roleChanged"
286
+ },
287
+ "forgeId": {
288
+ "$ref": "#/$defs/ForgeId"
289
+ },
290
+ "resource": {
291
+ "$ref": "#/$defs/RepoResource"
292
+ },
293
+ "account": {
294
+ "$ref": "#/$defs/ForgeAccount"
295
+ },
296
+ "role": {
297
+ "$ref": "#/$defs/ForgeRole",
298
+ "description": "The role the account now holds. Absent: the account holds no role now."
299
+ }
300
+ }
301
+ },
302
+ {
303
+ "title": "ProtectionChanged",
304
+ "type": "object",
305
+ "additionalProperties": false,
306
+ "required": [
307
+ "type",
308
+ "forgeId",
309
+ "resource",
310
+ "requiredCheck"
311
+ ],
312
+ "properties": {
313
+ "type": {
314
+ "const": "protectionChanged"
315
+ },
316
+ "forgeId": {
317
+ "$ref": "#/$defs/ForgeId"
318
+ },
319
+ "resource": {
320
+ "$ref": "#/$defs/RepoResource"
321
+ },
322
+ "requiredCheck": {
323
+ "type": "boolean",
324
+ "description": "Whether the forge still refuses merges without a passing verify-trust check, with no bypass."
325
+ }
326
+ }
327
+ },
328
+ {
329
+ "title": "InstallationRemoved",
330
+ "type": "object",
331
+ "additionalProperties": false,
332
+ "required": [
333
+ "type"
334
+ ],
335
+ "properties": {
336
+ "type": {
337
+ "const": "installationRemoved"
338
+ }
339
+ }
340
+ },
341
+ {
342
+ "title": "AccountLinked",
343
+ "type": "object",
344
+ "additionalProperties": false,
345
+ "required": [
346
+ "type",
347
+ "jobId",
348
+ "account"
349
+ ],
350
+ "properties": {
351
+ "type": {
352
+ "const": "accountLinked"
353
+ },
354
+ "jobId": {
355
+ "$ref": "#/$defs/JobId",
356
+ "description": "The beginAccountLink job."
357
+ },
358
+ "account": {
359
+ "$ref": "#/$defs/ForgeAccount"
360
+ }
361
+ }
362
+ },
363
+ {
364
+ "title": "BindCompleted",
365
+ "type": "object",
366
+ "additionalProperties": false,
367
+ "required": [
368
+ "type",
369
+ "jobId",
370
+ "ownerId",
371
+ "kind"
372
+ ],
373
+ "properties": {
374
+ "type": {
375
+ "const": "bindCompleted"
376
+ },
377
+ "jobId": {
378
+ "$ref": "#/$defs/JobId",
379
+ "description": "The beginBind job."
380
+ },
381
+ "ownerId": {
382
+ "$ref": "#/$defs/ForgeId",
383
+ "description": "The forge's id for the owner, which survives renames."
384
+ },
385
+ "kind": {
386
+ "type": "string",
387
+ "enum": [
388
+ "organization",
389
+ "user"
390
+ ]
391
+ }
392
+ }
393
+ }
394
+ ]
395
+ },
396
+ "Response": {
397
+ "$anchor": "response",
398
+ "title": "Git Namespaces — Bridge Event — response payload",
399
+ "description": "The VTC has recorded the event. Nothing else is returned.",
400
+ "type": "object",
401
+ "additionalProperties": false,
402
+ "required": [],
403
+ "properties": {
404
+ "ext": {
405
+ "$ref": "#/$defs/Ext"
406
+ }
407
+ }
408
+ },
409
+ "Ext": {
410
+ "title": "Ext",
411
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
412
+ "type": "object",
413
+ "minProperties": 1,
414
+ "additionalProperties": true,
415
+ "propertyNames": {
416
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
417
+ }
418
+ },
419
+ "ForgeId": {
420
+ "title": "ForgeId",
421
+ "description": "An identifier the forge itself assigns — a repository id, a user or organisation id — carried as a string so a forge whose ids are not numbers needs no new version. GitHub and Forgejo ids are decimal integers written as strings (`\"812736451\"`). Unlike a name, it survives renames and transfers, which is why rights and bindings are keyed by it.",
422
+ "type": "string",
423
+ "minLength": 1,
424
+ "maxLength": 64
425
+ },
426
+ "ForgeAccount": {
427
+ "title": "ForgeAccount",
428
+ "description": "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.",
429
+ "type": "object",
430
+ "additionalProperties": false,
431
+ "required": [
432
+ "forge",
433
+ "id",
434
+ "login"
435
+ ],
436
+ "properties": {
437
+ "forge": {
438
+ "$ref": "#/$defs/ForgeHost"
439
+ },
440
+ "id": {
441
+ "$ref": "#/$defs/ForgeId"
442
+ },
443
+ "login": {
444
+ "type": "string",
445
+ "minLength": 1,
446
+ "maxLength": 100,
447
+ "description": "The account's current login, as the forge reported it when last seen. Display only."
448
+ }
449
+ }
450
+ },
451
+ "ForgeHost": {
452
+ "title": "ForgeHost",
453
+ "description": "The lowercased DNS host of a forge: `github.com`, a GitHub Enterprise Server host, `codeberg.org`, or a self-hosted Forgejo instance such as `git.example.org`. No scheme, no port, no path. The host is a segment of every resource, so a right never crosses forges.",
454
+ "type": "string",
455
+ "minLength": 3,
456
+ "maxLength": 253,
457
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
458
+ },
459
+ "RepoResource": {
460
+ "title": "RepoResource",
461
+ "description": "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.",
462
+ "type": "string",
463
+ "maxLength": 455,
464
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$"
465
+ },
466
+ "DriftItem": {
467
+ "title": "DriftItem",
468
+ "description": "One difference between the forge's observed state and the VTC's projection of a repository.",
469
+ "type": "object",
470
+ "additionalProperties": false,
471
+ "required": [
472
+ "type",
473
+ "resource"
474
+ ],
475
+ "properties": {
476
+ "type": {
477
+ "type": "string",
478
+ "enum": [
479
+ "roleAdded",
480
+ "roleRemoved",
481
+ "roleChanged",
482
+ "requiredCheckMissing",
483
+ "protectionWeakened",
484
+ "bootstrapMissing"
485
+ ],
486
+ "description": "`roleAdded` — someone holds a forge role the projection does not give them. `roleRemoved` — a projected role is missing. `roleChanged` — a projected role is present at another level. `requiredCheckMissing` — the verify-trust check is no longer required. `protectionWeakened` — branch protection or a ruleset is weaker than the projection in another way (force-push allowed, bypass actors added). `bootstrapMissing` — a bootstrap file or variable is gone."
487
+ },
488
+ "resource": {
489
+ "$ref": "#/$defs/RepoResource"
490
+ },
491
+ "account": {
492
+ "$ref": "#/$defs/ForgeAccount",
493
+ "description": "Whose role differs, for the three role types."
494
+ },
495
+ "observed": {
496
+ "type": "string",
497
+ "maxLength": 256,
498
+ "description": "What the forge shows, in the forge's own vocabulary (a role name such as `maintain`, a setting name). Absent when nothing is there."
499
+ },
500
+ "expected": {
501
+ "type": "string",
502
+ "maxLength": 256,
503
+ "description": "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing."
504
+ }
505
+ }
506
+ },
507
+ "NamespaceId": {
508
+ "title": "NamespaceId",
509
+ "description": "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.",
510
+ "type": "string",
511
+ "minLength": 1,
512
+ "maxLength": 128
513
+ }
514
+ }
515
+ } as const;
516
+
517
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
518
+ export const RESPONSE_PAYLOAD_SCHEMA = {
519
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
520
+ "$ref": "#/$defs/Response",
521
+ "$defs": {
522
+ "JobId": {
523
+ "type": "string",
524
+ "minLength": 1,
525
+ "maxLength": 128,
526
+ "description": "The VTC's identifier for a job, unique across the VTC's jobs."
527
+ },
528
+ "ForgeRole": {
529
+ "type": "string",
530
+ "minLength": 1,
531
+ "maxLength": 64,
532
+ "description": "A role in the forge's own vocabulary (`maintain`, `write`)."
533
+ },
534
+ "ForgeEvent": {
535
+ "title": "ForgeEvent",
536
+ "description": "One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.",
537
+ "type": "object",
538
+ "oneOf": [
539
+ {
540
+ "title": "RepoRenamed",
541
+ "type": "object",
542
+ "additionalProperties": false,
543
+ "required": [
544
+ "type",
545
+ "forgeId",
546
+ "from",
547
+ "to"
548
+ ],
549
+ "properties": {
550
+ "type": {
551
+ "const": "repoRenamed"
552
+ },
553
+ "forgeId": {
554
+ "$ref": "#/$defs/ForgeId"
555
+ },
556
+ "from": {
557
+ "$ref": "#/$defs/RepoResource"
558
+ },
559
+ "to": {
560
+ "$ref": "#/$defs/RepoResource"
561
+ }
562
+ }
563
+ },
564
+ {
565
+ "title": "RepoTransferred",
566
+ "type": "object",
567
+ "additionalProperties": false,
568
+ "required": [
569
+ "type",
570
+ "forgeId",
571
+ "from",
572
+ "to"
573
+ ],
574
+ "properties": {
575
+ "type": {
576
+ "const": "repoTransferred"
577
+ },
578
+ "forgeId": {
579
+ "$ref": "#/$defs/ForgeId"
580
+ },
581
+ "from": {
582
+ "$ref": "#/$defs/RepoResource"
583
+ },
584
+ "to": {
585
+ "$ref": "#/$defs/RepoResource"
586
+ }
587
+ }
588
+ },
589
+ {
590
+ "title": "RepoCreatedUnmanaged",
591
+ "type": "object",
592
+ "additionalProperties": false,
593
+ "required": [
594
+ "type",
595
+ "forgeId",
596
+ "resource"
597
+ ],
598
+ "properties": {
599
+ "type": {
600
+ "const": "repoCreatedUnmanaged"
601
+ },
602
+ "forgeId": {
603
+ "$ref": "#/$defs/ForgeId"
604
+ },
605
+ "resource": {
606
+ "$ref": "#/$defs/RepoResource"
607
+ }
608
+ }
609
+ },
610
+ {
611
+ "title": "RepoDeleted",
612
+ "type": "object",
613
+ "additionalProperties": false,
614
+ "required": [
615
+ "type",
616
+ "forgeId",
617
+ "resource"
618
+ ],
619
+ "properties": {
620
+ "type": {
621
+ "const": "repoDeleted"
622
+ },
623
+ "forgeId": {
624
+ "$ref": "#/$defs/ForgeId"
625
+ },
626
+ "resource": {
627
+ "$ref": "#/$defs/RepoResource"
628
+ }
629
+ }
630
+ },
631
+ {
632
+ "title": "RoleChanged",
633
+ "type": "object",
634
+ "additionalProperties": false,
635
+ "required": [
636
+ "type",
637
+ "forgeId",
638
+ "resource",
639
+ "account"
640
+ ],
641
+ "properties": {
642
+ "type": {
643
+ "const": "roleChanged"
644
+ },
645
+ "forgeId": {
646
+ "$ref": "#/$defs/ForgeId"
647
+ },
648
+ "resource": {
649
+ "$ref": "#/$defs/RepoResource"
650
+ },
651
+ "account": {
652
+ "$ref": "#/$defs/ForgeAccount"
653
+ },
654
+ "role": {
655
+ "$ref": "#/$defs/ForgeRole",
656
+ "description": "The role the account now holds. Absent: the account holds no role now."
657
+ }
658
+ }
659
+ },
660
+ {
661
+ "title": "ProtectionChanged",
662
+ "type": "object",
663
+ "additionalProperties": false,
664
+ "required": [
665
+ "type",
666
+ "forgeId",
667
+ "resource",
668
+ "requiredCheck"
669
+ ],
670
+ "properties": {
671
+ "type": {
672
+ "const": "protectionChanged"
673
+ },
674
+ "forgeId": {
675
+ "$ref": "#/$defs/ForgeId"
676
+ },
677
+ "resource": {
678
+ "$ref": "#/$defs/RepoResource"
679
+ },
680
+ "requiredCheck": {
681
+ "type": "boolean",
682
+ "description": "Whether the forge still refuses merges without a passing verify-trust check, with no bypass."
683
+ }
684
+ }
685
+ },
686
+ {
687
+ "title": "InstallationRemoved",
688
+ "type": "object",
689
+ "additionalProperties": false,
690
+ "required": [
691
+ "type"
692
+ ],
693
+ "properties": {
694
+ "type": {
695
+ "const": "installationRemoved"
696
+ }
697
+ }
698
+ },
699
+ {
700
+ "title": "AccountLinked",
701
+ "type": "object",
702
+ "additionalProperties": false,
703
+ "required": [
704
+ "type",
705
+ "jobId",
706
+ "account"
707
+ ],
708
+ "properties": {
709
+ "type": {
710
+ "const": "accountLinked"
711
+ },
712
+ "jobId": {
713
+ "$ref": "#/$defs/JobId",
714
+ "description": "The beginAccountLink job."
715
+ },
716
+ "account": {
717
+ "$ref": "#/$defs/ForgeAccount"
718
+ }
719
+ }
720
+ },
721
+ {
722
+ "title": "BindCompleted",
723
+ "type": "object",
724
+ "additionalProperties": false,
725
+ "required": [
726
+ "type",
727
+ "jobId",
728
+ "ownerId",
729
+ "kind"
730
+ ],
731
+ "properties": {
732
+ "type": {
733
+ "const": "bindCompleted"
734
+ },
735
+ "jobId": {
736
+ "$ref": "#/$defs/JobId",
737
+ "description": "The beginBind job."
738
+ },
739
+ "ownerId": {
740
+ "$ref": "#/$defs/ForgeId",
741
+ "description": "The forge's id for the owner, which survives renames."
742
+ },
743
+ "kind": {
744
+ "type": "string",
745
+ "enum": [
746
+ "organization",
747
+ "user"
748
+ ]
749
+ }
750
+ }
751
+ }
752
+ ]
753
+ },
754
+ "Response": {
755
+ "$anchor": "response",
756
+ "title": "Git Namespaces — Bridge Event — response payload",
757
+ "description": "The VTC has recorded the event. Nothing else is returned.",
758
+ "type": "object",
759
+ "additionalProperties": false,
760
+ "required": [],
761
+ "properties": {
762
+ "ext": {
763
+ "$ref": "#/$defs/Ext"
764
+ }
765
+ }
766
+ },
767
+ "Ext": {
768
+ "title": "Ext",
769
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
770
+ "type": "object",
771
+ "minProperties": 1,
772
+ "additionalProperties": true,
773
+ "propertyNames": {
774
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
775
+ }
776
+ },
777
+ "ForgeId": {
778
+ "title": "ForgeId",
779
+ "description": "An identifier the forge itself assigns — a repository id, a user or organisation id — carried as a string so a forge whose ids are not numbers needs no new version. GitHub and Forgejo ids are decimal integers written as strings (`\"812736451\"`). Unlike a name, it survives renames and transfers, which is why rights and bindings are keyed by it.",
780
+ "type": "string",
781
+ "minLength": 1,
782
+ "maxLength": 64
783
+ },
784
+ "ForgeAccount": {
785
+ "title": "ForgeAccount",
786
+ "description": "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.",
787
+ "type": "object",
788
+ "additionalProperties": false,
789
+ "required": [
790
+ "forge",
791
+ "id",
792
+ "login"
793
+ ],
794
+ "properties": {
795
+ "forge": {
796
+ "$ref": "#/$defs/ForgeHost"
797
+ },
798
+ "id": {
799
+ "$ref": "#/$defs/ForgeId"
800
+ },
801
+ "login": {
802
+ "type": "string",
803
+ "minLength": 1,
804
+ "maxLength": 100,
805
+ "description": "The account's current login, as the forge reported it when last seen. Display only."
806
+ }
807
+ }
808
+ },
809
+ "ForgeHost": {
810
+ "title": "ForgeHost",
811
+ "description": "The lowercased DNS host of a forge: `github.com`, a GitHub Enterprise Server host, `codeberg.org`, or a self-hosted Forgejo instance such as `git.example.org`. No scheme, no port, no path. The host is a segment of every resource, so a right never crosses forges.",
812
+ "type": "string",
813
+ "minLength": 3,
814
+ "maxLength": 253,
815
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
816
+ },
817
+ "RepoResource": {
818
+ "title": "RepoResource",
819
+ "description": "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.",
820
+ "type": "string",
821
+ "maxLength": 455,
822
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$"
823
+ },
824
+ "DriftItem": {
825
+ "title": "DriftItem",
826
+ "description": "One difference between the forge's observed state and the VTC's projection of a repository.",
827
+ "type": "object",
828
+ "additionalProperties": false,
829
+ "required": [
830
+ "type",
831
+ "resource"
832
+ ],
833
+ "properties": {
834
+ "type": {
835
+ "type": "string",
836
+ "enum": [
837
+ "roleAdded",
838
+ "roleRemoved",
839
+ "roleChanged",
840
+ "requiredCheckMissing",
841
+ "protectionWeakened",
842
+ "bootstrapMissing"
843
+ ],
844
+ "description": "`roleAdded` — someone holds a forge role the projection does not give them. `roleRemoved` — a projected role is missing. `roleChanged` — a projected role is present at another level. `requiredCheckMissing` — the verify-trust check is no longer required. `protectionWeakened` — branch protection or a ruleset is weaker than the projection in another way (force-push allowed, bypass actors added). `bootstrapMissing` — a bootstrap file or variable is gone."
845
+ },
846
+ "resource": {
847
+ "$ref": "#/$defs/RepoResource"
848
+ },
849
+ "account": {
850
+ "$ref": "#/$defs/ForgeAccount",
851
+ "description": "Whose role differs, for the three role types."
852
+ },
853
+ "observed": {
854
+ "type": "string",
855
+ "maxLength": 256,
856
+ "description": "What the forge shows, in the forge's own vocabulary (a role name such as `maintain`, a setting name). Absent when nothing is there."
857
+ },
858
+ "expected": {
859
+ "type": "string",
860
+ "maxLength": 256,
861
+ "description": "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing."
862
+ }
863
+ }
864
+ },
865
+ "NamespaceId": {
866
+ "title": "NamespaceId",
867
+ "description": "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.",
868
+ "type": "string",
869
+ "minLength": 1,
870
+ "maxLength": 128
871
+ }
872
+ }
873
+ } as const;
874
+
875
+ /**
876
+ * SPEC.md §7.2 policy for the request variant, from this specification's
877
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
878
+ * per-specification and cannot be derived from the document alone, and
879
+ * item 2 needs the schema this carries.
880
+ */
881
+ export const SPEC = {
882
+ typeUri: TYPE_URI,
883
+ isBearer: false,
884
+ isProofRequired: true,
885
+ isRecipientRequired: true,
886
+ isIssuedAtRequired: true,
887
+ payloadSchema: PAYLOAD_SCHEMA,
888
+ } as const;
889
+
890
+ /**
891
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
892
+ * tracks the *issuer* party's requirement because a response swaps the
893
+ * parties (§7.3 item 5).
894
+ */
895
+ export const RESPONSE_SPEC = {
896
+ typeUri: RESPONSE_TYPE_URI,
897
+ isBearer: false,
898
+ isProofRequired: true,
899
+ isRecipientRequired: true,
900
+ isIssuedAtRequired: true,
901
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
902
+ } as const;