DEV Community

JEONSEWON
JEONSEWON

Posted on

I almost rewrote my engine. It was never the thing that was broken.

My tool could only ingest traces from one framework, and that narrow door was strangling adoption. The obvious fix screamed at me: the detection engine must be too framework-specific — rewrite it to be agnostic. Days of work, touching the most sensitive code I have (the frozen detector). I was ready to start.

Instead I spent one hour doing nothing but reading. Read-only: no edits, no plan, just trace exactly where the framework-coupling actually lived.

It wasn't in the engine. The detector was already framework-agnostic — waste looks the same whether it came from LangGraph or CrewAI, and the core only ever saw normalized spans. The coupling was a single thing: there was no entry point that read a trace file. The "rewrite" I was about to do would have churned days of risky changes through code that was already correct, to fix a problem located somewhere else entirely.
The actual fix was adding one entrypoint — hours, low risk, the frozen engine untouched. The hour of diagnosis didn't just save time; it saved me from confidently solving the wrong problem, which is the more expensive mistake. A rewrite that "works" but addressed a non-issue still leaves you with the original bottleneck and a pile of new risk.

The discipline I'm taking from this: when something feels broken, the instinct is to open the file you suspect and start changing it. The cheaper move is to first prove where the problem is, read-only, before a single edit. Most of the time the thing you were about to rewrite was never the thing standing in your way.

Code: github.com/JEONSEWON/Clew-by-Custos

Top comments (0)