Sovereign DSA Registry (alnoms.dsa)
The Sovereign DSA Registry is the "Single Source of Truth" for algorithmic metadata within the Alnoms ecosystem. It acts as a specialized pharmacy, providing the precise "Complexity Profiles" required by the Analyzer and Decision Engine to issue performance verdicts.
๐งญ 1. Philosophy: The Algorithmic Pharmacy
In Alnoms, data structures are not just code; they are Remedies. Every entry in this registry is mapped to a specific Big-O complexity class, ensuring that when the engine recommends a "Cure," it is backed by mathematical certainty.
- Standardized Profiles: Unified metadata for time complexity, access tiers, and implementation paths.
- Tier-Awareness: Transparent classification of OSS, PRO, and ENTERPRISE algorithms.
- Conceptual Stubs: Educational placeholders for optimization strategies like "Pruning" and "Memoization."
๐ 2. Algorithmic Profiles (OSS Tier)
Below are the foundational remedies available in the Open Source tier. These form the core of the Applied Data Intelligence curriculum.
๐ ๏ธ Data Structures
| Identifier | Complexity | Category | Role |
|---|---|---|---|
separate_chaining_hash |
\(O(N/M)\) | structure | Industrial-grade collision-resistant lookup. |
bst_search |
\(O(\log N)\) Avg | structure | Efficient ordered data retrieval. |
graph |
\(O(V + E)\) | structure | Base for network and relationship modeling. |
stack / queue |
\(O(1)\) | structure | Fundamental low-latency collections. |
โก Sorting & Searching
| Identifier | Complexity | Category | Role |
|---|---|---|---|
merge_sort |
\(O(N \log N)\) | sorting | Stable, predictable high-volume sorting. |
binary_search |
\(O(\log N)\) | searching | Logarithmic lookup in ordered arrays. |
dijkstra |
\(O(E \log V)\) | graph | Shortest path calculation in weighted graphs. |
โ๏ธ 3. Optimization Strategies
Beyond traditional structures, the registry tracks conceptual strategies used to fix high-level performance regressions:
memoization: Used by the Expensive Call Fixer to eliminate redundant \(O(2^N)\) recursive branches.list_concat: Promotes \(O(N)\) string/list building over \(O(N^2)\) in-place addition.buffered_io: Prevents IO-bound bottlenecks by batching operations in memory.
๐ข 4. Tiered Architecture
The registry scales with your engineering requirements, providing more advanced "Sovereign Remediation" as you move through the tiers:
- OSS (Tier 0): Essential DSA for 90% of performance bottlenecks.
- PRO (Tier 1/2): High-performance structures like
red_black_bst(guaranteed \(O(\log N)\)) andlinear_probing_hash. - ENTERPRISE (Tier 3): Specialized industrial algorithms like
bellman_fordandshell_sort.
๐งช 5. Internal Mechanics: Metadata Retrieval
The MetadataRegistry provides an \(O(1)\) lookup for any algorithm identifier. When the Decision Engine selects a fix, it queries this registry to enrich the final report:
# Internal Lookup Example
metadata = alnoms.dsa.metadata.MetadataRegistry.get_metadata("merge_sort")
# Returns:
# {
# "complexity": "O(n log n)",
# "tier": "OSS",
# "category": "sorting",
# "module": "dsa.algorithms.sorting.MergeSort"
# }
๐งญ 6. Design Principles
- Industrial Consistency: Ensures that the Analyzer, CLI, and educational modules all use the same Big-O definitions across the entire ecosystem.
- Sovereign Implementation: Every module path points to a highly-optimized Python implementation designed to reduce the "Cognitive Tax" on the end-user.
- Transparency: Users can verify the mathematical complexity and tier-access of any recommended fix directly from the registry.
๐ Next Step: Return to the Analyzer Architecture to see how this metadata is used to generate governance reports.