Commit 48aebd1
Bump version to 0.4.14
Completes ADR-057's deferred surface (register_shape! macro,
recurse:T / recurse(<bound>):T operand grammar, CYCLE_SIZE saturation
rule) that v0.4.13 incorrectly shipped as "future work" — closes the
implementation discipline violation.
ShapeRegistryProvider sealed trait + const-aggregated registry:
- `pipeline::shape_iri_registry::ShapeRegistryProvider` trait carries
the application's `const REGISTRY: &'static [RegisteredShape]`.
- `pipeline::shape_iri_registry::EmptyShapeRegistry` is the foundation
default (empty registry) — used by applications without recursive
shapes.
- `pipeline::shape_iri_registry::lookup_shape_in::<R>(iri)` walks
`R::REGISTRY` then falls back to the foundation-built-in registry.
`lookup_shape(iri)` continues to consult only the foundation registry.
- Implementation is no_std-safe, zero-dependency, zero-`unsafe`, and
zero-allocation per foundation discipline.
SDK `register_shape!` proc-macro (uor-foundation-sdk):
- `register_shape!(MyAppRegistry, Shape1, Shape2, …)` emits a marker
type implementing `ShapeRegistryProvider`. The `REGISTRY` const
aggregates `RegisteredShape` entries populated from each shape's
`ConstrainedTypeShape` associated items at the consumer's compile time.
- Also emits a `pub const <NAME>_SHAPES: &[RegisteredShape]` for direct
slice access by purely-const consumers.
- Admits both bare-Ident shapes (`LeafA`) and generic-parameter-bearing
types (`BigIntShape<128>`) per the v0.4.11 Type-operand widening.
partition_product! / partition_coproduct! recurse-operand grammar:
- New operand-marker syntax `recurse:T` (saturated at u32::MAX descent)
and `recurse(<bound>):T` (bounded descent, where <bound> is any
const-evaluable u32 expression — literal, const, HostBounds-derived).
- Lowers to `ConstraintRef::Recurse { shape_iri: <T>::IRI,
descent_bound: <bound> }` at the operand's position, instead of
inlining T's CONSTRAINTS array. SITE_COUNT still consults <T>::SITE_COUNT
to compute site offsets for adjacent inline-marked operands.
- Works in both the named-field (`<name>: recurse:T`) and positional
(`recurse:T`) forms; the proc-macro parser reserves `recurse` as a
marker keyword (cannot be used as a field name).
- Canonical operand ordering preserves the recurse marker with its
type (paired canonicalization).
- Foundation supplies `sdk_concat_product_constraints_v2` +
`sdk_product_constraints_v2_len` const-fn helpers that emit the
Recurse entry at the marked operand's position.
CYCLE_SIZE saturation rule (ADR-057 step 4):
- Shapes whose CONSTRAINTS contains a Recurse entry declare
CYCLE_SIZE = u64::MAX. Applied uniformly across binary and variadic
partition_product / partition_coproduct expansions; emitted by both
the macro path and the v2 helper path.
Conformance test coverage:
- foundation/tests/behavior_adr_057_recursive_typing.rs (+5 tests):
EmptyShapeRegistry returns empty slice; lookup_shape_in finds
application-registered shapes; lookup_shape_in falls back to None
on misses; finds second entry; EmptyShapeRegistry-typed lookup
returns None.
- uor-foundation-sdk/tests/smoke.rs (+7 tests): register_shape! emits
ShapeRegistryProvider impl + named const; partition_product! admits
recurse(<bound>):T with explicit bound; saturates CYCLE_SIZE;
recurse:T defaults to u32::MAX; recurse on left operand; coproduct
recurse-with-bound; coproduct CYCLE_SIZE saturation; both-operands-
recurse-marked.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1420c6d commit 48aebd1
13 files changed
Lines changed: 1832 additions & 286 deletions
File tree
- codegen/src
- conformance/shapes
- foundation
- src
- tests
- lean4
- uor-foundation-sdk
- src
- tests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
0 commit comments