@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
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
export * from './aeonic-temporal-civil-anchor.js';
|
|
2
|
+
export * from './aeonic-temporal-civil-clock.js';
|
|
3
|
+
export * from './aeonic-temporal-civil-datetime.js';
|
|
4
|
+
export * from './aeonic-temporal-civil-date.js';
|
|
5
|
+
export * from './aeonic-rational-arithmetic.js';
|
|
6
|
+
export * from './aeonic-convenience.js';
|
|
7
|
+
export * from './aeonic-arithmetic.js';
|
|
8
|
+
export * from './aeonic-comparison.js';
|
|
9
|
+
|
|
1
10
|
export type SansaParseErrorCode =
|
|
11
|
+
| 'SANSA_UNKNOWN_PROPERTY_SELECTOR'
|
|
12
|
+
| 'SANSA_EXPECTED_PROPERTY_ARGUMENT'
|
|
13
|
+
| 'SANSA_PROPERTY_LIMIT_EXCEEDED'
|
|
14
|
+
| 'SANSA_EXPECTED_IDENTITY'
|
|
15
|
+
| 'SANSA_UNTERMINATED_IDENTITY'
|
|
2
16
|
| 'SANSA_EMPTY_ADDRESS'
|
|
3
17
|
| 'SANSA_EXPECTED_ROOT'
|
|
4
18
|
| 'SANSA_EXPECTED_TOKEN'
|
|
@@ -81,6 +95,9 @@ export type SansaWarningCode =
|
|
|
81
95
|
| 'SANSA_NON_PORTABLE_POSITION_INDEX';
|
|
82
96
|
|
|
83
97
|
export interface SansaDiagnostic {
|
|
98
|
+
readonly limitKind?: 'payloadScalars' | 'selectors' | 'canonicalScalars';
|
|
99
|
+
readonly limit?: number;
|
|
100
|
+
readonly observed?: number;
|
|
84
101
|
readonly code: SansaParseErrorCode;
|
|
85
102
|
readonly message: string;
|
|
86
103
|
readonly index: number;
|
|
@@ -129,6 +146,12 @@ export type SansaInstructionParseResult =
|
|
|
129
146
|
| { readonly ok: false; readonly errors: readonly SansaDiagnostic[] };
|
|
130
147
|
|
|
131
148
|
export type SansaResolveErrorCode =
|
|
149
|
+
| 'SANSA_RESOLVE_INVALID_ADDRESS'
|
|
150
|
+
| 'SANSA_RESOLVE_UNSUPPORTED_IDENTITY'
|
|
151
|
+
| 'SANSA_RESOLVE_INVALID_IDENTITY'
|
|
152
|
+
| 'SANSA_RESOLVE_AMBIGUOUS_IDENTITY'
|
|
153
|
+
| 'SANSA_RESOLVE_INVALID_IDENTITY_LIMIT'
|
|
154
|
+
| 'SANSA_RESOLVE_IDENTITY_LIMIT_EXCEEDED'
|
|
132
155
|
| 'SANSA_RESOLVE_EXPECTED_NAMESPACE'
|
|
133
156
|
| 'SANSA_RESOLVE_MISSING_ROOT'
|
|
134
157
|
| 'SANSA_RESOLVE_UNSUPPORTED_CONTEXTUAL_ROOT'
|
|
@@ -140,7 +163,15 @@ export type SansaResolveErrorCode =
|
|
|
140
163
|
| 'SANSA_RESOLVE_INVALID_BINDING_LIMIT'
|
|
141
164
|
| 'SANSA_RESOLVE_BINDING_LIMIT_EXCEEDED'
|
|
142
165
|
| 'SANSA_RESOLVE_EXACT_MULTIPLICITY_VIOLATION'
|
|
143
|
-
| 'SANSA_RESOLVE_UNSUPPORTED_SELECTOR'
|
|
166
|
+
| 'SANSA_RESOLVE_UNSUPPORTED_SELECTOR'
|
|
167
|
+
| 'SANSA_RESOLVE_INVALID_PROPERTY_LIMIT'
|
|
168
|
+
| 'SANSA_RESOLVE_UNSUPPORTED_PROPERTY_SCOPE'
|
|
169
|
+
| 'SANSA_RESOLVE_UNSUPPORTED_KEY'
|
|
170
|
+
| 'SANSA_RESOLVE_UNSUPPORTED_TAG'
|
|
171
|
+
| 'SANSA_RESOLVE_PROPERTY_SCOPE_VIOLATION'
|
|
172
|
+
| 'SANSA_RESOLVE_INVALID_PROPERTY_METADATA'
|
|
173
|
+
| 'SANSA_RESOLVE_PROPERTY_ADAPTER_ERROR'
|
|
174
|
+
| 'SANSA_RESOLVE_PROPERTY_LIMIT_EXCEEDED';
|
|
144
175
|
|
|
145
176
|
export type SansaGraphErrorCode =
|
|
146
177
|
| 'SANSA_GRAPH_INVALID_INPUT'
|
|
@@ -224,6 +255,11 @@ export interface SansaResolveDiagnostic {
|
|
|
224
255
|
readonly message: string;
|
|
225
256
|
readonly index?: number;
|
|
226
257
|
readonly selectorIndex?: number;
|
|
258
|
+
/** Authored identity selected by an identity-related resolution failure. */
|
|
259
|
+
readonly identity?: string;
|
|
260
|
+
readonly property?: 'key' | 'tag' | 'headTag';
|
|
261
|
+
readonly budget?: 'maxPropertyInspections';
|
|
262
|
+
readonly causeCode?: string;
|
|
227
263
|
readonly limit?: number;
|
|
228
264
|
readonly observed?: number;
|
|
229
265
|
}
|
|
@@ -314,7 +350,30 @@ export interface SansaDatatypeNumberComponent {
|
|
|
314
350
|
export type SansaDatatypeGenericComponent = SansaDatatypeDescriptor | SansaDatatypeNumberComponent;
|
|
315
351
|
export type SansaDatatypeClarifierComponent = SansaDatatypeStringComponent | SansaDatatypeNumberComponent;
|
|
316
352
|
|
|
353
|
+
export type PropertyName = 'key' | 'tag' | 'headTag';
|
|
354
|
+
export type PropertyScopeRole = 'root' | 'inside' | 'outside';
|
|
355
|
+
export type PropertyNodeKind = 'NodeLiteral' | 'NodeHead' | 'Other';
|
|
356
|
+
export interface PropertyAccessContext<B extends object> {
|
|
357
|
+
readonly scopeRoot: B;
|
|
358
|
+
readonly evaluationRoot: B;
|
|
359
|
+
/** Present only while validating a yielded direct head of this owner. */
|
|
360
|
+
readonly directHeadOf?: B;
|
|
361
|
+
}
|
|
362
|
+
export interface PropertyAccessFault {
|
|
363
|
+
readonly type: 'SansaPropertyAccessFault';
|
|
364
|
+
readonly kind: 'invalidMetadata' | 'scopeViolation' | 'adapterFailure';
|
|
365
|
+
}
|
|
366
|
+
/** Callback faults are thrown, not returned as successful metadata. */
|
|
367
|
+
export interface PropertyAccess<B extends object> {
|
|
368
|
+
readonly scope: (binding: B, context: PropertyAccessContext<B>) => PropertyScopeRole;
|
|
369
|
+
readonly key?: (binding: B, context: PropertyAccessContext<B>) => string | undefined;
|
|
370
|
+
readonly nodeKind?: (binding: B, context: PropertyAccessContext<B>) => PropertyNodeKind;
|
|
371
|
+
readonly nodeTag?: (binding: B, context: PropertyAccessContext<B>) => string | undefined;
|
|
372
|
+
readonly nodeHeads?: (binding: B, context: PropertyAccessContext<B>) => Iterable<B>;
|
|
373
|
+
}
|
|
317
374
|
export interface SansaResolveNamespace<TBinding extends object = SansaResolveBinding> {
|
|
375
|
+
/** Explicit authoritative property capability; no name/tag field fallback. */
|
|
376
|
+
readonly properties?: PropertyAccess<TBinding>;
|
|
318
377
|
readonly root: TBinding | (() => TBinding | undefined);
|
|
319
378
|
readonly contextualRoot?: TBinding;
|
|
320
379
|
readonly children?: (binding: TBinding) => Iterable<TBinding> | readonly TBinding[] | undefined;
|
|
@@ -323,6 +382,8 @@ export interface SansaResolveNamespace<TBinding extends object = SansaResolveBin
|
|
|
323
382
|
readonly position?: (binding: TBinding, index: number) => TBinding | undefined;
|
|
324
383
|
readonly attributeSpace?: (binding: TBinding) => TBinding | undefined;
|
|
325
384
|
readonly localSpace?: (binding: TBinding, name: string) => TBinding | undefined;
|
|
385
|
+
/** Presence explicitly supports authored structural identity inspection. */
|
|
386
|
+
readonly identity?: (binding: TBinding) => string | undefined;
|
|
326
387
|
readonly name?: (binding: TBinding) => string | undefined;
|
|
327
388
|
readonly index?: (binding: TBinding) => number | undefined;
|
|
328
389
|
readonly semanticType?: (binding: TBinding) => string | undefined;
|
|
@@ -464,6 +525,12 @@ export type SansaGraphSequenceResult<TBinding extends object = SansaResolveBindi
|
|
|
464
525
|
};
|
|
465
526
|
|
|
466
527
|
export interface SansaResolveOptions<TBinding extends object = SansaResolveBinding> {
|
|
528
|
+
/** Standalone Resolve logical inspections; integer 0..1000000, default10000.
|
|
529
|
+
* No caller authority roots or mutable counter/session are accepted. */
|
|
530
|
+
readonly maxPropertyInspections?: number;
|
|
531
|
+
/** Logical child inspections; default 10000, including misses.
|
|
532
|
+
* For evaluateQuery, shared across all clauses/candidates in one invocation. */
|
|
533
|
+
readonly maxIdentityInspections?: number;
|
|
467
534
|
readonly parse?: SansaParseOptions;
|
|
468
535
|
readonly contextualRoot?: TBinding;
|
|
469
536
|
readonly allowParentFromEffectiveRoot?: boolean;
|
|
@@ -497,6 +564,7 @@ export interface SansaQueryEvaluateOptions<TBinding extends object = SansaResolv
|
|
|
497
564
|
}
|
|
498
565
|
|
|
499
566
|
export type SansaAddressActivationSelectorCapability =
|
|
567
|
+
| 'childIdentity'
|
|
500
568
|
| 'member'
|
|
501
569
|
| 'position'
|
|
502
570
|
| 'range'
|
|
@@ -511,7 +579,9 @@ export type SansaAddressActivationSelectorCapability =
|
|
|
511
579
|
|
|
512
580
|
export interface SansaAddressActivationPolicy {
|
|
513
581
|
readonly mode?: 'constrained' | 'trusted';
|
|
582
|
+
/** For childIdentity, canonical structural binding paths; scope is proven before scanning. */
|
|
514
583
|
readonly allowedRoots?: readonly (string | SansaAddress)[];
|
|
584
|
+
/** childIdentity requires constrained mode; trusted mode does not enable it. */
|
|
515
585
|
readonly allowedSelectors?: readonly SansaAddressActivationSelectorCapability[];
|
|
516
586
|
readonly allowContextualRoot?: boolean;
|
|
517
587
|
readonly maxAddressDepth?: number;
|
|
@@ -1459,7 +1529,20 @@ export interface RootSelector {
|
|
|
1459
1529
|
readonly kind: 'absolute' | 'contextual';
|
|
1460
1530
|
}
|
|
1461
1531
|
|
|
1532
|
+
export interface ChildIdentitySelector {
|
|
1533
|
+
readonly type: 'childIdentity';
|
|
1534
|
+
readonly identity: string;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
export interface PropertyFilterSelector {
|
|
1538
|
+
readonly type: 'propertyFilter';
|
|
1539
|
+
readonly property: 'key' | 'tag' | 'headTag';
|
|
1540
|
+
readonly value: string;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1462
1543
|
export type SansaSelector =
|
|
1544
|
+
| PropertyFilterSelector
|
|
1545
|
+
| ChildIdentitySelector
|
|
1463
1546
|
| MemberSelector
|
|
1464
1547
|
| PositionSelector
|
|
1465
1548
|
| PositionRangeSelector
|