Right now this leads to a silent deadlock because every public query is wrapped in a self.with_analysis(|a| ...) which locks the primary lock for the execution time of the query.
One place where recursive queries are handy is recursive symbol tree processing, e.g. when reconstructing hierarchical symbol outline.
I believe it'd be good to be a bit more explicit about the interior lock and expose it so the user can perform multiple queries in bulk.