Credit where it's due: I was working with structured data as JSON for the completion, and the Typescript definition hugely increased reliability. I took that from helpful advice (on Twitter) from Noah Brier who afiak came up with the approach:
https://brxnd.substack.com/p/the-prompt-to-rule-all-prompts-...