@hyperscale0/udl 1.0.0 → 1.0.124
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 +5 -216
- package/LICENSE.md +356 -0
- package/NOTICE.md +8 -0
- package/README.md +14 -106
- package/dist/canonical.d.ts.map +1 -1
- package/dist/canonical.js +1 -29
- package/dist/canonical.js.map +1 -1
- package/dist/diagnostics.d.ts +13 -165
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +33 -157
- package/dist/diagnostics.js.map +1 -1
- package/dist/field-value.d.ts +5 -0
- package/dist/field-value.d.ts.map +1 -0
- package/dist/field-value.js +85 -0
- package/dist/field-value.js.map +1 -0
- package/dist/finance.d.ts +10 -53
- package/dist/finance.d.ts.map +1 -1
- package/dist/finance.js +252 -536
- package/dist/finance.js.map +1 -1
- package/dist/index.d.ts +9 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +2 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +30 -0
- package/dist/json.js.map +1 -0
- package/dist/limits.d.ts +3 -28
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +5 -31
- package/dist/limits.js.map +1 -1
- package/dist/object-contract.d.ts +140 -0
- package/dist/object-contract.d.ts.map +1 -0
- package/dist/object-contract.js +314 -0
- package/dist/object-contract.js.map +1 -0
- package/dist/object-semantics-schema.d.ts +5710 -0
- package/dist/object-semantics-schema.d.ts.map +1 -0
- package/dist/object-semantics-schema.js +119 -0
- package/dist/object-semantics-schema.js.map +1 -0
- package/dist/object-semantics.d.ts +6 -0
- package/dist/object-semantics.d.ts.map +1 -0
- package/dist/object-semantics.js +279 -0
- package/dist/object-semantics.js.map +1 -0
- package/dist/object-structures.d.ts +4 -0
- package/dist/object-structures.d.ts.map +1 -0
- package/dist/object-structures.js +134 -0
- package/dist/object-structures.js.map +1 -0
- package/dist/reporting-validation.d.ts +8 -0
- package/dist/reporting-validation.d.ts.map +1 -0
- package/dist/reporting-validation.js +252 -0
- package/dist/reporting-validation.js.map +1 -0
- package/dist/reporting.d.ts +477 -0
- package/dist/reporting.d.ts.map +1 -0
- package/dist/reporting.js +169 -0
- package/dist/reporting.js.map +1 -0
- package/dist/schema.d.ts +5572 -2710
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +444 -1121
- package/dist/schema.js.map +1 -1
- package/dist/validation.d.ts +10 -73
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +1109 -2569
- package/dist/validation.js.map +1 -1
- package/docs/assets/brand/manifest.json +30 -0
- package/docs/assets/brand/udl-horizontal-white.svg +1 -0
- package/docs/assets/brand/udl-horizontal.svg +1 -0
- package/docs/assets/brand/udl-stacked-white.svg +1 -0
- package/docs/assets/brand/udl-stacked.svg +1 -0
- package/docs/assets/udl.svg +11 -0
- package/package.json +13 -22
- package/spec/README.md +300 -172
- package/spec/cars.udl.json +249 -0
- package/spec/udl.schema.json +3066 -2242
- package/src/canonical.ts +1 -35
- package/src/diagnostics.ts +76 -209
- package/src/field-value.ts +87 -0
- package/src/finance.ts +327 -832
- package/src/index.ts +18 -95
- package/src/json.ts +34 -0
- package/src/limits.ts +5 -31
- package/src/object-contract.ts +559 -0
- package/src/object-semantics-schema.ts +148 -0
- package/src/object-semantics.ts +378 -0
- package/src/object-structures.ts +255 -0
- package/src/reporting-validation.ts +383 -0
- package/src/reporting.ts +178 -0
- package/src/schema.ts +510 -1277
- package/src/validation.ts +1630 -4545
- package/LICENSE +0 -661
- package/LICENSING.md +0 -51
- package/TRADEMARKS.md +0 -35
- package/conformance/README.md +0 -82
- package/conformance/evolution/action-contract.expected.json +0 -10
- package/conformance/evolution/action-contract.live.udl +0 -44
- package/conformance/evolution/action-contract.next.udl +0 -45
- package/conformance/evolution/product-identity.expected.json +0 -10
- package/conformance/evolution/product-identity.live.udl +0 -55
- package/conformance/evolution/product-identity.next.udl +0 -55
- package/conformance/evolution/version-required.expected.json +0 -10
- package/conformance/evolution/version-required.live.udl +0 -55
- package/conformance/evolution/version-required.next.udl +0 -58
- package/conformance/invalid/action-without-transition.expected.json +0 -10
- package/conformance/invalid/action-without-transition.udl +0 -60
- package/conformance/invalid/agent-description-too-long.expected.json +0 -10
- package/conformance/invalid/agent-description-too-long.udl +0 -57
- package/conformance/invalid/blank-title.expected.json +0 -10
- package/conformance/invalid/blank-title.udl +0 -54
- package/conformance/invalid/composition-dial-duplicate-key.expected.json +0 -10
- package/conformance/invalid/composition-dial-duplicate-key.udl +0 -73
- package/conformance/invalid/depth-budget.expected.json +0 -10
- package/conformance/invalid/depth-budget.udl +0 -49
- package/conformance/invalid/duplicate-subject.expected.json +0 -10
- package/conformance/invalid/duplicate-subject.udl +0 -230
- package/conformance/invalid/forged-effects.expected.json +0 -10
- package/conformance/invalid/forged-effects.udl +0 -76
- package/conformance/invalid/format-version.expected.json +0 -10
- package/conformance/invalid/format-version.udl +0 -54
- package/conformance/invalid/instrument-id-not-snake-case.expected.json +0 -10
- package/conformance/invalid/instrument-id-not-snake-case.udl +0 -54
- package/conformance/invalid/invalid-aggregate-gate-shape.expected.json +0 -10
- package/conformance/invalid/invalid-aggregate-gate-shape.udl +0 -1819
- package/conformance/invalid/invalid-check-duration.expected.json +0 -10
- package/conformance/invalid/invalid-check-duration.udl +0 -219
- package/conformance/invalid/invalid-dial-anchor.expected.json +0 -10
- package/conformance/invalid/invalid-dial-anchor.udl +0 -219
- package/conformance/invalid/invalid-exception-parent-ref.expected.json +0 -10
- package/conformance/invalid/invalid-exception-parent-ref.udl +0 -2487
- package/conformance/invalid/invalid-exposure-shape.expected.json +0 -10
- package/conformance/invalid/invalid-exposure-shape.udl +0 -1819
- package/conformance/invalid/invalid-remainder.expected.json +0 -10
- package/conformance/invalid/invalid-remainder.udl +0 -220
- package/conformance/invalid/invalid-schema-keyword.expected.json +0 -10
- package/conformance/invalid/invalid-schema-keyword.udl +0 -220
- package/conformance/invalid/invalid-utf8.expected.json +0 -10
- package/conformance/invalid/invalid-utf8.udl +0 -1
- package/conformance/invalid/malformed-json.expected.json +0 -10
- package/conformance/invalid/malformed-json.udl +0 -1
- package/conformance/invalid/missing-create-action.expected.json +0 -10
- package/conformance/invalid/missing-create-action.udl +0 -48
- package/conformance/invalid/missing-exception-amount-field.expected.json +0 -10
- package/conformance/invalid/missing-exception-amount-field.udl +0 -2487
- package/conformance/invalid/missing-exception-contract.expected.json +0 -14
- package/conformance/invalid/missing-exception-contract.udl +0 -2523
- package/conformance/invalid/missing-exception-reason-field.expected.json +0 -10
- package/conformance/invalid/missing-exception-reason-field.udl +0 -2487
- package/conformance/invalid/not-an-object.expected.json +0 -10
- package/conformance/invalid/not-an-object.udl +0 -1
- package/conformance/invalid/payout-reconcile-not-a-bank-debit.expected.json +0 -10
- package/conformance/invalid/payout-reconcile-not-a-bank-debit.udl +0 -259
- package/conformance/invalid/quote-freeze-set-incomplete.expected.json +0 -10
- package/conformance/invalid/quote-freeze-set-incomplete.udl +0 -261
- package/conformance/invalid/quote-named-reference-gate.expected.json +0 -10
- package/conformance/invalid/quote-named-reference-gate.udl +0 -50
- package/conformance/invalid/reconcile-named-reference-gate.expected.json +0 -10
- package/conformance/invalid/reconcile-named-reference-gate.udl +0 -50
- package/conformance/invalid/unknown-key.expected.json +0 -10
- package/conformance/invalid/unknown-key.udl +0 -55
- package/conformance/invalid/unknown-reference-gate-field.expected.json +0 -10
- package/conformance/invalid/unknown-reference-gate-field.udl +0 -1819
- package/conformance/invalid/unknown-required-field.expected.json +0 -10
- package/conformance/invalid/unknown-required-field.udl +0 -220
- package/conformance/invalid/unreachable-state.expected.json +0 -10
- package/conformance/invalid/unreachable-state.udl +0 -55
- package/conformance/invalid/wrong-exception-amount-field.expected.json +0 -10
- package/conformance/invalid/wrong-exception-amount-field.udl +0 -2487
- package/conformance/invalid/wrong-exception-reason-field.expected.json +0 -10
- package/conformance/invalid/wrong-exception-reason-field.udl +0 -2487
- package/conformance/valid/agent-description.expected.json +0 -6
- package/conformance/valid/agent-description.udl +0 -66
- package/conformance/valid/cards.expected.json +0 -6
- package/conformance/valid/cards.udl +0 -1579
- package/conformance/valid/commerce-escrow.expected.json +0 -6
- package/conformance/valid/commerce-escrow.udl +0 -1512
- package/conformance/valid/compiled-crowdfunding.expected.json +0 -6
- package/conformance/valid/compiled-crowdfunding.udl +0 -1843
- package/conformance/valid/compiled-watch-club.expected.json +0 -6
- package/conformance/valid/compiled-watch-club.udl +0 -2486
- package/conformance/valid/complete-contract.expected.json +0 -6
- package/conformance/valid/complete-contract.udl +0 -218
- package/conformance/valid/effect-signatures.expected.json +0 -6
- package/conformance/valid/effect-signatures.udl +0 -75
- package/conformance/valid/hand-edited.expected.json +0 -6
- package/conformance/valid/hand-edited.udl +0 -1
- package/conformance/valid/insured-car-marketplace.expected.json +0 -6
- package/conformance/valid/insured-car-marketplace.udl +0 -1050
- package/conformance/valid/insured-travel.expected.json +0 -6
- package/conformance/valid/insured-travel.udl +0 -3469
- package/conformance/valid/minimal.expected.json +0 -6
- package/conformance/valid/minimal.udl +0 -54
- package/conformance/valid/protection.expected.json +0 -6
- package/conformance/valid/protection.udl +0 -1551
- package/conformance/valid/string-escaping.expected.json +0 -6
- package/conformance/valid/string-escaping.udl +0 -54
- package/dist/check-profiles.d.ts +0 -57
- package/dist/check-profiles.d.ts.map +0 -1
- package/dist/check-profiles.js +0 -62
- package/dist/check-profiles.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -184
- package/dist/cli.js.map +0 -1
- package/dist/effects.d.ts +0 -41
- package/dist/effects.d.ts.map +0 -1
- package/dist/effects.js +0 -110
- package/dist/effects.js.map +0 -1
- package/dist/evolution.d.ts +0 -120
- package/dist/evolution.d.ts.map +0 -1
- package/dist/evolution.js +0 -567
- package/dist/evolution.js.map +0 -1
- package/dist/parser.d.ts +0 -4
- package/dist/parser.d.ts.map +0 -1
- package/dist/parser.js +0 -44
- package/dist/parser.js.map +0 -1
- package/docs/README.md +0 -14
- package/docs/guide/01-a-document.md +0 -37
- package/docs/guide/02-money-steps.md +0 -23
- package/docs/guide/03-laws.md +0 -18
- package/docs/guide/04-fees-and-remainder.md +0 -15
- package/docs/guide/05-checks-updates-dials.md +0 -7
- package/docs/guide/06-effects.md +0 -11
- package/docs/guide/07-evolution.md +0 -11
- package/docs/guide/08-implementing.md +0 -13
- package/docs/llms-full.txt +0 -1241
- package/docs/llms.txt +0 -14
- package/docs/reference/canonical.md +0 -16
- package/docs/reference/clauses.md +0 -986
- package/docs/reference/cli.md +0 -22
- package/docs/reference/diagnostics.md +0 -32
- package/skills/udl/SKILL.md +0 -28
- package/src/check-profiles.ts +0 -80
- package/src/cli.ts +0 -196
- package/src/effects.ts +0 -163
- package/src/evolution.ts +0 -965
- package/src/parser.ts +0 -58
package/src/index.ts
CHANGED
|
@@ -1,99 +1,22 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
3
|
-
export { issue, udlDiagnostic, udlDiagnostics } from "./diagnostics.js";
|
|
4
|
-
export type {
|
|
5
|
-
UdlDiagnostic,
|
|
6
|
-
UdlDiagnosticFamily,
|
|
7
|
-
UdlIssue,
|
|
8
|
-
UdlIssueCategory,
|
|
9
|
-
UdlIssueCode,
|
|
10
|
-
} from "./diagnostics.js";
|
|
11
|
-
export {
|
|
12
|
-
udlCheckEvidenceProfile,
|
|
13
|
-
udlCheckEvidenceProfiles,
|
|
14
|
-
type UdlCheckEvidenceProfile,
|
|
15
|
-
} from "./check-profiles.js";
|
|
16
|
-
export { fixedIsoDurationMs } from "./duration.js";
|
|
17
|
-
export {
|
|
18
|
-
deriveUdlActionEffects,
|
|
19
|
-
movementClass,
|
|
20
|
-
udlEffectKinds,
|
|
21
|
-
type DerivedUdlEffects,
|
|
22
|
-
type UdlEffectKind,
|
|
23
|
-
type UdlMovementClass,
|
|
24
|
-
} from "./effects.js";
|
|
25
|
-
export {
|
|
26
|
-
analyzeInstrumentFinance,
|
|
27
|
-
type FinanceIssue,
|
|
28
|
-
type FinanceOptions,
|
|
29
|
-
} from "./finance.js";
|
|
30
|
-
export {
|
|
31
|
-
diffInstrumentEvolution,
|
|
32
|
-
diffValidatedUdlEvolution,
|
|
33
|
-
snapshotUdlInstrument,
|
|
34
|
-
} from "./evolution.js";
|
|
35
|
-
export type {
|
|
36
|
-
EvolutionFieldSnapshot,
|
|
37
|
-
EvolutionMoveSnapshot,
|
|
38
|
-
EvolutionStepSnapshot,
|
|
39
|
-
EvolutionTransitionSnapshot,
|
|
40
|
-
EvolutionActionSnapshot,
|
|
41
|
-
InstrumentEvolutionSnapshot,
|
|
42
|
-
} from "./evolution.js";
|
|
43
|
-
export {
|
|
44
|
-
quoteExpiresAtRefKey,
|
|
45
|
-
quoteFrozenRefKey,
|
|
46
|
-
quoteSeededRefKeys,
|
|
47
|
-
UDL_FORMAT_VERSION,
|
|
48
|
-
udlClauseVocabulary,
|
|
49
|
-
udlDocumentSchema,
|
|
50
|
-
udlInstrumentActionIdSchema,
|
|
51
|
-
udlKernelOperationSchema,
|
|
52
|
-
udlProviderFamilyIdSchema,
|
|
53
|
-
udlPublicActionSchema,
|
|
54
|
-
} from "./schema.js";
|
|
55
|
-
export type {
|
|
56
|
-
UdlAggregate,
|
|
57
|
-
UdlAggregateCondition,
|
|
58
|
-
UdlBinding,
|
|
59
|
-
UdlCompositionDial,
|
|
60
|
-
UdlDeclaredValuePolicy,
|
|
61
|
-
UdlDecision,
|
|
62
|
-
UdlDial,
|
|
63
|
-
UdlDocument,
|
|
64
|
-
UdlDue,
|
|
65
|
-
UdlEffects,
|
|
66
|
-
UdlExample,
|
|
67
|
-
UdlGate,
|
|
68
|
-
UdlKernelOperation,
|
|
69
|
-
UdlLifecycle,
|
|
70
|
-
UdlLifecycleTransition,
|
|
71
|
-
UdlInstrument,
|
|
72
|
-
UdlInstrumentSubject,
|
|
73
|
-
UdlPayout,
|
|
74
|
-
UdlQuote,
|
|
75
|
-
UdlProviderFamilyId,
|
|
76
|
-
UdlCheckRequirement,
|
|
77
|
-
UdlClauseCardinality,
|
|
78
|
-
UdlClauseEffect,
|
|
79
|
-
UdlReconcile,
|
|
80
|
-
UdlRemainder,
|
|
81
|
-
UdlStep,
|
|
82
|
-
UdlSubject,
|
|
83
|
-
UdlAction,
|
|
84
|
-
UdlClauseVocabularyEntry,
|
|
85
|
-
} from "./schema.js";
|
|
1
|
+
export * from "./schema.js";
|
|
2
|
+
export { serializeUdl, canonicalDigest } from "./canonical.js";
|
|
86
3
|
export {
|
|
4
|
+
validateUdl,
|
|
5
|
+
RESERVED_OBJECT_NAMES,
|
|
87
6
|
assertValidUdl,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
openReferenceShapeBudget,
|
|
7
|
+
resolveField,
|
|
8
|
+
resolveSubjectRequirement,
|
|
91
9
|
UdlError,
|
|
92
|
-
|
|
93
|
-
validateUdlJsonSchema,
|
|
94
|
-
validateUdlSchemaValue,
|
|
95
|
-
} from "./validation.js";
|
|
96
|
-
export type {
|
|
97
|
-
ReferenceShapeBudget,
|
|
98
|
-
UdlValidationResult,
|
|
10
|
+
type UdlValidationResult,
|
|
99
11
|
} from "./validation.js";
|
|
12
|
+
export { issue, type UdlIssue, type UdlIssueCode } from "./diagnostics.js";
|
|
13
|
+
export { analyzeInstrumentFinance, type FinanceIssue } from "./finance.js";
|
|
14
|
+
export { fixedIsoDurationMs } from "./duration.js";
|
|
15
|
+
|
|
16
|
+
export * from "./reporting.js";
|
|
17
|
+
export {
|
|
18
|
+
validateReportDefinition,
|
|
19
|
+
reportExpressionTypes,
|
|
20
|
+
} from "./reporting-validation.js";
|
|
21
|
+
export { udlFieldValueSchema } from "./field-value.js";
|
|
22
|
+
export * from "./object-contract.js";
|
package/src/json.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const INDENT = " ";
|
|
2
|
+
|
|
3
|
+
export function writeJson(value: unknown, depth = 0): string {
|
|
4
|
+
if (value === null || typeof value !== "object") {
|
|
5
|
+
const encoded = JSON.stringify(value);
|
|
6
|
+
if (encoded === undefined) {
|
|
7
|
+
throw new TypeError("UDL canonical JSON received a non-JSON value");
|
|
8
|
+
}
|
|
9
|
+
return encoded;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const indent = INDENT.repeat(depth);
|
|
13
|
+
const childIndent = INDENT.repeat(depth + 1);
|
|
14
|
+
if (Array.isArray(value)) {
|
|
15
|
+
if (value.length === 0) return "[]";
|
|
16
|
+
return `[\n${value
|
|
17
|
+
.map((item) => `${childIndent}${writeJson(item, depth + 1)}`)
|
|
18
|
+
.join(",\n")}\n${indent}]`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const record = value as Record<string, unknown>;
|
|
22
|
+
const keys = Object.keys(record).sort(compareCodeUnits);
|
|
23
|
+
if (keys.length === 0) return "{}";
|
|
24
|
+
return `{\n${keys
|
|
25
|
+
.map(
|
|
26
|
+
(key) =>
|
|
27
|
+
`${childIndent}${JSON.stringify(key)}: ${writeJson(record[key], depth + 1)}`,
|
|
28
|
+
)
|
|
29
|
+
.join(",\n")}\n${indent}}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function compareCodeUnits(left: string, right: string): number {
|
|
33
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
34
|
+
}
|
package/src/limits.ts
CHANGED
|
@@ -1,33 +1,7 @@
|
|
|
1
1
|
export const UDL_LIMITS = Object.freeze({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
financeTransitions: 64,
|
|
8
|
-
financeActions: 64,
|
|
9
|
-
financeWork: 4_096,
|
|
10
|
-
maxDepth: 24,
|
|
11
|
-
maxKeyLength: 128,
|
|
12
|
-
maxNodes: 10_000,
|
|
13
|
-
maxPatternLength: 320,
|
|
14
|
-
/**
|
|
15
|
-
* Upper bound on the match attempts a document-authored `pattern` can force
|
|
16
|
-
* the backtracking engine to explore at its single anchored start position.
|
|
17
|
-
* Every admitted pattern's search space is multiplied out at admission
|
|
18
|
-
* (alternation branches x optional atoms x variable-quantifier spans), so
|
|
19
|
-
* worst-case matching cost is this budget times the pattern length, not an
|
|
20
|
-
* exponential in the document author's choice of grammar.
|
|
21
|
-
*/
|
|
22
|
-
maxPatternPaths: 4_096,
|
|
23
|
-
/**
|
|
24
|
-
* Reference-shape classifications one `ReferenceShapeBudget` may buy. Each
|
|
25
|
-
* one compiles a JSON Schema validator, and a document controls both factors
|
|
26
|
-
* of the instruments x gate-fields product that asks for them.
|
|
27
|
-
*/
|
|
28
|
-
maxSchemaProbes: 2_048,
|
|
29
|
-
// The complete 2026-09-01 platform catalog serializes to 402,126 bytes.
|
|
30
|
-
maxSourceBytes: 512 * 1_024,
|
|
31
|
-
maxStringLength: 2_048,
|
|
32
|
-
maxTotalStringLength: 256 * 1_024,
|
|
2
|
+
maxDepth: 32,
|
|
3
|
+
maxKeyLength: 240,
|
|
4
|
+
maxNodes: 100_000,
|
|
5
|
+
maxSourceBytes: 1_024 * 1_024,
|
|
6
|
+
maxTotalStringLength: 1_024 * 1_024,
|
|
33
7
|
});
|