A client checklist with no checkboxes in it
· 4-minute read · Engineering · by Direct Softworks
Our onboarding list could say a contract was signed when none existed. Now it is computed from the records, and only three facts are still ticked by hand.

The client page in our management panel used to carry a five-item onboarding checklist: contract signed, advance received, access credentials shared, brief completed, kick-off call done. Somebody ticked each item by hand.
"Contract signed" did not know whether a contract existed. It could be ticked with no contract on file and left unticked next to a fully executed one, and nothing noticed either way. It was a to-do list that could disagree with the database.
That was tolerable while only we looked at it. Then the same information started feeding each client's own portal, and a tick that lied would now lie to the client.
Compute what the database already knows
Two of the five items are facts the database records anyway: a signed contract is a row with a signature date, and an advance received is a recorded payment against an invoice. Those two are now derived. They are read off the rows, shown read-only, and stamped with the document that proves them, a contract number or an invoice number.
The other three stay tickable, because no row knows them: whether the kick-off call happened, whether the brief arrived, whether the access credentials did. And the server action that records a tick refuses the two derived items outright. The interface no longer offers them, but hiding a control is not the same as refusing it, and a hand-written "contract signed" would put a tick on the client's portal that no contract supports.
Five stages, each answering only for itself
The checklist became a line of five stages: offer, agreement, setup, build, delivered. One function builds it from plain inputs, the offers, contracts, projects and invoices for that client, and each stage decides its own state.
Offer is done when an offer was accepted, or when there was never an offer but a contract exists, because plenty of work is agreed on a call and goes straight to paper. Agreement is done only when both sides have signed. An earlier version accepted the client's signature alone, and the document list on the same page then said "awaiting our signature" under a ticked dot. Setup is done when a project has actually started, which proves the kick-off happened whatever anybody remembered to tick; the tick is the fallback.
Build and delivered carry a guard that looks pedantic: there must be at least one project. "Every project is finished" is true of a client with no projects at all, and without the guard a client with a single invoice and no project would have been shown a completed line for work that never existed. Vacuous truth is a real bug in a rule table, and it hides in every every().
Money is deliberately not a stage. An invoice can be outstanding at any point, and a stage for payment would make the line run backwards for a client who pays the advance on day one.
The dot that certified a signature nobody gave
The first version of the line filled in backwards from the furthest stage reached, on the reasonable grounds that a line with a hole in it looks like a bug. If the project was delivered, surely the offer and the agreement had happened.
That is an inference, and on the client's own page it became a statement. A client saw all five stages ticked and a message saying everything had been handed over, while the panel, about that same client, said the agreement had never been executed. The line was certifying to the other party of a contract that a document had been signed when no signature was on file.
So the line no longer infers. Each stage answers only for itself, and a stage behind the furthest point reached that the record cannot evidence is marked skipped: drawn, muted, and silent about what it does not know instead of claiming something it cannot prove.
One card, and the order is the product
Alongside the line, the function returns the things waiting on the client, sorted by a priority table, and the client sees only the first. Overdue money comes first, because it is the only item where waiting has a cost that keeps growing. Then signing the agreement, because nothing else can proceed without it. Then answering an offer, then signing a form, then the brief, then an invoice that is due but not late.
That ordering is a product decision that happens to live in a code file, and it is treated as one. There are six kinds of request, and a seventh needs an argument, because the design depends on showing one thing at a time.
No imports, so it can be tested
The module imports nothing: no database client, no framework, no React. Plain objects go in and plain objects come out, so a script can run the whole rule table, 88 assertions at the moment, as part of the normal test run. That matters more than usual here, because our local environment cannot reach the production database at all, and these rules would otherwise be testable only in production.
The client portal and the panel both call the same function, so they cannot disagree about the rules. They disagreed twice anyway, through their inputs: the panel passed no public links for invoices, which removed the "invoice due" request entirely, and it passed projects the portal filters out. Sharing a function shares the rules, not the inputs, and every new caller has to copy the filters exactly.
The wider point
A checkbox is an opinion about a fact. When the fact is already in your database, the checkbox can only ever agree with it or be wrong, so compute it and keep the ticks for the things no record can know. Same instinct as the handover checklist: a list is only worth something when each line can be checked against evidence, not against somebody's memory.