Skip to content

Count every public module and its exports in leaf-dev interface - #7435

Merged
max-sixty merged 11 commits into
mainfrom
interface-census-public-modules
Nov 28, 2026
Merged

max-sixty merged 11 commits into
mainfrom
interface-census-public-modules

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

leaf-dev interface --base now reports the names the Effect UI ports made available to packages. Before this change it read functions from widget-api.js and portable-api.js alone, so it reported nothing for them. Run on each port's own commit against its parent, it now reports additions for every one of #7374, #7378, #7397, #7399, #7400 and #7395. For example, against the commit before #7374 it lists /runtime/effect-widget.js, /runtime/widget-services.js and /vendor/effect-ui.js as modules, defineWidget, widgetProps and the eight widget-services.js exports as functions, and Effect UI's 16 exports.

The census now reads every module $public-modules lists outside the library, with each module's exports, including the vendored ones. It also reads every mark any reference gives, which adds 21 documented marks it missed, such as data-lf-focus-visible, and the chrome parts package-themes.md lists.

Root AGENTS.md's "Keep the package interface small" now names the public modules and their exports as part of the interface, and the references that gave Lit as the only way to follow a page reading, or widget-api.js as the only module to import, now name the Effect UI forms too. What the move to Effect UI keeps and retires is left to the guidance change that states Max's call on it.

To weigh: a vendored module's exports count as names, so a Lit bump that adds an export shows as an addition. A widget's own part names are its package's, so the census doesn't count them. A function's options count as part of that function, so --base doesn't list them.

Asked for by Max from the parts-column-scroll page and in the session. Codex reviewed five rounds. Tests: dev/tests/model/test_interface.py, tests/runtime/widget-api.test.mjs. Evals: widget-controller-lifetime and widget-ratings-recorded-by-leaf, 12/12 on both arms.

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

…af-dev interface

`leaf-dev interface --base` now reports the names the Effect UI ports made available to packages. It read functions only from `widget-api.js` and `portable-api.js`, so against the commit before #7374 it reported no addition. It now reports:

```
Modules: adds `/runtime/effect-widget.js`, `/runtime/widget-services.js`, `/vendor/effect-ui.js`
Functions: adds from `/runtime/widget-services.js` `Announce`, `KeepInTab`, `NavigateToDatum`, `NextOnMe`, `OpenThread`, `RecordAction`, `ShowHeld`, `leafServices`; from `/runtime/effect-widget.js` `defineWidget`, `widgetProps`
Vendored exports: adds from `/vendor/effect-ui.js` `BrowserHost`, `Cause`, `Command`, …
```

Run on each port's own commit against its parent, the census reports an addition for every one of #7374, #7378, #7397, #7399, #7400 and #7395.

What the census reads now:

- Modules, a new part: each path `$public-modules` lists outside the library, Leaf's own and vendored.
- Functions: the exports of every Leaf module in that list. `--base` compares each export with each module it comes from, so a function newly re-exported by `portable-api.js` shows as added there.
- Vendored exports, a new part: the names the vendored public modules export, which Leaf's build chooses, such as #7400's `Mount`, `Queue` and `Stream`.
- Marks: every `data-lf-…` name any reference gives, and every attribute `$marks` paints. The census read marks only from the protocol index, so it missed 21 documented marks such as `data-lf-focus-visible`, which three packages use.
- Parts, a new part: the chrome parts `package-themes.md`'s "Leaf's chrome" table lists. A widget's own `part` names are its package's, for pages to style, so the census counts none of them.

Inline code comes from markdown-it tokens and module imports from `javascript_imports`, the readers Leaf already has.

AGENTS.md, "Keep the package interface small", now names the public modules and their exports as part of the interface. module-authoring.md no longer says a widget may import only the library's runtime modules: it names `$public-modules` as the list, with `portable-api.js`, `effect-widget.js` and `widget-services.js`.

Tests: `dev/tests/model/test_interface.py`, `tests/runtime/widget-api.test.mjs`.
leaf-agent
leaf-agent previously approved these changes Nov 27, 2026
…olds both ways until then

Max asked whether the guidance framed the interface's two ways of writing a widget, Lit with `widget-api.js` and Effect UI with `widget-services.js`'s Command services, as a stage on the way to coalescing on Effect UI. It didn't: nothing said why several services repeat a function or event under another name, or which way a new widget takes.

