The loop has stopped producing progress and each attempt is making things worse. What you do in the next twenty minutes decides whether this becomes a recovered project or an abandoned folder, and the instinctive response is the wrong one.
What is the instinctive response?
Describing the problem more emphatically. It does not work, because the difficulty is not that the request was unclear: it is that changes are being made against an inconsistent picture, and a clearer description of the symptom does not change that.
The other instinct worth resisting is starting a fresh session and describing the whole project again. That produces a second implementation with different problems rather than a fix, and now there are two things nobody understands.
What is the first thing to do?
Stop. Not pause, stop: the accumulated conversation is now part of the problem, since it contains several failed attempts that are influencing everything produced after them.
Continuing in the same session reliably produces more of the same.
Taking a break is more useful than it sounds, since the decision to stop is easier to make once the frustration of the last hour has faded.
What are the options?
- Revert to the last state that worked and try a different approach.
- Read the specific part that is failing, properly.
- Rewrite that part yourself, from a description of what it should do.
- Start again with everything you have learned.
All four are more productive than another round of describing, and the first is the cheapest.
Why is reverting so effective?
Because it removes the accumulated damage. Three hours of attempted fixes have usually left changes in several files, and going back to a known working state is a single operation where unpicking them is not.
This only works if you were committing as you went, which is the argument for doing so.
How much do you actually have to read?
Less than it feels. The failing behaviour is usually produced by one file or one function, and reading that carefully is an hour rather than a week.
Asking which part is responsible, before reading anything, narrows it considerably and is a reasonable use of the tool that got you here.
When is starting again correct?
When the structure is the problem rather than a specific piece. If the same failure keeps appearing in different forms, the arrangement is wrong, and no amount of local repair fixes an arrangement.
The second attempt is usually much faster, since the requirements are now known.
What should you salvage?
The description, not the code. What you learned about what the thing should do is the valuable output of a failed attempt, and it is what makes the rebuild quick.
Write a complete description of what this project does, based on what we built, including everything about behaviour and the cases we discovered along the way. Do not include any code.
How do you tell a wall from an ordinary difficulty?
By whether progress is being made in any direction. An ordinary difficulty produces a sequence of different failures, each slightly further along; a wall produces the same failures in rotation.
The other signal is size. If each fix makes the codebase noticeably larger without making the application better, the tool is adding compensating code rather than correcting the underlying problem, which is a pattern that never resolves itself. Noticing either within twenty minutes rather than three hours is the main thing that separates a recoverable afternoon from a lost one.
What is the lesson worth taking?
That the wall arrives at a fairly predictable size, so the decision about whether a project can be built this way should be made at the start rather than discovered at hour four. Small and temporary is where it works, and both of those are choices.