@openvtc/trust-tasks 0.18.3 → 0.18.5

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 (53) hide show
  1. package/CHANGELOG.md +193 -0
  2. package/dist/_shared/components.d.ts +56 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +4 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +4 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/process-attestation/0.1/payload.d.ts +1190 -0
  9. package/dist/process-attestation/0.1/payload.d.ts.map +1 -0
  10. package/dist/process-attestation/0.1/payload.js +660 -0
  11. package/dist/process-attestation/0.1/payload.js.map +1 -0
  12. package/dist/rooms/_shared/0.1/room.d.ts +1 -1
  13. package/dist/rooms/_shared/0.1/room.d.ts.map +1 -1
  14. package/dist/rooms/create/0.1/payload.d.ts +58 -2
  15. package/dist/rooms/create/0.1/payload.d.ts.map +1 -1
  16. package/dist/rooms/create/0.1/payload.js +32 -0
  17. package/dist/rooms/create/0.1/payload.js.map +1 -1
  18. package/dist/rooms/epoch/commits/0.1/payload.d.ts +506 -0
  19. package/dist/rooms/epoch/commits/0.1/payload.d.ts.map +1 -0
  20. package/dist/rooms/epoch/commits/0.1/payload.js +268 -0
  21. package/dist/rooms/epoch/commits/0.1/payload.js.map +1 -0
  22. package/dist/rooms/epoch/mint/0.1/payload.d.ts +20 -0
  23. package/dist/rooms/epoch/mint/0.1/payload.d.ts.map +1 -1
  24. package/dist/rooms/epoch/mint/0.1/payload.js +5 -0
  25. package/dist/rooms/epoch/mint/0.1/payload.js.map +1 -1
  26. package/dist/rooms/epoch/prune/0.1/payload.d.ts +423 -0
  27. package/dist/rooms/epoch/prune/0.1/payload.d.ts.map +1 -0
  28. package/dist/rooms/epoch/prune/0.1/payload.js +229 -0
  29. package/dist/rooms/epoch/prune/0.1/payload.js.map +1 -0
  30. package/dist/rooms/keys/browse/0.1/payload.d.ts +20 -0
  31. package/dist/rooms/keys/browse/0.1/payload.d.ts.map +1 -1
  32. package/dist/rooms/keys/browse/0.1/payload.js +24 -0
  33. package/dist/rooms/keys/browse/0.1/payload.js.map +1 -1
  34. package/dist/rooms/keys/read/0.1/payload.d.ts +20 -0
  35. package/dist/rooms/keys/read/0.1/payload.d.ts.map +1 -1
  36. package/dist/rooms/keys/read/0.1/payload.js +24 -0
  37. package/dist/rooms/keys/read/0.1/payload.js.map +1 -1
  38. package/dist/rooms/owner/anchor/0.1/payload.d.ts +537 -0
  39. package/dist/rooms/owner/anchor/0.1/payload.d.ts.map +1 -0
  40. package/dist/rooms/owner/anchor/0.1/payload.js +291 -0
  41. package/dist/rooms/owner/anchor/0.1/payload.js.map +1 -0
  42. package/package.json +1 -1
  43. package/src/_shared/components.ts +56 -0
  44. package/src/index.ts +4 -0
  45. package/src/process-attestation/0.1/payload.ts +794 -0
  46. package/src/rooms/_shared/0.1/room.ts +1 -1
  47. package/src/rooms/create/0.1/payload.ts +42 -2
  48. package/src/rooms/epoch/commits/0.1/payload.ts +341 -0
  49. package/src/rooms/epoch/mint/0.1/payload.ts +15 -0
  50. package/src/rooms/epoch/prune/0.1/payload.ts +289 -0
  51. package/src/rooms/keys/browse/0.1/payload.ts +24 -0
  52. package/src/rooms/keys/read/0.1/payload.ts +24 -0
  53. package/src/rooms/owner/anchor/0.1/payload.ts +353 -0
@@ -14,4 +14,4 @@ export interface RoomsSharedTypes {
14
14
  * The definitions this shared schema publishes, hoisted to one declaration each.
15
15
  * See "../../../_shared/components.js".
16
16
  */
17
- export type { AuthorityPresentation, DataCommitment, EpochLink, HeadVersion, ReadVerification, RecordCount, RecordMetadata, RecordTrace, RetentionPolicy, SealedRecord, Visibility } from "../../../_shared/components.js";
17
+ export type { AnchorCadence, AuthorityPresentation, DataCommitment, EpochAnchor, EpochLink, HeadVersion, ReadVerification, RecordCount, RecordMetadata, RecordTrace, RetentionPolicy, SealedRecord, Visibility } from "../../../_shared/components.js";
@@ -3,7 +3,7 @@
3
3
  * Source: specs/rooms/create/0.1/payload.schema.json
4
4
  */
5
5
 
6
- import type { Ext, RetentionPolicy, Visibility } from "../../../_shared/components.js";
6
+ import type { AnchorCadence, Ext, RetentionPolicy, Visibility } from "../../../_shared/components.js";
7
7
 
8
8
 
9
9
  export interface RoomsCreatePayload {
@@ -24,6 +24,10 @@ export interface RoomsCreatePayload {
24
24
  * How long the host will hold the room after its epoch lapses without renewal, before storage may be reclaimed. Stated at creation rather than discovered: reclamation that surprises a member is a failure of the design, not of the member.
25
25
  */
26
26
  retentionDays?: number;
27
+ /**
28
+ * What this room intends about anchoring. OPTIONAL; absent reads as `manual`, which draws no expectation and is the honest default for a room whose owner has not decided. A host stores it and serves it back — it constrains nothing the host does.
29
+ */
30
+ anchorCadence?: AnchorCadence;
27
31
  /**
28
32
  * Ecosystem-defined extension members per SPEC.md §4.5.1.
29
33
  */
@@ -38,11 +42,15 @@ export interface RoomsCreateResponsePayload {
38
42
  * Always 1 for a new room.
39
43
  */
40
44
  epoch: number;
45
+ /**
46
+ * Echoed so a caller knows what was recorded rather than what was asked — the two differ on a host that predates this member.
47
+ */
48
+ anchorCadence?: AnchorCadence;
41
49
  ext?: Ext;
42
50
  }
43
51
 
44
52
  /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
45
- export type { Ext, RetentionPolicy, Visibility };
53
+ export type { AnchorCadence, Ext, RetentionPolicy, Visibility };
46
54
 
47
55
  /** Trust Task type URI. */
48
56
  export const TYPE_URI = "https://trusttasks.org/spec/rooms/create/0.1" as const;
@@ -97,6 +105,10 @@ export const PAYLOAD_SCHEMA = {
97
105
  "minimum": 1,
98
106
  "description": "How long the host will hold the room after its epoch lapses without renewal, before storage may be reclaimed. Stated at creation rather than discovered: reclamation that surprises a member is a failure of the design, not of the member."
99
107
  },
108
+ "anchorCadence": {
109
+ "$ref": "#/$defs/AnchorCadence",
110
+ "description": "What this room intends about anchoring. OPTIONAL; absent reads as `manual`, which draws no expectation and is the honest default for a room whose owner has not decided. A host stores it and serves it back — it constrains nothing the host does."
111
+ },
100
112
  "ext": {
101
113
  "$ref": "#/$defs/Ext",
102
114
  "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
@@ -122,6 +134,10 @@ export const PAYLOAD_SCHEMA = {
122
134
  "minimum": 1,
123
135
  "description": "Always 1 for a new room."
124
136
  },
137
+ "anchorCadence": {
138
+ "$ref": "#/$defs/AnchorCadence",
139
+ "description": "Echoed so a caller knows what was recorded rather than what was asked — the two differ on a host that predates this member."
140
+ },
125
141
  "ext": {
126
142
  "$ref": "#/$defs/Ext"
127
143
  }
@@ -137,6 +153,16 @@ export const PAYLOAD_SCHEMA = {
137
153
  "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
138
154
  }
139
155
  },
156
+ "AnchorCadence": {
157
+ "title": "AnchorCadence",
158
+ "type": "string",
159
+ "enum": [
160
+ "never",
161
+ "renewal",
162
+ "manual"
163
+ ],
164
+ "description": "How often this room intends to write an `EpochAnchor`. **A statement of intent, not a schedule anything enforces** — nothing in this family can make an owner anchor.\n\nIt is worth stating anyway, and the reason is the interesting part: it makes **silence legible**. A room that says `renewal` and has not anchored in ten epochs is telling a member something, and a member who did not know what to expect could not have noticed. A room that says `never` is telling them not to wait for one.\n\n - `never` — no anchor is intended. Honest, and cheap: anchoring costs a witnessed update and a rotation of the room DID's update key each time.\n - `renewal` — one anchor per epoch change, which is the cadence §9's lifecycle already moves at.\n - `manual` — the owner anchors when they decide to. A member should draw no freshness expectation from this at all, which is exactly what it is for: it is the honest answer where there is no rule.\n\nDeliberately not a duration. A room that promised \"daily\" would be making a claim its owner's availability cannot keep, and a member comparing against a clock would read an owner's holiday as a host's misbehaviour."
165
+ },
140
166
  "RetentionPolicy": {
141
167
  "title": "RetentionPolicy",
142
168
  "type": "string",
@@ -184,6 +210,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
184
210
  "minimum": 1,
185
211
  "description": "Always 1 for a new room."
186
212
  },
213
+ "anchorCadence": {
214
+ "$ref": "#/$defs/AnchorCadence",
215
+ "description": "Echoed so a caller knows what was recorded rather than what was asked — the two differ on a host that predates this member."
216
+ },
187
217
  "ext": {
188
218
  "$ref": "#/$defs/Ext"
189
219
  }
@@ -199,6 +229,16 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
199
229
  "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
200
230
  }
201
231
  },
232
+ "AnchorCadence": {
233
+ "title": "AnchorCadence",
234
+ "type": "string",
235
+ "enum": [
236
+ "never",
237
+ "renewal",
238
+ "manual"
239
+ ],
240
+ "description": "How often this room intends to write an `EpochAnchor`. **A statement of intent, not a schedule anything enforces** — nothing in this family can make an owner anchor.\n\nIt is worth stating anyway, and the reason is the interesting part: it makes **silence legible**. A room that says `renewal` and has not anchored in ten epochs is telling a member something, and a member who did not know what to expect could not have noticed. A room that says `never` is telling them not to wait for one.\n\n - `never` — no anchor is intended. Honest, and cheap: anchoring costs a witnessed update and a rotation of the room DID's update key each time.\n - `renewal` — one anchor per epoch change, which is the cadence §9's lifecycle already moves at.\n - `manual` — the owner anchors when they decide to. A member should draw no freshness expectation from this at all, which is exactly what it is for: it is the honest answer where there is no rule.\n\nDeliberately not a duration. A room that promised \"daily\" would be making a claim its owner's availability cannot keep, and a member comparing against a clock would read an owner's holiday as a host's misbehaviour."
241
+ },
202
242
  "RetentionPolicy": {
203
243
  "title": "RetentionPolicy",
204
244
  "type": "string",
@@ -0,0 +1,341 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/epoch/commits/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { AuthorityPresentation, Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * TODO: what the request payload of rooms/epoch/commits carries. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface RoomsEpochCommitsPayload {
13
+ /**
14
+ * The room to catch up on.
15
+ */
16
+ roomId: string;
17
+ /**
18
+ * The epoch this member is at. The host returns the commits **above** it, in order.
19
+ *
20
+ * A member asks for what they are missing rather than for a count, because only they know where they are — a host that guessed would be guessing from the last time it saw them, which on a `private` room is a thing it should not be tracking.
21
+ */
22
+ sinceEpoch: number;
23
+ /**
24
+ * Page size to ask for. Commits are large and a member far behind may have many; a caller reads to the end by asking again from the epoch it reached.
25
+ */
26
+ limit?: number;
27
+ /**
28
+ * Must confer `read` at this room's scope. A commit is opaque to whoever holds it without the group state, so this authorises the *fetch* rather than the contents — and on a `private` room requires no host session, exactly as a record read does.
29
+ */
30
+ presentation: AuthorityPresentation;
31
+ /**
32
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
33
+ */
34
+ ext?: Ext;
35
+ }
36
+ /**
37
+ * Success response to rooms/epoch/commits. Type https://trusttasks.org/spec/rooms/epoch/commits/0.1#response.
38
+ */
39
+ export interface RoomsEpochCommitsResponsePayload {
40
+ roomId: string;
41
+ /**
42
+ * The commits above `sinceEpoch`, **in ascending epoch order and with no gaps**. MLS commits apply in sequence: one applied out of order or over a gap is rejected by the group, so a host that returned an unordered or sparse set would produce a member who cannot catch up and cannot say why. A host that is missing a commit MUST return the run it has *up to* the gap and stop, rather than skipping it.
43
+ *
44
+ * @maxItems 100
45
+ */
46
+ commits: {
47
+ /**
48
+ * The epoch this commit produced.
49
+ */
50
+ epoch: number;
51
+ /**
52
+ * The MLS commit, base64url, exactly as it was published. A host that re-encoded it would produce something the group rejects.
53
+ */
54
+ commit: string;
55
+ }[];
56
+ /**
57
+ * The epoch the room is at now.
58
+ *
59
+ * **Not `sinceEpoch` plus the number returned.** Those differ whenever the host is missing a commit or the page ended early, and that difference is the useful part: a member who applies everything served and is still behind knows a delivery is missing rather than concluding their own state is broken.
60
+ */
61
+ roomEpoch?: number;
62
+ ext?: Ext;
63
+ }
64
+
65
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
66
+ export type { AuthorityPresentation, Ext };
67
+
68
+ /** Trust Task type URI. */
69
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/epoch/commits/0.1" as const;
70
+
71
+ /** Stable alias for this specification's request payload shape. */
72
+ export type Payload = RoomsEpochCommitsPayload;
73
+
74
+ /** Trust Task response type URI (request type URI + "#response"). */
75
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/epoch/commits/0.1#response" as const;
76
+
77
+ /** Stable alias for this specification's success-response payload shape. */
78
+ export type Response = RoomsEpochCommitsResponsePayload;
79
+
80
+ /**
81
+ * This specification's payload schema, as a value.
82
+ *
83
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
84
+ * rather than only as a `.json` file because TypeScript types are erased
85
+ * at runtime: without a schema a consumer has nothing to validate, and
86
+ * every REQUIRED payload member is optional in practice. Cross-file
87
+ * `$ref`s are already inlined, so it needs no resolver.
88
+ */
89
+ export const PAYLOAD_SCHEMA = {
90
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
91
+ "$id": "https://trusttasks.org/spec/rooms/epoch/commits/0.1",
92
+ "title": "Rooms Epoch Commits — payload",
93
+ "description": "TODO: what the request payload of rooms/epoch/commits carries. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": [
97
+ "roomId",
98
+ "sinceEpoch",
99
+ "presentation"
100
+ ],
101
+ "properties": {
102
+ "roomId": {
103
+ "type": "string",
104
+ "description": "The room to catch up on."
105
+ },
106
+ "sinceEpoch": {
107
+ "type": "integer",
108
+ "minimum": 0,
109
+ "description": "The epoch this member is at. The host returns the commits **above** it, in order.\n\nA member asks for what they are missing rather than for a count, because only they know where they are — a host that guessed would be guessing from the last time it saw them, which on a `private` room is a thing it should not be tracking."
110
+ },
111
+ "limit": {
112
+ "type": "integer",
113
+ "minimum": 1,
114
+ "maximum": 100,
115
+ "description": "Page size to ask for. Commits are large and a member far behind may have many; a caller reads to the end by asking again from the epoch it reached."
116
+ },
117
+ "presentation": {
118
+ "$ref": "#/$defs/AuthorityPresentation",
119
+ "description": "Must confer `read` at this room's scope. A commit is opaque to whoever holds it without the group state, so this authorises the *fetch* rather than the contents — and on a `private` room requires no host session, exactly as a record read does."
120
+ },
121
+ "ext": {
122
+ "$ref": "#/$defs/Ext",
123
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
124
+ }
125
+ },
126
+ "$defs": {
127
+ "Response": {
128
+ "$anchor": "response",
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "required": [
132
+ "roomId",
133
+ "commits"
134
+ ],
135
+ "description": "Success response to rooms/epoch/commits. Type https://trusttasks.org/spec/rooms/epoch/commits/0.1#response.",
136
+ "properties": {
137
+ "roomId": {
138
+ "type": "string"
139
+ },
140
+ "commits": {
141
+ "type": "array",
142
+ "maxItems": 100,
143
+ "description": "The commits above `sinceEpoch`, **in ascending epoch order and with no gaps**. MLS commits apply in sequence: one applied out of order or over a gap is rejected by the group, so a host that returned an unordered or sparse set would produce a member who cannot catch up and cannot say why. A host that is missing a commit MUST return the run it has *up to* the gap and stop, rather than skipping it.",
144
+ "items": {
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "required": [
148
+ "epoch",
149
+ "commit"
150
+ ],
151
+ "properties": {
152
+ "epoch": {
153
+ "type": "integer",
154
+ "minimum": 1,
155
+ "description": "The epoch this commit produced."
156
+ },
157
+ "commit": {
158
+ "type": "string",
159
+ "maxLength": 262144,
160
+ "description": "The MLS commit, base64url, exactly as it was published. A host that re-encoded it would produce something the group rejects."
161
+ }
162
+ }
163
+ }
164
+ },
165
+ "roomEpoch": {
166
+ "type": "integer",
167
+ "minimum": 1,
168
+ "description": "The epoch the room is at now.\n\n**Not `sinceEpoch` plus the number returned.** Those differ whenever the host is missing a commit or the page ended early, and that difference is the useful part: a member who applies everything served and is still behind knows a delivery is missing rather than concluding their own state is broken."
169
+ },
170
+ "ext": {
171
+ "$ref": "#/$defs/Ext"
172
+ }
173
+ },
174
+ "title": "Rooms Epoch Commits — response payload"
175
+ },
176
+ "Ext": {
177
+ "title": "Ext",
178
+ "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.",
179
+ "type": "object",
180
+ "minProperties": 1,
181
+ "additionalProperties": true,
182
+ "propertyNames": {
183
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
184
+ }
185
+ },
186
+ "AuthorityPresentation": {
187
+ "title": "AuthorityPresentation",
188
+ "type": "object",
189
+ "additionalProperties": false,
190
+ "required": [
191
+ "membership",
192
+ "authority"
193
+ ],
194
+ "description": "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
195
+ "properties": {
196
+ "membership": {
197
+ "type": "string",
198
+ "description": "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile."
199
+ },
200
+ "authority": {
201
+ "type": "array",
202
+ "minItems": 1,
203
+ "maxItems": 8,
204
+ "items": {
205
+ "type": "string"
206
+ },
207
+ "description": "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent."
208
+ },
209
+ "subjectBinding": {
210
+ "type": "string",
211
+ "description": "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this."
212
+ }
213
+ }
214
+ }
215
+ }
216
+ } as const;
217
+
218
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
219
+ export const RESPONSE_PAYLOAD_SCHEMA = {
220
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
221
+ "$ref": "#/$defs/Response",
222
+ "$defs": {
223
+ "Response": {
224
+ "$anchor": "response",
225
+ "type": "object",
226
+ "additionalProperties": false,
227
+ "required": [
228
+ "roomId",
229
+ "commits"
230
+ ],
231
+ "description": "Success response to rooms/epoch/commits. Type https://trusttasks.org/spec/rooms/epoch/commits/0.1#response.",
232
+ "properties": {
233
+ "roomId": {
234
+ "type": "string"
235
+ },
236
+ "commits": {
237
+ "type": "array",
238
+ "maxItems": 100,
239
+ "description": "The commits above `sinceEpoch`, **in ascending epoch order and with no gaps**. MLS commits apply in sequence: one applied out of order or over a gap is rejected by the group, so a host that returned an unordered or sparse set would produce a member who cannot catch up and cannot say why. A host that is missing a commit MUST return the run it has *up to* the gap and stop, rather than skipping it.",
240
+ "items": {
241
+ "type": "object",
242
+ "additionalProperties": false,
243
+ "required": [
244
+ "epoch",
245
+ "commit"
246
+ ],
247
+ "properties": {
248
+ "epoch": {
249
+ "type": "integer",
250
+ "minimum": 1,
251
+ "description": "The epoch this commit produced."
252
+ },
253
+ "commit": {
254
+ "type": "string",
255
+ "maxLength": 262144,
256
+ "description": "The MLS commit, base64url, exactly as it was published. A host that re-encoded it would produce something the group rejects."
257
+ }
258
+ }
259
+ }
260
+ },
261
+ "roomEpoch": {
262
+ "type": "integer",
263
+ "minimum": 1,
264
+ "description": "The epoch the room is at now.\n\n**Not `sinceEpoch` plus the number returned.** Those differ whenever the host is missing a commit or the page ended early, and that difference is the useful part: a member who applies everything served and is still behind knows a delivery is missing rather than concluding their own state is broken."
265
+ },
266
+ "ext": {
267
+ "$ref": "#/$defs/Ext"
268
+ }
269
+ },
270
+ "title": "Rooms Epoch Commits — response payload"
271
+ },
272
+ "Ext": {
273
+ "title": "Ext",
274
+ "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.",
275
+ "type": "object",
276
+ "minProperties": 1,
277
+ "additionalProperties": true,
278
+ "propertyNames": {
279
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
280
+ }
281
+ },
282
+ "AuthorityPresentation": {
283
+ "title": "AuthorityPresentation",
284
+ "type": "object",
285
+ "additionalProperties": false,
286
+ "required": [
287
+ "membership",
288
+ "authority"
289
+ ],
290
+ "description": "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
291
+ "properties": {
292
+ "membership": {
293
+ "type": "string",
294
+ "description": "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile."
295
+ },
296
+ "authority": {
297
+ "type": "array",
298
+ "minItems": 1,
299
+ "maxItems": 8,
300
+ "items": {
301
+ "type": "string"
302
+ },
303
+ "description": "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent."
304
+ },
305
+ "subjectBinding": {
306
+ "type": "string",
307
+ "description": "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this."
308
+ }
309
+ }
310
+ }
311
+ }
312
+ } as const;
313
+
314
+ /**
315
+ * SPEC.md §7.2 policy for the request variant, from this specification's
316
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
317
+ * per-specification and cannot be derived from the document alone, and
318
+ * item 2 needs the schema this carries.
319
+ */
320
+ export const SPEC = {
321
+ typeUri: TYPE_URI,
322
+ isBearer: false,
323
+ isProofRequired: true,
324
+ isRecipientRequired: true,
325
+ isIssuedAtRequired: true,
326
+ payloadSchema: PAYLOAD_SCHEMA,
327
+ } as const;
328
+
329
+ /**
330
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
331
+ * tracks the *issuer* party's requirement because a response swaps the
332
+ * parties (§7.3 item 5).
333
+ */
334
+ export const RESPONSE_SPEC = {
335
+ typeUri: RESPONSE_TYPE_URI,
336
+ isBearer: false,
337
+ isProofRequired: true,
338
+ isRecipientRequired: true,
339
+ isIssuedAtRequired: true,
340
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
341
+ } as const;
@@ -23,6 +23,16 @@ export interface RoomsEpochMintPayload {
23
23
  * The rung of the epoch key chain that this advance produces: the outgoing epoch's storage key sealed under the incoming one. Carried here because minting is the only moment at which one party holds both keys, and a room that advances without producing it silently loses the ability to read everything written before — for every member, including whoever wrote it. Its `epoch` MUST equal `epoch`, and a host MUST reject the request otherwise; a host MUST NOT replace a link it already holds for an epoch, because a second one is either a replay or a re-pointing of the room's history at key material of somebody else's choosing, and the members who already walked the original would never see the difference. Absent where the room does not keep its history readable, and necessarily absent for a room's first epoch, which has no predecessor.
24
24
  */
25
25
  link?: EpochLink;
26
+ /**
27
+ * The MLS commit that produced this epoch, base64url, for the host to relay to members who were not online to receive it.
28
+ *
29
+ * Carried **here** for the same reason `link` is: minting is the moment the committer holds it, and a separate publish task would be a second chance to forget. A room that advances without leaving the commit somewhere fetchable **forks** — every member who missed the delivery is left at an epoch the room has moved past, holding keys that open nothing new.
30
+ *
31
+ * **Opaque to the host, and that is why this is safe on every tier.** A commit is ciphertext plus a leaf index; it names nobody. That is the difference from a Welcome, which the host is deliberately kept off the path of because it names the party joining. A host relaying commits learns that the room moved, which it already knew from `epoch`.
32
+ *
33
+ * OPTIONAL, because a room whose members are all online when it commits needs no relay and a host that stores one is storing it for nobody. A host **MUST NOT** replace a commit it already holds for an epoch: the first one published is the one members may already have applied, and a second would fork the very group it was meant to keep together.
34
+ */
35
+ commit?: string;
26
36
  /**
27
37
  * Optional operator-facing rationale, recorded in the room's audit.
28
38
  */
@@ -95,6 +105,11 @@ export const PAYLOAD_SCHEMA = {
95
105
  "description": "The rung of the epoch key chain that this advance produces: the outgoing epoch's storage key sealed under the incoming one. Carried here because minting is the only moment at which one party holds both keys, and a room that advances without producing it silently loses the ability to read everything written before — for every member, including whoever wrote it. Its `epoch` MUST equal `epoch`, and a host MUST reject the request otherwise; a host MUST NOT replace a link it already holds for an epoch, because a second one is either a replay or a re-pointing of the room's history at key material of somebody else's choosing, and the members who already walked the original would never see the difference. Absent where the room does not keep its history readable, and necessarily absent for a room's first epoch, which has no predecessor.",
96
106
  "$comment": "Optional rather than required: this member was added to an already-published version, and requiring it would break every conforming producer. A room that omits it is making the choice the description names, not failing to make one."
97
107
  },
108
+ "commit": {
109
+ "type": "string",
110
+ "maxLength": 262144,
111
+ "description": "The MLS commit that produced this epoch, base64url, for the host to relay to members who were not online to receive it.\n\nCarried **here** for the same reason `link` is: minting is the moment the committer holds it, and a separate publish task would be a second chance to forget. A room that advances without leaving the commit somewhere fetchable **forks** — every member who missed the delivery is left at an epoch the room has moved past, holding keys that open nothing new.\n\n**Opaque to the host, and that is why this is safe on every tier.** A commit is ciphertext plus a leaf index; it names nobody. That is the difference from a Welcome, which the host is deliberately kept off the path of because it names the party joining. A host relaying commits learns that the room moved, which it already knew from `epoch`.\n\nOPTIONAL, because a room whose members are all online when it commits needs no relay and a host that stores one is storing it for nobody. A host **MUST NOT** replace a commit it already holds for an epoch: the first one published is the one members may already have applied, and a second would fork the very group it was meant to keep together."
112
+ },
98
113
  "reason": {
99
114
  "type": "string",
100
115
  "maxLength": 1024,