The Go version of Leash's Cedar policy engine worked. It had worked for months. It evaluated Cedar policies against agent actions, rendered authorization decisions in under two milliseconds, and handled every edge case the scenario suite could throw at it. By every conventional metric, it was done.
Jay stared at the profiler output anyway.
"The policy evaluation hot path allocates on every call," he said to no one in particular. Navan looked over. "The Cedar AST gets rebuilt from scratch for each decision. In Go, that's fine. The garbage collector handles it. But it means we're burning cycles on memory that's immediately discarded."
"You want to optimize the Go?" Navan asked.
"No. I want to semport it to Rust."
Semporting. Not translation. Not running the Go source through a transpiler and hoping for the best. Semantic porting meant understanding what the code intended and reimplementing that intent in the target language's native idioms. The Go version of the Cedar engine thought in interfaces and goroutines and slices. The Rust version would think in traits and ownership and zero-cost abstractions. Same semantics. Different soul.
Justin approved the effort with a single sentence: "Write the scenarios first."
So they wrote the scenarios first. Forty-three Cedar policy evaluation scenarios, covering everything from simple allow-deny decisions to deeply nested policy compositions with conditional resource matching. The scenarios didn't care what language the engine was written in. They cared about correctness. They cared about the contract between input and output.
Then the agents went to work.
The first Rust implementation appeared within hours. It failed eleven scenarios. The second version failed four. The third failed one—a corner case involving policy evaluation order when multiple policies matched a single action with conflicting priorities. The Go version handled it through iteration order. The Rust version needed an explicit priority queue.
"It's not translating the solution," Navan said, watching the agent's commits stream past. "It's discovering a new solution to the same problem."
By evening, all forty-three scenarios passed. Jay ran the benchmarks.
The Rust Cedar engine evaluated policies in 340 microseconds. The Go version took 1.8 milliseconds. A 5x improvement. But the real win wasn't speed. The real win was expressiveness. The Rust type system encoded constraints that the Go version enforced at runtime. Invalid policy states were unrepresentable. You couldn't construct a malformed authorization decision even if you tried. The compiler itself became a policy enforcement mechanism.
"The Go version checks if you're wrong," Jay said, reading through the generated Rust. "The Rust version makes it impossible to be wrong."
Navan wrote it down in his notebook. Below it he added a note: Semporting is not translation. Translation preserves syntax. Semporting preserves meaning. The meaning is the same. Everything else is negotiable.
Justin pulled up the satisfaction dashboard. The Leash scenarios were climbing. Not because the behavior had changed—the contract was identical. But because the Rust version handled edge cases that the Go version had papered over with runtime checks. The type system had opinions, and its opinions were correct.
The Go version remained in the repository, tagged and archived. It had served its purpose. It had been the draft that taught them what the Cedar engine needed to be.
The Rust version was what it became.
"The Go version checks if you're wrong. The Rust version makes it impossible to be wrong." I'm getting this tattooed on my forearm. Not really. But spiritually.