@hyperscale0/udl 2.6.1 → 3.0.1

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 (213) hide show
  1. package/CHANGELOG.md +4 -328
  2. package/LICENSING.md +1 -2
  3. package/README.md +3 -114
  4. package/TRADEMARKS.md +2 -2
  5. package/dist/diagnostics.d.ts +21 -201
  6. package/dist/diagnostics.d.ts.map +1 -1
  7. package/dist/diagnostics.js +29 -193
  8. package/dist/diagnostics.js.map +1 -1
  9. package/dist/evolution.d.ts +3 -132
  10. package/dist/evolution.d.ts.map +1 -1
  11. package/dist/evolution.js +29 -633
  12. package/dist/evolution.js.map +1 -1
  13. package/dist/finance.d.ts +5 -72
  14. package/dist/finance.d.ts.map +1 -1
  15. package/dist/finance.js +233 -737
  16. package/dist/finance.js.map +1 -1
  17. package/dist/index.d.ts +7 -18
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +7 -12
  20. package/dist/index.js.map +1 -1
  21. package/dist/instrument-references.d.ts.map +1 -1
  22. package/dist/instrument-references.js +3 -2
  23. package/dist/instrument-references.js.map +1 -1
  24. package/dist/schema.d.ts +2079 -4564
  25. package/dist/schema.d.ts.map +1 -1
  26. package/dist/schema.js +270 -1609
  27. package/dist/schema.js.map +1 -1
  28. package/dist/validation.d.ts +8 -104
  29. package/dist/validation.d.ts.map +1 -1
  30. package/dist/validation.js +653 -3271
  31. package/dist/validation.js.map +1 -1
  32. package/docs/README.md +148 -14
  33. package/package.json +7 -11
  34. package/spec/README.md +152 -164
  35. package/spec/darb.udl.json +249 -0
  36. package/spec/udl.schema.json +4104 -3202
  37. package/src/diagnostics.ts +51 -246
  38. package/src/evolution.ts +39 -1045
  39. package/src/finance.ts +287 -1127
  40. package/src/index.ts +18 -142
  41. package/src/instrument-references.ts +3 -2
  42. package/src/schema.ts +285 -1843
  43. package/src/validation.ts +870 -5611
  44. package/conformance/README.md +0 -82
  45. package/conformance/evolution/action-contract.expected.json +0 -10
  46. package/conformance/evolution/action-contract.live.udl +0 -44
  47. package/conformance/evolution/action-contract.next.udl +0 -45
  48. package/conformance/evolution/product-identity.expected.json +0 -10
  49. package/conformance/evolution/product-identity.live.udl +0 -55
  50. package/conformance/evolution/product-identity.next.udl +0 -55
  51. package/conformance/evolution/version-required.expected.json +0 -10
  52. package/conformance/evolution/version-required.live.udl +0 -55
  53. package/conformance/evolution/version-required.next.udl +0 -58
  54. package/conformance/invalid/action-without-transition.expected.json +0 -10
  55. package/conformance/invalid/action-without-transition.udl +0 -60
  56. package/conformance/invalid/agent-description-too-long.expected.json +0 -10
  57. package/conformance/invalid/agent-description-too-long.udl +0 -57
  58. package/conformance/invalid/blank-title.expected.json +0 -10
  59. package/conformance/invalid/blank-title.udl +0 -54
  60. package/conformance/invalid/call-binds-results.expected.json +0 -10
  61. package/conformance/invalid/call-binds-results.udl +0 -314
  62. package/conformance/invalid/call-unknown-action.expected.json +0 -10
  63. package/conformance/invalid/call-unknown-action.udl +0 -314
  64. package/conformance/invalid/composition-dial-duplicate-key.expected.json +0 -10
  65. package/conformance/invalid/composition-dial-duplicate-key.udl +0 -73
  66. package/conformance/invalid/depth-budget.expected.json +0 -10
  67. package/conformance/invalid/depth-budget.udl +0 -49
  68. package/conformance/invalid/duplicate-subject.expected.json +0 -10
  69. package/conformance/invalid/duplicate-subject.udl +0 -230
  70. package/conformance/invalid/forged-effects.expected.json +0 -10
  71. package/conformance/invalid/forged-effects.udl +0 -76
  72. package/conformance/invalid/format-version.expected.json +0 -10
  73. package/conformance/invalid/format-version.udl +0 -54
  74. package/conformance/invalid/instrument-id-not-snake-case.expected.json +0 -10
  75. package/conformance/invalid/instrument-id-not-snake-case.udl +0 -54
  76. package/conformance/invalid/invalid-aggregate-gate-shape.expected.json +0 -10
  77. package/conformance/invalid/invalid-aggregate-gate-shape.udl +0 -1819
  78. package/conformance/invalid/invalid-check-duration.expected.json +0 -10
  79. package/conformance/invalid/invalid-check-duration.udl +0 -219
  80. package/conformance/invalid/invalid-dial-anchor.expected.json +0 -10
  81. package/conformance/invalid/invalid-dial-anchor.udl +0 -219
  82. package/conformance/invalid/invalid-exception-parent-ref.expected.json +0 -10
  83. package/conformance/invalid/invalid-exception-parent-ref.udl +0 -2487
  84. package/conformance/invalid/invalid-exposure-shape.expected.json +0 -10
  85. package/conformance/invalid/invalid-exposure-shape.udl +0 -1819
  86. package/conformance/invalid/invalid-journeys.expected.json +0 -10
  87. package/conformance/invalid/invalid-journeys.udl +0 -77
  88. package/conformance/invalid/invalid-remainder.expected.json +0 -10
  89. package/conformance/invalid/invalid-remainder.udl +0 -220
  90. package/conformance/invalid/invalid-schema-keyword.expected.json +0 -10
  91. package/conformance/invalid/invalid-schema-keyword.udl +0 -220
  92. package/conformance/invalid/invalid-utf8.expected.json +0 -10
  93. package/conformance/invalid/invalid-utf8.udl +0 -1
  94. package/conformance/invalid/leaf-effect-mismatch.expected.json +0 -10
  95. package/conformance/invalid/leaf-effect-mismatch.udl +0 -314
  96. package/conformance/invalid/malformed-json.expected.json +0 -10
  97. package/conformance/invalid/malformed-json.udl +0 -1
  98. package/conformance/invalid/missing-create-action.expected.json +0 -10
  99. package/conformance/invalid/missing-create-action.udl +0 -48
  100. package/conformance/invalid/missing-exception-amount-field.expected.json +0 -10
  101. package/conformance/invalid/missing-exception-amount-field.udl +0 -2487
  102. package/conformance/invalid/missing-exception-contract.expected.json +0 -14
  103. package/conformance/invalid/missing-exception-contract.udl +0 -2523
  104. package/conformance/invalid/missing-exception-reason-field.expected.json +0 -10
  105. package/conformance/invalid/missing-exception-reason-field.udl +0 -2487
  106. package/conformance/invalid/not-an-object.expected.json +0 -10
  107. package/conformance/invalid/not-an-object.udl +0 -1
  108. package/conformance/invalid/payout-reconcile-not-a-bank-debit.expected.json +0 -10
  109. package/conformance/invalid/payout-reconcile-not-a-bank-debit.udl +0 -259
  110. package/conformance/invalid/piece-plan-without-partition.expected.json +0 -10
  111. package/conformance/invalid/piece-plan-without-partition.udl +0 -305
  112. package/conformance/invalid/private-action-independent-approval.expected.json +0 -10
  113. package/conformance/invalid/private-action-independent-approval.udl +0 -314
  114. package/conformance/invalid/quote-freeze-set-incomplete.expected.json +0 -10
  115. package/conformance/invalid/quote-freeze-set-incomplete.udl +0 -261
  116. package/conformance/invalid/quote-named-reference-gate.expected.json +0 -10
  117. package/conformance/invalid/quote-named-reference-gate.udl +0 -50
  118. package/conformance/invalid/reconcile-named-reference-gate.expected.json +0 -10
  119. package/conformance/invalid/reconcile-named-reference-gate.udl +0 -50
  120. package/conformance/invalid/unfund-order-not-reversed.expected.json +0 -10
  121. package/conformance/invalid/unfund-order-not-reversed.udl +0 -314
  122. package/conformance/invalid/unknown-key.expected.json +0 -10
  123. package/conformance/invalid/unknown-key.udl +0 -55
  124. package/conformance/invalid/unknown-reference-gate-field.expected.json +0 -10
  125. package/conformance/invalid/unknown-reference-gate-field.udl +0 -1819
  126. package/conformance/invalid/unknown-required-field.expected.json +0 -10
  127. package/conformance/invalid/unknown-required-field.udl +0 -220
  128. package/conformance/invalid/unreachable-state.expected.json +0 -10
  129. package/conformance/invalid/unreachable-state.udl +0 -55
  130. package/conformance/invalid/wrong-exception-amount-field.expected.json +0 -10
  131. package/conformance/invalid/wrong-exception-amount-field.udl +0 -2487
  132. package/conformance/invalid/wrong-exception-reason-field.expected.json +0 -10
  133. package/conformance/invalid/wrong-exception-reason-field.udl +0 -2487
  134. package/conformance/valid/agent-description.expected.json +0 -6
  135. package/conformance/valid/agent-description.udl +0 -66
  136. package/conformance/valid/attested.expected.json +0 -6
  137. package/conformance/valid/attested.udl +0 -251
  138. package/conformance/valid/cards.expected.json +0 -6
  139. package/conformance/valid/cards.udl +0 -1579
  140. package/conformance/valid/commerce-escrow.expected.json +0 -6
  141. package/conformance/valid/commerce-escrow.udl +0 -1512
  142. package/conformance/valid/compiled-crowdfunding.expected.json +0 -6
  143. package/conformance/valid/compiled-crowdfunding.udl +0 -1843
  144. package/conformance/valid/compiled-watch-club.expected.json +0 -6
  145. package/conformance/valid/compiled-watch-club.udl +0 -2486
  146. package/conformance/valid/complete-contract.expected.json +0 -6
  147. package/conformance/valid/complete-contract.udl +0 -218
  148. package/conformance/valid/effect-signatures.expected.json +0 -6
  149. package/conformance/valid/effect-signatures.udl +0 -75
  150. package/conformance/valid/hand-edited.expected.json +0 -6
  151. package/conformance/valid/hand-edited.udl +0 -1
  152. package/conformance/valid/insured-car-marketplace.expected.json +0 -6
  153. package/conformance/valid/insured-car-marketplace.udl +0 -1050
  154. package/conformance/valid/insured-travel.expected.json +0 -6
  155. package/conformance/valid/insured-travel.udl +0 -3469
  156. package/conformance/valid/minimal.expected.json +0 -6
  157. package/conformance/valid/minimal.udl +0 -62
  158. package/conformance/valid/piece-plan-calls.expected.json +0 -6
  159. package/conformance/valid/piece-plan-calls.udl +0 -314
  160. package/conformance/valid/protection.expected.json +0 -6
  161. package/conformance/valid/protection.udl +0 -1551
  162. package/conformance/valid/string-escaping.expected.json +0 -6
  163. package/conformance/valid/string-escaping.udl +0 -54
  164. package/conformance/valid/vocabulary.expected.json +0 -6
  165. package/conformance/valid/vocabulary.udl +0 -2012
  166. package/dist/allocation.d.ts +0 -60
  167. package/dist/allocation.d.ts.map +0 -1
  168. package/dist/allocation.js +0 -177
  169. package/dist/allocation.js.map +0 -1
  170. package/dist/check-profiles.d.ts +0 -57
  171. package/dist/check-profiles.d.ts.map +0 -1
  172. package/dist/check-profiles.js +0 -62
  173. package/dist/check-profiles.js.map +0 -1
  174. package/dist/distribution.d.ts +0 -15
  175. package/dist/distribution.d.ts.map +0 -1
  176. package/dist/distribution.js +0 -49
  177. package/dist/distribution.js.map +0 -1
  178. package/dist/effects.d.ts +0 -58
  179. package/dist/effects.d.ts.map +0 -1
  180. package/dist/effects.js +0 -1126
  181. package/dist/effects.js.map +0 -1
  182. package/dist/reference.d.ts +0 -3
  183. package/dist/reference.d.ts.map +0 -1
  184. package/dist/reference.js +0 -28
  185. package/dist/reference.js.map +0 -1
  186. package/dist/vocabulary.d.ts +0 -23
  187. package/dist/vocabulary.d.ts.map +0 -1
  188. package/dist/vocabulary.js +0 -1052
  189. package/dist/vocabulary.js.map +0 -1
  190. package/docs/funding-custody.md +0 -165
  191. package/docs/guide/01-a-document.md +0 -37
  192. package/docs/guide/02-money-steps.md +0 -23
  193. package/docs/guide/03-laws.md +0 -18
  194. package/docs/guide/04-fees-and-remainder.md +0 -36
  195. package/docs/guide/05-checks-updates-dials.md +0 -7
  196. package/docs/guide/06-effects.md +0 -11
  197. package/docs/guide/07-evolution.md +0 -11
  198. package/docs/guide/08-implementing.md +0 -13
  199. package/docs/guide/09-schedules-and-allocation.md +0 -132
  200. package/docs/llms-full.txt +0 -2008
  201. package/docs/llms.txt +0 -14
  202. package/docs/piece-plans.md +0 -148
  203. package/docs/reference/canonical.md +0 -16
  204. package/docs/reference/clauses.md +0 -1585
  205. package/docs/reference/cli.md +0 -24
  206. package/docs/reference/diagnostics.md +0 -38
  207. package/skills/udl/SKILL.md +0 -28
  208. package/src/allocation.ts +0 -259
  209. package/src/check-profiles.ts +0 -80
  210. package/src/distribution.ts +0 -61
  211. package/src/effects.ts +0 -1920
  212. package/src/reference.ts +0 -31
  213. package/src/vocabulary.ts +0 -1635
