Rate-optimal community detection near the KS threshold via node-robust algorithms