> One possible outcome of all this is that we could prove that factoring is not in P (and therefore P!=NP), and further that almost all factoring problems are hard. If we had that, we’d be safe from all future AI advances.
I believe it's consistent with current knowledge that Factoring is hard in the worst case but easy on average for any efficiently sampleable distribution. In such a scenario, knowing that there are difficult-to-factor semiprimes may not be enough to sample them effectively, leaving us with no factoring-based crypto.
The same holds for other candidate crypto schemes and, more broadly, much of NP \ P. See: Heuristica.