Star Trek isn't real life, when human labor stops being valuable the humans who's labor was previously vital will be at best left to rot in squalor.
I'm sorry but us programmers didn't invent capitalism, and it wasn't our consent under the condition of having a good run under it what kept it in place.
Have to start making our own steel in the backyard and killing sparrows