Skip to content

Keep the site note inside a headerless workspace, and update the nightly tests to the shipped behavior - #509

Merged
max-sixty merged 3 commits into
mainfrom
fix/ci-34342437953
Sep 9, 2026
Merged

max-sixty merged 3 commits into
mainfrom
fix/ci-34342437953

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

The daily complete-suite run on main went red with eleven failures (run 34342437953). None of them is a flake: every one reproduces locally at 26754cc4, and each traces to a change that landed since the previous nightly and could not be gated by it. The two scheduled runs are ~70 commits apart — the one before this ran at 7e403108, so this was the first complete suite over that whole span, and eleven failures is what a span that wide accumulated.

Ten of the eleven are the nightly-only tests still describing a behavior a shipped change has replaced, or an arrangement a shipped change has moved. One is a real defect on https://leaf.page/.

The site defect

docs/sitenote.js looked for main > :only-child > header and, finding none, dropped the site's context label beside the workspace under main. That second element under main is exactly what syncRootWorkspace reads to decide a workspace is not the page's root, so the note cost the example the bounded allocation it is published to demonstrate: notification-playground arrived on the site in ordinary document flow with no bounded regions at all. It became reachable when #481 compacted the example and removed the <header> the note had been landing in — the site's placement rule had been resting on markup the example was free to drop.

The note now gives a headerless framed task a header of its own rather than standing beside it. The generated header is marked lf-ui, like the note it carries, so the example's anchorable reading is unchanged. The framed root is still read as main's only element child: narrowing that to the lf-workspace tag would have moved the same defect onto live-progress, whose root is lf-monitor.

test_published_workspaces_keep_their_allocation_under_site_context is what let the original defect through — it named two examples, so neither live-progress nor current-proposed-comparison was gated. It now derives its parametrization from the corpus, covering every example whose whole main is one framed task, and reads the root by the lf-workspace-arranged class the runtime marks any arranged workspace with rather than by tag. Under the tag-name selector that gate fails on live-progress and passes on the other three.

The stale readings

Failure What moved under it
test_a_key_on_screen_is_a_key_that_works, test_no_two_hints_on_the_key_line_say_the_same_word #494 renamed version.previous/version.next to version.later/version.earlier, added 1–9 numbered travel to the menu's aria-keyshortcuts, and set promoteEscape: false on both of the menu's doors out, so the compact line now prints the walk beside numbered travel rather than the Escape return. The assertions name the new commands, keys, and words.
test_the_layer_traps_no_margin_in_the_panel_it_draws The test picked its page as the first corpus source shipping any .jsonl. #505 added current-proposed-comparison.jsonl, which sorts first and holds one widget action and no conversation, so the panel opened on nothing and the test's own positive control — a rule planted to trap a margin against a thread's quoted address — found nothing to plant against. The selection now asks for a log holding an anchored comment.
test_page_round_trip, test_browser_and_file_captures_stop_at_the_same_widget_fences[1,2] #471 keeps an open thread card standing in a stable page margin. Both tests send a comment and then reach for something underneath the card it leaves open: the board column the drag is aimed at (the board is a wide widget, so its columns run out into that same band) and the composer field for the next passage. Both now dismiss the card first, which is what a reader does.
test_an_exported_page_fixture_stands_on_its_own[notification-playground, corpus] The copy's unshown reading reported section#notification-artifact — the slot notification-playground authors hidden so that notification-artifact is bound before the agent captures it. lf-source renders a no data caption into it, and the reading counted those words as content a copy had lost. A slot the markup hides is hidden on the live page too, so the copy withholds nothing; [hidden] joins the reading's exemptions. Across the whole corpus this exempts that slot and nothing else — every other fixture's reading is already empty.
test_the_feature_gallery_keeps_its_real_actions_reachable[390] The gallery is ~20,000px tall at 390px, and its arrival cascade after the test's bare page.reload intermittently raises ResizeObserver loop completed with undelivered notifications — the platform reporting a deferred delivery. The repo already adjudicates that notice over two attempts on the same document, in render_harness.navigate and again in the render gate's own arrival readings; this reload was the one that bypassed it. It goes through navigate now.

Verification

uv run pytest tests --run-nightly on this branch: 2327 passed, 6 skipped, 10 failed in 45:23. All eleven of the run's failures pass. Every one of the ten remaining failures is this sandbox's, not the branch's — none appeared in the CI run, and all ten reproduce identically with tests/ and docs/ checked out at the merge base. They are three capabilities the container withholds: no IPv6 for the two stated-host wildcard binds tests/CLAUDE.md already names, no AF_UNIX socket for the two app-server tests, and a denied process_singleton socket for the six that launch the installed Chrome from a subprocess (Check failed: socket() failed: Operation not permitted) rather than through the pinned headless shell the fixtures use.

uv run pre-commit run --files over every changed file: passed.

