Technically just advanced indexing of code snippets
That is an extremely disingenuous take. It produces novel output, so is not merely an “index” in any sense of the word.
The illusion of creativity is similar to that of technology. Sufficient advanced technology is indistinguishable from magic, and sufficient advanced math is indistinguishable from intelligence. The relation between AI and math is the same as the relation between magic and technology.
Infringement isn't about how the infringing system works, it's about the product of that work.
Exactly this. It makes zero difference that you produced your infringing work with the help of a program that happens to be extremely complex and marketed as "AI".