ADR-055: universal substrate-Term verb body discipline — fold-fusion guaranteed for every axis impl via type-system enforcement
Implementer experience proved the standard-library-only scope of ADR-054's
canonical axis impl body discipline (ADR-054 RA2) load-bearing for prism's
fold-fusion guarantee. An application-author custom axis with an
arbitrary-Rust body produces a Term::AxisInvocation whose body the
catamorphism cannot reach; the structural-inference guarantee per
ADR-001 + ADR-019 fails at that axis's surface; C2's "one Rust function
per forward invocation" claim is provisional, not universal.
ADR-055 supersedes ADR-054 RA2 with a universal commitment enforced at
compile time:
- Foundation declares the sealed `SubstrateTermBody` supertrait on
`AxisExtension`. Every axis impl (standard-library AND application-
author custom) MUST provide a `body_arena() -> &'static [Term]`
accessor returning the Term arena slice the kernel decomposes to.
- The catamorphism's `Term::AxisInvocation` fold-rule per ADR-029
recursively folds the axis impl's `body_arena()` slice rather than
calling an opaque kernel function. Fold-fusion's structural reach
extends to the leaf level across every axis surface for every axis
impl.
- The `axis!` SDK macro per ADR-030 + ADR-052 extends with a normative
`body` clause; the macro emits both `AxisExtension` and
`SubstrateTermBody` impls together. Axes lacking a `body` clause fail
to satisfy the supertrait bound and fail to compile.
- ADR-010's arbitrary-Rust Hasher carve-out is amended: HashAxis impls
(per ADR-031's HashAxis-from-prism-crypto framing) are axis impls and
follow the universal discipline. Standard-library impls already
satisfy this per ADR-054's canonical discipline; application-author
custom Hashers provide a `body` clause too.
Migration: pre-ADR-055 axes with arbitrary-Rust kernels have two paths
per ADR-019's initial-algebra commitment: (1) decompose to substrate
Terms via the closure-body grammar; (2) move the off-substrate kernel
out of the axis surface to a host-boundary wrapper around
`forward(input)`. No third option — operations that cannot be expressed
in substrate Terms are not prism operations.
Updates across the wiki for consistency:
- §4 Strategic Decisions row updated to reflect universal scope and
drop the standard-library-only framing.
- §8 Closure Across Layers concluding paragraph updated similarly.
- Conceptual Model intro C2 mechanism updated; "structurally guaranteed
by the type system, not aspirational."
- ADR-013/TR-08 substrate-amendment paragraph + typed-iso surface
consolidation paragraph extended with ADR-055.
- TR-20 rewritten: discipline regression is now a compile-time error,
not a runtime / inclusion-criterion concern. Migration risk for
pre-ADR-055 axes documented.
- ADR-054's Rejected alternative 2 marked `(*superseded by ADR-055*)`
with the supersession reasoning preserved per the
feedback-implementer-loop discipline.
- Glossary: new `SubstrateTermBody` trait entry; `Substrate-Term verb
body` entry updated for universal scope.
Wire format unchanged. All 8 validators pass on clean rebuild.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ADR-054: Fold-Fusion Principle + ADR-031 amendments + Conceptual Model C2 mechanism
ADR-054 names fold fusion as the architectural mechanism that
realizes C2 (zero runtime movement per inference per the Conceptual
Model's cost commitments). Every prism transformation — verb-body,
prism_model route, resolver body, standard-library canonical
axis-impl body — is a folding operation, and the catamorphism's
initial-algebra universal property (ADR-019) fuses composed folds
into one Rust routine per substitution-axis selection.
Three fusion layers stack:
(1) Macro-expansion fusion — verb-call sites lower to Term
subtrees at proc-macro expansion (ADR-024); the verb-call
walker is absent at run time.
(2) Catamorphism fusion — per-variant fold-rules (ADR-029) compose
universally per the initial-algebra property; there is no
choice about how to fuse them.
(3) Monomorphization fusion — per-substitution-axis-selection
Rust routine has no dynamic dispatch and no allocation (TC-01);
LLVM inlining collapses per-variant dispatch with fold-rule
bodies into straight-line code.
Standard-library canonical axis impl body discipline: every published
canonical impl carries a substrate-Term verb body, so the
catamorphism's structural reach has no opaque axis-kernel boundary
inside the published canonical surface. Application-author custom
axis impls retain ADR-010's arbitrary-Rust permission.
Substrate-Term realization examples cover the operation-space
dichotomy: prism-numerics (algebraic/laws-structured — modexp_p,
polyeval, gcd, ext_euclidean, field_<op><P>, fma, newton_step, horner)
and prism-crypto (cryptographic/iteration-structured — SHA-2, SHA-3,
BLAKE3 compression rounds as substrate-Term W32/W64 ops + rotate).
Both reduce to fold compositions under the principle.
ADR-031 amendments per the implementer patch:
- "Application-neutral within domain" → "Application-neutral" with
substrate-faithful framing (conventional groupings are
presentation conventions, not architectural partitions).
- Roster reframed as operational organization, not architectural
commitment: reorganizing the roster is admissible operational
policy so long as the disciplines (ADR-024 closure, ADR-017
content-addressing, ADR-031 conformance, ADR-054 body discipline)
are preserved.
- New "Conventional shape and axis naming" section: BigInt<MaxBits>,
FixedPoint<I,F>, Tensor<Element,Shape>, Digest<N>, etc. are
conventional aliases for substrate-level ConstrainedTypeShape
constructions.
- New "Canonical axis impl body discipline" section per ADR-054.
- Deduped resolver-baselines paragraph; second occurrence updated
to drop "application-neutral-within-domain" → "application-neutral".
ADR-013 substrate-amendment paragraph + typed-iso consolidation
extended with ADR-054 (not a substrate amendment — names a property
the architecture already realizes; only substrate-adjacent change is
the canonical axis impl body discipline on ADR-031's inclusion
criteria). Conceptual Model intro's C2 commitment now points to the
Fold-Fusion Principle as its structural mechanism, and SD2
Principal Data Path narrative carries the same cross-reference.
Glossary entries added: Fold-Fusion Principle, Substrate-Term verb
body. Folding-transformation entry updated to cross-reference
ADR-054. Standard-library sub-crate entry updated to reflect the
roster's operational (not architectural) framing.
All 8 validators pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add ISO standard links + source info to OPM and Lifecycle chapters (issue #8)
Per issue #8 (RobinWikoff), pages referencing ISO standards previously
named the standard without a clickable link or full edition/source
metadata. Added:
Conceptual-Model page (OPM, ISO 19450):
- Linked ISO/PAS 19450:2015 to iso.org/standard/62274.html and
ISO 19450:2024 (Second edition) to iso.org/standard/83454.html.
- Added ICS codes (25.040.40, 35.240.50) and an explicit pointer
to the wiki's pinned EBNF transcription at tools/iso-19450-opl.ebnf.
- Cited supplementary sources: Dori 2002 (CAiSE) and Dori 2016
(Springer) — the canonical OPL production rules pre-dating the
ISO standard and the published textbook treatment.
- Linked the iso.org/obp free preview for Clauses 1–3.
- Noted the standard's patent acknowledgment per ISO/PAS 19450:2015
Foreword.
Lifecycle pages (ISO/IEC/IEEE 15288), four chapters covering
Clauses 6.1, 6.2, 6.3, 6.4:
- Added a `[NOTE]` block at the top of each chapter linking
ISO/IEC/IEEE 15288:2023 to iso.org/standard/81702.html, naming
the full title, edition, ICS code (35.080), supersession
relationship, and joint publication by ISO, IEC, and IEEE.
- Linked the iso.org/obp free preview.
All 8 validators pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Conceptual Model: ISO 19450 framing + cost-model establishment + per-OPD narratives
The conceptual model chapter previously rendered as six bare
OPD-plus-OPL pairs with a one-line preamble. Two structural problems:
(1) no normative context tied each OPD back to ISO 19450's vocabulary
or the arc42 chapters that elaborate it; (2) the OPM model derived from
prism's architecture, when the conceptual model must instead establish
the cost-model that architecture and implementation uphold.
Both addressed:
- src/opm/intro.md establishes the normative ISO 19450 framing
(ISO/PAS 19450:2015 + 2024 second edition; §6 OPD; §7 OPL; §8
generic OPM ontology; bimodal-equivalence principle V6/V7
enforce) AND names four cost-model commitments (C1–C4) the
conceptual model establishes for prism:
- C1: Operational cost = declared bandwidth at equality
(Hardening Principle U6 per ADR-047; Lean tight-bound theorem).
- C2: Zero runtime movement per inference (per-invocation cost is
O(1) + K·t_eval; no allocation, no dyn, no runtime-unknown
loop bounds; #![no_std] posture).
- C3: Structural inference, not search (ψ-residuals discipline per
ADR-035 + scope clarification per ADR-046; host-boundary
retry is external to the catamorphism's per-invocation
contract).
- C4: σ-projection axis qualification is conceptual (U1–U6 axioms
per ADR-047; empirical witness through axis::cryptanalyze
per ADR-049; foundation CI enforces).
- src/opm/<SD>/narrative.md for each of the six OPDs (SD,
SD1-Prism-Structure, SD2-Principal-Data-Path, SD3-Verification,
SD4-UORassembly-Enforcement, SD5-Distribute-and-Run) carries:
- OPD kind per ISO 19450 §6.5 (System Diagram / in-zoom).
- Architectural commitment with explicit ADR cross-references.
- Which of C1–C4 the OPD upholds and how.
- ISO 19450 vocabulary used (consists of, exhibits, requires,
yields, invokes, handles, affects), each cited to §7.3.X.
- Arc42 cross-reference to the chapter elaborating the OPD.
- scripts/render-opm-index.sh extended to inject the optional
top-level src/opm/intro.md after the page heading and the
optional per-SD src/opm/<SD>/narrative.md after each OPD's
heading. Backward-compatible: SDs without narrative.md render
as before (no narrative block). OPL syntax and OPD-OPL coherence
validators (V6/V7) are unaffected — they operate on opl.txt and
opd.svg only.
All 8 validators pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>