Skip to content

Commit 746075c

Browse files
afflomclaude
andcommitted
Bump version to 0.4.5
Implements wiki ADR-040, ADR-041, ADR-042 — the implementer-facing surface trio. With this release, foundation/uor-foundation-sdk fully meets the needs of layer-3 ψ-pipeline implementors: closed-catalog disambiguation of comparison semantics, type-system discrimination of ψ-stage outputs, and a foundation-provided typed Rust verdict-envelope surface. ADR-040 — `type:LexicographicLessEqBound` (7th BoundShape individual): - Adds the byte-sequence-comparison primitive to the closed BoundShape catalog. Predicate form `observable(datum) <= bound` under canonical big-endian unsigned ordering (lexicographic with shorter-prefix-rule for variable-length). - `LessEqBound` remains the integer-valued primitive (HammingMetric, DerivationDepthObservable, etc.); `LexicographicLessEqBound` is the byte-sequence-valued primitive paralleling it. Catalog declaration alone determines comparison semantics — resolvers do not dispatch on observable type. - Ontology counts bump: INDIVIDUALS 3559 → 3560, CLASSIFICATION_PATH1 413 → 414, LEAN_CONSTANT_NAMESPACES 3422 → 3423. ADR-041 — Typed-coordinate resolver carriers: - Nine `#[repr(transparent)]` newtype wrappers over `&'a [u8]` — `SimplicialComplexBytes`, `ChainComplexBytes`, `HomologyGroupsBytes`, `BettiNumbersBytes`, `CochainComplexBytes`, `CohomologyGroupsBytes`, `PostnikovTowerBytes`, `HomotopyGroupsBytes`, `KInvariantsBytes` (the κ-label carrier). Each carrier is layout-identical to `&[u8]`; the type wrapper is purely compile-time discrimination. - The 8 ψ-stage resolver traits' `resolve` method now takes the prior ψ-stage's typed carrier as input. `NerveResolver` retains `&[u8]` input (the per-value bytes); the other seven receive their typed predecessor-stage carrier. Cross-stage composition is type-checked at compile time — mismatches surface as type errors at the resolver- impl compile-time rather than runtime ShapeViolations. - The catamorphism's resolver-bound fold-rules wrap `operand.bytes()` in the typed carrier before invoking each downstream resolver. - All 8 `Null<Category>Resolver` impls + 8 `NullResolverTuple` impls updated to the new typed signatures. ADR-042 — Inhabitance verdict typed Rust surface: - `InhabitanceCertificateView<'a, T, Tag>` — `#[repr(transparent)]` zero-allocation view over `&Grounded<T, Tag>` with accessors: * `kappa_label() -> KInvariantsBytes<'_>` (the κ-label at ψ_9) * `witness() -> WitnessValueTuple<'_>` (concrete witness) * `certificate() -> &Validated<GroundingCertificate>` * `certified_type() -> &'static str` (output IRI) - `InhabitanceImpossibilityCertificate<'a>` — view over `&PipelineFailure` with `contradiction_proof() -> &[u8]` accessor. - `Grounded::as_inhabitance_certificate(&self)` and `PipelineFailure::as_inhabitance_impossibility_certificate(&self) -> Option<...>` as the accessor method surface. - `inhabitance::dispatch_through_table(...)` helper for optional `predicate:InhabitanceDispatchTable` consultation; three rule arms (TwoSatDecider → HornSatDecider → ResidualVerdictResolver) routed in ontology order via Option-returning closures. - `WitnessValueTuple<'a>` + `WitnessTupleSource` trait — concrete witness view backed by `Grounded`'s binding table. - Universal: typed accessors available for any `Grounded<T, Tag>` / `PipelineFailure`; applications whose admission relations are not inhabitance questions simply don't call the typed accessors. Implementer-verification end-to-end tests (uor-foundation-sdk/tests/smoke.rs): - `adr041_typed_coordinate_carriers_are_repr_transparent_and_zero_cost` — pins each typed carrier's `size_of` / `align_of` against `&[u8]`. - `adr041_resolver_trait_signatures_type_check_psi_stage_composition` — coerces every resolver trait's `resolve` method to its wiki-mandated `fn`-pointer signature (regression-fence). - `adr042_inhabitance_certificate_view_exposes_kappa_witness_certified_type` — drives the canonical k-invariants branch through `Model::forward`, borrows the `Grounded` as an `InhabitanceCertificateView`, asserts the κ-label carries the chain markers, `certified_type` returns the output IRI, and `witness` constructs. - `adr042_inhabitance_impossibility_certificate_exposes_contradiction_proof` — constructs a `ShapeViolation` failure, borrows as `InhabitanceImpossibilityCertificate`, asserts `contradiction_proof` surfaces the shape_iri bytes. - `adr042_dispatch_through_table_routes_through_three_decider_arms` — exercises all three rule-arm winners (TwoSatDecider, HornSatDecider, ResidualVerdictResolver) through the dispatch helper. - `adr040_lexicographic_less_eq_bound_is_in_closed_catalog` — pins the foundation-emitted constant module's existence in scope. All quality gates green: fmt, clippy --all-targets -D warnings, workspace tests (57 SDK smoke tests, every foundation test), conformance (544 passed, 0 failures, 10 meta-audit passed, 0 gaps detected). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 33e868b commit 746075c

