← Rounak Sengupta All work

Case Study

Teaching an AI to Show Its Work

Arcana AI can write and run Python to answer hard analytical questions. But for a hedge fund, the hard part was never the code — it was trust. No one acts on a number they can’t verify. Code Mode is the design layer that makes an AI-computed answer auditable enough to act on.

Rounak Sengupta · Product Designer · Arcana AI
0→1
new AI capability
2
prototype iterations
5
part trust receipt
7
result states designed
~12
analytics events specced
Role
Product designer — feature design, PRD reconciliation, interactive prototyping, and engineering alignment on Arcana AI
Scope
A 0→1 trust & validation layer for AI-generated analytics — reconciled PRD plus two interactive prototypes (MVP → future direction)
Key challenge
Make AI-computed numbers trustworthy enough for institutional investors to act on — without turning the chat into a Jupyter notebook for non-technical users
Collaboration
Solo on design; synthesized an engineering + PM review into the spec; open threads with the eng lead on what code belongs in the model’s thought process
Status
In active design. Driving the engineering build — not yet shipped to clients

The 60-second version. Arcana AI runs Python when math is more reliable than an LLM “reasoning” about numbers. Engineering had the execution working; what was missing was any reason for a skeptical analyst to believe the result. I designed a computation receipt — a status chip that expands into what data was used, what was checked, and what didn’t reconcile — plus honest caveat and failure states. After a dev review, I took it further: a multi-step reasoning timeline, and an edit-and-rerun model where validation re-runs with every change. Everything below is the long version.

Prototype

Try It First — Both Iterations

Self-contained, single-file HTML built on the live Arcana AI layout with the product’s real design tokens. Use the switcher inside the prototype to move between states; in v2, edit the code and rerun to watch validation re-bind. (Shown full-width — even better full-screen.)

The Code Mode prototype is a full desktop analytics interface — it needs a wider screen to be usable.

Open on desktop, or launch full-screen: v2 · v1
Multi-step thinking timeline, edit & rerun with live validation, tiered disclosure, and a live analytics-event log. Open full-screen →
The MVP: single thinking box, code block, and the computation receipt across four states. Open full-screen →

The Problem

Code Is Easy to Show. Trust Is Hard to Earn.

Some questions are best answered by running code, not by asking a language model to do arithmetic in its head. “Take my last six months of returns, find the 10 worst drawdown days, and show which positions drove each one” is a join, a sort, and a reconciliation — deterministic work an LLM should never freehand.

So Code Mode generates and runs Python against Arcana’s data, then feeds the validated output back into the answer. By the time I joined the problem, engineering had the mechanics working: a collapsed block showing code and its output. The feature was technically real.

It also had a trust problem that no amount of engineering would fix on its own. The users are portfolio managers and analysts at hedge funds — many of them not technical. When someone like that sees generated code, gets a number back, and doesn’t understand how it got there, one of two things happens: they take it on faith (dangerous), or they stop using the feature (worse). As one engineer put it in review, “users who lose trust early are unlikely to return.” And the stakes are asymmetric — in a financial workflow, a confidently wrong number that someone trades on is far more costly than no answer at all.

The Reframe

Design the Trust, Not the Code Viewer

The existing direction answered “how do we show code and output?” The more useful question was: how do we show reasoning, data, checks, and limits in one coherent flow — so a non-technical user can trust the answer, and a technical one can audit it?

That reframe is the spine of the whole project. The code block stops being the feature. The feature becomes the evidence around the answer: where the numbers came from, what was validated, what didn’t reconcile, and what to be careful about — surfaced by default, with the code itself one layer deeper for the people who want it.

Approach

Three Layers That Stay Stable

The organizing idea: however messy the AI’s reasoning gets — multiple steps, failed attempts, retries — the interface should always resolve to three stable layers. This model is what kept the design coherent as the feature grew.

Process

The thinking

The reasoning timeline — ephemeral. It holds the plan, the data pulls, and any retries (“Attempt 1 failed, refined, re-ran”). Narrates how the answer was reached.

Artifact

The code

The canonical, copyable, auditable code block — durable. Later, editable and re-runnable. In a financial tool, this is the trust anchor; it never dissolves into the transcript.

Result

The answer

The plain-language answer, headed by a status chip that expands into the validation receipt — bound to a specific run of the code.

Principle

Progressive Disclosure, Honestly Done

A non-technical PM should never be forced past the answer. A quant should be able to get all the way to the code in a few clicks. So the default view is calm — answer plus a one-line status chip — and every layer of depth is exactly one expand away: answer → plain-English method → validation receipt → code → full reasoning with attempts.

The hardest calls were about honesty. It would have been easy to hide the messy parts. Instead, caveats and failures are first-class:

Process

From a Forked PRD to a Future-Direction Prototype

The work moved in four passes — each one a different mode of design: untangling a spec, prototyping the core idea, absorbing a hard critique, then pushing the concept forward.

