Skip to content

Rebuild the vendored highlight.js bundle at 11.12.0 - #31

Merged
max-sixty merged 1 commit into
mainfrom
chore/vendor-highlight-11.12.0
Aug 24, 2026
Merged

max-sixty merged 1 commit into
mainfrom
chore/vendor-highlight-11.12.0

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Aug 23, 2026 •

Copy link
Copy Markdown
Collaborator

Weekly vendored-bundle sweep. scripts/vendor-highlight.sh held HLJS_VERSION=11.11.1 while upstream is at 11.12.0 — the pin is a shell variable rather than a manifest entry, so dependabot cannot see it and the drift is silent until this step reads it. Bumped the variable and reran the script; the rebuilt bundle is the change, not the version string.

The bundle is a function of both the pin and the registry, since the script reads $languages.names out of registry.json to decide what to bundle. All fifteen declared names still register under leaf's own spelling, with html and toml resolving through the xml and ini aliases — so the page's vocabulary and the tokenizer's remain unable to disagree.

11.12.0 is grammar work, no API change. Among the languages leaf carries: a ReDoS fix in xml removing recursive sublanguage references, a markdown fix that stops a *** thematic break reading as the start of bold text, rust char-literal escapes no longer leaking their highlight past the literal, and keyword or literal additions to css, go, java, javascript, python, and shell.

Verification

hljs.listLanguages() against the new bundle returns exactly the registry's fifteen names, none missing and none extra, and hljs.versionString reports 11.12.0.

Tokenizing round-trips the source words for each of the sampled languages — the UNREAD_SYNTAX contract, checked properly across the corpus by the browser gate below.

Full suite green on this branch — uv run pytest tests --run-nightly gave 1011 passed, 6 skipped in 615.23s. The targeted readings, run first:

tests/test_interact.py -k "language or languages or diff_resolves"   6 passed
tests/test_render.py -k "every_language_returns_the_source
                         or code_is_colored_without_a_word_moving
                         or reader_cannot_tell_from_its_block"       3 passed

test_every_path_a_diff_resolves_names_a_language_the_bundle_carries and test_every_language_returns_the_source_it_was_given are the two that would catch a bundle built from a different list than the registry states.

The pin lives in scripts/vendor-highlight.sh as a shell variable, so
dependabot cannot see it; the weekly sweep is what catches the drift.
The bundle is a function of the pin and the registry's $languages.names,
and rerunning the script is how those two stay unable to disagree: all
fifteen declared names still register under leaf's own spelling, html
and toml through the xml and ini aliases.

11.12.0 is grammar work. Among the languages leaf carries: a ReDoS fix
in xml removing recursive sublanguage references, a markdown fix that
stops a `***` thematic break reading as the start of bold, rust char
escapes no longer leaking their highlight, and additions to css, go,
java, javascript, python, and shell.

@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.

Reviewed the bump; nothing to change in the diff. Rebuilding from scripts/vendor-highlight.sh at HLJS_VERSION=11.12.0 reproduces the committed bundle byte-for-byte, so the artifact is a function of the pin and the registry as the script's header claims, not a hand-edited blob.

One observation, not about this diff: the weekly step names two bundles, and only one moved here. scripts/vendor-marked.sh still holds MARKED_VERSION=18.0.7 while upstream is at 18.0.10 — 18.0.8 published 2026-08-04 and 18.0.10 on 2026-08-18, so both predate this sweep. Nothing else on the branch or in the open PRs covers it, and dependabot can't see that pin either, so it stays invisible until the next weekly reading. Separate concern, separate PR — noting it here because this is where the sweep's other half would have been.

