holdings
The units r may spend at group, derived from the merged state:
holdings = creditIn + transferNet(f, r)
− Σ_{c ∈ childEdges(group)} (issued(c)[r] − returned(c)[r])
− leafSpent(f)[r]where f = inbound(group); creditIn is the sum of minted amounts held by r at group itself when group has no inbound edge (a MintRecord names the root it was minted at, so no other group's supply is creditable here — #1751), else effIssued(f)[r] − returned(f)[r]. effLeafSpent(f)[r] is subtracted unconditionally — no isLeaf test — which keeps conservation topology-independent when a former leaf later gains a child (design fix 1). Both the issuance and the leaf-spend terms read effective values (base ± relocation), so a re-homed generation credits the child that now owns it.
Every subtracted term reads a slot only r writes, so a peer's local feasibility check is sound with zero coordination. If group's lineage is quarantined (see lineageEdges) this returns 0 — quarantine is transitive down the path (design §4.6). May be negative (a real overspell net; see LedgerConflict.PersistentNegativeHoldings).
Retired children are folded, not skipped
The child sum runs over every child edge group ever had, and a retired one stays in it: a served child retires with issued − returned = spent > 0, and that spend left this group. The non-retired children are summed here; the retired ones come pre-summed from the index's per-parent fold, so a group with fifty thousand retired children pays for none of them. The children this ledger has forgotten come pre-summed too, from forgotten.
The sum is kept in 128 bits and narrowed once, at the end. Wherever the old term-by-term checkedAdd/checkedSub sum returned a value, this returns the same one. It now throws on fewer states: a partial sum that leaves Long no longer throws, and neither does a retired child's own term, which the fold keeps exactly. What still throws is a result that does not fit a Long, and an overflow inside one of the other terms (the inbound credit, the transfer net, a non-retired child's net inflow, the leaf spend). Never a silent wrap (§10.12).