@openvtc/trust-tasks 0.20.4 → 0.20.6

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 (40) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/_shared/components.d.ts +4 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/git-ns/_shared/0.2/git-ns.d.ts +16 -0
  5. package/dist/git-ns/_shared/0.2/git-ns.d.ts.map +1 -0
  6. package/dist/git-ns/_shared/0.2/git-ns.js +6 -0
  7. package/dist/git-ns/_shared/0.2/git-ns.js.map +1 -0
  8. package/dist/git-ns/bridge/event/0.2/payload.d.ts +1348 -0
  9. package/dist/git-ns/bridge/event/0.2/payload.d.ts.map +1 -0
  10. package/dist/git-ns/bridge/event/0.2/payload.js +785 -0
  11. package/dist/git-ns/bridge/event/0.2/payload.js.map +1 -0
  12. package/dist/git-ns/bridge/job/0.2/payload.d.ts +1068 -0
  13. package/dist/git-ns/bridge/job/0.2/payload.d.ts.map +1 -0
  14. package/dist/git-ns/bridge/job/0.2/payload.js +573 -0
  15. package/dist/git-ns/bridge/job/0.2/payload.js.map +1 -0
  16. package/dist/git-ns/drift/resolve/0.1/payload.d.ts +1060 -0
  17. package/dist/git-ns/drift/resolve/0.1/payload.d.ts.map +1 -0
  18. package/dist/git-ns/drift/resolve/0.1/payload.js +630 -0
  19. package/dist/git-ns/drift/resolve/0.1/payload.js.map +1 -0
  20. package/dist/git-ns/namespace/reseat/0.1/payload.d.ts +515 -0
  21. package/dist/git-ns/namespace/reseat/0.1/payload.d.ts.map +1 -0
  22. package/dist/git-ns/namespace/reseat/0.1/payload.js +296 -0
  23. package/dist/git-ns/namespace/reseat/0.1/payload.js.map +1 -0
  24. package/dist/git-ns/view/0.2/payload.d.ts +1524 -0
  25. package/dist/git-ns/view/0.2/payload.d.ts.map +1 -0
  26. package/dist/git-ns/view/0.2/payload.js +918 -0
  27. package/dist/git-ns/view/0.2/payload.js.map +1 -0
  28. package/dist/index.d.ts +6 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +6 -0
  31. package/dist/index.js.map +1 -1
  32. package/package.json +1 -1
  33. package/src/_shared/components.ts +10 -0
  34. package/src/git-ns/_shared/0.2/git-ns.ts +17 -0
  35. package/src/git-ns/bridge/event/0.2/payload.ts +902 -0
  36. package/src/git-ns/bridge/job/0.2/payload.ts +691 -0
  37. package/src/git-ns/drift/resolve/0.1/payload.ts +699 -0
  38. package/src/git-ns/namespace/reseat/0.1/payload.ts +342 -0
  39. package/src/git-ns/view/0.2/payload.ts +981 -0
  40. package/src/index.ts +6 -0
