Repository navigation
Make Leaf configuration inputs explicit - #642
Conversation
…oundation # Conflicts: # scripts/CLAUDE.md
leaf-agent
left a comment
There was a problem hiding this comment.
Making the package selection explicit is the right simplification, and the CLI/adapter rework holds together — scripts/site.py already selects ./docs/package explicitly, so the published site is unaffected, and the shipped guidance no longer mentions the implicit overlays anywhere.
Three browser tests that write a tmp_path/.leaf overlay were not given the new explicit "./.leaf" selection, so the overlay is no longer vendored and the behaviour they name is gone:
tests/test_render_conversations.py::test_a_boxless_widget_in_a_reply_still_shows_the_parts_it_paints— its.leaf/theme.csssetslf-options { display: contents }; without it the widget draws asblockand the boxless-fallback assertion fails.tests/test_render_options.py::test_local_work_chrome_does_not_take_its_holder_gesture— its.leaf/registry.jsongiveslf-optionanx-workcontent seat; without itleaf status --on job-mountsexits with "job-mounts has no local work seat".tests/test_render_controls.py::test_a_stale_package_widget_uses_recursive_parent_eligibility— its.leaf/registry.jsondeclareslf-quota; without it the fixture version fails to activate with "unknown widget — not in the vendored registry.json".
All three pass at the merge base (da716dbe) and fail at d716b21b; I ran the three files together at this head and got 3 failed, 226 passed. They carry nightly, so uv run pytest tests and this PR's test job deselect them — the PR's "1,040 passed" reading is accurate as far as it goes, and that is the problem: this lands green and reddens the next daily complete-suite run on main.
A fourth case is the same mechanism without the red. tests/test_render_controls.py::test_a_self_eligibility_check_reads_state_before_its_optimistic_gesture writes an overlay setting x-state.choose.requires to {"target": "self", "awaiting": true} on lf-options. The default package declares no requires under choose, so with the overlay dropped the press it makes is unconditionally eligible and the test passes while exercising nothing of the self-eligibility door it is named for. It needs the same packages=(*EXAMPLE_PACKAGES, "./.leaf") argument as its neighbours, and no run will tell you so.
Separately, dropping BESIDE_TRAYS also dropped the assertion in test_the_layer_sheets_spell_the_runtime_s_layout_numbers that held the sheets and the runtime equal on which tray takes a strip. The constant genuinely drove no runtime behaviour — covers: () => key === "leaves" || trayCovers() never read it — but the test did, and it was the only thing binding theme.css's html[data-lf-restore-tray="asks"] and html[data-lf-live]:has(body[data-lf-auxiliary-surface="asks"]) rules to that condition. The two now state complementary halves of the same fact independently, so a third tray can make them disagree with nothing failing. chrome.css's header comment describes exactly this pattern for the widths it still covers.
The fixes for all four tests are the one argument the rest of the suite already takes; happy to push them as a commit if you'd like.
Select the test-authored `./.leaf` package explicitly so the declared-shadow revision fixture follows the package cutover from #642. Validated with all 119 revision-projection tests. > _This was written by Codex on behalf of max-sixty_
Leaf accumulated ambient behavior across environment variables, wrapper scripts, implicit package overlays, a dormant hosted-task mode, and an exported tray constant that did not own runtime behavior. This change makes those inputs explicit and keeps each lifecycle in its owning module.
Pages now compose the bundled default plus packages named with
--package; reinitialization records and reuses that selection. Website verification exposes an importable Python journey and an explicit CLI, while the local adapter owns its temporary site, Codex home, process, and cleanup. Hosted website tasks use the normal durable App Server thread contract, and tray coverage remains expressed at the auxiliary-surface boundary.Validation:
uv run pytest tests(1,040 passed)uv run pre-commit run --all-filesnpm run typecheck --prefix workernpm test --prefix worker(60 passed)uv run scripts/verify_site.py local(published revision 2, displayed the reply, and reloaded the changed page)