Pass 1 · Specification
The PRD Arrived Forked
A working session had drafted a v2 PRD, but the original PRD held decisions the draft had lost or overridden. Rather than pick one, I reconciled them into a single document with a three-marker system — [locked] (decided in session), [original] (from the source PRD), and [auto-resolved] (my recommended calls, flagged for review). Every decision carried its provenance, so the team could trust the immovable parts and challenge the rest. It also resolved real conflicts: a 120-second timeout, and a broad routing scope with a baseline validation tier rather than refusing anything unusual.
PRD reconciliation Decision provenance Scope & routing
Pass 2 · MVP prototype
v1 — The Computation Receipt
A self-contained prototype, built on the live Arcana AI page using the product’s real design tokens. The answer is headed by a status chip — “Code Mode · Calculated with Python · 4 checks passed” — that expands into a receipt: data sources, universe, method, the validation checks, and any residual. Four states: running, passed, caveat, and a clean failure. This made the abstract “trust” goal concrete enough to react to.
Status chip Computation receipt Caveat & failure states Design-token fidelity
Pass 3 · Critique
The Dev Review
I walked engineering and PM through v1. They confirmed it closed the trust gaps they’d flagged — validation, failure explanations, caveats — and then opened the more interesting questions. The product was heading toward multiple reasoning steps, with code possibly moving inside the thought process. Users would eventually edit and re-run code, which meant validation couldn’t be a static message. And there was no usage tracking yet — we didn’t actually know whether anyone wanted to inspect code at all.
Cross-functional review Future direction Open questions
Pass 4 · Future direction
v2 — Process, Artifact, Result
The second prototype answered the review. A single thinking box became a multi-step reasoning timeline that narrates retries but graduates the final code out into the durable code block. That block became editable and re-runnable, with validation re-bound to each run. Disclosure was tiered so depth never ambushes a non-technical user, a “Why Code Mode?” affordance explains the routing, and the prototype streams a live analytics-event log that doubles as the instrumentation spec for engineering.
Multi-step thinking Edit & rerun Live validation Analytics spec

Deep Dives

Three Decisions Worth the Detail

For anyone who wants past the summary — the three design problems that took the most thought.

Deep Dive 01

The Computation Receipt

Trust comes from traceability, not from a green checkmark. The receipt is the answer to “why should I believe this?” — a fixed structure so an analyst always knows where to look. It lives behind the status chip, so it’s there when wanted and invisible when not.

Data
Exact sources, instruments, and the as-of timestamp. You can’t trust a number without knowing its inputs.
Universe
Which positions were included — current holdings by default, historical only when asked, always stated.
Method
A plain-English description of what the code did, for the non-technical reader.
Checks
The validations that ran, each passed / flagged / skipped — e.g. “contributions reconciled with portfolio returns within tolerance.”
Residual
The size of any discrepancy, in basis points — so “close enough” is a number, not a vibe.

The code itself and the full tolerance formula sit one layer deeper, behind “View code” and “Methodology.”

Deep Dive 02

The Stale State — Designing for Edit & Rerun

When users can edit and re-run code, validation stops being a description and becomes a contract bound to a specific run. The most dangerous moment in the whole feature is the one in between: a user edits the code, but the green “passed” chip from the previous run is still showing. That’s false confidence — the exact thing the feature exists to prevent.

So I designed that in-between state first. The instant code is touched, the receipt grays out and the answer is marked stale: “You’ve edited the code — rerun to revalidate.” Re-running produces a new run with its own receipt, and if the result changed, a “What changed” diff explains how (“you widened the tolerance from 5bps to 10bps; the two flagged dates now reconcile; the caveat is cleared”). A run-history control lets you compare or revert. Validation becomes live — it tells the truth about the code in front of you, not the code from a minute ago.

Deep Dive 03

Code in the Thinking, or the Artifact?

The review surfaced a genuine fork, owned jointly with the eng lead: as the product moves toward multi-step reasoning “like Claude,” does the code live inside the thought process, or stay a separate object?

My position: both, with a clear division of labor. The thinking timeline narrates process — including failed attempts, phrased as refinement rather than raw stack traces so they reassure rather than alarm. But the final, successful code graduates out into the durable code block. In a financial tool, the canonical, copyable, auditable artifact is the trust anchor; dissolving it into a scrolling transcript just because a general-purpose chatbot does would cost more than it gains. That framing turned an open-ended “how should this look” into a concrete decision engineering and the eng lead could build against.

Outcomes

What’s True Today — and How We’ll Know It Worked

Code Mode hasn’t shipped to clients, so there’s no adoption data yet. Two things matter here instead: what the design work has already produced, and the measurement plan that ships with it — because designing the instrumentation is part of the job, not an afterthought.

Shipped into the build

  • A reconciled PRD with every decision’s provenance marked — now the source of truth for engineering.
  • Two interactive prototypes (MVP and future direction) built on real product tokens.
  • A dev review that validated the direction — the trust gaps engineering flagged were confirmed addressed.
  • An instrumentation spec (~12 events) defined with data engineering, ready to wire up.

Success metrics

Targets · defined, not yet measured
  • Code-inspection rate — do users expand the code at all? Resolves the “collapsed by default” bet.
  • Validation-engagement rate — how often the receipt is opened; the core trust signal.
  • Trust-break rate — users who abandon after a caveat or failure. The number to drive down.
  • Rerun adoption — once edit & rerun ships, whether anyone uses it.

One guardrail I pushed for: because the users are hedge funds, no holdings, values, or tickers go into analytics payloads — magnitudes are bucketed, identities are hashed. Worth getting right before the events go in, not after.

Reflection

What the Work Taught

Code Mode sits inside a broader theme in my Arcana work: making dense, high-stakes, increasingly AI-driven information legible enough to act on. Same discipline as the RMS and research work — just pointed at the question of whether you can trust what the machine just told you.