90.2 Scope.
(A) Covered. This Code covers the installation and removal of
electrical conductors, equipment, and raceways; signaling and
communications conductors, equipment, and raceways; and
optical fiber cables and raceways for the following:
So the code would not cover troubleshooting if you are not installing or removing electrical conductors , equipment, etc.

The rest of the stuff you mentioned would appear to involve installing and/or removal of such things and thus would be subject to the code.

However, just because something is subject to the code does not mean you are required to get a permit. You still have to do the work in accordance with code requirements but the rules adopted by statutory authority will tell you when you you need a permit and when you don't.

Also just because something is not subject to the code does not mean you are exempt from permits.

The code and permits are two separate issues.