@altopelago/sansa 0.14.2 → 0.15.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/CHANGELOG.md +133 -1
  2. package/README.md +98 -1
  3. package/conformance/README.md +8 -0
  4. package/conformance/aeonic-anchor-claims.json +133 -0
  5. package/conformance/aeonic-arithmetic-claims.json +60 -0
  6. package/conformance/aeonic-clock-claims.json +123 -0
  7. package/conformance/aeonic-comparison-claims.json +37 -0
  8. package/conformance/aeonic-datetime-claims.json +110 -0
  9. package/conformance/aeonic-rational-arithmetic-claims.json +72 -0
  10. package/conformance/aeonic-temporal-claims.json +105 -0
  11. package/conformance/cts-claims.json +17 -3
  12. package/conformance/results/aeonic-anchor-bounded-expansion-2026-11-24.json +39 -0
  13. package/conformance/results/aeonic-anchor-capacity-bounded-expansion-2026-11-24.json +452 -0
  14. package/conformance/results/aeonic-anchor-capacity-rc3-2026-11-24.json +452 -0
  15. package/conformance/results/aeonic-anchor-capacity.json +452 -0
  16. package/conformance/results/aeonic-anchor-rc3-2026-11-24.json +39 -0
  17. package/conformance/results/aeonic-anchor-snapshot-0.1.json +39 -0
  18. package/conformance/results/aeonic-arithmetic-snapshot-0.1.json +28 -0
  19. package/conformance/results/aeonic-clock-all-bounded-expansion-2026-11-24.json +49 -0
  20. package/conformance/results/aeonic-clock-all-rc3-2026-11-24.json +49 -0
  21. package/conformance/results/aeonic-clock-all-snapshot-0.1.json +49 -0
  22. package/conformance/results/aeonic-clock-arithmetic-bounded-expansion-2026-11-24.json +48 -0
  23. package/conformance/results/aeonic-clock-arithmetic-rc3-2026-11-24.json +48 -0
  24. package/conformance/results/aeonic-clock-arithmetic-snapshot-0.1.json +48 -0
  25. package/conformance/results/aeonic-clock-capacity-bounded-expansion-2026-11-24.json +326 -0
  26. package/conformance/results/aeonic-clock-capacity-rc3-2026-11-24.json +326 -0
  27. package/conformance/results/aeonic-clock-capacity.json +326 -0
  28. package/conformance/results/aeonic-clock-relations-bounded-expansion-2026-11-24.json +48 -0
  29. package/conformance/results/aeonic-clock-relations-rc3-2026-11-24.json +48 -0
  30. package/conformance/results/aeonic-clock-relations-snapshot-0.1.json +48 -0
  31. package/conformance/results/aeonic-comparison-snapshot-0.1.json +19 -0
  32. package/conformance/results/aeonic-datetime-all-bounded-expansion-2026-11-24.json +47 -0
  33. package/conformance/results/aeonic-datetime-all-rc3-2026-11-24.json +47 -0
  34. package/conformance/results/aeonic-datetime-all-snapshot-0.1.json +47 -0
  35. package/conformance/results/aeonic-datetime-arithmetic-bounded-expansion-2026-11-24.json +46 -0
  36. package/conformance/results/aeonic-datetime-arithmetic-rc3-2026-11-24.json +46 -0
  37. package/conformance/results/aeonic-datetime-arithmetic-snapshot-0.1.json +46 -0
  38. package/conformance/results/aeonic-datetime-capacity-bounded-expansion-2026-11-24.json +302 -0
  39. package/conformance/results/aeonic-datetime-capacity-rc3-2026-11-24.json +302 -0
  40. package/conformance/results/aeonic-datetime-capacity.json +302 -0
  41. package/conformance/results/aeonic-datetime-relations-bounded-expansion-2026-11-24.json +46 -0
  42. package/conformance/results/aeonic-datetime-relations-rc3-2026-11-24.json +46 -0
  43. package/conformance/results/aeonic-datetime-relations-snapshot-0.1.json +46 -0
  44. package/conformance/results/aeonic-rational-arithmetic-capacity.json +100 -0
  45. package/conformance/results/aeonic-rational-arithmetic-snapshot-0.2.json +30 -0
  46. package/conformance/results/aeonic-temporal-all-bounded-expansion-2026-11-24.json +39 -0
  47. package/conformance/results/aeonic-temporal-all-property-addressing-2026-11-16.json +39 -0
  48. package/conformance/results/aeonic-temporal-all-rc3-2026-11-24.json +39 -0
  49. package/conformance/results/aeonic-temporal-all-snapshot-0.1.json +39 -0
  50. package/conformance/results/aeonic-temporal-calendar-bounded-expansion-2026-11-24.json +38 -0
  51. package/conformance/results/aeonic-temporal-calendar-property-addressing-2026-11-16.json +38 -0
  52. package/conformance/results/aeonic-temporal-calendar-rc3-2026-11-24.json +38 -0
  53. package/conformance/results/aeonic-temporal-calendar-snapshot-0.1.json +38 -0
  54. package/conformance/results/aeonic-temporal-capacity-bounded-expansion-2026-11-24.json +136 -0
  55. package/conformance/results/aeonic-temporal-capacity-property-addressing-2026-11-16.json +136 -0
  56. package/conformance/results/aeonic-temporal-capacity-rc3-2026-11-24.json +136 -0
  57. package/conformance/results/aeonic-temporal-capacity.json +136 -0
  58. package/conformance/results/aeonic-temporal-relations-bounded-expansion-2026-11-24.json +38 -0
  59. package/conformance/results/aeonic-temporal-relations-property-addressing-2026-11-16.json +38 -0
  60. package/conformance/results/aeonic-temporal-relations-rc3-2026-11-24.json +38 -0
  61. package/conformance/results/aeonic-temporal-relations-snapshot-0.1.json +38 -0
  62. package/docs/aeonic-arithmetic.md +126 -0
  63. package/docs/aeonic-comparison.md +123 -0
  64. package/docs/aeonic-rational-arithmetic.md +167 -0
  65. package/docs/aeonic-temporal-civil-anchor.md +89 -0
  66. package/docs/aeonic-temporal-civil-clock.md +100 -0
  67. package/docs/aeonic-temporal-civil-date.md +124 -0
  68. package/docs/aeonic-temporal-civil-datetime.md +122 -0
  69. package/docs/api-contract.md +130 -3
  70. package/docs/capabilities.json +106 -2
  71. package/docs/child-identity-activation.md +93 -0
  72. package/docs/child-identity-candidate.md +60 -0
  73. package/docs/child-identity-tooling.md +31 -0
  74. package/docs/child-identity-workflows.md +102 -0
  75. package/docs/empty-keys-candidate.md +29 -0
  76. package/docs/migration-0.15.0.md +86 -0
  77. package/docs/property-addressing-implementation.md +118 -0
  78. package/docs/property-resolve-implementation.md +105 -0
  79. package/docs/property-selector-support.md +65 -0
  80. package/docs/property-selectors-api.d.ts +43 -0
  81. package/docs/property-selectors-api.pyi +27 -0
  82. package/docs/property-selectors-api.rs +48 -0
  83. package/docs/property-selectors-contract.md +168 -0
  84. package/docs/query-tool.md +32 -1
  85. package/docs/selector-cursor.md +45 -0
  86. package/docs/unicode-hardening.md +41 -0
  87. package/fixtures/address-v1.json +4 -3
  88. package/fixtures/child-identity-workflows/README.md +9 -0
  89. package/fixtures/child-identity-workflows/moved.aeon +10 -0
  90. package/fixtures/child-identity-workflows/original.aeon +10 -0
  91. package/fixtures/child-identity-workflows/reordered.aeon +10 -0
  92. package/fixtures/child-identity-workflows/replacement.aeon +10 -0
  93. package/fixtures/child-identity-workflows/workflows.json +89 -0
  94. package/fixtures/property-namespace-candidate-v1.json +336 -0
  95. package/fixtures/property-parser-candidate-v1.json +705 -0
  96. package/fixtures/property-query-candidate-v1.json +398 -0
  97. package/fixtures/property-resolve-candidate-v1.json +2702 -0
  98. package/fixtures/unicode-hardening-v1.json +401 -0
  99. package/package.json +30 -3
  100. package/scripts/calibrate-aeonic-anchor-capacity.py +294 -0
  101. package/scripts/calibrate-aeonic-clock-capacity.py +62 -0
  102. package/scripts/calibrate-aeonic-datetime-capacity.py +76 -0
  103. package/scripts/calibrate-aeonic-rational-capacity.py +85 -0
  104. package/scripts/calibrate-aeonic-temporal-capacity.py +95 -0
  105. package/scripts/cts-address.mjs +6 -2
  106. package/scripts/cts-aeonic-anchor.mjs +21 -0
  107. package/scripts/cts-aeonic-arithmetic-adapter.mjs +25 -0
  108. package/scripts/cts-aeonic-arithmetic.mjs +24 -0
  109. package/scripts/cts-aeonic-clock.mjs +24 -0
  110. package/scripts/cts-aeonic-comparison-adapter.mjs +30 -0
  111. package/scripts/cts-aeonic-comparison.mjs +25 -0
  112. package/scripts/cts-aeonic-datetime.mjs +24 -0
  113. package/scripts/cts-aeonic-rational-arithmetic-adapter.mjs +25 -0
  114. package/scripts/cts-aeonic-rational-arithmetic.mjs +24 -0
  115. package/scripts/cts-aeonic-temporal-civil-anchor-adapter.mjs +26 -0
  116. package/scripts/cts-aeonic-temporal-civil-clock-adapter.mjs +28 -0
  117. package/scripts/cts-aeonic-temporal-civil-date-adapter.mjs +28 -0
  118. package/scripts/cts-aeonic-temporal-civil-datetime-adapter.mjs +28 -0
  119. package/scripts/cts-aeonic-temporal.mjs +24 -0
  120. package/scripts/cts-instruction.mjs +4 -2
  121. package/scripts/cts-mutate.mjs +3 -2
  122. package/scripts/cts-resolve.mjs +17 -2
  123. package/scripts/playground.mjs +110 -0
  124. package/src/aeonic-arithmetic-binding.js +61 -0
  125. package/src/aeonic-arithmetic.d.ts +84 -0
  126. package/src/aeonic-arithmetic.js +276 -0
  127. package/src/aeonic-comparison.d.ts +86 -0
  128. package/src/aeonic-comparison.js +274 -0
  129. package/src/aeonic-convenience.d.ts +30 -0
  130. package/src/aeonic-convenience.js +45 -0
  131. package/src/aeonic-exact-number.js +34 -0
  132. package/src/aeonic-json.js +45 -0
  133. package/src/aeonic-rational-arithmetic.d.ts +86 -0
  134. package/src/aeonic-rational-arithmetic.js +417 -0
  135. package/src/aeonic-rational-json.js +51 -0
  136. package/src/aeonic-temporal-civil-anchor.d.ts +54 -0
  137. package/src/aeonic-temporal-civil-anchor.js +316 -0
  138. package/src/aeonic-temporal-civil-clock.d.ts +124 -0
  139. package/src/aeonic-temporal-civil-clock.js +388 -0
  140. package/src/aeonic-temporal-civil-date.d.ts +123 -0
  141. package/src/aeonic-temporal-civil-date.js +310 -0
  142. package/src/aeonic-temporal-civil-datetime.d.ts +138 -0
  143. package/src/aeonic-temporal-civil-datetime.js +501 -0
  144. package/src/index.d.ts +84 -1
  145. package/src/index.js +859 -190
  146. package/src/property-address.js +196 -0
  147. package/src/property-resolve.js +132 -0
  148. package/src/query-metadata.d.ts +16 -0
  149. package/src/query-metadata.js +25 -0
  150. package/src/selector-cursor.d.ts +19 -0
  151. package/src/selector-cursor.js +79 -0
  152. package/stress-tests/address/invalid.sansa-cases +0 -2
  153. package/stress-tests/address/valid.sansa-cases +3 -0
  154. package/tools/mutate-web/examples.mjs +1 -1
  155. package/tools/mutate-web/runtime.mjs +0 -2
  156. package/tools/playground/README.md +165 -0
  157. package/tools/playground/accessibility.js +91 -0
  158. package/tools/playground/aeon-highlight.js +77 -0
  159. package/tools/playground/aeon-source-composer.js +1077 -0
  160. package/tools/playground/anchor-examples.mjs +16 -0
  161. package/tools/playground/arithmetic-evaluator.mjs +28 -0
  162. package/tools/playground/arithmetic-model.mjs +187 -0
  163. package/tools/playground/arithmetic-worker.mjs +14 -0
  164. package/tools/playground/arithmetic.css +1 -0
  165. package/tools/playground/arithmetic.html +29 -0
  166. package/tools/playground/arithmetic.mjs +110 -0
  167. package/tools/playground/clock-examples.mjs +16 -0
  168. package/tools/playground/datetime-examples.mjs +22 -0
  169. package/tools/playground/examples.mjs +46 -0
  170. package/tools/playground/index.html +174 -0
  171. package/tools/playground/local.css +25 -0
  172. package/tools/playground/namespace.mjs +39 -0
  173. package/tools/playground/sansa-playground.js +1565 -0
  174. package/tools/playground/site.css +3914 -0
  175. package/tools/playground/temporal-examples.mjs +20 -0
  176. package/tools/playground/walkthrough.js +90 -0
  177. package/tools/playground/website-origin.json +16 -0
  178. package/tools/query-web/IDENTITY_SELECTORS.md +44 -0
  179. package/tools/query-web/app.js +4 -0
  180. package/tools/query-web/index.html +4 -0
  181. package/tools/query-web/runtime.mjs +70 -19
  182. package/tools/workflows/property-playground-assertions.mjs +33 -0
  183. package/tools/workflows/verify-child-identities.mjs +137 -0
  184. package/tools/workflows/verify-property-playground.mjs +48 -0