@@ -1,6 +0,0 @@
1
- {
2
- "canonical": "complete-contract.udl",
3
- "digest": "3b984bf4afe253ee11e2341fc6247934b4c56020ad404d2c60aeb0f8aba5e660",
4
- "summary": "Admitted document covering public clause families.",
5
- "verdict": "valid"
6
- }
@@ -1,218 +0,0 @@
1
- {
2
- "instruments": [
3
- {
4
- "actionOrder": [
5
- "create",
6
- "revise",
7
- "settle"
8
- ],
9
- "actions": {
10
- "create": {
11
- "moves": [],
12
- "steps": [],
13
- "summary": "Open the agreement"
14
- },
15
- "revise": {
16
- "examples": [
17
- {
18
- "input": {
19
- "agreementId": "agr_sandbox_agreement01",
20
- "note": "Updated terms",
21
- "tenantId": "ten_sandbox_example001"
22
- },
23
- "name": "revise_terms"
24
- }
25
- ],
26
- "input": {
27
- "additionalProperties": false,
28
- "properties": {
29
- "note": {
30
- "type": "string"
31
- }
32
- },
33
- "required": [
34
- "note"
35
- ],
36
- "type": "object"
37
- },
38
- "moves": [],
39
- "principal": "user_session",
40
- "steps": [],
41
- "summary": "Revise the note",
42
- "updates": [
43
- "note"
44
- ]
45
- },
46
- "settle": {
47
- "deadline": {
48
- "field": "closesAt"
49
- },
50
- "moves": [
51
- {
52
- "bind": {
53
- "amount": {
54
- "from": "instance",
55
- "path": "refs.remainingAmount"
56
- },
57
- "currency": {
58
- "from": "instance",
59
- "path": "fields.currency"
60
- },
61
- "destinationAccountId": {
62
- "from": "instance",
63
- "path": "fields.destinationAccountId"
64
- },
65
- "sourceAccountId": {
66
- "from": "instance",
67
- "path": "fields.sourceAccountId"
68
- }
69
- },
70
- "key": "settlement",
71
- "operation": "internal_transfer.create"
72
- }
73
- ],
74
- "remainder": {
75
- "amountRef": "remainingAmount",
76
- "onZero": "refuse",
77
- "totalPath": "fields.amount"
78
- },
79
- "requiresChecks": [
80
- {
81
- "checkKind": "identity_verification",
82
- "family": "national_identity",
83
- "maxAge": "P30D",
84
- "statuses": [
85
- "completed"
86
- ],
87
- "subjectField": "subjectId"
88
- }
89
- ],
90
- "sandboxFailurePoint": "release",
91
- "steps": [],
92
- "summary": "Settle the agreement"
93
- }
94
- },
95
- "callerParkedStates": {
96
- "open": "The owner may revise or settle the agreement."
97
- },
98
- "dials": [
99
- {
100
- "field": "closesAt",
101
- "key": "settlement_window",
102
- "kind": "window",
103
- "maxOffset": "P30D",
104
- "minOffset": "PT0S",
105
- "summary": "The settlement deadline offset.",
106
- "title": "Settlement window"
107
- }
108
- ],
109
- "fields": {
110
- "amount": {
111
- "pattern": "^[1-9][0-9]{0,17}$",
112
- "type": "string"
113
- },
114
- "closesAt": {
115
- "format": "hyperscale-date-time",
116
- "type": "string"
117
- },
118
- "currency": {
119
- "pattern": "^[A-Z]{3}$",
120
- "type": "string"
121
- },
122
- "destinationAccountId": {
123
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
124
- "type": "string"
125
- },
126
- "note": {
127
- "type": "string"
128
- },
129
- "sourceAccountId": {
130
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
131
- "type": "string"
132
- },
133
- "subjectId": {
134
- "type": "string"
135
- }
136
- },
137
- "id": "agreement",
138
- "idPrefix": "agr",
139
- "lifecycle": {
140
- "initial": "open",
141
- "states": [
142
- "open",
143
- "closed"
144
- ],
145
- "transitions": {
146
- "revise": {
147
- "from": [
148
- "open"
149
- ],
150
- "to": "open"
151
- },
152
- "settle": {
153
- "from": [
154
- "open"
155
- ],
156
- "to": "closed"
157
- }
158
- }
159
- },
160
- "nav": [
161
- "Agreements"
162
- ],
163
- "required": [
164
- "amount",
165
- "closesAt",
166
- "currency",
167
- "destinationAccountId",
168
- "sourceAccountId",
169
- "subjectId"
170
- ],
171
- "subject": {
172
- "extensible": false,
173
- "kinds": [
174
- "asset"
175
- ]
176
- },
177
- "summary": "One agreement with a computed final settlement.",
178
- "surfaceVisibility": "public",
179
- "templateId": "agreement",
180
- "title": "Agreement",
181
- "update": {
182
- "examples": [
183
- {
184
- "input": {
185
- "agreementId": "agr_sandbox_agreement01",
186
- "note": "Updated terms",
187
- "tenantId": "ten_sandbox_example001"
188
- },
189
- "name": "revise_terms"
190
- }
191
- ],
192
- "fields": [
193
- "note"
194
- ],
195
- "states": [
196
- "open"
197
- ]
198
- }
199
- }
200
- ],
201
- "product": "complete_contract",
202
- "subjects": [
203
- {
204
- "declaredValue": "none",
205
- "kind": "asset",
206
- "schema": {
207
- "additionalProperties": false,
208
- "properties": {},
209
- "type": "object"
210
- },
211
- "title": "Asset",
212
- "version": 1
213
- }
214
- ],
215
- "title": "Complete contract",
216
- "udl": 1,
217
- "version": 1
218
- }
@@ -1,6 +0,0 @@
1
- {
2
- "canonical": "effect-signatures.udl",
3
- "digest": "f00226a7195e26f3ba0ee444488ab906af0f353a1b4c46f449e7560291e6f5fb",
4
- "summary": "Effect rows carry a signature and their source clause path; notification rows keep channel and role.",
5
- "verdict": "valid"
6
- }
@@ -1,75 +0,0 @@
1
- {
2
- "instruments": [
3
- {
4
- "actionOrder": [
5
- "create",
6
- "close"
7
- ],
8
- "actions": {
9
- "close": {
10
- "decision": {
11
- "capability": "identity_verification",
12
- "deadlineMs": 15000,
13
- "onTimeout": "decline"
14
- },
15
- "effects": {
16
- "decides": [
17
- {
18
- "signature": "decides.identity_verification",
19
- "source": "decision"
20
- }
21
- ],
22
- "notifies": [
23
- {
24
- "channel": "email",
25
- "role": "beneficiary",
26
- "signature": "notifies.email",
27
- "source": "effects.notifies[0]"
28
- }
29
- ]
30
- },
31
- "moves": [],
32
- "steps": [],
33
- "summary": "Close the note."
34
- },
35
- "create": {
36
- "moves": [],
37
- "steps": [],
38
- "summary": "File the note."
39
- }
40
- },
41
- "fields": {
42
- "reference": {
43
- "type": "string"
44
- }
45
- },
46
- "id": "note",
47
- "idPrefix": "note",
48
- "lifecycle": {
49
- "initial": "open",
50
- "states": [
51
- "open",
52
- "closed"
53
- ],
54
- "transitions": {
55
- "close": {
56
- "from": [
57
- "open"
58
- ],
59
- "to": "closed"
60
- }
61
- }
62
- },
63
- "required": [
64
- "reference"
65
- ],
66
- "summary": "A note a tenant files and later closes.",
67
- "title": "Note"
68
- }
69
- ],
70
- "product": "minimal",
71
- "subjects": [],
72
- "title": "Minimal",
73
- "udl": 1,
74
- "version": 1
75
- }
@@ -1,6 +0,0 @@
1
- {
2
- "canonical": "minimal.udl",
3
- "digest": "7933986489470a2e95e316c854077b6f970b1228679ea86d71d8c4c276e89624",
4
- "summary": "Compact, reverse-ordered bytes canonicalize to minimal.udl.",
5
- "verdict": "valid"
6
- }
@@ -1 +0,0 @@
1
- {"version":1,"udl":1,"title":"Minimal","subjects":[],"product":"minimal","instruments":[{"fields":{"reference":{"type":"string"}},"id":"note","idPrefix":"note","lifecycle":{"initial":"open","states":["open","closed"],"transitions":{"close":{"from":["open"],"to":"closed"}}},"required":["reference"],"summary":"A note a tenant files and later closes.","title":"Note","actionOrder":["close","create"],"actions":{"close":{"moves":[],"steps":[],"summary":"Close the note."},"create":{"examples":[{"input":{"reference":"example"},"name":"default"}],"moves":[],"steps":[],"summary":"File the note."}}}]}
@@ -1,6 +0,0 @@
1
- {
2
- "canonical": "insured-car-marketplace.udl",
3
- "digest": "f419cf74a30e2e6354ca5fc2614496a397720b6df59e37f2f6e7a9e382f96603",
4
- "summary": "Vehicle sale with motor cover: a listing, an escrowed sale, and a policy bound to it.",
5
- "verdict": "valid"
6
- }