Repository navigation
Read each page vocabulary from one resolution of its packages - #7236
Merged
Merged
Conversation
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]>
leaf-agent
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
leaf package installlanding 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_vocabularyandlayer_widgetstake an already-resolvedLayerVocabulary,read_page_registryand_revision_compositionresolve once (the first also reads the layer record once, after taking its stamp), and_compose_revisionno longer takespage_dir.runtime_selection.executinghad 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 newlayer=keyword ofrevision_vocabulary.Two readers still resolve twice,
page.page_instructionsandpage_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_packageswaps the package's snapshot after each lookup and checks the candidate read, the revision read and the served/registry.jsoneach 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.