SEF documentation for residency extensions counting towards 5-year citizenship timeline

The law regarding residence towards citizenship is at: https://dre.pt/dre/detalhe/lei-organica/2-2020-148086464 and this thread is relevant: Switching from a Golden Visa to a D7
There is a great deal on this site that is worth reading before posting, despite the clutter.