Skip to content

Refresh public example preview manifest - #164

Merged
max-sixty merged 3 commits into
mainfrom
codex/refresh-example-previews
Aug 31, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/refresh-example-previews

Conversation

@max-sixty

@max-sixty max-sixty commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

The complete nightly suite on main caught a stale public example-preview input digest after the preview-handoff and runtime changes were combined with #161. This branch now includes the later main updates from #163 as well, then regenerates through scripts/example-previews.py; all nine preview images remain byte-for-byte unchanged.

Validation on that merged tree: all 20 tests in tests/test_site.py pass, followed by every pre-commit hook.

This was written by Codex on behalf of max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputs_sha256 is correct for this branch's base (b4a5aeb), but main has moved to d755e18 ("Keep page chrome on the document coordinate plane"), which edited four digest inputs under skills/leaf/assets/runtime/. On the merge result the digest is a5fbd867a36f22f1d71d2e82a7eafb03cfeb4037eff1d7f04490cfff569a059c, not aa676dc2… — so the assertion this PR set out to fix still fails once this lands.

This PR's own ci run can't show that: test_site.py is pytest.mark.nightly and ci.yaml passes --run-nightly only on push, so a green check here says nothing about the digest. Note inline on the file for what I'd regenerate rather than hand-edit.

The same collision is queued behind #163, which touches skills/leaf/assets/runtime/ and examples/release-notes.html — both digest inputs. Whichever of the two lands second re-stales the manifest, so this regeneration is worth doing as the last step before merging rather than up front.

How I checked

digest(capture_input_files()) is a pure function of tracked file bytes, so I recomputed it against three trees with the same code scripts/example-previews.py uses:

