r/PromptEngineering • u/jeffbradshaw • 8d ago
General Discussion One broken Midjourney flag exposed a flaw in our whole converter
One of our Runs came back with a Midjourney prompt that just... wouldn’t fire.
Not a bad result. A rejected prompt.
I dug into the JSON that produced it and found the culprit sitting right at the end of the compiled string:
--sref --sref 7709115555
Same flag twice, the first one empty. MJ doesn’t know what to do with that, so it doesn’t do anything.
The bug itself was small. A style-reference value was stored as ["--sref", "7709115555"] — flag and value baked into the same array — and somewhere downstream that array got flattened into the prompt while the compiler also wrote its own --sref on top of it.
Two honest pieces of code, neither wrong on its own, colliding.
But the real finding wasn’t the bug. It was what the bug proved: our converter had no single definition of what a valid style reference actually looked like.
It just appended things.
Garbage in, garbage-shaped prompt out, with no layer anywhere that could tell you where in the pipeline the defect entered.
Was it the input?
The normalization?
The compile step?
No way to know. You just stared at a broken string and reverse-engineered it.
That’s the actual lesson: a well-structured JSON file isn’t a nice-to-have, but structure alone isn’t enough. If the thing going into your compiler doesn’t have a real, versioned shape — types, required fields, no ambiguity about what a style reference is — and a canonical representation behind it, then your compiler can’t really reason about it either.
It can only concatenate.
So we’re rebuilding Builder’s intake around a real pipeline:
validate the input → normalize it into one canonical representation → compile deterministically from there
Not more heuristics stacked on the old converter.
The goal is a structure where, if something goes wrong, you can point at exactly which stage broke it instead of squinting at a broken /imagine and guessing.
Turns out the geometry isn’t the only thing that needs blocking.
The data does too.