@altopelago/sansa 0.14.2 → 0.15.0-rc.2
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 +118 -1
- package/README.md +96 -1
- package/conformance/README.md +8 -0
- package/conformance/aeonic-anchor-claims.json +133 -0
- package/conformance/aeonic-arithmetic-claims.json +60 -0
- package/conformance/aeonic-clock-claims.json +123 -0
- package/conformance/aeonic-comparison-claims.json +37 -0
- package/conformance/aeonic-datetime-claims.json +110 -0
- package/conformance/aeonic-rational-arithmetic-claims.json +72 -0
- package/conformance/aeonic-temporal-claims.json +105 -0
- package/conformance/cts-claims.json +17 -3
- package/conformance/results/aeonic-anchor-capacity.json +452 -0
- package/conformance/results/aeonic-anchor-snapshot-0.1.json +39 -0
- package/conformance/results/aeonic-arithmetic-snapshot-0.1.json +28 -0
- package/conformance/results/aeonic-clock-all-snapshot-0.1.json +49 -0
- package/conformance/results/aeonic-clock-arithmetic-snapshot-0.1.json +48 -0
- package/conformance/results/aeonic-clock-capacity.json +326 -0
- package/conformance/results/aeonic-clock-relations-snapshot-0.1.json +48 -0
- package/conformance/results/aeonic-comparison-snapshot-0.1.json +19 -0
- package/conformance/results/aeonic-datetime-all-snapshot-0.1.json +47 -0
- package/conformance/results/aeonic-datetime-arithmetic-snapshot-0.1.json +46 -0
- package/conformance/results/aeonic-datetime-capacity.json +302 -0
- package/conformance/results/aeonic-datetime-relations-snapshot-0.1.json +46 -0
- package/conformance/results/aeonic-rational-arithmetic-capacity.json +100 -0
- package/conformance/results/aeonic-rational-arithmetic-snapshot-0.2.json +30 -0
- package/conformance/results/aeonic-temporal-all-property-addressing-2026-11-16.json +39 -0
- package/conformance/results/aeonic-temporal-all-snapshot-0.1.json +39 -0
- package/conformance/results/aeonic-temporal-calendar-property-addressing-2026-11-16.json +38 -0
- package/conformance/results/aeonic-temporal-calendar-snapshot-0.1.json +38 -0
- package/conformance/results/aeonic-temporal-capacity-property-addressing-2026-11-16.json +136 -0
- package/conformance/results/aeonic-temporal-capacity.json +136 -0
- package/conformance/results/aeonic-temporal-relations-property-addressing-2026-11-16.json +38 -0
- package/conformance/results/aeonic-temporal-relations-snapshot-0.1.json +38 -0
- package/docs/aeonic-arithmetic.md +126 -0
- package/docs/aeonic-comparison.md +123 -0
- package/docs/aeonic-rational-arithmetic.md +167 -0
- package/docs/aeonic-temporal-civil-anchor.md +89 -0
- package/docs/aeonic-temporal-civil-clock.md +100 -0
- package/docs/aeonic-temporal-civil-date.md +124 -0
- package/docs/aeonic-temporal-civil-datetime.md +122 -0
- package/docs/api-contract.md +130 -3
- package/docs/capabilities.json +106 -2
- package/docs/child-identity-activation.md +93 -0
- package/docs/child-identity-candidate.md +60 -0
- package/docs/child-identity-tooling.md +31 -0
- package/docs/child-identity-workflows.md +102 -0
- package/docs/empty-keys-candidate.md +29 -0
- package/docs/migration-0.15.0.md +75 -0
- package/docs/property-addressing-implementation.md +118 -0
- package/docs/property-resolve-implementation.md +105 -0
- package/docs/property-selector-support.md +65 -0
- package/docs/property-selectors-api.d.ts +43 -0
- package/docs/property-selectors-api.pyi +27 -0
- package/docs/property-selectors-api.rs +48 -0
- package/docs/property-selectors-contract.md +168 -0
- package/docs/query-tool.md +32 -1
- package/docs/selector-cursor.md +45 -0
- package/docs/unicode-hardening.md +41 -0
- package/fixtures/address-v1.json +4 -3
- package/fixtures/child-identity-workflows/README.md +9 -0
- package/fixtures/child-identity-workflows/moved.aeon +10 -0
- package/fixtures/child-identity-workflows/original.aeon +10 -0
- package/fixtures/child-identity-workflows/reordered.aeon +10 -0
- package/fixtures/child-identity-workflows/replacement.aeon +10 -0
- package/fixtures/child-identity-workflows/workflows.json +89 -0
- package/fixtures/property-namespace-candidate-v1.json +336 -0
- package/fixtures/property-parser-candidate-v1.json +705 -0
- package/fixtures/property-query-candidate-v1.json +398 -0
- package/fixtures/property-resolve-candidate-v1.json +2702 -0
- package/fixtures/unicode-hardening-v1.json +401 -0
- package/package.json +30 -3
- package/scripts/calibrate-aeonic-anchor-capacity.py +294 -0
- package/scripts/calibrate-aeonic-clock-capacity.py +62 -0
- package/scripts/calibrate-aeonic-datetime-capacity.py +76 -0
- package/scripts/calibrate-aeonic-rational-capacity.py +85 -0
- package/scripts/calibrate-aeonic-temporal-capacity.py +95 -0
- package/scripts/cts-address.mjs +6 -2
- package/scripts/cts-aeonic-anchor.mjs +21 -0
- package/scripts/cts-aeonic-arithmetic-adapter.mjs +25 -0
- package/scripts/cts-aeonic-arithmetic.mjs +24 -0
- package/scripts/cts-aeonic-clock.mjs +24 -0
- package/scripts/cts-aeonic-comparison-adapter.mjs +30 -0
- package/scripts/cts-aeonic-comparison.mjs +25 -0
- package/scripts/cts-aeonic-datetime.mjs +24 -0
- package/scripts/cts-aeonic-rational-arithmetic-adapter.mjs +25 -0
- package/scripts/cts-aeonic-rational-arithmetic.mjs +24 -0
- package/scripts/cts-aeonic-temporal-civil-anchor-adapter.mjs +26 -0
- package/scripts/cts-aeonic-temporal-civil-clock-adapter.mjs +28 -0
- package/scripts/cts-aeonic-temporal-civil-date-adapter.mjs +28 -0
- package/scripts/cts-aeonic-temporal-civil-datetime-adapter.mjs +28 -0
- package/scripts/cts-aeonic-temporal.mjs +24 -0
- package/scripts/cts-instruction.mjs +4 -2
- package/scripts/cts-mutate.mjs +3 -2
- package/scripts/cts-resolve.mjs +17 -2
- package/scripts/playground.mjs +110 -0
- package/src/aeonic-arithmetic-binding.js +61 -0
- package/src/aeonic-arithmetic.d.ts +84 -0
- package/src/aeonic-arithmetic.js +276 -0
- package/src/aeonic-comparison.d.ts +86 -0
- package/src/aeonic-comparison.js +274 -0
- package/src/aeonic-convenience.d.ts +30 -0
- package/src/aeonic-convenience.js +45 -0
- package/src/aeonic-exact-number.js +34 -0
- package/src/aeonic-json.js +45 -0
- package/src/aeonic-rational-arithmetic.d.ts +86 -0
- package/src/aeonic-rational-arithmetic.js +417 -0
- package/src/aeonic-rational-json.js +51 -0
- package/src/aeonic-temporal-civil-anchor.d.ts +54 -0
- package/src/aeonic-temporal-civil-anchor.js +316 -0
- package/src/aeonic-temporal-civil-clock.d.ts +124 -0
- package/src/aeonic-temporal-civil-clock.js +388 -0
- package/src/aeonic-temporal-civil-date.d.ts +123 -0
- package/src/aeonic-temporal-civil-date.js +310 -0
- package/src/aeonic-temporal-civil-datetime.d.ts +138 -0
- package/src/aeonic-temporal-civil-datetime.js +501 -0
- package/src/index.d.ts +84 -1
- package/src/index.js +828 -183
- package/src/property-address.js +196 -0
- package/src/property-resolve.js +132 -0
- package/src/query-metadata.d.ts +16 -0
- package/src/query-metadata.js +25 -0
- package/src/selector-cursor.d.ts +19 -0
- package/src/selector-cursor.js +79 -0
- package/stress-tests/address/invalid.sansa-cases +0 -2
- package/stress-tests/address/valid.sansa-cases +3 -0
- package/tools/mutate-web/examples.mjs +1 -1
- package/tools/mutate-web/runtime.mjs +0 -2
- package/tools/playground/README.md +165 -0
- package/tools/playground/accessibility.js +91 -0
- package/tools/playground/aeon-highlight.js +77 -0
- package/tools/playground/aeon-source-composer.js +1077 -0
- package/tools/playground/anchor-examples.mjs +16 -0
- package/tools/playground/arithmetic-evaluator.mjs +28 -0
- package/tools/playground/arithmetic-model.mjs +187 -0
- package/tools/playground/arithmetic-worker.mjs +14 -0
- package/tools/playground/arithmetic.css +1 -0
- package/tools/playground/arithmetic.html +29 -0
- package/tools/playground/arithmetic.mjs +110 -0
- package/tools/playground/clock-examples.mjs +16 -0
- package/tools/playground/datetime-examples.mjs +22 -0
- package/tools/playground/examples.mjs +46 -0
- package/tools/playground/index.html +174 -0
- package/tools/playground/local.css +25 -0
- package/tools/playground/namespace.mjs +39 -0
- package/tools/playground/sansa-playground.js +1565 -0
- package/tools/playground/site.css +3914 -0
- package/tools/playground/temporal-examples.mjs +20 -0
- package/tools/playground/walkthrough.js +90 -0
- package/tools/playground/website-origin.json +16 -0
- package/tools/query-web/IDENTITY_SELECTORS.md +44 -0
- package/tools/query-web/app.js +4 -0
- package/tools/query-web/index.html +4 -0
- package/tools/query-web/runtime.mjs +70 -19
- package/tools/workflows/property-playground-assertions.mjs +33 -0
- package/tools/workflows/verify-child-identities.mjs +137 -0
- package/tools/workflows/verify-property-playground.mjs +48 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// Adapted from Aeonic comparison boundary at fefc72be3fc10db24a279862d7194507c36ec94a.
|
|
2
|
+
// MIT; see LICENSE and docs/aeonic-comparison.md. Declared order is unavailable.
|
|
3
|
+
import { FINITE_NUMBER, compareFiniteNumbers } from './aeonic-exact-number.js';
|
|
4
|
+
import { exceedsJsonDepth, parseStrictJson } from './aeonic-json.js';
|
|
5
|
+
|
|
6
|
+
const BASELINE = 'aeonic.operations.comparison.baseline.v1';
|
|
7
|
+
const CODEPOINT = 'aeonic.operations.string.codepoint.v1';
|
|
8
|
+
export const AEONIC_COMPARISON_DEFAULT_RESOURCE_LIMITS = Object.freeze({
|
|
9
|
+
maxRequestBytes: 4194304, maxRequestDepth: 32, maxNumericCharacters: 65536,
|
|
10
|
+
maxStringScalars: 65536, maxSymbolScalars: 65536,
|
|
11
|
+
maxDeclarations: 64, maxDeclaredSymbols: 1024,
|
|
12
|
+
});
|
|
13
|
+
const SUPPORTED = new Set(['finiteNumber', 'string', 'boolean', 'symbol']);
|
|
14
|
+
const DEFERRED = new Set([
|
|
15
|
+
'positiveInfinity', 'negativeInfinity', 'nan', 'explicitNull', 'explicitAbsence',
|
|
16
|
+
'toggle', 'hex', 'radix', 'encoding', 'separator', 'sansaAddress', 'referenceForm',
|
|
17
|
+
'temporal', 'container',
|
|
18
|
+
]);
|
|
19
|
+
const record = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
20
|
+
const scalar = (value) => typeof value === 'string' && !/[\uD800-\uDFFF]/u.test(value);
|
|
21
|
+
const identifier = (value) => scalar(value) && value.length > 0;
|
|
22
|
+
const pointer = (path, key) => scalar(String(key))
|
|
23
|
+
? `${path}/${String(key).replaceAll('~', '~0').replaceAll('/', '~1')}` : null;
|
|
24
|
+
|
|
25
|
+
class OperationFailure extends Error {
|
|
26
|
+
constructor(reason, stage, path) {
|
|
27
|
+
super(reason);
|
|
28
|
+
this.result = { outcome: 'diagnostic', reason, context: { stage, path } };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const stop = (reason, stage, path) => { throw new OperationFailure(reason, stage, path); };
|
|
32
|
+
const invalidPolicy = (path) => stop('invalid_policy', 3, path);
|
|
33
|
+
|
|
34
|
+
function limitsFor(options) {
|
|
35
|
+
if (!record(options)) throw new TypeError('Aeonic comparison options must be an object');
|
|
36
|
+
for (const key of Object.keys(options)) {
|
|
37
|
+
if (key !== 'resourceLimits') throw new TypeError(`Unknown trusted Aeonic comparison option: ${key}`);
|
|
38
|
+
}
|
|
39
|
+
const supplied = options.resourceLimits === undefined ? {} : options.resourceLimits;
|
|
40
|
+
if (!record(supplied)) throw new TypeError('resourceLimits must be an object');
|
|
41
|
+
for (const [name, limit] of Object.entries(supplied)) {
|
|
42
|
+
if (!Object.hasOwn(AEONIC_COMPARISON_DEFAULT_RESOURCE_LIMITS, name) || !Number.isSafeInteger(limit) || limit < 0) {
|
|
43
|
+
throw new TypeError(`Invalid trusted resource limit: ${name}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { ...AEONIC_COMPARISON_DEFAULT_RESOURCE_LIMITS, ...supplied };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function closed(object, allowed, path, reason, stage) {
|
|
50
|
+
for (const key of Object.keys(object).sort(compareScalars)) {
|
|
51
|
+
if (!allowed.includes(key)) stop(reason, stage, pointer(path, key));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function compareScalars(left, right) {
|
|
56
|
+
const a = left[Symbol.iterator]();
|
|
57
|
+
const b = right[Symbol.iterator]();
|
|
58
|
+
while (true) {
|
|
59
|
+
const x = a.next(); const y = b.next();
|
|
60
|
+
if (x.done || y.done) return x.done === y.done ? 0 : x.done ? -1 : 1;
|
|
61
|
+
const difference = x.value.codePointAt(0) - y.value.codePointAt(0);
|
|
62
|
+
if (difference !== 0) return difference < 0 ? -1 : 1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function validateText(value, path, reason, stage, nonempty, limit) {
|
|
67
|
+
if (typeof value !== 'string') stop(reason, stage, path);
|
|
68
|
+
let count = 0;
|
|
69
|
+
for (const character of value) {
|
|
70
|
+
if (character.length === 1 && /[\uD800-\uDFFF]/u.test(character)) stop(reason, stage, path);
|
|
71
|
+
count += 1;
|
|
72
|
+
if (count > limit) stop('resource_limit', stage, path);
|
|
73
|
+
}
|
|
74
|
+
if (nonempty && count === 0) stop(reason, stage, path);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function validateOrder(order, path, limits) {
|
|
78
|
+
if (!Array.isArray(order) || order.length === 0) invalidPolicy(path);
|
|
79
|
+
if (order.length > limits.maxDeclaredSymbols) stop('resource_limit', 3, path);
|
|
80
|
+
const seen = new Set();
|
|
81
|
+
for (const [index, symbol] of order.entries()) {
|
|
82
|
+
const at = pointer(path, index);
|
|
83
|
+
if (!record(symbol) || symbol.category !== 'symbol') invalidPolicy(pointer(at, 'category'));
|
|
84
|
+
closed(symbol, ['category', 'value'], at, 'invalid_policy', 3);
|
|
85
|
+
validateText(symbol.value, pointer(at, 'value'), 'invalid_policy', 3, true, limits.maxSymbolScalars);
|
|
86
|
+
if (seen.has(symbol.value)) invalidPolicy(at);
|
|
87
|
+
seen.add(symbol.value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function validateReference(reference, path) {
|
|
92
|
+
if (!record(reference)) invalidPolicy(path);
|
|
93
|
+
closed(reference, ['id', 'version'], path, 'invalid_policy', 3);
|
|
94
|
+
for (const key of ['id', 'version']) if (!identifier(reference[key])) invalidPolicy(pointer(path, key));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function validateConfig(config, path, context, limits) {
|
|
98
|
+
if (!record(config)) invalidPolicy(path);
|
|
99
|
+
closed(config, context ? ['profile', 'strings', 'symbols', 'declarations'] : ['profile', 'strings', 'symbols'], path, 'invalid_policy', 3);
|
|
100
|
+
if (Object.hasOwn(config, 'profile') && !identifier(config.profile)) invalidPolicy(pointer(path, 'profile'));
|
|
101
|
+
if (Object.hasOwn(config, 'strings')) {
|
|
102
|
+
const at = pointer(path, 'strings');
|
|
103
|
+
if (!record(config.strings)) invalidPolicy(at);
|
|
104
|
+
closed(config.strings, ['profile'], at, 'invalid_policy', 3);
|
|
105
|
+
if (!identifier(config.strings.profile)) invalidPolicy(pointer(at, 'profile'));
|
|
106
|
+
}
|
|
107
|
+
if (Object.hasOwn(config, 'symbols')) {
|
|
108
|
+
const symbols = config.symbols; const at = pointer(path, 'symbols');
|
|
109
|
+
if (!record(symbols)) invalidPolicy(at);
|
|
110
|
+
closed(symbols, ['mode', 'profile', 'declaration'], at, 'invalid_policy', 3);
|
|
111
|
+
if (!['string-profile', 'declared-order'].includes(symbols.mode)) invalidPolicy(pointer(at, 'mode'));
|
|
112
|
+
if (symbols.mode === 'string-profile') {
|
|
113
|
+
if (Object.hasOwn(symbols, 'declaration')) invalidPolicy(pointer(at, 'declaration'));
|
|
114
|
+
if (!identifier(symbols.profile)) invalidPolicy(pointer(at, 'profile'));
|
|
115
|
+
} else {
|
|
116
|
+
if (Object.hasOwn(symbols, 'profile')) invalidPolicy(pointer(at, 'profile'));
|
|
117
|
+
const declaration = symbols.declaration; const target = pointer(at, 'declaration');
|
|
118
|
+
if (!record(declaration)) invalidPolicy(target);
|
|
119
|
+
closed(declaration, ['order', 'reference'], target, 'invalid_policy', 3);
|
|
120
|
+
if (Object.hasOwn(declaration, 'order') === Object.hasOwn(declaration, 'reference')) invalidPolicy(target);
|
|
121
|
+
if (Object.hasOwn(declaration, 'order')) validateOrder(declaration.order, pointer(target, 'order'), limits);
|
|
122
|
+
else validateReference(declaration.reference, pointer(target, 'reference'));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (Object.hasOwn(config, 'declarations')) {
|
|
126
|
+
const declarations = config.declarations; const at = pointer(path, 'declarations');
|
|
127
|
+
if (!Array.isArray(declarations)) invalidPolicy(at);
|
|
128
|
+
if (declarations.length > limits.maxDeclarations) stop('resource_limit', 3, at);
|
|
129
|
+
const seen = new Set();
|
|
130
|
+
for (const [index, declaration] of declarations.entries()) {
|
|
131
|
+
const target = pointer(at, index);
|
|
132
|
+
if (!record(declaration)) invalidPolicy(target);
|
|
133
|
+
closed(declaration, ['id', 'version', 'order'], target, 'invalid_policy', 3);
|
|
134
|
+
for (const key of ['id', 'version']) if (!identifier(declaration[key])) invalidPolicy(pointer(target, key));
|
|
135
|
+
const identity = JSON.stringify([declaration.id, declaration.version]);
|
|
136
|
+
if (seen.has(identity)) invalidPolicy(target);
|
|
137
|
+
seen.add(identity);
|
|
138
|
+
validateOrder(declaration.order, pointer(target, 'order'), limits);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function resolvePolicy(input) {
|
|
144
|
+
const context = input.context ?? {}; const policy = input.policy ?? {};
|
|
145
|
+
const select = (key, fallback) => Object.hasOwn(policy, key)
|
|
146
|
+
? { value: policy[key], path: `/input/policy/${key}` }
|
|
147
|
+
: Object.hasOwn(context, key) ? { value: context[key], path: `/input/context/${key}` }
|
|
148
|
+
: { value: fallback, path: null };
|
|
149
|
+
const profile = select('profile', BASELINE);
|
|
150
|
+
if (profile.value !== BASELINE) stop('unsupported_profile', 3, profile.path);
|
|
151
|
+
const strings = select('strings', { profile: CODEPOINT });
|
|
152
|
+
if (strings.value.profile !== CODEPOINT) stop('unsupported_profile', 3, `${strings.path}/profile`);
|
|
153
|
+
const symbols = select('symbols', { mode: 'string-profile', profile: CODEPOINT });
|
|
154
|
+
let effectiveSymbols;
|
|
155
|
+
if (symbols.value.mode === 'string-profile') {
|
|
156
|
+
if (symbols.value.profile !== CODEPOINT) stop('unsupported_profile', 3, `${symbols.path}/profile`);
|
|
157
|
+
effectiveSymbols = { mode: 'string-profile', profile: CODEPOINT };
|
|
158
|
+
} else {
|
|
159
|
+
stop('unsupported_profile', 3, `${symbols.path}/mode`);
|
|
160
|
+
}
|
|
161
|
+
return { profile: BASELINE, strings: { profile: CODEPOINT }, symbols: effectiveSymbols };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function validateOperand(operand, path, limits) {
|
|
165
|
+
const invalid = (at) => stop('invalid_operand', 4, at);
|
|
166
|
+
if (!record(operand)) invalid(path);
|
|
167
|
+
if (!SUPPORTED.has(operand.category) && !DEFERRED.has(operand.category)) invalid(pointer(path, 'category'));
|
|
168
|
+
if (DEFERRED.has(operand.category)) return;
|
|
169
|
+
closed(operand, ['category', 'value'], path, 'invalid_operand', 4);
|
|
170
|
+
const at = pointer(path, 'value');
|
|
171
|
+
if (operand.category === 'boolean') {
|
|
172
|
+
if (typeof operand.value !== 'boolean') invalid(at);
|
|
173
|
+
} else if (operand.category === 'finiteNumber') {
|
|
174
|
+
if (typeof operand.value !== 'string') invalid(at);
|
|
175
|
+
if (operand.value.length > limits.maxNumericCharacters) stop('resource_limit', 4, at);
|
|
176
|
+
if (!FINITE_NUMBER.test(operand.value)) invalid(at);
|
|
177
|
+
} else {
|
|
178
|
+
validateText(operand.value, at, 'invalid_operand', 4, operand.category === 'symbol',
|
|
179
|
+
operand.category === 'symbol' ? limits.maxSymbolScalars : limits.maxStringScalars);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function objectAdmission(request, limit) {
|
|
184
|
+
const stack = [[request, 1, false]];
|
|
185
|
+
const ancestors = new Set();
|
|
186
|
+
const checkedDepth = new WeakMap();
|
|
187
|
+
while (stack.length) {
|
|
188
|
+
const [value, depth, leaving] = stack.pop();
|
|
189
|
+
if (value === null || typeof value !== 'object') continue;
|
|
190
|
+
if (leaving) {
|
|
191
|
+
ancestors.delete(value);
|
|
192
|
+
checkedDepth.set(value, depth);
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (depth > limit) stop('resource_limit', 1, null);
|
|
196
|
+
if (ancestors.has(value)) stop('invalid_operand', 2, null);
|
|
197
|
+
// Completed shared subtrees only need another visit at a greater depth.
|
|
198
|
+
// Check active ancestors first so memoization cannot hide a cycle.
|
|
199
|
+
if ((checkedDepth.get(value) ?? 0) >= depth) continue;
|
|
200
|
+
ancestors.add(value);
|
|
201
|
+
stack.push([value, depth, true]);
|
|
202
|
+
for (const child of Object.values(value)) stack.push([child, depth + 1, false]);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function evaluate(request, limits) {
|
|
207
|
+
if (!record(request)) stop('invalid_operand', 2, null);
|
|
208
|
+
if (!identifier(request.operation)) stop('invalid_operand', 2, '/operation');
|
|
209
|
+
if (!record(request.input)) stop('invalid_operand', 2, '/input');
|
|
210
|
+
for (const key of ['left', 'right']) if (!Object.hasOwn(request.input, key)) stop('invalid_operand', 2, `/input/${key}`);
|
|
211
|
+
closed(request, ['operation', 'input'], '', 'invalid_operand', 2);
|
|
212
|
+
closed(request.input, ['left', 'right', 'context', 'policy'], '/input', 'invalid_operand', 2);
|
|
213
|
+
if (!['equal', 'compare'].includes(request.operation)) stop('unsupported_operation', 2, '/operation');
|
|
214
|
+
const input = request.input;
|
|
215
|
+
if (Object.hasOwn(input, 'context')) validateConfig(input.context, '/input/context', true, limits);
|
|
216
|
+
if (Object.hasOwn(input, 'policy')) validateConfig(input.policy, '/input/policy', false, limits);
|
|
217
|
+
const effectivePolicy = resolvePolicy(input);
|
|
218
|
+
validateOperand(input.left, '/input/left', limits);
|
|
219
|
+
validateOperand(input.right, '/input/right', limits);
|
|
220
|
+
for (const key of ['left', 'right']) if (!SUPPORTED.has(input[key].category)) stop('unsupported_domain', 5, `/input/${key}/category`);
|
|
221
|
+
if (input.left.category !== input.right.category) stop('incompatible_comparison', 5, '/input');
|
|
222
|
+
const domain = input.left.category;
|
|
223
|
+
const left = input.left.value; const right = input.right.value;
|
|
224
|
+
let comparison;
|
|
225
|
+
let method;
|
|
226
|
+
if (domain === 'finiteNumber') {
|
|
227
|
+
comparison = compareFiniteNumbers(left, right); method = 'exact-numeric';
|
|
228
|
+
} else if (domain === 'boolean') {
|
|
229
|
+
comparison = left === right ? 0 : left ? 1 : -1; method = 'boolean';
|
|
230
|
+
} else { comparison = compareScalars(left, right); method = 'string-profile'; }
|
|
231
|
+
const symbol = request.operation === 'equal' ? (comparison === 0 ? 'equal' : 'notEqual')
|
|
232
|
+
: comparison < 0 ? 'less' : comparison > 0 ? 'greater' : 'equal';
|
|
233
|
+
return {
|
|
234
|
+
outcome: 'value', value: { category: 'symbol', value: symbol },
|
|
235
|
+
metadata: { effectivePolicy: { ...effectivePolicy, domain, comparison: method } },
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function guarded(action) {
|
|
240
|
+
try { return action(); }
|
|
241
|
+
catch (error) { if (error instanceof OperationFailure) return error.result; throw error; }
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** Typed logical API. Numeric text is never converted through a host float. */
|
|
245
|
+
export function evaluateAeonicComparison(request, options = {}) {
|
|
246
|
+
const limits = limitsFor(options);
|
|
247
|
+
return guarded(() => { objectAdmission(request, limits.maxRequestDepth); return evaluate(request, limits); });
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/** Exact logical JSON ingress. Byte/depth guards run before strict decoding. */
|
|
251
|
+
export function evaluateAeonicComparisonText(requestText, options = {}) {
|
|
252
|
+
if (!scalar(requestText)) throw new TypeError('requestText must be Unicode scalar text');
|
|
253
|
+
const limits = limitsFor(options);
|
|
254
|
+
return guarded(() => {
|
|
255
|
+
if (new TextEncoder().encode(requestText).byteLength > limits.maxRequestBytes || exceedsJsonDepth(requestText, limits.maxRequestDepth)) {
|
|
256
|
+
stop('resource_limit', 1, null);
|
|
257
|
+
}
|
|
258
|
+
let request;
|
|
259
|
+
try { request = parseStrictJson(requestText); }
|
|
260
|
+
catch (error) { if (error instanceof SyntaxError) stop('invalid_operand', 2, null); throw error; }
|
|
261
|
+
return evaluate(request, limits);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** Structured CTS ingress checks depth before invoking the host serializer. */
|
|
266
|
+
export function evaluateAeonicComparisonStructuredJson(request, options = {}) {
|
|
267
|
+
const limits = limitsFor(options);
|
|
268
|
+
return guarded(() => {
|
|
269
|
+
objectAdmission(request, limits.maxRequestDepth);
|
|
270
|
+
return evaluateAeonicComparisonText(JSON.stringify(request), options);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export { BASELINE as AEONIC_COMPARISON_BASELINE_PROFILE, CODEPOINT as AEONIC_COMPARISON_CODEPOINT_PROFILE };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AeonicArithmeticRequest, AeonicArithmeticOptions, AeonicArithmeticDiagnostic,
|
|
3
|
+
AeonicArithmeticValueResult, AeonicArithmeticMaterializeRequest,
|
|
4
|
+
AeonicFiniteNumber, AeonicArithmeticHistory,
|
|
5
|
+
} from './aeonic-arithmetic.js';
|
|
6
|
+
import type {
|
|
7
|
+
AeonicRationalArithmeticRequest, AeonicRationalArithmeticOptions,
|
|
8
|
+
AeonicRationalArithmeticDiagnostic, AeonicRationalArithmeticMetadata,
|
|
9
|
+
AeonicQuantizationPolicy, AeonicRationalMaterializationPolicy,
|
|
10
|
+
} from './aeonic-rational-arithmetic.js';
|
|
11
|
+
|
|
12
|
+
type Materialized<M, S extends string> = {
|
|
13
|
+
readonly outcome: 'value';
|
|
14
|
+
readonly value: { readonly number: AeonicFiniteNumber; readonly history: AeonicArithmeticHistory };
|
|
15
|
+
readonly metadata: { readonly steps: readonly { readonly step: S; readonly metadata: M }[] };
|
|
16
|
+
};
|
|
17
|
+
export type AeonicArithmeticOutputPolicy = AeonicArithmeticMaterializeRequest['input']['policy'];
|
|
18
|
+
export type AeonicRationalOutputPolicy = AeonicRationalMaterializationPolicy & { readonly quantize?: AeonicQuantizationPolicy };
|
|
19
|
+
export type AeonicArithmeticCombinedResult =
|
|
20
|
+
| Materialized<AeonicArithmeticValueResult['metadata'], 'calculation' | 'materialization'>
|
|
21
|
+
| (AeonicArithmeticDiagnostic & { readonly step: 'calculation' | 'materialization' });
|
|
22
|
+
export type AeonicRationalArithmeticCombinedResult =
|
|
23
|
+
| Materialized<AeonicRationalArithmeticMetadata, 'calculation' | 'quantization' | 'materialization'>
|
|
24
|
+
| (AeonicRationalArithmeticDiagnostic & { readonly step: 'calculation' | 'quantization' | 'materialization' });
|
|
25
|
+
/** Application composition, not a frozen operation result. Family is explicit; errors have no partial value. */
|
|
26
|
+
export function evaluateAeonicArithmeticAndMaterialize(request: AeonicArithmeticRequest, output: AeonicArithmeticOutputPolicy, options?: AeonicArithmeticOptions): AeonicArithmeticCombinedResult;
|
|
27
|
+
export function evaluateAeonicArithmeticAndMaterializeText(requestText: string, output: AeonicArithmeticOutputPolicy, options?: AeonicArithmeticOptions): AeonicArithmeticCombinedResult;
|
|
28
|
+
/** Quantization is explicit. Metadata retains each operation's policy/evaluation and the final history. */
|
|
29
|
+
export function evaluateAeonicRationalArithmeticAndMaterialize(request: AeonicRationalArithmeticRequest, output: AeonicRationalOutputPolicy, options?: AeonicRationalArithmeticOptions): AeonicRationalArithmeticCombinedResult;
|
|
30
|
+
export function evaluateAeonicRationalArithmeticAndMaterializeText(requestText: string, output: AeonicRationalOutputPolicy, options?: AeonicRationalArithmeticOptions): AeonicRationalArithmeticCombinedResult;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Adapted from Aeonic rational arithmetic/convenience at 64347f19181041f86135e958da5a16ecc4b60b57.
|
|
2
|
+
// Copyright (c) 2026 Patrik. MIT; see LICENSE and docs/aeonic-rational-arithmetic.md.
|
|
3
|
+
import { evaluateAeonicArithmetic, evaluateAeonicArithmeticText } from './aeonic-arithmetic.js';
|
|
4
|
+
import { evaluateAeonicRationalArithmetic, evaluateAeonicRationalArithmeticText } from './aeonic-rational-arithmetic.js';
|
|
5
|
+
|
|
6
|
+
const record = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
7
|
+
|
|
8
|
+
function combine(request, output, options, first, next, rational) {
|
|
9
|
+
if (!record(output) || !Object.hasOwn(output, 'family')) {
|
|
10
|
+
throw new TypeError('Combined arithmetic requires an output object with an explicit family.');
|
|
11
|
+
}
|
|
12
|
+
const calculated = first(request, options);
|
|
13
|
+
if (calculated.outcome !== 'value') return { ...calculated, step: 'calculation' };
|
|
14
|
+
const steps = [{ step: 'calculation', metadata: calculated.metadata }];
|
|
15
|
+
const context = { profile: calculated.metadata.effectivePolicy.profile };
|
|
16
|
+
let value = calculated.value;
|
|
17
|
+
if (rational && Object.hasOwn(output, 'quantize')) {
|
|
18
|
+
const quantized = next({ operation: 'quantize', input: { value, context, policy: output.quantize } }, options);
|
|
19
|
+
if (quantized.outcome !== 'value') return { ...quantized, step: 'quantization' };
|
|
20
|
+
steps.push({ step: 'quantization', metadata: quantized.metadata }); value = quantized.value;
|
|
21
|
+
}
|
|
22
|
+
const policy = rational ? Object.fromEntries(Object.entries(output).filter(([key]) => key !== 'quantize')) : output;
|
|
23
|
+
const materialized = next({ operation: 'materialize', input: { value, context, policy } }, options);
|
|
24
|
+
if (materialized.outcome !== 'value') return { ...materialized, step: 'materialization' };
|
|
25
|
+
steps.push({ step: 'materialization', metadata: materialized.metadata });
|
|
26
|
+
return { outcome: 'value', value: materialized.value, metadata: { steps } };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Application convenience composition, separate from frozen operation results.
|
|
30
|
+
* output is a materialization policy; rational output may also contain an explicit
|
|
31
|
+
* quantize policy. Diagnostics add step, retain their operation-local context,
|
|
32
|
+
* and expose no intermediate values. Engine limits apply independently per step.
|
|
33
|
+
*/
|
|
34
|
+
export function evaluateAeonicArithmeticAndMaterialize(request, output, options = {}) {
|
|
35
|
+
return combine(request, output, options, evaluateAeonicArithmetic, evaluateAeonicArithmetic, false);
|
|
36
|
+
}
|
|
37
|
+
export function evaluateAeonicArithmeticAndMaterializeText(requestText, output, options = {}) {
|
|
38
|
+
return combine(requestText, output, options, evaluateAeonicArithmeticText, evaluateAeonicArithmetic, false);
|
|
39
|
+
}
|
|
40
|
+
export function evaluateAeonicRationalArithmeticAndMaterialize(request, output, options = {}) {
|
|
41
|
+
return combine(request, output, options, evaluateAeonicRationalArithmetic, evaluateAeonicRationalArithmetic, true);
|
|
42
|
+
}
|
|
43
|
+
export function evaluateAeonicRationalArithmeticAndMaterializeText(requestText, output, options = {}) {
|
|
44
|
+
return combine(requestText, output, options, evaluateAeonicRationalArithmeticText, evaluateAeonicRationalArithmetic, true);
|
|
45
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Adapted from SANSA src/index.js at 4f05ea935a684ada91a8cd6f8f75367730c1430f.
|
|
2
|
+
// Copyright (c) 2026 Patrik. MIT; see LICENSE and docs/aeonic-comparison.md.
|
|
3
|
+
// Input grammar and resource checks belong to the staged operation boundary.
|
|
4
|
+
export const FINITE_NUMBER = /^[+-]?(?:(?:0|[1-9][0-9]*)(?:\.[0-9]+)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?$(?![\s\S])/u;
|
|
5
|
+
|
|
6
|
+
function parts(value) {
|
|
7
|
+
const match = /^([+-]?)(?:(0|[1-9][0-9]*)(?:\.([0-9]+))?|\.([0-9]+))(?:[eE]([+-]?[0-9]+))?$(?![\s\S])/u.exec(value);
|
|
8
|
+
const fraction = match[3] ?? match[4] ?? '';
|
|
9
|
+
const digits = `${match[2] ?? ''}${fraction}`.replace(/^0+/u, '');
|
|
10
|
+
if (digits.length === 0) return { sign: 0, digits: '0', scale: 0n };
|
|
11
|
+
return {
|
|
12
|
+
sign: match[1] === '-' ? -1 : 1,
|
|
13
|
+
digits,
|
|
14
|
+
scale: BigInt(match[5] ?? '0') - BigInt(fraction.length),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function compareFiniteNumbers(left, right) {
|
|
19
|
+
const a = parts(left);
|
|
20
|
+
const b = parts(right);
|
|
21
|
+
if (a.sign !== b.sign) return a.sign < b.sign ? -1 : 1;
|
|
22
|
+
if (a.sign === 0) return 0;
|
|
23
|
+
const aOrder = BigInt(a.digits.length) + a.scale;
|
|
24
|
+
const bOrder = BigInt(b.digits.length) + b.scale;
|
|
25
|
+
let comparison;
|
|
26
|
+
if (aOrder !== bOrder) comparison = aOrder < bOrder ? -1 : 1;
|
|
27
|
+
else {
|
|
28
|
+
const width = Math.max(a.digits.length, b.digits.length);
|
|
29
|
+
const aDigits = a.digits.padEnd(width, '0');
|
|
30
|
+
const bDigits = b.digits.padEnd(width, '0');
|
|
31
|
+
comparison = aDigits === bDigits ? 0 : aDigits < bDigits ? -1 : 1;
|
|
32
|
+
}
|
|
33
|
+
return a.sign === -1 ? -comparison : comparison;
|
|
34
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// JSON.parse loses duplicate member names before a reviver can inspect them.
|
|
2
|
+
// This decoder retains JSON's string/number grammar and rejects duplicate keys.
|
|
3
|
+
export function parseStrictJson(text) {
|
|
4
|
+
const result = JSON.parse(text);
|
|
5
|
+
const stack = [];
|
|
6
|
+
for (let offset = 0; offset < text.length; offset += 1) {
|
|
7
|
+
const character = text[offset];
|
|
8
|
+
if (character === '"') {
|
|
9
|
+
const start = offset;
|
|
10
|
+
while (++offset < text.length) {
|
|
11
|
+
if (text[offset] === '\\') offset += 1;
|
|
12
|
+
else if (text[offset] === '"') break;
|
|
13
|
+
}
|
|
14
|
+
const context = stack.at(-1);
|
|
15
|
+
if (context?.object && context.key) {
|
|
16
|
+
const key = JSON.parse(text.slice(start, offset + 1));
|
|
17
|
+
if (context.keys.has(key)) throw new SyntaxError('Duplicate JSON member');
|
|
18
|
+
context.keys.add(key);
|
|
19
|
+
context.key = false;
|
|
20
|
+
}
|
|
21
|
+
} else if (character === '{') stack.push({ object: true, key: true, keys: new Set() });
|
|
22
|
+
else if (character === '[') stack.push({ object: false });
|
|
23
|
+
else if (character === '}' || character === ']') stack.pop();
|
|
24
|
+
else if (character === ',' && stack.at(-1)?.object) stack.at(-1).key = true;
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function exceedsJsonDepth(text, limit) {
|
|
30
|
+
let depth = 0;
|
|
31
|
+
let quoted = false;
|
|
32
|
+
let escaped = false;
|
|
33
|
+
for (const character of text) {
|
|
34
|
+
if (quoted) {
|
|
35
|
+
if (escaped) escaped = false;
|
|
36
|
+
else if (character === '\\') escaped = true;
|
|
37
|
+
else if (character === '"') quoted = false;
|
|
38
|
+
} else if (character === '"') quoted = true;
|
|
39
|
+
else if (character === '{' || character === '[') {
|
|
40
|
+
depth += 1;
|
|
41
|
+
if (depth > limit) return true;
|
|
42
|
+
} else if (character === '}' || character === ']') depth -= 1;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AeonicArithmeticResourceLimits, AeonicArithmeticOperand, AeonicArithmeticHistory,
|
|
3
|
+
AeonicFiniteNumber, AeonicExactNumber, AeonicArithmeticOutputFamily, AeonicArithmeticDiagnostic,
|
|
4
|
+
} from './aeonic-arithmetic.js';
|
|
5
|
+
|
|
6
|
+
export const AEONIC_RATIONAL_ARITHMETIC_PROFILE: 'aeonic.operations.arithmetic.rational.v1';
|
|
7
|
+
export interface AeonicRationalArithmeticResourceLimits extends AeonicArithmeticResourceLimits {
|
|
8
|
+
readonly maxDenominatorDigits: number;
|
|
9
|
+
}
|
|
10
|
+
export const AEONIC_RATIONAL_ARITHMETIC_DEFAULT_RESOURCE_LIMITS: Readonly<AeonicRationalArithmeticResourceLimits>;
|
|
11
|
+
export interface AeonicRationalArithmeticOptions {
|
|
12
|
+
readonly resourceLimits?: Partial<AeonicRationalArithmeticResourceLimits>;
|
|
13
|
+
}
|
|
14
|
+
/** Normalized internal value coefficient × 10^exponent / denominator; not an AEON literal. */
|
|
15
|
+
export interface AeonicExactRational {
|
|
16
|
+
readonly category: 'exactRational';
|
|
17
|
+
readonly coefficient: string;
|
|
18
|
+
readonly exponent: string;
|
|
19
|
+
readonly denominator: string;
|
|
20
|
+
}
|
|
21
|
+
export type AeonicRationalArithmeticOperand = AeonicArithmeticOperand
|
|
22
|
+
| { readonly number: AeonicExactRational; readonly history: AeonicArithmeticHistory };
|
|
23
|
+
export type AeonicRoundingMode = 'half-even' | 'half-away-from-zero' | 'half-toward-zero'
|
|
24
|
+
| 'toward-zero' | 'away-from-zero' | 'floor' | 'ceiling';
|
|
25
|
+
export interface AeonicRationalArithmeticPolicy { readonly profile?: string }
|
|
26
|
+
export interface AeonicQuantizationPolicy extends AeonicRationalArithmeticPolicy {
|
|
27
|
+
readonly increment: AeonicExactNumber;
|
|
28
|
+
readonly rounding: AeonicRoundingMode;
|
|
29
|
+
}
|
|
30
|
+
export interface AeonicRationalMaterializationPolicy extends AeonicRationalArithmeticPolicy {
|
|
31
|
+
readonly family: AeonicArithmeticOutputFamily;
|
|
32
|
+
readonly zeroSign?: 'positive' | 'negative';
|
|
33
|
+
}
|
|
34
|
+
export interface AeonicRationalArithmeticBinaryRequest {
|
|
35
|
+
readonly operation: 'add' | 'subtract' | 'multiply' | 'divide';
|
|
36
|
+
readonly input: {
|
|
37
|
+
readonly left: AeonicRationalArithmeticOperand;
|
|
38
|
+
readonly right: AeonicRationalArithmeticOperand;
|
|
39
|
+
readonly context?: AeonicRationalArithmeticPolicy;
|
|
40
|
+
readonly policy?: AeonicRationalArithmeticPolicy;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface AeonicQuantizeRequest {
|
|
44
|
+
readonly operation: 'quantize';
|
|
45
|
+
readonly input: {
|
|
46
|
+
readonly value: AeonicRationalArithmeticOperand;
|
|
47
|
+
readonly context?: AeonicRationalArithmeticPolicy;
|
|
48
|
+
readonly policy: AeonicQuantizationPolicy;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface AeonicRationalMaterializeRequest {
|
|
52
|
+
readonly operation: 'materialize';
|
|
53
|
+
readonly input: {
|
|
54
|
+
readonly value: AeonicRationalArithmeticOperand;
|
|
55
|
+
readonly context?: AeonicRationalArithmeticPolicy;
|
|
56
|
+
readonly policy: AeonicRationalMaterializationPolicy;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export type AeonicRationalArithmeticRequest = AeonicRationalArithmeticBinaryRequest
|
|
60
|
+
| AeonicQuantizeRequest | AeonicRationalMaterializeRequest;
|
|
61
|
+
export type AeonicRationalArithmeticDiagnostic = Omit<AeonicArithmeticDiagnostic, 'reason'> & {
|
|
62
|
+
readonly reason: AeonicArithmeticDiagnostic['reason'] | 'division_by_zero';
|
|
63
|
+
};
|
|
64
|
+
export interface AeonicRationalArithmeticMetadata {
|
|
65
|
+
readonly evaluation: 'exact-for-operands' | 'rounded-for-operands';
|
|
66
|
+
readonly effectivePolicy: {
|
|
67
|
+
readonly profile: typeof AEONIC_RATIONAL_ARITHMETIC_PROFILE;
|
|
68
|
+
readonly increment?: AeonicExactNumber;
|
|
69
|
+
readonly rounding?: AeonicRoundingMode;
|
|
70
|
+
readonly family?: AeonicArithmeticOutputFamily;
|
|
71
|
+
readonly zeroSign?: 'positive' | 'negative';
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface AeonicRationalArithmeticValueResult {
|
|
75
|
+
readonly outcome: 'value';
|
|
76
|
+
readonly value:
|
|
77
|
+
| { readonly number: AeonicFiniteNumber; readonly history: AeonicArithmeticHistory }
|
|
78
|
+
| { readonly number: AeonicExactNumber; readonly history: AeonicArithmeticHistory }
|
|
79
|
+
| { readonly number: AeonicExactRational; readonly history: AeonicArithmeticHistory };
|
|
80
|
+
readonly metadata: AeonicRationalArithmeticMetadata;
|
|
81
|
+
}
|
|
82
|
+
export type AeonicRationalArithmeticResult = AeonicRationalArithmeticValueResult | AeonicRationalArithmeticDiagnostic;
|
|
83
|
+
/** Structured JSON admission. Requires explicit rational profile at runtime; no profile fallback. */
|
|
84
|
+
export function evaluateAeonicRationalArithmetic(request: AeonicRationalArithmeticRequest, options?: AeonicRationalArithmeticOptions): AeonicRationalArithmeticResult;
|
|
85
|
+
/** Verbatim scalar JSON ingress with byte/depth/duplicate-key admission. */
|
|
86
|
+
export function evaluateAeonicRationalArithmeticText(requestText: string, options?: AeonicRationalArithmeticOptions): AeonicRationalArithmeticResult;
|