@@ -0,0 +1,168 @@
1
+ # Property selectors: candidate API contract 0.2
2
+
3
+ Status: **unreleased candidate; core direct read-only Resolve and Query implemented**.
4
+ JavaScript/TypeScript and Rust expose the optional facet. Owning AEON SDK namespaces
5
+ supply authoritative metadata; pure Python remains Resolve-only because it has no
6
+ Query evaluator. Core/WASM literal ports remain inert; existing native Pytonic
7
+ Query is a separately delivered SDK consumer. No generic callback bridge or
8
+ new WASM Query API is introduced.
9
+ The `.d.ts`, `.rs` and `.pyi` siblings retain original review sketches; current
10
+ exported types/modules and the [implementation checkpoint](property-resolve-implementation.md)
11
+ describe delivered support and limits. No profile promotion or release.
12
+ Existing capability manifests are unchanged.
13
+
14
+ ## Address and Query model
15
+
16
+ `&key("...")`, `&tag("...")` and `&headTag("...")` are suffix filters without a preceding dot.
17
+ They use the existing SANSA quoted-payload decoder/canonical emitter; no JSON-only
18
+ or host-regex replacement is allowed. Payloads may contain whitespace, escaped
19
+ quotes/backslashes and literal wildcard characters. Unknown names/extra arguments
20
+ fail. `&first`/`&last`/rank operators remain deferred.
21
+
22
+ The proposed selector is `{type:'propertyFilter', property:'key'|'tag'|'headTag', value:string}`.
23
+ Normalize caller ASTs without mutation, recompute rendering/exactness, and reject
24
+ unknown variants/invalid Unicode/unchecked accessor fields or cyclic graphs.
25
+ Property-bearing addresses have fixed candidate ceilings: 256 total selectors,
26
+ 4096 argument scalars and 65536 canonical scalars. Use bounded scratch while
27
+ recognizing/validating; do not serialize an unchecked graph. These are not a
28
+ constant work bound independent of caller input length. Preserve existing parsing
29
+ options, especially an explicitly increased position-index limit. Property-free
30
+ inputs retain existing limits and behavior.
31
+
32
+ Query `.&key("x")`/`.&tag("x")` is a distinct current-row resolution expression:
33
+ `scope:'current'`, contextual address root and the property selector. Standalone
34
+ Addressing still requires `$` or `?`. Explicit `?&key("x")` starts a contextual
35
+ boundary. Do not implement current-row syntax by a generic dot-member rewrite.
36
+ Query scanners must preserve quoted spaces, comment characters and clause words
37
+ inside arguments. An empty selected Binding Set retains its candidate result
38
+ record; a false `where exists(...)` removes it.
39
+
40
+ ## Optional namespace facet
41
+
42
+ The single additive namespace member is `properties`. Keeping accessors together
43
+ avoids confusing `binding.key`, old `namespace.name` or cached outer tags with an
44
+ opt-in authoritative property interface. No public session, index or mutable
45
+ counter is introduced.
46
+
47
+ | Operation | Contract |
48
+ | --- | --- |
49
+ | `scope(binding, context)` | Mandatory for the facet. Return `root`, `inside` or `outside`; prove both authorization and any `directHeadOf` ownership request. |
50
+ | `key(binding, context)` | Optional key support; Unicode-scalar string or absent. Root keys are hidden by the engine without calling this hook. |
51
+ | `nodeKind(binding, context)` | For tag support, exactly `NodeLiteral`, `NodeHead` or `Other`; no binding-field fallback. |
52
+ | `nodeTag(binding, context)` | For tag support, Unicode-scalar string or absent. Only called on an authorized NodeHead. |
53
+ | `nodeHeads(binding, context)` | For tag support, incremental iterable of original directly owned head handles; no flattening, eager clone or hidden suffix read. |
54
+
55
+ Both tag predicates share node support requiring all three node operations, even in an empty/non-node
56
+ namespace. Key support requires `key`; both require `scope`. JavaScript/Python
57
+ use callable presence; Rust's optional facet has required `scope`, explicit
58
+ `supports_key`/`supports_nodes` defaults false and checked fallible methods.
59
+ A supported absent value is a miss. Invalid kinds, nonstring/ill-formed values,
60
+ non-iterables and wrong-kind heads fail. Scope and metadata errors must not expose
61
+ foreign addresses, hidden values or host exception text.
62
+
63
+ `PropertyAccessContext` is engine-created/read-only, with `scopeRoot`,
64
+ `evaluationRoot` and optional `directHeadOf`. Do not accept caller authority roots
65
+ in Resolve options/ASTs. Each in-flight occurrence retains its own scope frame:
66
+ absolute namespace root; standalone contextual boundary; Query current-row
67
+ anchor retaining its originating scope; and new boundaries at explicit attribute
68
+ or local-space roots. Parent navigation is unchanged, but property inspection of
69
+ an escaped occurrence fails. The facet must not infer authority from a canonical
70
+ path. Adapters unable to prove it stay unsupported.
71
+
72
+ Only `&headTag` matches a NodeHead's own tag. `&tag` matches only a NodeLiteral, existentially inspecting its direct heads,
73
+ emitting the original container at most once per input occurrence. Stop at first
74
+ match; later navigation still starts from that container. Repeated branches retain
75
+ results and charges. Ordinary `tag` object fields and cached outer tags are ignored.
76
+
77
+ ## Failure and resource API
78
+
79
+ Use `maxPropertyInspections` (Rust `max_property_inspections`), default 10000,
80
+ portable finite integer-valued numbers 0..1000000; booleans are invalid. Integral numeric 1.0 and negative zero normalize to 1 and 0 across JSON/Python bridges before the Rust u32 field; do not coerce strings or arbitrary host objects. Invalid input/AST
81
+ comes first, then options, root validity, consumer policy and complete capability
82
+ preflight. Reject missing support before traversal even on an empty or
83
+ short-circuited branch. No metadata/child/head callback runs during preflight.
84
+
85
+ Charge a candidate before scope/kind/key access, including hidden roots, absent
86
+ keys and Other kinds. Tagging a container also charges each yielded head before
87
+ its scope/ownership/kind/tag access. One terminal `next` probe may prove an exact
88
+ budget sufficient; it must not inspect a yielded over-budget head. Iterator work
89
+ before yielding is separate host cost. Query shares one private allowance across
90
+ from/where/order/select, projections and repeated internal resolutions. A new
91
+ public/reentrant call starts a fresh allowance. Do not repurpose identity or
92
+ binding limits, cache away charges or bypass earlier `maxBindings` errors.
93
+
94
+ Exhaustion returns no partial bindings/records, with
95
+ `SANSA_RESOLVE_PROPERTY_LIMIT_EXCEEDED`, `budget:'maxPropertyInspections'`,
96
+ `limit`, `observed:limit+1`, `property` and `selectorIndex`. Query uses its existing
97
+ `phase`: `policy` for preflight or the consuming clause. Existing diagnostic span
98
+ conventions remain host-specific. Full identifiers are in the owning JSON resource.
99
+
100
+ Checked adapter faults have `invalidMetadata`, `scopeViolation` and `adapterFailure`
101
+ kinds, mapping to the corresponding property diagnostics. Other callback/iterator
102
+ exceptions map to `SANSA_RESOLVE_PROPERTY_ADAPTER_ERROR`. Existing non-property
103
+ callbacks keep their old behavior. Release iterator resources on all exits;
104
+ Python must explicitly close generators when appropriate, JavaScript uses return
105
+ and Rust Drop. An unvisited suffix is not validated after success. Rust iterator
106
+ `Err` is an iterator failure before another head's inspection, matching a thrown
107
+ JavaScript/Python next failure. Cleanup failures also fail the invocation; host
108
+ panic/abort behavior is not a portable checked-error guarantee.
109
+
110
+ <a id="provider-and-consumer-plan"></a>
111
+
112
+ ## Delivered providers and consumer admission
113
+
114
+ | Provider | Delivered development support |
115
+ | --- | --- |
116
+ | JavaScript/TypeScript and Rust SANSA | Addressing, standalone read-only Resolve and direct Query through an explicitly capable namespace; existing adapters do not opt in automatically |
117
+ | AEON TypeScript/Rust SDK | Authoritative document property facets with validated scope/direct-head ownership and streaming inspection |
118
+ | Pure Python AEON | Addressing and standalone Resolve through the optional `properties` mapping; no pure-Python Query evaluator |
119
+ | Existing native Pytonic | `Document.query()` uses the Rust SDK facet and its bounded allowance/diagnostics; no generic Python callback bridge |
120
+ | Core/native/WASM literal APIs | Existing inert parsing/representation/transport ports; no new standalone Resolve or WASM Query API |
121
+ | Portable AEOS | Explicit portable AES/Telex rule-selector APIs under the separately implemented `aeos-properties-0.1` development profile |
122
+
123
+ The [provider/host matrix](property-selector-support.md) distinguishes these APIs
124
+ from the incapable built-in CLI/workbench adapters and native-event LSP validator.
125
+ Legacy native-event AEOS validation and structural AEOS paths remain closed.
126
+ The AES Type Transpiler is deferred. Activation
127
+ (including trusted), Graph, mutation/Instruction/SO, structural AEOS paths,
128
+ references and event/storage paths stay closed. Query-shaped mutation entry points
129
+ must deny properties before traversal; a generic Query parser/evaluator must not
130
+ silently admit them. AEON literal syntax reuses Addressing; lexical integration is an owning evidence gate, not a new literal deny rule. Never
131
+ change public capability manifests or claim CTS support just because this ABI exists.
132
+
133
+ ## Delivery gates
134
+
135
+ 1. Review/merge the owning unpublished spec/resource, this API and explicit CTS
136
+ preparation target. They do not promote an immutable snapshot.
137
+ 2. Implement parser/AST/render and bounded authorization/accounting in each
138
+ advertised provider. Reuse existing payload/cursor machinery.
139
+ 3. Implement direct Query current/contextual frames and full-clause preflight,
140
+ with real Query record semantics and separate old-consumer denials.
141
+ 4. Execute every selected experimental expectation, including probe counts,
142
+ through actual source/installed/native/WASM/tooling consumers as advertised.
143
+ Unsupported instrumentation must fail, not skip expectations.
144
+ 5. Retain original reference/target checks and 1.15x latency/1.20x memory budgets;
145
+ measure the new work under an approved protocol. No inherited heap waiver.
146
+
147
+ Local positions keep their separate group/candidate/buffer/cost gate. Official
148
+ release, deployment and publication stay held. This guide does not establish complete experimental-profile or stable
149
+ conformance; selected runtime regressions and full release qualification are separate.
150
+
151
+ Owning specification input: [`ec43f7996d3d44d86e1a7639bb26d98b4fb829c1`](https://github.com/aeonite-org/aeonite-specs/commit/ec43f7996d3d44d86e1a7639bb26d98b4fb829c1). This pins the proposal, not an adopted or published profile.
152
+
153
+ ## Unreleased 0.2 kind split
154
+
155
+ `&tag("book")` retains only NodeLiteral containers with a matching direct head.
156
+ `&headTag("book")` retains only NodeHead bindings with that intrinsic tag. A
157
+ wrong-kind candidate is a charged miss after scope/kind validation; it does not
158
+ read tag metadata or enumerate heads. Neither predicate matches a StringLiteral
159
+ whose value happens to be `book`. Both share the existing node capability and
160
+ inspection allowance. `nodeTag` remains the adapter callback name for authorized
161
+ head access; it is not renamed by this grammar addition.
162
+
163
+ Child navigation stays explicit: `...&headTag("book").*` selects the matched
164
+ head's children. A recursive search can now select containers or heads without
165
+ implicitly returning both. `&key`, scope/ownership, ordering, multiplicity,
166
+ canonical structural paths, resource ceilings and prohibited-consumer admission
167
+ remain unchanged. This revises an unpublished candidate; it does not promote a
168
+ stable profile. Rust exhaustive PropertyName matches must handle HeadTag.
@@ -1,5 +1,13 @@
1
1
  # SANSA Query Tool
2
2
 
3
+ The CLI and legacy Query Workbench use their own namespace adapters. Those
4
+ adapters do not supply the property facet: a valid `&key`, `&tag` or `&headTag`
5
+ expression can parse, but evaluation returns
6
+ `SANSA_RESOLVE_UNSUPPORTED_PROPERTY_SCOPE`. This does not affect ordinary or
7
+ previously admitted identity queries. Use the SDK-backed source playground or
8
+ a capable SDK namespace for property evaluation; see the
9
+ [provider/host matrix](property-selector-support.md).
10
+
3
11
  The package includes a standalone query tool for exercising SANSA.Query against
4
12
  AEON source, portable Telex AES, reader-only Film AES, or a host-neutral JSON
5
13
  namespace fixture:
@@ -138,6 +146,29 @@ The browser UI renders the grouped example menu from that catalog, and the
138
146
  runtime tests execute the same examples against the default `.aeon` fixture
139
147
  when an AEON runtime is available.
140
148
 
149
+ ## Child identity selectors (candidate)
150
+
151
+ Read-only Query sources and address expressions accept child identity selectors
152
+ when the namespace explicitly exposes identity inspection:
153
+
154
+ ```sansa
155
+ from $.items.\first\
156
+ select .\label\
157
+ ```
158
+
159
+ The selected candidate and value retain their canonical structural paths and
160
+ original binding handles. `resolve.maxIdentityInspections` (default 10,000)
161
+ is one logical inspection budget for the entire Query invocation, including
162
+ `from`, `where`, ordering, projection fields, all candidates and repeated reads.
163
+ A miss still costs inspections; a failure returns no partial records. Enumeration
164
+ and metadata costs depend on the host adapter. Calls have independent budgets.
165
+
166
+ Dynamic `path(...)` identity activation requires the separate explicit constrained
167
+ feature and scope contract in [identity activation](child-identity-activation.md).
168
+ Trusted/default activation, references, Instruction and mutation stay guarded. Pure Python exposes Address/Resolve without a Query evaluator. The existing
169
+ native Pytonic `Document.query` facade uses the shared Rust Query engine and
170
+ its default 10,000-inspection budget; it adds no new method or keyword argument.
171
+
141
172
  ## Query Semantics
142
173
 
143
174
  Boolean context accepts explicit Boolean scalar values and single resolved
@@ -214,7 +245,7 @@ value, comparison uses the shared numeric value semantics; range, width,
214
245
  integer-only, unsigned, and precision checks remain profile or schema concerns.
215
246
  The same label-vs-family split applies to reserved aliases: `n` compares as a
216
247
  number, `bool` compares as a Boolean, `trimtick` and `prose` compare as strings,
217
- `radix2`, `radix6`, `radix8`, and `radix12` remain radix-family labels,
248
+ `radix2`, `radix6`, `radix8`, `radix12`, and `radix16` remain radix-family labels,
218
249
  `base64`, `embed`, and `inline` compare as encoded payloads, and `kadot`
219
250
  compares as a separator payload when the host exposes those representation
220
251
  families. `hex` remains distinct from radix, including `radix[16]`; no numeric
@@ -0,0 +1,45 @@
1
+ # Host-token parsing cursor
2
+
3
+ Import `parseDotSelectorFromCursor`, `parsePositionSelectorFromCursor`,
4
+ `validatePositionIndex`, and the `SansaSelectorCursor` type from
5
+ `@altopelago/sansa/parsing/selector-cursor`. This supported subpath follows
6
+ package SemVer; it is not re-exported at the root.
7
+
8
+ The shared functions own selector-step grammar. The synchronous cursor owns
9
+ lexical decoding/trivia, offsets, token consumption, resource limits and native
10
+ diagnostics. Each parse consumes exactly one dot or positional selector and
11
+ returns its SANSA selector, or an optional member/position projection. All other
12
+ selector kinds retain their normal SANSA representation. Errors propagate from
13
+ the cursor; `fail` must throw. Cursors and projection callbacks are trusted host
14
+ code and are never retained after a call. No registry, session, cache or replay
15
+ protocol is involved.
16
+
17
+ `index` is the current host offset. `peekSyntax()` exposes actual punctuation,
18
+ not the decoded contents of a quoted token. `consume` must consume or throw;
19
+ `match` consumes only on a match. `matchRangeSeparator` handles `..`. Identifier
20
+ and quoted-payload methods return decoded text. A quoted member or attribute
21
+ name may be an empty string; it remains a present property selector, distinct
22
+ from the root or an omitted token. Identifier roles retain their own validity
23
+ rules, including the nonempty requirement for local-space names.
24
+ `parseOptionalPositionIndex` returns a validated index or null for an omitted
25
+ range endpoint, and must not consume the closing bracket. Hosts may adapt token
26
+ consumption internally while presenting these semantics.
27
+
28
+ Validate each original numeric token with
29
+ `validatePositionIndex(raw, maximum, fail)` before numeric conversion. The
30
+ default maximum is 999999. An explicitly configured maximum must already be a
31
+ nonnegative safe integer; host option validation is responsible for this
32
+ precondition. Spelling is unsigned decimal without leading zeroes (except `0`).
33
+ The helper invokes `fail(message, code)` for malformed/out-of-bound values; the
34
+ host supplies source spans. A host that permits a larger maximum must surface
35
+ SANSA_NON_PORTABLE_POSITION_INDEX when it has a warning channel. Native SANSA
36
+ retains its existing larger-bound/warning behavior.
37
+
38
+ This is a grammar/transport API, not a reference admission API. The host owns
39
+ root/namespace/endpoint constraints and permitted structural lowering. AEON
40
+ references use existing structural segments and document-root shorthands; they
41
+ exclude contextual roots, parent/recursive/expansion/range/local-space/qualifier
42
+ steps and identity selectors. Successful reference validation still requires
43
+ one existing permitted binding. A singleton result or caller `isExact` flag
44
+ does not authorize additional reference syntax. Future exact path steps need
45
+ engine-owned lowering and compatible host support.
@@ -0,0 +1,41 @@
1
+ # Unicode hardening regression contract and capability inventory
2
+
3
+ These implementation regression vectors exercise existing AEON identity, SANSA
4
+ value/selector and AEOS length contracts. They do not allocate a new profile,
5
+ change normalization, promote a CTS snapshot or create a released conformance
6
+ claim. The data source is `aeonite-cts/fixtures/unicode-hardening/v1.json`;
7
+ consumer copies must match its bytes. Initial SHA-256: `41b0e1b55ffed9d3a4f9263ad95aa9340e9e0f5bca3fd8687174f1d5dbd4e9a5`.
8
+
9
+ | Operation | Required behavior / advertised surface |
10
+ | --- | --- |
11
+ | Exact keys, reference targets and canonical ordering | Retain decoded scalar sequences without normalization, case folding or ambient-locale comparison. TypeScript, Rust, pure Python and affected native facades exercise distinct keys, references, duplicate controls and canonical fixed points. |
12
+ | Default string equality and lower/upper | Existing SANSA JS/shared Rust/native Query surfaces retain exact equality and full default mapping. Casing is an implementation slice: record runtime/Unicode data rather than claiming a future locked version. Pure Python's standalone resolver does not expose Query/default case-conversion APIs. |
13
+ | Explicit locale profile | SANSA JS requires supported tr/az/lt fixtures to execute, using one complete string profile for comparison and casing. Invalid locale syntax fails through Intl; valid unsupported locales retain standard Intl fallback, recorded separately from requested locale. Shared Rust/native named locale profiles are rejected through the existing unsupported-profile boundary. No ICU provider is added. |
14
+ | Name-pattern ?/* | One code point / zero or more code points, including LF, CR, U+2028/U+2029. This is not grapheme matching. JS, Rust and pure Python Resolve keep original handles, ordering and structural paths; admitted Query consumers reuse that behavior. |
15
+ | AEOS min_length/max_length | UTF-16 code units, including ordinary, attribute, attribute-path, datatype and existing alternate-constraint routes. Do not substitute scalar or UTF-8 byte counts. Resource limits retain their separately specified units. |
16
+ | Search presentation | Both websites use explicit Unicode default lowercase for query/index-field matching, not ambient locale. AEON website search and Aeonite publication artifact search map excerpt offsets back to original UTF-16 positions, retain surrogate pairs and explicitly select English collation for title ties. Aeonite public search preserves catalog/section order and renders headings and context without excerpts. No normalization/full-casefold search claim is made. |
17
+
18
+ Default-casing fixtures include Greek final sigma, sharp-s and ligature expansion,
19
+ Kelvin/fullwidth mappings and dotted I. Locale cases include Turkish/Azeri and
20
+ Lithuanian context. Identity controls include canonical/compatibility lookalikes,
21
+ combining sequences, Hangul/Jamo, confusables, zero-width and variation selectors.
22
+ The fixture records escaped strings, code points, operation, locale and expected
23
+ values. Required supported cases must not be silently skipped. Unsupported or
24
+ unexposed APIs are distinct from passing tested capabilities.
25
+
26
+ Unicode data version is part of evidence: record Node/ICU/CLDR/Unicode, Python
27
+ and its Unicode database, and Rust/compiler library versions. Explicit locale
28
+ vectors establish bounded provider behavior, not universal cross-version
29
+ collation conformance. Preserve complete-profile requirements and equality/order
30
+ agreement; no Exact/Custom policy API is added. Normalization, full folding,
31
+ grapheme APIs and universal locale providers remain separate work.
32
+
33
+ References: existing AEON Value Semantics v1, AEOS v1 section 5.14, SANSA
34
+ Addressing/Resolve and Query; Unicode SpecialCasing 17.0 at
35
+ https://www.unicode.org/Public/17.0.0/ucd/SpecialCasing.txt. The 17.0 file is a
36
+ reference for established sample mappings, not a claim that every runtime uses
37
+ that data version. Source canonicalization is not Unicode normalization.
38
+
39
+ This candidate document and the shared fixture need owning review. Immutable
40
+ snapshot bytes and existing claim IDs stay unchanged; authority promotion and
41
+ release artifact/provider qualification remain separate gates.
@@ -253,10 +253,11 @@
253
253
  "error": "SANSA_POSITION_INDEX_LIMIT_EXCEEDED"
254
254
  },
255
255
  {
256
- "id": "reject-empty-quoted-member",
256
+ "id": "empty-quoted-member",
257
257
  "source": "$.[\"\"]",
258
- "valid": false,
259
- "error": "SANSA_EMPTY_MEMBER_NAME"
258
+ "valid": true,
259
+ "canonical": "$.[\"\"]",
260
+ "exact": true
260
261
  },
261
262
  {
262
263
  "id": "reject-empty-local-space",
@@ -0,0 +1,9 @@
1
+ # Read-only child identity workflow snapshots
2
+
3
+ The [workflow guide](../../docs/child-identity-workflows.md) explains the four
4
+ independent documents and expected structural results. `workflows.json` owns the
5
+ shared expectations. Reorder, move and replacement are authored snapshots;
6
+ no mutation/SO operation or occurrence-continuity guarantee is implied.
7
+
8
+ These are unpublished candidate regression fixtures, separate from the existing
9
+ immutable/experimental CTS inputs and original compatibility/target helpers.
@@ -0,0 +1,10 @@
1
+ west:object = {}
2
+ east:object = {
3
+ renamed\stock1\:object = {
4
+ items:list<object> = [
5
+ \item2\ = { name\name2\:string = "Bracket" }
6
+ \item1\ = { name\name1\:string = "Widget" }
7
+ ]
8
+ }
9
+ }
10
+ selection:sansa = $.east.\stock1\.items.\item1\.\name1\
@@ -0,0 +1,10 @@
1
+ west:object = {
2
+ stock\stock1\:object = {
3
+ items:list<object> = [
4
+ \item1\ = { name\name1\:string = "Widget" }
5
+ \item2\ = { name\name2\:string = "Bracket" }
6
+ ]
7
+ }
8
+ }
9
+ east:object = {}
10
+ selection:sansa = $.west.\stock1\.items.\item1\.\name1\
@@ -0,0 +1,10 @@
1
+ west:object = {
2
+ stock\stock1\:object = {
3
+ items:list<object> = [
4
+ \item2\ = { name\name2\:string = "Bracket" }
5
+ \item1\ = { name\name1\:string = "Widget" }
6
+ ]
7
+ }
8
+ }
9
+ east:object = {}
10
+ selection:sansa = $.west.\stock1\.items.\item1\.\name1\
@@ -0,0 +1,10 @@
1
+ west:object = {}
2
+ east:object = {
3
+ renamed\stock1\:object = {
4
+ items:list<object> = [
5
+ \item2\ = { name\name2\:string = "Bracket" }
6
+ \item1\ = { name\name1\:string = "Replacement" }
7
+ ]
8
+ }
9
+ }
10
+ selection:sansa = $.east.\stock1\.items.\item1\.\name1\
@@ -0,0 +1,89 @@
1
+ {
2
+ "status": "unpublished-candidate",
3
+ "description": "Independently compiled snapshots; no mutation/continuity claim. Original expectation helpers are not replaced.",
4
+ "scopedSelector": "$.items.\\item1\\.\\name1\\",
5
+ "contextualSelector": "?.items.\\item1\\.\\name1\\",
6
+ "scopedSelf": "$.\\stock1\\",
7
+ "snapshots": [
8
+ {
9
+ "id": "original",
10
+ "source": "original.aeon",
11
+ "subtree": "$.west.stock",
12
+ "parent": "$.west",
13
+ "selector": "$.west.\\stock1\\.items.\\item1\\.\\name1\\",
14
+ "namePath": "$.west.stock.items[0].name",
15
+ "itemPath": "$.west.stock.items[0]",
16
+ "nameValue": "Widget",
17
+ "itemOrder": [
18
+ "item1",
19
+ "item2"
20
+ ],
21
+ "projected": [
22
+ [
23
+ "$.west.stock.items[0].name"
24
+ ],
25
+ []
26
+ ]
27
+ },
28
+ {
29
+ "id": "reordered",
30
+ "source": "reordered.aeon",
31
+ "subtree": "$.west.stock",
32
+ "parent": "$.west",
33
+ "selector": "$.west.\\stock1\\.items.\\item1\\.\\name1\\",
34
+ "namePath": "$.west.stock.items[1].name",
35
+ "itemPath": "$.west.stock.items[1]",
36
+ "nameValue": "Widget",
37
+ "itemOrder": [
38
+ "item2",
39
+ "item1"
40
+ ],
41
+ "projected": [
42
+ [],
43
+ [
44
+ "$.west.stock.items[1].name"
45
+ ]
46
+ ]
47
+ },
48
+ {
49
+ "id": "moved",
50
+ "source": "moved.aeon",
51
+ "subtree": "$.east.renamed",
52
+ "parent": "$.east",
53
+ "selector": "$.east.\\stock1\\.items.\\item1\\.\\name1\\",
54
+ "namePath": "$.east.renamed.items[1].name",
55
+ "itemPath": "$.east.renamed.items[1]",
56
+ "nameValue": "Widget",
57
+ "itemOrder": [
58
+ "item2",
59
+ "item1"
60
+ ],
61
+ "projected": [
62
+ [],
63
+ [
64
+ "$.east.renamed.items[1].name"
65
+ ]
66
+ ]
67
+ },
68
+ {
69
+ "id": "replacement",
70
+ "source": "replacement.aeon",
71
+ "subtree": "$.east.renamed",
72
+ "parent": "$.east",
73
+ "selector": "$.east.\\stock1\\.items.\\item1\\.\\name1\\",
74
+ "namePath": "$.east.renamed.items[1].name",
75
+ "itemPath": "$.east.renamed.items[1]",
76
+ "nameValue": "Replacement",
77
+ "itemOrder": [
78
+ "item2",
79
+ "item1"
80
+ ],
81
+ "projected": [
82
+ [],
83
+ [
84
+ "$.east.renamed.items[1].name"
85
+ ]
86
+ ]
87
+ }
88
+ ]
89
+ }