What I checked
  • Reproducible: reran scripts/vendor-highlight.sh on the merged tree; cmp against the committed highlight.esm.js is identical (77602 bytes). versionString in the bundle reads 11.12.0, and npm view highlight.js dist-tags confirms that is latest.
  • The two lists still agree: the bundle's registerLanguage calls are exactly the fifteen names in registry.json's $languages.names — none missing, none extra — with html/toml arriving through the xml/ini aliases.
  • Round trip: drove both bundles over the fifteen languages × nine samples, including the cases 11.12.0's grammar work touches (a markdown *** thematic break, a rust 'a\n' char literal, <script>/<style> nested in html — the ReDoS fix that removed xml's recursive sublanguage references). Zero round-trip failures against the new bundle, so the syntax partition promise and UNREAD_SYNTAX hold.
  • No role silently lost: compared the hljs-* scope set each language emits, old against new. Nothing dropped — which is the failure SYNTAX_ROLE's fall-back-to-plain design would have absorbed without an error. The one change is diff hunk headers now emitting hljs-meta (@@ -1 +1 @@ was bare before), which maps to the existing fn role, so it colours rather than reading wrong.
  • No other consumer: 11.11.1 appeared only in the script and the bundle; nothing pins a size, hash, or version elsewhere. The hljs surface leaf.js uses — getLanguage, highlight, the hljs- class prefix — is unchanged in 11.12.0.
  • CI: every gating check on 6e8367d settled green.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

The review asks for no change to this diff, and the sweep's other half is already covered: #32 rebuilds marked at 18.0.10 and touches only scripts/vendor-marked.sh and the vendored marked.esm.js. It opened at 09:50, six minutes before the review, so the "nothing in the open PRs covers it" reading was stale rather than wrong about the drift — the pin really was at 18.0.7. Both halves of the weekly sweep are therefore proposed, one PR each.

Nothing further to do here. Every gating check on 6e8367d is green.

State of the other half

#32's test check went red at 10:01 on a single failure, test_an_open_tab_reloads_before_posting_through_a_revendored_layer, timing out waiting for a poll response with the counters unmoved (sends=1 acked=1 pending=0 asked=2 heard=2 at both the start and the end of the wait). That test exercises layer revendoring, not thread Markdown, so it is not downstream of the marked bundle; the isolated timeout matches the contention shape rather than a regression. tend-review is still in progress there, and that PR's own run owns its CI — I have not touched it.

