Calibrated Ideas
← All posts

A Writing Room, Built by Opus 5

I asked Opus 5 to build a tool for comparing two layouts of the same piece of writing. All 52 tests passed, but when I tried it I found a button still showing after it should have disappeared.

The Wordroom comparison panel, showing the same short poem set two ways side by side: on the left, version A under the heading More breathing room, its lines widely spaced; on the right, version B headed Closer together, the same words set tighter. Each card carries a Keep this one button.

Most writing tools ask you to choose a typeface. That is a hard question to answer in the abstract, and an easy one to answer badly, because the sample text is never yours. A specimen sheet reads beautifully. Your own paragraph, at the width and spacing you actually use, may not.

So the brief I wrote asked a narrower question: of these two, which reads better?

Two versions of the same text, the reader’s own text, with exactly one property changed between them. The difference named in plain language, “More breathing room” against “Closer together”, with a small factual note underneath saying what had actually moved, in this case line spacing. Choose one, and it goes into the page you are reading; then the next pair changes something else. No scores, no recommendation, no claim that one is better.

I wanted the comparison to change the layout and leave the writing alone. For a poem or a piece of technical writing, that includes the line breaks and indentation.

I gave the brief to Opus 5, one of Anthropic’s Claude models, and asked it to build somewhere other than my machine. It took a throwaway Linux box over SSH, from ssh railway.new, which hands you a container and a preview URL without an account. The first box came with a build window, and the window closed while the work was still in progress. That turned out to be the least interesting problem of the day.

What it got right

The discipline around the text held. Every piece of writing goes onto the page as text and never as markup, so nothing a reader pastes can be interpreted as anything other than what it is. Poems and technical writing are rendered verbatim, with the whitespace preserved as typed. Only prose is split into paragraphs, and only because paragraph spacing cannot be compared without paragraphs to space.

I gave it the awkward case deliberately: a fragment carrying −196 °C, 0.07 mK, a drift figure of ±0.4 mK/h, four-space and eight-space code indentation, and a numbered list. Symbols, units and indentation came through every view unaltered, including the printed page.

It made one judgement I would not have thought to specify. When the property under test is the width of the column, showing the two versions side by side would squeeze each into half the screen, which is precisely the thing being judged. So in that one case, and only that one, the two versions stack full width instead. A 64ch measure cannot be assessed in a half-width card.

It also wrote fifty-two tests that run without a browser, driving the page against a stub. They cover the things that would fail quietly: that the exported style never contains the writing, that a cancelled tour restores exactly what was there before, that preferences hold presentation and nothing else.

Here is the result. It is the same page, embedded.

Paste something of your own into it. Open it in its own tab if the frame feels tight.

What it could not see

I opened the page and sent back a screenshot of one panel. The tour of complete looks was running, at look three of eight, with the name and description showing and the four controls beneath. Sitting above all of it, still visible, was the button that starts the tour.

The cause was ordinary. The button sits in a row laid out with display: flex, and the code had correctly set the hidden attribute on it. But an author stylesheet outranks the browser’s own, so display: flex quietly overrode the display: none that hidden is supposed to carry. The test checked for the hidden attribute. It was there, but the browser was still displaying the button.

This reminded me of a thermometer calibrated in the lab and then fitted in a thermowell. The certificate tells you how the thermometer performed under the test conditions. To know what it will read in use, you still have to consider the temperature gradient down the thermowell.

The fix took one line, applied globally rather than to the single button, since two other elements would have hit it later.

Fonts and privacy

The first build loaded its fonts from Google. The app now serves the three font files and their licences itself, about 190 KB in all. The browser can load the page without sending a request to Google.

No cookies are set, so there is nothing that needs a banner. The switch that remembers your preferences is off until you turn it on, and it keeps your choices about spacing and width, never a word of your writing.

I was pleased with how it handled the line breaks and indentation. I’d have spent a fair bit of time getting that right. A browser test that checks whether the button is visible would have caught the problem.