- Root `AGENTS.md`, "Keep the package interface small": Leaf is moving its widgets to Effect UI. A bundled widget Leaf adds or rewrites that draws a view of its own is an Effect UI component, and a name only widgets not yet moved use leaves the interface once its last package or page caller has moved. A new root-guidance situation, `duplicate-names-in-transit`, scores that call: 3/3 on head, 0/3 on base.
- `module-authoring.md` states the move as a fact and keeps both ways described for other authors; it no longer says an Effect UI component's events record, since it records through `RecordAction`. The table's Leaf-only row names both forms.
- Passages that gave Lit as the only way now name both: `browser/AGENTS.md`'s one-view rule and import rule, `module-plain-elements.md` and `module-reading.md` on following page readings, and the headers of `widget-api.ts`, `widget-services.ts` (whose `KeepInTab` drops `tabStore.set`'s result and clears nothing) and `reports.ts`.

Evals: root guidance, 53 situations x3 on both arms, no cell a rule lost; `widget-controller-lifetime` and `widget-ratings-recorded-by-leaf`, 12/12 on both arms.
@max-sixty max-sixty changed the title Count every module a package may import, and what each exports, in leaf-dev interface Count every public module and its exports in leaf-dev interface, and say Leaf's widgets are moving to Effect UI Nov 27, 2026
leaf-agent
leaf-agent previously approved these changes Nov 27, 2026
leaf-agent
leaf-agent previously approved these changes Nov 27, 2026
…ter it

Max said Leaf intends to move everything to Effect UI, and `browser/AGENTS.md`,
"Renderers" (#7461), now states that move, chrome included. Root's paragraph
under "Keep the package interface small" points there instead of restating it,
and says what the interface keeps once the move ends: Lit and `LeafElement`
leave once Leaf's packages and example pages no longer draw with them, while
the protocol's events and the `widget-api.js` functions a Command service
repeats stay, since a plain element or a page script can't issue a Command
service. The earlier text said such a function leaves with its last bundled
caller, which contradicted the rule "Renderers" states; that sentence now
lives in root alone. The rule that a widget Leaf adds or rewrites is an Effect
UI component goes, since "Renderers" makes each port pay for itself and stop
where it can't.

The root-guidance situation becomes `service-and-function-for-one-act`: a
survey that finds `KeepInTab` and `tabStore.set` keeps both after the bundled
`LeafElement` callers are ported. It passes 3/3 on head and 0/3 on base; no
other cell loses a rule (field-editor-keys went 3/3 to 2/3 on a judge reading
unrelated to this paragraph). The final wording passes the five interface
situations 15/15.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty max-sixty changed the title Count every public module and its exports in leaf-dev interface, and say Leaf's widgets are moving to Effect UI Count every public module and its exports in leaf-dev interface, and say which forms the move to Effect UI keeps Nov 28, 2026
leaf-agent
leaf-agent previously approved these changes Nov 28, 2026
…s call

Max has since said every widget, plain ones and other authors' included, is
to be an Effect UI component, and picked no Lit in packages. The paragraph
this branch added said the protocol's events and the widget-api.js functions
a Command service repeats stay after the move, which that call reverses. The
effect-ui-review session's guidance change states the call, so this branch
drops its own statement of the move: the root paragraph, the Renderers bullet
edit, module-authoring.md's sentence on the move and the
service-and-function-for-one-act eval case. The root example of a dependency
Leaf serves is now Effect UI rather than Lit, which is leaving.
@max-sixty max-sixty changed the title Count every public module and its exports in leaf-dev interface, and say which forms the move to Effect UI keeps Count every public module and its exports in leaf-dev interface Nov 28, 2026
leaf-agent
leaf-agent previously approved these changes Nov 28, 2026

@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.

Two wording suggestions inline: in "those $public-modules in the kernel registry … lists", the verb arrives only after the noun phrase and a parenthetical, so the sentence takes a second read.

Comment thread AGENTS.md Resolved
…public modules

The reviewer found that "those `$public-modules` in the kernel registry … lists"
reaches its verb only after the key and a parenthetical, so it takes a second
read. Both passages now say the kernel registry lists them in `$public-modules`.
@max-sixty
max-sixty merged commit 4b21b34 into main Nov 28, 2026
8 checks passed
@max-sixty
max-sixty deleted the interface-census-public-modules branch November 28, 2026 02:19
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