Skip to content

Read each page vocabulary from one resolution of its packages - #7236

Merged
max-sixty merged 2 commits into
mainfrom
agent-af9f4ddbe20238ad1
Nov 26, 2026
Merged

max-sixty merged 2 commits into
mainfrom
agent-af9f4ddbe20238ad1

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A leaf package install landing partway through a cold read of a page's vocabulary could pair one snapshot's declarations with the other's modules, and the page was refused for that one read ("declares verbatim, which a module provides, and has none at widgets/…"). The read resolved the page's package selection three times, for the cache stamp, the registry and the widget list, and the revision reading and its composition did the same.

A read now resolves the selection once and takes the cache key, the registry and the widget list from that one result: layer_vocabulary and layer_widgets take an already-resolved LayerVocabulary, read_page_registry and _revision_composition resolve once (the first also reads the layer record once, after taking its stamp), and _compose_revision no longer takes page_dir. runtime_selection.executing had the same race between the layer's files and the revision's registry, which could leave a page's widgets as plain markup until a reload; it passes the vocabulary it built the files from through a new layer= keyword of revision_vocabulary.

Two readers still resolve twice, page.page_instructions and page_inspection.inspect_artifact; each failure lasts one command that a retry fixes, and fixing either means changing a return type, so they are left.

Codex found this while reviewing #7224; the race predates it.

Tests: test_a_reading_composes_one_installation_of_a_package swaps the package's snapshot after each lookup and checks the candidate read, the revision read and the served /registry.json each hold one installation; all three failed before the fix. lint-imports, pre-commit, and the 158 model and process tests that call the changed functions.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits November 25, 2026 21:19
A `leaf package install` that replaced a package while a page's
vocabulary was being read could refuse the page for that one read. The
candidate's read (`read_page_registry`) and a revision's
(`revision_vocabulary`) each resolved the page's package selection three
times: for the cache key, the registry and the widget list. An install
between two of those met one snapshot's declarations with the other's
modules, and the composer refused, as in "<lf-first> declares verbatim,
which a module provides, and has none at widgets/lf-first.js". A
revision's execution (`runtime_selection.executing`) resolved the
selection once for the layer's files and again for its registry, so a
page loaded in that window could be served one snapshot's files under
the other's registry, its widgets left as plain markup until a reload.

Each of these readings now resolves the selection once
(`layer.selected_vocabulary`) and derives everything from that one
`LayerVocabulary`: `layer_vocabulary` and `layer_widgets` take it rather
than resolving again, and `revision_vocabulary` takes the vocabulary
`executing` composed the layer's files with. That also drops two
redundant resolutions and a second read of the layer record from every
cold candidate read; the record is now read after its stamp is taken.

Two readings still resolve twice, each for one command during an
install: `page.page_instructions` can pair the candidate's registry with
another snapshot's package instructions, and
`page_inspection.inspect_artifact` can raise a KeyError on a layer path
its execution lacks.

Test: `test_a_reading_composes_one_installation_of_a_package` installs
the other snapshot after every resolution of the package's name. On the
base, the candidate and revision readings refuse with the error above
and the execution's raises it too; without the `executing` change, the
execution serves the second snapshot's registry. Ran the model and
process tests that call the changed functions (158), import-linter and
pre-commit.

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

Co-authored-by: Claude <[email protected]>
@max-sixty
max-sixty merged commit 6387dfb into main Nov 26, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-af9f4ddbe20238ad1 branch November 26, 2026 05:34
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