Repository navigation
Conversation
…y one moved A fact no signal carries, such as the page's reading, the threads' placement, a widget's layout, a visual's parts or a stored choice, now has a `version` its owner moves, in place of a function each reading asked again on every read (`reads`). A version whose owner moves it only as it catches up, as the page's watcher and placement do, names its catch-up, which a reading runs as it first reads the version and before it is checked. Every move of any version moves one count, so a reading checked since the last move stands without asking anything. `keptEach` keeps each key's reading on its own, so a version one key read makes that key again and no other: the assertion that an input any item read makes all again now asserts the opposite. A reading takes arguments, compared by identity and two lists by their items, and is read as `read(key, ...args)` rather than `read()(key)`. A reading around a make that threw is made again, as before. Outside any reading, `elementById` no longer catches the page's reading up, since it reads the document directly.
…ptReadings The fold's records and steps are now kept readings (`kept.js`): each thread, message, reaction, widget, obligation and queue row by the served record it is made from and the arguments it is given, each step and index by its arguments, and the whole fold by the seven it reads, so a publication that moves none of them, such as a widget's output or new data, folds nothing. A make sits at module scope and reads only its arguments, so no input list is written by hand: `keptReadings`, `BETWEEN`, `done()` and the readings a thread handed its next reading are gone. Adoption captures message bodies by thread, each thread's kept while its messages' read the same, and a message's plain words are kept while they read the same, so a thread's record stands while its messages do. Admitted projection entries, and a pending undo with its target's id, are kept by what they are made from, so a widget's fold can tell the entries in force on it unchanged by identity: the board test now passes the same entry again, where a new wrapper around the same parts counted as unchanged before. A thread's messages read the workflows serving them from the thread's own workflows, which hold every message's. How it works replaces State → Shared readings with Derived data: the sources, how a change is heard, kept readings, the server's kept readings and the views, and Drawing current state points to it.
…version where it changes The memos keyed by a list (each obligation context's ids, the widgets that ask, the names an obligation's place goes by, a walk list's obligation stops) are `keptEach` readers, and a reading of the vocabulary (`perVocabulary`, the state index) is a `kept` reading of the vocabulary's version, which moves when a reader finds the layer's generation changed and on every reading before the vocabulary loads, as nothing was kept of it then before. The page's version moves where its reading changes: as the page's reading is forgotten, as an id or a part's name changes, and as the vocabulary or a settlement resets the reading, rather than being compared on every catch-up, which every reader of the page runs. A read of a kept reading reuses one list of the catch-ups it has run rather than making one.
# Conflicts: # browser/runtime/anchor-placement.js # browser/runtime/kept.js # browser/runtime/passages.js
leaf-agent
previously approved these changes
Nov 18, 2026
# Conflicts: # browser/runtime/state-application.js
leaf-agent
approved these changes
Nov 18, 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.
The second of the pull requests that bring Leaf's derived data onto one keeping primitive, which max-sixty asked for. It moves the publication fold and the memos written by hand onto
kept/keptEachfrom #6413, and deleteskeptReadings, the reader that kept each record beside an input list written by hand.Each thread, message, reaction, widget, obligation and queue row is now kept by the served record it is made from and the arguments it is given; each step and index of the fold by its arguments; and the whole fold by the seven values it reads, so a publication of a widget's output or new data folds nothing. A make sits at module scope and reads only its arguments, so a record can't read more than it is kept by: the message reading that read
messageBodieswithout listing it now takes its body as an argument. The memos keyed by a list, and the vocabulary's readings, are kept readings too.To weigh:
How it works replaces State → Shared readings with Derived data.
Cost, on
leaf-dev bench --base(Chromium, lowest of 3 rounds): on the threads page at 512 threads a click takes 32.0 ms of main thread against 34.5 and a reply 53.5 against 58.9; a keystroke and a wheel step measure as on main. On the asks page a click, keystroke,mpress, wheel step and reply measure as on main within round-to-round noise.Tests:
pnpm run test:runtime(1,044 pass),pnpm run check:browser,tests/model/test_product_page.py.