Doesn't need to be. Point an AI at it and say reproduce the behavior.
Point is, if need be, the open source version could be forked and carried forward by someone else, using the public code as a definitive spec for any missing functionality.
What is your reference for saying that this is legally dubious? I'm trying to stay up to date with "coding agent clones of copyrighted software" but haven't seen this settled in court yet