Skip to content

leaf page init --package ./theme composes a theme without the base it names, which leaf package check enforces #6820

Done

Description

@max-sixty

A package selected by path that declares $theme.base composes over the page's own theme, and its base is never read. A base that isn't installed passes leaf page init and leaf page check, while leaf package check on the same directory refuses it. An installed base isn't composed either, unless it is already the page's theme, so the author sees their theme drawn over reading, or over nothing with --no-theme, rather than over the base it names.

Reproduce on 8f7d552ecd:

mkdir mytheme
echo '{"$theme": {"base": "nosuch"}}' > mytheme/registry.json
echo ':root { --lf-accent: red; }' > mytheme/defaults.css
leaf package check ./mytheme              # status 1: 'mytheme' builds on theme 'nosuch', which is not installed
leaf page init page --package ./mytheme   # exit 0
leaf page check page                      # status 0

leaf page state page then shows the layer as {"packages": ["./packages/mytheme"], "theme": {"name": "reading", …}}.

Where. package check composes a package over themes_under (src/leaf/themes.py:153), which follows base_chain and refuses a missing base. A page composes with_theme(packages, theme) (themes.py:140, called from src/leaf/vendoring.py:368), which reads $theme.base for the page's recorded theme only. --theme takes only a theme themes.toml lists, so a theme being written can be the page's theme only after leaf package install and a catalogue entry.

Decision. Whether page init composes a selected package's base chain under it, as package check does, or refuses or reports a $theme it won't read.

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

Activity

  1. added
    bug
    backlog
    next
    agent-experience
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-experiencebacklogbugnext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions