@hyperscale0/udl 2.6.1 → 3.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 (213) hide show
  1. package/CHANGELOG.md +2 -330
  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 +147 -14
  33. package/package.json +7 -11
  34. package/spec/README.md +151 -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
package/CHANGELOG.md CHANGED
@@ -1,331 +1,3 @@
1
- # Changelog
1
+ # UDL 3.0.0
2
2
 
3
- All notable changes to this package are documented here. The format follows
4
- [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this package
5
- follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
7
- Format version and package version are different numbers.
8
-
9
- ## [2.6.1] - 2026-09-17
10
-
11
- Pairs with HSX 2.4.1.
12
-
13
- ### Changed
14
-
15
- - README pairs the package with HSX 2.4.1. No format or validator change.
16
-
17
- ## [2.6.0] - 2026-09-17
18
-
19
- ### Added
20
-
21
- - `cascade`: executes a named lifecycle action on linked instances of another instrument inside the same transaction before evaluating the parent action's gates. A cascade target action may declare a port when the parent action declares a port.
22
- - Validate cascade `inputField` against reserved protocol fields (`tenantId`, `productId`, `actorAccountId`) and the instrument instance key.
23
- - Snapshot cascade declarations in `EvolutionActionSnapshot` and report changed or removed cascade configurations as breaking changes.
24
-
25
- ## [2.5.0] - 2026-09-17
26
-
27
- ### Changed
28
-
29
- - The `hyperscale-date-time` format admits any RFC 3339 offset, not only `Z`. Hosts normalise the value to its UTC instant on admission.
30
-
31
- ## [2.4.0] - 2026-09-15
32
-
33
- ### Added
34
-
35
- - `attests.forAction` lets a declined decision close the same assessed request through its declared refusal action.
36
- - Add reference age gates with fixed durations and allocation gates over a named slice.
37
- - Refuse fee plus VAT ratios above distributable profit and impossible constant partitions.
38
- - Derive published instrument dependencies and tenant scoping from the same schema annotations.
39
- - Request authority binds a server-computed decision digest to a frozen target action and its material input.
40
- - Instrument reference annotations drive tenant scoping through the document schema, including allocation and funding references.
41
-
42
- - Allocation vocabulary: `allocation`, `requiresAllocation`, self allocation, shared consumption and children buckets; `templateBinding` preserves template identity. Unique constraints accept account fields, and exposure can measure allocation-backed remaining balances.
43
- - Signed schedules, stored rates, equal partitions, contributions, referenced transitions and attested decisions with subject and party binding.
44
- - Custody clauses: `shift_date`, `requiresExposure.groupField` and `minimumField`, `funding` snapshots and `receiptDistribution` for repeated receipt-backed cash and noncash loss allocation.
45
- - Assessment refunds across receipts and collection against remaining balances.
46
-
47
- ### Changed
48
-
49
- - Regenerate the schema specification and public clause reference for this vocabulary. Document checkout validation and the matching HSX 2.2.0 release.
50
- - Remove the retired journeys clause and Blueprint cost dimension.
51
- - Clarify that catalogue slices must include clause-referenced instruments, including optional references, and use the sealed public ID grammar.
52
-
53
- ## [2.3.0] - 2026-09-14
54
-
55
- ### Added
56
-
57
- - `instrumentFinanceIssues(instrument, options?)` exposes the funded-amount conservation proof for one instrument. An instrument with a `piecePlan` is unfolded over piece progress (which pieces are funded, which are consumed) the same way the runtime admits pieces: the next piece in the stage's order, fund refused once any piece has left escrow, the lifecycle state retained until the stage's last eligible piece, and `requiresDrainedAccount` actions closed while held pieces remain. `validateUdl` runs the same proof, so a plan whose refund or unfund order skips a funded piece is refused with `UDL4001` on the authored action and state names.
58
- - A call binding may name `$instance.refs.<name>` when a step or move on the same instrument captures that ref; a captured `accountId` binds as an account, any other capture as text.
59
-
60
- ### Changed
61
-
62
- - The piece-progress unfolding is bounded by the action expansion limit (256 reachable variants); exceeding it reports `UDL2010`.
63
- - Sandbox failure points and finance proofs judge a call-based action by its resolved plan leaves, not by authored moves it does not have.
64
-
65
- ## [2.2.0] - 2026-09-14
66
-
67
- ### Changed
68
-
69
- - `resolveUdlActionPlans` returns a plan for every action. Ordinary actions (no `calls`, no `pieceStage`) now resolve to flat leaves in executor order: each `steps` entry, the `payout` intent as a `payout.create` step, then each `moves` entry. Every leaf carries an `originPath` into the authored action and the clause-vocabulary effects derived for that source. Compilers no longer need a separate path for actions that never expanded.
70
- - `ResolvedActionPlanLeaf.step` admits the synthetic `payout.create` step alongside authored steps and moves.
71
-
72
- ## [2.1.0] - 2026-09-14
73
-
74
- Published in lockstep with HSX 2.1.0.
75
-
76
- ### Added
77
-
78
- - An instrument may declare `piecePlan`: a total field partitioned into named pieces, each with an amount field and immutable release and refund payees, plus `fundOrder`, `releaseOrder`, `refundOrder` and `unfundOrder`. Fund covers every piece, unfund reverses fund, and the other orders may select subsets. Piece amount fields must be distinct and partition the total in one concrete currency; a singleton may bind the total itself.
79
- - An action may declare `pieceStage` (`plan` and `stage`) to move one piece of a plan. The compiler derives the required `pieceId` input from the selected order and adds no movement of its own; the money flows through the action's `calls`.
80
- - An action may declare `calls` to typed private actions from an `actionLibrary`, binding parameters from `$instance`, `$piece` or its own inputs and capturing results by name. Private actions never carry independent approval or recovery.
81
- - Diagnostics `UDL2010` (action graph: cycles, unresolved targets, expansion bound), `UDL2011` (call bindings: forward references, `$results.*`, types), `UDL2012` (call authority: principal, approval and recovery boundary), `UDL2013` (leaf effects and evidence), `UDL4002` (piece partition) and `UDL5013` (piece stage). Each has a conformance case under `conformance/invalid` and a clause reference entry.
82
- - `resolveUdlActionPlans` exposes the expanded action plans and their diagnostics.
83
-
84
- ### Changed
85
-
86
- - The schema specification, clause reference and diagnostics reference are regenerated for the new clauses.
87
-
88
- ## [2.0.4] - 2026-09-11
89
-
90
- - Republished in lockstep with HSX 2.0.4. No format or API change.
91
-
92
- ## [2.0.3] - 2026-09-10
93
-
94
- Published in lockstep with HSX 2.0.3.
95
-
96
- ### Added
97
-
98
- - A quote may declare `chargeRetainedBy` (`payer`, `beneficiary`, or `subjectHolder`). The named role keeps the quoted charge in the source account instead of moving it through a payout action. `UDL5006` refuses a retained charge whose refund source is not that role's account, a charge reference any action consumes, and a self-transfer. The finance walk keeps proving the refund source account when the charge is retained.
99
-
100
- ## [2.0.2] - 2026-09-10
101
-
102
- - Republished in lockstep with HSX 2.0.2. The README no longer points at a GitHub Actions publish path, and the workflows are removed. No format or API change.
103
-
104
- ## [2.0.1] - 2026-09-10
105
-
106
- Published in lockstep with HSX 2.0.1. No functional change.
107
-
108
- ## [2.0.0] - 2026-09-10
109
-
110
- Published in lockstep with HSX 2.0.0.
111
-
112
- ### Added
113
-
114
- - Money field schemas may carry `x-hyperscale-currency`; `UDL6001` refuses any value that is not a three-letter uppercase code on a string schema.
115
- - `dateComparison` reference laws compare a local date field against a referenced instrument's date field with a matched-field guard.
116
- - Aggregate invariants sum integer supply fields, not only money fields, so share allocations cannot exceed an offering's supply.
117
- - `validateUdl` takes options, and the document schema gains `journey` and composition dial definitions.
118
- - Evolution comparison reports a changed `sandboxFailurePoint`.
119
-
120
- ### Changed
121
-
122
- - Finance laws know the declared parties: distinct declared parties never alias, and terminal stranding applies only to `ref:` accounts.
123
- - Field descriptions are prose and no longer part of the frozen schema; the migration plan says recompose is refused when a frozen field changes.
124
-
125
- ## [1.0.0] - 2026-09-04
126
-
127
- This release is byte-identical to 1.0.0-rc.1.
128
-
129
- ## [1.0.0-rc.1] - 2026-09-02
130
-
131
- ### Added
132
-
133
- - Stable `UDL####` diagnostics include a category, fix, message, and JSON path.
134
- - Evolution comparison returns coded issues instead of strings.
135
- - `canonicalDigest` returns a promise for SHA-256 over canonical UTF-8 bytes.
136
- - `udl canon` prints canonical bytes or their digest, and `udl explain` prints
137
- the catalog entry for one code.
138
- - The conformance runner has evolution pairs and pins canonical digests, issue
139
- codes, and paths.
140
- - Eight guides, generated clause, diagnostic, and command references,
141
- `llms.txt`, `llms-full.txt`, and an agent skill now ship with the package.
142
-
143
- - `reconcile` declares one expectation about money an action cannot see yet:
144
- the amount path, currency field, direction, the ref naming the provider-side
145
- row, exactly one evidence source, a match law, and a window. The match law is
146
- `exact`, `tolerance` bounded by a `reconcile_tolerance` dial, or `window`. An
147
- expectation that never matches by the end of its window is carried by the
148
- named exception child, capped by `maxOpen`. The child is declared and
149
- validated at admission, not materialized: the transition refuses with
150
- `state_conflict` naming it and the due sweep re-arms the expectation.
151
- `UdlReconcile` exposes the clause type.
152
- - An action may declare a `quote` offer and exactly one other action may spend
153
- it through `commit`. Both the base money field and the net destination are
154
- mandatory members of `fixes`, and `fixes` and `updates` may not overlap.
155
-
156
- ### Removed
157
-
158
- - `requiresSettlement` and `UdlRequiresSettlement` are gone. A payout-owning
159
- instrument now declares exactly one action carrying `reconcile` against a
160
- debit statement line, under any match law. There is no wrapper and no alias.
161
-
162
- ### Changed
163
-
164
- - The npm package includes `docs/` and `skills/`.
165
- - Derived effect rows for `quote`, `commit`, and `reconcile` change the canonical
166
- bytes of stored documents that carry `effects` for those clauses.
167
- - Format 1 now carries every instrument contract clause. Instrument metadata
168
- includes archetype template, navigation, visibility, dials, caller-parked
169
- states, and extensible subjects. Actions include check gates, remainder
170
- arithmetic, field updates, principal policy, and sandbox failure points.
171
- - Remainder clauses declare their computed money refs, so computed money has
172
- one authored source.
173
- - Evolution snapshots protect lifted clauses that affect composition,
174
- admission, or execution. Navigation, examples, and parked-state reason text
175
- remain editable presentation.
176
-
177
- ## [1.0.0-beta.1] - 2026-08-29
178
-
179
- - This is the first beta and has no package behavior changes from
180
- 1.0.0-alpha.5.
181
-
182
- ## [1.0.0-alpha.5] - 2026-08-29
183
-
184
- ### Added
185
-
186
- - Actions may declare a camelCase `publicAction` as their author-approved public
187
- name while the action key remains the lifecycle and execution identity. System
188
- due actions must omit it. `udlPublicActionSchema` is exported for consumers
189
- that admit the same name outside a complete document.
190
- - `captureInput` maps declared action input fields into durable receipt refs.
191
- Declare only input properties from that action and allocate each captured key
192
- in the instrument's shared ref namespace.
193
- - `signedSum` computes stored add and subtract subtotals over typed child money,
194
- then captures one net amount for exactly one payout or instrument transfer. Authors
195
- must declare the child reference, money field, currency, admitted statuses,
196
- and explicit negative and zero policies.
197
- - `requiresExposure` gates a child amount against a stored cap, with an optional
198
- anchor-specific cap, and `setsAt.marker` records occurrence timestamps that
199
- cannot drive a due condition or deadline. Use these clauses for bounded
200
- installment writes and per-anchor occurrence markers.
201
- - `distribute` allocates one parent money field or remainder-computed money ref
202
- across typed children selected by status and stored weight. The validator
203
- resolves the parent, weight, statuses, and pool before admitting the document.
204
- - Instruments may declare up to four `derivedAmounts`. Each rule computes a declared
205
- money field as 1 through 9,999 basis points of another declared money field
206
- with floor rounding. Callers supply neither the result nor a fixed or tiered
207
- rule, and a rule may not derive a field from itself.
208
- - Actions may declare one `payout` intent that reads stored money, currency,
209
- source-account, and beneficiary values and captures the payout reference.
210
- This does not add an operation to the seven-instruction kernel.
211
- - A system-only `requiresSettlement` transition may read a captured payout
212
- reference and capture the durable evidence record that matched it. The
213
- validator rejects caller input, decision ports, public actions, due and
214
- deadline triggers, kernel steps, and money moves on that transition.
215
- - `validateUdlJsonSchema` validates one schema against UDL's sealed JSON Schema
216
- subset without applying it to a value. `UdlPayout` and
217
- `UdlRequiresSettlement` expose the new clause types to TypeScript consumers.
218
-
219
- ### Changed
220
-
221
- - Evolution snapshots freeze public actions, captured receipt input,
222
- distribution rules, exposure gates, signed sums, computed money clauses, and
223
- derived-amount arithmetic once a instrument has live instances. Older snapshots
224
- remain readable when those keys are absent.
225
- - Evolution snapshots freeze both payout intents and settlement evidence gates.
226
- - Receipt refs written by the new clauses share the instrument ref namespace with
227
- kernel captures, input captures, signed sums, subject refs, and unwind refs.
228
-
229
- ## [1.0.0-alpha.4] - 2026-08-26
230
-
231
- ### Removed
232
-
233
- - `diffUdlEvolution`. It validated both arguments and then handed off to
234
- `diffValidatedUdlEvolution`, and nothing called it: `udl diff` and the
235
- engine's composer both take the validated door. Two doors onto one comparison
236
- meant every caller first had to work out which one it was standing in.
237
- Validate with `validateUdl` or `assertValidUdl`, then call
238
- `diffValidatedUdlEvolution`, whose `UdlDocument` parameters keep the compiler
239
- on the right side of that rule.
240
-
241
- ## [1.0.0-alpha.3] - 2026-08-25
242
-
243
- ### Changed
244
-
245
- - `diffUdlEvolution` validates both arguments, so a document `validateUdl`
246
- refuses now throws a `UdlError` carrying that document's issues where
247
- alpha.2 returned evolution violations. Measured on
248
- `conformance/valid/protection.udl` with the product renamed to
249
- `protection_v2` and the live `claim` instrument dropped: alpha.2 returned three
250
- violations, naming the rename, the removed live instrument, and the version that
251
- did not move; this release throws `invalid_semantics` at
252
- `$.instruments[0].aggregateInvariants[0].childInstrumentId`, because another instrument's
253
- aggregate still references `claim`.
254
-
255
- Read the throw as a refusal to judge, not as a verdict of no violations.
256
- A `catch` that treats it as a schema problem and carries on has skipped the
257
- append-only check entirely, and the candidate above is exactly the kind that
258
- then sails through: dropping a live instrument is the headline violation the law
259
- exists to catch. Fix the document, or use `diffValidatedUdlEvolution`.
260
-
261
- The parameters are `unknown` because the function now accepts input nobody
262
- has parsed. A caller who wants the compiler checking the call should hold
263
- two validated documents and use `diffValidatedUdlEvolution`, which keeps the
264
- `UdlDocument` parameter types.
265
-
266
- ### Fixed
267
-
268
- - The evolution exports no longer route around the validator. `diffUdlEvolution`
269
- took typed `UdlDocument` arguments and called neither `validateUdl` nor
270
- `assertValidUdl` before reaching the diff's comparison key, so a caller
271
- handing it an object it had never parsed got a `RangeError` off the call
272
- stack where `validateUdl` returns a `resource_limit` issue for the same
273
- object. It takes `unknown` now and validates both arguments.
274
- - The comparison key behind every diff carries the same depth budget the
275
- validator applies to a document (`UDL_LIMITS.maxDepth`, 24 levels; the
276
- deepest conformance document reaches 12). This is what protects
277
- `diffInstrumentEvolution`, which takes snapshots no validator has seen, and it
278
- closes the case where `snapshotUdlInstrument` returns a cyclic snapshot that only
279
- detonates when something later stringifies it.
280
-
281
- ### Added
282
-
283
- - `diffValidatedUdlEvolution`, the same comparison for a caller holding two
284
- documents `validateUdl` has already admitted. It keeps the `UdlDocument`
285
- parameter types, and it is the door for judging a candidate that is not yet
286
- valid on its own. It also skips a validation the caller has already paid
287
- for: on the commerce-escrow fixture `validateUdl` costs 0.57 ms against the
288
- diff's 0.38 ms, so `udl diff`, which parses both files first, takes this
289
- door rather than validating four documents to compare two.
290
-
291
- ## [1.0.0-alpha.2] - 2026-08-23
292
-
293
- ### Fixed
294
-
295
- - `bin` points at the built JavaScript; alpha.1's registry metadata pointed at
296
- TypeScript source. npm builds the packument from package.json as it sits on
297
- disk after `postpack`, so the pack-time rewrite never reached `bin`, and
298
- every install linked `.bin/udl` to `src/cli.ts`, which Node refuses to
299
- execute.
300
-
301
- ### Changed
302
-
303
- - Licensed AGPL-3.0-only with a commercial license from Hyperscale LLC;
304
- copyright holder Hyperscale LLC; repository renamed to
305
- `hyperscale0/hyperscale-udl`.
306
-
307
- ## [1.0.0-alpha.1] - 2026-08-22
308
-
309
- First public release. Format version 1.
310
-
311
- ### Added
312
-
313
- - `spec/udl.schema.json`, JSON Schema 2020-12 generated from the grammar, plus
314
- `spec/README.md` carrying the ten laws, the canonical form, and the issue
315
- codes.
316
- - `conformance/`, the format's semantic spec as data: 7 valid documents with
317
- their canonical bytes and 11 refused documents with the issue codes and JSON
318
- paths they must report, runnable from any language.
319
- - The `udl` command: `udl validate`, `udl fmt [--write]`, and `udl diff`.
320
- - `bun run spec:check`, which fails when the committed schema drifts from the
321
- grammar it was generated from.
322
-
323
- [Unreleased]: https://github.com/hyperscale0/hyperscale-udl/compare/v1.0.0...HEAD
324
- [1.0.0]: https://github.com/hyperscale0/hyperscale-udl/compare/v1.0.0-rc.1...v1.0.0
325
- [1.0.0-rc.1]: https://github.com/hyperscale0/hyperscale-udl/compare/v1.0.0-beta.1...v1.0.0-rc.1
326
- [1.0.0-beta.1]: https://github.com/hyperscale0/hyperscale-udl/compare/v1.0.0-alpha.5...v1.0.0-beta.1
327
- [1.0.0-alpha.5]: https://github.com/hyperscale0/hyperscale-udl/compare/v1.0.0-alpha.4...v1.0.0-alpha.5
328
- [1.0.0-alpha.4]: https://github.com/hyperscale0/hyperscale-udl/compare/v1.0.0-alpha.3...v1.0.0-alpha.4
329
- [1.0.0-alpha.3]: https://github.com/hyperscale0/hyperscale-udl/compare/v1.0.0-alpha.2...v1.0.0-alpha.3
330
- [1.0.0-alpha.2]: https://github.com/hyperscale0/hyperscale-udl/compare/v1.0.0-alpha.1...v1.0.0-alpha.2
331
- [1.0.0-alpha.1]: https://github.com/hyperscale0/hyperscale-udl/releases/tag/v1.0.0-alpha.1
3
+ Version 3 replaces the previous grammar. Recreate development estates. There is no migration reader.
package/LICENSING.md CHANGED
@@ -40,8 +40,7 @@ says nothing about trademarks in either direction, so
40
40
  ## The format is not the implementation
41
41
 
42
42
  UDL the format is separate from this implementation of it. The JSON Schema in
43
- [`spec/`](./spec) and the conformance cases in [`conformance/`](./conformance)
44
- are data describing a format, and anyone may write their own parser, validator,
43
+ [`spec/`](./spec) is data describing a format, and anyone may write their own parser, validator,
45
44
  or serializer against them, in any language, under any license, without
46
45
  touching this code.
47
46
 
package/README.md CHANGED
@@ -1,116 +1,5 @@
1
- <p align="left">
2
- <picture>
3
- <source media="(max-width: 600px) and (prefers-color-scheme: dark)" srcset="docs/assets/brand/udl-stacked-white.svg">
4
- <source media="(max-width: 600px)" srcset="docs/assets/brand/udl-stacked.svg">
5
- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/brand/udl-horizontal-white.svg">
6
- <source media="(prefers-color-scheme: light)" srcset="docs/assets/brand/udl-horizontal.svg">
7
- <img src="docs/assets/brand/udl-horizontal.svg" alt="Hyperscale™ UDL" width="336">
8
- </picture>
9
- </p>
1
+ # UDL 3
10
2
 
11
- # UDL
3
+ Read the [language reference](docs/README.md).
12
4
 
13
- Hyperscale™ UDL. The canonical contract between a financial product and its engine.
14
-
15
- UDL is the Universal Domain Language, the canonical JSON contract for a financial product. One `.udl` file declares subjects, instruments, lifecycles, actions, and money movement. An engine admits that document without reading the source language that produced it. UDL keeps provider machinery below the format: it has no file drops, polling loops, cutoff jobs, scheme messages, or provider statement schemas. The `reconcile` clause names settlement evidence against a declared provider-side row; it does not model provider transport or matching machinery.
16
-
17
- ## Install
18
-
19
- ```bash
20
- npm install @hyperscale0/udl
21
- ```
22
-
23
- This package contains the parser, semantic validator, canonical serializer, append-only evolution diff, JSON Schema, and conformance corpus.
24
-
25
- ## First document
26
-
27
- Save this document as `note.udl`:
28
-
29
- ```json
30
- {
31
- "instruments": [
32
- {
33
- "actionOrder": ["close", "create"],
34
- "fields": { "reference": { "type": "string" } },
35
- "id": "note",
36
- "idPrefix": "note",
37
- "lifecycle": {
38
- "initial": "open",
39
- "states": ["open", "closed"],
40
- "transitions": { "close": { "from": ["open"], "to": "closed" } }
41
- },
42
- "required": ["reference"],
43
- "summary": "A note a tenant files and later closes.",
44
- "title": "Note",
45
- "actions": {
46
- "close": { "moves": [], "steps": [], "summary": "Close the note." },
47
- "create": { "moves": [], "steps": [], "summary": "File the note." }
48
- }
49
- }
50
- ],
51
- "product": "minimal",
52
- "subjects": [],
53
- "title": "Minimal",
54
- "udl": 1,
55
- "version": 1
56
- }
57
- ```
58
-
59
- In the full repository checkout, the UDL CLI entrypoint is `open/udl/src/cli.ts`. Validate local compiler output with `bun open/udl/src/cli.ts validate note.udl` from the repository root so the compiler and validator use the same source revision. In a standalone UDL package checkout, use `bun src/cli.ts validate note.udl`.
60
-
61
- For npm installations, pair HSX 2.4.1 with UDL 2.6.1. HSX 2.1.1 as published pairs with UDL 2.3.0; a checkout with later clauses such as `templateBinding` needs the local validator even if its package version has not yet changed. These are package versions; the UDL document format remains version 1.
62
-
63
- Check the document with the installed CLI:
64
-
65
- ```bash
66
- npx @hyperscale0/udl validate note.udl
67
- npx @hyperscale0/udl fmt note.udl --write
68
- npx @hyperscale0/udl canon note.udl --digest
69
- ```
70
-
71
- Exit code `0` means success. Exit code `1` means the validator refused the document. Exit code `2` means the invocation or file read failed.
72
-
73
- In TypeScript, parse, validate, and compare documents directly:
74
-
75
- ```ts
76
- import { readFile, writeFile } from "node:fs/promises";
77
- import {
78
- canonicalDigest,
79
- diffValidatedUdlEvolution,
80
- parseUdl,
81
- serializeUdl,
82
- validateUdl,
83
- } from "@hyperscale0/udl";
84
-
85
- const document = parseUdl(await readFile("note.udl"));
86
- await writeFile("note.udl", serializeUdl(document));
87
- console.log(await canonicalDigest(document));
88
-
89
- const result = validateUdl(document);
90
- if (!result.ok) console.error(result.issues);
91
-
92
- const previous = parseUdl(await readFile("note.previous.udl"));
93
- const violations = diffValidatedUdlEvolution(previous, document);
94
- ```
95
-
96
- The evolution diff API (`diffValidatedUdlEvolution`, `diffInstrumentEvolution`, and `npx @hyperscale0/udl diff`) verifies that changes between two product versions are append-only. Adding optional fields, states, transitions, and actions is permitted; removing, renaming, or tightening existing structures returns `UDL7xxx` violation issues.
97
-
98
- ## Documentation
99
-
100
- - [Guide and reading order](docs/README.md)
101
- - [Format specification](spec/README.md)
102
- - [Canonical bytes law](docs/reference/canonical.md)
103
- - [Stable diagnostics](docs/reference/diagnostics.md)
104
- - [Conformance suite](conformance/README.md)
105
- - [Agent skill](skills/udl/SKILL.md)
106
- - [Contributing](CONTRIBUTING.md)
107
-
108
- ## License and security
109
-
110
- UDL is licensed under AGPL-3.0-only, with a commercial license available from Hyperscale LLC. See [LICENSE](LICENSE), [LICENSING.md](LICENSING.md), and [TRADEMARKS.md](TRADEMARKS.md).
111
-
112
- Vulnerability reports go through private disclosure as described in [SECURITY.md](SECURITY.md).
113
-
114
- ---
115
-
116
- Hyperscale™ is a trademark of Hyperscale LLC. Code licenses do not grant rights to the name or marks.
5
+ Run `bun run check` to build and check this package.
package/TRADEMARKS.md CHANGED
@@ -25,8 +25,8 @@ What that means in practice:
25
25
  An independent implementation may say it "implements UDL version X" or "passes
26
26
  the UDL conformance suite version X" only while it passes the published
27
27
  conformance cases for that version, unmodified. The cases in
28
- [`conformance/`](./conformance) are the whole test: no skipped case, no edited
29
- expectation, no local fork of the fixtures.
28
+ [`test/language.spec.ts`](./test/language.spec.ts) are the whole test: no skipped case, no edited
29
+ expectation, no local change to the document mutations.
30
30
 
31
31
  That claim is a statement about your implementation, so keep the marks out of
32
32
  its name and off its logo, and do not present it as endorsement or