@max-sixty
max-sixty merged commit 7fc50b1 into main Aug 24, 2026
7 checks passed
@max-sixty
max-sixty deleted the chore/vendor-highlight-11.12.0 branch August 24, 2026 19:24
leaf-agent added a commit that referenced this pull request Oct 14, 2026
Update Mermaid from 12.1.0 to 12.2.0 and rebuild its committed browser
bundle. Mermaid now resolves KaTeX 0.18.10, above the 0.18.2 patched
floor in [security alert
#31](https://github.com/max-sixty/leaf/security/dependabot/31). The
previous lock resolved KaTeX 0.16.47.

Verification: `pnpm run check:browser` and three focused browser tests
for diagram rendering, SVG references, and label markup passed. The
dependency update leaves the rest of the graph unchanged except KaTeX's
Commander dependency.

Dependabot's [uv update
run](https://github.com/max-sixty/leaf/actions/runs/38195723509) failed
while resolving the Python workspace, but this alert is in the npm lock.
This PR updates the npm path directly.

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 19, 2026
Replace the diagram package's Mermaid renderer with Pele 1.6.0 while
retaining Mermaid source syntax and threads attached to individual
shapes. Leaf registers the same `node:<authored id>` anchors from Pele's
parsed models and rendered boxes across flowcharts, state, class,
entity-relationship and sequence diagrams, including containers and
nested states.

Pele supplies parsing, layout and SVG generation in one lazy,
offline-capable module. The renderer is 666 KB uncompressed (246 KB
gzip), down from 5.25 MB (1.49 MB gzip). Leaf supplies its fonts and
live light/dark palette, disables source links and images, and updates
authored selectors and measured diagram heights in the examples and
documentation. One vendoring adaptation preserves unsupported
HTML-looking tags as escaped label text instead of silently dropping
them; the upstream request is [Pele
#31](obsidianmd/pele#31), also reproduced on
1.7.0.

Validation: focused browser/model checks cover shape-thread submission,
source revision and reload, keyboard and touch selection, all supported
diagram families, duplicate identities, hostile labels, fonts, scheme
changes, SVG definitions and lazy loading. `pnpm run check` covers
reproducible bundles, framework, runtime and Worker tests. Independent
code review and a fresh browser user verified shape-thread behavior;
before/after light and dark views were inspected.

> _This was written by Codex on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Oct 21, 2026
A new nightly test, `test_presses_and_fills_leave_no_element_naming_stale_keys` in `tests/journeys/test_render_navigation.py`, holds the rule `keyboard/scopes.js` states: a module's own state that a row's `when` reads must be a signal. Before this change nothing enforced it, and #3342 found four rows that read plain variables and left `aria-keyshortcuts` or `aria-disabled` stale.

The test runs the probe #3342 used. For each public example and developer page, it makes 40 random presses and fills on visible controls, in an order seeded by the example's name. After each step it waits for the page's readiness, for every send to come back, and for rendering. It then reads every element's `aria-keyshortcuts` and `aria-disabled`, forces a full key repaint (`paintKeys()`), and reads them again. It fails on any attribute the repaint changed, naming the step, the control pressed and the element. The keys themselves still work when a row is stale, since a press reads the rows afresh, so no other test catches this.

## The stale row it found

On this PR's first CI run the sweep failed on `code-comparison`. After a press on a closed tab, the tab strip still named Enter and Space. The strip's "open the tab" row read `aria-selected` on the focused tab, which no signal tracks. A person's press focuses the tab on mousedown and opens it on click, a few frames later. So the strip read the focused tab while it was still closed, and nothing told it to read again once the tab opened. `lf-tabs` now holds the open panel in a signal (`#active`), and the row compares the focused tab with the open one. A new browser-tier test, `test_a_pressed_tab_stops_naming_the_key_that_opens_it`, holds the mouse down for a frame before releasing. It fails on the previous `lf-tabs` and passes now.

I also put #3342's diff-filter fix back (`lf-diff.js` asking `:focus-within` directly), and the sweep failed on `diff-thread-gallery`, naming the diff whose `aria-keyshortcuts` kept or lost `Escape`.

## Waits instead of the probe's fixed delay

The probe waited a fixed 400 ms. Two of its findings were readings taken mid-operation rather than stale rows. A live sample's Reset is `aria-disabled` while its child loads, and the child finished loading between the two readings. A playground's Build query was `aria-disabled` until its send came back. The test waits for page readiness, which counts each sample's arrival, and for `round_trip`, so neither reads as stale.

## Write-watch findings on the sweep's path

The random presses also met three findings from the write watch, which this change fixes so the test passes:

- **The merge film** (`examples/wt-merge.page/film.js`) removed every annotation note and drew it again on each paint. The painter dropped unseen parts before `#paintNotes` marked the notes as seen; it now drops them after every layer has painted. The corpus copy is regenerated.
- **The playground's Copy button** wrote the same `data-copy-state` again when pressed twice within two seconds. It now writes through `keeps`.
- **Sortable** sets a card's `draggable` to false on every release of its grip, whether or not the press became a drag. It is vendored, so `write_watch.js` lists that write in `EXPECTED`.

## Cost

Locally, under load from other sessions, the 28 cases take 202–306 worker-seconds in total over seven runs (about 3.5–5 worker-minutes), and 70–78 s of wall time on 4 workers. The slowest are `wt-merge` and `pr-walkthrough`, each up to about 40 s. It runs one seed; the decision estimated about 6 worker-minutes per seed.

This is Max's decision #31 (option C) on the overnight report.

> _This was written by Claude Code on behalf of max-sixty_

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 21, 2026
… signal (#3456)

A new nightly test,
`test_presses_and_fills_leave_no_element_naming_stale_keys` in
`tests/journeys/test_render_navigation.py`, holds the rule
`keyboard/scopes.js` states: a module's own state that a row's `when`
reads must be a signal. Before this change nothing enforced it, and
#3342 found four rows that read plain variables and left
`aria-keyshortcuts` or `aria-disabled` stale.

The test runs the probe #3342 used. For each public example and
developer page, it makes 40 random presses and fills on visible
controls, in an order seeded by the example's name. After each step it
waits for the page's readiness, for every send to come back, and for
rendering. It then reads every element's `aria-keyshortcuts` and
`aria-disabled`, forces a full key repaint (`paintKeys()`), and reads
them again. It fails on any attribute the repaint changed, naming the
step, the control pressed and the element. The keys themselves still
work when a row is stale, since a press reads the rows afresh, so no
other test catches this.

## The stale row it found

On this PR's first CI run the sweep failed on `code-comparison`. After a
press on a closed tab, the tab strip still named Enter and Space. The
strip's "open the tab" row read `aria-selected` on the focused tab,
which no signal tracks. A person's press focuses the tab on mousedown
and opens it on click, a few frames later. So the strip read the focused
tab while it was still closed, and nothing told it to read again once
the tab opened. `lf-tabs` now holds the open panel in a signal
(`#active`), and the row compares the focused tab with the open one. A
new browser-tier test,
`test_a_pressed_tab_stops_naming_the_key_that_opens_it`, holds the mouse
down for a frame before releasing. It fails on the previous `lf-tabs`
and passes now.

I also put #3342's diff-filter fix back (`lf-diff.js` asking
`:focus-within` directly), and the sweep failed on
`diff-thread-gallery`, naming the diff whose `aria-keyshortcuts` kept or
lost `Escape`.

## Waits instead of the probe's fixed delay

The probe waited a fixed 400 ms. Two of its findings were readings taken
mid-operation rather than stale rows. A live sample's Reset is
`aria-disabled` while its child loads, and the child finished loading
between the two readings. A playground's Build query was `aria-disabled`
until its send came back. The test waits for page readiness, which
counts each sample's arrival, and for `round_trip`, so neither reads as
stale.

## Write-watch findings on the sweep's path

The random presses also met three findings from the write watch, which
this change fixes so the test passes:

- **The merge film** (`examples/wt-merge.page/film.js`) removed every
annotation note and drew it again on each paint. The painter dropped
unseen parts before `#paintNotes` marked the notes as seen; it now drops
them after every layer has painted. The corpus copy is regenerated.
- **The playground's Copy button** wrote the same `data-copy-state`
again when pressed twice within two seconds. It now writes through
`keeps`.
- **Sortable** sets a card's `draggable` to false on every release of
its grip, whether or not the press became a drag. It is vendored, so
`write_watch.js` lists that write in `EXPECTED`.

## Cost

Locally, under load from other sessions, the 28 cases take 202–306
worker-seconds in total over eight runs (about 3.5–5 worker-minutes),
and 66–78 s of wall time on 4 workers. The slowest are `wt-merge` and
`pr-walkthrough`, each up to about 40 s. On this PR's CI run, the 23
cases among the job's 25 slowest tests took 510 worker-seconds,
`file-tree` the longest at 85 s, so the sweep costs about 9
worker-minutes there. It runs one seed; the decision estimated about 6
worker-minutes per seed.

This is Max's decision #31 (option C) on the overnight report.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 25, 2026
The user judged focus rings too central to Leaf for another per-case
fix. This reverts the branch's two ring commits: the ring room shared by
every sticking block (647ef69) and the Web Awesome host margin at Tab
arrival (4eb1eef). Main keeps #3939's track-only room and #3916's
Copy-only margin.

notes/focus-ring-room.md lists the six cases found so far, with their
measurements and reproductions, the two mechanisms behind them, and the
two candidate fixes tried. TODO #31 asks for one mechanism once the list
shows its shape.

Co-Authored-By: Claude Opus 5.5 (1M context) <[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