@hyperscale0/udl 1.0.0-rc.1 → 1.0.123

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 (234) hide show
  1. package/CHANGELOG.md +5 -211
  2. package/LICENSE.md +356 -0
  3. package/NOTICE.md +8 -0
  4. package/README.md +14 -106
  5. package/dist/canonical.d.ts.map +1 -1
  6. package/dist/canonical.js +1 -29
  7. package/dist/canonical.js.map +1 -1
  8. package/dist/diagnostics.d.ts +13 -165
  9. package/dist/diagnostics.d.ts.map +1 -1
  10. package/dist/diagnostics.js +33 -157
  11. package/dist/diagnostics.js.map +1 -1
  12. package/dist/field-value.d.ts +5 -0
  13. package/dist/field-value.d.ts.map +1 -0
  14. package/dist/field-value.js +85 -0
  15. package/dist/field-value.js.map +1 -0
  16. package/dist/finance.d.ts +10 -53
  17. package/dist/finance.d.ts.map +1 -1
  18. package/dist/finance.js +252 -536
  19. package/dist/finance.js.map +1 -1
  20. package/dist/index.d.ts +9 -13
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +9 -9
  23. package/dist/index.js.map +1 -1
  24. package/dist/json.d.ts +2 -0
  25. package/dist/json.d.ts.map +1 -0
  26. package/dist/json.js +30 -0
  27. package/dist/json.js.map +1 -0
  28. package/dist/limits.d.ts +3 -28
  29. package/dist/limits.d.ts.map +1 -1
  30. package/dist/limits.js +5 -31
  31. package/dist/limits.js.map +1 -1
  32. package/dist/object-contract.d.ts +140 -0
  33. package/dist/object-contract.d.ts.map +1 -0
  34. package/dist/object-contract.js +314 -0
  35. package/dist/object-contract.js.map +1 -0
  36. package/dist/object-semantics-schema.d.ts +5710 -0
  37. package/dist/object-semantics-schema.d.ts.map +1 -0
  38. package/dist/object-semantics-schema.js +119 -0
  39. package/dist/object-semantics-schema.js.map +1 -0
  40. package/dist/object-semantics.d.ts +6 -0
  41. package/dist/object-semantics.d.ts.map +1 -0
  42. package/dist/object-semantics.js +279 -0
  43. package/dist/object-semantics.js.map +1 -0
  44. package/dist/object-structures.d.ts +4 -0
  45. package/dist/object-structures.d.ts.map +1 -0
  46. package/dist/object-structures.js +134 -0
  47. package/dist/object-structures.js.map +1 -0
  48. package/dist/reporting-validation.d.ts +8 -0
  49. package/dist/reporting-validation.d.ts.map +1 -0
  50. package/dist/reporting-validation.js +252 -0
  51. package/dist/reporting-validation.js.map +1 -0
  52. package/dist/reporting.d.ts +477 -0
  53. package/dist/reporting.d.ts.map +1 -0
  54. package/dist/reporting.js +169 -0
  55. package/dist/reporting.js.map +1 -0
  56. package/dist/schema.d.ts +5572 -2710
  57. package/dist/schema.d.ts.map +1 -1
  58. package/dist/schema.js +444 -1121
  59. package/dist/schema.js.map +1 -1
  60. package/dist/validation.d.ts +10 -73
  61. package/dist/validation.d.ts.map +1 -1
  62. package/dist/validation.js +1109 -2569
  63. package/dist/validation.js.map +1 -1
  64. package/docs/assets/brand/manifest.json +30 -0
  65. package/docs/assets/brand/udl-horizontal-white.svg +1 -0
  66. package/docs/assets/brand/udl-horizontal.svg +1 -0
  67. package/docs/assets/brand/udl-stacked-white.svg +1 -0
  68. package/docs/assets/brand/udl-stacked.svg +1 -0
  69. package/docs/assets/udl.svg +11 -0
  70. package/package.json +13 -22
  71. package/spec/README.md +300 -172
  72. package/spec/cars.udl.json +249 -0
  73. package/spec/udl.schema.json +3066 -2242
  74. package/src/canonical.ts +1 -35
  75. package/src/diagnostics.ts +76 -209
  76. package/src/field-value.ts +87 -0
  77. package/src/finance.ts +327 -832
  78. package/src/index.ts +18 -95
  79. package/src/json.ts +34 -0
  80. package/src/limits.ts +5 -31
  81. package/src/object-contract.ts +559 -0
  82. package/src/object-semantics-schema.ts +148 -0
  83. package/src/object-semantics.ts +378 -0
  84. package/src/object-structures.ts +255 -0
  85. package/src/reporting-validation.ts +383 -0
  86. package/src/reporting.ts +178 -0
  87. package/src/schema.ts +510 -1277
  88. package/src/validation.ts +1630 -4545
  89. package/LICENSE +0 -661
  90. package/LICENSING.md +0 -51
  91. package/TRADEMARKS.md +0 -35
  92. package/conformance/README.md +0 -82
  93. package/conformance/evolution/action-contract.expected.json +0 -10
  94. package/conformance/evolution/action-contract.live.udl +0 -44
  95. package/conformance/evolution/action-contract.next.udl +0 -45
  96. package/conformance/evolution/product-identity.expected.json +0 -10
  97. package/conformance/evolution/product-identity.live.udl +0 -55
  98. package/conformance/evolution/product-identity.next.udl +0 -55
  99. package/conformance/evolution/version-required.expected.json +0 -10
  100. package/conformance/evolution/version-required.live.udl +0 -55
  101. package/conformance/evolution/version-required.next.udl +0 -58
  102. package/conformance/invalid/action-without-transition.expected.json +0 -10
  103. package/conformance/invalid/action-without-transition.udl +0 -60
  104. package/conformance/invalid/agent-description-too-long.expected.json +0 -10
  105. package/conformance/invalid/agent-description-too-long.udl +0 -57
  106. package/conformance/invalid/blank-title.expected.json +0 -10
  107. package/conformance/invalid/blank-title.udl +0 -54
  108. package/conformance/invalid/composition-dial-duplicate-key.expected.json +0 -10
  109. package/conformance/invalid/composition-dial-duplicate-key.udl +0 -73
  110. package/conformance/invalid/depth-budget.expected.json +0 -10
  111. package/conformance/invalid/depth-budget.udl +0 -49
  112. package/conformance/invalid/duplicate-subject.expected.json +0 -10
  113. package/conformance/invalid/duplicate-subject.udl +0 -230
  114. package/conformance/invalid/forged-effects.expected.json +0 -10
  115. package/conformance/invalid/forged-effects.udl +0 -76
  116. package/conformance/invalid/format-version.expected.json +0 -10
  117. package/conformance/invalid/format-version.udl +0 -54
  118. package/conformance/invalid/instrument-id-not-snake-case.expected.json +0 -10
  119. package/conformance/invalid/instrument-id-not-snake-case.udl +0 -54
  120. package/conformance/invalid/invalid-aggregate-gate-shape.expected.json +0 -10
  121. package/conformance/invalid/invalid-aggregate-gate-shape.udl +0 -1819
  122. package/conformance/invalid/invalid-check-duration.expected.json +0 -10
  123. package/conformance/invalid/invalid-check-duration.udl +0 -219
  124. package/conformance/invalid/invalid-dial-anchor.expected.json +0 -10
  125. package/conformance/invalid/invalid-dial-anchor.udl +0 -219
  126. package/conformance/invalid/invalid-exception-parent-ref.expected.json +0 -10
  127. package/conformance/invalid/invalid-exception-parent-ref.udl +0 -2487
  128. package/conformance/invalid/invalid-exposure-shape.expected.json +0 -10
  129. package/conformance/invalid/invalid-exposure-shape.udl +0 -1819
  130. package/conformance/invalid/invalid-remainder.expected.json +0 -10
  131. package/conformance/invalid/invalid-remainder.udl +0 -220
  132. package/conformance/invalid/invalid-schema-keyword.expected.json +0 -10
  133. package/conformance/invalid/invalid-schema-keyword.udl +0 -220
  134. package/conformance/invalid/invalid-utf8.expected.json +0 -10
  135. package/conformance/invalid/invalid-utf8.udl +0 -1
  136. package/conformance/invalid/malformed-json.expected.json +0 -10
  137. package/conformance/invalid/malformed-json.udl +0 -1
  138. package/conformance/invalid/missing-create-action.expected.json +0 -10
  139. package/conformance/invalid/missing-create-action.udl +0 -48
  140. package/conformance/invalid/missing-exception-amount-field.expected.json +0 -10
  141. package/conformance/invalid/missing-exception-amount-field.udl +0 -2487
  142. package/conformance/invalid/missing-exception-contract.expected.json +0 -14
  143. package/conformance/invalid/missing-exception-contract.udl +0 -2523
  144. package/conformance/invalid/missing-exception-reason-field.expected.json +0 -10
  145. package/conformance/invalid/missing-exception-reason-field.udl +0 -2487
  146. package/conformance/invalid/not-an-object.expected.json +0 -10
  147. package/conformance/invalid/not-an-object.udl +0 -1
  148. package/conformance/invalid/payout-reconcile-not-a-bank-debit.expected.json +0 -10
  149. package/conformance/invalid/payout-reconcile-not-a-bank-debit.udl +0 -259
  150. package/conformance/invalid/quote-freeze-set-incomplete.expected.json +0 -10
  151. package/conformance/invalid/quote-freeze-set-incomplete.udl +0 -261
  152. package/conformance/invalid/quote-named-reference-gate.expected.json +0 -10
  153. package/conformance/invalid/quote-named-reference-gate.udl +0 -50
  154. package/conformance/invalid/reconcile-named-reference-gate.expected.json +0 -10
  155. package/conformance/invalid/reconcile-named-reference-gate.udl +0 -50
  156. package/conformance/invalid/unknown-key.expected.json +0 -10
  157. package/conformance/invalid/unknown-key.udl +0 -55
  158. package/conformance/invalid/unknown-reference-gate-field.expected.json +0 -10
  159. package/conformance/invalid/unknown-reference-gate-field.udl +0 -1819
  160. package/conformance/invalid/unknown-required-field.expected.json +0 -10
  161. package/conformance/invalid/unknown-required-field.udl +0 -220
  162. package/conformance/invalid/unreachable-state.expected.json +0 -10
  163. package/conformance/invalid/unreachable-state.udl +0 -55
  164. package/conformance/invalid/wrong-exception-amount-field.expected.json +0 -10
  165. package/conformance/invalid/wrong-exception-amount-field.udl +0 -2487
  166. package/conformance/invalid/wrong-exception-reason-field.expected.json +0 -10
  167. package/conformance/invalid/wrong-exception-reason-field.udl +0 -2487
  168. package/conformance/valid/agent-description.expected.json +0 -6
  169. package/conformance/valid/agent-description.udl +0 -66
  170. package/conformance/valid/cards.expected.json +0 -6
  171. package/conformance/valid/cards.udl +0 -1579
  172. package/conformance/valid/commerce-escrow.expected.json +0 -6
  173. package/conformance/valid/commerce-escrow.udl +0 -1512
  174. package/conformance/valid/compiled-crowdfunding.expected.json +0 -6
  175. package/conformance/valid/compiled-crowdfunding.udl +0 -1843
  176. package/conformance/valid/compiled-watch-club.expected.json +0 -6
  177. package/conformance/valid/compiled-watch-club.udl +0 -2486
  178. package/conformance/valid/complete-contract.expected.json +0 -6
  179. package/conformance/valid/complete-contract.udl +0 -218
  180. package/conformance/valid/effect-signatures.expected.json +0 -6
  181. package/conformance/valid/effect-signatures.udl +0 -75
  182. package/conformance/valid/hand-edited.expected.json +0 -6
  183. package/conformance/valid/hand-edited.udl +0 -1
  184. package/conformance/valid/insured-car-marketplace.expected.json +0 -6
  185. package/conformance/valid/insured-car-marketplace.udl +0 -1050
  186. package/conformance/valid/insured-travel.expected.json +0 -6
  187. package/conformance/valid/insured-travel.udl +0 -3469
  188. package/conformance/valid/minimal.expected.json +0 -6
  189. package/conformance/valid/minimal.udl +0 -54
  190. package/conformance/valid/protection.expected.json +0 -6
  191. package/conformance/valid/protection.udl +0 -1551
  192. package/conformance/valid/string-escaping.expected.json +0 -6
  193. package/conformance/valid/string-escaping.udl +0 -54
  194. package/dist/check-profiles.d.ts +0 -57
  195. package/dist/check-profiles.d.ts.map +0 -1
  196. package/dist/check-profiles.js +0 -62
  197. package/dist/check-profiles.js.map +0 -1
  198. package/dist/cli.d.ts +0 -3
  199. package/dist/cli.d.ts.map +0 -1
  200. package/dist/cli.js +0 -184
  201. package/dist/cli.js.map +0 -1
  202. package/dist/effects.d.ts +0 -41
  203. package/dist/effects.d.ts.map +0 -1
  204. package/dist/effects.js +0 -110
  205. package/dist/effects.js.map +0 -1
  206. package/dist/evolution.d.ts +0 -120
  207. package/dist/evolution.d.ts.map +0 -1
  208. package/dist/evolution.js +0 -567
  209. package/dist/evolution.js.map +0 -1
  210. package/dist/parser.d.ts +0 -4
  211. package/dist/parser.d.ts.map +0 -1
  212. package/dist/parser.js +0 -44
  213. package/dist/parser.js.map +0 -1
  214. package/docs/README.md +0 -14
  215. package/docs/guide/01-a-document.md +0 -37
  216. package/docs/guide/02-money-steps.md +0 -23
  217. package/docs/guide/03-laws.md +0 -18
  218. package/docs/guide/04-fees-and-remainder.md +0 -15
  219. package/docs/guide/05-checks-updates-dials.md +0 -7
  220. package/docs/guide/06-effects.md +0 -11
  221. package/docs/guide/07-evolution.md +0 -11
  222. package/docs/guide/08-implementing.md +0 -13
  223. package/docs/llms-full.txt +0 -1241
  224. package/docs/llms.txt +0 -14
  225. package/docs/reference/canonical.md +0 -16
  226. package/docs/reference/clauses.md +0 -986
  227. package/docs/reference/cli.md +0 -22
  228. package/docs/reference/diagnostics.md +0 -32
  229. package/skills/udl/SKILL.md +0 -28
  230. package/src/check-profiles.ts +0 -80
  231. package/src/cli.ts +0 -196
  232. package/src/effects.ts +0 -163
  233. package/src/evolution.ts +0 -965
  234. package/src/parser.ts +0 -58
