mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-06 07:28:23 +00:00
Repository discovery arrives in five-second batches, but the previous incremental path accumulated subscriptions until a coarse threshold rebuilt the complete live set. Reopening healthy core groups and separately managed descendant coverage creates avoidable relay load and coverage gaps. Use the actual filter-count and serialized-byte grouping function as the capacity authority. Preserve protected descendant and count-full groups. Repack the complete mutable core tail when that releases slots; when byte limits mean the complete tail cannot shrink, retire only the smallest groups whose participation reduces the incremental slot cost. Failed CLOSE or replacement open restores the exact retired tail, while capacity pressure retains the deferred full-regroup backstop. Correctness assumes the held-permit map describes the filters open in the current connection session and that adding one existing group can increase grouped output by at most its prior one slot. Reconnect, exceptional full restoration, and multi-connection sharding are deliberately unchanged. Validated with cargo check --lib and cargo test --lib (680 passed). Tests cover deterministic grouping, full/descendant preservation, thirteen small partial groups becoming two replacements and releasing eleven slots, seventeen byte-bound groups replacing only one to avoid a new slot, byte-full preservation, replacement-open rollback, and partial-CLOSE rollback.