Skip to content

test: read How it works' own heading from its header, not every h1 on the page - #6525

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6519
Nov 19, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-6519

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_every_product_route_is_a_live_leaf_page now reads each product page's heading from the page's own header (#top h1) instead of asserting that the page holds a single h1. Since #6459, How it works shows each prompt Leaf sends a model in an lf-text-document preview="markdown", and the turn-end check's prompt (skills/leaf/references/turn-end-check.md) opens with # Turn-end check, which the preview draws as a second h1. That made the strict page.locator("h1") match two elements.

The repair keeps both #6459's intent and the preview's behavior: a Markdown preview draws a file's headings at the levels the file wrote, as GitHub draws a file, and Leaf's other embedded documents (a thread message's Markdown, an lf-sample's page) keep their own headings too. Shifting the preview's heading levels would add a rewrite pass over rendered Markdown to satisfy a test. Every file in docs/ carries its h1 in header#top, so the assertion still protects what it did: each route draws its authored title heading.

Verification: the test failed on dd38dcb16 with the strict-mode violation the issue quotes, and passes with this change (uv run pytest "tests/journeys/test_site.py::test_every_product_route_is_a_live_leaf_page").

Closes #6519 — automated triage

… the page

#6459 shows each prompt Leaf sends a model in a Markdown preview on How it
works, and the turn-end check's prompt opens with `# Turn-end check`, which
the preview draws as an h1, as GitHub draws a file's heading. The product-route
journey asserted that the page holds exactly one h1, so it failed strict mode.
It now reads the h1 in the page's own header (#top), which every product source
carries; what it protects, that each route draws its authored title heading, is
unchanged, and the preview keeps drawing the file's headings as written.

Closes #6519
@leaf-agent
leaf-agent merged commit 78d3c57 into main Nov 19, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6519 branch November 19, 2026 16:28
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.

test_every_product_route_is_a_live_leaf_page: How it works draws a second h1 from the turn-end prompt since #6459

1 participant