Probably, within a few months, one (or more, possibly colaborating) LLMs just might.
Always fun to see "the difficult ones," proven.
However, being able to rewrite a program with formally well-defined behavior (i.e. code) should be in an LLM's capability, but LLMs are a long ways away from demonstrating semantically coherent coding skills, just the ability to regurgitate common patterns (often filled with bugs and/or incoherent semantics).
That's just what people do, we are hard-wired to see social cues even if there are none.
(The wonder here isn't that an LLM succeeds at text retrieval tasks, the wonder is how highly compressed the index turns out to be. But maybe we just severely overestimate our own information complexity.)
You can claim that mental models don't actually exist and everything in the universe is just maximum likelihood, but that would be a religious/spiritual statement, outside the realm of science.
Of course, to get it better at refactoring, everyone has to write blog posts on refactoring to feed the machine.
Worked at a few of these dog shite companies and the amount of low quality shit driven by half baked initiatives from the C-level suite (ie, “we are microservice oriented now, do that”) is astounding.