Skip to content

09 Architecture Decisions Continued

Alex Flom edited this page May 23, 2026 · 3 revisions

Architecture Decisions (continued)

← Architecture Decisions: ADR-001 through ADR-037

This page continues 9. Architecture Decisions, carrying ADR-038 onward. The chapter is split across two pages because GitHub renders rich markdown only up to ~512 KiB per page; the audit-trail table and ADR-001 through ADR-037 are on the first page.


ADR-038 — Closed-catalog extension: observable:AxisProjectionObservable + canonical-string-form args_repr encoding (substrate amendment under ADR-013/TR-08)

Status: Accepted.

Context: The substrate’s closed ConstraintRef catalog (per ADR-013’s substrate-amendment-via-foundation rule) admits a Bound { observable_iri, bound_shape_iri, args_repr } variant whose payload identifies an observable:Observable instance, a type:BoundShape instance, and the predicate’s bound-arguments per the application’s typed feature hierarchy. The wire form at the foundation’s current snapshot is:

ConstraintRef::Bound {
    observable_iri: &'static str,
    bound_shape_iri: &'static str,
    args_repr: &'static str,        // canonical string form
}

The args_repr field is a canonical-string-form payload, mirroring the convention used by the catalogued BoundConstraint kind individuals (e.g., residueConstraintKind carries boundArguments: "modulus=256;residue=0"; hammingConstraintKind carries boundArguments: "bound=0").

The ontology declares a closed Observable taxonomy with seven top-level categories (StratumObservable, MetricObservable, PathObservable, ReductionObservable, CatastropheObservable, CurvatureObservable, HolonomyObservable) plus their specialized subclasses. All categories derive from the framework’s internal algebraic/topological structure. The closed BoundShape catalogue carries 6 individuals (EqualBound, LessEqBound, GreaterEqBound, RangeContainBound, ResidueClassBound, AffineEqualBound). type:LessEqBound's predicate form is observable(datum) ⇐ bound, used by integer-valued observables (hamming, depth, carry, site-rank) under the existing catalog.

One structurally distinct admission-relation pattern lacks closed-catalog representation: axis-realized projections. The application’s admission relation references the byte-sequence output of applying an axis kernel (a method on an AxisExtension trait per ADR-030) to a typed site set. The observable’s value is the byte sequence the kernel emits. Examples span content-addressing fingerprints under a hash axis, tensor reductions under a tensor axis, homomorphic evaluations under an FHE axis. None of the existing seven Observable categories fit — those categories derive from the framework’s internal algebraic/topological structure, not from external axis-kernel realizations.

Without an Observable for this pattern, applications whose admission relations naturally express as "the axis-projected observable of typed sites X is bounded by Y" cannot declare their admission relation through ConstraintRef::Bound. The relation gets encoded out-of-catalog — through a verb body’s ψ-residuals (Term::AxisInvocation plus a comparison PrimitiveOp) — defeating the typed-iso surface’s commitment that admission relations are declared in the closed catalog. The ψ-residuals discipline per ADR-035 forbids exactly this verb-body shape; without the catalog extension, applications with this admission-relation pattern have no architectural lowering target.

A coupled concern: byte-sequence-valued observables (e.g., the output of a hash axis kernel) admit ordering predicates, but type:LessEqBound's current comment specializes to integer-valued observables. For byte-sequence values, the predicate form is well-defined under a canonical convention but the convention is not normatively documented in the closed catalog.

Decision: ADR-038 commits two coupled amendments under ADR-013/TR-08’s substrate-amendment-via-foundation rule:

(1) observable:AxisProjectionObservable — new Observable subclass. A new top-level Observable subclass (parallel to the seven existing categories) lands in the foundation’s observable namespace:

Class {
    id: "https://uor.foundation/observable/AxisProjectionObservable",
    label: "AxisProjectionObservable",
    comment: "An Observable whose value is the byte sequence produced by
              applying an axis kernel (a method on an AxisExtension trait
              declared via the `axis!` macro per ADR-030) to a specified
              set of typed sites. The specific axis identity, kernel
              selector, and source site range are carried by the
              BoundConstraint's args_repr canonical string form per the
              ADR-038 encoding rules. Distinct from the seven
              internally-derived Observable categories (Stratum, Metric,
              Path, Reduction, Catastrophe, Curvature, Holonomy), which
              derive from the framework's algebraic/topological
              structure; AxisProjectionObservable carries values from
              the substrate-extension surface per ADR-030.",
    subclass_of: &["https://uor.foundation/observable/Observable"],
    disjoint_with: &[],
}

The class is a top-level Observable subclass, not a member of any of the seven existing categories. Future substrate amendments may introduce specialized subclasses (e.g., HashProjectionObservable under AxisProjectionObservable, TensorProjectionObservable, FheProjectionObservable) per the kernel families standard-library Layer-3 sub-crates declare; ADR-038 commits the parent class.

(2) Byte-sequence-valued observables use type:LexicographicLessEqBound per ADR-040. AxisProjectionObservable and any future byte-sequence-valued Observable use the distinct LexicographicLessEqBound BoundShape primitive (ADR-040 extends the closed BoundShape catalogue to 7 individuals); type:LessEqBound is for integer-valued observables (HammingMetric, DerivationDepthObservable, etc.). The catalog declaration alone determines the comparison semantics — resolvers do not dispatch on observable type.

(3) ConstraintRef::Bound.args_repr canonical string-form encoding for AxisProjectionObservable. The existing args_repr: &'static str wire commitment is preserved. ADR-038 commits the normative canonical-form encoding rules for AxisProjectionObservable arguments:

args_repr := axis_address=<hex>;kernel=<symbolic>;sites=<site-list>[;target=<target-spec>]

Where:
  <hex>          := "0x" followed by uppercase hex characters (the axis trait's
                    AXIS_ADDRESS per ADR-030, content-derived from trait name
                    + method signatures + bounds via foundation's
                    content-addressing per ADR-017).
  <symbolic>     := the kernel selector — the foundation-emitted KERNEL_<NAME>
                    symbol corresponding to a method on the axis trait per
                    ADR-030.
  <site-list>    := "(" <decimal> "," <decimal> ")" [ "," "(" <decimal> "," <decimal> ")" ]*
                    (one or more (offset, length) pairs, in canonical
                    low-to-high order by offset; decimal-without-leading-zeros).
  <target-spec>  := "site:" <site-list> | "const:" <hex>
                    (target is either a site-range reference resolved at
                    evaluation time from the typed input's bytes, or a
                    constant byte sequence in hex declared inline).

Example for a content-fingerprint admission relation — generically, an axis-projection observable bounded by a target byte sequence held in another typed site range (admission relations of the form kernel(source_bytes) ⇐ target_bytes fit this shape across domains: content-addressing predicates, structural-fingerprint inequalities, axis-realized integrity bounds):

ConstraintRef::Bound {
    observable_iri: "https://uor.foundation/observable/AxisProjectionObservable",
    bound_shape_iri: "https://uor.foundation/type/LexicographicLessEqBound",
    args_repr: "axis_address=0xABCDEF1234...;kernel=KERNEL_FOLD_BYTES;sites=(0,N);target=site:(N,M)",
}

N is the source site-range length; M is the target byte-sequence length; both are application-declared concretely at the typed-feature-hierarchy declaration site. The encoding is canonical: no leading zeros in decimals, uppercase hex characters, key-order fixed to axis_address;kernel;sites;target, no whitespace, semicolons as field separators, commas as intra-field list separators. The encoding is round-trip-identity with the foundation’s typed-Rust constructors (the SDK emits the canonical form from typed inputs; foundation parses the canonical form into typed dispatch).

(4) Axis identification by content-address, not tuple position. AxisProjectionObservable references its axis by axis_address (the AXIS_ADDRESS per ADR-030 — content-derived from the trait’s name + method signatures + bounds), not by tuple position in the application’s AxisTuple. Tuple positions are per-application (different applications declare different AxisTuples with different orderings); AXIS_ADDRESS is content-derived and application-invariant. This preserves the closed-catalog discipline: AxisProjectionObservable individuals declared in any application’s ConstraintRef::Bound.args_repr have application-invariant identity through the axis_address coordinate. Two applications using the same axis kernel against the same source sites declare structurally-identical AxisProjectionObservable references.

Substrate-amendment-via-foundation rule per ADR-013/TR-08. Foundation declares the new Observable class (AxisProjectionObservable) in the foundation’s observable namespace and commits the canonical-form encoding rules in foundation’s docstrings for ConstraintRef::Bound.args_repr. The wire-format version constant bumps for the schema amendment.

Consequences: Typed feature hierarchies whose admission relations express as "the axis-realized projection of typed sites is bounded by a target" declare their admission relation through ConstraintRef::Bound with observable_iri = "…​/AxisProjectionObservable", bound_shape_iri = "…​/LexicographicLessEqBound" per ADR-040 (or another existing BoundShape, depending on the predicate), and args_repr per the canonical-form encoding rules. The ψ-residuals discipline per ADR-035 holds — axis-realized projections are consumed by the application’s ψ_1 NerveResolver via the constraint declaration, not by verb-body ψ-residual composition.

The application’s NerveResolver<H> impl per ADR-036 receives the parsed constraint declaration and constructs the simplicial complex. Internal computation in the resolver (resolving the axis_address to a concrete axis kernel through the application’s AxisTuple, invoking the kernel at the specified source sites, applying the byte-sequence comparison against the target, materializing the simplicial complex’s structural witness) is the resolver’s design responsibility — the closed catalog declares the structural shape of the admission relation; the resolver realizes it for the application’s typed feature hierarchy.

The closed-catalog discipline holds: foundation owns the Observable taxonomy and the BoundShape catalogue; applications declare instances through the canonical-form args_repr. New admission-relation patterns that don’t fit existing Observables are subjects of further substrate amendments under ADR-013/TR-08, not of out-of-catalog encoding.

Rejected alternative 1: Treat byte-sequence comparison as a polymorphic extension of type:LessEqBound rather than as a distinct BoundShape primitive. Rejected — the catalog declaration should determine the comparison semantics in full; polymorphic primitives push comparison dispatch into the resolver and weaken the catalog’s expressiveness. The distinct LexicographicLessEqBound primitive per ADR-040 keeps dispatch in the catalog.

Rejected alternative 2: Express axis-realized projections through Term::AxisInvocation in the verb body. Rejected — Term::AxisInvocation is a ψ-residual per ADR-035 when emitted from verb-body terms. Closed-catalog declaration through ConstraintRef::Bound is the architectural lowering target for admission relations involving axis projections; verb-body composition is reserved for the application’s structural ψ-chain operations.

Rejected alternative 3: Reference the axis by tuple position (axis_index: u8) rather than by content-address. Rejected — tuple positions are application-local; closed-catalog Observable instances must have application-invariant identity. Content-address per ADR-030’s AXIS_ADDRESS is the architectural commitment for application-invariant axis identification.

Rejected alternative 4: Replace args_repr: &'static str with a structured Rust enum (BoundArgValue variants) for AxisProjectionObservable arguments. Rejected — ConstraintRef::Bound.args_repr is &'static str per the foundation’s existing wire commitment; the canonical-string-form is the wire commitment and matches the existing catalogued BoundConstraint kinds. Migrating to a structured enum is a substrate-shape change beyond ADR-038’s scope and breaks the existing kinds' wire form.

Rejected alternative 5: Place AxisProjectionObservable as a subclass of an existing Observable category (e.g., under MetricObservable or ReductionObservable). Rejected — none of the seven existing categories fit cleanly. The existing categories derive from the framework’s internal algebraic/topological structure (stratification, metrics, paths, reductions, catastrophes, curvature, holonomy); AxisProjectionObservable carries values from the substrate-extension surface per ADR-030, structurally distinct. The top-level placement (parallel to the seven categories) reflects the architectural distinction.

ADR-039 — Inhabitance verdict realization through the canonical k-invariants branch + four-family resolver landscape mapping

Status: Accepted.

Context: The ontology declares the verdict structure for inhabitance — the question "does this type:ConstrainedType admit a satisfying value tuple?" — through three distinct primitives in the foundation’s cert and proof namespaces:

  • cert:InhabitanceCertificate — "A ComputationCertificate verdict primitive that decides carrier non-emptiness on a type:ConstrainedType." The positive-verdict certificate envelope. Carries properties cert:witness → schema:ValueTuple (a specific value tuple in the carrier when cert:verified is true), cert:searchTrace → trace:InhabitanceSearchTrace (the audit trail of the inhabitance search that produced the certificate), and cert:certifiedType → type:ConstrainedType (the constrained type the certificate is about).

  • cert:InhabitanceImpossibilityCertificate — "A certificate attesting that the inhabitance decider concluded the input is unsatisfiable — there is no value in the carrier that satisfies the declared constraint conjunction." The negative-verdict certificate envelope.

  • proof:InhabitanceImpossibilityWitness — "A specialisation of proof:ImpossibilityWitness produced when the inhabitance search determines that the carrier of a ConstrainedType is empty." Carries property proof:contradictionProof → xsd:string ("The Lean 4 by-contradiction derivation over the predicate vocabulary attesting that no value tuple satisfies the constraint system"). The proof payload inside the negative-verdict envelope.

Plus the resolution and trace primitives: resolver:InhabitanceResolver ("A Resolver whose dispatch is governed by predicate:InhabitanceDispatchTable"); trace:InhabitanceSearchTrace ("A subclass of trace:ComputationTrace specialised to inhabitance-search execution"); predicate:InhabitanceDispatchTable (a three-rule dispatch table routing inhabitance questions to specific deciders).

Many typed feature hierarchies' admission relations are structurally inhabitance questions: the application asks "does this typed feature hierarchy admit any value satisfying its CONSTRAINTS?" The canonical k-invariants branch per ADR-035 (Term::Nerve → Term::PostnikovTower → Term::HomotopyGroups → Term::KInvariants) produces a κ-label classifying the homotopy type of the constraint nerve up to weak equivalence. The κ-label is the maximum-discriminating structural witness in the ψ-chain. The architectural question: how does Grounded<Output> (the catamorphism’s success envelope) and Err(PipelineFailure) (the catamorphism’s failure) realize the ontology’s three-primitive verdict structure, and what is the relationship between the κ-label and the ontology’s cert:witness ValueTuple?

A coupled disambiguation question concerns the term "resolver." Foundation declares four distinct resolver-trait families sharing the term:

  1. Foundation’s pipeline ψ-stage resolvers (8 traits per ADR-036) — NerveResolver<H>, ChainComplexResolver<H>, HomologyGroupResolver<H>, CochainComplexResolver<H>, CohomologyGroupResolver<H>, PostnikovResolver<H>, HomotopyGroupResolver<H>, KInvariantResolver<H>. Per-value byte-buffer content providers for the 8 resolver-bound ψ-Term variants per ADR-035. Sealed via __sdk_seal::Sealed; only the SDK resolver! macro emits impls.

  2. Foundation’s bridge Observable-category resolvers — ObservableResolver<H> (root) plus per-category subclasses (StratumObservableResolver<H>, MetricObservableResolver<H>, PathObservableResolver<H>, ReductionObservableResolver<H>, CatastropheObservableResolver<H>, CurvatureObservableResolver<H>, HolonomyObservableResolver<H>) plus per-specialization subclasses. Per-Observable-category content providers for the bridge surface. Open trait surface — applications provide impls directly.

  3. Foundation’s user-surface morphism resolvers — TransformResolver<H>, IsometryResolver<H>, EmbeddingResolver<H>, ActionResolver<H>, CompositionResolver<H>, etc. Per-morphism-class content providers. Open trait surface.

  4. Ontology resolver:Resolver hierarchy — resolver:Resolver supertype ("A strategy for resolving a type declaration into a partition of the ring") with subclasses spanning resolver:DihedralFactorizationResolver, resolver:CanonicalFormResolver, resolver:EvaluationResolver, resolver:CompletenessResolver, resolver:WittLevelResolver, resolver:SessionResolver, resolver:TypeSynthesisResolver, resolver:IncrementalCompletenessResolver, resolver:MonodromyResolver, resolver:JacobianGuidedResolver, resolver:SuperpositionResolver, resolver:GroundingAwareResolver, resolver:MeasurementResolver, resolver:TowerCompletenessResolver, resolver:InhabitanceResolver, resolver:ResidualVerdictResolver, resolver:MultiplicationResolver, resolver:HomotopyResolver, resolver:ModuliResolver, etc. Conceptual resolution-strategy specifications at the ontology layer. Not surfaced as foundation traits.

The four families share the term "resolver" but represent different abstractions operating at different layers. Without an explicit wiki commitment, applications navigating the substrate cannot disambiguate which "resolver" surface their impls target or how the families relate.

Decision: ADR-039 commits two coupled amendments:

(1) Inhabitance verdict realization through the canonical k-invariants branch. For typed feature hierarchies whose admission relations are structurally inhabitance questions, the canonical k-invariants branch’s output realizes the ontology’s three-primitive verdict structure:

  • Positive verdict. A successful Grounded<Output> IS a cert:InhabitanceCertificate envelope. Three witness coordinates derive from the catamorphism’s ψ-chain output:

    • The κ-label (the Term::KInvariants emission at the ψ_9 stage per ADR-035) IS the structural witness of inhabitance at homotopy-classification granularity. The κ-label classifies the constraint nerve’s homotopy type up to weak equivalence — it is a representative of an equivalence class of satisfying value tuples sharing the same homotopy type.

    • The concrete cert:witness ValueTuple IS derivable at the ψ_1 stage: a 0-simplex of Term::Nerve's SimplicialComplex emission IS a concrete satisfying value tuple in the carrier. Applications consuming Grounded<Output> as cert:InhabitanceCertificate materialize the concrete ValueTuple from the ψ_1 stage’s 0-simplices through their NerveResolver impl’s exposed witness selector.

    • cert:searchTrace IS Grounded::derivation().replay() (the trace recoverable from the catamorphism’s output per ADR-019’s anamorphism dual). The trace populates the trace:InhabitanceSearchTrace's derivation:InhabitanceStep sequence with the catamorphism’s per-variant fold-rule traversal across the canonical k-invariants branch.

  • Negative verdict. A catamorphism failure Err(PipelineFailure) whose structural cause is "the constraint nerve has empty Kan completion (no value in the carrier satisfies the declared constraint conjunction)" realizes a cert:InhabitanceImpossibilityCertificate envelope. The structural-reason payload IS proof:InhabitanceImpossibilityWitness; the witness’s proof:contradictionProof is the canonical-form encoding of the catamorphism’s failure trace (the sequence of ψ-stage evaluations that determined the constraint set’s unsatisfiability), suitable for Lean 4 by-contradiction reconstruction.

The κ-label and cert:witness are different witness granularities: the κ-label classifies an equivalence class of satisfying value tuples up to homotopy-type-equivalence; cert:witness is a specific representative ValueTuple drawn from that equivalence class. Both are valid witnesses of inhabitance; the canonical k-invariants branch produces both — the κ-label as its terminal output (ψ_9), and concrete ValueTuple representatives as 0-simplices of the constraint nerve (ψ_1). Applications consuming the verdict envelope select the witness granularity their use case requires.

The mapping is structural, not nominal. Grounded<Output> and Err(PipelineFailure) are the catamorphism’s success/failure envelopes; the ontology’s cert:InhabitanceCertificate / cert:InhabitanceImpossibilityCertificate are the verdict-envelope vocabulary; the κ-label, the SimplicialComplex’s 0-simplices, and the catamorphism’s recoverable trace are the structural witnesses that flow into the verdict envelopes' payload properties. The framework’s verifiability commitment per ADR-001 + ADR-019 is preserved end-to-end without new substrate machinery — the verdict envelope IS the catamorphism’s success/failure envelope.

An application’s NerveResolver<H> impl per ADR-036 MAY consult the ontology’s predicate:InhabitanceDispatchTable to route its internal dispatch through the three rule arms (TwoSatDecider, HornSatDecider, ResidualVerdictResolver per the three rules' declared targets). The dispatch table is a resolution-strategy specification at the ontology layer; the application’s NerveResolver impl’s choice of internal decider is a design decision, not a substrate requirement.

(2) Four-family resolver landscape mapping. The four resolver-trait families coexist as parallel resolution categories operating at different layers, not in a subclass/specialization relationship. Each family addresses a distinct architectural concern:

Family Surface Role Discipline
(1) Pipeline ψ-stage resolvers 8 traits per ADR-036 (NerveResolver<H>, …, KInvariantResolver<H>) Per-value byte-buffer content provision for resolver-bound ψ-Term variants per ADR-035. Sealed via __sdk_seal::Sealed; SDK resolver! macro emits impls.
(2) Bridge Observable-category resolvers ObservableResolver<H> root plus per-category plus per-specialization Per-Observable-category content provision for the bridge surface. Open trait surface; applications provide impls directly.
(3) User-surface morphism resolvers TransformResolver<H>, IsometryResolver<H>, etc. Per-morphism-class content provision for the user surface. Open trait surface.
(4) Ontology resolver:Resolver hierarchy 20+ class declarations (resolver:DihedralFactorizationResolver, resolver:InhabitanceResolver, etc.) Conceptual resolution-strategy specifications. Closed-catalog ontology; not surfaced as foundation traits.

The four families share the term "resolver" because each performs resolution — mapping abstract structural elements to concrete operational outputs — at its respective layer. They do not stand in a subclass relationship. Family (1) provides per-value content for the canonical ψ-chain; family (2) provides per-Observable content for the bridge surface; family (3) provides per-morphism content for the user surface; family (4) names resolution-strategy concepts in the ontology that impls in families (1)–(3) MAY consult internally.

The wiki commits explicit layer-naming in normative prose: when discussing per-ψ-stage content provision, the wiki names the ADR-036 traits explicitly by family (1); when discussing per-Observable-category content provision, the wiki names the bridge traits by family (2); etc. The ontology’s resolver:-namespace IRIs are referenced explicitly when discussing resolution strategies at the ontology layer. The four surfaces are kept distinct in normative wiki prose. Conflation between layers is the disambiguation hazard ADR-039 names.

Consequences: Applications whose admission relations are inhabitance questions have a committed architectural mapping: the canonical k-invariants branch IS the verdict mechanism; Grounded<Output> IS the positive-verdict envelope; Err(PipelineFailure) IS the negative-verdict envelope; the κ-label IS the structural (homotopy-classification) witness; the SimplicialComplex’s 0-simplices ARE concrete ValueTuple witnesses; the catamorphism’s recoverable trace IS the audit trail. No new substrate machinery is introduced.

The four-family resolver landscape is a vocabulary commitment. The wiki keeps the eight ADR-036 trait names (NerveResolver<H>, etc.) for family (1). Families (2) and (3) are foundation’s open bridge and user surfaces, addressed by other ADRs (ADR-022 D4 + downstream bridge ADRs). Family (4) is the ontology’s closed-catalog resolution-strategy vocabulary, consulted by impls in families (1)–(3) per application design.

Rejected alternative 1: Surface resolver:InhabitanceResolver as a 9th substrate-level resolver trait + Term::Inhabitance variant + grammar form G30. Rejected — duplicates the canonical k-invariants branch’s verdict mechanism. The κ-label of the canonical k-invariants branch IS the structural witness of inhabitance; the SimplicialComplex’s 0-simplices ARE concrete witness ValueTuples; the catamorphism’s trace IS the audit trail. A separate substrate-level InhabitanceResolver would split the verdict semantics across two substrate paths and force applications to choose between them. The canonical k-invariants branch is the architectural commitment for verdict production; resolver:InhabitanceResolver is a resolution-strategy specification the application’s NerveResolver MAY consult internally per predicate:InhabitanceDispatchTable.

Rejected alternative 2: Map the κ-label directly to cert:witness (treating the κ-label as the ValueTuple). Rejected — cert:witness ranges over schema:ValueTuple (a concrete value tuple); the κ-label is a homotopy classification (an equivalence class up to weak equivalence). The two are different witness granularities and the architectural commitment names both explicitly. The κ-label is the structural witness; the 0-simplex from Term::Nerve is the concrete witness; both flow into the cert:InhabitanceCertificate envelope’s payload.

Rejected alternative 3: Rename the wiki’s ADR-036 traits (e.g., to NerveProvider<H>, ChainComplexProvider<H>, etc.) to eliminate the term-collision with the ontology’s resolver:Resolver hierarchy. Rejected — major API break for foundation and all applications. The layer-naming disambiguation in clause (2) above is sufficient to clarify the architecture without renaming. The four families' shared term reflects the fact that all four perform resolution; the disambiguation is by layer, not by name.

Rejected alternative 4: Surface the entire resolver:-namespace’s hierarchy as a parallel substrate-level resolver-trait family (one foundation trait per ontology subclass). Rejected — explodes the substrate’s trait surface (20+ ontology subclasses each gaining a foundation trait); collides with ADR-036’s per-ψ-stage decomposition and ADR-022 D4’s bridge surface; serves no architectural purpose beyond exhaustive mirroring. The ontology’s resolver hierarchy is a closed-catalog vocabulary at the ontology layer; foundation’s traits are substrate-level decompositions at the implementation layer; the two have different roles and stay independent.

Rejected alternative 5: Restrict the verdict-realization mapping to applications that opt in via a marker trait (e.g., InhabitanceAdmissionRelation on PrismModel). Rejected — the mapping is universal: for any typed feature hierarchy whose admission relation is structurally an inhabitance question (any application whose ConstraintRef::Bound constraints define a satisfiability surface), the canonical k-invariants branch’s output realizes the verdict structure. The architecture does not require applications to opt in; the realization is structural to the framework’s verifiability commitment per ADR-001 + ADR-019.

ADR-040 — type:LexicographicLessEqBound — 7th BoundShape individual for byte-sequence-valued observables (substrate amendment under ADR-013/TR-08)

Status: Accepted.

Context: observable:AxisProjectionObservable per ADR-038 admits declarative encoding of axis-realized admission relations through ConstraintRef::Bound. Byte-sequence-valued observables (AxisProjectionObservable plus any future byte-sequence-valued Observable) and integer-valued observables (HammingMetric, DerivationDepthObservable, etc.) have structurally different comparison semantics. The closed catalog declares the structural shape of the admission relation; the application’s ψ_1 NerveResolver consumes the constraint declaration to construct the simplicial complex. The catalog primitive’s comparison semantics must be determinable from the catalog declaration alone, so the resolver does not dispatch on observable type. A single polymorphic primitive would push comparison dispatch into the resolver and weaken the catalog’s expressiveness; distinct primitives keep dispatch in the catalog.

Decision: ADR-040 commits one amendment under ADR-013/TR-08’s substrate-amendment-via-foundation rule:

type:LexicographicLessEqBound joins the closed BoundShape catalogue. Foundation declares the new individual in its type namespace:

Individual {
    id: "https://uor.foundation/type/LexicographicLessEqBound",
    label: "LexicographicLessEqBound",
    comment: "A BoundShape whose predicate form is observable(datum) <= bound,
              with byte-sequence comparison under the canonical big-endian
              unsigned ordering convention: for fixed-length sequences, this
              is identical to lexicographic order; for variable-length
              sequences, the convention is lexicographic with
              shorter-prefixed-sequences-less-than-longer-sequences-with-matching-prefix.
              Distinguished from type:LessEqBound, which is restricted to
              integer-valued observables. Use LexicographicLessEqBound for
              byte-sequence-valued observables (observable:AxisProjectionObservable
              per ADR-038 plus any future byte-sequence-valued Observable);
              use LessEqBound for integer-valued observables (HammingMetric,
              DerivationDepthObservable, etc.). The two are structurally
              distinct catalog primitives — the catalog declaration alone
              determines the comparison semantics; the resolver does not
              need to dispatch on observable type.",
    bound_kind: "https://uor.foundation/type/BoundShape",
}

type:LessEqBound is restricted to integer-valued observables; type:LexicographicLessEqBound is the byte-sequence-comparison primitive. The closed BoundShape catalogue contains 7 individuals: EqualBound, LessEqBound, GreaterEqBound, RangeContainBound, ResidueClassBound, AffineEqualBound, LexicographicLessEqBound.

ConstraintRef::Bound.args_repr canonical-string-form encoding rules for AxisProjectionObservable per ADR-038 are unchanged; the catalog’s bound_shape_iri field on the ConstraintRef::Bound declaration carries …​/LexicographicLessEqBound when the observable is byte-sequence-valued and …​/LessEqBound when integer-valued.

If a future totally-ordered value type with comparison semantics distinct from integer ⇐ and lexicographic byte-sequence ordering is introduced through ADR-013/TR-08 substrate amendment, it lands as its own distinct BoundShape catalog primitive, not as a semantic extension of LessEqBound or LexicographicLessEqBound. The architectural commitment: each totally-ordered value type whose comparison semantics differ from those the catalog already realizes gets its own catalog primitive at the ADR-013/TR-08 amendment boundary.

Bound-shape-to-ObservablePredicate-impl correspondence. Each BoundShape individual in the closed catalog has a corresponding foundation-published ObservablePredicate impl realizing the predicate semantics the bound shape names. type:LessEqBound is realized by foundation’s existing integer-typed ObservablePredicate impls (per the variants ADR-049 commits whose predicate form is integer-valued comparison). type:LexicographicLessEqBound is realized by LexicographicLessEqThreshold — a new ObservablePredicate impl committed alongside this ADR in the foundation observable module:

/// Byte-sequence threshold observable per
/// `observable:ValueThresholdObservable` (ADR-040). Predicate form:
/// `(digest as big-endian unsigned integer) <= (target as
/// big-endian unsigned integer)`. The target byte sequence IS the
/// argument; the predicate's accept_prob under U1 is
/// `(target_int + 1) / 2^(8 * width)`.
pub struct LexicographicLessEqThreshold {
    pub target: &'static [u8],
}

LexicographicLessEqThreshold is the canonical search-cost commitment realization: it consumes the target byte sequence as the bound’s argument and evaluates the predicate by big-endian-unsigned comparison of the digest against the target. Its accept_prob reading under U1 is the target’s normalized integer value (target_int + 1) / 2^(8·width) — the target byte sequence directly carries the acceptance probability rather than the probability being derivable from a structural-property type. This is the predicate form ADR-040 implicitly named when it committed LexicographicLessEqBound; making the correspondence explicit closes the catalog hole between the bound-shape primitive and its operational realization.

The bound-shape-to-predicate-impl correspondence is the substrate’s dispatch table: a ConstraintRef::Bound declaration with bound_shape_iri = "…/LexicographicLessEqBound" and args_repr encoding a byte-sequence target dispatches at evaluation to the LexicographicLessEqThreshold predicate impl with the canonical-string-form-decoded target byte sequence. The dispatch is catalog-driven; the application’s ψ_1 NerveResolver consumes the constraint declaration uniformly across bound-shape kinds, and the catamorphism’s commitment-evaluation per ADR-048 dispatches to the predicate impl the bound shape names.

Substrate-amendment-via-foundation rule per ADR-013/TR-08. Foundation declares the new BoundShape individual (LexicographicLessEqBound) in spec/src/namespaces/type_.rs and the corresponding LexicographicLessEqThreshold ObservablePredicate impl in the foundation observable module under a new observable:ValueThresholdObservable taxonomy subclass per ADR-038’s rule (parallel in role to the observable:SpectralObservable subclass added by ADR-049 — both extend the closed Observable taxonomy with a new top-level subclass derived from an architectural need not covered by the original seven categories). Foundation revises type:LessEqBound's comment to restrict it to integer-valued observables (removing the byte-sequence semantic-extension language per ADR-038 clause (2)). The wire-format version constant bumps for the schema amendment. The closed BoundShape catalogue is now 7 individuals.

Consequences: Typed feature hierarchies whose admission relations express as "the axis-realized projection of typed sites is bounded by a target byte sequence" declare their admission relation through ConstraintRef::Bound with observable_iri = "…​/AxisProjectionObservable" per ADR-038 and bound_shape_iri = "…​/LexicographicLessEqBound" per this ADR. The catalog declaration alone determines the comparison semantics; the application’s ψ_1 NerveResolver consumes the constraint declaration and constructs the simplicial complex over the byte-sequence comparison directly — no observable-type dispatch in the resolver.

The architectural commitment is to catalog-level disambiguation: each BoundShape primitive has unambiguous semantics that the resolver realizes uniformly. Each totally-ordered value type whose comparison semantics differ from integer ⇐ gets its own catalog primitive.

Rejected alternative 1: Use a single polymorphic-LessEqBound primitive that requires resolvers to dispatch on observable type. Rejected — the closed catalog should declare the structural shape of the admission relation in full, including the comparison semantics; pushing comparison dispatch into the resolver weakens the catalog’s expressiveness and complicates resolver implementations. Distinct primitives keep the catalog declaration self-contained.

Rejected alternative 2: Add a comparison_kind field to every ConstraintRef::Bound variant carrying an explicit "integer" or "byte-sequence" tag. Rejected — adds a parallel discriminator mechanism that duplicates information already carried by the bound_shape_iri field; the cleaner approach is to use distinct BoundShape primitives so the IRI itself is the discriminator.

Rejected alternative 3: Replace LessEqBound with LexicographicLessEqBound everywhere (treating byte-sequence comparison as the primitive form and integer comparison as a special case). Rejected — integer-valued observables are pervasive (HammingMetric, DerivationDepthObservable, etc.); restating their existing comparison rule in byte-sequence terms is an unnecessary change that complicates the catalog’s read for the integer-valued case. Both primitives coexist.

Rejected alternative 4: Add LexicographicLessEqBound as a subclass of LessEqBound (treating it as a specialization). Rejected — BoundShape is a closed-catalog of individuals, not a class hierarchy. Subclassing within the catalog would introduce a meta-level relationship that the existing 6 individuals don’t have; flat catalog structure is preserved.

Rejected alternative 5: Defer LexicographicLessEqBound to a future amendment. Rejected — applications whose admission relations involve axis-realized projections depend on catalog-level disambiguation of byte-sequence comparison; deferring it defers the architecture’s verifiability commitment for that class of applications.

ADR-041 — Typed-coordinate resolver carriers: zero-allocation newtype wrappers preserving ψ-stage output typing

Status: Accepted. Carrier byte-widths derived per ADR-060. The typed-coordinate carriers (SimplicialComplexBytes, ChainComplexBytes, …, KInvariantsBytes) remain #[repr(transparent)] newtype views preserving ψ-stage output typing; ADR-060 changes only their byte-width sizing — each stage’s width derives from a foundation const fn (nerve_carrier_bytes::<B>(), …) computing structural-count × foundation-fixed per-element wire width, rather than from a removed *_OUTPUT_BYTES_MAX HostBounds ceiling. The carriers are constructed over the source-polymorphic TermValue’s backing bytes (a resolver emitting `Borrowed/Stream exposes its carrier through the same typed-view discipline). The type-system discrimination of ψ-stage outputs is unchanged.

Context: ADR-036 committed the uniform writer-style byte-buffer surface for the eight ψ-stage resolver traits: fn resolve(&self, input: &[u8], out: &mut [u8]) → Result<usize, ShapeViolation>. The byte-buffer surface was chosen over typed *Record<H> returns to avoid per-stage allocation in the catamorphism’s evaluation environment (ADR-036 Rejected alternative 2). The architectural concern was: typed returns would force allocation; byte buffers thread between ψ-stages with zero allocation.

The byte-buffer surface is correct on the allocation dimension but incomplete on the type-system dimension. As ψ-stage outputs flow between resolvers — Term::Nerve's output flows to Term::PostnikovTower's input; Term::ChainComplex's output flows to Term::HomologyGroups's input — the type system has no way to distinguish SimplicialComplex bytes from ChainComplex bytes from HomologyGroups bytes. All are &[u8]. The catamorphism’s per-variant fold-rules can pass arbitrary bytes from any prior stage as input to any subsequent stage; mismatches would only surface as ShapeViolations at evaluation time, not at compile time.

Without typed carriers, ψ-stage outputs lose typing under a byte-flat carrier; resolvers cannot distinguish their expected input shape from arbitrary bytes; the type system cannot enforce that NerveResolver's output flows only to PostnikovResolver/ChainComplexResolver’s input (and not to `KInvariantResolver's input by mistake). The application must trust the catamorphism to thread the right bytes between the right stages — a runtime invariant the type system should enforce statically.

