Repository navigation
A page's copy of a package keeps the sheets its sheets import - #6011
Merged
Merged
Conversation
`page init --package ./pkg` copied a package's top files and directories into the page but not a sheet one of its sheets imports from elsewhere in the package, the `@import "./styles/tabs.css"` split packages.md documents. Init passed, and every later read of the page refused to compose its layer; `package check --render`, which starts such a page, refused too while plain `package check` passed. The install copy already followed imports, in its own listing of what a layer input reads. `layer.package_files` is now the one listing, with the imported sheets, and both copies write it.
# Conflicts: # src/leaf/runtime_selection.py
max-sixty
marked this pull request as ready for review
November 18, 2026 06:32
leaf-agent
approved these changes
Nov 18, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 18, 2026
…s it missed (#6377) `layer.input_paths` and `layer.package_files` each listed what a layer input reads, by different rules: `input_paths` followed the imports of every top-level `.css` in an input, while composition and `package_files` follow only the sheets the layer composes. Both now take one walk, `_input_entries`. `input_paths` resolves each path it yields, and `package_files` reads the files among them. This follows #6011, which made `package_files` the one listing for package copies. A new test records every sheet composing the layer reads and holds `input_paths` to it. It found two kernel sheets `composed_sheets` reads by name that `KERNEL_STYLES` didn't list, `styles/control-face.css` and `styles/shadow-leading.css`, so a `leaf-dev preview` missed an edit to either. `KERNEL_STYLES` now names both. Behavior changes: `input_paths` no longer follows the imports of a top-level sheet the layer doesn't compose, and a package copy reads `instructions/` one level deep, as composition does. Two tests that used one scratch directory as the kernel and then as a package now put the importing sheet in a package. Tests: `tests/model/test_interact_layer.py` passes. `dev/tests/model/test_interact_preview.py` has the same 8 failures on its base as with this change, in the desktop-chat, file-subscription and Codex-feedback tests. > _This was written by Claude Code on behalf of max-sixty_
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 package that splits a sheet with
@import "./styles/tabs.css", aspackages.mddocuments, broke any page that selected it by path:page init --package ./pkgpassed, and every later read of the page refused with "cannot compose the page's layer … imports './styles/x.css', which is no file".package check --render, which starts such a page, refused the same way while plainpackage checkpassed. The page's copy took the package's top files and directories and left a sheet imported from anywhere else behind.The install copy already followed imports, in a second listing of what a layer input reads.
layer.package_filesis now the one listing, imported sheets included, and both the page's copy and the install copy write it. The install copy no longer preserves file times or modes outsidescripts/.Found by a package author working from the shipped references in #5981's trials. One model test composes the source, an installed copy and a page's copy and holds them equal; it fails without the imported sheets.