EP-0195: Canonical Core Consolidation & Verification Suite Alignment¶
| Field | Value |
|---|---|
| EP | 0195 |
| Title | Canonical Core Consolidation & Verification Suite Alignment |
| Author | Eran Rivlis eran@rivlis.info, Antigravity |
| Sponsor | Council Framework |
| Delegate | 🧩 Russell (Taxonomy & Rigor), ✂️ Shannon (Parsimony), 🧪 Popper (Falsifiability) |
| Status | Final |
| Type | Standards Track |
| Created | 2026-11-04 |
| Updated | 2026-11-04 |
| Replaces | — |
| Superseded-By | — |
Abstract¶
This proposal enacts the recommendations of EXP-0007: Canonical Surface Consolidation & Zero-Alias Purge across the
core engine (src/algebrax/) and verification test suite (tests/). It purges all 14 identified backward-compatibility
aliases, duplicate re-exports, and legacy facade modules, establishing a strict One Concept = One Canonical Symbol =
One Canonical Module invariant. Concurrently, all 622 tests in tests/algebrax/ and tests/verifications/ are
refactored to exercise canonical symbols directly, ensuring 100% green CI test execution without relying on transitional
shims.
Motivation¶
During Phases 1 through 6, rapid promotions of algebraic structures left behind compatibility sediment:
- Multi-Protocol Structures under Multiple Aliases:
DualNumberAlgebra,PolynomialAlgebra, andCliffordAlgebraare currently re-exported as*Semiringand*Ring, confusing users as to whether these are distinct types. - Protocol Synonym Duplication:
CommGroup,CommMonoid, andCommRingcoexist with English synonyms (AbelianGroup,CommutativeMonoid,AbelianRing,CommutativeRing), diluting our commitment to Lean 4 Mathlib nomenclature. - Ghost Facades:
src/algebrax/homology.pyexists solely as a 92-line duplicate facade overalgebrax.topology, causing 15 test files to bypass the canonicalalgebrax.topologypackage. - Tooling Redundancy:
src/algebrax/verify.pyduplicates functionality already provided byalgebrax.verificationandalgebrax.__main__.
Because algebrax is in pre-v1.0 development, backward compatibility shims serve only our own internal test suite.
Maintaining them creates technical drag before embarking on Phase 7 (Categorical Foundations & Enriched Matrices).
Rationale & Council Alignment¶
- Bertrand Russell (Unique Designation): Rejects linguistic synonyms in a formal system. A mathematical structure must have a unique identifier.
- Claude Shannon (Minimal Entropy): Removing redundant aliases eliminates cognitive and computational noise from module namespaces and autocomplete indexes.
- Karl Popper (Strict Verification): Tests must exercise the canonical public interface, not backward-compatibility scaffolding.
- The Golem (Defensive Execution): Pre-v1.0 is the only window for zero-debt breaking cleanups without external disruption.
Specification¶
1. Engine Cleanups (src/algebrax/)¶
The following aliases and files will be removed or consolidated:
| Target File | Removed Alias / File | Canonical Replacement |
|---|---|---|
src/algebrax/clifford.py |
CliffordSemiring = CliffordAlgebra |
CliffordAlgebra |
src/algebrax/clifford.py |
GeneralizedCliffordSemiring = GeneralizedCliffordAlgebra |
GeneralizedCliffordAlgebra |
src/algebrax/clifford.py |
QuantumCliffordSemiring = QuantumCliffordAlgebra |
QuantumCliffordAlgebra |
src/algebrax/algebra/_dual.py |
DualNumberRing = DualNumberAlgebra |
DualNumberAlgebra |
src/algebrax/algebra/_dual.py |
DualNumberSemiring = DualNumberAlgebra |
DualNumberAlgebra |
src/algebrax/algebra/_polynomial.py |
PolynomialRing = PolynomialAlgebra |
PolynomialAlgebra |
src/algebrax/algebra/_polynomial.py |
PolynomialSemiring = PolynomialAlgebra |
PolynomialAlgebra |
src/algebrax/algebra/_group.py |
AbelianGroup = CommGroup |
CommGroup |
src/algebrax/algebra/_monoid.py |
CommutativeMonoid = CommMonoid |
CommMonoid |
src/algebrax/algebra/_ring.py |
AbelianRing = CommRing |
CommRing |
src/algebrax/algebra/_ring.py |
CommutativeRing = CommRing |
CommRing |
src/algebrax/algebra/_mixins.py |
HasSMul = HasScale |
HasScale |
src/algebrax/semiring/statistical.py |
BivariateCovarianceSemiring = BivariateVarianceSemiring |
BivariateVarianceSemiring |
src/algebrax/matrix/decompose.py |
lu = lu_decompose |
lu_decompose |
src/algebrax/homology.py |
Entire facade file deleted | algebrax.topology |
src/algebrax/verify.py |
Standalone script deleted | Use python -m algebrax or algebrax.verification |
src/algebrax/__init__.py |
Purge homology and verify from root __all__ |
algebrax.topology |
2. Semiring Catalog Invariant¶
In algebrax.semiring.Semiring.catalog():
- Ensure each of the 34 semirings maps to a single canonical key.
'BivariateCovariance'alias entry removed;'BivariateVariance'remains the unique registration forBivariateVarianceSemiring.
3. Verification Suite Refactoring (tests/)¶
Every test file currently importing or asserting alias names will be mechanically updated:
tests/algebrax/test_homology.py: Change all imports fromalgebrax.homologytoalgebrax.topology.tests/algebrax/test_domain_unification.py: Remove assertions that check identity between aliases (assert PolynomialRing is PolynomialAlgebra). Assert canonical classes directly.tests/algebrax/test_type_safety.py,tests/algebrax/test_algebra.py,tests/algebrax/test_rings_fields.py: UpdateAbelianGroup,CommutativeRing,CommutativeMonoid,HasSMultoCommGroup,CommRing,CommMonoid,HasScale.tests/algebrax/test_clifford.py,tests/algebrax/test_lie.py: UpdateCliffordSemiring\(\to\)CliffordAlgebra.tests/algebrax/test_verification.py: Remove tests foralgebrax.verifyCLI script, redirecting verification tests toalgebrax.verification.tests/verifications/test_differential_statistical_semirings.py: UpdateBivariateCovarianceSemiring\(\to\)BivariateVarianceSemiring.tests/algebrax/test_matrix_decompose.py,tests/algebrax/test_numerical_stability.py: Ensurelu_decomposeis called directly.
Backwards Compatibility¶
This is an intentional, breaking cleanup of pre-release internal aliases. By executing this before Phase 7 and v1.0, we establish a permanent, immutable public API contract. External consumers targeting v1.0 will have a single, unambiguous way to import and use every mathematical construct.
How to Teach This / Documentation Plan¶
- No deprecation warnings or migration guides are needed in user docs, in accordance with the principle that user-facing docs remain clean, self-contained, and free of planning-time artifacts.
- Code examples in docs already utilize canonical forms; this EP aligns internal implementation and test suites with that ideal.
Reference Implementation¶
- Purge alias definitions in
src/algebrax/. - Delete
src/algebrax/homology.pyandsrc/algebrax/verify.py. - Update
src/algebrax/__init__.pyexports. - Update
tests/imports via AST/regex refactoring. - Execute
uv run pytestto achieve 622 passed tests with 0 warnings.
Rejected Ideas¶
- Retain Runtime Deprecation Warnings: Rejected because
algebraxhas no external v0 production dependents. Emitting warnings creates log noise in internal benchmarks and test suites without providing value. - Defer Purge to Post-v1.0: Strongly rejected. Once v1.0 is released, breaking aliases requires a full major version deprecation cycle (v2.0). Doing it now is cheap and clean.
Open Questions¶
- None. Consensus reached during EXP-0007.
Change Log¶
- 2026-11-04: Draft authored following EXP-0007 Council consensus.
- 2026-11-04: Implemented and verified: all 14 legacy aliases and facades purged from
src/algebrax/, test suite aligned, 619 tests passing. Marked as Final.