weightFitsTheBudget
Whether weight could be activated at all: true when it fits the weight budget as the only active child of its parent, false when no parent could ever take it.
A heddle refuses an activation whose weights would push a product a pick forms out of Long, or make the grid so fine that one full lease of LocalHeddle.MAX_RESERVATION no longer fits a child's window. A weight that fails alone fails beside any siblings, so this settles the question before the edge exists. A denominator above 30,719 fails it at any lease size, since the rule is sized for the largest lease and no grant is larger (#3353). A true here is necessary, not sufficient: the siblings already active can still refuse it, which activationFitsTheBudget asks.
The rule is the one LocalHeddle.apply enforces, asked without applying anything. Use it to vet a weight before proposing the edge, rather than re-deriving the arithmetic.
Samples
// 1/30,719 is the finest weight one full lease fits; one step finer fails at any parent.
check(weightFitsTheBudget(Weight.of(1L, 30_719L)))
check(!weightFitsTheBudget(Weight.of(1L, 30_720L)))
val root = GroupId("root")
val alice = ReplicaId("alice")
val toHeavy = AttachmentId("root→heavy")
val toThird = AttachmentId("root→third")
val heavy = Weight.of(185_000_000_000_000_000L)
val third = Weight.of(1L, 3L)
check(weightFitsTheBudget(heavy) && weightFitsTheBudget(third))
var ledger = EntitlementLedger.bootstrap(root, mapOf(alice to 100L), nonce = "genesis")
ledger = ledger.piece(checkNotNull(ledger.prepare(AttachmentRecord(toHeavy, root, GroupId("heavy"), heavy))))
ledger = ledger.piece(checkNotNull(ledger.activate(toHeavy)))
ledger = ledger.piece(checkNotNull(ledger.prepare(AttachmentRecord(toThird, root, GroupId("third"), third))))
// Each fits alone, but not together: ask before proposing the activation, not after.
check(!ledger.activationFitsTheBudget(toThird))