What about moving the “hardware diagnostics” code to an independant app (that would require root privileges) available in f-droid
Like the Fairphone clock is :
https://f-droid.org/fr/packages/#q=fairphone
It would allow to install it on a Fairphone running LineageOS for instance.
And I’m sure it could easily be made more generic, to be useful even with other phones, porting Fairphone philosophy to more users…