This year at work I built a desktop app that migrates audit data from one platform to another. Most of the work is matching every account in a trial balance to the right line on the financial statements, then proving the totals still tie.
The app is air-gapped by design. Audit data is sensitive, and the people using it work on virtual desktops with no internet access, so nothing ever leaves their network. That rules out a cloud model, API calls, telemetry and "we'll fix it in the backend". Whatever the app needs has to be inside the installer.
I built it solo. The first installer shipped two weeks after the spec, and the app has been in production since August 2026. Since then, about 30 releases have been driven by what real users hit in the field. These are the lessons that held up.
A blank beats a wrong number
In most software, a wrong answer is a bug you fix next sprint. In audit, a wrong number that looks right is the worst possible outcome, because nobody goes looking for it. A blank with a reason attached is fine. Someone sees it and fixes it in a minute.
So the app is built deterministic-first, AI-last:
- Deterministic rules decide everything they can. On our reference sample they map 99.4% of rows correctly with the AI switched off.
- A small local model only sees what the rules could not settle, and its answers face the same checks as everything else.
- Anything still uncertain goes to a review queue with a reason. The app never fills a gap with a guess.
The best evidence came from the first week of real use. I traced every reported issue to its root cause. Each one was environmental, a visible refusal, or a gap in the UI. None of them was a wrong number.
Two smaller rules came out of the same week:
- Checks must cover what users assume they cover. One reconciliation row showed a green "ties" badge while the prior year was off, because the badge only checked the current year. Now each year gets its own check.
- Repairs need proof. Real input is messy, and the app cleans some of it up. It only applies a fix it can prove. Without proof, the value stays visibly incomplete instead of being invented.
Local AI on a small CPU is slower than you think
Early on, a user ran a large file with the AI on and left it overnight. It never finished. The arithmetic explains why: a few seconds of local inference per row, on a small virtual CPU, times a few thousand rows, is hours.
Three fixes, in order of how much they mattered:
- Estimate before you start. Any long AI run now shows a time estimate first, so nobody waits overnight by accident.
- Run the AI on demand, not by default. One button runs the model over just the review queue, after the deterministic pass is done.
- Use the GPU if there is one. An optional GPU pack ships a CUDA build of the inference engine in the installer. NVIDIA's runtime libraries are an opt-in download, pinned by sha256 like every other download the app makes.
The GPU had its own twist. The first virtual desktops reported "GPU not detected", and Windows listed only virtual display adapters. The GPU was attached, but no driver was installed, so Windows could not name the card. Once the driver went in, a 1,600-row AI run dropped from more than two hours on CPU to four minutes.
One more rule fell out of this: an AI failure costs one row, never the run. Early on, a single failed model call could crash a whole conversion. Now a failed call sends that one row to review, and everything else finishes.
SQLite on a network share: no WAL
The app started single-user, with JSON files in the user's profile. Then the team wanted a shared workspace on a network drive: several reviewers, one set of runs, one history.
SQLite fits, with one catch. Its write-ahead log (WAL) mode keeps an index in shared memory, and SQLite documents it as unsupported when the same file is opened from several machines. That is exactly the network-share case. So the workspace uses the older rollback journal:
conn = sqlite3.connect(path, timeout=8.0, isolation_level=None)
conn.execute("PRAGMA journal_mode=DELETE") # never WAL on a share
conn.execute("PRAGMA busy_timeout=8000") # second writer waits, not fails
# writes use BEGIN IMMEDIATE: take the write lock up frontRollback mode serialises writers under a file lock. A write either commits or raises an error. It never silently loses a row, which plain JSON files could do when two people saved at once.
What made the move painless: records that used to be JSON are stored verbatim as JSON next to the indexed columns. The rest of the app reads the same dictionaries as before, so the change was a storage swap, not a behaviour change.
Wrapping a closed .NET platform from Python
The source platform is a Windows desktop application with a .NET API and nothing for Python. This integration was the most painful part of the project. Three choices made it workable.
Put a process boundary in the middle. A small .NET console adapter starts once per session. The Python app drives it over stdin and stdout, one JSON object per line. Long operations stream progress events before the final reply. Simplified, an exchange looks like this:
→ {"id": 7, "cmd": "read", "item": "..."}
← {"event": "progress", "id": 7, "done": 3, "total": 12}
← {"id": 7, "ok": false, "step": "read", "error": "...", "detail": "..."}Bind at run time, ship nothing of theirs. The adapter loads the vendor's assemblies from the user's own install when it starts. It builds anywhere against reference packages, and none of the vendor's code is redistributed.
Make every failure say where it failed. You can only test against the real platform on the client's machines, so every error names the step that failed and carries the platform's own reason. When something breaks in the field, the log says whether it is our code, the platform, or the environment, and that usually settles it in one round instead of five.
The target is a cloud REST API, which is easier. One habit worth stealing: after a push, read the record back and report what the target has, not what you sent.
Licences with no server
An app that cannot phone home cannot use an activation server. The licence is a small JSON file signed with Ed25519. The app carries the public key and checks the file offline:
payload, sig = lic["payload"], bytes.fromhex(lic["signature"])
canonical = json.dumps(payload, sort_keys=True, separators=(",", ":")).encode()
PUBLIC_KEY.verify(sig, canonical) # any edit, say to "expires", breaks thisThe licence file is the activation key. It is deliberately not locked to a machine: virtual desktops get rebuilt, and a machine fingerprint would lock users out after every rebuild. Usage metering was considered and dropped, because a local counter is easy to reset and treats the customer as an adversary.
A Python app also ships readable source by default. The app is compiled and its data is encrypted before it leaves CI. None of that is unbreakable. It moves the bar from "open the folder" to deliberate reverse engineering, and the contract covers the rest. Saying that bar out loud was more useful than pretending there was none.
Shipping without being in the room
- Installers come from CI for Windows and macOS. SHA-256 checksums go in the release notes, because the customer's IT checks them.
- Test the release build before you tag. Our repository does not allow deleting tags, and a few version numbers were burned by builds that failed after tagging. Now the Windows build runs on the branch first.
- Expect the installer to run while the app is open. One machine ended up with two parts of the app at different versions. The app now refuses to start on a version mismatch and says why.
- Unsigned executables get flagged. Antivirus blocked the app once. An allow rule fixed it for now, and code signing is the durable fix.
What I'd tell myself at the start
- Decide what a wrong answer costs before choosing where the AI goes. Here it cost a lot, so the AI went last.
- Treat "no match" as a feature with its own UI, not a failure state.
- Do the arithmetic on local inference before promising anyone a run time.
- Put a process boundary around anything you cannot test locally, and make its errors name the step.
- Most field failures are environmental. Logs that prove which environment problem it is save days of back-and-forth.
The app keeps growing as the team asks for new features. The design rule has not changed since the first week: the AI is the last resort, and a blank with a reason beats a confident wrong number.