Repository navigation
Count every public module and its exports in leaf-dev interface - #7435
Merged
Merged
Conversation
…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
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.
leaf-agent
previously approved these changes
Nov 27, 2026
leaf-agent
previously approved these changes
Nov 27, 2026
…ic-modules # Conflicts: # browser/AGENTS.md
…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_
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.
leaf-agent
previously approved these changes
Nov 28, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
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.
…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`.
leaf-agent
approved these changes
Nov 28, 2026
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.
leaf-dev interface --basenow reports the names the Effect UI ports made available to packages. Before this change it read functions fromwidget-api.jsandportable-api.jsalone, 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.jsand/vendor/effect-ui.jsas modules,defineWidget,widgetPropsand the eightwidget-services.jsexports as functions, and Effect UI's 16 exports.The census now reads every module
$public-moduleslists 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 asdata-lf-focus-visible, and the chrome partspackage-themes.mdlists.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, orwidget-api.jsas 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
partnames are its package's, so the census doesn't count them. A function's options count as part of that function, so--basedoesn'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-lifetimeandwidget-ratings-recorded-by-leaf, 12/12 on both arms.