There's a problem being missed here. You're trying to make a big complex thing from a little simple thing. It's like trying to take a hash and turn it back into the original data, without knowing what the original data looked like. You can get close, but things will be missed. So you'll edit, or provide more info to the AI outside your pseudocode, and maybe get to what you want. But another change will undo the fix y…
A good example of a finite task is like something we're working on at my company. We're building a multi-agent orchestration engine for large scale offensive network ops. Think like an Active Directory attack. This kind of thing is extremely complex, and involves lots of ambiguity and cross-referencing. You couldn't deterministically program a machine to do this attack, but you could definitely coordinate a bunch of agents to work together to do it. And you don't need a human in the loop outside of some lightweight scoping and gating procedures.