Stored vs computed balance disagreements at end-of-day. Leaf table covers individual posting accounts (computed = cumulative net of every Money record through that BusinessDay's end). Ledger table covers parent accounts (computed = sum of child accounts' stored balances). Both tables only show rows where stored ≠ computed — every row is one SHOULD-constraint violation.
Internal Accounts in Scope Accounts where drift is checked — drift surfaces where stored balance disagrees with the cumulative net of posted Money records (leaf) or the sum of child stored balances (parent):
ClearingSuspense (clearing-suspense)
NorthPool (north-pool)
SouthPool (south-pool)
CustomerLedger (customer-ledger)
CustomerSubledger (cust-001)
CustomerSubledger (cust-002)
CustomerSubledger (template)
Leaf Accounts in Drift
Count of leaf-account day-rows where stored balance disagrees with the cumulative net of posted Money records.
Parent Accounts in Drift
Count of parent-account day-rows where stored balance disagrees with the sum of child accounts' stored balances.
Leaf Account Drift
Each leaf account's stored vs computed balance per BusinessDay. Computed = cumulative Σ signed Money through that day's end. Drift = stored − computed; non-zero ⇒ feed diverged from the underlying ledger. Right-click any row → View Daily Statement to open that account-day.
Parent Account Drift
Each parent account's stored vs computed balance per BusinessDay. Computed = Σ stored balances of its child accounts on that day. Drift = stored − computed; non-zero ⇒ a child posting didn't roll up correctly. Right-click any row → View Daily Statement to open that account-day.
**Sub-ledger drift**
> For every CurrentStoredBalance where `Account.Scope = Internal` and `¬IsParent(Account)`, `Drift(Account, BusinessDay)` SHOULD equal 0.
Each leaf-account day where the stored balance disagrees with the cumulative net of every Posted Money record posted to that account through the BusinessDay's end. The disagreement is the *drift*; a non-zero value signals the feed diverged from the underlying ledger.
**Action.** Diff the day's transactions for `account_id` against the stored balance — the gap is missing or duplicated postings on that account-day. Re-load the source feed for the account-day and refresh matviews.
**Parent-account roll-up drift**
> For every CurrentStoredBalance where `Account.Scope = Internal` and `IsParent(Account)`, `LedgerDrift(Account, BusinessDay)` SHOULD equal 0.
Each parent-account day where the stored balance disagrees with the sum of its child accounts' stored balances. Surfaces a child posting that didn't roll up correctly to its parent.
**Columns:** same as `_drift` minus `account_parent_role` (parents ARE the parents).
**Action.** Sum the child accounts of `account_id` on `business_day_start` and compare to the parent's stored balance. The gap is a child posting that didn't propagate to the parent — usually a missing FK in the feed. Fix the parent link upstream, re-load, refresh.