Case study · Design systems and evals

A DESIGN SYSTEM
WITH TWO READERS

Building the measurement that tells you when your system does not work — and publishing what it said when the answer was no.

Faramarz HashemiWritten with ClaudeOctober 2026

A constrained generator beat having no design system, reproducibly. It lost to simply publishing the component registry, reproducibly. And it emitted more raw hex than a plain-Tailwind baseline — the one property the constraint existed to guarantee. Three claims of mine were retracted on the way to numbers that survive being re-run.

Contents

  1. 01The second reader
  2. 02What I was actually claiming
  3. 03The first thing that was broken was the instrument
  4. 04A single run is a coin flip
  5. 05What the measurement actually says
  6. 06The claim I had to retract
  7. 07What I would tell the next person building one
  8. 08Where this leaves the system

The second reader

A design system has always had one reader. Someone opens the documentation, decides which component to use, and writes the markup. The system's job is to make that person's decision easy and their output consistent.

Then a second reader arrived, and it does not read documentation the way a person does. It reads whatever you put in its context, infers the rest, and produces markup in one pass with no opportunity to ask a follow-up question. It cannot be onboarded. It will not absorb your conventions over six months of code review. Whatever it gets wrong, it gets wrong at the speed and scale of generation.

The obvious response is to constrain it: a system prompt that states the rules, an approved component catalog, an explicit instruction to never emit a raw colour. That is what I built. This piece is about what happened when I measured whether it worked, which was not what I expected and not what I would have written up if I had only run the measurement once.

What I was actually claiming

The pitch was that a constrained generator produces better interface code than an unconstrained one. Stated that way it is unfalsifiable, because "better" has no denominator and "unconstrained" has no definition. So the harness fixes both.

Four conditions. Identical task, identical grader, and the only thing that varies is what the model is given.

The four conditions
  • Registry only

    Given the component registry, and nothing else.

    24/24 token gates · 0 raw hex

  • Constrained generatorunder test

    Given the full constrained system prompt.

    22/24 token gates · 14 raw hex

  • Plain Tailwind

    Given a CSS framework, no design system.

    22/24 token gates · 9 raw hex

  • Plain React

    Given nothing.

    0/24 token gates · 679 raw hex

Counts are over 24 cells per condition, ranked by composite score. The system under test places second of four here — and third on raw hex, behind a baseline with no design system at all.

8 tasks, drawn from the domain the system is for: treasury dashboards, cash-position tables, approval gates, confidence displays, form validation, empty and error states. Each one graded on deterministic gates — does it compile, does it avoid raw hex, does it use components from the approved catalog — plus a separate blind score for whether it actually did the task.

The fairness rule is the whole design: only the system under test varies. Which sounds obvious, and which I got wrong in a way that invalidated every result I had.

The first thing that was broken was the instrument

The harness shelled out to a model with no working directory set, so each call inherited the directory it was launched from. That directory was the repository. And the repository contains a rules file stating, in plain language, the rules the grader scores: never use raw hex, consume the semantic token layer, register new components.

Every condition was being handed the answer key. Including the baselines, whose entire purpose is to not have it.

I found this by asking the subprocess a question with a checkable answer — do you have project instructions loaded? — from inside the repository and from an empty directory. Yes from one, no from the other. The fix is one line. The lesson is that I had been about to publish numbers from an instrument I had never pointed at itself.

A single run is a coin flip

With the leak closed, I ran the matrix and got a result: the constrained generator beat the no-system baseline by +2 points. That is nothing, so the honest read was that the constraint did not earn its place.

Then I ran it again, changing nothing. +17 points.

Constrained generator vs no design system
−30 pts±10-pt margin+30 pts

A single run measured plus 2.08 points against the no-design-system baseline, inside the 10-point margin.

+2.08 pts — inside the margin, so "no benefit"

The first single run measured 2.08 points and the second measured 16.52. Either one, published alone, looks like an answer.

Same code, same tasks, same grader. The gap between those two runs is 14 points, which is wider than the 10-point threshold I had set for calling a difference real. My margin was narrower than my noise. Either run, published alone, would have been a defensible-looking number that the next person to run it would have failed to reproduce.

One caveat I owe that comparison: the second run contained a generation that timed out and scored zero, so the two runs do not differ by noise alone. That failure is itself part of the finding — the harness was dropping failed cells out of the average rather than failing them, which quietly flattered whichever condition was slowest, and the slowest condition is the one carrying the largest prompt. Fixing it was a separate change. So the clean statement is narrower than it first looks: two runs disagreed, and one reason was a defect in how the runs were scored.

So the harness now repeats itself and reports the spread, and it takes every verdict from the worst run rather than the average. A mean can clear a threshold while the individual runs straddle it. The worst run clearing is the only version of the claim that survives somebody checking it.

That change is what turned this from an opinion into a result.

What the measurement actually says

Over 3 runs and 96 cells:

Constraining the generator beats having no system. +14 points in the worst run, every run clearing the margin. This is the finding that survives, and it is the smaller of the two.

It loses to simply publishing the registry. -22 points in the worst run. The condition that was handed nothing but a list of available components — no constrained prompt, no rules, no instructions about tokens — beat the thing I built in every run, by between 1.7 and 2.2 times the margin.

And it does not buy the property it was sold on. Token discipline was the whole point of the constraint. The constrained arm emits 14 raw hex values and passes 22/24 token gates. Plain Tailwind, with no design system at all, emits 9. The registry-only condition emits 0 and passes 24/24.

The constrained generator is worse on raw hex than the baseline it was built to beat.

One number, then the shape under it
  • Registry only96%
  • Constrained generator76%
  • Plain Tailwind58%
  • Plain React38%

The headline. The constrained generator places second of four.

The composite still favours the constrained arm, and the per-dimension view shows why: 55 catalog components used against the baseline's 14. The constraint does buy something real. It buys component reuse. It does not buy token hygiene, which is what I had been saying it bought.

The claim I had to retract

An earlier version of this work stated that the constrained arm emitted zero raw hex and was alone in doing so. That was true of the data I had: 8 cells, one run, 0 hex.

At 24 cells it is false in both halves. Not zero, and not alone — the registry-only arm is cleaner. The 14 came from 2 cells, 12 of them in a single form-validation task. One generation, in one task, in one run, moved a number I had already written down and published.

Three of my own claims were overturned between building this and trusting it. The leak invalidated the first set of numbers. The second run invalidated the verdict. The third run invalidated the token-compliance claim I had been most confident about, and which I had put in a changelog.

That is not a story about carelessness. It is what measurement does when you let it run more than once and do not adjust the rubric until it agrees with you — which I was tempted to do, and which would have been the one unrecoverable mistake, because a rubric tuned until the system under test wins measures nothing at all.

What I would tell the next person building one

Point the instrument at itself before you point it at anything else. Ask it a question whose answer you already know. A measurement you have not tried to break is a belief.

Run it more than once before you believe the direction, let alone the magnitude. If the run-to-run spread is wider than the effect, you do not have a result, you have a sample.

Report the worst case. It is the only number that survives someone else running your code.

Put the numbers somewhere they can be checked, and keep nothing in prose that is not derived from them. This page holds no figures of its own. Every value above is interpolated from the committed artifact, and a placeholder that does not resolve fails the build. I added that specifically because I had already published a figure that a larger sample contradicted.

Separate the dimensions. One composite number hid the fact that the system was losing on the property it was designed to guarantee.

Where this leaves the system

Better than nothing, reproducibly. Worse than its own documentation, reproducibly. Good at the thing I was not selling and bad at the thing I was.

I did not re-weight the rubric to fix that, and the harness now prints the unflattering comparison on every run whether or not anyone asks for it.

The honest version of the two-readers idea is not that I built a system the model reads correctly. It is that I built the measurement that can tell me when it does not — and the first thing it told me was no.

← WritingFigures resolve at build time from a committed run artifact