Skip to content

agent-guide: require measuring grid-anchored sixels, not eyeballing#85

Merged
tig merged 1 commit into
mainfrom
docs/verify-grid-anchored-sixels
Jun 10, 2026
Merged

agent-guide: require measuring grid-anchored sixels, not eyeballing#85
tig merged 1 commit into
mainfrom
docs/verify-grid-anchored-sixels

Conversation

@tig

@tig tig commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Closes the doc gap behind #84: agents (and humans) recurrently verify the wrong invariant when checking sixel recordings. They confirm the sixel appears in the GIF, or that agg rendered it faithfully at the requested cursor cell, and call it done — which misses size/position errors. The headline example is the ~4% undersize from the advertised cell resolution not matching agg's rendered font cell (#84); a 4% gap is invisible to the eye but trivial to measure.

This edits the source agent/RECORDING-AGENT.md (and regenerates the embedded cmd/tuirec/agent-guide.md via go generate):

  1. Corrects an inaccurate claim. The "Sixel graphics in GIFs" bullet said sixel apps "size their raster to match agg's cells" — but that match is exactly what Advertised sixel cell resolution doesn't match agg's rendered font cell — sixels render ~4% undersized #84 shows is broken. Reworded, and the mismatch is now listed as a caveat with a pointer to verify by measurement.
  2. Adds "Verifying grid-anchored sixels — measure, don't eyeball." States the invariant (does the rendered sixel cover the cells it was meant to cover, in position and size?) and gives the cheap recipe: extract a frame, measure agg's real cell from a known grid reference (cellPx = spanPx / cells; not imageWidth / colsagg adds margins), read the app's raster size from the DCS header (P…q"a;b;W;H), reconcile, and confirm the rendered bbox spans the intended cells.

Why

Found while building an agent verification loop for Terminal.Gui (gui-cs/Terminal.Gui PR #5482, #5478). I made this exact mistake: verified agg was pixel-faithful to the requested cell and declared success, but never checked the raster size against the layout target — so a sixel that rendered ~1.7 cols short of a dialog border slipped through until caught by eye. The fix is to make the guide demand a measurement for anything grid-anchored. The same recipe is now in the downstream Terminal.Gui guide (Scripts/tuirec/README.md).

Verification

  • go generate ./cmd/tuirec/ — embedded copy regenerated; source and embed are byte-identical.
  • go build ./... — passes.

🤖 Generated with Claude Code

Agents recurrently verify the wrong invariant for sixel recordings: they
confirm the sixel appears, or that agg rendered it faithfully at the
requested cursor cell, and stop there. That misses size/position errors —
notably the ~4% undersize from the advertised cell resolution not matching
agg's rendered font cell (#84). A 4% gap is invisible by sight.

- Corrects the "Sixel graphics in GIFs" bullet, which inaccurately claimed
  apps "size their raster to match agg's cells" — that mismatch is exactly
  #84 — and adds it as a caveat.
- Adds a "Verifying grid-anchored sixels — measure, don't eyeball" bullet
  with the cell-calibration recipe: measure agg's real cell from a known
  grid reference, read the app's raster size from the DCS header, reconcile,
  and confirm the rendered bbox spans the intended cells.

Regenerated cmd/tuirec/agent-guide.md via go generate (verbatim sync).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tig tig merged commit 59fa88b into main Jun 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant