pub fn count_nodes_by_scope(db: &Database) -> Result<BTreeMap<String, usize>>
Counts of nodes per scope (from SQLite).