@@ -0,0 +1,918 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/git-ns/view/0.2/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/git-ns/view/0.2";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/git-ns/view/0.2#response";
9
+ /**
10
+ * This specification's payload schema, as a value.
11
+ *
12
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
13
+ * rather than only as a `.json` file because TypeScript types are erased
14
+ * at runtime: without a schema a consumer has nothing to validate, and
15
+ * every REQUIRED payload member is optional in practice. Cross-file
16
+ * `$ref`s are already inlined, so it needs no resolver.
17
+ */
18
+ export const PAYLOAD_SCHEMA = {
19
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
20
+ "$id": "https://trusttasks.org/spec/git-ns/view/0.2",
21
+ "title": "Git Namespaces — View — payload",
22
+ "description": "A member reads the namespaces, repositories and rights they are entitled to see, optionally narrowed to one resource, together with the forge accounts linked to their own DID.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [],
26
+ "properties": {
27
+ "resource": {
28
+ "$ref": "#/$defs/Resource",
29
+ "description": "Narrow the answer to this resource and everything inside it. Absent: everything the caller may see."
30
+ },
31
+ "ext": {
32
+ "$ref": "#/$defs/Ext"
33
+ }
34
+ },
35
+ "$defs": {
36
+ "LinkedAccount": {
37
+ "title": "LinkedAccount",
38
+ "description": "A forge account linked to the caller's DID with git-ns/account/link, and when the link completed.",
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": [
42
+ "account",
43
+ "linkedAt"
44
+ ],
45
+ "properties": {
46
+ "account": {
47
+ "$ref": "#/$defs/ForgeAccount",
48
+ "description": "The linked account. `id` is authoritative; `login` is as the forge last reported it."
49
+ },
50
+ "linkedAt": {
51
+ "type": "string",
52
+ "format": "date-time",
53
+ "description": "When the link completed: when the VTC recorded the account against the caller's DID."
54
+ }
55
+ }
56
+ },
57
+ "Response": {
58
+ "$anchor": "response",
59
+ "title": "Git Namespaces — View — response payload",
60
+ "description": "What the caller may see, and the caller's own linked forge accounts.",
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": [
64
+ "namespaces",
65
+ "repos",
66
+ "rights",
67
+ "accounts"
68
+ ],
69
+ "properties": {
70
+ "namespaces": {
71
+ "type": "array",
72
+ "items": {
73
+ "$ref": "#/$defs/GitNamespace"
74
+ },
75
+ "description": "Namespaces bound to this VTC that contain, or are contained by, `resource`."
76
+ },
77
+ "repos": {
78
+ "type": "array",
79
+ "items": {
80
+ "$ref": "#/$defs/RepoSummary"
81
+ },
82
+ "description": "Repositories within `resource`. `unmanaged` repositories are included only for callers holding `git.ns.admin` over them."
83
+ },
84
+ "rights": {
85
+ "type": "array",
86
+ "items": {
87
+ "$ref": "#/$defs/RightRecord"
88
+ },
89
+ "description": "Rights within `resource` the caller may see: always the caller's own; every right on a resource the caller owns or administers. `reason` is omitted except on resources the caller owns or administers."
90
+ },
91
+ "accounts": {
92
+ "type": "array",
93
+ "items": {
94
+ "$ref": "#/$defs/LinkedAccount"
95
+ },
96
+ "description": "The forge accounts linked to the caller's own DID — never another member's — at most one per forge. With `resource`, only the account on that resource's forge. Empty when the caller has linked none."
97
+ },
98
+ "ext": {
99
+ "$ref": "#/$defs/Ext"
100
+ }
101
+ }
102
+ },
103
+ "Ext": {
104
+ "title": "Ext",
105
+ "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.",
106
+ "type": "object",
107
+ "minProperties": 1,
108
+ "additionalProperties": true,
109
+ "propertyNames": {
110
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
111
+ }
112
+ },
113
+ "RightRecord": {
114
+ "title": "RightRecord",
115
+ "description": "One recorded right. Implied rights (§4.2 of the rights model: `own` implies `maintain` implies `commit.sign` on the same resource; `ns.admin` implies `repo.create` and `own` across its namespace) are not records and never appear as RightRecords.",
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "subject",
120
+ "right",
121
+ "resource",
122
+ "grantedBy",
123
+ "grantedAt"
124
+ ],
125
+ "properties": {
126
+ "subject": {
127
+ "$ref": "#/$defs/Did",
128
+ "description": "Who holds the right. For `git.commit.sign` this is the DID whose commit signatures the CI check accepts."
129
+ },
130
+ "right": {
131
+ "$ref": "#/$defs/Right"
132
+ },
133
+ "resource": {
134
+ "$ref": "#/$defs/Resource"
135
+ },
136
+ "grantedBy": {
137
+ "$ref": "#/$defs/Did",
138
+ "description": "The actor whose task caused the right: the granter, the creator of a repository (for its first `own`), the adopting admin, the transferring owner, or the binding admin (for the first `git.ns.admin`). The VTC's own DID for a right it derives from its configuration."
139
+ },
140
+ "grantedAt": {
141
+ "type": "string",
142
+ "format": "date-time"
143
+ },
144
+ "expiresAt": {
145
+ "type": "string",
146
+ "format": "date-time",
147
+ "description": "When the right lapses. Absent: no expiry."
148
+ },
149
+ "reason": {
150
+ "type": "string",
151
+ "maxLength": 1024,
152
+ "description": "The granter's free-text reason. Disclosed only to holders of `git.repo.own` on the resource and of `git.ns.admin` over it."
153
+ }
154
+ }
155
+ },
156
+ "Did": {
157
+ "title": "Did",
158
+ "description": "A DID, compared by exact string equality.",
159
+ "type": "string",
160
+ "maxLength": 2048,
161
+ "pattern": "^did:[a-z0-9]+:\\S+$"
162
+ },
163
+ "Resource": {
164
+ "title": "Resource",
165
+ "description": "A forge-qualified resource: `<forge-host>/<owner>` for a namespace, or `<forge-host>/<owner>/<repo>` for one repository, all lowercase — `github.com/acme`, `github.com/acme/widgets`, `codeberg.org/acme`. The forge is never implied: `acme/widgets` alone is not a resource. Containment is by whole segment: `github.com/acme` contains `github.com/acme/widgets` and does not contain `github.com/acme-labs/x` or `codeberg.org/acme/widgets`.",
166
+ "type": "string",
167
+ "maxLength": 455,
168
+ "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}){1,2}$"
169
+ },
170
+ "Right": {
171
+ "title": "Right",
172
+ "description": "One of the five git rights. Each string is also the TRQP `action` the VTC publishes the right under in its Trust Registry, so it is carried verbatim. `git.ns.admin` and `git.repo.create` apply to a namespace resource; `git.repo.own` and `git.repo.maintain` to a repository resource; `git.commit.sign` to either.",
173
+ "type": "string",
174
+ "enum": [
175
+ "git.ns.admin",
176
+ "git.repo.create",
177
+ "git.repo.own",
178
+ "git.repo.maintain",
179
+ "git.commit.sign"
180
+ ]
181
+ },
182
+ "RepoSummary": {
183
+ "title": "RepoSummary",
184
+ "description": "One repository as the VTC records it.",
185
+ "type": "object",
186
+ "additionalProperties": false,
187
+ "required": [
188
+ "resource",
189
+ "visibility",
190
+ "state",
191
+ "owners",
192
+ "bootstrap",
193
+ "sync"
194
+ ],
195
+ "properties": {
196
+ "resource": {
197
+ "$ref": "#/$defs/RepoResource"
198
+ },
199
+ "forgeId": {
200
+ "$ref": "#/$defs/ForgeId",
201
+ "description": "The forge's repository id. Absent until the forge has confirmed the repository exists (a `pendingCreate` repository, or one adopted in bridge mode before the first inspection)."
202
+ },
203
+ "visibility": {
204
+ "$ref": "#/$defs/RepoVisibility"
205
+ },
206
+ "state": {
207
+ "type": "string",
208
+ "enum": [
209
+ "pendingCreate",
210
+ "active",
211
+ "archived",
212
+ "detached",
213
+ "orphaned",
214
+ "unmanaged"
215
+ ],
216
+ "description": "`pendingCreate` — the name is reserved and the repository is not yet confirmed on the forge. `active` — managed. `archived` — archived through git-ns/repo/archive; commit rights on it are revoked. `detached` — no longer governed: its namespace was unbound, or it moved outside the namespace. `orphaned` — its last owner left the community and ownership passed to the namespace admins, who have not yet named a new owner. `unmanaged` — it exists on the forge inside a bound namespace but was never created or adopted through the VTC."
217
+ },
218
+ "owners": {
219
+ "type": "array",
220
+ "uniqueItems": true,
221
+ "items": {
222
+ "$ref": "#/$defs/Did"
223
+ },
224
+ "description": "The DIDs holding `git.repo.own` on this repository by an explicit grant. Empty only for an `unmanaged` repository, and for an `orphaned` one whose ownership rests with the namespace admins by implication."
225
+ },
226
+ "bootstrap": {
227
+ "$ref": "#/$defs/Bootstrap"
228
+ },
229
+ "sync": {
230
+ "$ref": "#/$defs/Sync"
231
+ }
232
+ }
233
+ },
234
+ "Sync": {
235
+ "title": "Sync",
236
+ "description": "How the forge compares with the VTC's projection for one repository.",
237
+ "type": "object",
238
+ "additionalProperties": false,
239
+ "required": [
240
+ "state",
241
+ "drift"
242
+ ],
243
+ "properties": {
244
+ "state": {
245
+ "type": "string",
246
+ "enum": [
247
+ "inSync",
248
+ "drift",
249
+ "pending",
250
+ "unchecked"
251
+ ],
252
+ "description": "`inSync` — the last comparison found no drift. `drift` — it found some, listed in `drift`. `pending` — a change has been sent to the forge and not yet confirmed. `unchecked` — nothing compares this repository (a manual-mode namespace)."
253
+ },
254
+ "checkedAt": {
255
+ "type": "string",
256
+ "format": "date-time",
257
+ "description": "When the forge was last compared. Absent if never."
258
+ },
259
+ "drift": {
260
+ "type": "array",
261
+ "items": {
262
+ "$ref": "#/$defs/DriftItem"
263
+ },
264
+ "description": "Outstanding drift. Empty unless `state` is `drift`."
265
+ }
266
+ }
267
+ },
268
+ "DriftItem": {
269
+ "title": "DriftItem",
270
+ "description": "One difference between the forge's observed state and the VTC's projection of a repository.",
271
+ "type": "object",
272
+ "additionalProperties": false,
273
+ "required": [
274
+ "type",
275
+ "resource"
276
+ ],
277
+ "properties": {
278
+ "type": {
279
+ "type": "string",
280
+ "enum": [
281
+ "roleAdded",
282
+ "roleRemoved",
283
+ "roleChanged",
284
+ "requiredCheckMissing",
285
+ "protectionWeakened",
286
+ "bootstrapMissing"
287
+ ],
288
+ "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."
289
+ },
290
+ "resource": {
291
+ "$ref": "#/$defs/RepoResource"
292
+ },
293
+ "account": {
294
+ "$ref": "#/$defs/ForgeAccount",
295
+ "description": "Whose role differs, for the three role types."
296
+ },
297
+ "observed": {
298
+ "type": "string",
299
+ "maxLength": 256,
300
+ "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."
301
+ },
302
+ "expected": {
303
+ "type": "string",
304
+ "maxLength": 256,
305
+ "description": "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing."
306
+ }
307
+ }
308
+ },
309
+ "ForgeAccount": {
310
+ "title": "ForgeAccount",
311
+ "description": "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.",
312
+ "type": "object",
313
+ "additionalProperties": false,
314
+ "required": [
315
+ "forge",
316
+ "id",
317
+ "login"
318
+ ],
319
+ "properties": {
320
+ "forge": {
321
+ "$ref": "#/$defs/ForgeHost"
322
+ },
323
+ "id": {
324
+ "$ref": "#/$defs/ForgeId"
325
+ },
326
+ "login": {
327
+ "type": "string",
328
+ "minLength": 1,
329
+ "maxLength": 100,
330
+ "description": "The account's current login, as the forge reported it when last seen. Display only."
331
+ }
332
+ }
333
+ },
334
+ "ForgeId": {
335
+ "title": "ForgeId",
336
+ "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.",
337
+ "type": "string",
338
+ "minLength": 1,
339
+ "maxLength": 64
340
+ },
341
+ "ForgeHost": {
342
+ "title": "ForgeHost",
343
+ "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.",
344
+ "type": "string",
345
+ "minLength": 3,
346
+ "maxLength": 253,
347
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
348
+ },
349
+ "RepoResource": {
350
+ "title": "RepoResource",
351
+ "description": "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.",
352
+ "type": "string",
353
+ "maxLength": 455,
354
+ "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}$"
355
+ },
356
+ "Bootstrap": {
357
+ "title": "Bootstrap",
358
+ "description": "Whether each step that turns commit trust on for a repository is in place, as last reported. A step that this forge's plan does not need reads `true`.",
359
+ "type": "object",
360
+ "additionalProperties": false,
361
+ "required": [
362
+ "workflow",
363
+ "keyring",
364
+ "variables",
365
+ "requiredCheck"
366
+ ],
367
+ "properties": {
368
+ "workflow": {
369
+ "type": "boolean",
370
+ "description": "The verify-trust check runs on the repository's pull requests — from a workflow committed to it, or, where the forge supports it, required on it from the namespace's own bridge-managed workflow repository at a pinned commit."
371
+ },
372
+ "keyring": {
373
+ "type": "boolean",
374
+ "description": "The exempt platform keyring for forge-signed merge commits is committed, or the forge's plan does not need one."
375
+ },
376
+ "variables": {
377
+ "type": "boolean",
378
+ "description": "The repository names the Trust Registry and this VTC as its trust anchors."
379
+ },
380
+ "requiredCheck": {
381
+ "type": "boolean",
382
+ "description": "The forge refuses to merge into the default branch unless the verify-trust check passes, with no bypass, and a pull request cannot change what that check runs: an organisation-required workflow, code-owner review of workflow files, or protected workflow paths, as the forge allows."
383
+ }
384
+ }
385
+ },
386
+ "RepoVisibility": {
387
+ "title": "RepoVisibility",
388
+ "type": "string",
389
+ "enum": [
390
+ "public",
391
+ "private"
392
+ ],
393
+ "description": "Repository visibility on the forge."
394
+ },
395
+ "GitNamespace": {
396
+ "title": "GitNamespace",
397
+ "description": "The VTC's binding to one owner on one forge.",
398
+ "type": "object",
399
+ "additionalProperties": false,
400
+ "required": [
401
+ "id",
402
+ "forge",
403
+ "owner",
404
+ "mode",
405
+ "state"
406
+ ],
407
+ "properties": {
408
+ "id": {
409
+ "$ref": "#/$defs/NamespaceId"
410
+ },
411
+ "forge": {
412
+ "$ref": "#/$defs/ForgeHost"
413
+ },
414
+ "owner": {
415
+ "$ref": "#/$defs/Segment",
416
+ "description": "The organisation or user on the forge, lowercased."
417
+ },
418
+ "kind": {
419
+ "type": "string",
420
+ "enum": [
421
+ "organization",
422
+ "user"
423
+ ],
424
+ "description": "Whether the owner is an organisation or a personal account, as the forge reports it. Present once known: a bridge-mode namespace learns it when binding completes, and a manual-mode namespace MAY never learn it."
425
+ },
426
+ "mode": {
427
+ "type": "string",
428
+ "enum": [
429
+ "bridge",
430
+ "manual"
431
+ ],
432
+ "description": "`bridge` — a bridge service acts on the forge for this namespace (creates repositories, projects roles, reports drift). `manual` — no automation; people with forge access carry out the steps the VTC names, and the VTC governs the rights alone."
433
+ },
434
+ "state": {
435
+ "type": "string",
436
+ "enum": [
437
+ "pending",
438
+ "bound"
439
+ ],
440
+ "description": "`pending` — binding has started and the forge-side proof has not arrived yet. `bound` — the VTC governs rights under this namespace."
441
+ }
442
+ }
443
+ },
444
+ "Segment": {
445
+ "title": "Segment",
446
+ "description": "One lowercased owner or repository name. Forges compare these case-insensitively, so the wire form is always lowercase and a producer lowercases before sending. A leading `.` is refused, which rules out `.` and `..`.",
447
+ "type": "string",
448
+ "minLength": 1,
449
+ "maxLength": 100,
450
+ "pattern": "^[a-z0-9_-][a-z0-9._-]*$"
451
+ },
452
+ "NamespaceId": {
453
+ "title": "NamespaceId",
454
+ "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.",
455
+ "type": "string",
456
+ "minLength": 1,
457
+ "maxLength": 128
458
+ }
459
+ }
460
+ };
461
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
462
+ export const RESPONSE_PAYLOAD_SCHEMA = {
463
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
464
+ "$ref": "#/$defs/Response",
465
+ "$defs": {
466
+ "LinkedAccount": {
467
+ "title": "LinkedAccount",
468
+ "description": "A forge account linked to the caller's DID with git-ns/account/link, and when the link completed.",
469
+ "type": "object",
470
+ "additionalProperties": false,
471
+ "required": [
472
+ "account",
473
+ "linkedAt"
474
+ ],
475
+ "properties": {
476
+ "account": {
477
+ "$ref": "#/$defs/ForgeAccount",
478
+ "description": "The linked account. `id` is authoritative; `login` is as the forge last reported it."
479
+ },
480
+ "linkedAt": {
481
+ "type": "string",
482
+ "format": "date-time",
483
+ "description": "When the link completed: when the VTC recorded the account against the caller's DID."
484
+ }
485
+ }
486
+ },
487
+ "Response": {
488
+ "$anchor": "response",
489
+ "title": "Git Namespaces — View — response payload",
490
+ "description": "What the caller may see, and the caller's own linked forge accounts.",
491
+ "type": "object",
492
+ "additionalProperties": false,
493
+ "required": [
494
+ "namespaces",
495
+ "repos",
496
+ "rights",
497
+ "accounts"
498
+ ],
499
+ "properties": {
500
+ "namespaces": {
501
+ "type": "array",
502
+ "items": {
503
+ "$ref": "#/$defs/GitNamespace"
504
+ },
505
+ "description": "Namespaces bound to this VTC that contain, or are contained by, `resource`."
506
+ },
507
+ "repos": {
508
+ "type": "array",
509
+ "items": {
510
+ "$ref": "#/$defs/RepoSummary"
511
+ },
512
+ "description": "Repositories within `resource`. `unmanaged` repositories are included only for callers holding `git.ns.admin` over them."
513
+ },
514
+ "rights": {
515
+ "type": "array",
516
+ "items": {
517
+ "$ref": "#/$defs/RightRecord"
518
+ },
519
+ "description": "Rights within `resource` the caller may see: always the caller's own; every right on a resource the caller owns or administers. `reason` is omitted except on resources the caller owns or administers."
520
+ },
521
+ "accounts": {
522
+ "type": "array",
523
+ "items": {
524
+ "$ref": "#/$defs/LinkedAccount"
525
+ },
526
+ "description": "The forge accounts linked to the caller's own DID — never another member's — at most one per forge. With `resource`, only the account on that resource's forge. Empty when the caller has linked none."
527
+ },
528
+ "ext": {
529
+ "$ref": "#/$defs/Ext"
530
+ }
531
+ }
532
+ },
533
+ "Ext": {
534
+ "title": "Ext",
535
+ "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.",
536
+ "type": "object",
537
+ "minProperties": 1,
538
+ "additionalProperties": true,
539
+ "propertyNames": {
540
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
541
+ }
542
+ },
543
+ "RightRecord": {
544
+ "title": "RightRecord",
545
+ "description": "One recorded right. Implied rights (§4.2 of the rights model: `own` implies `maintain` implies `commit.sign` on the same resource; `ns.admin` implies `repo.create` and `own` across its namespace) are not records and never appear as RightRecords.",
546
+ "type": "object",
547
+ "additionalProperties": false,
548
+ "required": [
549
+ "subject",
550
+ "right",
551
+ "resource",
552
+ "grantedBy",
553
+ "grantedAt"
554
+ ],
555
+ "properties": {
556
+ "subject": {
557
+ "$ref": "#/$defs/Did",
558
+ "description": "Who holds the right. For `git.commit.sign` this is the DID whose commit signatures the CI check accepts."
559
+ },
560
+ "right": {
561
+ "$ref": "#/$defs/Right"
562
+ },
563
+ "resource": {
564
+ "$ref": "#/$defs/Resource"
565
+ },
566
+ "grantedBy": {
567
+ "$ref": "#/$defs/Did",
568
+ "description": "The actor whose task caused the right: the granter, the creator of a repository (for its first `own`), the adopting admin, the transferring owner, or the binding admin (for the first `git.ns.admin`). The VTC's own DID for a right it derives from its configuration."
569
+ },
570
+ "grantedAt": {
571
+ "type": "string",
572
+ "format": "date-time"
573
+ },
574
+ "expiresAt": {
575
+ "type": "string",
576
+ "format": "date-time",
577
+ "description": "When the right lapses. Absent: no expiry."
578
+ },
579
+ "reason": {
580
+ "type": "string",
581
+ "maxLength": 1024,
582
+ "description": "The granter's free-text reason. Disclosed only to holders of `git.repo.own` on the resource and of `git.ns.admin` over it."
583
+ }
584
+ }
585
+ },
586
+ "Did": {
587
+ "title": "Did",
588
+ "description": "A DID, compared by exact string equality.",
589
+ "type": "string",
590
+ "maxLength": 2048,
591
+ "pattern": "^did:[a-z0-9]+:\\S+$"
592
+ },
593
+ "Resource": {
594
+ "title": "Resource",
595
+ "description": "A forge-qualified resource: `<forge-host>/<owner>` for a namespace, or `<forge-host>/<owner>/<repo>` for one repository, all lowercase — `github.com/acme`, `github.com/acme/widgets`, `codeberg.org/acme`. The forge is never implied: `acme/widgets` alone is not a resource. Containment is by whole segment: `github.com/acme` contains `github.com/acme/widgets` and does not contain `github.com/acme-labs/x` or `codeberg.org/acme/widgets`.",
596
+ "type": "string",
597
+ "maxLength": 455,
598
+ "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}){1,2}$"
599
+ },
600
+ "Right": {
601
+ "title": "Right",
602
+ "description": "One of the five git rights. Each string is also the TRQP `action` the VTC publishes the right under in its Trust Registry, so it is carried verbatim. `git.ns.admin` and `git.repo.create` apply to a namespace resource; `git.repo.own` and `git.repo.maintain` to a repository resource; `git.commit.sign` to either.",
603
+ "type": "string",
604
+ "enum": [
605
+ "git.ns.admin",
606
+ "git.repo.create",
607
+ "git.repo.own",
608
+ "git.repo.maintain",
609
+ "git.commit.sign"
610
+ ]
611
+ },
612
+ "RepoSummary": {
613
+ "title": "RepoSummary",
614
+ "description": "One repository as the VTC records it.",
615
+ "type": "object",
616
+ "additionalProperties": false,
617
+ "required": [
618
+ "resource",
619
+ "visibility",
620
+ "state",
621
+ "owners",
622
+ "bootstrap",
623
+ "sync"
624
+ ],
625
+ "properties": {
626
+ "resource": {
627
+ "$ref": "#/$defs/RepoResource"
628
+ },
629
+ "forgeId": {
630
+ "$ref": "#/$defs/ForgeId",
631
+ "description": "The forge's repository id. Absent until the forge has confirmed the repository exists (a `pendingCreate` repository, or one adopted in bridge mode before the first inspection)."
632
+ },
633
+ "visibility": {
634
+ "$ref": "#/$defs/RepoVisibility"
635
+ },
636
+ "state": {
637
+ "type": "string",
638
+ "enum": [
639
+ "pendingCreate",
640
+ "active",
641
+ "archived",
642
+ "detached",
643
+ "orphaned",
644
+ "unmanaged"
645
+ ],
646
+ "description": "`pendingCreate` — the name is reserved and the repository is not yet confirmed on the forge. `active` — managed. `archived` — archived through git-ns/repo/archive; commit rights on it are revoked. `detached` — no longer governed: its namespace was unbound, or it moved outside the namespace. `orphaned` — its last owner left the community and ownership passed to the namespace admins, who have not yet named a new owner. `unmanaged` — it exists on the forge inside a bound namespace but was never created or adopted through the VTC."
647
+ },
648
+ "owners": {
649
+ "type": "array",
650
+ "uniqueItems": true,
651
+ "items": {
652
+ "$ref": "#/$defs/Did"
653
+ },
654
+ "description": "The DIDs holding `git.repo.own` on this repository by an explicit grant. Empty only for an `unmanaged` repository, and for an `orphaned` one whose ownership rests with the namespace admins by implication."
655
+ },
656
+ "bootstrap": {
657
+ "$ref": "#/$defs/Bootstrap"
658
+ },
659
+ "sync": {
660
+ "$ref": "#/$defs/Sync"
661
+ }
662
+ }
663
+ },
664
+ "Sync": {
665
+ "title": "Sync",
666
+ "description": "How the forge compares with the VTC's projection for one repository.",
667
+ "type": "object",
668
+ "additionalProperties": false,
669
+ "required": [
670
+ "state",
671
+ "drift"
672
+ ],
673
+ "properties": {
674
+ "state": {
675
+ "type": "string",
676
+ "enum": [
677
+ "inSync",
678
+ "drift",
679
+ "pending",
680
+ "unchecked"
681
+ ],
682
+ "description": "`inSync` — the last comparison found no drift. `drift` — it found some, listed in `drift`. `pending` — a change has been sent to the forge and not yet confirmed. `unchecked` — nothing compares this repository (a manual-mode namespace)."
683
+ },
684
+ "checkedAt": {
685
+ "type": "string",
686
+ "format": "date-time",
687
+ "description": "When the forge was last compared. Absent if never."
688
+ },
689
+ "drift": {
690
+ "type": "array",
691
+ "items": {
692
+ "$ref": "#/$defs/DriftItem"
693
+ },
694
+ "description": "Outstanding drift. Empty unless `state` is `drift`."
695
+ }
696
+ }
697
+ },
698
+ "DriftItem": {
699
+ "title": "DriftItem",
700
+ "description": "One difference between the forge's observed state and the VTC's projection of a repository.",
701
+ "type": "object",
702
+ "additionalProperties": false,
703
+ "required": [
704
+ "type",
705
+ "resource"
706
+ ],
707
+ "properties": {
708
+ "type": {
709
+ "type": "string",
710
+ "enum": [
711
+ "roleAdded",
712
+ "roleRemoved",
713
+ "roleChanged",
714
+ "requiredCheckMissing",
715
+ "protectionWeakened",
716
+ "bootstrapMissing"
717
+ ],
718
+ "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."
719
+ },
720
+ "resource": {
721
+ "$ref": "#/$defs/RepoResource"
722
+ },
723
+ "account": {
724
+ "$ref": "#/$defs/ForgeAccount",
725
+ "description": "Whose role differs, for the three role types."
726
+ },
727
+ "observed": {
728
+ "type": "string",
729
+ "maxLength": 256,
730
+ "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."
731
+ },
732
+ "expected": {
733
+ "type": "string",
734
+ "maxLength": 256,
735
+ "description": "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing."
736
+ }
737
+ }
738
+ },
739
+ "ForgeAccount": {
740
+ "title": "ForgeAccount",
741
+ "description": "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.",
742
+ "type": "object",
743
+ "additionalProperties": false,
744
+ "required": [
745
+ "forge",
746
+ "id",
747
+ "login"
748
+ ],
749
+ "properties": {
750
+ "forge": {
751
+ "$ref": "#/$defs/ForgeHost"
752
+ },
753
+ "id": {
754
+ "$ref": "#/$defs/ForgeId"
755
+ },
756
+ "login": {
757
+ "type": "string",
758
+ "minLength": 1,
759
+ "maxLength": 100,
760
+ "description": "The account's current login, as the forge reported it when last seen. Display only."
761
+ }
762
+ }
763
+ },
764
+ "ForgeId": {
765
+ "title": "ForgeId",
766
+ "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.",
767
+ "type": "string",
768
+ "minLength": 1,
769
+ "maxLength": 64
770
+ },
771
+ "ForgeHost": {
772
+ "title": "ForgeHost",
773
+ "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.",
774
+ "type": "string",
775
+ "minLength": 3,
776
+ "maxLength": 253,
777
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
778
+ },
779
+ "RepoResource": {
780
+ "title": "RepoResource",
781
+ "description": "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.",
782
+ "type": "string",
783
+ "maxLength": 455,
784
+ "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}$"
785
+ },
786
+ "Bootstrap": {
787
+ "title": "Bootstrap",
788
+ "description": "Whether each step that turns commit trust on for a repository is in place, as last reported. A step that this forge's plan does not need reads `true`.",
789
+ "type": "object",
790
+ "additionalProperties": false,
791
+ "required": [
792
+ "workflow",
793
+ "keyring",
794
+ "variables",
795
+ "requiredCheck"
796
+ ],
797
+ "properties": {
798
+ "workflow": {
799
+ "type": "boolean",
800
+ "description": "The verify-trust check runs on the repository's pull requests — from a workflow committed to it, or, where the forge supports it, required on it from the namespace's own bridge-managed workflow repository at a pinned commit."
801
+ },
802
+ "keyring": {
803
+ "type": "boolean",
804
+ "description": "The exempt platform keyring for forge-signed merge commits is committed, or the forge's plan does not need one."
805
+ },
806
+ "variables": {
807
+ "type": "boolean",
808
+ "description": "The repository names the Trust Registry and this VTC as its trust anchors."
809
+ },
810
+ "requiredCheck": {
811
+ "type": "boolean",
812
+ "description": "The forge refuses to merge into the default branch unless the verify-trust check passes, with no bypass, and a pull request cannot change what that check runs: an organisation-required workflow, code-owner review of workflow files, or protected workflow paths, as the forge allows."
813
+ }
814
+ }
815
+ },
816
+ "RepoVisibility": {
817
+ "title": "RepoVisibility",
818
+ "type": "string",
819
+ "enum": [
820
+ "public",
821
+ "private"
822
+ ],
823
+ "description": "Repository visibility on the forge."
824
+ },
825
+ "GitNamespace": {
826
+ "title": "GitNamespace",
827
+ "description": "The VTC's binding to one owner on one forge.",
828
+ "type": "object",
829
+ "additionalProperties": false,
830
+ "required": [
831
+ "id",
832
+ "forge",
833
+ "owner",
834
+ "mode",
835
+ "state"
836
+ ],
837
+ "properties": {
838
+ "id": {
839
+ "$ref": "#/$defs/NamespaceId"
840
+ },
841
+ "forge": {
842
+ "$ref": "#/$defs/ForgeHost"
843
+ },
844
+ "owner": {
845
+ "$ref": "#/$defs/Segment",
846
+ "description": "The organisation or user on the forge, lowercased."
847
+ },
848
+ "kind": {
849
+ "type": "string",
850
+ "enum": [
851
+ "organization",
852
+ "user"
853
+ ],
854
+ "description": "Whether the owner is an organisation or a personal account, as the forge reports it. Present once known: a bridge-mode namespace learns it when binding completes, and a manual-mode namespace MAY never learn it."
855
+ },
856
+ "mode": {
857
+ "type": "string",
858
+ "enum": [
859
+ "bridge",
860
+ "manual"
861
+ ],
862
+ "description": "`bridge` — a bridge service acts on the forge for this namespace (creates repositories, projects roles, reports drift). `manual` — no automation; people with forge access carry out the steps the VTC names, and the VTC governs the rights alone."
863
+ },
864
+ "state": {
865
+ "type": "string",
866
+ "enum": [
867
+ "pending",
868
+ "bound"
869
+ ],
870
+ "description": "`pending` — binding has started and the forge-side proof has not arrived yet. `bound` — the VTC governs rights under this namespace."
871
+ }
872
+ }
873
+ },
874
+ "Segment": {
875
+ "title": "Segment",
876
+ "description": "One lowercased owner or repository name. Forges compare these case-insensitively, so the wire form is always lowercase and a producer lowercases before sending. A leading `.` is refused, which rules out `.` and `..`.",
877
+ "type": "string",
878
+ "minLength": 1,
879
+ "maxLength": 100,
880
+ "pattern": "^[a-z0-9_-][a-z0-9._-]*$"
881
+ },
882
+ "NamespaceId": {
883
+ "title": "NamespaceId",
884
+ "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.",
885
+ "type": "string",
886
+ "minLength": 1,
887
+ "maxLength": 128
888
+ }
889
+ }
890
+ };
891
+ /**
892
+ * SPEC.md §7.2 policy for the request variant, from this specification's
893
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
894
+ * per-specification and cannot be derived from the document alone, and
895
+ * item 2 needs the schema this carries.
896
+ */
897
+ export const SPEC = {
898
+ typeUri: TYPE_URI,
899
+ isBearer: false,
900
+ isProofRequired: false,
901
+ isRecipientRequired: true,
902
+ isIssuedAtRequired: false,
903
+ payloadSchema: PAYLOAD_SCHEMA,
904
+ };
905
+ /**
906
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
907
+ * tracks the *issuer* party's requirement because a response swaps the
908
+ * parties (§7.3 item 5).
909
+ */
910
+ export const RESPONSE_SPEC = {
911
+ typeUri: RESPONSE_TYPE_URI,
912
+ isBearer: false,
913
+ isProofRequired: false,
914
+ isRecipientRequired: true,
915
+ isIssuedAtRequired: false,
916
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
917
+ };
918
+ //# sourceMappingURL=payload.js.map