03

Article 3 of 12 · ARTHA Craft

My AI Agent Gave Me a Sports Car With No Brakes. I Was Shipping Fast and Breaking Faster. Here's How I Built the Brakes.

Tests passing. UI broken. The agent did exactly what I asked. That was the entire problem.

Jitander Singh Chauhan

Lead AI & Data Technologist · Haystream

⚡ A confession before the story

Earlier in writing this series, I asked my AI assistant a question it had already answered. Context from earlier in our session: gone. Had to be re-explained. Time wasted.

I am writing a 12-part series about exactly that problem. The irony was not subtle. And it was the perfect reminder that this isn't theoretical. It happens to everyone working with AI, including the person writing the methodology to fix it.

Three Weeks In. I Had Never Moved Faster.

Features were shipping in hours that would have taken days. The stack was growing. The demo was looking sharp. The team was energised. There was a genuine sense that we had found something: a way of working that compressed timelines in a way I hadn't experienced in 25 years of building software.

Then I ran the tests. [1]

The test run

Green. Every single one. Unit tests passing. Component tests passing. The suite smiled back at me with clean results across the board.

The stakeholder demo: same day

The UI was broken. Not a cosmetic issue. Not a minor edge case. The actual end-to-end user journey, the flow a real user would take through the product, was silently, completely broken. No error thrown. No alarm raised. Just the wrong thing happening, quietly, while the test suite had given us a clean bill of health.

What followed: half a day

Back and forth. Layer by layer. The API looked fine in isolation. The worker looked fine in isolation. Every individual component, examined on its own terms, appeared to be working correctly. The system as a whole was not working.

What I Was Looking At Had a Name. [2] I Just Didn't Know It Yet.

Cross-Layer Breakage: What the Tests Didn't See
UI Layer
Built in session 4. Assumed the API response shape from session 2. Nobody told it the shape had changed in session 3.
Broken
API Layer
Updated in session 3. Technically correct for its own brief. Had no knowledge of what the UI was depending on.
Passed
Worker Layer
Still reading the schema from session 1. The schema had been updated twice since. Tests verified the worker's logic, not the schema contract.
Silent
Test Suite
Written per-layer. Tested what each piece did in isolation. Did not test how the layers talked to each other across the full journey.
All Green ✓

The agent had not made mistakes. Every individual implementation was technically correct for the brief it had been given. The briefs just hadn't known about each other.

The agent was doing exactly what I asked. That was the entire problem.

Session after session of a stateless agent executing brilliantly, with no memory of what any other session had decided, built, or changed. No shared picture. No cross-layer awareness. Just speed. Clean, fast, isolated speed. That was quietly accumulating invisible debt between the layers.

The End-to-End Journey Test Was the Moment Everything Became Clear.

Not a unit test. Not a component test. A full user journey, from first action to final outcome, touching every layer the product had. It failed. And as I traced the failure backwards through the stack, session by session, decision by decision, I saw the pattern with complete clarity for the first time.

I had given the team speed. I had not given it coherence. I had given the agent execution. I had not given it the full picture. I had handed a sports car to a driver who could only see the ten metres directly in front of them, and I had been surprised when it left the road.

The brakes were never the agent's job to build.

They were mine. The architect's job is not just to design the features. It is to maintain the coherent picture of how the layers connect, and hand that picture to every session, every agent, every time.

Here Is What I Changed After That Day.

1
Full platform state: read before every session

Before any session starts, the agent reads a structured document that tells it what exists, what is connected, what has changed recently, and what must not be touched. Not just today's feature. The whole picture.

2
Cross-layer dependencies: documented in the task file

Before any feature is built, the cross-layer dependencies are written down explicitly. What does the layer above expect? What does the layer below provide? The agent does not infer these. They are stated.

3
End-to-end check: part of the definition of done

Before any code is merged, the full user journey is verified. Not "does this unit pass." Does the whole journey still work end to end across every layer it touches.

4
Context handoff: written before every session closes

What changed this session. What the next session needs to know. What is now different in the layer contract. Written down before the chat is closed. Never lost.

The agent still moves fast. [3] The sports car still has the engine. But now it has brakes.

And the difference, in stability, in team confidence, in the hours not lost to half-day debugging sessions, is not incremental. It is the difference between a product and a graveyard of chat sessions dressed up as software.


The speed was never the problem. Unstructured speed was the problem. Speed without a system that carries context across layers, sessions, and decisions. Once the system exists, the speed becomes something you can actually trust.

Research & Further Reading

← Previous

Article 2

Next →

Article 4: The Conversation Ends. The Document Survives.