Skip to content
Back to case studies

Case Study · AI-Powered CFO OS

MarkOS:
a CFO operating system in production

Azure ACANext.js 16PrismaDouble-entry ledger197 unit testsLP transfer workflowMS Graph

PE and VC fund administration is still largely manual spreadsheets and email chains. The risk is latent. Every LP transfer that goes through email is a future audit finding. The problem wasn't that a better tool didn't exist; it was that building one requires understanding both the software and the fund operation.

What was built

MarkOS is a full CFO operating system for PE/VC fund administrators. The core is a deterministic judgment engine. Not a language model making gut calls, but a 12-rule engine that evaluates LP redemptions, capital calls, and distributions against codified policy. Every decision has a traceable audit chain.

The most complex piece is the LP transfer workflow. Moving a limited partner position between funds or between LPs requires GP consent, CPA coordination, a reclassification journal entry, and a chain of document verification. Six phases. Each phase has its own state machine, its own rules, its own escalation path. This workflow was built, tested with 197 unit tests, and handed to the first client with a 41-case showcase covering every possible state.

The LP transfer workflow

Phase 1

Intake + GP consent gate

Transfer case creation, GP consent tracking, inline buying-LP creation. Atomic actions: decline, withdraw, close.

Phase 2

Delegation + Research & Present

3-way delegation (CFO / GP wants to discuss / CPA). Deterministic fact sheet. Research & Present substate with version history.

Phase 3

CPA tax alignment + doc checklist

TaxTreatmentPlan, TransferDocChecklist with per-item upload/review/waive. Deterministic doc checklist template by LP type.

Phase 4

Journal entry + ledger

Atomic Prisma transaction: DR/CR LP equity subaccounts, position update, audit event, immutable log. Safety invariant check.

Phase 5

CPA notification + LP portal

Non-blocking MS Graph email dispatch. LP portal read-only view. Happy-path Playwright e2e.

Phase 6

Observability

Structured Pino logger with 20 event kinds. TransferMetricsCard: by-status counts, closed-last-30, time-in-state.

Technical architecture

The stack is Next.js 16 with React 19, Prisma 6 with PostgreSQL + pgvector, and NextAuth 5 for authentication. The multi-tenancy layer uses AsyncLocalStorage + a Prisma extension scoping every query to the active tenant. 22 models covered, with explicit `dbUnscoped` escape hatches for auth routes and cron jobs.

Deployed to Azure ACA (Canada Central). PostgreSQL 17 + PgBouncer + Redis on Azure. Azure Bicep IaC. CI runs on self-hosted runners. The schema drift gate in CI fails the build if Prisma schema diverges from migration files.

A production AI orchestration system ran parallel work: code review, test generation, security audit, documentation. The human conductor made every architectural decision and reviewed every artifact before it shipped.

Outcomes

197
Unit tests covering LP transfer workflow
41
Seed cases spanning all 9 workflow states. Handed to first client
6
Workflow phases, all code-complete and merged to main
~98
Prisma models across the full fund admin domain

What this means for a client

If you're building a complex workflow product. One where business logic is non-trivial, audit trails matter, and the state machine has more than five states. This is the reference architecture. Deterministic judgment over language model guess. Every decision traceable. Every state transition tested.

The same pattern applies to compliance-adjacent software, healthcare workflow, legal tech. Any domain where "it worked in testing" isn't good enough and the audit log is a first-class requirement.

If you're building this

Need a fractional CTO who's shipped TEE + agent infrastructure?