Headwind

Architecture

System overview

A Next.js web app, a background worker and one SQLite database on one server.

The parts

Web appPages, CSV import, reply entry and review controls. Reads the database; queues work but never calls Crustdata or cfo.ai itself.
WorkerClaims queued reviews with a lease and runs their steps in order: match companies, check listings, assess, forecast, sync to cfo.ai.
DatabaseSQLite: agency, clients, roles, evidence, cases, decisions, tasks, replies, forecasts and each run's steps.
CrustdataCompany enrichment (/company/enrich) and role listing search (/job/search), API version 2025-11-01.
Model gatewayAn OpenAI-compatible model writes case notes and reads client replies. It never sees fees, probabilities or expected totals.
cfo.aiHolds the Reviewed and Downside scenarios. Written and read back over MCP. Main is never written.
neatlogsReceives a trace of each run's steps and model calls.

Boundaries

What data goes where

Client domains and role titles go to Crustdata. Case evidence summaries and reply text go to the model gateway. Scenario totals go to cfo.ai. Run steps and model calls go to neatlogs.