Surface PrismModel + categorical structures (ADR-019, ADR-020)
Two related additions that name the structures already present in the
architecture and surface the developer's contract for declaring an
application as a typed iso between input features and output labels.
ADR-019 — Foundation is a closed signature endofunctor; `Term` is
its initial algebra; `pipeline::run` is the catamorphism.
The wiki has stated TC-01 (zero-cost runtime) and ADR-013 (closure
under uor-foundation's vocabulary) as separate properties. They are
not separate; they are two halves of one categorical theorem:
closure makes F's signature complete; completeness lets the
catamorphism be discharged at the application's compile time
(TC-04, UORassembly); zero-cost follows. Stating the theorem in its
native vocabulary lets later commitments compose against initiality
+ uniqueness + completeness rather than re-establishing them.
The vocabulary uor-foundation gains is editorial: signature
endofunctor, F-algebra, initial algebra, catamorphism, anamorphism,
fixed point. None names a new runtime concern; each names a
structure already present. Naturally extends ADR-007's three-position
substrate-vs-implementor pattern: foundation defines the signature
endofunctor and initial algebra; prism declares the bound (the
F-algebra contract any Route satisfies); the application author
selects the F-algebra by writing the model.
ADR-020 — `PrismModel` is the application author's contract for
declaring a typed iso between input features and output labels.
Without a trait, the categorical structure exists but is not
actionable: developers assemble ConstrainedTypeShape impls, pick
substitution-axis selections, and write hand-rolled Rust to compose
them, with no type system enforcing that the composition is the
unique homomorphism the architecture demands. Real-world Prism
applications observed in the field exhibit exactly this failure
mode (the operations are foundation-vocabulary; the composition is
hand-rolled outside the type system).
`PrismModel` carries Input, Output, Route associated types and
forward(input) -> Grounded<Output>. Route's bound is closure under
foundation vocabulary, checked at the application's compile time
(TC-04, ADR-006). forward is the catamorphism prism derives from
Route via initiality of Term (ADR-019); the application author does
not write forward's body. The framing the developer reads is
Real-Time Inference; the framing the architecture supports
underneath is the categorical iso. Both framings are the same
statement.
Naming considered: Prism (collides with crate name + optic
concept), Model (ML connotation: parameterized weights, training),
Inference (names the runtime behavior, not the declaration), Route
(names a Route component, not the whole iso). Settled on PrismModel
as the conjunction with no overload.
Edits:
- src/arc42/adoc/08_concepts.adoc: two new top-level sections —
"Foundation as a Signature Category" (signature endofunctor,
initial algebra, catamorphism, anamorphism, fixed points, the
closure+TC-01 unification) and "PrismModel" (contract,
compilation as monomorphism, Real-Time Inference framing, replay
side).
- src/arc42/adoc/05_building_block_view.adoc: new PrismModel row in
the prism container's Level 3 component table; prism black-box
description's author-interface row updated to lead with the
PrismModel trait; layered-structure paragraph updated to describe
PrismModel sitting at the top of the runtime stack.
- src/arc42/adoc/09_architecture_decisions.adoc: appended ADR-019
(signature category) and ADR-020 (PrismModel) after ADR-018, each
with three rejected alternatives.
- src/arc42/adoc/12_glossary.adoc: 8 new entries — Anamorphism,
Catamorphism, F-algebra, Fixed point, Initial algebra, PrismModel,
Real-Time Inference, Signature endofunctor — placed alphabetically.
Verification: ./scripts/build.sh complete, all 8 validators PASS,
Stage 5 idempotence holds, ./tests/run-all.sh PASS (59 tests). No
incidental SVG churn (the timestamp-stripping work makes C4 SVGs
deterministic across builds).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>