Case study · November 2026 — now
PRIVATEIstova
A managed platform where specialist agents do real work under approval gates — and the product, not the model, owns the policy.
- Module boundaries
- 18
- Decisions recorded
- 43
- Shared contracts
- 21
- Commits
- 67
Role · Sole engineer — architecture, contracts, control plane, gates
Context
Istova is the second system I have built for agents rather than for people. The first one grew by accretion: tools were added as they were needed, and the record of why was a chat history. That works until a decision has to be reversed, and then nobody can say what the decision was.
This one started from the opposite end. Eighteen module boundaries, twenty-one shared contracts and a decision register came before the features, because the expensive mistakes in an agent platform are architectural: who owns tenancy, who owns model choice, and what happens when the deployed artifact is not the source you think it is.
It is in development, private, and described here at the level of design rather than deployment. That is a deliberate limit, not modesty.
The problem
Agents without a policy plane are a liability
An agent that can call a model, a shell and a payment API needs a boundary that is enforced before execution, not audited afterwards. Spend limits, per-tenant quotas and approval gates are product concerns, and they cannot live inside a prompt.
The runtime is not the product
Provider choice, fallback and execution belong to the runtime. Identity, tenancy, tasks, approvals and billing belong to the platform. Merging them means every provider change becomes a product migration.
Deployed reality drifts from source
The most dangerous bug in this class of system is a deployed worker that contains routes the configured source does not. A rebuild from source then deletes working capability silently.
Constraints
- One engineer, and the platform has to stay operable by one person
- Private while the brand and trademark position are unresolved
- Single-tenant today — isolation must be proven before a second tenant exists
- Every module ships behind a numbered gate with owner approval
- No second model gateway: one runtime, one provider surface
Decisions
The choices that carried most of the system. Each one lists the alternative that was on the table and the bill that came with the choice.
A shared relational schema with a tenant discriminator, a single scoped data-access layer, and row-level security as a second wall.
- Not this
- A PostgreSQL schema per tenant — the model I chose for Deltern, where each customer had a dedicated database surface.
- Why
- The two systems have opposite constraints. Deltern tenants are few, large and isolated by contract; this platform is managed cloud with many small workspaces, where migrations must be one operation, not one per tenant. Isolation is enforced centrally, then re-checked by the database.
- The cost
- Every query has to go through the scoped layer or it is a defect, and the runtime database role must not bypass row-level security — a default that has to be deliberately removed. No second tenant is onboarded until negative tests prove reads, writes, lists and vector queries all deny foreign scope.
The runtime owns providers, models and fallback; the platform owns budgets, quotas, approvals and the usage ledger.
- Not this
- Building an OpenAI-compatible proxy inside the product, so every model call passes through my own gateway.
- Why
- A second gateway duplicates the runtime, doubles the failure surface and freezes model choice behind my release cadence. Splitting ownership keeps one place that knows about providers and one place that knows about money.
- The cost
- An enforcement point has to exist between preflight authorisation and execution, and usage has to be reconciled after the fact — the platform cannot see the token count until the run reports it. Fail-closed on high-cost work means some legitimate runs are refused.
One authoritative source file, one build configuration and one reproducible artifact per deployed service, enforced in CI.
- Not this
- Trusting wrangler.toml to describe what is deployed.
- Why
- A verification pass found the deployed worker was a superset of the configured entry point: approvals, an AI lane and signed webhooks existed only in the deployed copy. Rebuilding from the configured source would have deleted them without an error.
- The cost
- The fix is slower than the incident: verify the live deployment, adopt the superset as canonical, repoint the build, backfill the tables that were created out of band, smoke-test a preview, record a rollback target — and only then delete the stale copy.
Delivery is a sequence of eighteen gates, each with evidence and an owner decision.
- Not this
- Building all modules in parallel and declaring the platform ready when the screens look finished.
- Why
- Agent platforms fail in the seams: identity before tenancy, tenancy before tasks, tasks before approvals, approvals before billing. A gate that will not open is the only reliable way to keep that order when one person is doing all of it.
- The cost
- Progress is slower and visible, and the platform looks less finished than it is at every point before the last gate.
How it is put together
- Product plane
- Identity, tenancy, workspaces, tasks, approvals, policies, billing and usage — the authority every other plane answers to.
- Runtime plane
- Agent execution on Hermes: sessions, provider configuration, model selection, fallback and traces. Owned by the runtime, not reimplemented.
- Knowledge plane
- One cross-module knowledge layer for facts and lessons with freshness, so a module cannot invent its own version of the truth.
- Domain plane
- Eighteen modules — research, engineering, media, domains, finance, learning, operations and others — each with its own contracts, policies and migrations.
- Data
- PostgreSQL for product state with row-level security, D1 at the edge where a Worker needs local reads, R2 for objects with tenant-prefixed keys.
- Surfaces
- Web first, mobile next; the API and the contracts exist before either surface is finished.
What broke, and what it taught
A case study that only lists wins is a sales page. These are the defects the audit found in my own system, how each surfaced, and what fixing it takes.
Defect
Two worker entry points: 1,120 lines deployed, 1,011 lines configured, and the deployed one was the superset.
Found by
A verification matrix run against the live deployment, not against the repository.
Fix
Adopt the deployed file as canonical, point the build at it, lint the source that actually ships, and record a rollback target before deleting the stale copy.
Defect
Four tables existed in production but in no migration — created by hand, invisible to a rebuild.
Found by
The same verification pass, comparing live schema against the migration history.
Fix
Backfill them into migrations and add a schema-drift check, so the next out-of-band table fails CI instead of appearing months later.
Defect
Row-level security is bypassed by default on the managed Postgres role.
Found by
Reading the provider documentation while writing the isolation decision, before any code depended on it.
Fix
A non-bypass runtime role, FORCE ROW LEVEL SECURITY, and negative tests that attempt cross-tenant reads on every path, including exports and vector queries.
Defect
The decision register was being treated as documentation rather than as a gate input.
Found by
Rebranding an existing system: several decisions had been reversed in code with no entry recording it.
Fix
A decision is not closed until the gate that depends on it cites it. Forty-three entries, each with the rejected option and the cost, is the only reason this page can be written at all.
Evidence
- 43 architecture decisions recorded with the alternative rejected and the cost accepted
- 21 shared contracts and 18 module boundaries defined before feature work
- 67 commits across the platform, contracts and gates
- Sanitised architecture walkthrough available on request — no endpoints, keys or tenant data
Checked 30 November 2026. Private by design. Walkthrough on request — no endpoints, keys or tenant data are shared.