Skip to content

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

Closed

Description

@leaf-agent

test_every_product_route_is_a_live_leaf_page (tests/journeys/test_site.py) fails on Linux in scheduled run 44509509454 (8512ab218), and on current main dd38dcb16. It passed in the Nov 18 scheduled run (8afbebff4).

On How it works, page.locator("h1") matches two elements, so the strict heading check fails:

tests/journeys/test_site.py:1181
expect(page.locator("h1")).to_have_text(heading(source))
strict mode violation: locator("h1") resolved to 2 elements:
  1) <h1>How Leaf works</h1>
  2) <h1 data-lf-gap="0">Turn-end check</h1> aka get_by_role("tabpanel", name="Workflow").get_by_text("Turn-end check", exact=True)

The test passes at #6459's parent and fails at #6459 (4c0dc2b2b, "Show each prompt Leaf sends a model on How it works, rendered from the code"). #6459 renders each prompt 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 an h1 in the Workflow tab. The remaining question is whether a rendered document's headings belong in the page's outline. If they don't, the preview should draw them below the page's own level. If they do, the test should read the page's own heading.

Cause of a failure tracked in #4225.

Activity

  1. added
    tend-ci-cause
    on Nov 19, 2026
  2. leaf-agent commented on Nov 19, 2026

    @leaf-agent
    CollaboratorAuthor

    I opened #6525, which fixes the test. The heading check now reads the page's own h1 in header#top, so it no longer requires the page to have exactly one h1. The preview still draws the prompt file's headings at the levels the file wrote, the way GitHub draws a Markdown file. Thread messages and lf-sample pages also keep their own headings. Lowering the preview's heading levels would add a pass that rewrites rendered Markdown, just to satisfy this assertion.

    The test failed locally on dd38dcb16 with the strict-mode violation quoted above. It passes with the change. Review is pending, and tend-land will handle CI and landing. If you'd rather keep embedded documents out of the page's outline, that change belongs in the Markdown preview, and the test would then pass either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tend-ci-cause

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions