@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.
- package/CHANGELOG.md +78 -25
- package/README.md +37 -99
- package/conformance/README.md +44 -41
- package/conformance/evolution/action-contract.expected.json +10 -0
- package/conformance/evolution/action-contract.live.udl +44 -0
- package/conformance/evolution/action-contract.next.udl +45 -0
- package/conformance/evolution/product-identity.expected.json +10 -0
- package/conformance/evolution/product-identity.live.udl +55 -0
- package/conformance/evolution/product-identity.next.udl +55 -0
- package/conformance/evolution/version-required.expected.json +10 -0
- package/conformance/evolution/version-required.live.udl +55 -0
- package/conformance/evolution/version-required.next.udl +58 -0
- package/conformance/invalid/action-without-transition.expected.json +10 -0
- package/conformance/invalid/{verb-without-transition.udl → action-without-transition.udl} +7 -2
- package/conformance/invalid/agent-description-too-long.expected.json +10 -0
- package/conformance/invalid/agent-description-too-long.udl +57 -0
- package/conformance/invalid/blank-title.expected.json +1 -1
- package/conformance/invalid/blank-title.udl +6 -2
- package/conformance/invalid/composition-dial-duplicate-key.expected.json +10 -0
- package/conformance/invalid/composition-dial-duplicate-key.udl +73 -0
- package/conformance/invalid/depth-budget.expected.json +1 -1
- package/conformance/invalid/duplicate-subject.expected.json +10 -0
- package/conformance/invalid/duplicate-subject.udl +230 -0
- package/conformance/invalid/forged-effects.expected.json +10 -0
- package/conformance/invalid/forged-effects.udl +76 -0
- package/conformance/invalid/format-version.expected.json +1 -1
- package/conformance/invalid/format-version.udl +6 -2
- package/conformance/invalid/instrument-id-not-snake-case.expected.json +10 -0
- package/conformance/invalid/{noun-id-not-snake-case.udl → instrument-id-not-snake-case.udl} +6 -2
- package/conformance/invalid/invalid-aggregate-gate-shape.expected.json +10 -0
- package/conformance/invalid/invalid-aggregate-gate-shape.udl +1819 -0
- package/conformance/invalid/invalid-check-duration.expected.json +10 -0
- package/conformance/invalid/invalid-check-duration.udl +219 -0
- package/conformance/invalid/invalid-dial-anchor.expected.json +10 -0
- package/conformance/invalid/invalid-dial-anchor.udl +219 -0
- package/conformance/invalid/invalid-exception-parent-ref.expected.json +10 -0
- package/conformance/invalid/invalid-exception-parent-ref.udl +2487 -0
- package/conformance/invalid/invalid-exposure-shape.expected.json +10 -0
- package/conformance/invalid/invalid-exposure-shape.udl +1819 -0
- package/conformance/invalid/invalid-remainder.expected.json +10 -0
- package/conformance/invalid/invalid-remainder.udl +220 -0
- package/conformance/invalid/invalid-schema-keyword.expected.json +10 -0
- package/conformance/invalid/invalid-schema-keyword.udl +220 -0
- package/conformance/invalid/invalid-utf8.expected.json +1 -1
- package/conformance/invalid/malformed-json.expected.json +1 -1
- package/conformance/invalid/missing-create-action.expected.json +10 -0
- package/conformance/invalid/{missing-create-verb.udl → missing-create-action.udl} +5 -2
- package/conformance/invalid/missing-exception-amount-field.expected.json +10 -0
- package/conformance/invalid/missing-exception-amount-field.udl +2487 -0
- package/conformance/invalid/missing-exception-contract.expected.json +14 -0
- package/conformance/invalid/missing-exception-contract.udl +2523 -0
- package/conformance/invalid/missing-exception-reason-field.expected.json +10 -0
- package/conformance/invalid/missing-exception-reason-field.udl +2487 -0
- package/conformance/invalid/not-an-object.expected.json +1 -1
- package/conformance/invalid/payout-reconcile-not-a-bank-debit.expected.json +10 -0
- package/conformance/invalid/payout-reconcile-not-a-bank-debit.udl +259 -0
- package/conformance/invalid/quote-freeze-set-incomplete.expected.json +10 -0
- package/conformance/invalid/quote-freeze-set-incomplete.udl +261 -0
- package/conformance/invalid/quote-named-reference-gate.expected.json +10 -0
- package/conformance/invalid/quote-named-reference-gate.udl +50 -0
- package/conformance/invalid/reconcile-named-reference-gate.expected.json +10 -0
- package/conformance/invalid/reconcile-named-reference-gate.udl +50 -0
- package/conformance/invalid/unknown-key.expected.json +1 -1
- package/conformance/invalid/unknown-key.udl +6 -2
- package/conformance/invalid/unknown-reference-gate-field.expected.json +10 -0
- package/conformance/invalid/unknown-reference-gate-field.udl +1819 -0
- package/conformance/invalid/unknown-required-field.expected.json +10 -0
- package/conformance/invalid/unknown-required-field.udl +220 -0
- package/conformance/invalid/unreachable-state.expected.json +2 -2
- package/conformance/invalid/unreachable-state.udl +6 -2
- package/conformance/invalid/wrong-exception-amount-field.expected.json +10 -0
- package/conformance/invalid/wrong-exception-amount-field.udl +2487 -0
- package/conformance/invalid/wrong-exception-reason-field.expected.json +10 -0
- package/conformance/invalid/wrong-exception-reason-field.udl +2487 -0
- package/conformance/valid/agent-description.expected.json +6 -0
- package/conformance/valid/agent-description.udl +66 -0
- package/conformance/valid/cards.expected.json +1 -0
- package/conformance/valid/cards.udl +843 -356
- package/conformance/valid/commerce-escrow.expected.json +1 -0
- package/conformance/valid/commerce-escrow.udl +792 -291
- package/conformance/valid/compiled-crowdfunding.expected.json +6 -0
- package/conformance/valid/compiled-crowdfunding.udl +1843 -0
- package/conformance/valid/compiled-watch-club.expected.json +6 -0
- package/conformance/valid/compiled-watch-club.udl +2486 -0
- package/conformance/valid/complete-contract.expected.json +6 -0
- package/conformance/valid/complete-contract.udl +218 -0
- package/conformance/valid/effect-signatures.expected.json +6 -0
- package/conformance/valid/effect-signatures.udl +75 -0
- package/conformance/valid/hand-edited.expected.json +1 -0
- package/conformance/valid/hand-edited.udl +1 -1
- package/conformance/valid/insured-car-marketplace.expected.json +1 -0
- package/conformance/valid/insured-car-marketplace.udl +534 -315
- package/conformance/valid/insured-travel.expected.json +2 -1
- package/conformance/valid/insured-travel.udl +1489 -641
- package/conformance/valid/minimal.expected.json +1 -0
- package/conformance/valid/minimal.udl +18 -14
- package/conformance/valid/protection.expected.json +1 -0
- package/conformance/valid/protection.udl +719 -304
- package/conformance/valid/string-escaping.expected.json +6 -0
- package/conformance/valid/string-escaping.udl +54 -0
- package/dist/canonical.d.ts +2 -0
- package/dist/canonical.d.ts.map +1 -1
- package/dist/canonical.js +7 -0
- package/dist/canonical.js.map +1 -1
- package/dist/check-profiles.d.ts +57 -0
- package/dist/check-profiles.d.ts.map +1 -0
- package/dist/check-profiles.js +62 -0
- package/dist/check-profiles.js.map +1 -0
- package/dist/cli.js +48 -4
- package/dist/cli.js.map +1 -1
- package/dist/diagnostics.d.ts +168 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +164 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/effects.d.ts +41 -0
- package/dist/effects.d.ts.map +1 -0
- package/dist/effects.js +110 -0
- package/dist/effects.js.map +1 -0
- package/dist/evolution.d.ts +51 -18
- package/dist/evolution.d.ts.map +1 -1
- package/dist/evolution.js +244 -102
- package/dist/evolution.js.map +1 -1
- package/dist/finance.d.ts +17 -13
- package/dist/finance.d.ts.map +1 -1
- package/dist/finance.js +165 -109
- package/dist/finance.js.map +1 -1
- package/dist/index.d.ts +12 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +2 -2
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +4 -3
- package/dist/limits.js.map +1 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +6 -16
- package/dist/parser.js.map +1 -1
- package/dist/schema.d.ts +2059 -135
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +759 -73
- package/dist/schema.js.map +1 -1
- package/dist/validation.d.ts +22 -9
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +1463 -457
- package/dist/validation.js.map +1 -1
- package/docs/README.md +14 -0
- package/docs/guide/01-a-document.md +37 -0
- package/docs/guide/02-money-steps.md +23 -0
- package/docs/guide/03-laws.md +18 -0
- package/docs/guide/04-fees-and-remainder.md +15 -0
- package/docs/guide/05-checks-updates-dials.md +7 -0
- package/docs/guide/06-effects.md +11 -0
- package/docs/guide/07-evolution.md +11 -0
- package/docs/guide/08-implementing.md +13 -0
- package/docs/llms-full.txt +1241 -0
- package/docs/llms.txt +14 -0
- package/docs/reference/canonical.md +16 -0
- package/docs/reference/clauses.md +986 -0
- package/docs/reference/cli.md +22 -0
- package/docs/reference/diagnostics.md +32 -0
- package/package.json +6 -2
- package/skills/udl/SKILL.md +28 -0
- package/spec/README.md +82 -51
- package/spec/udl.schema.json +1191 -119
- package/src/canonical.ts +11 -0
- package/src/check-profiles.ts +80 -0
- package/src/cli.ts +49 -3
- package/src/diagnostics.ts +221 -0
- package/src/effects.ts +163 -0
- package/src/evolution.ts +375 -125
- package/src/finance.ts +255 -160
- package/src/index.ts +50 -14
- package/src/limits.ts +4 -3
- package/src/parser.ts +15 -18
- package/src/schema.ts +855 -81
- package/src/validation.ts +2666 -560
- package/conformance/invalid/missing-create-verb.expected.json +0 -10
- package/conformance/invalid/noun-id-not-snake-case.expected.json +0 -10
- package/conformance/invalid/verb-without-transition.expected.json +0 -10
|
@@ -0,0 +1,220 @@
|
|
|
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
|
+
"missing"
|
|
171
|
+
],
|
|
172
|
+
"subject": {
|
|
173
|
+
"extensible": false,
|
|
174
|
+
"kinds": [
|
|
175
|
+
"asset"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"summary": "One agreement with a computed final settlement.",
|
|
179
|
+
"surfaceVisibility": "public",
|
|
180
|
+
"templateId": "agreement",
|
|
181
|
+
"title": "Agreement",
|
|
182
|
+
"update": {
|
|
183
|
+
"examples": [
|
|
184
|
+
{
|
|
185
|
+
"input": {
|
|
186
|
+
"agreementId": "agr_sandbox_agreement01",
|
|
187
|
+
"note": "Updated terms",
|
|
188
|
+
"tenantId": "ten_sandbox_example001"
|
|
189
|
+
},
|
|
190
|
+
"name": "revise_terms"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"fields": [
|
|
194
|
+
"note"
|
|
195
|
+
],
|
|
196
|
+
"states": [
|
|
197
|
+
"open"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"product": "complete_contract",
|
|
203
|
+
"subjects": [
|
|
204
|
+
{
|
|
205
|
+
"declaredValue": "none",
|
|
206
|
+
"kind": "asset",
|
|
207
|
+
"schema": {
|
|
208
|
+
"additionalProperties": false,
|
|
209
|
+
"properties": {},
|
|
210
|
+
"type": "object"
|
|
211
|
+
},
|
|
212
|
+
"title": "Asset",
|
|
213
|
+
"version": 1
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"title": "Complete contract",
|
|
217
|
+
"udl": 1,
|
|
218
|
+
"version": 1
|
|
219
|
+
}
|
|
220
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"issues": [
|
|
3
3
|
{
|
|
4
|
-
"code": "
|
|
5
|
-
"path": "$.
|
|
4
|
+
"code": "UDL3001",
|
|
5
|
+
"path": "$.instruments[0].lifecycle.states[2]"
|
|
6
6
|
}
|
|
7
7
|
],
|
|
8
8
|
"summary": "Lifecycle closure: a state no transition can reach is a typo, not a state.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"instruments": [
|
|
3
3
|
{
|
|
4
4
|
"fields": {
|
|
5
5
|
"reference": {
|
|
@@ -29,7 +29,11 @@
|
|
|
29
29
|
],
|
|
30
30
|
"summary": "A note a tenant files and later closes.",
|
|
31
31
|
"title": "Note",
|
|
32
|
-
"
|
|
32
|
+
"actionOrder": [
|
|
33
|
+
"close",
|
|
34
|
+
"create"
|
|
35
|
+
],
|
|
36
|
+
"actions": {
|
|
33
37
|
"close": {
|
|
34
38
|
"moves": [],
|
|
35
39
|
"steps": [],
|