[Divergent Signal]
Quant + AI Research Terminal
A web terminal where the optimizer says how much to hold, the agents say why — and the rows that matter are where they disagree.
Every day my optimizer produces weights for Brazilian, US and crypto assets, and the agent pipeline writes a rating for each one. Both were files on disk; nobody could read them side by side.
Solo: data contracts, the runner that connects both systems, the Postgres schema and the React front end (started in an AI app builder, then developed locally).
Optimizers give weights with no narrative; agents give narrative with no sizing. Worse, an early version of the site showed things the system never produced — seeded debates, hard-coded rates — fatal for a product aimed at regulated advisors.
01 · Runs as the core entity
Each execution is a run: summary, optimizer result and one decision per asset. A run switcher in the top bar scopes every page, and the run id lives in the URL.
02 · Divergence as the hero signal
An asset is flagged when the optimizer gives it at least 10% weight but the agents rate it Underweight or Sell. A conviction matrix (weight × rating) puts every asset in one of four quadrants.
03 · Binding contracts
TypeScript types mirror the Python JSON field by field, so a backend change breaks the front-end build instead of rendering blanks.
04 · File-first, database as mirror
Results are files per run, synced to Postgres behind read-only RLS. Reruns never overwrite history.
05 · Honesty gates
A written list of what is real and what was fabricated. Seeded ratings, synthetic news and invented debates were removed from code and database; where there's no AI output yet, the page says “AI pending”.
! brokeThe app downloaded only the first 1,000 frontier points, so the chart was thinner than the run.
→ changedPaginated the query and checked the plotted count against the run's.
! brokeThe hero card printed a Sharpe ratio under a “return %” label.
→ changedOne <Metric> component that carries the unit together with the value.
! brokeSeed data looked like real AI output on public pages.
→ changedHonesty gates, deletion from code and database, and explicit empty states.