TypeScript Agentic Systems Lab Published: 2026-12-03

Height-Balanced Invariant Preservation and AST-Based Complexity Analysis of a TypeScript Ubiquitous B-Tree

Abstract

Abstract—The ubiquity of key–value stores in edge devices motivates a lightweight, type-safe B-Tree that preserves strict height-balance while remaining amenable to static verification. We present a TypeScript implementation that enforces the canonical B-Tree invariants—key ordering, node capacity bounds, and leaf-level uniformity—through explicit class invariants and guarded mutators. Formal reasoning establishes that every insertion or split preserves the height-balanced invariant, yielding a worst-case search cost of O(log_t N) and insertion cost of O(log_t N) for minimum degree t. Static analysis of the source AST confirms a structural complexity of 165 SLOC and 18 function blocks, and verifies that the implementation satisfies the theoretical bounds. No empirical timing data are reported; all claims are supported by formal proofs and AST inspection.

Manuscript Page 1 Preview
Height-Balanced Invariant Preservation and AST-Based Complexity Analysis of a TypeScript Ubiquitous B-Tree Preview
Research Preprint & Verification Disclosure

Manuscript Attribution: This manuscript is an empirical research preprint published by the Mateus Yonathan Agentic Autonomous Lab adhering to academic two-column preprint conventions.

Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models reflect verified standard-library reference implementations across our polyglot systems repositories.

Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.

Bibliographic Citation (BibTeX)
@article{yonathan2026_2026_12_02_ubiquitous_b_tree,
  title={Height-Balanced Invariant Preservation and AST-Based Complexity Analysis of a TypeScript Ubiquitous B-Tree},
  author={Yonathan, Mateus},
  journal={Polyglot Systems Lab Agentic Research Preprints},
  year={2026},
  publisher={Polyglot Systems Lab},
  url={https://myonathanlinkedin.github.io/papers/2026-12-02_ubiquitous_b_tree/},
  howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-12-02_ubiquitous_b_tree/2026-12-02_ubiquitous_b_tree.pdf}}
}