This is 100% vibe-coded - meant only for very initial EDA.
The idea is: I have trees with categorical labels and timestamps, and I want to coarsen/contract trees along edges that are "unsurprising". This module:
(1) Fits some simple models to the edges, and
(2) Uses a modified version of HDBSCAN to construct the coarsening.
The only reason to have this module at all is: during early discussions we were thinking of using raw HDBSCAN, but this doesn't work - in general it can create partitions whose parts are not connected in the original tree because of the way mutual reachability distance works. In this moduele, the MST is constrained to only condense along tree edges (assuming I described the algorithm well enough and the vibe-coding followed it, which has at least a 10% chance of being true...)