Skip to content

Make Leaf configuration inputs explicit - #642

Merged
max-sixty merged 3 commits into
mainfrom
codex/visual-review-foundation
Sep 12, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/visual-review-foundation

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

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)
  • focused package and tray browser regressions (7 passed)
  • uv run pre-commit run --all-files
  • npm run typecheck --prefix worker
  • npm test --prefix worker (60 passed)
  • uv run scripts/verify_site.py local (published revision 2, displayed the reply, and reloaded the changed page)

This was written by Codex on behalf of max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.css sets lf-options { display: contents }; without it the widget draws as block and the boxless-fallback assertion fails.
  • tests/test_render_options.py::test_local_work_chrome_does_not_take_its_holder_gesture — its .leaf/registry.json gives lf-option an x-work content seat; without it leaf status --on job-mounts exits 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.json declares lf-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.

@max-sixty
max-sixty merged commit 6d6dbf0 into main Sep 12, 2026
7 checks passed
@max-sixty
max-sixty deleted the codex/visual-review-foundation branch September 12, 2026 19:45
max-sixty added a commit that referenced this pull request Sep 12, 2026
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_
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