@hyperscale0/udl 1.0.0-beta.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/CHANGELOG.md +78 -25
  2. package/README.md +37 -99
  3. package/conformance/README.md +44 -41
  4. package/conformance/evolution/action-contract.expected.json +10 -0
  5. package/conformance/evolution/action-contract.live.udl +44 -0
  6. package/conformance/evolution/action-contract.next.udl +45 -0
  7. package/conformance/evolution/product-identity.expected.json +10 -0
  8. package/conformance/evolution/product-identity.live.udl +55 -0
  9. package/conformance/evolution/product-identity.next.udl +55 -0
  10. package/conformance/evolution/version-required.expected.json +10 -0
  11. package/conformance/evolution/version-required.live.udl +55 -0
  12. package/conformance/evolution/version-required.next.udl +58 -0
  13. package/conformance/invalid/action-without-transition.expected.json +10 -0
  14. package/conformance/invalid/{verb-without-transition.udl → action-without-transition.udl} +7 -2
  15. package/conformance/invalid/agent-description-too-long.expected.json +10 -0
  16. package/conformance/invalid/agent-description-too-long.udl +57 -0
  17. package/conformance/invalid/blank-title.expected.json +1 -1
  18. package/conformance/invalid/blank-title.udl +6 -2
  19. package/conformance/invalid/composition-dial-duplicate-key.expected.json +10 -0
  20. package/conformance/invalid/composition-dial-duplicate-key.udl +73 -0
  21. package/conformance/invalid/depth-budget.expected.json +1 -1
  22. package/conformance/invalid/duplicate-subject.expected.json +10 -0
  23. package/conformance/invalid/duplicate-subject.udl +230 -0
  24. package/conformance/invalid/forged-effects.expected.json +10 -0
  25. package/conformance/invalid/forged-effects.udl +76 -0
  26. package/conformance/invalid/format-version.expected.json +1 -1
  27. package/conformance/invalid/format-version.udl +6 -2
  28. package/conformance/invalid/instrument-id-not-snake-case.expected.json +10 -0
  29. package/conformance/invalid/{noun-id-not-snake-case.udl → instrument-id-not-snake-case.udl} +6 -2
  30. package/conformance/invalid/invalid-aggregate-gate-shape.expected.json +10 -0
  31. package/conformance/invalid/invalid-aggregate-gate-shape.udl +1819 -0
  32. package/conformance/invalid/invalid-check-duration.expected.json +10 -0
  33. package/conformance/invalid/invalid-check-duration.udl +219 -0
  34. package/conformance/invalid/invalid-dial-anchor.expected.json +10 -0
  35. package/conformance/invalid/invalid-dial-anchor.udl +219 -0
  36. package/conformance/invalid/invalid-exception-parent-ref.expected.json +10 -0
  37. package/conformance/invalid/invalid-exception-parent-ref.udl +2487 -0
  38. package/conformance/invalid/invalid-exposure-shape.expected.json +10 -0
  39. package/conformance/invalid/invalid-exposure-shape.udl +1819 -0
  40. package/conformance/invalid/invalid-remainder.expected.json +10 -0
  41. package/conformance/invalid/invalid-remainder.udl +220 -0
  42. package/conformance/invalid/invalid-schema-keyword.expected.json +10 -0
  43. package/conformance/invalid/invalid-schema-keyword.udl +220 -0
  44. package/conformance/invalid/invalid-utf8.expected.json +1 -1
  45. package/conformance/invalid/malformed-json.expected.json +1 -1
  46. package/conformance/invalid/missing-create-action.expected.json +10 -0
  47. package/conformance/invalid/{missing-create-verb.udl → missing-create-action.udl} +5 -2
  48. package/conformance/invalid/missing-exception-amount-field.expected.json +10 -0
  49. package/conformance/invalid/missing-exception-amount-field.udl +2487 -0
  50. package/conformance/invalid/missing-exception-contract.expected.json +14 -0
  51. package/conformance/invalid/missing-exception-contract.udl +2523 -0
  52. package/conformance/invalid/missing-exception-reason-field.expected.json +10 -0
  53. package/conformance/invalid/missing-exception-reason-field.udl +2487 -0
  54. package/conformance/invalid/not-an-object.expected.json +1 -1
  55. package/conformance/invalid/payout-reconcile-not-a-bank-debit.expected.json +10 -0
  56. package/conformance/invalid/payout-reconcile-not-a-bank-debit.udl +259 -0
  57. package/conformance/invalid/quote-freeze-set-incomplete.expected.json +10 -0
  58. package/conformance/invalid/quote-freeze-set-incomplete.udl +261 -0
  59. package/conformance/invalid/quote-named-reference-gate.expected.json +10 -0
  60. package/conformance/invalid/quote-named-reference-gate.udl +50 -0
  61. package/conformance/invalid/reconcile-named-reference-gate.expected.json +10 -0
  62. package/conformance/invalid/reconcile-named-reference-gate.udl +50 -0
  63. package/conformance/invalid/unknown-key.expected.json +1 -1
  64. package/conformance/invalid/unknown-key.udl +6 -2
  65. package/conformance/invalid/unknown-reference-gate-field.expected.json +10 -0
  66. package/conformance/invalid/unknown-reference-gate-field.udl +1819 -0
  67. package/conformance/invalid/unknown-required-field.expected.json +10 -0
  68. package/conformance/invalid/unknown-required-field.udl +220 -0
  69. package/conformance/invalid/unreachable-state.expected.json +2 -2
  70. package/conformance/invalid/unreachable-state.udl +6 -2
  71. package/conformance/invalid/wrong-exception-amount-field.expected.json +10 -0
  72. package/conformance/invalid/wrong-exception-amount-field.udl +2487 -0
  73. package/conformance/invalid/wrong-exception-reason-field.expected.json +10 -0
  74. package/conformance/invalid/wrong-exception-reason-field.udl +2487 -0
  75. package/conformance/valid/agent-description.expected.json +6 -0
  76. package/conformance/valid/agent-description.udl +66 -0
  77. package/conformance/valid/cards.expected.json +1 -0
  78. package/conformance/valid/cards.udl +843 -356
  79. package/conformance/valid/commerce-escrow.expected.json +1 -0
  80. package/conformance/valid/commerce-escrow.udl +792 -291
  81. package/conformance/valid/compiled-crowdfunding.expected.json +6 -0
  82. package/conformance/valid/compiled-crowdfunding.udl +1843 -0
  83. package/conformance/valid/compiled-watch-club.expected.json +6 -0
  84. package/conformance/valid/compiled-watch-club.udl +2486 -0
  85. package/conformance/valid/complete-contract.expected.json +6 -0
  86. package/conformance/valid/complete-contract.udl +218 -0
  87. package/conformance/valid/effect-signatures.expected.json +6 -0
  88. package/conformance/valid/effect-signatures.udl +75 -0
  89. package/conformance/valid/hand-edited.expected.json +1 -0
  90. package/conformance/valid/hand-edited.udl +1 -1
  91. package/conformance/valid/insured-car-marketplace.expected.json +1 -0
  92. package/conformance/valid/insured-car-marketplace.udl +534 -315
  93. package/conformance/valid/insured-travel.expected.json +2 -1
  94. package/conformance/valid/insured-travel.udl +1489 -641
  95. package/conformance/valid/minimal.expected.json +1 -0
  96. package/conformance/valid/minimal.udl +18 -14
  97. package/conformance/valid/protection.expected.json +1 -0
  98. package/conformance/valid/protection.udl +719 -304
  99. package/conformance/valid/string-escaping.expected.json +6 -0
  100. package/conformance/valid/string-escaping.udl +54 -0
  101. package/dist/canonical.d.ts +2 -0
  102. package/dist/canonical.d.ts.map +1 -1
  103. package/dist/canonical.js +7 -0
  104. package/dist/canonical.js.map +1 -1
  105. package/dist/check-profiles.d.ts +57 -0
  106. package/dist/check-profiles.d.ts.map +1 -0
  107. package/dist/check-profiles.js +62 -0
  108. package/dist/check-profiles.js.map +1 -0
  109. package/dist/cli.js +48 -4
  110. package/dist/cli.js.map +1 -1
  111. package/dist/diagnostics.d.ts +168 -0
  112. package/dist/diagnostics.d.ts.map +1 -0
  113. package/dist/diagnostics.js +164 -0
  114. package/dist/diagnostics.js.map +1 -0
  115. package/dist/effects.d.ts +41 -0
  116. package/dist/effects.d.ts.map +1 -0
  117. package/dist/effects.js +110 -0
  118. package/dist/effects.js.map +1 -0
  119. package/dist/evolution.d.ts +51 -18
  120. package/dist/evolution.d.ts.map +1 -1
  121. package/dist/evolution.js +244 -102
  122. package/dist/evolution.js.map +1 -1
  123. package/dist/finance.d.ts +17 -13
  124. package/dist/finance.d.ts.map +1 -1
  125. package/dist/finance.js +165 -109
  126. package/dist/finance.js.map +1 -1
  127. package/dist/index.d.ts +12 -8
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +8 -5
  130. package/dist/index.js.map +1 -1
  131. package/dist/limits.d.ts +2 -2
  132. package/dist/limits.d.ts.map +1 -1
  133. package/dist/limits.js +4 -3
  134. package/dist/limits.js.map +1 -1
  135. package/dist/parser.d.ts.map +1 -1
  136. package/dist/parser.js +6 -16
  137. package/dist/parser.js.map +1 -1
  138. package/dist/schema.d.ts +2059 -135
  139. package/dist/schema.d.ts.map +1 -1
  140. package/dist/schema.js +759 -73
  141. package/dist/schema.js.map +1 -1
  142. package/dist/validation.d.ts +22 -9
  143. package/dist/validation.d.ts.map +1 -1
  144. package/dist/validation.js +1463 -457
  145. package/dist/validation.js.map +1 -1
  146. package/docs/README.md +14 -0
  147. package/docs/guide/01-a-document.md +37 -0
  148. package/docs/guide/02-money-steps.md +23 -0
  149. package/docs/guide/03-laws.md +18 -0
  150. package/docs/guide/04-fees-and-remainder.md +15 -0
  151. package/docs/guide/05-checks-updates-dials.md +7 -0
  152. package/docs/guide/06-effects.md +11 -0
  153. package/docs/guide/07-evolution.md +11 -0
  154. package/docs/guide/08-implementing.md +13 -0
  155. package/docs/llms-full.txt +1241 -0
  156. package/docs/llms.txt +14 -0
  157. package/docs/reference/canonical.md +16 -0
  158. package/docs/reference/clauses.md +986 -0
  159. package/docs/reference/cli.md +22 -0
  160. package/docs/reference/diagnostics.md +32 -0
  161. package/package.json +6 -2
  162. package/skills/udl/SKILL.md +28 -0
  163. package/spec/README.md +82 -51
  164. package/spec/udl.schema.json +1191 -119
  165. package/src/canonical.ts +11 -0
  166. package/src/check-profiles.ts +80 -0
  167. package/src/cli.ts +49 -3
  168. package/src/diagnostics.ts +221 -0
  169. package/src/effects.ts +163 -0
  170. package/src/evolution.ts +375 -125
  171. package/src/finance.ts +255 -160
  172. package/src/index.ts +50 -14
  173. package/src/limits.ts +4 -3
  174. package/src/parser.ts +15 -18
  175. package/src/schema.ts +855 -81
  176. package/src/validation.ts +2666 -560
  177. package/conformance/invalid/missing-create-verb.expected.json +0 -10
  178. package/conformance/invalid/noun-id-not-snake-case.expected.json +0 -10
  179. package/conformance/invalid/verb-without-transition.expected.json +0 -10
@@ -0,0 +1,986 @@
1
+ <!-- Generated by scripts/docs/build.ts from @hyperscale0/udl 1.0.0. Edit the source, not clauses.md. -->
2
+
3
+ # Clause reference
4
+
5
+ This page lists every entry in `udlClauseVocabulary`. The examples are copied from admitted documents under `conformance/valid`.
6
+
7
+ ## agent description
8
+
9
+ - Scope: action
10
+ - UDL target: `agentDescription`
11
+ - Cardinality: one
12
+ - Linear outputs: none
13
+ - Effects: none
14
+ - Law: Requirements-as-data law and closure law
15
+ - Conformance source: `agent-description.udl`
16
+
17
+ ```json
18
+ "Close a note that has already been filed. Takes the note id and nothing else, and moves no money."
19
+ ```
20
+
21
+ ## capture input
22
+
23
+ - Scope: action
24
+ - UDL target: `captureInput`
25
+ - Cardinality: one
26
+ - Linear outputs: none
27
+ - Effects: none
28
+ - Law: Requirements-as-data law and closure law
29
+ - Conformance source: `compiled-crowdfunding.udl`
30
+
31
+ ```json
32
+ {
33
+ "snapshotEvidenceReference": "evidenceReference"
34
+ }
35
+ ```
36
+
37
+ ## commit
38
+
39
+ - Scope: action
40
+ - UDL target: `commit`
41
+ - Cardinality: one
42
+ - Linear outputs: none
43
+ - Effects: none
44
+ - Law: Requirements-as-data law and closure law
45
+ - Conformance source: `commerce-escrow.udl`
46
+
47
+ A commit has no separate effect row. The committing action consumes the quote through its `moves.*` row.
48
+
49
+ ```json
50
+ "quote"
51
+ ```
52
+
53
+ ## quote
54
+
55
+ - Scope: action
56
+ - UDL target: `quote`
57
+ - Cardinality: one
58
+ - Linear outputs: `netRef`
59
+ - Effects: holds.quote per clause; schedules.expiry per clause
60
+ - Law: Requirements-as-data law and closure law
61
+ - Conformance source: `commerce-escrow.udl`
62
+
63
+ ```json
64
+ {
65
+ "baseField": "amount",
66
+ "chargeRef": "unwindPenalty",
67
+ "charges": [
68
+ {
69
+ "bps": 0
70
+ }
71
+ ],
72
+ "expires": {
73
+ "offset": "PT15M"
74
+ },
75
+ "fixes": ["amount", "buyerAccountId"],
76
+ "netDestinationField": "buyerAccountId",
77
+ "netRef": "unwindRefund"
78
+ }
79
+ ```
80
+
81
+ ## decided amount
82
+
83
+ - Scope: action
84
+ - UDL target: `decidedAmount`
85
+ - Cardinality: one
86
+ - Linear outputs: `field`
87
+ - Effects: none
88
+ - Law: Requirements-as-data law and closure law
89
+ - Conformance source: `compiled-watch-club.udl`
90
+
91
+ ```json
92
+ {
93
+ "boundField": "depositAmount",
94
+ "field": "damageAmount",
95
+ "remainderAction": "return_deposit"
96
+ }
97
+ ```
98
+
99
+ ## deadline
100
+
101
+ - Scope: action
102
+ - UDL target: `deadline`
103
+ - Cardinality: one
104
+ - Linear outputs: none
105
+ - Effects: schedules.deadline per clause
106
+ - Law: Time law and closure law
107
+ - Conformance source: `compiled-watch-club.udl`
108
+
109
+ ```json
110
+ {
111
+ "field": "clawbackAt"
112
+ }
113
+ ```
114
+
115
+ ## decision
116
+
117
+ - Scope: action
118
+ - UDL target: `decision`
119
+ - Cardinality: one
120
+ - Linear outputs: none
121
+ - Effects: decides.value from capability per clause
122
+ - Law: Requirements-as-data law and closure law
123
+ - Conformance source: `cards.udl`
124
+
125
+ ```json
126
+ {
127
+ "capability": "banking_or_card_issuing",
128
+ "deadlineMs": 1500,
129
+ "onTimeout": "decline"
130
+ }
131
+ ```
132
+
133
+ ## computes distribute
134
+
135
+ - Scope: action
136
+ - UDL target: `distribute`
137
+ - Cardinality: one
138
+ - Linear outputs: `amountRef`
139
+ - Effects: none
140
+ - Law: Requirements-as-data law and closure law
141
+ - Conformance source: `compiled-crowdfunding.udl`
142
+
143
+ ```json
144
+ {
145
+ "amountRef": "payoutShare",
146
+ "onZero": "skip_steps",
147
+ "pool": {
148
+ "from": "parent",
149
+ "path": "fields.distributableAmount"
150
+ },
151
+ "refField": "repaymentDistributionId",
152
+ "statuses": ["recorded", "paid"],
153
+ "weightField": "committedWeight"
154
+ }
155
+ ```
156
+
157
+ ## description
158
+
159
+ - Scope: action
160
+ - UDL target: `description`
161
+ - Cardinality: one
162
+ - Linear outputs: none
163
+ - Effects: none
164
+ - Law: One-sentence law, uniform object law, and naming law
165
+ - Conformance source: `cards.udl`
166
+
167
+ ```json
168
+ "Approves the customer to hold and use cards."
169
+ ```
170
+
171
+ ## due
172
+
173
+ - Scope: action
174
+ - UDL target: `due`
175
+ - Cardinality: one
176
+ - Linear outputs: none
177
+ - Effects: schedules.due per clause
178
+ - Law: Time law and closure law
179
+ - Conformance source: `cards.udl`
180
+
181
+ ```json
182
+ {
183
+ "field": "expiresAt"
184
+ }
185
+ ```
186
+
187
+ ## earnable
188
+
189
+ - Scope: action
190
+ - UDL target: `earnable`
191
+ - Cardinality: one
192
+ - Linear outputs: none
193
+ - Effects: none
194
+ - Law: Requirements-as-data law and closure law
195
+ - Conformance source: `cards.udl`
196
+
197
+ ```json
198
+ true
199
+ ```
200
+
201
+ ## event name
202
+
203
+ - Scope: action
204
+ - UDL target: `eventName`
205
+ - Cardinality: one
206
+ - Linear outputs: none
207
+ - Effects: none
208
+ - Law: Event law and naming law
209
+ - Conformance source: `cards.udl`
210
+
211
+ ```json
212
+ "card.issued"
213
+ ```
214
+
215
+ ## examples
216
+
217
+ - Scope: action
218
+ - UDL target: `examples`
219
+ - Cardinality: many
220
+ - Linear outputs: none
221
+ - Effects: none
222
+ - Law: Requirements-as-data law and closure law
223
+ - Conformance source: `cards.udl`
224
+
225
+ ```json
226
+ [
227
+ {
228
+ "input": {
229
+ "cardholderId": "chd_sandbox_customer0001",
230
+ "tenantId": "ten_sandbox_cards000001"
231
+ },
232
+ "name": "activate_approved_cardholder"
233
+ }
234
+ ]
235
+ ```
236
+
237
+ ## input
238
+
239
+ - Scope: action
240
+ - UDL target: `input`
241
+ - Cardinality: one
242
+ - Linear outputs: none
243
+ - Effects: none
244
+ - Law: Requirements-as-data law and closure law
245
+ - Conformance source: `cards.udl`
246
+
247
+ ```json
248
+ {
249
+ "additionalProperties": false,
250
+ "properties": {
251
+ "reason": {
252
+ "maxLength": 180,
253
+ "minLength": 1,
254
+ "type": "string"
255
+ }
256
+ },
257
+ "required": ["reason"],
258
+ "type": "object"
259
+ }
260
+ ```
261
+
262
+ ## moves
263
+
264
+ - Scope: action
265
+ - UDL target: `moves`
266
+ - Cardinality: many
267
+ - Linear outputs: none
268
+ - Effects: moves.movement class per element; holds.reserve per element
269
+ - Law: One-spine law and closure law
270
+ - Conformance source: `agent-description.udl`
271
+
272
+ ```json
273
+ []
274
+ ```
275
+
276
+ ## payout
277
+
278
+ - Scope: action
279
+ - UDL target: `payout`
280
+ - Cardinality: one
281
+ - Linear outputs: none
282
+ - Effects: moves.payout.external per clause
283
+ - Law: One-spine law and closure law
284
+ - Conformance source: `compiled-watch-club.udl`
285
+
286
+ ```json
287
+ {
288
+ "amount": "refs.netPayable",
289
+ "beneficiaryField": "payoutBeneficiaryId",
290
+ "beneficiaryPartyField": "payoutDestinationAccountId",
291
+ "capture": "payoutId",
292
+ "currencyField": "currency",
293
+ "sourceAccountField": "clubAccountId",
294
+ "speed": "standard"
295
+ }
296
+ ```
297
+
298
+ ## port
299
+
300
+ - Scope: action
301
+ - UDL target: `port`
302
+ - Cardinality: one
303
+ - Linear outputs: none
304
+ - Effects: decides.tenant_port per clause
305
+ - Law: Requirements-as-data law and closure law
306
+ - Conformance source: `compiled-crowdfunding.udl`
307
+
308
+ ```json
309
+ {
310
+ "allowedParties": ["beneficiary"]
311
+ }
312
+ ```
313
+
314
+ ## principal
315
+
316
+ - Scope: action
317
+ - UDL target: `principal`
318
+ - Cardinality: one
319
+ - Linear outputs: none
320
+ - Effects: none
321
+ - Law: Requirements-as-data law and closure law
322
+ - Conformance source: `complete-contract.udl`
323
+
324
+ ```json
325
+ "user_session"
326
+ ```
327
+
328
+ ## public action
329
+
330
+ - Scope: action
331
+ - UDL target: `publicAction`
332
+ - Cardinality: one
333
+ - Linear outputs: none
334
+ - Effects: none
335
+ - Law: Event law and naming law
336
+ - Conformance source: `compiled-crowdfunding.udl`
337
+
338
+ ```json
339
+ "abandonLenderCommitment"
340
+ ```
341
+
342
+ ## reconcile
343
+
344
+ - Scope: action
345
+ - UDL target: `reconcile`
346
+ - Cardinality: many
347
+ - Linear outputs: none
348
+ - Effects: reads.reconcile per element
349
+ - Law: Requirements-as-data law and closure law
350
+ - Conformance source: `compiled-watch-club.udl`
351
+
352
+ `exception.amountField` must name a required money field on the exception child. `exception.reasonField` must name a required text field on that child. UDL evolution supplies no default for either name.
353
+
354
+ ```json
355
+ [
356
+ {
357
+ "amount": "refs.netPayable",
358
+ "capture": "settlementEvidenceId",
359
+ "counterpartyRef": "payoutId",
360
+ "currencyField": "currency",
361
+ "direction": "debit",
362
+ "evidence": "statement_line",
363
+ "exception": {
364
+ "amountField": "amount",
365
+ "childInstrumentId": "seller_payout_debit_adjustment",
366
+ "maxOpen": 1,
367
+ "reasonField": "adjustmentReference",
368
+ "refField": "sellerPayoutId"
369
+ },
370
+ "match": {
371
+ "law": "exact"
372
+ },
373
+ "within": {
374
+ "offset": "P30D"
375
+ }
376
+ }
377
+ ]
378
+ ```
379
+
380
+ ## computes remainder
381
+
382
+ - Scope: action
383
+ - UDL target: `remainder`
384
+ - Cardinality: one
385
+ - Linear outputs: `amountRef`
386
+ - Effects: none
387
+ - Law: Requirements-as-data law and closure law
388
+ - Conformance source: `complete-contract.udl`
389
+
390
+ ```json
391
+ {
392
+ "amountRef": "remainingAmount",
393
+ "onZero": "refuse",
394
+ "totalPath": "fields.amount"
395
+ }
396
+ ```
397
+
398
+ ## requires aggregate
399
+
400
+ - Scope: action
401
+ - UDL target: `requiresAggregate`
402
+ - Cardinality: many
403
+ - Linear outputs: none
404
+ - Effects: reads.requires_aggregate per clause
405
+ - Law: Requirements-as-data law and closure law
406
+ - Conformance source: `compiled-crowdfunding.udl`
407
+
408
+ ```json
409
+ [
410
+ {
411
+ "check": {
412
+ "amountField": "amount",
413
+ "kind": "sum_exactly",
414
+ "targetField": "installment1Amount"
415
+ },
416
+ "instrumentId": "borrower_loan_installment_1_payment",
417
+ "over": "children",
418
+ "refField": "borrowerLoanId",
419
+ "statuses": ["paid"]
420
+ }
421
+ ]
422
+ ```
423
+
424
+ ## requires checks
425
+
426
+ - Scope: action
427
+ - UDL target: `requiresChecks`
428
+ - Cardinality: many
429
+ - Linear outputs: none
430
+ - Effects: reads.requires_checks per clause
431
+ - Law: Requirements-as-data law and closure law
432
+ - Conformance source: `complete-contract.udl`
433
+
434
+ ```json
435
+ [
436
+ {
437
+ "checkKind": "identity_verification",
438
+ "family": "national_identity",
439
+ "maxAge": "P30D",
440
+ "statuses": ["completed"],
441
+ "subjectField": "subjectId"
442
+ }
443
+ ]
444
+ ```
445
+
446
+ ## requires drained
447
+
448
+ - Scope: action
449
+ - UDL target: `requiresDrainedAccount`
450
+ - Cardinality: one
451
+ - Linear outputs: none
452
+ - Effects: none
453
+ - Law: Requirements-as-data law and closure law
454
+ - Conformance source: `commerce-escrow.udl`
455
+
456
+ ```json
457
+ {
458
+ "path": "refs.escrowAccountId"
459
+ }
460
+ ```
461
+
462
+ ## requires exposure
463
+
464
+ - Scope: action
465
+ - UDL target: `requiresExposure`
466
+ - Cardinality: many
467
+ - Linear outputs: none
468
+ - Effects: none
469
+ - Law: Requirements-as-data law and closure law
470
+ - Conformance source: `compiled-crowdfunding.udl`
471
+
472
+ ```json
473
+ [
474
+ {
475
+ "amountField": "amount",
476
+ "anchorField": "borrowerLoanId",
477
+ "capField": "installment1Amount",
478
+ "capOnAnchor": true,
479
+ "childInstrumentId": "borrower_loan_installment_1_payment",
480
+ "statuses": ["paid"]
481
+ }
482
+ ]
483
+ ```
484
+
485
+ ## requires refs
486
+
487
+ - Scope: action
488
+ - UDL target: `requiresRefs`
489
+ - Cardinality: many
490
+ - Linear outputs: none
491
+ - Effects: reads.requires_refs per clause
492
+ - Law: Requirements-as-data law and closure law
493
+ - Conformance source: `cards.udl`
494
+
495
+ ```json
496
+ [
497
+ {
498
+ "field": "cardholderId",
499
+ "statuses": ["active"]
500
+ }
501
+ ]
502
+ ```
503
+
504
+ ## sandbox failure point
505
+
506
+ - Scope: action
507
+ - UDL target: `sandboxFailurePoint`
508
+ - Cardinality: one
509
+ - Linear outputs: none
510
+ - Effects: none
511
+ - Law: Requirements-as-data law and closure law
512
+ - Conformance source: `commerce-escrow.udl`
513
+
514
+ ```json
515
+ "funding"
516
+ ```
517
+
518
+ ## sets at
519
+
520
+ - Scope: action
521
+ - UDL target: `setsAt`
522
+ - Cardinality: one
523
+ - Linear outputs: none
524
+ - Effects: none
525
+ - Law: Time law and closure law
526
+ - Conformance source: `compiled-crowdfunding.udl`
527
+
528
+ ```json
529
+ {
530
+ "field": "installment1DelinquentAfter",
531
+ "marker": true,
532
+ "offset": "PT1S"
533
+ }
534
+ ```
535
+
536
+ ## computes signed_sum
537
+
538
+ - Scope: action
539
+ - UDL target: `signedSum`
540
+ - Cardinality: one
541
+ - Linear outputs: `amountRef`
542
+ - Effects: none
543
+ - Law: Requirements-as-data law and closure law
544
+ - Conformance source: `compiled-watch-club.udl`
545
+
546
+ ```json
547
+ {
548
+ "amountRef": "netPayable",
549
+ "onNegative": "refuse",
550
+ "onZero": "refuse",
551
+ "sources": [
552
+ {
553
+ "amountField": "amount",
554
+ "instrumentId": "seller_payout_capture_entry",
555
+ "refField": "sellerPayoutId",
556
+ "sign": "add",
557
+ "statuses": ["accrued"],
558
+ "subtotalRef": "grossCaptureAmount"
559
+ },
560
+ {
561
+ "amountField": "amount",
562
+ "instrumentId": "seller_payout_credit_adjustment",
563
+ "refField": "sellerPayoutId",
564
+ "sign": "add",
565
+ "statuses": ["applied"],
566
+ "subtotalRef": "creditAdjustmentAmount"
567
+ },
568
+ {
569
+ "amountField": "amount",
570
+ "instrumentId": "seller_payout_debit_adjustment",
571
+ "refField": "sellerPayoutId",
572
+ "sign": "subtract",
573
+ "statuses": ["applied"],
574
+ "subtotalRef": "debitAdjustmentAmount"
575
+ }
576
+ ]
577
+ }
578
+ ```
579
+
580
+ ## steps
581
+
582
+ - Scope: action
583
+ - UDL target: `steps`
584
+ - Cardinality: many
585
+ - Linear outputs: none
586
+ - Effects: none
587
+ - Law: One-spine law and closure law
588
+ - Conformance source: `agent-description.udl`
589
+
590
+ ```json
591
+ []
592
+ ```
593
+
594
+ ## summary
595
+
596
+ - Scope: action
597
+ - UDL target: `summary`
598
+ - Cardinality: one
599
+ - Linear outputs: none
600
+ - Effects: none
601
+ - Law: One-sentence law, uniform object law, and naming law
602
+ - Conformance source: `agent-description.udl`
603
+
604
+ ```json
605
+ "Close the note."
606
+ ```
607
+
608
+ ## updates
609
+
610
+ - Scope: action
611
+ - UDL target: `updates`
612
+ - Cardinality: many
613
+ - Linear outputs: none
614
+ - Effects: none
615
+ - Law: Requirements-as-data law and closure law
616
+ - Conformance source: `commerce-escrow.udl`
617
+
618
+ ```json
619
+ ["escrowOrderId"]
620
+ ```
621
+
622
+ ## notify
623
+
624
+ - Scope: action
625
+ - UDL target: `effects.notifies`
626
+ - Cardinality: many
627
+ - Linear outputs: none
628
+ - Effects: notifies.value from channel per element
629
+ - Law: Requirements-as-data law and closure law
630
+ - Conformance source: `effect-signatures.udl`
631
+
632
+ ```json
633
+ [
634
+ {
635
+ "channel": "email",
636
+ "role": "beneficiary",
637
+ "signature": "notifies.email",
638
+ "source": "effects.notifies[0]"
639
+ }
640
+ ]
641
+ ```
642
+
643
+ ## agent description
644
+
645
+ - Scope: instrument
646
+ - UDL target: `agentDescription`
647
+ - Cardinality: one
648
+ - Linear outputs: none
649
+ - Effects: none
650
+ - Law: Requirements-as-data law and closure law
651
+ - Conformance source: `agent-description.udl`
652
+
653
+ ```json
654
+ "Close a note that has already been filed. Takes the note id and nothing else, and moves no money."
655
+ ```
656
+
657
+ ## aggregate invariants
658
+
659
+ - Scope: instrument
660
+ - UDL target: `aggregateInvariants`
661
+ - Cardinality: many
662
+ - Linear outputs: none
663
+ - Effects: none
664
+ - Law: Closure law
665
+ - Conformance source: `compiled-crowdfunding.udl`
666
+
667
+ ```json
668
+ [
669
+ {
670
+ "childField": "amount",
671
+ "childInstrumentId": "borrower_loan_installment_1_payment",
672
+ "childRefField": "borrowerLoanId",
673
+ "childStatuses": ["paid"],
674
+ "parentField": "installment1Amount"
675
+ },
676
+ {
677
+ "childField": "amount",
678
+ "childInstrumentId": "borrower_loan_installment_2_payment",
679
+ "childRefField": "borrowerLoanId",
680
+ "childStatuses": ["paid"],
681
+ "parentField": "installment2Amount"
682
+ }
683
+ ]
684
+ ```
685
+
686
+ ## caller parked states
687
+
688
+ - Scope: instrument
689
+ - UDL target: `callerParkedStates`
690
+ - Cardinality: one
691
+ - Linear outputs: none
692
+ - Effects: none
693
+ - Law: Time law and closure law
694
+ - Conformance source: `cards.udl`
695
+
696
+ ```json
697
+ {
698
+ "active": "a cardholder in good standing stays active until the issuer or holder acts",
699
+ "pending": "activation follows the issuer's verification outcome",
700
+ "suspended": "reinstatement or closure is an issuer decision"
701
+ }
702
+ ```
703
+
704
+ ## description
705
+
706
+ - Scope: instrument
707
+ - UDL target: `description`
708
+ - Cardinality: one
709
+ - Linear outputs: none
710
+ - Effects: none
711
+ - Law: One-sentence law, uniform object law, and naming law
712
+ - Conformance source: `cards.udl`
713
+
714
+ ```json
715
+ "Approves the customer to hold and use cards."
716
+ ```
717
+
718
+ ## dials
719
+
720
+ - Scope: instrument
721
+ - UDL target: `dials`
722
+ - Cardinality: many
723
+ - Linear outputs: none
724
+ - Effects: none
725
+ - Law: Requirements-as-data law and closure law
726
+ - Conformance source: `cards.udl`
727
+
728
+ ```json
729
+ [
730
+ {
731
+ "field": "expiresAt",
732
+ "key": "authorization_window",
733
+ "kind": "window",
734
+ "maxOffset": "P30D",
735
+ "summary": "Grace beyond the authorization expiry timestamp before an uncaptured hold expires.",
736
+ "title": "Authorization window"
737
+ },
738
+ {
739
+ "action": "approve",
740
+ "key": "policy_decision_deadline_ms",
741
+ "kind": "decision_deadline_ms",
742
+ "maxMs": 5000,
743
+ "minMs": 500,
744
+ "summary": "How long approve waits for the card policy's just-in-time decision before the timeout default declines.",
745
+ "title": "Policy decision deadline"
746
+ }
747
+ ]
748
+ ```
749
+
750
+ ## distinct parties
751
+
752
+ - Scope: instrument
753
+ - UDL target: `distinctParties`
754
+ - Cardinality: one
755
+ - Linear outputs: none
756
+ - Effects: none
757
+ - Law: Closure law
758
+ - Conformance source: `compiled-watch-club.udl`
759
+
760
+ ```json
761
+ true
762
+ ```
763
+
764
+ ## computes derived
765
+
766
+ - Scope: instrument
767
+ - UDL target: `derivedAmounts`
768
+ - Cardinality: many
769
+ - Linear outputs: none
770
+ - Effects: none
771
+ - Law: One-spine law and closure law
772
+ - Conformance source: `compiled-crowdfunding.udl`
773
+
774
+ ```json
775
+ [
776
+ {
777
+ "field": "platformFee",
778
+ "rounding": "floor",
779
+ "rule": {
780
+ "bps": 200,
781
+ "kind": "percentage_of"
782
+ },
783
+ "sourceField": "principalAmount"
784
+ }
785
+ ]
786
+ ```
787
+
788
+ ## computes fees
789
+
790
+ - Scope: instrument
791
+ - UDL target: `feeRules`
792
+ - Cardinality: many
793
+ - Linear outputs: none
794
+ - Effects: none
795
+ - Law: One-spine law and closure law
796
+ - Conformance source: `compiled-watch-club.udl`
797
+
798
+ ```json
799
+ [
800
+ {
801
+ "amountField": "checkoutFee",
802
+ "baseField": "purchasePrice",
803
+ "bearerField": "memberAccountId",
804
+ "position": "on_top",
805
+ "rule": {
806
+ "currencyField": "currency",
807
+ "field": "checkoutFee",
808
+ "kind": "exact"
809
+ }
810
+ },
811
+ {
812
+ "amountField": "carvedFeeAmount",
813
+ "baseField": "purchasePrice",
814
+ "bearerField": "sellerAccountId",
815
+ "position": "carved",
816
+ "rule": {
817
+ "kind": "tiered",
818
+ "tiers": [
819
+ {
820
+ "fromInclusive": "0",
821
+ "rule": {
822
+ "bps": 100,
823
+ "kind": "bps"
824
+ },
825
+ "toExclusive": "10000"
826
+ },
827
+ {
828
+ "fromInclusive": "10000",
829
+ "rule": {
830
+ "currencyField": "currency",
831
+ "field": "highValueFee",
832
+ "kind": "exact"
833
+ }
834
+ }
835
+ ]
836
+ }
837
+ }
838
+ ]
839
+ ```
840
+
841
+ ## id prefix
842
+
843
+ - Scope: instrument
844
+ - UDL target: `idPrefix`
845
+ - Cardinality: one
846
+ - Linear outputs: none
847
+ - Effects: none
848
+ - Law: One-sentence law, uniform object law, and naming law
849
+ - Conformance source: `agent-description.udl`
850
+
851
+ ```json
852
+ "note"
853
+ ```
854
+
855
+ ## nav
856
+
857
+ - Scope: instrument
858
+ - UDL target: `nav`
859
+ - Cardinality: many
860
+ - Linear outputs: none
861
+ - Effects: none
862
+ - Law: One-sentence law, uniform object law, and naming law
863
+ - Conformance source: `cards.udl`
864
+
865
+ ```json
866
+ ["Blueprints", "Cardholders"]
867
+ ```
868
+
869
+ ## partitions
870
+
871
+ - Scope: instrument
872
+ - UDL target: `partitions`
873
+ - Cardinality: many
874
+ - Linear outputs: none
875
+ - Effects: none
876
+ - Law: One-spine law and closure law
877
+ - Conformance source: `compiled-crowdfunding.udl`
878
+
879
+ ```json
880
+ [
881
+ {
882
+ "pieceFields": ["installment1Amount", "installment2Amount"],
883
+ "totalField": "principalAmount"
884
+ }
885
+ ]
886
+ ```
887
+
888
+ ## subject
889
+
890
+ - Scope: instrument
891
+ - UDL target: `subject`
892
+ - Cardinality: one
893
+ - Linear outputs: none
894
+ - Effects: none
895
+ - Law: Closure law
896
+ - Conformance source: `commerce-escrow.udl`
897
+
898
+ ```json
899
+ {
900
+ "kinds": ["vehicle", "merchandise"]
901
+ }
902
+ ```
903
+
904
+ ## summary
905
+
906
+ - Scope: instrument
907
+ - UDL target: `summary`
908
+ - Cardinality: one
909
+ - Linear outputs: none
910
+ - Effects: none
911
+ - Law: One-sentence law, uniform object law, and naming law
912
+ - Conformance source: `agent-description.udl`
913
+
914
+ ```json
915
+ "Close the note."
916
+ ```
917
+
918
+ ## surface visibility
919
+
920
+ - Scope: instrument
921
+ - UDL target: `surfaceVisibility`
922
+ - Cardinality: one
923
+ - Linear outputs: none
924
+ - Effects: none
925
+ - Law: One-sentence law, uniform object law, and naming law
926
+ - Conformance source: `complete-contract.udl`
927
+
928
+ ```json
929
+ "public"
930
+ ```
931
+
932
+ ## template id
933
+
934
+ - Scope: instrument
935
+ - UDL target: `templateId`
936
+ - Cardinality: one
937
+ - Linear outputs: none
938
+ - Effects: none
939
+ - Law: One-sentence law, uniform object law, and naming law
940
+ - Conformance source: `cards.udl`
941
+
942
+ ```json
943
+ "wallet_cards"
944
+ ```
945
+
946
+ ## title
947
+
948
+ - Scope: instrument
949
+ - UDL target: `title`
950
+ - Cardinality: one
951
+ - Linear outputs: none
952
+ - Effects: none
953
+ - Law: One-sentence law, uniform object law, and naming law
954
+ - Conformance source: `agent-description.udl`
955
+
956
+ ```json
957
+ "Note"
958
+ ```
959
+
960
+ ## update
961
+
962
+ - Scope: instrument
963
+ - UDL target: `update`
964
+ - Cardinality: one
965
+ - Linear outputs: none
966
+ - Effects: none
967
+ - Law: Closure law
968
+ - Conformance source: `cards.udl`
969
+
970
+ ```json
971
+ {
972
+ "examples": [
973
+ {
974
+ "input": {
975
+ "cardholderId": "chd_sandbox_customer0001",
976
+ "displayName": "Noura Al Saud",
977
+ "email": "noura@example.test",
978
+ "tenantId": "ten_sandbox_cards000001"
979
+ },
980
+ "name": "update_cardholder_contact"
981
+ }
982
+ ],
983
+ "fields": ["displayName", "email", "phoneNumber"],
984
+ "states": ["pending", "active", "suspended"]
985
+ }
986
+ ```