Transparent Maintenance OS — One Database, an Agent Desk, and Nothing Ever Deleted
Operations · agent-in-the-loop ·
The internal operating system for a six-person maintenance company: one Postgres database, a static page, twelve serverless functions, and an agent that works its own task queue twice a day.
Problem
A small services company accumulates tools faster than people: a CRM, a field-service system, a calendar, a chat platform, an ad platform. Each is wired to the next by an automation nobody remembers, and the question "who owes what, by when" has no single answer.
The constraint that shaped the answer was cost. The system had to be a thin, zero-hosting layer over one database, which forced a rule that turned out to be the design: no tool ever talks to another tool. They talk to the database.
Constraints
- Nothing is ever deleted. Soft delete from the UI; every change since 2026-09-11 is in the audit log with before and after values.
- The free hosting plan allows twelve serverless functions, and all twelve are in use.
- The agent desk never sends email, touches sequences, deletes, or writes to the field-service system, the calendar or the chat platform.
- A claim the company makes to a prospect on a call is gated by a column that defaults to false.
My role
I designed the operating model (a task is done once, a process repeats and spawns tasks, a role owns processes), the hub-not-mesh architecture, the agent desk and its hand-over rule, and the attribution design. Thirty decision records are mine; the code was built with agents against them.
What shipped
- Roles, processes and tasks with a daily spawn job that is idempotent by construction.
- Read-only mirrors of the CRM, the field-service system and the ad platform, raw first and typed when read.
- Outlook calendar blocks for every dated task, and a real fortnight view that says so when the calendar cannot be read.
- A Growth tab: reactivation ranked by recovery, pipeline clocks, an events ledger with drive times, a scorecard against plan, and a weekly report card frozen on Mondays.
- The Claude desk: a scheduled routine that works Claude-owned tasks at 9:00 and 14:00 ET, answers into notes, opens pull requests, and hands tasks to the person who holds the system it cannot reach.
- A licences panel with per-row renewal windows and a voice gate for the outbound calling agent.
Outcome
- A 62 KB query string, a 400, and a tab that went down — 2,493 accounts on the board × 24-character ids in one filter. Fixed by paging the mirror in memory, and separately by making the optional lookup unable to fail the page it decorates. White paper, section 4
- Attribution by identity: 0 of 585 jobs had a lead source, 72% of customers have a phone — Ad leads match on the last ten digits of the phone first, then email. Cost metrics are null until their denominator exists, and the funnel names the rung that is holding. White paper, section 5
- 9 of 10 agent-owned tasks were parked where nobody looks — The desk now reassigns a task to the person who holds the last system in the chain, with the click path in the notes. "Blocked" means waiting on another task again. White paper, section 6
By the numbers
Accounts on the pipeline board: 2,493. Customers in the field-service mirror: 14,719. Completed jobs with a lead source over twelve months: 0 of 585. Customers with a phone: 72%; with an email: 13%. Serverless functions: 12 of 12. Audit log: every change since 2026-09-11. Decision records: 30. Agent desk runs: twice a day, six days a week.
Hub, never mesh
The database holds the operating model and a merged copy of what every other system knows. Interfaces act on it, connected systems are mirrored into it, connectors move data and hold none. A client's owner follows the CRM until someone changes it on the internal board, and then the board owns it; one column settles the argument.
A snapshot is not a move
The weekly report card graded A on day one because the scorecard counted the nine snapshot rows written when stage history began as wins. The first history row per account is a baseline, and a moves column carries that rule into the table. Same data, zero clients won since plan start.
Stack
Supabase · PostgreSQL · Vercel Functions · TypeScript · Microsoft Graph · Discord · Vercel AI Gateway
Artifacts
- White paper: One Database, Many Connectors (PDF) (doc)
- Transparent Permits (public product from the same company) (live)
- TM Voice (the calling agent) (repo)
Revenue, client names, grades and licence numbers are in the system and not published. Paid-advertising lead volume is a funnel with null cost metrics as of 2026-09-14.