@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,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"instruments": [
|
|
3
|
+
{
|
|
4
|
+
"actionOrder": [
|
|
5
|
+
"close",
|
|
6
|
+
"create"
|
|
7
|
+
],
|
|
8
|
+
"actions": {
|
|
9
|
+
"close": {
|
|
10
|
+
"moves": [],
|
|
11
|
+
"steps": [],
|
|
12
|
+
"summary": "Close the note."
|
|
13
|
+
},
|
|
14
|
+
"create": {
|
|
15
|
+
"moves": [],
|
|
16
|
+
"steps": [],
|
|
17
|
+
"summary": "File the note."
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"fields": {
|
|
21
|
+
"reference": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"id": "note",
|
|
26
|
+
"idPrefix": "note",
|
|
27
|
+
"lifecycle": {
|
|
28
|
+
"initial": "open",
|
|
29
|
+
"states": [
|
|
30
|
+
"open",
|
|
31
|
+
"closed"
|
|
32
|
+
],
|
|
33
|
+
"transitions": {
|
|
34
|
+
"close": {
|
|
35
|
+
"from": [
|
|
36
|
+
"open"
|
|
37
|
+
],
|
|
38
|
+
"to": "closed"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": [
|
|
43
|
+
"reference"
|
|
44
|
+
],
|
|
45
|
+
"summary": "A lone surrogate \ud800 stays escaped; U+2028
and U+007F stay literal.",
|
|
46
|
+
"title": "Canonical string escaping"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"product": "canonical_string_escaping",
|
|
50
|
+
"subjects": [],
|
|
51
|
+
"title": "Canonical string escaping",
|
|
52
|
+
"udl": 1,
|
|
53
|
+
"version": 1
|
|
54
|
+
}
|
package/dist/canonical.d.ts
CHANGED
package/dist/canonical.d.ts.map
CHANGED
|
@@ -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"}
|
|
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"}
|
package/dist/canonical.js
CHANGED
|
@@ -4,6 +4,13 @@ export function serializeUdl(value) {
|
|
|
4
4
|
const document = assertValidUdl(value);
|
|
5
5
|
return `${writeJson(document, 0)}\n`;
|
|
6
6
|
}
|
|
7
|
+
/** SHA-256 over the canonical UTF-8 bytes, encoded as lowercase hexadecimal. */
|
|
8
|
+
export async function canonicalDigest(value) {
|
|
9
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(serializeUdl(value)));
|
|
10
|
+
return [...new Uint8Array(digest)]
|
|
11
|
+
.map((byte) => byte.toString(16).padStart(2, "0"))
|
|
12
|
+
.join("");
|
|
13
|
+
}
|
|
7
14
|
function writeJson(value, depth) {
|
|
8
15
|
if (value === null || typeof value !== "object") {
|
|
9
16
|
const encoded = JSON.stringify(value);
|
package/dist/canonical.js.map
CHANGED
|
@@ -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,SAAS,SAAS,CAAC,KAAc,EAAE,KAAa;IAC9C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,MAAM,KAAK;aACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,WAAW,GAAG,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;aAC5D,IAAI,CAAC,KAAK,CAAC,KAAK,MAAM,GAAG,CAAC;IAC/B,CAAC;IAED,M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CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,MAAM,IAAI;SACd,GAAG,CACF,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,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"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evidence profiles that an instrument action may require before it runs.
|
|
3
|
+
* The public grammar and the runtime both read this table. A pair absent here
|
|
4
|
+
* cannot gate an action.
|
|
5
|
+
*/
|
|
6
|
+
export interface UdlCheckEvidenceProfile {
|
|
7
|
+
readonly family: string;
|
|
8
|
+
readonly checkKind: string;
|
|
9
|
+
readonly kindField?: string;
|
|
10
|
+
readonly statusField: string;
|
|
11
|
+
readonly statuses: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export declare const udlCheckEvidenceProfiles: readonly [{
|
|
14
|
+
readonly family: "national_identity";
|
|
15
|
+
readonly checkKind: "identity_verification";
|
|
16
|
+
readonly kindField: "checkKind";
|
|
17
|
+
readonly statusField: "verificationStatus";
|
|
18
|
+
readonly statuses: readonly ["requested", "waiting", "completed", "rejected", "expired", "error"];
|
|
19
|
+
}, {
|
|
20
|
+
readonly family: "national_identity";
|
|
21
|
+
readonly checkKind: "contact_ownership_verification";
|
|
22
|
+
readonly kindField: "checkKind";
|
|
23
|
+
readonly statusField: "matchResult";
|
|
24
|
+
readonly statuses: readonly ["match", "no_match"];
|
|
25
|
+
}, {
|
|
26
|
+
readonly family: "credit_bureau";
|
|
27
|
+
readonly checkKind: "consumer_inquiry";
|
|
28
|
+
readonly kindField: "inquiryType";
|
|
29
|
+
readonly statusField: "bureauStatus";
|
|
30
|
+
readonly statuses: readonly ["returned", "acknowledged", "correction_required"];
|
|
31
|
+
}, {
|
|
32
|
+
readonly family: "credit_bureau";
|
|
33
|
+
readonly checkKind: "commercial_inquiry";
|
|
34
|
+
readonly kindField: "inquiryType";
|
|
35
|
+
readonly statusField: "bureauStatus";
|
|
36
|
+
readonly statuses: readonly ["returned", "acknowledged", "correction_required"];
|
|
37
|
+
}, {
|
|
38
|
+
readonly family: "credit_bureau";
|
|
39
|
+
readonly checkKind: "facility_report";
|
|
40
|
+
readonly kindField: "inquiryType";
|
|
41
|
+
readonly statusField: "bureauStatus";
|
|
42
|
+
readonly statuses: readonly ["returned", "acknowledged", "correction_required"];
|
|
43
|
+
}, {
|
|
44
|
+
readonly family: "sanctions_screening";
|
|
45
|
+
readonly checkKind: "screen";
|
|
46
|
+
readonly kindField: "checkKind";
|
|
47
|
+
readonly statusField: "screeningStatus";
|
|
48
|
+
readonly statuses: readonly ["clear", "hit", "manual_review"];
|
|
49
|
+
}, {
|
|
50
|
+
readonly family: "enforcement_instrument";
|
|
51
|
+
readonly checkKind: "note_request";
|
|
52
|
+
readonly statusField: "requestStatus";
|
|
53
|
+
readonly statuses: readonly ["debtor_approved", "debtor_rejected", "auto_cancelled"];
|
|
54
|
+
}];
|
|
55
|
+
/** Returns the tenant-gateable evidence profile for one family and check. */
|
|
56
|
+
export declare function udlCheckEvidenceProfile(family: string, checkKind: string): UdlCheckEvidenceProfile | undefined;
|
|
57
|
+
//# sourceMappingURL=check-profiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-profiles.d.ts","sourceRoot":"","sources":["../src/check-profiles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDkB,CAAC;AAExD,6EAA6E;AAC7E,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,uBAAuB,GAAG,SAAS,CAIrC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export const udlCheckEvidenceProfiles = [
|
|
2
|
+
{
|
|
3
|
+
family: "national_identity",
|
|
4
|
+
checkKind: "identity_verification",
|
|
5
|
+
kindField: "checkKind",
|
|
6
|
+
statusField: "verificationStatus",
|
|
7
|
+
statuses: [
|
|
8
|
+
"requested",
|
|
9
|
+
"waiting",
|
|
10
|
+
"completed",
|
|
11
|
+
"rejected",
|
|
12
|
+
"expired",
|
|
13
|
+
"error",
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
family: "national_identity",
|
|
18
|
+
checkKind: "contact_ownership_verification",
|
|
19
|
+
kindField: "checkKind",
|
|
20
|
+
statusField: "matchResult",
|
|
21
|
+
statuses: ["match", "no_match"],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
family: "credit_bureau",
|
|
25
|
+
checkKind: "consumer_inquiry",
|
|
26
|
+
kindField: "inquiryType",
|
|
27
|
+
statusField: "bureauStatus",
|
|
28
|
+
statuses: ["returned", "acknowledged", "correction_required"],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
family: "credit_bureau",
|
|
32
|
+
checkKind: "commercial_inquiry",
|
|
33
|
+
kindField: "inquiryType",
|
|
34
|
+
statusField: "bureauStatus",
|
|
35
|
+
statuses: ["returned", "acknowledged", "correction_required"],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
family: "credit_bureau",
|
|
39
|
+
checkKind: "facility_report",
|
|
40
|
+
kindField: "inquiryType",
|
|
41
|
+
statusField: "bureauStatus",
|
|
42
|
+
statuses: ["returned", "acknowledged", "correction_required"],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
family: "sanctions_screening",
|
|
46
|
+
checkKind: "screen",
|
|
47
|
+
kindField: "checkKind",
|
|
48
|
+
statusField: "screeningStatus",
|
|
49
|
+
statuses: ["clear", "hit", "manual_review"],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
family: "enforcement_instrument",
|
|
53
|
+
checkKind: "note_request",
|
|
54
|
+
statusField: "requestStatus",
|
|
55
|
+
statuses: ["debtor_approved", "debtor_rejected", "auto_cancelled"],
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
/** Returns the tenant-gateable evidence profile for one family and check. */
|
|
59
|
+
export function udlCheckEvidenceProfile(family, checkKind) {
|
|
60
|
+
return udlCheckEvidenceProfiles.find((profile) => profile.family === family && profile.checkKind === checkKind);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=check-profiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-profiles.js","sourceRoot":"","sources":["../src/check-profiles.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC;QACE,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,uBAAuB;QAClC,SAAS,EAAE,WAAW;QACtB,WAAW,EAAE,oBAAoB;QACjC,QAAQ,EAAE;YACR,WAAW;YACX,SAAS;YACT,WAAW;YACX,UAAU;YACV,SAAS;YACT,OAAO;SACR;KACF;IACD;QACE,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,gCAAgC;QAC3C,SAAS,EAAE,W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
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* The `udl` command.
|
|
3
|
+
* The `udl` command. Actions over the same library the compiler uses:
|
|
4
4
|
* `validate` answers whether a document is admissible, `fmt` writes the
|
|
5
5
|
* canonical bytes, and `diff` answers whether a change is legal against a
|
|
6
6
|
* document that already has live instances.
|
|
7
7
|
*/
|
|
8
8
|
import { readFile, writeFile } from "node:fs/promises";
|
|
9
|
-
import { canonicalizeUdl, diffValidatedUdlEvolution, parseUdl, UdlError, } from "./index.js";
|
|
9
|
+
import { canonicalizeUdl, canonicalDigest, diffValidatedUdlEvolution, parseUdl, UdlError, udlDiagnostic, } from "./index.js";
|
|
10
10
|
const USAGE = `udl - the Universal Domain Language toolchain
|
|
11
11
|
|
|
12
12
|
usage:
|
|
13
13
|
udl validate <file> parse <file> and report every issue found
|
|
14
14
|
udl fmt <file> [--write] print the canonical form, or rewrite the file
|
|
15
|
+
udl canon <file> [--digest] print canonical bytes, or their SHA-256 digest
|
|
15
16
|
udl diff <live> <next> check <next> against the append-only law
|
|
17
|
+
udl explain UDL#### explain one stable diagnostic code
|
|
16
18
|
udl help print this
|
|
17
19
|
|
|
18
20
|
exit codes:
|
|
@@ -31,14 +33,55 @@ async function main(argv) {
|
|
|
31
33
|
return validateCommand(rest);
|
|
32
34
|
case "fmt":
|
|
33
35
|
return formatCommand(rest);
|
|
36
|
+
case "canon":
|
|
37
|
+
return canonCommand(rest);
|
|
34
38
|
case "diff":
|
|
35
39
|
return diffCommand(rest);
|
|
40
|
+
case "explain":
|
|
41
|
+
return explainCommand(rest);
|
|
36
42
|
case undefined:
|
|
37
43
|
return usageError("udl: no command given");
|
|
38
44
|
default:
|
|
39
45
|
return usageError(`udl: unknown command ${command}`);
|
|
40
46
|
}
|
|
41
47
|
}
|
|
48
|
+
async function canonCommand(args) {
|
|
49
|
+
const digest = args.includes("--digest");
|
|
50
|
+
const [file, ...extra] = args.filter((argument) => argument !== "--digest");
|
|
51
|
+
if (file === undefined || extra.length > 0) {
|
|
52
|
+
return usageError("usage: udl canon <file> [--digest]");
|
|
53
|
+
}
|
|
54
|
+
const bytes = await readDocument(file);
|
|
55
|
+
if (bytes === null)
|
|
56
|
+
return 2;
|
|
57
|
+
let document;
|
|
58
|
+
try {
|
|
59
|
+
document = parseUdl(bytes);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
return reportIssues(file, error);
|
|
63
|
+
}
|
|
64
|
+
if (digest)
|
|
65
|
+
console.log(await canonicalDigest(document));
|
|
66
|
+
else
|
|
67
|
+
process.stdout.write(canonicalizeUdl(bytes));
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
function explainCommand(args) {
|
|
71
|
+
const [code, ...extra] = args;
|
|
72
|
+
if (code === undefined || extra.length > 0) {
|
|
73
|
+
return usageError("usage: udl explain UDL####");
|
|
74
|
+
}
|
|
75
|
+
const diagnostic = udlDiagnostic(code);
|
|
76
|
+
if (!diagnostic) {
|
|
77
|
+
return usageError(`udl: unknown diagnostic code ${code}`);
|
|
78
|
+
}
|
|
79
|
+
console.log(`${code} ${diagnostic.title}`);
|
|
80
|
+
console.log(`category: ${diagnostic.category}`);
|
|
81
|
+
console.log(`family: ${diagnostic.family}`);
|
|
82
|
+
console.log(`fix: ${diagnostic.fix}`);
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
42
85
|
async function validateCommand(args) {
|
|
43
86
|
const [file, ...extra] = args;
|
|
44
87
|
if (file === undefined || extra.length > 0) {
|
|
@@ -99,8 +142,9 @@ async function diffCommand(args) {
|
|
|
99
142
|
console.log(`${nextPath}: additive`);
|
|
100
143
|
return 0;
|
|
101
144
|
}
|
|
102
|
-
for (const violation of violations)
|
|
103
|
-
console.error(`${nextPath}: ${violation}`);
|
|
145
|
+
for (const violation of violations) {
|
|
146
|
+
console.error(`${nextPath}: ${violation.code} ${violation.path}: ${violation.message}`);
|
|
147
|
+
}
|
|
104
148
|
return 1;
|
|
105
149
|
}
|
|
106
150
|
async function readDocument(file) {
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,QAAQ,EACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EACL,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EAER,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,MAAM,KAAK,GAAG;;;;;;;;;;;;;6DAa+C,CAAC;AAE9D,KAAK,UAAU,IAAI,CAAC,IAAuB;IACzC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,MAAM,CAAC;QACZ,KAAK,IAAI,CAAC;QACV,KAAK,QAAQ;YACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,CAAC;QACX,KAAK,UAAU;YACb,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;QAC/B,KAAK,KAAK;YACR,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,OAAO;YACV,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,SAAS;YACZ,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,KAAK,SAAS;YACZ,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;QAC7C;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C,IAAY,EAAE,KAAiB;IACpD,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,KAAc;IAChD,IAAI,CAAC,CAAC,KAAK,YAAY,QAAQ,CAAC;QAAE,MAAM,KAAK,CAAC;IAC9C,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,UAAU,CAAC,OAAe;IACjC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,CAAC;AACX,CAAC;AAED,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
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;
|
|
159
|
+
export interface UdlIssue {
|
|
160
|
+
readonly category: UdlIssueCategory;
|
|
161
|
+
readonly code: UdlIssueCode;
|
|
162
|
+
readonly fix: string;
|
|
163
|
+
readonly message: string;
|
|
164
|
+
readonly path: string;
|
|
165
|
+
}
|
|
166
|
+
export declare function issue(code: UdlIssueCode, path: string, messageDetail?: string): UdlIssue;
|
|
167
|
+
export {};
|
|
168
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +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,qB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