Iterating & re-steering

Don't argue with the AI. Diagnose why it failed and adjust the context.

The idea

When an LLM gives you the wrong output, yelling "No, do it right!" doesn't help. You must diagnose why it failed. Did it lack context? Did it misinterpret a vague word? Was the task too large?

To steer the model back on track, you must either Add Constraints, Provide an Example, or if the context window is too polluted with bad attempts, Reset the Thread completely.

You: Generate a regex to parse emails.
AI: ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$
The AI gave a naive regex that misses plus-addressing (test+foo@gmail.com). How do you fix it?

How it works (Re-steering Strategies)

# Why AI generation fails:

1. "I said make it robust!" (Vague constraint)
   AI response: Adds excessive error handling you didn't want.
   Fix: "Add a constraint: Must match RFC 5322 specifications."

2. "It formatted the JSON wrong again." (Lack of example)
   AI response: Tries a different, still wrong format.
   Fix: Provide a literal example: `{"users": [{"id": 1}]}`

3. The "Death Spiral" (Context pollution)
   If you have corrected the AI 4 times and it keeps reverting to
   old mistakes, the context window is corrupted with bad logic.
   Fix: Open a NEW thread. Paste your refined, final prompt.