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
@@ -685,29 +684,6 @@ verification_md = '''Probe h'cafe', b64'yv4=', h'CAFE', and a raw UTF-8 control
685
684
due_action_md = '''Perform the ordered closeout actions only after fresh evidence satisfies the external predicate and the verification succeeds; otherwise retain the closeout and its accommodations.
`bytes .size 32` can map to `[u8; 32]`: the representation itself carries the constraint. The
697
-
`uint .size 1` → `u8` mapping is the shipped precedent, independently of the `TryFrom` door, which
698
-
stays as the ergonomic entry point.
699
-
700
-
'''
701
-
work_state = "ready"
702
-
work_intent = "optimize"
703
-
work_kind = "optimization"
704
-
risk = "wrong_public_api"
705
-
acceptance_md = '''Map an exact bytes .size N value to [u8; N], retain TryFrom as the ergonomic entry point, and cover Rust, wasm, JSON, component, cross-crate, matrix, fixed-member, and recombination surfaces without changing fixed-array campaign identity.
706
-
'''
707
-
priority_band = "normal"
708
-
priority_rationale_md = '''The exact byte-array representation carries its length invariant statically and has the shipped uint .size 1 to u8 precedent, while remaining an independent optimization.
709
-
'''
710
-
711
687
[[record]]
712
688
id = "matrix.fixed-bytes.validator-corroboration"
713
689
title = "When a rust `cddl` release fixes fixed-byte CBOR validation (README gap #17)"
Suppresses emission of Rust `pub type` aliases for generator-**synthesized** collection wrappers — currently a table rule's auto-named keys-list, e.g. `pub type FooList = Vec<Foo>;` minted for `tbl = { * foo => uint }`. Off by default.
212
212
213
-
Rule-declared aliases are never suppressed, even when structurally transparent: an explicitly authored `foo_list = [* foo]` or `signature = bytes .size 32` is a human-written name and always stays. The suppression is emission-only — generated code references collections structurally (`Vec<Foo>`), never through the alias, so no field type or serialization changes, and the crate still compiles. Wasm-side wrappers and aliases are untouched.
213
+
Rule-declared aliases are never suppressed, even when structurally transparent: an explicitly authored `foo_list = [* foo]` or `payload = bytes` is a human-written name and always stays. The suppression is emission-only — generated code references collections structurally (`Vec<Foo>`), never through the alias, so no field type or serialization changes, and the crate still compiles. Wasm-side wrappers and aliases are untouched. An exact byte rule such as `signature = bytes .size 32` is not this case: it is a checked wrapper whose native inner carrier is `[u8; 32]`.
214
214
215
215
This is a flag rather than a default change because it removes public API (the crate's own synthesized aliases, not just extern-element ones) that existing consumers may depend on.
including zero) is stored as `[u8; N]`; non-exact byte windows remain `Vec<u8>`. Constructors
109
+
deliberately accept a `Vec<u8>` and return `RangeCheck` on a wrong length before atomically
110
+
converting it to the static carrier. JSON follows the same invariant, including exact schema
111
+
cardinality. This is specific to byte strings: exact homogeneous CDDL array occurrences still
112
+
use their existing collection carriers.
108
113
* Type-enforced homogeneous collections - bare `[* T]` maps to `Vec<T>` and `[+ T]` / `1* T` to `NonEmptyVec<T>`; every other supported array occurrence window maps to `BoundedVec<T, MIN, MAX>`, except `@duplicates reject`, which maps to `BoundedOrderedSet<T, MIN, MAX>` and enforces both order-preserving uniqueness and bounds at one door. A unique-key table maps `{ * K => V }` to a loose map, `{ + K => V }` to `NonEmptyMap<K, V>`, and every other window (including omitted exact-once) to `BoundedMap<K, V, MIN, MAX>`. A preserve table uses `PairMap` / `NonEmptyPairMap` for those loose forms and `BoundedPairMap<K, V, MIN, MAX>` for every other window; duplicate keys count separately and retain entry order. The bounded carriers route loose API, CBOR, JSON, wasm, and component input through their `TryFrom` door and expose no mutable carrier. See [Output format](output_format#non-empty-containers).
109
114
* Integer width via `.size` - `u = uint .size 1` maps to `u8`, `uint .size 8` to `u64`, etc. `.size` on a signed `int` is **rejected gracefully**: per the spec semantics clarified by the RFC author ([cbor-wg/cddl#32](https://github.com/cbor-wg/cddl/issues/32)), `int = uint / nint` and a control distributes over the choice with `.size` undefined (never-matching) on `nint`, so `int .size N` means exactly the `uint .size N` window `0...(256**N)` — a signed `i{8N}` reading would mis-enforce it in both directions, and the aligned unsigned reading is spelled `uint .size N` directly. If you mean an N-byte signed integer, use the explicit range (e.g. `-9223372036854775808..9223372036854775807` maps to `i64`), which is fully supported.
110
115
* Value ranges - integer (`foo = -10..3`, `bar = int .le 10`) and float (`f = 0.5..10.5`, `g = float64 .lt 10.5`) windows are both enforced (float checks are NaN-safe; see the range note below for the boundaries)
0 commit comments