A middle ground exists between byte-flat &[u8] and allocation-forcing *Record<H>: newtype wrappers around byte slices that carry no runtime state beyond the slice itself, but distinguish ψ-stage outputs at the type level. pub struct SimplicialComplexBytes<'a>(pub &'a [u8]) is zero-cost at runtime (a &[u8] with a typed wrapper) and provides the type-system discrimination ADR-036’s byte-flat surface lacks.

Decision: ADR-041 commits the typed-coordinate carrier mechanism for ψ-stage resolvers:

(1) Foundation declares one zero-allocation typed carrier per ψ-stage output shape. Each carrier is a #[repr(transparent)] newtype wrapping a byte slice:

/// ψ_1 output: byte serialization of a SimplicialComplex.
#[repr(transparent)]
pub struct SimplicialComplexBytes<'a>(pub &'a [u8]);

/// ψ_2 output: byte serialization of a ChainComplex.
#[repr(transparent)]
pub struct ChainComplexBytes<'a>(pub &'a [u8]);

/// ψ_3 output: byte serialization of HomologyGroups.
#[repr(transparent)]
pub struct HomologyGroupsBytes<'a>(pub &'a [u8]);

/// ψ_4 output: byte serialization of BettiNumbers.
#[repr(transparent)]
pub struct BettiNumbersBytes<'a>(pub &'a [u8]);

/// ψ_5 output: byte serialization of a CochainComplex.
#[repr(transparent)]
pub struct CochainComplexBytes<'a>(pub &'a [u8]);

/// ψ_6 output: byte serialization of CohomologyGroups.
#[repr(transparent)]
pub struct CohomologyGroupsBytes<'a>(pub &'a [u8]);

/// ψ_7 output: byte serialization of a PostnikovTower.
#[repr(transparent)]
pub struct PostnikovTowerBytes<'a>(pub &'a [u8]);

/// ψ_8 output: byte serialization of HomotopyGroups.
#[repr(transparent)]
pub struct HomotopyGroupsBytes<'a>(pub &'a [u8]);

/// ψ_9 output: byte serialization of KInvariants — the κ-label.
#[repr(transparent)]
pub struct KInvariantsBytes<'a>(pub &'a [u8]);

Each carrier is #[repr(transparent)] so the layout is identical to &[u8]; the type wrapper is purely compile-time. Zero runtime cost; zero allocation; full type-system discrimination.

(2) The eight ψ-stage resolver traits' resolve method signatures take the prior stage’s typed carrier as input and produce the current stage’s typed-carrier byte representation as output. The byte-buffer writer surface is preserved for the output (zero-allocation byte serialization); the input is typed:

pub trait NerveResolver<H: Hasher> {
    /// ψ_1: value bytes → SimplicialComplex serialization.
    /// `input` is the per-value byte sequence (the typed-feature-hierarchy
    /// input bytes, not a prior ψ-stage's output, so its type is &[u8]).
    fn resolve(&self, input: &[u8], out: &mut [u8])
        -> Result<usize, ShapeViolation>;
}

pub trait ChainComplexResolver<H: Hasher> {
    /// ψ_2: SimplicialComplex → ChainComplex serialization.
    fn resolve(&self, input: SimplicialComplexBytes<'_>, out: &mut [u8])
        -> Result<usize, ShapeViolation>;
}

pub trait HomologyGroupResolver<H: Hasher> {
    /// ψ_3: ChainComplex → HomologyGroups serialization.
    fn resolve(&self, input: ChainComplexBytes<'_>, out: &mut [u8])
        -> Result<usize, ShapeViolation>;
}

pub trait CochainComplexResolver<H: Hasher> {
    /// ψ_5: ChainComplex → CochainComplex serialization.
    fn resolve(&self, input: ChainComplexBytes<'_>, out: &mut [u8])
        -> Result<usize, ShapeViolation>;
}

pub trait CohomologyGroupResolver<H: Hasher> {
    /// ψ_6: CochainComplex → CohomologyGroups serialization.
    fn resolve(&self, input: CochainComplexBytes<'_>, out: &mut [u8])
        -> Result<usize, ShapeViolation>;
}

pub trait PostnikovResolver<H: Hasher> {
    /// ψ_7: SimplicialComplex → PostnikovTower serialization (Kan-completion
    /// + truncation tower).
    fn resolve(&self, input: SimplicialComplexBytes<'_>, out: &mut [u8])
        -> Result<usize, ShapeViolation>;
}

pub trait HomotopyGroupResolver<H: Hasher> {
    /// ψ_8: PostnikovTower → HomotopyGroups serialization.
    fn resolve(&self, input: PostnikovTowerBytes<'_>, out: &mut [u8])
        -> Result<usize, ShapeViolation>;
}

pub trait KInvariantResolver<H: Hasher> {
    /// ψ_9: HomotopyGroups → KInvariants (κ-label) serialization.
    fn resolve(&self, input: HomotopyGroupsBytes<'_>, out: &mut [u8])
        -> Result<usize, ShapeViolation>;
}

The NerveResolver input remains &[u8] because its source is the per-value byte sequence from the typed feature hierarchy — not a prior ψ-stage’s output. All other resolver inputs are the typed carrier for the corresponding prior ψ-stage’s output. Term::Betti's fold-rule (per ADR-035, resolver-free) reads HomologyGroupsBytes<'_> directly from the catamorphism’s ψ_3 emission and extracts the BettiNumbers byte array; the resolver-free fold-rule shape adapts to the typed input without requiring a BettiResolver trait.

(3) The catamorphism threads typed carriers between ψ-stages. The catamorphism’s per-variant fold-rules per ADR-035 + ADR-029 evaluate each ψ-Term variant by:

  • Evaluating the operand subterm recursively, producing a byte sequence in the catamorphism’s scratch buffer (per <B as HostBounds>::*_OUTPUT_BYTES_MAX per ADR-037).

  • Constructing the typed carrier from the byte sequence: SimplicialComplexBytes(&scratch[..len]) (or the equivalent for other stages).

  • Invoking the corresponding resolver’s resolve method with the typed carrier as input.

  • The resolver writes its output bytes into the next ψ-stage’s scratch buffer; the catamorphism wraps that buffer in the appropriate typed carrier for the next stage.

The runtime cost is unchanged from ADR-036’s byte-flat surface: the #[repr(transparent)] newtype constructor is a no-op at runtime; the byte slice flows through the wrapper without copy or allocation. The type system gains full discrimination of ψ-stage outputs at compile time.

(4) Cross-stage composition is type-checked at resolver-impl compile time. Application authors writing resolver impls receive typed inputs they cannot mistake: a PostnikovResolver impl receives SimplicialComplexBytes<'_> (not ChainComplexBytes<'_> and not &[u8]); its resolve body operates on the typed carrier. The Rust type system rejects mismatched composition at compile time — an attempt to pass ChainComplexBytes to PostnikovResolver::resolve is a type error, not a ShapeViolation.

The architectural commitment is to typed carriers between ψ-stages; the byte-buffer output is preserved (zero allocation); the type system catches cross-stage mismatches that would previously surface only at evaluation time.

Substrate-amendment-via-foundation rule per ADR-013/TR-08. Foundation declares the nine typed-carrier newtypes in the foundation pipeline component. Foundation updates the eight ψ-stage resolver trait signatures to take the prior-stage typed carrier as input. The catamorphism’s per-variant fold-rules per ADR-035 + ADR-029 adapt to construct and thread the typed carriers. The wire-format byte serializations are unchanged (each carrier’s byte layout is the same as before; only the type wrapper changes); the format-version constant is unchanged for the type-system-only amendment.

Consequences: ψ-stage resolver impls receive typed inputs they cannot confuse; cross-stage composition is type-checked at compile time; the architectural commitment that "the catamorphism evaluates the ψ-chain through one uniform byte-buffer surface" is preserved; ψ-stage outputs preserve type-system discrimination from the catamorphism’s evaluation environment to the resolver impl.

The typed-carrier mechanism is not a typed return value (typed returns would force per-stage allocation, which ADR-036’s writer-style output surface avoids). The carriers are typed views into the same byte buffer the byte-flat surface already used. Zero allocation; full typing. The writer-style &mut [u8] output surface is preserved; only the input parameter type changes from &[u8] to the typed carrier.

Rejected alternative 1: Revert to fully typed *Record<H> returns (the ADR-036 rejected alternative 2 form). Rejected for the same reason ADR-036 rejected it: typed returns force per-stage allocation in the catamorphism’s evaluation environment, breaking the architectural commitment to zero-allocation byte threading.

Rejected alternative 2: Use marker traits on the byte-slice type (e.g., unsafe trait SimplicialComplex {}) rather than newtype wrappers. Rejected — marker traits don’t carry the byte slice as a struct field; the application would have to thread the slice separately, defeating the convenience the newtype wrapper provides. Newtype wrappers are the canonical Rust idiom for zero-cost typing.

Rejected alternative 3: Introduce an associated type on each resolver trait (type Input;, type Output;) carrying the ψ-stage shape. Rejected — associated types require resolver impls to bind them, adding boilerplate without architectural benefit; the typed-carrier approach is simpler and the byte-layout commitment is preserved at the type-system level via #[repr(transparent)].

Rejected alternative 4: Defer typed carriers to a future amendment, accepting type-system erasure as a known limitation. Rejected — type-system discrimination at compile time is materially stronger than runtime ShapeViolation detection. Deferring the commitment leaves applications unable to enforce ψ-stage composition correctness at compile time.

Rejected alternative 5: Combine typed carriers with MaybeUninit-based output buffers (writing into uninitialized memory). Rejected — adds unsafe complexity to resolver impls; the existing &mut [u8] output surface is safe Rust and the typed-input change is purely additive at the type-system level.

ADR-042 — Inhabitance verdict typed surface: InhabitanceCertificate<T> / InhabitanceImpossibilityCertificate as zero-allocation views over the catamorphism’s Result envelope

Status: Accepted.

Context: ADR-039 committed the inhabitance verdict realization mapping: a successful Grounded<Output> IS a cert:InhabitanceCertificate envelope (carrying the κ-label as homotopy-classification structural witness at ψ_9; the concrete cert:witness ValueTuple derivable from Term::Nerve's 0-simplices at ψ_1; cert:searchTrace as Grounded::derivation().replay()); an Err(PipelineFailure) realizes a cert:InhabitanceImpossibilityCertificate envelope (carrying proof:InhabitanceImpossibilityWitness as proof payload).

ADR-039’s mapping is structural — Grounded<Output> IS the certificate envelope in the sense that the certificate’s payload coordinates derive from the Grounded’s witness surfaces. But ADR-039 stops short of a typed Rust surface. The application receives Result<Grounded<Output>, PipelineFailure> from pipeline::run_route; to consume the result as a cert:InhabitanceCertificate it must implement the κ-label / witness / search-trace accessors itself for every typed feature hierarchy.

Without a foundation-declared typed surface, applications consuming the framework as a verdict producer must re-derive the verdict-envelope mapping per-application — extracting the κ-label byte slice from the Grounded's output payload, locating the 0-simplices within the Term::Nerve emission, exposing the trace through derivation().replay() — and each application re-implements the verdict envelope.

Two coupled needs frame the typed surface: a typed InhabitanceCertificate<T> surface that wraps Grounded<T> and exposes the verdict-envelope coordinates, and an inhabitance-resolver wiring that lets applications consult predicate:InhabitanceDispatchTable through a foundation-provided helper rather than re-implementing the dispatch-table consultation inside every NerveResolver impl.

Decision: ADR-042 commits the typed-surface wiring for the inhabitance verdict envelope:

(1) InhabitanceCertificate<T> and InhabitanceImpossibilityCertificate — newtype views over the catamorphism’s Result envelope. Foundation declares two zero-allocation typed views:

/// A typed view exposing the verdict-envelope coordinates of a successful
/// catamorphism evaluation per ADR-039. Constructed from `Grounded<T>` via
/// `Grounded::as_inhabitance_certificate(&self)`. Zero allocation;
/// `#[repr(transparent)]` over `&Grounded<T>`.
#[repr(transparent)]
pub struct InhabitanceCertificate<'a, T>(pub &'a Grounded<T>);

impl<'a, T: ConstrainedTypeShape + GroundedShape + IntoBindingValue>
    InhabitanceCertificate<'a, T>
{
    /// The κ-label — the homotopy-classification structural witness at ψ_9
    /// per the canonical k-invariants branch (ADR-035). A byte slice into
    /// the Grounded's output payload at the offset/length the canonical
    /// branch's terminal stage emission writes.
    pub fn kappa_label(&self) -> KInvariantsBytes<'_> {
        // Foundation implementation: locate the Term::KInvariants emission
        // in the Grounded's output payload via the route's Term arena
        // metadata; return a typed-carrier view into the bytes.
    }

    /// The concrete `cert:witness` ValueTuple per ADR-039 — derivable from
    /// `Term::Nerve`'s 0-simplices at ψ_1. Foundation returns a typed view
    /// into the SimplicialComplex 0-simplex byte range; the application
    /// interprets the ValueTuple per its typed-feature-hierarchy's shape.
    pub fn witness(&self) -> WitnessValueTuple<'_> {
        // Foundation implementation: locate Term::Nerve's emission;
        // return the 0-simplex byte range as a typed view.
    }

    /// The `cert:searchTrace` audit trail per ADR-039 — recoverable from the
    /// Grounded via `derivation().replay()` per ADR-019's anamorphism dual.
    pub fn search_trace(&self) -> Trace {
        self.0.derivation().replay()
    }

    /// The `cert:certifiedType` reference — the typed feature hierarchy
    /// the certificate is about.
    pub fn certified_type(&self) -> &'static str {
        <T as ConstrainedTypeShape>::IRI
    }

    /// Access the underlying Grounded.
    pub fn grounded(&self) -> &'a Grounded<T> {
        self.0
    }
}

/// A typed view exposing the `proof:InhabitanceImpossibilityWitness` payload
/// of a catamorphism failure whose structural cause is "the constraint nerve
/// has empty Kan completion" per ADR-039.
pub struct InhabitanceImpossibilityCertificate<'a> {
    failure: &'a PipelineFailure,
    contradiction_proof: &'a [u8],
}

impl<'a> InhabitanceImpossibilityCertificate<'a> {
    /// The `proof:contradictionProof` — the canonical-form encoding of the
    /// catamorphism's failure trace (the sequence of ψ-stage evaluations
    /// that determined the constraint set's unsatisfiability), suitable for
    /// Lean 4 by-contradiction reconstruction.
    pub fn contradiction_proof(&self) -> &[u8] {
        self.contradiction_proof
    }

    /// The underlying PipelineFailure for inspection of other ShapeViolation
    /// metadata.
    pub fn failure(&self) -> &'a PipelineFailure {
        self.failure
    }
}

The two typed surfaces are zero-allocation views; they do not own the underlying data; they expose verdict-envelope coordinates the catamorphism’s Result envelope already carries. The architectural commitment per ADR-039 — "the verdict envelope IS the catamorphism’s success/failure envelope" — is preserved; ADR-042 adds the typed accessors.

WitnessValueTuple<'a> is a typed carrier paralleling ADR-041’s ψ-stage carriers: #[repr(transparent)] pub struct WitnessValueTuple<'a>(pub &'a [u8]). Foundation also declares the conversion accessors on Grounded<T> and PipelineFailure:

impl<T: ConstrainedTypeShape + GroundedShape + IntoBindingValue> Grounded<T> {
    /// Type-system surface for ADR-039's verdict-realization mapping:
    /// for typed feature hierarchies whose admission relations are
    /// inhabitance questions, view this Grounded as the
    /// cert:InhabitanceCertificate envelope.
    pub fn as_inhabitance_certificate(&self) -> InhabitanceCertificate<'_, T> {
        InhabitanceCertificate(self)
    }
}

impl PipelineFailure {
    /// Type-system surface for ADR-039's negative-verdict realization:
    /// if this failure's structural cause is "the constraint nerve has
    /// empty Kan completion", view it as the
    /// cert:InhabitanceImpossibilityCertificate envelope.
    /// Returns None if the failure has a different structural cause
    /// (capacity-exceeded, shape-violation outside the Kan-completion path,
    /// etc.).
    pub fn as_inhabitance_impossibility_certificate(&self)
        -> Option<InhabitanceImpossibilityCertificate<'_>>
    { /* ... */ }
}

(2) inhabitance::dispatch_through_table — foundation-provided helper for predicate:InhabitanceDispatchTable consultation. Per ADR-039 clause (1), an application-supplied NerveResolver<H> impl MAY consult predicate:InhabitanceDispatchTable (per spec/src/namespaces/predicate.rs) to route its internal dispatch through the three rule arms (TwoSatDecider, HornSatDecider, ResidualVerdictResolver). Foundation provides a helper that abstracts the dispatch-table consultation:

/// Routes an inhabitance-style admission relation through the ontology's
/// predicate:InhabitanceDispatchTable per ADR-039. Application NerveResolver
/// impls call this helper from inside their resolve method to dispatch on
/// the constraint-set shape; the helper returns either a SimplicialComplex
/// byte serialization (positive verdict path) or a ShapeViolation with the
/// canonical-form failure trace (negative verdict path).
pub fn dispatch_through_table<H: Hasher>(
    constraints: &[u8],
    value_bytes: &[u8],
    out: &mut [u8],
) -> Result<usize, ShapeViolation>;

The helper’s three rule arms parallel the ontology’s predicate:InhabitanceDispatchTable dispatch rules. The application’s NerveResolver impl invokes the helper inside its resolve body when the constraint-set shape fits one of the three rule arms; for shapes outside the dispatch table’s coverage, the application’s NerveResolver implements the admission-relation logic directly. The helper is opt-in; resolver impls that don’t consult predicate:InhabitanceDispatchTable need not use it.

(3) The typed surface is universal, not opt-in. For any typed feature hierarchy whose admission relations are inhabitance questions (any application whose ConstraintRef::Bound constraints define a satisfiability surface), the typed-surface accessors as_inhabitance_certificate / as_inhabitance_impossibility_certificate are available. Applications whose admission relations are not inhabitance questions still receive Result<Grounded<T>, PipelineFailure> from pipeline::run_route without obligation to use the typed surface — the accessors are additional methods, not replacements. The verdict-envelope reading is the application’s choice.

Substrate-amendment-via-foundation rule per ADR-013/TR-08. Foundation declares the InhabitanceCertificate<'a, T> and InhabitanceImpossibilityCertificate<'a> typed-view structs, the WitnessValueTuple<'a> carrier, the accessor methods on Grounded<T> and PipelineFailure, and the inhabitance::dispatch_through_table helper. The wire format is unchanged (the typed surface is a view layer over the existing catamorphism’s Result envelope; no new wire-format types).

Consequences: Applications consume the catamorphism’s Result envelope as the ontology’s three-primitive verdict structure through the foundation-provided typed surface. ADR-039’s structural mapping is realized at the Rust type-system level: Grounded::as_inhabitance_certificate(&self) -> InhabitanceCertificate<'_, T> is the typed surface; PipelineFailure::as_inhabitance_impossibility_certificate(&self) -> Option<InhabitanceImpossibilityCertificate<'_>> is the typed negative-verdict surface; inhabitance::dispatch_through_table is the optional predicate:InhabitanceDispatchTable consultation helper.

The framework’s verifiability commitment per ADR-001 + ADR-019 is realized end-to-end through typed surfaces: applications declare their typed feature hierarchy’s admission relations through the closed catalog (per ADR-038 + ADR-040); the canonical k-invariants branch evaluates them (per ADR-035 + ADR-041); the typed verdict envelope exposes the κ-label and concrete witness coordinates (per ADR-042). No application-layer verdict re-derivation; no per-application accessor reimplementation.

Rejected alternative 1: Make InhabitanceCertificate<T> a wholly new sealed substrate type returned directly from the catamorphism (alongside or replacing Grounded<T>). Rejected — this would split the catamorphism’s success-envelope vocabulary (Grounded<T> for general success, InhabitanceCertificate<T> for inhabitance-style success), forcing applications to choose between them based on admission-relation shape. The view-layer approach keeps Grounded<T> as the universal success envelope and adds the typed view for inhabitance-style consumption.

Rejected alternative 2: Require applications to declare an InhabitanceAdmissionRelation marker trait on their PrismModel impl to enable the typed accessors. Rejected — the typed accessors are zero-cost views available universally; marker-trait gating adds boilerplate without architectural benefit. Applications whose admission relations are not inhabitance questions simply don’t call the typed accessors.

Rejected alternative 3: Expose InhabitanceCertificate<T> as a heap-allocated owned type rather than a borrowed view. Rejected — heap allocation in the carrier path violates #![no_std] posture; the view layer is zero-allocation by construction (#[repr(transparent)] over &Grounded<T>).

Rejected alternative 4: Surface resolver:InhabitanceResolver as a parallel foundation trait (separate from NerveResolver) that applications implement explicitly for inhabitance-style admission relations. Rejected — ADR-039 Rejected alternative 1 already addressed this: the canonical k-invariants branch IS the verdict mechanism; introducing a parallel substrate-level resolver trait splits the verdict semantics across two substrate paths. The inhabitance::dispatch_through_table helper provides the predicate:InhabitanceDispatchTable consultation without surfacing a new resolver trait.

Rejected alternative 5: Defer the typed surface to a future amendment, accepting per-application accessor reimplementation as a known limitation. Rejected — the typed surface is a small additive commitment; deferring it forces per-application reimplementation of accessor logic foundation can provide once.

ADR-043 — Iterative-resolution discipline: resolver-internal bounded-search convergence/exhaustion with impossibility-witness emission

Status: Accepted.

Context: ADR-035 commits the canonical ψ-pipeline (ψ_1 → ψ_7 → ψ_8 → ψ_9) and the ψ-residuals discipline that forbids σ-residuals (Term::FirstAdmit, Term::AxisInvocation, byte-comparison PrimitiveOp s) in verb bodies. ADR-036 commits the eight resolver traits whose impls realize each resolver-bound ψ-stage’s typed-carrier transform. ADR-041 commits the typed-coordinate carriers (SimplicialComplexBytes, …​, KInvariantsBytes) that thread between ψ-stages. ADR-039 commits the verdict realization mapping (Grounded<Output> ⇔ cert:InhabitanceCertificate; Err(PipelineFailure) ⇔ cert:InhabitanceImpossibilityCertificate). ADR-040 commits type:LexicographicLessEqBound as the byte-sequence-comparison primitive in the closed BoundShape catalogue.

What is unspecified across these ADRs is the load-bearing computation inside a resolver body when the typed-carrier transform requires bounded-search inhabitance enumeration. Several resolver-bound ψ-stages — most prominently ψ_9 KInvariant whose typed output is the homotopy-classification κ-label — must materialize the admitting value of a finite parametric domain against the constraint geometry’s admission relation. The resolver receives the prior ψ-stage’s typed carrier (containing the upstream geometry and unpinned-site locations), iterates candidate values from the domain-parametric finite ring per ADR-032, evaluates each candidate against the structural admission relation, and emits the admitting carrier on convergence or the impossibility witness on domain exhaustion. The wiki references this pattern obliquely (the FreeRank sealed type per ADR-016; first_admit per ADR-034 as a closure-body operator; the proof:InhabitanceImpossibilityWitness payload per ADR-039) but does not canonicalize the resolver-internal iteration discipline as an architectural commitment. Implementations have therefore re-derived the discipline informally — a fragility that risks divergent realizations and obscures the boundary between closure-body restrictions and resolver-body affordances.

The discipline is structurally distinct from the closure-body first_admit operator. The closure-body first_admit is a typed-iso surface construct (ADR-026 G16 + ADR-034) that the catamorphism’s Term::FirstAdmit fold-rule evaluates per ADR-029, lowered by the SDK macro from the route declaration’s closure body, restricted to non-verb-body contexts per ADR-035’s ψ-residuals discipline. The iterative-resolution discipline is a resolver-internal mechanism — bounded iteration inside a resolver impl’s resolve method body — that the catamorphism’s resolver-bound ψ-Term fold-rules per ADR-036 dispatch to as a single opaque step from the typed-iso surface’s perspective. The two operate at different layers: closure-body first_admit is the application author’s typed-iso vocabulary; iterative-resolution is the substrate’s structural-transform realization.

Decision: ADR-043 commits the iterative-resolution discipline as the resolver-internal computational pattern for resolver-bound ψ-stages whose typed-carrier transform requires bounded-search inhabitance enumeration. The discipline:

(1) FreeRank protocol. The resolver consumes its typed-coordinate carrier per ADR-041; the carrier encodes the upstream ψ-stage’s structural geometry (the SimplicialComplex nerve at ψ_1’s emission; the HomotopyGroups π_0 count at ψ_8’s emission; etc.) and the unpinned-site identifiers — the sites in the constraint geometry’s free dimension that lack pinning by the upstream stages. FreeRank is the count of unpinned sites in the resolver’s working state at any iteration step. Per ADR-016, FreeRank is one of the four UOR-domain sealed types in uor-foundation::enforcement; the resolver consumes it through the typed carrier’s structural metadata, not as a value-level argument.

FreeRank decreases monotonically as the resolver pins sites by successful predicate evaluations. Convergence is FreeRank = 0 — every site in the constraint geometry’s free dimension has been pinned, the typed carrier’s structural-transform output is fully materialized, and the resolver emits its typed-output bytes (per the resolver trait’s writer-style signature per ADR-036).

(2) Bounded-domain enumeration. The resolver iterates candidate values over a domain-parametric finite ring per ADR-032. The domain is any ConstrainedTypeShape whose CYCLE_SIZE: u64 per ADR-032 is bounded — a Witt-level shape (W{n}::CYCLE_SIZE = 2^n), a partition-product / partition-coproduct over Witt-level shapes, or an application-declared shape with a bounded CYCLE_SIZE. The resolver introspects the domain’s cardinality through the same <DomainTy as ConstrainedTypeShape>::CYCLE_SIZE introspection the closure-body first_admit lowering per ADR-032 uses, so the resolver and the closure-body operator consume the same shape-cardinality surface — at different layers, with structurally-identical introspection.

At each iteration, the resolver assembles a candidate working state by composing the prior carrier’s pinned sites with the candidate value at the unpinned-site positions; evaluates the structural admission relation (per the constraint geometry’s ConstraintRef::Bound variant per ADR-040 — for byte-sequence-comparison admission relations, type:LexicographicLessEqBound); and continues if the relation evaluates false, terminates if the relation evaluates true (Convergence) or if the domain is exhausted (Exhaustion). The σ-projection through the canonical hash axis (<A as Hasher>::initial().fold_bytes(…​) per ADR-022 D5 + ADR-036) is computed inside the iteration when the admission relation consults the canonical hash axis; the byte-comparison against the constraint’s bound per ADR-040 is computed inside the iteration when the admission relation reads type:LexicographicLessEqBound. Both are resolver-body computations, not verb-body emissions.

(3) Termination — Convergence vs Exhaustion. The resolver terminates iteration on one of two outcomes:

  • Convergence. The first candidate value for which the admission relation evaluates true. The resolver pins the candidate to the unpinned-site positions (FreeRank decreases to 0); the resolver emits the admitting carrier’s bytes through its writer-style out: &mut [u8] parameter per ADR-036; the return value is Ok(byte_count) carrying the number of bytes written.

  • Exhaustion. The domain-parametric finite ring is enumerated to its full cardinality without convergence. No candidate value admits; the constraint geometry has empty Kan completion (per ADR-039’s negative-verdict reading: the carrier of the ConstrainedType is empty). The resolver returns Err(ShapeViolation) carrying the canonical https://uor.foundation/proof/InhabitanceImpossibilityWitness shape IRI per ADR-039; the ShapeViolation propagates through Term::Try per ADR-022 D3 G9, surfacing the catamorphism’s failure envelope as Err(PipelineFailure) whose predicate:InhabitanceImpossibilityCertificate typed surface per ADR-042 carries the proof:InhabitanceImpossibilityWitness payload with proof:contradictionProof as the canonical-form encoding of the exhaustion trace.

(4) Host-boundary retry. Convergence is the architectural success outcome; Exhaustion is the architectural unsatisfiability outcome. On Exhaustion, the catamorphism propagates Err(PipelineFailure) to the application’s PrismModel::forward(input) caller; the host boundary (the application’s caller-side outer loop) may vary the input outside the iterative-resolution domain — by mutating a parameter that produces a structurally-distinct MiningTask-equivalent input, for which the resolver’s iteration explores a different region of the domain-parametric finite ring — and re-invoke forward(input). The retry is host-external: the application chooses whether and how to vary the input; the catamorphism is invoked afresh for each retry; each invocation runs the resolver’s iteration over the full domain in the new input’s context.

The retry mechanism is not part of the catamorphism’s structural commitment. The catamorphism is one structural inference per invocation; it terminates with Convergence (Ok(Grounded<Output>)) or Exhaustion (Err(PipelineFailure)) per the resolver’s iteration outcome. Retry is the application’s host-boundary affordance — the architectural commitment ADR-001 calls "structural inference + application-side retry on unsatisfiability" — not a catamorphism-internal loop.

(5) Scope boundary with ψ-residuals discipline. ADR-035’s ψ-residuals discipline applies to verb bodies — the closure-body expressions consumed by verb! and prism_model! route declarations, emitted as Term arena slices via SDK macro expansion per ADR-026. ADR-043’s iterative-resolution discipline applies to resolver bodies — the impl <ψ-stage>Resolver<H> for <Impl> blocks per ADR-036 whose resolve method bodies realize the typed-carrier structural transform. The two disciplines reside at different layers without contradiction:

  • Verb body. Term::FirstAdmit, Term::AxisInvocation, PrimitiveOp::Le/Lt/Ge/Gt/Concat are forbidden per ADR-035. The SDK macro’s ψ-residuals walk per ADR-035 rejects emissions at proc-macro expansion time. The verb body composes only ψ-Term variants (per ADR-035’s canonical ψ_1 → ψ_7 → ψ_8 → ψ_9 branch and ADR-035’s resolver-free ψ_4 Betti); σ-residual constructs are admissible in non-verb-body contexts but rejected from typed-iso surface declarations.

  • Resolver body. Bounded iteration over <DomainTy as ConstrainedTypeShape>::CYCLE_SIZE per ADR-032, σ-projection through the canonical hash axis per ADR-022 D5 + ADR-036, byte-comparison against ConstraintRef::Bound per ADR-040, structural admission-relation evaluation, FreeRank decrement, impossibility-witness emission per ADR-039 — all are admissible inside resolver bodies. The resolver body is the substrate’s mechanism for realizing the typed-carrier transform; it is not a closure-body expression.

The boundary is structural, not stylistic: closure bodies are the application’s typed-iso vocabulary that SDK macros lower to Term arena slices for the catamorphism to fold; resolver bodies are the substrate’s mechanism for realizing the structural transform that the catamorphism’s resolver-bound fold-rules dispatch to. The disciplines apply at different layers; the ψ-residuals discipline does not constrain resolver bodies, and the iterative-resolution discipline does not constrain closure bodies.

Substrate-amendment-via-foundation rule per ADR-013/TR-08: ADR-043 is not a substrate amendment in the TR-08 sense. It canonicalizes a discipline over existing substrate constructs (resolver traits per ADR-036; typed carriers per ADR-041; ConstrainedTypeShape::CYCLE_SIZE per ADR-032; ConstraintRef::Bound per ADR-040; proof:InhabitanceImpossibilityWitness per ADR-039; the canonical-hash-axis surface per ADR-022 D5 + ADR-036). Foundation declares no new types, no new traits, no new const values; the wire format is unchanged; the catamorphism’s evaluation contract is unchanged. The discipline is a re-statement of how existing substrate constructs compose inside resolver bodies, made explicit as an architectural commitment so implementations realize it consistently.

Consequences: Resolver-bound ψ-stages whose typed-carrier transform requires bounded-search inhabitance enumeration realize the transform through the iterative-resolution discipline. The resolver iterates candidate values over a domain-parametric finite ring; convergence emits the admitting carrier; exhaustion emits the impossibility witness; the host boundary retries with varied input on unsatisfiability. The catamorphism is one structural inference per invocation, terminating on Convergence or Exhaustion; the application’s host-boundary retry is external to the catamorphism’s structural commitment.

The discipline’s scope boundary with ψ-residuals is explicit: verb bodies are constrained per ADR-035; resolver bodies are unconstrained beyond the typed-carrier writer-style signature per ADR-036. The substrate’s structural-transform realization machinery is fully expressive at the resolver-body layer; the typed-iso surface layer remains closed to σ-residuals per ADR-035’s commitment to "structural inference, not enumeration."

Rejected alternative 1: Surface the iterative-resolution discipline as a typed-iso surface construct (a closure-body iterate_until_admission(domain, predicate) operator paralleling first_admit). Rejected — the iterative-resolution discipline is the substrate’s structural-transform realization for resolver-bound ψ-stages, not an application-author typed-iso vocabulary. The closure-body first_admit per ADR-034 already covers application-level bounded-search needs; introducing a parallel closure-body operator that lowers to a different Term variant duplicates ADR-034’s machinery without architectural benefit. The resolver-body discipline is structurally distinct from the closure-body operator and operates at a different layer.

Rejected alternative 2: Restrict resolver bodies to a foundation-vetted vocabulary of computational primitives (a closed catalog of admissible resolver-body operations). Rejected — resolver bodies are the substrate’s mechanism for realizing arbitrary typed-carrier transforms; the structural-transform vocabulary cannot be pre-enumerated because it spans every application’s typed feature hierarchy’s admission-relation form. Foundation’s substrate commits the typed-carrier interface (the resolver trait’s writer-style signature per ADR-036) and the outcome contract (Convergence ↔ Ok(byte_count); Exhaustion ↔ Err(ShapeViolation) carrying the impossibility-witness IRI); the resolver body’s implementation is the application’s responsibility, bounded only by the trait’s interface and outcome contract.

Rejected alternative 3: Commit the iterative-resolution discipline as a foundation-provided default-impl on each resolver trait (a generic resolver-body template that applications customize via type parameters). Rejected — the structural-transform realization varies by typed feature hierarchy; a foundation-provided default-impl would have to be parametric on the application’s admission-relation form, the constraint geometry’s pinning protocol, the canonical-hash-axis selection, and the impossibility-witness emission path. The architectural commitment is to the discipline’s structural form, not to a generic implementation; foundation declares the discipline; applications realize it in their resolver impls per their typed feature hierarchy.

Rejected alternative 4: Defer the discipline to the implementation-runtime override per ADR-026 G16’s three-way responsibility split. Rejected — ADR-026 G16’s override is for strategy (parallel coset traversal, cancellation policy, cost-budget enforcement) at the closure-body first_admit operator; the iterative-resolution discipline is a structural commitment about how resolver bodies realize the typed-carrier transform. The two are at different layers — the override is closure-body-strategy; the discipline is resolver-body-structure. Conflating them leaves the structural commitment unmoored.

ADR-044 — PartitionProductFields trait: split-const form for product-shape field metadata

Status: Accepted.

Context: ADR-033 commits Term::ProjectField for product-shape field-access projection (G20) and specifies the partition_product! SDK macro’s emission to include a pub const FIELDS of type &'static [(&'static str, u32, u32)] carrying named-field metadata as (field_name, byte_offset, byte_length) triples. The prism_model! and verb! macros consume the const at expansion time to resolve closure-body field-access expressions (input.<name> and input.<index>) per ADR-033’s lowering rules.

