Offline-first isn't a feature

I’ve been working on RepartoMás, a system for businesses that sell products on the road. Owner loads a truck with snacks, medicines, or beverages and sends drivers out to towns where cell signal is unreliable at best. Web dashboard for the owner, mobile app for the drivers. Standard split.

Offline mode is the whole product. If the app doesn’t work without signal, it’s a demo. Today we fixed two bugs that proved exactly that.

First bug: try to register a sale in airplane mode. The product and customer lists came up empty, and the confirm button sat there spinning “Registrando…” forever. The data was all stored locally — SQLite on the device had everything. But the internal state machine was gated on connectivity: “wait for internet before doing anything.” It didn’t need it. Now the sale goes through instantly, offline, and syncs to the server when the signal returns.

Second bug: processing a return. The driver would log it, but the screen showed nothing — no badge, no status change. It only appeared after a manual page reload. The app and the server were fighting over whose data was newer. Now the app holds the local version until it confirms the server is up to date, and only then refreshes.

Two small state-machine fixes. Together they make offline flow work end-to-end. That’s the difference between software that runs in a demo with Wi-Fi and software that runs in the real world.

The test suite is the interface

The Bun Zig-to-Rust rewrite cost $165K in tokens and touched over a million lines. Everyone focuses on the scale. That’s not what I find interesting.

What makes this work isn’t that an agent can write code. It’s that the TypeScript test suite served as a language-independent executable spec. A million assertions that don’t care whether the runtime underneath is Zig or Rust. Without that oracle, a +1M-line PR is unreviewable — no amount of adversarial review saves you when you can’t tell correct from plausible.

The job shifts from reviewing code to reviewing the process that generates it. You don’t fix bugs in the output. You fix the loop, re-run, and let the test suite tell you if you’re done.