Skip to content

fix(doctests): ship a 256x256 placeholder icon, per the LGX icon contract - #82

Merged
dlipicar merged 1 commit into
masterfrom
fix/icon-256-contract
Aug 19, 2026
Merged

fix(doctests): ship a 256x256 placeholder icon, per the LGX icon contract#82
dlipicar merged 1 commit into
masterfrom
fix/icon-256-contract

Conversation

@dlipicar

Copy link
Copy Markdown
Contributor

What's red

Tutorial Tests fails on both ubuntu and macOS — on master as well as on #81. 208 passed, 3 failed, and all three are one cause cascading:

ERROR: icon does not match the Logos icon standard.
  file:     .../icons/calc.png
  expected: PNG, exactly 256x256
  actual:   PNG, 64x64
  spec:     logos-package/docs/spec.md#icon-contract

nix build '.#lgx' dies for calc_ui, so result-lgx/ is never created; Install the UI plugin then fails on a literal result-lgx/*.lgx; basecamp launches without the plugin and the UI step ends with click("calc_ui"): No clickable element found.

Why now

Not a regression in the tutorial — an upstream contract it had not yet tracked. nix-bundle-lgx 6fb5d5b ("feat: add requirement for icons with manifest 0.4.0") validates the icon from a fixed-offset PNG IHDR read. Per logos-package/docs/spec.md#icon-contract the icon must be exactly 256x256 and is required for type == "ui_qml" — which is exactly calc_ui. The tutorials embed a 64x64 base64 placeholder.

The change

Regenerated the placeholder at 256x256, same solid #2ECC71. It is now a 1-bit palette PNG rather than RGBA, so the embedded blob is shorter than the one it replaces — 280 → 144 base64 chars, 209 → 106 bytes — despite 16x the pixels.

Updated all six embed sites (the executed - run: and the displayed code_block: in each spec, plus each generated doc), the two committed icon copies, the 64×64 comment, and the surrounding prose so a reader is told the size is a hard requirement.

The C++ UI tutorial carried the same 64x64 blob and was passing only because its chain never reaches an .#lgx step. Fixed here too, before it surfaces.

Verification

Rather than eyeballing dimensions, I extracted bundle.sh's validator verbatim and ran the tutorials' own - run: command through it:

icon gate
old 64x64 (control) correctly REJECTED, reproducing the exact CI error text
new 256x256 PASS

Also: both specs still parse as YAML; an independent re-parse of the PNG confirms 256x256, every pixel #2ECC71, all chunk CRCs valid; file(1) and a real decoder agree.

Note on outputs/*.md

These are hand-maintained, not regenerated — they carry deliberate /0.2.0 flake pins that logos-doctest generate does not emit (and CI's Verify markdown generation only checks that generation succeeds; it never diffs). So the doc edits here are mirrored by hand; regenerating wholesale would strip those pins.

🤖 Generated with Claude Code

…ract

nix-bundle-lgx 6fb5d5b ("feat: add requirement for icons with manifest
0.4.0") validates the packaged icon straight out of the PNG IHDR: exactly
256x256, required for `type == "ui_qml"`. The tutorials embed a base64
placeholder that is 64x64, so `nix build '.#lgx'` now fails for calc_ui:

    ERROR: icon does not match the Logos icon standard.
      expected: PNG, exactly 256x256
      actual:   PNG, 64x64

That one rejection is the whole of the red run (208 passed, 3 failed):
`result-lgx/` is never created, so `Install the UI plugin` fails on a
literal `result-lgx/*.lgx`, and basecamp then launches without the plugin
("No clickable element found with text 'calc_ui'").

Regenerate the placeholder at 256x256, keeping the same solid #2ECC71. It
is now a 1-bit palette PNG rather than RGBA, which makes the embedded blob
shorter than the one it replaces (280 -> 144 base64 chars, 209 -> 106
bytes) despite the 16x pixel count.

The C++ UI tutorial carried the same 64x64 blob and was passing only
because its chain never reaches an `.#lgx` step — fixed here too, before
it surfaces.

Verified by extracting bundle.sh's validator verbatim and running the
tutorials' own `- run:` command through it: the old icon is rejected with
the exact CI error text, the new one passes.

outputs/*.md are hand-maintained (they carry deliberate /0.2.0 flake pins
that the generator does not emit), so the mirrored edits there are by hand
rather than regenerated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dlipicar
dlipicar merged commit b8f8741 into master Aug 19, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

📊 Tutorial execution report

Rendered tutorial alongside the commands actually run and their output (updated each run, commit 643af47):

Pages can take a minute to update after the run finishes.

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