How the two non-obvious causes were established

test_page_round_trip fails deterministically at 26754cc4 and passes with skills/ and examples/ checked out at 7e403108; swapping either alone still fails, because examples/layer.json at head names a package the older skills/ has not got. Swapping the pair commit by commit lands on #471, and a probe of document.elementFromPoint at the drop coordinate returns div.lf-margin-thread-body — the card the comment opened, over the column.

The gallery's notice was traced by wrapping ResizeObserver on the page and recording each callback's construction site per frame. With the reload followed by a settle, no notice arrives at all and no gesture in the test produces one; the frames that raise it are the post-reload arrival cascade, in which body height climbs from ~18,000 to ~20,500px across a dozen frames while three observers deliver on each.

…tly tests to the shipped behavior

The daily complete-suite run on main went red with eleven failures. The two
scheduled runs are about seventy commits apart, so this was the first complete
suite over that whole span, and none of the eleven is a flake: each reproduces
at 26754cc and traces to a change the nightly could not gate.

docs/sitenote.js looked for a header under main's only child and, finding none,
dropped the site's context label beside the workspace. A second element under
main is what tells the runtime the workspace is not the page's root, so the note
cost notification-playground the bounded allocation it is published to show. It
became reachable when #481 removed the header the note had been landing in. The
note now gives a headerless framed task a header of its own.

The other ten are nightly-only tests describing behavior a shipped change has
replaced or an arrangement one has moved: #494's renamed version commands and
numbered travel, #505's first-sorting log with no conversation in it, #471's
thread card standing over the board column and the next composer, the
notification playground's authored-hidden artifact slot in an exported copy, and
the feature gallery's post-reload ResizeObserver notice, which the repo already
adjudicates over two attempts everywhere but this one bare reload.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Narrowing the framed-root selector to the lf-workspace tag regresses live-progress, which is the same defect this PR fixes for notification-playground.

examples/live-progress.html puts lf-monitor as the only element child of main. lf-monitor is a workspace root — its connectedCallback calls arrangeReadingElement({ kind: "workspace", header: direct(this, "header"), ... }), so it takes lf-workspace-arranged, goes through syncRootWorkspace, and fitRootReadingElement short-circuits to setPosture("flow") whenever data-lf-root-workspace is absent. The old :scope > :only-child > header matched its authored <header>; :scope > lf-workspace:only-child does not match lf-monitor at all, so the note falls back to main, which is the second child that costs the example its allocation.

Measured on the built site through test_site.py's hosted fixture at 1200×900, /examples/live-progress/:

note's parent data-lf-root-workspace data-lf-posture
base HEADER.lf-arranged-furniture lf-arranged-before present bounded
this branch MAIN absent flow

test_render_widgets.py pins that example to bounded at 1100×780 without the note, so this is a live change to what leaf.page serves, not a latent one.

Restoring the old breadth fixes it — the generated-header half of the change is what was missing, not the tag. With const framed = main.querySelector(":scope > :only-child");, live-progress returns to bounded with the note in its arranged header, and review-queue, notification-playground, and current-proposed-comparison all still pass test_published_workspaces_keep_their_allocation_under_site_context.

That test is also what let this through: it parametrizes only review-queue and notification-playground, so neither the lf-monitor root nor current-proposed-comparison is gated. Adding them is what keeps the site's placement rule from resting on which tag the corpus happens to use next.

Everything else in the diff checks out — each of the eleven nightly cases passes here, and the [hidden] exemption, the anchored-comment corpus selection, and the navigate swap all hold.

Comment thread docs/sitenote.js Resolved
The tag-name selector missed lf-monitor, so live-progress lost
data-lf-root-workspace and dropped to flow posture — the same defect
this PR fixes for notification-playground. The only-child form restores
the old breadth; the generated header covers the headerless case.

test_published_workspaces_keep_their_allocation_under_site_context now
derives its parametrization from the corpus instead of naming two
examples, and reads the root by the lf-workspace-arranged class the
runtime marks any arranged workspace with rather than by tag.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

MainChildren is a third tag-stack walk over documents leaf.structure already reads, and it is the one that does not honour HTML's optional end tags. implicit_closes in that module — the module this file now imports VOID_TAGS from — states the invariant it breaks: "Two parsers walk the same documents ... and version check accepts an omitted </p>, so a tree they disagreed about would be a passage one of them puts in the wrong section."

So an example that omits a </p> under main reads as one element child here and as two in the browser. framed_root_examples() then names a page that is not a framed root; the runtime counts two children, syncRootWorkspace withholds data-lf-root-workspace, and the nightly gate goes red on a page with no site-note defect. Confirmed against the two readings: <main><p>intro<section><h2>A</h2></section></main> gives ['p'] from MainChildren and ['p', 'section'] from parse_structure, with parse_structure().errors empty — so version check admits the markup that splits them. An unclosed <li> does the same to everything after the list.

parse_structure gives the reading the runtime takes, in four lines, and returns the same four names on today's corpus. Replacement in the inline comment.

Comment thread tests/test_site.py Resolved
MainChildren did not honour HTML's optional end tags, so an example that omits a </p> under main read as one element child in the test and two in the browser. version check admits that markup, so the gate could name a page the runtime does not treat as a framed root. parse_structure is the reading version check and the browser share; it returns the same four examples on today's corpus.
@max-sixty
max-sixty merged commit 52fab47 into main Sep 9, 2026
7 checks passed
@max-sixty
max-sixty deleted the fix/ci-34342437953 branch September 9, 2026 15:09
leaf-agent added a commit that referenced this pull request Nov 22, 2026
This week's duplicate sweep of `dev/`, `build/`, `tests/` and `worker/`
(week 47) moves six duplicated helpers onto one home each and moves
every caller. Behavior stays the same. The touched model tests, the dev
js_facts tests and the Worker's routing, storage and index tests pass. A
script compared the old and new outputs of the consolidated `leaf_dev`
functions and the seeded-log reads across the corpus, and they match.

| Question | Home | Copies removed (introducing PR) |
|---|---|---|
| Which stylesheets do the core and the bundled packages ship, leaving
out vendored files? | new `interact_support.shipped_sheets` | `sheets()`
in `test_interface_fonts.py` (#4804) and `test_theme_tokens.py` (#6025).
Five inline loops in `test_interact_layer.py` (#3138, #3886) |
| Run `tests/js_facts.mjs` | `interact_support.js_facts` (#2666) | its
own subprocess call in `dev/tests/test_js_facts.py` (#5118) |
| Lowercase hex of bytes in the Worker | `routing.hex`, which is
`newSessionId` (#313) renamed, plus a `sha256Hex` in `storage.ts` | the
publication-identity and chunk-digest copies in `storage.ts` (#2652) |
| Is this pid alive? | `leaf.machine.pid_alive` | `_alive` in
`tests/process/test_codex_tool.py` (#3331). `running()` in
`test_interact_layer.py` (#1774) |
| Read an example's seeded log | `read_event_lines(seed_log(source))`
(#4484) | inline parsers in `test_render_pages.py`,
`test_interact_product.py` (#924) and `test_render_gate.py` (#509). The
last one split lines with `splitlines()`, which also breaks at U+2028 |
| Paths of the bundled registries and packages; which registry keys name
elements | `leaf.schema.ASSETS` / `BUNDLED_PACKAGES` /
`DEFAULT_PACKAGE`, `leaf.registry.contract.is_element_name`,
`docs.registries()` | `docs.py`'s own `ASSETS`/`PACKAGES` (#3593) and
its `startswith("lf-")` checks (#2660). `logs usage`'s hand-written
regex and registry list (#5970). `ROOT / "packages" / "default"` in
`stills.py` (#3927) and `test_product_page.py` (#3593) |

`is_element_name` and the two checks it replaces give the same answer
for every key in the bundled registries today. A selector key such as
`lf-options.selected` would have passed the `lf-` prefix test.

<details><summary>Sets found and left alone</summary>

- **Sets an open PR is changing.** Nothing in this diff overlaps another
open PR's hunks. #6732 moves tests out of `test_render_gate.py`,
`test_render_pages.py` and `test_interact_layer.py`, but none of the
tests changed here.
- **Changes to browser tests with nothing run to check them.** The WCAG
contrast computation exists as about 11 copies across browser, journey
and model tests. Other copies: about 9 `EDITOR_ROOTS` shadow-root
keepers, the `/api/interaction` batch predicates, CDP `touch()`
closures, one-line patch templates, reply-holding route handlers, and
the `data-lf-entry` runtime-module import snippet in
`dev/leaf_dev/states.py` and in tests. Each would mean editing browser
tests that this sweep can't run on a shared host. They suit a sweep that
can run those tests.
- **Vendor bundling.** `build/browser/build.mjs` builds signals-core and
Lit with esbuild calls that repeat `build/vendor.mjs`'s `bundle()`.
Merging them changes build options and needs a full `check:browser` byte
comparison, so it was left for a change that runs that.
- **Copies that are near but not the same.** `_build.py`'s `check_links`
repeats `leaf_website.released_path`, but it also needs the matched
page's root and kind. The list of API-key variables an eval drops is
repeated across Python and the Promptfoo configs, as subsets and
supersets of one another. The Codex token-expiry check has different
thresholds, 1 h and 60 s.
- **Too small to be worth it.** Picking a free loopback port
(`eval_user.py`, `interact_support.available_loopback_port`). The XDG
state root in `leaf_dev.state_home` and `leaf.state.state_home`. The
`settled` helper in two `tests/runtime` files.

</details>

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