Two practical concerns refine ADR-033’s emission shape:

  • Const evaluation cost. The macro’s name-lookup at expansion time evaluates FIELDS.iter().find(|(n, _, _)| n == &<name>) to retrieve the matching (byte_offset, byte_length). Threading the field name through the lookup adds string-comparison cost at proc-macro expansion proportional to the number of fields; for product shapes with high factor-counts, the cost compounds.

  • Hand-written product shape ergonomics. Some product shapes do not fit the partition_product! macro’s bytewise-concatenation form. Wire-format composites whose layout is dictated by an external protocol (the application’s host-boundary wire format, not the macro’s canonical layout) declare a hand-written ConstrainedTypeShape impl with explicit byte-offset and byte-length per field, plus a hand-written IntoBindingValue impl computing the layout from the wire-format spec. The field-access surface for such hand-written shapes wants to participate in the closure-body field-access lowering (input.<name>) — but ADR-033’s emission shape locks the field metadata to macro-emitted form only.

Foundation 0.4.5 refines ADR-033’s emission shape into a foundation-declared trait whose FIELDS and FIELD_NAMES consts are separate:

pub trait PartitionProductFields {
    /// (byte_offset, byte_length) pairs for each field, in declaration order.
    const FIELDS: &'static [(u32, u32)];

    /// Field names parallel to FIELDS, in declaration order.
    const FIELD_NAMES: &'static [&'static str];
}

The split-const form addresses both concerns: name-lookup uses FIELD_NAMES.iter().position(|n| n == &<name>) (a single string-comparison pass) and indexes FIELDS[idx] for the offset/length (a single positional indexing); hand-written product shapes implement the trait directly with two parallel arrays that are easier to write and audit than a single array of triples.

Decision: Foundation declares the PartitionProductFields trait with the split-const form above. The partition_product! macro per ADR-033 emits this trait impl alongside the standard ConstrainedTypeShape impl. Hand-written product shapes impl the trait directly; the prism_model! and verb! macros consume the trait at expansion time to resolve closure-body field-access.

Trait shape requirements. FIELDS.len() == FIELD_NAMES.len(); the parallel arrays are indexed by position. The partition_product! macro emits the trait impl with this invariant by construction; hand-written impls are responsible for the invariant (a divergence would be a closure-body field-access lookup failure at proc-macro expansion time). The byte-offset and byte-length values are the same as ADR-033 commits per factor sequence: byte_offset[i] = sum_{j<i} <FactorTy_j as IntoBindingValue>::MAX_BYTES; byte_length[i] = <FactorTy_i as IntoBindingValue>::MAX_BYTES. For hand-written shapes whose factor sequence is dictated by an external wire-format spec rather than the macro’s canonical layout, the byte-offset / byte-length values follow the wire-format spec, not the macro’s per-factor sequence.

Proc-macro consumption. The prism_model! and verb! macros' closure-body field-access expansion per ADR-033 reads <ReceiverTy as PartitionProductFields>::FIELDS and <ReceiverTy as PartitionProductFields>::FIELD_NAMES at expansion time. For input.<name> (named-field access), the macro emits:

// Pseudocode for proc-macro expansion:
let idx = <ReceiverTy as PartitionProductFields>::FIELD_NAMES
    .iter()
    .position(|n| n == &"<name>")?;
let (byte_offset, byte_length) = <ReceiverTy as PartitionProductFields>::FIELDS[idx];
emit Term::ProjectField { source_index, byte_offset, byte_length };

For input.<index> (positional-field access), the macro emits the Term::ProjectField variant directly from <ReceiverTy as PartitionProductFields>::FIELDS[<index>]. Either form lowers to the same Term::ProjectField per ADR-033; the trait shape is the metadata surface, not a new substrate construct.

Substrate-amendment-via-foundation rule per ADR-013/TR-08: ADR-044 amends ADR-033’s emission shape for the partition_product! macro and declares the PartitionProductFields trait as a foundation-declared metadata surface. Foundation declares the trait; the macro’s emission shifts from one const-of-triples to two parallel consts on the trait. The wire format is unchanged (Term::ProjectField's byte_offset and byte_length fields are unaffected); the catamorphism’s Term::ProjectField fold-rule per ADR-029 is unchanged; the macro’s lowering rules per ADR-033 are unchanged. The substrate-amendment-via-foundation rule covers the new trait declaration; the wire-format version constant bumps per ADR-013 for the substrate amendment.

Consequences: Product shapes whose layout fits the partition_product! macro’s canonical bytewise-concatenation form emit the PartitionProductFields trait impl automatically through the macro. Product shapes whose layout follows an external wire-format spec (composite shapes whose factor sequence is dictated by host-boundary protocols) implement the trait by hand alongside a hand-written ConstrainedTypeShape + IntoBindingValue impl. Both forms participate in closure-body field-access lowering per ADR-033 without distinction; the trait surface is uniform.

The split-const form reduces proc-macro expansion cost for high-factor-count product shapes and improves ergonomics for hand-written wire-format composites. The ADR-033 typed-iso surface commitment is preserved end-to-end: applications declare product shapes; closure-body field-access expressions lower to Term::ProjectField; the catamorphism’s fold-rule evaluates the slice extraction.

Rejected alternative 1: Keep ADR-033’s single-array-of-triples form. Rejected — the practical concerns above (proc-macro expansion cost; hand-written ergonomics) compound at higher factor-counts and complicate the foundation’s hand-written-composite usage. The split-const form is structurally equivalent at the typed-iso surface (closure-body field-access lowers to the same Term::ProjectField) while resolving both concerns.

Rejected alternative 2: Make FIELDS a &'static [u32] carrying alternating offset/length values (a flat array indexed by 2 * field_index). Rejected — the (u32, u32) tuple form is type-safe in Rust (the tuple’s two positions are distinguished by type-level position) where a flat-array form requires per-access [i * 2] / [i * 2 + 1] indexing that’s error-prone to write by hand. The tuple form is the canonical Rust idiom for paired metadata.

Rejected alternative 3: Surface the metadata as a foundation-emitted struct PartitionProductFieldMetadata { name: &'static str, byte_offset: u32, byte_length: u32 } array. Rejected — equivalent to the rejected ADR-033 emission shape in expansion cost; the struct-array form trades tuple-position semantics for named-field semantics but the structural cost is the same. The split-const form decouples names from offsets/lengths, which is the architectural concern.

Rejected alternative 4: Defer the trait declaration; expect hand-written product shapes to re-emit the const directly. Rejected — without a foundation-declared trait, the prism_model! and verb! macros cannot consume the metadata uniformly across macro-emitted and hand-written shapes. The trait declaration is the structural surface the macros consume; deferring it leaves hand-written shapes outside the closure-body field-access lowering.

ADR-045 — Grounded::tag::<NewTag>(): zero-cost re-tagging affordance for application-domain Tag binding

Status: Accepted.

Context: ADR-028 commits Grounded<T, Tag> as the catamorphism’s success-envelope sealed type carrying the route’s evaluation output value (output_bytes()) plus the typed-iso path attestation (content_fingerprint(), unit_address(), the Triad<L> projection per the canonical k-invariants branch). The Tag parameter is a phantom marker that distinguishes Groundeds across application-domain contexts: an application declaring multiple PrismModel impls — one per typed feature hierarchy — receives multiple Grounded<Output, Tag> types parameterized by the application’s domain-distinct Tag markers.

At the catamorphism’s emission point (pipeline::run_route's Ok(grounded) arm), foundation produces a Grounded<Output, DefaultTag> whose Tag parameter is foundation’s default Tag witness. The application binds its own Tag marker through a re-tagging step: grounded.tag::<MyAppTag>() produces a Grounded<Output, MyAppTag> with the application’s marker bound. The re-tagging step is structurally a typed projection over the sealed value (no payload duplication, no allocation); the Tag parameter is a zero-sized PhantomData<Tag> field in Grounded<T, Tag>, so rebinding it is a no-op at runtime.

The affordance is load-bearing for applications that surface domain-distinct Grounded types in their public API (e.g., the application’s typed witness wrapper pub type MyWitness = Grounded<Output, MyAppTag> consumed by downstream verifiers, RPC adapters, or test harnesses). Without the re-tagging affordance, applications would have to choose between (a) exposing foundation’s DefaultTag-parameterized Grounded directly (losing the application-domain marker’s type-system distinction), or (b) wrapping Grounded in an application-side newtype (adding indirection that doesn’t preserve the seal regime per ADR-011). Re-tagging preserves the seal regime — the rebinding is a sealed method on Grounded; external code cannot synthesize a Grounded with arbitrary Tag values — only re-tag an existing Grounded the application received from forward().

Decision: Foundation extends Grounded<T, Tag> with the tag::<NewTag>() consuming method:

impl<T, Tag> Grounded<T, Tag> {
    /// Re-tag this Grounded with NewTag.
    ///
    /// Consumes `self` and emits a `Grounded<T, NewTag>` with the
    /// requested NewTag binding. Zero-cost: the Tag parameter is a
    /// PhantomData<Tag> field; re-tagging is a structural rebinding
    /// with no payload duplication and no allocation.
    pub fn tag<NewTag>(self) -> Grounded<T, NewTag>
    where
        NewTag: Default,
    {
        // Foundation-internal: rebind PhantomData<Tag> to
        // PhantomData<NewTag> while preserving the seal regime.
        ...
    }
}

The method consumes self by value (the seal is preserved — the Grounded value is not duplicated; the original Grounded<T, Tag> is moved into the method and the returned Grounded<T, NewTag> is the same sealed value with rebound Tag). The NewTag: Default bound is the only constraint: the rebinding constructs the new PhantomData<NewTag> field by Default::default()-equivalent zero-initialization (for marker types, PhantomData<NewTag> is unit-valued regardless of Default).

Sealed method surface per ADR-011 + ADR-028. The tag::<NewTag>() method is a sealed accessor on Grounded — declared by foundation, callable from any context that holds a Grounded value, but only constructible via the catamorphism’s emission path per ADR-011’s seal regime. Re-tagging does not introduce a new construction path; it is a typed projection over the existing sealed value. External code cannot construct a Grounded from scratch with an arbitrary Tag; only re-tag a Grounded the catamorphism emitted (or that a previous re-tagging produced from a catamorphism emission). The seal-coverage chain (TC-02; ADR-016) is preserved: every Grounded reachable in application code descends from a catamorphism emission, regardless of how many times its Tag parameter has been rebound.

Application-domain Tag binding. Applications declare domain-distinct Tag markers as zero-sized struct types implementing Default:

#[derive(Default, Debug, Clone, Copy)]
pub struct MyAppTag;

pub type MyWitness = Grounded<MyAppOutput, MyAppTag>;

pub fn run_app(input: MyAppInput) -> Result<MyWitness, PipelineFailure> {
    let grounded = <MyAppModel as PrismModel<...>>::forward(input)?;
    Ok(grounded.tag::<MyAppTag>())
}

The application’s public API surfaces MyWitness (with the application’s domain-distinct Tag marker); downstream consumers consume the application-domain Tag-parameterized type. The Tag marker is the application’s responsibility — foundation provides the rebinding mechanism, not the Tag declaration vocabulary.

Substrate-amendment-via-foundation rule per ADR-013/TR-08: ADR-045 adds the tag::<NewTag>() consuming method to the existing Grounded<T, Tag> sealed type. Foundation declares the method; the wire format is unchanged (Grounded carries the same T output value and metadata fields per ADR-028; the Tag parameter is PhantomData<Tag> with no wire-format representation); the catamorphism’s emission contract is unchanged (the catamorphism emits Grounded<Output, DefaultTag>; the application rebinds afterward). The substrate-amendment-via-foundation rule covers the method addition; no new types, no new traits, no new wire-format fields.

Consequences: Applications surface domain-distinct Grounded<Output, MyAppTag> types in their public API without sacrificing the foundation-sealed regime. The catamorphism emits foundation-default-Tag Groundeds; applications rebind to their domain-distinct Tag at the host-boundary; downstream consumers consume the application-domain-typed witness. The re-tagging step is zero-cost (Tag is PhantomData, rebinding is a no-op at runtime); the seal regime is preserved (re-tagging is a sealed method, not a construction path); the type-system distinction across application-domain Tags is sharp.

The affordance composes with ADR-028’s accessor surface: a Grounded<T, MyAppTag> reached via tag::<MyAppTag>() exposes the same output_bytes(), content_fingerprint(), unit_address(), and as_inhabitance_certificate() accessors per ADR-028 + ADR-042. Tag rebinding does not affect the metadata accessors — only the type-system marker.

Rejected alternative 1: Surface application-domain Tag binding through a separate foundation-declared trait ApplicationTag that applications impl and the catamorphism dispatches through. Rejected — adds a foundation-vetted trait surface for what is structurally a type-system rebinding, not a runtime dispatch. The PhantomData rebinding mechanism is the canonical Rust idiom for type-level marker propagation; introducing a runtime dispatch trait adds machinery without architectural benefit.

Rejected alternative 2: Wrap Grounded<T, DefaultTag> in an application-side newtype (pub struct MyWitness(Grounded<T, DefaultTag>)). Rejected — the application-side newtype is outside foundation’s seal regime; consumers of MyWitness cannot read the foundation-sealed accessors (output_bytes(), content_fingerprint(), etc.) without explicit re-exposure on the newtype. The re-tagging affordance preserves the seal regime end-to-end without per-application newtype boilerplate.

Rejected alternative 3: Make the Tag parameter mutable on Grounded<T, Tag> (e.g., a &mut self set_tag method). Rejected — the &mut self form retains the original Grounded<T, Tag> value with a rebound interior, but the Rust type system cannot rebind the type-level Tag parameter through a mutable reference (the rebinding requires moving the value to construct the new type-level binding). The consuming-method form (self → Grounded<T, NewTag>) is the only Rust-idiomatic shape for type-level rebinding.

Rejected alternative 4: Expose multiple typed entry points (forward_with_tag<Tag>(input) → Result<Grounded<Output, Tag>, PipelineFailure>) parameterized by Tag at the model declaration site. Rejected — the PrismModel trait per ADR-020 has a fixed forward(input) signature whose return type is foundation’s default-Tag Grounded; parameterizing the Tag at the model declaration site would add a fifth substrate parameter to the PrismModel trait surface (alongside H, B, A, R), expanding the application-author surface for a concern (Tag binding) that does not affect the catamorphism’s evaluation. Post-catamorphism re-tagging is structurally cleaner than per-invocation Tag parameterization.

ADR-046 — Resolver-body discipline scope clarification (cross-reference to ADR-035 + ADR-043)

Status: Accepted.

Context: ADR-035 commits the ψ-residuals discipline that rejects σ-residuals from verb bodies (the closure-body expressions consumed by verb! and prism_model! route declarations). ADR-043 commits the iterative-resolution discipline as the resolver-internal computational pattern for resolver-bound ψ-stages. Implementations have observed that the boundary between closure-body restrictions and resolver-body affordances is sometimes read ambiguously — particularly around: whether resolver bodies may invoke the canonical hash axis (yes, per ADR-022 D5 + ADR-036); whether resolver bodies may perform byte-comparison against ConstraintRef::Bound (yes, per ADR-040); whether resolver bodies may iterate over <DomainTy as ConstrainedTypeShape>::CYCLE_SIZE (yes, per ADR-043). The ADR-035 + ADR-043 split makes the discipline boundary structural, but a single explicit cross-reference helps implementations read the boundary correctly without re-derivation.

Decision: ADR-046 records the discipline-scope boundary as an explicit architectural commitment, refined by ADR-056 to recognize four distinct verb-body categories with their respective scope:

(1) Route bodies — the route closure body the prism_model! macro emits as the application’s typed-iso surface per ADR-020:

  • Restricted vocabulary. The ψ-residuals discipline per ADR-035 + ADR-056 rejects direct syntactic emissions of Term::FirstAdmit (per ADR-034), Term::AxisInvocation (per ADR-029/030), and byte-comparison/concat PrimitiveOp s (Le, Lt, Ge, Gt, Concat) from the route closure body. The SDK macro’s ψ-residuals walk rejects offending syntactic forms at proc-macro expansion time.

  • Admissible vocabulary. The closure-body grammar G1–G29 per ADR-022 D3 + ADR-026 + ADR-033 + ADR-034 + ADR-035 — minus the σ-residual constructs — plus verb-call sites to compound verbs declared via verb! per ADR-024 (the verb’s internal composition is opaque to the route body’s discipline walk).

(2) Compound verb bodies (declared via verb! per ADR-024) and (3) axis impl bodies (declared via axis! per ADR-030 + ADR-052 + ADR-055):

  • Unrestricted vocabulary per ADR-056. Verb bodies and axis impl bodies admit the full substrate vocabulary: every PrimitiveOp in the post-ADR-053 18-variant catalog (including Concat, Le, Lt, Ge, Gt), every prism operator per ADR-026, Term::FirstAdmit per ADR-034, Term::AxisInvocation per ADR-030, and any other Term variant the substrate vocabulary admits.

  • Discipline source. Substrate-vocabulary closure per ADR-013/TR-08; ADR-055’s SubstrateTermBody decomposability for axis impl bodies.

  • Fold-fusion through them. The catamorphism’s per-variant fold-rules per ADR-029 inline verb-body and axis-impl-body Term arenas at evaluation time per ADR-054 + ADR-055; the byte-comparison / byte-concat operations these bodies use are fold-fused into the route’s structural evaluation, not exposed as typed-iso-surface admission predicates.

(4) Resolver bodies (the impl <ψ-stage>Resolver<H> for <Impl> blocks per ADR-036 whose resolve method bodies realize the typed-carrier structural transform):

  • Unrestricted vocabulary. Resolver bodies are arbitrary Rust function bodies bounded only by the resolver trait’s writer-style signature per ADR-036 (fn resolve(&self, input: <TypedCarrier>, out: &mut [u8]) → Result<usize, ShapeViolation>) and the typed-carrier interface per ADR-041 (#[repr(transparent)] newtype over &[u8]). The body may perform any computation the structural-transform realization requires.

  • Admissible patterns. Bounded iteration over <DomainTy as ConstrainedTypeShape>::CYCLE_SIZE per ADR-032 + ADR-043 (the iterative-resolution discipline); σ-projection through the canonical hash axis <A as Hasher>::initial().fold_bytes(…​) per ADR-022 D5 + ADR-036; byte-comparison against ConstraintRef::Bound per ADR-040 (including type:LexicographicLessEqBound for byte-sequence comparison); structural admission-relation evaluation; FreeRank decrement per ADR-043; impossibility-witness emission via Err(ShapeViolation) carrying the https://uor.foundation/proof/InhabitanceImpossibilityWitness shape IRI per ADR-039; the inhabitance::dispatch_through_table helper per ADR-042 for predicate:InhabitanceDispatchTable consultation.

The boundary is structural, not stylistic. Route bodies are the application’s typed-iso surface the SDK macro walks for discipline conformance; compound verbs and axis impl bodies are substrate-vocabulary compositions the catamorphism’s fold-rules inline at evaluation time; resolver bodies are the substrate’s mechanism for realizing the structural transform that the catamorphism’s resolver-bound fold-rules dispatch to. The four layers compose: the catamorphism evaluates a route-body-emitted Term arena per ADR-029; route-body Term references to verbs and axes fold-fuse the verb / axis Term arenas at evaluation time per ADR-054 + ADR-055; resolver-bound Term variants per ADR-036 dispatch to resolver impls; resolver impls realize the typed-carrier transform per ADR-043. ψ-residuals are forbidden at the route-body syntactic surface (layer 1); fold-fusion is the canonical pattern at layers 2–3; iterative-resolution is the canonical pattern at layer 4; all four are correct, at different layers, without contradiction.

Substrate-amendment-via-foundation rule per ADR-013/TR-08: ADR-046 is not a substrate amendment. It records a cross-reference between ADR-035 and ADR-043, making the discipline-scope boundary an explicit architectural commitment instead of an implicit reading. Foundation declares no new types, no new traits, no new vocabulary; the wire format is unchanged.

Consequences: Implementations read the discipline-scope boundary unambiguously: closure bodies are restricted per ADR-035; resolver bodies are unrestricted per ADR-046’s admissible-patterns list. The proc-macro’s ψ-residuals walk applies only to closure-body expressions; resolver impls are not subject to the ψ-residuals walk; the boundary is enforced structurally by the SDK macro recognizing closure-body expressions only, not resolver impls.

The discipline-scope clarification preserves both prior commitments without weakening either. The typed-iso surface remains closed to σ-residuals per ADR-035’s "structural inference, not enumeration" commitment; the substrate’s structural-transform realization machinery remains fully expressive per ADR-043’s iterative-resolution discipline.

Rejected alternative 1: Re-state the discipline boundary inside ADR-035 directly rather than as a separate ADR. Rejected — ADR-035 is the ψ-residuals commitment; ADR-043 is the iterative-resolution commitment; the boundary between them is a cross-cutting architectural reading, not a property of either ADR in isolation. A separate ADR records the boundary explicitly.

Rejected alternative 2: Move the discipline-scope reading to chapter 8 (Concepts) as documentation rather than an ADR. Rejected — the boundary is a load-bearing architectural commitment about how two ADRs compose, not a conceptual reading. Implementations relying on the boundary depend on its ADR-level commitment; documentation in chapter 8 is non-normative.

ADR-047 — σ-projection hardening principle: U1–U6 axioms on canonical-hash-axis impls

Status: Accepted.

Context: ADR-030 commits the canonical hash axis as the third substitution position via the Hasher trait bound on AxisTuple per ADR-036, with concrete impls provided by the prism-crypto standard-library sub-crate per ADR-031. The trait carries the substitution-axis-realized content-addressing function: <A as Hasher>::initial().fold_bytes(…​).finalize(). The architectural commitment is to the trait surface — any impl satisfying Hasher's contract (sealed, deterministic, fixed-width output, idempotent) is admissible as a canonical hash axis selection at the model declaration site.

What ADR-030 + ADR-031 do not state is what structural condition a Hasher impl must satisfy cryptographically for the substrate’s downstream commitments to hold. The catamorphism’s resolver-bound ψ_9 stage per ADR-035 emits a κ-label whose admission relation per ADR-040 + ADR-046 evaluates a structural inhabitance condition over the σ-projection’s output bytes. The framework’s verifiability commitment per ADR-001 + ADR-019 reads as: structural inference, not enumeration. But this reading is hollow if the σ-projection itself exposes admission-correlated observable structure on its output — an application could exploit such structure as a typed-iso surface shortcut, defeating the architectural commitment to one structural inference per invocation.

The implementer-feedback loop surfaces a concrete need: applications consuming a Hasher impl as the canonical hash axis need a formal criterion for axis qualification. Without a substrate-level commitment to the σ-projection’s structural properties, applications must re-derive the cryptographic-axis-validity argument per application — a substrate-level concern leaking into the application layer.

Decision: ADR-047 commits the σ-Projection Hardening Principle as substrate axiom on Hasher impls. A Hasher impl qualifies as a UOR-hardened canonical hash axis (admissible as a model declaration’s third-position selection per ADR-030) iff it satisfies, under the random-oracle baseline:

(U1) Marginal-uniformity. Every elementary UOR observable on the σ-projection’s output is distributed as the random-oracle model predicts. For the canonical 256-bit content-address space (the σ-projection’s image under a 32-byte hash): the p-adic valuation ν_p(σ(x)) is Geometric((p − 1) / p) for every prime p; the Walsh–Hadamard parity at any non-trivial frequency ω is Bernoulli(1/2).

(U2) Joint-independence. For any k-tuple of distinct inputs (x_1, …, x_k) and any joint UOR observable, the joint distribution of (σ(x_1), …, σ(x_k)) factorizes as the product of marginals to cryptographic precision.

(U3) Admission-orthogonality. For every UOR observable f and every admission relation R of the form σ(x) ≤ target (or a structurally analogous bound per ADR-040’s BoundShape catalogue), f(σ(x)) and R(σ(x)) are statistically independent under random-oracle input.

(U4) Avalanche. For any fixed input difference Δ ≠ 0, the distribution of ν_p(σ(x) ⊕ σ(x ⊕ Δ)) matches the random-oracle reference for every prime p. Input proximity in the input space does not transfer to output proximity on the content-address manifold.

(U5) Autocorrelation-flatness. Under any structured input sequence (sequential, arithmetic-progression, etc.), all per-observable autocorrelations are 0 to within sampling error.

(U6) Bandwidth-additivity. For any application-declared admission relation with PRF probability α, and any collection of K independent 1-bit typed predicates each with PRF probability 1/2, the joint constraint C_K(d) ≡ admits(d) ∧ p_1(d) ∧ … ∧ p_K(d) satisfies P(C_K(σ(x))) = α · 2^-K · (1 ± ε) for small ε. Equivalently, expected search cost grows as 2^K × α^-1. U6 is a corollary of U1 + U2: the joint K-tuple of independent predicates distributes as Uniform({0,1}^K), so the conjunction’s satisfaction probability factors as the product of marginals.

Substrate commitment. The Hardening Principle’s six axioms are the substrate-level qualification criteria for canonical-hash-axis impls. A Hasher impl that fails any axiom is not admissible as a UOR-hardened canonical hash axis; foundation’s DefaultHasher and prism-crypto’s published impls (SHA-256, BLAKE3, etc.) are required to pass the battery. Implementer-side validation through the substrate-provided cryptanalysis battery per ADR-049 witnesses the axioms empirically; the Lean axiomatization per ADR-001’s verifiability commitment names them formally.

Substrate-amendment-via-foundation rule per ADR-013/TR-08: ADR-047 commits the Hardening Principle as a property axiom on existing substrate constructs (the Hasher trait per ADR-030, the canonical-hash-axis selection mechanism per ADR-031). Foundation declares no new types, no new traits, no new wire-format fields; the wire format is unchanged. The principle constrains the qualification of Hasher impls but does not alter the trait surface — implementations that satisfy U1–U6 are admissible; implementations that fail are non-conforming. Foundation’s reference impls (and the prism-crypto sub-crate per ADR-031) are required to pass; downstream applications selecting a Hasher impl from any source rely on the impl’s stated U1–U6 conformance.

Consequences: The substrate’s canonical-hash-axis selection is governed by a formal qualification criterion. Applications consume Hasher impls knowing the structural properties their selected axis must satisfy — admission-orthogonality (U3) is what makes the typed-iso surface’s commitment to "one structural inference per invocation" load-bearing (no cheaper-than-σ observable predicts admission); bandwidth-additivity (U6) is what makes the substrate’s type:Conjunction primitive serve as a typed bandwidth channel per ADR-048 (each declared predicate is one bit of structural commitment).

The Hardening Principle generalizes across σ-projection axes. The same battery (per ADR-049) re-applies when an application substitutes a different axis impl (post-quantum hashes, domain-specific projections, future cryptographic primitives); the substrate’s commitments hold derivatively against any U1–U6-passing impl.

Rejected alternative 1: Leave Hasher impl qualification to application-side discretion (no substrate axiom). Rejected — without a substrate-level criterion, every application must re-derive the cryptographic-axis-validity argument per axis selection. The Hardening Principle pulls the criterion to the substrate layer where it belongs; applications select an axis knowing its structural properties.

Rejected alternative 2: Commit only U1–U2 (marginal-uniformity + joint-independence) and treat U3–U6 as derived corollaries. Rejected — U3 (admission-orthogonality), U4 (avalanche), and U5 (autocorrelation-flatness) are independently testable and structurally distinct; conflating them with U1–U2 obscures which property an empirical failure violates. U6 is a corollary of U1+U2 but is the load-bearing property for ADR-048’s typed-bandwidth surface and warrants explicit naming.

Rejected alternative 3: Restrict the Hardening Principle to a single canonical-hash-axis impl. Rejected — domain-neutral framing requires the principle to span every UOR-hardened axis. ADR-031’s prism-crypto sub-crate publishes multiple Hasher impls; the principle qualifies each of them at the same axiom level.

Rejected alternative 4: Surface U6 as a separate ADR (decoupled from U1–U5). Rejected — U6 derives mechanically from U1+U2 and reads correctly as one of the six structural properties a UOR-hardened axis exhibits. Splitting it across ADRs fragments the qualification criterion; the six-property naming reads as one architectural commitment about what makes an axis qualify.

ADR-048 — TypedCommitment substrate surface + 5th model-declaration parameter C: TypedCommitment for zero-cost typed-bandwidth admission composition

Status: Accepted.

Context: ADR-035 commits the canonical ψ-pipeline producing a κ-label at ψ_9; the catamorphism per ADR-029 + ADR-036 evaluates the ψ-Term variants and emits Result<Grounded<Output>, PipelineFailure> per ADR-020. The base admission relation (whether the κ-label satisfies the application’s ConstraintRef::Bound constraints per ADR-040 + ADR-046) is evaluated inside the catamorphism through the resolver-bound ψ_9 stage. Applications whose admission relation factors as a conjunction of independent typed predicates over the κ-label — for example, the base admission relation σ(x) ≤ target (per ADR-040’s type:LexicographicLessEqBound) AND K additional application-declared predicates each consuming UOR observables per ADR-049 — currently have two options:

(1) Encode every predicate into the typed feature hierarchy’s ConstraintRef set, expanding the constraint geometry. This works but bloats the resolver’s structural-validation surface for what is, semantically, a conjunction of independent typed predicates.

(2) Apply the additional predicates outside the catamorphism, in an application-side wrapper that calls forward(input) and then evaluates the application-declared predicates on the returned Grounded<Output>'s output_bytes(). This works but moves the admission decision outside the typed-iso surface; the catamorphism’s success-envelope Grounded<Output> is no longer the application’s final admission verdict.

The implementer-feedback loop surfaces a concrete need: the architecture should commit a typed admission predicate conjunction surface (a typed-iso surface for composing K independent 1-bit predicates onto the base admission relation, evaluated inside the catamorphism per the framework’s verifiability commitment) that preserves zero-cost monomorphization per TC-01 and ADR-019. The Hardening Principle’s bandwidth-additivity property (U6 per ADR-047) makes this composition cryptographically well-founded: each declared predicate is one bit of structural commitment in the κ-label at proportional PRF cost. The substrate’s type:Conjunction primitive in the closed ConstraintRef catalog is the conceptual ancestor; ADR-048 commits its typed-surface realization.

Decision: ADR-048 commits two coupled architectural amendments:

(1) Foundation declares the TypedCommitment trait — the substrate’s zero-cost typed-bandwidth admission surface.

pub trait TypedCommitment: Copy {
    /// Bandwidth in bits the commitment encodes per κ-label.
    /// Equal to `-log2(accept_prob())` by U6 per ADR-047.
    fn bandwidth_bits(&self) -> f64;

    /// PRF acceptance probability under the random-oracle baseline.
    /// Equal to the product of per-predicate acceptances; tight per
    /// the Hardening Principle's U1 + U2 axioms per ADR-047.
    fn accept_prob(&self) -> f64;

    /// Evaluate the commitment on the κ-label byte sequence.
    /// Returns true iff every underlying predicate accepts.
    /// Monomorphized per concrete `C: TypedCommitment` at compile time.
    fn evaluate(&self, kappa_label: &[u8]) -> bool;

    /// Number of typed predicates conjuncted in this commitment.
    fn predicate_count(&self) -> usize;
}

Foundation also declares three built-in implementors:

  • EmptyCommitment — the no-commitment baseline. bandwidth_bits = 0, accept_prob = 1, evaluate = true, predicate_count = 0. Direct correspondence to the substrate’s type:Conjunction empty case.

  • SingletonCommitment<P: ObservablePredicate> — a single typed predicate over a UOR observable per ADR-049. bandwidth_bits = -log2(P::accept_prob()), accept_prob = P::accept_prob(), evaluate = P::evaluate(kappa_label), predicate_count = 1.

  • AndCommitment<A: TypedCommitment, B: TypedCommitment> — typed conjunction at the type level. bandwidth_bits = A::bandwidth_bits() + B::bandwidth_bits(), accept_prob = A::accept_prob() * B::accept_prob(), evaluate = A::evaluate(kl) && B::evaluate(kl), predicate_count = A::predicate_count() + B::predicate_count(). Static dispatch through monomorphization; the type parameter <A, B> carries the conjunction structure at compile time.

The trait is sealed via the standard __sdk_seal::Sealed pattern per ADR-022 D1; external impls beyond the foundation-emitted baseline are admissible (applications declare their own TypedCommitment impls for application-specific predicate compositions) but go through the SDK-emission lane parallel to output_shape! per ADR-027.

Zero-cost contract. Every TypedCommitment impl is Copy (no heap allocation), monomorphized per concrete type at every call site (no dynamic dispatch via dyn or Box<dyn TypedCommitment>), with evaluate body’s loop bounds known at compile time (the compiler unrolls the conjunction chain). The architectural commitment per TC-01 + ADR-019 is preserved: the typed-bandwidth surface adds no runtime cost over the bare admission relation; conjunction composition is type-level structural state, not value-level dynamic state.

The wellFormed-by-construction discipline. Per the Hardening Principle’s U2 (joint-independence per ADR-047), TypedCommitment impls' accept_prob is the tight PRF acceptance probability only when the underlying predicates' supports are pairwise disjoint (the predicates are admission-orthogonal). The AndCommitment<A, B> constructor’s correctness depends on this; foundation’s emission discipline emits AndCommitment impls only when the compile-time-checkable support-disjointness invariant holds. Applications declaring TypedCommitment impls directly are responsible for the invariant; the SDK proc-macro per the future commitment! lane (parallel to output_shape! per ADR-027) emits the impl with the discipline checked at expansion time.

(2) PrismModel’s substrate parameters extend from <H, B, A, R> to <H, B, A, R, C>, with C: TypedCommitment defaulting to EmptyCommitment.

pub trait PrismModel<
    H: HostTypes,
    B: HostBounds,
    A: AxisTuple + Hasher,
    R: ResolverTuple = NullResolverTuple,
    C: TypedCommitment = EmptyCommitment,
>
{
    type Input;
    type Output;
    type Route;

    fn forward(input: Self::Input) -> Result<Grounded<Self::Output>, PipelineFailure>;
}

The fifth substrate parameter C carries the application’s typed-bandwidth admission commitment. The catamorphism’s ψ_9 dispatch per ADR-035 + ADR-036 evaluates the base admission relation through the resolver-bound KInvariantResolver<H> and then consults C::evaluate(kappa_label_bytes) to determine whether the κ-label satisfies the additional typed predicates. The success arm Ok(Grounded<Output>) is reached iff both the resolver-emitted κ-label is well-formed (FreeRank = 0 per ADR-043) AND C::evaluate(kappa_label) = true. The failure arm Err(PipelineFailure) is reached iff either the resolver’s iteration exhausts the domain (Exhaustion per ADR-043, surfacing as proof:InhabitanceImpossibilityWitness per ADR-039) OR the κ-label fails C::evaluate (a typed-commitment violation, surfaced as a ShapeViolation carrying the failing predicate’s IRI).

Models that declare C = EmptyCommitment (the default) preserve ADR-035’s commitment to the bare base-admission semantics — EmptyCommitment::evaluate = true unconditionally, so the catamorphism’s success envelope is determined solely by the resolver-bound ψ_9 stage. Models that declare a non-empty C opt into the typed-bandwidth surface; the prism_model! macro per ADR-022 D3 extends to accept the optional C parameter at the model declaration site.

TargetCommitment — canonical search-cost commitment alias. Foundation publishes the type alias

pub type TargetCommitment = SingletonCommitment<LexicographicLessEqThreshold>;

as the canonical realization of the search-cost commitment for admission shapes that gate on a lexicographic threshold against a &'static [u8] target (the foundation-published ObservablePredicate impl per ADR-049 realizing the type:LexicographicLessEqBound catalog primitive per ADR-040). TargetCommitment is a singleton in C's structural position (one predicate, not a conjunction), so its accept_prob reads as the per-attempt success probability for the resolver-emitted κ-label being lexicographically ≤ the target, and its U6 bandwidth-bits reading is -log2(accept_prob). Applications instantiate C = TargetCommitment at the model declaration site to opt into the search-cost-typed admission surface; the catamorphism’s ψ_9 dispatch consults the threshold predicate inline, and the wire format’s CommitmentEvaluated event carries predicate_iris = &["https://uor.foundation/observable/LexicographicLessEqThreshold"]. The alias is canonical (foundation-published, not application-emitted) so that downstream substrates compose against a single foundation-owned IRI for the search-cost commitment shape; this matches ADR-049’s reference-impl publishing discipline for the underlying ObservablePredicate.

Substrate-amendment-via-foundation rule per ADR-013/TR-08. Foundation declares the TypedCommitment trait, the three built-in impls (EmptyCommitment, SingletonCommitment<P>, AndCommitment<A, B>), the TargetCommitment type alias, and the fifth-parameter extension to PrismModel. Foundation’s pipeline::run_route extends from its prior five-type-parameter signature (<H, B, A, M, R> per ADR-036) to a six-type-parameter signature (<H, B, A, M, R, C>); the catamorphism’s ψ_9 dispatch extends with the post-resolver C::evaluate consultation. The wire format extends per ADR-013’s rule: the trace per ADR-008’s Trace Wire Format § gains a CommitmentEvaluated { predicate_iris: &'static [&'static str], result: bool } event variant carrying the predicates evaluated and the conjunction result. Wire-format version constant bumps per ADR-013/TR-08.

Consequences. The catamorphism’s success-envelope Grounded<Output> is the application’s complete admission verdict, not a partial one that requires host-side post-processing. Applications composing K independent typed predicates onto the base admission relation pay zero runtime cost at the typed-iso surface (the conjunction structure is compile-time-known via AndCommitment<A, B>'s type parameters; C::evaluate monomorphizes to inlined predicate evaluations the compiler can unroll); the bandwidth scaling 2^K × α^-1 per Hardening Principle U6 (ADR-047) holds end-to-end without out-of-band machinery. The framework’s verifiability commitment per ADR-001 + ADR-019 reads as: structural inference inside the catamorphism produces the complete typed verdict — Grounded<Output> IS the typed-bandwidth-attested admission certificate.

Rejected alternative 1: Treat typed-bandwidth admission as application-internal (no substrate-level trait). Rejected — without a substrate-level commitment, every application re-derives the zero-cost monomorphization pattern from scratch, and the accept_prob / bandwidth_bits invariants are unwritten architectural folklore. The substrate-level trait makes the zero-cost contract explicit and the U6 bandwidth-additivity reading load-bearing across applications.

Rejected alternative 2: Use Box<dyn TypedCommitment> to admit runtime-known commitment shapes. Rejected — dyn dispatch violates TC-01’s zero-cost monomorphization commitment (the indirect call cannot be inlined; the predicate-count is runtime-unknown so the conjunction chain cannot be unrolled). The architectural commitment is to compile-time-known typed structure; runtime polymorphism over commitment shapes is structurally forbidden.

Rejected alternative 3: Carry the commitment as an application-side wrapper around PrismModel::forward() (the "residual upstream move" pattern). Rejected — moves the admission decision outside the typed-iso surface; the catamorphism’s Grounded<Output> is no longer the application’s final verdict. The architectural commitment per ADR-019 is that the catamorphism IS the application’s typed-iso surface; partial admission verdicts violate this commitment.

Rejected alternative 4: Make C a fourth-parameter extension to AxisTuple rather than a fifth-position model-declaration parameter. Rejected — AxisTuple's third-position role is per-domain substitution-axis selection per ADR-030; TypedCommitment is per-application predicate composition over the catamorphism’s output, structurally distinct. Conflating them obscures the architectural separation between substitution axes (per-domain operation kernels) and typed admission predicates (per-application output composition).

Rejected alternative 5: Encode the K predicates as additional ConstraintRef entries in the typed feature hierarchy’s input shape. Rejected — the K predicates are over the output (the κ-label), not over the input’s typed feature hierarchy. The ConstraintRef set declares the input's constraint geometry per ADR-024 + ADR-040; the output’s predicate composition lives at a structurally distinct layer.

Reference implementation surface for foundation. The architectural commitments above determine the foundation crate’s module shape end-to-end. Foundation places the trait + built-in impls in a new uor_foundation::commitment module re-exported from the crate root. The reference shape:

// uor_foundation::commitment

use core::marker::PhantomData;
use crate::pipeline::__sdk_seal::Sealed;

/// Substrate's zero-cost typed-bandwidth admission surface (ADR-048).
/// Every impl is monomorphized per concrete C at every call site; no
/// `Vec`, no `dyn`, no allocation, no runtime-unknown loop bounds.
pub trait TypedCommitment: Sealed + Copy {
    fn bandwidth_bits(&self) -> f64;
    fn accept_prob(&self) -> f64;
    fn evaluate(&self, kappa_label: &[u8]) -> bool;
    fn predicate_count(&self) -> usize;

    #[inline]
    fn and<Other: TypedCommitment>(self, other: Other) -> AndCommitment<Self, Other> {
        AndCommitment { a: self, b: other }
    }
}

#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct EmptyCommitment;

impl Sealed for EmptyCommitment {}
impl TypedCommitment for EmptyCommitment {
    #[inline] fn bandwidth_bits(&self) -> f64 { 0.0 }
    #[inline] fn accept_prob(&self) -> f64 { 1.0 }
    #[inline] fn evaluate(&self, _kl: &[u8]) -> bool { true }
    #[inline] fn predicate_count(&self) -> usize { 0 }
}

#[derive(Debug, Clone, Copy)]
pub struct SingletonCommitment<P: crate::observable::ObservablePredicate> {
    pub predicate: P,
}

impl<P: crate::observable::ObservablePredicate> Sealed for SingletonCommitment<P> {}
impl<P: crate::observable::ObservablePredicate> TypedCommitment for SingletonCommitment<P> {
    #[inline] fn bandwidth_bits(&self) -> f64 { -self.predicate.accept_prob().log2() }
    #[inline] fn accept_prob(&self) -> f64 { self.predicate.accept_prob() }
    #[inline] fn evaluate(&self, kl: &[u8]) -> bool { self.predicate.evaluate(kl) }
    #[inline] fn predicate_count(&self) -> usize { 1 }
}

#[derive(Debug, Clone, Copy)]
pub struct AndCommitment<A: TypedCommitment, B: TypedCommitment> {
    pub a: A,
    pub b: B,
}

impl<A: TypedCommitment, B: TypedCommitment> Sealed for AndCommitment<A, B> {}
impl<A: TypedCommitment, B: TypedCommitment> TypedCommitment for AndCommitment<A, B> {
    #[inline] fn bandwidth_bits(&self) -> f64 { self.a.bandwidth_bits() + self.b.bandwidth_bits() }
    #[inline] fn accept_prob(&self) -> f64 { self.a.accept_prob() * self.b.accept_prob() }
    #[inline] fn evaluate(&self, kl: &[u8]) -> bool { self.a.evaluate(kl) && self.b.evaluate(kl) }
    #[inline] fn predicate_count(&self) -> usize { self.a.predicate_count() + self.b.predicate_count() }
}

The PrismModel trait extension in uor_foundation::pipeline:

// uor_foundation::pipeline (extension)

pub trait PrismModel<
    H: HostTypes,
    B: HostBounds,
    A: AxisTuple + Hasher,
    R: ResolverTuple = NullResolverTuple,
    C: crate::commitment::TypedCommitment = crate::commitment::EmptyCommitment,
>: __sdk_seal::Sealed
{
    type Input;
    type Output;
    type Route: FoundationClosed;

    fn forward(input: Self::Input) -> Result<Grounded<Self::Output>, PipelineFailure>;
}

/// Foundation's catamorphism entry point per ADR-022 D5 + ADR-036.
/// Extended to accept the 5th substrate parameter; the commitment is
/// threaded as a value reference alongside the resolver tuple.
pub fn run_route<H, B, A, M, R, C>(
    input: M::Input,
    resolvers: &R,
    commitment: &C,
) -> Result<Grounded<M::Output>, PipelineFailure>
where
    H: HostTypes,
    B: HostBounds,
    A: AxisTuple + Hasher,
    M: PrismModel<H, B, A, R, C>,
    R: ResolverTuple,
    C: crate::commitment::TypedCommitment,
{
    // ... existing ψ-pipeline evaluation (unchanged through ψ_1..ψ_9
    // resolver-bound fold-rules) ...
    let kappa_label = /* ψ_9 KInvariantResolver emission, per ADR-035 + ADR-041 */;

    // Post-resolver TypedCommitment consultation per ADR-048:
    if !commitment.evaluate(&kappa_label) {
        // Emit CommitmentEvaluated trace event with result = false,
        // then return PipelineFailure carrying the typed-commitment
        // ShapeViolation per ADR-039.
        return Err(/* PipelineFailure::commitment_violation(...) */);
    }

    // Emit CommitmentEvaluated trace event with result = true.
    // Build Grounded<Output> per ADR-028; seal and return.
    Ok(/* Grounded::new(kappa_label, ...) */)
}

The prism_model! macro per ADR-022 D3 extends its model-declaration parser to accept the optional fifth C: TypedCommitment clause:

// uor_foundation_sdk macro grammar (extension)

prism_model! {
    pub struct MyModel;
    pub struct MyRoute;
    impl PrismModel<
        DefaultHostTypes,
        MyHostBounds,
        (HashAxis<MyHasher>,),
        MyResolverTuple<MyHasher>,
        MyCommitment,                  // <-- 5th position, optional
    > for MyModel {
        type Input = MyInput;
        type Output = MyOutput;
        type Route = MyRoute;
        fn route(input: Self::Input) -> Self::Output {
            k_invariants(homotopy_groups(postnikov_tower(nerve(input))))
        }
    }
}

Model declarations that omit the 5th position default to EmptyCommitment (the macro emits the <…​> parameter list with the default applied). The macro’s emitted forward body calls pipeline::run_route::<H, B, A, Self, R, C>(input, &resolvers, &commitment) per ADR-022 D5 with the commitment threaded through; how the value-level commitment instance is constructed is the application’s choice (typically a const-fn returning the desired AndCommitment<TargetCommitment, PayloadCommitment<K>>-shaped composition).

Wire-format extension for the trace. The Trace per ADR-008’s Trace Wire Format § gains a CommitmentEvaluated event variant. Variant discriminant byte: foundation-assigned (next free value after the existing five variants per ADR-008’s catalog — DatumAdmitted, CompileUnitConstructed, Validated, PipelineRun, CertificateEmitted); TRACE_REPLAY_FORMAT_VERSION bumps to reflect the variant addition. Payload:

// uor_foundation::bridge::trace (variant addition)

pub enum TraceEvent {
    DatumAdmitted(...),
    CompileUnitConstructed(...),
    Validated(...),
    PipelineRun(...),
    CertificateEmitted(...),
    /// ADR-048: emitted after the post-resolver TypedCommitment
    /// consultation. The `result` field indicates whether
    /// `C::evaluate(kappa_label)` returned true; the `predicate_iris`
    /// list enumerates the `observable:Observable` IRIs the commitment
    /// evaluated, in the AndCommitment-derived left-associative order.
    CommitmentEvaluated {
        predicate_iris: &'static [&'static str],
        result: bool,
    },
}

Verifier check per ADR-008’s wire-format discipline: confirm each predicate_iri is in the foundation’s known observable:Observable catalog per ADR-038 + ADR-049’s amendment; confirm the result byte is 0 or 1.

Status: Accepted.

Context: ADR-038 commits the closed observable:Observable taxonomy with seven top-level categories (StratumObservable, MetricObservable, PathObservable, ReductionObservable, CatastropheObservable, CurvatureObservable, HolonomyObservable) plus the AxisProjectionObservable extension. ADR-047 commits the σ-Projection Hardening Principle (U1–U6) as axioms on Hasher impls. ADR-048 commits the TypedCommitment trait whose SingletonCommitment<P: ObservablePredicate> implementor consumes a typed observable’s value to evaluate a single-bit predicate on the κ-label.

What is unspecified: the typed Rust surface for elementary UOR observables — the foundation-declared types whose values are read from a digest and serve as predicate operands in the typed-commitment surface per ADR-048. Implementations consuming the canonical hash axis as a content-addressing surface end up declaring application-internal observable types (p-adic valuations, Walsh–Hadamard parities, ultrametric distances) that should be substrate primitives per ADR-013/TR-08 — they are the elementary readings of the σ-projection’s output, useful across applications, not domain-specific.

Coupled concern: applications selecting a Hasher impl need a substrate-provided mechanism to validate the impl against the Hardening Principle’s six axioms (ADR-047 U1–U6). Without a substrate-level cryptanalysis battery, every application re-derives the empirical-validation harness from scratch; the substrate’s commitment to U1–U6 conformance is unaudited.

Decision: ADR-049 commits two coupled substrate-level surfaces:

(1) Foundation declares typed UOR observable primitives. Five primitive observable types land in uor_foundation::observable::*, each implementing the foundation-declared ObservablePredicate trait whose evaluate method reads the observable’s value from a digest and returns the predicate’s boolean satisfaction:

pub trait ObservablePredicate: Copy {
    /// PRF acceptance probability under the Hardening Principle's U1.
    fn accept_prob(&self) -> f64;

    /// Evaluate the predicate on a digest byte sequence.
    fn evaluate(&self, digest: &[u8]) -> bool;

    /// Foundation-vetted Observable IRI per ADR-038's closed catalog.
    fn observable_iri(&self) -> &'static str;
}

/// p-adic stratum observable per `observable:StratumObservable`.
/// `value(d) = ν_p(d)` — the p-adic valuation of `d` viewed as a
/// big-endian integer. Default impl checks `value(d) == k` against
/// the predicate's parameter `k`.
pub struct Stratum<const P: u32> {
    pub k: u32,
}

/// Walsh–Hadamard parity observable.
/// `value(d, ω) = popcount(d & ω) mod 2` — the WH parity at
/// frequency ω. Default impl checks `value(d) == expected`.
pub struct WalshHadamardParity {
    pub frequency: &'static [u8],
    pub expected: bool,
}

/// p-adic ultrametric distance observable per
/// `observable:MetricObservable`. `value(d, r) = ν_p(d XOR r)` —
/// the ultrametric distance from `d` to a reference `r`. Default
/// impl checks `value(d) >= k`.
pub struct UltrametricCloseTo<const P: u32> {
    pub reference: &'static [u8],
    pub k: u32,
}

/// Affine-pinned bit observable. `value(d, bit) = d[bit/8] >> (bit%8) & 1`.
/// Default impl checks `value(d) == expected`. Used by application-
/// declared payload commitments encoding K bits at K disjoint single-
/// bit positions.
pub struct AffineParity {
    pub bit_index: u32,
    pub expected: bool,
}

/// Lexicographic-threshold observable per `observable:ValueThresholdObservable`.
/// `value(d) = d` viewed as a big-endian byte sequence. Predicate:
/// `d ≤_lex target`, where comparison right-aligns the two sequences
/// (shorter operand left-padded with zero bytes). Realizes the
/// `type:LexicographicLessEqBound` catalog primitive per ADR-040.
pub struct LexicographicLessEqThreshold {
    pub target: &'static [u8],
}

Each observable is Copy, foundation-declared, ontology-bound to its observable:Observable IRI per ADR-038, and consumable as a SingletonCommitment<P: ObservablePredicate> operand per ADR-048. Applications declare predicate compositions over these primitives without redeclaring the observables themselves; the substrate provides the typed observable surface; applications compose.

The five observables span the elementary UOR readings per the Hardening Principle’s U1 marginal-uniformity battery: Stratum reads p-adic valuations across primes; WalshHadamardParity reads spectral parities at arbitrary frequencies; UltrametricCloseTo reads p-adic distances to references; AffineParity reads single-bit values; LexicographicLessEqThreshold reads big-endian integer thresholds against a static target. Together they cover the BitSet, Modular, and ValueThreshold admission regimes per the Hardening Principle’s joint-independence (U2) calibration; LexicographicLessEqThreshold’s accept_prob is the closed-form (value(target) + 1) / 256^|target| per the integer-threshold interpretation, completing the substrate-published set of ObservablePredicate impls one-for-one against the closed BoundShape catalog of ADR-040.

(2) Foundation provides the substrate-level cryptanalysis battery. uor_foundation::axis::cryptanalyze::<H: Hasher>(samples: usize) → CryptanalysisReport runs eight structural tests against the candidate axis impl and emits a structured report. The eight tests:

  • §A Triadic-coordinate uniformity — Stratum + spectrum + parity uniformity, χ² goodness-of-fit at α = 0.001.

  • §B Ultrametric avalanche — single-bit-flip avalanche distribution over ν_p.

  • §C Walsh–Hadamard spectrum — parity uniformity at 32 non-trivial frequencies.

  • §D Stratum autocorrelation — sequential-input z-test across lags 1..10.

  • §E κ-derivation autocorrelation — sequential-template-variation z-test.

  • §F p-adic stratification — Stratum uniformity for p ∈ {3, 5, 7}.

  • §G Joint admission independence — pairwise admission factorization.

  • §H Differential cryptanalysis — Δ-pattern avalanche distributions across Hamming weights.

Plus two predicate-calibration tests:

  • §I U1 marginal calibration — every ObservablePredicate variant accepts at its declared rational rate; χ² goodness-of-fit at α = 0.001.

  • §J U2 joint-independence per disjoint-support pair — pairs of ObservablePredicate instances with disjoint algebraic supports factor as Pr[A]·Pr[B]; χ² goodness-of-fit at α = 0.001 with a non-disjoint negative control witnessing non-vacuity.

The battery’s report enumerates each test’s observed statistic + critical threshold + pass/fail. Foundation’s DefaultHasher and prism-crypto’s published impls per ADR-031 are required to pass the battery at samples = 10^7; failure on any test is a non-conformance signal — the impl does not qualify as a UOR-hardened canonical hash axis per ADR-047. The battery’s structural-test set is the empirical witness for the Hardening Principle’s U1–U6 axioms.

Substrate-amendment-via-foundation rule per ADR-013/TR-08: Foundation declares the ObservablePredicate trait, the five typed observable primitives, the cryptanalyze function, and the CryptanalysisReport struct. The Observable IRIs land in the foundation’s closed ontology catalog per ADR-038 as specializations under the existing taxonomy categories (Stratum + AffineParity under observable:StratumObservable; WalshHadamardParity under a new observable:SpectralObservable subclass parallel to the existing seven; UltrametricCloseTo under observable:MetricObservable; LexicographicLessEqThreshold under a new observable:ValueThresholdObservable subclass parallel to the existing seven, realizing the type:LexicographicLessEqBound catalog primitive per ADR-040). Wire-format version constant bumps for the new Observable subclasses per ADR-013/TR-08.

Consequences: Applications consuming the canonical hash axis read elementary UOR observables through the foundation-declared typed surface; the typed-commitment surface per ADR-048 composes over these observables without per-application re-declaration. Substrate-level axis qualification is empirically verifiable through axis::cryptanalyze; foundation’s CI runs the battery against the published Hasher impls on every release, surfacing any U1–U6 conformance regression as a substrate-level failure rather than a downstream-application surprise.

The framework’s verifiability commitment per ADR-001 + ADR-019 extends to the σ-projection axis itself: the canonical hash axis is not an unaudited substitution; its structural properties (the Hardening Principle’s U1–U6 per ADR-047) are auditable through the substrate-provided battery, and the typed observable surface makes the manifold’s structural readings first-class types applications consume without ad-hoc helpers.

Reference implementation surface for foundation. Foundation places the typed observables and the ObservablePredicate trait in a new uor_foundation::observable::predicate module re-exported from the crate root; the cryptanalysis battery lives in a new uor_foundation::axis module. The reference shape:

// uor_foundation::observable::predicate

use crate::pipeline::__sdk_seal::Sealed;

/// Substrate-level typed-observable predicate (ADR-049). Implementors
/// are foundation-declared typed observables that read a structural
/// property of a digest and evaluate a single-bit predicate against
/// the read value. Sealed; no external impls beyond foundation's
/// emission lane.
pub trait ObservablePredicate: Sealed + Copy {
    /// PRF acceptance probability under the Hardening Principle's U1
    /// (ADR-047). Used by `SingletonCommitment<P>` per ADR-048 for
    /// bandwidth and accept_prob propagation.
    fn accept_prob(&self) -> f64;

    /// Read the structural property from `digest` and return the
    /// predicate's boolean satisfaction.
    fn evaluate(&self, digest: &[u8]) -> bool;

    /// Foundation-vetted Observable IRI per ADR-038's closed catalog.
    fn observable_iri(&self) -> &'static str;
}

/// p-adic stratum observable per `observable:StratumObservable`.
/// `value(d) = ν_p(d)` — the p-adic valuation of `d` viewed as a
/// big-endian integer. Predicate: `value(d) == k`.
#[derive(Debug, Clone, Copy)]
pub struct Stratum<const P: u32> {
    pub k: u32,
}

impl<const P: u32> Sealed for Stratum<P> {}
impl<const P: u32> ObservablePredicate for Stratum<P> {
    fn accept_prob(&self) -> f64 {
        // P(ν_p(d) = k) = (p-1) / p^(k+1)
        let p = P as f64;
        (p - 1.0) / p.powi(self.k as i32 + 1)
    }

    fn evaluate(&self, digest: &[u8]) -> bool {
        // ν_p over the big-endian integer view of `digest`.
        p_adic_valuation_be(digest, P) == self.k
    }

    fn observable_iri(&self) -> &'static str {
        match P {
            2  => "https://uor.foundation/observable/Stratum/2",
            3  => "https://uor.foundation/observable/Stratum/3",
            5  => "https://uor.foundation/observable/Stratum/5",
            7  => "https://uor.foundation/observable/Stratum/7",
            _  => "https://uor.foundation/observable/Stratum/other",
        }
    }
}

/// Walsh–Hadamard parity observable per the new `observable:SpectralObservable`
/// subclass (ADR-049). `value(d, ω) = popcount(d & ω) mod 2`.
/// Predicate: `value(d) == expected`.
#[derive(Debug, Clone, Copy)]
pub struct WalshHadamardParity {
    pub frequency: &'static [u8],
    pub expected: bool,
}

impl Sealed for WalshHadamardParity {}
impl ObservablePredicate for WalshHadamardParity {
    fn accept_prob(&self) -> f64 { 0.5 }

    fn evaluate(&self, digest: &[u8]) -> bool {
        let mut popcount: u32 = 0;
        let n = digest.len().min(self.frequency.len());
        for i in 0..n {
            popcount += (digest[i] & self.frequency[i]).count_ones();
        }
        ((popcount & 1) == 1) == self.expected
    }

    fn observable_iri(&self) -> &'static str {
        "https://uor.foundation/observable/WalshHadamardParity"
    }
}

/// p-adic ultrametric-distance observable per `observable:MetricObservable`.
/// `value(d, r) = ν_p(d XOR r)`. Predicate: `value(d) >= k`.
#[derive(Debug, Clone, Copy)]
pub struct UltrametricCloseTo<const P: u32> {
    pub reference: &'static [u8],
    pub k: u32,
}

impl<const P: u32> Sealed for UltrametricCloseTo<P> {}
impl<const P: u32> ObservablePredicate for UltrametricCloseTo<P> {
    fn accept_prob(&self) -> f64 {
        // P(ν_p(d XOR r) >= k) = p^-k
        (P as f64).powi(-(self.k as i32))
    }

    fn evaluate(&self, digest: &[u8]) -> bool {
        let mut xored = [0u8; 32];
        let n = digest.len().min(self.reference.len()).min(32);
        for i in 0..n { xored[i] = digest[i] ^ self.reference[i]; }
        p_adic_valuation_be(&xored[..n], P) >= self.k
    }

    fn observable_iri(&self) -> &'static str {
        "https://uor.foundation/observable/UltrametricCloseTo"
    }
}

/// Single-bit affine observable per `observable:StratumObservable`.
/// `value(d, bit) = (d[bit/8] >> (bit%8)) & 1`. Predicate: `value(d) == expected`.
#[derive(Debug, Clone, Copy)]
pub struct AffineParity {
    pub bit_index: u32,
    pub expected: bool,
}

impl Sealed for AffineParity {}
impl ObservablePredicate for AffineParity {
    fn accept_prob(&self) -> f64 { 0.5 }

    fn evaluate(&self, digest: &[u8]) -> bool {
        let byte = self.bit_index / 8;
        let bit  = self.bit_index % 8;
        if (byte as usize) >= digest.len() { return false; }
        let v = (digest[byte as usize] >> bit) & 1 == 1;
        v == self.expected
    }

    fn observable_iri(&self) -> &'static str {
        "https://uor.foundation/observable/AffineParity"
    }
}

/// Lexicographic-threshold observable per `observable:ValueThresholdObservable`.
/// Realizes the `type:LexicographicLessEqBound` catalog primitive per ADR-040.
/// `evaluate(digest)` returns true iff `digest ≤_lex target` under right-aligned
/// big-endian byte comparison (shorter operand zero-padded on the left).
#[derive(Debug, Clone, Copy)]
pub struct LexicographicLessEqThreshold {
    pub target: &'static [u8],
}

impl Sealed for LexicographicLessEqThreshold {}
impl ObservablePredicate for LexicographicLessEqThreshold {
    fn accept_prob(&self) -> f64 {
        // Closed form: (value(target) + 1) / 256^|target|. Reads `target`
        // as a big-endian integer and divides by the codomain cardinality
        // for byte sequences of `target`'s width. The +1 accounts for the
        // ≤ (inclusive) predicate boundary at `value(target)`.
        let width = self.target.len();
        let mut t = 0.0_f64;
        let mut place = 256.0_f64.powi(width as i32 - 1);
        for &byte in self.target {
            t += f64::from(byte) * place;
            place /= 256.0;
        }
        (t + 1.0) / 256.0_f64.powi(width as i32)
    }

    fn evaluate(&self, digest: &[u8]) -> bool {
        // Right-aligned big-endian comparison: zero-pad the shorter
        // operand on the LEFT so that `0x00FF` and `0xFF` compare equal,
        // matching the integer interpretation of the byte sequences.
        let n = digest.len().max(self.target.len());
        for i in 0..n {
            let dpos = i + digest.len();
            let tpos = i + self.target.len();
            let d = if dpos < n { 0 } else { digest[dpos - n] };
            let t = if tpos < n { 0 } else { self.target[tpos - n] };
            if d != t { return d < t; }
        }
        true
    }

    fn observable_iri(&self) -> &'static str {
        "https://uor.foundation/observable/LexicographicLessEqThreshold"
    }
}

/// p-adic valuation of a big-endian byte sequence. Returns the lowest
/// `k` such that the integer `d` is not divisible by `p^(k+1)`, or
/// `d.len()*8` (effectively "infinity") if `d` is all zeros and `p == 2`.
/// For p > 2, returns the largest k such that p^k divides the integer.
#[inline]
fn p_adic_valuation_be(d: &[u8], p: u32) -> u32 {
    // Foundation-internal helper; full implementation reads `d` as a
    // big-endian integer and computes ν_p. For p == 2 this is the
    // index of the lowest set bit; for p > 2 this is the count of
    // factors of p in the integer representation.
    ...
}

The cryptanalysis battery:

// uor_foundation::axis

/// Structured report emitted by the cryptanalysis battery per ADR-049.
/// Each test reports observed statistic, critical threshold at α = 0.001,
/// and pass/fail verdict. All eight structural + two predicate-calibration
/// tests are independent; the battery's overall pass requires every test
/// to pass at its declared α.
#[derive(Debug, Clone)]
pub struct CryptanalysisReport {
    pub samples: usize,
    pub alpha: f64,                          // significance level (e.g., 0.001)
    pub structural: StructuralReport,        // §A–§H
    pub predicate_calibration: CalibrationReport, // §I–§J
    pub pass: bool,                          // conjunction of all tests
}

#[derive(Debug, Clone)]
pub struct StructuralReport {
    pub triadic_uniformity: TestResult,             // §A
    pub ultrametric_avalanche: TestResult,          // §B
    pub walsh_hadamard_spectrum: TestResult,        // §C — 32 frequencies
    pub stratum_autocorrelation: TestResult,        // §D — lags 1..10
    pub k_derivation_autocorrelation: TestResult,   // §E
    pub padic_stratification: [TestResult; 3],      // §F — p ∈ {3, 5, 7}
    pub joint_admission_independence: TestResult,   // §G
    pub differential_cryptanalysis: [TestResult; 6],// §H — Δ Hamming weights
}

#[derive(Debug, Clone)]
pub struct CalibrationReport {
    pub u1_marginal: alloc::vec::Vec<TestResult>,   // §I — per ObservablePredicate variant
    pub u2_joint_independence: alloc::vec::Vec<TestResult>, // §J — disjoint-support pairs + non-disjoint NEG CTRL
}

#[derive(Debug, Clone)]
pub struct TestResult {
    pub name: &'static str,
    pub observed: f64,         // observed statistic
    pub critical: f64,         // critical value at the declared α
    pub df: u32,               // degrees of freedom (0 for z-tests)
    pub pass: bool,            // observed < critical
}

/// Run the UOR Cryptanalysis Battery against `H` at `samples` samples.
/// Foundation's CI runs at `samples = 10^7`; downstream applications
/// may run at smaller `samples` for development feedback but the
/// canonical conformance witness for ADR-047's U1–U6 is `samples ≥ 10^7`.
/// The battery is deterministic in `samples` (it uses a fixed input
/// stream — sequential 80-byte headers / 108-byte mining-task-shaped
/// payloads varying a 4-byte counter field).
pub fn cryptanalyze<H: crate::enforcement::Hasher>(samples: usize) -> CryptanalysisReport {
    // Run §A–§H structural tests and §I–§J predicate-calibration tests.
    // Each test computes its statistic from the sample stream and
    // compares against the critical value at α = 0.001 (foundation's
    // chosen significance level for the battery).
    ...
}

Statistical thresholds. The battery’s α = 0.001 thresholds derive from chi-squared critical values at the test’s degrees of freedom: §A stratum χ²(df=16) crit ≈ 39.25; §A spectrum χ²(df=1) crit ≈ 10.83; §B avalanche χ²(df=16) crit ≈ 39.25; §C aggregate χ²(df=32) crit ≈ 62.5; §D/§E autocorrelation max |z| crit ≈ 3.29; §F p-adic χ² crit ≈ 34.5/27.9/26.1 at df=13/9/8 for p=3/5/7; §G admission-independence χ²(df=1) crit ≈ 10.83; §H differential χ²(df=16) crit ≈ 39.25; §I/§J predicate calibration χ²(df=1) crit ≈ 10.83 per variant/pair. The thresholds are foundation-vetted with the canonical sample size samples = 10^7 calibrated against the expected sampling variance.

Rejected alternative 1: Leave the typed observable surface to applications (no foundation declarations). Rejected — every application using the canonical hash axis as a content-addressing surface ends up declaring identical observable types; the substrate-level commitment to ADR-038’s Observable taxonomy implies the substrate-level realization of its typed instances. ADR-049 closes the gap between the ontology’s taxonomy and the foundation’s Rust surface.

Rejected alternative 2: Surface the cryptanalysis battery as a downstream-published test crate (not a foundation primitive). Rejected — the battery is the empirical witness for the Hardening Principle (ADR-047) which IS a substrate-level commitment. Externalizing the battery breaks the substrate-level audit chain; foundation’s CI cannot witness U1–U6 conformance if the battery lives elsewhere.

Rejected alternative 3: Generalize each Observable as a single Observable<T> parametric trait rather than five concrete types. Rejected — the five observables read structurally distinct properties of the digest (p-adic valuation, spectral parity, ultrametric distance, single-bit value, big-endian integer threshold); their value types and accept-probability formulas differ structurally. A single parametric trait collapses meaningful structural distinctions; the five-type surface keeps each observable’s structural identity legible.

Rejected alternative 4: Land the typed observables in the prism-crypto sub-crate (per ADR-031) rather than uor-foundation. Rejected — the observables are content-addressing readings that ANY canonical-hash-axis impl exposes, not crypto-specific. They belong in foundation alongside the Observable taxonomy (ADR-038). prism-crypto’s role per ADR-031 is to publish Hasher impls; foundation’s role is to declare the substrate’s universal surfaces. The Hardening Principle (ADR-047) qualifies impls against the foundation-declared observable surface.

ADR-050 — Width-parametric arithmetic fold-rules: substrate evaluation of the ring-axis and hypercube-axis PrimitiveOps at full Witt-tower widths

Status: Accepted.

Context: ADR-026 commits the closed PrimitiveOp catalog; the 15 discriminants in foundation 0.4.6’s enums.rs realize the dihedral-group-D_{2^n} action structure (Neg/Bnot as the two reflection generators, Succ/Pred as rotations, Add/Sub/Mul as ring-axis operations, Xor/And/Or as hypercube-axis operations, Le/Lt/Ge/Gt/Concat as byte-level primitives). ADR-019 + ADR-029 commit pipeline::run as the catamorphism: every Term::Application { operator, args } evaluates through a per-discriminant fold-rule.

What is unspecified: the width semantics of the fold-rules. Foundation 0.4.6’s binary-arithmetic fold-rule at foundation/src/pipeline.rs:4539 evaluates operands by calling bytes_to_u64_be(lhs.bytes()) (which truncates input to the low 8 bytes when the operand exceeds 64 bits), computes the u64::wrapping_* operation, then encodes back via to_be_bytes and slices to min(operand_width, 8). The unary fold-rule at line 4444 follows the same pattern. The result is that PrimitiveOp::Add at WittLevel::new(256) silently truncates both operands to their low 8 bytes, computes a 64-bit sum, and returns an 8-byte result — without raising a ShapeViolation.

This is a Correction-4-class soundness gap: the catamorphism’s success envelope Grounded<T> attests to a 256-bit arithmetic operation that was actually computed at 64-bit precision. The trace records (Application, Add, args) with no width witness; the verifier per ADR-019’s anamorphism replays an operation whose semantics are width-dependent without a structural width commitment.

The gap is reachable today via any Term::Application over PrimitiveOp::{Add, Sub, Mul, Neg, Bnot, Succ, Pred} whose operand bytes exceed 8 in length. ADR-031’s prism-numerics sub-crate works around the gap by routing arithmetic through Term::AxisInvocation to hand-coded AxisExtension::dispatch_kernel bodies (BigIntModularNumeric<BYTES>::add at crates/uor-prism-numerics/src/bigint.rs:94), bypassing the catamorphism’s PrimitiveOp fold-rule entirely. The architectural cost: arithmetic operations on widths > 64 bits are not, today, transformations expressible in the substrate’s Term language — they are opaque axis-kernel bodies, contrary to ADR-019’s "any well-typed term tree is an element of the free term language F generates" commitment.

Decision: The fold-rules for the ring-axis and hypercube-axis arithmetic PrimitiveOp s — Neg, Bnot, Succ, Pred, Add, Sub, Mul, Xor, And, Or per this ADR, plus Div, Mod, Pow per ADR-053 — evaluate at the full Witt tower (W8 through the WittLevel ceiling the host bounds admit — <B as HostBounds>::WITT_LEVEL_MAX_BITS, whose byte width carrier_inline_bytes::<B>() admits per ADR-060; the pre-0.5.0 TERM_VALUE_MAX_BYTES framing of the effective maximum is superseded by ADR-060). Width is inferred from operand byte-widths: for unary ops, result_width = operand_width; for binary ops, result_width = max(lhs_width, rhs_width) (the operand-aligned convention preserves the ring-axis arithmetic as operations on Z/(2^(8·result_width))Z). The fold-rules MUST NOT truncate operands; operands wider than result_width are a ShapeViolation::CardinalityViolation (rejected, not silently truncated). Comparison primitives Le/Lt/Ge/Gt and Concat are byte-level by definition and retain their existing byte-padded comparison / byte-sequence semantics — they are not subject to width-parametric arithmetic evaluation.

Reference-impl byte-level semantics. The fold-rules realize the following operations at the operand width; Div, Mod, Pow semantics are specified in ADR-053 under the same width-parametric discipline.

  • Add(a, b): byte-wise ripple-carry, result[i] = (a[i] + b[i] + carry) & 0xff; carry-out at the most-significant byte is discarded (mod 2^(8·width)).

  • Sub(a, b): byte-wise ripple-borrow, dual to Add.

  • Mul(a, b): schoolbook product into a 2·width-byte accumulator, low width bytes returned (mod 2^(8·width)).

  • Neg(a): two’s complement — bitwise complement then ripple-carry add 1.

  • Bnot(a): byte-wise 0xff ^ a[i] (no carry; trivially width-parametric).

  • Succ(a) / Pred(a): Add(a, 1) / Sub(a, 1) at the operand’s width, where 1 is the width-operand_width literal.

  • Xor(a, b) / And(a, b) / Or(a, b): byte-wise (no carry; trivially width-parametric).

Hot-path preservation. The implementation is permitted (encouraged) to retain a u64 fast path for result_width ⇐ 8; the cold path handles widths from 9 up to the WittLevel ceiling’s byte width (WITT_LEVEL_MAX_BITS / 8 per ADR-060; pre-0.5.0 this was framed as TERM_VALUE_MAX_BYTES). This is implementation strategy per the three-way responsibility split (ADR-026): structural correctness is foundation-owned; algorithm-strategy selection is implementation-owned. The architectural commitment is structural: same byte-output for any width within the admitted range.

Per-axis byte-width witness. The fold-rule’s result-width inference is observable: a Term arena that requires PrimitiveOp::Add @ result_width = 32 must construct operands whose TermValue.bytes().len() == 32. The Term constructors (per ADR-051) guarantee operand width matches the declared WittLevel.

Consequences: The substrate’s arithmetic vocabulary becomes sound at every Witt level the host bounds admit. ADR-031’s prism-numerics modular-arithmetic axes (BigIntAxis, the Gf2NumericAxisN family, the modular reduction in RingAxis) become substrate-realizable: an application’s prism_model! can emit Term::Application { operator: PrimitiveOp::Add, args: [a, b] } and the catamorphism evaluates correctly at the operand width. ADR-035’s ψ-residuals discipline (forbidding Term::AxisInvocation in verb bodies) becomes practically usable for numerics: verbs composing arithmetic stay closed under the seven prism operators applied to substrate primitives, without escaping to axis dispatch.

The verifier (prism-verify, the anamorphism per ADR-019) gains structural certainty at all widths: replay walks the Term tree, computes each PrimitiveOp fold-rule at the recorded operand width, and confirms the recorded output. No width-truncation surprise.

Rejected alternative 1: Keep the u64 ceiling; document that PrimitiveOp::Add is sound only at W ⇐ 64 and require wider arithmetic to route through axes. Rejected — silently truncating in a normatively-evaluable Term variant violates ADR-019’s initial-algebra commitment; the catamorphism either evaluates a Term variant correctly at all admitted instantiations or rejects it; silent truncation is neither.

Rejected alternative 2: Carry an explicit n_bits: WittLevel field on Term::Application. Rejected — width is observable from the operand byte-widths once those are carried correctly (per ADR-051); an explicit field duplicates the witness and admits constructions where the field disagrees with operand width, opening a new soundness surface. Result width = max(operand widths) is the unambiguous convention.

Rejected alternative 3: Reject Term::Application at result_width > 8 with a structural violation, forcing all wide arithmetic to axis dispatch. Rejected — capitulates to the gap rather than closing it; codifies the workaround as the architecture.

ADR-051 — Wide-value carrier on Term::Literal: byte-sequence representation for wide Witt-level literals

Status: Accepted. Carrier shape amended by ADR-060. ADR-051 widened the Term::Literal value carrier from u64 to a byte sequence so wide Witt-level literals could be represented. ADR-060 retains that motivation but replaces the single owned byte sequence with the source-polymorphic TermValue<'a, const INLINE_BYTES: usize> carrier: wide literals flow through the Inline variant (whose width derives from carrier_inline_bytes::<B>(), which admits every literal at Witt levels up to WITT_LEVEL_MAX_BITS), and the carrier additionally admits Borrowed/Stream forms for structural and unbounded payloads. The byte-length-equals-level.witt_length() / 8 relationship for an inline literal is unchanged.

Context: Foundation 0.4.6’s Term::Literal (per foundation/src/enforcement.rs:1797) is declared:

Literal {
    value: u64,
    level: WittLevel,
},

WittLevel admits arbitrary widths (WittLevel::new(256) is valid; only W8/W16/W24/W32 are named constants). But value: u64 carries at most 8 bytes. So Term::Literal { value: 0xdeadbeef…​, level: WittLevel::new(256) } is structurally malformed — the literal claims a 256-bit width but only carries 64 bits of payload, with the high 192 bits implicitly zero.

This forces wide-literal construction through PrimitiveOp::Concat composition over narrow literals. A 256-bit constant in a Term arena requires four Term::Literal { value, level: W64 } records concatenated, with the application or codegen layer reconstructing the byte sequence. The fold-rule for Term::Literal at pipeline.rs:3504 evaluates the narrow form by emitting value.to_be_bytes() truncated to level.witt_length()/8 bytes — which discards the upper bits for widths > 64.

After ADR-050 closes the fold-rule width gap for arithmetic, the literal carrier becomes the remaining bottleneck for wide-value Term construction.

Decision: Term::Literal widens its value carrier to a byte sequence whose length matches the declared Witt level:

Literal {
    value: TermValue,           // byte sequence, length = level.witt_length() / 8
    level: WittLevel,
},

TermValue is the wide carrier; per ADR-060 it is the source-polymorphic TermValue<'a, INLINE_BYTES>, the wide literal occupying the Inline variant whose width derives from carrier_inline_bytes::<B>() (superseding the pre-0.5.0 fixed TERM_VALUE_MAX_BYTES buffer). A literal’s byte-length MUST equal level.witt_length() / 8; mismatched constructions are rejected at Term-arena construction time with a ShapeViolation. The fold-rule emits the carrier’s bytes directly.

Narrow-form preservation. Codegen and application authors retain a narrow construction surface: uor_foundation_sdk::literal_u64(value: u64, level: WittLevel) → Term is the SDK-emitted helper that constructs a Literal whose value is value.to_be_bytes() truncated/padded to match the declared level. Call sites using u64 literals route through this helper.

Wire-format. Literal records carry the length-prefixed value byte sequence plus the WittLevel. The wire-format version constant identifies the carrier discipline per ADR-013/TR-08.

Consequences: Wide-value Term construction becomes uniform — a 256-bit constant is a single Term::Literal record, not four Term::Application records over Concat. Trace compactness improves at wide widths. The fold-rule for Term::Literal no longer needs width-aware byte-encoding logic; it emits the carrier bytes directly.

ADR-050’s width inference (operand byte-width = max(lhs.bytes().len(), rhs.bytes().len())) becomes structurally well-founded: every Term variant emitting a TermValue carries width information through its bytes, and Term::Literal is the base case.

Rejected alternative 1: Keep value: u64; canonicalize Concat-of-narrow as the wide-literal pattern. Rejected — pushes wide-value construction complexity from one substrate-amendment site (Literal widening) to every consumer of wide literals (codegen, application, trace replay), and bloats wire-format size proportionally to the wide-value count.

Rejected alternative 2: Add a LiteralWide variant alongside Literal. Rejected — proliferates Term variants for what is conceptually one role (an immediate-value carrier); two variants for one role complicates pattern matching at every consumer.

ADR-052 — axis! SDK macro generic-form emission: companion macros admit parametric impl types

Status: Accepted.

Context: ADR-030 commits the axis! SDK macro as the universal substrate-extension declaration mechanism. Per ADR-030’s emission discipline, axis! { trait Foo: AxisExtension { …​ fn bar(…​) → …​ } } emits the trait declaration plus a companion #[macro_export] macro axis_extension_impl_for_foo!(<impl_type>) that synthesizes the AxisExtension::dispatch_kernel body matching against per-method KERNEL_* constants.

The companion macro’s parameter is matched as :ident (per rust-lang/rust#52234 forcing macro-emitted #[macro_export] macros to constrain their parameter forms). This prevents the companion from being applied to generic types: axis_extension_impl_for_foo!(BigIntModularNumeric<BYTES>) fails to parse because BigIntModularNumeric<BYTES> is not an :ident.

ADR-031’s parametric Layer-3 axes (MerkleRoot<H: HashAxis, const LEAF_BYTES: usize>, BigIntModularNumeric<const BYTES: usize>, CpuI8MatmulSquare<const DIM: usize>, OneTimePadFhe<const BLOCK_BYTES: usize>) work around this constraint by hand-writing the AxisExtension impl, replicating the companion macro’s dispatch arms verbatim. The hand-written form lives in every parametric axis impl across the standard-library sub-crates (~12 sites in prism today). The architectural cost: ADR-030’s emission-discipline guarantee (the companion’s dispatch logic stays in sync with the axis trait’s method set automatically) is forfeited for parametric types; the hand impls can drift silently from the macro’s emission convention.

Decision: The axis! macro additionally emits a generic-form companion that admits parametric impl types. The companion’s parameter accepts a :ty form (which admits both :ident and generic-typed forms) constrained by a where-clause forwarded from the application’s invocation. The hand-written AxisExtension impls in the standard-library sub-crates dissolve to generic-form companion invocations.

Companion-name discipline. The generic-form companion is named consistently with the existing one: axis_extension_impl_for_<lowercased_axis_name>!. Existing call sites (axis_extension_impl_for_field_axis!(PrimeFieldNumericSecp256k1) per prism-numerics' field.rs) continue to work; new call sites pass parametric impl types directly.

SDK seal preservation. The generic-form companion still emits through the SDK’s __sdk_seal::Sealed discipline per ADR-022 D1; sealing is structural, not surface. Application authors implementing parametric axes go through the same emission lane.

Consequences: ADR-031’s parametric Layer-3 axes lose their hand-written AxisExtension boilerplate. The dispatch-arm-drift risk closes: the macro emits the dispatch body once, and parametric impls inherit it through the generic companion.

This is independent of ADR-050’s arithmetic-fold-rule widening. Even after prism-numerics' modular-arithmetic axes dissolve into substrate PrimitiveOp s (per the prism-side restructuring), the parametric cryptographic/tensor/FHE axes remain — they’re parametric over hasher / dimension / block-width and need axis-generic SDK emission regardless.

Rejected alternative 1: Add a sibling macro (parametric_axis_extension!) for generic types only. Rejected — admits two emission paths for one role, complicating the SDK’s documented surface; the generic form subsumes the non-generic form (:ty admits :ident).

Rejected alternative 2: Require parametric Layer-3 axes to manually re-invoke axis! per concrete instantiation. Rejected — undermines the parametricity ADR-031 commits to; an application instantiating MerkleRoot<H, 32> at three hasher types would need three axis! invocations.

ADR-053 — PrimitiveOp catalog extension: Div, Mod, Pow as substrate primitives realized through folding-transformation fold-rules

Status: Accepted.

Context: ADR-026 names the gauge-tower arithmetic operator set as Γ = {+, −, ×, ÷, ^} (five elements). Foundation 0.4.6’s PrimitiveOp enum commits three (Add, Sub, Mul) and omits Div and Pow. The wiki prose and the enum disagree, and the omission has a recurring justification (the omitted operations are "derivable" as Recurse/first_admit-bodied verbs over the committed primitives).

This justification confuses derivability with the architectural principle. Per ADR-019’s initial-algebra commitment, every operation an application expresses on substrate values is realized as a Term variant. Per ADR-029’s per-variant fold-rule discipline, the substrate’s evaluation of each Term variant IS the operation’s realization. The principle that distinguishes substrate primitives from verbs is not whether the operation can be decomposed in some closure-body grammar — Add itself could be decomposed via byte-level Succ iteration — but whether the operation is a folding-transformation fused into a single Term variant whose fold-rule realizes the fold at the substrate level, vs. a named composition of multiple Term variants whose body the catamorphism walks during evaluation.

Add, Sub, Mul qualify as folding-transformations: each is a carry-based byte-level fold (per the carry-recurrence identity CA_2: c_[k+1](x,y) = or(and(x_k, y_k), and(xor(x_k, y_k), c_k))); the substrate’s fold-rule fuses the fold into a single Term::Application evaluation. Div, Mod, and Pow qualify on the same grounds: each is a fold whose body is structurally elementary (a carry-based bit-position iteration), supported by identities in the Lean corpus (the carry-recurrence family for ripple-carry; the Witt-correction WC_ family for division by 2 as arithmetic right shift; pow-fold structural correctness as Recurse-over-Mul with Lean-verified totality). The Lean library’s role is exactly to establish the structural identities these fold-rules must satisfy.

The arguments for treating Div and Pow as verbs are concrete but addressable:

  • Div’s zero-divisor issue. Div(a, b) in Z/(2^n)Z is partial only at b = 0. Euclidean division divmod(a, b) → (q, r) where a = q·b + r, 0 ⇐ r < b is total for b > 0 and treats both operands as unsigned big-endian values in Z/(2^n)Z. This is the canonical semantics: total on its domain, well-defined structurally, with b = 0 rejected as a ShapeViolation (the same total-on-domain discipline PrimitiveOp::Le/Lt/Ge/Gt satisfy). Multiplicative inverse (restricted to odd values) is a separate operation realized as a verb (field_inv).

  • Pow’s derivability. Square-and-multiply is a fold whose body uses Mul. Yes — and ripple-carry add is a fold whose body uses Succ. Derivability is not the differentiator; folding-transformation fusion is.

Decision: The PrimitiveOp catalog extends with three substrate primitives — Div, Mod, Pow — each realized as a folding-transformation fold-rule per ADR-050’s width-parametric evaluation. ADR-053 closes the wiki-enum disagreement by committing Γ = {Add, Sub, Mul, Div, Mod, Pow} — the six ring-axis arithmetic primitives on Z/(2^n)Z. The hypercube-axis operations {Xor, And, Or, Bnot} remain the separate metric-dual family per the MetricAxis enum.

Per-variant semantics.

  • Div(a, b) → q. Euclidean quotient: the unique q ∈ Z/(2^n)Z such that a = q·b + r with 0 ⇐ r < b, where both operands are read as unsigned big-endian integers at the common operand width. b = 0 emits ShapeViolation::ValueCheck with constraint IRI https://uor.foundation/op/Div/nonZeroDivisor. Fold-rule realization: binary long division — fold over bit positions of a from MSB to LSB, maintaining (remainder, quotient) state, conditionally subtracting b when the working remainder reaches or exceeds b per the carry-recurrence identity. Geometric character: a new individual op:Quotient (the structural dual of op:Scaling), commitment to the MetricAxis::Vertical axis.

  • Mod(a, b) → r. Euclidean remainder, dual to Div: returns the r companion of divmod(a, b). Same b = 0 discipline. Fold-rule shares structure with Div's fold-rule — implementations may evaluate Div and Mod jointly and emit one of the components, or run independent fold passes; the architectural commitment is the byte-output equivalence Add(Mul(Div(a, b), b), Mod(a, b)) == a for b > 0. Geometric character: op:Remainder, also MetricAxis::Vertical.

  • Pow(base, exp) → base^exp mod 2^n. Modular exponentiation at the operand width. Fold-rule realization: square-and-multiply — fold over bit positions of exp, maintaining an accumulator initialized to 1, squaring at each step and conditionally multiplying by base per the current exp-bit. Pow(0, 0) = 1 (the empty-fold convention per the substrate’s iteration model). Geometric character: op:IteratedScaling, MetricAxis::Vertical.

Identity-catalogue commitments. Each new primitive carries identity individuals in the Lean corpus per the existing op:Identity pattern:

  • DV_1: Euclidean division identity — Add(Mul(Div(a, b), b), Mod(a, b)) == a for b > 0. Universally valid at every Witt level. This is the structural identity the fold-rule’s correctness reduces to.

  • DV_2: Remainder bound — Lt(Mod(a, b), b) == 1 for b > 0. Universally valid.

  • DV_3: Division by 1 — Div(a, 1) == a and Mod(a, 1) == 0. Universally valid.

  • DV_4: Division by self — Div(a, a) == 1 for a > 0; Mod(a, a) == 0. Universally valid.

  • PW_1: Exponentiation identity at zero — Pow(a, 0) == 1 universally; Pow(0, b) == 0 for b > 0. Universally valid.

  • PW_2: Recursive pow identity — Pow(a, Succ(k)) == Mul(a, Pow(a, k)). The structural identity the fold-rule’s square-and-multiply correctness reduces to. Universally valid.

  • PW_3: Multiplicative split — Pow(a, Add(j, k)) == Mul(Pow(a, j), Pow(a, k)). Universally valid at sufficient Witt width for the additive operation.

The Witt-correction identity WC_12 (δ(x) = (x − mul(x,x)) / 2) is directly expressible as Div(Sub(x, Mul(x, x)), 2) at the operand’s Witt level; Sub(x, Mul(x, x)) is even at every admitting Witt level, so the Euclidean quotient is the exact value.

The identity individuals are emitted by the codegen pipeline alongside the three op:Operation individuals (op:div, op:mod, op:pow) per the spec/ namespace’s amendment-recording discipline.

Catalog count. The PrimitiveOp enum has 18 variants — the 15 prior to this ADR plus Div, Mod, Pow. The GeometricCharacter enum gains three new individuals: Quotient (Div), Remainder (Mod), IteratedScaling (Pow). The amendment is recorded under ADR-013/TR-08 with the corresponding wire-format version constant.

Consequences: Wiki and substrate enum become consistent without losing arithmetic expressivity. Every operation an application performs on ring values stays a substrate-native folding-transformation, realized through a single Term variant with a fused fold-rule — no application-author decomposition into bit-level loops, no verb-walker overhead for fundamental ring arithmetic. The catamorphism’s per-variant fold-rule discipline extends uniformly: Div(a, b) evaluates structurally the same way Add(a, b) does — single Term::Application, single fold-rule, single byte-output. Compound operations (modexp, GCD, extended Euclidean, polynomial evaluation, Newton’s iteration) remain verbs per ADR-024 — they compose multiple substrate primitives because they ARE multiple folding-transformations sequenced. The principle: one folding-transformation = one Term variant.

ADR-019’s initial-algebra commitment strengthens: Z/(2^n)Z as a substrate carrier admits the full ring-arithmetic vocabulary as primitives, not as derived constructions. The Lean corpus’s identity coverage of ring axioms (AA_*, AM_*, AR_*, MA_*) extends naturally to the new primitives via DV_* and PW_* identities.

Rejected alternative 1: Keep Div/Mod/Pow as verbs in prism-numerics. Rejected — the user-author surface a / b then lowers to a verb-call Term::Application whose body the catamorphism walks via Recurse + Mul + Ge + Sub (or fold_n + Mul) variant by variant. Per the folding-transformation-fusion principle, this multiplies the catamorphism’s per-evaluation Term-variant count without architectural benefit; the fold can be fused into a single fold-rule at the substrate level for the same byte-output.

Rejected alternative 2: Add Div with semantics restricted to multiplicative inverse over invertibles. Rejected — partial-on-domain primitive breaks the catalog’s totality convention; Euclidean division is total over b > 0, well-defined structurally, and recovers the multiplicative-inverse case as the special instance Div(1, b) when Mod(1, b) == 0 (i.e., when b == 1 or the inverse exists).

Rejected alternative 3: Add only DivMod(a, b) → (q, r) as a single coproduct-returning primitive. Rejected — every other binary PrimitiveOp in the catalog returns a single TermValue; introducing a coproduct-returning primitive complicates the catamorphism’s evaluation surface and the TermValue carrier’s discipline. The architectural cost of carrying Div and Mod separately (one extra fold-rule, byte-output-equivalent to a joint impl up to a Sub) is lower than admitting coproduct-shaped primitive results.

ADR-054 — The Fold-Fusion Principle: every prism transformation is a folding operation; the catamorphism fuses composed folds by universal property

Status: Accepted.

Context: ADR-019 commits pipeline::run as the catamorphism — the unique structure-preserving morphism from the initial algebra Term over the foundation’s signature category into the runtime carrier R(H, B, A, R, C). ADR-029 commits the per-variant fold-rule discipline: every Term variant has a deterministic byte-output fold-rule the catamorphism applies inductively. ADR-053 commits the substrate-Term arithmetic primitives as folding-transformations fused into single Term variants per the byte-buffer fold-rule criterion. ADR-024 commits the three-layer closure with verbs as Layer-3 named compositions of prism operators applied to substrate primitives. ADR-031 commits the standard-library Layer-3 sub-crates (prism-numerics, prism-crypto, prism-tensor, prism-fhe) carrying canonical axes and verbs.

Across these commitments, an architectural property is implicit but unstated: the per-variant fold-rule discipline plus the initial-algebra universal property jointly guarantee that any composition of prism operations — verb-bodied, prism-operator-composed, primitive-op-fused, FirstAdmit-bodied (where ADR-035’s ψ-residuals discipline admits it), axis-dispatched — collapses into a single structure-preserving morphism into the runtime carrier. Per TC-01 this morphism monomorphizes to one Rust routine per substitution-axis selection. The architecture realizes fold fusion as its structural mechanism at every layer; it has not been named.

Two consequential questions are also left unstated: what discipline governs Layer-3 canonical axis impls' bodies, beyond the bare permission of ADR-010’s arbitrary-Rust carve-out? And what role does the substrate-Term realization of an operation play, beyond "the substrate vocabulary admits it"?

Decision: The architecture commits the Fold-Fusion Principle as a normative architectural statement spanning ADR-019, ADR-024, ADR-029, and ADR-031.

(1) Every prism transformation is a folding operation. Every operation reachable from a verb body, a prism_model! route body, a resolver body, or a standard-library canonical axis-impl body is expressible as a Term composition over the substrate’s PrimitiveOp vocabulary plus the prism operator set (ADR-026) plus the closure-body grammar’s higher-order variants per ADR-022 D3 + ADR-033 + ADR-034 + ADR-035. The structural shape is a fold composition: each level of composition is a fold whose body is a primitive or another fold.

(2) The catamorphism fuses composed folds by universal property. Per ADR-019, the catamorphism is the unique structure-preserving morphism from the initial algebra Term into the runtime carrier; uniqueness is the fusion guarantee. Composed fold-rules — verb calls inlined into Term subtrees at proc-macro expansion, prism operators lowering to specific Term variants, per-variant fold-rules consumed inductively — compose universally; the catamorphism IS the fusion of all per-variant fold-rules into one structure-preserving map. No intermediate Term-tree materialization is required during evaluation; no choice exists about how to compose the per-variant fold-rules.

(3) Three layers of fusion realize the principle concretely. The principle’s architectural realization stacks three fusion layers:

  • Macro-expansion fusion. Verb-call sites lower to their Term subtrees at proc-macro expansion per ADR-024. Closure-body-grammar forms lower to specific Term variants per ADR-022 D3 + ADR-026 + ADR-033 + ADR-034 + ADR-035. After expansion, the verb-call walker is absent at run time; the Term arena is a fully-substituted composition over substrate variants and ψ-Term variants.

  • Catamorphism fusion. Foundation’s pipeline::run evaluates the Term arena via the per-variant fold-rules per ADR-029. Per ADR-019, this is the unique morphism into the runtime carrier; the universal property guarantees the composed fold-rules fuse into one structure-preserving map. Substrate-primitive fold-rules operate on byte buffers directly (no intermediate TermValue records); verb bodies recurse into substrate-primitive fold-rules; the recursion is bounded by the Term arena’s structural depth.

  • Monomorphization fusion. The catamorphism’s per-variant fold-rules + the application’s substitution-axis selection (H, B, A, R, C) monomorphize per the Rust type system. Per TC-01, the resulting Rust routine has no dynamic dispatch and no allocation; LLVM’s inlining collapses per-variant dispatch with fold-rule bodies into straight-line code. The application sees one Rust function per PrismModel-typed forward invocation.

(4) Standard-library canonical axis impl body discipline. Every canonical axis implementation published in the standard-library Layer-3 sub-crates per ADR-031 carries a substrate-Term verb body. The axis surface (declared via axis! per ADR-030) remains as the typed-extension contract; the body is realized as a verb!-emitted Term composition over substrate PrimitiveOp s and prism operators per ADR-024. The discipline applies to prism-crypto’s HashAxis canonical impls (Sha256Hasher, Sha512Hasher, Sha3_256Hasher, KeccakHasher, Blake3Hasher), prism-numerics' FieldAxis canonical impls (PrimeFieldNumericSecp256k1 and analogues), prism-tensor’s TensorAxis / ActivationAxis canonical impls (CpuI8MatmulSquare, CpuI8VectorActivation, and analogues), and prism-fhe’s FheAxis canonical impl (OneTimePadFhe and successor schemes when added).

The arbitrary-Rust body permission per ADR-010’s Hasher contract remains for application-defined custom Hasher / axis impls; the standard library does not exercise this carve-out — canonical impls follow the substrate-Term-verb-body discipline by construction. This is the architectural mechanism that makes the catamorphism’s structural reach extend to the leaf level across the published canonical axis surface: there is no opaque axis-kernel boundary inside the substrate’s structural reach for standard-library canonical impls.

Substrate-Term realization examples. The principle’s reach across operation-space is demonstrated by two structurally-distinct example families in the standard library, which together cover the dichotomy that defines operation-space:

  • prism-numerics — the algebraic example family. Compound verbs (modexp_p, polyeval, gcd, ext_euclidean, field_add<P>, field_sub<P>, field_mul<P>, field_inv<P>, fma, newton_step, horner) compose substrate primitives Add, Sub, Mul, Div, Mod, Pow at Witt widths up to the host bounds' ceiling. The Lean corpus’s algebraic identity catalogue (AA_*, AM_*, AR_*, MA_*, DV_*, PW_*) backs the verb-level reasoning. Each verb body composes one or more fold_n / first_admit_over_pairs folds whose body is a primitive sequence over substrate-Term operands. The operations are algebraically structured: the verb-body correctness reduces to algebraic identities the substrate proves.

  • prism-crypto — the cryptographic example family. The HashAxis canonical impls realize SHA-2, SHA-3, BLAKE3 as substrate-Term verbs composing W32 / W64 substrate primitives (Add, Xor, And, Or, Bnot, Div, Mul) plus rotate. The rotate operation may be realized as a verb composing Or(Div(x, 2^k), Mul(x, 2^(width-k))) at the operand’s Witt width, or — if measurement establishes a substrate-primitive emission story for the byte-buffer fold-rule — as a substrate primitive with an explicit byte-rotation fold-rule; both forms satisfy the principle. Each compression-round body is a fixed sequence of substrate primitives; the full compression folds 64 rounds (SHA-256), 80 rounds (SHA-512), or 24 rounds (Keccak); the hash itself folds over input blocks via fold_n plus pad-and-finalize via Concat. The operations are iteration-structured: the verb-body correctness reduces to byte-output equivalence with the canonical reference vectors, not to algebraic identities.

These two example families span the operation-space dichotomy: algebraic (laws-structured) versus cryptographic (iteration-structured). The principle’s coverage across the dichotomy demonstrates that the fold-fusion structure is invariant under the body’s algebraic content — what matters is the byte-buffer fold-rule decomposition into substrate primitives, not whether the body satisfies non-trivial algebraic identities. Any operation in operation-space falls under one structural pattern or the other (or a composition), and both patterns reduce to fold compositions under the principle.

Closure under composition. The Fold-Fusion Principle is closed under composition: any expression in the prism vocabulary — a verb-call, a prism_model body, a verb-of-verbs, a verb-composing-an-axis — compiles to a fused fold by structural induction over the Term language. There is no expression in the prism vocabulary that escapes the principle; the closure is the architectural commitment.

Consequences: The architecture gains a unified structural commitment connecting ADR-019 (catamorphism), ADR-024 (three-layer closure), ADR-029 (per-variant fold-rules), ADR-031 (standard library), and ADR-053 (folding-transformation criterion for substrate primitives). Verb-body composition, prism-model composition, resolver-body composition, and standard-library canonical axis-impl composition all carry the same structural mechanism: each is a fold-rule composition fused universally by the catamorphism into one Rust routine per substitution-axis selection.

ADR-031’s standard-library Layer-3 sub-crates carry the updated body discipline. This refines the standard library’s role from "publishing the canonical typed-extension surface" to "publishing both the surface and the canonical body realization in substrate-Term form." Application authors consuming the standard library through the axis surface (Term::AxisInvocation-keyed dispatch through AxisTuple) get fold-fusion-reachable bodies by construction: the catamorphism walks the canonical impl bodies structurally, with no opaque axis-kernel boundary inside the substrate’s structural reach.

ADR-049’s cryptanalysis battery U1–U6 applies to the substrate-Term-realized canonical impls byte-identically; the battery’s empirical conclusions about axis-realized implementations transfer to the substrate-Term forms by byte-output equivalence at the conformance boundary.

Application architectures that consume the standard-library through the axis surface continue to work unchanged at every observable surface — the axis surface, the kind discrimination, the AxisTuple mechanism, the Term::AxisInvocation lowering — all preserved. What changes is the body’s structural visibility to the catamorphism, which is an internal property of how axis dispatch is realized. The byte-output is identical at every byte-observable surface.

Conformance commitment: each standard-library sub-crate’s conformance test suite per ADR-031 includes byte-equivalence checks between the substrate-Term verb body and the canonical reference vectors (FIPS-180-4 for SHA-2, FIPS-202 for SHA-3, the BLAKE3 spec for BLAKE3, the secp256k1 SEC 2 §2.4.1 vectors for the prime-field family, BLAS reference outputs at integer precision for tensor, the FHE-scheme correctness predicates for prism-fhe). The conformance evidence carries forward from any prior pure-Rust impl of the same canonical operation; the substrate-Term form is conformance-bound to the same reference vectors.

Rejected alternative 1: Commit fold fusion only as a documentation property (ADR-019’s universal property is the fold fusion). Rejected — leaves the standard-library canonical-impl-body discipline unstated, so applications cannot rely on the catamorphism reaching through the axis surface to the leaf level; the architecture’s "every transformation is a fold" claim is implicit but not enforceable at the standard-library boundary.

Rejected alternative 2 (superseded by ADR-055): Require every axis impl (including application-author custom impls) to use substrate-Term verb bodies. Rejected — overreaches ADR-010’s deliberate permission for arbitrary-Rust Hasher impls; application authors writing custom axes for novel domains may not have a substrate-Term decomposition of their kernel, and forcing one would block the open-ended substrate-extension lane ADR-030 commits to. The discipline applies to the standard library as canonical guidance, not as a substrate-level enforcement. Superseded by ADR-055: implementer experience proved that "novel-domain axes that cannot be expressed in substrate Terms" are not actually prism axes — they are unverifiable opaque kernels that defeat ADR-001 + ADR-019’s verifiability commitment, and the catamorphism’s structural reach must extend to every axis surface uniformly. ADR-055 universalizes the substrate-Term verb body discipline via type-system enforcement (the SubstrateTermBody supertrait bound on AxisExtension); ADR-010’s arbitrary-Rust carve-out for Hasher impls is amended accordingly.

Rejected alternative 3: Eliminate the axis surface entirely for canonical implementations; replace canonical hash / tensor / fhe axes with bare verbs in prism-crypto / prism-tensor / prism-fhe. Rejected — the axis surface is the typed-extension declaration mechanism per ADR-030, providing the kind discrimination (HashAxis vs TensorAxis vs FheAxis) that AxisTuple-keyed dispatch requires per ADR-007. Verbs alone don’t carry that kind discrimination at the substrate level; the axis surface is structurally load-bearing for the substitution-axis mechanism. The principle keeps the axis surface intact and commits the body discipline; both surfaces coexist as the typed-extension declaration and the substrate-Term realization respectively.

ADR-055 — Universal substrate-Term verb body discipline: the SubstrateTermBody supertrait makes fold-fusion structurally universal for every axis impl

Status: Accepted. Supersedes: ADR-054 Rejected alternative 2 (the standard-library-only scope of the canonical axis impl body discipline). Amends: ADR-010 (the arbitrary-Rust Hasher carve-out).

Context: ADR-054 commits the Fold-Fusion Principle as the architectural mechanism realizing the Conceptual Model’s C2 (zero runtime movement) cost commitment. The principle’s standard-library realization — the canonical axis impl body discipline — requires every published canonical axis impl in the standard-library Layer-3 sub-crates per ADR-031 to carry a substrate-Term verb body. ADR-054 Rejected alternative 2 explicitly carved out application-author custom axes from this discipline, citing ADR-010’s deliberate permission for arbitrary-Rust Hasher impls and a concern that "novel-domain axes for which substrate-Term decomposition is unknown would be blocked."

Implementer experience proved the carve-out load-bearing in the wrong direction: it prevents prism from supporting fold fusion for arbitrary operations that implement prism. An application-author custom axis that opts into arbitrary-Rust body — say, a third-party CustomCompressionAxis whose kernel calls into a vendor SIMD intrinsic via FFI, or a domain-specific axis whose kernel is hand-tuned assembly — produces a Term::AxisInvocation whose body the catamorphism cannot reach. The catamorphism’s structural reach stops at the axis dispatch; the kernel body is opaque to fold-fusion thereafter. Per ADR-054’s three fusion layers, the second layer (catamorphism fusion) cannot fuse what it cannot see; the third layer (monomorphization fusion) inlines through the axis dispatch but cannot inline through an opaque kernel body.

The Conceptual Model’s C2 commitment is the byte-output-equivalent of "every transformation reachable from forward(input) is a folding operation that fuses universally" — but as long as ADR-054’s discipline is opt-in, the commitment is provisional. Applications consuming any non-conforming axis impl lose the structural-inference guarantee per ADR-001 + ADR-019 at that axis’s surface; the framework’s verifiability commitment is no longer end-to-end.

The previously-rejected alternative’s central concern — "novel-domain axes may not have a substrate-Term decomposition of their kernel" — turns out to be the wrong framing. Per ADR-019’s initial-algebra commitment, every operation an application expresses on substrate values is an element of the term language F generates over the substrate’s PrimitiveOp vocabulary. An operation that genuinely cannot be expressed in substrate Terms is not a prism operation — it is an off-substrate computation that defeats the catamorphism’s structural reach. Such computations are admissible at the host boundary (outside the catamorphism, as host-side wrappers around forward(input)) but not as axis impls inside the catamorphism’s reach.

The architectural choice: either accept that fusion is provisional (per ADR-054 RA2’s original framing) and weaken C2 to "fusion holds for standard-library impls; application-author custom impls opt out at their own risk"; or commit fusion as a universal structural property by extending the body discipline to every axis impl via type-system enforcement. The second is the architectural commitment the framework’s verifiability and zero-cost claims require.

Decision: ADR-055 commits the universal substrate-Term verb body discipline — every AxisExtension impl per ADR-030 (standard-library AND application-author custom) MUST carry a substrate-Term verb body. The discipline is enforced through a foundation-declared sealed supertrait bound on AxisExtension:

// uor_foundation::pipeline (extension)

/// Substrate-Term verb body discipline per ADR-055. Every axis impl
/// must decompose its kernel body to a substrate-Term composition
/// the catamorphism can fuse through. Sealed; emission is via the
/// `axis!` SDK macro per ADR-030.
pub trait SubstrateTermBody: __sdk_seal::Sealed {
    /// The Term arena slice the axis kernel decomposes to.
    /// Read by the catamorphism's `Term::AxisInvocation` fold-rule
    /// per ADR-029 — the per-variant fold-rule walks this slice
    /// inductively rather than calling an opaque kernel function.
    fn body_arena() -> &'static [Term];
}

/// Updated `AxisExtension` declaration per ADR-030, amended by ADR-055
/// to require `SubstrateTermBody`. Application-author custom axes that
/// cannot decompose to substrate Terms fail to compile.
pub trait AxisExtension: __sdk_seal::Sealed + SubstrateTermBody {
    // ... existing ADR-030 surface ...
}

The axis! SDK macro per ADR-030 + ADR-052 emits the SubstrateTermBody impl alongside the AxisExtension impl. The macro’s input gains a normative body clause carrying the Term composition the kernel decomposes to — emitted via the same verb!-style closure-body grammar per ADR-022 D3 + ADR-026 + ADR-033 + ADR-034 + ADR-035. The macro’s emission discipline:

axis! {
    pub trait CustomHashAxis: AxisExtension {
        fn hash(input: &[u8]) -> Digest32;
        fn body = |input| {
            // Substrate-Term composition expressing the kernel.
            // Closure-body grammar per ADR-022 D3 / ADR-026 / ADR-035.
            // The macro lowers this to the Term arena that
            // SubstrateTermBody::body_arena() returns.
            ...
        };
    }
}

For impls of an existing axis trait, the impl site provides the body:

impl CustomHashAxis for MyHasher {
    fn body() -> impl Fn(&[u8]) -> Digest32 {
        |input| { /* substrate-Term composition */ }
    }
}

The macro emits both AxisExtension for MyHasher and SubstrateTermBody for MyHasher together; the latter’s body_arena() returns the static slice the closure decomposes to.

Catamorphism fold-rule extension per ADR-029. The per-variant fold-rule for Term::AxisInvocation { axis_index, kernel_id, inputs } is amended: instead of "dispatch through <A as AxisTuple>::dispatch(axis_index, kernel_id, &evaluated_inputs) to the kernel function and emit its result," the fold-rule now reads the axis’s SubstrateTermBody::body_arena() and recursively folds the body’s Term arena with the evaluated inputs bound in scope. The catamorphism’s structural reach extends through the axis surface to the leaf level for every axis impl, not just standard-library canonical impls. ADR-054’s three fusion layers (macro-expansion fusion, catamorphism fusion, monomorphization fusion) all reach the leaf level uniformly across the axis surface.

The previous "kernel function" dispatch path is preserved as an optional fast-path for axes whose SubstrateTermBody::body_arena() decomposes to a single primitive (e.g., a 1-Term arena pointing to a single PrimitiveOp::Add would be byte-output-equivalent to calling the kernel directly). Implementations may apply this optimization as strategy selection per ADR-026’s three-way responsibility split; the architectural commitment is to byte-output equivalence at every input, not to a specific evaluation strategy.

ADR-010 amendment. ADR-010 originally permitted Hasher impls to have arbitrary-Rust bodies. ADR-055 amends this: Hasher impls (now HashAxis impls per ADR-031) are axis impls and MUST satisfy the universal substrate-Term verb body discipline. The amendment is mechanical — the axis! macro per ADR-052’s generic-form emission accepts a body clause for HashAxis impls just as it does for any other axis. Standard-library Hasher impls (Sha256Hasher, Sha512Hasher, Blake3Hasher, etc.) already satisfy this per ADR-054’s canonical axis impl body discipline; application-author custom Hashers (a custom domain hash, a domain-specific keyed primitive, etc.) provide a body clause too. The cryptographic verification surface per ADR-049’s σ-Projection Hardening Principle (U1–U6) applies to the substrate-Term-realized body byte-identically.

Application-author custom-axis migration path. Application authors with pre-ADR-055 axes whose kernels are arbitrary-Rust bodies have two options:

  1. Decompose to substrate Terms. If the kernel is expressible in the closure-body grammar (any combination of PrimitiveOp s per the post-ADR-053 18-variant catalog, prism operators per ADR-026, higher-order constructs per ADR-022 D3 + ADR-033 + ADR-034 + ADR-035), the author writes the decomposition as a body clause; the macro emits both impls. This is the universal path; per ADR-019’s initial-algebra commitment, every prism operation is substrate-Term decomposable.

  2. Move out of the axis surface. If the kernel is genuinely off-substrate (an FFI call, a vendor intrinsic, an opaque service invocation), the author moves it out of the AxisExtension lane and into a host-boundary wrapper around forward(input). The off-substrate computation lives outside the catamorphism’s reach, where it always did; the framework’s verifiability commitment does not extend to it; the host-boundary contract is the application’s responsibility.

There is no third option per ADR-055’s universal discipline. An axis impl is either substrate-Term-decomposable (option 1) or not an axis impl (option 2). The carve-out ADR-054 RA2 admitted for "novel-domain axes for which substrate-Term decomposition is unknown" reframes per ADR-055: if substrate-Term decomposition is unknown, the operation is not yet a prism operation — it is a research direction for extending the framework’s primitive vocabulary or the closure-body grammar via ADR-013/TR-08.

Substrate-amendment-via-foundation rule per ADR-013/TR-08. ADR-055 IS a substrate amendment under this ADR’s rule. Foundation declares the SubstrateTermBody trait; the AxisExtension trait’s supertrait list extends to include SubstrateTermBody; the catamorphism’s Term::AxisInvocation fold-rule per ADR-029 extends to recursively fold the body’s Term arena; the axis! SDK macro per ADR-030 + ADR-052 extends to emit both impls together with the new body clause. The wire format is unchanged (Term::AxisInvocation's on-wire shape is preserved; the body_arena() slice is a static const, not wire-format state); the version constant bumps per this ADR’s rule for the new trait.

Consequences: Fold-fusion becomes structurally universal across every axis impl. The Conceptual Model’s C2 (zero runtime movement) commitment becomes byte-output-equivalent for every prism transformation regardless of which axis the application selects. ADR-054’s three fusion layers reach the leaf level uniformly; the catamorphism’s structural reach has no opaque axis-kernel boundary anywhere in any conforming implementation. Implementer crates supporting fold-fusion for arbitrary operations (the prism repository realizing uor-foundation, plus any application that uses prism) gain the architectural guarantee that their compositions over arbitrary axis impls fuse universally.

The framework’s verifiability commitment per ADR-001 + ADR-019 strengthens: every prism operation is structurally inspectable by the verifier (prism-verify's anamorphism walks the Term arena including axis bodies). Replay equivalence per TC-05 extends to axis-body evaluation; the verifier reproduces the catamorphism’s full structural fold through axis surfaces without invoking the axis kernel’s Rust body separately. The trace per ADR-008 records Term::AxisInvocation events that reference the static body_arena() slice; replay deterministically reproduces the kernel’s byte output.

ADR-054’s standard-library canonical axis impl body discipline becomes a special case of ADR-055’s universal discipline. ADR-031’s standard-library inclusion criterion ("each canonical axis impl carries a substrate-Term verb body") is no longer an additional discipline — it is the same trait bound every axis impl satisfies. Standard-library and third-party Layer-3 axes are architecturally identical with respect to fold-fusion reach; the operational distinctions per ADR-031 (foundation-maintained, conformance-tested, recommended-for-production) remain operational, not architectural.

The axis! SDK macro’s emission discipline gains a normative body clause. ADR-052’s generic-form companion per ADR-052 carries the body emission for parametric impls; ADR-030’s per-method KERNEL_* const surface is preserved for axis-dispatch routing but the kernel’s body is the substrate-Term decomposition, not arbitrary Rust. Application-author tooling for axis declaration (the axis! invocation, the verb!-style body grammar, the SDK’s diagnostic surface for closure-body violations) is uniform across all axis impls.

Rejected alternative 1: Make SubstrateTermBody an optional supertrait — axes that implement it gain fusion, axes that don’t fall back to opaque-kernel dispatch. Rejected — preserves the carve-out ADR-054 RA2 originally admitted, which is exactly what implementer experience proved load-bearing. A non-mandatory bound gives applications the same provisional-fusion guarantee they had before; the framework’s verifiability and zero-cost claims remain end-to-end-failable at the first non-conforming axis surface.

Rejected alternative 2: Enforce the discipline at the SDK macro level only (the macro rejects axis declarations without a body clause) rather than at the trait level. Rejected — the SDK macro is one path through which axes are declared; applications might bypass the macro for advanced use cases (custom proc-macro emission, hand-written impls per ADR-030’s axis! macro’s normative-but-not-exclusive role). The supertrait bound is the type-system enforcement that holds regardless of how the impl was generated.

Rejected alternative 3: Replace Term::AxisInvocation entirely with substrate-Term inlining at proc-macro expansion (every axis call site lowers to its body’s Term subtree, no axis dispatch at runtime). Rejected — the axis surface per ADR-030 + ADR-007 is the substitution-axis mechanism the framework’s parametric-in-axes commitment depends on; eliminating the Term::AxisInvocation lowering would remove the substitution-axis selection point and force every model declaration to inline its axis selections at proc-macro time, breaking ADR-030’s open-ended substrate-extension lane. ADR-055 keeps the axis surface intact AND extends fusion through it via the SubstrateTermBody supertrait; both architectural commitments survive.

Rejected alternative 4: Provide ADR-055 as discipline-level guidance only (per ADR-054’s standard-library-only framing extended verbally to all axes) without type-system enforcement. Rejected — implementer experience proved that discipline-level commitments are weaker than the architectural property requires. ADR-054 RA2’s original framing was discipline-level; the result is provisional-fusion. Type-system enforcement via the supertrait bound is the architectural mechanism that makes fusion universal — applications that try to declare an axis without a body clause fail to compile, not at runtime.

ADR-056 — ψ-residuals discipline scope refinement: the discipline applies to the route body’s syntactic surface, not to compound verbs or axis impl bodies

Status: Accepted. Refines: ADR-035 (ψ-residuals discipline on verb-body composition). Extends: ADR-046 (verb-body / resolver-body scope-boundary clarification).

Context: ADR-035 commits the ψ-residuals discipline as the architectural mechanism that keeps prism’s typed-iso surface structurally determined — admission is a property of the value’s k-invariant signature per the canonical k-invariants branch, not a runtime predicate enumerated over byte values. ADR-035 forbids Term::FirstAdmit, Term::AxisInvocation, and byte-comparison/concat PrimitiveOp emissions (Le, Lt, Ge, Gt, Concat) in "verb-body terms," checked at proc-macro expansion by the SDK’s verb! and prism_model! macros.

ADR-035’s wording "verb-body terms" is ambiguous across the wiki’s verb-body categories that subsequent ADRs introduced. Verb bodies now appear at four distinct architectural layers:

  1. Route bodies — the closure body the prism_model! macro emits as the application’s typed-iso surface (per ADR-020). The route body determines the application’s structural admission relation.

  2. Compound verb bodies — verbs declared via verb! per ADR-024 that the route body calls. These are Layer-3 named compositions of operators; their Term arenas fold-fuse into the route’s evaluation at the catamorphism’s invocation per ADR-054, but are syntactically distinct from the route’s direct emissions.

  3. Axis impl bodies — the substrate-Term body clause every AxisExtension impl carries per ADR-055’s universal discipline. The catamorphism’s Term::AxisInvocation fold-rule per ADR-029 recursively folds these per ADR-055.

  4. Resolver bodies — the resolve method bodies of <ψ-stage>Resolver<H> impls per ADR-036. Already documented as unrestricted per ADR-046.

Implementer-feedback loop per : reading ADR-035’s discipline as applying to all four categories blocks load-bearing compound operations in the standard library’s canonical axis impls per ADR-054 + ADR-055:

  • SHA padding uses PrimitiveOp::Concat to assemble the padded input message (input || 0x80 || zero-bytes || length-encoded suffix) and PrimitiveOp::Le/Lt to compute the padding length relative to the block-size threshold.

  • HMAC uses PrimitiveOp::Concat to construct the inner and outer keyed inputs (key XOR ipad || message; key XOR opad || inner-hash).

  • Merkle tree construction uses PrimitiveOp::Concat to combine left and right child hashes before re-hashing.

  • Tensor saturation and analogous element-wise clamping operations use PrimitiveOp::Le/Ge to clamp values to saturation bounds.

  • Many cryptographic, tensor, and FHE compound operations need similar Concat-based composition or comparison-based reduction.

Without scope refinement, ADR-055’s universal substrate-Term verb body discipline (requiring every axis impl to provide a body_arena() substrate-Term decomposition) is unattainable for these canonical impls — the substrate-Term decomposition needs Concat/Le/Lt/Ge/Gt, which ADR-035 rejects. The wiki internally contradicts itself: ADR-055 commits universal substrate-Term decomposition; ADR-035 (read broadly) forbids the substrate primitives that decomposition requires.

The contradiction resolves by recognizing that ADR-035’s discipline was about the typed-iso surface’s structural shape, not the substrate’s vocabulary. The discipline keeps the route body’s admission commitment structural — the route author commits to a ψ-chain composition (per ADR-035’s canonical k-invariants branch), not to a byte-search predicate. Compound operations the route composes (via verb calls or axis dispatch) are substrate-vocabulary closures whose internal byte-comparison or byte-concat is a structural-fold detail, fold-fused into the route’s evaluation per ADR-054, not a typed-iso-surface admission predicate.

Decision: ADR-056 refines ADR-035’s scope. The ψ-residuals discipline applies to the route body’s syntactic surface — the closure body the author writes directly in the prism_model!-declared route function. The discipline does NOT apply to:

  • Compound verb bodies declared via verb! per ADR-024. Verbs are Layer-3 named compositions of operators; their internal Term compositions are unrestricted within the substrate’s PrimitiveOp catalog per ADR-053 (the post-ADR-053 18-variant catalog including Concat, Le, Lt, Ge, Gt) plus the prism operator set per ADR-026 plus Term::AxisInvocation (a verb composing axes per ADR-030). The discipline is enforced at the verb-CALL site in the route body (the route cannot directly emit ψ-residual syntactic forms), not at the verb-BODY site.

  • Axis impl bodies per ADR-055’s universal substrate-Term verb body discipline. The body clause in axis! macro invocations is unrestricted; axis impl bodies may use the full substrate vocabulary including Concat, Le, Lt, Ge, Gt, and Term::AxisInvocation (an axis body composing other axes). The catamorphism’s Term::AxisInvocation fold-rule recursively folds these per ADR-029 + ADR-055.

  • Resolver bodies per ADR-046’s scope-boundary clarification. Already documented as unrestricted; ADR-056 reaffirms the boundary.

Architectural distinction. The discipline is about what the AUTHOR WRITES in the route closure body — the typed-iso surface’s syntactic shape — NOT about what the catamorphism EVALUATES at runtime. After macro expansion + fold-fusion per ADR-054, the route’s evaluation includes the inlined Term arenas of every verb and axis impl the route reaches, and those arenas can contain Concat, Le, etc. — the route’s typed-iso surface stays structural because the route’s syntactic emission is a ψ-chain composition, not a byte-search predicate. The fold-fusion mechanism per ADR-054 + ADR-055 fuses verb / axis bodies into the route’s evaluation as one Rust routine per substitution-axis selection per TC-01; the byte-comparison / byte-concat operations the inlined bodies use are fold-fused into the structural evaluation, not exposed as admission-determining predicates at the typed-iso surface.

Discipline enforcement mechanism. The SDK macros realize the discipline through syntactic positioning:

  • The prism_model! macro walks the route closure body (the route function declaration in the impl PrismModel for <Model> block) at proc-macro expansion. Direct syntactic emissions of concat(…​), <, ⇐, >, >=, first_admit(…​), hash(…​), or <axis>::<method>(…​) axis-invocation forms are rejected at this site per ADR-035’s commitment. Verb-call sites (e.g., merkle_root(leaves)) are admissible — the syntactic form is a verb name, not a ψ-residual operation, even if the verb internally uses ψ-residual substrate primitives.

  • The verb! macro emits verb-body Term arenas without applying the ψ-residuals walk to those arenas. Verb bodies are admissible Term compositions per ADR-024’s three-layer closure, restricted only by substrate-vocabulary closure per ADR-013 + ADR-053. A verb’s body may use any PrimitiveOp discriminant from the canonical catalog, any prism operator per ADR-026, Term::AxisInvocation to compose axes, Term::FirstAdmit for bounded search per ADR-034, and any other Term variant the substrate vocabulary admits.

  • The axis! macro per ADR-030 + ADR-052 + ADR-055 emits axis-impl-body Term arenas without applying the ψ-residuals walk. Axis bodies are admissible per ADR-055’s universal substrate-Term body discipline, restricted only by SubstrateTermBody decomposability per ADR-055.

The ψ-residuals walk that ADR-035 specifies is therefore a route-body-syntactic-surface check. Verbs and axis impls called from the route are opaque to the walk; their internal compositions are governed by the substrate’s closure per ADR-013/TR-08 and by ADR-055’s substrate-Term-body discipline, not by ADR-035’s discipline.

Canonical use cases enabled. The scope refinement enables substrate-Term decomposition of every canonical axis impl per ADR-031 + ADR-054 + ADR-055:

  • SHA-2 / SHA-3 / BLAKE3 compression functions compose Add, Xor, And, Or, Bnot plus rotate per round at W32 / W64 widths.

  • SHA-2 / SHA-3 padding composes Concat of input + delimiter byte + zero-pad + length suffix, with Le/Lt computing the padding length.

  • HMAC verb composes Concat of key XOR ipad || message, then hash composition with Concat of key XOR opad || inner-hash.

  • Merkle tree construction verb composes Concat of left-child || right-child at each level, then hash per level, via tree_fold per ADR-026 G15.

  • Tensor saturation verbs (saturate_i8, clamp_to_range, relu_i8) compose Le / Ge against the saturation bounds and Match per ADR-022 D3 G6 for the clamping decision.

  • Bounded-precision arithmetic verbs (e.g., field_inv_modp, mod_reduce) compose Le / Lt for comparison-based reduction steps.

These are all valid substrate-Term verb bodies per ADR-055’s universal discipline; ADR-056’s scope refinement closes the previous wiki-internal contradiction without weakening ADR-035’s architectural intent.

Consequences: The standard library’s canonical axis impls per ADR-031 + ADR-054 + ADR-055 have substrate-Term decompositions composing the full substrate vocabulary in their body clauses without violating ADR-035’s discipline. SHA padding, HMAC, Merkle, tensor saturation, and analogous compound operations across the standard-library Layer-3 sub-crates are now implementable as conformant prism axis impls. The framework’s verifiability commitment per ADR-001 + ADR-019 is unaffected — the catamorphism’s structural reach extends through every verb and axis surface to the leaf level per ADR-055, and the route’s typed-iso surface remains structurally shaped per ADR-035.

The architectural commitment per ADR-035 — admission is structural, not search-based — is preserved at the route-body layer where it matters. The route author commits to a typed-iso surface whose admission is determined by the value’s k-invariant signature (the canonical k-invariants branch per ADR-035 ψ_1 → ψ_7 → ψ_8 → ψ_9 emitting a structural κ-label). Compound operations the route composes are substrate-vocabulary closures whose internal byte-level fold-rules are fold-fused into the route’s structural evaluation per ADR-054.

Application authors with routes that previously appeared to require byte-search operations restructure by introducing compound verbs that internally compose those operations. The verb DECLARATION uses the full substrate vocabulary; the route’s CALL to the verb uses the verb’s name (a Layer-3 identifier per ADR-024). The discipline at compile time rejects the literal concat(a, b) in the route body but accepts merkle_root(leaves) where the merkle_root verb internally composes concat calls.

Substrate-amendment-via-foundation rule per ADR-013/TR-08. ADR-056 is not a substrate amendment. It refines the proc-macro-time enforcement scope of ADR-035’s pre-existing discipline; no substrate primitives are added or removed; no Term variants change; no wire-format fields change. The SDK proc-macro mechanism that walks the route closure body is the same mechanism per ADR-035 + ADR-026’s identifier-resolution rules; ADR-056 specifies the syntactic boundary of the walk’s scope.

Rejected alternative 1: Drop ADR-035’s ψ-residuals discipline entirely. Rejected — the discipline is load-bearing for the framework’s verifiability commitment per ADR-001 + ADR-019; without it, application authors can write byte-search admission relations at the typed-iso surface, defeating the structural-inference commitment that distinguishes prism from arbitrary-Rust-compute frameworks. The discipline’s purpose (route-body structural shape) is preserved; only the scope is refined.

Rejected alternative 2: Maintain ADR-035’s broad scope and re-engineer the canonical axis impls to avoid Concat/Le/etc. Rejected — these primitives are foundational to cryptographic and tensor compound operations; re-engineering would require parallel non-byte-comparison primitives or routing the operations through resolver bodies (where ψ-residuals are admissible per ADR-046). Both alternatives create architectural complexity for an artificial restriction; the discipline’s purpose is structural-admission shape at the route layer, not vocabulary restriction at the substrate layer.

Rejected alternative 3: Move the discipline to a typed-iso-surface annotation the author adds explicitly to the route signature. Rejected — implicit-by-syntactic-position is simpler than explicit-by-annotation; the proc-macro mechanism already distinguishes route-body emissions from verb-body and axis-body emissions through the macro invocation surface; adding an annotation requirement adds boilerplate without architectural benefit.

Rejected alternative 4: Permit ψ-residuals in compound verb bodies but maintain the ban on Term::AxisInvocation everywhere (including verb bodies). Rejected — verbs that compose axis kernels (e.g., HMAC composing two hash invocations) need Term::AxisInvocation in their body. ADR-055’s universal substrate-Term verb body discipline already accepts Term::AxisInvocation in axis impl bodies (where the catamorphism’s Term::AxisInvocation fold-rule recursively folds them); extending the same admission to compound verb bodies is structurally identical and architecturally consistent.

ADR-057 — Bounded recursive structural typing: ConstraintRef::Recurse substrate amendment and foundation shape-IRI registry

Status: Accepted.

Context: ADR-024 commits the framework’s three-layer algebraic closure with implementation closure as Layer 3 — each application declares verbs (named compositions of prism operators over substrate primitives) and Layer-3 axes (substrate-extension vocabularies declared via axis! per ADR-030). ADR-026 commits the partition_product! and partition_coproduct! SDK macros as the structural-decomposition machinery for typed input shapes; ADR-033 extends them with the factor-field-directory mechanism (G20) for named-field forms. The combination is the framework’s vocabulary for expressing typed structural decomposition at the application level.

What is not yet expressible: bounded recursive structural typing at the constraint-geometry level. Application-domain values whose typed form admits self-reference up to a bounded depth — JSON values, XML documents, syntax trees of programming languages, S-expressions of homoiconic languages, ASN.1 or Protocol Buffer message families, filesystem-like hierarchies, categorical constructions like rose trees or bounded forests, any partition_coproduct-shaped vocabulary whose operand set includes the vocabulary itself — cannot be declared as ConstrainedTypeShape impls under the current macro surface. The const-evaluation barrier makes direct self-reference in partition_coproduct!'s operand list non-terminating: the macro’s expansion calls <#operand as ConstrainedTypeShape>::SITE_COUNT in const context per the emitted SITE_COUNT derivation, and Rust’s const evaluator cannot resolve a self-referential constant. Indirect self-reference (recursive trait impls with mutual references between shape types) hits the same barrier through transitivity.

Static depth unrolling — instantiating ShapeAtDepth<N> for N = 0..=MAX_DEPTH and assembling the recursive shape as a const-generic-parameterized type family — is mechanically realizable but combinatorially explosive. A JSON value at MAX_JSON_DEPTH = 32 with MAX_ARRAY_ELEMENTS = 256 unrolls to a constraint set of size ~256^32 ≈ 10^77 — beyond any plausible <B as HostBounds>::NERVE_CONSTRAINTS_MAX or per-stage carrier ceiling. The combinatorial wall is real; static unrolling is not the realizable path.

Three architectural readings of the gap, none satisfactory under the current substrate vocabulary: (1) reduce the constraint-geometry depth and fanout below the parser-level bounds, creating a model/parser bound mismatch where values admissible to the parser carry no constraint-geometry typing; (2) express only the top-level structural cases at the constraint-geometry level, treating recursive content as opaque bytes that resolvers decode internally — sacrificing the typed-distinction-at-constraint-geometry commitment for the recursive content; (3) duplicate the recursive-grammar handling per application, with each application inventing its own mechanism for the const-eval cycle break. Each fails the architectural goal of expressing the application’s typed structural form at the framework’s natural level of structural commitment.

The framework already has the primitives that compose to express bounded recursive structure — they are not yet wired together at the constraint-geometry level. Term::Recurse { measure_index, base_index, step_index } per the substrate-Term arena (foundation’s enforcement module) is the value-level bounded-recursion primitive: the catamorphism evaluates the descent measure to n, applies the base case when n = 0, and iterates the step n times with the recursive-call placeholder bound to the previous iteration’s result. The discrete-clock model per ADR-032 explicitly saturates CYCLE_SIZE at u64::MAX for cardinalities beyond direct representation — the framework’s designated handling of bounded-but-enormous populations. ConstraintRef::Bound { observable_iri, bound_shape_iri, args_repr } per ADR-040 already carries string-IRI references in the constraint vocabulary, demonstrating that shape-IRI references at the constraint level are within the framework’s primitive surface. What is missing is a dedicated ConstraintRef variant for bounded recursive shape reference — the structural analog of Term::Recurse.

Decision: ADR-057 commits a coupled substrate amendment introducing the framework’s constraint-level bounded-recursion primitive plus the shape-IRI registry mechanism that catalogs the shapes admissible as recursion targets:

(1) Foundation declares ConstraintRef::Recurse and the LeafConstraintRef::Recurse parallel. A new variant lands in foundation’s ConstraintRef enum per the substrate-amendment-via-foundation rule (ADR-013/TR-08):

pub enum ConstraintRef {
    // ... existing variants (Residue, Hamming, Depth, Carry, Site,
    // Affine, SatClauses, Bound, Conjunction) ...

    /// Bounded recursive shape reference per ADR-057. The constraint
    /// references another `ConstrainedTypeShape` by its content-
    /// addressed IRI, with an explicit descent budget bounding the
    /// recursion at evaluation time. The constraint expands at the
    /// framework's ψ_1 NerveResolver to the referenced shape's
    /// `CONSTRAINTS` array unrolled up to `descent_bound` levels;
    /// `descent_bound = 0` terminates the recursion (the referenced
    /// shape contributes no further constraints at this depth).
    Recurse {
        shape_iri: &'static str,
        descent_bound: u32,
    },
}

The same variant lands in LeafConstraintRef. Recurse is itself non-recursive at the variant level (the recursion is in the shape-IRI reference graph, which is bounded by descent_bound at every reference) so it composes with Conjunction's leaf-conjuncts and with all other variant slots without re-introducing the deep-Conjunction problem ADR-040 already solved for Bound.

(2) Foundation maintains a closed shape-IRI registry. The foundation crate hosts a pub mod shape_iri_registry module whose role mirrors the observable-IRI registry per ADR-038/049: a closed catalog of shape IRIs admissible as recursion targets, with foundation-vetted registration semantics. Standard-library Layer-3 sub-crates per ADR-031 and application crates register their ConstrainedTypeShape impls at compile time via a register_shape! SDK macro emitting the registration metadata into a foundation-known link-section, analogous to how the observable-IRI registry collects observables across crates. The registry is consulted by ψ_1’s NerveResolver at evaluation time to resolve ConstraintRef::Recurse.shape_iri to the referenced shape’s CONSTRAINTS array.

The registry’s closure rule: a shape is registry-admissible if and only if (a) it implements ConstrainedTypeShape per ADR-017’s closure rule; (b) its IRI is content-derived per the closure rule (no application-chosen string); (c) the shape’s CONSTRAINTS array’s reachable graph (walking ConstraintRef::Recurse references transitively) terminates under any descent budget — i.e., the shape-IRI reference graph’s strongly-connected components are all reachable from the registry root in finite steps. The third condition is a structural acyclicity requirement on the reachable graph’s skeleton; cycles in the shape-IRI reference graph are admissible (a shape can reference itself, or mutually-recursive shape pairs can reference each other) as long as every reachable cycle is bounded by some descent_bound at every reference instance along the cycle.

(3) ψ_1 NerveResolver gains ConstraintRef::Recurse evaluation semantics. Foundation’s validate_constrained_type per the runtime admission path, and the analog at ψ_1 NerveResolver per ADR-036, evaluate ConstraintRef::Recurse by: resolving shape_iri against the shape-IRI registry; walking the referenced shape’s CONSTRAINTS array at the position the Recurse constraint occupies; decrementing the descent budget on each Recurse reference encountered during the walk; terminating when the descent budget reaches zero (the referenced shape contributes no constraints at that depth — the recursion bottoms out with the typed feature hierarchy’s irreducible leaves). The simplicial complex N© emerges from the dynamically-unrolled constraint set; the catamorphism’s downstream ψ-stages consume N© without observing the unrolling per se — they see a constraint geometry that reflects the application’s typed grammar at the application’s bounded depth.

The const-time admission path per validate_constrained_type_const defers ConstraintRef::Recurse to runtime admission, analogous to how ADR-049’s ConstraintRef::Bound { observable_iri = LandauerCost } defers to runtime per the existing const-eval-context carve-out. The const path’s only check on Recurse is that shape_iri is non-empty; the registry lookup happens at the runtime admission path.

(4) CYCLE_SIZE saturation handles recursive populations. A shape whose CONSTRAINTS array includes a ConstraintRef::Recurse reference declares CYCLE_SIZE saturated at u64::MAX. The discrete-clock model’s saturation semantics per ADR-032 already accommodate this; the amendment commits that recursive shapes always saturate. Application authors do not compute a precise CYCLE_SIZE for recursive shapes; the saturated value is structurally derived from the presence of a Recurse constraint in the CONSTRAINTS array.

(5) partition_coproduct! and partition_product! SDK macro extensions admit recurse:T operand markers. The macros extend their operand grammar to admit a recurse:<TypeRef> form. An operand marked as recurse emits a ConstraintRef::Recurse { shape_iri: <T’s IRI>, descent_bound: <bound> } reference at the operand’s position in the emitted constraint set, instead of expanding T’s CONSTRAINTS inline (as non-recurse-marked operands do). The descent bound is specified syntactically — recurse(<bound>):<T> — with the bound expression admitting any const-context-evaluable u32 (a literal, a const, an <AppBounds as HostBounds>-associated const, etc.). The macro expansion emits the Recurse-bearing CONSTRAINTS array; the SITE_COUNT derivation for recurse-marked operands uses the referenced shape’s registered SITE_COUNT (looked up at compile time via a foundation-supplied helper) rather than re-walking T’s ConstraintRef list in const context — breaking the const-eval cycle that direct self-reference cannot resolve.

The shape’s IRI is consulted at compile time through the SDK’s shape-IRI-registry interface; the macro emits a registration call alongside the CONSTRAINTS array, ensuring the referenced shape is registry-present before evaluation can reach the Recurse reference. The registration mechanism follows the link-section pattern foundation uses for observable-IRI registry entries per ADR-038/049: the SDK macro emits a register_shape! invocation in the macro’s expansion; the foundation-supplied registration machinery collects all registered shapes at link time; ψ_1 NerveResolver consults the collected registry at runtime.

(6) Wire-format integration per ADR-013/TR-08. The ConstraintRef wire-format type per ADR-008 gains a variant tag for Recurse and a serialized form carrying (shape_iri, descent_bound). The wire-format version constant bumps per the substrate-amendment-via-foundation rule. Verifiers per ADR-019 validate Recurse-bearing constraint sets by confirming the referenced shape_iri is registry-known per the verifier’s mirror of the foundation shape-IRI registry. Foundation’s verifier-side registry is built at link time the same way the prism-side registry is; the two sides see the same registered shapes when both link against the same foundation version.

Use-case scope — bounded recursive structural typing is generally applicable. ADR-057 is not a domain-specific amendment. The ConstraintRef::Recurse variant serves any application domain whose typed input form admits self-reference up to a bounded depth. The following examples are illustrative, not exhaustive:

  • JSON values: six structural cases (null, false, true, number, string) plus two recursive cases (array, object) with bounded depth. Array’s constraint geometry references JsonValue recursively with descent_bound = MAX_JSON_DEPTH; Object’s constraint geometry references JsonValue recursively at each value position.

  • XML documents: element/attribute/text/CDATA/processing-instruction cases with bounded element-tree depth. Element’s constraint geometry references XmlValue recursively in its children sequence.

  • Code module ASTs: programming language syntax trees with expression-statement-declaration recursive cases bounded by parse-tree depth. The recursive cases reference the AST’s root shape with the application-declared parse-depth bound.

  • S-expressions / homoiconic-language ASTs: cons-cell / atom / nil cases with bounded recursion depth. Cons-cell’s constraint geometry references SExpr recursively in both car and cdr slots.

  • ASN.1 / Protocol Buffer message families: nested-message structural typing with bounded message-tree depth. Each nested-message case’s constraint geometry references the message-family root shape recursively.

  • Filesystem-like hierarchies: directory/file cases with bounded hierarchy depth. Directory’s constraint geometry references the hierarchy’s root shape recursively in its entries sequence.

  • Categorical constructions: bounded rose trees, bounded forests, bounded lazy sequences, bounded zippers — any inductively-defined data type whose constructor set includes self-reference up to a bounded depth.

The substrate amendment’s framing is bounded recursive structural typing as a substrate primitive, not as a per-application convenience. Standard-library Layer-3 sub-crates per ADR-031 may publish reference recursive shape impls in domains where the application-neutral-within-domain criterion holds (e.g., a JSON typed-input sub-crate publishing the canonical JsonValue typed-input shape with the canonicalization companion verb; an XML typed-input sub-crate analogously for XML). Whether specific reference impls land in the standard library is operational policy of the sub-crate maintenance per ADR-031; the substrate primitive is universal.

Consequences: The framework gains constraint-level bounded recursion as a typed primitive, completing the parallel to Term::Recurse at the Term level. Applications carrying bounded recursive structural typing express it through the standard SDK macro surface (partition_coproduct! / partition_product! with recurse:T operands) without per-application invention of cycle-break mechanisms. The framework’s typed-iso surface commitment per ADR-001 + ADR-019 extends to bounded recursive structural typing: the prism_model's constraint geometry reflects the application’s typed grammar at the application’s natural bound, not a sub-language compromise nor a top-level-only compromise.

The const-eval barrier that prevented direct self-reference in partition_coproduct!'s operands is broken by deferral: recursive references are resolved at evaluation time through the shape-IRI registry rather than at const-eval time through type-system inlining. The framework’s evaluator handles the bounded recursion natively; applications do not embed depth-unrolling logic.

The shape-IRI registry mechanism is the framework’s second registry surface — the first being the observable-IRI registry per ADR-038/049. The two registries follow the same architectural pattern (foundation-vetted closed catalogs collected at link time, consulted at runtime by the framework’s evaluators) and admit the same architectural extension mechanism (registration via SDK macros; closure under content-addressing per ADR-017). The framework’s registry pattern is the third-time crystallized mechanism — first the observable-IRI registry per ADR-038/049, second the substitution-axis catalog per ADR-007/030, third the shape-IRI registry per this ADR. ADR-013/TR-08 substrate amendments that introduce new content-addressed reference vocabularies follow the same pattern; the closure discipline (content-addressing, link-time registration, runtime resolution) applies uniformly.

Applications carrying JSON-value (or analogously XML, AST, S-expression, protocol-message-family, filesystem-hierarchy, categorical-construction) typed-input realize the strong-reading commitment under this amendment. A JsonValue shape’s CONSTRAINTS array becomes a partition_coproduct! expansion over seven structural cases with the Array and Object cases using recurse(MAX_JSON_DEPTH):JsonValue operands. The simplicial complex N© at ψ_1 reflects the JSON grammar’s recursive structure; the typed-distinction-at-constraint-geometry property is realized for both the immediate structural cases and the recursive content.

Substrate-amendment-via-foundation rule per ADR-013/TR-08: Foundation declares the ConstraintRef::Recurse variant, the LeafConstraintRef::Recurse parallel, the shape-IRI registry module, the register_shape! SDK macro, the ψ_1 NerveResolver evaluation extension, the validate_constrained_type runtime path’s Recurse handling, the const-time validation’s deferral to runtime, the partition_coproduct! / partition_product! SDK macro extensions admitting recurse:T operands, and the wire-format type’s new variant tag with the wire-format version constant bump. Standard-library Layer-3 sub-crates per ADR-031 may publish reference recursive shape impls; the canonical-reference role for specific recursive-grammar domains lives in the appropriate sub-crate or remains application-side per the inclusion criteria.

Reference implementation surface for foundation.

// uor_foundation::pipeline — ConstraintRef extension

pub enum ConstraintRef {
    // ... existing variants ...
    Recurse {
        shape_iri: &'static str,
        descent_bound: u32,
    },
}

pub enum LeafConstraintRef {
    // ... existing variants ...
    Recurse {
        shape_iri: &'static str,
        descent_bound: u32,
    },
}

impl ConstraintRef {
    pub const fn as_leaf(self) -> LeafConstraintRef {
        match self {
            // ... existing arms ...
            ConstraintRef::Recurse { shape_iri, descent_bound } => {
                LeafConstraintRef::Recurse { shape_iri, descent_bound }
            }
        }
    }
}

// uor_foundation::shape_iri_registry — the new registry module

pub struct RegisteredShape {
    pub iri: &'static str,
    pub site_count: usize,
    pub constraints: &'static [ConstraintRef],
    pub cycle_size: u64,
}

/// Look up a registered shape by IRI. Returns `None` if the IRI is
/// not present in the registry. Called by ψ_1 NerveResolver during
/// `ConstraintRef::Recurse` evaluation.
pub fn lookup_shape(iri: &str) -> Option<RegisteredShape>;

/// Register a shape with the foundation's registry. Called at link
/// time by SDK-emitted registration calls; not called from
/// application code directly.
#[doc(hidden)]
pub fn __register_shape(shape: RegisteredShape);

// uor_foundation_sdk — the new SDK macro

/// `register_shape!` SDK macro per ADR-057. Emits a link-section
/// registration call that adds the shape to the foundation's
/// shape-IRI registry at link time.
#[macro_export]
macro_rules! register_shape {
    ($shape:ty) => { /* expansion */ };
}

The partition_coproduct! and partition_product! macros gain a recurse:T operand-grammar extension that emits Recurse-bearing CONSTRAINTS arrays per the macro-extension rules above; the expansion’s SITE_COUNT derivation uses the registry’s recorded site count for recurse-marked operands rather than re-walking T’s CONSTRAINTS at const-eval time. The const-eval cycle is broken by the registry indirection.

Rejected alternative 1: Static depth unrolling — each recursion depth gets its own ShapeAtDepth<N> type instantiated for N = 0..=MAX_DEPTH. Rejected — combinatorially explosive. A JSON value at MAX_JSON_DEPTH = 32 with MAX_ARRAY_ELEMENTS = 256 unrolls to a constraint set of size ~256^32 ≈ 10^77 — beyond any plausible <B as HostBounds>::NERVE_CONSTRAINTS_MAX. The unrolling does not fit in the framework’s capacity profile at any practical bound.

Rejected alternative 2: Reduce the constraint-geometry depth and fanout below the parser-level bounds so the static unrolling becomes tractable. Rejected — creates a model/parser bound mismatch where values admissible to the parser carry no constraint-geometry typing. The framework’s typed-iso surface commitment requires the constraint-geometry typing reach the same bound the parser reaches; sub-language compromise contradicts the typed-iso commitment.

Rejected alternative 3: Express only top-level structural cases at the constraint-geometry level; treat recursive content as opaque bytes the resolvers decode internally. Rejected — sacrifices the typed-distinction-at-constraint-geometry property for the recursive content. The framework’s structural-typing claim distinguishes constraint-geometry-typed inputs from byte-buffer-typed inputs; a top-level-only realization carries the distinction at one level but not at the recursive level, partially abandoning the architectural commitment.

Rejected alternative 4: Per-application recursion handling — each application invents its own mechanism for breaking the const-eval cycle, using application-specific helper traits, application-internal shape registries, or application-coded depth-unrolling logic. Rejected — duplicates effort across applications; fragments the ecosystem along each application’s recursion-handling choice; admits no canonical-reference role for any specific approach; conflicts with the substrate-amendment-via-foundation rule per ADR-013/TR-08 (capabilities needed across applications belong in the substrate, not in per-application reinvention).

Rejected alternative 5: Use the existing ConstraintRef::Bound { bound_shape_iri } field as the recursive reference mechanism, overloading the typed-commitment surface per ADR-040 for shape-recursion duty. Rejected — the Bound variant’s semantics per ADR-040 are typed-commitment evaluation (the constraint references an observable:Observable + a typed bound shape + canonical-form args), not bounded recursive shape composition. The two roles are architecturally distinct: Bound evaluates a typed predicate on a digest per ADR-048; Recurse references a shape’s CONSTRAINTS array for grammar expansion. Overloading one variant for both roles conflates structurally-different evaluation paths and obscures the constraint vocabulary’s typed-role decomposition.

Rejected alternative 6: Introduce a parallel RecursiveShape trait surface that is structurally distinct from ConstrainedTypeShape, with its own constraint-vocabulary and its own evaluator path. Rejected — fragments the typed-input surface into two trait surfaces applications must understand and choose between; doubles the framework’s typed-input vocabulary; breaks ADR-017’s closure rule by introducing a parallel content-addressing path. The amendment as committed extends the existing ConstrainedTypeShape surface uniformly; recursive shapes and non-recursive shapes share the same trait, the same content-addressing rule, the same registry, and the same evaluator path.

Rejected alternative 7: Defer this amendment indefinitely; require applications carrying bounded recursive structural typing to remain on the top-level-only realization or the reduced-bounds realization until some future framework version commits to recursive shape composition. Rejected — applications carrying bounded recursive structural typing require constraint-geometry-level typed distinction for the recursive content; the deferral path leaves them in a partial-strong-reading state indefinitely. The amendment’s scope (a single new ConstraintRef variant + a registry module + macro extensions) is bounded and architecturally well-placed; deferring it delays applications across multiple domains (JSON, XML, code-module ASTs, S-expressions, protocol-message families, filesystem-like hierarchies, categorical constructions) without architectural reward.

The architecture’s typed-iso commitment, the substrate’s recursion primitive at the Term level, the discrete-clock model’s saturation semantics, and the constraint vocabulary’s existing IRI-reference infrastructure compose into the framework’s natural answer to bounded recursive structural typing. ADR-057 lands that composition as the substrate primitive the framework was designed to express.

ADR-058 — κ-derivation as the framework’s compression operator: structural identity between canonical-form emission and minimum-information representation

Status: Accepted.

Context: ADR-019 + ADR-035 fix the framework’s principal data path as the eight-resolver ψ-pipeline composed with the ψ_9 σ-projection: ψ_1 NerveResolver, ψ_2 PostnikovTowerResolver, ψ_3 HomotopyGroupResolver, ψ_4 KInvariantResolver on the canonical k-invariants branch (with ψ_5 ChainComplexResolver, ψ_6 HomologyGroupResolver, ψ_7 CochainComplexResolver, ψ_8 CohomologyGroupResolver populated for ResolverTuple completeness per ADR-036 but not invoked on the canonical path per ADR-035), terminating at the ψ_9 σ-projection — the canonical hash-axis invocation that emits the κ-label per ADR-047’s hardening principle. ADR-043 fixes the resolver-internal iterative-resolution discipline: each ψ-stage’s FreeRank decreases monotonically toward FreeRank = 0; convergence is the closure of the ψ-pipeline’s typed-distinction surface over the input’s constraint geometry.

The framework specifies what the pipeline does — categorical pullback on the substrate-Term arena per ADR-019; closure under uor-foundation per ADR-013; the three-layer algebraic closure per ADR-024; the fold-fusion universality per ADR-054 + ADR-055 — but does not yet ADR-commit, at the conceptual-model level, what the pipeline is in algorithmic-information-theoretic terms.

Two properties of the κ-label hold by construction across the framework’s existing commitments. First, minimum-information emission. The σ-projection at ψ_9 carries only those bits that distinguish the input within its constraint geometry’s typed-distinction surface per ADR-001 + ADR-017. The pre-σ-projection ψ-stages monotonically reduce the unresolved-site count per ADR-043; the σ-projection emits the residual structural identity. The κ-label is the minimum byte sequence under the framework’s σ-projection axis selection that identifies the input as a member of its constraint-geometry orbit.

Second, uniqueness under fixed pipeline order. The fixed total order of pipeline stages per ADR-035 sidesteps the confluence / critical-pair problem of generic term-rewriting systems. Two inputs admitting through the same ψ-pipeline emit byte-identical κ-labels if and only if they are computationally equivalent under closure under the identity catalogue per ADR-019 + ADR-024 — and the converse holds under the σ-projection’s hardening axioms per ADR-047 (U1–U6).

These two properties — minimum-information emission and uniqueness under fixed-pipeline order — are the defining properties of compression-to-canonical-form. The κ-label is the canonical-form representation under the framework’s constraint-geometry topology; the κ-derivation is the compression operator that emits it.

What is not yet ADR-committed: the framework’s identity claim that κ-derivation is compression-to-canonical-form. Without this commitment, substrate-natural-coordinate observations of compression behavior — progressive operator-count reduction under capacity constraint, convergence to stable attractors under iterated compression, plateau-then-drop transitions at threshold capacities, structure-lossless round-trip behavior under compose-decompose-recompose cycles — carry no a priori structural-equivalence to the framework’s κ-derivation. With this commitment, they are admissible as κ-derivation observations under closure under the identity catalogue.

Decision: ADR-058 commits κ-derivation as the framework’s compression operator under the structural reading:

(1) κ-derivation is compression-to-canonical-form. The eight-resolver ψ-pipeline composed with the ψ_9 σ-projection emits the unique minimum-information byte sequence distinguishing the input within its constraint geometry’s typed-distinction surface. This is an identity claim, not a feature claim: the κ-derivation does not have compression-to-canonical-form as a property it provides; the κ-derivation is compression-to-canonical-form as the framework realizes it. The framework’s existing commitments fix the operator; the operator’s natural-coordinate behavior in any specific substrate is the operator’s behavior expressed in that substrate’s coordinates.

(2) Cross-substrate compression universality. Any conforming substrate — defined by the (HostTypes, HostBounds, AxisTuple, ResolverTuple, TypedCommitment) selection per ADR-007 + ADR-030 + ADR-036 + ADR-048 — that processes the same input under the same PrismModel emits the same κ-label. The framework’s substrate-independence commitment per TC-05 carries the compression operator’s universality as a closure property: cross-substrate convergence under compression is structural, not statistical. Substrates exhibiting operator-count reduction toward stable attractors under capacity constraint, converging at threshold capacities to operator-count ranges that agree across substrates, are exhibiting κ-derivation in substrate-natural coordinates — the framework’s compression operator is realized in each substrate’s terms.

(3) Three-tier closure-lossless taxonomy. The framework’s closure structure per ADR-019 + ADR-024 admits three architecturally-distinct levels of equivalence between two outputs under the same PrismModel:

  • T1 — Byte-identical. The two outputs are bit-equal as byte sequences. Achieved when the inputs admit through identical ψ-stage traces and the σ-projection axis selection per ADR-047 is identical.

  • T2 — Closure-lossless (κ-label-identical). The two outputs share the same κ-label under the framework’s σ-projection. Equivalent to TC-05 trace-replay equivalence: any conforming runtime emits the same Certified<GroundingCertificate> from either output’s trace. T2 is the framework’s natural equivalence relation under κ-derivation; T1 implies T2 by construction, but T2 does not imply T1 (two byte-distinct outputs may share a κ-label under closure under the identity catalogue).

  • T3 — Outcome-coarse-equivalent. The two outputs admit through the same typed-commitment per ADR-048 even if their κ-labels differ. A coarser equivalence supplied by the application’s 5th PrismModel parameter C: TypedCommitment selection. T2 implies T3 under the application’s C selection, but T3 does not imply T2 — the typed-commitment’s admission predicate may admit κ-label-distinct outputs as a designed cost-model affordance.

The three tiers form a strict chain T1 ⇒ T2 ⇒ T3 under the application’s PrismModel; the reverse implications hold only under additional structural conditions.

(4) Substrate-independence is binary under TC-05. The framework’s substrate-independence commitment per TC-05 admits no statistical-regression form. A conforming substrate emits the byte-identical certificate; a non-conforming substrate fails closed at certify_from_trace. Substrate-independence claims about compression dynamics in any specific substrate are evaluated against the binary TC-05 surface: any substrate whose compression dynamics admit under the κ-derivation is conforming; any substrate whose compression dynamics do not admit is non-conforming. The discrimination is structural, not regressional.

(5) Identity scope and codomain scope. ADR-058 commits the identity of the compression operator. ADR-059 commits the structure of its codomain in operator-geometry coordinates. The two ADRs compose: under ADR-058, κ-derivation is compression-to-canonical-form; under ADR-059, the canonical-form codomain has the exceptional algebraic structure that uor-foundation::kernel::convergence already encodes. The two ADRs are cited jointly when both the operator’s identity and its codomain’s structure are needed — e.g., the closure-lossless taxonomy at level T2 reads κ-label identity per ADR-058 and the Atlas-image codomain per ADR-059.

(6) Conceptual-reading scope. ADR-058 is a conceptual-reading commitment over existing constructs (the ψ-pipeline per ADR-019 + ADR-035, the σ-projection at ψ_9 per ADR-047, the iterative-resolution discipline per ADR-043, the closure structure per ADR-019 + ADR-024). No new substrate trait declarations, no new wire-format variants, no new SDK-macro discipline. The substrate-amendment-via-foundation rule per ADR-013/TR-08 is not engaged. The conceptual reading is normative for the wiki’s specification surface.

Consequences: The framework’s conceptual model gains an architectural commitment connecting κ-derivation to the algorithmic-information-theoretic structure of compression. Substrate-natural-coordinate observations of compression behavior in any conforming substrate are admissible as κ-derivation observations under closure under the identity catalogue. The closure-lossless taxonomy supplies a typed equivalence vocabulary for application-level interoperability protocols where κ-label-identity is the structural-equivalence target; applications declaring T2 interoperability requirements bind to a shared σ-projection axis selection per ADR-047 and consume the κ-label as the structural-fingerprint surface.

Cross-substrate compression universality grounds the framework’s content-addressing commitment per ADR-017 + ADR-047 at the algorithmic-information-theoretic level: two substrates emitting the same κ-label for the same input are exhibiting the same compression behavior up to substrate identity. Cross-substrate convergence under compression is a closure property of the framework, not an empirical regularity to be discovered per substrate. The framework’s substrate-independence commitment per TC-05 carries this universality as a binary discrimination at the certificate boundary.

ADR-058’s identity claim composes with ADR-059’s codomain claim to yield a categorical theorem under the joint commitments: any two conforming substrates compressing the same input land at the same codomain position modulo the codomain’s equivalence relation. The operator is universal (ADR-058); its codomain is universal (ADR-059); their composition is structurally determined.

Use-case scope — the compression-operator reading is generally applicable. ADR-058 is not a domain-specific commitment. Any PrismModel admitting through the κ-derivation has its canonical-form emission readable as compression-to-canonical-form. The following examples are illustrative, not exhaustive:

  • Format-preserving canonical forms — JSON values under JCS canonicalization, XML documents under W3C XML-C14N 1.1, ASN.1 values under X.690 DER, S-expressions under Rivest 1997 canonical form, ring elements under canonical-bytes layout: each admits through the framework’s address-inference verb body; each yields a κ-label that is the canonical-form representation under the format’s canonicalization rule. The κ-label is the structural fingerprint of the canonical form across formats.

  • Proof normalization — formal-system terms admitting through a PrismModel whose verb body realizes the system’s normalization procedure: the κ-label of the normalized term is the canonical-form representation under the system’s notion of equivalence. Two terms equivalent under the system’s rewriting share a κ-label.

  • Term-rewriting systems — any rewriting system whose normal forms are unique under the system’s confluence properties admits through a PrismModel whose verb body realizes the system’s rewriting; the framework’s fixed-pipeline-order discipline per ADR-035 sidesteps confluence concerns at the framework level (the pipeline is total; the application’s verb body is at the closure level beneath).

  • Iterated abstraction — any sequence of capacity-constrained transformations whose stable points are the inputs' canonical representations under the constraint admits as a κ-derivation in the constraint’s natural coordinates. Stable attractors under iteration are canonical-form realizations under the constraint’s pipeline order. The framework’s iterative-resolution discipline per ADR-043 is the substrate’s realization of this attractor structure at the resolver level.

  • Equivalence under transformation — two routes from distinct inputs to the same κ-label are computationally equivalent under closure under the identity catalogue. The framework’s content-addressing commitment per ADR-017 carries this equivalence as structural identity at the byte-coordinate level.

Rejected alternative 1: Treat κ-derivation as compression-compatible without committing the identity. Rejected — admits substrate-natural-coordinate observations of compression behavior only as analogically related to the framework, without structural-equivalence. Cross-substrate convergence then carries no a priori framework reading; each substrate’s compression behavior would require independent justification before admitting as κ-derivation evidence. The architectural goal of substrate-independence under compression — already committed at TC-05 — is undermined by the deferral of its conceptual-reading.

Rejected alternative 2: Treat compression as a property of specific PrismModel declarations rather than of the framework’s κ-derivation. Rejected — application-level compression behavior is downstream of the framework’s compression operator; the framework’s commitment must be at the operator level, not at the per-model level. Per-model compression treatment fragments the architectural commitment across the application surface; the κ-derivation is one operator realized by the framework, not a family of operators per PrismModel.

Rejected alternative 3: Defer the conceptual commitment indefinitely; admit substrate-natural-coordinate compression observations on a case-by-case basis without a structural-equivalence ADR. Rejected — substrate-natural-coordinate compression observations are already being made under the framework’s closure under the identity catalogue; without a conceptual commitment, the architectural reading of these observations is implicit rather than normative. The deferral path leaves the framework’s compression-related commitments under-articulated at the specification surface.

Rejected alternative 4: Specify an algorithm-specific compression metric (Kolmogorov complexity, minimum description length, Solomonoff inductive prior, etc.) as the framework’s compression operator. Rejected — the framework’s compression operator is structurally specified by the ψ-pipeline composed with the σ-projection; algorithm-specific metrics are particular realizations of compression-to-canonical-form under specific computational substrates. The framework’s commitment is at the structural level (the operator’s identity); the algorithmic-information-theoretic literature provides the reference vocabulary for what this operator is, not which specific compression algorithm the framework chooses. The framework chooses none; it specifies the structural operator that each substrate realizes in its natural coordinates.

Rejected alternative 5: Use a substrate-specific identity claim (the substrate is the framework’s compression operator) rather than a conceptual-reading commitment (κ-derivation is compression-to-canonical-form as the framework realizes it). Rejected — confuses what the conceptual model fixes (the framework’s identity claims about its own operators) with what specific substrates realize (the operator’s behavior in the substrate’s natural coordinates). The conceptual-reading commitment is at the framework level; specific substrates' compression behavior is at the substrate-natural-coordinates level. The two are related by closure under the identity catalogue per ADR-019 + ADR-024.

Rejected alternative 6: Commit the compression-operator reading within ADR-047’s σ-projection hardening principle as an additional axiom (U7). Rejected — ADR-047’s hardening axioms U1–U6 constrain the σ-projection axis selection’s structural properties (uniform distribution, avalanche behavior, etc.); the compression-operator reading is a conceptual identity claim about the κ-derivation as a whole (ψ-pipeline + σ-projection), not an additional structural constraint on the σ-projection alone. Lifting the conceptual-reading into ADR-047 would conflate operator identity with axis-selection hardening; the two are architecturally distinct.

ADR-059 — Atlas image inside E₈ as the codomain of κ-derivation in operator-geometry coordinates: structural commitment connecting the Hopf convergence tower to the exceptional algebraic structures

Status: Accepted.

Context: ADR-058 commits κ-derivation as the framework’s compression operator under the structural reading. What ADR-058 does not address: the structure of the operator’s codomain. The κ-label per ADR-047 carries the byte-sequence emission of the σ-projection; in byte-coordinate the codomain is the set of admissible byte sequences under the hash-axis selection. In operator-geometry coordinates — the natural-coordinate reading the framework’s convergence machinery already encodes — the codomain has additional structure that has not yet been ADR-committed.

The foundation’s kernel::convergence module (per the building-block view in section 5; per the kernel-component glossary in section 12) declares four traits over HostTypes: ConvergenceLevel with algebra_dimension, betti_signature, fiber_type, characteristic_identity, level_name methods; HopfFiber carrying fiber_dimension, total_space, base_space, fiber_sphere; ConvergenceResidual with residual_betti and residual_dimension; CommutativeSubspace and AssociativeSubalgebra for pairwise- and triple-interaction convergence.

The convergence-machinery’s structural commitment, fixed by the trait surface: four ConvergenceLevel instances at algebra dimensions {1, 2, 4, 8} (the dimensions of the four normed division algebras R, C, H, O); four HopfFiber instances at fiber spheres {S⁰, S¹, S³, S⁷} (the Hopf fibrations of those algebras); four characteristic identities {existence, feedback, choice, self-reference}; persistent residual Betti numbers β_{2^k − 1} = 1 at each level. The convergence-machinery is the framework’s substrate encoding of operator-geometry levels.

What the wiki does not yet commit: the structural connection between this machinery and the codomain of κ-derivation in operator-geometry coordinates. The convergence-tower’s four levels are the natural-coordinate target structure of κ-derivation: a canonical form’s position in operator-geometry coordinates is its level in the convergence tower, with finer-grained position determined by sub-level structure within the level.

The exceptional algebraic structures — the five exceptional simple Lie algebras over the reals (G₂, F₄, E₆, E₇, E₈) — admit a categorical construction from a single universal object: the Atlas of Resonance Classes, a 96-vertex graph arising as the stationary configuration of an action functional on a 12,288-cell complex. The Atlas is the initial object in the category ResGraph of resonance graphs; every exceptional Lie group structure factors through it via categorical operations:

  • G₂ via product — Klein quartet × ℤ/3 → 12 roots, rank 2.

  • F₄ via quotient — 96 / ± mirror symmetry → 48 sign classes, rank 4.

  • E₆ via filtration — degree partition (64 degree-5 vertices + 8 degree-6 vertices) → 72 roots, rank 6.

  • E₇ via augmentation — 96 vertices + 30 S₄ orbits → 126 roots, rank 7.

  • E₈ via direct embedding — φ: Atlas ↪ E₈ injective, adjacency-preserving (edges ↦ inner product −1), exactly 48 sign classes → 240 roots, rank 8.

The Atlas → E₈ embedding φ is unique up to E₈ Weyl group symmetry. The Atlas’s initiality in ResGraph means: every conforming compressor’s canonical-form target factors through it. The exceptional Lie group structures are the categorical operations on the Atlas; each exceptional group is reachable from the Atlas via the corresponding operation.

What is not yet ADR-committed: the framework’s identity claim that the codomain of κ-derivation in operator-geometry coordinates is the Atlas image inside E₈, with quotients / filtrations / products / augmentations / direct embeddings yielding F₄ / E₆ / G₂ / E₇ / E₈ codomain images for canonical forms whose constraint geometry admits the appropriate factorization. Without this commitment, the convergence-machinery’s structural commitment carries no explicit codomain reading; with this commitment, canonical-form codomain structure becomes specifiable as a typed surface admitting application-level typed-commitment predicates per ADR-048.

Decision: ADR-059 commits the Atlas image inside E₈ as the codomain of κ-derivation in operator-geometry coordinates, with the exceptional algebraic structures providing finer-grained codomain typing:

(1) Operator-geometry codomain commitment. The codomain of κ-derivation, viewed in operator-geometry coordinates per the convergence machinery in kernel::convergence, is the Atlas image inside E₈. Canonical forms whose constraint geometry admits no further factorization land in the full 96-vertex Atlas image. Canonical forms whose constraint geometry admits factorization through one of the categorical operations (product, quotient, filtration, augmentation, direct embedding) land in the corresponding exceptional-group image (G₂, F₄, E₆, E₇, E₈ respectively).

(2) Universal factorization through the Atlas. Every conforming compressor — every PrismModel admitting through the κ-derivation per ADR-058 — has its canonical-form codomain factoring through the Atlas as the initial object in ResGraph. The factorization is unique up to E₈ Weyl group symmetry per the Atlas → E₈ embedding’s uniqueness theorem. Cross-substrate convergence under compression per ADR-058 is sharpened to: two conforming substrates processing the same input emit canonical forms at the same Atlas-image position modulo Weyl-orbit equivalence.

(3) Cross-substrate codomain universality (joint with ADR-058). Two conforming substrates processing the same input under the same PrismModel emit byte-identical κ-labels per ADR-058 + TC-05; in operator-geometry coordinates, this byte-identity reads as identical Atlas-image positions modulo Weyl-orbit equivalence. Cross-substrate convergence under compression is a categorical theorem under the joint commitments of ADR-058 + ADR-059: the operator is universal (ADR-058); its codomain has universal structure (ADR-059); their composition is structurally determined.

(4) Hopf convergence tower as coarse codomain stratification. The four ConvergenceLevel instances per kernel::convergence (R / C / H / O at algebra dimensions {1, 2, 4, 8}) are the coarse stratification of the Atlas-image codomain:

  • R-level (algebra dimension 1; characteristic identity existence; HopfFiber S⁰): canonical forms whose operator-geometry coordinates admit only the existence-distinction. Single-primitive canonical forms at the irreducible-leaves limit.

  • C-level (algebra dimension 2; characteristic identity feedback; HopfFiber S¹): canonical forms admitting pairwise commutative structure. The commutative-subspace selection per the CommutativeSubspace trait determines the canonical form’s C-level position.

  • H-level (algebra dimension 4; characteristic identity choice; HopfFiber S³): canonical forms admitting triple associative structure. The associative-subalgebra selection per the AssociativeSubalgebra trait determines the canonical form’s H-level position.

  • O-level (algebra dimension 8; characteristic identity self-reference; HopfFiber S⁷): canonical forms admitting the full octonionic structure, including non-associative composition.

A canonical form’s level in the convergence tower corresponds to the algebra dimension at which its operator-geometry coordinates carry a normed-division-algebra structure; descent in the tower (O → H → C → R) corresponds to surrendering the corresponding characteristic identity (self-reference → choice → feedback → existence) under compression pressure. The descent is the natural-coordinate reading of the compression operator’s progressive site-pinning per ADR-043. Properties at higher levels are surrendered in reverse order of their acquisition; non-associativity (the O-level’s distinguishing identity) is the first surrendered, existence (the R-level’s irreducible identity) is the last preserved.

(5) Exceptional algebraic structures as finer-grained codomain typing. Within the convergence-tower’s coarse stratification, the exceptional algebraic structures and their Atlas-derived constructions admit application-level typed-commitment surfaces per ADR-048. An application’s 5th PrismModel parameter C: TypedCommitment may admit a canonical form on the basis of:

  • Atlas-image proximity — typed predicate over the canonical form’s distance to the 96-vertex Atlas image inside E₈. Realizable through SingletonCommitment<UltrametricCloseTo<K>> per ADR-048 + ADR-049 with target shape supplied by the application’s Atlas-image projection.

  • Exceptional-group orbit membership — typed predicate over the canonical form’s membership in a G₂ / F₄ / E₆ / E₇ / E₈ Weyl orbit. Realizable through SingletonCommitment<P> with P a Weyl-orbit-admission predicate.

  • Convergence-tower level-and-residual signature — typed predicate over the canonical form’s (ConvergenceLevel, ConvergenceResidual) pair. Realizable through compositions per AndCommitment<A, B> per ADR-048.

Each of these is a structural admission predicate, not an application-coded check; the application’s typed-commitment selection declares the codomain-typing the canonical form must satisfy.

(6) Conceptual-reading scope. ADR-059 is a conceptual-reading commitment over the foundation’s existing kernel::convergence module. The trait surface (ConvergenceLevel, HopfFiber, ConvergenceResidual, CommutativeSubspace, AssociativeSubalgebra) and the four instances at algebra dimensions {1, 2, 4, 8} are the substrate vocabulary; ADR-059 commits these as the codomain-structure encoding of κ-derivation in operator-geometry coordinates. The exceptional algebraic structures (G₂, F₄, E₆, E₇, E₈) and the Atlas-of-Resonance-Classes universal object are conceptual-model commitments; their realization in code is application-level (an exact-rational-arithmetic library admitted as a Layer-3 sub-crate per ADR-031’s demand-driven inclusion clause, or as a sibling library consumed by application code). No new substrate trait declarations, no new wire-format variants, no new SDK-macro discipline. The substrate-amendment-via-foundation rule per ADR-013/TR-08 is not engaged. The conceptual reading is normative for the wiki’s specification surface.

Consequences: The framework’s conceptual model gains an architectural commitment connecting the existing kernel::convergence trait surface to the codomain of κ-derivation. The convergence-machinery’s traits — previously documented at the component level but not connected to the framework’s compression-operator codomain at the conceptual-model level — are surfaced as the substrate’s encoding of operator-geometry codomain stratification. The four-level structure (R / C / H / O) at algebra dimensions {1, 2, 4, 8} acquires a normative reading: it is the coarse stratification of where canonical forms live in operator-geometry coordinates.

Cross-substrate convergence under compression is provable as a categorical theorem under ADR-058 + ADR-059: ADR-058 fixes the operator’s universality, ADR-059 fixes the codomain’s universality, and together they imply that any two conforming substrates compressing the same input land at the same Atlas-image position modulo Weyl-orbit equivalence. Substrate-independence under compression is thereby structurally determined, not empirically discovered.

Application-level typed-commitment surfaces per ADR-048 gain a codomain-typed vocabulary for canonical-form admission predicates. Atlas-image proximity, exceptional-group orbit membership, and convergence-tower level-and-residual signature become structural admission predicates rather than ad-hoc application-coded checks. The framework’s content-addressing commitment per ADR-017 + ADR-047 gains a categorical interpretation: content-addressing’s universality is the universal-factorization-through-the-initial-object-in-ResGraph property, expressed at the byte-coordinate level by the κ-label and at the operator-geometry-coordinate level by the Atlas-image position. The two levels are dual: byte-coordinate identity implies operator-geometry-coordinate identity up to Weyl-orbit equivalence under fixed hash-axis selection per ADR-047; operator-geometry-coordinate identity up to Weyl-orbit equivalence implies byte-coordinate identity under the σ-projection hardening axioms.

Use-case scope — the codomain-structure reading is generally applicable. ADR-059 is not a domain-specific commitment. Any PrismModel whose canonical forms admit operator-geometry-coordinate readings has its codomain structurally typed by the Atlas-image-inside-E₈ commitment. The following examples are illustrative, not exhaustive:

  • Bounded-complexity canonical forms — canonical forms whose constraint geometry admits no further factorization. Codomain: the full 96-vertex Atlas image. Examples include canonical forms at the R-level of the convergence tower (single-primitive irreducible leaves under maximum compression).

  • Pairwise-commutative canonical forms — canonical forms whose constraint geometry admits a CommutativeSubspace selection. Codomain: the F₄ image (Atlas / ± mirror symmetry). Two canonical forms in the same F₄ Weyl orbit are equivalent under the framework’s mirror-symmetry quotient.

  • Triple-associative canonical forms — canonical forms whose constraint geometry admits an AssociativeSubalgebra selection. Codomain: the E₆ or E₇ image (Atlas filtration or augmentation).

  • Full-octonionic canonical forms — canonical forms admitting the full Atlas-image structure under E₈. Codomain: the 240-root E₈ image with the 96-vertex Atlas as the universal-object distinguished subset.

  • Twelvefold-divisible canonical forms — canonical forms whose constraint geometry admits a Klein × ℤ/3 product structure. Codomain: the G₂ image (12 roots, the smallest exceptional group).

Rejected alternative 1: Commit only the convergence-tower’s coarse stratification (R / C / H / O) without the Atlas / exceptional-structure connection. Rejected — the convergence-tower alone carries the four-level structure but not the finer-grained codomain typing the exceptional structures provide. The categorical operations (product, quotient, filtration, augmentation, direct embedding) supply the finer structure that application-level typed-commitment surfaces consume per ADR-048; without the exceptional-structure connection, the codomain typing reduces to four-level binning. The framework’s commitment is at the structural-codomain level, not at the four-level-binning level.

Rejected alternative 2: Commit the Atlas / exceptional structures without the convergence-tower connection. Rejected — the convergence-tower is already encoded in the substrate via kernel::convergence; the Atlas / exceptional structures are the finer-grained extension of that encoding. Decoupling the two would create two parallel codomain-structure encodings, one in the substrate (the convergence-tower) and one at the conceptual model level (the Atlas / exceptional structures), without a unified architectural reading. The joint commitment unifies the two encodings as different levels of granularity over the same codomain structure.

Rejected alternative 3: Treat the codomain structure as application-level policy supplied by typed-commitment selections per ADR-048. Rejected — the codomain structure of κ-derivation is determined by the framework’s conceptual model, not by application choice. ADR-048’s typed-commitment surface admits application-supplied predicates over the codomain; the codomain’s structure is fixed by ADR-059. Without a framework-level codomain commitment, application-supplied predicates have no canonical structural target — each application would invent its own codomain typing, fragmenting the content-addressing universality property.

Rejected alternative 4: Restrict the commitment to specific exceptional groups (e.g., E₈ only, omitting G₂ / F₄ / E₆ / E₇). Rejected — the categorical construction is uniform: all five exceptional groups emerge from the Atlas via categorical operations; restricting to E₈ would obscure the universal-object reading the Atlas’s initiality in ResGraph provides. The full exceptional structure is necessary for the framework’s codomain commitment to be categorically complete. Applications whose canonical forms factor through smaller exceptional groups (G₂ via product, F₄ via mirror quotient) require the full structure for their codomain readings to be admissible.

Rejected alternative 5: Treat the connection to the exceptional algebraic structures and the connection to algorithmic-information-theoretic compression as separate ADRs at higher granularity (one per exceptional group; one per convergence-tower level). Rejected — the conceptual model gains coherence from joint commitment, not from per-element fragmentation. ADR-058 commits the operator’s identity at the framework’s compression-operator level; ADR-059 commits the codomain’s structure at the framework’s exceptional-algebraic-structures level. Sub-decomposition into per-element ADRs creates citation clutter without architectural reward; the two-ADR structure matches the operator / codomain duality.

Rejected alternative 6: Defer the codomain commitment indefinitely; admit the convergence-machinery’s substrate presence without a conceptual-model reading. Rejected — the convergence machinery is already part of the substrate per kernel::convergence; its conceptual-model reading is implicit rather than absent. Without ADR-059, the substrate’s convergence machinery carries no normative wiki-level interpretation, leaving the framework’s codomain-structure commitments under-articulated at the specification surface.

Rejected alternative 7: Require the Atlas / exceptional-structures realization to land in uor-foundation or in a Layer-3 standard-library sub-crate per ADR-031 as part of this ADR’s commitment. Rejected — ADR-059 is a conceptual-reading commitment; the realization of the Atlas and the exceptional structures as code is operational policy. An exact-rational-arithmetic library realizing the Atlas → E₈ embedding and the categorical-operation derivations of G₂ / F₄ / E₆ / E₇ may land as a Layer-3 standard-library sub-crate under ADR-031’s demand-driven inclusion clause, or may live as a sibling library consumed by application code. ADR-059 does not prescribe which; the conceptual commitment stands regardless of where the code realization lives.

Rejected alternative 8: Use a different universal-object encoding of the exceptional algebraic structures (the E₈ root system itself, the Leech lattice, the magic square of Lie algebras, the Freudenthal–Tits magic square). Rejected — the Atlas of Resonance Classes is the universal-object encoding the framework adopts: it is the initial object in ResGraph with the smallest vertex count (96) consistent with the categorical-operation derivation of all five exceptional groups, and it arises as the stationary configuration of an action functional, connecting the framework’s structural commitments to a variational principle. Alternative encodings either lose the categorical-completeness property (the E₈ root system alone does not provide the G₂ / F₄ / E₆ / E₇ derivations via Atlas-style categorical operations) or carry larger universal-object cardinalities without architectural reward.

ADR-060 — Source-polymorphic value carrier: removing the byte-width capacity caps and DefaultHostBounds, deriving the inline carrier width, admitting unbounded payloads

Status: Accepted. Supersedes ADR-037’s byte-width-cap family (branch (1)'s 11 byte-width constants); ADR-037’s structural-count, Witt/crypto, and catamorphism-trace constants and its branch (2) type-system impl-table caps are retained. Amends ADR-051 (the Term::Literal carrier), ADR-036 (the ψ-stage resolver trait surface), ADR-028 (route-output carrier), and ADR-041 (typed ψ-stage carriers). Refines how ADR-018’s capacity-completeness commitment is honored for byte widths.

Context: ADR-037 migrated 14 free-standing data-shape capacity caps plus the eight ψ-stage resolver output byte-buffer ceilings to HostBounds associated constants, with DefaultHostBounds carrying the foundation’s prior fixed values, so that an application could vary any capacity by declaring its own HostBounds impl. Downstream implementation experience proved the byte-width subset of that commitment unrealizable on stable Rust and fictional as declared:

  • The byte-width caps were a stable-Rust workaround, not an architectural commitment. The foundation pinned the catamorphism’s per-variant carrier buffer and the route input/output buffers at a single symmetric value (4096 bytes) because, absent the unstable generic_const_exprs feature, a const expression like max(ROUTE_INPUT_BUFFER_BYTES, ROUTE_OUTPUT_BUFFER_BYTES) is not admissible in array-length position. The 4096 figure names no mathematical or structural truth in the framework’s content (the Z/(2ⁿ)Z rings, the dihedral symmetry, the prism functor, the ψ-pipeline shape, and the σ-projection axis selection are all invariant under carrier byte width); it is purely an artifact of how byte-buffer carriers were declared in Rust.

  • Application-overridability was fictional. HostBounds declared the byte-width constants as associated constants, but the foundation’s internal carrier types (TermValue, the per-ψ-stage carriers) read the width through the default-impl path <DefaultHostBounds as HostBounds>::TERM_VALUE_MAX_BYTES, hardcoded to the default. Bumping the constant in an application’s HostBounds impl did nothing to the carrier sizes the foundation propagated through the catamorphism; the byte-width constants were read-only window dressing wherever the foundation’s internal types reached for them. The cap had propagated structurally through ~19 array-literal sites in the pipeline component plus the per-ψ-stage carriers in the enforcement component.

The fixed 4096-byte carrier blocks the framework’s universal-model-compiler scope: content-addressing of large structured payloads (model-weight container formats with multi-GB tensor-data sections; software-supply-chain attestation envelopes with embedded SBOMs; production canonical-JSON documents that routinely exceed 4096 bytes), verb bodies producing structured outputs above the cap, and audit-grade axes emitting full evidence transcripts rather than a single digest. The byte width of any single value carrier is properly an application concern (it depends on the application’s input domain, its acceptable stack/heap profile, and its deployment target — embedded MCU vs. server vs. WASM); the framework should expose carrier byte-width as a structural parameter the application controls or that the foundation derives from the application’s primitives, never a pinned literal.

Decision: ADR-060 commits the source-polymorphic carrier resolution under five principles — no contrived numbers, no defaults that hide a choice, no backward-compatibility shim, no application-policy byte-width ceiling on bounded carriers, and unbounded payloads first-class.

(1) TermValue becomes source-polymorphic and const-generic over its inline width. The fixed-buffer struct is replaced by

pub enum TermValue<'a, const INLINE_BYTES: usize> {
    /// Stack-allocated inline buffer carrying derived structural content
    /// (integer literals at any admitted Witt level; cryptographic digests
    /// at the application's hasher output width; the κ-label ASCII form;
    /// primitive-op single-value outputs).
    Inline { bytes: [u8; INLINE_BYTES], len: usize },
    /// Borrowed slice into an upstream byte source (input bytes, a sibling
    /// ψ-stage's scratch, an axis-kernel output region) — a 16-byte slice
    /// descriptor whose width as a carrier is independent of payload size.
    Borrowed(&'a [u8]),
    /// Chunk-emitting source for unbounded payloads (tensor-data sections,
    /// large signing payloads, multi-GB messages) — no byte-width ceiling.
    Stream(&'a dyn ChunkSource),
}

pub trait ChunkSource {
    /// Fold each chunk into the closure in canonical order; total folded
    /// byte count is unbounded; per-call slice lifetime (not retained).
    fn for_each_chunk(&self, f: &mut dyn FnMut(&[u8]));
    /// Total byte count if statically known, else `None`.
    fn total_bytes(&self) -> Option<usize> { None }
}

Term::Literal's value field carries the same 'a and INLINE_BYTES parameters; the Term enum and the catamorphism’s evaluate gain the lifetime and const-generic parameters, instantiated at the application boundary. This amends ADR-051: the wide-value carrier is no longer a single owned byte sequence but a source-polymorphic carrier whose inline form carries the wide literal and whose borrowed/stream forms carry structural and unbounded payloads.

(2) The inline width is foundation-derived, never declared. Applications instantiate TermValue at carrier_inline_bytes::<B>(), a foundation const fn computing the minimum admissible inline width from the application’s HostBounds primitives. The inline carrier must admit every value class that flows inline: an integer literal at the application’s maximum Witt level (WITT_LEVEL_MAX_BITS / 8 bytes), a cryptographic digest at the application’s maximum fingerprint width (FINGERPRINT_MAX_BYTES), and the κ-label ASCII serialization (HASHER_IDENTIFIER_BYTES + 1 + 2 × FINGERPRINT_MAX_BYTES — the hex-encoded digest doubles the fingerprint width). The derivation is the maximum over all three:

pub const fn carrier_inline_bytes<B: HostBounds>() -> usize {
    let witt_bytes = B::WITT_LEVEL_MAX_BITS as usize / 8;
    let kappa_bytes = HASHER_IDENTIFIER_BYTES + 1 + 2 * B::FINGERPRINT_MAX_BYTES;
    max3(witt_bytes, B::FINGERPRINT_MAX_BYTES, kappa_bytes)
}

The application has no opportunity to pick an arbitrary number; the foundation computes the width from primitives the application has already committed to. Per-TermValue stack-copy cost is the minimum the mathematical content admits, with no padding for hypothetical larger structural payloads (those flow as Borrowed or Stream). (Architectural note: the three-term maximum — including the κ-label width — is the self-consistent derivation; a two-term max(witt_bytes, fingerprint_bytes) form does not in general admit the κ-label, whose hex-doubled digest can exceed a fingerprint-sized buffer.)

(3) Bounded and unbounded payloads have no carrier-side byte-width ceiling. Borrowed references an upstream byte source whose lifetime the catamorphism propagates; its width as a carrier is mem::size_of::<&[u8]>(), independent of payload size. Stream references a dyn ChunkSource; its width is the dyn-trait descriptor size, also payload-independent. There is no carrier-side fixed allocation that depends on payload size, so there is no carrier-side ceiling to declare. The σ-projection at ψ_9 folds Stream chunks directly into the Hasher via Hasher::fold_bytes per ADR-022 D5; structural fold-rules read the chunks as a flat byte sequence via for_each_chunk.

(4) The 12 byte-width capacity constants and DefaultHostBounds are removed. HostBounds sheds TERM_VALUE_MAX_BYTES, AXIS_OUTPUT_BYTES_MAX, ROUTE_INPUT_BUFFER_BYTES, ROUTE_OUTPUT_BUFFER_BYTES, and the eight ψ-stage *_OUTPUT_BYTES_MAX ceilings (4 + 8 = 12). Each ψ-stage carrier’s byte width derives from a foundation const fn (nerve_carrier_bytes::<B>(), chain_complex_carrier_bytes::<B>(), …, k_invariants_carrier_bytes::<B>()) computing structural-element-count (the retained NERVE_SITES_MAX, NERVE_CONSTRAINTS_MAX, BETTI_DIMENSION_MAX, FINGERPRINT_MAX_BYTES, …) × foundation-fixed per-element wire width (SITE_DESCRIPTOR_BYTES, CONSTRAINT_DESCRIPTOR_BYTES, the per-stage wire-format header widths the SimplicialComplex / ChainComplex / … serializations pin per ADR-014 + ADR-020). Every previously-application-declared byte-width ceiling decomposes into an application-declared structural count × a foundation-fixed per-element width; the application declares only the counts. HostBounds drops from 26 associated constants to 14: the 4 pre-ADR-018 constants (FINGERPRINT_MIN_BYTES, FINGERPRINT_MAX_BYTES, TRACE_MAX_EVENTS, WITT_LEVEL_MAX_BITS) plus the 10 retained migrated constants (FOLD_UNROLL_THRESHOLD, BETTI_DIMENSION_MAX, NERVE_CONSTRAINTS_MAX, NERVE_SITES_MAX, JACOBIAN_SITES_MAX, RECURSION_TRACE_DEPTH_MAX, OP_CHAIN_DEPTH_MAX, AFFINE_COEFFS_MAX, CONJUNCTION_TERMS_MAX, UNFOLD_ITERATIONS_MAX). The type-system impl-table caps MAX_AXIS_TUPLE_ARITY / MAX_RESOLVER_TUPLE_ARITY (ADR-037 branch (2)) are separate and unaffected. DefaultHostBounds is removed: there is no "default" application, so the foundation supplies no default policy. Every application declares its own impl HostBounds, and every numeric constant the foundation honors at runtime traces to an application’s explicit declaration. The foundation supplies the const fn derivations that compute per-carrier sizes from the declared primitives; it does not supply default values for the primitives.

(5) The ψ-stage resolver traits return a TermValue; the streaming-σ-projection is foundation-level. The eight resolver traits per ADR-036 change from the writer-style fn resolve(&self, input: &[u8], out: &mut [u8]) → Result<usize, ShapeViolation> to fn resolve(&self, input: TermValue<'a, {carrier_inline_bytes::<B>()}>) → Result<TermValue<'a, {carrier_inline_bytes::<B>()}>, ShapeViolation>. The resolver constructs whichever carrier variant its output requires (Inline for structural identities that fit the derived inline width; Borrowed into resolver-owned scratch; Stream for unbounded structural sequences). The σ-projection (ψ_9 KInvariantResolver) dispatches on the carrier variant — Inline/Borrowed fold their bytes once, Stream folds chunk-by-chunk via for_each_chunk — and emits the κ-label, which is always Inline (its width is bounded by carrier_inline_bytes::<B>() by construction per principle (2)). The streaming-σ-projection is therefore a foundation-level surface every realization gains by returning TermValue::Stream from its canonicalization step; it is no longer a downstream realization-level workaround.

(6) Wholesale replacement, no shim. The 0.5.0 surface is the only surface: no #[deprecated] aliases, no migration wrappers, no evaluate_owned() fallback. Downstream code that held carriers across the catamorphism’s lifetime boundary restructures to hold the byte source for the needed lifetime, or materializes a Borrowed/Stream into an owned buffer via an alloc-gated TermValue::to_vec() helper (the only allocation surface, opt-in per caller). Declaring any removed constant (TERM_VALUE_MAX_BYTES, etc.) in a HostBounds impl is a compile error — the names no longer exist.

Consequences: The carrier byte width is architecturally grounded rather than pinned: the Inline width is the foundation-derived mathematical minimum, the Borrowed carrier carries structural payloads by reference with no copy and no ceiling, and the Stream carrier admits unbounded payloads with peak resident memory of carrier_inline_bytes::<B>() plus the chunk source’s internal state — never the full canonical byte sequence. Content-addressing of multi-GB inputs flows natively through the ψ-pipeline. HostBounds carries only constants the framework’s mathematical content cannot derive (13 application-policy primitives + the 4 pre-ADR-018 constants), and every byte width derives from those. The removal of DefaultHostBounds makes the architecture’s parametric-in-capacity commitment per ADR-018 load-bearing in fact rather than in name: there is no default impl whose constants the foundation silently reads instead of the application’s.

The wire format is unchanged. The κ-label, trace, and certificate serializations are byte-identical to the pre-0.5.0 surface (the σ-projection’s mathematical content is invariant under carrier byte width); the conformance corpus verifies the same reference κ-labels. The ψ-stage carriers (SimplicialComplexBytes, …) per ADR-041 are in-memory typed carriers threaded between stages, not wire-format types; their byte widths becoming derived rather than ceiling-capped does not touch the wire format. ADR-018’s commitment is honored more strictly than before — bounded carriers have no application-policy byte-width ceiling because their widths are derived, and unbounded payloads have no ceiling at all.

The framework’s mathematical content is unchanged. The contrived 4096 limit was an artifact of stable-Rust workarounds the foundation source documented as such; ADR-060 eliminates the artifact and replaces it with the carrier surface the framework’s mathematical content already implied.

Rejected alternative 1: Raise the cap to a larger fixed value (e.g., 1 MiB). Rejected — the magic number remains, just larger; it still blocks unbounded payloads (multi-GB tensor data) and still pins a byte width the framework’s content does not name. Per ADR-037 rejected-alternative-3, the commitment is no contrived byte-width cap, not a generous one.

Rejected alternative 2: Keep the byte-width caps on HostBounds but fix the foundation’s internal types to read the application’s impl rather than DefaultHostBounds. Rejected — this preserves application-declared byte-width ceilings, which (a) still cannot admit unbounded payloads (an application cannot declare a multi-GB inline buffer), and (b) re-introduce a per-application byte-width number that names no mathematical truth. The source-polymorphic carrier removes the need for any inline-buffer ceiling for bounded payloads (Borrowed) and unbounded payloads (Stream) alike, and derives the residual inline width for the values that genuinely flow inline.

Rejected alternative 3: Gate the const-generic carrier on the unstable generic_const_exprs feature so applications can size carriers by arbitrary const expressions. Rejected — the foundation commits to stable Rust; depending on an unstable feature is the very situation that produced the contrived 4096 workaround. The carrier_inline_bytes::<B>() derivation and the per-ψ-stage const fn derivations are admissible in array-length position on stable Rust because they are plain const fn calls on the application’s already-committed HostBounds constants, not generic_const_exprs arithmetic over generic parameters.

Rejected alternative 4: Retain DefaultHostBounds as an ergonomic convenience for applications whose capacities match the prior defaults. Rejected — a default that the foundation’s internal types silently read is exactly the mechanism that made byte-width overridability fictional. The load-bearing commitment is that every constant the foundation honors traces to an application’s explicit declaration; a default policy hides a choice the application must own. Applications wanting the prior values declare them explicitly in their own impl HostBounds.

Rejected alternative 5: Keep the writer-style resolver signature (&mut [u8] output + byte-count return) and add a separate streaming entry point for unbounded payloads. Rejected — two resolver surfaces fragment the ψ-stage contract and force every realization to choose between them per stage; the source-polymorphic TermValue return unifies bounded and unbounded outputs under one signature, with the carrier variant carrying the bounded/unbounded distinction. The σ-projection’s three-variant match is the single dispatch point.

Rejected alternative 6: Provide an evaluate_owned() fallback that materializes all carriers into owned buffers, preserving the pre-0.5.0 lifetime-free evaluate ergonomics. Rejected — a foundation-level owning fallback re-introduces allocation on the principal data path (violating the #![no_std]-without-alloc commitment) and hides the lifetime structure the source-polymorphic carrier makes explicit. Materialization is available as the opt-in, alloc-gated, per-caller TermValue::to_vec() helper, not as a foundation-level evaluation mode.

ADR-061 — Operational composition surface for κ-labels: compositions as realizations parameterized over the categorical operations on the Atlas image inside E₈

Status: Proposed. Builds on ADR-058 (κ-derivation as the framework’s compression operator) and ADR-059 (the operator-geometry codomain is the Atlas image inside E₈, with the exceptional Lie group structures G₂ / F₄ / E₆ / E₇ / E₈ as finer-grained codomain typing). Does not amend ADR-048 (the TypedCommitment closed three-impl set is retained as-is), ADR-049 (the ObservablePredicate closed catalog is retained as-is), or ADR-013 (no new substrate trait declarations, no foundation version bump). This is a prism-runtime-level decision: the surface lands as additions to prism’s standard type library per ADR-031; foundation and SDK are unchanged.

Context: ADR-058 + ADR-059 jointly commit a substantive structural reading of κ-derivation: it is the framework’s compression-to-canonical-form operator (ADR-058), its codomain in operator-geometry coordinates is the Atlas image inside E₈ (ADR-059), and the categorical operations on the Atlas — product (G₂), quotient (F₄), filtration (E₆), augmentation (E₇), direct embedding (E₈) — supply finer-grained codomain typing through which conforming canonical forms factor.

What ADR-058 + ADR-059 commit at the single-input level: every PrismModel admitting through κ-derivation produces a canonical form whose Atlas-image position is determined modulo Weyl-orbit equivalence; two conforming substrates processing the same input under the same model emit byte-identical κ-labels per TC-05 + ADR-058, landing at identical Atlas-image positions per ADR-059. What they do not commit is an operational surface for composing N canonical forms — taking N input values with κ-labels k_1, …, k_N and emitting a single κ-label k_composed naming the composition. The categorical operations on the Atlas supply the algebraic structure under which such composition is well-defined, but no ADR yet operationalizes them as a surface conforming applications can invoke.

The gap is concrete. Three example use cases the framework cannot express without ad-hoc concatenation conventions that import the byte-codomain pigeonhole framing ADR-058 + ADR-059 explicitly do not take: a media-container format (PNG, JPEG, MP4) embedding a model κ-label as content metadata cannot derive a joint κ-label naming the (media, embedded-model) composition; a document format (PDF) composes its κ-label per the document’s canonical form but cannot name the (document, transformation-chain) pair whose transformations are themselves κ-label-identified operations; a model κ-label, a prompt κ-label, and a sampler-configuration κ-label compose into a single inference-trace κ-label naming the (model, prompt, sampler) triple but the framework has no surface to emit it. In every case the application carries the components' κ-labels without a structural surface composing them. The pragmatic workaround — byte-concatenation through the σ-axis hash of the component κ-labels — imports the byte-codomain pigeonhole framing the framework explicitly does not take: ADR-059 commits the codomain to the Atlas image inside E₈ in operator-geometry coordinates (an algebraic structure with a composition law), not an opaque digest space with pigeonhole semantics. Composing κ-labels by byte-concatenation collapses the codomain’s algebraic structure and loses the operator-geometry-coordinate semantics ADR-059 commits.

What is required: a composition surface that honors ADR-059’s codomain structure, factors through the Atlas as the initial object in ResGraph, and admits the five categorical operations as the operation-selection vocabulary an application’s typed surface chooses among.

Decision: ADR-061 commits the operational composition surface under six principles — compositions are realizations (no new substrate primitive), the five categorical operations are each ConstrainedTypeShape s in prism’s standard type library (no foundation amendment), composition is bounded by the Categorical X regime split’s T = 3 / O = 8 (ADR-025 + ADR-059), composition is closed under the Atlas (the composed κ-label is itself a κ-label, recursively composable), σ-axis substitutability per ADR-047 propagates through composition, and cross-substrate composition universality lifts from the single-input case under ADR-058 + ADR-059 + ADR-061 jointly.

(1) Compositions are content-addressing realizations. A composition of N input values with κ-labels k_1, …, k_N under a categorical operation C is a value under a Layer-3 content-addressing realization (per ADR-031) whose typed-input shape is one of the five composition shapes declared in (2) — the shape identifies the operation. The realization’s canonicalize verb emits a canonical-form byte sequence determined by the shape’s specification and the component κ-labels; the σ-projection at ψ_9 produces the composed κ-label. The composition’s κ-label is therefore itself a κ-label under the standard κ-derivation discipline — universally derivable, content-addressable, cross-substrate convergent per TC-05 + ADR-058, landing at the shape-determined Atlas-image position per ADR-059. This commits no new substrate primitive: each composition shape is a typed-input shape consumed by the existing ψ-pipeline through the existing σ-projection; the categorical operation IS the shape (see (2)) rather than a separate parameter; the canonicalize verb is per-realization work an architect writes against the operation’s algebraic specification. The substrate-amendment-via-foundation rule per ADR-013/TR-08 is not engaged.

(2) The categorical operations are each ConstrainedTypeShape s in prism’s standard type library. The five categorical operations on the Atlas are each declared as their own ConstrainedTypeShape in prism’s standard type library per ADR-031, parametric over the component-label byte width:

  • G2ProductShape<COMPONENT_LABEL_BYTES> — the G₂-via-product construction (Klein quartet × ℤ/3 → 12 roots, rank 2 per ADR-059). G₂ is a product of two algebraic objects; the shape is binary by structural necessity, with SITE_COUNT = 2 × COMPONENT_LABEL_BYTES.

  • F4QuotientShape<COMPONENT_LABEL_BYTES> — the F₄-via-quotient construction (96 / ± mirror symmetry → 48 sign classes, rank 4). F₄ is a quotient of one Atlas structure under mirror symmetry; the shape is unary, with SITE_COUNT = COMPONENT_LABEL_BYTES; the composed κ-label addresses the operand’s equivalence class under the quotient, not the operand directly.

  • E6FiltrationShape<COMPONENT_LABEL_BYTES> — the E₆-via-filtration construction (64 degree-5 + 8 degree-6 vertices → 72 roots, rank 6). E₆ is a filtration of one Atlas structure by vertex degree; the shape is unary, with SITE_COUNT = COMPONENT_LABEL_BYTES + 1. The filtration is structure-preserving (not quotient-like): the canonical form retains the operand’s identity (COMPONENT_LABEL_BYTES bytes) annotated with a one-byte degree-partition tag identifying which of the two filtration groups (degree-5 or degree-6) the operand belongs to. The composed κ-label respects the filtration’s degree-partition by structural concatenation of the tag and the operand bytes.

  • E7AugmentationShape<COMPONENT_LABEL_BYTES> — the E₇-via-augmentation construction (96 vertices + 30 S₄ orbits → 126 roots, rank 7). E₇ is an augmentation of one Atlas structure with S₄-orbit data; the shape is unary, with SITE_COUNT = COMPONENT_LABEL_BYTES. The S₄ augmentation is canonical-form-internal: the operand is normalized to its S₄-orbit canonical representative; no additional bytes are prepended to the canonical form.

  • E8EmbeddingShape<COMPONENT_LABEL_BYTES> — the E₈-via-direct-embedding construction (φ: Atlas ↪ E₈ injective, adjacency-preserving → 240 roots, rank 8). E₈ is the direct embedding of the Atlas into the full root system; the shape is unary, with SITE_COUNT = COMPONENT_LABEL_BYTES — the universal target, any single operand factoring through E₈ without further algebraic constraint per ADR-059’s Atlas-as-initial-object commitment. The embedding is the identity on canonical-form bytes; the composed κ-label is distinguished from the operand’s κ-label by realization-IRI provenance, not by digest bytes.

The arity per shape is determined by ADR-059’s categorical-operation structure, not by an application-supplied const generic: G₂ is binary (a product); the other four are unary (operations on one Atlas structure). Multi-operand compositions of arity > 2 are iterated applications of these primitive shapes — e.g., a three-operand composition decomposes into two iterated G2ProductShape applications via ConstraintRef::Recurse per ADR-057 + principle (3). Each shape inherits the closure-under-foundation class IRI https://uor.foundation/type/ConstrainedType per ADR-017 — empty-CONSTRAINTS shapes share the foundation’s class IRI; instance identity flows through the Rust type system’s distinction between the five shapes and through the COMPONENT_LABEL_BYTES parameter selecting the σ-axis label width. The realization’s canonicalize verb determines the canonical-form bytes per the shape’s algebraic specification (lexicographic-min-first ordering of operand κ-labels for the symmetric G2ProductShape; mirror-class lex-min canonical representative for F4QuotientShape; degree-partition tag prepended to operand bytes for E6FiltrationShape; S₄-orbit lex-min canonical representative for E7AugmentationShape; identity on operand bytes for E8EmbeddingShape). The framework commits the constraint (the canonical form MUST reflect the operation’s algebraic identity and match the shape’s SITE_COUNT); the realization commits the exact rule, anchored by the operation’s algebraic identity in ADR-059.

(3) Categorical X bounds: T = 3, O = 8. The five primitive composition shapes admit at their natural arities (G₂ at arity 2; F₄ / E₆ / E₇ / E₈ at arity 1). Compositions of arity > 3 decompose via ConstraintRef::Recurse per ADR-057 into a composition tree whose internal nodes are iterated applications of the primitive shapes (typically G2ProductShape for binary combination) and whose leaves are component κ-labels. The arity-3 bound is the H-level’s triple associativity per ADR-059’s convergence tower; the depth bound d ≤ 8 is the O-level’s algebra dimension. These are the same T = 3 (triple-interaction) and O = 8 (octonionic algebra-dimension) constants the Categorical X regime split commits at the substrate layer per ADR-025; ADR-061 inherits them at the composition layer. The bounds are structural, not heuristic: arity > 3 surrenders the H-level’s associativity identity per ADR-059’s descent commitment, silently breaking the codomain’s algebraic structure; depth > 8 exceeds the O-level’s algebra dimension — there is no codomain coordinate at which the composition would land. Each internal node is itself a composition under ADR-061; the recursion’s bracketing is the application’s commitment, expressed through the recursion-descent bound per ADR-057.

(4) Composition is closed under the Atlas as the initial object in ResGraph. For any composition under ADR-061, the composed κ-label factors through the Atlas image inside E₈ per ADR-059’s initiality theorem, the factorization unique up to E₈ Weyl group symmetry per the Atlas → E₈ embedding’s uniqueness theorem. Two compositions producing canonical forms at the same Atlas-image position modulo Weyl-orbit equivalence emit equivalent composed κ-labels under fixed σ-axis selection per ADR-047; compositions whose operands factor through the Atlas in the same way under the same operation emit byte-identical composed κ-labels. Closure under the Atlas is what makes the composed κ-label recursively composable: it is itself a κ-label landing at an Atlas-image position, and can compose with other κ-labels under any of the five categorical operations to produce a further composed κ-label. The framework’s content-addressable surface becomes closed under composition.

(5) σ-axis substitutability propagates through composition. The composition’s σ-axis selection per ADR-047 propagates to the composed κ-label: a SHA-256 composition of SHA-256 κ-labels emits a SHA-256-prefixed composed κ-label; the same composition under BLAKE3 emits a BLAKE3-prefixed composed κ-label. Composition does not fix a single σ-axis; the application’s hash-axis selection determines the composed κ-label’s byte form. The Atlas-image position is unchanged across σ-axes per ADR-059’s codomain-universality commitment.

σ-axis homogeneity is required within a composition: all operand κ-labels of a composition share the composition’s σ-axis. Operands derived under different σ-projection functions live in different codomain spaces (each σ-axis is a distinct projection from ψ-canonical-form bytes to operator-geometry coordinates); composing operands derived under different σ-projection functions would require a cross-σ-axis bridge between codomain spaces that ADR-061 does not commit. Applications wanting to compose κ-labels derived under different σ-axes first re-derive their content under a common σ-axis through the appropriate realization.

(6) Cross-substrate composition universality holds jointly. Two conforming substrates composing the same inputs under the same composition shape, σ-axis, and realization emit byte-identical composed κ-labels. The cross-substrate convergence theorem from ADR-058 + ADR-059 lifts to compositions under ADR-061: the single-input operator is universal (ADR-058), the single-input codomain is universal (ADR-059), and the composition operation is universal (this ADR). The composed κ-label’s byte-output is structurally determined by the input κ-labels, the composition shape, the σ-axis, and the realization — nothing else.

Substrate footprint. ADR-061 commits the composition surface as an operational addition with the following footprint. Foundation: no changes — the TypedCommitment closed three-impl set per ADR-048 is retained as-is, the ObservablePredicate closed catalog per ADR-049 is retained as-is, the ConstraintRef variants per ADR-057 are unchanged, the kernel::convergence trait surface per ADR-059 is unchanged; no new substrate trait declarations, no new wire-format variants, no wire-format version bump. SDK: no changes — no new SDK macros or admission rules; axis!, verb!, prism_model!, partition_product!, register_shape!, and the rest are unchanged. Prism: additions to the standard type library only — five ConstrainedTypeShape impls (G2ProductShape<N>, F4QuotientShape<N>, E6FiltrationShape<N>, E7AugmentationShape<N>, E8EmbeddingShape<N>), each parametric over the component-label byte width, satisfying the standard-type-library inclusion criteria per ADR-031 (built on foundation primitives, application-neutral, content-addressed via the closure rule, compile-time stable, #![no_std]-clean); no new top-level prism modules; each shape’s rustdoc references the conceptual ADR-059 vocabulary, with the algebraic structure living in the conceptual model rather than the substrate. Realization layer: a content-addressing realization implements the canonicalize verb for each of the five shapes per its specification; the Lean conformance discipline applies per the existing per-realization pattern (κ-derivation, algebraic-closure, typed-input, and verb-discipline theorems plus one per-shape theorem establishing the operation’s algebraic identity, factor-through-Atlas, and σ-axis substitutability), σ-axis-parametric per the existing hash-axis discipline. Wiki: this ADR; no amendments to ADR-058, ADR-059, or ADR-060.

Consequences: The framework gains an operational surface for composing κ-labels under ADR-059’s codomain structure. Realization architects whose realizations compose (media containers embedding models, document attestation chains, inference traces) gain a structural surface for emitting joint κ-labels naming the composition rather than only the components; the composition’s algebraic structure (associativity at arity 3, arity/depth bounds, factor-through-Atlas) is determined by ADR-059’s codomain structure, not by ad-hoc application convention. Cross-substrate composition universality joins cross-substrate single-input convergence as a categorical theorem under ADR-058 + ADR-059 + ADR-061 jointly. The framework’s content-addressable surface is closed under composition: every composed κ-label is itself a κ-label, recursively composable.

The ConstraintRef::Recurse discipline per ADR-057 acquires a new application pattern — a composition tree decomposing a wide-arity or deep composition into bounded sub-compositions over the primitive shapes, with ADR-057’s application-declared descent bound capping the composition tree’s depth and preventing pathological unbounded composition recursion. The foundation’s register_shape! SDK macro per ADR-057 admits any of the five composition shapes' Recurse-bearing specializations the same way it admits any other Recurse-bearing shape. Application-level typed-commitment surfaces per ADR-048 acquire a composition-aware vocabulary without any change to ADR-048’s surface: applications declaring their C: TypedCommitment over composed κ-labels use the same SingletonCommitment<P> / AndCommitment<A, B> discipline as for non-composed κ-labels; the composition’s operation is upstream of the commitment evaluation, not part of it.

Decomposition — the inverse operation taking a composed κ-label back to its component κ-labels — is realization-architect work, not framework-level work, because it requires the realization’s canonicalize-verb inverse, which is per-shape (G2ProductShape decomposes by recovering the operands from the canonical lexicographic order; E6FiltrationShape by recovering the degree partition; etc.). The framework supplies the contract — given a composed κ-label and which of the five composition shapes produced it, the realization architect’s inverse reproduces the component κ-labels — without committing to a substrate-level decomposition primitive.

Use-case scope — the composition surface is generally applicable; ADR-061 is not a domain-specific commitment. Any application whose canonical forms admit composition under one of the five categorical operations emits joint κ-labels through ADR-061’s surface. The following examples are illustrative:

  • Media-format compositions — a media-format realization emits its κ-label per the format’s canonical form; an embedded model κ-label per a model-container realization is a separate κ-label; the composition under G2ProductShape (G₂ product over two independent operands) emits the joint κ-label naming the (media, model) pair.

  • Document attestation chains — a document-format realization emits its κ-label per the document’s canonical form; the transformation pipeline producing it is a sequence of κ-label-identified code-module operations; the composition under E6FiltrationShape (E₆ filtration over the degree-partition the transformation chain induces) emits the κ-label naming the document under the filtration the transformation imposes.

  • Inference traces — a model κ-label composes with a prompt κ-label under G2ProductShape to yield an intermediate joint κ-label; that joint κ-label composes again with the sampler-configuration κ-label under a second iterated G2ProductShape per ADR-057 recursion, yielding the trace κ-label naming the (model, prompt, sampler-config) triple.

  • Route-declaration shapes — a route-declaration shape composes its component κ-labels (target, signature κ-label, commitment-root κ-label) under iterated G2ProductShape applications to yield the route’s own κ-label.

In each case the composition’s algebraic structure is determined by ADR-059’s codomain commitment for the chosen operation, not by an application-level concatenation convention.

Rejected alternative 1: Byte-concatenation composition through the σ-axis hash. Composing κ-labels by concatenating their byte sequences and σ-projecting through the chosen σ-axis. Rejected — it imports the byte-codomain pigeonhole framing ADR-058 + ADR-059 explicitly do not take; the codomain has algebraic structure per ADR-059, and byte-concatenation collapses it.

Rejected alternative 2: Tree-hash composition. Composing κ-labels via a Merkle tree whose leaves are the input κ-labels and whose root is the composed κ-label. Rejected for the same reason — tree-hash is structurally equivalent to byte-concatenation through the σ-axis hash and does not respect ADR-059’s codomain structure. The CommitmentAxis per ADR-031 (prism-crypto) supplies tree-hash commitments for applications that genuinely need them; those are not compositions under ADR-061.

Rejected alternative 3: Composition fixed at a single categorical operation (always E8EmbeddingShape, the universal target, regardless of operand structure). Rejected — different application semantics demand different operations: media-embedded-models want product (independent components); document-from-source-chains want filtration (degree-partition structure); etc. Fixing one operation forces every application onto a single semantics, which is not what ADR-059’s codomain structure provides.

Rejected alternative 4: Composition as a new substrate primitive (a Composition { op_iri, components } ConstraintRef variant, a CompositionAxis on the foundation’s axis-extension surface, or five new TypedCommitment variants). Rejected — the composition is expressible as a typed-input shape consumed by the existing ψ-pipeline through the existing σ-projection; adding substrate primitives would amend the foundation’s closed sets per ADR-048 + ADR-049 without architectural necessity.

Rejected alternative 5: Composition as a new prism extension axis (a CompositionAxis: AxisExtension whose dispatch_kernel takes N κ-labels and emits a composed κ-label). Rejected — AxisExtension's kernel surface is byte-level (&[u8] in, &mut [u8] out, byte-count return per the foundation’s pipeline surface); it does not naturally express "N typed κ-labels in, 1 typed κ-label out," and the shape mismatch would force an awkward byte-flattening at the axis interface or a parallel non-axis surface. The realization-as-typed-input-shape path avoids both.

Open questions. (a) Per-shape Lean formalization. Each of the five composition shapes requires Lean theorems establishing the per-shape canonical form is well-defined, the operation’s algebraic identity holds (G₂ commutativity for G2ProductShape at arity 2; quotient-equivalence for F4QuotientShape; etc.), and the factor-through-Atlas commitment holds; the framework supplies the contract, each shape’s proofs are realization-architect work, σ-axis-parametric per the existing hash-axis discipline. (b) Decomposition under TC-05 trace replay. A composition’s trace contains the component traces as sub-traces; TC-05 replay must reconstruct each component’s κ-label before reconstructing the composite. The replay-completeness theorem lifts to compositions, but the formal statement is realization-architect work depending on the composition realization’s verb-body design. (c) Per-shape canonical-ordering rules. Each shape’s canonicalize verb commits a canonical ordering for its operand κ-label(s); the exact form is the realization architect’s commitment, anchored by the operation’s algebraic identity in ADR-059. (d) Atlas-image-position observable. Whether a composed κ-label’s Atlas-image position admits as a new ObservablePredicate per ADR-049’s closed catalog (e.g., an AtlasImagePosition predicate) is a separate ADR question; ADR-061 does not commit to extending ADR-049’s catalog. The existing UltrametricCloseTo<P> observable per ADR-049 is the closest available primitive for Atlas-image-proximity admissions; whether it suffices for composition-aware applications is open.

Clone this wiki locally