reuse query preparation across terminal outputs
I made query preparation reuse work when several outputs share most of the same graph. This avoids rebuilding the same pieces repeatedly while keeping separate outputs, privacy checks, storage, and public APIs unchanged.