lib: query make exclude handling non-destructive