Leverage-Driven Software Architecture: A Probabilistic Framework for Architectural Decision-Making
Abstract
The axis orthogonality paper (Paper 1) and the Single Source of Truth paper (Paper 2) establish necessary conditions for coherent software architecture: axis orthogonality and DOF = 1 per fact. Among architectures satisfying these constraints, this paper proves the optimization criterion is computable and decidable: maximize leverage L = |Capabilities|/DOF. The axis orthogonality paper proves minimal complete axis sets are orthogonal for classification systems. The SSOT paper proves DOF = 1 is necessary and sufficient for epistemic coherence. These establish the constraint space for coherent architectures. This paper derives the optimization criterion within that space. We prove seven theorems (machine-checked, 0 sorries). Error Independence (Theorem 3.1): axis orthogonality implies statistical independence of errors across DOF, derived from matroid theory. Error Compounding (Theorem 3.3): for a system with n DOF and per-component error rate p, system error probability is P_error(n) = 1 - (1-p)^n, following from the SSOT paper's coherence theorem. DOF-Reliability Isomorphism (Theorem 3.4): an architecture with n DOF is isomorphic to a series reliability system with n components, preserving failure probability ordering. Leverage-Error Tradeoff (Theorem 4.1): for architectures with equal capabilities, higher leverage strictly implies lower error probability. Modification Complexity Gap (Theorem 4.2): for architectures with equal capabilities, the expected modification ratio equals the DOF ratio, growing unbounded. Optimal Architecture (Theorem 4.3): given requirements R, architecture A* minimizes error probability iff it satisfies feasibility and maximality constraints, yielding a decidable criterion. Metaprogramming Dominance (Theorem 4.4): for metaprogramming architectures with DOF = 1 and unbounded derivations, leverage approaches infinity. The three papers form a complete framework. The axis orthogonality paper's orthogonality result enables our error independence result (Theorem 3.1). The SSOT paper's coherence requirement enables our error compounding result (Theorem 3.3). Given constraints from the prior papers, we prove leverage maximization minimizes error probability (Theorem 4.1). Three instances demonstrate integration. For SSOT vs scattered architecture with n use sites, SSOT achieves L = c while scattered achieves L = c/n, yielding unbounded leverage ratio. For nominal vs duck typing, the axis orthogonality paper's four additional capabilities (provenance, identity, enumeration, conflict resolution) yield L_nominal = (c + 4)/d > c/d = L_duck with equal DOF. For microservices vs monolith with n services of c capabilities each, monolith achieves L = nc while microservices achieve L = c, yielding n× leverage advantage. Given coherence as a requirement, architectural choice becomes deterministic. The optimization criterion L(A) = |Cap(A)|/DOF(A) is decidable, the optimal architecture is unique up to isomorphism, and preference dissolves into mathematical necessity. OpenHCS PR #44 validates the framework: migrating from duck typing (47 scattered checks, DOF = 47) to nominal ABC (1 definition, DOF = 1) increased leverage 47× and improved error localization from Ω(n) to O(1). Lean 4 formalization: 741 lines, 35 theorems, 0 sorry. Applies theorems established in the axis orthogonality paper and the SSOT paper to derive leverage optimization criterion.
Fields of Study & Subjects
Software Reliability and Analysis Research
Formal Methods in Verification
Advanced Software Engineering Methodologies
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 3 January 2026