package/README.md CHANGED
@@ -1,110 +1,18 @@
1
- # UDL
1
+ # UDL 1
2
2
 
3
- 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 can admit that document without reading the source language that produced it.
3
+ UDL, the Universal Domain Language, describes a company's objects, agreements,
4
+ actions and money rules. HSX compiles to this typed contract. An executor reads
5
+ UDL and enforces its actors, lifecycle transitions, requirements and effects.
6
+ The UDL package parses, validates and serializes contracts; it executes no actions.
7
+ This version supports SAR only.
4
8
 
5
- 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 the provider file or transport.
9
+ Read the [specification](spec/README.md) for the contract and its runtime obligations.
10
+ The [JSON schema](spec/udl.schema.json) defines every field and default.
6
11
 
7
- This package contains the parser, semantic validator, canonical serializer, append-only evolution diff, JSON Schema, and conformance corpus.
12
+ Install `@hyperscale0/udl` with Node.js 22 or later. `validateUdl` checks a
13
+ contract, not an account balance or a deployed executor. `canonicalDigest`
14
+ identifies its canonical bytes.
8
15
 
9
- ## Install
10
-
11
- ```bash
12
- npm install @hyperscale0/udl
13
- ```
14
-
15
- `1.0.0-rc.1` freezes the candidate format for one full wave of use. Pin the release candidate while testing another implementation. Format 1 freezes when the package reaches `1.0.0`.
16
-
17
- ## Thirty seconds
18
-
19
- `note.udl` is the smallest admitted document.
20
-
21
- ```json
22
- {
23
- "instruments": [
24
- {
25
- "actionOrder": ["close", "create"],
26
- "fields": { "reference": { "type": "string" } },
27
- "id": "note",
28
- "idPrefix": "note",
29
- "lifecycle": {
30
- "initial": "open",
31
- "states": ["open", "closed"],
32
- "transitions": { "close": { "from": ["open"], "to": "closed" } }
33
- },
34
- "required": ["reference"],
35
- "summary": "A note a tenant files and later closes.",
36
- "title": "Note",
37
- "actions": {
38
- "close": { "moves": [], "steps": [], "summary": "Close the note." },
39
- "create": { "moves": [], "steps": [], "summary": "File the note." }
40
- }
41
- }
42
- ],
43
- "product": "minimal",
44
- "subjects": [],
45
- "title": "Minimal",
46
- "udl": 1,
47
- "version": 1
48
- }
49
- ```
50
-
51
- ```ts
52
- import { readFile, writeFile } from "node:fs/promises";
53
- import {
54
- canonicalDigest,
55
- diffValidatedUdlEvolution,
56
- parseUdl,
57
- serializeUdl,
58
- validateUdl,
59
- } from "@hyperscale0/udl";
60
-
61
- const document = parseUdl(await readFile("note.udl"));
62
- await writeFile("note.udl", serializeUdl(document));
63
- console.log(await canonicalDigest(document));
64
-
65
- const result = validateUdl(document);
66
- if (!result.ok) console.error(result.issues);
67
-
68
- const previous = parseUdl(await readFile("note.previous.udl"));
69
- const violations = diffValidatedUdlEvolution(previous, document);
70
- ```
71
-
72
- Every issue has a stable `UDL####` code, a category, a JSON path, a message, and a fix. Messages may become clearer. Codes do not change once published.
73
-
74
- `parseUdl` accepts a string or `Uint8Array` and rejects malformed UTF-8. `serializeUdl` validates before writing. It sorts object keys by UTF-16 code unit, keeps array order, uses two-space indentation, and writes one final line feed. `canonicalDigest` hashes those UTF-8 bytes with SHA-256 and returns a promise for the lowercase hexadecimal digest.
75
-
76
- The seven kernel operations are `internal_transfer.create`, `internal_transfer.reserve`, `internal_transfer.post`, `internal_transfer.void`, `account.escrow.provision`, `account.freeze`, and `account.unfreeze`. A `payout` is an execution intent, not another kernel operation.
77
-
78
- The compiler derives action `effects` from clauses. The validator rejects a supplied effects object unless every row and its order match. Derived effects do not consume the authored node budget.
79
-
80
- ## Command line
81
-
82
- ```bash
83
- udl validate product.udl
84
- udl fmt product.udl --write
85
- udl canon product.udl
86
- udl canon product.udl --digest
87
- udl diff frozen.udl product.udl
88
- udl explain UDL5001
89
- ```
90
-
91
- Exit code `0` means success. Exit code `1` means the validator or evolution law refused the document. Exit code `2` means the invocation or file read failed.
92
-
93
- ## Documentation
94
-
95
- - [Guide and reading order](docs/README.md)
96
- - [Format specification](spec/README.md)
97
- - [Canonical bytes law](docs/reference/canonical.md)
98
- - [Stable diagnostics](docs/reference/diagnostics.md)
99
- - [Conformance runner contract](conformance/README.md)
100
- - [Agent skill](skills/udl/SKILL.md)
101
-
102
- ## Versioning
103
-
104
- The literal `"udl": 1` is the format version. The version in `package.json` is the package version. They move independently. After package version `1.0.0`, an incompatible format change uses a new format literal and keeps an explicit reader for stored format 1 documents during its stated support window.
105
-
106
- ## Contributing and license
107
-
108
- Hyperscale accepts format proposals as issues with a use case and the conformance case they would add. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup and proof commands.
109
-
110
- UDL is AGPL-3.0-only. Hyperscale LLC also offers a commercial license. See [LICENSING.md](LICENSING.md) and [TRADEMARKS.md](TRADEMARKS.md).
16
+ From the public source checkout, run `bun install`, then `bun run build`.
17
+ `bun run check` checks schema freshness, types and package tests. Edit prose in
18
+ `spec/README.md`.
@@ -1 +1 @@
1
- {"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGnD;AAED,gFAAgF;AAChF,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAQrE"}
1
+ {"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGnD;AAED,gFAAgF;AAChF,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAQrE"}
package/dist/canonical.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { assertValidUdl } from "./validation.js";
2
- const INDENT = " ";
2
+ import { writeJson } from "./json.js";
3
3
  export function serializeUdl(value) {
4
4
  const document = assertValidUdl(value);
5
5
  return `${writeJson(document, 0)}\n`;
@@ -11,32 +11,4 @@ export async function canonicalDigest(value) {
11
11
  .map((byte) => byte.toString(16).padStart(2, "0"))
12
12
  .join("");
13
13
  }
14
- function writeJson(value, depth) {
15
- if (value === null || typeof value !== "object") {
16
- const encoded = JSON.stringify(value);
17
- if (encoded === undefined) {
18
- throw new TypeError("UDL canonical JSON received a non-JSON value");
19
- }
20
- return encoded;
21
- }
22
- const indent = INDENT.repeat(depth);
23
- const childIndent = INDENT.repeat(depth + 1);
24
- if (Array.isArray(value)) {
25
- if (value.length === 0)
26
- return "[]";
27
- return `[\n${value
28
- .map((item) => `${childIndent}${writeJson(item, depth + 1)}`)
29
- .join(",\n")}\n${indent}]`;
30
- }
31
- const record = value;
32
- const keys = Object.keys(record).sort(compareCodeUnits);
33
- if (keys.length === 0)
34
- return "{}";
35
- return `{\n${keys
36
- .map((key) => `${childIndent}${JSON.stringify(key)}: ${writeJson(record[key], depth + 1)}`)
37
- .join(",\n")}\n${indent}}`;
38
- }
39
- function compareCodeUnits(left, right) {
40
- return left < right ? -1 : left > right ? 1 : 0;
41
- }
42
14
  //# sourceMappingURL=canonical.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"canonical.js","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,MAAM,GAAG,IAAI,CAAC;AAEpB,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACvC,OAAO,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC;AAED,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAc;IAClD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAClD,SAAS,EACT,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAC9C,CAAC;IACF,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SAC/B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CA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K,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,CAC/E;SACA,IAAI,CAAC,KAAK,CAAC,KAAK,MAAM,GAAG,CAAC;AAC/B,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,KAAa;IACnD,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC"}
1
+ {"version":3,"file":"canonical.js","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACvC,OAAO,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC;AAED,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAc;IAClD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAClD,SAAS,EACT,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAC9C,CAAC;IACF,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SAC/B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SACjD,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
@@ -1,168 +1,16 @@
1
- export type UdlIssueCategory = "invalid_evolution" | "invalid_json" | "invalid_semantics" | "invalid_shape" | "invalid_utf8" | "resource_limit";
2
- export type UdlDiagnosticFamily = "admission" | "document" | "evolution" | "finance" | "gates" | "lifecycle" | "schema";
3
- declare const diagnosticDefinitions: {
4
- readonly UDL1001: {
5
- readonly category: "invalid_utf8";
6
- readonly family: "admission";
7
- readonly title: "Invalid UTF-8";
8
- readonly fix: "Encode the document as valid UTF-8.";
9
- };
10
- readonly UDL1002: {
11
- readonly category: "invalid_json";
12
- readonly family: "admission";
13
- readonly title: "Invalid JSON";
14
- readonly fix: "Repair the JSON syntax before validation.";
15
- };
16
- readonly UDL1003: {
17
- readonly category: "invalid_shape";
18
- readonly family: "admission";
19
- readonly title: "Invalid document shape";
20
- readonly fix: "Match the published UDL JSON Schema.";
21
- };
22
- readonly UDL1004: {
23
- readonly category: "resource_limit";
24
- readonly family: "admission";
25
- readonly title: "Resource limit exceeded";
26
- readonly fix: "Reduce the source size, nesting, values, strings, references, or financial paths named by the message.";
27
- };
28
- readonly UDL2001: {
29
- readonly category: "invalid_semantics";
30
- readonly family: "document";
31
- readonly title: "Duplicate declaration";
32
- readonly fix: "Give each declaration a unique name.";
33
- };
34
- readonly UDL2002: {
35
- readonly category: "invalid_semantics";
36
- readonly family: "document";
37
- readonly title: "Document law violation";
38
- readonly fix: "Repair the declaration, subject contract, or derived effects named by the message.";
39
- };
40
- readonly UDL2005: {
41
- readonly category: "invalid_semantics";
42
- readonly family: "document";
43
- readonly title: "Derived effects mismatch";
44
- readonly fix: "Regenerate the action effects from its clauses.";
45
- };
46
- readonly UDL3001: {
47
- readonly category: "invalid_semantics";
48
- readonly family: "lifecycle";
49
- readonly title: "Lifecycle is not closed";
50
- readonly fix: "Declare every state and action transition, and make every state reachable.";
51
- };
52
- readonly UDL4001: {
53
- readonly category: "invalid_semantics";
54
- readonly family: "finance";
55
- readonly title: "Money graph violation";
56
- readonly fix: "Balance every funded amount and close every hold on each lifecycle path.";
57
- };
58
- readonly UDL5001: {
59
- readonly category: "invalid_semantics";
60
- readonly family: "gates";
61
- readonly title: "Reference gate violation";
62
- readonly fix: "Point the gate at a declared instrument, action, state, field, and reference.";
63
- };
64
- readonly UDL5002: {
65
- readonly category: "invalid_semantics";
66
- readonly family: "gates";
67
- readonly title: "Check requirement violation";
68
- readonly fix: "Use a declared check with compatible evidence and recurrence.";
69
- };
70
- readonly UDL5003: {
71
- readonly category: "invalid_semantics";
72
- readonly family: "gates";
73
- readonly title: "Exposure gate violation";
74
- readonly fix: "Use declared account and money fields for the exposure gate.";
75
- };
76
- readonly UDL5004: {
77
- readonly category: "invalid_semantics";
78
- readonly family: "gates";
79
- readonly title: "Aggregate law violation";
80
- readonly fix: "Point the aggregate at compatible parent and child fields.";
81
- };
82
- readonly UDL5005: {
83
- readonly category: "invalid_semantics";
84
- readonly family: "gates";
85
- readonly title: "Settlement or payout violation";
86
- readonly fix: "Use a declared settlement account and a compatible payout statement line.";
87
- };
88
- readonly UDL5006: {
89
- readonly category: "invalid_semantics";
90
- readonly family: "gates";
91
- readonly title: "Quote and commit violation";
92
- readonly fix: "Declare one complete quote freeze set and one matching commit action.";
93
- };
94
- readonly UDL5007: {
95
- readonly category: "invalid_semantics";
96
- readonly family: "gates";
97
- readonly title: "Reconcile exception child violation";
98
- readonly fix: "Name a declared child whose reference points back to this instrument.";
99
- };
100
- readonly UDL5008: {
101
- readonly category: "invalid_semantics";
102
- readonly family: "gates";
103
- readonly title: "Action clause violation";
104
- readonly fix: "Repair the clause fields and keep incompatible clauses separate.";
105
- };
106
- readonly UDL5009: {
107
- readonly category: "invalid_semantics";
108
- readonly family: "gates";
109
- readonly title: "Reconcile exception amount field is missing or optional";
110
- readonly fix: "Name the exception child's required money field in amountField.";
111
- };
112
- readonly UDL5010: {
113
- readonly category: "invalid_semantics";
114
- readonly family: "gates";
115
- readonly title: "Reconcile exception amount field has the wrong type";
116
- readonly fix: "Point amountField at a money field declared by the exception child.";
117
- };
118
- readonly UDL5011: {
119
- readonly category: "invalid_semantics";
120
- readonly family: "gates";
121
- readonly title: "Reconcile exception reason field is missing or optional";
122
- readonly fix: "Name the exception child's required text field in reasonField.";
123
- };
124
- readonly UDL5012: {
125
- readonly category: "invalid_semantics";
126
- readonly family: "gates";
127
- readonly title: "Reconcile exception reason field has the wrong type";
128
- readonly fix: "Point reasonField at a required plain text field declared by the exception child.";
129
- };
130
- readonly UDL6001: {
131
- readonly category: "invalid_semantics";
132
- readonly family: "schema";
133
- readonly title: "Unsupported JSON Schema";
134
- readonly fix: "Use only the sealed UDL JSON Schema subset.";
135
- };
136
- readonly UDL7001: {
137
- readonly category: "invalid_evolution";
138
- readonly family: "evolution";
139
- readonly title: "Stored contract changed";
140
- readonly fix: "Keep stored identities and contracts unchanged, and add only allowed optional declarations.";
141
- };
142
- readonly UDL7002: {
143
- readonly category: "invalid_evolution";
144
- readonly family: "evolution";
145
- readonly title: "Version was not increased";
146
- readonly fix: "Increase the product version for every semantic change.";
147
- };
148
- };
149
- export type UdlIssueCode = keyof typeof diagnosticDefinitions;
150
- export interface UdlDiagnostic {
151
- readonly category: UdlIssueCategory;
152
- readonly code: UdlIssueCode;
153
- readonly family: UdlDiagnosticFamily;
154
- readonly fix: string;
155
- readonly title: string;
156
- }
157
- export declare const udlDiagnostics: readonly UdlDiagnostic[];
158
- export declare function udlDiagnostic(code: string): UdlDiagnostic | undefined;
1
+ export type UdlIssueCode = "economic_party_unbound" | "economic_move_invalid" | "economic_reservation_conflict" | "subject_field_conflict" | "subject_field_unknown" | "subject_requirement_missing" | "subject_adapter_unbound" | "subject_party_unbound" | "party_name_reserved" | "party_kind_mismatch" | "staff_role_unknown" | "product_party_unbound" | "product_party_invalid" | "UDL1003" | "UDL1004" | "UDL2001" | "UDL2002" | "UDL2010" | "UDL3001" | "UDL4001" | "UDL5001";
159
2
  export interface UdlIssue {
160
- readonly category: UdlIssueCategory;
161
- readonly code: UdlIssueCode;
162
- readonly fix: string;
163
- readonly message: string;
164
- readonly path: string;
3
+ code: UdlIssueCode;
4
+ path: string;
5
+ message: string;
6
+ fix: string;
7
+ category: string;
8
+ stranded?: {
9
+ state: string;
10
+ accounts: string[];
11
+ actions: string[];
12
+ paths: Record<string, string[]>;
13
+ };
165
14
  }
166
- export declare function issue(code: UdlIssueCode, path: string, messageDetail?: string): UdlIssue;
167
- export {};
15
+ export declare function issue(code: UdlIssueCode, path: string, message: string): UdlIssue;
168
16
  //# sourceMappingURL=diagnostics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GACxB,mBAAmB,GACnB,cAAc,GACd,mBAAmB,GACnB,eAAe,GACf,cAAc,GACd,gBAAgB,CAAC;AAErB,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,UAAU,GACV,WAAW,GACX,SAAS,GACT,OAAO,GACP,WAAW,GACX,QAAQ,CAAC;AAEb,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+J1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAKhD,CAAC;AAEJ,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAErE;AAED,MAAM,W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QV"}
@@ -1,164 +1,40 @@
1
- const diagnosticDefinitions = {
2
- UDL1001: {
3
- category: "invalid_utf8",
4
- family: "admission",
5
- title: "Invalid UTF-8",
6
- fix: "Encode the document as valid UTF-8.",
7
- },
8
- UDL1002: {
9
- category: "invalid_json",
10
- family: "admission",
11
- title: "Invalid JSON",
12
- fix: "Repair the JSON syntax before validation.",
13
- },
14
- UDL1003: {
15
- category: "invalid_shape",
16
- family: "admission",
17
- title: "Invalid document shape",
18
- fix: "Match the published UDL JSON Schema.",
19
- },
20
- UDL1004: {
21
- category: "resource_limit",
22
- family: "admission",
23
- title: "Resource limit exceeded",
24
- fix: "Reduce the source size, nesting, values, strings, references, or financial paths named by the message.",
25
- },
26
- UDL2001: {
27
- category: "invalid_semantics",
28
- family: "document",
29
- title: "Duplicate declaration",
30
- fix: "Give each declaration a unique name.",
31
- },
32
- UDL2002: {
33
- category: "invalid_semantics",
34
- family: "document",
35
- title: "Document law violation",
36
- fix: "Repair the declaration, subject contract, or derived effects named by the message.",
37
- },
38
- UDL2005: {
39
- category: "invalid_semantics",
40
- family: "document",
41
- title: "Derived effects mismatch",
42
- fix: "Regenerate the action effects from its clauses.",
43
- },
44
- UDL3001: {
45
- category: "invalid_semantics",
46
- family: "lifecycle",
47
- title: "Lifecycle is not closed",
48
- fix: "Declare every state and action transition, and make every state reachable.",
49
- },
50
- UDL4001: {
51
- category: "invalid_semantics",
52
- family: "finance",
53
- title: "Money graph violation",
54
- fix: "Balance every funded amount and close every hold on each lifecycle path.",
55
- },
56
- UDL5001: {
57
- category: "invalid_semantics",
58
- family: "gates",
59
- title: "Reference gate violation",
60
- fix: "Point the gate at a declared instrument, action, state, field, and reference.",
61
- },
62
- UDL5002: {
63
- category: "invalid_semantics",
64
- family: "gates",
65
- title: "Check requirement violation",
66
- fix: "Use a declared check with compatible evidence and recurrence.",
67
- },
68
- UDL5003: {
69
- category: "invalid_semantics",
70
- family: "gates",
71
- title: "Exposure gate violation",
72
- fix: "Use declared account and money fields for the exposure gate.",
73
- },
74
- UDL5004: {
75
- category: "invalid_semantics",
76
- family: "gates",
77
- title: "Aggregate law violation",
78
- fix: "Point the aggregate at compatible parent and child fields.",
79
- },
80
- UDL5005: {
81
- category: "invalid_semantics",
82
- family: "gates",
83
- title: "Settlement or payout violation",
84
- fix: "Use a declared settlement account and a compatible payout statement line.",
85
- },
86
- UDL5006: {
87
- category: "invalid_semantics",
88
- family: "gates",
89
- title: "Quote and commit violation",
90
- fix: "Declare one complete quote freeze set and one matching commit action.",
91
- },
92
- UDL5007: {
93
- category: "invalid_semantics",
94
- family: "gates",
95
- title: "Reconcile exception child violation",
96
- fix: "Name a declared child whose reference points back to this instrument.",
97
- },
98
- UDL5008: {
99
- category: "invalid_semantics",
100
- family: "gates",
101
- title: "Action clause violation",
102
- fix: "Repair the clause fields and keep incompatible clauses separate.",
103
- },
104
- UDL5009: {
105
- category: "invalid_semantics",
106
- family: "gates",
107
- title: "Reconcile exception amount field is missing or optional",
108
- fix: "Name the exception child's required money field in amountField.",
109
- },
110
- UDL5010: {
111
- category: "invalid_semantics",
112
- family: "gates",
113
- title: "Reconcile exception amount field has the wrong type",
114
- fix: "Point amountField at a money field declared by the exception child.",
115
- },
116
- UDL5011: {
117
- category: "invalid_semantics",
118
- family: "gates",
119
- title: "Reconcile exception reason field is missing or optional",
120
- fix: "Name the exception child's required text field in reasonField.",
121
- },
122
- UDL5012: {
123
- category: "invalid_semantics",
124
- family: "gates",
125
- title: "Reconcile exception reason field has the wrong type",
126
- fix: "Point reasonField at a required plain text field declared by the exception child.",
127
- },
128
- UDL6001: {
129
- category: "invalid_semantics",
130
- family: "schema",
131
- title: "Unsupported JSON Schema",
132
- fix: "Use only the sealed UDL JSON Schema subset.",
133
- },
134
- UDL7001: {
135
- category: "invalid_evolution",
136
- family: "evolution",
137
- title: "Stored contract changed",
138
- fix: "Keep stored identities and contracts unchanged, and add only allowed optional declarations.",
139
- },
140
- UDL7002: {
141
- category: "invalid_evolution",
142
- family: "evolution",
143
- title: "Version was not increased",
144
- fix: "Increase the product version for every semantic change.",
145
- },
1
+ const fixes = {
2
+ economic_party_unbound: "Bind sourceParty to a money party retained by this attachment.",
3
+ economic_move_invalid: "Declare a cash purpose on a cash transfer or its posting; use internal for non-cash accounting.",
4
+ economic_reservation_conflict: "Keep the reservation's economics on its posting.",
5
+ subject_field_conflict: "Rename the field or use matching types and constraints.",
6
+ subject_field_unknown: "Name a declared subject requirement or object field.",
7
+ subject_requirement_missing: "Supply the required action field.",
8
+ subject_adapter_unbound: "Bind the required adapter declaration.",
9
+ subject_party_unbound: "Bind the parameter to a subject role or declared party.",
10
+ party_name_reserved: "Choose a party name other than owner, actor or operator.",
11
+ party_kind_mismatch: "Use a business or subject role for money.",
12
+ staff_role_unknown: "Use a registered staff permission role.",
13
+ product_party_unbound: "Supply the consumed business in the Build party bindings.",
14
+ product_party_invalid: "Bind a business participant in the same tenant and environment.",
15
+ UDL1003: "Use the UDL 1 typed grammar.",
16
+ UDL1004: "Reduce the declared structure or expansion.",
17
+ UDL2001: "Give each declaration a distinct name.",
18
+ UDL2002: "Repair the named type or declaration.",
19
+ UDL2010: "Remove the invocation cycle or reduce its expansion.",
20
+ UDL3001: "Declare reachable states and one transition per action.",
21
+ UDL4001: "Fund owned accounts before spending and close them with zero balances.",
22
+ UDL5001: "Use a declared reference of the required type.",
146
23
  };
147
- export const udlDiagnostics = Object.entries(diagnosticDefinitions).map(([code, diagnostic]) => ({
148
- code: code,
149
- ...diagnostic,
150
- }));
151
- export function udlDiagnostic(code) {
152
- return udlDiagnostics.find((diagnostic) => diagnostic.code === code);
153
- }
154
- export function issue(code, path, messageDetail) {
155
- const diagnostic = diagnosticDefinitions[code];
24
+ export function issue(code, path, message) {
156
25
  return {
157
- category: diagnostic.category,
158
26
  code,
159
- fix: diagnostic.fix,
160
- message: messageDetail ?? diagnostic.title,
161
27
  path,
28
+ message,
29
+ fix: fixes[code],
30
+ category: category(code),
162
31
  };
163
32
  }
33
+ function category(code) {
34
+ return code === "UDL1003"
35
+ ? "invalid_shape"
36
+ : code === "UDL1004"
37
+ ? "resource_limit"
38
+ : "invalid_semantics";
39
+ }
164
40
  //# sourceMappingURL=diagnostics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAiBA,MAAM,qBAAqB,GAAG;IAC5B,OAAO,EAAE;QACP,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,eAAe;QACtB,GAAG,EAAE,qCAAqC;KAC3C;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,cAAc;QACrB,GAAG,EAAE,2CAA2C;KACjD;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,eAAe;QACzB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,wBAAwB;QAC/B,GAAG,EAAE,sCAAsC;KAC5C;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,gBAAgB;QAC1B,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,yBAAyB;QAChC,GAAG,EAAE,wGAAwG;KAC9G;IAED,OAAO,EAAE;QACP,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,uBAAuB;QAC9B,GAAG,EAAE,sCAAsC;KAC5C;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,wBAAwB;QAC/B,GAAG,EAAE,oFAAoF;KAC1F;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,0BAA0B;QACjC,GAAG,EAAE,iDAAiD;KACvD;IAED,OAAO,EAAE;QACP,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,yBAAyB;QAChC,G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,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,KAAK,SAAS;QACvB,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,IAAI,KAAK,SAAS;YAClB,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,mBAAmB,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as z from "zod";
2
+ import { type UdlField } from "./schema.js";
3
+ /** Values, rather than declarations. The same validator feeds forms and admission. */
4
+ export declare function udlFieldValueSchema(field: UdlField): z.ZodType;
5
+ //# sourceMappingURL=field-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-value.d.ts","sourceRoot":"","sources":["../src/field-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK/D,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,CAAC,OAAO,CA+E9D"}