Sync is bouncing nodes, and creating unnecessary calls to the currently expensive `has-newer-record-for-certname?`. Because it has the record already, the check is true and it does not enqueue the command. This results in a count of 0 for the nodes entity even though it did all the work of transferring and vetting a command, but just didn't enqueue it.
The discrepancy is between the handling of ttls between produce-streaming-body which gets called by the query endpoint and stream-query-result which gets called by the trapperkeeper endpoint.
produce-streaming-body properly handles the context, and turns it into query-config as expected
In steam-query-result the node-purge-ttl setting needed to properly set the inactive_nodes CTE for the query is in the context. But we strip it out before proceeding to turn the AST into SQL.