"The UI and the engine share a process. That's a convenience, not a license to skip the API."
The Tempting Shortcut
Bonfire's built-in UI and its engine run together — one server, the engine on a port, the UI talking to it. Because they're so close, there's a constant temptation: why fetch the model over HTTP when the engine object is right there in the same codebase? Just import it. It's faster, it's fewer lines, and in the moment it works perfectly.
It also quietly destroys the thing that makes the engine worth building. The instant the UI imports engine internals, it's coupled to the engine's shape, not its API. Refactor the engine and the UI breaks in ways the API contract never promised. Worse, the model can now arrive at the UI by a path no other client can use — so the Live bridge, the mobile app, the CLI you build later are all locked out of that path.
Treat In-Process Like Remote
The discipline is simple to state and annoying to hold: the built-in UI calls the API as if the engine were on another machine. Even though a function call would work, you make an HTTP request. The cost is a little latency and a little ceremony. The payoff is that the UI proves, on every single request, that the API is sufficient — because the UI is living proof that a client can do everything it needs through the API alone.