cluster-beliefs-respects-budget

IN premise

`cluster_beliefs` never returns more IDs than the `budget` parameter; each cluster's allocation is individually capped by `min(alloc, len(members))`.

Summary

The clustering function guarantees it won't exceed the caller's requested limit on how many belief IDs to return. It does this by capping each individual cluster's contribution to the smaller of its calculated share or its actual size, so the total output is always within budget. This matters because downstream consumers can rely on a predictable, bounded result set without needing to truncate or re-check the count themselves.

Details

Sourceentries/2026/05/08/reasons_lib-cluster.md