I think there is an easy test: if you didn’t write it, it’s not yours.
If we go back 10 years and your friend says “I have an idea for an app, here it is,” and you build it, you own the copyright because you wrote it.
You give an idea to the pile of math calculated of the stolen work of humanity, the math owns it (which it can’t, so no one owns it).
No matter how detailed of a conversation you have with a friend, I don’t think they have justification to claim copyright over code written by you.
What if an artist programs a programs a carving robot to create a sculpture? How is that meaningfully different?
Based on your logic that should not qualify, but it currently clearly does: https://quayola.com/selected-unfinished-sculptures/
That's how you want it to be, but that's not how it is.