You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cddl-matrix/containment/occurrence-target.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -260,7 +260,7 @@ id = "contain.occurrence-target.grpent.member.zero_array"
260
260
role = "role.occurrence-target"
261
261
feature = "grpent.member"
262
262
spec = "allowed"
263
-
note = "A zero-or-more occurrence on a bare-type entry in a HETEROGENEOUS array is an open-array segment. A final `* t` tail is supported, as is the one safe non-final shape: a leading/middle segment whose immediate fixed suffix is mandatory, exactly one CBOR item, field-codec-free, and CBOR-major-disjoint from `t` (`[uint, * bytes, tstr]`). Each effective boundary head is generator-proven (including mandatory outer framing) or declared by a transparent custom-codec alias with `@custom_wire_major`; an undeclared custom-owned or direct opaque-extern head remains unproven. The decoder obeys RFC 8610 greedy non-backtracking matching: it consumes repeated element majors without rewind and stops at that disjoint suffix. Same-major/value-discriminator boundaries, multiple occurrences, and group/group-choice/plain-group forms stay rejected gracefully. `*` captures `Vec<T>`; `+` and bounded siblings use `NonEmptyVec`/`BoundedVec`. Under --preserve-encodings each captured segment element re-serializes byte-exactly via a positional per-element sidecar (a self-carried `any` element needs none), and --canonical-form normalizes each element in source position; the captured `Vec<T>` renders as an ordinary JSON array field (skip-if-empty on write, default-on-read) and exposes a read-only wasm `rest()` list-wrapper getter. RFC8610 §3.2, §3.4."
263
+
note = "A zero-or-more occurrence on a bare-type entry in a HETEROGENEOUS array is an open-array segment. A final `* t` tail is supported, as is the one safe non-final shape: a leading/middle segment whose immediate fixed suffix is mandatory, exactly one CBOR item, field-codec-free, and CBOR-major-disjoint from `t` (`[uint, * bytes, tstr]`). Each effective boundary head is generator-proven (including mandatory outer framing) or declared by a transparent custom-codec alias with `@custom_wire_major`; an undeclared custom-owned or direct opaque-extern head remains unproven. The decoder obeys RFC 8610 greedy non-backtracking matching: it consumes repeated element majors without rewind and stops at that disjoint suffix. A finite exact `N*N` segment instead stops by count, needs no major discriminator, and stores ordinary/preserve data as `[T; N]` (exact reject remains `BoundedOrderedSet<T, N, N>`); uniquely named finite exact segments may be adjacent. Variable same-major/value-discriminator, variable multiple, and group/group-choice/plain-group forms stay rejected gracefully. `*` captures `Vec<T>`, `+` `NonEmptyVec<T>`, and variable bounded windows `BoundedVec<T, MIN, MAX>`. Under --preserve-encodings each captured segment element re-serializes byte-exactly via a positional per-element sidecar (a self-carried `any` element needs none), and --canonical-form normalizes each element in source position; the loose captured `Vec<T>` renders as an ordinary JSON array field (skip-if-empty on write, default-on-read) and exposes a read-only wasm `rest()` list-wrapper getter. RFC8610 §3.2, §3.4."
"note": "A zero-or-more occurrence on a bare-type entry in a HETEROGENEOUS array is an open-array segment. A final `* t` tail is supported, as is the one safe non-final shape: a leading/middle segment whose immediate fixed suffix is mandatory, exactly one CBOR item, field-codec-free, and CBOR-major-disjoint from `t` (`[uint, * bytes, tstr]`). Each effective boundary head is generator-proven (including mandatory outer framing) or declared by a transparent custom-codec alias with `@custom_wire_major`; an undeclared custom-owned or direct opaque-extern head remains unproven. The decoder obeys RFC 8610 greedy non-backtracking matching: it consumes repeated element majors without rewind and stops at that disjoint suffix. Same-major/value-discriminator boundaries, multiple occurrences, and group/group-choice/plain-group forms stay rejected gracefully. `*` captures `Vec<T>`; `+` and bounded siblings use `NonEmptyVec`/`BoundedVec`. Under --preserve-encodings each captured segment element re-serializes byte-exactly via a positional per-element sidecar (a self-carried `any` element needs none), and --canonical-form normalizes each element in source position; the captured `Vec<T>` renders as an ordinary JSON array field (skip-if-empty on write, default-on-read) and exposes a read-only wasm `rest()` list-wrapper getter. RFC8610 §3.2, §3.4.",
4816
+
"note": "A zero-or-more occurrence on a bare-type entry in a HETEROGENEOUS array is an open-array segment. A final `* t` tail is supported, as is the one safe non-final shape: a leading/middle segment whose immediate fixed suffix is mandatory, exactly one CBOR item, field-codec-free, and CBOR-major-disjoint from `t` (`[uint, * bytes, tstr]`). Each effective boundary head is generator-proven (including mandatory outer framing) or declared by a transparent custom-codec alias with `@custom_wire_major`; an undeclared custom-owned or direct opaque-extern head remains unproven. The decoder obeys RFC 8610 greedy non-backtracking matching: it consumes repeated element majors without rewind and stops at that disjoint suffix. A finite exact `N*N` segment instead stops by count, needs no major discriminator, and stores ordinary/preserve data as `[T; N]` (exact reject remains `BoundedOrderedSet<T, N, N>`); uniquely named finite exact segments may be adjacent. Variable same-major/value-discriminator, variable multiple, and group/group-choice/plain-group forms stay rejected gracefully. `*` captures `Vec<T>`, `+` `NonEmptyVec<T>`, and variable bounded windows `BoundedVec<T, MIN, MAX>`. Under --preserve-encodings each captured segment element re-serializes byte-exactly via a positional per-element sidecar (a self-carried `any` element needs none), and --canonical-form normalizes each element in source position; the loose captured `Vec<T>` renders as an ordinary JSON array field (skip-if-empty on write, default-on-read) and exposes a read-only wasm `rest()` list-wrapper getter. RFC8610 §3.2, §3.4.",
classification, and spec-derived boundary vectors.
638
+
Exact ordinary/preserve `n*n T` occurrences now use `[T; n]` across Rust, CBOR, wasm, component,
639
+
cross-crate projection, matrix classification, and boundary vectors. The pinned serde/schemars
640
+
versions only derive arrays through length 32, so the generated `static_array` runtime presently
641
+
adapts a direct field/newtype payload and a loose `Vec<[T; N]>` occurrence when `T` is not CDDL
642
+
`any`. Direct/optional exact `any` arrays use the natural-JSON static adapter. That is not a general
643
+
solution: an optional loose sequence, bounded sequence, map value, nested exact array, or another
644
+
containing shape would still require `Serialize`/`Deserialize`/`JsonSchema` directly on a wide
645
+
`[T; N]`. With either JSON flag, the generator now rejects those shapes loudly before codegen rather
646
+
than emitting a crate that fails to compile.
643
647
644
648
'''
645
649
work_state = "ready"
646
-
work_intent = "optimize"
647
-
work_kind = "optimization"
650
+
work_intent = "build_capability"
651
+
work_kind = "feature"
648
652
risk = "wrong_public_api"
649
-
acceptance_md = '''Map exact n*n homogeneous array occurrences to [T; n], retain TryFrom as the ergonomic construction door, keep fixed-byte representation outside this identity, and update every applicable Rust, wasm, JSON, component, cross-crate, matrix, and boundary-vector surface.
650
-
'''
653
+
acceptance_md = '''Make JSON derives and schema generation compositional for every supported position that contains a wide exact ordinary/preserve array, including optional/loose/bounded sequences, map values, nested exact arrays, records, aliases, and type choices; preserve the ordinary JSON list surface and exact inner minItems/maxItems. Preserve CDDL `any`'s natural JSON rendering rather than falling back to AnyCbor's tagged codec, including nested exact-any arrays. Add execution coverage for representative nesting families. Until then, reject every unadapted containing shape under either JSON flag before codegen; do not claim complete JSON support while any containing shape still relies on serde/schemars' length-32 array traits.'''
651
654
priority_band = "normal"
652
-
priority_rationale_md = '''The fixed-array representation remains explicitly selected because an exact array type carries the cardinality invariant statically and avoids conflating this scope with the separate fixed-byte representation.
653
-
'''
655
+
priority_rationale_md = '''The native carrier is shipped, but JSON flags must not turn otherwise-supported CDDL nesting into a generated-crate compile failure. The remaining work is an adapter-composition design, not a reason to revert the representation.'''
0 commit comments