The agent had been working on the access control module for twenty-eight turns. It had parsed the Cedar policy schema. It had generated the token validation middleware. It had wired up the route handlers. And then, at turn twenty-nine, it decided to restructure the entire middleware stack, and everything stopped compiling.
Jay watched the red cascade in the CI output. Forty-seven test failures. The agent had pulled a load-bearing piece of middleware out of the stack and tried to replace it with something more elegant that wasn't yet functional.
"Classic agent behavior," Justin said, not unkindly. "They see a local optimum and reach for a global one, but they don't always make it across the valley."
"So we fork," Jay said. He'd been waiting to use this.
He opened the CXDB console and found turn twenty-eight—the last known good state. Three forks. Three Contexts. Three different instructions for what to do next.
Branch A: "Continue with the current middleware structure. Don't restructure. Fix the remaining test failures by adjusting the route handlers."
Branch B: "Complete the middleware restructuring. The new design is correct but incomplete. Finish what you started."
Branch C: "Abandon both approaches. Write the access control as a standalone package with its own test suite, then integrate it."
Three agents, same history, divergent futures. Jay kicked them off simultaneously. CXDB didn't copy the twenty-eight shared turns. Each branch simply pointed back to the same immutable turn twenty-eight in the DAG. The storage cost was three pointers.
Branch A moved fast. The agent understood the constraint—don't restructure, just fix—and started working through the test failures methodically. By turn thirty-five, twenty of the forty-seven tests were passing.
Branch B moved slower but with more ambition. The agent completed the middleware restructuring by turn thirty-four, introduced two new abstractions, and broke a different set of tests in the process. By turn forty, it was making progress but still had twelve failures.
Branch C was the surprise. The agent created a clean-room implementation of the access control logic as an independent package. No dependencies on the existing middleware. Its own test suite. By turn thirty-three, the standalone package was complete and passing all its own tests. By turn thirty-eight, it was integrated into the main codebase. Zero test failures.
"Branch C," Navan said, looking at the results. "The one that started over with clean boundaries."
"In twelve turns," Jay added. "The original agent spent twenty-eight turns getting tangled. Branch C solved the whole thing in twelve, starting from scratch with a better architecture."
Justin studied the DAG visualization on Navan's screen. Three branches diverging from a single node, two of them still struggling, one of them clean and complete. "The cost of this experiment was three Contexts and twelve turns of compute. The alternative was letting the original agent struggle for another fifty turns and maybe never converge."
"Fork early, fork often," Jay said.
"Fork early," Justin agreed. "But also: keep the failures. Branch A and Branch B are still in the DAG. Someone might learn from them later."
The failed branches stayed in the graph. Immutable. Addressable. A record of the approaches that didn't work, which was sometimes more valuable than the one that did.
Branch C winning by starting clean instead of fixing the existing mess is such a powerful lesson. Sometimes the best fix is a fresh perspective from the same starting point.