@altopelago/sansa 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,37 @@ versions may still include breaking changes when the SANSA specifications move.
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 0.14.0 - 2026-10-15
11
+
12
+ ### Added
13
+
14
+ - Added a proposal-stage Rust SANSA.Mutate type shell and a side-effect-free
15
+ planner covering all 28 cases assigned to the pinned experimental plan
16
+ surface. The planner retains opaque exact bindings, evaluates Query
17
+ preconditions, enforces conservative container/conflict/budget rules, and
18
+ preserves provenance and portability warnings.
19
+ - Added post-plan Rust SANSA.Mutate target-surface validation covering all 36
20
+ pinned experimental AEON and JSON cases. Built-in validation remains
21
+ representability-only, and a host-neutral trait permits separate custom
22
+ validators without granting authority or exposing mutation hooks. Apply and
23
+ policy remain independent unimplemented surfaces.
24
+
25
+ ### Fixed
26
+
27
+ - JSON mutation target validation in Rust and JavaScript now distinguishes
28
+ actual attribute-space selectors from quoted property names containing
29
+ `.@`, including contextual aliases and attribute descendants.
30
+ - Corrected Rust target-validator dispatch so JSON's container and attribute
31
+ restrictions run in the JSON validator, while AEON accepts those targets.
32
+ Public API regression coverage now exercises every mutation operation across
33
+ AEON, JSON, and their default/alias spellings.
34
+ - Hardened the Rust mutation planner so every resolved alias of the namespace
35
+ root is protected from removal, pre-parsed targets are revalidated under the
36
+ planner's Address ceiling, and non-portable Address warnings inside Query
37
+ preconditions are retained on the plan. Precondition resolution now has a
38
+ finite default binding ceiling and reports exhaustion through the normalized
39
+ mutation budget diagnostic.
40
+
10
41
  ## 0.13.0 - 2026-10-06
11
42
 
12
43
  ### Added
@@ -2,7 +2,7 @@
2
2
  "claim_format": "aeonite.cts-claims.v1",
3
3
  "repository": "AltoPelago/sansa",
4
4
  "implementation": "@altopelago/sansa",
5
- "implementation_version": "0.13.0",
5
+ "implementation_version": "0.14.0",
6
6
  "cts_repository": "aeonite-org/aeonite-cts",
7
7
  "cts_protocol": "cts.protocol.v1",
8
8
  "claims": [
@@ -453,7 +453,7 @@ planMutation({
453
453
  }, namespace)
454
454
  ```
455
455
 
456
- If mutation targets parse successfully but produce SANSA portability warnings, successful planning preserves those diagnostics on `plan.portabilityWarnings`. For example, a caller may raise the local position-index limit above the SANSA portable ceiling; if the target resolves exactly, the plan remains inspectable but carries the non-portability warning.
456
+ If mutation targets or addresses embedded in precondition expressions parse successfully but produce SANSA portability warnings, successful planning preserves those diagnostics on `plan.portabilityWarnings`. For example, a caller may raise the local position-index limit above the SANSA portable ceiling; if the address resolves successfully, the plan remains inspectable but carries the non-portability warning. Pre-parsed target addresses are rendered and revalidated under the planner's configured Address ceiling, so they cannot bypass its limit or warning behavior.
457
457
 
458
458
  Mutation plans are current-process execution artifacts, not portable serialized plan documents. A plan retains live binding objects supplied by the resolver, along with local adapter artifacts such as `bindingHandle` and `observedState`. These fields are for same-process continuity checks and diagnostics. Do not `JSON.stringify` a plan and replay it later or in another implementation; cloned or serialized plans cannot prove live binding continuity and should fail apply-time stale-target checks. A portable mutation-plan serialization format may be defined by a later profile.
459
459
 
@@ -490,10 +490,24 @@ applyMutationPlan(plan, namespace, {
490
490
 
491
491
  Budget exhaustion returns `SANSA_MUTATE_BUDGET_EXCEEDED` with `phase`, `budget`, `limit`, and `observed`. It does not produce a partial plan and does not apply partial mutations.
492
492
 
493
+ Query preconditions also inherit the planner's Resolve `maxBindings` ceiling.
494
+ The Rust planner applies a fail-closed default of `100000` bindings when the
495
+ caller does not provide a stricter ceiling. Exhausting this resolution budget
496
+ is normalized as `SANSA_MUTATE_BUDGET_EXCEEDED` with `budget: "maxBindings"`
497
+ and the failing precondition index.
498
+
493
499
  `maxValueNodes`, `maxValueDepth`, and `maxStringLength` are budgets over supplied values for `create`, `replace`, and `insert`. They are honored during planning and again during apply when callers provide a prebuilt plan. `maxValueNodes` counts all supplied value nodes across the request or plan; arrays and objects count as one node plus their entries. `maxValueDepth` is the deepest supplied value tree, with scalar values at depth `1`. `maxStringLength` is the longest supplied string payload observed by this implementation.
494
500
 
495
501
  Planning is side-effect free. Every executable target is resolved exactly at planning time. Expanded selectors such as `$.items.*`, ranges such as `$.items[0..2]`, filters, name patterns, and parent traversal are not accepted as mutation targets in this initial slice. `create` targets an existing exact parent and carries the new child name separately.
496
502
 
503
+ The Rust runtime exposes post-plan target validation separately through
504
+ `mutate_target::validate_mutation_plan_target`. Its built-in proposal-stage
505
+ surfaces cover AEON and JSON representability and are exercised directly by all
506
+ 36 target-validation cases in the pinned experimental CTS snapshot.
507
+ `MutationTargetValidator` permits a host-defined immutable plan validator, but
508
+ successful representability does not imply schema validity, authorization, or
509
+ permission to apply the plan.
510
+
497
511
  `applyMutationPlan` applies an already planned mutation only when the namespace exposes matching mutation hooks:
498
512
 
499
513
  ```js
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "implementation": "@altopelago/sansa",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "profiles": [
5
5
  "value-semantics-minimum-consumer",
6
6
  "aeon.value.default.v1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altopelago/sansa",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Semantic Address NameSpace Abstraction parser, resolver, and query toolkit.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -2420,7 +2420,13 @@ function validateJsonTargetAddresses(operation, operationIndex) {
2420
2420
  for (const role of ['target', 'parent', 'source', 'container']) {
2421
2421
  const target = operation[role];
2422
2422
  if (!target) continue;
2423
- if (target.binding?.representationKind === 'attributeSpace' || String(target.canonicalAddress ?? '').includes('.@')) {
2423
+ // A quoted member can contain literal .@ text. Classify selectors in both
2424
+ // paths so contextual aliases still reveal canonical attribute ancestors.
2425
+ // Do not reimpose the portable index ceiling on an already planned path.
2426
+ const canonical = parseAddress(String(target.canonicalAddress ?? ''), { maxPositionIndex: Number.MAX_SAFE_INTEGER });
2427
+ const hasAttributeSelector = target.address?.selectors?.some((selector) => selector.type === 'attributeSpace')
2428
+ || (canonical.ok && canonical.address.selectors.some((selector) => selector.type === 'attributeSpace'));
2429
+ if (target.binding?.representationKind === 'attributeSpace' || hasAttributeSelector) {
2424
2430
  return {
2425
2431
  ok: false,
2426
2432
  error: mutationTargetSurfaceError(