tree computed digest manifest says
b4a5aeb (this branch's parent) aa676dc2… ae6f4b2d…
8731acf (this PR's head) aa676dc2… aa676dc2…
d755e18 / merge result a5fbd867… aa676dc2…

So the fix was right when it was written; main moved underneath it. The four inputs d755e18 changed are skills/leaf/assets/runtime/chrome-style.js, geometry.js, living-margin.js, and composing/surface.js.

The nine recorded per-image sha256 values all match the checked-in JPEGs on this branch — that part of the manifest is consistent.

Comment thread docs/example-previews.json Resolved
@leaf-agent

Copy link
Copy Markdown
Collaborator

Dispatched for ci run 33359081160 (6bbfb4b), which ends 1 failed, 1568 passed, 6 skipped — this digest is still the only red on main, and this PR is the thing that clears it.

The collision the review above named has since landed: #163 merged as 7f58225 and moved six hashed inputs again, so at main's tip the computed digest is 3e83775774fd235aea33e549841d6481e734543dc22a54d44b5eee8f2185c3ea. This branch's aa676dc2… is now two moves behind — a5fbd867… was the d755e18 merge result, and the tip has moved past that too. Rebasing onto 7f58225 and regenerating there is what greens main; regenerating before the rebase just produces a third stale value.

One thing is different this time. Every re-staling so far came from runtime code, which the recapture answers with the hash alone — this PR's diff is one line and no image bytes. 7f58225 also edits examples/release-notes.html, authored copy inside a captured example, so the regeneration at the tip may move example-release-notes.jpg as well rather than only inputs_sha256. That is a reason to run the script rather than hand-edit the hash to the value above.

Measured

digest(capture_input_files()) from scripts/example-previews.py, 145 hashed files, in a worktree checked out at each commit:

tree manifest computed
6bbfb4b (the failed run's commit) ae6f4b2d… aa676dc2… stale — the run's own two values
d755e18 (this branch's base) ae6f4b2d… a5fbd867… stale
7f58225 (main tip) ae6f4b2d… 3e837757… stale

The 6bbfb4b row reproduces the two hashes in the run's assertion exactly, which is what says the method here matches the gate's.

git diff --name-only d755e18 7f58225 hashed inputs: assets/leaf.js, assets/runtime/anchors.js, assets/runtime/composing/aim.js, composing/surface.js, composing/targets.js, and examples/release-notes.html. Its examples/corpus.html is not hashed — capture_input_files() excludes that name.

No PR from this run: a recapture taken here would re-set the gallery in the runner's substituted faces, per #133.

@max-sixty
max-sixty merged commit 77a8681 into main Aug 31, 2026
12 checks passed
@max-sixty
max-sixty deleted the codex/refresh-example-previews branch August 31, 2026 05:48
max-sixty pushed a commit that referenced this pull request Aug 31, 2026
…#167)

## Problem

The nightly `test` job failed on [run
33360981578](https://github.com/max-sixty/leaf/actions/runs/33360981578)
(7f58225) with two failures.

`test_the_public_catalog_is_a_visual_index_of_full_page_routes` failed
on the preview digest, and that one is already fixed: #164 landed the
refreshed manifest right after 7f58225, the test passes at main's head,
and the nightly run on 77a8681 was green.

`test_a_specimen_holds_a_wide_exhibit_inside_the_column` is a stale read
rather than a layout regression, and it is still live. At the failing
read every box on the page already measured the narrowed window —
`#spec` 332px, the board's box 305px, `main` 380px — while
`document.documentElement.scrollWidth` still answered 596, the width the
document scrolled to before the window narrowed. So the assertion named
the specimen's containment for something the specimen had already got
right.

Chromium publishes the document's own scrolling area in the rendering
update *after* the one that dispatches `resize`, and `resized()`
returned as soon as the event reached its listeners. Measured on the
specimen page narrowed to 380px, with a fresh load per probe point so no
read forces the layout the next one asks about — identical across three
runs of the set:

| read taken at | `documentElement.scrollWidth` |
| --- | --- |
| the resize handler | 596 |
| a task behind the handler | 596 |
| that update's animation frame | 596 |
| the next update's animation frame | 596 |
| a task behind that second frame | **380** |

## Solution

`resized()` now waits one rendering turn once the resize event has
reached its listeners, with `page.evaluate(ONE_FRAME)` — the module's
own one-turn wait, the one `navigate` takes after the readiness stamp.
It resolves in that turn's animation-frame callback, so the caller's
next read is a round trip behind it, which is the first point the
measurement above shows settled.

Fixed in the shared helper rather than in the one test:
`document.documentElement.scrollWidth` is read after a resize in five
browser modules — `test_render_options.py`, `test_render_pages.py`,
`test_render_controls.py`, `test_render_widgets.py`,
`test_render_projection.py` — and all of them were reading at the same
stale point. It costs one frame per `resized()` call.

## Testing

<details><summary>Reproduction, bug-back, and suite</summary>

- Reproduced on main at 77a8681: 5 failures in ~180 runs of the test as
written, `-n0`, with the identical read (1 in the first 6).
- The probe table above is the deterministic form of it: the stale value
is reachable at four defined points and gone at the fifth, 3/3 per
point.
- After the change: 60/60 runs of
`test_a_specimen_holds_a_wide_exhibit_inside_the_column` on `d7d9fc2`,
the `ONE_FRAME` form; 30/30 on the first push's hand-rolled poll, which
it replaced.
- `uv run pytest tests --run-nightly -n 2` with this change on 77a8681,
main's last green head: 1569 passed, 6 skipped.
- The same suite on this branch's base (bba885a): 14 failed, 1558
passed, 6 skipped — the same fourteen, test for test, that main's own
[ci run on
bba885a](https://github.com/max-sixty/leaf/actions/runs/33364553456)
reports. They are that commit's, not this change's, and `tend-ci-fix` is
already running on them.
`test_a_specimen_holds_a_wide_exhibit_inside_the_column` passed in that
run.
-
`tests/test_site.py::test_the_public_catalog_is_a_visual_index_of_full_page_routes`
passes at 77a8681, which is what confirms the digest half of the
original run was #164's. It is red again at bba885a, on that commit's
own preview inputs, and is one of the fourteen above.

</details>

---
Automated fix for [failed
run](https://github.com/max-sixty/leaf/actions/runs/33360981578)

---------

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants