Search was already missing from our SVG toolbar. Print worked. We asked Codex to make one change: turn the green status light orange.
The saved SVG still had one broken reference. Was it the same one?
Start with the original toolbar
The file contains drawings named search and print. Each toolbar button uses an SVG <use> element to display its drawing. The light between them has its own fill.
<use id="search-button" xlink:href="#search-old"/>
<rect id="status" x="38" y="11" width="8" height="8" rx="4" fill="#22786f"/>
<use id="print-button" xlink:href="#print"/>
There’s no drawing named search-old. That explains the empty slot on the left. We recorded the button and the target it tried to load: search-button → #search-old.
Check what a save changes on its own
We used Python’s ElementTree to open and save the original without touching any object. Then we started from the original again and had Codex change the fill on status from #22786f to #ab4f22 using the same library.
We rendered each file in Inkscape 1.4 at 336 × 120 pixels, composited it onto white, and counted the positions where any RGB channel differed from the original. We also checked whether the target of each local <use> reference existed in the saved file.
| File | Unresolved reference | Changed pixels |
|---|---|---|
| Original |
search-button → #search-old
|
0 |
| Saved without an edit |
search-button → #search-old
|
0 |
| Status light recolored |
search-button → #search-old
|
856 |
All 856 changed pixels fell inside the light’s 32 × 32 pixel box. In the difference image below, white marks a changed pixel. The printer’s entire region is black because every pixel there matched the original.
We’d accept the recoloring and track the stale Search reference separately.
What if one warning disappears and another takes its place?
To test our check, we made a separate copy of the original. We left the light green and deliberately changed two references:
- <use id="search-button" xlink:href="#search-old"/>
+ <use id="search-button" xlink:href="#search"/>
- <use id="print-button" xlink:href="#print"/>
+ <use id="print-button" xlink:href="#print-old"/>
Search came back. Print disappeared. The number of broken references stayed at one, even though 4,616 pixels changed. We constructed this pair specifically to see whether our check could catch the swap. See the two toolbars side by side in our article on X.
Here’s what I’d want to see in a review:
Resolved search-button → #search-old
Introduced print-button → #print-old
What I’d put in the pull request
For a small SVG edit, I’d include the name of the object I meant to change, before-and-after renders at the same size, and the references that appeared or disappeared. If the file went through an editor, I’d also include a save without edits so the reviewer can see what that step contributed.
Our check covers local <use> references in this fixture. Gradients, masks and stylesheets would need their own checks. For this toolbar, though, the reviewer can answer the question that matters: Does the printer still work after we change the light?
The experiment grew out of Attentionform’s article about editing Word documents with an agent. The SVG fixture and measurements are our own.



Top comments (0)