Unfortunately, the jwz threading algorithm can't be literally applied to Mastodon threads without doing a status_context API call for each message, which is too expensive (no References field on posts, only In-Reply-To). But it's also the case that you can trust the information you *do* have in a way that you can't with email, which simplifies things. Will probably play with this at lunch or this evening.