20 files changed

Lines changed: 1616 additions & 170 deletions

File tree

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ members = [
1818
resolver = "2"
1919

2020
[workspace.package]
21-
version = "0.4.4"
21+
version = "0.4.5"
2222
edition = "2021"
2323
rust-version = "1.83"
2424
license = "Apache-2.0"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ structure based on Z/(2^n)Z.
99

1010
## Ontology
1111

12-
Version 0.4.3: 34 namespaces · 472 classes · 948 properties · 3559 named individuals
12+
Version 0.4.4: 34 namespaces · 472 classes · 948 properties · 3560 named individuals
1313

1414
All terms are encoded as typed Rust data in `spec/` (`uor-ontology`) and exported as:
1515
- `foundation/` (`uor-foundation`) — typed Rust traits (published to crates.io)

codegen/src/enforcement.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6433,6 +6433,23 @@ fn generate_grounded_wrapper(f: &mut RustFile) {
64336433
f.line(" pub fn with_bindings(self, bindings: BindingsTable) -> Self {");
64346434
f.line(" Self { bindings, ..self }");
64356435
f.line(" }");
6436+
f.blank();
6437+
// ADR-042: typed inhabitance-verdict view over Grounded<T>.
6438+
f.indented_doc_comment("Wiki ADR-042: borrow `self` as an");
6439+
f.indented_doc_comment("[`crate::pipeline::InhabitanceCertificateView`] over the canonical");
6440+
f.indented_doc_comment("k-invariants branch's verdict envelope.");
6441+
f.indented_doc_comment("");
6442+
f.indented_doc_comment("Universal — available for any `Grounded<T, Tag>`; applications whose");
6443+
f.indented_doc_comment("admission relations are not inhabitance questions simply don't");
6444+
f.indented_doc_comment("call the typed accessors. The view is zero-cost");
6445+
f.indented_doc_comment("(`#[repr(transparent)]` over `&'a Grounded<T, Tag>`).");
6446+
f.line(" #[inline]");
6447+
f.line(" #[must_use]");
6448+
f.line(
6449+
" pub fn as_inhabitance_certificate(&self) -> crate::pipeline::InhabitanceCertificateView<'_, T, Tag> {",
6450+
);
6451+
f.line(" crate::pipeline::InhabitanceCertificateView(self)");
6452+
f.line(" }");
64366453
f.line("}");
64376454
f.blank();
64386455

0 commit comments

Comments
 (0)