Technology

Engineering record

Server and accountsPartly changed

Moving product rules out of the server

The same product rules were in the app, the server functions and the database. Instead of keeping three copies in step, we move them out of the server.

When a rule changes, the app, the server functions and the database all have to change. Miss one and the same record can be judged two ways. Having people keep the three in line more carefully isn't the answer, because a structure where any one of them can be missed stays as it is.

We could keep per-product server functions and generate only the agreement with the app automatically. That works for now, but the server that judges the rules remains. We could also build a Rust server that shares types with the app. But that adds a server that has to stay on all the time, and one more thing to run. We haven't compared hosting yet.

What does the server really need to know?

Once we changed the question, the server's job shrank. It only has to confirm who is asking, store and read records, relay in real time, and make the outside calls that need a secret key. It stores records without interpreting what kind they are. The product rules go in the app's engine.

AI requests go through one relay function instead of two server functions. We expect it to take about 200 lines. For the functions that already-released apps use, we freeze the behavior. We won't change the app of someone using it today just because we're building a new structure.

Still, the server can't know nothing about the product. Things the server has to know, such as usage limits and public records, remain. We decided to treat these as exceptions.

Written from that day’s point of view, using the documents and change history of the time. Published 2026.12.01.